/* CP SCS prototype — dark admin theme (tokens carried over from the design canvas) */
:root {
  color-scheme: dark;
  /* color */
  --bg: #0D0F12; --bg-side: #111418; --surface: #14171B; --surface-2: #1A1E23; --surface-3: #222830;
  --border: #262C34; --border-strong: #39414C; --border-hover: #4A5360;
  --text: #E6E9ED; --text-2: #AAB2BD; --text-3: #8A94A0; --text-body: #C9CFD6;
  --accent: #7FA6FF; --accent-hover: #9AB8FF; --accent-ink: #0A0F1E; --accent-soft: rgba(127,166,255,.14);
  --success: #4CC38A; --warning: #E8A93F; --danger: #F2716F; --info: #5CBAD8;
  --success-ink: #74D8A8; --warning-ink: #F2C06A; --danger-ink: #F99A98; --info-ink: #86CFE6;
  /* type */
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 32px;
  /* spacing */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  /* radius & borders */
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-full: 999px; --bw: 1px;
  /* controls */
  --h-sm: 28px; --h-md: 36px; --h-lg: 40px; --h-touch: 44px;
  /* layout */
  --sidebar-w: 232px; --topbar-h: 60px; --gutter: 24px;
  /* z-index */
  --z-menu: 30; --z-drawer: 40; --z-modal: 50; --z-toast: 60;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: var(--fs-md)/1.45 var(--font-sans); }
a { color: var(--accent-hover); }
a:hover { color: #C2D4FF; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
.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; }
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 100; padding: 8px 12px; border-radius: var(--r-md); background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.skip-link:focus { top: 8px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: var(--fs-xs); }
.sub { font-size: var(--fs-xs); color: var(--text-3); }
.muted { color: var(--text-2); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-r { text-align: right; }
.inline { display: inline-flex; align-items: center; gap: var(--sp-2); }
.inline.wrap { flex-wrap: wrap; }

/* ---- icons ---- */
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ic .fill { fill: currentColor; stroke: none; }
.ic-sm { width: 13px; height: 13px; }
.muted-ic { width: 28px; height: 28px; color: var(--text-3); }
.tone-danger.ic { width: 28px; height: 28px; color: var(--danger); }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--h-md); padding: 0 14px; border-radius: var(--r-md); border: var(--bw) solid var(--border-strong); background: var(--surface-2); color: var(--text); font: 500 var(--fs-sm)/1 var(--font-sans); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-3); border-color: var(--border-hover); color: var(--text); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn[aria-busy="true"] { opacity: .8; cursor: progress; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { height: var(--h-sm); padding: 0 10px; font-size: var(--fs-xs); }
.btn-lg { height: var(--h-lg); font-size: var(--fs-md); }
.icon-btn { width: var(--h-md); padding: 0; }
.icon-btn.btn-sm { width: var(--h-sm); }
.btn-md { height: var(--h-touch); width: var(--h-touch); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex-shrink: 0; }
.spinner.sm { width: 12px; height: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- fields ---- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.input { height: var(--h-md); width: 100%; padding: 0 12px; border-radius: var(--r-md); border: var(--bw) solid var(--border-strong); background: var(--bg); color: var(--text); font: var(--fs-md) var(--font-sans); }
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--border-hover); }
.input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.input.is-error { border-color: var(--danger); }
.input:disabled, .input:read-only:not(select) { opacity: .75; }
select.input { padding-right: 28px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pw-toggle:hover { background: var(--surface-3); color: var(--text); }
.chk { display: inline-flex; align-items: center; gap: 8px; height: var(--h-md); padding: 0 12px; border: var(--bw) solid var(--border-strong); border-radius: var(--r-md); font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; white-space: nowrap; }
.chk input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }

/* ---- badges ---- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; border: var(--bw) solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.t-success { color: var(--success-ink); background: rgba(76,195,138,.12); border-color: rgba(76,195,138,.24); }
.t-warning { color: var(--warning-ink); background: rgba(232,169,63,.12); border-color: rgba(232,169,63,.24); }
.t-danger { color: var(--danger-ink); background: rgba(242,113,111,.12); border-color: rgba(242,113,111,.26); }
.t-info { color: var(--info-ink); background: rgba(92,186,216,.12); border-color: rgba(92,186,216,.24); }
.t-neutral { color: var(--text-2); background: rgba(170,178,189,.07); border-color: var(--border-strong); }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-sm); background: var(--surface-3); border: var(--bw) solid var(--border-strong); font: 500 var(--fs-xs) var(--font-mono); color: var(--text-2); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-hover); font-size: 11px; }

/* ---- switch ---- */
.switch { position: relative; width: 38px; height: 22px; border-radius: var(--r-full); border: var(--bw) solid var(--border-strong); background: var(--surface-3); padding: 0; cursor: pointer; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform .15s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { transform: translateX(16px); background: var(--accent-ink); }
.switch:hover:not(:disabled) { border-color: #5A6472; }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.switch.busy { opacity: .7; cursor: progress; }

/* ---- surfaces ---- */
.card { background: var(--surface); border: var(--bw) solid var(--border); border-radius: var(--r-lg); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 14px 18px; border-bottom: var(--bw) solid var(--border); }
.card-h h2 { font-size: 15px; font-weight: 600; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); border: var(--bw) solid; font-size: var(--fs-sm); }
.alert > .ic { margin-top: 1px; }
.alert-body { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.alert-body strong { font-weight: 600; }
.alert-info { border-color: rgba(92,186,216,.35); background: rgba(92,186,216,.08); color: #CDEAF3; }
.alert-success { border-color: rgba(76,195,138,.35); background: rgba(76,195,138,.08); color: #CFF0DF; }
.alert-warning { border-color: rgba(232,169,63,.35); background: rgba(232,169,63,.08); color: #F5DEB5; }
.alert-danger { border-color: rgba(242,113,111,.35); background: rgba(242,113,111,.08); color: #F2D3D2; }
.skel { display: inline-block; background: var(--surface-3); border-radius: 4px; animation: pulse 1.4s ease-in-out infinite; max-width: 100%; }
.skel.pill { border-radius: var(--r-full); }
@keyframes pulse { 50% { opacity: .45; } }
.empty { padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.empty-title { font-size: 15px; font-weight: 600; }
.empty .muted { font-size: var(--fs-sm); max-width: 420px; }
.empty .btn { margin-top: 8px; }

/* ---- brand ---- */
.brand { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 8px; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font: 700 11px var(--font-mono); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 600; font-size: var(--fs-md); }
.brand-sub { font-size: 11px; color: var(--text-3); }

/* ---- shell ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; background: var(--bg-side); border-right: var(--bw) solid var(--border); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: var(--r-md); color: var(--text-2); text-decoration: none; font: 500 var(--fs-sm) var(--font-sans); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--text); }
.nav-item.active .ic { color: var(--accent); }
.nav-group { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.main-col { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: var(--topbar-h); display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--gutter); border-bottom: var(--bw) solid var(--border); position: sticky; top: 0; background: rgba(13,15,18,.96); z-index: 20; }
.topbar-title { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.page-title { font-size: var(--fs-xl); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted-title { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-3); min-width: 0; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs [aria-current] { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { flex-grow: 1; padding: 20px var(--gutter) 32px; min-width: 0; }
.page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.backdrop { position: fixed; inset: 0; background: rgba(5,6,8,.64); z-index: calc(var(--z-drawer) - 1); }

/* user menu & dropdowns */
.user-menu, .card-menu { position: relative; }
.user-btn { height: 44px; gap: 10px; padding: 0 8px 0 6px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); border: var(--bw) solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--text); }
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.user-name { font-size: var(--fs-sm); color: var(--text); }
.user-role { font-size: 11px; color: var(--text-3); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); width: 240px; background: var(--surface-2); border: var(--bw) solid var(--border-strong); border-radius: 10px; padding: 6px; z-index: var(--z-menu); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.menu-head { padding: 8px 10px 10px; border-bottom: var(--bw) solid var(--border); margin-bottom: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; font: var(--fs-sm) var(--font-sans); background: none; border: 0; cursor: pointer; text-align: left; }
.menu-item:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.menu-item:disabled { color: var(--text-3); cursor: not-allowed; }

/* demo panel — visually separate from the product */
.demo { margin-top: auto; border: var(--bw) dashed rgba(232,169,63,.45); background: rgba(232,169,63,.04); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.demo .label { font-size: 11px; }
.demo .input { height: 30px; font-size: var(--fs-xs); }
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.demo-head .btn { padding: 0 6px; font-size: 11px; height: 24px; }
.demo-title { white-space: nowrap; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--warning-ink); }
.demo-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-actions .btn { white-space: normal; height: auto; min-height: var(--h-sm); padding: 6px 10px; text-align: left; line-height: 1.2; }
.seg { display: flex; padding: 2px; border-radius: var(--r-sm); background: var(--bg); border: var(--bw) solid var(--border); }
.seg button { flex: 1; height: 26px; border: 0; border-radius: 4px; background: none; color: var(--text-2); font: 500 var(--fs-xs) var(--font-sans); cursor: pointer; }
.seg button.on { background: var(--surface-3); color: var(--text); }
.demo-creds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.demo-creds li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-creds li .btn { margin-left: auto; }

/* ---- login ---- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.login-wrap { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.login-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.login-title { font-size: var(--fs-xl); font-weight: 600; }
.login-wrap .demo { margin-top: 0; }

/* ---- accounts ---- */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.tile-label { font-size: var(--fs-sm); color: var(--text-3); }
.tile-value { font-size: var(--fs-2xl); font-weight: 600; }
.tone-warning { color: var(--warning-ink); }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search .input { padding-left: 34px; }
.search-ic { position: absolute; left: 11px; top: 10px; color: var(--text-3); }
.filters-extra { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters-extra[hidden] { display: none; }
.filters-extra .field { width: auto; }
.filters-extra select.input { width: auto; min-width: 160px; }
.toolbar-actions { display: flex; gap: 8px; margin-left: auto; }
.results { display: flex; align-items: center; gap: 12px; min-height: 28px; font-size: var(--fs-sm); color: var(--text-2); }
.is-stale .bal time, .is-stale .bal .amount { opacity: .7; }

.table { overflow: hidden; }
.tr { display: grid; align-items: center; column-gap: 16px; padding: 0 16px; }
.tr.admin { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(200px, 1.1fr) minmax(0, 1fr) 96px 104px; }
.tr.op { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr) minmax(200px, 1.1fr) minmax(0, 1.1fr) 104px; }
.th { min-height: 38px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); border-bottom: var(--bw) solid var(--border); }
.td-row { min-height: 62px; padding-top: 10px; padding-bottom: 10px; border-bottom: var(--bw) solid var(--border); }
.td-row:last-child { border-bottom: 0; }
.td-row:hover { background: rgba(255,255,255,.018); }
.cell-acc { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.acc-link { color: var(--text); font-weight: 600; text-decoration: none; }
.acc-link:hover { color: var(--accent-hover); text-decoration: underline; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.parse-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.bal { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.amount { font-weight: 600; }
.amount .cur { color: var(--text-3); font-weight: 500; }
.amount-big { font-size: var(--fs-3xl); letter-spacing: -.01em; }
.amount-big .cur { font-size: 18px; }
.bal-none { color: var(--text-2); }
.stale { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--warning-ink); }
.bal time.sub, .bal .sub { font-size: var(--fs-xs); }

.m-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.m-card { background: var(--surface); border: var(--bw) solid var(--border); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.m-card-top { display: flex; justify-content: space-between; gap: 12px; }
.m-card-top .bal { align-items: flex-end; }
.m-name { font-size: 15px; }
.m-badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.m-actions { display: flex; gap: 8px; }
.m-actions .btn { height: var(--h-touch); }
.m-actions .icon-btn { width: var(--h-touch); }
.m-open { flex-grow: 1; }

/* ---- account ---- */
.acc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.acc-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.acc-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-title-lg { font-size: var(--fs-2xl); font-weight: 600; }
.acc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: var(--bw) solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.tab { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--text-2); font: 500 var(--fs-sm) var(--font-sans); text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.overview .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sk-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.fin-top { padding: 18px 18px 4px; display: flex; flex-direction: column; gap: 6px; }
.fin-top .k, .kv dt { color: var(--text-3); font-size: var(--fs-sm); }
.kv { display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr); gap: 12px 16px; font-size: var(--fs-sm); align-items: center; padding: 16px 18px; margin: 0; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pos { font-weight: 600; color: var(--success-ink); }
.ctrl { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 14px 18px; border-bottom: var(--bw) solid var(--border); }
.ctrl:last-child { border-bottom: 0; }
.ctrl-col { flex-direction: column; align-items: stretch; gap: 12px; }
.ctrl-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ctrl-text { display: flex; flex-direction: column; gap: 4px; max-width: 480px; min-width: 0; }
.ctrl-text .sub { font-size: var(--fs-sm); }
.ctrl-title { font-weight: 600; }
.ctrl-alert { padding: 12px 18px; border-bottom: var(--bw) solid var(--border); }
.status-line { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); }
.status-line.info { color: var(--info-ink); }
.status-line.warn { color: var(--warning-ink); }
.stepper-box { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; border-radius: var(--r-md); background: var(--bg); border: var(--bw) solid var(--border); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.step { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.step .dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.step.done { color: var(--text-2); }
.step.done .dot { background: var(--success); border-color: var(--success); color: var(--accent-ink); }
.step.current { color: var(--text); }
.step.current .dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step.fail { color: var(--danger-ink); }
.step.fail .dot { border-color: var(--danger); color: var(--danger); background: rgba(242,113,111,.12); }
.stepper-box .sub { font-size: var(--fs-sm); }

/* activity */
.activity { list-style: none; margin: 0; padding: 0; }
.ev { display: grid; grid-template-columns: 130px 150px minmax(0, 1fr) 110px; gap: 16px; padding: 12px 18px; border-bottom: var(--bw) solid var(--border); align-items: start; font-size: var(--fs-sm); }
.ev:last-child { border-bottom: 0; }
.ev-time { color: var(--text-2); }
.ev-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev-main .sub { font-size: var(--fs-sm); }
.ev-action { font-weight: 500; }
.sk-list .ev { align-items: center; }

/* ---- modal & toasts ---- */
.overlay { position: fixed; inset: 0; background: rgba(5,6,8,.72); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: var(--z-modal); overflow-y: auto; }
.modal { width: 460px; max-width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: var(--bw) solid var(--border-strong); border-radius: var(--r-lg); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.modal-body { padding: 20px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.modal-title { font-size: 17px; font-weight: 600; }
.modal-desc { color: var(--text-body); font-size: var(--fs-md); }
.modal-note { padding: 10px 12px; border-radius: var(--r-md); border: var(--bw) solid var(--border-strong); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 20px; }
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; width: 380px; max-width: calc(100vw - 32px); padding: 10px 10px 10px 14px; border-radius: 10px; background: var(--surface-3); border: var(--bw) solid var(--border-strong); box-shadow: 0 8px 24px rgba(0,0,0,.4); font-size: var(--fs-sm); }
.toast .badge { flex-shrink: 0; }
.toast-text { flex-grow: 1; min-width: 0; }

/* ============================ breakpoints ============================ */
@media (max-width: 1279px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
  .tr.admin { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(190px, 1fr) minmax(0, 1fr) 88px 104px; column-gap: 12px; }
}
@media (max-width: 1023px) {
  :root { --gutter: 20px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: auto; z-index: var(--z-drawer); width: min(300px, 86vw); transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; box-shadow: none; }
  .sidebar.open { transform: none; visibility: visible; transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .topbar { padding: 0 12px 0 8px; gap: 4px; }
}
@media (max-width: 767px) {
  :root { --gutter: 16px; }
  .main { padding-top: 16px; }
  .tiles { gap: 8px; }
  .tile { padding: 10px 12px; }
  .tile-label { font-size: var(--fs-xs); }
  .tile-value { font-size: var(--fs-xl); }
  .search { max-width: none; flex-basis: 100%; }
  .filters > .btn { height: var(--h-touch); }
  .filters-extra { flex-basis: 100%; flex-direction: column; align-items: stretch; }
  .filters-extra select.input { width: 100%; height: var(--h-touch); }
  .chk { height: var(--h-touch); }
  .toolbar-actions { margin-left: 0; flex-basis: 100%; }
  .toolbar-actions .btn { flex: 1; height: var(--h-touch); }
  .m-list { grid-template-columns: minmax(0, 1fr); }
  .user-meta { display: none; }
  .acc-actions { width: 100%; }
  .acc-actions > .btn { flex-grow: 1; height: var(--h-touch); }
  .page-title-lg { font-size: var(--fs-xl); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .ctrl, .ctrl-row { flex-wrap: wrap; }
  .ctrl-row > .btn { height: var(--h-touch); }
  .ev { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .ev-time { grid-column: 1; }
  .ev-result { grid-column: 2; grid-row: 1; }
  .ev-actor, .ev-main { grid-column: 1 / -1; }
  .overlay { align-items: flex-end; padding: 12px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { height: var(--h-touch); width: 100%; }
  .toasts { right: 16px; left: 16px; bottom: 16px; align-items: stretch; }
  .toast { width: auto; max-width: none; }
  .amount-big { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .spinner { animation: none; border-right-color: currentColor; opacity: .6; }
  .skel { animation: none; }
}
