/* ============================================================================
   Migrator Admin — styles
   Dashboard UI on the Migrator brand: near-black / off-white neutral with the
   #FF5CD7 pink accent used sparingly. Theme-aware (prefers-color-scheme +
   :root[data-theme]). Tables scroll inside their own containers; numbers use
   tabular-nums; status is encoded as pills.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg:        #0b0b12;
  --bg-2:      #101019;
  --surface:   #13131f;
  --surface-2: #191926;
  --surface-3: #20202f;
  --border:    rgba(255,255,255,.09);
  --border-2:  rgba(255,255,255,.16);
  --fg:        #f5f5fa;
  --fg-2:      #c9c9d6;
  --muted:     #8c8c9d;

  --accent:      #FF5CD7;
  --accent-text: #ff8ce4;
  --accent-ink:  #14141a;
  --accent-soft: rgba(255,92,215,.14);
  --accent-line: rgba(255,92,215,.30);
  --ring:        rgba(255,140,228,.60);

  --ok:      #6ee7a8;
  --ok-soft: rgba(110,231,168,.14);
  --warn:      #f5c667;
  --warn-soft: rgba(245,198,103,.15);
  --danger:      #ff8080;
  --danger-soft: rgba(255,128,128,.15);
  --info:      #82b4ff;
  --info-soft: rgba(130,180,255,.15);

  --grid-line: rgba(255,255,255,.045);
  --shadow:    0 24px 60px -30px rgba(0,0,0,.8);
  --shadow-sm: 0 8px 24px -16px rgba(0,0,0,.7);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --radius:    14px;
  --radius-sm: 10px;
  --sidebar-w: 244px;
  --topbar-h:  60px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg:        #f6f6f9;
    --bg-2:      #eeeef3;
    --surface:   #ffffff;
    --surface-2: #f4f4f8;
    --surface-3: #ececef;
    --border:    rgba(12,12,24,.10);
    --border-2:  rgba(12,12,24,.18);
    --fg:        #141419;
    --fg-2:      #38384a;
    --muted:     #5c5c6b;

    --accent-text: #b3178f;
    --accent-soft: rgba(255,92,215,.12);
    --accent-line: rgba(255,92,215,.38);
    --ring:        rgba(190,26,150,.55);

    --ok:      #0f9b5a;
    --ok-soft: rgba(15,155,90,.14);
    --warn:      #a9720a;
    --warn-soft: rgba(169,114,10,.14);
    --danger:      #c62f2f;
    --danger-soft: rgba(198,47,47,.12);
    --info:      #2563c9;
    --info-soft: rgba(37,99,201,.12);

    --grid-line: rgba(12,12,24,.05);
    --shadow:    0 22px 50px -30px rgba(24,10,30,.28);
    --shadow-sm: 0 8px 20px -16px rgba(24,10,30,.3);
  }
}
:root[data-theme="dark"] {
  --bg:#0b0b12; --bg-2:#101019; --surface:#13131f; --surface-2:#191926; --surface-3:#20202f;
  --border:rgba(255,255,255,.09); --border-2:rgba(255,255,255,.16);
  --fg:#f5f5fa; --fg-2:#c9c9d6; --muted:#8c8c9d;
  --accent-text:#ff8ce4; --accent-soft:rgba(255,92,215,.14); --accent-line:rgba(255,92,215,.30); --ring:rgba(255,140,228,.60);
  --ok:#6ee7a8; --ok-soft:rgba(110,231,168,.14); --warn:#f5c667; --warn-soft:rgba(245,198,103,.15);
  --danger:#ff8080; --danger-soft:rgba(255,128,128,.15); --info:#82b4ff; --info-soft:rgba(130,180,255,.15);
  --grid-line:rgba(255,255,255,.045); --shadow:0 24px 60px -30px rgba(0,0,0,.8); --shadow-sm:0 8px 24px -16px rgba(0,0,0,.7);
}
:root[data-theme="light"] {
  --bg:#f6f6f9; --bg-2:#eeeef3; --surface:#ffffff; --surface-2:#f4f4f8; --surface-3:#ececef;
  --border:rgba(12,12,24,.10); --border-2:rgba(12,12,24,.18);
  --fg:#141419; --fg-2:#38384a; --muted:#5c5c6b;
  --accent-text:#b3178f; --accent-soft:rgba(255,92,215,.12); --accent-line:rgba(255,92,215,.38); --ring:rgba(190,26,150,.55);
  --ok:#0f9b5a; --ok-soft:rgba(15,155,90,.14); --warn:#a9720a; --warn-soft:rgba(169,114,10,.14);
  --danger:#c62f2f; --danger-soft:rgba(198,47,47,.12); --info:#2563c9; --info-soft:rgba(37,99,201,.12);
  --grid-line:rgba(12,12,24,.05); --shadow:0 22px 50px -30px rgba(24,10,30,.28); --shadow-sm:0 8px 20px -16px rgba(24,10,30,.3);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, select, textarea { font: inherit; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}
/* The view container is only a programmatic focus target (route changes move
   focus here for screen readers) — it must not paint a focus ring. */
#view:focus, #view:focus-visible { outline: none; }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 10px; font-weight: 650;
  transition: top .16s ease;
}
.skip:focus { top: 12px; }

/* ---------- Boot / loading ---------- */
.boot {
  min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px;
  color: var(--muted);
}
.boot-logo {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .5; transform: scale(.94);} 50% { opacity: 1; transform: scale(1);} }
@media (prefers-reduced-motion: reduce) { .boot-logo { animation: none; } }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-2); border-top-color: var(--accent);
  animation: spin .7s linear infinite; display: inline-block; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* ---------- Brand mark ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: var(--accent);
  display: grid; place-content: center;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ============================================================================
   LOGIN
   ========================================================================== */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(60% 40% at 50% -4%, var(--accent-soft), transparent 70%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.login-card .brand { font-size: 18px; margin-bottom: 4px; }
.login-title { font-size: 20px; letter-spacing: -.02em; margin-top: 18px; }
.login-desc { color: var(--muted); font-size: 14px; margin-top: 6px; margin-bottom: 20px; }
.login-form { display: grid; gap: 14px; }
.login-error {
  background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--fg); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px;
}
.advanced { margin-top: 6px; }
.advanced > summary {
  cursor: pointer; color: var(--muted); font-size: 13px; list-style: none;
  display: inline-flex; align-items: center; gap: 6px; user-select: none;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before { content: "▸"; font-size: 10px; transition: transform .15s ease; }
.advanced[open] > summary::before { transform: rotate(90deg); }
.advanced .field { margin-top: 12px; }

/* ---------- Form primitives ---------- */
.field { display: grid; gap: 6px; }
.field > label, .lbl { font-size: 13px; font-weight: 600; color: var(--fg-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; background: var(--surface-2); color: var(--fg);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 10px 12px; transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.select { appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--border-2); position: relative; transition: background .16s ease, border-color .16s ease; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--muted); transition: transform .16s ease, background .16s ease;
}
.switch input:checked + .track { background: var(--accent-soft); border-color: var(--accent-line); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--accent); }
.switch input:focus-visible + .track { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  border: 1px solid transparent; transition: transform .06s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn-ghost { background: var(--surface-2); color: var(--fg); border-color: var(--border-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 22%, transparent); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.btn-icon:hover { background: var(--surface-3); }
.btn-icon svg { width: 18px; height: 18px; }

/* ============================================================================
   APP SHELL
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  grid-row: 1 / -1; position: sticky; top: 0; align-self: start; height: 100vh;
  background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 4px;
}
.sidebar .brand { padding: 6px 8px 16px; font-size: 16px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: var(--fg-2); font-weight: 550; font-size: 14px; transition: background .13s ease, color .13s ease;
}
.nav-link:hover { background: var(--surface); color: var(--fg); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-link .ico { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-link.active .ico { opacity: 1; }
.nav-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.nav-user { padding: 6px 8px; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user strong { color: var(--fg-2); font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 clamp(16px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 17px; letter-spacing: -.01em; font-weight: 650; }
.topbar .crumbs { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.topbar .crumbs a:hover { color: var(--fg-2); }
.topbar .spacer { flex: 1; }
.hamburger { display: none; }

.content { padding: clamp(18px, 3vw, 30px) clamp(16px, 3vw, 30px); max-width: 1200px; width: 100%; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .ph-title { font-size: clamp(20px, 3vw, 25px); letter-spacing: -.02em; }
.page-head .ph-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.card-head .card-sub { color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 18px; }
@media (min-width: 720px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat .stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: .01em; display: flex; align-items: center; gap: 7px; }
.stat .stat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.stat .stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; line-height: 1; }
.stat.accent .stat-value { color: var(--accent-text); }
.stat .stat-dot.ok { background: var(--ok); }
.stat .stat-dot.warn { background: var(--warn); }
.stat .stat-dot.danger { background: var(--danger); }

/* ---------- Pills / chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap; line-height: 1.7;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.plain::before { display: none; }
.pill-ok      { color: var(--ok);     background: var(--ok-soft);     border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.pill-warn    { color: var(--warn);   background: var(--warn-soft);   border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.pill-danger  { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 34%, transparent); }
.pill-info    { color: var(--info);   background: var(--info-soft);   border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.pill-accent  { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); }
.pill-muted   { color: var(--muted);  background: var(--surface-2);   border-color: var(--border); }
.role-admin { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); }
.role-user  { color: var(--fg-2); background: var(--surface-2); border-color: var(--border); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
table.data th, table.data td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
table.data thead th {
  position: sticky; top: 0; background: var(--surface-2); z-index: 1;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650;
}
table.data tbody tr { transition: background .1s ease; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .cell-mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-2); }
table.data .cell-muted { color: var(--muted); }
.trunc { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Toolbar (search / filters above tables) ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 200px; max-width: 360px; position: relative; }
.toolbar .search .input { padding-left: 34px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.toolbar .grow { flex: 1; }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 14px; color: var(--muted); font-size: 13px; }
.pager .range { font-variant-numeric: tabular-nums; }

/* ---------- Definition / meta list ---------- */
.meta { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; align-items: baseline; }
.meta dt { color: var(--muted); font-size: 13px; }
.meta dd { margin: 0; color: var(--fg); word-break: break-word; }

/* ---------- Timeline (migration logs) ---------- */
.timeline { position: relative; margin: 0; padding: 4px 0 4px 6px; }
.tl-item { position: relative; padding: 0 0 16px 26px; }
.tl-item::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: -2px; width: 2px; background: var(--border-2); }
.tl-item:last-child::before { display: none; }
.tl-item .tl-dot { position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px var(--bg); }
.tl-item.level-info .tl-dot  { background: var(--info); }
.tl-item.level-warn .tl-dot  { background: var(--warn); }
.tl-item.level-error .tl-dot { background: var(--danger); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-phase { font-weight: 650; font-size: 13.5px; }
.tl-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tl-msg { color: var(--fg-2); font-size: 13.5px; margin-top: 2px; }
.tl-data { margin-top: 6px; }

/* ---------- Code / copy block ---------- */
.codeblock {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: var(--font-mono); font-size: 13px; color: var(--fg-2);
  max-height: 260px; overflow: auto; white-space: pre; line-height: 1.7;
}
.code-list { display: grid; gap: 4px; }
.code-list .code-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details.raw > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
details.raw pre { margin: 8px 0 0; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; overflow: auto; font-size: 12px; }

/* ---------- Empty / error states ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .empty-title { color: var(--fg-2); font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.state-error { background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 34%, transparent); color: var(--fg); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; }
.loading-row { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 32px)); }
.toast {
  background: var(--surface); border: 1px solid var(--border-2); border-left: 3px solid var(--muted);
  border-radius: var(--radius-sm); padding: 11px 14px; box-shadow: var(--shadow);
  font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start;
  animation: toast-in .18s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
.toast .t-body { flex: 1; }
.toast .t-close { color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; }

/* ---------- Modal / drawer scrim ---------- */
.scrim { position: fixed; inset: 0; z-index: 100; background: rgba(4,4,10,.55); display: none; }
.scrim.show { display: block; }

/* ---------- Helpers ---------- */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.gap-sm { gap: 8px; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 10px; }
.muted { color: var(--muted); }
.accent-text { color: var(--accent-text); }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ============================================================================
   RESPONSIVE — sidebar becomes a slide-in drawer under 900px
   ========================================================================== */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 120; width: min(280px, 82vw); height: 100vh;
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .hamburger { display: inline-flex; }
  .content { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
