/* HubOne — shared design-system CSS.
 *
 * One source of truth for tokens (colors), the base reset, page chrome
 * (header + tabs + view-switcher + user-menu), and common utility
 * components (chips, toast, pill). All templates (admin.html,
 * public.html, account.html, login.html) link to this file via
 *   <link rel="stylesheet" href="{{ url_for('static', filename='css/app.css') }}">
 *
 * Page-specific layout + component styles stay inline in their template
 * (e.g. the world-card grid in public.html, the blade-card in admin.html).
 *
 * Extracted 2026-05-19 per Bjorn's modularity feedback: keep CSS in one
 * place so changes propagate to every page without per-template edits.
 */

/* ---------- Design tokens ---------- */
:root {
  --bg:        #0d1117;
  --panel:     #161b22;
  --panel2:    #1c2128;
  --panel3:    #252c36;
  --border:    #30363d;
  --fg:        #c9d1d9;
  --muted:     #8b949e;
  --accent:    #58a6ff;
  --accent-2:  #1f6feb;
  --ok:        #4ade80;
  --warn:      #fbbf24;
  --err:       #f85149;
  --family:    #4ea8ff;  /* Friend family-tier star (blue). Distinct from
                            --accent so family-tier friends don't visually
                            collide with the existing online-dot color. */
}

/* ---------- Base reset + body ---------- */
* { box-sizing: border-box; }

/* Native UI scale. The CSS is rem-based (1rem = 16px under the spec's
 * default), and we bump html's font-size from the UA default 16px to 28px
 * so the whole UI renders at 1.75x its base. Users should keep browser
 * zoom at 100% — this is the baked-in scale. Borders intentionally stay
 * `1px` for hairline crispness; everything else scales.
 *
 * IMPORTANT: html and body MUST be in separate rules. An earlier version
 * had `html, body { font: 0.8125rem/1.45 ... }` which silently overrode
 * html's font-size back to 0.8125rem (= 13px of UA-default-16) — that
 * collapsed the entire rem system to ~46% of intended scale. The body
 * font shorthand belongs on body alone. */
html { font-size: 28px; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
}

body {
  font: 0.8125rem/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI",
        system-ui, sans-serif;
}

/* ---------- Header (used identically by admin + public + account) ----- */
header {
  padding: 0.625rem 1.125rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  gap: 0.875rem;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}
header h1 {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
}
header .grow { flex: 1; }
header a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.75rem;
}
header a:hover { text-decoration: underline; }

/* ---------- Tabs (admin's tab nav, public's tab nav) ---------- */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-left: 0.75rem;
}
.tab {
  padding: 0.5rem 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 0.375rem 0.375rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  user-select: none;
  background: transparent;
}
.tab:hover { color: var(--fg); }
.tab.active {
  color: var(--fg);
  background: var(--panel);
  border-color: var(--border);
  margin-bottom: -0.0625rem;
  padding-bottom: 0.5625rem;
}

/* ---------- View switcher (Public View | Admin View pill pair) -------- */
.view-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  overflow: hidden;
  margin-bottom: 0.375rem;
}
.view-switch-btn {
  padding: 0.3125rem 0.6875rem;
  font-size: 0.71875rem;
  color: var(--muted);
  text-decoration: none;
  border-right: 1px solid var(--border);
  transition: background 0.1s;
}
.view-switch-btn:last-child { border-right: none; }
.view-switch-btn:hover {
  background: var(--panel2);
  color: var(--fg);
  text-decoration: none;
}
.view-switch-btn.active {
  background: var(--accent-2);
  color: #fff;
  font-weight: 600;
}

/* ---------- Chips (used in user-menu tag display + other places) ----- */
.chips {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 62.4375rem;
  font-size: 0.75rem;
}
.chip button {
  padding: 0 0.25rem;
  background: transparent;
  border: 0;
  color: var(--muted);
}
.chip button:hover {
  color: var(--err);
  background: transparent;
}

/* ---------- User menu (avatar pill + dropdown) ----------------------- */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.625rem 0.25rem 0.25rem;
  border-radius: 62.4375rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel);
  margin-bottom: 0.375rem;
}
.user-menu:hover { background: var(--panel2); }
.user-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #b58aff);
  color: #0d1117;
  font-weight: 700;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -.02em;
  /* Crimson 2026-05-26: avatar <img> children must stay inside the
     circle — without overflow:hidden + img constraints, the raw
     256×256 webp blows past the 28px circle by ~9× when an avatar
     is uploaded. */
  overflow: hidden;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.user-menu .uname {
  font-size: 0.8125rem;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu .chev {
  color: var(--muted);
  font-size: 0.625rem;
  transition: transform .15s;
}
.user-menu.open .chev { transform: rotate(180deg); }
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.375rem);
  min-width: 15rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.25rem;
  display: none;
  z-index: 20;
  box-shadow: 0 0.5rem 2rem rgba(0,0,0,.4);
}
.user-dropdown.show { display: block; }
.user-dropdown .info {
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.user-dropdown .info .name { font-weight: 600; font-size: 0.8125rem; line-height: 1.3; }
/* .email rule retained for any leftover .email blocks; the dropdown's
   HTML no longer renders one. Kept the selectors to avoid surprising
   anyone who reads the CSS without the markup context. */
.user-dropdown .info .email { color: var(--muted); font-size: 0.75rem; }
.user-dropdown a,
.user-dropdown button.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.375rem 0.625rem;
  background: transparent;
  border: 0;
  color: var(--fg);
  text-decoration: none;
  font: inherit;
  font-size: 0.78125rem;
  cursor: pointer;
  border-radius: 0.25rem;
}
.user-dropdown a:hover,
.user-dropdown button.menu-item:hover {
  background: var(--panel2);
}
.user-dropdown .sep {
  height: 0.0625rem;
  background: var(--border);
  margin: 0.1875rem 0.25rem;
}

/* ---------- Generic utilities ---------- */
.muted { color: var(--muted); }
.pill {
  padding: 0.125rem 0.5625rem;
  border-radius: 62.4375rem;
  font-size: 0.71875rem;
  background: #21262d;
  color: var(--muted);
}
.pill.on   { background: rgba(46,160,67,.15);  color: var(--ok); }
.pill.off  { background: rgba(248,81,73,.15);  color: var(--err); }
.pill.warn { background: rgba(210,153,34,.15); color: var(--warn); }

/* ---------- Header calendar button (sits immediately left of the bell;
   same hit-area + radius as .notif-bell so the two read as a pair). On
   public.html it activates the in-page calendar view; on admin/account
   it links to /?tab=calendar. No unread badge — calendar isn't a notify
   surface, its "due today" hint shows on the icon itself. */
.cal-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 62.4375rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel);
  margin-bottom: 0.375rem;
  /* Negative right margin pulls the bell back toward the calendar so the
     two read as a tight pair. The header's 0.875rem flex gap would
     otherwise leave a wide gap between them; this nets ~0.375rem. */
  margin-right: -0.5rem;
  color: var(--muted);
  user-select: none;
  flex-shrink: 0;
  text-decoration: none;
}
.cal-btn:hover { background: var(--panel2); color: var(--fg); }
.cal-btn.active { background: var(--panel2); color: var(--accent);
  border-color: var(--accent); }
.cal-btn svg { width: 1rem; height: 1rem; }
/* Tiny dot in the corner when the user has any event scheduled in the
   next 24h. Driven by JS adding/removing .has-soon. */
.cal-btn .soon-dot {
  position: absolute;
  top: -0.1875rem;
  right: -0.1875rem;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--accent);
  border: 0.125rem solid var(--bg);
  display: none;
}
.cal-btn.has-soon .soon-dot { display: block; }

/* ---------- Notifications bell (left of user-menu in every header) -- */
.notif-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 62.4375rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel);
  margin-bottom: 0.375rem;
  color: var(--muted);
  user-select: none;
  flex-shrink: 0;
}
.notif-bell:hover { background: var(--panel2); color: var(--fg); }
.notif-bell svg { width: 1rem; height: 1rem; }
.notif-bell .badge {
  position: absolute;
  top: -0.1875rem;
  right: -0.1875rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 0.5rem;
  background: var(--err);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
  border: 0.125rem solid var(--bg);
  pointer-events: none;
}
.notif-bell .badge[hidden] { display: none; }

.notif-dropdown {
  position: absolute;
  right: 1rem;
  top: 3.5rem;
  width: 22.5rem;
  max-height: 28.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  display: none;
  z-index: 20;
  box-shadow: 0 0.5rem 2rem rgba(0,0,0,.4);
  flex-direction: column;
}
.notif-dropdown.show { display: flex; }
.notif-dropdown .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
}
.notif-dropdown .head h4 { margin: 0; font-size: 0.8125rem; font-weight: 600; }
.notif-dropdown .head button {
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  padding: 0;
}
.notif-dropdown .head button:hover { text-decoration: underline; }
.notif-dropdown .head button:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.notif-dropdown .list {
  overflow-y: auto;
  flex: 1;
  min-height: 5rem;
}
.notif-dropdown .empty {
  padding: 2rem 0.875rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  font-style: italic;
}
/* Notification dropdown tabs. "All" stays as a text button on the
   left; the rest are icon-only buttons (Attention / Invites / Friends).
   Active state = underline + accent color. */
.notif-tabs {
  display: flex;
  align-items: stretch;
  padding: 0 0.375rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.notif-tab {
  position: relative;
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 0.125rem solid transparent;
  margin-bottom: -0.0625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3125rem;
  white-space: nowrap;
}
.notif-tab:hover { color: var(--fg); }
.notif-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
/* Icon-only variant (Attention / Invites / Friends). Square click target. */
.notif-tab-icon {
  width: 2.5rem;
  padding: 0.5rem 0;
}
.notif-tab svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Badge sits at the top-right of the icon, like the bell badge does on
   the header. For the text "All" tab it inlines after the label. */
.notif-tab .tab-badge {
  background: var(--err);
  color: #fff;
  font-size: 0.59375rem;
  font-weight: 700;
  padding: 0.0625rem 0.3125rem;
  border-radius: 0.5rem;
  min-width: 0.875rem;
  text-align: center;
  line-height: 1.4;
}
.notif-tab-icon .tab-badge {
  position: absolute;
  top: 0.1875rem;
  right: 0.1875rem;
  border: 0.125rem solid var(--panel);
  padding: 0 0.1875rem;
  min-width: 0.75rem;
  font-size: 0.5625rem;
}
.notif-tab.active .tab-badge { background: var(--accent); }

/* Per-notification cards. Each card has a colored header strip with
   the kind label + dismiss X, then a body with title + time + description,
   and an optional thumbnail. Inspired by VRChat's notification UI but
   tighter (no wasted whitespace). */
.notif-list-pad { padding: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; }

.notif-card {
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  overflow: hidden;
  background: var(--panel2);
  cursor: pointer;
  position: relative;
  transition: border-color .12s, background .12s;
}
.notif-card:hover { border-color: var(--accent); background: var(--panel3); }
.notif-card.unread { border-left: 0.1875rem solid var(--accent); }
.notif-card.dismissing { opacity: 0; transform: translateX(1.25rem); transition: opacity .15s, transform .15s; }

.notif-card .head {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: 1px solid var(--border);
}
.notif-card .head .head-icon { font-size: 0.75rem; line-height: 1; }
.notif-card .head .head-label { flex: 1; }
.notif-card .head .head-close {
  background: transparent;
  border: 0;
  color: inherit;
  opacity: .6;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.25rem;
  cursor: pointer;
  border-radius: 0.1875rem;
}
.notif-card .head .head-close:hover { opacity: 1; background: rgba(255,255,255,.08); }
/* Per-kind header colors (border-left already covers unread state) */
.notif-card.kind-security .head { background: rgba(248,81,73,.15); color: var(--err); }
.notif-card.kind-friend   .head { background: rgba(74,222,128,.15); color: var(--ok); }
.notif-card.kind-system   .head { background: rgba(88,166,255,.15); color: var(--accent); }
.notif-card.kind-admin    .head { background: rgba(251,191,36,.15); color: var(--warn); }

.notif-card .body {
  display: flex;
  gap: 0.625rem;
  padding: 0.5625rem 0.625rem;
}
.notif-card .body .thumb {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.25rem;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}
.notif-card .body .text { flex: 1; min-width: 0; }
.notif-card .body .title {
  font-size: 0.78125rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.125rem;
  word-break: break-word;
}
.notif-card .body .meta {
  font-size: 0.65625rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.notif-card .body .desc {
  font-size: 0.71875rem;
  color: var(--fg);
  word-break: break-word;
  opacity: .85;
}
/* Inline action row at the bottom of a notification card (e.g. the
   Accept / Decline pair on a friend.request). The pair sits flush
   with the card edges so the buttons feel like a footer, not floating
   chips. The accent button mirrors the primary-button look used
   elsewhere in the dropdown. */
.notif-card .actions {
  display: flex;
  gap: 0.375rem;
  padding: 0 0.625rem 0.5625rem 0.625rem;
}
.notif-card .actions button {
  flex: 1;
  padding: 0.375rem 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--fg);
  font-size: 0.71875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s, filter .12s;
}
.notif-card .actions button:hover {
  border-color: var(--accent);
  background: var(--panel3);
}
.notif-card .actions button:disabled { opacity: .5; cursor: default; }
.notif-card .actions .act-accept {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.notif-card .actions .act-accept:hover { filter: brightness(1.1); }
.notif-card .actions .sent-cancel { border-color: var(--err); color: var(--err); }
.notif-card .actions .sent-cancel:hover { border-color: var(--err); background: rgba(248,81,73,0.12); }
/* Sent-tab cards are informational (not unread inbox items) — neutralize
   the hover that implies "click to open". */
.notif-card.is-sent { cursor: default; }
.notif-card.is-sent:hover { border-color: var(--border); background: var(--panel2); }

/* "View more" link at the top of the list */
.notif-view-more {
  display: block;
  text-align: right;
  padding: 0.375rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.71875rem;
  text-decoration: none;
}
.notif-view-more:hover { text-decoration: underline; }

/* ---------- Header H1-as-link (back-to-home behavior on every page) - */
header h1 a {
  color: var(--fg);
  text-decoration: none;
  font: inherit;
}
header h1 a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ---------- User-menu trigger (the name+chevron click zone) ---------- */
/* Split-click pattern: avatar (left) is its own <a> -> /account; the
   name+chev area is the dropdown trigger. Stops "click avatar = open
   dropdown" weirdness; matches Discord / GitHub / VRChat conventions. */
.user-menu .user-avatar {
  text-decoration: none;
  cursor: pointer;
}
.user-menu .user-avatar:hover {
  outline: 0.125rem solid var(--accent);
  outline-offset: 0.0625rem;
}

/* ---------- Tier glow plaque (whole user-menu pill) ----------------- */
/* Driven by /api/auth/me — JS adds .tier-<key> to the #userMenu element
   based on u.tier and u.tags. Free = no class = no ring. Pure box-shadow
   on the pill itself so the colored border wraps avatar+name+chev as a
   single "plaque". The inner ring matches the colour; the outer halo is
   the soft glow. Admin/super-admin resolve from tags so OIDC-group
   admins glow without needing an admin-tier row. */
.user-menu.tier-1           { border-color: transparent; box-shadow: 0 0 0 0.0625rem #3fdc7a, 0 0 0.625rem rgba(63,220,122,.45); }
.user-menu.tier-2           { border-color: transparent; box-shadow: 0 0 0 0.0625rem #3b9eff, 0 0 0.625rem rgba(59,158,255,.50); }
.user-menu.tier-3           { border-color: transparent; box-shadow: 0 0 0 0.0625rem #a259ff, 0 0 0.75rem  rgba(162,89,255,.55); }
.user-menu.tier-4           { border-color: transparent; box-shadow: 0 0 0 0.0625rem #ffc23a, 0 0 0.875rem rgba(255,194,58,.60); }
.user-menu.tier-creator     { border-color: transparent; box-shadow: 0 0 0 0.0625rem #ff4da8, 0 0 0.875rem rgba(255,77,168,.60); }
.user-menu.tier-admin       { border-color: transparent; box-shadow: 0 0 0 0.0625rem #ff4d2e, 0 0 0.875rem rgba(255,77,46,.65);  }
.user-menu.tier-super-admin { border-color: transparent; box-shadow: 0 0 0 0.0625rem #ffffff, 0 0 1rem      rgba(255,255,255,.75); }
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  padding: 0 0.125rem;
  user-select: none;
}

/* Username + role badge stack vertically: the role pill sits ABOVE the
   name instead of eating horizontal space in the name pane. With no role
   the column collapses to just the name, still vertically centred. */
.user-id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  line-height: 1.15;
  gap: 0.0625rem;
}

/* ---------- Inline role badge (tiny pill next to username) ----------- */
/* Shows the user's HIGHEST role only (super-admin > admin > moderator >
   vip > premium > plus). Hidden if the user has no notable role. */
.user-role {
  display: inline-block;
  padding: 0 0.3125rem;
  border-radius: 0.1875rem;
  font-size: 0.53125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  background: var(--panel3);
  color: var(--muted);
  line-height: 1.6;
  vertical-align: middle;
  position: relative;
  top: -0.0625rem;
}
/* Inside the stacked .user-id column the badge is its own block row, so
   the inline-alignment nudge is dropped. Font shrunk ~40% vs the base
   .user-role size (0.53125rem) so the role label reads as small
   secondary text above the username, not a competing line. */
.user-id .user-role { top: 0; font-size: 0.31875rem; }
.user-role.super-admin { background: rgba(248,81,73,.18);  color: var(--err); }
.user-role.admin       { background: rgba(88,166,255,.18); color: var(--accent); }
.user-role.moderator   { background: rgba(251,191,36,.18); color: var(--warn); }
.user-role.vip,
.user-role.premium     { background: rgba(181,138,255,.18); color: #c5a3ff; }
.user-role.plus        { background: rgba(74,222,128,.18); color: var(--ok); }
[hidden] { display: none !important; }

/* ---------- Page back-link (used in /account header area) ----------- */
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--err);
  text-decoration: none;
  font-size: 0.78125rem;
  margin-bottom: 0.5rem;
}
.page-back:hover { color: var(--err); text-decoration: none; filter: brightness(1.2); }

/* ---------- Toast (fixed-bottom flash message) ---------- */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 0.625rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.4);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.err { border-color: var(--err); color: var(--err); }
.toast.ok  { border-color: var(--ok);  }

/* Row visual treatment shared by every admin table — keeps suspended
 * accounts visible in the Live view (no longer filter-only) but with a
 * clear "deprioritised" treatment so they don't distract from active
 * management work. */
tr.row-suspended {
  background: rgba(245, 158, 11, 0.04);
  border-left: 3px solid var(--warn);
  opacity: 0.7;
}
tr.row-reported {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--warn);
}
tr.row-deleted {
  background: rgba(220, 38, 38, 0.04);
  border-left: 3px solid var(--err);
  opacity: 0.6;
}

/* Button busy state — used by _btnBusy() to give an unmistakable
 * mid-request signal: disabled, dimmed, with a subtle pulse. The
 * text content is swapped to "Suspending…" / "Deleting…" / etc by
 * the helper itself; this only handles the visual treatment. */
button.busy {
  opacity: 0.55;
  cursor: progress !important;
  position: relative;
}
button.busy::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  background-size: 200% 100%;
  animation: btnBusyShimmer 1.2s infinite linear;
  pointer-events: none;
}
@keyframes btnBusyShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Modal overlay — shared across all templates that use the same modal
 * JS pattern (`.modal-overlay.show` to open, hidden by default).
 * Base `.modal-card` provides the visual shell; templates override
 * sizing/padding for surface-specific cards. */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 1.25rem;
}
.modal-overlay.show { display: flex; }
.modal-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 0.625rem; padding: 1.375rem 1.5rem 1.125rem;
  width: 100%; max-width: 28.75rem;
  /* Low-res safety: cap to the viewport (overlay pads 1.25rem each side)
     and scroll internally instead of clipping off-screen top+bottom.
     Templates that set their own max-height (create-group, verif) keep
     theirs via higher specificity. Crimson 2026-06-01. */
  max-height: calc(100vh - 2.5rem); overflow-y: auto;
  box-shadow: 0 0.75rem 2.5rem rgba(0,0,0,0.5);
}
.modal-card h3 { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 600; }
.modal-card > p { margin: 0 0 1rem; color: var(--muted); font-size: 0.78125rem; }
.modal-buttons {
  display: flex; gap: 0.5rem; justify-content: flex-end;
  margin-top: 1.125rem;
}
