/* ==========================================================================
   REC ADM
   Shell theme, components, and layout primitives.
   ========================================================================== */

/* ── 1. Color & type ────────────────────────────────────────────────────
   Status tones mix toward text so they stay legible on light and dark. */
:root {
  --adm-theme: light;
  --adm-bg: transparent;
  --adm-surface: rgba(24, 24, 27, 0.035);
  --adm-surface-2: color-mix(in srgb, var(--adm-text) 6%, var(--adm-surface));
  --adm-text: #18181b;
  --adm-muted: #71717a;
  --adm-subtle: color-mix(in srgb, var(--adm-muted) 82%, var(--adm-surface));
  --adm-accent: #5b5bd6;
  --adm-accent-2: color-mix(in srgb, #7c3aed 84%, var(--adm-text));
  --adm-on-accent: #ffffff;
  --adm-border: rgba(24, 24, 27, 0.12);
  --adm-border-strong: color-mix(in srgb, var(--adm-text) 20%, transparent);
  --adm-ok: color-mix(in srgb, #15803d 88%, var(--adm-text));
  --adm-warn: color-mix(in srgb, #b45309 88%, var(--adm-text));
  --adm-risk: color-mix(in srgb, #c2410c 90%, var(--adm-text));
  --adm-info: color-mix(in srgb, #3b82f6 84%, var(--adm-text));
  --adm-series-1: var(--adm-info);
  --adm-series-2: var(--adm-accent);
  --adm-series-3: var(--adm-accent-2);
  --adm-series-4: var(--adm-muted);
  --adm-series-5: var(--adm-ok);
  --adm-series-6: var(--adm-risk);
  --adm-shadow-1: 0 1px 2px color-mix(in srgb, var(--adm-text) 6%, transparent);
  --adm-shadow-2: 0 1px 2px color-mix(in srgb, var(--adm-text) 5%, transparent),
    0 8px 24px color-mix(in srgb, var(--adm-text) 8%, transparent);
  --adm-radius: 8px;
  --adm-radius-sm: 6px;
  --adm-radius-lg: 10px;
  --adm-font: "SF Pro Text", Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --adm-font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --adm-page: #fafafa;
  --adm-panel: #ffffff;
  --adm-side-bg: #f7f7f8;
  --adm-scrim: rgba(24, 24, 27, 0.3);
  --adm-chrome: rgba(24, 24, 27, 0.02);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --adm-theme: dark;
  --adm-surface: rgba(255, 255, 255, 0.05);
  --adm-surface-2: color-mix(in srgb, var(--adm-text) 6%, var(--adm-surface));
  --adm-text: #f4f4f5;
  --adm-muted: #a1a1aa;
  --adm-subtle: color-mix(in srgb, var(--adm-muted) 82%, var(--adm-surface));
  --adm-accent: #7b7ff0;
  --adm-accent-2: color-mix(in srgb, #8b5cf6 84%, var(--adm-text));
  --adm-on-accent: #ffffff;
  --adm-ok: #4ade80;
  --adm-warn: #fbbf24;
  --adm-risk: #fb923c;
  --adm-info: #6aa7ff;
  --adm-border: rgba(255, 255, 255, 0.1);
  --adm-border-strong: color-mix(in srgb, var(--adm-text) 17%, transparent);
  --adm-shadow-1: 0 1px 0 color-mix(in srgb, var(--adm-text) 4%, transparent) inset,
    0 1px 2px rgba(0, 0, 0, 0.35);
  --adm-shadow-2: 0 1px 0 color-mix(in srgb, var(--adm-text) 5%, transparent) inset,
    0 8px 24px rgba(0, 0, 0, 0.45);
  --adm-page: #09090b;
  --adm-panel: #111113;
  --adm-side-bg: #0c0c0e;
  --adm-scrim: rgba(9, 9, 11, 0.66);
  --adm-chrome: rgba(255, 255, 255, 0.02);
  color-scheme: dark;
}

/* Admin-derived tokens in the shell's idiom: rules and washes are the text
   color at low alpha, never a separate gray. */
:root {
  --adm-rule: color-mix(in srgb, var(--adm-text) 9%, transparent);
  --adm-rule-soft: color-mix(in srgb, var(--adm-text) 6%, transparent);
  --adm-wash: color-mix(in srgb, var(--adm-text) 4%, transparent);
  --adm-line: color-mix(in srgb, var(--adm-text) 30%, transparent);
  --adm-accent-wash: color-mix(in srgb, var(--adm-accent) 10%, transparent);
  --adm-accent-line: color-mix(in srgb, var(--adm-accent) 45%, transparent);
  --adm-rail: 232px;
  --adm-control: 32px;
  --adm-motion: 120ms ease;
  --adm-z: 60;

  /* Legacy aliases kept for older template hooks. */
  --bg-canvas: var(--adm-page);
  --bg-sidebar: var(--adm-chrome);
  --bg-surface: var(--adm-surface);
  --bg-surface-hover: var(--adm-surface-2);
  --bg-input: var(--adm-surface);
  --border-subtle: var(--adm-rule);
  --border-default: var(--adm-border);
  --border-strong: var(--adm-border-strong);
  --border-focus: var(--adm-accent);
  --text-main: var(--adm-text);
  --text-secondary: var(--adm-muted);
  --text-muted: var(--adm-subtle);
  --text-dim: var(--adm-subtle);
  --accent: var(--adm-accent);
  --accent-hover: var(--adm-accent);
  --accent-subtle: var(--adm-accent-wash);
  --color-online: var(--adm-ok);
  --color-offline: var(--adm-muted);
  --color-coruna: var(--adm-info);
  --color-darksword: var(--adm-accent-2);
  --color-warning: var(--adm-warn);
  --color-danger: var(--adm-risk);
  --color-purple: var(--adm-accent-2);
  --radius-xs: 5px;
  --radius-sm: var(--adm-radius-sm);
  --radius-md: 10px;
  --radius-lg: var(--adm-radius-lg);
  --radius-full: 999px;
}

/* ── 2. Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--adm-page);
  color: var(--adm-text);
  font-family: var(--adm-font);
  font-size: 14px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.3; text-wrap: balance; }
h1 { font-size: 1.6em; letter-spacing: -0.02em; line-height: 1.22; }
h2 { font-size: 1.16em; letter-spacing: -0.006em; }
h3 { font-size: 1em; }
h4 {
  font-size: 0.76em;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--adm-muted);
}
p { margin: 0 0 0.85em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
strong, b { font-weight: 650; }
hr { height: 0; margin: 2em 0; border: 0; border-top: 1px solid var(--adm-rule); }

a { color: var(--adm-accent); text-decoration: none; text-underline-offset: 0.18em; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; }

code, pre, .mono, kbd, samp {
  font-family: var(--adm-font-mono);
}
code {
  font-size: 0.875em;
  padding: 1.5px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--adm-text) 8%, transparent);
  color: var(--adm-text);
  border: 1px solid color-mix(in srgb, var(--adm-text) 9%, transparent);
  font-weight: 450;
}
pre code { background: transparent; border: 0; padding: 0; border-radius: 0; font-size: inherit; }

ul, ol { margin: 0 0 0.95em; padding-left: 1.35em; }
li { margin: 0.28em 0; }
li::marker { color: var(--adm-muted); }

blockquote {
  margin: 1.1em 0;
  padding: 0.1em 0 0.1em 1em;
  border-left: 2px solid var(--adm-border);
  color: var(--adm-muted);
}

.muted { color: var(--adm-muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { justify-content: space-between; }
.ml { margin-left: auto; }
.nowrap { white-space: nowrap; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--adm-text) 22%, transparent);
  background-clip: content-box;
  border: 1px solid transparent;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--adm-text) 38%, transparent); }

/* Tone contract (component shell). */
:where([data-tone='ok']) { --adm-tone: var(--adm-ok); }
:where([data-tone='warn']) { --adm-tone: var(--adm-warn); }
:where([data-tone='risk']) { --adm-tone: var(--adm-risk); }
:where([data-tone='info']) { --adm-tone: var(--adm-info); }
:where([data-tone='accent']) { --adm-tone: var(--adm-accent); }

/* ── 3. Shell ─────────────────────────────────────────────────────────── */
.app, .layout {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
  grid-template-columns: var(--adm-rail) minmax(0, 1fr);
  grid-template-areas: 'tb tb' 'side stage';
  background: var(--adm-page);
}

.tb, .top-bar {
  grid-area: tb;
  position: sticky;
  top: 0;
  z-index: var(--adm-z);
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid var(--adm-border);
  background: var(--adm-page);
}
.tb-crumb, .top-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-crumb h1, .top-bar h1 {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-right, .top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.side {
  grid-area: side;
  position: sticky;
  top: 44px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 44px);
  padding: 12px 10px 10px;
  background: var(--adm-side-bg);
  border-right: 1px solid var(--adm-border);
}
.stage, .main { grid-area: stage; min-width: 0; display: flex; flex-direction: column; }
.content-body { flex: 1; padding: 24px 28px 48px; }

/* Brand */
.brand-wrapper { display: flex; align-items: center; gap: 8px; padding: 0 6px 14px; }
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--adm-text);
}
.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--adm-text);
  color: var(--adm-page);
  box-shadow: var(--adm-shadow-1);
}
.brand-icon svg { display: block; width: 16px; height: 16px; }
.brand span { color: var(--adm-muted); font-weight: 500; }
.brand-tag {
  margin-left: auto;
  padding: 0 7px;
  border: 1px solid var(--adm-border);
  border-radius: 999px;
  background: var(--adm-surface);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--adm-muted);
}

/* Nav — a toned rail marks the active route, the shell's selection idiom. */
.nav-scroll { flex: 1; overflow-y: auto; padding: 0 2px; margin: 0 -2px; }
.nav-section-title {
  margin: 14px 0 5px;
  padding: 0 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--adm-muted);
}
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 31px;
  padding: 0 9px;
  border-radius: 8px;
  color: var(--adm-muted);
  font-size: 0.84rem;
  font-weight: 500;
  transition: background var(--adm-motion), color var(--adm-motion);
}
.nav a svg { width: 15px; height: 15px; stroke-width: 1.7; flex: none; }
.nav a:hover { background: var(--adm-wash); color: var(--adm-text); text-decoration: none; }
.nav a.on {
  color: var(--adm-text);
  font-weight: 600;
  background: var(--adm-panel);
  box-shadow: 0 0 0 1px var(--adm-border), var(--adm-shadow-1);
}
.nav a.on svg { color: var(--adm-accent); }

.side-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 9px 7px 2px;
  border-top: 1px solid var(--adm-rule);
  font-size: 0.72rem;
  color: var(--adm-muted);
}
.side-status-indicator { display: inline-flex; align-items: center; gap: 6px; }
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--adm-ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--adm-ok) 18%, transparent);
}

/* Titleband controls */
.mobile-menu-btn, .tb-btn, .user-logout, .icon-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--adm-muted);
  cursor: pointer;
  transition: background var(--adm-motion), color var(--adm-motion);
}
.mobile-menu-btn:hover, .tb-btn:hover, .user-logout:hover, .icon-btn:hover {
  background: var(--adm-wash);
  color: var(--adm-text);
}
.mobile-menu-btn { display: none; }

.user-menu-wrap { position: relative; }
.user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 4px 6px;
  border-radius: var(--adm-radius-sm);
  cursor: pointer;
}
.user-profile:hover, .user-menu-wrap.open .user-profile { background: var(--adm-wash); }
.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--adm-accent) 16%, transparent);
  color: var(--adm-accent);
  font-size: 0.7rem;
  font-weight: 650;
  flex-shrink: 0;
}
.user-name { font-size: 0.82rem; color: var(--adm-muted); font-weight: 500; }

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 172px;
  padding: 5px;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-panel);
  box-shadow: var(--adm-shadow-2);
  z-index: 400;
}
.user-menu-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 9px 9px;
  border-bottom: 1px solid var(--adm-rule);
  margin-bottom: 5px;
}
.user-menu-head strong { font-size: 0.84rem; font-weight: 600; color: var(--adm-text); }
.user-menu-head .muted { font-size: 0.72rem; }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 5px;
  color: var(--adm-muted);
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
}
.user-menu-item:hover { background: var(--adm-wash); color: var(--adm-risk); }
.user-menu-item svg { flex-shrink: 0; }

.btn-mnemonic-reveal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  background: var(--adm-surface);
  color: var(--adm-muted);
  font-size: 0.8rem;
  cursor: pointer;
}
.btn-mnemonic-reveal:hover { border-color: var(--adm-border-strong); color: var(--adm-text); }
.btn-mnemonic-reveal.revealed {
  border-color: color-mix(in srgb, var(--adm-warn) 40%, var(--adm-border));
  background: color-mix(in srgb, var(--adm-warn) 10%, transparent);
  color: var(--adm-warn);
}

/* ── 4. Controls ──────────────────────────────────────────────────────── */
button, input, select, textarea { font: inherit; }

.btn, a.btn, input[type='submit'],
button:where(:not(.copy-btn):not(.mobile-menu-btn):not(.tb-btn):not(.icon-btn):not(.user-logout):not(.seg button):not(.btn-mnemonic-reveal):not(.tab-btn):not(.swal2-styled)) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--adm-control);
  padding: 0 13px;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-panel);
  color: var(--adm-text);
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--adm-motion), border-color var(--adm-motion), color var(--adm-motion);
}
.btn:hover, a.btn:hover, input[type='submit']:hover,
button:where(:not(.copy-btn):not(.mobile-menu-btn):not(.tb-btn):not(.icon-btn):not(.user-logout):not(.seg button):not(.btn-mnemonic-reveal):not(.tab-btn):not(.swal2-styled)):hover {
  background: var(--adm-surface-2);
  border-color: var(--adm-border-strong);
  text-decoration: none;
}
.btn.ghost, a.btn.ghost, button.btn.ghost {
  background: var(--adm-surface);
  border-color: var(--adm-border);
  color: var(--adm-text);
}
.btn.ghost:hover, a.btn.ghost:hover, button.btn.ghost:hover { background: var(--adm-surface-2); border-color: var(--adm-border-strong); }
.btn.danger, button.danger, button.btn.danger {
  background: color-mix(in srgb, var(--adm-risk) 8%, transparent);
  border-color: color-mix(in srgb, var(--adm-risk) 32%, var(--adm-border));
  color: var(--adm-risk);
}
.btn.danger:hover, button.danger:hover, button.btn.danger:hover {
  background: color-mix(in srgb, var(--adm-risk) 15%, transparent);
  border-color: color-mix(in srgb, var(--adm-risk) 50%, var(--adm-border));
}
.btn.sm, a.btn.sm, button.btn.sm { height: 28px; padding: 0 10px; font-size: 0.79rem; white-space: nowrap; }
/* Action cluster in a table's last cell. */
.actions { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
/* A centered count with an optional badge beneath it. */
.cell-stack { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
/* Two lines in one cell, left aligned. */
.cell-stack-start { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; }
/* Compact per-row asset counts: value over label. */
.cell-metrics { display: inline-flex; align-items: flex-end; gap: 14px; }
.cell-metrics > span { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.25; }
.cell-metrics > span > b { font-size: 0.86rem; font-weight: 650; }
.cell-metrics > span > small {
  color: var(--adm-muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.cell-metrics > span.has-secret > b { color: var(--adm-ok); }
/* Truncated identifier: the full value stays in title and on the copy button. */
code.uuid { font-size: 0.78rem; letter-spacing: 0.01em; }

input:not([type]), input[type='text'], input[type='password'], input[type='search'], input[type='number'], select, textarea {
  height: var(--adm-control);
  padding: 0 11px;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface);
  color: var(--adm-text);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--adm-motion), box-shadow var(--adm-motion);
}
textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  border-color: var(--adm-accent-line);
  box-shadow: 0 0 0 3px var(--adm-accent-wash);
}
::placeholder { color: var(--adm-subtle); }

.seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  background: var(--adm-surface);
}
.seg button {
  height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--adm-muted);
  font-size: 0.78rem;
  font-weight: 550;
  cursor: pointer;
}
.seg button.on {
  background: var(--adm-page);
  color: var(--adm-text);
  box-shadow: var(--adm-shadow-1);
}

/* ── 5. Surfaces ──────────────────────────────────────────────────────── */
.card, .filter-card, .adm-card {
  margin-bottom: 12px;
  padding: 16px 18px;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  background: var(--adm-panel);
  box-shadow: var(--adm-shadow-1);
}
.filter-card { padding: 11px 13px; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.006em;
}
.card-title svg { color: var(--adm-accent); flex: none; }
.card-subtitle { margin: -8px 0 14px; font-size: 0.83rem; color: var(--adm-muted); }

/* Page head — flat masthead: title left, no decorative frame. */
.page-head {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.page-head h1 { font-size: 1.4rem; }
.page-head .adm-meta {
  margin: 0 0 0.35em;
  color: var(--adm-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.page-head .adm-lede { margin: 0.5em 0 0; max-width: 60em; font-size: 0.94rem; color: var(--adm-muted); }

/* ── 6. Data views ────────────────────────────────────────────────────── */
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
table, .table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.5;
}
.table { margin: 0; }
/* Data cells stay on one line; the wrapper scrolls instead of squeezing a
   column into a wrapped stack. */
.table th, .table td { white-space: nowrap; }
.table td .cell-sub, .table td.wrap { white-space: normal; }
th, td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--adm-rule);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: break-word;
}
th {
  border-bottom-color: var(--adm-border);
  color: var(--adm-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: var(--adm-side-bg);
}
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
tbody tr:last-child > td { border-bottom: 0; }
tbody tr { transition: background var(--adm-motion); }
tbody tr:hover > td { background: var(--adm-wash); }

/* Table footer holding pagination under the last row. */
.table-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--adm-rule);
}
.table-foot:has(.pager:empty) { display: none; }
.card.is-flush tbody tr:last-child > td { border-bottom: 0; }
.table-foot > .pager { padding-top: 0; }

/* Small stacked cell text (a value with a secondary line under it). */
.cell-sub { font-size: 0.79rem; color: var(--adm-muted); }

/* Inline block-explorer jump from an address cell. */
.addr-explorer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.74rem;
  color: var(--adm-info);
  text-decoration: none;
  opacity: 0.85;
}
.addr-explorer:hover { opacity: 1; text-decoration: underline; }
.addr-explorer > svg { flex: 0 0 auto; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.center { text-align: center; }
.right { text-align: right; }

/* Search field with a leading icon. */
.field-icon { position: relative; display: block; min-width: 0; }
.field-icon > input { width: 100%; padding-left: 32px; }
.field-icon > svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--adm-subtle);
  pointer-events: none;
}
.filter-card .row > select { min-width: 0; }

/* Status: a dot plus a word, tinted toward the text color. */
.badge, .ui-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--adm-muted);
  font-size: 0.8rem;
  font-weight: 550;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.ui-status-badge .ui-status-dot { width: 6px; height: 6px; background: currentColor; }
.badge.on, .badge.done, .ui-status-badge.tone-success { color: var(--adm-ok); }
.badge.off { color: var(--adm-muted); }
.badge.pending, .ui-status-badge.tone-warning { color: var(--adm-warn); }
.badge.likely, .badge.sent { color: var(--adm-accent); }
.badge.coruna { color: var(--adm-info); }
.badge.darksword { color: var(--adm-accent-2); }
.badge.risk, .ui-status-badge.tone-danger { color: var(--adm-risk); }

/* Card that is nothing but a table: no inner padding, footer carries the rest. */
.card.is-flush { padding: 0; overflow: hidden; }
/* Head strip inside a flush card. */
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--adm-rule);
}
.card-head > .card-title { margin: 0; }
/* Head strip inside a padded card bleeds to the card edges, so its rule and title
   line up with the card boundary instead of stacking a second inset. */
.card:not(.card-hero):not(.is-flush) > .card-head { margin: -16px -18px 16px; }

/* Two-pane work surface: a narrow form beside a wide list. */
.split {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.split > .card { margin-bottom: 0; }
@media (max-width: 1080px) { .split { grid-template-columns: minmax(0, 1fr); } }
/* Command desk: the two panes share the width more evenly. */
.split-wide { grid-template-columns: minmax(320px, 1fr) minmax(340px, 1.2fr); }
@media (max-width: 1180px) { .split-wide { grid-template-columns: minmax(0, 1fr); } }

/* Labelled field with breathing room between stacked controls. */
.field-block { margin-bottom: 14px; }
.field-block > .kv-label { display: block; margin-bottom: 6px; }

/* Group Administrator row in the channel list. */
tr.is-self > td { background: var(--adm-accent-wash); }
/* One wallet paired with its credential block inside a framework section. */
.wallet-pair {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--adm-rule);
  border-radius: 10px;
  background: var(--adm-wash);
}
.wallet-pair > :last-child { margin-bottom: 0; }
.tg-col { min-width: 250px; }
.tg-inline-form input[type='password'],
.tg-inline-form input[type='text'] { height: 28px; width: 132px; font-size: 0.78rem; }
.tg-inline-form input[name='tg_chat_id'] { width: 104px; }
.promo-url { display: inline-block; max-width: 210px; }
.promo-url-wide { display: inline-block; max-width: 420px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
/* Single-purpose card that should not stretch across a wide stage. */
.card.narrow { max-width: 440px; }

/* Tone chip for metadata. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--adm-tone, var(--adm-muted)) 14%, transparent);
  color: color-mix(in srgb, var(--adm-tone, var(--adm-muted)) 88%, var(--adm-text));
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.7;
  white-space: nowrap;
}

/* Callout (report) — also the error / success surface. */
.adm-callout, .err-alert, .notice-ok {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--adm-tone, var(--adm-muted)) 26%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--adm-tone, var(--adm-muted)) 7%, transparent);
  color: color-mix(in srgb, var(--adm-tone, var(--adm-muted)) 88%, var(--adm-text));
  font-size: 0.86rem;
}
.adm-callout svg, .err-alert svg, .notice-ok svg { flex: none; margin-top: 1px; }
.err-alert { --adm-tone: var(--adm-risk); }
.notice-ok { --adm-tone: var(--adm-ok); }

/* Stats grid (report) */
.adm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.adm-card, .adm-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 13px 15px;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  background: var(--adm-surface);
  box-shadow: var(--adm-shadow-1);
}
.adm-stat > span, .adm-stat > small {
  color: var(--adm-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.adm-stat > strong, .adm-stat > b {
  font-size: 1.6em;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.adm-stat[data-tone] > strong, .adm-stat[data-tone] > b { color: var(--adm-tone); }

/* Key/value list (report) */
.adm-kv, .kv-grid {
  display: grid;
  grid-template-columns: minmax(5.5em, max-content) minmax(0, 1fr);
  gap: 9px 20px;
  margin: 0;
}
.adm-kv > dt, .kv-label {
  color: var(--adm-muted);
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.7;
}
.adm-kv > dd, .kv-val { min-width: 0; margin: 0; font-size: 0.86rem; }

/* Tabs — a segmented control, not an underline bar. */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 16px;
  padding: 3px;
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  background: var(--adm-surface);
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 7px;
  color: var(--adm-muted);
  font-size: 0.82rem;
  font-weight: 550;
  transition: background var(--adm-motion), color var(--adm-motion);
}
.tabs a:hover { background: var(--adm-wash); color: var(--adm-text); text-decoration: none; }
.tabs a.on {
  background: var(--adm-page);
  color: var(--adm-text);
  box-shadow: var(--adm-shadow-1);
}
.tab-count {
  padding: 0 6px;
  border-radius: 999px;
  background: var(--adm-wash);
  color: var(--adm-muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
}
.tabs a.on .tab-count { background: color-mix(in srgb, var(--adm-accent) 14%, transparent); color: var(--adm-accent); }

/* Pagination — covers the app's own markup and both Bootstrap shapes
   ThinkPHP's paginator can emit. */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.table-foot > .pager { padding-top: 0; }
.pager > a, .pager > span,
.pager ul, .pager ol { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 0; padding: 0; list-style: none; }
.pager li { margin: 0; list-style: none; }
.pager a, .pager span, .pager li > a, .pager li > span, .pager .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--adm-border);
  border-radius: 7px;
  background: var(--adm-surface);
  color: var(--adm-muted);
  font-size: 0.79rem;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.pager a:hover { border-color: var(--adm-border-strong); color: var(--adm-text); text-decoration: none; }
.pager .active > span, .pager .active > a, .pager > span.current,
.pager li.active, .pager li.active > span, .pager li.active > a, .pager .page-item.active .page-link {
  border-color: transparent;
  background: var(--adm-accent);
  color: var(--adm-on-accent);
  font-weight: 600;
}
.pager .disabled > a, .pager .disabled > span, .pager .page-item.disabled .page-link,
.pager > span.disabled, .pager .page-link.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.pager > span.ellipsis {
  min-width: 22px;
  padding: 0 2px;
  border-color: transparent;
  background: transparent;
  color: var(--adm-subtle);
  pointer-events: none;
}

/* ── 7. Secrets, media, notes ─────────────────────────────────────────── */
.copy-wrap { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.copy-btn {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--adm-subtle);
  cursor: pointer;
  transition: background var(--adm-motion), color var(--adm-motion);
}
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn:hover { background: var(--adm-wash); color: var(--adm-text); }

.secret-box {
  margin: 9px 0;
  padding: 11px 13px;
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  background: var(--adm-wash);
}
.secret-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--adm-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* Label for one credential kind inside a secret box. */
.secret-tag {
  color: var(--adm-accent-2);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.secret-content {
  font-family: var(--adm-font-mono);
  font-size: 0.82rem;
  line-height: 1.62;
  color: var(--adm-text);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.wallet-fold { margin: 9px 0; }
.wallet-fold > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  color: var(--adm-text);
  font-size: 0.86rem;
  font-weight: 550;
  cursor: pointer;
}
.wallet-fold > summary::marker { color: var(--adm-muted); }

.asset-device {
  margin-bottom: 16px;
  padding: 14px 16px 8px;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  background: var(--adm-chrome);
  box-shadow: var(--adm-shadow-1);
}
.asset-device > .card { background: var(--adm-surface); }
.asset-device-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.asset-device-id { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.asset-device-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 13px;
}
.photo-item {
  overflow: hidden;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  background: var(--adm-surface);
  box-shadow: var(--adm-shadow-1);
  transition: border-color var(--adm-motion), box-shadow var(--adm-motion);
}
.photo-item:hover { border-color: var(--adm-border-strong); box-shadow: var(--adm-shadow-2); }
.photo-thumb { position: relative; display: block; aspect-ratio: 1; background: var(--adm-wash); }
.photo-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-scan-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--adm-page) 82%, transparent);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
}
.photo-meta { display: flex; flex-direction: column; gap: 5px; padding: 10px 11px 11px; font-size: 0.78rem; }

.note-list-tg { display: flex; flex-direction: column; gap: 7px; }
.note-row-tg {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  background: var(--adm-surface);
}
.note-row-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-row-meta { display: flex; align-items: center; gap: 9px; justify-content: flex-end; }
@media (max-width: 900px) {
  .note-row-tg { grid-template-columns: 1fr; }
  .note-row-meta { justify-content: flex-start; }
}

/* Monospace islands keep a sunken well instead of a flat tint. */
.json-block, .swal-json, .promo-iframe-snippet {
  display: block;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--adm-rule);
  border-radius: 8px;
  background: var(--adm-wash);
  color: var(--adm-text);
  font-family: var(--adm-font-mono);
  font-size: 0.8rem;
  line-height: 1.62;
  tab-size: 2;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.promo-iframe-snippet { font-size: 0.74rem; }
.money { color: var(--adm-info); font-weight: 650; }
.apps-all { display: none; }
.apps-all.show { display: block; }

/* ── 8. shell components (ported as-is) ─────────────────────────────────── */
.adm-hero { margin: 0 0 1.7em; }
.adm-steps, .adm-checklist { margin: 1.3em 0; padding: 0; list-style: none; }
.adm-steps { counter-reset: adm-step; }
.adm-steps > li {
  position: relative;
  min-height: 26px;
  margin: 0;
  padding: 2px 0 1.25em 40px;
  counter-increment: adm-step;
}
.adm-steps > li:last-child { padding-bottom: 0; }
.adm-steps > li::before {
  content: counter(adm-step);
  position: absolute;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--adm-line);
  border-radius: 50%;
  background: var(--adm-surface);
  color: var(--adm-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 23px;
  text-align: center;
}
.adm-steps > li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 31px;
  bottom: 5px;
  left: 12.25px;
  width: 1.5px;
  border-radius: 1px;
  background: var(--adm-rule);
}
.adm-steps > li[data-state='done']:not(:last-child)::after {
  background: color-mix(in srgb, var(--adm-ok) 45%, transparent);
}
.adm-steps > li[data-state='done']::before {
  content: '✓';
  border-color: color-mix(in srgb, var(--adm-ok) 55%, transparent);
  background: color-mix(in srgb, var(--adm-ok) 15%, var(--adm-surface));
  color: var(--adm-ok);
}
.adm-steps > li[data-state='blocked']::before {
  content: '!';
  border-color: color-mix(in srgb, var(--adm-risk) 55%, transparent);
  background: color-mix(in srgb, var(--adm-risk) 15%, var(--adm-surface));
  color: var(--adm-risk);
}
.adm-steps > li[data-state='current']::before {
  border-color: var(--adm-accent);
  color: var(--adm-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--adm-accent) 16%, transparent);
}
.adm-steps > li:not([data-state]) { color: var(--adm-muted); }
.adm-steps > li small { display: block; margin-top: 0.1em; color: var(--adm-muted); font-size: 0.86em; font-weight: 400; }

.adm-checklist > li { position: relative; margin: 0; padding: 0.32em 0 0.32em 28px; }
.adm-checklist > li::before {
  content: '';
  position: absolute;
  top: 0.5em;
  left: 0;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--adm-line);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
.adm-checklist > li[data-state='done']::before {
  content: '✓';
  border-color: color-mix(in srgb, var(--adm-ok) 55%, transparent);
  background: color-mix(in srgb, var(--adm-ok) 15%, var(--adm-surface));
  color: var(--adm-ok);
}
.adm-checklist > li[data-state='blocked']::before {
  content: '✕';
  border-color: color-mix(in srgb, var(--adm-risk) 55%, transparent);
  background: color-mix(in srgb, var(--adm-risk) 15%, var(--adm-surface));
  color: var(--adm-risk);
}
.adm-checklist > li[data-state='current']::before {
  content: '•';
  border-color: color-mix(in srgb, var(--adm-accent) 55%, transparent);
  background: color-mix(in srgb, var(--adm-accent) 15%, var(--adm-surface));
  color: var(--adm-accent);
}
.adm-checklist > li[data-state='done'] { color: var(--adm-muted); }

.adm-progress {
  --adm-progress: var(--adm-accent);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  align-items: baseline;
  margin: 0.95em 0;
  font-size: 0.93em;
}
.adm-progress[data-tone] { --adm-progress: var(--adm-tone); }
.adm-progress > b, .adm-progress > strong, .adm-progress > output { font-weight: 650; }
.adm-progress > progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--adm-text) 8%, transparent);
  appearance: none;
  -webkit-appearance: none;
}
.adm-progress > progress::-webkit-progress-bar { border-radius: 999px; background: transparent; }
.adm-progress > progress::-webkit-progress-value { border-radius: 999px; background: var(--adm-progress); }
.adm-progress > progress::-moz-progress-bar { border-radius: 999px; background: var(--adm-progress); }

.adm-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
  gap: 12px;
  align-items: stretch;
  margin: 1.3em 0;
}
.adm-compare > * {
  min-width: 0;
  margin: 0;
  padding: 1em 1.15em;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  background: var(--adm-surface);
}
.adm-compare > [data-pick] {
  border-color: color-mix(in srgb, var(--adm-accent) 55%, transparent);
  background: color-mix(in srgb, var(--adm-accent) 5%, var(--adm-surface));
  box-shadow: inset 0 3px 0 var(--adm-accent), var(--adm-shadow-2);
}
.adm-compare > * > h2, .adm-compare > * > h3, .adm-compare > * > h4 { margin: 0 0 0.45em; font-size: 1.04em; }

.adm-matrix {
  width: 100%;
  margin: 1.3em 0;
  border-collapse: separate;
  border-spacing: 3px;
  font-size: 0.92em;
}
.adm-matrix th, .adm-matrix td {
  padding: 0.5em 0.65em;
  border: 0;
  border-radius: 6px;
  text-align: center;
  vertical-align: middle;
  background: none;
  font-size: inherit;
  letter-spacing: 0;
}
.adm-matrix thead th { color: var(--adm-muted); font-size: 0.88em; white-space: nowrap; }
.adm-matrix tbody th { width: 1%; padding-left: 0; color: var(--adm-text); text-align: left; white-space: nowrap; }
.adm-matrix td { background: color-mix(in srgb, var(--adm-text) 4%, transparent); }
.adm-matrix td[data-tone] {
  background: color-mix(in srgb, var(--adm-tone) 17%, transparent);
  color: color-mix(in srgb, var(--adm-tone) 72%, var(--adm-text));
  font-weight: 600;
}

[data-trend]::before { margin-right: 0.28em; font-size: 0.82em; }
[data-trend='up']::before { content: '▲'; }
[data-trend='down']::before { content: '▼'; }
[data-trend='flat']::before { content: '—'; }
[data-trend][data-tone] { color: var(--adm-tone); }

/* ── 9. shell diagrams (ported as-is) ───────────────────────────────────── */
.adm-flow, .adm-timeline, .adm-tree, .adm-tree ul { margin: 0; padding: 0; list-style: none; }
.adm-flow, .adm-timeline, .adm-tree { margin: 1.3em 0; --adm-diagram-line: var(--adm-line); --adm-diagram-rule: var(--adm-rule); }

.adm-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px 36px; }
.adm-flow > li, .adm-lanes td > p, .adm-lanes td > div {
  margin: 0;
  padding: 0.62em 0.9em;
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  background: var(--adm-surface);
  box-shadow: var(--adm-shadow-1);
  overflow-wrap: break-word;
}
.adm-flow > li[data-tone], .adm-lanes td > p[data-tone] {
  border-color: color-mix(in srgb, var(--adm-tone) 38%, var(--adm-border));
  background:
    linear-gradient(var(--adm-tone), var(--adm-tone)) 0 0 / 3px 100% no-repeat,
    color-mix(in srgb, var(--adm-tone) 8%, var(--adm-surface));
}
.adm-flow > li { position: relative; display: flex; flex: 1 1 7.5rem; flex-direction: column; justify-content: center; min-width: 0; }
.adm-flow > li[data-kind='decision'] {
  align-items: center;
  border-style: dashed;
  border-color: var(--adm-line);
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  padding-inline: 1.2em;
  text-align: center;
}
.adm-flow > li + li::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -29px;
  width: 21px;
  border-top: 1.5px solid var(--adm-line);
  transform: translateY(-50%);
}
.adm-flow > li + li::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -15px;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid var(--adm-line);
  border-right: 1.5px solid var(--adm-line);
  transform: translateY(-50%) rotate(45deg);
}
.adm-flow[data-dir='down'] { flex-direction: column; flex-wrap: nowrap; gap: 30px; }
.adm-flow[data-dir='down'] > li { flex: 0 0 auto; }
.adm-flow[data-dir='down'] > li + li::before {
  top: -25px; left: 50%; width: 0; height: 19px; border-top: 0;
  border-left: 1.5px solid var(--adm-line); transform: translateX(-50%);
}
.adm-flow[data-dir='down'] > li + li::after { top: -13px; left: 50%; transform: translateX(-50%) rotate(135deg); }
.adm-flow > li small, .adm-timeline > li small {
  display: block;
  margin-top: 0.15em;
  color: var(--adm-muted);
  font-size: 0.84em;
  font-weight: 400;
}

.adm-lanes {
  width: 100%;
  margin: 1.3em 0;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  counter-reset: adm-phase;
  font-size: 0.93em;
}
.adm-lanes th, .adm-lanes td {
  padding: 0.7em 0.75em;
  border: 0;
  border-bottom: 1px solid var(--adm-rule);
  border-left: 1px dashed var(--adm-rule);
  text-align: left;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: break-word;
}
.adm-lanes tr > :first-child { border-left: 0; padding-left: 1em; }
.adm-lanes tr > :nth-child(2) { border-left-style: solid; }
.adm-lanes tbody tr:last-child > * { border-bottom: 0; }
.adm-lanes thead th {
  padding-block: 0.6em;
  background: var(--adm-wash);
  color: var(--adm-muted);
  font-size: 0.86em;
  font-weight: 600;
  white-space: nowrap;
}
.adm-lanes thead th:not(:first-child)::before {
  content: counter(adm-phase);
  counter-increment: adm-phase;
  display: inline-block;
  min-width: 1.55em;
  margin-right: 0.5em;
  border-radius: 999px;
  background: color-mix(in srgb, var(--adm-text) 9%, transparent);
  color: var(--adm-text);
  font-size: 0.92em;
  text-align: center;
}
.adm-lanes tbody th {
  width: 1%;
  background: var(--adm-wash);
  color: var(--adm-text);
  font-size: 1em;
  font-weight: 650;
  white-space: nowrap;
}
.adm-lanes thead tr:first-child > :first-child { border-top-left-radius: 11px; }
.adm-lanes thead tr:first-child > :last-child { border-top-right-radius: 11px; }
.adm-lanes tbody tr:last-child > :first-child { border-bottom-left-radius: 11px; }
.adm-lanes td > p, .adm-lanes td > div { min-width: 4.5em; padding: 0.45em 0.75em; border-radius: 8px; }

.adm-timeline > li { position: relative; margin: 0; padding: 0 0 1.25em 1.9em; }
.adm-timeline > li:last-child { padding-bottom: 0; }
.adm-timeline > li::before {
  content: '';
  position: absolute;
  top: 0.42em;
  left: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--adm-tone, var(--adm-muted));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--adm-tone, var(--adm-muted)) 18%, transparent);
}
.adm-timeline > li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: calc(0.42em + 17px);
  bottom: calc(-0.42em + 8px);
  left: 7px;
  width: 1.5px;
  border-radius: 1px;
  background: var(--adm-rule);
}
.adm-timeline time {
  display: block;
  margin-bottom: 0.1em;
  color: var(--adm-muted);
  font-size: 0.82em;
  letter-spacing: 0.02em;
}

.adm-tree > li { font-weight: 650; }
.adm-tree ul { margin-left: 0.45em; padding-left: 1.25em; font-weight: 400; }
.adm-tree li { position: relative; margin: 0; padding: 0.22em 0; }
.adm-tree ul > li::before {
  content: '';
  position: absolute;
  top: 0;
  left: -1.25em;
  width: 0.9em;
  height: 0.98em;
  border-bottom: 1px solid var(--adm-line);
  border-left: 1px solid var(--adm-line);
  border-bottom-left-radius: 5px;
}
.adm-tree ul > li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1.25em;
  border-left: 1px solid var(--adm-line);
}

/* ── 10. Empty state ──────────────────────────────────────────────────── */
.empty-state, .is-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  padding: 44px 24px;
  text-align: center;
  color: var(--adm-muted);
}
.empty-state-visual-inner {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 15px;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  background: var(--adm-surface);
  color: var(--adm-subtle);
  box-shadow: var(--adm-shadow-1);
}
.empty-state-title { margin: 0 0 6px; color: var(--adm-text); font-size: 0.98rem; font-weight: 650; }
.empty-state-copy { max-width: 34em; margin: 0; font-size: 0.84rem; }

/* ── 11. Login ────────────────────────────────────────────────────────── */
.login-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--adm-page);
}
.login-box {
  width: 100%;
  max-width: 372px;
  padding: 28px 26px 24px;
  border: 1px solid color-mix(in srgb, var(--adm-accent) 20%, transparent);
  border-radius: var(--adm-radius-lg);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--adm-accent) 12%, transparent),
    color-mix(in srgb, var(--adm-accent-2) 5%, transparent) 60%,
    var(--adm-surface));
  box-shadow: var(--adm-shadow-2);
}
.login-header { margin-bottom: 22px; text-align: center; }
.logo-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 13px;
  border-radius: var(--adm-radius-lg);
  background: var(--adm-accent);
  color: var(--adm-on-accent);
  box-shadow: var(--adm-shadow-1);
}
.login-box h1 { margin: 0 0 4px; font-size: 1.28rem; }
.login-box > .login-header p { margin: 0; color: var(--adm-muted); font-size: 0.82rem; }
.login-field { margin-bottom: 13px; }
.login-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--adm-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.login-field input { width: 100%; }
.login-box button[type='submit'] { width: 100%; margin-top: 7px; }

/* ── 12. Overlays ─────────────────────────────────────────────────────── */
#adm-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  background: var(--adm-surface-2);
  color: var(--adm-text);
  box-shadow: var(--adm-shadow-2);
  font-size: 0.86rem;
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
#adm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.swal2-popup {
  border: 1px solid var(--adm-border) !important;
  border-radius: var(--adm-radius-lg) !important;
  background: var(--adm-panel) !important;
  color: var(--adm-text) !important;
  box-shadow: var(--adm-shadow-2) !important;
  font-family: var(--adm-font) !important;
}
:root[data-theme='dark'] .swal2-popup {
  border-color: var(--adm-border) !important;
}
.swal2-backdrop-show {
  backdrop-filter: blur(5px) !important;
  background: var(--adm-scrim) !important;
}
.badge svg {
  width: 12px;
  height: 12px;
  display: inline-block;
  vertical-align: -1px;
  flex-shrink: 0;
}
.swal2-title { color: var(--adm-text) !important; font-size: 1.1rem !important; }
.swal2-html-container { color: var(--adm-muted) !important; }
.swal2-input, .swal2-textarea, .swal2-select {
  background: var(--adm-surface) !important;
  color: var(--adm-text) !important;
  border: 1px solid var(--adm-border) !important;
  border-radius: var(--adm-radius-sm) !important;
}
.swal2-confirm {
  background: var(--adm-accent) !important;
  color: var(--adm-on-accent) !important;
  border-radius: var(--adm-radius-sm) !important;
}
.adm-swal-danger .swal2-confirm {
  background: var(--adm-risk) !important;
  color: var(--adm-on-accent) !important;
}
.swal2-cancel {
  background: var(--adm-surface) !important;
  color: var(--adm-text) !important;
  border: 1px solid var(--adm-border) !important;
  border-radius: var(--adm-radius-sm) !important;
}
.swal-json .jk { color: var(--adm-info); }
.swal-json .js { color: var(--adm-ok); }
.swal-json .jn { color: var(--adm-warn); }
.swal-json .jl { color: var(--adm-series-4); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: color-mix(in srgb, var(--adm-page) 55%, transparent);
  backdrop-filter: blur(2px);
}
.sidebar-backdrop.show { display: block; }

/* ── 13. Responsive ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app, .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'tb' 'stage'; }
  .side {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: min(276px, 86vw);
    height: 100vh;
    background: var(--adm-page);
    transform: translateX(-102%);
    transition: transform 200ms ease;
  }
  .side.open { transform: none; box-shadow: var(--adm-shadow-2); }
  .mobile-menu-btn { display: grid; }
  .user-name { display: none; }
  .content-body { padding: 16px 14px 32px; }
  .page-head { padding: 15px 16px; }
  .adm-flow { gap: 12px 34px; }
}

@media (max-width: 640px) {
  .tb-crumb .muted { display: none; }
  .btn-mnemonic-reveal span { display: none; }
  .btn-mnemonic-reveal { padding: 0 8px; height: 28px; }
  .user-profile .chip { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .date-filter-bar { flex-direction: column; align-items: stretch; }
  .date-presets { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── 14. Modern V2.7 Enhancements (High-Usability & Aesthetics) ──────── */

/* Pulsing Online / Offline Status Dot */
.status-dot.online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--adm-ok);
  box-shadow: 0 0 0 0 rgba(31, 157, 107, 0.7);
  animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(31, 157, 107, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(31, 157, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 157, 107, 0); }
}
.status-dot.offline {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--adm-muted);
  opacity: 0.45;
}

/* Interactive Copyable Pill */
.copy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--adm-wash);
  border: 1px solid var(--adm-rule);
  font-family: var(--adm-font-mono);
  font-size: 0.82rem;
  color: var(--adm-text);
  line-height: 1.25;
  transition: all var(--adm-motion);
  cursor: pointer;
  user-select: all;
}
.copy-pill:hover {
  border-color: var(--adm-border-strong);
  background: var(--adm-surface-2);
}
.copy-pill .copy-icon {
  color: var(--adm-subtle);
  flex-shrink: 0;
  transition: color var(--adm-motion);
}
.copy-pill:hover .copy-icon {
  color: var(--adm-accent);
}

/* Exploitation Chain Badges */
.badge.coruna {
  background: color-mix(in srgb, var(--adm-info) 14%, transparent);
  color: var(--adm-info);
  border: 1px solid color-mix(in srgb, var(--adm-info) 30%, transparent);
}
.badge.darksword {
  background: color-mix(in srgb, var(--adm-accent-2) 14%, transparent);
  color: var(--adm-accent-2);
  border: 1px solid color-mix(in srgb, var(--adm-accent-2) 30%, transparent);
}
.badge.app {
  background: color-mix(in srgb, #9333ea 14%, transparent);
  color: #a855f7;
  border: 1px solid color-mix(in srgb, #9333ea 30%, transparent);
}
.badge.has-wallet {
  background: color-mix(in srgb, var(--adm-ok) 14%, transparent);
  color: var(--adm-ok);
  border: 1px solid color-mix(in srgb, var(--adm-ok) 30%, transparent);
}
.badge.no-wallet {
  background: var(--adm-wash);
  color: var(--adm-muted);
  border: 1px solid var(--adm-rule);
}
.badge.collectable {
  background: color-mix(in srgb, var(--adm-ok) 18%, transparent);
  color: var(--adm-ok);
  font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--adm-ok) 40%, transparent);
}

/* KPI Card Grid: 6 列一排完美对齐，不再 4+3 缺角 */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  box-shadow: var(--adm-shadow-1);
  transition: transform var(--adm-motion), box-shadow var(--adm-motion), border-color var(--adm-motion);
}
.kpi-card:hover {
  border-color: var(--adm-border-strong);
  box-shadow: var(--adm-shadow-2);
  transform: translateY(-1px);
}
/* Dashboard tiles double as shortcuts; keep them looking like cards, not links. */
a.kpi-card { color: inherit; text-decoration: none; cursor: pointer; }
a.kpi-card:focus-visible { outline: 2px solid var(--adm-accent); outline-offset: 2px; }
.kpi-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kpi-card-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--adm-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.kpi-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--adm-wash);
  color: var(--adm-accent);
}
.kpi-card-val {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--adm-text);
}
.kpi-card-sub {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--adm-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Date Preset Pills */
.date-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid var(--adm-border);
  background: var(--adm-surface);
}
.date-presets {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  background: var(--adm-wash);
}
.date-presets button {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--adm-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--adm-motion);
}
.date-presets button:hover {
  color: var(--adm-text);
}
.date-presets button.on {
  background: var(--adm-accent);
  color: var(--adm-on-accent);
  font-weight: 600;
  box-shadow: var(--adm-shadow-1);
}

/* Balances Matrix */
.balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.balance-item {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--adm-border);
  background: var(--adm-wash);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.balance-item .coin-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--adm-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.balance-item .coin-val {
  font-size: 1.15rem;
  font-weight: 650;
  font-family: var(--adm-font-mono);
  color: var(--adm-text);
}
.balance-item.has-money {
  border-color: color-mix(in srgb, var(--adm-ok) 40%, transparent);
  background: color-mix(in srgb, var(--adm-ok) 8%, var(--adm-wash));
}
.balance-item.has-money .coin-val {
  color: var(--adm-ok);
}

/* Filter Card Bar */
.filter-card-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  background: var(--adm-surface);
}
.filter-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 170px;
  flex: 1;
}
.filter-input-wrap svg {
  position: absolute;
  left: 10px;
  color: var(--adm-subtle);
  pointer-events: none;
}
.filter-input-wrap input {
  width: 100%;
  padding-left: 32px;
  height: 32px;
}
.filter-select {
  height: 32px;
  padding: 0 10px;
  min-width: 110px;
}

/* Device Hero Card */
.dev-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 860px) {
  .dev-hero { grid-template-columns: 1fr; }
}
.dev-hero-main {
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--adm-border);
  background: var(--adm-surface);
  box-shadow: var(--adm-shadow-1);
}
.dev-hero-side {
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--adm-border);
  background: var(--adm-surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.dev-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dev-machine-badge {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--adm-text);
}
.dev-meta-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.dev-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dev-meta-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--adm-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dev-meta-val {
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--adm-text);
}

/* DarkSword Command Console */
.cmd-console {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--adm-border);
  background: var(--adm-surface);
  margin-bottom: 18px;
}
.cmd-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.cmd-form select, .cmd-form input {
  height: 34px;
  border-radius: 7px;
}
.cmd-form input {
  flex: 1;
  min-width: 220px;
}

/* Modal Address & Secret Inspection */
.modal-addrs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  text-align: left;
  padding: 4px;
}
.modal-addr-card {
  padding: 10px 14px;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  background: var(--adm-wash);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.modal-addr-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}


/* ── 钱包助记词获取方式着色 ────────────────────────────────────── */
.acq { display:inline-flex; align-items:center; gap:6px; font-weight:600; }
.acq > i { width:8px; height:8px; border-radius:50%; background:currentColor; flex:none; display:inline-block; }
.acq-pwd { color: var(--adm-risk); }
.acq-direct { color: var(--adm-ok); }
.acq-vault { color: var(--adm-warn); }
.acq-na { color: var(--adm-muted); }

/* ===== 访问记录：地区下钻 + 访客 IP 表 ===== */
.geo-list { display: flex; flex-direction: column; gap: 1px; }
.geo-group + .geo-group { border-top: 1px solid var(--adm-border); }
.geo-row {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) 108px 14px;
  gap: 10px; align-items: center; padding: 7px 6px; border-radius: 8px;
  cursor: pointer; transition: background 0.15s ease;
}
.geo-row:hover { background: var(--adm-surface-2); }
.geo-name {
  font-size: 0.82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.geo-bar { display: block; height: 8px; border-radius: 99px; background: var(--adm-surface-2); overflow: hidden; }
.geo-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--adm-accent); }
.geo-meta { font-size: 0.74rem; text-align: right; color: var(--adm-muted); }
.geo-chev { font-size: 0.7rem; color: var(--adm-muted); transition: transform 0.15s ease; }
.geo-row.open .geo-chev { transform: rotate(90deg); }
.geo-sub { padding: 2px 0 8px 6px; display: flex; flex-direction: column; gap: 2px; }
.geo-sub[hidden] { display: none; }
.geo-ip {
  display: grid; grid-template-columns: minmax(0, 1.3fr) 84px 130px 96px;
  gap: 8px; align-items: center; font-size: 0.78rem;
  padding: 4px 8px; border-left: 2px solid var(--adm-border);
}
.geo-filter { font-size: 0.74rem; color: var(--adm-accent); text-decoration: none; white-space: nowrap; }
.geo-filter:hover { text-decoration: underline; }

.ip-table { display: flex; flex-direction: column; }
.ip-tr {
  display: grid; grid-template-columns: 150px 120px 52px 52px 106px minmax(0, 1fr) 52px;
  gap: 10px; align-items: center; padding: 8px 10px; font-size: 0.8rem;
  border-top: 1px solid var(--adm-border);
}
.ip-th {
  border-top: 0; font-size: 0.72rem; letter-spacing: 0.04em;
  color: var(--adm-muted); font-weight: 600;
}
.ip-tr:not(.ip-th):hover { background: var(--adm-surface-2); }
.ip-addr { white-space: nowrap; font-weight: 600; }
.ip-region, .ip-who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  .geo-row { grid-template-columns: 92px minmax(0, 1fr) 88px 12px; gap: 8px; }
  .geo-ip { grid-template-columns: minmax(0, 1fr) 66px 96px; }
  .geo-ip .geo-filter { display: none; }
  .ip-tr { grid-template-columns: 112px minmax(0, 1fr) 42px 42px 44px; gap: 8px; }
  .ip-tr > *:nth-child(5), .ip-tr > *:nth-child(6) { display: none; }
}

/* 管理平台访问 tab：6 列的 IP 表 + tab 切换 */
.ip-table .ip-tr-6 { grid-template-columns: 150px 120px 64px 106px minmax(0, 1fr) 52px; }
.vtabs {
  display: inline-flex; gap: 4px; padding: 3px; margin-bottom: 16px;
  border: 1px solid var(--adm-border); border-radius: 10px; background: var(--adm-surface);
}
.vtab {
  padding: 6px 14px; border-radius: 8px; font-size: 0.82rem; font-weight: 600;
  color: var(--adm-muted); text-decoration: none; transition: background 0.15s ease, color 0.15s ease;
}
.vtab:hover { color: var(--adm-text); }
.vtab.on { background: var(--adm-accent); color: var(--adm-on-accent); }
@media (max-width: 900px) {
  .ip-table .ip-tr-6 { grid-template-columns: 112px minmax(0, 1fr) 42px 44px; }
  .ip-table .ip-tr-6 > *:nth-child(5) { display: none; }
}

/* ── Telegram 聊天记录页（#/tgchat） ─────────────────────────────── */
.tg-wrap { display: flex; height: calc(100dvh - 200px); min-height: 420px; }
.tg-side {
  width: 300px; flex: none; border-right: 1px solid var(--adm-border);
  display: flex; flex-direction: column; background: var(--adm-surface-2);
}
.tg-search { padding: 10px; border-bottom: 1px solid var(--adm-border); }
.tg-search input {
  width: 100%; box-sizing: border-box; height: 32px; padding: 0 10px;
  border: 1px solid var(--adm-border); border-radius: 8px; font-size: 0.82rem;
  background: var(--adm-surface); color: var(--adm-text); outline: none;
}
.tg-search input:focus { border-color: var(--adm-accent); }
.tg-list { flex: 1; overflow-y: auto; }
.tg-dlg {
  display: block; padding: 10px 12px; text-decoration: none; color: var(--adm-text);
  border-bottom: 1px solid var(--adm-border); transition: background 0.12s ease;
}
.tg-dlg:hover { background: var(--adm-surface); }
.tg-dlg.on { background: var(--adm-surface); box-shadow: inset 3px 0 0 var(--adm-accent); }
.tg-dlg-top { display: flex; align-items: center; gap: 6px; }
.tg-dlg-title { flex: 1; min-width: 0; font-weight: 600; font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-unread {
  flex: none; min-width: 18px; padding: 1px 5px; border-radius: 99px;
  background: var(--adm-accent); color: var(--adm-on-accent);
  font-size: 0.68rem; font-weight: 700; text-align: center;
}
.tg-kind {
  flex: none; font-size: 0.64rem; padding: 1px 5px; border-radius: 4px;
  background: var(--adm-surface); border: 1px solid var(--adm-border); color: var(--adm-muted);
}
.tg-kind-user { color: var(--adm-info); }
.tg-kind-chat { color: var(--adm-ok); }
.tg-kind-channel { color: var(--adm-accent-2); }
.tg-dlg-prev { display: flex; gap: 8px; margin-top: 3px; }
.tg-dlg-last {
  flex: 1; min-width: 0; font-size: 0.76rem; color: var(--adm-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tg-dlg-time { flex: none; font-size: 0.7rem; color: var(--adm-muted); }
.tg-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tg-pane-head {
  padding: 10px 16px; border-bottom: 1px solid var(--adm-border);
  font-weight: 650; font-size: 0.9rem; display: flex; align-items: center;
}
.tg-msgs {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px;
  background: var(--adm-surface-2);
}
.tg-msg {
  max-width: 72%; align-self: flex-start; padding: 8px 12px;
  border-radius: 12px 12px 12px 4px;
  background: var(--adm-surface); border: 1px solid var(--adm-border);
  font-size: 0.84rem; line-height: 1.5;
}
.tg-msg.tg-out {
  align-self: flex-end; border-radius: 12px 12px 4px 12px;
  background: var(--adm-accent); color: var(--adm-on-accent); border-color: transparent;
}
.tg-msg-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 2px; }
.tg-from { font-weight: 650; font-size: 0.78rem; }
.tg-out .tg-from { color: var(--adm-on-accent); opacity: 0.9; }
.tg-time { margin-left: auto; font-size: 0.68rem; color: var(--adm-muted); white-space: nowrap; }
.tg-out .tg-time { color: var(--adm-on-accent); opacity: 0.75; }
.tg-msg-body { white-space: pre-wrap; word-break: break-word; }
.tg-svc {
  align-self: center; font-size: 0.74rem; color: var(--adm-muted);
  padding: 3px 12px; border-radius: 99px; background: var(--adm-surface);
  border: 1px solid var(--adm-border);
}
@media (max-width: 860px) {
  .tg-wrap { flex-direction: column; height: auto; }
  .tg-side { width: 100%; border-right: 0; border-bottom: 1px solid var(--adm-border); max-height: 260px; }
  .tg-msgs { min-height: 320px; }
  .tg-msg { max-width: 88%; }
}

/* ── 20. Row action icons & primary action ─────────────────────────────
   Row-level delete/edit are icon-only: a bare 「删」 reads as a label, not a
   control, and it shifts width on every row. */
.btn.icon, a.btn.icon, button.btn.icon {
  width: 26px;
  height: 26px;
  padding: 0;
  justify-content: center;
  border-radius: 5px;
}
.btn.icon svg { width: 13.5px; height: 13.5px; }
.btn.icon.danger:hover, button.btn.icon.danger:hover {
  border-color: var(--adm-risk);
  color: var(--adm-risk);
  background: color-mix(in srgb, var(--adm-risk) 10%, transparent);
}

.btn.primary, a.btn.primary, button.btn.primary {
  background: var(--adm-accent);
  border-color: var(--adm-accent);
  color: var(--adm-on-accent);
}
.btn.primary:hover, a.btn.primary:hover, button.btn.primary:hover {
  background: var(--adm-accent);
  border-color: var(--adm-accent);
  color: var(--adm-on-accent);
  filter: brightness(1.07);
}

/* ── 21. Modal sub-form ────────────────────────────────────────────────
   Create/edit opens a focused dialog instead of a permanent inline form
   eating the top of every list page. */
.adm-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--adm-scrim);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.adm-modal-mask.open { opacity: 1; pointer-events: auto; }

.adm-modal {
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  background: var(--adm-panel);
  box-shadow: var(--adm-shadow-2);
  transform: translateY(6px) scale(0.99);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.adm-modal-mask.open .adm-modal { transform: none; }
.adm-modal.wide { max-width: 620px; }

.adm-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--adm-border);
}
.adm-modal-head h3 { font-size: 0.94rem; font-weight: 650; }
.adm-modal-head p { margin: 3px 0 0; font-size: 0.78rem; color: var(--adm-muted); }
.adm-modal-x {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--adm-muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}
.adm-modal-x:hover { background: var(--adm-wash); color: var(--adm-text); }

.adm-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.adm-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--adm-border);
  background: var(--adm-side-bg);
}

.adm-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adm-field-grid > .full { grid-column: 1 / -1; }
.adm-modal .field-block { margin: 0; }
.adm-modal .field-block > label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--adm-muted);
}
.adm-modal .field-block > .hint { margin-top: 4px; font-size: 0.72rem; color: var(--adm-muted); }
.adm-modal input, .adm-modal select, .adm-modal textarea { width: 100%; }
.adm-modal textarea { min-height: 140px; font-family: var(--adm-font-mono); font-size: 0.8rem; }
.adm-modal input[readonly] { color: var(--adm-muted); background: var(--adm-side-bg); }

/* Per-user permission override tri-state, inside the account dialog. */
.adm-perm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-side-bg);
}
.adm-perm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid var(--adm-rule);
  border-radius: 5px;
  background: var(--adm-panel);
  font-size: 0.75rem;
  color: var(--adm-text);
  cursor: pointer;
}
.adm-perm-item > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.adm-perm-item input[type='checkbox'] { margin: 0; accent-color: var(--adm-accent); }
.adm-perm-item select {
  width: 70px;
  height: 22px;
  padding: 0 4px;
  font-size: 0.72rem;
  border-radius: 4px;
}

.adm-modal .adm-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--adm-risk) 30%, transparent);
  border-radius: var(--adm-radius-sm);
  background: color-mix(in srgb, var(--adm-risk) 9%, transparent);
  color: var(--adm-risk);
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .adm-field-grid, .adm-perm-grid { grid-template-columns: 1fr; }
  .adm-modal { max-width: 100%; }
}

/* Solid destructive action: white on the light-mode risk red reads fine, but on
   the dark-mode orange it needs near-black text instead. */
:root { --adm-on-risk: #ffffff; }
:root[data-theme='dark'] { --adm-on-risk: #1c1917; }
.btn.danger-solid, a.btn.danger-solid, button.btn.danger-solid {
  background: var(--adm-risk);
  border-color: var(--adm-risk);
  color: var(--adm-on-risk);
}
.btn.danger-solid:hover, a.btn.danger-solid:hover, button.btn.danger-solid:hover {
  background: var(--adm-risk);
  border-color: var(--adm-risk);
  color: var(--adm-on-risk);
  filter: brightness(1.06);
}

/* ── Channel Assets (#/channel-assets) ─────────────────────────────────────── */
.ca-filters { gap: 8px; flex-wrap: wrap; }
.ca-filters .filter-select { min-width: 112px; width: auto; flex: 0 1 auto; }
.ca-filters .ca-date-input {
  height: 32px;
  padding: 0 10px;
  width: 126px;
  font-size: 0.78rem;
  font-family: var(--adm-font-mono);
}
.ca-filters .ca-filter-actions { display: inline-flex; gap: 6px; margin-left: auto; }

.ca-overview {
  margin-bottom: 16px;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  background: var(--adm-panel);
  overflow: hidden;
}
.ca-hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--adm-border);
  background: color-mix(in srgb, var(--adm-accent) 4%, var(--adm-panel));
}
.ca-hero-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ca-hero-label { font-size: 0.84rem; font-weight: 650; color: var(--adm-text); }
.ca-hero-sub { font-size: 0.74rem; color: var(--adm-muted); }
.ca-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.ca-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.ca-metric {
  padding: 14px 18px;
  border-right: 1px solid var(--adm-border);
  min-width: 0;
}
.ca-metric:last-child { border-right: none; }
.ca-metric-k { font-size: 0.74rem; color: var(--adm-muted); font-weight: 500; }
.ca-metric-v {
  margin-top: 4px;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.ca-metric-v.ok { color: var(--adm-ok); }
.ca-metric-v.warn { color: var(--adm-warn); }
.ca-metric-s { margin-top: 3px; font-size: 0.71rem; color: var(--adm-subtle); }

.ca-coins { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ca-coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--adm-border);
  background: var(--adm-surface-2);
  font-size: 0.75rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.ca-coin-pill strong { font-weight: 700; color: var(--adm-text); font-family: var(--adm-font-mono); }
.ca-coin-pill span { color: var(--adm-muted); font-weight: 600; font-size: 0.7rem; }

.ca-channel {
  margin-bottom: 14px;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  background: var(--adm-panel);
  overflow: hidden;
}
.ca-ch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--adm-border);
  background: var(--adm-surface);
}
.ca-ch-id { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ca-ch-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--adm-accent) 13%, transparent);
  color: var(--adm-accent);
  font-family: var(--adm-font-mono);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}
.ca-ch-stats { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--adm-muted); }
.ca-ch-list { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }

.ca-mn {
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface);
  transition: border-color 140ms ease;
}
.ca-mn[open] {
  border-color: var(--adm-border-strong);
  background: var(--adm-panel);
}
.ca-mn-sum {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  user-select: none;
}
.ca-mn-sum::-webkit-details-marker { display: none; }
.ca-mn-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ca-mn-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ca-chevron {
  display: inline-block;
  width: 14px;
  text-align: center;
  color: var(--adm-muted);
  font-size: 0.75rem;
  transition: transform 150ms ease;
}
.ca-mn[open] .ca-chevron { transform: rotate(90deg); color: var(--adm-accent); }

.ca-mn-body {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--adm-border);
  background: var(--adm-panel);
}
.ca-mn-secret {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface);
  border: 1px dashed var(--adm-border-strong);
}
.ca-row-dim { opacity: 0.54; }
.ca-row-dim:hover { opacity: 0.88; }

@media (max-width: 960px) {
  .ca-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ca-metric { border-bottom: 1px solid var(--adm-border); }
}
@media (max-width: 560px) {
  .ca-metrics { grid-template-columns: 1fr; }
  .ca-metric { border-right: none; }
  .ca-filters .ca-filter-actions { margin-left: 0; width: 100%; }
}


/* ── 相册识别：判定计数章 + 卡片网格 + 大图核对弹窗 ───────────────────────── */
.photo-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.pstat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 112px;
  padding: 11px 15px;
  border: 1px solid var(--adm-border);
  border-radius: 13px;
  background: var(--adm-surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--adm-shadow-1);
  transition: border-color var(--adm-motion), box-shadow var(--adm-motion);
}
.pstat:hover { border-color: var(--adm-border-strong); box-shadow: var(--adm-shadow-2); }
.pstat.on { border-color: var(--adm-accent); box-shadow: inset 0 0 0 1px var(--adm-accent); }
.pstat-n { font-size: 1.3rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pstat-l { font-size: 0.76rem; color: var(--adm-muted); }
.pstat.tone-warn .pstat-n { color: var(--adm-warn); }
.pstat.tone-accent .pstat-n { color: var(--adm-accent); }
.pstat.tone-info .pstat-n { color: var(--adm-info); }

.photo-item { cursor: pointer; }
.photo-thumb-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--adm-muted) 62%, transparent);
  background: var(--adm-wash);
}
.photo-thumb img { position: relative; z-index: 1; }
.photo-scan-badge { font-weight: 600; }
.photo-scan-badge.is-hit { color: var(--adm-accent); }
.photo-scan-badge.is-review { color: var(--adm-warn); }
.photo-scan-badge.is-pending { color: var(--adm-info); }
.photo-scan-badge.is-purged, .photo-scan-badge.is-done { color: var(--adm-muted); }
.photo-name { font-weight: 600; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-facts { font-size: 0.75rem; color: var(--adm-muted); }
.photo-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 0.74rem; color: var(--adm-muted); }
.photo-foot a { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--adm-accent); text-decoration: none; }
.photo-foot span { flex: 0 0 auto; white-space: nowrap; }

.pdet { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; gap: 16px; text-align: left; }
.pdet-shot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  overflow: hidden;
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  background: var(--adm-wash);
}
.pdet-img { display: block; width: 100%; max-height: 56vh; object-fit: contain; }
.pdet-noimg { padding: 28px 18px; font-size: 0.82rem; color: var(--adm-muted); text-align: center; line-height: 1.6; }
.pdet-facts { display: flex; flex-direction: column; gap: 7px; font-size: 0.82rem; }
.pdet-row { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px dashed var(--adm-border); }
.pdet-row span { color: var(--adm-muted); white-space: nowrap; }
.pdet-row b { font-weight: 600; text-align: right; word-break: break-all; }
.pdet-path { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.pdet-path span { color: var(--adm-muted); font-size: 0.76rem; }
.pdet-path code { padding: 7px 9px; border-radius: 8px; background: var(--adm-wash); font-size: 0.74rem; word-break: break-all; }
.pdet-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.photo-card-acts { margin-top: 6px; padding-top: 7px; border-top: 1px dashed var(--adm-border); display: flex; }
.photo-card-acts .btn { width: 100%; justify-content: center; height: 26px; font-size: 0.74rem; }
@media (max-width: 760px) { .pdet { grid-template-columns: 1fr; } }

/* ── 访问记录漏斗与未感染排查 (#/visits) ──────────────────────────────── */
.vf-overview {
  margin-bottom: 16px;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  background: var(--adm-panel);
  box-shadow: var(--adm-shadow-1);
  overflow: hidden;
}
.vf-hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border-bottom: 1px solid var(--adm-border);
  background: color-mix(in srgb, var(--adm-accent) 4%, var(--adm-panel));
}
.vf-hero-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vf-hero-title { font-size: 0.86rem; font-weight: 700; color: var(--adm-text); }
.vf-dedup-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--adm-accent);
  background: color-mix(in srgb, var(--adm-accent) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--adm-accent) 26%, transparent);
}
.vf-funnel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.vf-step {
  position: relative;
  padding: 15px 18px;
  border-right: 1px solid var(--adm-border);
  min-width: 0;
}
.vf-step:last-child {
  border-right: 0;
  background: color-mix(in srgb, var(--adm-risk) 5%, transparent);
}
.vf-step-k {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--adm-muted);
}
.vf-step-rate {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 600;
  background: var(--adm-wash);
  color: var(--adm-muted);
  font-variant-numeric: tabular-nums;
}
.vf-step-rate.is-ok {
  color: var(--adm-ok);
  background: color-mix(in srgb, var(--adm-ok) 13%, transparent);
}
.vf-step-rate.is-risk {
  color: var(--adm-risk);
  background: color-mix(in srgb, var(--adm-risk) 13%, transparent);
}
.vf-step-v {
  margin-top: 6px;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--adm-text);
}
.vf-step-v.tone-info { color: var(--adm-info); }
.vf-step-v.tone-accent { color: var(--adm-accent); }
.vf-step-v.tone-ok { color: var(--adm-ok); }
.vf-step-v.tone-risk { color: var(--adm-risk); }
.vf-step-s {
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--adm-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vf-step-arrow {
  position: absolute;
  right: -9px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--adm-panel);
  border: 1px solid var(--adm-border);
  color: var(--adm-muted);
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  z-index: 2;
}

.vf-mid-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 16px;
  align-items: stretch;
}
.vf-mid-grid > .card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}
.vf-ver-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.71rem;
  color: var(--adm-muted);
}
.vf-ver-legend span { display: inline-flex; align-items: center; gap: 4px; }
.vf-ver-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.vf-ver-list {
  padding: 6px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 316px;
  overflow-y: auto;
}
.vf-ver-head,
.vf-ver-row {
  display: grid;
  grid-template-columns: 102px minmax(136px, 1.3fr) 64px minmax(114px, 0.95fr) 104px;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
}
.vf-ver-head {
  padding: 7px 20px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--adm-muted);
  background: var(--adm-side-bg);
  border-bottom: 1px solid var(--adm-rule);
  white-space: nowrap;
}
.vf-ver-row {
  border-radius: 8px;
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--adm-motion), border-color var(--adm-motion);
}
.vf-ver-row.is-empty-eff { opacity: 0.62; }
.vf-ver-row.is-empty-eff:hover { opacity: 1; }
.vf-ver-row:hover { background: var(--adm-wash); text-decoration: none; }
.vf-ver-row.active {
  opacity: 1;
  background: color-mix(in srgb, var(--adm-accent) 9%, transparent);
  border-color: color-mix(in srgb, var(--adm-accent) 34%, transparent);
}
.vf-ver-id {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.vf-ver-num {
  font-family: var(--adm-font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--adm-text);
  white-space: nowrap;
}
.vf-fam-tag {
  font-family: var(--adm-font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  letter-spacing: 0.02em;
  flex: none;
}
.vf-fam-tag.darksword {
  color: var(--adm-accent-2);
  background: color-mix(in srgb, var(--adm-accent-2) 14%, transparent);
}
.vf-fam-tag.coruna {
  color: var(--adm-info);
  background: color-mix(in srgb, var(--adm-info) 14%, transparent);
}
.vf-ver-bar-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vf-ver-cell-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  line-height: 1.2;
}
.vf-ver-ch-hint {
  font-family: var(--adm-font-mono);
  font-size: 0.69rem;
  color: var(--adm-warn);
  white-space: nowrap;
}
.vf-bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--adm-wash);
  overflow: hidden;
  display: flex;
}
.vf-bar-ok { background: var(--adm-ok); height: 100%; flex: 0 0 auto; }
.vf-bar-chain { background: var(--adm-warn); height: 100%; flex: 0 0 auto; }
.vf-bar-rest { background: color-mix(in srgb, var(--adm-risk) 48%, transparent); height: 100%; flex: 0 0 auto; }
.vf-ver-rate {
  text-align: right;
  font-family: var(--adm-font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vf-pill.none {
  color: var(--adm-muted);
  background: transparent;
  border-color: transparent;
}
.vf-ver-counts {
  text-align: left;
  font-family: var(--adm-font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vf-ver-counts strong { color: var(--adm-ok); font-weight: 700; }
.vf-ver-counts strong.is-zero { color: var(--adm-muted); font-weight: 600; }
.vf-ver-counts span { color: var(--adm-muted); font-size: 0.71rem; }
.vf-ver-dwell-col { text-align: right; }
.vf-excl-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.vf-mtag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: var(--adm-font-mono);
  font-size: 0.69rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  border: 1px solid transparent;
}
.vf-mtag.warn {
  color: var(--adm-warn);
  background: color-mix(in srgb, var(--adm-warn) 11%, transparent);
  border-color: color-mix(in srgb, var(--adm-warn) 24%, transparent);
}
.vf-mtag.sub {
  color: var(--adm-muted);
  background: var(--adm-wash);
  border-color: var(--adm-border);
}

/* 软语义胶囊（无额外圆点、明暗自适应） */
.vf-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  border: 1px solid transparent;
}
.vf-pill.coruna {
  color: var(--adm-info);
  background: color-mix(in srgb, var(--adm-info) 12%, transparent);
  border-color: color-mix(in srgb, var(--adm-info) 26%, transparent);
}
.vf-pill.darksword {
  color: var(--adm-accent-2);
  background: color-mix(in srgb, var(--adm-accent-2) 12%, transparent);
  border-color: color-mix(in srgb, var(--adm-accent-2) 26%, transparent);
}
.vf-pill.fail {
  color: var(--adm-risk);
  background: color-mix(in srgb, var(--adm-risk) 12%, transparent);
  border-color: color-mix(in srgb, var(--adm-risk) 26%, transparent);
}
.vf-pill.warn {
  color: var(--adm-warn);
  background: color-mix(in srgb, var(--adm-warn) 12%, transparent);
  border-color: color-mix(in srgb, var(--adm-warn) 28%, transparent);
}
.vf-pill.prog, .vf-pill.info {
  color: var(--adm-info);
  background: color-mix(in srgb, var(--adm-info) 11%, transparent);
  border-color: color-mix(in srgb, var(--adm-info) 24%, transparent);
}
.vf-pill.ok {
  color: var(--adm-ok);
  background: color-mix(in srgb, var(--adm-ok) 12%, transparent);
  border-color: color-mix(in srgb, var(--adm-ok) 28%, transparent);
}
.vf-pill.visit {
  color: var(--adm-accent);
  background: color-mix(in srgb, var(--adm-accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--adm-accent) 26%, transparent);
}
.vf-pill.skip, .vf-pill.muted {
  color: var(--adm-muted);
  background: var(--adm-wash);
  border-color: var(--adm-border);
}

.vf-trend-body {
  padding: 12px 14px 14px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.vf-pie-tabs {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 7px;
  background: var(--adm-wash);
  border: 1px solid var(--adm-border);
  gap: 2px;
}
.vf-pie-tab {
  border: 0;
  background: transparent;
  color: var(--adm-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  line-height: 1.45;
  transition: background var(--adm-motion), color var(--adm-motion);
}
.vf-pie-tab:hover { color: var(--adm-text); }
.vf-pie-tab.active {
  background: var(--adm-accent);
  color: var(--adm-on-accent);
}
.vf-pie-wrap {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  flex: 1 1 auto;
}
.vf-pie-svg {
  display: block;
  margin: 0 auto;
  overflow: visible;
}
.vf-pie-slice {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity var(--adm-motion), transform var(--adm-motion);
}
.vf-pie-slice.is-hot { transform: scale(1.035); }
.vf-pie-slice.is-dim { opacity: 0.36; }
.vf-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.vf-pie-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto 46px;
  align-items: center;
  gap: 8px;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 0.78rem;
  transition: background var(--adm-motion), opacity var(--adm-motion);
}
.vf-pie-item.is-eligible { cursor: pointer; }
.vf-pie-item:hover, .vf-pie-item.is-hot { background: var(--adm-wash); }
.vf-pie-item.is-dim { opacity: 0.45; }
.vf-pie-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
}
.vf-pie-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--adm-font-mono);
  font-weight: 600;
  color: var(--adm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vf-pie-elig {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--adm-ok);
  flex-shrink: 0;
}
.vf-pie-val {
  text-align: right;
  font-family: var(--adm-font-mono);
  font-size: 0.76rem;
  color: var(--adm-text);
  font-variant-numeric: tabular-nums;
}
.vf-pie-pct {
  text-align: right;
  font-family: var(--adm-font-mono);
  font-size: 0.74rem;
  color: var(--adm-muted);
  font-variant-numeric: tabular-nums;
}
.vf-pie-foot {
  font-size: 0.74rem;
  padding-top: 6px;
  border-top: 1px dashed var(--adm-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vf-sub-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.vf-sub-bar .vtabs { margin-bottom: 0; }
.vf-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--adm-accent);
  background: color-mix(in srgb, var(--adm-accent) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--adm-accent) 30%, transparent);
  text-decoration: none;
  cursor: pointer;
}
.vf-active-chip:hover {
  background: color-mix(in srgb, var(--adm-accent) 18%, transparent);
  text-decoration: none;
}

/* 查日志弹窗时间轴 */
.vf-dev-banner {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--adm-ok) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--adm-ok) 32%, transparent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.vf-timeline {
  position: relative;
  padding-left: 22px;
  max-height: 58vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vf-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--adm-border);
}
.vf-tl-item {
  position: relative;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--adm-border);
  background: var(--adm-surface);
}
.vf-tl-dot {
  position: absolute;
  left: -20px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--adm-panel);
  background: var(--adm-info);
}
.vf-tl-dot.is-fail { background: var(--adm-risk); }
.vf-tl-dot.is-warn { background: var(--adm-warn); }
.vf-tl-dot.is-visit { background: var(--adm-accent); }
.vf-tl-dot.is-ok { background: var(--adm-ok); }
.vf-tl-dot.is-skip { background: var(--adm-muted); }
.vf-tl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.vf-tl-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.vf-tl-sum { font-size: 0.82rem; font-weight: 600; word-break: break-word; }
.vf-tl-sub { margin-top: 3px; font-size: 0.74rem; color: var(--adm-muted); }

@media (max-width: 1080px) {
  .vf-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vf-step { border-bottom: 1px solid var(--adm-border); }
  .vf-step-arrow { display: none; }
  .vf-mid-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .vf-pie-wrap { grid-template-columns: 1fr; }
  .vf-pie-legend { width: 100%; }
  .vf-funnel { grid-template-columns: 1fr; }
  .vf-step { border-right: 0; }
  .vf-ver-head,
  .vf-ver-row { grid-template-columns: 96px minmax(0, 1fr) 62px; gap: 8px; }
  .vf-ver-head { padding: 7px 16px; }
  .vf-ver-dwell-col,
  .vf-ver-fail-col { display: none; }
}
