/* assets/css/custom.css - FULL VMS STYLE (FIXED SOS BUTTON & COMPACT FONT) */

/* 1. IMPORT FONT INTER */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* 2. GLOBAL SETTINGS */
:root {
    --primary-purple: #6a11cb;
    --sidebar-width: 260px;
    --font-main: 'Inter', sans-serif;
    --bg-body: #f4f6f8;
}

body {
    font-family: var(--font-main) !important;
    background-color: var(--bg-body);
    color: #495057;
    -webkit-font-smoothing: antialiased;
    font-size: 0.9rem; /* Saiz font global kecil sikit (Compact) */
}

/* 3. SIDEBAR STYLES (KEKAL) */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    background: linear-gradient(160deg, #6a11cb 0%, #2575fc 100%);
    z-index: 1000;
    border-right: none;
    display: flex; flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 4px 0 15px rgba(106, 17, 203, 0.2);
    color: white;
}

.sidebar-brand {
    padding: 20px;
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.05);
}

.brand-icon {
    width: 40px; height: 40px;
    background: white;
    color: #6a11cb;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.brand-text-container { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-size: 1.3rem; font-weight: 800; color: white; letter-spacing: 0.5px; }
.brand-subtitle { font-size: 0.6rem; font-weight: 400; color: rgba(255, 255, 255, 0.8); text-transform: uppercase; margin-top: 2px; }

.sidebar-menu { padding: 15px 12px; flex-grow: 1; overflow-y: auto; }

.menu-header { 
    font-size: 0.65rem; font-weight: 700; color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase; margin: 15px 0 5px 15px; letter-spacing: 1px;
}

.nav-item { margin-bottom: 3px; }

.nav-link {
    display: flex; align-items: center; padding: 10px 18px;
    color: rgba(255, 255, 255, 0.85) !important; text-decoration: none !important;
    font-weight: 500; font-size: 0.9rem; border-radius: 10px; transition: all 0.2s; margin-bottom: 4px;
}

.nav-link i { width: 22px; font-size: 1rem; text-align: center; margin-right: 10px; color: rgba(255, 255, 255, 0.7); }
.nav-link:hover { background-color: rgba(255, 255, 255, 0.15) !important; color: white !important; transform: translateX(3px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.nav-link:hover i { color: white; }
.nav-link.active { background-color: white !important; color: #6a11cb !important; font-weight: 700; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.nav-link.active i { color: #6a11cb !important; }

.user-profile {
    padding: 12px 15px; margin: 12px; background: rgba(0, 0, 0, 0.2); border-radius: 14px;
    display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,0.1); color: white;
}
.avatar-circle { width: 35px; height: 35px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #6a11cb; font-size: 0.85rem; }
.user-profile h6 { font-size: 0.85rem; margin: 0; font-weight: 600; }
.user-profile .text-muted { color: rgba(255,255,255,0.6) !important; font-size: 0.7rem; }
.user-profile a { color: #ffcccc !important; font-size: 0.8rem; }
.user-profile a:hover { color: #ff4d4d !important; }

/* 4. MAIN CONTENT WRAPPER */
.main-content { 
    margin-left: var(--sidebar-width); padding: 15px 30px; transition: all 0.3s ease;
    min-height: 100vh; padding-top: 15px;
}

/* 5. SIDEBAR COLLAPSED */
.sidebar.collapsed { width: 70px; }
.sidebar.collapsed .brand-text-container, .sidebar.collapsed .menu-header, .sidebar.collapsed .nav-link span, .sidebar.collapsed .user-profile div, .sidebar.collapsed .user-profile a { display: none !important; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 15px 0; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 12px 0; }
.sidebar.collapsed .nav-link i { margin-right: 0; font-size: 1.2rem; }
.sidebar.collapsed .user-profile { justify-content: center; padding: 10px 0; }
.main-content.expanded { margin-left: 70px; }

.sidebar-toggle-btn { 
    position: absolute; right: -12px; top: 25px; width: 26px; height: 26px; background: white; 
    color: #6a11cb; border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    cursor: pointer; border: 2px solid #eef2f6; z-index: 1001; box-shadow: 0 2px 5px rgba(0,0,0,0.2); transition: 0.3s; font-size: 0.8rem;
}
.sidebar-toggle-btn:hover { background: #f0f0f0; color: #2575fc; }

/* 6. GENERAL UI */
.navbar-brand { color: #fff !important; }
.animate-up { animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; opacity: 0; transform: translateY(15px); }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
.delay-1 { animation-delay: 0.1s; } .delay-2 { animation-delay: 0.2s; } .delay-3 { animation-delay: 0.3s; }

/* WELCOME CARD (FIXED ALIGNMENT) */
.welcome-card { 
    background: white; border-radius: 12px; padding: 15px 25px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-bottom: 20px; 
    display: flex; justify-content: space-between; align-items: center; 
    border-left: 4px solid #6a11cb; height: 100%;
}
.welcome-name { color: #2c3e50; font-weight: 700; text-transform: capitalize; font-size: 1.1rem; }
.badge-location { background: #f3e8fd; color: #6a11cb; font-weight: 700; padding: 5px 12px; border-radius: 30px; font-size: 0.75rem; display: inline-flex; align-items: center; margin-top: 4px; }
.clock-box { text-align: right; border-right: 1px solid #eee; padding-right: 20px; margin-right: 20px; }
.live-time { font-size: 1.4rem; font-weight: 800; color: #333; line-height: 1; }
.live-date { font-size: 0.7rem; color: #888; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* --- SOS BUTTON (FIXED DESIGN) --- */
.btn-sos { 
    background: #fee2e2; color: #dc2626; font-weight: 800; 
    padding: 10px 20px; border-radius: 50px; border: 1px solid #fecaca; 
    display: inline-flex; align-items: center; gap: 8px; 
    text-decoration: none; font-size: 0.85rem; box-shadow: 0 4px 10px rgba(220, 38, 38, 0.15); 
    transition: all 0.3s ease; white-space: nowrap; line-height: 1.2;
}
.btn-sos:hover { background: #dc2626; color: white; transform: translateY(-2px); border-color: #dc2626; }
.pulse-icon { animation: pulse-red 1.5s infinite; }
@keyframes pulse-red { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } }

/* COLORFUL CARDS */
.kpi-card-colorful { border-radius: 14px; padding: 20px; height: 100%; min-height: 120px; color: white; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 8px 15px rgba(0,0,0,0.1); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.kpi-card-colorful:hover { transform: translateY(-4px); box-shadow: 0 12px 25px rgba(0,0,0,0.15); }
.bg-gradient-blue { background: linear-gradient(45deg, #007bff, #00c6ff); }
.bg-gradient-green { background: linear-gradient(45deg, #28a745, #85e085); }
.bg-gradient-purple { background: linear-gradient(45deg, #6f42c1, #a64dff); }
.bg-gradient-red { background: linear-gradient(45deg, #dc3545, #ff6b6b); }
.bg-gradient-info { background: linear-gradient(45deg, #17a2b8, #66d9e8); }
.kpi-content h3 { font-size: 2.2rem; font-weight: 800; margin-bottom: 4px; line-height: 1; }
.kpi-content p { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; opacity: 0.9; margin: 0; letter-spacing: 0.5px; }
.kpi-bg-icon { position: absolute; right: 10px; bottom: 5px; font-size: 4rem; opacity: 0.15; transform: rotate(-15deg); z-index: 1; transition: 0.3s; }

/* MENU CARDS */
.section-header { font-size: 0.75rem; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; display: block; border-left: 3px solid #6a11cb; padding-left: 10px; }
.menu-card { background: white; border: 1px solid #f1f3f5; border-radius: 12px; padding: 20px 15px; text-align: center; height: 100%; min-height: 160px; transition: 0.3s; box-shadow: 0 3px 8px rgba(0,0,0,0.02); display: flex; flex-direction: column; justify-content: center; align-items: center; }
.menu-card:hover { transform: translateY(-4px); border-color: #6a11cb; box-shadow: 0 8px 20px rgba(106, 17, 203, 0.1); }
.menu-icon { width: 45px; height: 45px; margin-bottom: 12px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.menu-title { font-weight: 700; font-size: 0.9rem; color: #333; margin-bottom: 4px; }
.menu-desc { font-size: 0.75rem; color: #777; line-height: 1.3; }
.menu-link { text-decoration: none; color: inherit; height: 100%; display: block; }

/* ACTIVITY FEED */
.card-activity { background: white; border-radius: 12px; border: 1px solid #f1f3f5; box-shadow: 0 4px 15px rgba(0,0,0,0.02); height: 600px; overflow: hidden; display: flex; flex-direction: column; }
.scroll-window { flex-grow: 1; overflow: hidden; position: relative; }
.scroll-content { animation: scroll 40s linear infinite; }
.scroll-window:hover .scroll-content { animation-play-state: paused; }
@keyframes scroll { 0% { transform: translateY(0); } 100% { transform: translateY(-50%); } }
.activity-item { padding: 12px 15px; border-bottom: 1px solid #f8f9fa; display: flex; align-items: center; justify-content: space-between; transition: 0.2s; }
.activity-item:hover { background-color: #fcfcfc; }
.icon-status-circle { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 12px; flex-shrink: 0; font-size: 0.9rem; }
.status-in { background: #dcfce7; color: #16a34a; }
.status-out { background: #fee2e2; color: #dc2626; }
.activity-info { min-width: 0; flex-grow: 1; margin-right: 10px; }
.visitor-name { font-weight: 700; color: #334155; font-size: 0.8rem; display: block; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visit-cat { font-size: 0.65rem; color: #94a3b8; text-transform: uppercase; font-weight: 600; }
.badge-time { font-size: 0.65rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; width: 70px; text-align: center; flex-shrink: 0; }
.bt-in { background: #f0fdf4; color: #15803d; border: 1px solid #dcfce7; }
.bt-out { background: #fef2f2; color: #b91c1c; border: 1px solid #fee2e2; }

/* GRID SYSTEM 5 COLUMN */
@media (min-width: 1400px) { .row-cols-xxl-5 > * { flex: 0 0 auto; width: 20%; } .col-xl-20 { flex: 0 0 auto; width: 20%; } }

/* DROPDOWN & LANGUAGE */
.nav-link.dropdown-toggle::after { display: none; }
.arrow-icon { font-size: 0.75rem !important; transition: transform 0.3s ease; width: auto !important; margin-right: 0 !important; color: rgba(255, 255, 255, 0.5) !important; }
.nav-link[aria-expanded="true"] .arrow-icon { transform: rotate(180deg); }
.sub-menu { background: rgba(0, 0, 0, 0.15); border-radius: 10px; margin: 2px 0 5px 0; padding: 5px 0; }
.sub-link { display: block; padding: 6px 15px 6px 45px; color: rgba(255, 255, 255, 0.7); text-decoration: none; font-size: 0.8rem; font-weight: 400; transition: all 0.2s; position: relative; }
.sub-link::before { content: ''; position: absolute; left: 25px; top: 50%; width: 5px; height: 5px; background: rgba(255,255,255,0.3); border-radius: 50%; transform: translateY(-50%); }
.sub-link:hover { color: white; background: rgba(255, 255, 255, 0.05); }
.sub-link.active { color: #fff; font-weight: 700; }
.sub-link.active::before { background: #fff; box-shadow: 0 0 5px rgba(255,255,255,0.8); }
.sidebar.collapsed .arrow-icon, .sidebar.collapsed .collapse { display: none !important; }
.lang-switch-container { display: flex; justify-content: center; gap: 8px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); margin-top: auto; }
.lang-btn { font-size: 0.7rem; font-weight: 700; color: rgba(255, 255, 255, 0.6); text-decoration: none; padding: 2px 6px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 4px; transition: 0.3s; }
.lang-btn:hover { color: white; border-color: white; }
.lang-btn.active { background: white; color: #6a11cb; border-color: white; }
.sidebar.collapsed .lang-switch-container { display: none; }

/* LOGIN PAGE */
.login-body { background: #e9ecef; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; font-family: var(--font-main) !important; }
.login-container { background: #fff; border-radius: 20px; box-shadow: 0 15px 35px rgba(0,0,0,0.1); overflow: hidden; width: 100%; max-width: 900px; min-height: 550px; }
.login-left-side, .login-right-side { background: linear-gradient(160deg, #6a11cb 0%, #2575fc 100%); position: relative; overflow: hidden; }
.login-brand-icon { width: 70px; height: 70px; background: rgba(255, 255, 255, 0.1); border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; color: white; margin: 0 auto; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.2); }
.bg-shape { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.05); }
.shape-1 { width: 300px; height: 300px; top: -80px; left: -80px; }
.shape-2 { width: 250px; height: 250px; bottom: -40px; right: -40px; }
.login-form-box { width: 100%; max-width: 400px; position: relative; z-index: 2; }
.input-group-glass { background: rgba(255, 255, 255, 0.1); border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.2); overflow: hidden; transition: all 0.3s; }
.input-group-glass:focus-within { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.5); box-shadow: 0 0 15px rgba(255,255,255,0.1); }
.input-group-glass .input-group-text { background: transparent; border: none; color: rgba(255, 255, 255, 0.7); padding-left: 15px; }
.input-group-glass .form-control { background: transparent; border: none; color: white !important; padding: 12px; font-weight: 500; font-size: 0.9rem; }
.input-group-glass .form-control::placeholder { color: rgba(255, 255, 255, 0.5); }
.btn-glass-toggle { background: transparent; border: none; color: rgba(255, 255, 255, 0.6); padding-right: 15px; transition: 0.3s; }
.btn-glass-toggle:hover { color: white; }
.btn-white-primary { background: white; color: #6a11cb; border: none; transition: all 0.3s; font-size: 0.9rem; padding: 10px; border-radius: 8px; font-weight: 700; }
.btn-white-primary:hover { background: #f8f9fa; transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important; }
.alert-danger-soft { background: rgba(220, 53, 69, 0.2); color: #ffcdd2; border: 1px solid rgba(220, 53, 69, 0.3); border-radius: 10px; font-size: 0.85rem; padding: 10px; }
.text-white-50 { color: rgba(255, 255, 255, 0.6) !important; font-size: 0.85rem; }

/* OVERLAY (MOBILE) */
.overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 999; }
.overlay.active { display: block; }