/* ============================================================
   ArchPay Admin app shell — Keystone design system
   Navy #16314A / Teal #15897B, Space Grotesk display, arch motif.
   Ported from Options/keystone/keystone.css onto the app's
   existing markup (collapsible sidebar, body.dark theme).
   ============================================================ */

:root {
  --navy:#16314A; --navy-deep:#0E2236; --teal:#15897B; --teal-d:#0F6F63;
  --paper:#F4F7F7; --panel:#FFFFFF; --ink:#1C2B33; --ink-soft:#41525C; --muted:#64757E;
  --line:#DCE5E7; --line-strong:#CBD8DA;
  --okc:#1A7F4B; --ok-bg:#E9F7EF; --provc:#9A6112; --prov-bg:#FFF7E8;
  --warnc:#B42318; --warn-bg:#FDECEA; --infoc:#1E5FAE; --info-bg:#EAF2FC;
  --teal-wash:rgba(21,137,123,.13);
  --heading:#16314A; --link:#0F6F63;
  --brand:#16314A; --accent:#15897B; --accent-soft:#E7F4F1;
  --th-bg:#FAFCFC; --row-hover:#F7FAFA; --row-line:#EBF1F2;
  --chip-bg:#F1F5F5; --chip-ink:#41525C;
  --post:#16314A; --post-bg:#E8EEF5; --get:#0F6F63; --get-bg:#E7F4F1;
  --code-bg:#F1F5F5; --pre-bg:#0E2236; --pre-ink:#E7EEF6;
  --chart-calls:#15897B; --chart-rejected:#C4574A; --chart-grid:#E4ECED;
  --radius:10px; --radius-sm:8px;
  --display:'Space Grotesk',ui-sans-serif,'Segoe UI',sans-serif;
  --sans:'Inter',-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --sidebar-w:248px; --sidebar-w-c:66px;
  --shadow:0 1px 2px rgba(22,49,74,.05), 0 6px 20px rgba(22,49,74,.05);
  --shadow-lg:0 12px 40px rgba(14,34,54,.18);
  --arch-underline:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 18"><path d="M8 15 C8 5, 15 1.5, 19 1.5 C23 1.5, 30 5, 30 15" fill="none" stroke="%2316314A" stroke-width="2.4"/><path d="M2 16 H74" stroke="%2315897B" stroke-width="2.4" stroke-linecap="round"/></svg>');
}
body.dark {
  --paper:#0D141A; --panel:#15202A; --ink:#E5EDF0; --ink-soft:#C3D0D6; --muted:#8597A0;
  --line:#233039; --line-strong:#31424C; --heading:#DCE9F0; --link:#3FC2AF;
  --teal-d:#3FC2AF;
  --brand:#DCE9F0; --accent:#3FC2AF; --accent-soft:#16302C;
  --ok-bg:#16301F; --okc:#6CD397; --prov-bg:#332708; --provc:#E7B463;
  --warn-bg:#3A1F1F; --warnc:#F0A0A0; --info-bg:#102740; --infoc:#7DB4EE;
  --th-bg:#121B23; --row-hover:#1A2732; --row-line:#1E2B35;
  --chip-bg:#16242E; --chip-ink:#C3D0D6;
  --post:#A8C4E4; --post-bg:#12283E; --get:#6FD1C0; --get-bg:#123029;
  --code-bg:#16242E; --pre-bg:#0A1118; --pre-ink:#DCE9F0;
  --chart-calls:#3FC2AF; --chart-rejected:#F08A80; --chart-grid:#1E2B35;
  --shadow:0 1px 2px rgba(0,0,0,.35), 0 6px 20px rgba(0,0,0,.25);
  --shadow-lg:0 16px 50px rgba(0,0,0,.55);
  --arch-underline:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 18"><path d="M8 15 C8 5, 15 1.5, 19 1.5 C23 1.5, 30 5, 30 15" fill="none" stroke="%23DCE9F0" stroke-width="2.4"/><path d="M2 16 H74" stroke="%2315897B" stroke-width="2.4" stroke-linecap="round"/></svg>');
}

* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  margin:0; font-family:var(--sans); font-size:14.5px; line-height:1.6;
  color:var(--ink); background:var(--paper);
  -webkit-font-smoothing:antialiased;
}
a { color:var(--link); text-decoration:none; }
a:hover { text-decoration:underline; }
:focus-visible { outline:2px solid var(--teal); outline-offset:2px; border-radius:4px; }
.muted { color:var(--muted); }
.mono { font-family:var(--mono); font-size:.88em; }
h1,h2,h3 { color:var(--heading); }

code {
  font-family:var(--mono); font-size:.85em; background:var(--code-bg);
  border:1px solid var(--line); border-radius:5px; padding:1px 5px; color:var(--ink);
}
pre {
  background:var(--pre-bg); color:var(--pre-ink); border-radius:var(--radius-sm);
  padding:16px 18px; overflow-x:auto; font-size:13px; line-height:1.6; margin:14px 0;
}
pre code { background:none; border:none; color:inherit; padding:0; }

/* ---------------- App layout ---------------- */
.app-body { display:flex; min-height:100vh; }
.app-main { flex:1; min-width:0; margin-left:var(--sidebar-w); transition:margin-left .18s; }
.app-content { max-width:1200px; margin:0 auto; padding:34px 42px 90px; }
.sidebar.collapsed ~ .app-main { margin-left:var(--sidebar-w-c); }

.page-header {
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:16px; margin-bottom:26px; flex-wrap:wrap;
}
.page-header h1 {
  font-family:var(--display); font-weight:700; font-size:30px; letter-spacing:-.015em;
  color:var(--heading); margin:0 0 2px;
}
.page-header h1::after {
  content:""; display:block; width:76px; height:18px; margin:6px 0 2px;
  background:var(--arch-underline) no-repeat; background-size:76px 18px;
}
.page-header .sub { color:var(--muted); font-size:13.5px; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  position:fixed; top:0; left:0; bottom:0; width:var(--sidebar-w); z-index:100;
  display:flex; flex-direction:column;
  background:linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 100%);
  color:#C3D3DD; transition:width .18s; overflow:hidden;
}
body.dark .sidebar { background:linear-gradient(180deg, #0A1118 0%, #10202F 100%); }
.sidebar::after {
  content:""; position:absolute; bottom:-70px; right:-70px; width:300px; height:300px;
  background-repeat:no-repeat; background-size:contain; pointer-events:none; opacity:.05;
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 72"><path d="M16 58 C16 25, 28 11, 36 11 C44 11, 56 25, 56 58 L48.5 58 C48.5 30, 43 21, 36 21 C29 21, 23.5 30, 23.5 58 Z" fill="white"/><path d="M19 59 H53" stroke="white" stroke-width="4" stroke-linecap="round"/></svg>');
}
.sidebar.collapsed { width:var(--sidebar-w-c); }
.sidebar__logo { display:flex; align-items:center; gap:10px; padding:20px 18px 16px; min-height:64px; color:#fff; }
.sidebar__logo:hover { text-decoration:none; }
.sidebar__logo svg { flex:none; }
.sidebar__logo-text { white-space:nowrap; }
.brand-name { font-family:var(--display); font-weight:700; font-size:17px; letter-spacing:.01em; line-height:1.15; color:#fff; display:block; }
.brand-name .pay { color:#3FC2AF; }
.brand-sub {
  font-size:9.5px; font-weight:600; letter-spacing:.28em; color:#7E96A6;
  text-transform:uppercase; margin-top:1px; display:block;
}
.sidebar.collapsed .sidebar__logo-text { display:none; }

.sidebar-nav { list-style:none; margin:0; padding:4px 12px 12px; flex:1; overflow-y:auto; position:relative; z-index:1; }
.sidebar-nav__section {
  font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.16em;
  color:#6C8494; padding:18px 12px 6px; white-space:nowrap;
}
.sidebar.collapsed .sidebar-nav__section { font-size:0; padding:8px 0 6px; }
.sidebar.collapsed .sidebar-nav__section::after {
  content:""; display:block; height:1px; background:rgba(255,255,255,.1); margin:0 16px;
}
.sidebar-nav__link {
  position:relative; display:flex; align-items:center; gap:11px;
  padding:8px 12px; margin:1px 0; border-radius:8px;
  color:#C3D3DD; font-size:13.5px; font-weight:500; white-space:nowrap;
}
.sidebar-nav__link:hover { background:rgba(255,255,255,.06); color:#fff; text-decoration:none; }
.sidebar-nav__link.active { background:var(--teal-wash); color:#fff; }
.sidebar-nav__link.active::before {
  content:""; position:absolute; left:-6px; top:50%;
  width:22px; height:10px; transform:translateY(-50%) rotate(-90deg);
  background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 56 14" preserveAspectRatio="none"><path d="M6 12 C6 4.5, 11 1.5, 14 1.5 C17 1.5, 22 4.5, 22 12" fill="none" stroke="%233FC2AF" stroke-width="2"/><path d="M1.5 12.5 H54.5" stroke="%2315897B" stroke-width="2" stroke-linecap="round"/></svg>') no-repeat;
  background-size:100% 100%;
}
.sidebar-nav__link svg, .sidebar-nav__link i { width:16px; height:16px; flex:none; opacity:.85; }
.sidebar-nav__link.active svg { opacity:1; stroke:#3FC2AF; }
.sidebar.collapsed .sidebar-nav__link span { display:none; }
.sidebar.collapsed .sidebar-nav__link { justify-content:center; padding:8px 0; }
.sidebar.collapsed .sidebar-nav__link.active::before { display:none; }

.sidebar__footer { position:relative; z-index:1; border-top:1px solid rgba(255,255,255,.09); padding:14px 16px; }
.sidebar__user { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.sidebar__avatar {
  width:34px; height:34px; flex:none; border-radius:50%;
  background:var(--teal); color:#fff; font-weight:600; font-size:14px;
  display:flex; align-items:center; justify-content:center; font-family:var(--display);
}
.sidebar__user-name { font-size:13px; color:#fff; font-weight:600; line-height:1.3; white-space:nowrap; }
.sidebar__user-role { font-size:11.5px; color:#8BA2B0; white-space:nowrap; }
.sidebar.collapsed .sidebar__user-info, .sidebar.collapsed .sidebar__footer-bottom .sidebar__version,
.sidebar.collapsed .sidebar__logout span { display:none; }
.sidebar.collapsed .sidebar__user, .sidebar.collapsed .sidebar__footer-bottom { justify-content:center; }
.sidebar__footer-bottom { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:11.5px; color:#6C8494; }
.sidebar__version { font-size:11px; color:#6C8494; }
.sidebar__logout { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:#A9BEC9; }
.sidebar__logout:hover { color:#fff; text-decoration:none; }
.sidebar__logout i, .sidebar__logout svg { width:14px; height:14px; }

.sidebar__toggle { position:absolute; top:20px; right:12px; width:26px; height:26px; z-index:2;
  border:none; border-radius:7px; background:rgba(255,255,255,.08); color:#C3D3DD; cursor:pointer;
  display:flex; align-items:center; justify-content:center; }
.sidebar__toggle:hover { background:rgba(255,255,255,.16); color:#fff; }
.sidebar__toggle i, .sidebar__toggle svg { width:16px; height:16px; }
.sidebar.collapsed .sidebar__toggle { right:0; left:0; margin:auto; }

/* ---------------- Buttons / chips / badges ---------------- */
.btn {
  display:inline-flex; align-items:center; gap:8px; font:inherit; font-weight:600;
  font-size:13.5px; padding:8px 15px; border-radius:8px; cursor:pointer;
  border:1px solid transparent; text-decoration:none;
}
.btn:hover { text-decoration:none; }
.btn-primary { background:var(--teal); color:#fff; }
.btn-primary:hover { background:#0F6F63; color:#fff; }
body.dark .btn-primary { background:#15897B; }
body.dark .btn-primary:hover { background:#0F6F63; }
.btn-ghost { background:var(--panel); border-color:var(--line); color:var(--ink); }
.btn-ghost:hover { border-color:var(--teal); color:var(--teal-d); }
.btn-sm { padding:6px 11px; font-size:12.5px; border-radius:7px; }
.btn svg, .btn i { width:15px; height:15px; }

.chip {
  display:inline-block; font-family:var(--mono); font-size:11.5px; color:var(--chip-ink);
  background:var(--chip-bg); border:1px solid var(--line); border-radius:6px; padding:2px 8px;
}

.status-badge {
  display:inline-block; font-size:10.5px; font-weight:600; letter-spacing:.05em;
  text-transform:uppercase; padding:2.5px 10px; border-radius:999px;
}
.st-ok   { color:var(--okc); background:var(--ok-bg); }
.st-info { color:var(--infoc); background:var(--info-bg); }
.st-warn { color:var(--provc); background:var(--prov-bg); }
.st-err  { color:var(--warnc); background:var(--warn-bg); }

.method {
  font-family:var(--mono); font-weight:500; font-size:10.5px; letter-spacing:.04em;
  padding:2.5px 8px; border-radius:5px; text-transform:uppercase;
}
.m-get { color:var(--get); background:var(--get-bg); }
.m-post { color:var(--post); background:var(--post-bg); }
.m-put { color:var(--provc); background:var(--prov-bg); }
.m-delete { color:var(--warnc); background:var(--warn-bg); }

.env-badge {
  display:inline-flex; align-items:center; gap:7px; font-size:11.5px; font-weight:600;
  letter-spacing:.06em; text-transform:uppercase; color:var(--teal-d);
  border:1px solid rgba(21,137,123,.35); background:rgba(21,137,123,.07);
  padding:5px 12px; border-radius:999px;
}
.env-badge .dot { width:7px; height:7px; border-radius:50%; background:var(--teal); }

/* ---------------- Telemetry strip (dashboard traffic chart) ---------------- */
.telemetry {
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:18px 24px 14px; margin-bottom:22px;
}
.tele-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:10px; }
.tele-title { font-family:var(--display); font-weight:700; font-size:16.5px; color:var(--heading); margin:0; }
.tele-legend { display:flex; gap:14px; margin-top:3px; font-size:12px; color:var(--muted); }
.tele-legend .dot { display:inline-block; width:8px; height:8px; border-radius:2px; margin-right:6px; }
.dot-calls { background:var(--chart-calls); }
.dot-rejected { background:var(--chart-rejected); }
.tele-readouts { display:flex; gap:26px; }
.readout { text-align:right; }
.readout .r-label { font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); }
.readout .r-value { font-family:var(--display); font-weight:700; font-size:20px; color:var(--heading); line-height:1.25; }
.readout .r-value small { font-size:12px; font-weight:500; color:var(--muted); }
.tele-chart { width:100%; height:96px; display:block; }
.tele-ticks {
  display:flex; justify-content:space-between; margin-top:6px;
  font-family:var(--mono); font-size:10.5px; color:var(--muted);
}

/* ---------------- Cards / stat tiles ---------------- */
.card {
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  padding:22px 24px; box-shadow:var(--shadow);
}
.card h2, .card h3 {
  font-family:var(--display); font-weight:700; font-size:16.5px; color:var(--heading);
  letter-spacing:-.005em; margin-top:0;
}
.stat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:16px; margin:4px 0 26px; }
.stat-card {
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  padding:16px 20px 18px; box-shadow:var(--shadow);
}
.stat-card .arch-tick { display:block; margin-bottom:12px; }
.arch-tick .t-arch { stroke:rgba(22,49,74,.28); }
body.dark .arch-tick .t-arch { stroke:rgba(220,233,240,.3); }
.arch-tick .t-base { stroke:var(--teal); }
.stat-card__label { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); }
.stat-card__value {
  font-family:var(--display); font-weight:700; font-size:34px; letter-spacing:-.02em;
  color:var(--heading); margin-top:4px; line-height:1.1;
}
.stat-card__value.small { font-size:19px; padding-top:9px; }
.stat-card__hint { font-size:12.5px; color:var(--muted); margin-top:5px; }

/* operations quick actions */
.op-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:12px; }

/* ---------------- Forms ---------------- */
label.field { display:block; margin:14px 0 4px; font-size:12.5px; font-weight:600; color:var(--ink); }
input[type=text], input[type=email], input[type=search], input[type=password],
input[type=date], input[type=number], select, textarea {
  width:100%; font:inherit; font-size:13.5px; color:var(--ink); background:var(--panel);
  border:1px solid var(--line); border-radius:9px; padding:8px 12px;
}
input::placeholder, textarea::placeholder { color:var(--muted); }
input:focus, select:focus, textarea:focus {
  outline:none; border-color:var(--teal); box-shadow:0 0 0 3px var(--teal-wash);
}
.form-narrow { max-width:520px; }
.form-actions { display:flex; gap:10px; margin-top:20px; }
.form-inline { display:flex; gap:10px; align-items:center; margin:10px 0 4px; }
.form-inline select { flex:1; width:auto; min-width:0; }
.inline-form { display:inline; }

/* Filter bar (API logs, list views): labeled fields on one wrapping row */
.filter-bar { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; margin-bottom:16px; }
.filter-bar .filter-field { display:flex; flex-direction:column; }
.filter-bar .filter-field label.field { margin:0 0 5px; font-size:11px; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); }
.filter-bar .filter-field input, .filter-bar .filter-field select { width:auto; }
.filter-bar input[type=date] { min-width:150px; }
.filter-actions { display:flex; gap:8px; align-items:center; margin-left:auto; }

/* Two-column detail layout: edit forms left, history/related right */
.detail-cols { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:20px; align-items:start; }
.detail-cols > .col { min-width:0; display:flex; flex-direction:column; gap:20px; }
.detail-cols .form-narrow { max-width:none; }
@media (max-width:900px) { .detail-cols { grid-template-columns:1fr; } }

/* Version history timeline (SCD2 profile history) */
.history-item { border-left:3px solid var(--line); padding:2px 0 14px 14px; position:relative; }
.history-item:last-child { padding-bottom:0; }
.history-item.is-current { border-left-color:var(--teal); }
.history-item .h-when { font-weight:600; font-size:13px; color:var(--ink); }
.history-item .h-meta { color:var(--muted); font-size:12px; margin:2px 0 6px; }
.history-item .h-fields { font-size:13px; line-height:1.6; color:var(--ink); }
.history-item .h-fields .k { color:var(--muted); display:inline-block; min-width:96px; }

/* ---------------- Tables ---------------- */
/* Full-bleed list card: header row + optional filter bar + table + pager */
.card.table-card { padding:0; overflow:hidden; }
.table-card .table-head {
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 24px 14px; gap:12px; flex-wrap:wrap;
}
.table-card .table-head h2 { margin:0; }
.table-link { font-size:13px; font-weight:600; }
.table-card .filter-bar { padding:0 24px 16px; margin-bottom:0; border-bottom:1px solid var(--line); }
.table-card .table-scroll { margin:0; border:none; border-radius:0; box-shadow:none; }
.table-card table.data th { border-top:1px solid var(--line); }
.table-card table.data th:first-child, .table-card table.data td:first-child { padding-left:24px; }
.table-card table.data th:last-child, .table-card table.data td:last-child { padding-right:24px; }

.pager { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
  padding:14px 24px; border-top:1px solid var(--line); font-size:13px; color:var(--muted); }
.pager .pages { display:flex; gap:6px; }
.pager .pages a, .pager .pages span {
  min-width:30px; height:30px; padding:0 6px; display:inline-flex; align-items:center; justify-content:center;
  border-radius:7px; border:1px solid var(--line); color:var(--ink); font-size:12.5px; text-decoration:none;
}
.pager .pages span.cur { background:var(--teal); border-color:var(--teal); color:#fff; font-weight:600; }
.pager .pages a:hover { border-color:var(--teal); color:var(--teal-d); }

/* log-table cell helpers */
.when { color:var(--muted); font-size:13px; white-space:nowrap; }
.req-id {
  font-family:var(--mono); font-size:11.5px; color:var(--chip-ink);
  background:var(--chip-bg); border:1px solid var(--line); border-radius:6px; padding:2px 8px;
}
.endpoint { font-family:var(--mono); font-size:12.5px; color:var(--ink); white-space:nowrap; }
.ms { font-family:var(--mono); font-size:12.5px; color:var(--muted); }
td.num, th.num { text-align:right; }

.table-scroll { max-width:100%; overflow-x:auto; margin:6px 0 20px; border:1px solid var(--line);
  border-radius:var(--radius); background:var(--panel); box-shadow:var(--shadow); }
table.data { width:100%; border-collapse:collapse; font-size:13.5px; background:var(--panel); }
table.data th {
  text-align:left; font-size:10.5px; font-weight:600; letter-spacing:.11em; text-transform:uppercase;
  color:var(--muted); padding:9px 14px; border-bottom:1px solid var(--line);
  background:var(--th-bg); white-space:nowrap;
}
table.data td { text-align:left; padding:11px 14px; border-bottom:1px solid var(--row-line); vertical-align:top; }
table.data tbody tr:last-child td { border-bottom:none; }
table.data tbody tr:hover { background:var(--row-hover); }
table.data th:first-child, table.data td:first-child { padding-left:20px; }
table.data th:last-child, table.data td:last-child { padding-right:20px; }
table.data td code { white-space:normal; overflow-wrap:anywhere; }

/* ---------------- Callouts (flash + notes) ---------------- */
.callout { border-radius:var(--radius-sm); padding:12px 16px; margin:12px 0; border-left:4px solid; font-size:13.5px; color:var(--ink); }
.callout .lbl { font-weight:700; text-transform:uppercase; font-size:10.5px; letter-spacing:.06em; margin-right:6px; }
.callout.info { background:var(--info-bg); border-color:var(--infoc); }
.callout.ok   { background:var(--ok-bg);   border-color:var(--okc); }
.callout.warn { background:var(--warn-bg); border-color:var(--warnc); }
.callout.prov { background:var(--prov-bg); border-color:var(--provc); }
.callout.info .lbl { color:var(--infoc); } .callout.ok .lbl { color:var(--okc); }
.callout.warn .lbl { color:var(--warnc); } .callout.prov .lbl { color:var(--provc); }

/* ---------------- Theme toggle / header tool buttons ---------------- */
.themebtn {
  width:36px; height:36px; border-radius:9px; border:1px solid var(--line);
  background:var(--panel); color:var(--muted); cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
}
.themebtn:hover { border-color:var(--teal); color:var(--teal-d); }
.themebtn i, .themebtn svg { width:16px; height:16px; }

/* ---------------- Login ---------------- */
.login-wrap {
  min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px;
  background:linear-gradient(135deg, var(--navy-deep), var(--navy));
}
.login-card {
  width:100%; max-width:420px; background:var(--panel); border-radius:16px;
  box-shadow:var(--shadow-lg); padding:38px 34px; text-align:center;
}
.login-card img { height:40px; margin-bottom:18px; }
.login-card h1 { font-family:var(--display); font-size:22px; margin:0 0 6px; }
.login-card p { color:var(--muted); font-size:13.5px; margin:0 0 24px; }
.login-provider {
  display:flex; align-items:center; justify-content:center; gap:10px; width:100%;
  padding:11px 16px; margin:8px 0; border:1px solid var(--line); border-radius:10px;
  background:var(--panel); color:var(--ink); font-weight:600; font-size:14px; cursor:pointer; text-decoration:none;
}
.login-provider:hover { border-color:var(--teal); text-decoration:none; }
.login-provider i, .login-provider svg { width:16px; height:16px; }

/* ---------------- Row-actions menu (ellipsis) ---------------- */
.action-cell { position:relative; text-align:right; white-space:nowrap; }
.action-menu-btn { font-size:16px; line-height:1; padding:3px 10px; }
.action-menu {
  position:absolute; right:6px; top:calc(100% - 4px); z-index:40; min-width:160px;
  background:var(--panel); border:1px solid var(--line); border-radius:10px;
  box-shadow:var(--shadow-lg); padding:4px; display:flex; flex-direction:column; text-align:left;
}
.action-menu[hidden] { display:none; }
.action-menu a, .action-menu button {
  display:block; width:100%; text-align:left; background:none; border:0;
  padding:7px 11px; font:inherit; font-size:13px; color:var(--ink); cursor:pointer; border-radius:7px;
}
.action-menu a:hover, .action-menu button:hover { background:var(--teal-wash); text-decoration:none; }
.action-menu form { margin:0; }
.action-menu .danger { color:var(--warnc); }

/* ---------------- Help center ---------------- */
.help-section-title { font-size:12px; text-transform:uppercase; letter-spacing:.11em;
  color:var(--muted); font-weight:600; margin:26px 0 12px; }
.help-section-title:first-of-type { margin-top:4px; }
.help-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:14px; }
.help-card { display:block; background:var(--panel); border:1px solid var(--line);
  border-radius:var(--radius); padding:16px 18px; box-shadow:var(--shadow); color:var(--ink); }
.help-card:hover { border-color:var(--teal); text-decoration:none; }
.help-card__title { font-family:var(--display); font-weight:700; color:var(--heading); margin-bottom:5px; font-size:14.5px; }
.help-card__summary { font-size:13px; color:var(--muted); line-height:1.45; }
.help-article { max-width:860px; line-height:1.6; font-size:14.5px; }
.help-article h2 { font-family:var(--display); font-size:19px; margin:26px 0 10px; }
.help-article h2:first-child { margin-top:0; }
.help-article h3 { font-family:var(--display); font-size:15.5px; margin:20px 0 8px; }
.help-article p, .help-article li { color:var(--ink-soft); }
.help-article ul, .help-article ol { padding-left:22px; margin:8px 0 14px; }
.help-article li { margin:4px 0; }
.help-fig { margin:16px 0 20px; }
.help-fig img { max-width:100%; border:1px solid var(--line-strong); border-radius:10px;
  box-shadow:var(--shadow); }
.help-fig figcaption { font-size:12.5px; color:var(--muted); margin-top:6px; }

/* ---------------- Motion / responsive ---------------- */
@media (prefers-reduced-motion: no-preference) {
  .stat-card, .card { animation:rise .4s ease both; }
  .stat-card:nth-child(2) { animation-delay:.05s; }
  .stat-card:nth-child(3) { animation-delay:.1s; }
  .stat-card:nth-child(4) { animation-delay:.15s; }
  @keyframes rise { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
}
@media (max-width:820px) {
  .sidebar { transform:translateX(-105%); transition:transform .2s; width:var(--sidebar-w); }
  .sidebar.open { transform:translateX(0); box-shadow:var(--shadow-lg); }
  .app-main { margin-left:0; }
  .app-content { padding:24px 18px 90px; }
}
@media (prefers-reduced-motion:reduce) { * { animation:none!important; transition:none!important; } }
