/* ============================================================
   KZSTORE — dark, warm, bento. Glass tiles with a top-lit
   hairline, monochrome accent, Bricolage + Inter + JetBrains Mono.
   ============================================================ */

:root {
    --bg: #0b0b0d;
    --bg-2: #0f0f12;
    --tile: rgba(21, 20, 23, 0.86);
    --tile-solid: #151417;
    --tile-2: #1b1a1e;
    --tile-hover: #201f23;
    --inset: #09090b;

    --line: rgba(255, 255, 255, 0.07);
    --line-2: rgba(255, 255, 255, 0.12);
    --line-3: rgba(255, 255, 255, 0.2);
    --lit: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.04) 40%, rgba(255,255,255,0.06) 100%);

    --ink: #f3efe8;
    --ink-2: #a5a099;
    --ink-3: #6d6960;

    --accent: #fafafa;
    --accent-hover: #ffffff;
    --accent-weak: rgba(255, 255, 255, 0.10);
    --accent-border: rgba(255, 255, 255, 0.22);
    --accent-ink: #0b0b0d;

    --success: #5bb27a;
    --success-weak: rgba(91, 178, 122, 0.14);
    --success-border: rgba(91, 178, 122, 0.3);
    --danger: #e0655f;
    --danger-weak: rgba(224, 101, 95, 0.13);
    --danger-border: rgba(224, 101, 95, 0.35);
    --warning: #eab308;
    --warning-weak: rgba(234, 179, 8, 0.12);

    --radius: 20px;
    --radius-md: 14px;
    --radius-sm: 11px;
    --pill: 999px;

    --font-display: 'Bricolage Grotesque', 'Inter', sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --t-fast: 0.16s;
    --t: 0.28s;

    --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 40px 90px rgba(0, 0, 0, 0.6);
    --content-max: 1240px;
}

/* ------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 12% 0%, rgba(255, 255, 255, 0.055), transparent 70%),
        radial-gradient(ellipse 50% 40% at 100% 100%, rgba(255, 255, 255, 0.035), transparent 70%),
        linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px) 0 0 / 72px 72px,
        linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px) 0 0 / 72px 72px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 0%, #000 10%, transparent 100%);
    mask-image: radial-gradient(ellipse 70% 60% at 30% 0%, #000 10%, transparent 100%);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-weak); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 5px; border: 2px solid var(--bg); }

.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }

.display {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }

/* ------------------------------------------------------------ glass tile */

.tile {
    position: relative;
    background:
        linear-gradient(var(--tile), var(--tile)) padding-box,
        var(--lit) border-box;
    border: 1px solid transparent;
    border-radius: var(--radius);
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 10px 30px rgba(0,0,0,0.28);
    transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.tile.is-link { cursor: pointer; }
.tile.is-link:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), var(--shadow); }

.tile-pad { padding: 24px 26px; }

.tile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.tile-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.tile-sub { color: var(--ink-2); font-size: 13px; margin-top: 3px; }

.tile-label { font-size: 13px; color: var(--ink-2); }
.tile-value { font-family: var(--font-display); font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; margin-top: 8px; }
.tile-value small { font-family: var(--font-sans); font-size: 14px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-left: 6px; }
.tile-value.accent { color: var(--accent); }
.tile-foot { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }

/* ------------------------------------------------------------ buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); box-shadow: 0 8px 22px rgba(255,255,255,0.10); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary { background: var(--tile-2); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--tile-hover); border-color: var(--line-2); }

.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); background: var(--tile); border-color: var(--line-2); }

.btn-danger { background: var(--danger-weak); color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: rgba(224, 101, 95, 0.2); }

.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: var(--radius-md); }
.btn-block { width: 100%; }
.btn-pill { border-radius: var(--pill); }

.btn[disabled], .btn.is-disabled { opacity: 0.45; pointer-events: none; }

.btn.is-loading { position: relative; pointer-events: none; }
.btn.is-loading > * { opacity: 0; }
.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.btn.is-success { background: var(--success); color: #0b1a0f; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ inputs */

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }

.input {
    width: 100%;
    padding: 12px 15px;
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 14px;
    transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--line-2); }
.input:focus { outline: none; border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-weak); }

.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.input-icon > .input { padding-left: 40px; }

select.input {
    appearance: none;
    padding-right: 36px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236d6960' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.input-pill { border-radius: var(--pill); background: var(--tile-2); padding-top: 10px; padding-bottom: 10px; font-size: 13.5px; }
textarea.input { resize: vertical; line-height: 1.6; }

/* ------------------------------------------------------------ pills / chips */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: var(--pill);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--tile-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
}

.pill-accent { background: var(--accent-weak); border-color: var(--accent-border); color: var(--accent); }
.pill-ink { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pill-silver { background: rgba(255,255,255,0.08); border-color: var(--line-3); color: var(--ink); }
.pill-ok { background: var(--success-weak); border-color: var(--success-border); color: var(--success); }
.pill-bad { background: var(--danger-weak); border-color: var(--danger-border); color: var(--danger); }
.pill-sm { padding: 3px 9px; font-size: 11px; }

.glyph {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--tile-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
}
.glyph svg { width: 20px; height: 20px; }
.glyph-accent { background: var(--accent-weak); border-color: var(--accent-border); color: var(--accent); }
.glyph-lg { width: 64px; height: 64px; border-radius: 18px; }
.glyph-lg svg { width: 28px; height: 28px; }

/* ------------------------------------------------------------ shell */

.shell { display: flex; flex-direction: column; min-height: 100vh; }

.topnav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 11, 13, 0.78);
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    border-bottom: 1px solid var(--line);
}

.topnav-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 14px 30px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    padding-right: 4px;
    white-space: nowrap;
}

.brand-mark {
    width: 22px; height: 22px;
    border-radius: 7px;
    background: var(--accent);
    display: grid; place-items: center;
    color: var(--accent-ink);
    flex-shrink: 0;
}
.brand-mark svg { width: 13px; height: 13px; }
.brand .pill { margin-left: 6px; }

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--pill);
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
    cursor: pointer;
}
.nav-item svg { width: 16px; height: 16px; }
.nav-item:hover { color: var(--ink); background: var(--tile-solid); }
.nav-item[aria-current="page"], .nav-item.active { color: var(--accent); background: var(--accent-weak); }

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

.balance {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 5px 5px 14px;
    border-radius: var(--pill);
    background: var(--accent-weak);
    border: 1px solid var(--accent-border);
}
.balance-amount { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--accent); letter-spacing: -0.01em; }
.balance-amount small { font-family: var(--font-sans); font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-left: 3px; }
.balance-add {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    display: grid; place-items: center;
    transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.balance-add:hover { background: var(--accent-hover); transform: scale(1.06); }
.balance-add svg { width: 13px; height: 13px; }

.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--tile-2);
    border: 1px solid var(--line-2);
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}
.user-name { font-size: 13.5px; font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-logout { font-size: 12px; color: var(--ink-3); cursor: pointer; transition: color var(--t-fast); }
.user-logout:hover { color: var(--danger); }

.stage {
    flex: 1;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 34px 30px 80px;
}

.page { animation: page-in var(--t) var(--ease-out) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.page-title { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
.page-sub { color: var(--ink-2); font-size: 14.5px; margin-top: 8px; }
.page-sub b { color: var(--ink); font-weight: 600; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters .input-icon { min-width: 240px; }
.filters select.input { width: auto; }

/* ------------------------------------------------------------ bento */

.bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: 1 / -1; }

.hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 190px;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute;
    right: -60px; top: -80px;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 65%);
    pointer-events: none;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.kpi { display: flex; flex-direction: column; justify-content: space-between; min-height: 150px; }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kpi-top .glyph { width: 36px; height: 36px; border-radius: 11px; }
.kpi-top .glyph svg { width: 17px; height: 17px; }

.meter { height: 6px; border-radius: 3px; background: var(--tile-2); overflow: hidden; margin-top: 14px; }
.meter > i { display: block; height: 100%; width: var(--w, 40%); background: var(--accent); border-radius: 3px; }

/* ------------------------------------------------------------ products */

.group-label {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 4px 0;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.group-label b { font-weight: 600; text-transform: capitalize; }
.group-label span { font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: var(--ink-3); }

.product {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 20px 18px;
}

.product-top { display: flex; align-items: center; gap: 14px; }
.product-title { min-width: 0; flex: 1; }
.product-code {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-name { font-size: 13px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.price { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.price small { font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }

/* ------------------------------------------------------------ lists inside tiles */

.list { display: flex; flex-direction: column; }
.list-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }
.list-main { min-width: 0; }
.list-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-title .mono { font-size: 14px; font-weight: 600; }
.list-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.list-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.list-end .num { font-size: 12px; color: var(--ink-3); }

.list-row.is-link { cursor: pointer; margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: var(--radius-sm); transition: background var(--t-fast) var(--ease); }
.list-row.is-link:hover { background: rgba(255,255,255,0.03); }

.kv { display: flex; flex-direction: column; }
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row > span:first-child { color: var(--ink-2); }
.kv-row > span:last-child { font-weight: 600; text-align: right; }

.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty svg { width: 32px; height: 32px; margin: 0 auto 12px; color: var(--ink-3); opacity: 0.7; }
.empty h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.empty p { font-size: 13px; }
.bento > .empty { grid-column: 1 / -1; }

/* ------------------------------------------------------------ deposit */

.amount-input { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 18px; }
.amount-currency { font-family: var(--font-display); font-size: 26px; color: var(--ink-3); font-weight: 600; }
.amount-input input {
    flex: 1; width: 100%; min-width: 0;
    background: none; border: 0;
    border-bottom: 1px solid var(--line-2);
    padding: 0 0 8px;
    font-family: var(--font-display);
    font-size: 56px; font-weight: 700; letter-spacing: -0.03em; line-height: 1;
    color: var(--ink);
    transition: border-color var(--t-fast) var(--ease);
    -moz-appearance: textfield;
}
.amount-input input::-webkit-outer-spin-button, .amount-input input::-webkit-inner-spin-button { -webkit-appearance: none; }
.amount-input input:focus { outline: 0; border-color: var(--accent); }

.quick-values { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-values button {
    padding: 8px 16px;
    border-radius: var(--pill);
    background: var(--tile-2);
    border: 1px solid var(--line);
    font-size: 13.5px; font-weight: 600;
    color: var(--ink-2);
    transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.quick-values button:hover { border-color: var(--line-2); color: var(--ink); }
.quick-values button.is-active { background: var(--accent-weak); border-color: var(--accent-border); color: var(--accent); }

.payment-pending { display: flex; gap: 14px; align-items: flex-start; }
.payment-pending strong { display: block; font-family: var(--font-display); font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.payment-pending p { color: var(--ink-2); font-size: 13.5px; }

/* ------------------------------------------------------------ profile / support */

.identity { display: flex; align-items: center; gap: 18px; }
.identity .avatar { width: 64px; height: 64px; font-size: 24px; border-radius: 20px; }
.identity h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.identity p { color: var(--ink-2); font-size: 14px; margin-top: 4px; }

.support-tile { display: flex; flex-direction: column; gap: 16px; }
.support-tile h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.support-tile p { color: var(--ink-2); font-size: 13.5px; flex: 1; }

/* ------------------------------------------------------------ modals */

.modal-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(6, 6, 8, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t) var(--ease), visibility var(--t);
}
.modal-overlay.is-open, .modal-overlay.active { opacity: 1; visibility: visible; }
.modal-overlay.is-closing { opacity: 0; transition-duration: var(--t-fast); }

.modal {
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background:
        linear-gradient(rgba(24, 23, 27, 0.92), rgba(24, 23, 27, 0.92)) padding-box,
        var(--lit) border-box;
    border: 1px solid transparent;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: opacity var(--t) var(--ease-out), transform var(--t) var(--ease-out);
}
.modal-overlay.is-open .modal, .modal-overlay.active .modal { opacity: 1; transform: none; }
.modal-overlay.is-closing .modal { opacity: 0; transform: translateY(6px) scale(0.98); transition-duration: var(--t-fast); }
.modal-lg { max-width: 560px; }

.modal-head, .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.modal-close {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--tile-2); border: 1px solid var(--line);
    color: var(--ink-2); display: grid; place-items: center;
    transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.modal-close:hover { color: var(--ink); border-color: var(--line-2); }
.modal-close svg { width: 14px; height: 14px; }
.modal-body { padding: 20px 24px 24px; }
.modal-foot, .modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 24px; }

.item-hero {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 26px 18px;
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: 18px;
}
.item-hero .mono { font-size: 19px; font-weight: 600; }
.item-hero-meta { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }

.buy-options { display: flex; flex-direction: column; gap: 10px; }
.buy-option {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 18px;
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    text-align: left;
    transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.buy-option:hover { border-color: var(--line-2); background: var(--tile-solid); transform: translateY(-1px); }
.buy-option.is-featured, .buy-option.featured { border-color: var(--accent-border); background: var(--accent-weak); }
.buy-option.is-featured:hover, .buy-option.featured:hover { border-color: var(--accent); }
.buy-option-title, .buy-option-info .buy-option-title { display: block; font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.buy-option-desc, .buy-option-info .buy-option-desc { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.buy-option-price { font-family: var(--font-display); font-size: 20px; font-weight: 700; white-space: nowrap; }
.buy-option.is-featured .buy-option-price, .buy-option.featured .buy-option-price { color: var(--accent); }

.flip { position: relative; perspective: 1100px; }
.flip-face { backface-visibility: hidden; transition: transform 0.5s var(--ease-out); }
.flip-front { position: relative; }
.flip-back { position: absolute; inset: 0; transform: rotateY(180deg); overflow-y: auto; }
.flip.is-flipped .flip-front { transform: rotateY(-180deg); pointer-events: none; }
.flip.is-flipped .flip-back { transform: rotateY(0); }
.flip:not(.is-flipped) .flip-back { pointer-events: none; }
.flip.is-settled .flip-front { position: absolute; inset: 0; overflow: hidden; }
.flip.is-settled .flip-back { position: relative; overflow: visible; }

.reveal-code { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--accent); letter-spacing: 0.02em; word-break: break-all; }

/* ------------------------------------------------------------ toasts */

.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: rgba(27, 26, 30, 0.92);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-md);
    font-size: 13.5px; font-weight: 500;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    animation: toast-in var(--t) var(--ease-out) both;
    pointer-events: auto;
}
.toast.is-leaving { animation: toast-out var(--t-fast) var(--ease) forwards; }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast-ok svg, .toast.success svg { color: var(--success); }
.toast-bad svg, .toast.error svg { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ------------------------------------------------------------ auth */

.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 42px 40px 36px; }
.auth-card h1 { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; margin: 20px 0 8px; }
.auth-sub { color: var(--ink-2); font-size: 14.5px; margin-bottom: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-alt { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; }
.auth-alt a { color: var(--ink); font-weight: 600; }
.auth-alt a:hover { color: var(--accent); }

.form-error {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 14px;
    background: var(--danger-weak); border: 1px solid var(--danger-border);
    border-radius: var(--radius-sm);
    color: var(--danger); font-size: 13px;
    margin-bottom: 16px;
}
.form-error svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.form-error.is-shaking { animation: shake 0.32s var(--ease); }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 50%{transform:translateX(6px)} 75%{transform:translateX(-4px)} }

/* ------------------------------------------------------------ tables (admin) */

.table-wrap { overflow-x: auto; margin: 0 -26px -24px; padding: 0 26px 6px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; padding: 10px 14px 12px; font-size: 12px; font-weight: 600; color: var(--ink-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; text-align: right; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast) var(--ease); }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }
.table .accent { color: var(--accent); font-weight: 600; }
.table .td-empty { text-align: center; padding: 40px 0; color: var(--ink-3); }

.import-format { font-size: 12.5px; color: var(--ink-3); }
.import-format code { font-family: var(--font-mono); font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--inset); border: 1px solid var(--line); color: var(--ink-2); }

.sold-to { margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--inset); border: 1px solid var(--line); font-size: 13.5px; }
.sold-to strong { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; font-weight: 600; }
.sold-to span { display: block; color: var(--ink-2); }

/* ------------------------------------------------------------ credit card visual */

.cc-visual {
    background: linear-gradient(145deg, #1c1c22 0%, #0d0d10 100%);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    min-height: 140px;
    color: white;
    border: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}
.cc-visual.gold { background: linear-gradient(145deg, #b8860b 0%, #8b6914 100%); }
.cc-visual.platinum { background: linear-gradient(145deg, #52525b 0%, #3f3f46 100%); }
.cc-visual.black { background: linear-gradient(145deg, #18181b 0%, #09090b 100%); }
.cc-visual.infinite { background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%); }

.cc-chip {
    width: 36px; height: 26px;
    background: linear-gradient(135deg, #d4a44a 0%, #9a7735 100%);
    border-radius: 5px;
    margin-bottom: 16px;
}

.cc-number {
    font-family: var(--font-mono);
    font-size: 18px;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.cc-bottom { display: flex; gap: 32px; }
.cc-field-label { font-size: 9px; opacity: 0.5; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.cc-field-value { font-family: var(--font-mono); font-size: 13px; letter-spacing: 1px; }

.cc-brand { position: absolute; top: 16px; right: 20px; width: 48px; height: 32px; }
.cc-brand svg { width: 100%; height: 100%; fill: currentColor; }

/* ------------------------------------------------------------ history cards */

.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.history-card {
    background: var(--tile);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.history-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); }

.history-card-top {
    background: linear-gradient(135deg, #1e1e24, #141418);
    padding: 16px;
    position: relative;
    height: 90px;
}
.history-card-top.gold { background: linear-gradient(135deg, #d4a44a, #9a7735); }
.history-card-top.platinum { background: linear-gradient(135deg, #71717a, #52525b); }
.history-card-top.black { background: linear-gradient(135deg, #1c1c1f, #0a0a0b); }

.history-card-chip { width: 28px; height: 20px; background: linear-gradient(135deg, #fbbf24, #d97706); border-radius: 4px; }
.history-card-bin { position: absolute; bottom: 16px; left: 16px; font-family: var(--font-mono); font-size: 14px; color: rgba(255,255,255,0.9); letter-spacing: 1px; }
.history-card-brand { position: absolute; top: 12px; right: 12px; width: 32px; height: 20px; }
.history-card-brand svg { width: 100%; height: 100%; }

.history-card-bottom { padding: 14px 16px; }
.history-card-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.history-card-level { font-size: 13px; font-weight: 600; }
.history-card-bank { font-size: 12px; color: var(--ink-2); }
.history-card-meta { display: flex; justify-content: space-between; align-items: center; }
.history-card-type { font-size: 11px; padding: 3px 8px; background: var(--tile-2); border-radius: 4px; color: var(--ink-2); }
.history-card-date { font-size: 11px; color: var(--ink-3); }

/* ------------------------------------------------------------ pix/recharge */

.pix-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
@media (max-width: 900px) { .pix-layout { grid-template-columns: 1fr; } }

.qr-container { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px; }
.qr-box { background: white; padding: 16px; border-radius: var(--radius-sm); }
.qr-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--warning); }
.qr-status::before { content: ''; width: 8px; height: 8px; background: var(--warning); border-radius: 50%; animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1100px) {
    .product { grid-column: span 6; }
    .span-3 { grid-column: span 6; }
    .span-4, .span-5, .span-7, .span-8 { grid-column: span 6; }
    .hero, .span-6 { grid-column: span 12; }
}

@media (max-width: 768px) {
    .topnav-inner { flex-wrap: wrap; gap: 10px 14px; padding: 12px 18px; }
    .nav { order: 3; flex-basis: 100%; }
    .user-name { display: none; }
    .stage { padding: 24px 18px 60px; }
    .page-title { font-size: 26px; }
    .filters { width: 100%; }
    .filters .input-icon { min-width: 0; flex: 1 1 100%; }
    .filters select.input { flex: 1; }
    .bento { gap: 12px; }
    .product, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
    .tile-pad { padding: 20px; }
    .amount-input input { font-size: 44px; }
    .auth-card { padding: 32px 24px 28px; }
    .auth-row { grid-template-columns: 1fr; }
    .toast-container { left: 16px; right: 16px; bottom: 16px; }
    .table-wrap { margin: 0 -20px -20px; padding: 0 20px 6px; }
}

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

/* ------------------------------------------------------------ pagination */

.pagination { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pagination-controls { display: flex; align-items: center; gap: 4px; }
.pagination-controls button { min-width: 36px; height: 36px; padding: 0 8px; }
.pagination-controls button:disabled { opacity: 0.3; cursor: not-allowed; }
.pagination-dots { color: var(--ink-3); padding: 0 4px; }
.pagination-info { font-size: 12px; color: var(--ink-3); }

@media (max-width: 768px) {
    .pagination-controls button { min-width: 32px; height: 32px; font-size: 12px; }
}

/* ------------------------------------------------------------ loading state */

.loading-state { 
    grid-column: 1 / -1; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    padding: 60px 20px;
    gap: 16px;
}
.loading-state p { color: var(--ink-2); font-size: 14px; }
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--tile-2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ filtros avançados */

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--tile);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.filters-bar select,
.filters-bar input {
    background: var(--inset);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--ink);
    font-size: 13px;
    min-width: 120px;
}

.filters-bar select:focus,
.filters-bar input:focus {
    outline: none;
    border-color: var(--accent-border);
}

.filters-bar .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filters-bar .filter-label {
    font-size: 11px;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* bin search */
.bin-search {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.bin-search input {
    flex: 1;
    max-width: 200px;
}
.bin-search button {
    padding: 8px 16px;
}
