:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #3b82f6;
    --sidebar-hover: #334155;
    --topbar-height: 60px;
    --primary: #3b82f6;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: #f1f5f9; color: #1e293b; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}
.sidebar-header {
    padding: 20px;
    color: #fff;
    border-bottom: 1px solid #334155;
}
.sidebar-header h4 { font-weight: 700; }
.sidebar-nav { padding: 10px 0; }
.sidebar-nav .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;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
}
.sidebar-nav .nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--sidebar-active);
    border-left-color: var(--sidebar-active);
}
.sidebar-nav .nav-link i { font-size: 18px; width: 24px; text-align: center; }
.nav-section {
    padding: 16px 20px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* Top Navbar */
.top-navbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 999;
}
.sidebar-toggle { color: #64748b; padding: 4px 8px; }
.top-navbar .btn-link { color: #64748b; text-decoration: none; }
.top-navbar .btn-link:hover { color: #1e293b; }

/* Page Content */
.page-content { padding: 24px; }

/* Cards */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.stat-card .stat-value { font-size: 28px; font-weight: 700; }
.stat-card .stat-label { font-size: 13px; color: #64748b; font-weight: 500; }
.stat-card .stat-change { font-size: 12px; font-weight: 600; }

/* Content Cards */
.content-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}
.content-card .card-header-custom {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.content-card .card-header-custom h5 { margin: 0; font-weight: 600; font-size: 16px; }
.content-card .card-body-custom { padding: 20px; }

/* Tables */
.table-custom { margin: 0; }
.table-custom thead th {
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    padding: 12px 16px;
}
.table-custom tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
}
.table-custom tbody tr:hover { background: #f8fafc; }

/* Badges */
.badge-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-active { background: #dcfce7; color: #16a34a; }
.badge-inactive { background: #fee2e2; color: #dc2626; }
.badge-pending { background: #fef3c7; color: #d97706; }
.badge-present { background: #dcfce7; color: #16a34a; }
.badge-absent { background: #fee2e2; color: #dc2626; }
.badge-late { background: #fef3c7; color: #d97706; }
.badge-paid { background: #dcfce7; color: #16a34a; }
.badge-unpaid { background: #fee2e2; color: #dc2626; }
.badge-partial { background: #dbeafe; color: #2563eb; }

/* Buttons */
.btn-primary-custom {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 14px;
}
.btn-primary-custom:hover { background: #2563eb; color: #fff; }

/* Forms in modals */
.modal .form-label { font-size: 13px; font-weight: 600; color: #475569; }
.modal .form-control, .modal .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
}
.modal .form-control:focus, .modal .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Chart containers */
.chart-container { position: relative; height: 300px; }

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .sidebar-overlay {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    .sidebar-overlay.show { display: block; }
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.login-card h2 { font-weight: 700; color: #1e293b; }
.login-card .login-icon { font-size: 48px; color: var(--primary); }

/* Quick action cards */
.quick-action {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: #1e293b;
}
.quick-action:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}
.quick-action i { font-size: 32px; color: var(--primary); }

/* Scrollbar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }

/* Loading spinner */
.spinner-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}
