/* ============================================================================
 * ZKNesia Billing · Design System v2 — "Studio"
 * A crisp, professional dark UI. Cool near-black surfaces, a single confident
 * indigo accent, precise hairline borders, and a modern geometric typeface.
 * Solid flat colors (hex); gradients are avoided except a couple of hairline
 * highlights for depth. All class + CSS-variable names are preserved so every
 * page inherits the new look automatically.
 * ========================================================================== */

:root {
    /* ── Surfaces (cool near-black, stepped by luminance) ── */
    --bg:            #0b0d11;
    --bg-2:          #0f1217;
    --surface:       #14181e;
    --surface-2:     #1a1f27;
    --surface-3:     #222833;

    /* ── Lines ── */
    --border:        #262d38;
    --border-soft:   #1e242d;
    --border-strong: #333c49;

    /* ── Type ── */
    --text:          #e8ebf0;
    --text-dim:      #c2c8d2;
    --muted:         #8b93a1;
    --faint:         #5d6675;

    /* ── Accent — professional indigo, solid, used deliberately ── */
    --primary:       #635bff;
    --primary-2:     #7d76ff;   /* hover */
    --primary-3:     #4f46e5;   /* pressed */
    --primary-tint:  rgba(99, 91, 255, .12);
    --primary-line:  rgba(99, 91, 255, .32);
    --primary-glow:  rgba(99, 91, 255, .35);
    --accent:        #22d3ee;

    /* ── Status (flat hex) ── */
    --success:       #10b981;
    --success-tint:  rgba(16, 185, 129, .12);
    --warning:       #f59e0b;
    --warning-tint:  rgba(245, 158, 11, .12);
    --danger:        #f04438;
    --danger-tint:   rgba(240, 68, 56, .12);
    --info:          #3b82f6;
    --info-tint:     rgba(59, 130, 246, .12);

    /* ── Shape ── */
    --radius:        16px;
    --radius-sm:     11px;
    --radius-lg:     22px;

    /* ── Depth — soft, layered, ambient (premium material feel) ── */
    --shadow:        0 1px 1px rgba(0, 0, 0, .16), 0 3px 6px -2px rgba(0, 0, 0, .28), 0 12px 28px -14px rgba(0, 0, 0, .5);
    --shadow-lg:     0 6px 14px -4px rgba(0, 0, 0, .3), 0 28px 64px -22px rgba(0, 0, 0, .72);
    --rim:           inset 0 1px 0 rgba(255, 255, 255, .05);

    --font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', 'Menlo', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    letter-spacing: -0.006em;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg, video, canvas { max-width: 100%; }
img { height: auto; }
::selection { background: rgba(99, 91, 255, .38); color: #fff; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ── Technical mono helpers ─────────────────────────────────────────────── */
.mono { font-family: var(--font-mono); font-feature-settings: "zero" 1; }

.tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono);
    font-size: .68rem; font-weight: 600; letter-spacing: .14em;
    text-transform: uppercase; color: var(--muted);
}
.tag::before { content: '['; color: var(--primary-2); }
.tag::after  { content: ']'; color: var(--primary-2); }

.eyebrow, .eyebrow-chip {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: .68rem; font-weight: 600; letter-spacing: .16em;
    text-transform: uppercase; color: var(--primary-2);
    padding: 5px 11px; border: 1px solid var(--primary-line);
    border-radius: 7px; background: var(--primary-tint);
    margin-bottom: 12px;
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(11, 13, 17, .72);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; letter-spacing: -.03em; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; font-size: 18px; color: #fff; box-shadow: var(--rim); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a { padding: 8px 14px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; font-size: .9rem; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--text); background: var(--surface); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 700; font-size: .9rem;
    border: 1px solid transparent; cursor: pointer; white-space: nowrap; letter-spacing: -.01em;
    transition: background .15s, border-color .15s, color .15s, transform .08s, box-shadow .15s;
    -webkit-tap-highlight-color: transparent; user-select: none; font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg, .qa-btn svg, .side-link svg, a.inline-link svg {
    width: 16px; height: 16px; flex-shrink: 0; display: inline-block; vertical-align: middle;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--rim), 0 6px 18px -8px var(--primary-glow); }
.btn-primary:hover { background: var(--primary-2); box-shadow: var(--rim), 0 10px 24px -8px var(--primary-glow); }
.btn-primary:active { background: var(--primary-3); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-danger { background: transparent; color: #fca5a5; border-color: rgba(240, 68, 56, .42); }
.btn-danger:hover { background: var(--danger-tint); color: #fecaca; }
.btn-success { background: var(--success); color: #04241a; }
.btn-success:hover { background: #0ea371; color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 22px; font-size: .95rem; }
.btn-sm { padding: 7px 12px; font-size: .82rem; }
.btn-lg svg { width: 17px; height: 17px; }
.btn-sm svg { width: 14px; height: 14px; }

/* ── Cards & surfaces ───────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--rim), var(--shadow);
    transition: border-color .18s, transform .18s, box-shadow .18s;
}
.card:hover { border-color: var(--border-strong); }
.card-pad { padding: 24px; }
.grid { display: grid; gap: 18px; }

/* ── Hero (marketing / welcome) ─────────────────────────────────────────── */
.hero { padding: 68px 0 32px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.08; }
.hero .gradient { color: var(--primary-2); }
.hero p { color: var(--muted); font-size: 1.06rem; max-width: 600px; margin: 18px auto 0; }
.heading-mega { font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.08; }

/* Emphasized words — solid indigo (always visible) */
.gradient-text, .text-animate { color: var(--primary-2); -webkit-text-fill-color: currentColor; background: none; }
.type-caret::after { content: '|'; display: inline-block; margin-left: 2px; color: var(--primary-2); animation: caret-blink 1s steps(1) infinite; }
@keyframes caret-blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }

/* ── Plan grid ──────────────────────────────────────────────────────────── */
.plans { grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); padding: 24px 0 64px; }
.plan-card { position: relative; padding: 24px; display: flex; flex-direction: column; transition: border-color .18s, transform .18s; overflow: hidden; }
.plan-card:hover { transform: translateY(-3px); border-color: var(--primary-line); }
.plan-card .icon { font-size: 28px; margin-bottom: 8px; }
.plan-card h3 { font-size: 1.3rem; font-weight: 700; }
.plan-card .desc { color: var(--muted); font-size: .88rem; min-height: 38px; margin: 6px 0 14px; }
.plan-card .price { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.plan-card .price span { font-size: .88rem; color: var(--muted); font-weight: 500; }
.plan-specs { list-style: none; margin: 16px 0; display: grid; gap: 9px; }
.plan-specs li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; }
.plan-specs li b { color: var(--text); font-weight: 600; }

.badge {
    position: absolute; top: 16px; right: -34px; transform: rotate(45deg);
    background: var(--primary); color: #fff; font-size: .64rem; font-weight: 700;
    padding: 4px 40px; letter-spacing: .1em; text-transform: uppercase; font-family: var(--font-mono);
}
.badge.recommended { background: var(--accent); color: #04222e; }

.plan-card-v2 {
    position: relative; padding: 26px 24px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--rim), var(--shadow);
    transition: transform .2s, border-color .2s, box-shadow .2s;
    display: flex; flex-direction: column; gap: 16px;
}
.plan-card-v2:hover { transform: translateY(-4px); border-color: var(--primary-line); box-shadow: var(--rim), var(--shadow-lg); }
.plan-card-v2.is-featured { border-color: var(--primary-line); }
.plan-ribbon {
    position: absolute; top: 14px; right: -38px;
    background: var(--primary); color: #fff;
    font-size: .64rem; font-weight: 700; padding: 5px 44px;
    letter-spacing: .1em; text-transform: uppercase; font-family: var(--font-mono);
    transform: rotate(45deg);
}
.plan-ribbon.bs { background: var(--warning); color: #241a02; }
.plan-card-v2 .plan-name { font-size: 1.4rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; }
.plan-card-v2 .plan-desc { color: var(--muted); font-size: .86rem; min-height: 36px; line-height: 1.5; }
.plan-price { display: flex; align-items: baseline; gap: 4px; margin-top: 6px; }
.plan-price .nominal { font-size: 2rem; font-weight: 800; letter-spacing: -.035em; color: var(--text); font-variant-numeric: tabular-nums; }
.plan-price .period { color: var(--muted); font-size: .85rem; font-weight: 500; }

.plan-orb {
    position: relative; display: grid; place-items: center;
    width: 68px; height: 68px; border-radius: 18px;
    background: var(--primary-tint); border: 1px solid var(--primary-line);
    color: var(--primary-2); font-size: 30px; line-height: 1;
}

.specs-v2 { list-style: none; display: grid; gap: 10px; padding: 0; margin: 4px 0 0; }
.specs-v2 li { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); }
.specs-v2 li b { color: var(--text); font-weight: 700; }
.specs-v2 .spec-ic { width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; background: var(--primary-tint); color: var(--primary-2); }
.specs-v2 .spec-ic svg { width: 14px; height: 14px; }
.specs-v2 .spec-ic.ram  { background: var(--info-tint);    color: var(--info); }
.specs-v2 .spec-ic.cpu  { background: var(--warning-tint); color: var(--warning); }
.specs-v2 .spec-ic.disk { background: var(--success-tint); color: var(--success); }
.specs-v2 .spec-ic.port { background: var(--danger-tint);  color: var(--danger); }
.specs-v2 .spec-ic.db   { background: var(--primary-tint); color: var(--primary-2); }
.specs-v2 .spec-ic.bk   { background: var(--info-tint);    color: var(--info); }

/* ── Spec tiles ─────────────────────────────────────────────────────────── */
.spec-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.spec-tile { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.spec-tile .si { width: 40px; height: 40px; border-radius: 11px; background: var(--primary-tint); display: grid; place-items: center; font-size: 19px; }
.spec-tile .si svg { width: 19px; height: 19px; color: var(--primary-2); }
.spec-tile .sl { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-mono); }
.spec-tile .sv { font-size: 1.02rem; font-weight: 700; }

.trust-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 28px 0 8px; }
.trust-pill { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.trust-pill .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-tint); color: var(--primary-2); display: grid; place-items: center; flex-shrink: 0; }
.trust-pill .ic svg { width: 18px; height: 18px; }
.trust-pill strong { display: block; font-size: .92rem; }
.trust-pill span { color: var(--muted); font-size: .76rem; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 7px; font-weight: 600; font-family: var(--font-mono); letter-spacing: .03em; text-transform: uppercase; }
.input, .select, textarea.input {
    width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
    background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
    font-size: 16px; transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
@media (min-width: 768px) { .input, .select, textarea.input { font-size: .92rem; } }
.input::placeholder, textarea.input::placeholder { color: var(--faint); }
.input:hover:not(:focus), .select:hover:not(:focus) { border-color: var(--border-strong); }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-tint); }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b93a1' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; color: var(--muted); }
.checkbox-row input { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: transparent; border: none; cursor: pointer; font-size: 1.05rem; padding: 6px; line-height: 1; border-radius: 8px; color: var(--muted); }
.pw-toggle:hover { background: var(--surface-2); }

/* ── Auth ───────────────────────────────────────────────────────────────── */
.auth-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 410px; padding: 34px; }
.auth-card h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: .92rem; margin-bottom: 24px; }
.auth-foot { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 18px; }
.auth-foot a { color: var(--primary-2); font-weight: 600; }

.auth-badge {
    width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 20px;
    background: var(--primary-tint); border: 1px solid var(--primary-line);
    color: var(--primary-2); display: grid; place-items: center;
}
.auth-badge svg { width: 32px; height: 32px; }

.auth-split { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 66px); }
.auth-split .auth-art {
    position: relative; overflow: hidden; padding: 48px;
    background: var(--bg-2); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; justify-content: space-between;
}
.auth-split .auth-art::before {
    content: ''; position: absolute; inset: 0; opacity: .55; pointer-events: none;
    background-image:
        linear-gradient(var(--border-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(ellipse at center, #000 22%, transparent 78%);
}
.auth-split .auth-art .orb { display: none; }
.auth-split .auth-art .top, .auth-split .auth-art .mid, .auth-split .auth-art .bot { position: relative; z-index: 1; }
.auth-split .auth-art .brand-row { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.auth-split .auth-art .brand-row img { width: 40px; height: 40px; border-radius: 11px; }
.auth-split .auth-art h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.14; max-width: 26ch; }
.auth-split .auth-art h2 span { color: var(--primary-2); }
.auth-split .auth-art p { color: var(--muted); margin-top: 14px; max-width: 38ch; font-size: 1rem; line-height: 1.6; }
.auth-feats { display: grid; gap: 12px; margin-top: 24px; max-width: 380px; }
.auth-feat { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .18s, transform .18s; }
.auth-feat:hover { border-color: var(--primary-line); transform: translateX(3px); }
.auth-feat .ic { width: 32px; height: 32px; border-radius: 10px; background: var(--primary-tint); color: var(--primary-2); display: grid; place-items: center; flex-shrink: 0; }
.auth-feat .ic svg { width: 18px; height: 18px; }
.auth-feat .ft strong { display: block; font-size: .92rem; }
.auth-feat .ft span { color: var(--muted); font-size: .82rem; }
.auth-split .auth-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.auth-split .auth-form { width: 100%; max-width: 400px; }
.auth-split .auth-form h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-split .auth-form .sub { color: var(--muted); font-size: .92rem; margin-bottom: 22px; }

@media (max-width: 900px) {
    .auth-split { grid-template-columns: 1fr; min-height: auto; }
    .auth-split .auth-art { padding: 32px 24px; border-right: none; border-bottom: 1px solid var(--border); }
    .auth-split .auth-art h2 { font-size: 1.6rem; }
    .auth-feats { display: none; }
}

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert { padding: 12px 15px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 16px; border: 1px solid; border-left-width: 3px; }
.alert-success { background: var(--success-tint); border-color: rgba(16, 185, 129, .3); color: #6ee7b7; }
.alert-error { background: var(--danger-tint); border-color: rgba(240, 68, 56, .3); color: #fca5a5; }
.alert-info { background: var(--primary-tint); border-color: var(--primary-line); color: #b4aeff; }
.alert-warning { background: var(--warning-tint); border-color: rgba(245, 158, 11, .3); color: #fcd34d; }

/* ── Status pills ───────────────────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: .74rem; font-weight: 600; border: 1px solid transparent; letter-spacing: .01em; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-pending { background: var(--warning-tint); color: var(--warning); border-color: rgba(245, 158, 11, .28); }
.pill-active { background: var(--success-tint); color: #34d399; border-color: rgba(16, 185, 129, .28); }
.pill-suspended { background: var(--danger-tint); color: #fb7185; border-color: rgba(240, 68, 56, .28); }
.pill-expired, .pill-cancelled { background: rgba(139, 147, 161, .14); color: var(--muted); border-color: rgba(139, 147, 161, .22); }
.pill-info { background: var(--info-tint); color: #60a5fa; border-color: rgba(59, 130, 246, .28); }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); animation: live-pulse 1.6s cubic-bezier(.4, 0, .2, 1) infinite; vertical-align: middle; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); } 70% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.live-dot.warn { background: var(--warning); animation-name: live-pulse-warn; }
.live-dot.down { background: var(--danger); animation-name: live-pulse-down; }
@keyframes live-pulse-warn { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .5); } 70% { box-shadow: 0 0 0 9px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }
@keyframes live-pulse-down { 0% { box-shadow: 0 0 0 0 rgba(240, 68, 56, .5); } 70% { box-shadow: 0 0 0 9px rgba(240, 68, 56, 0); } 100% { box-shadow: 0 0 0 0 rgba(240, 68, 56, 0); } }
.pill-live::before { animation: live-pulse 1.6s cubic-bezier(.4, 0, .2, 1) infinite; }
.pill-live.pill-suspended::before { animation-name: live-pulse-down; }
.pill-live.pill-pending::before { animation-name: live-pulse-warn; }

/* ── Layout helpers ─────────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
.section-title { font-size: 1.42rem; font-weight: 800; letter-spacing: -.025em; }
.muted { color: var(--muted); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.summary-line { display: flex; justify-content: space-between; padding: 7px 0; font-size: .92rem; }
.summary-line .v { font-weight: 600; }
.total-line { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; }
.total-line .amt { font-size: 1.5rem; font-weight: 800; color: #34d399; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mb-0{margin-bottom:0}.mt-2{margin-top:8px}.mt-3{margin-top:16px}.mt-4{margin-top:24px}
.text-c{text-align:center}.flex{display:flex}.gap{gap:12px}.wrap{flex-wrap:wrap}
.row-between > *, .flex > *, .svc-name > *, .acct-chip > * { min-width: 0; }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(6, 7, 11, .68); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: none; place-items: center; z-index: 100; padding: 20px; }
.modal-overlay.open { display: grid; }
.modal { width: 100%; max-width: 440px; padding: 26px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--rim), var(--shadow-lg); animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.97) translateY(6px); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.modal .row-between .btn-ghost svg { color: var(--muted); width: 16px; height: 16px; }

.method-opt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, background .15s; margin-top: 10px; background: var(--bg-2); }
.method-opt:hover { border-color: var(--primary-2); background: var(--surface-2); }
.method-opt:has(input:checked) { border-color: var(--primary-2); background: var(--primary-tint); box-shadow: inset 0 0 0 1px var(--primary-2); }
.method-opt input[type="radio"] { margin: 0; flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--primary); }
.method-opt .mi { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-tint); color: var(--primary-2); display: grid; place-items: center; flex-shrink: 0; }
.method-opt .mi svg { width: 20px; height: 20px; }
.method-opt .mt { font-weight: 700; font-size: .95rem; }
.method-opt .md { color: var(--muted); font-size: .8rem; margin-top: 2px; }

.countdown { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--warning); }
.countdown-wrap { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; background: var(--warning-tint); border: 1px solid rgba(245, 158, 11, .3); }
.countdown-wrap .countdown { font-size: 1.6rem; }
.qr-box { background: #fff; padding: 16px; border-radius: var(--radius-lg); display: inline-block; }
.qr-box img { display: block; width: 260px; height: 260px; }
.qr-frame { display: inline-block; padding: 14px; background: var(--surface); border: 1px solid var(--primary-line); border-radius: var(--radius-lg); text-align: center; }
.qr-frame-head { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text); font-weight: 700; font-size: .88rem; margin-bottom: 10px; }
.qr-frame-head img { border-radius: 6px; vertical-align: middle; }
.qr-frame .qr-box { background: #fff; padding: 14px; border-radius: 12px; display: inline-block; }
.qr-frame .qr-box img { display: block; width: 248px; height: 248px; }
.qr-frame-foot { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: .76rem; margin-top: 10px; }
.qr-frame-foot svg { width: 12px; height: 12px; }
.va-number { font-size: 1.5rem; font-weight: 800; letter-spacing: .06em; font-family: var(--font-mono); }
.va-frame { background: var(--surface); border: 1px solid var(--primary-line); border-radius: var(--radius-lg); padding: 18px 20px; text-align: left; max-width: 460px; margin: 0 auto; }
.va-frame-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; margin-bottom: 10px; font-family: var(--font-mono); }
.va-frame-head svg { width: 14px; height: 14px; vertical-align: middle; margin-right: 4px; }
.va-bank { background: var(--info-tint); color: #60a5fa; padding: 3px 10px; border-radius: 999px; font-size: .72rem; letter-spacing: .04em; }
.va-number-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg-2); padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--primary-line); }
.va-number-row .va-number { font-size: 1.5rem; color: #fff; user-select: all; }
.va-amount-row { display: flex; justify-content: space-between; padding-top: 12px; margin-top: 12px; border-top: 1px dashed var(--border); font-size: .92rem; }
.va-amount-row strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); }
.table td { padding: 14px; border-bottom: 1px solid var(--border); font-size: .92rem; }
.table tr:last-child td { border-bottom: none; }

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 56px 24px; }
.empty .ei { font-size: 48px; margin-bottom: 12px; }
.empty .ei-wrap { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: var(--radius); background: var(--primary-tint); color: var(--primary-2); display: grid; place-items: center; }
.empty .ei-wrap svg { width: 30px; height: 30px; }
.empty h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: .9rem; margin-top: 48px; }

/* ════════════════════════════════════════════════════════════════════════
 * Portal (client area / admin)
 * ══════════════════════════════════════════════════════════════════════ */
.portal { display: grid; grid-template-columns: 258px 1fr; min-height: 100vh; }
.sidebar {
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding-top: max(18px, env(safe-area-inset-top));
}
.sidebar .brand { margin-bottom: 22px; padding: 6px 8px; }
.sidebar .brand img { width: 32px; height: 32px; border-radius: 9px; }
.side-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .14em; color: var(--faint); padding: 16px 12px 7px; font-weight: 600; font-family: var(--font-mono); }
.side-link {
    position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--muted); font-weight: 600; font-size: .89rem; margin-bottom: 1px;
    transition: background .12s, color .12s;
}
.side-link:hover { background: var(--surface); color: var(--text); }
.side-link.active { background: var(--primary-tint); color: #fff; }
.side-link.active::before { content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--primary); }
.side-link.active .ic { color: var(--primary-2); }
.side-link .ic { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--muted); transition: transform .15s; }
.side-link:hover .ic { transform: translateX(2px); }
.side-link .ic svg { width: 18px; height: 18px; }
.side-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .66rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); }
.side-bal { margin-left: auto; font-size: .66rem; padding: 2px 8px; border-radius: 999px; background: var(--success-tint); color: #34d399; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-family: var(--font-mono); }

.portal-main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 62px; border-bottom: 1px solid var(--border); display: flex; align-items: center;
    justify-content: space-between; padding: 0 24px;
    background: rgba(15, 18, 23, .72); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
    position: sticky; top: 0; z-index: 40;
}
.topbar .page-title { font-weight: 800; font-size: 1.02rem; letter-spacing: -.02em; }
.acct-chip { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); transition: border-color .15s; }
.acct-chip:hover { border-color: var(--border-strong); }
.acct-chip .av { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; }
.acct-chip .av-img { object-fit: cover; }
.portal-body { padding: 28px 24px; flex: 1; min-width: 0; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat { padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat .si { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.stat .si svg { width: 20px; height: 20px; }
.stat .sv { font-size: 1.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .sl { color: var(--muted); font-size: .82rem; margin-top: 3px; }
.stat .delta { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--success-tint); color: var(--success); margin-top: 6px; display: inline-block; }
.si.violet { background: var(--primary-tint); color: var(--primary-2); }
.si.green  { background: var(--success-tint); color: #34d399; }
.si.amber  { background: var(--warning-tint); color: var(--warning); }
.si.cyan   { background: var(--info-tint); color: #60a5fa; }
.si.rose   { background: var(--danger-tint); color: var(--danger); }

.stat-card {
    position: relative; padding: 20px; display: grid;
    grid-template-areas: "icon ." "value value" "label label";
    grid-template-columns: auto 1fr; row-gap: 6px;
    transition: transform .18s, border-color .18s, box-shadow .18s;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--primary-line); box-shadow: var(--rim), var(--shadow-lg); }
.stat-card .si-wrap, .stat-card .si-img { grid-area: icon; }
.stat-card .sv { grid-area: value; font-size: 1.75rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; margin-top: 14px; font-variant-numeric: tabular-nums; }
.stat-card .sl { grid-area: label; color: var(--muted); font-size: .82rem; font-weight: 500; }
.stat-card .si-wrap { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.stat-card .si-wrap svg { width: 22px; height: 22px; }
.si-wrap.violet { background: var(--primary-tint); color: var(--primary-2); }
.si-wrap.green  { background: var(--success-tint); color: #34d399; }
.si-wrap.amber  { background: var(--warning-tint); color: var(--warning); }
.si-wrap.cyan   { background: var(--info-tint); color: #60a5fa; }
.si-wrap.rose   { background: var(--danger-tint); color: var(--danger); }
.stat-card .si-img { width: 44px; height: 44px; display: grid; place-items: center; }
.stat-card .si-img img { width: 100%; height: 100%; }
.stat-card-active { border-color: rgba(16, 185, 129, .32); }
.stat-card-active .sv { color: #34d399; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--rim), var(--shadow); }
.panel-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--bg-2); }
.panel-head h3 { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; overflow-x: auto; }

.table-clean { width: 100%; border-collapse: collapse; }
.table-clean th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 12px 18px; background: var(--bg-2); font-weight: 600; border-bottom: 1px solid var(--border); font-family: var(--font-mono); }
.table-clean td { padding: 14px 18px; border-top: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
.table-clean tbody tr { transition: background .12s; }
.table-clean tbody tr:hover { background: var(--surface-2); }
.table-clean td .btn + .btn, .table-clean td form + form { margin-left: 6px; }
.svc-name { display: flex; align-items: center; gap: 12px; }
.svc-name .si { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-tint); color: var(--primary-2); display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }

.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

/* ── Dashboard hero ─────────────────────────────────────────────────────── */
.hero-card {
    position: relative; overflow: hidden; padding: 30px;
    background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--rim), var(--shadow);
    display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between;
}
/* one restrained accent: a faint indigo wash in the corner (not a full gradient bg) */
.hero-card::before { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(99,91,255,.14), transparent 68%); pointer-events: none; }
.hero-card .left { position: relative; z-index: 1; }
.hero-card .left h1 { font-size: clamp(1.45rem, 2.6vw, 1.85rem); font-weight: 800; letter-spacing: -.03em; }
.hero-card h1 .wave { display: inline-block; animation: wave 1.6s ease-in-out infinite; transform-origin: 70% 70%; }
.hero-card p { color: var(--muted); font-size: .94rem; margin-top: 4px; }
@keyframes wave { 0%,60%,100%{transform:rotate(0)} 10%,30%,50%{transform:rotate(14deg)} 20%,40%{transform:rotate(-8deg)} }

.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 2; }
.qa-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 700; font-size: .88rem; transition: border-color .15s, background .15s, transform .12s; }
.qa-btn:hover { border-color: var(--primary-line); background: var(--surface-3); transform: translateY(-1px); }
.qa-btn svg { width: 16px; height: 16px; transition: transform .15s; }
.qa-btn:hover svg { transform: scale(1.08); }
.qa-btn.primary { background: var(--primary); border-color: transparent; color: #fff; box-shadow: var(--rim), 0 6px 18px -8px var(--primary-glow); }
.qa-btn.primary:hover { background: var(--primary-2); }

/* Service grid (dashboard) */
.svc-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.svc-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; transition: transform .18s, border-color .18s, box-shadow .18s; position: relative; overflow: hidden; }
.svc-card:hover { transform: translateY(-3px); border-color: var(--primary-line); box-shadow: var(--rim), var(--shadow-lg); }
.svc-card.is-suspended { opacity: .82; }
.svc-card .svc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.svc-card .svc-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.svc-card .svc-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; background: var(--primary-tint); color: var(--primary-2); display: grid; place-items: center; }
.svc-card .svc-icon svg { width: 20px; height: 20px; }
.svc-card .svc-title { font-weight: 700; font-size: 1rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14ch; }
.svc-card .svc-meta { display: grid; gap: 8px; font-size: .88rem; }
.svc-card .svc-meta-row { display: flex; align-items: center; gap: 10px; }
.svc-card .svc-meta-row svg { width: 15px; height: 15px; }
.svc-card .svc-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-soft); margin-top: auto; }
.svc-card .svc-actions .btn { flex: 1; }
.text-warn { color: var(--warning); font-weight: 600; }

/* ── Charts (flat bars) ─────────────────────────────────────────────────── */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart .bar .fill { width: 100%; max-width: 22px; border-radius: 5px 5px 0 0; background: var(--primary); transition: height .3s; min-height: 2px; }
.chart .bar .fill.green { background: var(--success); }
.chart .bar .lbl { font-size: .6rem; color: var(--muted); margin-top: 6px; white-space: nowrap; font-family: var(--font-mono); }
.chart .bar .val { font-size: .58rem; color: var(--text); margin-bottom: 4px; opacity: .7; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-row .name { width: 110px; font-size: .85rem; color: var(--muted); }
.bar-row .track { flex: 1; height: 10px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.bar-row .num { width: 30px; text-align: right; font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }

.cap { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.cap .lbl { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); }
.cap .track { height: 6px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.cap .track i { display: block; height: 100%; background: var(--primary); }
.cap.warn .track i { background: var(--warning); }
.cap.full .track i { background: var(--danger); }

/* ── Ticket conversation ────────────────────────────────────────────────── */
.msg { display: flex; margin-bottom: 14px; }
.msg.staff { justify-content: flex-start; }
.msg.cust { justify-content: flex-end; }
.msg .bubble { max-width: 78%; padding: 12px 15px; border-radius: 16px; font-size: .92rem; line-height: 1.5; }
.msg.staff .bubble { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg.cust .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.msg .who { font-size: .72rem; opacity: .8; margin-bottom: 4px; font-weight: 600; }
.msg .time { font-size: .68rem; opacity: .6; margin-top: 5px; }
.msg .bubble.staff-badge .who { color: var(--primary-2); }

/* ── Sensitive value ────────────────────────────────────────────────────── */
.sensitive { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--border); cursor: pointer; user-select: all; font-family: var(--font-mono); font-size: .95rem; font-weight: 600; transition: border-color .15s; }
.sensitive:hover { border-color: var(--primary-2); }
.sensitive .val { filter: blur(7px); transition: filter .18s ease; user-select: text; }
.sensitive:hover .val, .sensitive:focus-within .val, .sensitive.revealed .val { filter: none; }
.sensitive .ic { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.sensitive .ic svg { width: 14px; height: 14px; }
.sensitive .hint { font-size: .68rem; color: var(--muted); font-weight: 500; transition: opacity .15s; font-family: var(--font-sans); }
.sensitive:hover .hint, .sensitive.revealed .hint { opacity: 0; }
@media (hover: none) { .sensitive:active .val { filter: none; } }

/* ── Wallet ─────────────────────────────────────────────────────────────── */
.hero-balance { text-align: right; }
.hero-balance .balance-amount { font-size: 1.9rem; font-weight: 800; color: #34d399; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.amount-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.amount-chip { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: var(--radius-sm); font-size: .88rem; font-weight: 700; cursor: pointer; transition: border-color .15s, background .15s; }
.amount-chip:hover { border-color: var(--primary-2); }
.amount-chip.active { background: var(--primary); color: #fff; border-color: transparent; }

/* ── Status page ────────────────────────────────────────────────────────── */
.status-banner { display: flex; align-items: center; gap: 16px; padding: 22px 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.status-banner-success { border-color: rgba(16, 185, 129, .3); }
.status-banner-warn { border-color: rgba(245, 158, 11, .3); }
.status-banner-error { border-color: rgba(240, 68, 56, .3); }
.status-banner .sb-icon { width: 56px; height: 56px; display: grid; place-items: center; }
.status-banner .sb-icon svg { width: 32px; height: 32px; color: var(--danger); }
.status-banner-success .sb-icon svg { color: var(--success); }
.status-banner-warn .sb-icon svg { color: var(--warning); }
.status-banner .sb-title { font-size: 1.1rem; font-weight: 800; }
.status-banner .sb-sub { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.status-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.status-card { padding: 16px; }
.status-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.status-card .status-name { font-weight: 700; }
.uptime-row { display: flex; justify-content: space-between; padding: 6px 0; }
.history-bars { display: flex; gap: 2px; align-items: flex-end; height: 22px; }
.history-bars .hbar { flex: 1; height: 16px; border-radius: 2px; }
.hbar-up { background: var(--success); }
.hbar-partial { background: var(--warning); }
.hbar-down { background: var(--danger); }
.hbar-na { background: var(--surface-3); }

/* ── Public verification ────────────────────────────────────────────────── */
.verify-seal { width: 110px; height: 110px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--success-tint); border: 1px solid rgba(16, 185, 129, .3); }
.verify-seal-bad { background: var(--danger-tint); border-color: rgba(240, 68, 56, .3); }
.verify-meta { text-align: left; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 6px 18px; }
.verify-meta .vm-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 0; font-size: .9rem; border-bottom: 1px solid var(--border-soft); }
.verify-meta .vm-row:last-child { border-bottom: none; }
.verify-meta .vm-row .v { font-weight: 600; text-align: right; word-break: break-all; }
@media (max-width: 540px) { .verify-meta .vm-row { flex-direction: column; align-items: flex-start; gap: 4px; padding: 9px 0; } .verify-meta .vm-row .v { text-align: left; } }

/* ── Profile ────────────────────────────────────────────────────────────── */
.profile-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar-lg { width: 76px; height: 76px; border-radius: 18px; object-fit: cover; flex-shrink: 0; }
.avatar-initials { display: grid; place-items: center; background: var(--primary); color: #fff; font-size: 1.8rem; font-weight: 800; }

/* ── FAQ accordion ──────────────────────────────────────────────────────── */
.faq { display: grid; gap: 10px; margin-top: 18px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; transition: border-color .2s; }
.faq details[open] { border-color: var(--primary-line); }
.faq summary { cursor: pointer; font-weight: 700; font-size: .96rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--primary-2); font-size: 1.2rem; }
.faq details[open] summary::after { content: '−'; }
.faq .a { color: var(--muted); margin-top: 10px; line-height: 1.6; font-size: .9rem; }

/* ── Live stats bar ─────────────────────────────────────────────────────── */
.live-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; margin-top: 22px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.live-stats .ls-item { background: var(--surface); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.live-stats .ls-v { font-size: 1.4rem; font-weight: 800; letter-spacing: -.025em; color: var(--text); font-variant-numeric: tabular-nums; }
.live-stats .ls-l { color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; font-family: var(--font-mono); }

.sticky-rail { position: sticky; top: 84px; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s; }
.reveal.reveal-in { opacity: 1; transform: none; }

.glass, .glass-strong { background: var(--surface); border: 1px solid var(--border); }
.bg-aurora::before { display: none; }

/* ── Payment success ────────────────────────────────────────────────────── */
.success-wrap { max-width: 620px; margin: 0 auto; }
.success-card { overflow: hidden; border-color: var(--primary-line); }
.success-hero { text-align: center; padding: 36px 24px 8px; position: relative; }
.success-hero h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.025em; margin-top: 6px; }
.success-hero p { color: var(--muted); margin-top: 8px; }
.success-check { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 20px; background: var(--success); display: grid; place-items: center; animation: pop-in .5s cubic-bezier(.2,.9,.3,1.4); }
.success-check svg { width: 50px; height: 50px; stroke: #fff; stroke-width: 4; fill: none; }
.success-check svg path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .5s .25s forwards ease; }
@keyframes pop-in { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.success-anim { position: relative; width: 120px; height: 120px; margin: 0 auto 24px; }
.success-anim .ring { position: absolute; inset: 0; border-radius: 50%; background: var(--success-tint); animation: ring-pulse 1.6s ease-out infinite; }
.success-anim .ring2 { animation-delay: .4s; }
.success-anim svg { position: relative; width: 100%; height: 100%; display: block; }
.success-anim .circle-bg { fill: none; stroke: rgba(16, 185, 129, .18); stroke-width: 4; }
.success-anim .circle-fg { fill: none; stroke: var(--success); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 314; stroke-dashoffset: 314; transform: rotate(-90deg); transform-origin: 50% 50%; animation: circle-draw .7s cubic-bezier(.65,.05,.36,1) .1s forwards; }
.success-anim .check { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 36; stroke-dashoffset: 36; animation: check-draw .35s cubic-bezier(.5,.1,.3,1) .65s forwards; }
.success-anim .check-bg { fill: var(--success); transform-origin: 50% 50%; transform: scale(0); animation: check-pop .35s cubic-bezier(.4,0,.2,1.2) .55s forwards; }
@keyframes circle-draw { to { stroke-dashoffset: 0; } }
@keyframes check-draw { to { stroke-dashoffset: 0; } }
@keyframes check-pop { to { transform: scale(1); } }
@keyframes ring-pulse { 0%{transform:scale(.7);opacity:.9} 100%{transform:scale(1.6);opacity:0} }

.confetti { display: none; }

.receipt-block { padding: 18px 22px; border-top: 1px solid var(--border); background: var(--bg-2); }
.receipt-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: .92rem; }
.receipt-row .v { font-weight: 600; }
.receipt-tear { height: 1px; margin: 10px 0; background: repeating-linear-gradient(90deg, var(--border) 0 8px, transparent 8px 14px); }
.success-amt { color: #34d399; }

a.inline-link { color: var(--primary-2); font-weight: 600; }
a.inline-link:hover { text-decoration: underline; }
.err-code { font-size: clamp(3.4rem, 22vw, 5rem); font-weight: 800; color: var(--primary-2); font-family: var(--font-mono); letter-spacing: -.03em; }

/* ════════════════════════════════════════════════════════════════════════
 * Responsive
 * ══════════════════════════════════════════════════════════════════════ */
.menu-toggle { display: none; }
.menu-toggle svg { width: 20px; height: 20px; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(5, 6, 10, .62); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); z-index: 55; }
.sidebar-backdrop.show { display: block; }

table.table-clean, table.table { min-width: 520px; }
.panel-body.flush, .table-clean, .card[style*="overflow-x"] { -webkit-overflow-scrolling: touch; }

@media (max-width: 900px) {
    .portal { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: -300px; width: 264px; z-index: 60; transition: left .2s; }
    .sidebar.open { left: 0; }
    .topbar .menu-toggle, .menu-toggle { display: inline-flex !important; align-items: center; justify-content: center; }
    .acct-chip .av { margin: 0; }
    .acct-chip > div { display: none; }
    .topbar { padding: 0 16px; }
    .portal-body { padding: 18px 16px; }
    .two-col { gap: 16px; }
    .nav-links a:not(.btn) { display: none; }
}

@media (max-width: 768px) {
    .stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-card .sv { font-size: 1.45rem; margin-top: 10px; }
    .stat-card .sl { font-size: .76rem; }
    .stat-card .si-wrap, .stat-card .si-img { width: 38px; height: 38px; }
    .stat-card .si-wrap svg { width: 19px; height: 19px; }
    .svc-grid { grid-template-columns: 1fr; gap: 12px; }
    .hero-card { padding: 22px; }
    .hero-card h1 { font-size: 1.3rem; }
}

@media (max-width: 640px) {
    .grid { grid-template-columns: 1fr !important; }
    .two-col { grid-template-columns: 1fr !important; }
    .container { padding: 0 16px; }
    .card-pad { padding: 18px; }
    .hero { padding: 40px 0 20px; }
    .auth-card { padding: 26px 20px; }
    .section-title { font-size: 1.3rem; }
    .total-line .amt { font-size: 1.35rem; }
    .nav-inner { height: 58px; }
    .btn { padding: 11px 16px; }
    .btn-lg { padding: 13px 20px; }
    .chart { gap: 3px; height: 130px; }
    .chart .bar .lbl { font-size: .5rem; }
    .bar-row .name { width: 84px; font-size: .8rem; }
    .modal { max-width: 100%; }
    .qr-box img { width: 210px; height: 210px; }
    .qr-frame .qr-box img { width: 210px; height: 210px; }
    .plan-price .nominal { font-size: 1.6rem; }
    .va-number { font-size: 1.2rem; letter-spacing: .02em; }
    .balance-amount { font-size: 1.5rem; }
    .countdown-wrap .countdown { font-size: 1.35rem; }
    .table-clean th, .table-clean td { padding: 11px 14px; font-size: .85rem; }
    .panel-head { padding: 13px 15px; flex-wrap: wrap; gap: 6px; }
    .panel-head h3 { font-size: .96rem; }
}

@media (max-width: 400px) {
    .stats { grid-template-columns: 1fr; }
    .stat .sv { font-size: 1.3rem; }
    .btn { padding: 10px 14px; font-size: .9rem; }
    .hero-card h1 { font-size: 1.2rem; }
    .sidebar { width: 86vw; }
    .side-bal { display: none; }
}

@media (hover: none) and (pointer: coarse) {
    .btn, .qa-btn { min-height: 42px; }
    .btn-sm { min-height: 38px; }
    .side-link { padding: 12px; }
    .method-opt { padding: 16px; }
    select.select, .input { min-height: 44px; }
}
@media (hover: none) {
    .svc-card:hover, .stat-card:hover, .plan-card-v2:hover { transform: none; }
}

@media (min-width: 1600px) {
    .portal-body { max-width: 1440px; margin-left: auto; margin-right: auto; width: 100%; }
}

.va-number, .lic-no, [style*="ui-monospace"] { overflow-wrap: anywhere; word-break: break-word; }

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #43434e; }

:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; border-radius: 5px; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    /* Tame only continuous / looping motion. One-shot entrances, hover
     * transitions and micro-interactions stay ON so the UI still feels alive. */
    .live-dot, .pill-live::before,
    .text-animate, .hero-card h1 .wave, .dash-hero .wave,
    .success-anim .ring, .plan-orb, .type-caret::after { animation: none !important; }
}

.topbar { padding-top: env(safe-area-inset-top); height: calc(62px + env(safe-area-inset-top)); }
.footer { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
.portal-body { padding-bottom: max(28px, env(safe-area-inset-bottom)); }

/* ════════════════════════════════════════════════════════════════════════
 * Motion — cohesive, restrained
 * ══════════════════════════════════════════════════════════════════════ */
.portal-body > *, main > .container > *, .auth-form { animation: zk-fade-up .45s cubic-bezier(.22,.9,.32,1) both; }
@keyframes zk-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.portal-body > *:nth-child(1) { animation-delay: 0s; }
.portal-body > *:nth-child(2) { animation-delay: .05s; }
.portal-body > *:nth-child(3) { animation-delay: .10s; }
.portal-body > *:nth-child(4) { animation-delay: .15s; }
.portal-body > *:nth-child(5) { animation-delay: .20s; }

.stats > *, .svc-grid > *, .status-grid > *, .plans > * { animation: zk-fade-up .5s cubic-bezier(.22,.9,.32,1) both; }
.stats > *:nth-child(1), .svc-grid > *:nth-child(1), .status-grid > *:nth-child(1) { animation-delay: .04s; }
.stats > *:nth-child(2), .svc-grid > *:nth-child(2), .status-grid > *:nth-child(2) { animation-delay: .08s; }
.stats > *:nth-child(3), .svc-grid > *:nth-child(3), .status-grid > *:nth-child(3) { animation-delay: .12s; }
.stats > *:nth-child(4), .svc-grid > *:nth-child(4), .status-grid > *:nth-child(4) { animation-delay: .16s; }
.stats > *:nth-child(5) { animation-delay: .20s; }
.stats > *:nth-child(6) { animation-delay: .24s; }
.stats > *:nth-child(7) { animation-delay: .28s; }
.stats > *:nth-child(8) { animation-delay: .32s; }

.bar-row .track i, .cap .track i { transform-origin: left center; animation: zk-grow-x .8s cubic-bezier(.2,.85,.25,1) both; }
@keyframes zk-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.chart .bar .fill { transform-origin: bottom center; animation: zk-rise .7s cubic-bezier(.2,.85,.25,1) both; }
@keyframes zk-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart .bar:nth-child(1) .fill { animation-delay: .02s; } .chart .bar:nth-child(2) .fill { animation-delay: .05s; }
.chart .bar:nth-child(3) .fill { animation-delay: .08s; } .chart .bar:nth-child(4) .fill { animation-delay: .11s; }
.chart .bar:nth-child(5) .fill { animation-delay: .14s; } .chart .bar:nth-child(6) .fill { animation-delay: .17s; }
.chart .bar:nth-child(7) .fill { animation-delay: .20s; } .chart .bar:nth-child(8) .fill { animation-delay: .23s; }

.table-clean tbody:not(#live-orders) tr { animation: zk-row-in .4s ease both; }
.table-clean tbody:not(#live-orders) tr:nth-child(1) { animation-delay: .02s; }
.table-clean tbody:not(#live-orders) tr:nth-child(2) { animation-delay: .05s; }
.table-clean tbody:not(#live-orders) tr:nth-child(3) { animation-delay: .08s; }
.table-clean tbody:not(#live-orders) tr:nth-child(4) { animation-delay: .11s; }
.table-clean tbody:not(#live-orders) tr:nth-child(5) { animation-delay: .14s; }
.table-clean tbody:not(#live-orders) tr:nth-child(n+6) { animation-delay: .16s; }
@keyframes zk-row-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.count-up.counting { color: var(--primary-2); transition: color .3s; }

.stat-card .si-wrap, .stat .si { transition: transform .2s cubic-bezier(.2,.9,.3,1.3); }
.stat-card:hover .si-wrap, .card.stat:hover .si { transform: scale(1.08) rotate(-3deg); }

.panel > .panel-head { position: relative; }
.panel > .panel-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); transform: scaleX(0); transform-origin: left; transition: transform .3s cubic-bezier(.2,.9,.3,1); }
.panel:hover > .panel-head::after { transform: scaleX(1); }

.sidebar .side-link { animation: zk-slide-in .35s ease both; }
.sidebar .side-link:nth-child(2) { animation-delay: .02s; } .sidebar .side-link:nth-child(3) { animation-delay: .04s; }
.sidebar .side-link:nth-child(4) { animation-delay: .06s; } .sidebar .side-link:nth-child(5) { animation-delay: .08s; }
.sidebar .side-link:nth-child(6) { animation-delay: .10s; } .sidebar .side-link:nth-child(n+7) { animation-delay: .12s; }
@keyframes zk-slide-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

.eyebrow, .eyebrow-chip, .tag { animation: zk-fade .5s ease both; }
@keyframes zk-fade { from { opacity: 0; } to { opacity: 1; } }


/* ════════════════════════════════════════════════════════════════════════
 * Layout v2 — floating shell + bento dashboards
 * Repositions the whole app: sidebar and topbar become separate floating
 * rounded panels over the page, and dashboards use a 12-column bento grid.
 * ══════════════════════════════════════════════════════════════════════ */

/* ── Floating shell (desktop only; mobile keeps the off-canvas drawer) ───── */
@media (min-width: 901px) {
    .portal { padding: 18px; gap: 18px; background: var(--bg); }
    .sidebar {
        position: sticky; top: 18px; height: calc(100vh - 36px);
        border: 1px solid var(--border); border-right: 1px solid var(--border);
        border-radius: 20px; box-shadow: var(--rim), var(--shadow);
    }
    .portal-main { min-width: 0; }
    .topbar {
        top: 18px; height: 60px; padding: 0 20px; margin-bottom: 18px;
        border: 1px solid var(--border); border-radius: 16px;
        box-shadow: var(--rim), var(--shadow);
    }
    .portal-body { padding: 0 2px; padding-bottom: 24px; }
}

/* ── Bento grid ─────────────────────────────────────────────────────────── */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; align-items: stretch; }
.bento > * { grid-column: span 12; min-width: 0; }
.b-3 { grid-column: span 3; } .b-4 { grid-column: span 4; } .b-5 { grid-column: span 5; }
.b-6 { grid-column: span 6; } .b-7 { grid-column: span 7; } .b-8 { grid-column: span 8; } .b-9 { grid-column: span 9; }
@media (max-width: 1100px) {
    .b-3 { grid-column: span 6; } .b-4 { grid-column: span 12; } .b-5 { grid-column: span 12; }
    .b-7 { grid-column: span 12; } .b-8 { grid-column: span 12; } .b-9 { grid-column: span 12; }
}
@media (max-width: 560px) {
    .bento > * { grid-column: span 12; }
    .bento > .b-3 { grid-column: span 6; }   /* keep small KPI tiles 2-per-row */
}

/* Bento tile entrance cascade */
.bento > * { animation: zk-fade-up .5s cubic-bezier(.22,.9,.32,1) both; }
.bento > *:nth-child(1){animation-delay:.03s} .bento > *:nth-child(2){animation-delay:.07s}
.bento > *:nth-child(3){animation-delay:.11s} .bento > *:nth-child(4){animation-delay:.15s}
.bento > *:nth-child(5){animation-delay:.19s} .bento > *:nth-child(6){animation-delay:.23s}
.bento > *:nth-child(7){animation-delay:.27s} .bento > *:nth-child(8){animation-delay:.31s}
.bento > *:nth-child(9){animation-delay:.35s} .bento > *:nth-child(n+10){animation-delay:.38s}

/* ── Dashboard hero tile ────────────────────────────────────────────────── */
.dash-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.dash-hero::before { content: ''; position: absolute; right: -70px; top: -70px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(99,91,255,.16), transparent 68%); pointer-events: none; }
.dash-hero > * { position: relative; z-index: 1; }
.dash-hero h1 { font-size: clamp(1.55rem, 3vw, 2.05rem); font-weight: 800; letter-spacing: -.035em; margin-top: 10px; line-height: 1.1; }
.dash-hero p { color: var(--muted); margin-top: 8px; max-width: 54ch; }
.dash-hero .quick-actions { margin-top: 20px; }

/* Inline mini-metrics under the hero */
.hero-metrics { display: flex; gap: 26px; margin-top: 22px; flex-wrap: wrap; }
.hero-metrics .hm { display: flex; flex-direction: column; gap: 2px; }
.hero-metrics .hm .v { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.hero-metrics .hm .l { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hero-metrics .hm + .hm { padding-left: 26px; border-left: 1px solid var(--border); }

/* ── Side tile: wallet / metric stack ───────────────────────────────────── */
.side-tile { display: flex; flex-direction: column; gap: 14px; }
.side-tile .balance-amount { font-size: 2.1rem; font-weight: 800; color: #34d399; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }

.metric-stack { display: flex; flex-direction: column; gap: 18px; justify-content: center; height: 100%; }
.metric .l { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.metric .v { font-size: 1.85rem; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1; }
.metric .v.accent { color: var(--primary-2); }
.metric .v.green { color: #34d399; }
.metric + .metric { padding-top: 18px; border-top: 1px solid var(--border); }

/* Make panels/cards fill their bento cell height for a tidy grid */
.bento > .panel { height: 100%; display: flex; flex-direction: column; }
.bento > .panel > .panel-body { flex: 1; }
.bento > .card { height: 100%; }

/* Section label used above bento groups */
.dash-section-label { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 4px; }


/* ════════════════════════════════════════════════════════════════════════
 * Global animation layer v2 — applies to every page
 * (kept lively even under reduced-motion, which now only tames looping motion)
 * ══════════════════════════════════════════════════════════════════════ */

/* Chrome slides in on load */
.nav, .topbar { animation: zk-drop .5s cubic-bezier(.22,.9,.32,1) both; }
@keyframes zk-drop { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* Sidebar panel eases in */
.sidebar { animation: zk-slide-left .45s cubic-bezier(.22,.9,.32,1) both; }
@keyframes zk-slide-left { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .sidebar { animation: none; } }  /* off-canvas drawer handles its own transition */

/* Buttons: clear tactile hover lift + press */
.btn:hover:not(:disabled):not(:active) { transform: translateY(-1px); }
.qa-btn:hover, .amount-chip:hover { transform: translateY(-1px); }

/* Table rows nudge on hover */
.table-clean tbody tr:hover { transform: translateX(2px); }
.table-clean tbody tr { transition: background .12s, transform .12s; }

/* Pills gently pop in */
.pill { animation: zk-pill .35s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes zk-pill { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

/* Icon inside side-links & buttons springs on hover */
.side-link:hover .ic, .btn:hover svg { transition: transform .18s cubic-bezier(.2,.9,.3,1.4); }

/* Scroll-reveal (JS toggles .is-in). Initial hidden state is applied by JS so
 * content is always visible if JS is unavailable. */
.zk-reveal { will-change: opacity, transform; }
.zk-reveal.is-in { opacity: 1 !important; transform: none !important; }

/* Focus-visible ring animates in */
:focus-visible { transition: outline-color .15s, outline-offset .15s; }

/* Modal overlay fades, modal pops (already), backdrop blur eases */
.modal-overlay.open { animation: zk-fade .2s ease both; }

/* Empty-state icon subtle float */
.empty .ei-wrap { animation: zk-float 3.2s ease-in-out infinite; }
@keyframes zk-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .empty .ei-wrap { animation: none; } }


/* ── Minecraft block/item image inside plan orb ─────────────────────────── */
.plan-orb { position: relative; overflow: visible; }
.plan-orb .orb-fallback { line-height: 1; }
.plan-orb .mc-block {
    width: 68%; height: 68%; object-fit: contain;
    /* Crisp, authentic pixel scaling for 16×16 official textures */
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45));
    transition: transform .25s cubic-bezier(.2, .9, .3, 1.4);
}
.plan-card-v2:hover .plan-orb .mc-block { transform: translateY(-2px) scale(1.06) rotate(-3deg); }
/* On the detail page the orb sits inside an <h1>; keep the image centered */
h1 .plan-orb { display: inline-grid; place-items: center; vertical-align: middle; }


/* ════════════════════════════════════════════════════════════════════════
 * Premium polish — craft-level finishing (typography, depth, components)
 * The final layer that lifts the UI from "clean" to "premium". No new colors,
 * just refined material, rhythm, and states.
 * ══════════════════════════════════════════════════════════════════════ */

/* ── Typography: tighter display tracking + true tabular figures ────────── */
h1, h2, h3, .section-title, .heading-mega, .hero h1, .dash-hero h1,
.plan-name, .auth-card h1, .auth-split .auth-form h1 { letter-spacing: -.03em; }
.stat-card .sv, .stat .sv, .metric .v, .hero-metrics .hm .v, .plan-price .nominal,
.total-line .amt, .hero-balance .balance-amount, .live-stats .ls-v, .va-number, .countdown {
    font-feature-settings: "tnum" 1, "cv01" 1; letter-spacing: -.03em;
}
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }

/* ── Material: "lit from above" — a brighter top border edge on surfaces ── */
.card, .panel, .stat-card, .svc-card, .plan-card, .plan-card-v2, .hero-card,
.spec-tile, .trust-pill, .status-card, .faq details, .method-opt, .modal {
    border-top-color: rgba(255, 255, 255, .09);
}

/* Cards read a touch more elevated on hover (depth, not just border) */
.card:hover, .panel:hover { box-shadow: var(--rim), var(--shadow); border-top-color: rgba(255, 255, 255, .12); }
.stat-card:hover, .svc-card:hover, .plan-card:hover, .plan-card-v2:hover { box-shadow: var(--rim), var(--shadow-lg); }

/* ── Buttons: crisper, more tactile ─────────────────────────────────────── */
.btn { border-radius: 11px; font-weight: 650; }
.btn-primary {
    background: var(--primary);
    box-shadow: var(--rim), 0 1px 1px rgba(0,0,0,.2), 0 6px 16px -8px var(--primary-glow);
}
.btn-primary:hover { box-shadow: var(--rim), 0 2px 3px rgba(0,0,0,.24), 0 10px 22px -8px var(--primary-glow); }
.btn-ghost { box-shadow: var(--rim); }

/* ── Section title: subtle accent bar for a designed, intentional look ──── */
.section-title { position: relative; }
.dash-section-label .section-title,
.two-col .section-title { padding-left: 14px; }
.dash-section-label .section-title::before,
.two-col .section-title::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 4px; height: 1em; border-radius: 3px; background: var(--primary);
}

/* ── Panel headers: refined weight + spacing ────────────────────────────── */
.panel-head h3 { letter-spacing: -.01em; }
.panel-head { background: linear-gradient(180deg, rgba(255,255,255,.02), transparent); }

/* ── Sidebar: refined active state (crisper, softer surround) ───────────── */
.side-link { font-weight: 600; }
.side-link.active {
    background: var(--primary-tint);
    box-shadow: var(--rim), inset 0 0 0 1px rgba(99,91,255,.18);
}
.side-label { color: var(--faint); }

/* ── Pills: tighter, refined ────────────────────────────────────────────── */
.pill { font-weight: 650; padding: 4px 10px; }

/* ── Tables: clearer separation + hover ─────────────────────────────────── */
.table-clean thead th { position: relative; }
.table-clean tbody tr:hover { background: rgba(99, 91, 255, .05); }
.table-clean tbody tr:hover td { color: var(--text); }

/* ── Inputs: refined focus (soft double ring) ───────────────────────────── */
.input:focus, .select:focus, textarea.input:focus {
    border-color: var(--primary-2);
    box-shadow: 0 0 0 1px var(--primary-2), 0 0 0 4px var(--primary-tint);
}

/* ── Stat tiles: number leads, refined label ───────────────────────────── */
.stat-card .sl, .metric .l, .live-stats .ls-l, .hero-metrics .hm .l { color: var(--muted); }
.stat-card .si-wrap { box-shadow: var(--rim); }

/* ── Scrollbar: slimmer, subtler ────────────────────────────────────────── */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #2b3340; border: 2px solid transparent; background-clip: content-box; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #3a4453; background-clip: content-box; }

/* ── Focus ring: unified, accessible, on-brand ──────────────────────────── */
:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; border-radius: 6px; }

/* ── Selection ──────────────────────────────────────────────────────────── */
::selection { background: rgba(99, 91, 255, .32); color: #fff; }

/* ── Topbar: hairline underglow for separation over content ─────────────── */
.topbar { box-shadow: var(--rim), var(--shadow), 0 1px 0 rgba(255,255,255,.02); }

/* ── Empty states: softer, more designed ────────────────────────────────── */
.empty .ei-wrap { box-shadow: var(--rim); }
.empty h3 { letter-spacing: -.02em; }


/* ════════════════════════════════════════════════════════════════════════
 * Reference finish (Linear / Vercel) — subtle dot-grid backdrop + depth
 * A faint fixed grid behind the app gives that premium dev-tool feel without
 * adding visual noise. Content layers sit above it.
 * ══════════════════════════════════════════════════════════════════════ */
body::before {
    content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 24px 24px;
    -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% -10%, #000 35%, transparent 100%);
    mask-image: radial-gradient(ellipse 120% 90% at 50% -10%, #000 35%, transparent 100%);
}
/* subtle top accent glow that fades in — very restrained */
body::after {
    content: ''; position: fixed; top: 0; left: 0; right: 0; height: 320px; z-index: 0; pointer-events: none;
    background: radial-gradient(1200px 320px at 50% -140px, rgba(99, 91, 255, .10), transparent 70%);
}
.portal, main, .nav, .footer, .auth-wrap, .auth-split { position: relative; z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
    .nav, .topbar { transition: box-shadow .3s; }
}


/* ════════════════════════════════════════════════════════════════════════
 * Pagination — themed Prev/Next + page numbers (used app-wide via ->links())
 * ══════════════════════════════════════════════════════════════════════ */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.page-btn, .page-num {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 38px; height: 38px; padding: 0 13px; border-radius: 11px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font-weight: 650; font-size: .88rem; box-shadow: var(--rim);
    transition: border-color .15s, background .15s, color .15s, transform .08s;
    font-family: inherit; cursor: pointer; user-select: none;
}
.page-num { padding: 0 10px; font-variant-numeric: tabular-nums; }
.page-btn:hover, .page-num:hover { border-color: var(--border-strong); background: var(--surface-2); }
.page-btn:active, .page-num:active { transform: translateY(1px); }
.page-num.is-active {
    background: var(--primary); border-color: transparent; color: #fff;
    box-shadow: var(--rim), 0 6px 16px -8px var(--primary-glow);
}
.page-num.is-active:hover { background: var(--primary-2); }
.page-btn.is-disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.page-dots { padding: 0 4px; color: var(--faint); font-weight: 700; }
.page-btn svg, .page-num svg { width: 15px; height: 15px; }
/* reuse the "back" chevron, rotated, for the Next button */
.page-btn .rot { display: inline-flex; transform: rotate(180deg); }
.page-info { display: none; color: var(--muted); font-size: .85rem; }

@media (max-width: 640px) {
    .pagination { justify-content: space-between; width: 100%; }
    .pagination .page-num, .pagination .page-dots { display: none; }
    .page-info { display: inline-flex; }
}


/* ════════════════════════════════════════════════════════════════════════
 * Elevation pass — high-class, modern finish
 * Confident typographic scale, more generous rhythm, and signature depth.
 * The layer that makes the product feel top-tier. Colors unchanged.
 * ══════════════════════════════════════════════════════════════════════ */

/* ── Type scale: bigger, more confident headings; airier body ───────────── */
body { font-size: 15px; line-height: 1.62; }
.section-title { font-size: clamp(1.35rem, 2.4vw, 1.6rem); font-weight: 800; letter-spacing: -.03em; }
.heading-mega { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.04; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); letter-spacing: -.045em; line-height: 1.04; }
.dash-hero h1 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); letter-spacing: -.04em; }
.stat-card .sv, .metric .v, .hero-metrics .hm .v { font-size: 1.9rem; letter-spacing: -.04em; }
p, .muted { line-height: 1.65; }
.eyebrow, .eyebrow-chip, .tag { letter-spacing: .18em; }

/* ── Rhythm: more breathing room where it matters ───────────────────────── */
@media (min-width: 901px) {
    .portal-body { padding-bottom: 40px; }
    .bento { gap: 18px; }
}
.card-pad { padding: 26px; }
.dash-section-label { margin: 34px 0 6px; }
.panel-head { padding: 17px 20px; }
.panel-body { padding: 20px; }
.table-clean th { padding: 13px 20px; }
.table-clean td { padding: 15px 20px; }

/* ── Primary button: premium single-hue sheen + crisper depth ───────────── */
.btn-primary {
    position: relative; overflow: hidden;
    background: var(--primary);
    box-shadow: var(--rim), 0 1px 1px rgba(0,0,0,.2), 0 8px 20px -8px var(--primary-glow);
}
.btn-primary::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0) 55%);
    opacity: .8;
}
.btn-primary > * { position: relative; z-index: 1; }
.btn-primary:hover { background: var(--primary-2); box-shadow: var(--rim), 0 2px 4px rgba(0,0,0,.24), 0 14px 30px -8px var(--primary-glow); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

/* ── Nav / brand presence ───────────────────────────────────────────────── */
.brand { font-weight: 800; letter-spacing: -.03em; }
.nav { height: auto; }
.nav-inner { height: 70px; }

/* ── Cards: larger radius already via token; add a refined hover float ──── */
.card, .panel, .stat-card, .svc-card, .plan-card-v2 { transition: transform .22s cubic-bezier(.2,.9,.3,1.2), border-color .22s, box-shadow .22s; }
.stat-card:hover, .svc-card:hover, .plan-card-v2:hover { transform: translateY(-4px); }

/* ── Store (plans) hero — the shop window, made premium ─────────────────── */
.plans-hero, .bg-aurora > .heading-mega { }
.plan-card-v2 { padding: 30px 26px 26px; }
.plan-card-v2 .plan-name { font-size: 1.5rem; }
.plan-price .nominal { font-size: 2.3rem; letter-spacing: -.045em; }
.live-stats { border-radius: var(--radius-lg); }
.live-stats .ls-v { font-size: 1.55rem; letter-spacing: -.03em; }

/* ── Stat cards: give the tile more presence ────────────────────────────── */
.stat-card { padding: 22px; }
.stat-card .si-wrap { width: 46px; height: 46px; border-radius: 13px; }

/* ── Sidebar: a touch more refined spacing ──────────────────────────────── */
.side-link { padding: 11px 13px; }
.sidebar .brand { font-size: 1.15rem; }

/* ── Topbar: taller, more confident ─────────────────────────────────────── */
@media (min-width: 901px) { .topbar { height: 64px; } }
.topbar .page-title { font-size: 1.06rem; font-weight: 800; letter-spacing: -.02em; }

/* ── Pills & badges: refined ────────────────────────────────────────────── */
.pill { padding: 5px 12px; font-size: .74rem; }

/* ── Hairline dividers a touch softer ───────────────────────────────────── */
.divider { background: linear-gradient(90deg, transparent, var(--border) 12%, var(--border) 88%, transparent); }

/* ── Links: refined underline reveal ────────────────────────────────────── */
a.inline-link { background-image: linear-gradient(var(--primary-2), var(--primary-2)); background-size: 0% 1.5px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .25s; text-decoration: none; }
a.inline-link:hover { background-size: 100% 1.5px; }

/* ── Big money / totals: display treatment ──────────────────────────────── */
.total-line .amt, .hero-balance .balance-amount { font-size: 1.7rem; letter-spacing: -.04em; }

/* ── Refined scrollbar track spacing already set; keep consistent ───────── */
@media (max-width: 640px) {
    .card-pad { padding: 20px; }
    .heading-mega { font-size: clamp(1.8rem, 8vw, 2.4rem); }
    .plan-price .nominal { font-size: 1.9rem; }
}


/* ════════════════════════════════════════════════════════════════════════
 * Mobile finish — phone polish for the new layouts
 * ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    /* Dashboard hero mini-metrics: tighter, no dangling dividers on wrap */
    .hero-metrics { gap: 14px 18px; }
    .hero-metrics .hm + .hm { padding-left: 18px; }
    .hero-metrics .hm .v { font-size: 1.35rem; }
    .dash-hero .quick-actions { width: 100%; }
    .dash-hero .quick-actions .qa-btn { flex: 1; justify-content: center; }

    /* Bento gap a touch tighter on phones */
    .bento { gap: 12px; }

    /* Compensation control card: stack the day/note inputs */
    #komp-form .grid { grid-template-columns: 1fr !important; }

    /* Reports: date range filter stacks full width */
    .panel-body form input[type="date"] { flex: 1; }

    /* Section header rows wrap cleanly */
    .dash-section-label { flex-wrap: wrap; gap: 8px; }

    /* Keep KPI numbers from overflowing tiny screens */
    .stat-card .sv, .metric .v { font-size: 1.4rem; }
    .total-line .amt, .hero-balance .balance-amount { font-size: 1.45rem; }
}

@media (max-width: 380px) {
    .hero-metrics .hm + .hm { padding-left: 14px; border-left: none; }  /* drop divider on very small screens */
    .page-btn { padding: 0 10px; font-size: .82rem; }
}
