/* ============================================
   AKUNTANSI APP - Premium Dark Theme
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-card: rgba(255,255,255,0.04);
    --bg-card-hover: rgba(255,255,255,0.08);
    --bg-sidebar: #0d0d24;
    --bg-input: rgba(255,255,255,0.06);
    --bg-modal: rgba(10,10,26,0.95);

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-light: rgba(99,102,241,0.15);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);

    --income: #10b981;
    --income-light: rgba(16,185,129,0.15);
    --expense: #ef4444;
    --expense-light: rgba(239,68,68,0.15);
    --warning: #f59e0b;
    --info: #06b6d4;
    --transfer: #3b82f6;
    --transfer-light: rgba(59,130,246,0.15);

    --border: rgba(255,255,255,0.08);
    --border-hover: rgba(255,255,255,0.15);

    --glass-bg: rgba(255,255,255,0.03);
    --glass-border: rgba(255,255,255,0.06);
    --glass-blur: 20px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(99,102,241,0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --sidebar-width: 260px;
    --topbar-height: 70px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-input: #ffffff;
    --bg-modal: rgba(255,255,255,0.95);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --border: #e2e8f0;
    --border-hover: #cbd5e1;

    --glass-bg: rgba(255,255,255,0.8);
    --glass-border: rgba(226,232,240,0.8);
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 20px rgba(99,102,241,0.1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* ============================================
   AUTH PAGES (Login / Register)
   ============================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    animation: pulse-glow 6s ease-in-out infinite;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    animation: pulse-glow 8s ease-in-out infinite reverse;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.auth-logo h1 {
    font-size: 28px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    background: rgba(99,102,241,0.05);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

select.form-control option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-check label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16,185,129,0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

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

.auth-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--accent);
    font-weight: 600;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.5;
    animation: slideDown 0.3s ease;
}

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

.alert-danger {
    background: var(--expense-light);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
}

.alert-success {
    background: var(--income-light);
    border: 1px solid rgba(16,185,129,0.3);
    color: #6ee7b7;
}

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

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header span {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.sidebar-menu {
    flex: 1;
    padding: 16px 12px;
}

.sidebar-menu .menu-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 12px 8px;
    margin-top: 8px;
}

.sidebar-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: var(--transition);
    cursor: pointer;
}

.sidebar-menu .menu-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.sidebar-menu .menu-item.active {
    background: var(--accent-light);
    color: var(--accent-hover);
}

.sidebar-menu .menu-item.active svg {
    color: var(--accent);
}

.sidebar-menu .menu-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

.sidebar-footer .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    color: var(--expense);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-footer .menu-item:hover {
    background: var(--expense-light);
}

.sidebar-footer .menu-item svg {
    width: 20px;
    height: 20px;
}

/* ---------- Mobile Sidebar Overlay ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
}

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

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

/* ---------- Topbar ---------- */
.topbar {
    height: var(--topbar-height);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(10,10,26,0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.topbar-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.btn-sidebar-toggle:hover {
    background: rgba(255,255,255,0.05);
}

.btn-sidebar-toggle svg {
    width: 24px;
    height: 24px;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.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);
}

/* ---------- Summary Cards ---------- */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.summary-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    animation: fadeInUp 0.5s ease forwards;
}

.summary-card:nth-child(1) { animation-delay: 0s; }
.summary-card:nth-child(2) { animation-delay: 0.1s; }
.summary-card:nth-child(3) { animation-delay: 0.2s; }
.summary-card:nth-child(4) { animation-delay: 0.3s; }

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

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.summary-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.summary-card.income::after { background: var(--accent-gradient); background: linear-gradient(90deg, #10b981, #34d399); }
.summary-card.expense::after { background: linear-gradient(90deg, #ef4444, #f87171); }
.summary-card.balance::after { background: var(--accent-gradient); }
.summary-card.total::after { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.summary-icon svg {
    width: 24px;
    height: 24px;
}

.summary-card.income .summary-icon { background: var(--income-light); color: var(--income); }
.summary-card.expense .summary-icon { background: var(--expense-light); color: var(--expense); }
.summary-card.balance .summary-icon { background: var(--accent-light); color: var(--accent); }
.summary-card.total .summary-icon { background: rgba(245,158,11,0.15); color: var(--warning); }

.summary-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.summary-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.summary-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ---------- Wallet Cards ---------- */
.wallet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.wallet-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.wallet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.wallet-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.wallet-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallet-icon svg {
    width: 18px;
    height: 18px;
}

.wallet-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.wallet-type {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallet-balance {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   CHART
   ============================================ */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 28px;
}

.chart-container canvas {
    max-height: 350px;
}

/* ============================================
   DATATABLES
   ============================================ */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    overflow: hidden;
}

/* DataTables wrapper overrides */
.dataTables_wrapper {
    font-family: 'Inter', sans-serif;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-secondary) !important;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background: var(--bg-input) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-primary) !important;
    padding: 6px 12px !important;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1) !important;
}

table.dataTable {
    width: 100% !important;
    border-collapse: collapse;
    margin-top: 12px !important;
    margin-bottom: 12px !important;
}

table.dataTable thead th {
    background: rgba(255,255,255,0.02);
    border-bottom: 2px solid var(--border) !important;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px !important;
    white-space: nowrap;
}

table.dataTable tbody td {
    padding: 14px 16px !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--text-primary);
    font-size: 14px;
    vertical-align: middle;
}

table.dataTable tbody tr {
    transition: var(--transition);
}

table.dataTable tbody tr:hover {
    background: rgba(255,255,255,0.03) !important;
}

table.dataTable tbody tr.odd {
    background: transparent !important;
}

table.dataTable tbody tr.even {
    background: rgba(255,255,255,0.01) !important;
}

/* Pagination */
.dataTables_wrapper .dataTables_paginate {
    margin-top: 16px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px !important;
    margin: 0 2px;
    border-radius: var(--radius-sm) !important;
    border: 1px solid transparent !important;
    color: var(--text-secondary) !important;
    background: transparent !important;
    font-size: 13px;
    transition: var(--transition);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(255,255,255,0.05) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent-gradient) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: var(--text-muted) !important;
    opacity: 0.5;
}

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

.badge svg {
    width: 14px;
    height: 14px;
}

.badge-income {
    background: var(--income-light);
    color: var(--income);
}

.badge-expense {
    background: var(--expense-light);
    color: var(--expense);
}

.badge-transfer {
    background: var(--transfer-light);
    color: var(--transfer);
}

.badge-wallet, .badge-kategori {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.badge-wallet svg, .badge-kategori svg {
    width: 14px;
    height: 14px;
}

.text-income { color: var(--income) !important; font-weight: 600; }
.text-expense { color: var(--expense) !important; font-weight: 600; }
.text-transfer { color: var(--transfer) !important; font-weight: 600; }

/* ============================================
   ACTION BUTTONS
   ============================================ */
.btn-group-action {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.btn-action {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
}

.btn-action svg {
    width: 16px;
    height: 16px;
}

.btn-action.btn-edit {
    color: var(--accent);
}

.btn-action.btn-edit:hover {
    background: var(--accent-light);
}

.btn-action.btn-delete {
    color: var(--expense);
}

.btn-action.btn-delete:hover {
    background: var(--expense-light);
}

.btn-action.btn-pay {
    color: var(--income);
}

.btn-action.btn-pay:hover {
    background: var(--income-light);
}

/* ============================================
   MODAL
   ============================================ */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-backdrop.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--expense-light);
    color: var(--expense);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: 24px 28px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 0 28px 24px;
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

.filter-bar .form-control {
    width: auto;
    min-width: 140px;
}

/* ============================================
   TOOLBAR
   ============================================ */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

/* ============================================
   SECTION TITLE
   ============================================ */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

/* ============================================
   RESPONSIVE
   ============================================ */

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

/* Mobile */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .btn-sidebar-toggle {
        display: flex;
    }

    .topbar {
        padding: 0 16px;
    }

    .topbar-left h1 {
        font-size: 16px;
    }

    .page-content {
        padding: 16px;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .summary-card {
        padding: 16px;
    }

    .summary-value {
        font-size: 18px;
    }

    .wallet-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-control {
        width: 100%;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left, .toolbar-right {
        flex-wrap: wrap;
    }

    .user-name {
        display: none;
    }

    .modal-content {
        max-width: 100%;
        margin: 10px;
        border-radius: var(--radius-lg);
    }

    .modal-header, .modal-body, .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .auth-card {
        padding: 32px 24px;
    }

    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 10px 12px !important;
        font-size: 13px;
    }

    /* Hide some columns on mobile */
    .dt-col-hide-mobile {
        display: none;
    }
}

/* Small phones */
@media (max-width: 375px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .wallet-grid {
        grid-template-columns: 1fr;
    }

    .summary-value {
        font-size: 16px;
    }

    .wallet-balance {
        font-size: 16px;
    }
}

/* iPhone safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .page-content {
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   COLOR INPUT
   ============================================ */
input[type="color"] {
    width: 48px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
    padding: 2px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* ============================================
   SWEETALERT2 DARK THEME
   ============================================ */
.swal2-popup {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-xl) !important;
    color: var(--text-primary) !important;
}

.swal2-title {
    color: var(--text-primary) !important;
    font-family: 'Inter', sans-serif !important;
}

.swal2-html-container {
    color: var(--text-secondary) !important;
    font-family: 'Inter', sans-serif !important;
}

.swal2-confirm {
    background: var(--accent-gradient) !important;
    border-radius: var(--radius-md) !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3) !important;
}

.swal2-cancel {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-md) !important;
    font-family: 'Inter', sans-serif !important;
}

.swal2-container {
    z-index: 9999 !important;
}

.swal2-input {
    background: var(--bg-input) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
}
