/* ============================================================
   RE Paint Line — dark lemon-gold shell
   Spec: docs/superpowers/specs/2026-09-01-cryptovault-visual-language.md
   ============================================================ */

:root {
  --gold:       #F5C400;
  --gold-hover: #e0b200;
  --gold-soft:  rgba(245, 196, 0, 0.12);
  --gold-ink:   #000000;
  --gold-dim:   #a07a1a;
  --nav-bg:     #000000;
  --nav-border: #2a2a2a;
  --nav-width:  220px;
  --content-bg: #050505;
  --panel-bg:   #141414;
  --panel-border:#2a2a2a;
  --card-line:  #4a4a4a;
  --chip-bg:    #1c1c1c;
  --text:       #ffffff;
  --text-dim:   #9a9a9a;
  --text-muted: #6b6b6b;
  --danger:     #e05252;
  --success:    #3dd68c;
  --warning:    #F5C400;
  --shadow:     0 4px 24px rgba(0,0,0,0.5);
  --radius:     14px;
  --radius-card: 20px;
  --mono:      "IBM Plex Mono", ui-monospace, monospace;
  font-family: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--content-bg); color: var(--text); overflow: hidden; }
button, input, select, textarea { font-family: inherit; }

/* ── App shell layout ──────────────────────────────────────── */
#appshell {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ── Left nav ──────────────────────────────────────────────── */
#appnav {
  width: var(--nav-width);
  flex: none;
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 16px;
  border-bottom: 1px solid var(--nav-border);
  flex: none;
}
.nav-logo-icon {
  width: 36px; height: 36px;
  background: var(--gold);
  color: var(--gold-ink);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; letter-spacing: 0.05em;
  flex: none;
}
.nav-logo-text { display: flex; flex-direction: column; }
.nav-logo-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; }
.nav-logo-sub   { font-size: 10px; color: var(--text-dim); line-height: 1.3; }
.nav-logo-powered { font-size: 8.5px; color: var(--gold); opacity: 0.72; letter-spacing: 0.03em; margin-top: 2px; }

.nav-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 6px;
  flex: 1;
  overflow-y: auto;
}
.nav-list::-webkit-scrollbar { width: 4px; }
.nav-list::-webkit-scrollbar-thumb { background: var(--nav-border); border-radius: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.12s;
  user-select: none;
}
.nav-item:hover:not(.disabled) { background: var(--gold-soft); }
.nav-item.active {
  background: var(--gold-soft);
}
.nav-item.disabled { opacity: 0.35; cursor: default; }

.nav-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--gold-dim);
  flex: none;
  width: 20px;
}
.nav-item.active .nav-num { color: var(--gold); }
.nav-label { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.nav-item.active .nav-label { color: var(--gold); font-weight: 700; }

.nav-section-title {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 12px 10px 4px;
}

.nav-footer {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--nav-border);
  flex: none;
}
.nav-version { font-size: 10px; color: var(--text-muted); font-family: "IBM Plex Mono", monospace; display: flex; align-items: center; gap: 5px; }
.nav-conn-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); flex: none; transition: background 0.4s; }
.nav-conn-dot.online  { background: var(--success); box-shadow: 0 0 4px var(--success); }
.nav-conn-dot.offline { background: var(--danger);  box-shadow: 0 0 4px var(--danger); }

/* ── Content stage + shared topbar ─────────────────────────── */
#appstage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#apptop {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 20px;
  margin: 0;
  background: #000;
  border-bottom: 1px solid var(--nav-border);
}
#apptop .ops-dash-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ── Content area ──────────────────────────────────────────── */
#content {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* ── Module panels ─────────────────────────────────────────── */
.module-panel {
  position: absolute;
  inset: 0;
  display: none;    /* router shows/hides */
}
.module-panel.scrollable {
  overflow-y: auto;
  background: var(--content-bg);
}

/* ── Module header (used by scrollable modules) ────────────── */
.module-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel-bg);
}
.module-header h1 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.module-header .module-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}
.module-header .btn-ghost { margin-top: 10px; }

/* ── Coming-soon placeholder ───────────────────────────────── */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
}
.cs-num {
  font-size: 72px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  color: var(--nav-border);
  line-height: 1;
}
.cs-label {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-dim);
}
.cs-note { font-size: 13px; color: var(--text-muted); }

/* ── Admin module ──────────────────────────────────────────── */
.admin-body { padding: 24px 32px 40px; max-width: 760px; }

.admin-section { margin-bottom: 32px; }
.admin-section h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-border);
}

.admin-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-border);
}
.admin-row:last-child { border-bottom: none; }

.admin-row-label {
  font-size: 12px;
  color: var(--text-dim);
  width: 160px;
  flex: none;
}
.admin-row-value {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
}
.admin-row input {
  flex: 1;
  background: var(--content-bg);
  border: 1px solid var(--panel-border);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  padding: 6px 10px;
  font-family: "IBM Plex Mono", monospace;
}
.admin-row input:focus { outline: none; border-color: var(--gold); }

.admin-stat {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--content-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 14px 20px;
  min-width: 100px;
}
.admin-stat-num  { font-size: 26px; font-weight: 700; color: var(--text); font-family: "IBM Plex Mono", monospace; }
.admin-stat-lbl  { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

.admin-stats-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn-primary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  padding: 12px 20px;
  min-height: 44px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid transparent;
}
.btn-primary:disabled,
.btn-ghost:disabled,
.btn-danger:disabled { opacity: 0.38; cursor: default; }
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: var(--gold);
}
.btn-primary:hover:not(:disabled) {
  background: var(--gold-hover);
  border-color: var(--gold-hover);
}
.btn-ghost,
.dba-export-btn,
.rt-export-btn {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}
.btn-ghost:hover:not(:disabled),
.dba-export-btn:hover,
.rt-export-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
}
.btn-danger,
.dba-danger-btn {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled),
.dba-danger-btn:hover {
  background: rgba(224, 82, 82, 0.12);
  color: var(--danger);
}

.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--success);
  color: var(--gold-ink);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 9999;
}
.toast.show { opacity: 1; }

/* ── Station Builder wrapper ───────────────────────────────── */
/* The existing sb.css scopes to #app; we host it inside #module-01 */
#module-01 #app {
  position: absolute;
  inset: 0;
  width: auto !important;
  height: auto !important;
}

/* ── Scrollbars (global) ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
.gold-scroll {
  scrollbar-color: var(--gold) transparent;
  scrollbar-width: thin;
}
.gold-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.gold-scroll::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 8px; }
.gold-scroll::-webkit-scrollbar-track { background: transparent; }

/* ── Shared scroll picker ─────────────────────────────────────── */
.scroll-picker { position: relative; width: 100%; min-width: 0; }
.scroll-picker-control { position: relative; width: 100%; }
.scroll-picker-input,
.scroll-picker-button {
  width: 100%;
  min-height: 46px;
  height: 46px;
  box-sizing: border-box;
  padding: 8px 38px 8px 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--chip-bg);
  color: var(--text);
  font: 500 15px "IBM Plex Sans", sans-serif;
  text-align: left;
}
.scroll-picker-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
}
.scroll-picker-input:focus,
.scroll-picker-button:focus { outline: none; border-color: var(--gold); }
.scroll-picker-button.is-placeholder { color: var(--text-muted); font-weight: 400; }
.scroll-picker-chevron {
  position: absolute; right: 14px; top: 50%; transform: translateY(-55%);
  color: var(--gold); pointer-events: none; font-size: 18px;
}
.scroll-picker-list {
  z-index: 1000;
  max-height: 320px;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding: 4px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: var(--chip-bg);
  box-shadow: var(--shadow);
}
.scroll-picker-list::-webkit-scrollbar-thumb { background: var(--gold); }
.scroll-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.scroll-picker-option:hover,
.scroll-picker-option.is-active { background: var(--gold-soft); color: var(--gold); }
.scroll-picker-option.is-selected { font-weight: 700; }
.scroll-picker-option:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.scroll-picker-empty { padding: 11px 12px; color: var(--text-muted); font-size: 13px; }
.scroll-picker.is-disabled { opacity: .55; }
.scroll-picker.is-disabled .scroll-picker-button { cursor: not-allowed; }
.scroll-picker-option .ops-ico,
.scroll-picker-button .ops-ico {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: none;
}

/* ── Light theme ──────────────────────────────────────────────── */
[data-theme="light"] {
  --gold:         #F5C400;
  --gold-hover:   #e0b200;
  --gold-soft:    rgba(245, 196, 0, 0.18);
  --gold-ink:     #000000;
  --gold-dim:     #8a5a0a;
  --nav-bg:       #f4f4f5;
  --nav-border:   #d8d8dc;
  --content-bg:   #f5f5f6;
  --panel-bg:     #ffffff;
  --panel-border: #dce4ee;
  --chip-bg:      #ececf0;
  --text:         #111111;
  --text-dim:     #5c5c66;
  --text-muted:   #8a8a94;
  --shadow:       0 4px 24px rgba(30,50,80,0.10);
  --danger:       #c94040;
  --success:      #2aa86a;
}
[data-theme="light"] #appnav { box-shadow: 1px 0 0 var(--nav-border); }

/* Station builder always stays dark — override any theme leak */
[data-theme="light"] #module-01 {
  --canvas-bg: #0b0f14; --surface: #1a2129cc; --border: #2c3742;
  --text: #e7edf2; --text-dim: #93a2ad; --chip-bg: #212a33;
}

/* ── Theme toggle button ──────────────────────────────────────── */
.theme-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1.5px solid var(--gold);
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: pointer;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  margin-bottom: 8px;
  width: 100%;
  justify-content: center;
  transition: background 0.12s;
}
.theme-btn:hover { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.theme-btn .tb-icon { font-size: 14px; line-height: 1; }

/* ── Module 02 — RFID Tagging ─────────────────────────────────── */
#tagging-root, #kiosk-tag-root { height: auto; overflow: visible; min-height: 0; }
#module-02.scrollable:focus,
#kiosk-tagging.scrollable:focus { outline: none; }

.rtag-page { padding: 0 0 48px; max-width: none; height: auto; overflow: visible; }
.rtag-page button { touch-action: manipulation; }

.rtag-head h1 { display: none; }
.rtag-head .ops-dash-clock { display: none; }
.rtag-intro {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 10px 16px 8px;
}
.rtag-page-title {
  font-size: 13px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text);
}
.rtag-page-sub { font-size: 12px; color: var(--text-dim); margin: 0; }

/* ── Settings modal ── */
.rtag-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center;
}
.rtag-modal {
  background: var(--panel-bg); border: 1px solid var(--panel-border);
  border-radius: 12px; min-width: 380px; max-width: 480px; width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.rtag-modal-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--panel-border);
  font-size: 14px; font-weight: 700; color: var(--text);
}
.rtag-modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1;
}
.rtag-modal-close:hover { color: var(--text); }
.rtag-modal-body { padding: 18px; }
.rtag-modal-label { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.rtag-modal-hint {
  font-size: 11px; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px;
}
.rtag-modal-hint code { color: var(--gold); font-family: monospace; }
.rtag-upload-label {
  display: inline-block; padding: 8px 18px; border-radius: 6px;
  background: rgba(245,196,0,0.12); border: 1px solid var(--gold);
  color: var(--gold); font-size: 13px; font-weight: 600; cursor: pointer;
}
.rtag-upload-label:hover { background: rgba(245,196,0,0.22); }
.rtag-modal-status { margin-top: 14px; font-size: 12px; min-height: 18px; color: var(--text-muted); }
.rtag-modal-ok { color: var(--success); }
.rtag-modal-err { color: var(--danger, #e74c3c); }
.rtag-reader-badge {
  display: flex; align-items: center; gap: 7px;
  background: rgba(61, 214, 140, 0.12);
  border: 1px solid rgba(61, 214, 140, 0.35);
  border-radius: 20px; padding: 5px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--success);
  text-transform: uppercase;
}
.rtag-online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 6px var(--success);
  animation: rtag-dot-pulse 2s ease-in-out infinite; flex: none;
}
@keyframes rtag-dot-pulse {
  0%, 100% { box-shadow: 0 0 4px var(--success); }
  50%       { box-shadow: 0 0 10px var(--success); }
}
.rtag-hdr-pipe { color: var(--panel-border); font-size: 16px; }
.rtag-hdr-chip {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text); padding: 4px 10px;
  background: var(--chip-bg); border: 1px solid var(--card-line);
  border-radius: 6px;
}
.rtag-hdr-clock {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--text-dim); letter-spacing: 0.04em; white-space: nowrap;
}
.rtag-hdr-settings {
  background: none; border: 1px solid var(--card-line); border-radius: 8px;
  color: var(--text-dim); font: inherit; font-size: 12px; font-weight: 600;
  padding: 5px 12px; cursor: pointer; letter-spacing: 0.04em;
}
.rtag-hdr-settings:hover { border-color: var(--gold); color: var(--text); }

/* ── Step progress bar + 3-col body share the same tracks ── */
.rtag-steps,
.rtag-cols {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
}
.rtag-step-bar {
  align-items: stretch;
  border-bottom: 2px solid var(--panel-border);
}
.rtag-step {
  flex: 1; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: #0d0d0d;
  min-width: 0; transition: flex 0.25s, background 0.15s;
  overflow: hidden;
}
/* active step gets 2× the width */
.rtag-step.on   { flex: 2.4; background: rgba(245, 196, 0, 0.10); border-bottom: 3px solid var(--gold); margin-bottom: -2px; }
.rtag-step.done { background: rgba(61, 214, 140, 0.07); border-bottom: 3px solid rgba(61,214,140,0.5); margin-bottom: -2px; }

.rtag-step-badge {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900;
  background: #222; color: var(--text-muted);
  border: 2px solid #333;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rtag-step.on   .rtag-step-badge { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.rtag-step.done .rtag-step-badge { background: var(--success); color: #04140c; border-color: var(--success); }

.rtag-step-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rtag-step-body b {
  font-size: 11px; font-weight: 800; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.rtag-step.on   .rtag-step-body b { font-size: 12px; color: var(--gold); }
.rtag-step.done .rtag-step-body b { color: var(--success); }
.rtag-step-body small { font-size: 10px; color: var(--text-muted); font-weight: 400; white-space: nowrap; }

/* ‹ › chevron separators */
.rtag-step-chevron {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 22px; font-size: 20px; color: #333;
  background: #0a0a0a;
  border-bottom: 2px solid var(--panel-border);
  align-self: stretch;
}

/* ── need-pick flash ── */
.rtag-step.need-pick {
  border: 1px solid var(--gold);
  background: rgba(245, 196, 0, 0.16);
}
.rtag-step-bar .rtag-step.on.need-pick { animation: rtag-need-pick 0.7s ease-out 1; }
@keyframes rtag-need-pick {
  0%  { background: rgba(245, 196, 0, 0.4); }
  100%{ background: rgba(245, 196, 0, 0.10); }
}

/* ── 3-column layout ── */
.rtag-cols {
  margin-bottom: 0;
  border-bottom: 1px solid var(--panel-border);
}
.rtag-col {
  background: var(--panel-bg);
  border-right: 1px solid var(--panel-border);
  padding: 16px 16px 18px;
  min-width: 0;
}
.rtag-col:last-child { border-right: 0; }
.rtag-col-select { background: var(--content-bg); }
.rtag-col-select.need-pick {
  background: rgba(245,196,0,0.05);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.rtag-col.dim { opacity: 0.45; pointer-events: none; }
.rtag-col.ready { opacity: 1; pointer-events: auto; }

/* ── Column heading rows (scan/fit) ── */
.rtag-col-head-row {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px;
}
.rtag-col-num {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: #1e1e1e; border: 2px solid var(--card-line);
  font-size: 15px; font-weight: 800; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.rtag-col-title {
  font-size: 13px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text); padding-top: 2px;
}
.rtag-col-sub {
  font-size: 11.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.4;
}

/* ── Section headings inside select column ── */
.rtag-sec-hdr {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.rtag-sec-hdr-gap { margin-top: 18px; }
.rtag-sec-label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text); white-space: nowrap;
}
.rtag-sec-num { color: var(--gold); margin-right: 2px; }
.rtag-sec-count {
  font-size: 10.5px; font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.02em;
}
.rtag-sec-hint {
  font-size: 10.5px; color: var(--text-muted); text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Model grid ── */
.rtag-models {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 96px;
  gap: 10px;
  overflow-y: auto;
}
.rtag-model {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  height: 96px;
  min-height: 96px;
  box-sizing: border-box;
  padding: 8px 6px 6px;
  background: var(--chip-bg);
  border: 1.5px solid var(--panel-border);
  border-radius: 10px;
  color: inherit; font: inherit; cursor: pointer;
  min-width: 0; transition: border-color 0.1s, background 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(245, 196, 0, 0.22);
}
.rtag-model:hover { border-color: rgba(245, 196, 0, 0.5); }
.rtag-model.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(245, 196, 0, 0.3);
  background: rgba(245, 196, 0, 0.07);
}
.rtag-model-img {
  width: 72px; height: 46px;
  object-fit: contain; object-position: center bottom;
  display: block;
}
.rtag-bike { width: 48px; height: 30px; color: var(--text-muted); overflow: visible; }

/* ── Hero preview + colour rail (fixed panes; 8 colour slots, 2×4) ── */
.rtag-pick-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 12px;
  margin-top: 14px;
  align-items: stretch;
  height: 292px;
  min-height: 292px;
  max-height: 292px;
}
.rtag-hero {
  height: 292px;
  min-height: 292px;
  max-height: 292px;
  background: var(--chip-bg);
  border: 1px solid var(--card-line, #4a4a4a);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.rtag-hero-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px 12px;
}
.rtag-prev-img {
  width: 100%;
  height: 232px;
  object-fit: contain;
  object-position: center;
  flex: none;
}
.rtag-prev-img-fallback {
  width: 100%;
  height: 232px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.rtag-prev-img-fallback svg { width: 88%; height: 88%; color: var(--text-muted); }
.rtag-prev-model {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: center;
  line-height: 1.3;
  height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.rtag-hero-empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.rtag-color-rail {
  display: flex;
  flex-direction: column;
  width: 176px;
  min-width: 176px;
  max-width: 176px;
  height: 292px;
  min-height: 292px;
  max-height: 292px;
  box-sizing: border-box;
  border: 1px solid var(--card-line, #4a4a4a);
  border-radius: 10px;
  padding: 8px 8px 10px;
  background: var(--chip-bg);
  overflow: hidden;
}
.rtag-color-rail .rtag-sec-hdr { margin-bottom: 4px; flex: none; }
.rtag-color-rail .rtag-sec-hint {
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 8px;
  font-size: 10px;
  line-height: 1.35;
  height: 14px;
  flex: none;
}
.rtag-bike svg { width: 100%; height: 100%; }
.rtag-model.selected .rtag-bike { color: var(--gold); }
.rtag-model-name {
  font-size: 10px; font-weight: 700; color: var(--text);
  text-align: center; line-height: 1.25;
  height: 26px; max-height: 26px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  width: 100%;
}
.rtag-check {
  position: absolute; top: 5px; right: 5px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--gold); color: var(--gold-ink);
  font-size: 9px; font-weight: 900; line-height: 15px; text-align: center;
}

/* ── Variant buttons ── */
.rtag-variants {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 4px;
}
.rtag-variant-btn {
  position: relative;
  padding: 7px 16px;
  background: var(--chip-bg);
  border: 1.5px solid var(--panel-border);
  border-radius: 8px;
  font: inherit; font-size: 12px; font-weight: 600;
  color: var(--text-dim); cursor: pointer;
  transition: border-color 0.1s, color 0.1s;
}
.rtag-variant-btn:hover { border-color: rgba(245,196,0,0.5); color: var(--text); }
.rtag-variant-btn.selected {
  border-color: var(--gold);
  color: var(--text);
  background: rgba(245, 196, 0, 0.09);
}
.rtag-variant-btn .rtag-check { top: 4px; right: 4px; }

/* ── Colour swatches: always 2 columns × 4 equal cells ── */
.rtag-colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(4, 52px);
  gap: 6px 8px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  align-content: start;
}
.rtag-swatch.is-slot {
  pointer-events: none;
  visibility: hidden;
}
.rtag-swatch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 52px;
  min-height: 44px;
  box-sizing: border-box;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(245, 196, 0, 0.22);
}
.rtag-dot {
  width: 36px;
  height: 36px;
  flex: none;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid var(--panel-border);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}
.rtag-swatch:hover .rtag-dot { border-color: rgba(245,196,0,0.6); }
.rtag-swatch.selected .rtag-dot {
  border-color: var(--gold);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}
.rtag-swatch-name {
  display: block;
  width: 100%;
  height: 14px;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-dim);
  text-align: center;
  line-height: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rtag-swatch.selected .rtag-swatch-name { color: var(--text); font-weight: 500; }
.rtag-swatch .rtag-check { top: 0; right: 2px; }

.rtag-hint { font-size: 11.5px; color: var(--text-dim); margin: 4px 0 0; }
.rtag-err  { color: var(--danger); font-size: 12.5px; margin: 8px 0 0; }

/* ── Scan / fit mockup art ── */
.rtag-art {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto 8px;
}
.rtag-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}
.rtag-art-scan.is-idle { opacity: 0.72; }
.rtag-art-scan.is-waiting .rtag-pulse {
  position: absolute;
  inset: 18% 22% 38%;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 40px 12px rgba(245, 196, 0, 0.22);
  animation: rtag-halo-pulse 1.6s ease-in-out infinite;
}
.rtag-art-scan.is-tagged .rtag-pulse { animation: none; opacity: 0.35; }
.rtag-reader-svg {
  width: 100%; max-width: 280px; height: auto;
  display: block; margin: 0 auto 10px;
}
.rtag-tank-svg {
  width: 100%; max-width: 220px; height: auto;
  display: block; margin: 4px auto 12px;
}

/* reader wave animations */
@keyframes rtag-field-pulse {
  0%, 100% { opacity: 0.08; }
  50%       { opacity: 1; }
}
@keyframes rtag-wave-pulse {
  0%, 100% { opacity: 0.08; }
  50%       { opacity: 1; }
}
@keyframes rtag-led-blink {
  0%, 49% { opacity: 1; }
  50%,100% { opacity: 0.15; }
}
@keyframes rtag-halo-pulse {
  0%, 100% { opacity: 0; }
  50%       { opacity: 1; }
}
.rtag-reader-svg.is-waiting .rtag-wave,
.rtag-reader-svg.is-waiting .rtag-pulse {
  animation: rtag-field-pulse 1.6s ease-in-out infinite;
}
.rtag-reader-svg.is-waiting .rtag-wave-2 { animation-delay: 0.28s; }
.rtag-reader-svg.is-waiting .rtag-wave-3 { animation-delay: 0.56s; }
.rtag-reader-svg.is-waiting .rtag-led    { animation: rtag-led-blink 1s step-end infinite; }
.rtag-reader-svg.is-waiting .rtag-halo   { animation: rtag-halo-pulse 1.6s ease-in-out infinite; }
.rtag-reader-svg.is-tagged  .rtag-wave { opacity: 0.9; animation: none; }
.rtag-reader-svg.is-tagged .rtag-pulse { opacity: 0.9; animation: none; }
.rtag-reader-svg.is-tagged  .rtag-halo  { opacity: 0.6; animation: none; }
.rtag-reader-svg.is-tagged  .rtag-led   { opacity: 1;   animation: none; }
.rtag-reader-svg.is-idle    .rtag-wave  { opacity: 0.14; animation: none; }
.rtag-reader-svg.is-idle    .rtag-halo  { opacity: 0;   animation: none; }
.rtag-reader-svg.is-idle    .rtag-led   { opacity: 0.2; animation: none; }
@media (prefers-reduced-motion: reduce) {
  .rtag-reader-svg.is-waiting .rtag-wave,
  .rtag-reader-svg.is-waiting .rtag-led,
  .rtag-reader-svg.is-waiting .rtag-halo { animation: none; opacity: 0.7; }
}

/* ── Scan status text ── */
.rtag-scan-status {
  text-align: center; font-size: 16px; font-weight: 900; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--gold); margin: 6px 0 4px;
}
.rtag-scan-status.ok  { color: var(--success); }
.rtag-scan-status.dim { color: var(--text-muted); font-weight: 700; }
.rtag-scan-hint {
  text-align: center; font-size: 12px; color: var(--text-dim); margin: 0 0 10px; line-height: 1.4;
}
.rtag-tag-detail {
  text-align: center; font-size: 13px; font-weight: 600;
  color: var(--text); margin: 0 0 4px;
}
.rtag-tag-epc {
  text-align: center; font-family: var(--mono); font-size: 12px;
  color: var(--text-dim); margin: 0 0 12px;
}
.rtag-scan-action { text-align: center; margin-top: 12px; }
.rtag-scan-action .btn-primary { display: inline-block; }
.rtag-col-scan .sim-read { text-align: center; margin-top: 10px; }

/* ── Scan info bar ── */
.rtag-scan-info-bar {
  display: flex; align-items: center; gap: 8px;
  margin-top: auto; padding: 8px 12px;
  background: var(--chip-bg); border: 1px solid var(--panel-border);
  border-radius: 8px; font-size: 11px; color: var(--text-dim);
  flex-wrap: wrap;
}
.rtag-radio-icon {
  font-family: var(--mono); font-size: 12px; color: var(--success);
  letter-spacing: -0.02em;
}
.rtag-info-pipe { color: var(--panel-border); }
.rtag-scan-info-bar .live-toggle { margin: 0; min-height: 44px; touch-action: manipulation; }

/* ── Fit column copy ── */
.rtag-fit-copy {
  text-align: center; font-size: 12px; color: var(--text-dim); margin: 0; line-height: 1.5;
}

/* ── Recently tagged caps ── */
.rtag-recent-wrap {
  padding: 14px 22px 16px;
  border-bottom: 1px solid var(--panel-border);
}
.rtag-recent-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px;
}
.rtag-recent-badge {
  background: var(--chip-bg); border: 1px solid var(--card-line);
  border-radius: 10px; padding: 2px 8px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--text-muted); text-transform: none; vertical-align: middle;
  margin-left: 6px;
}
.rtag-view-all {
  background: none; border: 0; color: var(--gold); cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 10px 12px; min-height: 44px;
  touch-action: manipulation;
}
}
.rtag-recent {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.rtag-recent-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
}
.rtag-recent-swatch {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  border: 1.5px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.rtag-recent-mid {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px;
}
.rtag-recent-epc {
  font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rtag-recent-model {
  font-size: 11px; color: var(--text-dim); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rtag-recent-color {
  font-size: 10px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rtag-recent-time {
  font-size: 10px; color: var(--text-muted); font-family: var(--mono);
}
.rtag-recent-ok {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--success); color: #04140c;
  font-size: 11px; font-weight: 900; line-height: 22px; text-align: center;
}
.rtag-assoc { margin: 0; padding: 14px 22px 8px; }
.rtag-assoc .pt-section-head {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 10px;
}

/* ── live mode badge ── */
#tagging-root.live-mode .live-toggle.on .live-toggle-dot,
#kiosk-tag-root.live-mode .live-toggle.on .live-toggle-dot {
  background: var(--success);
  box-shadow: 0 0 8px rgba(61, 214, 140, .7);
  animation: ops-live-blink 1s step-end infinite;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .rtag-models { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rtag-recent { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .rtag-cols { grid-template-columns: 1fr; }
  .rtag-col  { border-right: 0; border-bottom: 1px solid var(--panel-border); }
  .rtag-models { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rtag-recent { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .rtag-models { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rtag-recent { grid-template-columns: 1fr; }
  .rtag-page-hdr { flex-direction: column; align-items: flex-start; }
}

/* ── Module 03 — Reader Administration ───────────────────────── */
#module-03 { background: var(--content-bg); }

.ra-layout { display: flex; height: 100%; overflow: hidden; }

.ra-sidebar {
  width: 240px; flex: none; border-right: 1px solid var(--panel-border);
  background: var(--panel-bg); display: flex; flex-direction: column; overflow: hidden;
}
.ra-sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px 11px; border-bottom: 1px solid var(--panel-border); flex: none;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); font-weight: 600;
}
.ra-sidebar-head .btn-ghost { padding: 4px 10px; font-size: 11px; }
.ra-reader-list { flex: 1; overflow-y: auto; padding: 6px; }

.ra-reader-item {
  padding: 9px 10px; border-radius: 7px; cursor: pointer; margin-bottom: 2px;
  border: 1px solid transparent; transition: background 0.1s;
}
.ra-reader-item:hover:not(.selected) { background: rgba(245, 196, 0),0.06); }
.ra-reader-item.selected { background: rgba(245, 196, 0),0.10); border-color: rgba(245, 196, 0),0.28); }
.ra-reader-name { font-size: 12.5px; color: var(--text); font-weight: 500; }
.ra-reader-meta { font-size: 10.5px; color: var(--text-dim); margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ra-reader-empty { color: var(--text-muted); font-size: 12px; text-align: center; padding: 28px 14px; line-height: 1.6; }

.ra-status-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ra-status-dot.active      { background: var(--success); }
.ra-status-dot.planned     { background: var(--text-muted); }
.ra-status-dot.offline     { background: var(--danger); }
.ra-status-dot.maintenance { background: var(--warning); }

.ra-canvas { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--content-bg); }
.ra-canvas-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; border-bottom: 1px solid var(--panel-border);
  background: var(--panel-bg); flex: none; min-height: 42px;
}
.ra-canvas-label { font-size: 10.5px; color: var(--text-muted); }
.ra-floor-svg { flex: 1; width: 100%; height: 100%; display: block; cursor: grab; user-select: none; }
.ra-floor-svg:active { cursor: grabbing; }
.ra-floor-svg.placing { cursor: crosshair; }

.ra-detail {
  width: 272px; flex: none; border-left: 1px solid var(--panel-border);
  background: var(--panel-bg); overflow-y: auto; display: flex; flex-direction: column;
}
.ra-detail-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 12px; text-align: center; padding: 24px; line-height: 1.6;
}
.ra-detail-head {
  padding: 11px 14px; border-bottom: 1px solid var(--panel-border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none;
  background: var(--panel-bg); position: sticky; top: 0; z-index: 1;
}
.ra-detail-title { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra-detail-body { padding: 12px 14px 20px; }
.ra-detail-field { margin-bottom: 11px; }
.ra-detail-field label { display: block; font-size: 9.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.ra-detail-field input, .ra-detail-field select {
  width: 100%; background: var(--content-bg); border: 1px solid var(--panel-border);
  border-radius: 5px; color: var(--text); font-size: 12.5px; padding: 6px 8px; outline: none;
}
.ra-detail-field input:focus, .ra-detail-field select:focus { border-color: var(--gold); }

.ra-section-divider {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-dim); font-weight: 600; margin: 14px 0 9px;
  padding-bottom: 7px; border-bottom: 1px solid var(--panel-border);
}
.ra-antenna-item {
  background: var(--content-bg); border: 1px solid var(--panel-border);
  border-radius: 6px; padding: 7px 9px; margin-bottom: 5px;
  display: flex; align-items: center; gap: 8px;
}
.ra-ant-port {
  width: 22px; height: 22px; background: var(--gold); color: var(--gold-ink);
  border-radius: 4px; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.ra-ant-info { flex: 1; }
.ra-ant-label { font-size: 12px; color: var(--text); }
.ra-ant-range { font-size: 10.5px; color: var(--text-dim); }
.ra-ant-del {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 3px 5px; border-radius: 4px; font-size: 13px;
}
.ra-ant-del:hover { color: var(--danger); background: rgba(224,82,82,0.1); }

.ra-place-hint {
  font-size: 11px; color: var(--text-dim); text-align: center;
  padding: 8px 10px; border-radius: 6px; line-height: 1.5;
  background: rgba(245, 196, 0),0.06); border: 1px dashed rgba(245, 196, 0),0.28); margin-bottom: 10px;
}
.ra-place-hint b { color: var(--gold); }

.ra-add-form { background: var(--content-bg); border-top: 1px solid var(--panel-border); padding: 12px; }
.ra-add-form .ra-detail-field { margin-bottom: 8px; }

/* ── Module 03 extended: view toggle, search, 3D, grid dialog ────────────── */
.ra-view-toggle { display: flex; gap: 0; border: 1px solid var(--panel-border); border-radius: 7px; overflow: hidden; flex: none; }
.ra-vtbtn { background: transparent; border: none; padding: 4px 12px; font-size: 11px; color: var(--text-dim); cursor: pointer; transition: background .12s, color .12s; }
.ra-vtbtn:hover { background: var(--chip-bg); color: var(--text); }
.ra-vtbtn.active { background: var(--gold); color: #1a1200; font-weight: 600; }

.ra-cov-btn { font-size: 11px; padding: 4px 10px; }
.ra-cov-btn.active { border-color: rgba(245, 196, 0),.5); color: var(--gold); }

.ra-search-row { display: flex; gap: 6px; padding: 6px 8px; flex: none; }
.ra-search { flex: 1; background: var(--chip-bg); border: 1px solid var(--panel-border); border-radius: 6px;
  padding: 5px 8px; font-size: 11.5px; color: var(--text); outline: none; }
.ra-search:focus { border-color: var(--gold); }
.ra-status-filter { background: var(--chip-bg); border: 1px solid var(--panel-border); border-radius: 6px;
  padding: 4px 6px; font-size: 11px; color: var(--text); cursor: pointer; outline: none; }

.ra-count-badge { display: inline-block; background: var(--chip-bg); color: var(--text-dim); font-size: 10px;
  padding: 1px 7px; border-radius: 20px; margin-left: 5px; font-family: var(--mono); }

.ra-sidebar-stats { padding: 10px 12px; border-top: 1px solid var(--panel-border); flex: none; }
.ra-stat-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ra-stat-sub { font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.ra-stat-chip { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-dim);
  background: var(--chip-bg); border-radius: 6px; padding: 3px 8px; }

/* Per-reader list row additions */
.ra-ri-left  { flex: 1; min-width: 0; }
.ra-ri-btns  { display: flex; gap: 4px; flex: none; align-items: center; }
.ra-ri-text  { display: flex; align-items: center; gap: 6px; }

.ra-eye-btn { background: transparent; border: none; cursor: pointer; padding: 3px 5px; border-radius: 5px;
  color: var(--text-dim); font-size: 14px; line-height: 1; transition: background .1s; }
.ra-eye-btn:hover { background: var(--chip-bg); color: var(--text); }
.ra-eye-btn.dimmed { opacity: .35; }

.ra-hidden-item { opacity: .45; }

/* 3D canvas */
.ra-3d-canvas { flex: 1; width: 100%; height: 100%; display: block; outline: none; }

/* Camera preset row */
.ra-preset-group { display: flex; gap: 4px; flex: none; }

/* Auto-place / grid */
.ra-auto-btn { font-size: 11px; padding: 4px 8px; }

/* Grid placement dialog */
.ra-grid-dlg { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; }
.ra-grid-dlg-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.ra-grid-dlg-box { position: relative; background: var(--surface); border: 1px solid var(--panel-border);
  border-radius: 14px; padding: 22px 24px 20px; width: 340px; max-width: 96vw; z-index: 1; }
.ra-grid-dlg-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.ra-grid-row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.ra-grid-field { flex: 1; }
.ra-grid-field label { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-dim); margin-bottom: 4px; }
.ra-grid-field input { width: 100%; background: var(--chip-bg); border: 1px solid var(--panel-border);
  border-radius: 6px; padding: 5px 8px; font-size: 12px; color: var(--text); box-sizing: border-box; }
.ra-grid-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* ── Module 04: DB Administration ─────────────────────────────────────────── */
.dba-layout { display: flex; height: 100%; overflow: hidden; }
.dba-sidebar { width: 180px; flex: none; background: var(--content-bg); border-right: 1px solid var(--panel-border);
  display: flex; flex-direction: column; overflow-y: auto; }
.dba-sidebar-head { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim);
  padding: 14px 14px 8px; font-weight: 600; }
.dba-table-item { display: flex; align-items: center; gap: 8px; padding: 8px 14px; cursor: pointer;
  font-size: 13px; color: var(--text); border-left: 3px solid transparent; transition: background .12s; }
.dba-table-item:hover { background: var(--chip-bg); }
.dba-table-item.active { border-left-color: var(--gold); background: var(--chip-bg); color: var(--gold); }
.dba-tbl-icon { font-size: 14px; opacity: .5; }
.dba-tbl-count { margin-left: auto; font-size: 10px; color: var(--text-dim); font-family: var(--mono); }
.dba-divider { flex: 1; }
.dba-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.dba-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--panel-border); flex: none; }
.dba-tbl-title { font-weight: 600; font-size: 15px; color: var(--text); flex: none; }
.dba-search { flex: 1; padding: 7px 11px; border-radius: 7px; border: 1px solid var(--panel-border);
  background: var(--chip-bg); color: var(--text); font-size: 13px; }
.dba-search:focus { outline: none; border-color: var(--gold); }
.dba-table-wrap { flex: 1; overflow: auto; padding: 0; }
.dba-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dba-table th { background: var(--chip-bg); color: var(--text-dim); text-transform: uppercase;
  font-size: 10px; letter-spacing: .05em; padding: 8px 12px; text-align: left;
  position: sticky; top: 0; border-bottom: 1px solid var(--panel-border); }
.dba-table td { padding: 7px 12px; border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dba-table tr:hover td { background: var(--chip-bg); }
.dba-null { color: var(--text-dim) !important; font-style: italic; }
.dba-del-btn { padding: 3px 8px; border-radius: 5px; border: 1px solid var(--danger);
  background: transparent; color: var(--danger); font-size: 11px; cursor: pointer; }
.dba-del-btn:hover { background: var(--danger); color: #fff; }
.dba-empty, .dba-loading { padding: 40px; text-align: center; color: var(--text-dim); font-size: 13px; }
.dba-status { padding: 8px 16px; font-size: 12px; height: 34px; flex: none; }
.dba-status.ok  { color: var(--success); }
.dba-status.err { color: var(--danger); }
.dba-expand-btn { padding: 3px 7px; border-radius: 5px; border: 1px solid var(--panel-border);
  background: none; color: var(--text-dim); cursor: pointer; font-size: 14px; margin-right: 4px; }
.dba-expand-btn:hover { border-color: var(--gold); color: var(--gold); }
.dba-expand-btn.active { border-color: var(--gold); color: var(--gold); background: var(--chip-bg); }
.dba-data-row { cursor: default; }
.dba-detail-row td { background: var(--sidebar-bg) !important; }
.dba-detail-cell { padding: 12px 16px !important; }
.dba-detail-field { display: flex; gap: 12px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 12px; }
.dba-detail-field:last-child { border-bottom: none; }
.dba-detail-key { width: 140px; flex: none; color: var(--text-dim); font-family: var(--mono); font-size: 11px; padding-top: 1px; }
.dba-detail-val { flex: 1; color: var(--text); word-break: break-all; font-family: var(--mono); font-size: 12px; }

/* ── Module 05: Part Tracing ───────────────────────────────────────────────── */
.pt-body { padding: 0 24px 48px; max-width: 1120px; margin: 0 auto; }
.pt-search-panel { max-width: 280px; margin: 0 auto 28px; }
.pt-search-row { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.pt-field label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 6px; }
.pt-searchbar { display: flex; margin-bottom: 12px; }
.pt-search-actions { display: flex; gap: 10px; }
.pt-search-actions .btn-primary,
.pt-search-actions .btn-ghost { flex: 1; }
.pt-search-input { width: 100%; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--panel-border);
  background: var(--chip-bg); color: var(--text); font-size: 14px; box-sizing: border-box; }
.pt-search-input:focus { outline: none; border-color: var(--gold); }
.pt-suggestions { position: relative; background: var(--content-bg); border: 1px solid var(--panel-border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.4); overflow: hidden; margin-bottom: 10px; z-index: 10; }
.pt-sug-item { padding: 9px 14px; cursor: pointer; font-size: 13px; color: var(--text); }
.pt-sug-item:hover { background: var(--chip-bg); }
.pt-not-found { padding: 14px 18px; background: var(--chip-bg); border-radius: 8px;
  color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }
.pt-detail { background: var(--content-bg); border: 1px solid var(--panel-border);
  border-radius: 10px; padding: 18px 20px; margin-bottom: 24px; }
.pt-detail-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pt-detail-title { font-size: 18px; font-weight: 700; color: var(--text); }
.pt-detail-sub { font-size: 13px; color: var(--text-dim); }
.pt-detail-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; margin-left: auto; }
.pt-detail-badge.tagged   { background: rgba(61,214,140,.15); color: #3dd68c; border: 1px solid rgba(61,214,140,.3); }
.pt-detail-badge.untagged { background: rgba(143,163,180,.1); color: var(--text-dim); border: 1px solid rgba(143,163,180,.2); }
.pt-timeline { display: flex; flex-direction: column; gap: 0; }
.pt-tl-row { display: flex; gap: 14px; }
.pt-tl-left { display: flex; flex-direction: column; align-items: center; flex: none; width: 30px; }
.pt-tl-dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 11px; color: #fff; flex: none; }
.pt-tl-line { flex: 1; width: 2px; background: var(--panel-border); min-height: 24px; margin: 3px 0; }
.pt-tl-body { padding-bottom: 20px; }
.pt-tl-label  { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 3px; }
.pt-tl-detail { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.pt-tl-time   { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
.pt-section-head { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim);
  font-weight: 600; margin: 8px 0 12px; display: flex; align-items: center; justify-content: space-between; }
.pt-empty { padding: 24px; text-align: center; color: var(--text-dim); font-size: 13px; }

.asset-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.asset-list .pt-empty { grid-column: 1 / -1; }
.asset-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  color: inherit; font: inherit;
  box-sizing: border-box;
  min-width: 0;
}
button.asset-row { cursor: pointer; appearance: none; -webkit-appearance: none; }
button.asset-row:hover { border-color: var(--gold); }
.asset-swatch {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.asset-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.asset-title { font-size: 15px; font-weight: 700; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-sub { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-right {
  flex: none;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.asset-val { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.asset-meta-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  width: max-content;
  max-width: 100%;
}
.asset-epc {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.asset-meta { font-size: 11px; color: var(--gold); font-weight: 600; font-family: var(--mono); text-align: right; }
.asset-right .btn-danger { min-height: 32px; padding: 6px 12px; font-size: 12px; width: auto; }

/* ── Module 06: Live Operations ────────────────────────────────────────────── */
.rt-layout { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.rt-top { display: flex; gap: 12px; padding: 16px; flex: none; flex-wrap: wrap; }
.rt-card { background: var(--content-bg); border: 1px solid var(--panel-border); border-radius: 10px;
  padding: 14px 16px; flex: 1; min-width: 200px; }
.rt-card-stats { flex: none; min-width: 220px; }
.rt-card-head { font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-dim); font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.rt-badge { background: var(--chip-bg); color: var(--text-dim); font-size: 10px; padding: 1px 7px;
  border-radius: 20px; font-weight: 500; }
.rt-reader-grid { display: flex; flex-direction: column; gap: 6px; }
.rt-reader-chip { display: flex; align-items: center; gap: 9px; padding: 6px 8px;
  border-radius: 7px; background: var(--chip-bg); border: 1px solid transparent; }
.rt-reader-chip.alive { border-color: rgba(61,214,140,.25); }
.rt-reader-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex: none; }
.rt-reader-dot.alive { background: #3dd68c; box-shadow: 0 0 6px #3dd68c88; }
.rt-reader-info { display: flex; flex-direction: column; }
.rt-reader-name { font-size: 12px; font-weight: 600; color: var(--text); }
.rt-reader-meta { font-size: 10px; color: var(--text-dim); font-family: var(--mono); }
.rt-station-list { display: flex; flex-direction: column; gap: 6px; }
.rt-station-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px;
  border-radius: 7px; background: var(--chip-bg); }
.rt-st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.rt-st-dot.stale { background: var(--text-dim); }
.rt-st-info { flex: 1; display: flex; flex-direction: column; }
.rt-st-name { font-size: 12px; font-weight: 600; color: var(--text); }
.rt-st-epc  { font-size: 10px; color: var(--text-dim); font-family: var(--mono); }
.rt-dwell { font-size: 11px; color: var(--gold); font-family: var(--mono); }
.rt-dwell.stale { color: var(--text-dim); }
.rt-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rt-stat-chip { background: var(--chip-bg); border-radius: 8px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px; }
.rt-stat-num { font-size: 22px; font-weight: 700; color: var(--text); font-family: var(--mono); }
.rt-stat-lbl { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.rt-bottom { flex: 1; display: flex; flex-direction: column; overflow: hidden; border-top: 1px solid var(--panel-border); }
.rt-log-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px;
  background: var(--content-bg); border-bottom: 1px solid var(--panel-border); flex: none; font-size: 12px; font-weight: 600; color: var(--text); }
.rt-log-badge { background: var(--chip-bg); color: var(--text-dim); font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 400; }
.rt-pause-lbl { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-dim); font-weight: 400; cursor: pointer; margin-left: auto; }
.rt-clear-btn { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--panel-border);
  background: transparent; color: var(--text-dim); font-size: 11px; cursor: pointer; }
.rt-clear-btn:hover { border-color: var(--gold); color: var(--gold); }
.rt-sse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); display: inline-block; }
.rt-sse-dot.connected    { background: #3dd68c; box-shadow: 0 0 5px #3dd68c88; }
.rt-sse-dot.connecting   { background: var(--gold); }
.rt-sse-dot.disconnected { background: var(--danger); }
.rt-log-wrap { flex: 1; overflow-y: auto; font-family: var(--mono); font-size: 11.5px; }
.rt-log-inner { display: flex; flex-direction: column; }
.rt-log-row { display: flex; align-items: center; gap: 10px; padding: 5px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03); }
.rt-log-row:hover { background: var(--chip-bg); }
.rt-log-ts { color: var(--text-dim); flex: none; width: 90px; }
.rt-log-kind { flex: none; font-size: 9px; font-weight: 700; letter-spacing: .06em;
  padding: 2px 6px; border-radius: 4px; }
.rt-log-kind.read { background: rgba(61,214,140,.12); color: #3dd68c; }
.rt-log-kind.hb   { background: rgba(143,163,180,.1); color: var(--text-dim); }
.rt-log-tankid  { flex: none; width: 108px; font-weight: 600; color: var(--text); }
.rt-log-epc     { flex: 1; color: var(--text-dim); font-size: 10.5px; }
.rt-log-station { flex: none; width: 120px; color: var(--text-dim); }
.rt-log-rssi    { flex: none; width: 62px; color: var(--text-dim); text-align: right; }
.rt-log-header  { display: flex; align-items: center; gap: 10px; padding: 4px 16px 4px;
  border-bottom: 1px solid var(--panel-border); font-size: 9.5px; font-weight: 700;
  letter-spacing: .06em; color: var(--text-dim); text-transform: uppercase; background: var(--chip-bg); }
.rt-filter-sel  { padding: 2px 6px; border-radius: 6px; border: 1px solid var(--panel-border);
  background: var(--chip-bg); color: var(--text-dim); font-size: 11px; cursor: pointer; font-family: var(--mono); }
.rt-empty { padding: 30px; text-align: center; color: var(--text-dim); font-size: 13px; }

/* ── Module 06: Live Operations dashboard ──────────────────────────────────── */
.ops-wrap { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 24px; overflow: visible; height: auto; min-height: 0; box-sizing: border-box; width: 100%; }

/* KPI tiles */
.ops-kpi-row { display: flex; gap: 12px; flex-wrap: wrap; flex: none; }
.ops-kpi-card { flex: 1 1 130px; border-radius: 12px; padding: 16px 16px 13px;
  display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--panel-border);
  background: var(--content-bg); border-top-width: 3px; }
.ops-kpi-num { font-size: 30px; font-weight: 700; font-family: var(--mono); line-height: 1; }
.ops-kpi-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); font-weight: 600; }
.ops-kpi-sub { font-size: 10px; color: var(--text-dim); opacity: 0.7; margin-top: 1px; }
.kpi-blue   { border-top-color: #4a7db5; } .kpi-blue   .ops-kpi-num { color: #4a7db5; }
.kpi-green  { border-top-color: #3d9e6a; } .kpi-green  .ops-kpi-num { color: #3d9e6a; }
.kpi-amber  { border-top-color: #c88830; } .kpi-amber  .ops-kpi-num { color: #c88830; }
.kpi-red    { border-top-color: #c05050; } .kpi-red    .ops-kpi-num { color: #c05050; }
.kpi-purple { border-top-color: #9b59b6; } .kpi-purple .ops-kpi-num { color: #9b59b6; }

/* Cards */
.ops-card { background: var(--content-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 14px 16px; }
.ops-card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ops-card-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text); }
.ops-card-sub { font-size: 11px; color: var(--text-dim); }

/* Main charts row — 3 columns */
.ops-main-row { display: flex; gap: 14px; flex: none; }
.ops-card-wip   { flex: 1.4; min-width: 200px; }
.ops-card-donut { flex: 1;   min-width: 175px; }
.ops-card-rate  { flex: 1.4; min-width: 200px; }

/* WIP SVG chart */
.ops-wip-chart { height: 190px; overflow: hidden; }

/* Donut */
.ops-donut-wrap { display: flex; align-items: center; justify-content: center; }
.ops-donut-svg  { width: 100%; height: 190px; overflow: visible; }

/* Rate chart */
.ops-rate-chart { height: 168px; overflow: hidden; }

/* Live feed */
.ops-card-feed  { flex: none; }
.ops-feed-head  { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ops-feed-badge { background: var(--chip-bg); color: var(--text-dim); font-size: 10px; padding: 2px 8px; border-radius: 20px; }
.ops-sse-dot    { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); display: inline-block; }
.ops-sse-dot.connected    { background: #3dd68c; box-shadow: 0 0 5px #3dd68c88; }
.ops-sse-dot.connecting   { background: var(--gold); }
.ops-sse-dot.disconnected { background: var(--danger); }
.ops-btn-sm { padding: 3px 10px; border-radius: 6px; border: 1px solid var(--panel-border);
  background: var(--chip-bg); color: var(--text); cursor: pointer; font-size: 11px; }
.ops-btn-sm:hover { border-color: var(--gold); color: var(--gold); }
.ops-feed-log { max-height: 130px; overflow-y: auto; font-family: var(--mono); font-size: 11px; }
.ops-feed-row { display: flex; gap: 12px; padding: 3px 4px; border-bottom: 1px solid var(--panel-border); }
.ops-feed-row:hover { background: var(--chip-bg); }
.ops-feed-ts   { color: var(--text-dim); flex: none; width: 70px; }
.ops-feed-tank { font-weight: 600; color: var(--text); flex: none; width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-feed-st   { flex: 1; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-feed-rssi { color: var(--text-dim); flex: none; width: 60px; text-align: right; }
.ops-chart-empty { padding: 20px; text-align: center; color: var(--text-dim); font-size: 13px; }

@media (max-width: 700px) {
  .ops-main-row { flex-direction: column; }
}

/* ── Modules 07–10: Analytics shared styles ────────────────────────────────── */
.perf-body { padding: 0 24px 40px; }
.perf-kpi-row,
.ops-stn-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin: 0 0 12px;
}
@media (max-width: 1100px) {
  .perf-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .perf-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ops-sum-box {
  border: 1px solid var(--gold);
  border-radius: var(--radius-card);
  padding: 20px 22px 18px;
  background: var(--panel-bg);
  box-sizing: border-box;
}
.ops-live-box {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 16px 22px;
  margin: 0 0 18px;
  align-items: center;
}
.ops-gauge {
  grid-row: 1 / 3;
  position: relative;
  width: 188px;
  height: 188px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-card);
  background: var(--chip-bg);
  cursor: pointer;
  color: var(--gold);
}
.ops-gauge svg { width: 100%; height: 100%; display: block; }
.ops-gauge-track { fill: none; stroke: var(--panel-border); stroke-width: 10; }
.ops-gauge-arc {
  fill: none;
  stroke: var(--gold);
  stroke-width: 10;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 70px 70px;
  filter: drop-shadow(0 0 8px rgba(245, 196, 0, .35));
}
.ops-gauge-core {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}
.ops-gauge-n { font: 700 36px var(--mono); color: var(--text); line-height: 1; }
.ops-gauge-l { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.ops-gauge .ops-ico { width: 26px; height: 26px; margin-bottom: 4px; }
.ops-ico { width: 20px; height: 20px; color: var(--gold); flex: none; }
.st-ico { display: block; overflow: visible; }
.st-pick { position: relative; min-width: 220px; }
.st-pick-btn,
.st-pick-opt {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: var(--chip-bg); color: var(--text);
  border: 1px solid var(--panel-border); border-radius: 8px;
  padding: 7px 10px; cursor: pointer; font: inherit; font-size: 14px;
}
.st-pick-btn:hover,
.st-pick-opt:hover { border-color: var(--gold); color: var(--gold); }
.st-pick-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  z-index: 40; max-height: 320px; overflow-y: auto;
  overscroll-behavior: contain; scrollbar-gutter: stable;
  background: var(--chip-bg); border: 1px solid var(--gold);
  border-radius: 8px; box-shadow: var(--shadow); padding: 4px;
}
.st-pick-list::-webkit-scrollbar { width: 8px; }
.st-pick-list::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 8px; }
.st-pick.open-up .st-pick-list { top: auto; bottom: calc(100% + 4px); }
.st-pick-opt { border: 0; border-radius: 6px; margin: 0; background: transparent; }
.st-pick-opt.on { background: var(--gold-soft); color: var(--gold); }
.st-pick-opt:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.st-pick-btn span,
.st-pick-opt span { line-height: 1.2; }
.st-pick-btn .ops-ico,
.st-pick-opt .ops-ico { width: 30px; height: 30px; }
.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.st-btn .ops-ico { width: 28px; height: 28px; }
.ops-live-parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}
.ops-share {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px 12px;
  text-align: left;
  background: var(--chip-bg);
  border: 1px solid var(--card-line);
}
.ops-share-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ops-share .ops-ico { width: 28px; height: 28px; margin-bottom: 0; }
.ops-share-p { font-size: 11px; color: var(--text-muted); }
.ops-share-bar {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 4px;
  background: var(--chip-bg);
  border-radius: 2px;
  overflow: hidden;
}
.ops-share-bar i { display: block; height: 100%; background: var(--gold); }
.ops-stn-box {
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  min-width: 0;
}
.ops-stn-box .ops-stn-row,
.ops-pipe {
  display: flex;
  grid-template-columns: none;
  align-items: stretch;
  gap: 8px;
  margin: 0;
  width: 100%;
}
.ops-pipe-sep {
  flex: none;
  align-self: center;
  padding: 0 2px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
}
.ops-pipe-step .ops-ico { width: 28px; height: 28px; }
.ops-pipe-step {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 12px 14px;
  background: var(--chip-bg);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-card);
  color: var(--text);
  cursor: pointer;
}
.ops-pipe-n { font: 700 22px var(--mono); line-height: 1; }
.ops-pipe-l { font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); line-height: 1.25; }
.ops-out-kicker {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ops-out-box {
  border: 1px solid var(--gold);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  background: var(--panel-bg);
  box-sizing: border-box;
  margin-bottom: 16px;
}
.ops-out-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 0;
}
.ops-off-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 16px 18px;
  background: var(--chip-bg);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-card);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.ops-off-card .ops-ico { width: 28px; height: 28px; }
.ops-off-card:hover,
.ops-share:hover,
.ops-pipe-step:hover,
.ops-gauge:hover { border-color: var(--gold); }
.ops-gauge:hover .ops-gauge-arc { stroke: var(--gold); }
.ops-off-n { font: 700 26px var(--mono); line-height: 1; }
.ops-off-l { flex: 1; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.ops-off-chev { color: var(--gold); font-size: 22px; line-height: 1; }
@media (max-width: 1100px) {
  .ops-live-box { grid-template-columns: 1fr; }
  .ops-gauge { grid-row: auto; justify-self: center; }
  .ops-live-parts { grid-template-columns: 1fr; }
  .ops-pipe { flex-wrap: wrap; gap: 8px; }
  .ops-pipe-sep { display: none; }
  .ops-pipe-step { flex: 1 1 30%; }
  .ops-out-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .ops-live-parts { grid-template-columns: 1fr; }
  .ops-pipe-step { flex-basis: 46%; }
  .ops-out-row { grid-template-columns: 1fr; }
}
.perf-kpi-chip { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: var(--radius-card);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; width: 100%; min-width: 0; box-sizing: border-box; }
button.perf-kpi-chip { color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.perf-kpi-chip:hover { border-color: var(--gold); }
.ops-gauge,
.ops-share,
.ops-pipe-step,
.ops-off-card { border: 1px solid var(--card-line); }
.perf-kpi-num { font-size: 26px; font-weight: 700; color: var(--text); font-family: var(--mono); line-height: 1; }
.ops-live-box .ops-share .perf-kpi-num { font-size: 28px; }
.perf-kpi-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); font-weight: 600; }
.perf-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin: 0;
}
@media (max-width: 800px) { .perf-charts { grid-template-columns: 1fr; } }
.perf-chart-card { background: var(--panel-bg); border: 1px solid var(--card-line); border-radius: var(--radius-card); padding: 16px 18px; min-width: 0; }
.perf-chart-head { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim);
  font-weight: 600; margin-bottom: 14px; }
.perf-donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.perf-donut-legend { width: 100%; }
.perf-donut-legend .perf-legend-row { gap: 6px; padding: 4px 0; font-size: 12px; }
.perf-donut-legend .perf-legend-dot { width: 12px; height: 12px; border-width: 1px; }
.perf-donut-legend .perf-legend-lbl {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.perf-donut-legend .perf-legend-val { font-size: 12px; }
.mix-legend-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
}
.perf-legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text); padding: 6px 0; }
button.perf-legend-row {
  width: 100%; background: transparent; border: 0; cursor: pointer; text-align: left; font: inherit;
}
button.perf-legend-row:hover { color: var(--gold); }
.perf-legend-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; border: 2px solid rgba(255,255,255,.12); }
.perf-legend-lbl { flex: 1; color: var(--text-dim); }
.perf-legend-val { font-family: var(--mono); font-size: 14px; color: var(--text); font-weight: 700; }
.perf-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.perf-bar-lbl { width: 140px; flex: none; font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perf-bar-track { flex: 1; height: 10px; background: var(--chip-bg); border-radius: 5px; overflow: hidden; }
.perf-bar-fill  { height: 100%; background: var(--gold); border-radius: 5px; transition: width .3s ease; }
.perf-bar-val   { width: 36px; text-align: right; font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.perf-no-data   { padding: 20px; text-align: center; color: var(--text-dim); font-size: 13px; }

.mix-toolbar { display: flex; justify-content: flex-end; margin: 4px 0 8px; min-height: 32px; }
canvas.mix-donut { cursor: pointer; }
.perf-legend-row.mix-legend-on,
.perf-legend-row.mix-legend-on .perf-legend-lbl { color: var(--gold); }

/* ── Global circular spinner ───────────────────────────────────────────────── */
.g-spinner {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 9999;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.g-spinner.active { opacity: 1; }
.g-spinner-svg {
  position: absolute;
  top: 0; left: 0;
  width: 48px; height: 48px;
}
.g-spinner.active .g-spinner-svg { animation: g-spin-rot 1.2s linear infinite; }
.g-spinner.active .g-spinner-svg.has-pct { animation: none; }
@keyframes g-spin-rot {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.g-spinner-track {
  stroke: var(--panel-border, rgba(255,255,255,0.12));
}
.g-spinner-arc {
  stroke: var(--gold, #F5C400);
  stroke-dasharray: 113.1;
  stroke-dashoffset: 72; /* ~36% visible arc for spinning state */
  transition: stroke-dashoffset 0.3s ease;
}
.g-spinner-pct {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold, #F5C400);
  font-family: var(--mono, monospace);
  letter-spacing: -0.03em;
}

/* ── Live Ops dashboard header row ─────────────────────────────────────────── */
.ops-dash-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 2px 0 10px;
  flex: none;
}
.ops-dash-head .ops-dash-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.ops-dash-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ops-dash-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ops-dash-date {
  font-size: 12px;
  color: var(--text-dim);
}
.ops-dash-clock {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 3.2em;
  text-align: right;
}
.ops-live-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ops-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: none;
}
.ops-live-flag.on {
  color: var(--text);
}
.ops-live-flag.on .ops-live-dot {
  background: var(--success);
  box-shadow: 0 0 8px rgba(61, 214, 140, .7);
  animation: ops-live-blink 1s step-end infinite;
}
@keyframes ops-live-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.15; }
}
