@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-app: #F8FAFC; --bg-card: #FFFFFF; --text-main: #0F172A; --text-muted: #64748B;
    --border: #E2E8F0; --primary: #6366F1; --primary-hover: #4F46E5; --primary-soft: #EEF2FF;
    --info: #3B82F6; --info-soft: #EFF6FF; --success: #10B981; --success-soft: #ECFDF5;
    --warning: #F59E0B; --warning-soft: #FFFBEB; --danger: #EF4444; --danger-soft: #FEF2F2;
    --purple: #8B5CF6; --purple-soft: #F5F3FF;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05); --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-dropdown: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --sidebar-w: 260px; --sidebar-w-collapsed: 80px; --radius: 12px; --transition: all 0.25s ease;
}

/* PURE BLACK DARK MODE */
html[data-theme="dark"] {
    --bg-app: #000000; 
    --bg-card: #0F0F0F; 
    --text-main: #FAFAFA; 
    --text-muted: #A1A1AA;
    --border: #222222; 
    --primary: #6366f1; 
    --primary-soft: rgba(99, 102, 241, 0.15);
    --info-soft: rgba(59, 130, 246, 0.15);
    --success-soft: rgba(16, 185, 129, 0.15);
    --warning-soft: rgba(245, 158, 11, 0.15);
    --danger-soft: rgba(239, 68, 68, 0.15);
    --purple-soft: rgba(139, 92, 246, 0.15);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5); 
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.8);
    --shadow-dropdown: 0 20px 25px -5px rgba(0, 0, 0, 0.9);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-app); color: var(--text-main); transition: var(--transition); overflow-x: hidden; }

/* Utilities */
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 24px; } .w-100 { width: 100%; } .pb-0 { padding-bottom: 0 !important; } .border-0 { border: none !important; }
.text-primary { color: var(--primary); } .text-success { color: var(--success); } .text-danger { color: var(--danger); }
.text-warning { color: var(--warning); } .text-info { color: var(--info); } .text-purple { color: var(--purple); }
.text-right { text-align: right; } .text-xs { font-size: 11px; }
.muted { color: var(--text-muted); font-size: 12px; font-weight: 400;}

/* Sidebar */
.sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: var(--sidebar-w); background-color: var(--bg-card); border-right: 1px solid var(--border); transition: var(--transition); z-index: 100; display: flex; flex-direction: column; }
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar-header { height: 70px; display: flex; align-items: center; padding: 0 20px; gap: 12px; border-bottom: 1px solid var(--border); }
.brand-logo { width: 36px; height: 36px; min-width: 36px; background: linear-gradient(135deg, var(--primary), var(--purple)); color: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.brand-text { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
.sidebar.collapsed .brand-text { display: none; }
.sidebar-menu { padding: 20px 16px; overflow-y: auto; }
.menu-title { font-size: 12px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin: 10px 0 10px 12px; display: block; }
.sidebar.collapsed .menu-title { display: none; }
.nav-list { list-style: none; margin-bottom: 20px; }
.nav-item { margin-bottom: 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: 14px; transition: var(--transition); }
.nav-link i { font-size: 20px; }
.nav-link:hover { background-color: var(--border); color: var(--text-main); }
.nav-item.active .nav-link { background-color: var(--primary-soft); color: var(--primary); }
.sidebar.collapsed .nav-text { display: none; }

.main-wrapper { margin-left: var(--sidebar-w); min-height: 100vh; transition: var(--transition); }
.sidebar.collapsed ~ .main-wrapper { margin-left: var(--sidebar-w-collapsed); }

/* Header & Clickable Icons */
.top-header { height: 70px; background-color: var(--bg-card); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; padding: 0 24px; position: sticky; top: 0; z-index: 90; }
.header-left, .header-right { display: flex; align-items: center; gap: 8px; }

/* FIX: Ensure all action buttons are clickable with pointer cursor */
.action-btn, .icon-btn, .clickable-btn { 
    background: transparent; 
    border: none; 
    color: var(--text-muted); 
    width: 36px; height: 36px; 
    border-radius: 8px; 
    cursor: pointer !important;  /* Enforce pointer */
    display: flex; align-items: center; justify-content: center; 
    font-size: 18px; 
    transition: var(--transition); 
    z-index: 10;
}
.action-btn:hover, .icon-btn:hover, .clickable-btn:hover { background: var(--border); color: var(--text-main); }
.clickable-btn { background: var(--bg-app); border: 1px solid var(--border); }

.search-box { display: flex; align-items: center; background-color: var(--bg-app); border: 1px solid var(--border); padding: 0 12px; border-radius: 8px; height: 36px; width: 300px; }
.search-box input { border: none; background: transparent; outline: none; margin-left: 8px; width: 100%; color: var(--text-main); font-size: 13px; }
.shortcut { font-size: 10px; border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; color: var(--text-muted); }

.badge-btn { position: relative; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background-color: var(--danger); border-radius: 50%; border: 1.5px solid var(--bg-card); }
.user-profile { display: flex; align-items: center; gap: 10px; padding-left: 16px; border-left: 1px solid var(--border); cursor: pointer; }
.avatar-img-premium { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), var(--purple)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 14px; color: var(--text-main); }
.user-role { font-size: 12px; color: var(--text-muted); }
.profile-chevron { font-size: 18px; color: var(--text-muted); margin-left: 4px; }

/* Header Dropdowns */
.dropdown-wrapper { position: relative; cursor: pointer; }
.header-dropdown-menu { position: absolute; top: calc(100% + 15px); right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-dropdown); opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.25s; z-index: 100; min-width: 220px; }
.dropdown-wrapper.show .header-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.notification-menu { width: 320px; right: -80px; }
.menu-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.menu-header h4 { font-size: 15px; font-weight: 600; color: var(--text-main); }
.font-600 { font-weight: 600; }
.notify-item { display: flex; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--transition); }
.notify-item:hover { background: var(--bg-app); }
.notify-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; min-width: 10px; }
.notify-info h5 { font-size: 14px; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.notify-info p { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.notify-info span { font-size: 12px; color: var(--text-muted); }
.menu-footer { padding: 12px; text-align: center; border-top: 1px solid var(--border); }
.menu-footer a { color: var(--primary); font-size: 13px; font-weight: 600; text-decoration: none; }

.profile-menu { width: 200px; padding: 8px 0; }
.profile-menu .dropdown-item { padding: 10px 20px; font-size: 14px; color: var(--text-main); font-weight: 500; display: flex; align-items: center; gap: 12px; text-decoration: none; transition: var(--transition); border-radius: 0; }
.profile-menu .dropdown-item i { font-size: 18px; color: var(--text-muted); }
.profile-menu .dropdown-item:hover { background: var(--bg-app); }
.profile-menu .dropdown-item.text-danger i { color: var(--danger); }
.divider { height: 1px; background-color: var(--border); margin: 8px 0; }

/* Dashboard Grids */
.content-container { padding: 24px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.grid-layout-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-layout-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.span-2 { grid-column: span 2; }
.card { background-color: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.panel { padding: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; position: relative;}
.card-header h4 { font-size: 15px; font-weight: 600; }
.btn-text { background: none; border: none; color: var(--primary); font-size: 13px; font-weight: 500; cursor: pointer; }

/* NEW: Card Action Dropdown (3 Dots) */
.card-action-wrapper { position: relative; }
.card-action-menu { position: absolute; top: 100%; right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-md); padding: 8px 0; width: 150px; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.2s; z-index: 50; }
.card-action-wrapper.show .card-action-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.card-action-menu a { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: 13px; color: var(--text-main); text-decoration: none; transition: 0.2s; }
.card-action-menu a:hover { background: var(--bg-app); color: var(--primary); }

/* Hero */
.hero-section { display: flex; justify-content: space-between; align-items: center; padding: 24px; background: linear-gradient(to right, var(--bg-card), var(--primary-soft)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.hero-content h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.hero-content p { color: var(--text-muted); font-size: 14px; }
.hero-actions { display: flex; gap: 12px; }
.btn { padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; border: none; transition: var(--transition); }
.btn-primary { background-color: var(--primary); color: white; } .btn-primary:hover { background-color: var(--primary-hover); }
.btn-outline { background-color: transparent; border: 1px solid var(--border); color: var(--text-main); } .btn-outline:hover { background-color: var(--bg-app); }

/* KPI Cards */
.kpi-card { background-color: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); transition: var(--transition); }
.kpi-card:hover { border-color: var(--primary); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 12px; }
.kpi-top i { font-size: 18px; padding: 6px; background: var(--bg-app); border-radius: 6px; border: 1px solid var(--border); }
.kpi-card h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.kpi-bottom { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 4px; }

/* Custom Dropdown */
.custom-dropdown { position: relative; user-select: none; }
.dropdown-selected { background: var(--bg-app); border: 1px solid var(--border); padding: 8px 14px; border-radius: 8px; font-size: 13px; color: var(--text-main); cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: var(--transition); }
.custom-dropdown.active .dropdown-selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.dropdown-list { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-dropdown); opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.2s; z-index: 99; overflow: hidden; }
.dropdown-list.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item { padding: 10px 14px; font-size: 13px; color: var(--text-main); cursor: pointer; transition: background 0.1s; }
.dropdown-item:hover { background: var(--bg-app); }
.dropdown-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }

/* Charts & Widgets */
.fake-chart-area { display: flex; align-items: flex-end; justify-content: space-between; height: 180px; padding-top: 20px; border-bottom: 1px dashed var(--border); margin-bottom: 16px; }
.bar-group { display: flex; gap: 6px; width: 12%; height: 100%; align-items: flex-end; }
.bar { width: 100%; border-radius: 4px 4px 0 0; }
.bar-1 { background: var(--primary); } .bar-2 { background: var(--primary-soft); border: 1px solid var(--primary); }
.chart-legend { display: flex; gap: 16px; justify-content: center; font-size: 13px; color: var(--text-muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-1 { background: var(--primary); } .dot-2 { background: var(--primary-soft); border: 1px solid var(--primary); }

.css-donut { width: 160px; height: 160px; border-radius: 50%; background: conic-gradient(var(--primary) 0% 55%, var(--purple) 55% 80%, var(--info) 80% 100%); display: flex; align-items: center; justify-content: center; margin: 20px auto;}
.donut-inner { width: 120px; height: 120px; background-color: var(--bg-card); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-inner h3 { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.donut-inner p { font-size: 20px; font-weight: 700; }

.traffic-list { list-style: none; font-size: 13px; }
.traffic-list li { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.traffic-list li span { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }

.list-widget { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.list-item { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.item-info { display: flex; align-items: center; gap: 12px; }
.item-img { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.item-info h5 { font-size: 14px; color: var(--text-main); margin-bottom: 2px; font-weight: 600; }
.item-stats h5 { font-size: 14px; color: var(--text-main); margin-bottom: 2px; }

/* Progress Bars */
.progress-group { display: flex; flex-direction: column; gap: 8px; }
.progress-item { margin-bottom: 8px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.progress-bar { width: 100%; height: 6px; background: var(--bg-app); border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 10px; }

/* Table */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 12px 16px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--border); }
.data-table td { padding: 16px; font-size: 13px; border-bottom: 1px solid var(--border); color: var(--text-main); vertical-align: middle; }
.user-cell { display: flex; align-items: center; gap: 12px; }
.u-av { width: 36px; height: 36px; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 12px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.user-cell p { font-weight: 600; margin-bottom: 2px; font-size: 14px; }
.user-cell span { font-size: 12px; color: var(--text-muted); }
.tag { font-size: 11px; padding: 4px 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg-app); font-weight: 500;}
.badge { font-size: 11px; padding: 4px 10px; border-radius: 50px; font-weight: 600; }
.b-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.b-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.b-primary { background: rgba(99, 102, 241, 0.1); color: var(--primary); }

/* To-Do List */
.todo-list { display: flex; flex-direction: column; gap: 12px; }
.todo-item { display: flex; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; position: relative; transition: var(--transition); }
.todo-item:hover { background: var(--bg-app); }
.todo-item input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark { height: 18px; width: 18px; background-color: transparent; border: 2px solid var(--border); border-radius: 4px; margin-right: 12px; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.todo-item input:checked ~ .checkmark { background-color: var(--primary); border-color: var(--primary); }
.todo-item input:checked ~ .checkmark:after { content: "✓"; color: white; font-size: 12px; }
.todo-item .text { font-size: 14px; font-weight: 500; transition: var(--transition); }

/* Responsive */
@media (max-width: 1400px) { .grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1024px) { .grid-layout-2-1, .grid-layout-3 { grid-template-columns: 1fr; } .span-2 { grid-column: span 1;} }
@media (max-width: 768px) { .sidebar { left: -100%; } .main-wrapper { margin-left: 0; } .search-box { display: none; } .grid-6 { grid-template-columns: 1fr 1fr; } }