@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #f0f2f5;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-btn-outline: #fff;
    --text-main: #1a1f36;
    --text-muted: #697386;
    --border-color: rgba(60, 66, 87, 0.08);
    --primary: #0056b3;
    --primary-light: rgba(0, 86, 179, 0.08);
    --primary-gradient: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --sidebar-w: 280px;
    --glass-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
    --bg-badge-neutral: #f1f5f9;
    --text-badge-neutral: #64748b;
    --card-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-main: #020617;
    --bg-sidebar: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.7);
    --bg-btn-outline: rgba(255, 255, 255, 0.05);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --bg-badge-neutral: rgba(255, 255, 255, 0.05);
    --text-badge-neutral: #94a3b8;
    --glass-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }
body { background: var(--bg-main); color: var(--text-main); font-size: 14px; display: flex; height: 100vh; overflow: hidden; transition: background-color 0.4s ease; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }

/* Sidebar */
.sidebar { width: var(--sidebar-w); background: var(--bg-sidebar); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; z-index: 100; transition: var(--transition); }
.logo-container { padding: 2.5rem 1.5rem; display: flex; align-items: center; gap: 12px; }
.logo-container img { width: 36px; height: 36px; border-radius: 10px; object-fit: contain; }
.logo-container h1 { font-size: 1.25rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.5px; background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.nav-menu { flex: 1; overflow-y: auto; padding: 0 1rem; display: flex; flex-direction: column; gap: 4px; margin-top: 1rem; }
/* Hide sidebar items by default to prevent permission leak/flicker */
.nav-item {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 12px;
    color: #a3aed1;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    margin-bottom: 5px;
}
.nav-item[data-page="dashboard"] {
    display: flex; /* Dashboard is always visible once logged in */
}
.nav-item i { width: 18px; }
.nav-item:hover, .nav-item.active {
    background: var(--bg-hover);
    color: var(--primary);
}
.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
:hover i { transform: translateX(3px); }
.nav-item.active { background: var(--primary); color: white; box-shadow: 0 8px 20px -6px rgba(0, 86, 179, 0.4); }

/* Main Content */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
header { padding: 1.5rem 2rem; display: flex; justify-content: space-between; align-items: center; }
.search-bar { display: flex; align-items: center; gap: 12px; background: var(--bg-card); padding: 0.75rem 1.5rem; border-radius: 30px; box-shadow: var(--glass-shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); width: 420px; border: 1px solid var(--border-color); transition: var(--transition); }
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); width: 450px; }
.search-bar input { border: none; background: transparent; outline: none; color: var(--text-main); width: 100%; font-size: 0.9rem; font-weight: 500; }
.search-bar i { color: var(--text-muted); width: 18px; }

.header-right { display: flex; align-items: center; gap: 1rem; position: relative; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; background: var(--bg-card); display: flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; border: 1px solid var(--border-color); box-shadow: var(--glass-shadow); transition: var(--transition); backdrop-filter: blur(10px); }
.icon-btn:hover { color: var(--primary); border-color: var(--primary); transform: rotate(15deg); }

/* User Dropdown Menu */
.user-profile { display: flex; align-items: center; gap: 10px; cursor: pointer; background: var(--bg-card); padding: 0.4rem 1rem 0.4rem 0.4rem; border-radius: 30px; border: 1px solid var(--border-color); box-shadow: var(--glass-shadow); transition: var(--transition); }
.user-profile:hover { border-color: var(--primary); transform: translateY(-2px); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%); color: white; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; }
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.85rem; font-weight: 700; color: var(--text-main); }
.user-role { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; font-weight: 800; }

.user-menu { position: absolute; top: calc(100% + 12px); right: 0; background: var(--bg-sidebar); border: 1px solid var(--border-color); border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,0.1); width: 240px; padding: 0.75rem; display: none; flex-direction: column; z-index: 1000; animation: slideDownIn 0.3s ease; }
.user-menu.active { display: flex; }
@keyframes slideDownIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.user-menu a { display: flex; align-items: center; gap: 12px; padding: 0.85rem 1rem; color: var(--text-main); text-decoration: none; font-size: 0.9rem; font-weight: 600; border-radius: 10px; transition: var(--transition); }
.user-menu a:hover { background: rgba(99, 102, 241, 0.05); color: var(--primary); }
.user-menu i { width: 18px; height: 18px; color: var(--text-muted); }

/* Dashboard Content */
#page-content { flex: 1; padding: 0 2rem 2rem 2rem; overflow-y: auto; }
.page-section { display: none; animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.page-section.active { display: block; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Cards & Panels */
.glass-panel { 
    background: var(--bg-card); 
    backdrop-filter: blur(24px); 
    -webkit-backdrop-filter: blur(24px); 
    border: 1px solid var(--border-color); 
    border-radius: 28px; 
    padding: 2.25rem; 
    box-shadow: var(--card-shadow); 
    margin-bottom: 2rem; 
    transition: var(--transition); 
}
.glass-panel:hover { 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08); 
    border-color: rgba(67, 24, 255, 0.2); 
}
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.panel-header h2 { font-size: 1.25rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.5px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { 
    background: var(--bg-sidebar); 
    border: 1px solid var(--border-color); 
    border-radius: 24px; 
    padding: 1.5rem; 
    display: flex; 
    align-items: center; 
    gap: 1.25rem; 
    box-shadow: var(--card-shadow); 
    transition: var(--transition); 
    position: relative;
    overflow: hidden;
}
.stat-card:hover { 
    transform: translateY(-6px); 
    box-shadow: 0 20px 40px -10px rgba(67, 24, 255, 0.15); 
    border-color: var(--primary); 
}
.stat-icon { 
    width: 64px; 
    height: 64px; 
    border-radius: 20px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.75rem; 
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}
.stat-icon.primary { background: linear-gradient(135deg, rgba(67, 24, 255, 0.1) 0%, rgba(67, 24, 255, 0.05) 100%); color: var(--primary); }
.stat-icon.warning { background: linear-gradient(135deg, rgba(255, 181, 71, 0.1) 0%, rgba(255, 181, 71, 0.05) 100%); color: var(--warning); }
.stat-icon.danger { background: linear-gradient(135deg, rgba(238, 93, 80, 0.1) 0%, rgba(238, 93, 80, 0.05) 100%); color: var(--danger); }
.stat-icon.success { background: linear-gradient(135deg, rgba(1, 181, 116, 0.1) 0%, rgba(1, 181, 116, 0.05) 100%); color: var(--success); }
.stat-details { display: flex; flex-direction: column; z-index: 2; }
.stat-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 700; margin-bottom: 2px; }
.stat-value { font-size: 2.25rem; font-weight: 800; color: var(--text-main); letter-spacing: -1.5px; line-height: 1.1; }

/* Grid for Charts */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
@media (max-width: 1200px) { .charts-grid { grid-template-columns: 1fr; } }
.chart-container { height: 300px; position: relative; }

/* Tables */
table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 1rem; }
th { text-align: left; padding: 1.25rem 1rem; color: var(--text-muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; border-bottom: 1px solid var(--border-color); letter-spacing: 1px; }
td { padding: 1.25rem 1rem; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; font-weight: 600; color: var(--text-main); transition: var(--transition); }
tr:hover td { background: rgba(99, 102, 241, 0.03); }
tr:last-child td { border-bottom: none; }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 1rem; border-radius: 12px; }
.table-responsive table { margin-top: 0; }

/* Badges */
.badge { padding: 6px 14px; border-radius: 10px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-primary { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.badge-neutral { background: var(--bg-badge-neutral); color: var(--text-badge-neutral); border: 1px solid var(--border-color); }

/* Buttons */
.btn { padding: 0.8rem 1.75rem; border-radius: 16px; font-weight: 700; font-size: 0.9rem; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition); letter-spacing: -0.2px; }
.btn-primary { background: var(--primary-gradient); color: white; box-shadow: 0 10px 25px -5px rgba(67, 24, 255, 0.4); }
.btn-primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 15px 35px -5px rgba(67, 24, 255, 0.5); }
.btn-outline { background: var(--bg-btn-outline); color: var(--text-main); border: 2px solid var(--border-color); box-shadow: var(--card-shadow); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

/* Drawers */
.drawer { position: fixed; right: -100%; top: 0; width: 520px; height: 100vh; background: var(--bg-sidebar); border-left: 1px solid var(--border-color); z-index: 2000; padding: 3rem; transition: var(--transition); overflow-y: auto; box-shadow: -20px 0 50px rgba(0,0,0,0.1); visibility: hidden; pointer-events: none; opacity: 0; }
.drawer.open { right: 0; visibility: visible; pointer-events: auto; opacity: 1; }
.drawer.doc-preview-drawer { width: 85%; max-width: 1300px; padding: 2rem; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(20px); border-left: none; }
.drawer.doc-preview-drawer h2 { color: #fff; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); }

.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(10px); z-index: 1500; display: none; opacity: 0; transition: opacity 0.4s; }
.overlay.active { display: block; opacity: 1; }

/* Filter Bar */
.filter-bar { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.filter-bar select, .filter-bar input { padding: 0.85rem 1.25rem; border-radius: 16px; border: 2px solid var(--border-color); background: var(--bg-card); color: var(--text-main); outline: none; font-size: 0.9rem; font-weight: 600; transition: var(--transition); }
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); }

/* Forms */
.form-group { margin-bottom: 2rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 1rem 1.25rem; border-radius: 18px; border: 2.5px solid var(--border-color); background: var(--bg-card); color: var(--text-main); outline: none; font-size: 0.95rem; font-weight: 500; transition: var(--transition); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { background: var(--bg-sidebar); border-color: var(--primary); box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.1); }

/* Login Screen */
#login-screen { position: fixed; inset: 0; background: var(--bg-main); z-index: 10000; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--bg-sidebar); border: 1px solid var(--border-color); padding: 3.5rem; border-radius: 32px; width: 440px; box-shadow: 0 30px 60px -12px rgba(0,0,0,0.1); text-align: center; }
.login-card img { width: 72px; height: 72px; border-radius: 16px; margin-bottom: 2rem; object-fit: contain; }

/* Utilities */
.spin-icon { animation: rotate 1s linear infinite; }
@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.toast-container { position: fixed; top: 2rem; right: 2rem; z-index: 9999; display: flex; flex-direction: column; gap: 1rem; }
.toast { background: var(--bg-sidebar); border-radius: 20px; padding: 1.25rem 2rem; box-shadow: 0 20px 40px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 1rem; border-left: 6px solid var(--primary); font-weight: 700; color: var(--text-main); animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

/* ============================================================
   MOBILE RESPONSIVE + PWA STYLES
   ============================================================ */

/* Keyboard chip for file list */
.kbd-chip { display:inline-flex; align-items:center; gap:8px; padding:6px 12px; background:rgba(99,102,241,0.06); border:1px solid rgba(99,102,241,0.15); border-radius:10px; font-size:0.8rem; font-weight:600; color:var(--text-main); }

/* Mobile Bottom Navigation */
.mobile-bottom-nav { display: none; }

/* Drawer full on tablet */
@media (max-width: 1024px) {
    .drawer { width: 90%; }
    .charts-grid { grid-template-columns: 1fr; }
    .search-bar { width: 280px; }
}

/* ═══════════════════════════════
   MOBILE (768px and below)
═══════════════════════════════ */
@media (max-width: 768px) {

    /* Body layout */
    body { flex-direction: column; height: 100dvh; overflow: hidden; }

    /* Sidebar — slide in from left */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100%;
        z-index: 2100;
        width: 280px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 60px rgba(0,0,0,0.2);
    }
    .sidebar.active { left: 0; }

    /* Show hamburger button */
    .mobile-menu-btn { display: flex !important; }

    /* Header adjustments */
    header {
        padding: 0.85rem 1rem;
        gap: 10px;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-sidebar);
        position: sticky;
        top: 0;
        z-index: 100;
    }
    .search-bar {
        width: 100%;
        flex: 1;
        padding: 0.6rem 1rem;
        border-radius: 20px;
    }
    .search-bar:focus-within { width: 100%; }

    /* Hide some header items on mobile */
    .header-right .icon-btn:not(#theme-toggle) { display: none; }
    .user-info { display: none; }
    .user-profile { padding: 0.3rem; }
    [data-lucide="chevron-down"] { display: none; }

    /* User menu */
    .user-menu { right: -10px; width: 220px; }

    /* Birthday Glow Animation */
    @keyframes bday-glow {
        0% { box-shadow: 0 0 10px rgba(99, 102, 241, 0.4); border-color: var(--primary); }
        50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.6); border-color: var(--warning); transform: scale(1.01); }
        100% { box-shadow: 0 0 10px rgba(99, 102, 241, 0.4); border-color: var(--primary); }
    }
    .birthday-glow {
        animation: bday-glow 2s infinite ease-in-out;
        background: linear-gradient(to right, rgba(99,102,241,0.05), transparent) !important;
    }
    .birthday-glow strong {
        color: var(--primary);
        text-shadow: 0 0 5px rgba(99,102,241,0.2);
    }

    /* Page content */
    #page-content {
        padding: 1rem;
        padding-bottom: 90px; /* Space for bottom nav */
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Cards */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
    .stat-card { padding: 1.25rem; border-radius: 20px; }
    .stat-value { font-size: 1.4rem; }
    .glass-panel { padding: 1.25rem; border-radius: 20px; }

    /* Tables — horizontal scroll */
    .glass-panel { overflow-x: auto; }
    table { min-width: 700px; }

    /* Filter bar */
    .filter-bar { gap: 0.6rem; }
    .filter-bar select, .filter-bar input { padding: 0.65rem 0.85rem; font-size: 0.8rem; border-radius: 12px; }

    /* Drawers — full screen on mobile */
    .drawer { width: 100%; border-left: none; padding: 1.5rem; border-radius: 24px 24px 0 0; top: auto; bottom: -110%; right: 0; height: 92vh; transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.4s, opacity 0.4s; visibility: hidden; pointer-events: none; opacity: 0; }
    .drawer.open { bottom: 0; right: 0; visibility: visible; pointer-events: auto; opacity: 1; transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s, opacity 0.4s; }
    .drawer.doc-preview-drawer { height: 95vh; border-radius: 24px 24px 0 0; }

    /* Drawer header handle line */
    .drawer-header::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--border-color);
        border-radius: 4px;
        margin: -0.5rem auto 1rem;
        position: absolute;
        top: 1rem;
        left: 50%;
        transform: translateX(-50%);
    }
    .drawer { position: fixed; }

    /* Login card */
    .login-card { width: calc(100vw - 2rem); padding: 2.5rem 1.75rem; border-radius: 28px; }

    /* Buttons */
    .btn { padding: 0.75rem 1.25rem; font-size: 0.85rem; border-radius: 14px; }
    .drawer-actions { flex-direction: column; gap: 0.75rem; }

    /* Toast */
    .toast-container { top: auto; bottom: 90px; right: 1rem; left: 1rem; }

    /* Panel header */
    .panel-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .panel-header .btn { width: 100%; justify-content: center; }

    /* Mobile Bottom Navigation - Clean Style */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: var(--bg-sidebar); /* Matches theme, white in light mode */
        border-top: 1px solid var(--border-color);
        z-index: 1000;
        align-items: center;
        justify-content: space-around;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    }

    .mob-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.7rem;
        font-weight: 700;
        padding: 0.5rem;
        flex: 1;
        transition: var(--transition);
    }

    .mob-nav-item i { width: 20px; height: 20px; }
    .mob-nav-item.active { color: var(--primary); }

    .mob-nav-fab {
        background: var(--primary);
        color: white !important;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
        transform: translateY(-15px);
        margin: 0 10px;
        flex: 0 0 50px;
    }
    .mob-nav-fab i { width: 24px; height: 24px; }
    .mob-nav-fab span { display: none; }


    /* Main wrapper on mobile */
    .main-wrapper { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
}

@media (max-width: 360px) {
    #page-content { padding: 0.75rem; padding-bottom: 100px; }
}

@supports (padding-top: env(safe-area-inset-top)) {
    header { padding-top: max(0.85rem, env(safe-area-inset-top)); }

}

/* Premium Notifications (Chic Design) */
.notification-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: linear-gradient(135deg, #ff4b2b, #ff416c);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-sidebar);
    box-shadow: 0 4px 10px rgba(255, 75, 43, 0.3);
    pointer-events: none;
    z-index: 5;
}
.notif-panel {
    position: absolute;
    top: calc(100% + 20px);
    right: -10px;
    width: 340px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    z-index: 2000;
    display: none;
    opacity: 0;
    transform: translateY(15px) scale(0.95);
    transform-origin: top right;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: visible;
}
.notif-panel::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 22px;
    width: 16px;
    height: 16px;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    transform: rotate(45deg);
    z-index: -1;
}
.notif-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}
.notif-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.notif-header h3 { 
    font-size: 1rem; 
    font-weight: 800; 
    margin: 0; 
    color: var(--text-main);
    letter-spacing: -0.3px;
}
.notif-summary { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    font-weight: 500;
}
.notif-list {
    max-height: 380px;
    overflow-y: auto;
    padding: 0.5rem;
}
.notif-item {
    padding: 1rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
    border: 1px solid transparent;
}
.notif-item:hover {
    background: rgba(99, 102, 241, 0.08);
    transform: scale(0.98);
}
.notif-title { 
    font-weight: 700; 
    font-size: 0.85rem; 
    color: var(--text-main);
}
.notif-desc { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    line-height: 1.4;
}
.notif-time { 
    font-size: 0.7rem; 
    color: var(--primary); 
    font-weight: 700; 
    display: flex;
    align-items: center;
    gap: 4px;
}
.notif-empty {
    padding: 3rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
}
.notif-empty i {
    width: 48px;
    height: 48px;
    color: var(--border-color);
    margin-bottom: 0.5rem;
}

.sort-icon {
    width: 14px;
    height: 14px;
    margin-left: 4px;
    opacity: 0.5;
    transition: var(--transition);
}
th:hover .sort-icon {
    opacity: 1;
    color: var(--primary);
}
