/* ==========================================================================
   ReCodex Console — zero-build dark theme
   No external fonts, images or CDN resources. System font stack only.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------- */
:root {
  --bg: #070b12;
  --bg-soft: #0a0f19;
  --bg-elev: #0d1522;
  --panel: #111a29;
  --panel-2: #162133;
  --panel-3: #1d2b40;

  --border: #22314a;
  --border-soft: #1a2639;
  --border-strong: #2d4363;

  --text: #e8eef8;
  --text-dim: #9db0cb;
  --text-faint: #6f83a1;

  --brand: #38bdf8;
  --brand-2: #818cf8;
  --brand-3: #22d3ee;
  --brand-ink: #04121c;
  --brand-soft: rgba(56, 189, 248, 0.12);

  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.13);
  --purple: #c084fc;
  --purple-soft: rgba(192, 132, 252, 0.13);

  --radius-lg: 18px;
  --radius: 13px;
  --radius-sm: 9px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.28);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC",
    sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --topbar-h: 60px;
  --page-w: 1240px;
  --admin-w: 1420px;
}

/* --- Reset --------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-image:
    radial-gradient(1100px 520px at 12% -8%, rgba(56, 189, 248, 0.11), transparent 60%),
    radial-gradient(900px 480px at 92% -12%, rgba(129, 140, 248, 0.12), transparent 62%),
    radial-gradient(800px 600px at 50% 118%, rgba(34, 211, 238, 0.05), transparent 64%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, p { margin: 0; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: 0.2px; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
svg { display: block; }
details summary { cursor: pointer; }
::selection { background: rgba(56, 189, 248, 0.3); }

*:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.65);
  outline-offset: 2px;
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #2b3d59 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #24344d; border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #334a6b; }

/* --- Boot splash --------------------------------------------------------- */
.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.boot-inner { display: grid; justify-items: center; gap: 14px; }
.boot-logo svg {
  border-radius: 16px;
  box-shadow: 0 0 46px rgba(56, 189, 248, 0.3);
  animation: boot-pulse 1.8s ease-in-out infinite;
}
.boot-text { color: var(--text-dim); font-size: 13px; letter-spacing: 0.4px; }
.boot-bar {
  width: 168px;
  height: 3px;
  border-radius: 999px;
  background: #16213370;
  overflow: hidden;
}
.boot-bar i {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  animation: boot-slide 1.15s ease-in-out infinite;
}
.noscript {
  position: fixed;
  inset: auto 16px 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--warn);
  z-index: 999;
}
@keyframes boot-slide {
  0% { transform: translateX(-105%); }
  100% { transform: translateX(240%); }
}
@keyframes boot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.82; transform: scale(0.97); }
}

/* --- Layout primitives --------------------------------------------------- */
.page {
  width: min(var(--page-w), 100% - 40px);
  margin: 0 auto;
  padding: 26px 0 72px;
}
.page-wide { width: min(var(--admin-w), 100% - 40px); }

.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 10px; }
.stack-lg { display: grid; gap: 22px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.spacer { flex: 1 1 auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.hidden { display: none !important; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.wrap-any { overflow-wrap: anywhere; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-brand { color: var(--brand); }
.divider { height: 1px; background: var(--border-soft); border: 0; margin: 4px 0; }

/* --- Top bar ------------------------------------------------------------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  background: rgba(8, 13, 21, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 750;
  font-size: 15.5px;
  letter-spacing: 0.4px;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid;
  place-items: center;
  color: var(--brand-ink);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.32);
  flex: 0 0 auto;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-sub {
  color: var(--text-faint);
  font-weight: 500;
  font-size: 12px;
  border-left: 1px solid var(--border);
  padding-left: 10px;
  margin-left: 2px;
}
.topnav { display: flex; align-items: center; gap: 4px; }
.navlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 550;
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.16s, background 0.16s, border-color 0.16s;
}
.navlink:hover { color: var(--text); background: rgba(255, 255, 255, 0.045); text-decoration: none; }
.navlink.active {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--border);
}
.navlink .icon { color: inherit; }
.userchip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  max-width: 250px;
}
.userchip-email {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-ink);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  flex: 0 0 auto;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:hover { background: var(--panel-3); border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: var(--brand-ink);
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(56, 189, 248, 0.22);
}
.btn-primary:hover { background: linear-gradient(135deg, #4cc7fb, #939dfb); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); border-color: transparent; }
.btn-outline-ok { color: var(--ok); border-color: rgba(52, 211, 153, 0.4); background: var(--ok-soft); }
.btn-outline-ok:hover { background: rgba(52, 211, 153, 0.2); border-color: rgba(52, 211, 153, 0.6); }
.btn-danger { color: #fecaca; border-color: rgba(248, 113, 113, 0.38); background: var(--danger-soft); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); border-color: rgba(248, 113, 113, 0.6); }
.btn-brand-soft { color: var(--brand); border-color: rgba(56, 189, 248, 0.34); background: var(--brand-soft); }
.btn-brand-soft:hover { background: rgba(56, 189, 248, 0.2); border-color: rgba(56, 189, 248, 0.55); }
.btn-sm { padding: 5px 9px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-xs { padding: 3px 7px; font-size: 11.5px; border-radius: 6px; gap: 4px; }
.btn-lg { padding: 11px 20px; font-size: 14.5px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn .icon { color: inherit; }
.btn.is-loading { pointer-events: none; opacity: 0.7; }
.btn.is-loading .icon { animation: spin 0.9s linear infinite; }
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand);
  font-size: 12.5px;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

/* --- Cards / sections ---------------------------------------------------- */
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}
.card-flat { box-shadow: none; background: var(--bg-elev); }
.card-pad-0 { padding: 0; overflow: hidden; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.card-title { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-title .icon { color: var(--brand); }
.card-desc { color: var(--text-dim); font-size: 12.5px; margin-top: 3px; line-height: 1.5; }
.section-pad { padding: 18px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 13px;
}
.kpi {
  position: relative;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px 14px;
  overflow: hidden;
  min-width: 0;
}
.kpi::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  opacity: 0.9;
}
.kpi.tone-ok::after { background: linear-gradient(180deg, #34d399, #059669); }
.kpi.tone-warn::after { background: linear-gradient(180deg, #fbbf24, #d97706); }
.kpi.tone-danger::after { background: linear-gradient(180deg, #f87171, #dc2626); }
.kpi.tone-info::after { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.kpi.tone-purple::after { background: linear-gradient(180deg, #c084fc, #7c3aed); }
.kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.2px;
}
.kpi-label .icon { color: var(--text-faint); }
.kpi-value {
  margin-top: 7px;
  font-size: 26px;
  font-weight: 740;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
}
.kpi-value small { font-size: 13px; font-weight: 550; color: var(--text-dim); margin-left: 3px; }
.kpi-sub { margin-top: 5px; font-size: 11.5px; color: var(--text-faint); }

/* --- Badges / pills ------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  border: 1px solid transparent;
  white-space: nowrap;
  vertical-align: middle;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
  flex: 0 0 auto;
}
.badge.no-dot::before { display: none; }
.badge-ok { color: #6ee7b7; background: var(--ok-soft); border-color: rgba(52, 211, 153, 0.28); }
.badge-warn { color: #fcd34d; background: var(--warn-soft); border-color: rgba(251, 191, 36, 0.28); }
.badge-danger { color: #fca5a5; background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.28); }
.badge-info { color: #93c5fd; background: var(--info-soft); border-color: rgba(96, 165, 250, 0.28); }
.badge-brand { color: #7dd3fc; background: var(--brand-soft); border-color: rgba(56, 189, 248, 0.28); }
.badge-purple { color: #d8b4fe; background: var(--purple-soft); border-color: rgba(192, 132, 252, 0.28); }
.badge-muted { color: var(--text-dim); background: rgba(148, 163, 184, 0.1); border-color: rgba(148, 163, 184, 0.22); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--mono);
}

/* --- Forms --------------------------------------------------------------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.field-label .req { color: var(--danger); margin-left: 2px; }
.field-help { font-size: 11.5px; color: var(--text-faint); line-height: 1.45; }
.field-error { font-size: 12px; color: var(--danger); }
.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 11px;
  color: var(--text);
  background: #0a111c;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.45;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder,
.textarea::placeholder { color: #566b88; }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.13);
}
.textarea { min-height: 84px; resize: vertical; }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%),
    linear-gradient(135deg, var(--text-faint) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
.input-mono { font-family: var(--mono); font-size: 12.5px; }
.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.checkbox input {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: #0a111c;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  margin: 0;
}
.checkbox input:checked {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
}
.checkbox input:checked::after {
  content: "";
  width: 8px;
  height: 4.5px;
  border-left: 2px solid var(--brand-ink);
  border-bottom: 2px solid var(--brand-ink);
  transform: rotate(-45deg) translateY(-1px);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 6px;
  flex-wrap: wrap;
}

/* --- Filter / toolbar ---------------------------------------------------- */
.toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}
.filter-bar .field { min-width: 150px; }
.filter-bar .field.grow { flex: 1 1 220px; min-width: 200px; }
.filter-bar .field .field-label { font-size: 11.5px; }
.search-box { position: relative; }
.search-box .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}
.search-box .input { padding-left: 32px; }

/* --- Tabs ---------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 5px;
  padding: 5px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow-x: auto;
  max-width: 100%;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tab.active { color: var(--text); background: var(--panel-3); border-color: var(--border); }
.tab .icon { color: inherit; }

/* --- Tables -------------------------------------------------------------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: auto;
  background: rgba(8, 13, 21, 0.35);
  max-width: 100%;
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.8px;
  min-width: 620px;
}
table.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-faint);
  background: #0c1420;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  color: var(--text);
}
table.table tbody tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover { background: rgba(56, 189, 248, 0.035); }
table.table td.align-right,
table.table th.align-right { text-align: right; }
table.table td.align-center,
table.table th.align-center { text-align: center; }
table.table td .cell-main { font-weight: 550; }
table.table td .cell-sub { color: var(--text-faint); font-size: 11.5px; margin-top: 1px; white-space: nowrap; }
.td-truncate {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.table.dense th { padding: 8px 10px; }
table.table.dense td { padding: 8px 10px; }
.td-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.cell-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
}
.cell-copy .copy-btn {
  border: 0;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  border-radius: 4px;
}
.cell-copy .copy-btn:hover { color: var(--brand); background: var(--brand-soft); }

/* --- Progress / meters --------------------------------------------------- */
.progress {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #0a111c;
  border: 1px solid var(--border-soft);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.35s ease;
  min-width: 2px;
}
.progress.tone-ok > i { background: linear-gradient(90deg, #34d399, #10b981); }
.progress.tone-warn > i { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.progress.tone-danger > i { background: linear-gradient(90deg, #f87171, #ef4444); }
.progress-row { display: grid; gap: 6px; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.progress-meta b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 650; }
.meter-lg .progress { height: 10px; }

/* --- Key / value list ---------------------------------------------------- */
.kv { display: grid; gap: 9px; }
.kv-row {
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr;
  gap: 12px;
  align-items: baseline;
  font-size: 13px;
}
.kv-key { color: var(--text-faint); font-size: 12px; }
.kv-val { color: var(--text); overflow-wrap: anywhere; }

/* --- Charts -------------------------------------------------------------- */
.chart-box { width: 100%; overflow: hidden; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-bar { transition: opacity 0.15s; }
.chart-bar:hover { opacity: 0.78; }
.chart-bar.flat { fill: var(--panel-3); }
.chart-label { fill: var(--text-faint); font-size: 9.5px; font-family: var(--font); }
.chart-value { fill: var(--text-dim); font-size: 9.5px; font-family: var(--mono); }
.chart-grid { stroke: #1c2a3f; stroke-width: 1; stroke-dasharray: 3 5; }
.chart-track { fill: #0c1522; rx: 4; }
.chart-hlabel { fill: var(--text-dim); font-size: 10.5px; font-family: var(--font); }
.chart-hvalue { fill: var(--text); font-size: 10.5px; font-family: var(--mono); }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim); }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }

/* --- Empty / loading / error --------------------------------------------- */
.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-dim);
  display: grid;
  justify-items: center;
  gap: 8px;
}
.empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-faint);
  margin-bottom: 4px;
}
.empty-title { font-size: 14px; font-weight: 600; color: var(--text); }
.empty-desc { font-size: 12.5px; max-width: 380px; line-height: 1.55; }

.loading-block {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 48px 20px;
  color: var(--text-dim);
  font-size: 13px;
}
.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.22);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #131d2d 25%, #1b283d 50%, #131d2d 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  min-height: 12px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.55;
}
.notice .icon { flex: 0 0 auto; margin-top: 1px; color: var(--text-faint); }
.notice.tone-info { background: var(--info-soft); border-color: rgba(96, 165, 250, 0.24); color: #bfdbfe; }
.notice.tone-info .icon { color: var(--info); }
.notice.tone-warn { background: var(--warn-soft); border-color: rgba(251, 191, 36, 0.24); color: #fde68a; }
.notice.tone-warn .icon { color: var(--warn); }
.notice.tone-danger { background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.24); color: #fecaca; }
.notice.tone-danger .icon { color: var(--danger); }
.notice.tone-ok { background: var(--ok-soft); border-color: rgba(52, 211, 153, 0.24); color: #a7f3d0; }
.notice.tone-ok .icon { color: var(--ok); }
.notice b { color: inherit; }

.error-panel { max-width: 660px; margin: 36px auto; }
.error-code {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(248, 113, 113, 0.25);
  padding: 1px 7px;
  border-radius: 6px;
}

/* --- Pagination ---------------------------------------------------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  flex-wrap: wrap;
}
.pager-info { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.pager-actions { display: flex; align-items: center; gap: 6px; }
.pager-page {
  min-width: 30px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* --- Modal --------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 6, 11, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fade-in 0.14s ease-out;
  overflow-y: auto;
}
.modal {
  width: min(560px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: linear-gradient(180deg, #121b2b, #0c1420);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: modal-in 0.16s ease-out;
}
.modal.wide { width: min(760px, 100%); }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-title { font-size: 15.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.modal-desc { color: var(--text-dim); font-size: 12.5px; margin-top: 4px; line-height: 1.5; }
.modal-close {
  border: 0;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px;
  border-radius: 7px;
  display: inline-flex;
  flex: 0 0 auto;
}
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.modal-body { padding: 16px 20px 18px; display: grid; gap: 13px; }
.modal-error { display: none; }
.modal-error.show { display: block; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 0 20px 18px;
  flex-wrap: wrap;
}
.modal-foot .spacer { flex: 1; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* --- Toasts -------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(410px, calc(100vw - 36px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: 11px;
  background: rgba(18, 27, 43, 0.97);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  animation: toast-in 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.toast::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--info);
}
.toast.tone-ok::before { background: var(--ok); }
.toast.tone-ok .toast-icon { color: var(--ok); }
.toast.tone-error::before { background: var(--danger); }
.toast.tone-error .toast-icon { color: var(--danger); }
.toast.tone-warn::before { background: var(--warn); }
.toast.tone-warn .toast-icon { color: var(--warn); }
.toast.tone-info::before { background: var(--info); }
.toast.tone-info .toast-icon { color: var(--info); }
.toast-icon { flex: 0 0 auto; margin-top: 1px; }
.toast-body { min-width: 0; }
.toast-title { font-size: 12.8px; font-weight: 650; }
.toast-msg { font-size: 12.3px; color: var(--text-dim); overflow-wrap: anywhere; }
.toast-body .toast-msg:first-child { color: var(--text); }
.toast-detail {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10.8px;
  color: var(--text-faint);
  overflow-wrap: anywhere;
}
.toast.leaving { animation: toast-out 0.18s ease-in forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(22px); }
}

/* --- Auth / login -------------------------------------------------------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px 20px;
}
.auth-card {
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  background: linear-gradient(180deg, #121b2b, #0b111c);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.auth-promo {
  padding: 34px 32px;
  background:
    radial-gradient(520px 300px at 0% 0%, rgba(56, 189, 248, 0.18), transparent 62%),
    radial-gradient(420px 260px at 100% 100%, rgba(129, 140, 248, 0.18), transparent 60%),
    linear-gradient(180deg, #0e1826, #0a111c);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-promo .brand { font-size: 17px; }
.auth-headline {
  font-size: 25px;
  line-height: 1.32;
  font-weight: 740;
  letter-spacing: -0.4px;
  margin-top: 6px;
}
.auth-headline .grad {
  background: linear-gradient(120deg, var(--brand), var(--brand-2) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-sub { color: var(--text-dim); font-size: 13px; line-height: 1.65; }
.auth-features { display: grid; gap: 11px; margin-top: 4px; }
.auth-feature { display: flex; gap: 10px; align-items: flex-start; font-size: 12.8px; color: var(--text-dim); }
.auth-feature .icon { color: var(--brand); flex: 0 0 auto; margin-top: 2px; }
.auth-demo {
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 11px;
  background: rgba(8, 13, 21, 0.6);
  border: 1px dashed var(--border-strong);
  font-size: 12px;
  color: var(--text-dim);
  display: grid;
  gap: 5px;
}
.auth-demo code {
  font-family: var(--mono);
  color: var(--text);
  font-size: 11.5px;
  background: rgba(56, 189, 248, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}
.auth-form-side { padding: 32px 30px; display: flex; flex-direction: column; justify-content: center; }
.auth-tabs { display: flex; gap: 5px; padding: 4px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 18px; }
.auth-tab {
  flex: 1;
  padding: 7px 10px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.auth-tab.active { background: var(--panel-3); color: var(--text); }
.auth-form { display: grid; gap: 13px; }
.auth-form .btn { margin-top: 4px; }
.auth-foot { margin-top: 16px; font-size: 12px; color: var(--text-faint); line-height: 1.6; }
.auth-notice { margin-bottom: 14px; }
.auth-alt { margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--text-faint); }

/* --- Org cards ----------------------------------------------------------- */
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 15px; }
.org-card {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 17px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  border: 1px solid var(--border);
  transition: border-color 0.16s, transform 0.16s, box-shadow 0.16s;
}
.org-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}
.org-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.org-name { font-size: 15.5px; font-weight: 680; line-height: 1.3; overflow-wrap: anywhere; }
.org-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.org-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.org-stat { background: rgba(8, 13, 21, 0.45); border: 1px solid var(--border-soft); border-radius: 9px; padding: 8px 10px; }
.org-stat-label { font-size: 10.5px; color: var(--text-faint); letter-spacing: 0.3px; }
.org-stat-value { font-size: 16px; font-weight: 680; font-variant-numeric: tabular-nums; margin-top: 1px; }
.org-card-foot { display: flex; gap: 8px; align-items: center; margin-top: auto; }

/* --- Organization detail ------------------------------------------------- */
.org-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.org-header-main { display: grid; gap: 7px; min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-faint); }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { color: var(--text-faint); opacity: 0.6; }
.org-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.org-title h1 { font-size: 21px; }

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.mini-stat { background: rgba(8, 13, 21, 0.4); border: 1px solid var(--border-soft); border-radius: 10px; padding: 11px 13px; }
.mini-stat-label { font-size: 11px; color: var(--text-faint); }
.mini-stat-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.mini-stat-value small { font-size: 11.5px; color: var(--text-dim); font-weight: 500; margin-left: 2px; }

/* --- Plan cards ---------------------------------------------------------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 15px; }
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  border: 1px solid var(--border);
  position: relative;
}
.plan-card.highlight { border-color: rgba(56, 189, 248, 0.45); box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.12) inset; }
.plan-name { font-size: 15px; font-weight: 680; }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price .amount { font-size: 28px; font-weight: 750; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.plan-price .unit { font-size: 12px; color: var(--text-faint); }
.plan-features { display: grid; gap: 7px; margin: 2px 0; }
.plan-feature { display: flex; gap: 7px; align-items: flex-start; font-size: 12.3px; color: var(--text-dim); }
.plan-feature .icon { color: var(--ok); flex: 0 0 auto; margin-top: 2px; }
.plan-card .btn { margin-top: auto; }

/* --- CLI auth page ------------------------------------------------------- */
.cli-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
}
.cli-card {
  width: min(620px, 100%);
  background: linear-gradient(180deg, #121c2c, #0b111c);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cli-head {
  padding: 24px 26px 18px;
  background:
    radial-gradient(420px 200px at 0% 0%, rgba(56, 189, 248, 0.16), transparent 60%),
    radial-gradient(320px 180px at 100% 100%, rgba(129, 140, 248, 0.14), transparent 62%),
    #0d1624;
  border-bottom: 1px solid var(--border-soft);
  display: grid;
  gap: 10px;
}
.cli-head .brand { font-size: 14.5px; }
.cli-head h1 { font-size: 21px; letter-spacing: -0.2px; }
.cli-head p { color: var(--text-dim); font-size: 13px; }
.cli-body { padding: 20px 26px 24px; display: grid; gap: 16px; }
.machine-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  background: rgba(8, 13, 21, 0.5);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}
.machine-item { display: grid; gap: 1px; min-width: 0; }
.machine-label { font-size: 10.5px; color: var(--text-faint); letter-spacing: 0.3px; }
.machine-value { font-size: 12.8px; color: var(--text); overflow-wrap: anywhere; }
.machine-value.mono { font-family: var(--mono); font-size: 11.8px; }
.org-picker {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.org-option {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(8, 13, 21, 0.4);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.org-option:hover { border-color: var(--border-strong); background: rgba(56, 189, 248, 0.04); }
.org-option.selected { border-color: rgba(56, 189, 248, 0.55); background: var(--brand-soft); }
.org-option input {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  margin: 2px 0 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #0a111c;
  cursor: pointer;
}
.org-option input:checked { border-color: var(--brand); }
.org-option input:checked::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.org-option-main { display: grid; gap: 2px; min-width: 0; }
.org-option-name { font-size: 13.5px; font-weight: 600; }
.org-option-meta { font-size: 11.5px; color: var(--text-faint); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.success-hero { display: grid; justify-items: center; gap: 10px; padding: 22px 10px 8px; text-align: center; }
.success-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-soft);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: var(--ok);
  animation: pop-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.success-check svg { width: 30px; height: 30px; }
.success-title { font-size: 19px; font-weight: 700; }
.success-desc { color: var(--text-dim); font-size: 13px; max-width: 380px; line-height: 1.6; }
@keyframes pop-in {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.cli-code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(8, 13, 21, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
}

/* --- Admin shell --------------------------------------------------------- */
.admin-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.admin-side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 12px;
  background: linear-gradient(180deg, #0b1320, #080d17);
  border-right: 1px solid var(--border-soft);
  overflow-y: auto;
  z-index: 30;
}
.admin-side .brand { padding: 4px 8px 12px; }
.side-section { margin-top: 12px; }
.side-label {
  padding: 0 10px 5px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.side-nav { display: grid; gap: 2px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 520;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.14s, color 0.14s;
}
.side-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.045); text-decoration: none; }
.side-link.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.08));
  border-color: rgba(56, 189, 248, 0.24);
}
.side-link.active .icon { color: var(--brand); }
.side-link .icon { color: var(--text-faint); }
.side-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--border-soft);
  display: grid;
  gap: 8px;
}
.side-version { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }
.admin-main { display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  height: var(--topbar-h);
  background: rgba(8, 13, 21, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
}
.admin-title { font-size: 15px; font-weight: 650; }
.admin-crumbs { font-size: 11.5px; color: var(--text-faint); }
.admin-content { padding: 22px 22px 64px; width: min(var(--admin-w), 100%); }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
  flex: 0 0 auto;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--panel-2); }
.menu-toggle { display: none; }

/* --- Utilities specific to pages ---------------------------------------- */
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.split-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.code-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 7px;
  max-height: 280px;
  overflow: auto;
  padding: 10px;
  background: rgba(8, 13, 21, 0.5);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}
.code-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 7px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.code-chip button { border: 0; background: none; color: var(--text-faint); cursor: pointer; padding: 1px; }
.code-chip button:hover { color: var(--brand); }
.reveal {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(8, 13, 21, 0.35);
}
.reveal > summary { font-size: 12px; color: var(--text-dim); user-select: none; }
.reveal[open] > summary { margin-bottom: 10px; }
pre.raw-json {
  margin: 0;
  padding: 12px;
  border-radius: 9px;
  background: #070c14;
  border: 1px solid var(--border-soft);
  color: #a9c2e0;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  overflow: auto;
  max-height: 320px;
}
.menu-pop {
  position: relative;
  display: inline-block;
}
.menu-pop > summary {
  list-style: none;
}
.menu-pop > summary::-webkit-details-marker { display: none; }
.menu-pop-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 168px;
  padding: 5px;
  border-radius: 10px;
  background: #131d2d;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  display: grid;
  gap: 2px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.menu-item.danger { color: #fca5a5; }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-item .icon { color: inherit; }
.login-hint {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1180px) {
  .split-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1024px) {
  .admin-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .admin-content { padding: 18px 18px 56px; }
  .topnav .navlink span.nav-text { display: none; }
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-side {
    position: fixed;
    inset: 0 auto 0 0;
    width: 254px;
    height: 100dvh;
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
    z-index: 60;
  }
  .admin-side.open { transform: none; }
  .menu-toggle { display: inline-flex; }
  .side-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(3, 6, 11, 0.6);
    backdrop-filter: blur(3px);
  }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .auth-card { grid-template-columns: minmax(0, 1fr); }
  .auth-promo { border-right: 0; border-bottom: 1px solid var(--border-soft); padding: 26px 24px; }
  .auth-headline { font-size: 22px; }
  .auth-demo { margin-top: 6px; }
  .auth-form-side { padding: 26px 24px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: span 1; }
  .machine-box { grid-template-columns: minmax(0, 1fr); }
  .topbar { gap: 12px; padding: 0 14px; }
  .brand-sub { display: none; }
  .topnav { gap: 2px; }
  .page { width: calc(100% - 28px); padding-top: 18px; }
  .admin-content { width: 100%; }
}

@media (max-width: 620px) {
  .topbar-actions .userchip { display: none; }
  .topbar { flex-wrap: nowrap; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 13px 12px; }
  .kpi-value { font-size: 22px; }
  .org-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toast-stack { right: 10px; left: 10px; bottom: 10px; width: auto; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .admin-topbar { padding: 0 14px; }
  .admin-title { font-size: 14px; }
  .admin-crumbs { display: none; }
  .page { width: calc(100% - 22px); }
  .auth-promo { display: none; }
  .auth-form-side { padding: 26px 20px; }
  .cli-wrap { padding: 16px 12px; }
  .cli-head, .cli-body { padding-left: 18px; padding-right: 18px; }
  h1 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
