/* ============================================
   SPP Payment System - Main Stylesheet
   Banking-style Modern UI
   ============================================ */

:root {
    --primary: #1a56db;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --secondary: #059669;
    --secondary-light: #10b981;
    --accent: #6366f1;
    --danger: #dc2626;
    --danger-light: #ef4444;
    --warning: #d97706;
    --warning-light: #f59e0b;
    --success: #059669;
    --success-light: #10b981;
    --info: #0891b2;
    --info-light: #06b6d4;

    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-sidebar: #e0f2fe;
    --bg-sidebar-hover: #bae6fd;
    --bg-sidebar-active: #7dd3fc;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-sidebar: #1e3a5f;
    --text-sidebar-active: #1d4ed8;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --sidebar-width: 260px;
    --topbar-height: 64px;

    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: #334155;
    --bg-sidebar-active: rgba(59,130,246,0.2);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #93c5fd;

    --border: #334155;
    --border-light: #1e293b;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.3);
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--primary-dark); }

img { max-width: 100%; }

/* ============ PRELOADER ============ */
.preloader {
    position: fixed;
    inset: 0;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}
.preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}
.preloader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ SKELETON LOADING ============ */
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 120px; border-radius: var(--radius); }

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

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
    border-right: 1px solid #bae6fd;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #bae6fd;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: #2563eb;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}
img.sidebar-brand-icon {
    background: transparent;
    border-radius: 0;
}

.sidebar-brand-text h2 {
    color: #1e3a5f;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.3;
}
.sidebar-brand-text span {
    color: #3b82f6;
    font-size: 11px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #3b82f6;
    padding: 0 12px;
    margin-bottom: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 1px;
    position: relative;
}
.sidebar-link:hover {
    background: var(--bg-sidebar-hover);
    color: #1e3a5f;
}
.sidebar-link.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 600;
}
.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #2563eb;
    border-radius: 0 3px 3px 0;
}
.sidebar-link svg, .sidebar-link .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.5;
}
.sidebar-link:hover svg, .sidebar-link:hover .icon {
    opacity: 0.8;
}
.sidebar-link.active svg, .sidebar-link.active .icon {
    opacity: 1;
}

.sidebar-link-highlight {
    background: #059669;
    color: white;
    font-weight: 600;
    border: 1px solid #047857;
    margin-top: 4px;
}
.sidebar-link-highlight svg {
    opacity: 1;
}
.sidebar-link-highlight:hover {
    background: #047857;
    color: white;
    border-color: #065f46;
}
.sidebar-link-highlight.active {
    background: #047857;
    color: white;
    border-color: #065f46;
}

.sidebar-link-logout {
    background: #dc2626;
    color: white;
    font-weight: 600;
}
.sidebar-link-logout svg {
    opacity: 1;
}
.sidebar-link-logout:hover {
    background: #b91c1c;
    color: white;
}

.sidebar-footer {
    padding: 16px 10px;
    border-top: 1px solid #bae6fd;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.85);
}
[data-theme="dark"] .topbar {
    background: rgba(30,41,59,0.85);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    min-width: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
}
.topbar-toggle:hover {
    background: var(--bg-primary);
    color: var(--primary);
}

.topbar-title h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.topbar-title p {
    font-size: 12px;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-search {
    position: relative;
}
.topbar-search input {
    width: 240px;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition);
}
.topbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
.topbar-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.topbar-btn:hover {
    background: var(--bg-primary);
    color: var(--primary);
}
.topbar-btn .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}
.topbar-user:hover {
    background: var(--bg-primary);
}
.topbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
}
.topbar-user-info span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.topbar-user-info small {
    font-size: 11px;
    color: var(--text-muted);
}

.page-content {
    flex: 1;
    padding: 24px;
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow);
}
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.card-body {
    padding: 24px;
}
.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0.05;
    transform: translate(30%, -30%);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-card-info h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.stat-card-info .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
}
.stat-card-info .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card-icon svg {
    width: 24px;
    height: 24px;
}
.stat-card-icon.blue { background: rgba(59,130,246,0.1); color: #3b82f6; }
.stat-card-icon.green { background: rgba(16,185,129,0.1); color: #10b981; }
.stat-card-icon.orange { background: rgba(245,158,11,0.1); color: #f59e0b; }
.stat-card-icon.red { background: rgba(239,68,68,0.1); color: #ef4444; }
.stat-card-icon.purple { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.stat-card-icon.cyan { background: rgba(6,182,212,0.1); color: #06b6d4; }

.stat-card.blue::after { background: var(--primary); }
.stat-card.green::after { background: var(--secondary); }
.stat-card.orange::after { background: var(--warning); }
.stat-card.red::after { background: var(--danger); }

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.badge-success { background: rgba(16,185,129,0.1); color: #059669; }
.badge-danger { background: rgba(239,68,68,0.1); color: #dc2626; }
.badge-warning { background: rgba(245,158,11,0.1); color: #d97706; }
.badge-info { background: rgba(6,182,212,0.1); color: #0891b2; }
.badge-secondary { background: rgba(100,116,139,0.1); color: #64748b; }
.badge-primary { background: rgba(59,130,246,0.1); color: #2563eb; }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}
.btn-primary:hover { background: #2563eb; border-color: #2563eb; }

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.btn-success:hover { background: #047857; }

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}
.btn-danger:hover { background: #b91c1c; }

.btn-warning {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}
.btn-icon.sm {
    width: 30px;
    height: 30px;
}

/* ============ FORMS ============ */
.form-group {
    margin-bottom: 18px;
}
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-control::placeholder {
    color: var(--text-muted);
}

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

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

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

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

/* ============ TABLES ============ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
}

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

table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table tbody td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

table tbody tr:hover {
    background: var(--bg-primary);
}

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

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

/* ============ ALERTS / FLASH ============ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}
.alert-success { background: rgba(5,150,105,0.08); color: #059669; border: 1px solid rgba(5,150,105,0.15); }
.alert-danger { background: rgba(220,38,38,0.08); color: #dc2626; border: 1px solid rgba(220,38,38,0.15); }
.alert-warning { background: rgba(217,119,6,0.08); color: #d97706; border: 1px solid rgba(217,119,6,0.15); }
.alert-info { background: rgba(8,145,178,0.08); color: #0891b2; border: 1px solid rgba(8,145,178,0.15); }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
}
.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: var(--transition);
}
.pagination a:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    color: var(--primary);
}
.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============ FILTER BAR ============ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.filter-bar .form-group {
    margin-bottom: 0;
    min-width: 150px;
}
.filter-bar .form-control {
    padding: 8px 12px;
    font-size: 12px;
}

/* ============ LOGIN PAGE ============ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #1e3a8a 100%);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(59,130,246,0.08);
    border-radius: 50%;
    top: -200px;
    right: -200px;
}
.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(99,102,241,0.06);
    border-radius: 50%;
    bottom: -150px;
    left: -150px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(255,255,255,0.97);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    backdrop-filter: blur(10px);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo-icon {
    width: 56px;
    height: 56px;
    background: #3b82f6;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 24px;
    margin-bottom: 16px;
}
.login-logo h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.login-logo p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.login-form .form-group {
    margin-bottom: 20px;
}
.login-form .form-control {
    padding: 12px 16px;
    font-size: 14px;
    border-radius: var(--radius);
}

.login-btn {
    width: 100%;
    padding: 13px;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius);
    background: #3b82f6;
    border: none;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}
.login-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}
.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 13px;
}

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-slow);
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: var(--transition-slow);
}
.modal-overlay.active .modal {
    transform: scale(1);
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}
.modal-body {
    padding: 24px;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============ KWITANSI ============ */
.kwitansi-container {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 30px;
}
.kwitansi-header {
    text-align: center;
    border-bottom: 2px solid var(--text-primary);
    padding-bottom: 16px;
    margin-bottom: 20px;
}
.kwitansi-header h2 {
    font-size: 18px;
    font-weight: 800;
}
.kwitansi-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px dotted var(--border);
}
.kwitansi-row .label {
    color: var(--text-muted);
}
.kwitansi-row .value {
    font-weight: 600;
    color: var(--text-primary);
}
.kwitansi-total {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    margin-top: 10px;
    border-top: 2px solid var(--text-primary);
    font-size: 16px;
    font-weight: 800;
}

/* ============ DARK MODE TOGGLE ============ */
.theme-toggle {
    width: 48px;
    height: 26px;
    border-radius: 13px;
    background: var(--border);
    border: none;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}
.theme-toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.theme-toggle.active {
    background: var(--primary);
}
.theme-toggle.active::after {
    left: 25px;
}

/* ============ NOTIFICATION POLLING ============ */
.notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ============ CHART CONTAINER ============ */
.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .main-content {
        margin-left: 0;
    }
    .topbar-toggle {
        display: flex !important;
    }
    .topbar-search {
        display: none;
    }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .page-content {
        padding: 16px;
    }
    .filter-bar {
        flex-direction: column;
    }
    .filter-bar .form-group {
        width: 100%;
    }
    .stat-card {
        padding: 16px;
    }
    .stat-card-info .stat-value {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
    }
    .topbar-user-info {
        display: none;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 150;
    transition: var(--transition-slow);
}
.sidebar-overlay.active {
    display: block;
}

/* ============ UTILITIES ============ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
