/* ==========================================================================
   EasyCom Plus — Driver app design system (mobile-first, Light Premium)
   Shares tokens with admin.css. Plain CSS, no build step.
   ========================================================================== */

:root {
    --brand: #FF6B00; --brand-600: #E65F00; --brand-50: #FFF4EC; --brand-100: #FFE4D1;
    --bg: #F6F7F9; --surface: #FFFFFF; --surface-2: #F9FAFB;
    --border: #E6E8EC; --border-strong: #D5D9E0;
    --text: #0F172A; --text-2: #334155; --muted: #64748B; --faint: #94A3B8;
    --success: #059669; --success-50: #ECFDF5;
    --warning: #D97706; --warning-50: #FFFBEB;
    --danger: #DC2626; --danger-50: #FEF2F2;
    --info: #2563EB; --info-50: #EFF6FF;
    --radius: 14px; --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, .08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, .16);
    --ring: 0 0 0 3px rgba(255, 107, 0, .22);
    --ease: cubic-bezier(.2, .8, .2, 1);
    --font: 'Prompt', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
    --bg: #0B1120; --surface: #111827; --surface-2: #0F172A;
    --border: #1F2937; --border-strong: #334155;
    --text: #F1F5F9; --text-2: #CBD5E1; --muted: #94A3B8; --faint: #64748B;
    --brand-50: rgba(255, 107, 0, .14); --brand-100: rgba(255, 107, 0, .24);
    --success-50: rgba(5, 150, 105, .16); --warning-50: rgba(217, 119, 6, .16);
    --danger-50: rgba(220, 38, 38, .16); --info-50: rgba(37, 99, 235, .16);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 10px 30px rgba(0, 0, 0, .45);
}
[data-theme="dark"] .alert-warning { color: #FBBF24; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html { -webkit-text-size-adjust: 100%; }
body.fx {
    margin: 0; min-height: 100vh;
    font-family: var(--font); font-size: 15px; line-height: 1.55;
    color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }

/* ---------- Helpers ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 13px; } .xs { font-size: 12px; }
.fw-600 { font-weight: 600; } .center { text-align: center; } .right { text-align: right; }
.brand-text { color: var(--brand); } .success-text { color: var(--success); } .danger-text { color: var(--danger); }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: 16px; }
.nowrap { white-space: nowrap; } .num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 20px; border: 1px solid var(--border); border-radius: 14px;
    background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px;
    cursor: pointer; user-select: none; transition: background .15s, border-color .15s, transform .06s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(255, 107, 0, .28); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.link { color: var(--brand-600); font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; font-weight: 500; color: var(--text-2); }
.input, .select, .textarea {
    width: 100%; min-height: 50px; padding: 0 14px;
    border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
    font-size: 16px; /* avoids iOS zoom */
    transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input.is-invalid, .select.is-invalid { border-color: var(--danger); }
.field-error { font-size: 13px; color: var(--danger); }
.hint { font-size: 13px; color: var(--muted); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.input-icon > .input { padding-left: 42px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--faint); cursor: pointer; }
.pw-wrap button:hover { color: var(--text); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand); flex-shrink: 0; }

/* ---------- Choice cards (radio) ---------- */
.choices { display: grid; gap: 12px; }
.choices.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice {
    position: relative; display: flex; align-items: center; gap: 14px;
    padding: 16px; border: 1.5px solid var(--border); border-radius: 16px; background: var(--surface);
    cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}
.choice:active { transform: scale(.99); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-icon { width: 46px; height: 46px; flex-shrink: 0; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: 19px; transition: background .15s, color .15s; }
.choice-body { flex: 1; min-width: 0; }
.choice-title { display: block; font-weight: 600; }
.choice-sub { display: block; font-size: 13px; color: var(--muted); }
.choice-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); flex-shrink: 0; display: grid; place-items: center; color: #fff; font-size: 11px; transition: all .15s; }
.choice:hover { border-color: var(--border-strong); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand) inset; }
.choice:has(input:checked) .choice-icon { background: var(--brand); color: #fff; }
.choice:has(input:checked) .choice-check { background: var(--brand); border-color: var(--brand); }
.choice:has(input:focus-visible) { box-shadow: var(--ring); }
.choice.vertical { flex-direction: column; align-items: flex-start; }
.choice.vertical .choice-check { position: absolute; top: 14px; right: 14px; }

/* ---------- Cards / badges ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title { margin: 0; font-size: 16px; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--surface-2); color: var(--text-2); }
.badge-brand { background: var(--brand-50); color: var(--brand-600); }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-info { background: var(--info-50); color: var(--info); }
.alert { display: flex; gap: 12px; padding: 13px 15px; border-radius: 14px; font-size: 14px; }
.alert i { margin-top: 3px; }
.alert-danger { background: var(--danger-50); color: var(--danger); }
.alert-success { background: var(--success-50); color: var(--success); }
.alert-info { background: var(--info-50); color: var(--info); }
.alert-warning { background: var(--warning-50); color: #B45309; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- Tier table / editor ---------- */
.tiers { width: 100%; border-collapse: collapse; font-size: 14px; }
.tiers th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 10px; background: var(--surface-2); font-size: 12.5px; }
.tiers th:first-child { border-radius: 10px 0 0 10px; } .tiers th:last-child { border-radius: 0 10px 10px 0; }
.tiers td { padding: 9px 10px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.tiers .right { text-align: right; }
.tier-row { display: grid; grid-template-columns: 28px 1fr 1fr 1fr 36px; gap: 8px; align-items: center; }
.tier-row .input { min-height: 44px; padding: 0 10px; font-size: 15px; border-radius: 11px; }
.tier-head { font-size: 12px; color: var(--muted); font-weight: 500; }
.tier-n { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--muted); }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--faint); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--danger); }
.icon-btn[disabled] { opacity: .3; pointer-events: none; }
.calc-box { border: 1px dashed var(--border-strong); border-radius: 16px; padding: 16px; background: var(--surface-2); }
.calc-total { font-size: 28px; font-weight: 700; color: var(--brand); letter-spacing: -.02em; }

/* ---------- Auth layout ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-hero {
    position: relative; overflow: hidden; color: #fff;
    padding: 28px 22px 64px;
    background: radial-gradient(900px 420px at -10% 35%, rgba(255, 180, 107, .55) 0%, transparent 60%), linear-gradient(140deg, #FF6B00 0%, #F04E00 55%, #C2410C 100%);
}
.auth-hero::after { content: ''; position: absolute; right: -80px; bottom: -120px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.auth-logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; }
.auth-logo span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, .18); backdrop-filter: blur(6px); }
.auth-hero h1 { margin: 26px 0 8px; font-size: 26px; line-height: 1.25; font-weight: 700; }
.auth-hero p { margin: 0; opacity: .9; max-width: 440px; }
.auth-points { display: none; margin: 32px 0 0; padding: 0; list-style: none; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.auth-points i { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .16); }
.auth-main { display: flex; justify-content: center; align-items: flex-start; padding: 0 16px 40px; margin-top: -40px; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 460px; padding: 26px 22px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); }
.auth-card h2 { margin: 0 0 4px; font-size: 22px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 14px; color: var(--muted); }

@media (min-width: 960px) {
    .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .auth-hero { padding: 48px clamp(48px, 6vw, 112px); display: flex; flex-direction: column; }
    /* Logo pinned to the top; the message block sits in the vertical middle of what remains. */
    .auth-logo { margin-bottom: auto; }
    .auth-hero h1, .auth-hero p, .auth-points { position: relative; z-index: 1; max-width: 520px; }
    .auth-hero h1 { font-size: clamp(32px, 2.6vw, 42px); margin: 48px 0 12px; max-width: 640px; }
    .auth-hero p { font-size: 16px; line-height: 1.65; }
    .auth-points { display: block; margin: 36px 0 auto; padding-bottom: 48px; }
    .auth-points li { margin-bottom: 10px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); }
    .auth-hero::before { content: ''; position: absolute; right: -140px; top: -140px; width: 420px; height: 420px; border-radius: 50%; border: 56px solid rgba(255, 255, 255, .07); }
    .auth-hero::after { right: auto; left: -110px; bottom: -150px; width: 360px; height: 360px; background: rgba(255, 255, 255, .06); }
    .auth-main { align-items: center; margin-top: 0; padding: 40px; }
    .auth-card { max-width: 440px; padding: 40px 36px; box-shadow: var(--shadow-md); }
}

/* ---------- Setup wizard layout ---------- */
.setup-top { position: sticky; top: 0; z-index: 20; padding-top: var(--safe-t); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.setup-top-inner { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-mark { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--brand), #FF9A3D); box-shadow: 0 6px 14px rgba(255, 107, 0, .3); }
.steps { display: flex; gap: 6px; max-width: 760px; margin: 0 auto; padding: 0 16px 12px; }
.step { flex: 1; }
.step-bar { height: 5px; border-radius: 999px; background: var(--border); overflow: hidden; }
.step.is-done .step-bar, .step.is-current .step-bar { background: var(--brand); }
.step.is-current .step-bar { background: linear-gradient(90deg, var(--brand) 60%, var(--brand-100)); }
.step-label { margin-top: 6px; font-size: 11.5px; color: var(--faint); font-weight: 500; }
.step.is-current .step-label, .step.is-done .step-label { color: var(--text-2); }
.setup-main { max-width: 760px; margin: 0 auto; padding: 22px 16px calc(110px + var(--safe-b)); }
.setup-title { margin: 0 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.setup-sub { margin: 0 0 20px; color: var(--muted); }
.setup-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 12px 16px calc(12px + var(--safe-b));
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
}
.setup-actions-inner { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; }
.setup-actions-inner .btn-primary { flex: 1; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented label { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.summary { display: grid; gap: 10px; }
.summary-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.summary-item .choice-icon { background: var(--brand-50); color: var(--brand); }

.success-hero { text-align: center; padding: 18px 0 8px; }
.success-hero .ring { width: 84px; height: 84px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: var(--success-50); color: var(--success); font-size: 36px; animation: pop .4s var(--ease); }

/* ---------- Driver app shell ---------- */
.app-top { position: sticky; top: 0; z-index: 40; padding-top: var(--safe-t); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.app-top-inner { max-width: 1120px; margin: 0 auto; height: 60px; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.app-nav { display: none; gap: 4px; margin-left: 18px; }
.app-nav a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 11px; color: var(--muted); font-weight: 500; font-size: 14px; }
.app-nav a:hover { background: var(--surface); color: var(--text); }
.app-nav a.is-active { background: var(--brand-50); color: var(--brand-600); }
.app-top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; }
.top-btn:hover { background: var(--surface); color: var(--text); }
.app-main { max-width: 1120px; margin: 0 auto; padding: 18px 16px calc(96px + var(--safe-b)); }
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    padding: 6px 6px calc(6px + var(--safe-b));
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center; border-radius: 12px; color: var(--faint); font-size: 11px; font-weight: 500; }
.tabbar a i { font-size: 18px; }
.tabbar a.is-active { color: var(--brand); }
.tabbar .fab { position: relative; top: -14px; width: 56px; height: 56px; min-height: 0; margin: 0 auto; border-radius: 18px; background: linear-gradient(135deg, var(--brand), #FF9A3D); color: #fff; box-shadow: 0 10px 24px rgba(255, 107, 0, .4); }
.tabbar .fab i { font-size: 22px; }
.tabbar .fab span { display: none; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; }
.crumbs a:hover { color: var(--text); }
/* Larger touch area for small header links without changing how they look */
.card-head .link, .page-head .link { display: inline-flex; align-items: center; min-height: 36px; }
.crumbs i { font-size: 10px; color: var(--faint); }
@media (max-width: 899.98px) { .desk-only { display: none !important; } }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); min-width: 0; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--brand-50); color: var(--brand); font-size: 13px; }
.kpi-icon.is-success { background: var(--success-50); color: var(--success); }
.kpi-icon.is-info { background: var(--info-50); color: var(--info); }
.kpi-icon.is-warning { background: var(--warning-50); color: var(--warning); }
.kpi-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-meta { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.trend { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; font-weight: 600; font-size: 11.5px; }
.trend.up { background: var(--success-50); color: var(--success); }
.trend.down { background: var(--danger-50); color: var(--danger); }
.hero-kpi { padding: 18px; border-radius: 22px; color: #fff; background: radial-gradient(600px 200px at 110% -20%, rgba(255,255,255,.22), transparent 60%), linear-gradient(135deg, #FF6B00, #E04E00); box-shadow: 0 14px 30px rgba(255, 107, 0, .28); }
.hero-kpi .kpi-label { color: rgba(255,255,255,.85); }
.hero-kpi .big { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-kpi .sub { margin-top: 6px; font-size: 13px; opacity: .9; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-main { flex: 1; min-width: 0; }
.date-chip { width: 46px; flex-shrink: 0; text-align: center; border-radius: 12px; background: var(--surface-2); padding: 6px 0; line-height: 1.1; }
.date-chip .d { font-size: 17px; font-weight: 700; }
.date-chip .m { font-size: 11px; color: var(--muted); }
.date-chip.is-today { background: var(--brand-50); color: var(--brand-600); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty-icon { width: 58px; height: 58px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 18px; background: var(--surface-2); color: var(--faint); font-size: 22px; }
.empty-title { margin: 0 0 4px; font-weight: 600; color: var(--text); }
.chart-box { position: relative; height: 220px; }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font-weight: 500; font-size: 14px; }
.quick a:hover { border-color: var(--brand); background: var(--brand-50); }
.quick a i { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--brand); }
.seg-mini { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.seg-mini button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg-mini button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 14px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.money { font-variant-numeric: tabular-nums; }

/* Delivery form */
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; }
.stepper button { min-height: 56px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); font-size: 20px; color: var(--text-2); cursor: pointer; }
.stepper button:active { transform: scale(.97); }
.stepper .input { min-height: 56px; text-align: center; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.chip-btn.is-active, .chip-btn:hover { border-color: var(--brand); color: var(--brand-600); background: var(--brand-50); }
label.chip-btn { display: inline-flex; align-items: center; position: relative; }
label.chip-btn input { position: absolute; opacity: 0; pointer-events: none; }
label.chip-btn:has(input:checked) { border-color: var(--brand); color: var(--brand-600); background: var(--brand-50); font-weight: 600; }
label.chip-btn:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--ring); }
.preview { border-radius: 18px; padding: 16px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.preview .calc-total { font-size: 30px; }
.preview.is-loading { opacity: .55; }
.sticky-submit { position: sticky; bottom: calc(76px + var(--safe-b)); z-index: 20; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 110; display: none; align-items: flex-end; justify-content: center; background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); padding: 16px; }
.modal-backdrop.is-open { display: flex; animation: fadein .15s ease; }
.modal { width: 100%; max-width: 420px; background: var(--surface); border-radius: 22px; padding: 22px; box-shadow: var(--shadow-lg); animation: pop .2s var(--ease); }
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.modal .row { justify-content: flex-end; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); background: var(--danger); }
@keyframes fadein { from { opacity: 0; } }

/* Finance */
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .3s var(--ease); }
.meter.is-good > span { background: var(--success); }
.meter.is-warning > span { background: var(--warning); }
.meter.is-over > span { background: var(--danger); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.income-text { color: var(--success); } .expense-text { color: var(--danger); }

/* Settings */
.set-nav { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 18px; padding: 0 16px 4px; scrollbar-width: none; }
.set-nav::-webkit-scrollbar { display: none; }
.set-nav a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 14px; }
.set-nav a:hover { color: var(--text); }
.set-nav a.is-active { background: var(--brand-50); border-color: var(--brand); color: var(--brand-600); }
.avatar { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 20px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: 0; }
.switch { position: relative; flex: 0 0 auto; width: 48px; height: 28px; }
.switch input { position: absolute; inset: 0; z-index: 1; margin: 0; opacity: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s var(--ease); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.version { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.version + .version { margin-top: 10px; }
.version.is-current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.version > summary { list-style: none; cursor: pointer; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; }
.version > summary::-webkit-details-marker { display: none; }
.version > summary .fa-chevron-down { transition: transform .15s; }
.version[open] > summary { border-bottom: 1px solid var(--border); }
.version[open] > summary .fa-chevron-down { transform: rotate(180deg); }
.version-body { padding: 12px 16px 16px; }
.badge-danger { background: var(--danger-50); color: var(--danger); }
[data-rate-preview].is-loading .calc-box { opacity: .55; }
.date-check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.date-check .input { flex: 1 1 160px; }

@media (min-width: 900px) {
    .set-nav { margin: 0 0 18px; padding: 0 0 4px; }
    .app-nav { display: flex; }
    .tabbar { display: none; }
    .app-main { padding: 26px 24px 48px; }
    .page-title { font-size: 26px; }
    .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
    .kpi { padding: 18px; }
    .kpi-value { font-size: 26px; }
    .grid-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
    .grid-halves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
    .mob-only { display: none !important; }
    .chart-box { height: 260px; }
    .sticky-submit { position: static; }
    .modal-backdrop { align-items: center; }
}
@media (max-width: 899px) {
    .grid-main > * + *, .grid-halves > * + * { margin-top: 14px; }
}

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 16px; right: 16px; top: calc(16px + var(--safe-t)); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 460px; width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--text); color: #fff; box-shadow: var(--shadow-lg); animation: drop .25s var(--ease); font-size: 14px; }
.toast.is-success i { color: #34D399; } .toast.is-error i { color: #F87171; }
.toast.is-leaving { animation: rise .2s ease forwards; }

@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } }
@keyframes rise { to { opacity: 0; transform: translateY(-10px); } }

@media (min-width: 640px) {
    .setup-main { padding-top: 32px; }
    .setup-title { font-size: 28px; }
    .choices.cols-sm-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Desktop: the wizard's buttons follow the content (sticky only when it is long)
   instead of being pinned to the bottom of a tall window far below short steps. */
@media (min-width: 960px) {
    .setup-main { padding-bottom: 56px; }
    .setup-actions { position: sticky; left: auto; right: auto; margin: 28px -16px 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); }
}
@media (max-width: 420px) {
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .tier-row { grid-template-columns: 24px 1fr 1fr 1fr 30px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.field-error.is-info { display: block; padding: 10px 12px; border-radius: 12px; background: var(--info-50); color: var(--info); }
a.kpi { display: block; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.kpi:hover { border-color: var(--brand-100); box-shadow: var(--shadow-md); }
