﻿:root {
            --bg: #f0fdf6;
            --surface: #ffffff;
            --border: #d1fae5;
            --primary: #059669;
            --primary-light: #ecfdf5;
            --primary-glow: rgba(5,150,105,0.15);
            --accent: #0d9488;
            --danger: #dc2626;
            --danger-light: #fef2f2;
            --warn: #d97706;
            --warn-light: #fffbeb;
            --text: #111827;
            --text-2: #4b5563;
            --text-3: #9ca3af;
            --radius: 20px;
            --radius-lg: 28px;
            --shadow: 0 4px 24px rgba(5,150,105,0.08);
            --shadow-hover: 0 8px 40px rgba(5,150,105,0.18);
        }
        html.dark {
            --bg: #0f172a;
            --surface: #1e293b;
            --surface2: #334155;
            --border: #1e293b;
            --primary: #10b981;
            --primary-light: #064e3b;
            --text: #f1f5f9;
            --text-2: #cbd5e1;
            --text-3: #94a3b8;
            --danger: #ff6b6b;
        }
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            font-family: 'Cairo', sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
            transition: background 0.3s, color 0.3s;
        }

        /* TOAST */
        #toast-container {
            position: fixed;
            top: 80px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
        }
        .toast {
            padding: 14px 24px;
            border-radius: 50px;
            font-weight: 700;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 10px;
            color: white;
            pointer-events: none;
            animation: toastIn 0.4s cubic-bezier(0.175,0.885,0.32,1.275) forwards;
            box-shadow: 0 8px 32px rgba(0,0,0,0.2);
        }
        .toast.success { background: linear-gradient(135deg, #059669, #0d9488); }
        .toast.error   { background: linear-gradient(135deg, #dc2626, #b91c1c); }
        .toast.info    { background: linear-gradient(135deg, #0284c7, #0369a1); }
        .toast.warning { background: linear-gradient(135deg, #d97706, #b45309); }
        .toast.out     { animation: toastOut 0.3s ease forwards; }
        @keyframes toastIn  { from { opacity:0; transform:translateY(-20px) scale(0.9); } to { opacity:1; transform:none; } }
        @keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateY(-10px); } }

        /* HEADER */
        header {
            background: rgba(255,255,255,0.96);
            backdrop-filter: blur(16px);
            border-bottom: 1px solid var(--border);
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 2px 16px rgba(5,150,105,0.06);
        }
        html.dark header {
            background: rgba(30,41,59,0.96);
        }
        .header-inner {
            max-width: 1320px;
            margin: 0 auto;
            padding: 0 28px;
            height: 68px;
            display: flex;
            align-items: center;
            gap: 24px;
        }
        .logo {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-shrink: 0;
        }
        .logo-icon {
            width: 42px; height: 42px;
            background: linear-gradient(135deg, #059669, #0d9488);
            border-radius: 14px;
            display: flex; align-items: center; justify-content: center;
            font-size: 20px;
            box-shadow: 0 4px 12px rgba(5,150,105,0.3);
        }
        .logo-text h1 { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.2; }
        .logo-text p  { font-size: 11px; color: var(--primary); font-weight: 600; }
        nav { display: flex; gap: 4px; flex: 1; }
        .nav-btn {
            display: flex; align-items: center; gap: 8px;
            padding: 8px 18px;
            border-radius: 50px;
            font-weight: 600; font-size: 13px;
            color: var(--text-2);
            cursor: pointer;
            transition: all 0.2s;
            border: 1px solid transparent;
            background: none;
            font-family: 'Cairo', sans-serif;
        }
        .nav-btn:hover { background: var(--primary-light); color: var(--primary); }
        .nav-btn.active {
            background: var(--primary);
            color: white;
            box-shadow: 0 4px 12px rgba(5,150,105,0.3);
        }
        .header-actions { display: flex; align-items: center; gap: 12px; margin-right: auto; }
        .balance-box {
            text-align: right;
            background: var(--primary-light);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 8px 16px;
        }
        .balance-box .amount { font-size: 18px; font-weight: 800; color: var(--primary); }
        .balance-box .label  { font-size: 10px; color: var(--text-3); }
        .btn-icon {
            width: 38px; height: 38px;
            border-radius: 12px;
            border: 1px solid var(--border);
            background: white;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            color: var(--text-2);
            transition: all 0.2s;
            font-size: 14px;
            font-family: 'Cairo', sans-serif;
        }
        html.dark .btn-icon { background: var(--surface); }
        .btn-icon:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
        .online-dot {
            display: flex; align-items: center; gap: 6px;
            font-size: 11px; font-weight: 700;
            color: var(--primary);
            background: var(--primary-light);
            border: 1px solid var(--border);
            padding: 5px 12px; border-radius: 50px;
        }
        .online-dot::before {
            content: ''; width: 7px; height: 7px;
            background: var(--primary);
            border-radius: 50%;
            animation: pulse 2s infinite;
        }
        @keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.6;transform:scale(0.85)} }

        /* LAYOUT */
        main { max-width: 1320px; margin: 0 auto; padding: 28px; }
        .tab-panel { display: none; animation: fadeIn 0.3s ease; }
        .tab-panel.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

        /* CARDS */
        .card {
            background: var(--surface);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            box-shadow: var(--shadow);
            transition: all 0.25s;
        }
        .card:hover { box-shadow: var(--shadow-hover); }
        .stat-card {
            padding: 24px;
            display: flex; flex-direction: column; gap: 16px;
            position: relative; overflow: hidden;
        }
        .stat-icon {
            width: 44px; height: 44px;
            border-radius: 14px;
            display: flex; align-items: center; justify-content: center;
            font-size: 18px;
        }
        .stat-label { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }
        .stat-value { font-size: 28px; font-weight: 900; line-height: 1; }
        .stat-sub   { font-size: 11px; font-weight: 600; }

        /* TABLE */
        .data-table { width: 100%; border-collapse: collapse; }
        .data-table th {
            padding: 12px 18px;
            text-align: right;
            font-size: 11px; font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-3);
            background: #f9fafb;
            border-bottom: 1px solid var(--border);
        }
        html.dark .data-table th { background: var(--surface2); }
        .data-table td {
            padding: 14px 18px;
            text-align: right;
            font-size: 13px;
            border-bottom: 1px solid #f3f4f6;
            vertical-align: middle;
        }
        html.dark .data-table td { border-bottom-color: var(--surface2); }
        .data-table tr:last-child td { border-bottom: none; }
        .data-table tr:hover td { background: var(--primary-light); }
        .badge {
            display: inline-flex; align-items: center; gap: 5px;
            padding: 4px 12px;
            border-radius: 50px;
            font-size: 11px; font-weight: 700;
        }
        .badge-income  { background: #dcfce7; color: #166534; }
        .badge-expense { background: #fee2e2; color: #991b1b; }
        .badge-recurring { background: #dbeafe; color: #1e40af; }
        .category-tag {
            display: inline-flex; align-items: center; gap: 4px;
            padding: 3px 10px;
            border-radius: 50px;
            font-size: 11px; font-weight: 600;
            background: #f3f4f6; color: var(--text-2);
        }
        html.dark .category-tag { background: var(--surface2); }

        /* FORM */
        .form-group { display: flex; flex-direction: column; gap: 8px; }
        .form-label { font-size: 13px; font-weight: 700; color: var(--text-2); }
        .form-input {
            padding: 14px 18px;
            border: 1.5px solid #e5e7eb;
            border-radius: var(--radius);
            font-family: 'Cairo', sans-serif;
            font-size: 14px;
            transition: border-color 0.2s, box-shadow 0.2s;
            background: white;
            outline: none;
            width: 100%;
        }
        html.dark .form-input { background: var(--surface2); border-color: var(--surface2); color: white; }
        .form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
        .type-toggle { display: flex; background: #f3f4f6; border-radius: 50px; padding: 4px; gap: 4px; }
        html.dark .type-toggle { background: var(--surface2); }
        .type-btn {
            flex: 1; padding: 10px;
            border-radius: 50px;
            font-weight: 700; font-size: 13px;
            cursor: pointer; border: none;
            transition: all 0.2s;
            background: transparent;
            color: var(--text-3);
            font-family: 'Cairo', sans-serif;
        }
        .type-btn.active-income  { background: white; color: #059669; box-shadow: 0 2px 8px rgba(5,150,105,0.15); }
        .type-btn.active-expense { background: white; color: #dc2626; box-shadow: 0 2px 8px rgba(220,38,38,0.15); }
        html.dark .type-btn.active-income  { background: var(--surface2); }
        html.dark .type-btn.active-expense { background: var(--surface2); }

        /* BUDGET BARS */
        .budget-bar-track {
            height: 8px;
            background: #f3f4f6;
            border-radius: 50px;
            overflow: hidden;
        }
        html.dark .budget-bar-track { background: var(--surface2); }
        .budget-bar-fill {
            height: 100%;
            border-radius: 50px;
            transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
        }

        /* MODAL */
        .modal-overlay {
            position: fixed; inset: 0;
            background: rgba(0,0,0,0.5);
            backdrop-filter: blur(4px);
            z-index: 500;
            display: none; align-items: center; justify-content: center;
        }
        .modal-overlay.open { display: flex; }
        .modal-box {
            background: white;
            border-radius: 28px;
            padding: 32px;
            width: 480px; max-width: 90vw;
            animation: fadeIn 0.3s;
            max-height: 90vh;
            overflow-y: auto;
        }
        html.dark .modal-box { background: var(--surface); }

        /* ALERT BOX */
        .alert-box {
            padding: 16px 20px;
            border-radius: 16px;
            border-left: 4px solid;
            margin-bottom: 16px;
            display: flex; gap: 12px; align-items: flex-start;
        }
        .alert-warning { background: var(--warn-light); border-color: var(--warn); color: var(--warn); }
        .alert-danger { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }

        /* FLOATING BUTTON */
        .fab {
            position: fixed;
            bottom: 32px;
            right: 32px;
            width: 60px; height: 60px;
            border-radius: 50%;
            background: linear-gradient(135deg, #059669, #0d9488);
            color: white;
            border: none;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            font-size: 24px;
            box-shadow: 0 8px 32px rgba(5,150,105,0.4);
            z-index: 90;
            transition: all 0.3s;
            font-family: 'Cairo', sans-serif;
        }
        .fab:hover { transform: scale(1.1); box-shadow: 0 12px 48px rgba(5,150,105,0.5); }
        .fab:active { transform: scale(0.95); }

        /* INSIGHTS */
        .insight-item {
            padding: 16px;
            background: #f9fafb;
            border-radius: 16px;
            border-right: 4px solid var(--primary);
            font-size: 14px;
            line-height: 1.6;
        }
        html.dark .insight-item { background: var(--surface2); border-right-color: var(--primary); }

        /* UTILITY */
        .grid-2 { display: grid; grid-template-columns: 1fr 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; }
        @media (max-width: 1024px) {
            .grid-4 { grid-template-columns: repeat(2, 1fr); }
            .grid-3 { grid-template-columns: 1fr 1fr; }
        }
        @media (max-width: 640px) {
            .grid-2, .grid-4, .grid-3 { grid-template-columns: 1fr; }
            .header-inner { flex-wrap: wrap; height: auto; padding: 12px 16px; }
            nav { overflow-x: auto; }
            .fab { bottom: 16px; right: 16px; }
        }
        .text-income  { color: #059669; }
        .text-expense { color: #dc2626; }
        .text-muted   { color: var(--text-3); font-size: 12px; }
        .divider { height: 1px; background: var(--border); margin: 24px 0; }
        .btn-primary {
            display: inline-flex; align-items: center; justify-content: center; gap: 8px;
            padding: 14px 28px;
            background: linear-gradient(135deg, #059669, #0d9488);
            color: white; font-weight: 700; font-size: 15px;
            border: none; border-radius: 50px; cursor: pointer;
            font-family: 'Cairo', sans-serif;
            transition: all 0.2s;
            box-shadow: 0 4px 16px rgba(5,150,105,0.3);
        }
        .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(5,150,105,0.4); }
        .btn-primary:disabled { opacity: 0.6; transform: none; cursor: not-allowed; }
        .btn-ghost {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 10px 18px;
            border: 1.5px solid var(--border);
            border-radius: 50px; background: white;
            color: var(--text-2); font-size: 13px; font-weight: 600;
            cursor: pointer; font-family: 'Cairo', sans-serif;
            transition: all 0.2s;
        }
        html.dark .btn-ghost { background: var(--surface2); }
        .btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
        .btn-danger {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 8px 14px;
            border: none; border-radius: 50px; background: none;
            color: var(--danger); font-size: 12px; font-weight: 600;
            cursor: pointer; font-family: 'Cairo', sans-serif;
            transition: all 0.2s;
        }
        .btn-danger:hover { background: var(--danger-light); }
        .empty-state {
            text-align: center;
            padding: 64px 24px;
            color: var(--text-3);
        }
        .empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
        .empty-state p { font-size: 15px; font-weight: 600; }