:root {
    --primary: #4F46E5;
    --primary-light: #E0E7FF;
    --secondary: #10B981;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --sidebar-width: 260px;
    --topbar-height: 70px;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', 'Prompt', sans-serif; }
body { background: var(--bg); color: var(--text-main); display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar { width: var(--sidebar-width); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; height: 100vh; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; font-weight: 800; padding: 20px; color: var(--text-main); text-decoration: none; border-bottom: 1px solid var(--border); }
.brand-icon { background: #1E293B; color: #84CC16; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 1.1rem; }

.nav-section { padding: 15px 20px 5px; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.nav-link { padding: 12px 20px; margin: 4px 16px; border-radius: 8px; color: var(--text-muted); text-decoration: none; display: flex; align-items: center; gap: 12px; font-size: 0.9rem; font-weight: 500; transition: all 0.2s; }
.nav-link:hover { background: #F1F5F9; color: var(--text-main); }
.nav-link.active { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2); }
.nav-link i { font-size: 1.1rem; width: 20px; text-align: center; }
.badge { background: #84CC16; color: white; font-size: 0.7rem; padding: 2px 8px; border-radius: 12px; margin-left: auto; font-weight: 700; }

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

/* Topbar */
.topbar { height: var(--topbar-height); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; }
.search-bar { display: flex; align-items: center; background: #F1F5F9; border-radius: 20px; padding: 8px 16px; width: 300px; }
.search-bar i { color: var(--text-muted); margin-right: 10px; }
.search-bar input { border: none; background: transparent; outline: none; width: 100%; font-size: 0.9rem; color: var(--text-main); }

.topbar-actions { display: flex; align-items: center; gap: 20px; }
.action-icon { color: var(--text-muted); font-size: 1.2rem; cursor: pointer; position: relative; }
.action-badge { position: absolute; top: -5px; right: -5px; background: #84CC16; color: white; font-size: 0.6rem; padding: 2px 5px; border-radius: 10px; font-weight: 700; border: 2px solid white; }
.profile { display: flex; align-items: center; gap: 10px; cursor: pointer; border-left: 1px solid var(--border); padding-left: 20px; }
.profile-img { width: 36px; height: 36px; border-radius: 50%; background: #CBD5E1; }
.profile-info { display: flex; flex-direction: column; }
.profile-name { font-weight: 600; font-size: 0.9rem; }
.profile-role { font-size: 0.75rem; color: var(--text-muted); }

/* Main Content Area */
.main-content { flex: 1; padding: 30px; overflow-y: auto; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }

.card { background: var(--surface); border-radius: 16px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid var(--border); margin-bottom: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-title { font-weight: 700; font-size: 1.1rem; }

.btn { padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: 0.2s; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #4338CA; }
.btn-success { background: #10B981; color: white; }
.btn-outline { border: 1px solid var(--border); background: transparent; color: var(--text-main); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--text-muted); font-weight: 600; border-bottom: 2px solid var(--border); }
tbody tr:hover { background: #F8FAFC; }

/* Grid Layouts */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }

/* Dropdown Styles */
.dropdown-menu {
    display: none !important;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    margin-top: 10px;
    z-index: 9999;
    overflow: hidden;
    min-width: 200px;
    text-align: left;
}
.dropdown-menu.show {
    display: block !important;
    animation: fadeInDown 0.2s ease-out;
}
.dropdown-header {
    padding: 12px 15px;
    background: #F8FAFC;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
}
.dropdown-content {
    max-height: 300px;
    overflow-y: auto;
}
.dropdown-item {
    display: block;
    padding: 10px 15px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}
.dropdown-item:hover {
    background: #F1F5F9;
}
.dropdown-footer {
    display: block;
    padding: 10px;
    text-align: center;
    background: #F8FAFC;
    border-top: 1px solid var(--border);
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
}
.dropdown-footer:hover {
    text-decoration: underline;
}
.dropdown-trigger {
    position: relative;
    cursor: pointer;
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dark Mode */
body.dark-mode {
    --bg: #0F172A;
    --surface: #1E293B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border: #334155;
    background: var(--bg);
    color: var(--text-main);
}
body.dark-mode .sidebar, body.dark-mode .topbar, body.dark-mode .card, body.dark-mode .dropdown-menu {
    background: var(--surface);
    border-color: var(--border);
}
body.dark-mode .search-bar, body.dark-mode .search-bar input {
    background: #0F172A;
    color: white;
}
body.dark-mode .dropdown-header, body.dark-mode .dropdown-footer {
    background: #0F172A;
}
body.dark-mode .dropdown-item:hover {
    background: #334155;
}

