:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --primary-bg: #eef2ff;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --dark: #0f1729;
    --darker: #0a0f1a;
    --sidebar-bg: #0f1729;
    --sidebar-text: #94a3b8;
    --sidebar-active: #4f46e5;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 70px;
    --bg-primary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --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.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--secondary); }

/* ===== APP WRAPPER ===== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    height: var(--topbar-height);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    overflow: hidden;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-icon i {
    font-size: 20px;
    color: white;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 16px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.brand-sub {
    font-size: 10px;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-toggle:hover { background: rgba(255,255,255,0.1); color: white; }

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.nav-section {
    margin-bottom: 4px;
}

.nav-section-title {
    display: block;
    padding: 8px 24px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--sidebar-text);
    opacity: 0.5;
    font-weight: 600;
}

.sidebar.collapsed .nav-section-title { display: none; }

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    margin: 2px 8px;
    border-radius: var(--radius-sm);
}

.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.nav-item.active .nav-link {
    color: white;
    background: rgba(79, 70, 229, 0.15);
    border-left-color: var(--primary);
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar.collapsed .nav-link span { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 12px; margin: 2px 12px; }
.sidebar.collapsed .nav-link i { margin: 0; }

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--sidebar-text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    width: 100%;
    font-size: 13px;
    transition: var(--transition);
}

.theme-toggle:hover { background: rgba(255,255,255,0.1); color: white; }

.sidebar.collapsed .theme-toggle span { display: none; }
.sidebar.collapsed .theme-toggle { justify-content: center; }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

/* ===== TOPBAR ===== */
.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1040;
}

.topbar-left {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 500px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-box .global-search {
    padding-left: 40px;
    height: 44px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    font-size: 14px;
    transition: var(--transition);
}

.search-box .global-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.topbar-right { display: flex; align-items: center; gap: 8px; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover { background: var(--bg-primary); color: var(--primary); }

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.user-btn:hover { background: var(--bg-primary); }

.user-btn::after { display: none; }

.user-avatar { flex-shrink: 0; }

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== NOTIFICATION DROPDOWN ===== */
.notification-menu {
    width: 360px;
    padding: 0;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-top: 8px !important;
}

.notification-menu .dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.notification-list { max-height: 350px; overflow-y: auto; }

.notification-item {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.notification-item:hover { background: var(--bg-primary); }
.notification-item.unread { background: var(--primary-bg); }

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--primary-bg);
    color: var(--primary);
}

.notification-content { flex: 1; }
.notification-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; color: var(--text-primary); }
.notification-time { font-size: 11px; color: var(--text-muted); }

.notification-menu .dropdown-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
}

/* ===== PAGE CONTENT ===== */
.page-content {
    flex: 1;
    padding: 24px 30px;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-title small {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

/* ===== GLASS CARD ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
}

.card-body { padding: 20px; }
.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
}

/* ===== STATS CARDS ===== */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card .stat-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.stat-card .stat-change.positive { color: var(--success); }
.stat-card .stat-change.negative { color: var(--danger); }

.stat-card .stat-bg-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 80px;
    opacity: 0.05;
}

.stat-icon.primary { background: var(--primary-bg); color: var(--primary); }
.stat-icon.success { background: #d1fae5; color: var(--success); }
.stat-icon.warning { background: #fef3c7; color: var(--warning); }
.stat-icon.danger { background: #fee2e2; color: var(--danger); }
.stat-icon.info { background: #cffafe; color: var(--info); }

/* ===== BUTTONS ===== */
.btn {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-success { background: var(--success); border-color: var(--success); }
.btn-warning { background: var(--warning); border-color: var(--warning); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-info { background: var(--info); border-color: var(--info); }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-icon-only { width: 36px; height: 36px; padding: 0; display: flex; align-items: center; justify-content: center; }

/* ===== FORMS ===== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-text { font-size: 11px; color: var(--text-muted); }

.form-control-sm { padding: 6px 10px; font-size: 13px; }

textarea.form-control { min-height: 100px; resize: vertical; }

.input-group .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ===== TABLES ===== */
.table {
    margin-bottom: 0;
    color: var(--text-primary);
}

.table thead th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover { background: var(--bg-primary); }
.table tbody tr:last-child td { border-bottom: none; }

.table-actions {
    display: flex;
    gap: 4px;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border-color) !important;
    padding: 8px 14px !important;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border-color) !important;
}

/* ===== BADGES ===== */
.badge {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
}

/* ===== ALERTS ===== */
.alert {
    border: none;
    border-radius: var(--radius);
}

.alert-dismissible .btn-close { padding: 16px; }

/* ===== MODALS ===== */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ===== PAGINATION ===== */
.pagination {
    gap: 4px;
}

.page-link {
    border: none;
    border-radius: var(--radius-sm) !important;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    background: transparent;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--bg-primary);
    color: var(--primary);
}

.page-item.active .page-link {
    background: var(--primary);
    color: white;
}

.page-item.disabled .page-link {
    color: var(--text-muted);
    background: transparent;
}

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1060;
    backdrop-filter: blur(4px);
}

.search-overlay.active { display: block; }

.search-results-panel {
    display: none;
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 90vw;
    max-height: 70vh;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1070;
    overflow: hidden;
}

.search-results-panel.active { display: block; }

.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-results-body { max-height: calc(70vh - 60px); overflow-y: auto; padding: 8px 0; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.search-result-item:hover { background: var(--bg-primary); }

.search-result-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg);
    color: var(--primary);
    flex-shrink: 0;
}

.search-result-content { flex: 1; }

.search-result-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.search-result-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== FOOTER ===== */
.app-footer {
    padding: 16px 30px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    font-size: 12px;
    color: var(--text-muted);
}

.app-footer p { margin: 0; }

/* ===== SIDEBAR BACKDROP ===== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1049;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* ===== MOBILE SIDEBAR TOGGLE ===== */
.mobile-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    padding: 8px;
    margin-right: 4px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.mobile-sidebar-toggle:hover {
    background: var(--bg-primary);
    color: var(--primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1199px) {
    .search-results-panel {
        width: 90vw;
    }
}

@media (max-width: 992px) {
    .mobile-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        left: -280px;
        box-shadow: none;
    }

    .sidebar.mobile-open {
        left: 0;
        box-shadow: 0 0 40px rgba(0,0,0,0.3);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .page-content {
        padding: 16px;
    }

    .topbar {
        padding: 0 12px;
    }

    .topbar-left {
        max-width: none;
    }

    .search-box {
        max-width: 280px;
    }

    .search-results-panel {
        width: 95vw;
        top: 70px;
    }

    .user-info.d-none.d-md-block {
        display: none !important;
    }

    .stat-card .stat-value {
        font-size: 24px;
    }

    .notification-menu {
        width: 320px;
        right: -70px !important;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-title {
        font-size: 20px;
    }

    .page-header .d-flex.gap-2 {
        width: 100%;
    }

    .page-header .d-flex.gap-2 .btn {
        flex: 1;
        text-align: center;
    }

    .stat-card .stat-value {
        font-size: 22px;
    }

    .topbar-left {
        max-width: none;
    }

    .search-box {
        max-width: 180px;
    }

    .notification-menu {
        width: 300px;
        right: -60px !important;
    }

    .card-body {
        padding: 16px;
    }

    .table thead th,
    .table tbody td {
        padding: 10px 12px;
    }

    .app-footer {
        padding: 12px 16px;
        text-align: center;
    }

    .modal-body {
        padding: 16px;
    }

    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .mobile-sidebar-toggle {
        font-size: 18px;
        padding: 6px;
    }

    .page-content {
        padding: 12px;
    }

    .page-title {
        font-size: 18px;
    }

    .topbar {
        height: 56px;
        padding: 0 8px;
    }

    .topbar-left .search-box {
        max-width: 140px;
    }

    .search-box .global-search {
        height: 36px;
        font-size: 13px;
        padding-left: 34px;
    }

    .search-icon {
        left: 10px;
        font-size: 12px;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .user-btn {
        padding: 4px 8px;
    }

    .card-body {
        padding: 12px;
    }

    .card-header {
        padding: 12px 16px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-value {
        font-size: 20px;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
        margin-bottom: 12px;
    }

    .table thead th,
    .table tbody td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .table-actions .btn {
        width: 30px;
        height: 30px;
        padding: 0;
        font-size: 12px;
    }

    .btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .btn-sm {
        padding: 4px 10px;
        font-size: 11px;
    }

    .form-control, .form-select {
        padding: 8px 12px;
        font-size: 13px;
    }

    .form-label {
        font-size: 12px;
    }

    .notification-menu {
        width: 280px;
        right: -40px !important;
    }

    .notification-item {
        padding: 10px 16px;
    }

    .badge {
        padding: 3px 8px;
        font-size: 10px;
    }

    .empty-state {
        padding: 40px 16px;
    }

    .empty-state i {
        font-size: 40px;
    }

    .app-footer {
        padding: 10px 12px;
        font-size: 11px;
    }

    .pagination .page-link {
        padding: 6px 10px;
        font-size: 12px;
    }

    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 12px;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

    .search-results-panel {
        top: 60px;
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
    }

    .search-results-header {
        padding: 12px 16px;
    }

    .search-result-item {
        padding: 8px 16px;
    }
}

@media (max-width: 400px) {
    .topbar-left .search-box {
        max-width: 100px;
    }

    .search-box .global-search {
        font-size: 12px;
        padding-left: 30px;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .notification-badge {
        min-width: 16px;
        height: 16px;
        font-size: 8px;
        top: 2px;
        right: 2px;
    }

    .stat-card .stat-value {
        font-size: 18px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.animate-fade-in { animation: fadeIn 0.4s ease forwards; }
.animate-slide-left { animation: slideInLeft 0.4s ease forwards; }
.animate-slide-right { animation: slideInRight 0.4s ease forwards; }
.animate-slide-up { animation: slideInUp 0.4s ease forwards; }

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* =----- LOADING ----- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== AVATAR INITIALS ===== */
.avatar-initials {
    font-weight: 600;
    line-height: 1;
}

/* ===== DROPDOWNS ===== */
.dropdown-menu {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
}

.dropdown-item {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-primary);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
}

/* ===== TABS ===== */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    gap: 4px;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background: transparent;
    box-shadow: inset 0 -2px 0 var(--primary);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 60px;
    color: var(--text-muted);
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-state h5 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== PROGRESS ===== */
.progress {
    background: var(--border-color);
    border-radius: 20px;
    height: 8px;
}

.progress-bar {
    border-radius: 20px;
    background: var(--primary);
}

.progress-sm { height: 4px; }
.progress-lg { height: 12px; }

/* ===== TOOLTIP ===== */
.tooltip-inner {
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
}

/* ===== MISC HELPERS ===== */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.min-width-0 { min-width: 0; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.page-content > * { animation: fadeIn 0.4s ease forwards; }

/* ===== PRINT ===== */
@media print {
    .sidebar, .topbar, .app-footer { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}
