/* PayNex design system — shared by the dashboard (/dashboard) and the admin (/admin). Clean, neutral, Stripe-like. */
:root {
  --bg: #fafafa; --surface: #fff; --surface-2: #f6f6f6; --hover: #f4f4f4;
  --text: #0a0a0a; --text-2: #404040; --muted: #6b6b6b; --faint: #8a8a8a;
  --border: #e5e5e5; --border-2: #d4d4d4;
  --primary: #111; --primary-hover: #333; --primary-soft: #efefef; --on-primary: #fff; --link: #111;
  --ok-bg: #d7f7c2; --ok: #0b5e18; --warn-bg: #fcedb9; --warn: #8a4600; --bad-bg: #ffd7da; --bad: #b3093c; --info-bg: #ebebeb; --info: #262626; --neutral-bg: #efefef; --neutral: #404040;
  --green: #09825d; --red: #df1b41; --amber: #c37d16;
  --shadow: 0 1px 1px rgba(0, 0, 0, .04), 0 2px 5px rgba(0, 0, 0, .04);
  --shadow-pop: 0 15px 35px rgba(0, 0, 0, .14), 0 5px 15px rgba(0, 0, 0, .1);
  --radius: 8px; --sidebar: 236px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0a0a0a; --surface: #111; --surface-2: #0e0e0e; --hover: #1a1a1a; --text: #ededed; --text-2: #bdbdbd; --muted: #8e8e8e; --faint: #6e6e6e; --border: #262626; --border-2: #333;
    --primary: #f5f5f5; --primary-hover: #fff; --primary-soft: #1f1f1f; --on-primary: #0a0a0a; --link: #fff;
    --ok-bg: #12351f; --ok: #6be28a; --warn-bg: #3d2f0b; --warn: #f2c35a; --bad-bg: #44121c; --bad: #ff8ea1; --info-bg: #222; --info: #ddd; --neutral-bg: #1c1c1c; --neutral: #bdbdbd;
    --shadow: 0 1px 1px rgba(0, 0, 0, .25); --shadow-pop: 0 15px 35px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a; --surface: #111; --surface-2: #0e0e0e; --hover: #1a1a1a; --text: #ededed; --text-2: #bdbdbd; --muted: #8e8e8e; --faint: #6e6e6e; --border: #262626; --border-2: #333;
    --primary: #f5f5f5; --primary-hover: #fff; --primary-soft: #1f1f1f; --on-primary: #0a0a0a; --link: #fff;
  --ok-bg: #12351f; --ok: #6be28a; --warn-bg: #3d2f0b; --warn: #f2c35a; --bad-bg: #44121c; --bad: #ff8ea1; --info-bg: #222; --info: #ddd; --neutral-bg: #1c1c1c; --neutral: #bdbdbd;
  --shadow: 0 1px 1px rgba(0, 0, 0, .25); --shadow-pop: 0 15px 35px rgba(0, 0, 0, .5); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }

/* ---- shell ---------------------------------------------------------------------------------------------------------------- */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 12px 12px 14px; background: var(--bg); border-right: 1px solid var(--border); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 9px; padding: 6px 8px 14px; font-size: 17px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800; background: linear-gradient(135deg, #7a73ff, #3ec6ff 130%); }
.brand small { margin-left: 4px; padding: 2px 6px; border-radius: 5px; background: var(--neutral-bg); color: var(--neutral); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.switcher { position: relative; margin-bottom: 10px; }
.switcher > button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); text-align: left; }
.switcher > button:hover { border-color: var(--border-2); }
.avatar { width: 24px; height: 24px; flex: none; border-radius: 6px; display: grid; place-items: center; overflow: hidden; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.switcher .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.menu { position: absolute; z-index: 80; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.switcher .menu { left: 0; right: 0; top: calc(100% + 6px); }
.menu .item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 8px; background: none; border: 0; border-radius: 6px; text-align: left; color: var(--text); }
.menu .item:hover { background: var(--hover); text-decoration: none; }
.menu .item.on { font-weight: 600; }
.menu hr { height: 1px; margin: 6px -6px; border: 0; background: var(--border); }
.menu .label { padding: 6px 8px 4px; color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--text-2); font-weight: 500; }
.nav a:hover { background: var(--neutral-bg); text-decoration: none; color: var(--text); }
.nav a.on { background: var(--neutral-bg); color: var(--text); font-weight: 600; }
.nav a.on svg { color: var(--primary); }
.nav .count { margin-left: auto; padding: 0 7px; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 600; line-height: 18px; }
.nav .sep { height: 1px; margin: 10px 4px; background: var(--border); }
.nav .head { padding: 6px 10px 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.sidebar .grow { flex: 1; }
.sidebar .user { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: var(--radius); color: var(--text-2); font-size: 13px; }
.sidebar .user span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 32px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar .burger { display: none; }
.search { position: relative; flex: 0 1 420px; }
.search svg { position: absolute; left: 10px; top: 9px; color: var(--faint); }
.search input { width: 100%; height: 34px; padding: 0 12px 0 32px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); outline: 0; }
.search input:focus { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.topbar .spacer { flex: 1; }
.page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 32px 80px; }
.page.narrow { max-width: 820px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.page-head .grow { flex: 1; }
.crumb { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; color: var(--muted); font-weight: 500; }
.crumb:hover { color: var(--text); text-decoration: none; }
.sub { color: var(--muted); margin-top: 4px; }
.section { margin-top: 32px; }
.section > h2, .h2 { margin-bottom: 12px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.section > h2 .grow { flex: 1; }

/* ---- buttons ---------------------------------------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 6px; box-shadow: var(--shadow); color: var(--text); font-weight: 600; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); text-decoration: none; border-color: var(--faint); }
.btn:focus-visible, .seg button:focus-visible, .tabs a:focus-visible { outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 1px 1px rgba(0, 0, 0, .15); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--neutral-bg); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- forms ------------------------------------------------------------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .field > .lbl { font-weight: 600; color: var(--text); }
.field .hint { color: var(--muted); font-size: 12.5px; }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { width: 100%; height: 36px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 6px; box-shadow: var(--shadow); outline: 0; transition: border-color .12s, box-shadow .12s; }
.field textarea { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.input.sm { height: 30px; }
.field input[readonly] { background: var(--surface-2); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.affix { display: flex; align-items: center; }
.affix input { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.affix .suffix { height: 36px; padding: 0 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-2); border-left: 0; border-radius: 0 6px 6px 0; color: var(--muted); }
.form-error { margin: 0 0 12px; padding: 9px 12px; border-radius: 6px; background: var(--bad-bg); color: var(--bad); font-weight: 500; }
.form-error:empty { display: none; }
.note { padding: 10px 12px; border-radius: 6px; background: var(--info-bg); color: var(--info); }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.note.ok { background: var(--ok-bg); color: var(--ok); }

/* ---- cards, tables, badges ----------------------------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad, .pad { padding: 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { flex: 1; font-size: 14px; font-weight: 600; }
.card-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid2 > .card, .grid3 > .card { margin-top: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 9px 16px; text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--border); background: var(--surface-2); }
td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--hover); }
th.right, td.right { text-align: right; }
.card > .table-wrap > table th:first-child { border-top-left-radius: var(--radius); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty h3 { margin-bottom: 4px; color: var(--text); font-size: 15px; }
.empty .btn { margin-top: 14px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 6px; background: var(--neutral-bg); color: var(--neutral); font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad, .badge.off { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge svg.i { width: 12px; height: 12px; stroke-width: 2.6; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tabs { display: flex; gap: 22px; margin: 0 0 18px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a, .tabs button { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 0 10px; margin-bottom: -1px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .on { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .n { padding: 0 6px; border-radius: 9px; background: var(--neutral-bg); color: var(--neutral); font-size: 11.5px; line-height: 18px; }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--neutral-bg); border-radius: 8px; }
.seg button { height: 26px; padding: 0 11px; background: none; border: 0; border-radius: 6px; color: var(--text-2); font-weight: 600; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--border); color: var(--muted); }
dl.kv { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); margin: 0; }
dl.kv dt, dl.kv dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--border); }
dl.kv dt { color: var(--muted); }
dl.kv dd { overflow-wrap: anywhere; }
dl.kv dt:last-of-type, dl.kv dd:last-of-type { border-bottom: 0; }
.stack > * + * { margin-top: 16px; }

/* ---- metrics, charts ---------------------------------------------------------------------------------------------------------- */
.metric { padding: 18px 20px 14px; }
.metric .t { color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.metric .v { margin-top: 6px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metric .d { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.delta { font-weight: 600; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }
.chart { position: relative; margin-top: 14px; height: 120px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart + .axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--faint); font-size: 11.5px; }
.chart .tip { position: absolute; z-index: 5; pointer-events: none; min-width: 170px; padding: 9px 11px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-pop); font-size: 12px; transform: translateX(-50%); white-space: nowrap; }
.chart .tip .tt { font-weight: 600; margin-bottom: 6px; }
.chart .tip .tr { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.chart .tip .tr i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.chart .tip .tr span { color: var(--muted); flex: 1; }
.chart .tip .tr b { font-weight: 600; }
.chart .cursor { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-2); pointer-events: none; }
.chart .dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); pointer-events: none; }
.today { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.today > div { padding: 18px 20px; }
.today > div + div { border-left: 1px solid var(--border); }
.today .t { color: var(--muted); font-weight: 600; }
.today .v { margin-top: 4px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.today a.v { display: block; color: var(--text); }
.today a:hover { text-decoration: none; }
.progress { height: 6px; border-radius: 3px; background: var(--neutral-bg); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 3px; background: var(--primary); transition: width .3s; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.steps .ring { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--border-2); display: grid; place-items: center; color: #fff; }
.steps li.done .ring { background: var(--green); border-color: var(--green); }
.steps li.done .ring svg { width: 12px; height: 12px; stroke-width: 3; }
.steps li.done .what { color: var(--muted); text-decoration: line-through; }
.steps .what { flex: 1; min-width: 0; }
.steps .what b { display: block; font-weight: 600; }
.steps li.done .what b { font-weight: 500; }

/* ---- timeline, code, modal, toast -------------------------------------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 4px 0 4px 6px; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li:last-child { padding-bottom: 4px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 16px; bottom: -2px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-2); }
.timeline li.ok .dot { background: var(--green); border-color: var(--green); }
.timeline li.bad .dot { background: var(--red); border-color: var(--red); }
.timeline li.info .dot { background: var(--primary); border-color: var(--primary); }
.timeline .when { display: block; color: var(--muted); font-size: 12.5px; }
pre.codeblock { margin: 0; padding: 14px 16px; overflow: auto; max-height: 420px; background: #0a2540; color: #e6ebf3; border-radius: var(--radius); font: 12.5px/1.6 var(--mono); tab-size: 2; }
.copybox { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; }
.copybox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 13px var(--mono); }
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .5); animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(480px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-pop); animation: pop .14s; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal.wide { width: min(640px, 100%); }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 18px 22px 0; }
.modal-head h2 { flex: 1; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.modal-body { padding: 14px 22px 6px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; }
.toasts { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 240px; max-width: 380px; padding: 11px 14px; background: var(--text); color: var(--surface); border-radius: 8px; box-shadow: var(--shadow-pop); font-weight: 500; animation: pop .16s; }
.toast.bad { background: var(--red); color: #fff; }
.secret { font: 13px var(--mono); padding: 10px 12px; border: 1px dashed var(--border-2); border-radius: 6px; background: var(--surface-2); word-break: break-all; }
.skeleton { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--neutral-bg), var(--hover), var(--neutral-bg)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.logo-preview { width: 72px; height: 72px; border-radius: 12px; border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; background: var(--surface-2); color: var(--faint); }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.subnav { display: flex; flex-direction: column; gap: 1px; position: sticky; top: 76px; }
.subnav a { padding: 7px 10px; border-radius: 6px; color: var(--text-2); font-weight: 500; }
.subnav a:hover { background: var(--neutral-bg); text-decoration: none; }
.subnav a.on { background: var(--neutral-bg); color: var(--text); font-weight: 600; }

/* ---- sign-in -------------------------------------------------------------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; background: var(--bg); position: relative; overflow: hidden; }
.auth::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 220px; background: radial-gradient(60% 140% at 15% -20%, rgba(122, 115, 255, .35), transparent 70%), radial-gradient(50% 120% at 85% -30%, rgba(62, 198, 255, .3), transparent 70%); pointer-events: none; }
.auth-box { position: relative; width: min(400px, 100%); }
.auth .brand { justify-content: center; padding-bottom: 22px; font-size: 20px; }
.auth h1 { margin-bottom: 18px; font-size: 22px; font-weight: 700; text-align: center; letter-spacing: -.02em; }
.auth .card { padding: 26px; box-shadow: var(--shadow-pop); }
.auth .foot { margin-top: 18px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---- admin extras ----------------------------------------------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 0 0 18px; }
.stats .stat { padding: 16px 18px; margin: 0; }
.stat b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12.5px; }
.card.user { margin-bottom: 16px; }
.user-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.user-head h3 { font-size: 15px; display: flex; gap: 8px; align-items: center; }
.card > h3 { padding: 14px 20px 0; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card > p.muted { padding: 4px 20px 0; }
.card > .table-wrap { margin-top: 12px; }
.card > .seg { margin: 14px 20px; }
.card > .actions { padding: 12px 20px; }
h2.part { margin: 34px 0 14px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.barrow { display: grid; grid-template-columns: 70px 1fr 40px 190px; gap: 10px; align-items: center; padding: 3px 20px; font-size: 12.5px; }
.barrow .track { height: 8px; border-radius: 4px; background: var(--neutral-bg); overflow: hidden; }
.barrow .track i { display: block; height: 100%; background: var(--primary); opacity: .55; }
.barrow .track i.peak { opacity: 1; }
.bars { padding: 10px 0 14px; }
.code { display: inline-block; padding: 12px 16px; margin: 6px 0; background: var(--surface-2); border: 1px dashed var(--border-2); border-radius: 6px; font: 600 18px var(--mono); letter-spacing: .04em; user-select: all; }

/* ---- responsive --------------------------------------------------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: 264px; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow-pop); }
  .app.menu-open .sidebar { transform: none; }
  .app.menu-open::after { content: ""; position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .45); }
  .topbar { padding: 10px 16px; }
  .topbar .burger { display: inline-flex; }
  .page { padding: 20px 16px 60px; }
  .cols, .settings-layout, .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .today { grid-template-columns: 1fr; } .today > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .subnav { position: static; flex-direction: row; overflow-x: auto; }
  .barrow { grid-template-columns: 60px 1fr 36px; } .barrow em { display: none; }
  .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .page-head h1 { font-size: 22px; }
  dl.kv { grid-template-columns: 1fr; } dl.kv dt { border-bottom: 0; padding-bottom: 0; }
  th, td { padding-left: 12px; padding-right: 12px; }
  .search { flex: 1; }
}
@media print { .sidebar, .topbar, .btn { display: none !important; } .app { display: block; } }

.brand .wordmark { height: 22px; width: auto; display: block; }
.auth-box .brand .wordmark { height: 34px; }
.auth-box .brand { gap: 12px; }
@media (prefers-color-scheme: dark) { :root[data-theme=auto] .wordmark { filter: invert(1); } }
:root[data-theme=dark] .wordmark { filter: invert(1); }

@media (max-width: 1280px) { th { padding: 9px 12px; } td { padding: 11px 12px; } th:first-child, td:first-child { padding-left: 16px; } th:last-child, td:last-child { padding-right: 16px; } }
.home-today { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.home-today > .card, .home-today .stack > .card { margin-top: 0; }
@media (max-width: 900px) { .home-today { grid-template-columns: minmax(0, 1fr); } }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text-2); font-size: 12.5px; cursor: pointer; }
.pill:hover { background: var(--hover); }
.pill b { color: var(--primary); font-weight: 600; }
.pill svg.i { width: 12px; height: 12px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.filters .grow { flex: 1; }
.metric.editing { outline: 2px dashed var(--border-2); outline-offset: -2px; }
.metric .x { position: absolute; top: 10px; right: 10px; }
.metric { position: relative; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.picker .opt { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.picker .opt:hover { border-color: var(--border-2); }
.picker .opt.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.picker .opt small { color: var(--muted); }
.metric .t.pick { cursor: pointer; }
.balbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--neutral-bg); }
.balbar i { display: block; height: 100%; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.legend-row i { width: 8px; height: 8px; border-radius: 2px; }
.legend-row b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* no visible scrollbars (arrows + thumb) inside fields: they still scroll with the wheel / touch / keyboard */
textarea, select, input, .copybox, pre, code, .modal, .menu { scrollbar-width: none; -ms-overflow-style: none; }
textarea::-webkit-scrollbar, select::-webkit-scrollbar, input::-webkit-scrollbar, .copybox::-webkit-scrollbar, pre::-webkit-scrollbar, code::-webkit-scrollbar, .modal::-webkit-scrollbar, .menu::-webkit-scrollbar { display: none; width: 0; height: 0; }
.field textarea { resize: none; }

/* country picker (chips + selector) and per-method delivery block */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--text); }
.chip button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.chip button:hover { background: var(--hover); color: var(--text); }
.ship-method { padding: 14px 0; border-top: 1px solid var(--border); }
.ship-method:first-child { padding-top: 0; border-top: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--hover); }
.section-title { margin: 20px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.section-title:first-child { margin-top: 0; }
