:root {
  --canvas: #f6f5f3; --card: #fff; --rail: #2a2c32; --rail-ink: #a9adb8;
  --blue: #4e6fe0; --blue-600: #3d5bcc; --blue-50: #eef2fd; --blue-100: #dfe6fb;
  --green: #3b9b4a; --green-50: #e9f6eb; --amber: #c98a12; --amber-50: #fdf5e3; --red: #cc3b3b; --red-50: #fcecec;
  --ink: #1b1c20; --ink-2: #41444d; --muted: #6d717c; --line: #e6e3de; --line-2: #efede9;
  --navy: #143a5c;
  --r-sm: 6px; --r: 10px; --r-lg: 18px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 2px 8px rgba(20, 24, 40, .04);
  --shadow-lg: 0 12px 40px rgba(40, 60, 140, .18);
  --font: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --step--1: .8125rem; --step-0: .9375rem; --step-1: 1.125rem; --step-2: 1.5rem; --step-3: clamp(2rem, 4vw, 3.4rem);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 400 var(--step-0)/1.5 var(--font); color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 76px 1fr; min-height: 100vh; }
.rail { background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.rail .mark { width: 40px; height: 40px; border-radius: 10px; background: #fff url(/static/brand/favicon.png) center/80% no-repeat; margin-bottom: 14px; }
.rail a { width: 64px; padding: 8px 2px; border-radius: 10px; color: var(--rail-ink); display: grid; justify-items: center; gap: 3px; font-size: 10.5px; text-align: center; line-height: 1.15; position: relative; }
.rail a:hover { color: #fff; background: rgba(255, 255, 255, .06); text-decoration: none; }
.rail a.on { color: #fff; background: var(--blue); }
.rail a.on::before { content: ""; position: absolute; left: -6px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: #8fa6ff; }
.rail .badge { position: absolute; top: 4px; right: 10px; background: var(--red); color: #fff; font-size: 10px; border-radius: 9px; padding: 0 5px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--blue); color: #fff; display: flex; align-items: center; gap: 14px; padding: 10px 22px; position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 10px rgba(40, 60, 160, .25); }
.topbar form { flex: 1; max-width: 520px; }
.topbar input { width: 100%; border: 0; border-radius: 6px; padding: 8px 12px 8px 36px; font: inherit; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236d717c' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") 11px center no-repeat; }
.topbar .spacer { flex: 1; }
.chip-light { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); padding: 5px 12px; border-radius: 6px; font-size: var(--step--1); font-weight: 600; }
.who { display: flex; align-items: center; gap: 9px; font-size: var(--step--1); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: linear-gradient(135deg, #ffd27a, #ff9f6e); color: #5a2b00; flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.blue { background: linear-gradient(135deg, #c8d4ff, #8ea6ff); color: #1d2f80; }
.linkbtn { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 6px; border-radius: 6px; display: inline-flex; }
.linkbtn:hover { background: rgba(255, 255, 255, .15); }
.crumbs { background: #fff; border-bottom: 1px solid var(--line); padding: 7px 24px; font-size: 12px; color: var(--muted); }
.crumbs a { color: var(--blue-600); }
.content { padding: 22px 24px 48px; }
.page { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.page-head h1 { font-size: var(--step-1); font-weight: 600; margin-right: auto; }
.page-head h1 small { color: var(--muted); font-weight: 500; }
.page-body { padding: 18px 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); padding: 7px 14px; border-radius: var(--r-sm); font: 500 var(--step--1) var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: #c9c6c0; background: #fafafa; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-600); }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.success:hover { filter: brightness(.95); }
.btn.outline-green { border-color: var(--green); color: var(--green); }
.btn.danger { color: var(--red); border-color: #efc4c4; }
.btn.danger:hover { background: var(--red-50); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.lg { padding: 13px 34px; font-size: 1.05rem; border-radius: 999px; box-shadow: var(--shadow-lg); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 16px 20px 6px; }
.stat { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; color: inherit; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
a.stat:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(30, 40, 90, .1); text-decoration: none; }
.stat.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-100); }
.stat .ic { width: 38px; height: 38px; border-radius: 8px; background: #f1f0ee; color: var(--ink-2); display: grid; place-items: center; flex: none; }
.stat .lbl { font-size: 12px; font-weight: 600; color: var(--ink-2); line-height: 1.2; }
.stat .val { font-size: 1.6rem; font-weight: 500; color: var(--blue); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat.warn .val { color: var(--amber); }
.stat.bad .val { color: var(--red); }

/* ---------- Lists like onboarding ---------- */
.rows { list-style: none; margin: 0; padding: 4px 20px; }
.rows > li { display: grid; grid-template-columns: 54px 52px 1fr auto; gap: 16px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line-2); }
.rows > li:hover { background: #fbfbfa; }
.cal { width: 50px; border-radius: 6px; overflow: hidden; text-align: center; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.cal b { display: block; background: var(--blue); color: #fff; font-size: 9px; font-weight: 600; padding: 2px 0; text-transform: uppercase; letter-spacing: .03em; }
.cal span { display: block; font-size: 18px; font-weight: 700; line-height: 1.25; }
.cal i { display: block; font-style: normal; font-size: 9px; color: var(--blue); padding-bottom: 2px; }
.rows .who-name { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .01em; color: var(--ink); }
.rows .meta { font-size: 12px; color: var(--muted); }
.rows .right { display: flex; align-items: center; gap: 12px; }
.ring { --p: 0; width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(var(--blue) calc(var(--p) * 1%), #e1e4ee 0); display: inline-grid; place-items: center; vertical-align: middle; }
.ring::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.prog { font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; min-width: 120px; }
.status-btn { min-width: 150px; text-align: center; justify-content: center; font-size: 12px; padding: 8px 10px; border-radius: 4px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbfaf9; white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:hover td { background: #fcfcfb; }
.t .num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t tfoot td { font-weight: 700; background: #fbfaf9; border-top: 2px solid var(--line); }
.t input { width: 92px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; font: inherit; text-align: right; }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 30px; height: 30px; font-size: 11px; }

/* ---------- Chips ---------- */
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #f0efec; color: var(--ink-2); white-space: nowrap; }
.chip.blue, .chip.probation, .chip.pending, .chip.pending_admin, .chip.draft, .chip.initiated, .chip.scheduled, .chip.hold { background: var(--blue-50); color: var(--blue-600); }
.chip.green, .chip.confirmed, .chip.approved, .chip.joined, .chip.locked, .chip.completed, .chip.offer_accepted, .chip.selected, .chip.active { background: var(--green-50); color: var(--green); }
.chip.amber, .chip.notice, .chip.clearance, .chip.fnf, .chip.offer_sent { background: var(--amber-50); color: var(--amber); }
.chip.red, .chip.rejected, .chip.exited, .chip.cancelled, .chip.no_show, .chip.left { background: var(--red-50); color: var(--red); }

/* ---------- Forms ---------- */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 18px; }
.form .full { grid-column: 1 / -1; }
label.f { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
label.f .hint { font-weight: 400; color: var(--muted); }
.f input, .f select, .f textarea, select.in, input.in { font: 400 var(--step-0) var(--font); color: var(--ink); padding: 8px 10px; border: 1px solid #d9d6d0; border-radius: var(--r-sm); background: #fff; width: 100%; transition: border-color .15s, box-shadow .15s; }
.f textarea { min-height: 84px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus, .in:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.f input.prefilled { background: #f6f9ff; border-color: #c9d6fb; }
.check { display: flex; gap: 8px; align-items: center; font-size: var(--step--1); }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 0 0 16px; }
legend { font-weight: 600; padding: 0 6px; font-size: var(--step--1); color: var(--ink-2); }

/* ---------- Stepper ---------- */
.stepper { display: flex; gap: 0; padding: 16px 20px; border-bottom: 1px solid var(--line-2); overflow-x: auto; }
.stepper > a, .stepper > span { flex: 1; min-width: 140px; display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: var(--step--1); font-weight: 600; position: relative; padding-right: 12px; }
.stepper .n { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #d5d8e2; display: grid; place-items: center; background: #fff; font-size: 12px; flex: none; }
.stepper .done .n { background: var(--green); border-color: var(--green); color: #fff; }
.stepper .cur .n { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 4px var(--blue-100); }
.stepper .cur { color: var(--ink); }
.stepper .locked { opacity: .55; }
.stepper > *:not(:last-child)::after { content: ""; height: 2px; flex: 1; min-width: 16px; background: var(--line); margin-left: 6px; border-radius: 2px; }
.stepper > .done:not(:last-child)::after { background: var(--green); }

/* ---------- Notices ---------- */
.flash { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--r-sm); font-size: var(--step--1); display: flex; gap: 8px; align-items: center; }
.flash.ok { background: var(--green-50); color: #1f6b2b; border: 1px solid #cbe8cf; }
.flash.err { background: var(--red-50); color: #8f2323; border: 1px solid #f2caca; }
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alert-list li { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--amber-50); color: #6d4a06; font-size: var(--step--1); }
.callout { background: var(--blue-50); border: 1px solid var(--blue-100); color: #23397f; border-radius: var(--r); padding: 12px 14px; font-size: var(--step--1); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* ---------- Cards ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card h3 { font-size: var(--step--1); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: var(--step--1); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.bal { display: grid; gap: 4px; }
.bal .big { font-size: 2rem; font-weight: 600; color: var(--blue); line-height: 1; font-variant-numeric: tabular-nums; }
.bal .bar { height: 6px; border-radius: 3px; background: #edf0f7; overflow: hidden; }
.bal .bar i { display: block; height: 100%; background: var(--blue); transition: width .6s cubic-bezier(.2, .7, .2, 1); }
.tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line-2); overflow-x: auto; }
.tabs a { padding: 12px 14px; color: var(--muted); font-weight: 600; font-size: var(--step--1); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--blue-600); border-color: var(--blue); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.bars { display: grid; gap: 8px; }
.bars div { display: grid; grid-template-columns: 120px 1fr 32px; gap: 10px; align-items: center; font-size: 12px; }
.bars span.b { height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--blue), #8ea6ff); }

/* ---------- Pager ---------- */
.pager { display: flex; padding: 16px 20px; }
.pager a, .pager span { border: 1px solid var(--line); margin-left: -1px; padding: 6px 12px; font-size: 12px; color: var(--ink-2); background: #f6f6f5; }
.pager a:first-child { border-radius: 4px 0 0 4px; }
.pager > :last-child { border-radius: 0 4px 4px 0; }
.pager .cur { background: var(--blue); color: #fff; border-color: var(--blue); }
.pager .off { color: #b6b6b6; }

/* ---------- Login (Panakeia brand panel + form card) ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr); background: #fff; }
.auth-brand { position: relative; overflow: hidden; background: var(--navy); color: #dfe8f1; padding: 44px clamp(28px, 4vw, 64px); display: flex; flex-direction: column; gap: 28px; }
.auth-brand::after { content: ""; position: absolute; inset: auto -120px -160px auto; width: 520px; height: 520px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 0 0 60px rgba(255, 255, 255, .025), 0 0 0 140px rgba(255, 255, 255, .02); pointer-events: none; }
.auth-brand .tile { background: #f7f7f7; border-radius: 12px; padding: 10px 14px; width: max-content; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.auth-brand .tile img { display: block; height: 54px; width: auto; }
.auth-brand h2 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); font-weight: 600; line-height: 1.25; color: #fff; margin-top: auto; max-width: 420px; letter-spacing: -.01em; }
.auth-brand ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; font-size: var(--step--1); max-width: 400px; }
.auth-brand li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.auth-brand li svg { color: #8cc56a; margin-top: 1px; }
.auth-brand .foot { font-size: 11.5px; color: #9fb3c8; margin-top: auto; }
.auth-brand .foot strong { color: #fff; font-weight: 600; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: linear-gradient(180deg, #fbfbfa, #f3f2ef); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px 30px; box-shadow: 0 18px 50px rgba(20, 58, 92, .10); animation: rise .5s cubic-bezier(.2, .7, .2, 1) backwards; }
.auth-card .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #4a8a2a; }
.auth-card h1 { font-size: 1.45rem; font-weight: 700; margin: 6px 0 6px; color: var(--navy); }
.auth-card p.lead { color: var(--muted); font-size: var(--step--1); margin: 0 0 22px; line-height: 1.6; }
.auth-card label.f { margin-bottom: 14px; }
.auth-card .btn.block { width: 100%; justify-content: center; padding: 11px 14px; font-size: var(--step-0); background: var(--navy); border-color: var(--navy); color: #fff; }
.auth-card .btn.block:hover { background: #0f2f4b; }
.otp { display: flex; gap: 8px; margin: 4px 0 18px; justify-content: space-between; }
.otp input { width: 48px; height: 54px; text-align: center; font: 600 1.35rem var(--font); border: 1.5px solid #d6d3cd; border-radius: 10px; background: #fff; animation: pop .35s cubic-bezier(.2, .9, .3, 1.3) backwards; }
.otp input:nth-child(2) { animation-delay: .04s; } .otp input:nth-child(3) { animation-delay: .08s; } .otp input:nth-child(4) { animation-delay: .12s; } .otp input:nth-child(5) { animation-delay: .16s; } .otp input:nth-child(6) { animation-delay: .2s; }
.otp input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(20, 58, 92, .12); }
.otp.shake { animation: shake .4s; }
.msg { font-size: var(--step--1); color: var(--muted); margin: 12px 0 0; }
.msg.err { color: var(--red); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-main { padding: 24px 16px; align-items: start; }
  .auth-card { padding: 24px 20px; }
  .auth-brand { padding: 22px 18px; gap: 14px; }
  .auth-brand h2, .auth-brand ul { display: none; }
  .auth-brand .foot { display: none; }
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 6px; }
  .rail .mark { display: none; }
  .rows > li { grid-template-columns: 50px 1fr; }
  .rows .avatar-cell { display: none; }
  .rows .right { grid-column: 1 / -1; flex-wrap: wrap; }
  .topbar .who span, .topbar .chip-light { display: none; }
  .content { padding: 14px 12px 40px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .rail, .topbar, .crumbs, .btn, .pager { display: none !important; } .shell { display: block; } .content { padding: 0; } }
.credit { margin-top: 28px; text-align: center; font-size: 12px; color: var(--muted); }
.credit strong { color: var(--navy); font-weight: 600; }
.auth-credit { display: none; }
@media (max-width: 860px) { .auth-credit { display: block; } .auth-main { display: flex; flex-direction: column; align-items: stretch; } }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: var(--blue-50); }
tr[data-href]:focus-visible td { background: var(--blue-50); }
tr.cur-row td { background: var(--blue-50); font-weight: 600; }
.t td a.cell { color: inherit; display: block; }
.t td a.cell:hover { color: var(--blue-600); text-decoration: none; }
.rail .mark.mark-text { background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.auth-brand .tile-name { font-size: 1.3rem; font-weight: 700; color: var(--navy); padding: 14px 18px; }

/* ================= Theme v2 (2026-10-28): calmer clinical palette, softer depth ================= */
:root {
  --canvas: #f3f5f8; --rail: #0f1f33; --rail-ink: #93a4ba;
  --blue: #2f5bd3; --blue-600: #2549b3; --blue-50: #edf2fd; --blue-100: #d9e3fb;
  --green: #17845a; --green-50: #e6f5ee; --amber: #b7791f; --amber-50: #fdf4e3; --red: #c23a3a; --red-50: #fcecec;
  --ink: #142133; --ink-2: #3a4a5f; --muted: #66758a; --line: #e2e7ee; --line-2: #edf1f5;
  --navy: #143a5c;
  --r-sm: 9px; --r: 14px; --r-lg: 20px;
  --shadow: 0 1px 2px rgba(16, 32, 56, .05), 0 4px 14px rgba(16, 32, 56, .05);
  --shadow-lg: 0 18px 48px rgba(16, 32, 56, .16);
}
body { background: radial-gradient(1200px 400px at 70% -120px, #e3eafa 0%, transparent 70%), var(--canvas); }

/* Rail: deep navy, soft active pill */
.rail { background: linear-gradient(180deg, #13263f, #0d1a2c); gap: 6px; }
.rail a { border-radius: 12px; }
.rail a.on { background: rgba(255, 255, 255, .10); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.rail a.on::before { background: #6fa0ff; }
.rail a.on svg { color: #8fb4ff; }
.rail .mark { border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.rail .mark.mark-text { background: linear-gradient(135deg, #3d6ae0, #2647a8); }

/* Topbar: light, glassy, hairline instead of flat blue slab */
.topbar { background: rgba(255, 255, 255, .82); color: var(--ink); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  box-shadow: 0 1px 0 var(--line); padding: 10px 26px; }
.topbar input { background-color: #f1f4f8; border: 1px solid transparent; border-radius: 999px; padding: 9px 14px 9px 38px; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.topbar input:focus { outline: none; background-color: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-100); }
.chip-light { background: var(--blue-50); border: 1px solid var(--blue-100); color: var(--blue-600); border-radius: 999px; padding: 5px 14px; }
.linkbtn { color: var(--ink-2); border-radius: 10px; }
.linkbtn:hover { background: #eef2f7; }
.who small { color: var(--muted); opacity: 1 !important; }
.avatar { background: linear-gradient(135deg, #ffe1a8, #ffb48a); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.crumbs { background: transparent; border: 0; padding: 14px 28px 0; }
.content { padding: 14px 28px 48px; }

/* Surfaces */
.page { border-radius: var(--r-lg); border-color: var(--line); box-shadow: var(--shadow); overflow: hidden; }
.page-head { padding: 18px 22px; }
.page-head h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.015em; }
.card { border-radius: var(--r); }
.stat { border-radius: var(--r); padding: 14px 16px; }
.stat .ic { border-radius: 11px; background: var(--blue-50); color: var(--blue-600); }
.stat .val { font-weight: 700; color: var(--ink); }
a.stat:hover { box-shadow: 0 10px 26px rgba(16, 32, 56, .10); }
.t th { background: #f7f9fb; color: #708097; }
.t tr:hover td { background: #f8fafd; }
.chip { padding: 3px 10px; }
.callout { border-radius: var(--r); }
fieldset { border-radius: var(--r); }

/* Controls */
.btn { border-radius: 10px; padding: 8px 15px; font-weight: 600; border-color: #d8dfe8; }
.btn.primary { background: linear-gradient(180deg, #3a66de, #2c55c9); border-color: #2a51c0; box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 4px 12px rgba(47, 91, 211, .28); }
.btn.primary:hover { background: linear-gradient(180deg, #3460d6, #2549b3); }
.btn.success { background: linear-gradient(180deg, #1c9466, #157c55); border-color: #157c55; box-shadow: 0 4px 12px rgba(23, 132, 90, .25); }
.btn.sm { border-radius: 8px; }
.f input, .f select, .f textarea, select.in, input.in { border-radius: 10px; border-color: #d6dde7; padding: 9px 12px; }
.f input.prefilled { background: #f3f7ff; border-color: #c4d3f7; }

/* Stepper: real circles, connecting progress line */
.stepper { padding: 20px 22px; }
.stepper .n { width: 32px; height: 32px; font-weight: 700; }
.stepper .done .n { box-shadow: 0 4px 10px rgba(23, 132, 90, .25); }

/* Alerts: pinned toast at the top of the screen, always visible after an action */
.toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; width: min(560px, calc(100vw - 32px)); pointer-events: none; }
.toasts .flash { pointer-events: auto; margin: 0; padding: 12px 14px 12px 16px; border-radius: 12px; font-size: var(--step-0); font-weight: 500;
  box-shadow: 0 14px 40px rgba(16, 32, 56, .22); border: 0; animation: toast-in .35s cubic-bezier(.2, .8, .2, 1) both; }
.toasts .flash.ok { background: #0f5e41; color: #fff; }
.toasts .flash.err { background: #a32727; color: #fff; }
.toasts .flash svg { flex: none; }
.toasts .flash .x { margin-left: auto; background: none; border: 0; color: inherit; opacity: .75; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
.toasts .flash.out { animation: toast-out .3s ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-14px); } }
/* Staff import */
.imp-steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0; padding: 18px 22px 0; }
.imp-steps li { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: #fafbfd; }
.imp-steps b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #e8edf4; color: var(--ink-2); flex: none; font-size: 13px; }
.imp-steps strong { display: block; font-size: var(--step-0); }
.imp-steps span { font-size: 12px; color: var(--muted); }
.imp-steps li.cur { border-color: var(--blue); background: var(--blue-50); }
.imp-steps li.cur b { background: var(--blue); color: #fff; }
.imp-steps li.done b { background: var(--green); color: #fff; }
.imp-drop { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px; border: 1.5px dashed #b9c6da; border-radius: var(--r); background: #f8faff; }
.imp-drop > svg { color: var(--blue); }
.imp-drop > div { display: grid; margin-right: auto; }
.imp-table .row-bad td { background: #fff6f6; }
.imp-table .row-warn td { background: #fffbf1; }
.imp-check .e { color: var(--red); font-size: 12px; display: flex; gap: 4px; align-items: center; }
.imp-check .w { color: var(--amber); font-size: 12px; }
.imp-confirm { display: grid; gap: 12px; max-width: 620px; padding: 18px; border-radius: var(--r); background: #f5faf7; border: 1px solid #cfe7da; }
dialog.confirm { border: 0; border-radius: 16px; padding: 22px 22px 18px; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); font: 500 var(--step-0)/1.5 var(--font); color: var(--ink); animation: rise .25s cubic-bezier(.2, .8, .2, 1); }
dialog.confirm::backdrop { background: rgba(15, 31, 51, .45); backdrop-filter: blur(2px); }
dialog.confirm p { margin: 0 0 18px; font-size: 1.02rem; }
dialog.confirm .btn-row { justify-content: flex-end; }
.otp.otp8 { gap: 6px; } .otp.otp8 input { width: 40px; }
