/* ========== CSS DESIGN SYSTEM ========== */
:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --primary-bg: #EEF2FF;
    --success: #10B981;
    --success-light: #D1FAE5;
    --success-dark: #065F46;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --warning-dark: #92400E;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --danger-dark: #991B1B;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    --bg: #F1F5F9;
    --surface: #FFFFFF;
    --surface-alt: #F8FAFC;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --transition: 0.2s ease;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ========== SIDEBAR LAYOUT ========== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
}

.sidebar-brand {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand img { width: 42px; height: 42px; border-radius: var(--radius); object-fit: contain; }

.sidebar-brand-text h2 { font-size: 16px; color: var(--text-primary); font-weight: 700; }
.sidebar-brand-text span { font-size: 12px; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.sidebar-nav .nav-section { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 16px 12px 8px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}

.nav-item:hover { background: var(--primary-bg); color: var(--primary); }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item i { width: 20px; text-align: center; font-size: 16px; }
.nav-item .nav-badge { margin-left: auto; background: var(--primary-light); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.nav-item.active .nav-badge { background: rgba(255,255,255,0.3); }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius);
    text-decoration: none;
}

.sidebar-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { display: block; font-size: 13px; color: var(--text-primary); line-height: 1.3; }
.sidebar-user-info span { font-size: 11px; color: var(--text-muted); }

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-left h1 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.content-area {
    flex: 1;
    padding: 28px;
    max-width: 1400px;
    width: 100%;
}

/* ========== PAGE HEADER ========== */
.page-header {
    margin-bottom: 28px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-header p { color: var(--text-muted); font-size: 14px; }

/* ========== CARDS ========== */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    transition: all var(--transition);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-header h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); }

/* Stat Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-bg); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-icon.info { background: var(--info-light); color: var(--info); }

.stat-info { flex: 1; min-width: 0; }

.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }

.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }

.stat-change { font-size: 12px; margin-top: 4px; font-weight: 500; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ========== GRID LAYOUTS ========== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ========== ALERTS ========== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.alert-error { background: var(--danger-light); color: var(--danger-dark); border: 1px solid #FCA5A5; }
.alert-success { background: var(--success-light); color: var(--success-dark); border: 1px solid #6EE7B7; }
.alert-info { background: var(--info-light); color: #1E40AF; border: 1px solid #93C5FD; }
.alert-warning { background: var(--warning-light); color: var(--warning-dark); border: 1px solid #FCD34D; }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: inherit;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: var(--warning-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-outline {
    background: transparent; color: var(--primary); border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); color: var(--text-primary); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    transition: all var(--transition);
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: var(--danger); }

.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 560px;
}

/* ========== FILTER BAR ========== */
.filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.filter-bar .form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }

.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.filter-field input, .filter-field select { padding: 8px 12px; font-size: 13px; }

.filter-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========== TABLES ========== */
.table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.table-search {
    position: relative;
    max-width: 300px;
}

.table-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    transition: all var(--transition);
}

.table-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }

.table-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; }

.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead { background: var(--surface-alt); }
.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table tbody tr:last-child td { border-bottom: none; }

.data-table .text-right { text-align: right; }
.data-table .text-center { text-align: center; }

.data-table .month-header td {
    background: var(--primary-bg);
    font-weight: 700;
    color: var(--primary);
    padding: 12px 16px;
    font-size: 13px;
    border-top: 2px solid var(--primary-light);
}

.data-table .amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.data-table .amount.credit { color: var(--success); }
.data-table .amount.debit { color: var(--danger); }

.data-table .total-row td {
    font-weight: 700;
    background: var(--surface-alt);
    border-top: 2px solid var(--border);
}

.data-table .grand-total td {
    font-weight: 700;
    color: #fff;
    border-top: 2px solid var(--border);
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-danger { background: var(--danger-light); color: var(--danger-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.badge-info { background: var(--info-light); color: #1E40AF; }
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-neutral { background: #F1F5F9; color: var(--text-secondary); }

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.pagination .page-btn {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.pagination .page-btn:hover { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }
.pagination .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--border);
}

.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ========== MODAL ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: #fff;
    animation: scaleIn 0.4s ease-out 0.15s backwards;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.modal-icon.success { background: var(--success); }
.modal-icon.danger { background: var(--danger); }
.modal-icon.warning { background: var(--warning); }

.modal h3 { font-size: 22px; color: var(--text-primary); margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.modal .amount-display { font-size: 36px; font-weight: 700; margin-bottom: 28px; }

.modal-actions { display: flex; gap: 12px; }
.modal-actions .btn { flex: 1; }

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    background: var(--surface);
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    border-right: 1px solid var(--border);
}

.tab-btn:last-child { border-right: none; }
.tab-btn:hover { background: var(--surface-alt); color: var(--text-primary); }
.tab-btn.active { background: var(--primary); color: #fff; }

.tab-content { display: none; animation: fadeSlideIn 0.3s ease; }
.tab-content.active { display: block; }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== AUTH PAGES ========== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #9333EA 100%);
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 420px;
    padding: 44px 40px;
    position: relative;
    z-index: 1;
}

.auth-header { text-align: center; margin-bottom: 32px; }

.auth-icon {
    width: 64px; height: 64px;
    background: var(--primary-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: var(--primary);
}

.auth-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.auth-header p { font-size: 14px; color: var(--text-muted); }

.auth-form .form-group { margin-bottom: 18px; }

.auth-form .btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.auth-form .btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,0.4);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ========== BALANCE ADJUSTMENT ========== */
.adjust-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 560px;
}

.adjust-selector {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--border);
}

.adjust-option {
    flex: 1;
    padding: 14px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: var(--surface);
    color: var(--text-secondary);
    font-family: inherit;
}

.adjust-option:first-child { border-right: 2px solid var(--border); }
.adjust-option:hover { background: var(--surface-alt); }

.adjust-option.credit-active {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.adjust-option.debit-active {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

/* ========== PROTECTED PAGE LAYOUT (no sidebar) ========== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px;
    min-height: 100vh;
}

.page-topbar {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: block; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .content-area { padding: 20px; }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .content-area { padding: 16px; }
    .page-container { padding: 16px; }
    .form-card, .adjust-card { max-width: 100%; }
    .tabs { flex-direction: column; }
    .tab-btn { border-right: none; border-bottom: 1px solid var(--border); }
    .tab-btn:last-child { border-bottom: none; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 10px 12px; }
    .topbar { padding: 0 16px; }
    .topbar-left h1 { font-size: 16px; }
    .btn-group { flex-direction: column; }
    .btn-group .btn { width: 100%; }
    .auth-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
    .stat-card { padding: 16px; }
    .stat-value { font-size: 22px; }
    .auth-card { margin: 0 12px; padding: 28px 20px; }
    .modal { padding: 28px 20px; }
}

/* ========== UTILITIES ========== */
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ========== SKELETON LOADER ========== */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--border-light) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 16px; width: 80%; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 100px; }

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease-out;
    min-width: 300px;
    max-width: 420px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========== SIDEBAR OVERLAY ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,0.4);
    z-index: 99;
}

.sidebar-overlay.show { display: block; }
