@import "./auth-theme.css";
@import "./header.css";

        * { box-sizing: border-box; }
        body {
            margin: 0; min-height: 100vh; overflow-x: hidden;
            font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; color: #e2e8f0;
            background:
                radial-gradient(circle at top left, rgba(37,99,235,0.22), transparent 35%),
                radial-gradient(circle at bottom right, rgba(30,58,138,0.28), transparent 40%),
                linear-gradient(180deg, #0c1445 0%, #070e2a 55%, #040a1f 100%);
        }
        @keyframes fadeIn  { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }
        @keyframes slideUp { from { transform:translateY(0); opacity:1; } to { transform:translateY(-100%); opacity:0; pointer-events:none; } }
        @keyframes pulse   { 0%,100% { opacity:0.5; r:2; } 50% { opacity:1; r:4; } }
        .node { fill: #2563EB; animation: pulse 3s infinite; }
        .link { stroke: #93c5fd; stroke-width: 1; opacity: 0.18; }
        #splash-screen {
            position: fixed; inset: 0; background: #040a1f; z-index: 100;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            animation: slideUp 0.9s cubic-bezier(0.87,0,0.13,1) forwards 2.2s;
        }
        .brand-kicker { display:inline-flex; align-items:center; gap:0.6rem; padding:0.55rem 1rem; border-radius:999px; border:1px solid rgba(255,255,255,0.08); background:rgba(10,10,30,0.45); color:#94a3b8; font-size:0.72rem; font-weight:800; letter-spacing:0.22em; text-transform:uppercase; }
        .brand-name { margin:0; font-size:clamp(3.2rem,10vw,5.5rem); font-weight:800; line-height:0.9; letter-spacing:-0.05em; }
        .brand-name span { background:linear-gradient(90deg,#f8fafc 0%,#93c5fd 52%,#2563EB 100%); -webkit-background-clip:text; background-clip:text; color:transparent; }
        .reveal-1 { opacity:0; animation: fadeIn 0.8s ease-out 2.5s forwards; }
        .reveal-2 { opacity:0; animation: fadeIn 0.8s ease-out 2.7s forwards; }
        .reveal-3 { opacity:0; animation: fadeIn 0.8s ease-out 2.9s forwards; }
        @media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; } #splash-screen { display:none; } }

        /* ── Native Mobile App Shell ─────────────────────────────── */
        .app-container {
            display: flex; flex-direction: column;
            height: 100vh; height: 100dvh;
            overflow: hidden;
        }
        .xp-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 1rem 1.25rem;
            background: rgba(12,20,69,0.96);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(255,255,255,0.07);
            flex-shrink: 0; z-index: 40;
        }
        .xp-header-left { display: flex; align-items: center; gap: 0.7rem; }
        .xp-title { margin: 0; font-size: 1.1rem; font-weight: 900; color: #e2e8f0; letter-spacing: -0.03em; }
        .xp-back-btn {
            width: 2.1rem; height: 2.1rem;
            display: flex; align-items: center; justify-content: center;
            background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.10);
            border-radius: 0.6rem; color: #94a3b8; cursor: pointer; font-size: 0.9rem;
        }
        .xp-avatar-btn {
            width: 2.2rem; height: 2.2rem;
            display: flex; align-items: center; justify-content: center;
            background: rgba(37,99,235,0.16); border: 1px solid rgba(37,99,235,0.28);
            border-radius: 50%; color: #93c5fd; cursor: pointer; font-size: 1.1rem;
        }
        .xp-content {
            flex: 1; overflow-y: auto;
            padding-bottom: 5.5rem;
        }
        .xp-bottom-nav {
            position: fixed; bottom: 0; left: 0; right: 0;
            background: rgba(7,14,42,0.97);
            backdrop-filter: blur(16px);
            border-top: 1px solid rgba(255,255,255,0.07);
            display: flex; justify-content: space-around;
            padding: 0.65rem 0;
            padding-bottom: calc(0.65rem + env(safe-area-inset-bottom));
            z-index: 50;
            box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
        }
        .xp-nav-item {
            display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
            color: #3d5280; font-size: 0.67rem; font-weight: 800;
            width: 25%; cursor: pointer; border: none; background: none;
            transition: color 0.2s; padding: 0; text-transform: uppercase; letter-spacing: 0.06em;
        }
        .xp-nav-item i { font-size: 1.35rem; }
        .xp-nav-item.active { color: #2563EB; }
        .xp-nav-item.active i { filter: drop-shadow(0 0 6px rgba(37,99,235,0.6)); }

        /* ── Dashboard Cards ──────────────────────────────────────── */
        .dash-card {
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 1.25rem; padding: 1.25rem;
        }
        .dash-label { font-size: 0.72rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.10em; margin: 0 0 0.2rem; }
        .dash-total { font-size: 1.9rem; font-weight: 900; color: #e2e8f0; line-height: 1; margin: 0; letter-spacing: -0.04em; }
        .dash-remain { font-size: 1.1rem; font-weight: 800; margin: 0; }
        .progress-track { height: 6px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; margin-top: 0.85rem; }
        .progress-bar { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
        .progress-label { font-size: 0.7rem; color: #475569; font-weight: 600; margin: 0.35rem 0 0; }
        .dash-set-budget-btn {
            font-size: 0.72rem; font-weight: 800; color: #93c5fd;
            background: rgba(37,99,235,0.12); border: 1px solid rgba(37,99,235,0.22);
            border-radius: 0.5rem; padding: 0.3rem 0.75rem; cursor: pointer;
        }
        .quick-add-btn {
            width: 100%; padding: 0.95rem; border-radius: 1rem;
            background: linear-gradient(135deg, #1d4ed8, #2563EB);
            border: none; color: #fff; font-weight: 800; font-size: 1rem;
            cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
            box-shadow: 0 4px 16px rgba(37,99,235,0.35);
            transition: transform 0.15s, box-shadow 0.15s;
        }
        .quick-add-btn:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(37,99,235,0.3); }

        /* ── Category chips ───────────────────────────────────────── */
        .section-label { font-size: 0.72rem; font-weight: 800; color: #475569; text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 0.6rem; }
        .cat-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }
        .cat-chip {
            display: flex; align-items: center; gap: 0.4rem;
            background: rgba(255,255,255,0.04); border: 1px solid transparent;
            border-radius: 999px; padding: 0.35rem 0.75rem; font-size: 0.78rem;
        }
        .cat-chip-label { color: #94a3b8; font-weight: 600; }
        .cat-chip-amt { color: #e2e8f0; font-weight: 800; }
        .see-all-btn { font-size: 0.72rem; font-weight: 800; color: #2563EB; background: none; border: none; cursor: pointer; padding: 0; }

        /* ── Item rows ────────────────────────────────────────────── */
        .item-row {
            display: flex; align-items: center; gap: 0.85rem;
            background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
            border-radius: 0.875rem; padding: 0.75rem 1rem;
        }
        .item-icon {
            width: 2.4rem; height: 2.4rem; border-radius: 0.65rem; flex-shrink: 0;
            display: flex; align-items: center; justify-content: center;
            border: 1px solid transparent;
        }
        .item-info { flex: 1; min-width: 0; }
        .item-name { font-size: 0.92rem; font-weight: 700; color: #e2e8f0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .item-meta { font-size: 0.72rem; color: #475569; font-weight: 600; margin: 0.1rem 0 0; }
        .item-amount { font-size: 0.92rem; font-weight: 800; color: #e2e8f0; margin: 0; white-space: nowrap; }
        .mark-btn {
            font-size: 0.65rem; font-weight: 800; color: #34d399;
            background: rgba(52,211,153,0.10); border: 1px solid rgba(52,211,153,0.2);
            border-radius: 999px; padding: 0.2rem 0.55rem; cursor: pointer; margin-top: 0.2rem; white-space: nowrap;
        }
        .del-btn {
            width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center;
            background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.18);
            border-radius: 0.5rem; color: #f87171; cursor: pointer; font-size: 0.85rem; flex-shrink: 0;
        }
        .item-actions { flex-shrink: 0; }
        .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1rem; color: #475569; text-align: center; }
        .empty-state p { margin: 0; font-weight: 700; color: #64748b; }
        .empty-sub { font-size: 0.8rem; color: #334155; margin-top: 0.35rem; }

        /* ── History filters ──────────────────────────────────────── */
        .filter-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
        .filter-pill {
            font-size: 0.75rem; font-weight: 800; padding: 0.35rem 0.85rem;
            border-radius: 999px; background: rgba(255,255,255,0.05);
            border: 1px solid rgba(255,255,255,0.08); color: #64748b; cursor: pointer; transition: all 0.15s;
        }
        .filter-pill.active { background: rgba(37,99,235,0.15); border-color: rgba(37,99,235,0.35); color: #93c5fd; }
        .total-bar { display: flex; justify-content: space-between; align-items: center; }
        .total-bar-amt { font-size: 1.1rem; font-weight: 900; color: #e2e8f0; }

        /* ── Add / Edit Form ──────────────────────────────────────── */
        .xpens-form { display: flex; flex-direction: column; gap: 1.1rem; }
        .form-group { display: flex; flex-direction: column; gap: 0.35rem; position: relative; }
        .form-row { display: flex; gap: 0.75rem; }
        .form-label { font-size: 0.72rem; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: 0.10em; }
        .form-ctrl {
            width: 100%; padding: 0.75rem 1rem; border-radius: 0.75rem;
            background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.10);
            color: #e2e8f0; font-size: 0.95rem; font-family: inherit; outline: none;
            transition: border-color 0.15s;
        }
        .form-ctrl:focus { border-color: rgba(37,99,235,0.5); }
        .form-ctrl option { background: #0c1445; }
        .status-toggle { display: flex; gap: 0.5rem; }
        .status-btn {
            flex: 1; padding: 0.65rem; border-radius: 0.65rem; font-size: 0.82rem; font-weight: 800;
            background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
            color: #64748b; cursor: pointer; transition: all 0.15s;
        }
        .status-btn.active { background: rgba(37,99,235,0.16); border-color: rgba(37,99,235,0.4); color: #93c5fd; }
        .submit-btn {
            width: 100%; padding: 1rem; border-radius: 0.875rem;
            background: linear-gradient(135deg, #1d4ed8, #2563EB);
            border: none; color: #fff; font-weight: 900; font-size: 1rem;
            cursor: pointer; box-shadow: 0 4px 14px rgba(37,99,235,0.35);
            transition: transform 0.15s, box-shadow 0.15s;
        }
        .submit-btn:active { transform: scale(0.98); }

        /* ── Autocomplete ─────────────────────────────────────────── */
        .autocomplete-list {
            position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
            background: #0f1a3a; border: 1px solid rgba(37,99,235,0.3);
            border-radius: 0.75rem; overflow: hidden;
            box-shadow: 0 8px 24px rgba(0,0,0,0.5);
        }
        .autocomplete-list.hidden { display: none; }
        .ac-item {
            display: flex; justify-content: space-between; align-items: center;
            padding: 0.65rem 1rem; cursor: pointer; font-size: 0.88rem; color: #e2e8f0;
            border-bottom: 1px solid rgba(255,255,255,0.05); transition: background 0.12s;
        }
        .ac-item:last-child { border-bottom: none; }
        .ac-item:hover, .ac-item:focus { background: rgba(37,99,235,0.14); }
        .ac-price { font-size: 0.72rem; color: #475569; font-weight: 700; white-space: nowrap; }

        /* ── Settings ─────────────────────────────────────────────── */
        .settings-section {
            background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
            border-radius: 1.1rem; overflow: hidden; margin-bottom: 1.25rem;
        }
        .settings-row {
            display: flex; justify-content: space-between; align-items: center;
            padding: 0.9rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        .settings-row:last-child { border-bottom: none; }
        .settings-row-label { font-size: 0.88rem; font-weight: 700; color: #94a3b8; }
        .settings-input {
            background: transparent; border: none; color: #e2e8f0;
            font-weight: 800; font-size: 0.92rem; text-align: right; width: 8rem; outline: none;
            font-family: inherit;
        }
        select.settings-input { cursor: pointer; }
        .settings-input::placeholder { color: #334155; }
        .danger-btn {
            width: 100%; padding: 0.85rem; border-radius: 0.875rem;
            background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.2);
            color: #f87171; font-weight: 800; font-size: 0.92rem;
            cursor: pointer; transition: background 0.15s;
        }
        .danger-btn:hover { background: rgba(239,68,68,0.18); }

        /* ── Toast ────────────────────────────────────────────────── */
        .xp-toast {
            background: rgba(15,26,58,0.95); backdrop-filter: blur(8px);
            border: 1px solid rgba(255,255,255,0.10); border-radius: 0.75rem;
            padding: 0.65rem 1rem; font-size: 0.85rem; font-weight: 700;
            color: #e2e8f0; pointer-events: auto;
            animation: fadeIn 0.2s ease; white-space: nowrap;
        }
        .xp-toast.success { border-color: rgba(52,211,153,0.3); color: #34d399; }
        .xp-toast.error   { border-color: rgba(239,68,68,0.3);  color: #f87171; }
    
