/* ══════════════════════════════════════════════════════
   JYWA PAYMENT — "MIDNIGHT AURORA"
   Tema original: hitam pekat biru-malam dengan satu energi
   aurora cyan→biru sebagai identitas. Elegan, tenang, presisi.

   Filosofi:
   - Background hampir hitam (#07090f) = kanvas malam
   - Satu warna hidup: aurora (#38e1ff → #2f6bff) HANYA di
     titik fokus (CTA, saldo, indikator aktif) — sisanya diam
   - Tipografi besar & percaya diri untuk angka
   - Garis halus (hairline) memisahkan ruang, bukan kotak
   - Motion minimal tapi bermakna
   ══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --bg: #07090f;
    --surface: #0c1018;
    --surface-2: #11161f;

    --line: rgba(148, 170, 210, 0.09);        /* hairline */
    --line-strong: rgba(148, 170, 210, 0.16);

    --text: #eef2f9;
    --dim: #8b96ab;
    --faint: #4d5870;

    --aurora: #38e1ff;                         /* cyan utama */
    --aurora-deep: #2f6bff;                    /* biru dalam */
    --aurora-dim: rgba(56, 225, 255, 0.10);

    --green: #3ddc97;
    --red: #ff5c72;
    --yellow: #ffc94d;

    --radius: 18px;
    --radius-sm: 12px;
    --nav-h: 66px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(47, 107, 255, 0.07), transparent 60%),
        radial-gradient(900px 420px at 0% 0%, rgba(56, 225, 255, 0.05), transparent 55%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* ─── Angka pakai display font — biar terasa "uang" ─── */
.bal-amount, .stat-num {
    font-family: 'Space Grotesk', monospace;
    letter-spacing: -0.02em;
}

/* ═════════ TOPBAR ═════════ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(7, 9, 15, 0.82);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--line);
}
.topbar::after {
    /* garis aurora tipis di bawah header — sinyal brand yang subtle */
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--aurora), transparent);
    opacity: 0.35;
}
.icon-btn {
    width: 40px; height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    color: var(--text);
}
.icon-btn svg { width: 18px; height: 18px; }
.avatar {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--aurora), var(--aurora-deep));
    color: #04121c;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

/* ═════════ PAGE ═════════ */
.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 16px 28px;
}

/* ═════════ BANNER AURORA ═════════ */
.banner-inner {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: var(--radius);
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
}
.banner-inner::before {
    /* aurora sweep: satu cahaya bergerak lambat */
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(320px 160px at 88% 120%, rgba(56, 225, 255, 0.16), transparent 65%),
        radial-gradient(260px 140px at 12% -30%, rgba(47, 107, 255, 0.14), transparent 60%);
    pointer-events: none;
}
.banner-inner > * { position: relative; }
.banner-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--aurora);
    margin-bottom: 9px;
}
.banner-tag::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--aurora);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 50% { opacity: 0.35; } }
.banner-title {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.32;
    letter-spacing: -0.015em;
    max-width: 240px;
}
.banner-cta {
    display: inline-block;
    margin-top: 12px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--aurora);
}
.banner-emoji {
    font-size: 46px;
    filter: drop-shadow(0 6px 18px rgba(56, 225, 255, 0.25));
}

/* ═════════ SALDO — pusat perhatian ═════════ */
.balance-card {
    position: relative;
    margin-top: 14px;
    padding: 22px 20px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
}
.balance-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(56,225,255,0.45), transparent 38%, transparent 62%, rgba(47,107,255,0.35));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.bal-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
}
.bal-label .eye {
    cursor: pointer;
    color: var(--faint);
    display: inline-flex;
}
.eye svg { width: 15px; height: 15px; }
.bal-amount {
    font-size: 34px;
    font-weight: 700;
    margin-top: 6px;
    background: linear-gradient(90deg, var(--text), var(--aurora));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.bal-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--aurora);
    background: var(--aurora-dim);
    border: 1px solid rgba(56, 225, 255, 0.25);
}
.role-badge::before {
    content: '◆';
    font-size: 8px;
}
.bal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}
.bal-user {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--dim);
    display: flex;
    justify-content: space-between;
}

/* ═════════ TOMBOL ═════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: none;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.2s;
    min-height: 44px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    color: #04121c;
    background: linear-gradient(135deg, var(--aurora), var(--aurora-deep));
    box-shadow: 0 8px 24px -8px rgba(56, 225, 255, 0.55);
}
.btn-primary:hover { box-shadow: 0 10px 30px -8px rgba(56, 225, 255, 0.75); transform: translateY(-1px); }
.btn-ghost {
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--aurora-dim); color: var(--aurora); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 9px 14px; font-size: 13px; border-radius: 11px; }
.btn-flex { width: 100%; }

/* ═════════ FORM ═════════ */
.form-group { margin-bottom: 15px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--dim);
    margin-bottom: 7px;
}
.input {
    width: 100%;
    background: var(--bg-input, #0a0e14);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 13px 15px;
    font-size: 16px; /* cegah iOS zoom-on-focus */
    font-family: inherit;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: rgba(148, 170, 210, 0.25); }
.input:focus {
    border-color: var(--aurora);
    box-shadow: 0 0 0 3px rgba(56, 225, 255, 0.12);
}
select.input { appearance: none; }
textarea.input { resize: vertical; min-height: 90px; }

/* Autocomplete kuning browser → samakan dengan tema */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px #0a0e14 inset;
    transition: background-color 9999s ease-in-out 0s;
}

/* ═════════ GRID KATEGORI ═════════ */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 34px 0 14px;   /* beri ruang napas antar section */
}
.section-head h3 {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--text);
}
.section-head .see-all {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--dim);
    transition: color 0.2s;
}
.section-head .see-all:hover { color: var(--aurora); }

.category-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 11px;
}
.cat-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 16px 6px 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.cat-tile:active { transform: scale(0.95); }
@media (hover: hover) {
    .cat-tile:hover {
        border-color: rgba(56, 225, 255, 0.35);
        transform: translateY(-3px);
        box-shadow: 0 14px 34px -14px rgba(56, 225, 255, 0.25);
    }
}
/* titik indikator aurora kecil di pojok tile */
.cat-tile::after {
    content: '';
    position: absolute;
    top: 10px; right: 10px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--line-strong);
    transition: all 0.3s var(--ease);
}
.cat-tile:hover::after { background: var(--aurora); box-shadow: 0 0 8px var(--aurora); }
.cat-icon {
    width: 48px; height: 48px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    background: var(--surface-2);
    border: 1px solid var(--line);
}
.more-tile { border-style: dashed; border-color: var(--line-strong); }
.more-tile .cat-icon {
    background: transparent;
    border: none;
    color: var(--aurora);
    font-size: 26px;
    font-weight: 300;
    line-height: 1;
    padding-bottom: 4px;
}
.more-tile:hover { border-color: rgba(56, 225, 255, 0.4); }
.cat-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--dim);
    text-align: center;
    line-height: 1.3;
}
.cat-tile:hover .cat-name { color: var(--text); }

/* ═════════ NEWS ═════════ */
.news-section { margin-top: 4px; }
.news-card {
    position: relative;
    padding: 16px 16px 14px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    transition: border-color 0.3s var(--ease);
}
.news-card:hover { border-color: var(--line-strong); }
.news-card::before {
    /* aksen garis kiri aurora */
    content: '';
    position: absolute;
    left: 0; top: 14px; bottom: 14px;
    width: 2px;
    border-radius: 99px;
    background: linear-gradient(var(--aurora), var(--aurora-deep));
    opacity: 0.7;
}
.news-title { font-size: 13.5px; font-weight: 700; line-height: 1.42; }
.news-body {
    font-size: 12.5px;
    color: var(--dim);
    line-height: 1.6;
    margin-top: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-date { font-size: 11px; color: var(--faint); margin-top: 9px; }

/* ═════════ BOTTOM NAV — floating dock ═════════ */
.bottom-nav {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 200;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    background: rgba(12, 16, 24, 0.88);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    box-shadow: 0 16px 44px -12px rgba(0, 0, 0, 0.65);
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    border-radius: 18px;
    position: relative;
    transition: color 0.25s var(--ease);
}
.bottom-nav a svg { width: 21px; height: 21px; transition: transform 0.3s var(--ease); }
.bottom-nav a.active { color: var(--aurora); }
.bottom-nav a.active svg {
    filter: drop-shadow(0 0 10px rgba(56, 225, 255, 0.45));
    transform: translateY(-2px);
}
/* indikator garis aurora di atas item aktif */
.bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: -1px;
    width: 18px;
    height: 2px;
    border-radius: 99px;
    background: var(--aurora);
    box-shadow: 0 0 8px var(--aurora);
}

/* ═════════ MODAL ═════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(3, 5, 9, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.modal-box {
    width: 100%;
    max-height: 82vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 26px 26px 0 0;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    animation: sheet-up 0.4s var(--ease);
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.modal-head h3 { font-size: 16px; font-weight: 800; }
.modal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 11px;
}

/* ═════════ KOMPONEN DASAR (card, chip, row, badge) ═════════ */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
}
.card-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
    color: var(--text);
}
.card + .card, .card + .mt-1 { border-color: var(--line); }

/* Chips filter */
.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 99px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--dim);
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.25s var(--ease);
}
.chip.active {
    background: var(--aurora-dim);
    border-color: rgba(56, 225, 255, 0.35);
    color: var(--aurora);
}

/* Row list */
.row-list { display: flex; flex-direction: column; }
.row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.row-item:last-child { border-bottom: none; padding-bottom: 4px; }
.row-item:first-child { padding-top: 4px; }
.row-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.row-sub { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.row-value { font-size: 13.5px; font-weight: 800; text-align: right; white-space: nowrap; font-family: 'Space Grotesk', monospace; }
.row-value.blue { color: var(--aurora); }
.row-value.green { color: var(--green); }
.row-value.red { color: var(--red); }
.row-value.bold { font-size: 15px; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 99px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.05em;
}
.badge-blue { background: var(--aurora-dim); color: var(--aurora); border: 1px solid rgba(56,225,255,0.25); }
.badge-green { background: rgba(61,220,151,0.09); color: var(--green); border: 1px solid rgba(61,220,151,0.28); }
.badge-red { background: rgba(255,92,114,0.09); color: var(--red); border: 1px solid rgba(255,92,114,0.28); }
.badge-yellow { background: rgba(255,201,77,0.09); color: var(--yellow); border: 1px solid rgba(255,201,77,0.28); }

/* Form dasar (untuk halaman dalam) */
.form-group { margin-bottom: 15px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--dim);
    margin-bottom: 7px;
}

/* ═════════ UTIL ═════════ */
.muted { color: var(--dim); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.hidden { display: none !important; }

/* ═════════ DESKTOP ═════════ */
@media (min-width: 900px) {
    body { padding-bottom: 0; }
    .app-shell {
        display: grid;
        grid-template-columns: 250px 1fr;
        max-width: 1180px;
        margin: 0 auto;
        min-height: 100vh;
    }
    .bottom-nav { display: none; }
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding: 24px 16px;
        border-right: 1px solid var(--line);
    }
    .sidebar .brand {
        display: flex;
        align-items: center;
        gap: 10px;
        font-family: 'Space Grotesk', sans-serif;
        font-size: 19px;
        font-weight: 700;
        letter-spacing: -0.01em;
        padding: 0 10px 20px;
    }
    .sidebar .brand em {
        font-style: normal;
        color: var(--aurora);
    }
    .sidebar a.nav-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        border-radius: 13px;
        color: var(--dim);
        font-size: 13.5px;
        font-weight: 600;
        border: 1px solid transparent;
        transition: all 0.25s var(--ease);
    }
    .sidebar a.nav-link svg { width: 18px; height: 18px; }
    .sidebar a.nav-link:hover { color: var(--text); background: var(--surface); }
    .sidebar a.nav-link.active {
        color: var(--aurora);
        background: var(--aurora-dim);
        border-color: rgba(56, 225, 255, 0.22);
    }
    .admin-info {
        margin-top: auto;
        padding: 16px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        font-size: 12px;
        color: var(--dim);
        line-height: 1.65;
    }
    .admin-info strong { color: var(--text); display: block; margin-bottom: 3px; }
    .admin-info a { color: var(--aurora); }
    .page { padding: 30px 34px; }
    .topbar { display: none; }
    .category-section { grid-template-columns: repeat(4, 1fr); gap: 13px; }
}

@media (min-width: 600px) and (max-width: 899px) {
    .category-section { grid-template-columns: repeat(4, 1fr); }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
