/* ============================================================
   Enterprise Security Management System - Premium Theme
   ============================================================ */

/* CSS Variables */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary: #475569;
    --secondary-dark: #334155;
    --secondary-light: #64748b;
    --accent: #0ea5e9;
    --accent-dark: #0284c7;
    --accent-light: #7dd3fc;
    --success: #10b981;
    --success-dark: #059669;
    --success-light: #34d399;
    --info: #0ea5e9;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --danger-light: #f87171;
    --dark: #1e293b;
    --darker: #0f172a;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --body-bg: #f4f6fb;
    --card-bg: #ffffff;
    --text-color: #334155;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --sidebar-bg: #161b2c;
    --sidebar-text: #9aa8bd;
    --sidebar-hover: #28314a;
    --sidebar-active: #4f46e5;
    --header-bg: #4f46e5;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --radius: 0.5rem;
    --radius-sm: 0.25rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.2s ease;
    --glass-bg: rgba(255,255,255,0.7);
    --glass-border: rgba(255,255,255,0.2);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.1);
    --bs-border-radius: 0.375rem;
    --bs-border-radius-sm: 0.2rem;
    --bs-border-radius-lg: 0.5rem;
    --bs-btn-border-radius: 0.25rem;
    --bs-btn-border-radius-sm: 0.2rem;
    --bs-btn-border-radius-lg: 0.375rem;
}

[data-theme="dark"] {
    --body-bg: #0f172a;
    --card-bg: #1e293b;
    --text-color: #e2e8f0;
    --text-muted: #64748b;
    --border-color: #334155;
    --sidebar-bg: #020617;
    --sidebar-text: #64748b;
    --sidebar-hover: #1e293b;
    --header-bg: #3730a3;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
    --glass-bg: rgba(30,41,59,0.8);
    --glass-border: rgba(255,255,255,0.05);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Dashboard Theme Scoped Variables */
.dashboard-theme {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary: #475569;
    --secondary-dark: #334155;
    --accent: #0ea5e9;
    --accent-dark: #0284c7;
    --success: #10b981;
    --success-dark: #059669;
    --info: #0ea5e9;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --gray-100: #f8fafc;
    --gray-200: #f1f5f9;
    --gray-300: #e2e8f0;
    --gray-400: #cbd5e1;
    --gray-500: #94a3b8;
    --gray-600: #64748b;
    --body-bg: #f4f6fb;
    --card-bg: #FFFFFF;
    --text-color: #334155;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --sidebar-bg: #161b2c;
    --sidebar-text: #94a3b8;
    --sidebar-hover: #28314a;
    --sidebar-active: #4f46e5;
    --shadow-sm: 0 1px 2px rgba(79,70,229,0.05);
    --shadow: 0 4px 6px rgba(79,70,229,0.06);
    --shadow-lg: 0 10px 25px rgba(79,70,229,0.08);
}

[data-theme="dark"] .dashboard-theme {
    --body-bg: #0f172a;
    --card-bg: #1e293b;
    --text-color: #e2e8f0;
    --text-muted: #64748b;
    --border-color: #334155;
    --sidebar-bg: #020617;
    --sidebar-text: #64748b;
    --sidebar-hover: #1e293b;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
}

body {
    font-family: 'Google Sans Flex', Arial, Helvetica, sans-serif;
    background: var(--body-bg);
    color: var(--text-color);
    font-size: 0.8125rem;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: 200px;
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-collapsed .main-content {
    margin-left: 70px;
}

.page-content {
    flex: 1;
    padding: 1.25rem;
}

body:not(.admin-layout) .page-content {
    padding-top: calc(1.25rem + 96px);
}

.app-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-muted);
    font-family: 'Google Sans Flex', Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.06);
    z-index: 1030;
}

@media print {
    .app-footer {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .app-footer {
        display: none !important;
    }
}

/* Auth Wrapper */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--header-bg);
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    animation: authGlow 15s ease infinite;
}

@keyframes authGlow {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-30px, 20px) rotate(240deg); }
}

.auth-card {
    width: 100%;
    max-width: 450px;
    margin: 1rem;
    position: relative;
    z-index: 1;
}

.auth-card .card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 26px;
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.18),
        0 24px 50px -12px rgba(0, 0, 0, 0.32),
        inset 0 3px 4px rgba(255, 255, 255, 0.55),
        inset 0 -5px 12px rgba(0, 0, 0, 0.08);
    padding: 2.5rem;
}

.auth-card .auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card .auth-logo i {
    font-size: 3rem;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card .auth-logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
    color: var(--dark);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 100vh;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 50%, rgba(0, 0, 0, 0.14) 100%),
        var(--sidebar-bg);
    z-index: 1035;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.06);
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.18),
        inset 0 -4px 10px rgba(0, 0, 0, 0.20),
        inset 0 2px 3px rgba(255, 255, 255, 0.05);
}

.sidebar-collapsed .sidebar {
    width: 80px;
    overflow: visible;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-collapsed .sidebar-body {
    overflow: visible;
    padding: 0.5rem 0 0;
}

.sidebar-collapsed .sidebar-title,
.sidebar-collapsed .menu-arrow,
.sidebar-collapsed .sidebar-footer .menu-text {
    display: none;
}

.sidebar-collapsed .main-content {
    margin-left: 80px;
}

.sidebar-collapsed .menu-link {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.1rem;
    gap: 0;
    border-left: none;
}

.sidebar-collapsed .menu-link .menu-text {
    font-size: 0.58rem;
    line-height: 1.1;
    text-align: center;
    word-break: break-word;
    max-width: 100%;
}

.sidebar-collapsed .menu-link i {
    width: auto;
    font-size: 1.5rem;
    margin: 0;
    color: rgba(255,255,255,0.5);
}

.sidebar-collapsed .menu-link:hover i {
    color: rgba(255,255,255,0.85);
}

.sidebar-collapsed .menu-link.active i {
    color: var(--sidebar-active);
}

.sidebar-collapsed .sidebar-header {
    display: none;
}

.sidebar-collapsed .sidebar-footer .menu-link {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.1rem;
    gap: 0;
    border-left: none;
}

.sidebar-collapsed .sidebar-footer .menu-link .menu-text {
    font-size: 0.58rem;
    line-height: 1.2;
    text-align: center;
}

.sidebar-collapsed .submenu {
    display: none;
}

.sidebar-collapsed .has-submenu:hover > .submenu,
.sidebar-collapsed .has-submenu.open .submenu {
    display: block;
    position: absolute;
    left: 80px;
    top: 0;
    width: 220px;
    background: var(--sidebar-bg);
    border-radius: 0 8px 8px 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    max-height: none;
    z-index: 1040;
    border: 1px solid rgba(255,255,255,0.06);
}

.sidebar-collapsed .submenu-link {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.sidebar-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    min-height: 36px;
}

.sidebar-title {
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.8px;
    font-size: 0.68rem;
    font-weight: 600;
}

.sidebar-toggle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.3) !important;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    color: #fff !important;
}

.sidebar-body {
    flex: 1;
    min-height: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    padding: 0.4rem 0 2rem;
}

.sidebar-main-nav {
    padding: 0.25rem 0;
}

.sidebar-main-nav .menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.78rem;
    border-left: 3px solid transparent;
    border-radius: 10px;
    margin: 0.1rem 0.4rem;
    transition: var(--transition);
}

.sidebar-main-nav .menu-link:hover {
    color: #fff;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
    box-shadow:
        inset 0 1px 1px rgba(255,255,255,0.10),
        inset 0 -2px 4px rgba(0,0,0,0.22);
}

.sidebar-main-nav .menu-link.active {
    color: #fff;
    background:
        linear-gradient(145deg, rgba(79,70,229,0.70) 0%, rgba(49,46,129,0.85) 100%);
    border-left-color: var(--sidebar-active);
    box-shadow:
        0 3px 8px rgba(0,0,0,0.25),
        inset 0 2px 2px rgba(255,255,255,0.25),
        inset 0 -2px 4px rgba(0,0,0,0.25);
}

.sidebar-main-nav .menu-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-main-nav .menu-link .menu-text {
    font-size: 0.78rem;
    white-space: nowrap;
}

.sidebar-divider {
    margin: 0.25rem 1rem;
    border-color: rgba(255,255,255,0.08);
}

.sidebar-body::-webkit-scrollbar {
    width: 5px;
}

.sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

.sidebar-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    position: relative;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.75rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    margin: 0;
}

.menu-link i {
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    color: rgba(255,255,255,0.35);
    transition: var(--transition);
}

.menu-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.menu-link:hover i {
    color: rgba(255,255,255,0.7);
}

.menu-link.active {
    background: linear-gradient(90deg, rgba(79,70,229,0.2), transparent);
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.menu-link.active i {
    color: var(--sidebar-active);
}

.menu-arrow {
    margin-left: auto;
    font-size: 0.65rem;
    transition: var(--transition);
    color: rgba(255,255,255,0.3);
}

.has-submenu.open > .menu-link .menu-arrow {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0,0,0,0.15);
}

.has-submenu.open .submenu {
    max-height: 500px;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 0.2rem 0.4rem 0.2rem 2rem;
    color: rgba(162,163,199,0.7);
    text-decoration: none;
    font-size: 0.72rem;
    transition: var(--transition);
    border-left: 2px solid transparent;
}

.submenu-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.04);
    border-left-color: var(--sidebar-active);
}

.submenu-link.active {
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.sidebar-footer {
    padding: 0.15rem 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-footer .menu-link {
    margin: 0;
    border-left: none;
}

.sidebar-footer .menu-link.text-danger {
    color: rgba(231,76,60,0.7) !important;
}

.sidebar-footer .menu-link.text-danger:hover {
    color: #E74C3C !important;
    background: rgba(231,76,60,0.1);
}

/* Top Navbar */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 72px;
    height: auto;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    z-index: 1040;
    padding: 0 1rem;
    box-shadow: 0 4px 24px rgba(79,70,229,0.3);
    backdrop-filter: blur(20px);
    overflow: visible !important;
}

.top-navbar .navbar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon-sm {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    font-size: 0.95rem;
    color: #fff;
    backdrop-filter: blur(4px);
}

@media (max-width: 1199.98px) {
    /* Sidebar body shown (was hidden) – main nav is now in the mobile drawer */
    .sidebar-body .menu-link { flex-direction: row; gap: 0.75rem; align-items: center; padding: 0.5rem 1rem; }
    .sidebar-body .menu-link .menu-text { font-size: 0.78rem; }
    .sidebar-body .menu-link i { width: 20px; text-align: center; }
    .sidebar-collapsed .sidebar-header { display: flex; }
    .top-navbar .navbar-collapse .navbar-nav { display: none; }
    .top-navbar .navbar-collapse .d-flex.align-items-center { display: flex !important; }
    .sidebar, .sidebar-collapsed .sidebar {
        width: 260px !important;
        max-width: 85vw;
        transform: translateX(-100%);
        overflow-y: auto;
    }
    .sidebar.show, .sidebar-collapsed .sidebar.show {
        transform: translateX(0);
        z-index: 1050;
    }
    .main-content, .sidebar-collapsed .main-content {
        margin-left: 0 !important;
    }
    body.sidebar-mobile-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1049;
    }
}

@media (min-width: 1200px) {
    .top-navbar .navbar-collapse {
        overflow: visible;
    }
    .top-navbar .navbar-nav {
        flex-wrap: wrap;
        gap: 0.05rem;
    }
    .top-navbar .navbar-nav .dropdown-menu {
        position: absolute;
    }
}

@media (max-width: 1400px) {
    .top-navbar .navbar-nav .nav-link { padding: 0.3rem 0.4rem; font-size: 0.62rem; letter-spacing: 0.1px; }
    .top-navbar .navbar-nav .nav-link .nav-label { font-size: 0.52rem; }
    .top-navbar .navbar-nav { gap: 0.02rem; }
}

.top-navbar .navbar-collapse {
    overflow: visible !important;
}

.top-navbar .navbar-nav {
    flex-wrap: wrap;
    gap: 0.05rem;
    padding-bottom: 0;
}

.top-navbar .navbar-nav .nav-link {
    color: rgba(255,255,255,0.85);
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 0.2rem;
}

.top-navbar .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-navbar .navbar-nav .nav-link:hover::after,
.top-navbar .navbar-nav .nav-link.active::after {
    width: 60%;
}

.top-navbar .navbar-nav .nav-link:hover,
.top-navbar .navbar-nav .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.top-navbar .navbar-nav .nav-link.active {
    background: rgba(255,255,255,0.15);
}

.top-navbar .navbar-nav > .nav-item > .nav-link .nav-label {
    font-size: 0.65rem;
    opacity: 0.9;
    vertical-align: middle;
    white-space: nowrap;
}

.top-navbar .nav-item.dropdown {
    position: relative;
}

.top-navbar .navbar-nav .dropdown-menu {
    margin-top: 0.4rem;
    border: none;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(79,70,229,0.15);
    padding: 0.4rem;
    min-width: 180px;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    z-index: 1050;
}

.top-navbar .navbar-nav .dropdown-menu .dropdown-item {
    border-radius: 6px;
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
}

.top-navbar .navbar-nav .dropdown-menu .dropdown-item:hover {
    background: rgba(79,70,229,0.08);
    color: var(--primary);
    transform: translateX(4px);
}

.top-navbar .navbar-nav .dropdown-toggle::after {
    display: none;
}

.top-navbar .dropdown > .dropdown-toggle.active {
    color: #fff;
    background: rgba(255,255,255,0.18);
}

.user-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.3);
}

.avatar-initial {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #E74C3C;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.35rem;
    border-radius: 50%;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(231,76,60,0.4);
}

.notification-dropdown {
    width: 380px;
    max-height: 420px;
    overflow-y: auto;
    padding: 0;
}

.notification-list .notification-item {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.notification-list .notification-item:hover {
    background: var(--gray-100);
}

.notification-list .notification-item.unread {
    background: rgba(79,70,229,0.04);
    border-left: 3px solid var(--primary);
}

/* Cards & Glassmorphism */
.card {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.08) 45%, rgba(0, 0, 0, 0.02) 100%),
        var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.06),
        0 8px 18px -6px rgba(0, 0, 0, 0.14),
        inset 0 2px 2px rgba(255, 255, 255, 0.5),
        inset 0 -2px 6px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
}

.card:hover {
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.08),
        0 14px 26px -8px rgba(0, 0, 0, 0.18),
        inset 0 2px 2px rgba(255, 255, 255, 0.5),
        inset 0 -2px 6px rgba(0, 0, 0, 0.04);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: var(--radius);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card .stat-change {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Gradient backgrounds for stat cards */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
}

.bg-gradient-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.18),
        0 6px 12px -4px rgba(79,70,229,0.45),
        inset 0 2px 2px rgba(255, 255, 255, 0.35),
        inset 0 -2px 4px rgba(0, 0, 0, 0.18);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #312e81);
    transform: translateY(-1px);
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.2),
        0 10px 18px -6px rgba(79,70,229,0.4),
        inset 0 2px 2px rgba(255, 255, 255, 0.35),
        inset 0 -3px 5px rgba(0, 0, 0, 0.18);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    border: none;
    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.15),
        0 6px 12px -4px rgba(0, 0, 0, 0.2),
        inset 0 2px 2px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.16);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    color: #fff;
    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.15),
        0 6px 12px -4px rgba(0, 0, 0, 0.22),
        inset 0 2px 2px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.16);
}

.btn-accent:hover {
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.25);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-group-sm > .btn, .btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
}

/* Forms */
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.05) 60%, rgba(0, 0, 0, 0.02) 100%),
        var(--card-bg);
    color: var(--text-color);
    transition: var(--transition);
    box-shadow:
        inset 0 2px 3px rgba(0, 0, 0, 0.06),
        inset 0 -1px 2px rgba(255, 255, 255, 0.35);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 0.2rem rgba(79,70,229,0.15),
        inset 0 2px 3px rgba(0, 0, 0, 0.06),
        inset 0 -1px 2px rgba(255, 255, 255, 0.35);
}

.form-floating > .form-control:focus ~ label {
    color: var(--primary);
}

.form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
    color: var(--text-color);
}

.input-group-text {
    background: var(--gray-100);
    border-color: var(--border-color);
}

/* Tables */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.3rem 1.5rem 0.3rem 0.5rem;
}

table.dataTable {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

table.dataTable thead th {
    border-bottom: 2px solid var(--border-color);
    background: var(--gray-100);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
}

table.dataTable tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

table.dataTable tbody tr:hover {
    background: rgba(79,70,229,0.02);
}

/* Select2 */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-height: 38px;
}

/* SweetAlert2 */
.swal2-popup {
    border-radius: var(--radius);
}

.swal2-confirm {
    background: var(--primary) !important;
}

/* Avatar Groups */
.avatar-group {
    display: flex;
    align-items: center;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    font-size: 0.875rem;
    background: var(--primary);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h4 {
    font-weight: 700;
    margin: 0;
}

.page-header .breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in {
    animation: slideIn 0.3s ease;
}

.scale-in {
    animation: scaleIn 0.3s ease;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* Profile & Detail Cards */
.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item .detail-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    min-width: 140px;
    flex-shrink: 0;
}

.detail-item .detail-value {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.625rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--card-bg);
}

.timeline-item .timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Chat / Activity Feed */
.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.empty-state h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* File Upload */
.file-upload {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload:hover {
    border-color: var(--primary);
    background: rgba(79,70,229,0.03);
}

.file-upload input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

/* Image Preview */
.image-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.image-preview-sm {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* Map */
.map-container {
    width: 100%;
    height: 400px;
    border-radius: var(--radius);
    overflow: hidden;
}

/* Print */
@media print {
    .sidebar, .top-navbar, .sidebar-toggle, .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .page-content {
        margin-top: 0 !important;
        padding: 0 !important;
    }
}

/* Responsive */
@media (max-width: 1199.98px) {
    .top-navbar {
        padding: 0 0.75rem;
    }
    .top-navbar .navbar-brand {
        font-size: 1rem;
    }
    .brand-icon-sm {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    .top-navbar .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(180deg, var(--primary), var(--primary-dark));
        padding: 1rem 1.25rem;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        z-index: 1050;
    }
    .top-navbar .navbar-nav {
        flex-direction: column;
        gap: 0.15rem;
    }
    .top-navbar .navbar-nav .nav-link {
        padding: 0.7rem 0.85rem;
        white-space: normal;
        font-size: 0.8rem;
    }
    .top-navbar .navbar-nav .nav-link::after {
        display: none;
    }
    .top-navbar .nav-item.dropdown .dropdown-menu {
        position: static !important;
        background: rgba(0,0,0,0.2);
        border: none;
        border-radius: 8px;
        box-shadow: none;
        margin-top: 0.25rem;
        padding: 0.25rem;
        min-width: auto;
        transform: none !important;
    }
    .top-navbar .navbar-nav .dropdown-menu .dropdown-item {
        color: rgba(255,255,255,0.85);
        padding: 0.55rem 0.85rem;
        font-size: 0.78rem;
    }
    .top-navbar .navbar-nav .dropdown-menu .dropdown-item:hover {
        color: #fff;
        background: rgba(255,255,255,0.1);
        transform: none;
    }
    .top-navbar .navbar-nav .dropdown-toggle::after {
        display: inline-block;
        margin-left: auto;
    }
    .top-navbar .navbar-collapse .d-flex.align-items-center {
        flex-direction: row;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        justify-content: flex-end;
    }
    .notification-dropdown {
        width: auto;
        max-width: calc(100vw - 2rem);
    }
    .navbar-collapse .nav-label {
        display: inline !important;
        font-size: inherit;
    }
}

@media (max-width: 991.98px) {
    .top-navbar {
        left: 0;
        z-index: 1051;
    }
    .page-content {
        padding: 1rem;
    }
}

@media (max-width: 767.98px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    .auth-card .card {
        padding: 1.5rem;
    }
    .detail-item {
        flex-direction: column;
        gap: 0.25rem;
    }
    .detail-item .detail-label {
        min-width: auto;
    }
}

@media (max-width: 575.98px) {
    .top-navbar .navbar-collapse {
        top: 60px;
        max-height: calc(100vh - 60px);
    }
    .top-navbar .navbar-nav .nav-link {
        padding: 0.65rem 0.75rem;
        font-size: 0.78rem;
    }
    .top-navbar .navbar-nav .dropdown-menu .dropdown-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    .top-navbar .navbar-brand {
        font-size: 0.9rem;
    }
    .brand-icon-sm {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    .sidebar {
        width: 85vw !important;
        max-width: 300px;
    }
    .sidebar-collapsed .sidebar {
        width: 85vw !important;
        max-width: 300px;
    }
    .notification-dropdown {
        width: calc(100vw - 1.5rem);
        max-width: none;
    }
    .top-navbar .navbar-collapse .d-flex.align-items-center {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

/* Call Monitor Table */
#callMonitorTable th,
#callMonitorTable td {
    vertical-align: middle;
    white-space: nowrap;
    padding: 0.5rem 0.4rem;
    font-size: 0.85rem;
}

#callMonitorTable .btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.45rem;
}

#callMonitorTable .badge {
    font-size: 0.72rem;
}

@media (max-width: 991.98px) {
    #callMonitorTable th,
    #callMonitorTable td {
        padding: 0.4rem 0.3rem;
        font-size: 0.78rem;
    }
}

@media (max-width: 767.98px) {
    #callMonitorTable th,
    #callMonitorTable td {
        font-size: 0.72rem;
        padding: 0.35rem 0.25rem;
    }
    #callMonitorTable .btn {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
}

@media (max-width: 575.98px) {
    #callMonitorTable {
        font-size: 0.68rem !important;
    }
    #callMonitorTable th,
    #callMonitorTable td {
        font-size: 0.68rem;
        padding: 0.3rem 0.2rem;
    }
}

/* Utilities */
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rounded-card {
    border-radius: var(--radius);
}

.cursor-pointer {
    cursor: pointer;
}

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.hover-scale {
    transition: var(--transition);
}

.hover-scale:hover {
    transform: scale(1.02);
}

.z-index-1 { z-index: 1; }

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Nav tabs styling */
.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    color: var(--text-color);
    border-bottom-color: var(--gray-300);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 20px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.50) 0%, rgba(255, 255, 255, 0.06) 50%, rgba(0, 0, 0, 0.02) 100%),
        var(--card-bg);
    box-shadow:
        0 6px 14px rgba(0, 0, 0, 0.18),
        0 18px 40px -10px rgba(0, 0, 0, 0.30),
        inset 0 2px 2px rgba(255, 255, 255, 0.5),
        inset 0 -2px 6px rgba(0, 0, 0, 0.04);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ============================================================
   Dashboard - Premium Enterprise Redesign 2026
   ============================================================ */

/* Dashboard Header */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h4 {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0;
}

.dashboard-header .breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
    font-size: 0.813rem;
}

.dashboard-header .breadcrumb .breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.dashboard-header .breadcrumb .breadcrumb-item a:hover {
    color: var(--primary);
}

.dashboard-header .breadcrumb .breadcrumb-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* KPI Cards */
.kpi-card {
    background: #ffffff;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #E6EAF2);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    height: 120px;
    display: flex;
    align-items: center;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
    transition: var(--transition);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(79,70,229,0.12);
    border-color: transparent;
}

.kpi-card .kpi-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-right: 1rem;
    transition: var(--transition);
}

.kpi-card:hover .kpi-icon-wrap {
    transform: scale(1.05);
}

.kpi-card .kpi-content {
    flex: 1;
    min-width: 0;
}

.kpi-card .kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #7B8A9B;
    color: var(--text-muted, #7B8A9B);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.kpi-card .kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #2C3E50;
    color: var(--text-color, #2C3E50);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.kpi-card .kpi-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.kpi-card .kpi-change {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.kpi-card .kpi-change.up {
    color: var(--success);
    background: rgba(38,194,129,0.1);
}

.kpi-card .kpi-change.down {
    color: var(--danger);
    background: rgba(231,76,60,0.1);
}

.kpi-card .kpi-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* KPI Card Variants */
.kpi-card.blue::before { background: linear-gradient(90deg, var(--info), var(--accent-dark)); }
.kpi-card.blue .kpi-icon-wrap { background: linear-gradient(135deg, rgba(14,165,233,0.12), rgba(14,165,233,0.05)); color: var(--info); }

.kpi-card.purple::before { background: linear-gradient(90deg, var(--primary), var(--primary-dark)); }
.kpi-card.purple .kpi-icon-wrap { background: linear-gradient(135deg, rgba(79,70,229,0.12), rgba(79,70,229,0.05)); color: var(--primary); }

.kpi-card.green::before { background: linear-gradient(90deg, var(--success), var(--success-dark)); }
.kpi-card.green .kpi-icon-wrap { background: linear-gradient(135deg, rgba(22,163,74,0.12), rgba(22,163,74,0.05)); color: var(--success); }

.kpi-card.orange::before { background: linear-gradient(90deg, var(--warning), var(--warning-dark)); }
.kpi-card.orange .kpi-icon-wrap { background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(245,158,11,0.05)); color: var(--warning); }

.kpi-card.red::before { background: linear-gradient(90deg, var(--danger), var(--danger-dark)); }
.kpi-card.red .kpi-icon-wrap { background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.05)); color: var(--danger); }

.kpi-card.cyan::before { background: linear-gradient(90deg, var(--accent), var(--accent-dark)); }
.kpi-card.cyan .kpi-icon-wrap { background: linear-gradient(135deg, rgba(8,145,178,0.12), rgba(8,145,178,0.05)); color: var(--accent); }

/* Dashboard Cards */
.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(79,70,229,0.06);
    transition: all 0.3s ease;
    overflow: hidden;
}

.dashboard-card:hover {
    box-shadow: 0 8px 32px rgba(79,70,229,0.1);
}

.dashboard-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-card .card-header h6 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
}

.dashboard-card .card-header .card-header-action {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.dashboard-card .card-header .card-header-action:hover {
    color: var(--primary-dark);
    transform: translateX(2px);
}

.dashboard-card .card-body {
    padding: 1.25rem;
}

/* Chart Container */
.chart-container {
    position: relative;
    width: 100%;
}

.chart-container canvas {
    max-width: 100%;
}

/* Activity Feed */
.activity-feed {
    padding: 0;
}

.activity-feed .activity-item {
    display: flex;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    align-items: flex-start;
}

.activity-feed .activity-item:last-child {
    border-bottom: none;
}

.activity-feed .activity-item:hover {
    background: rgba(79,70,229,0.03);
}

.activity-feed .activity-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.activity-feed .activity-info {
    flex: 1;
    min-width: 0;
}

.activity-feed .activity-info .activity-name {
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.1rem;
}

.activity-feed .activity-info .activity-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.activity-feed .activity-info .activity-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Event Widget */
.event-widget .event-item {
    display: flex;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    align-items: center;
}

.event-widget .event-item:last-child {
    border-bottom: none;
}

.event-widget .event-item:hover {
    background: rgba(79,70,229,0.03);
}

.event-widget .event-date {
    width: 48px;
    height: 52px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(79,70,229,0.03));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(79,70,229,0.1);
}

.event-widget .event-date .event-day {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.event-widget .event-date .event-month {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-widget .event-info {
    flex: 1;
    min-width: 0;
}

.event-widget .event-info .event-title {
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.1rem;
}

.event-widget .event-info .event-location {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.event-widget .event-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem 0.4rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 80px;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(79,70,229,0.06), rgba(79,70,229,0.02));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79,70,229,0.1);
}

.quick-action-btn .q-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
}

.quick-action-btn:hover .q-icon {
    transform: scale(1.1);
}

.quick-action-btn .q-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    line-height: 1.15;
}

/* Notification Panel */
.notification-panel {
    max-height: 320px;
    overflow-y: auto;
}

.notification-panel .notif-item {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    align-items: flex-start;
}

.notification-panel .notif-item:last-child {
    border-bottom: none;
}

.notification-panel .notif-item:hover {
    background: rgba(79,70,229,0.03);
}

.notification-panel .notif-item.unread {
    background: rgba(79,70,229,0.04);
}

.notification-panel .notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.notification-panel .notif-content {
    flex: 1;
    min-width: 0;
}

.notification-panel .notif-content .notif-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.05rem;
}

.notification-panel .notif-content .notif-time {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.notification-panel .notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 0.35rem;
}

/* Dashboard Row Spacing */
.dashboard-row {
    margin-bottom: 1.25rem;
}

/* Mini Trend Chart */
.mini-trend {
    width: 60px;
    height: 24px;
    display: inline-flex;
    align-items: center;
}

/* Dashboard text colors */
.dashboard-theme .page-content { color: #2C3E50; }

/* Dashboard page header icon */
.page-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: linear-gradient(135deg, rgba(79,70,229,0.1), rgba(79,70,229,0.05));
    color: var(--primary);
}

/* KPI card stagger animation */
.kpi-stagger {
    animation: kpiFadeIn 0.5s ease both;
}

.kpi-stagger:nth-child(1) { animation-delay: 0.05s; }
.kpi-stagger:nth-child(2) { animation-delay: 0.1s; }
.kpi-stagger:nth-child(3) { animation-delay: 0.15s; }
.kpi-stagger:nth-child(4) { animation-delay: 0.2s; }
.kpi-stagger:nth-child(5) { animation-delay: 0.25s; }
.kpi-stagger:nth-child(6) { animation-delay: 0.3s; }

@keyframes kpiFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* KPI Card Responsive */
@media (max-width: 1399.98px) {
    .kpi-card {
        height: 110px;
        padding: 1rem;
    }
    .kpi-card .kpi-value {
        font-size: 1.5rem;
    }
    .kpi-card .kpi-icon-wrap {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        margin-right: 0.75rem;
    }
}

@media (max-width: 767.98px) {
    .kpi-card {
        height: auto;
        padding: 1rem;
    }
    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .dashboard-header h4 {
        font-size: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .quick-actions {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }
    .quick-action-btn {
        padding: 0.6rem 0.35rem;
        min-height: 68px;
    }
    .quick-action-btn .q-icon {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    .quick-action-btn .q-label {
        font-size: 0.6rem;
    }
    .kpi-card .kpi-value {
        font-size: 1.35rem;
    }
    .notification-panel .notif-item {
        padding: 0.65rem 0.85rem;
    }
}

/* ============================================================
   RESPONSIVE — All Admin Pages (Mobile First)
   ============================================================ */

/* Responsive font sizes */
@media (min-width: 768px) {
    .fs-md-4 { font-size: calc(1.275rem + 0.3vw) !important; }
}

/* Roster calendar responsive — class-based compact layout */
#rosterCalendar,
#trashCalendar {
    font-size: 0.9rem;
    width: 100%;
}
#rosterCalendar thead th,
#trashCalendar thead th {
    padding: 12px 6px !important;
    white-space: nowrap;
    vertical-align: middle;
}
.roster-th-client { min-width: 100px; width: 10%; }
.roster-th-sid { min-width: 36px; width: 4%; text-align: center; }
.roster-th-site { min-width: 120px; width: 14%; }
.roster-th-day { min-width: 85px; width: 10.3%; text-align: center; font-size: 0.85rem; }

.roster-td-name { padding: 8px 6px !important; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; }
.roster-td-sid { padding: 8px 4px !important; cursor: pointer; text-align: center; font-size: 0.8rem; }
.roster-td-site { padding: 8px 6px !important; cursor: pointer; }
.roster-td-day { padding: 6px 4px !important; cursor: pointer; text-align: center; font-size: 0.85rem; vertical-align: top; }
.roster-td-empty { color: #aaa; font-size: 0.85rem; vertical-align: middle; }
.roster-badge-t { font-size: 0.6rem; padding: 1px 4px; margin-right: 2px; vertical-align: middle; }
.roster-badge-u { font-size: 0.6rem; padding: 1px 4px; margin-right: 2px; vertical-align: middle; }

@media (max-width: 1199.98px) {
    #rosterCalendar,
    #trashCalendar { font-size: 0.82rem; }
    .roster-th-client { min-width: 80px; }
    .roster-th-site { min-width: 90px; }
    .roster-th-day { min-width: 72px; font-size: 0.78rem; }
    .roster-td-day { font-size: 0.78rem; padding: 4px 3px !important; }
    .roster-td-name { font-size: 0.82rem; }
}
@media (max-width: 991.98px) {
    #rosterCalendar,
    #trashCalendar { font-size: 0.78rem; }
    .roster-th-client { min-width: 65px; }
    .roster-th-site { min-width: 75px; }
    .roster-th-day { min-width: 62px; font-size: 0.72rem; padding: 8px 3px !important; }
    .roster-td-day { font-size: 0.72rem; padding: 3px 2px !important; }
    .roster-td-name { font-size: 0.75rem; }
    .roster-th-sid { width: 3%; min-width: 30px; }
    .roster-td-sid { font-size: 0.7rem; }
}
@media (max-width: 767.98px) {
    .roster-th-sid { display: none; }
    .roster-td-sid { display: none; }
    .roster-th-client { min-width: 55px; width: 15%; font-size: 0.65rem; }
    .roster-th-site { min-width: 60px; width: 20%; font-size: 0.65rem; }
    .roster-th-day { min-width: 50px; font-size: 0.6rem; padding: 6px 2px !important; }
    .roster-td-day { font-size: 0.6rem; padding: 2px 1px !important; }
    .roster-td-name { font-size: 0.65rem; padding: 4px 3px !important; }
    .roster-td-site { font-size: 0.65rem; padding: 4px 3px !important; }
    .roster-badge-t { font-size: 0.5rem; padding: 1px 3px; }
    .roster-badge-u { font-size: 0.5rem; padding: 1px 3px; }
    #rosterCalendar thead th { padding: 6px 2px !important; }
    #trashCalendar thead th { padding: 6px 2px !important; }
}

/* Common admin page patterns */
.card-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.filter-row > * {
    flex: 1 1 auto;
    min-width: 120px;
}
.action-cell {
    white-space: nowrap;
}
.action-cell .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
}
.summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.summary-bar .summary-item {
    flex: 1 1 150px;
}

/* Extra small devices (phones, <576px) */
@media (max-width: 575.98px) {
    .page-content {
        padding: 0.75rem;
    }
    .card-body {
        padding: 1rem;
    }
    .card-header {
        padding: 0.65rem 1rem;
    }
    h4, .h4 {
    font-size: 1.4rem;
    }
    h5, .h5 {
        font-size: 1rem;
    }
    /* Force tables to scroll horizontally */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table.dataTable {
        font-size: 0.8rem;
    }
    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 0.5rem 0.6rem;
        white-space: nowrap;
    }
    .dataTables_wrapper .dataTables_filter input {
        max-width: 140px;
    }
    /* Stack form rows */
    .row.g-3 > [class*="col-"] {
        margin-bottom: 0.5rem;
    }
    /* Buttons full-width in modals */
    .modal-footer .btn {
        flex: 1;
        font-size: 0.85rem;
    }
    .btn-group {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .btn-group .btn {
        border-radius: var(--radius-sm) !important;
        margin: 0;
    }
    /* Cards */
    .card {
        margin-bottom: 0.75rem;
    }
    .stat-card {
        padding: 1rem;
    }
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    .stat-card .stat-label {
        font-size: 0.7rem;
    }
    /* Modals full-screen on mobile */
    .modal-dialog {
        margin: 0.5rem;
    }
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        max-width: calc(100vw - 1rem);
    }
    .modal-body {
        padding: 1rem;
    }
    /* Nav tabs scroll horizontally */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    .nav-tabs .nav-item {
        white-space: nowrap;
    }
    /* Filters bar */
    .filter-bar, [class*="filter-"] {
        flex-direction: column;
        gap: 0.5rem;
    }
    .filter-bar .input-group,
    [class*="filter-"] .input-group {
        width: 100%;
    }
    /* Detail label-value */
    .detail-row {
        flex-direction: column;
        gap: 0.15rem;
    }
    .detail-label {
        min-width: auto;
        font-size: 0.75rem;
    }
    .detail-value {
        font-size: 0.85rem;
    }
    /* Dashboard */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .dashboard-header .d-flex {
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    .dashboard-header .btn {
        font-size: 0.8rem;
        padding: 0.35rem 0.6rem;
    }
    /* Page header with actions */
    .page-header .d-flex {
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    .page-header .btn {
        font-size: 0.8rem;
        padding: 0.35rem 0.6rem;
    }
    /* Search + button bars */
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }
    .d-flex.gap-2 .btn {
        font-size: 0.8rem;
    }
    /* Alerts */
    .alert {
        padding: 0.65rem 0.85rem;
        font-size: 0.85rem;
    }
    /* Auth */
    .auth-card {
        margin: 1rem;
        padding: 0;
    }
    .auth-card .card-body {
        padding: 1.5rem 1rem;
    }
    .auth-card .card-body h4 {
        font-size: 1.1rem;
    }
    /* Select2 */
    .select2-container--bootstrap-5 {
        width: 100% !important;
    }
    /* Flatpickr */
    .flatpickr-calendar {
        max-width: 100vw;
    }
    /* Summary/stat bars */
    .d-flex.gap-3 {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }
    .d-flex.gap-3 > * {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }
    .badge {
        font-size: 0.7rem;
        padding: 0.25em 0.5em;
    }
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.2rem;
    }
    .form-control, .form-select {
        font-size: 0.85rem;
        padding: 0.35rem 0.6rem;
    }
    .input-group-text {
        font-size: 0.85rem;
        padding: 0.35rem 0.6rem;
    }
    .input-group {
        flex-wrap: nowrap;
    }
}

/* Small devices (tablets, 576px–767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .page-content {
        padding: 1rem;
    }
    .card-body {
        padding: 1.25rem;
    }
    .row.g-3 > [class*="col-"] {
        margin-bottom: 0.5rem;
    }
    table.dataTable {
        font-size: 0.85rem;
    }
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        max-width: calc(100vw - 2rem);
    }
    .filter-bar, [class*="filter-"] {
        flex-direction: column;
        gap: 0.5rem;
    }
    .stat-card .stat-value {
        font-size: 1.35rem;
    }
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    .nav-tabs .nav-item {
        white-space: nowrap;
    }
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Medium devices (768px–991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .modal-dialog.modal-xl {
        max-width: calc(100vw - 2rem);
    }
    .row.g-3 > [class*="col-"] {
        margin-bottom: 0.5rem;
    }
    .filter-bar {
        flex-wrap: wrap;
    }
    .stat-card .stat-value {
    font-size: 1.7rem;
    }
}

/* Make card tables scrollable on small screens */
@media (max-width: 767.98px) {
    .card .table:not(.table-responsive) {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* DataTables responsive override — keep table cells visible on small screens */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
}
table.dataTable > tbody > tr.child ul.dtr-details {
    width: 100%;
}
table.dataTable > tbody > tr.child ul.dtr-details > li {
    padding: 0.35rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
table.dataTable > tbody > tr.child ul.dtr-details > li .dtr-title {
    font-weight: 600;
    min-width: 100px;
}
table.dataTable > tbody > tr.child ul.dtr-details > li .dtr-data {
    flex: 1;
}

/* General mobile utilities */
@media (max-width: 575.98px) {
    .mobile-stack {
        flex-direction: column !important;
    }
    .mobile-full {
        width: 100% !important;
    }
    .mobile-hide {
        display: none !important;
    }
    .mobile-text-center {
        text-align: center !important;
    }
}

/* Mobile Bottom Navigation — Modern Glassmorphism + 3D Icons */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(28px) saturate(1.6);
    -webkit-backdrop-filter: blur(28px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 28px;
    z-index: 1050;
    padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
    box-shadow:
        0 2px 16px rgba(0, 0, 0, 0.05),
        0 8px 40px rgba(79,70,229,0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    justify-content: space-around;
    align-items: center;
    margin: 0 auto;
    max-width: 500px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.6rem;
    color: rgba(0, 0, 0, 0.4);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 20px;
    min-width: 48px;
    flex: 1;
    max-width: 80px;
    position: relative;
    transform: translateY(0) perspective(400px) rotateX(0deg);
    cursor: pointer;
    border: none;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.mobile-nav-item i {
    font-size: 1.5rem;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.07));
}

/* ── Active background pill ── */
.mobile-nav-item.active {
    color: var(--primary);
    font-weight: 600;
    transform: translateY(-4px) perspective(400px) rotateX(3deg);
    background: rgba(79,70,229,0.08);
    box-shadow: 0 4px 16px rgba(79,70,229,0.12);
}

.mobile-nav-item.active i {
    color: var(--primary);
    transform: translateY(-3px) scale(1.18);
    filter: drop-shadow(0 4px 10px rgba(79,70,229,0.3));
}

.mobile-nav-item.active span {
    transform: translateY(1px);
    color: var(--primary);
}

/* ── Active indicator glow dot ── */
.mobile-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(79,70,229,0.5);
}

/* ── Tap / hover feedback ── */
.mobile-nav-item:active {
    transform: translateY(2px) perspective(400px) rotateX(-2deg);
    transition-duration: 0.08s;
}

.mobile-nav-item:active i {
    transform: translateY(2px) scale(0.9);
    transition-duration: 0.08s;
}

.mobile-nav-item:hover {
    color: var(--primary);
    background: rgba(79,70,229,0.05);
}

@media (max-width: 767.98px) {
    .mobile-bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: 80px;
    }
    .sidebar, .sidebar-collapsed .sidebar {
        display: none !important;
    }
    .sidebar.show, .sidebar-collapsed .sidebar.show {
        display: flex !important;
        transform: translateX(0) !important;
        width: 260px !important;
        max-width: 85vw;
    }
    .top-navbar .navbar-brand span {
        display: none;
    }
    .top-navbar .navbar-nav {
        display: none !important;
    }
    .top-navbar .navbar-collapse .d-flex.align-items-center {
        display: flex !important;
    }
    .main-content, .sidebar-collapsed .main-content {
        margin-left: 0 !important;
    }
}

/* ── Guard Dashboard Responsive ── */
@media (max-width: 767.98px) {
    .guard-dashboard {
        overflow-x: hidden;
    }
    .guard-dashboard > .row {
        --bs-gutter-x: 0.75rem;
    }
    .guard-dashboard .card-body {
        padding: 0.75rem !important;
    }
    .guard-dashboard .card-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    .guard-dashboard .welcome-card .card-body {
        flex-direction: column !important;
        text-align: center !important;
        gap: 0.5rem;
    }
    .guard-dashboard .welcome-card .text-end {
        text-align: center !important;
    }
    .guard-dashboard h4.mb-1 {
        font-size: 1rem;
    }
    .guard-dashboard h3 {
        font-size: 1.05rem;
    }
    .guard-dashboard .d-flex.justify-content-center.gap-4.mt-3 {
        gap: 0.5rem !important;
        flex-wrap: wrap;
    }
    .guard-dashboard .d-flex.justify-content-center.gap-4.mt-3 strong {
        font-size: 0.85rem;
    }
    .guard-dashboard .list-group-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.25rem;
        padding: 0.5rem 0 !important;
    }
    .guard-dashboard .list-group-item small.d-block {
        font-size: 0.7rem;
        word-break: break-word;
    }
    .guard-dashboard .list-group-item strong {
        font-size: 0.8rem;
    }
    .guard-dashboard .table {
        font-size: 0.65rem;
        width: 100%;
        table-layout: fixed;
    }
    .guard-dashboard .table td,
    .guard-dashboard .table th {
        padding: 0.3rem 0.3rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .guard-dashboard .table th {
        font-size: 0.6rem;
    }
    .guard-dashboard .btn-sm {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
    .guard-dashboard .badge {
        font-size: 0.6rem;
    }
    .guard-dashboard .small.text-muted {
        font-size: 0.65rem !important;
    }
    .guard-dashboard .mb-4 {
        margin-bottom: 0.75rem !important;
    }
    .guard-dashboard .fs-1 {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 575.98px) {
    .guard-dashboard > .row {
        --bs-gutter-x: 0.5rem;
    }
    .guard-dashboard .card-body {
        padding: 0.5rem !important;
    }
    .guard-dashboard .card-header {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
    .guard-dashboard h3 {
        font-size: 0.95rem;
    }
    .guard-dashboard .table {
        font-size: 0.6rem;
    }
    .guard-dashboard .table td,
    .guard-dashboard .table th {
        padding: 0.25rem 0.2rem;
    }
    .guard-dashboard .table th {
        font-size: 0.55rem;
    }
    .guard-dashboard .btn-sm {
        font-size: 0.6rem;
        padding: 0.12rem 0.35rem;
    }
    .guard-dashboard .badge {
        font-size: 0.55rem;
        padding: 0.2em 0.4em;
    }
    .guard-dashboard .list-group-item small.d-block {
        font-size: 0.65rem;
    }
    .guard-dashboard .d-flex.justify-content-center.gap-4.mt-3 {
        gap: 0.4rem !important;
    }
    .guard-dashboard .d-flex.justify-content-center.gap-4.mt-3 strong {
        font-size: 0.75rem;
    }
}

/* ══════════════════════════════════════════════
   NEW HEADER (replaces old top-navbar for admin)
   ══════════════════════════════════════════════ */

.top-header {
    position: sticky;
    top: 0;
    width: 100%;
    height: 96px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.02) 38%, rgba(0, 0, 0, 0.08) 100%),
        var(--header-bg);
    border-radius: 0 0 28px 28px;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.20),
        0 12px 28px rgba(0, 0, 0, 0.22),
        inset 0 2px 3px rgba(255, 255, 255, 0.22),
        inset 0 -4px 10px rgba(0, 0, 0, 0.28);
    z-index: 1045;
    flex-shrink: 0;
    user-select: none;
}

/* Admin layout: header spans full width above sidebar */
.admin-layout .top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}

.admin-layout .sidebar {
    top: 96px;
    height: calc(100vh - 96px);
}

.admin-layout .main-content {
    padding-top: 96px;
}

.header-inner {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 12px 0 0;
    max-width: 1600px;
    margin: 0 auto;
}

/* ── Sidebar toggle (mobile) ── */
.sidebar-toggle-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    padding: 2px 6px 2px 0;
    cursor: pointer;
    flex-shrink: 0;
}
@media (max-width: 1199.98px) {
    .sidebar-toggle-btn { display: flex; }
}

/* ── Logo ── */
.logo {
    flex-shrink: 0;
    margin-right: 16px;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    width: 175px;
    height: auto;
    display: block;
}

.super-logo {
    width: 175px;
    height: auto;
    display: block;
}

/* ── Logo hover animation (bubbles + shine + glow) ── */
.logo {
    position: relative;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo:hover {
    transform: scale(1.05);
}

/* wordmark text logo */
.logo-word {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    font-size: 1.55rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
    text-shadow:
        0 2px 0 rgba(55, 48, 163, 0.55),
        0 4px 14px rgba(0, 0, 0, 0.35);
    transition: filter 0.45s ease;
}

.logo-word-accent {
    color: #c7d2fe;
}

.logo:hover .logo-word {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.45)) drop-shadow(0 6px 14px rgba(20, 16, 90, 0.35));
}

/* soft glow pool under the logo */
.logo::after {
    content: '';
    position: absolute;
    left: 4%;
    right: 4%;
    bottom: -14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.6), transparent 70%);
    opacity: 0;
    transform: scaleX(0.55);
    filter: blur(5px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.logo:hover::after {
    opacity: 1;
    transform: scaleX(1);
}

/* diagonal shine sweep across the wordmark */
.logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -130%;
    width: 55%;
    height: 100%;
    background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.22) 45%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0.22) 55%, transparent 100%);
    transform: skewX(-22deg);
    pointer-events: none;
    z-index: 3;
}

.logo:hover::before {
    animation: logoShine 0.9s ease-in-out forwards;
}

@keyframes logoShine {
    0%   { left: -130%; }
    100% { left: 140%; }
}

/* radar ring pulse around the logo */
.logo-ring {
    position: absolute;
    inset: -8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 18px;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}

.logo:hover .logo-ring {
    animation: logoPulse 1.1s ease-out infinite;
}

@keyframes logoPulse {
    0%   { transform: scale(1); opacity: 0.75; }
    100% { transform: scale(1.18); opacity: 0; }
}

/* rising bubbles over the logo */
.bub {
    position: absolute;
    bottom: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.25) 55%, rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 -2px 4px rgba(255, 255, 255, 0.25);
    opacity: 0;
    transform: translateY(0) scale(0.5);
    pointer-events: none;
    z-index: 4;
}

.bub-1 { left: 16%; }
.bub-2 { left: 42%; animation-delay: 0.25s; }
.bub-3 { left: 62%; animation-delay: 0.12s; }
.bub-4 { left: 82%; animation-delay: 0.38s; }

.logo:hover .bub-1 { animation: bubFloat 1.5s ease-out 0s infinite; }
.logo:hover .bub-2 { animation: bubFloat 1.5s ease-out 0.25s infinite; }
.logo:hover .bub-3 { animation: bubFloat 1.5s ease-out 0.12s infinite; }
.logo:hover .bub-4 { animation: bubFloat 1.5s ease-out 0.38s infinite; }

@keyframes bubFloat {
    0%   { transform: translateY(0) translateX(0) scale(0.55); opacity: 0; }
    10%  { opacity: 0.95; }
    35%  { transform: translateY(-14px) translateX(3px) scale(0.9); opacity: 0.8; }
    70%  { transform: translateY(-32px) translateX(-4px) scale(1.05); opacity: 0.45; }
    100% { transform: translateY(-52px) translateX(2px) scale(1.2); opacity: 0; }
}

/* ── Desktop Nav ── */
.main-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1px;
    height: 100%;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 4px 8px;
    min-width: 60px;
    height: 54px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.78);
    border-radius: 8px;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    cursor: pointer;
    position: relative;
}

.nav-item i {
    font-size: 1.55rem;
    line-height: 1;
    transition: transform 0.2s;
}

.nav-item span {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-item:hover i {
    transform: scale(1.08);
}

.nav-item.active {
    color: #fff;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    background: #fff;
    border-radius: 3px;
}

/* ── Nav item label row (text + caret) ── */
.nav-item-label {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-caret {
    font-size: 0.55rem;
    transition: transform 0.2s;
}

.nav-item-wrapper:hover .nav-caret {
    transform: rotate(180deg);
}

/* ── Dropdown (hover) ── */
.nav-item-wrapper {
    position: relative;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 6px;
    min-width: 155px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1060;
}

.nav-item-wrapper:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: #2C3E50;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.nav-dropdown-item i {
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
    color: var(--primary);
}

.nav-dropdown-item:hover {
    background: #f0f2f7;
    color: var(--primary);
}

/* ── Profile ── */
.profile {
    flex-shrink: 0;
    margin-left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    height: 38px;
}

.profile-sa-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.2);
    text-decoration: none;
    transition: background 0.2s;
    flex-shrink: 0;
}
.profile-sa-link:hover {
    background: rgba(255, 215, 0, 0.35);
}

.profile-chat-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    position: relative;
    font-size: 1.1rem;
}
.profile-chat-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Theme Toggle (claymorphism) ── */
.theme-toggle-btn,
.mobile-theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    color: #fff;
    font-size: 1.1rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.10) 45%, rgba(0, 0, 0, 0.16) 100%);
    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.22),
        0 6px 12px rgba(0, 0, 0, 0.18),
        inset 0 2px 2px rgba(255, 255, 255, 0.35),
        inset 0 -3px 5px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.theme-toggle-btn:hover,
.mobile-theme-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.25),
        0 10px 18px rgba(0, 0, 0, 0.20),
        inset 0 2px 2px rgba(255, 255, 255, 0.4),
        inset 0 -3px 5px rgba(0, 0, 0, 0.22);
}
.theme-toggle-btn:active,
.mobile-theme-btn:active {
    transform: translateY(1px);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 3px 6px rgba(0, 0, 0, 0.28),
        inset 0 -1px 2px rgba(255, 255, 255, 0.12);
}
.mobile-theme-btn {
    width: 32px;
    height: 32px;
    font-size: 1.05rem;
}
.mobile-theme-btn.d-xl-none {
    margin-left: 8px;
}

@media (min-width: 993px) and (max-width: 1199.98px) {
    .mobile-theme-btn.d-xl-none { display: none; }
}
@media (max-width: 992px) {
    .mobile-theme-btn.d-xl-none { display: flex; }
}
.chat-badge {
    position: absolute;
    top: -2px;
    right: -3px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    pointer-events: none;
}
.nav-item .chat-badge {
    position: static;
    margin-left: 4px;
    min-width: 14px;
    height: 14px;
    font-size: 0.5rem;
    display: inline-flex;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

.profile-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.profile-signout {
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: color 0.2s;
    text-decoration: none;
}

.profile-signout:hover {
    color: #fff;
}

.profile-role {
    font-size: 0.58rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.3px;
}

/* ── Hamburger (mobile) ── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    background: none;
    border: none;
    margin-left: auto;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: #fff;
    border-radius: 2px;
    transition: 0.25s;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile Drawer ── */
.mobile-drawer {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--header-bg);
    z-index: 1040;
    padding: 0 16px 24px;
    overflow-y: auto;
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.mobile-drawer.open {
    transform: translateY(0);
    opacity: 1;
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 6px;
}

.drawer-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.drawer-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}

.drawer-close:hover {
    color: #fff;
}

.mobile-drawer .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 10px 14px;
    height: auto;
    min-width: 0;
    width: 100%;
    border-radius: 8px;
}

.mobile-drawer .nav-item i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.mobile-drawer .nav-item span {
    font-size: 0.78rem;
    white-space: nowrap;
}

.mobile-drawer .nav-item.active::after {
    display: none;
}

.mobile-drawer .nav-item.active {
    background: rgba(255, 255, 255, 0.12);
}

.drawer-footer {
    margin-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

.drawer-footer .nav-item {
    color: rgba(255, 255, 255, 0.65);
}

/* ── Responsive header ── */

@media (max-width: 1400px) {
    .nav-item {
        padding: 3px 7px;
        min-width: 54px;
        height: 48px;
    }

    .nav-item i {
        font-size: 1.35rem;
    }

    .nav-item span {
        font-size: 0.6rem;
        letter-spacing: 0.2px;
    }

    .logo-indel { font-size: 1.2rem; }
    .logo-security { font-size: 1rem; }
    .logo { margin-right: 10px; }
}

@media (max-width: 1200px) {
    .header-inner {
        padding: 0 12px 0 0;
    }

    .logo { margin-right: 10px; }
    .logo-word { font-size: 1.32rem; }

    .nav-item {
        padding: 3px 6px;
        min-width: 46px;
        height: 44px;
    }

    .nav-item i {
        font-size: 1.2rem;
    }

    .nav-item span {
        font-size: 0.55rem;
        letter-spacing: 0.1px;
    }

    .nav-item.active::after {
        width: 14px;
        height: 2px;
    }

    .profile {
        margin-left: 10px;
        padding-left: 10px;
        gap: 6px;
    }

    .profile-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .profile-signout {
        font-size: 0.6rem;
    }

    .profile-role {
        font-size: 0.52rem;
    }
}

@media (max-width: 992px) {
    .top-header {
        height: 66px;
        border-radius: 0 0 18px 18px;
    }

    .header-inner {
        padding: 0 8px 0 0;
    }

    .main-nav {
        display: none;
    }

    .profile {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .sidebar-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .admin-layout .sidebar {
        top: 66px;
        height: calc(100vh - 66px);
    }

    .mobile-drawer {
        top: 66px;
    }

    .logo-word { font-size: 1.14rem; }
}

@media (min-width: 993px) {
    .mobile-drawer {
        display: none !important;
    }
}

body.drawer-open {
    overflow: hidden;
}

/* ── Print ── */
/* ── Mobile page-content reduction ── */
@media (max-width: 767.98px) {
    .page-content {
        padding: 0.75rem !important;
    }
}

@media (max-width: 575.98px) {
    .page-content {
        padding: 0.5rem !important;
    }
}

@media print {
    .top-header {
        display: none !important;
    }
}

/* Print */
@media print {
    .sidebar,
    .top-navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .page-content {
        padding: 0 !important;
    }
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}

@media (max-width: 1000px) {
    .super-logo { width: 130px; }
}

@media (max-width: 768px) {
    .super-logo { width: 115px; }
}

