/* ============================================================
   BloodNet v2 - design tokens
   Signature: a heartbeat / pulse-line motif used as the section
   divider throughout, echoing a blood-pressure monitor readout.
   Palette: clinical warm-white base, deep blood red as the single
   loud accent, a life/health teal-green for "eligible / positive"
   states, and warm amber for "snoozed" states.
   ============================================================ */
:root {
  --bg: #faf8f6;
  --surface: #ffffff;
  --surface-2: #f3ede9;
  --ink: #201a18;
  --ink-soft: #5c534e;
  --line: #e7dfda;
  --primary: #b21e33;
  --primary-dark: #7d1424;
  --primary-tint: #f7e6e8;
  --accent: #1f7a5c;
  --accent-tint: #e4f2ec;
  --warn: #c97a22;
  --warn-tint: #faedd9;
  --danger: #b21e33;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(32, 26, 24, 0.06), 0 8px 24px -12px rgba(32, 26, 24, 0.18);
  --font-bn: "Noto Serif Bengali", "Noto Sans Bengali", serif;
  --font-ui: "Poppins", "Noto Sans Bengali", sans-serif;
  --max-w: 560px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
:lang(bn), .bn { font-family: var(--font-bn); }
h1, h2, h3, h4 { font-family: var(--font-bn); font-weight: 700; margin: 0 0 0.4em; color: var(--ink); }
p { margin: 0 0 0.8em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; } }

#app { max-width: var(--max-w); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding-bottom: 40px; }
@media (min-width: 900px) { #app { max-width: 720px; } }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; position: sticky; top: 0; background: rgba(250,248,246,0.92); backdrop-filter: blur(6px); z-index: 20; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) {
  /* position:fixed rather than sticky - sticky's "stuck" state depends on
     the nearest scrolling ancestor's containing-block rules, which proved
     unreliable in practice (reported as "not sticky" on the profile page
     in particular); fixed has no such dependency.
     Spans the full viewport width at a constant offset - the sidebar now
     floats as its own rounded panel over the page (see .bottom-nav below)
     rather than pushing the topbar over, so this doesn't need to track
     the sidebar's collapsed/expanded width. */
  .topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 21; }
}
.topbar__logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-bn); font-weight: 700; font-size: 1.15rem; color: var(--primary-dark); }
.topbar__logo img { height: 28px; width: 28px; border-radius: 7px; object-fit: cover; }
.topbar__spacer { flex: 1; }
.topbar__link { font-size: 0.92rem; font-weight: 600; color: var(--ink-soft); padding: 8px 10px; border-radius: 999px; }
.topbar__link:hover { background: var(--surface-2); text-decoration: none; }

main { flex: 1; padding: 20px 18px 8px; }

/* ---------- pulse divider (signature element) ---------- */
.pulse-divider { display: block; width: 100%; height: 28px; margin: 22px 0; }
.pulse-divider path { fill: none; stroke: var(--line); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pulse-divider.accent path { stroke: var(--primary); opacity: 0.55; }

/* ---------- cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card--flat { box-shadow: none; }

/* Clickable list rows (e.g. মাল্টিসাইট ব্র্যান্ডিং domain list) - a plain
   .card with a click handler needs a visible affordance, since the
   default .card has no hover/interactive styling on its own. */
.card--clickable { cursor: pointer; }
.card--clickable:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.center { text-align: center; }
.muted { color: var(--ink-soft); font-size: 0.92rem; }
.small { font-size: 0.85rem; }
.eyebrow { font-family: var(--font-ui); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary); font-weight: 700; margin-bottom: 6px; display: block; }

/* ---------- admin help doc ---------- */
/* Each admin nav section is a native <details> accordion re-using .card's
   look - summary is the clickable header (question mark cursor removed by
   overriding the default marker with a chevron-esque ::marker), the Q/A
   pairs inside use a slightly indented, lightly bordered block so multiple
   items in one open section stay visually separated without needing extra
   nested cards. */
.help-doc-section { cursor: default; }
.help-doc-section__title { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; color: var(--ink); list-style: none; }
.help-doc-section__title::-webkit-details-marker { display: none; }
.help-doc-section__title::marker { content: ""; }
.help-doc-section__title::after { content: "+"; margin-left: auto; font-size: 1.2rem; color: var(--ink-soft); }
.help-doc-section[open] .help-doc-section__title::after { content: "−"; }
.help-doc-item { margin-top: 14px; padding: 12px 14px; background: var(--surface-2); border-radius: calc(var(--radius) - 6px); }
.help-doc-item__q { font-weight: 600; color: var(--primary-dark); margin-bottom: 6px; }
.help-doc-item__a { font-size: 0.92rem; color: var(--ink); line-height: 1.6; }
.help-doc-item__a b { color: var(--ink); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 600; font-size: 0.98rem; cursor: pointer; width: 100%; transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-soft); width: auto; padding: 8px 12px; }
/* Small round icon-only button (copy/edit affordances next to a line of
   text) - needs its own sizing rather than the full .btn padding/width. */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: none; background: transparent; color: var(--ink-soft); cursor: pointer; flex-shrink: 0; transition: background 0.12s ease, color 0.12s ease; }
.btn-icon:hover { background: var(--surface-2); color: var(--primary); }
.btn-icon svg, .btn-icon i { width: 16px; height: 16px; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; width: auto; }
.btn-danger { background: var(--danger); color: #fff; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ---------- forms ---------- */
label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
input[type=text], input[type=password], input[type=tel], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); outline-offset: 2px;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 80px; }
.field { margin-bottom: 14px; }
.field-hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; }
.field-hint--ok { color: var(--accent); }
.field-error { font-size: 0.8rem; color: var(--danger); margin-top: 4px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; }
.switch { position: relative; width: 52px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 999px; cursor: pointer; transition: background 0.15s; }
.switch .track::before { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; background: #fff; border-radius: 50%; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::before { transform: translateX(22px); }

/* ---------- badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.badge-bg { background: var(--primary-tint); color: var(--primary-dark); }
.badge-on { background: var(--accent-tint); color: var(--accent); }
.badge-snoozed { background: var(--warn-tint); color: var(--warn); }
.badge-off { background: var(--surface-2); color: var(--ink-soft); }
/* Activity log table: aligned columns, readable on both mobile (horizontal
   scroll) and desktop. */
.activity-log-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.activity-log-table th, .activity-log-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.activity-log-table th { font-weight: 700; color: var(--ink-soft); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.activity-log-table tr:last-child td { border-bottom: none; }
/* Profile calls tab: borderless variant per spec ("তালিকা...বর্ডার ছাড়া") -
   overrides the row divider from .activity-log-table above. */
.profile-calls-table th, .profile-calls-table td { border-bottom: none; padding: 8px 10px 8px 0; }
.choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.choice-grid button { padding: 12px 4px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; }
.choice-grid button.selected, .choice-grid button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-tint); }

/* ---------- landing hero ---------- */
.hero { text-align: center; padding: 30px 6px 8px; }
.hero h1 { font-size: 1.7rem; line-height: 1.35; }
.hero .subhead { font-size: 1.02rem; color: var(--ink-soft); margin-bottom: 4px; }
.hero .fineprint { font-size: 0.82rem; color: var(--ink-soft); }
.choice-cards { display: grid; gap: 14px; margin-top: 22px; }
.choice-card { display: block; padding: 22px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); text-align: center; box-shadow: var(--shadow); cursor: pointer; }
.choice-card--seek { border-color: var(--primary-tint); }
.choice-card--seek:hover { border-color: var(--primary); }
.choice-card--donate:hover { border-color: var(--accent); }
.choice-card .icon { width: 44px; height: 44px; margin: 0 auto 10px; color: var(--primary); }
.choice-card--donate .icon { color: var(--accent); }
.choice-card b { display: block; font-family: var(--font-bn); font-size: 1.15rem; margin-bottom: 4px; }

/* ---------- donor profile card (shown one by one) ---------- */
.donor-card { text-align: center; }
.donor-card__pic { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px; background: var(--surface-2); border: 3px solid var(--primary-tint); }
.donor-card__name { font-size: 1.1rem; font-weight: 700; }
.donor-card__meta { color: var(--ink-soft); font-size: 0.9rem; margin: 4px 0 10px; }
.donor-card__details { text-align: left; border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 8px; font-size: 0.92rem; }
.donor-card__note { border: 1.5px dashed var(--warn); background: var(--warn-tint); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.88rem; margin: 12px 0; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px; -webkit-overflow-scrolling: touch; }
.tabs button { flex-shrink: 0; padding: 10px 14px; background: none; border: none; border-bottom: 2.5px solid transparent; font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-color: var(--primary); }
/* Tab content area (both the owner's own profile tabs and the public
   profile's tab view) always claims the full width of its parent card/
   column instead of shrinking to fit whichever tab's content happens to
   be shortest - without this, switching from a short tab (e.g. তথ্য) to
   a long one (e.g. a wide কল হিষ্ট্রি table) visibly resized the whole
   surrounding area, most noticeable on desktop where the page has real
   width to move around in. */
.profile-tab-body { width: 100%; box-sizing: border-box; }

/* ---------- lists ---------- */
.list-item { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: none; }
.list-item__actions { display: flex; gap: 2px; flex-shrink: 0; }
/* Call-history rows: text line, then a small timestamp line below it,
   rather than the default left/right single-line layout. */
.list-item--stacked { display: block; }
.list-item--stacked > div:first-child { margin-bottom: 2px; }
/* Public profile tab strip (tab view) */
.profile-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.profile-tabs__btn { border: none; background: transparent; padding: 10px 14px; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.profile-tabs__btn.is-active { color: var(--primary); border-bottom-color: var(--primary); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table-wrap { overflow-x: auto; }

/* ---------- toast / banner ---------- */
.banner { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 14px; }
.banner-error { background: var(--primary-tint); color: var(--primary-dark); border: 1px solid var(--primary); }
.banner-ok { background: var(--accent-tint); color: var(--accent); border: 1px solid var(--accent); }
.banner--dismissible { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.banner__dismiss { flex-shrink: 0; border: none; background: transparent; color: inherit; opacity: 0.6; cursor: pointer; padding: 2px; display: flex; }
.banner__dismiss:hover { opacity: 1; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 0.88rem; z-index: 100; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; text-align: center; max-width: min(90vw, 420px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

/* ---------- admin nav ---------- */
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.admin-nav a { font-size: 0.85rem; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-weight: 600; }
.admin-nav a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-card .num { font-size: 1.6rem; font-weight: 700; font-family: var(--font-bn); color: var(--primary); }
.stat-card .label { font-size: 0.8rem; color: var(--ink-soft); }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #ece4de 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); height: 18px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.checkbox-row input { margin-top: 3px; cursor: pointer; }
.checkbox-row .lbl { font-weight: 600; font-size: 0.9rem; }
/* Puts a field + its "মনে নেই"-style checkbox on one row on wider screens,
   stacked on narrow ones, so the checkbox sits to the right of the field
   instead of on its own line below it. */
.field-row-with-checkbox { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.field-row-with-checkbox .field { margin-bottom: 0; flex: 1 1 200px; min-width: 200px; }
.checkbox-row--inline { padding: 0; white-space: nowrap; margin-top: 1px; }

.link-list a { display: block; padding: 4px 0; }

/* ---------------------------------------------------------- password field */
.password-field { position: relative; display: flex; }
.password-field input { flex: 1; padding-right: 44px; }
.eye-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: none; background: transparent; color: var(--ink-soft); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.eye-toggle:hover { background: var(--surface-2); color: var(--ink); }
.eye-toggle svg, .eye-toggle i { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ modal */
.modal-root { position: fixed; inset: 0; background: rgba(32,26,24,0.45); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.modal-box { background: var(--surface); border-radius: var(--radius); max-width: 480px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.modal-header h3 { margin: 0; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--ink-soft); padding: 6px; border-radius: 50%; display: flex; }
.modal-close:hover { background: var(--surface-2); }
.modal-body { padding: 18px; }
.modal-actions { display: flex; gap: 10px; padding: 0 18px 18px; justify-content: flex-end; }
.modal-actions .btn { width: auto; }

.sidebar-collapse-btn { display: none; }

/* ------------------------------------------------------- bottom nav */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,0.97); backdrop-filter: blur(6px); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.68rem; color: var(--ink-soft); font-weight: 600; padding: 6px 4px; border-radius: 10px; flex: 1; max-width: 92px; }
.bottom-nav a svg, .bottom-nav a i { width: 21px; height: 21px; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a:hover { text-decoration: none; background: var(--surface-2); }
#app { padding-bottom: 84px; }
#toast { bottom: 92px; }

/* On desktop the same nav becomes a fixed vertical sidebar on the left
   instead of a bottom bar - lets page content use the full width instead
   of staying constrained to a mobile-style centered column.
   Sizes to its content (top-anchored, no bottom:0 stretch) rather than
   filling the full viewport height - five short nav rows don't need a
   column reaching all the way to the bottom of a tall screen, and there's
   nothing wrong with leaving that space empty.
   Two states instead of a width-breakpoint split: expanded (icon+label,
   default open) and collapsed (icon-only, narrow rail) - toggled by the
   person via the button at the bottom of the nav, not by viewport width,
   and remembered across visits (see the cookie read/write in app.js). */
@media (min-width: 900px) {
  .bottom-nav {
    position: fixed; top: 84px; left: 16px; bottom: auto; right: auto; width: 208px; transform: none;
    max-width: none; flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 1px; padding: 8px; border-top: none; border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    overflow-y: auto; max-height: calc(100vh - 104px); background: var(--surface);
    transition: width 0.15s ease;
  }
  .bottom-nav a {
    flex-direction: row; justify-content: flex-start; align-items: center; gap: 11px;
    font-size: 0.84rem; line-height: 1.15; font-weight: 600; max-width: none;
    padding: 9px 12px; border-radius: 9px; position: relative;
  }
  .bottom-nav a svg, .bottom-nav a i { width: 16px; height: 16px; flex-shrink: 0; }
  /* Thin left accent bar for the active item, rather than a full-width
     colored block - a quieter, more deliberate "you are here" marker that
     matches the crimson identity used elsewhere without repeating the
     same solid-fill pattern .btn-primary already owns. */
  .bottom-nav a.active { color: var(--primary); background: var(--primary-tint); }
  .bottom-nav a.active::before {
    content: ""; position: absolute; left: -1px; top: 6px; bottom: 6px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--primary);
  }
  .bottom-nav a:hover { background: var(--surface-2); }
  .bottom-nav a.active:hover { background: var(--primary-tint); }

  /* Collapse toggle - lives at the bottom of the sidebar as its own row,
     same visual language as the nav links above it. */
  .sidebar-collapse-btn {
    display: flex; align-items: center; gap: 11px; width: 100%; margin-top: 4px;
    padding: 9px 12px; border-radius: 9px; border: none; background: transparent;
    color: var(--ink-soft); font-size: 0.84rem; font-weight: 600; font-family: var(--font-ui);
    cursor: pointer; border-top: 1px solid var(--line); padding-top: 12px;
  }
  .sidebar-collapse-btn:hover { background: var(--surface-2); color: var(--ink); }
  .sidebar-collapse-btn svg, .sidebar-collapse-btn i { width: 16px; height: 16px; flex-shrink: 0; transition: transform 0.15s ease; }

  /* Collapsed state: icon-only narrow rail. Default state (see app.js) -
     the person found this more useful than the expanded labels, so it's
     what a first-time desktop visit shows. */
  .bottom-nav[data-collapsed="true"] { width: 60px; }
  .bottom-nav[data-collapsed="true"] a { flex-direction: column; justify-content: center; text-align: center; gap: 3px; padding: 10px 4px; }
  .bottom-nav[data-collapsed="true"] a span { display: none; }
  .bottom-nav[data-collapsed="true"] a svg, .bottom-nav[data-collapsed="true"] a i { width: 18px; height: 18px; }
  .bottom-nav[data-collapsed="true"] a.active::before { left: -9px; }
  .bottom-nav[data-collapsed="true"] .sidebar-collapse-btn { justify-content: center; }
  .bottom-nav[data-collapsed="true"] .sidebar-collapse-btn span { display: none; }
  .bottom-nav[data-collapsed="true"] .sidebar-collapse-btn svg { transform: rotate(180deg); }

  /* .topbar's fixed positioning is set in its own media query above -
     its left offset stays constant regardless of collapse state (the
     sidebar floats over the freed space rather than the topbar reflowing
     around it), so #app's padding also stays constant either way. */
  #app { margin: 0; max-width: none; padding-left: 96px; padding-top: 76px; padding-bottom: 40px; padding-right: 0; }
  #view { max-width: 760px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
  #toast { bottom: 24px; }
}

/* ------------------------------------------------- back button on auth steps */
.back-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.back-btn { background: none; border: none; color: var(--ink-soft); cursor: pointer; display: flex; align-items: center; gap: 4px; padding: 6px 4px; font-weight: 600; font-size: 0.88rem; }
.back-btn:hover { color: var(--primary); }

/* ------------------------------------------------ desktop admin friendliness */
@media (min-width: 900px) {
  .admin-layout { display: flex; align-items: flex-start; gap: 22px; }
  .admin-nav { flex: 0 0 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; flex-direction: column; align-items: stretch; gap: 4px; position: sticky; top: 68px; }
  .admin-nav a { display: flex; align-items: center; gap: 8px; justify-content: flex-start; }
  .admin-content { flex: 1; min-width: 0; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
