:root {
    /* Base Colors - Premium Dark Mode / Light Mode Contrast */
    --primary: #090e17; /* Deep Noir */
    --primary-hover: #17253b;
    --secondary: #dc2626; /* Crimson Red */
    --secondary-hover: #b91c1c;
    --success: #10b981;
    --success-light: #d1fae5;
    --info: #0ea5e9;
    --info-light: #e0f2fe;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --neutral-light: #f1f5f9;

    /* Backgrounds & Surfaces (Light - Default) */
    --bg-app: #f4f7fb;
    --bg-surface: #ffffff;
    --surface: #ffffff;
    
    /* Text (Light) */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-faint: #cbd5e1;
    
    /* Decoration (Light) */
    --border-color: #e2e8f0;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Cinematic Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.03), 0 4px 6px -4px rgb(0 0 0 / 0.02);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.01);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-app: #07090e; /* True Noir */
    --bg-surface: #0f172a;
    --surface: #0f172a;
    --text-main: #ffffff;
    --text-muted: #cbd5e1; /* Much lighter text-muted */
    --text-faint: #475569;
    --border-color: #334155; /* Lighter borders */
    --neutral-light: #1e293b;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

[data-theme="dark"] .card { background-color: var(--bg-surface); border-color: var(--border-color); }
[data-theme="dark"] .form-control { background-color: #0f172a !important; border-color: var(--border-color) !important; color: white !important; }
[data-theme="dark"] .form-control:focus { background-color: #1e293b !important; }
[data-theme="dark"] select.form-control option,
[data-theme="dark"] select option { background-color: #1e293b !important; color: white !important; }


[data-theme="dark"] .table { color: var(--text-main); }
[data-theme="dark"] .table th, [data-theme="dark"] th, [data-theme="dark"] .premium-table th { background-color: #0f172a; border-color: var(--border-color); color: var(--text-main) !important; }
[data-theme="dark"] .table td, [data-theme="dark"] td, [data-theme="dark"] .premium-table td { border-color: var(--border-color); color: var(--text-main) !important; }
[data-theme="dark"] .modal-content { background-color: var(--bg-surface); border-color: var(--border-color); }
[data-theme="dark"] .breadcrumb-item.active { color: white; }
[data-theme="dark"] .tenant-badge { background: #334155; color: white; }
[data-theme="dark"] .dropdown-content { background-color: #1e293b !important; border-color: #334155 !important; }
[data-theme="dark"] .dropdown-item { color: #f8fafc !important; }
[data-theme="dark"] .dropdown-item:hover { background-color: rgba(59, 130, 246, 0.2) !important; color: #ffffff !important; }
[data-theme="dark"] .btn-outline { color: #f8fafc !important; border-color: #475569 !important; }
[data-theme="dark"] .btn-outline:hover { background-color: #1e293b !important; color: #ffffff !important; border-color: #64748b !important; }

[data-theme="dark"] .page-title,
[data-theme="dark"] .modal-header h3,
[data-theme="dark"] .card-title,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] h4,
[data-theme="dark"] .kpi-value { color: #ffffff !important; }
[data-theme="dark"] .close-btn { background: #1e293b; color: #cbd5e1; }
[data-theme="dark"] .close-btn:hover { background: #334155; color: #ef4444; }
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] strong, [data-theme="dark"] b { color: #ffffff !important; }
[data-theme="dark"] .form-group label { color: #ffffff !important; }
[data-theme="dark"] .icon-btn { color: #ffffff; opacity: 1; }

/* Base DOM Elements */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* Layout Architecture */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR - THE PREMIUM DARK THEME --- */
.sidebar {
    width: 240px;
    background-color: var(--primary);
    background-image: linear-gradient(180deg, #090e17 0%, #0d1624 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 50;
    box-shadow: 4px 0 15px rgba(0,0,0,0.05);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: 60px;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--secondary) 0%, #1e40af 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: white;
}

.nav-menu {
    padding: 1.5rem 1rem;
    flex: 1;
    overflow-y: auto;
}

.nav-menu::-webkit-scrollbar { width: 4px; }
.nav-menu::-webkit-scrollbar-track { background: transparent; }
.nav-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.nav-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--text-muted);
    margin: 1.5rem 0 0.75rem 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.85rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.9rem;
}

.nav-item i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 0.75rem;
    text-align: center;
    transition: transform 0.2s;
}

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

.nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--secondary);
    position: relative;
    overflow: hidden;
}

.nav-item.active i {
    color: var(--secondary);
    transform: scale(1.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--secondary);
    border-radius: 0 4px 4px 0;
}

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

.nav-logout {
    color: #ef4444;
}
.nav-logout:hover {
    background-color: rgba(239,68,68,0.1);
}

/* --- MAIN CONTENT & TOPBAR FLOW --- */
.main-content {
    flex: 1;
    margin-left: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 56px; /* Sedikit lebih tinggi untuk mobile */
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    color: white;
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tenant-badge {
    background: #f1f5f9;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
    letter-spacing: 0.02em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.menu-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.2s;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.icon-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 0.35rem 0.5rem 0.35rem 1rem;
    border-radius: 30px;
    transition: background 0.2s;
}
.user-profile:hover {
    background: #f8fafc;
}

.user-info {
    text-align: right;
}
.user-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
}
.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}
.user-avatar {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05); /* Soft border trick */
}

.page-content {
    padding: 1rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.page-header {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}


.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 30px;
    transition: background 0.2s;
}


.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 0.35rem 0.5rem 0.35rem 1rem;
    border-radius: 30px;
    transition: background 0.2s;
}

.user-info { text-align: right; }
.user-name { font-weight: 700; font-size: 0.95rem; color: white; }
.user-role { font-size: 0.75rem; color: rgba(255,255,255,0.6); font-weight: 500; }
.user-avatar {
    width: 35px;
    height: 35px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* --- PAGE CONTENT & BEAUTIFUL HEADER --- */
.page-content {
    padding: 1.25rem 1.5rem;
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.04em;
}

/* --- ELEGANT CARDS --- */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

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

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

/* --- STUNNING FORMS & INPUTS --- */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-app);
    color: var(--primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.form-control::placeholder {
    color: #94a3b8;
}

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

select.form-control option,
select option {
    background-color: var(--bg-surface) !important;
    color: var(--text-main) !important;
}




/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--secondary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: var(--secondary-hover);
    box-shadow: 0 6px 12px -2px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.2);
}

.btn-secondary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid #cbd5e1;
}

.btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: var(--primary);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 6px 12px -2px rgba(239, 68, 68, 0.4);
}

/* --- UNIVERSAL BADGES --- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    letter-spacing: 0.03em;
}

.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-info { background: var(--info-light); color: #075985; }
.badge-neutral { background: var(--neutral-light); color: #475569; }

/* --- SEAMLESS TABLES --- */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    padding: 0.75rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-surface);
}

td {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--bg-surface);
}

tr:hover td {
    background-color: var(--bg-app);
}

tr:last-child td {
    border-bottom: none;
}

/* --- KPI CARDS (Dashboard / Analytics) --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

.kpi-card:hover {
    transform: translateY(-3px);
}

.kpi-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.04em;
}

.kpi-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    opacity: 0.1;
}

.kpi-icon.blue { background: #3b82f6; color: #3b82f6; opacity: 1; background: rgba(59, 130, 246, 0.1); }
.kpi-icon.green { background: #10b981; color: #10b981; opacity: 1; background: rgba(16, 185, 129, 0.1); }
.kpi-icon.orange { background: #f59e0b; color: #f59e0b; opacity: 1; background: rgba(245, 158, 11, 0.1); }
.kpi-icon.red { background: #ef4444; color: #ef4444; opacity: 1; background: rgba(239, 68, 68, 0.1); }

/* --- MODALS (Floating Center Glass) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 550px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
    padding: 2rem 2.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

.close-btn, .close {
    cursor: pointer;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: all 0.2s;
}

.close-btn:hover, .close:hover {
    background: #e2e8f0;
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body, form, #detail-content {
    padding: 2rem 2.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem 2.5rem 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: var(--bg-surface);
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
    border-top: 1px solid var(--border-color);
}

/* --- AUTH LAYOUT (Login) --- */
.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-app);
    background-image: radial-gradient(circle at 50% -20%, #e0f2fe 0%, var(--bg-app) 70%);
}

.auth-card {
    background: var(--surface);
    padding: 3.5rem 3rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(255,255,255,0.5);
    text-align: left;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo i {
    font-size: 3rem;
    color: var(--secondary);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--secondary) 0%, #1e40af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 10px rgba(59, 130, 246, 0.3));
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.04em;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* RESPONSIVENESS */
.d-none { display: none !important; }

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
}

@media (max-width: 991px) {
    .d-md-none { display: none !important; }
    .topbar { padding: 0 1rem; }
}

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .page-content { padding: 1.5rem; }
    .icon-btn.menu-toggle { font-size: 1.5rem; margin-right: 1rem; }
}

@media print {
    .sidebar, .topbar, .btn, .no-print { display: none !important; }
    .main-content { margin-left: 0; }
    .card { box-shadow: none; border: 1px solid #000; }
    body { background: white; color: black; }
}

/* --- TOP NAVIGATION OVERRIDE --- */
@media (min-width: 992px) {
    .sidebar { display: none !important; }
    .main-content { margin-left: 0 !important; }
    
    .top-nav {
        display: flex !important;
        align-items: center;
        gap: 4px;
        margin-left: 1rem;
    }
    
    .top-nav-link {
        color: rgba(255, 255, 255, 0.7) !important;
        text-decoration: none !important;
        font-weight: 600;
        font-size: 0.82rem;
        padding: 0.35rem 0.6rem;
        border-radius: 8px;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .top-nav-link:hover, .top-nav-link.active {
        background: rgba(255, 255, 255, 0.1);
        color: white !important;
    }
    
    .top-nav-link i {
        font-size: 1rem;
        color: var(--secondary);
    }
    
    .top-nav-dropdown {
        position: relative;
        display: flex;
        align-items: center;
    }
    
    .dropdown-content {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--bg-surface) !important;
        min-width: 240px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.3);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 0.5rem;
        z-index: 1000;
        margin-top: 0; 
        /* Pastikan menempel sempurna dengan trigger */
        transform: translateY(0); 
    }


    /* Bridge area yang lebih luas agar hover tidak putus */
    .dropdown-content::before {
        content: '';
        position: absolute;
        top: -30px; /* Bridge lebih tinggi */
        left: 0;
        width: 100%;
        height: 35px; /* Lebih tebal agar kursor tidak "jatuh" */
        background: transparent;
        z-index: -1;
    }

    
    .top-nav-dropdown:hover .dropdown-content,
    .dropdown:hover .dropdown-content {
        display: block !important;
    }
    
    .dropdown-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0.6rem 1rem;
        color: #1e293b !important; /* Force dark text in light mode */
        text-decoration: none !important;
        border-radius: 6px;
        font-size: 0.82rem;
        font-weight: 500;
        transition: all 0.2s;
    }
    
    .dropdown-item:hover {
        background: var(--bg-app);
        color: var(--secondary) !important;
    }

    .dropdown-item i {
        width: 20px;
        text-align: center;
        color: var(--text-muted);
    }

    .dropdown-item:hover i {
        color: var(--secondary);
    }
}

.badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid white;
    min-width: 18px;
    text-align: center;
}

@media (max-width: 991px) {
    .top-nav { display: none !important; }
    
    .sidebar { 
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }

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

    /* Overlay saat menu terbuka */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 45;
        backdrop-filter: blur(2px);
    }
    
    .sidebar.open + .sidebar-overlay {
        display: block;
    }
}