:root {
  --navy: #0b1220;
  --navy-2: #121a2b;
  --accent: #e8c547;
  --accent-soft: #f5d76e;
  --text: #e8eef8;
  --muted: #8b97ab;
  --line: rgba(232, 238, 248, 0.08);
  --bg: #070b14;
  --card: #101826;
  --ok: #3ddc97;
  --warn: #f0a202;
  --err: #ff5c6c;
  --info: #4da6ff;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px rgba(0, 0, 0, 0.28);
  --radius: 14px;
  --rail: 68px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 13px; }
body {
  font: 400 13px/1.45 "Plus Jakarta Sans", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  letter-spacing: 0.01em;
  min-height: 100vh;
}
body.app {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  background:
    radial-gradient(1100px 520px at 18% -12%, rgba(232, 197, 71, 0.08), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(77, 166, 255, 0.07), transparent 50%),
    var(--bg);
}

.shell {
  width: min(1360px, calc(100% - 32px));
  margin-inline: auto;
}
.content { padding: 18px 0 48px; }
.app-main { min-width: 0; }

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
  background: rgba(8, 12, 22, 0.92);
  border-right: 1px solid var(--line);
  z-index: 20;
}
.rail-brand {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(232, 197, 71, 0.18), rgba(232, 197, 71, 0.06));
  border: 1px solid rgba(232, 197, 71, 0.35);
  color: var(--accent-soft);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 0 18px rgba(232, 197, 71, 0.16);
}
.rail-nav { display: grid; gap: 8px; }
.rail-nav a {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #7d8aa0;
  border-radius: 11px;
  text-decoration: none;
}
.rail-nav a svg { width: 18px; height: 18px; }
.rail-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.rail-nav a.active {
  color: var(--accent-soft);
  background: rgba(232, 197, 71, 0.12);
  box-shadow: 0 0 16px rgba(232, 197, 71, 0.18);
}

.top {
  background: rgba(11, 18, 32, 0.78);
  color: #fff;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 15;
}
.top .shell {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 58px;
}
.brand { display: flex; gap: 10px; align-items: center; min-width: 200px; }
.brand strong { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; }
.brand small { display: block; color: #8b97ab; font-size: 10px; font-weight: 500; letter-spacing: 0.06em; }
.mark { width: 3px; height: 26px; background: var(--accent-soft); border-radius: 2px; box-shadow: 0 0 10px rgba(232, 197, 71, 0.5); }
.top nav { display: flex; gap: 2px; flex: 1; }
.top nav a {
  color: #9aa6ba;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  position: relative;
}
.top nav a:hover { color: #fff; }
.top nav a.active { color: #fff; }
.top nav a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(232, 197, 71, 0.7);
}
.who { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #b7c4d4; }
.who-chip {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}
button.linkish, .linkish {
  background: none; border: 0; color: #fff; cursor: pointer; font: inherit; text-decoration: none;
  opacity: 0.85;
}
button.linkish:hover, .linkish:hover { opacity: 1; text-decoration: underline; }

h1 {
  font-size: 1.7rem;
  margin: 0 0 4px;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.04em;
}
h2 {
  font-size: 0.78rem;
  margin: 22px 0 8px;
  color: #d7deea;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.muted { color: var(--muted); font-size: 12px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 6px;
}
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(232, 197, 71, 0.7);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 197, 71, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(232, 197, 71, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 197, 71, 0); }
}
.hint { font-size: 11px; color: var(--muted); }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.kpi-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
  min-height: 108px;
}
.kpi-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi-value {
  display: block;
  margin: 8px 0 6px;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.05em;
  color: #fff;
}
.kpi-trend {
  font-size: 11px;
  font-weight: 700;
}
.kpi-trend.ok { color: var(--ok); }
.kpi-trend.err { color: var(--err); }
.kpi-trend.muted { color: var(--muted); }

.ops-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 12px;
  margin-bottom: 16px;
}
.ops-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 36%), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 12px;
  min-width: 0;
}
.ops-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.ops-card-head h2 { margin: 0; }
.ops-chart { width: 100%; min-height: 168px; }
.ops-chart.donut { min-height: 210px; }
.ops-chart.line { min-height: 220px; }
.chart-svg { width: 100%; height: auto; display: block; }
.donut-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.donut-legend li {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.donut-legend .swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.donut-legend b { color: #fff; font-variant-numeric: tabular-nums; }
.donut-legend em { font-style: normal; color: #9aa6ba; font-variant-numeric: tabular-nums; }
.chart-legend {
  display: flex;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 11px;
  color: var(--muted);
}
.chart-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.lg-blue { background: #4da6ff; box-shadow: 0 0 8px #4da6ff; }
.lg-teal { background: #2ee6c7; box-shadow: 0 0 8px #2ee6c7; }
.lg-gold { background: #f5d76e; box-shadow: 0 0 8px #f5d76e; }
.quiet-link {
  color: var(--accent-soft);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}
.quiet-link:hover { text-decoration: underline; }
.alert-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.alert-feed li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.alert-feed a {
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.alert-feed strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #eef3fb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alert-feed span { display: block; font-size: 11px; color: var(--muted); }
.alert-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.alert-dot.err { background: var(--err); box-shadow: 0 0 10px rgba(255, 92, 108, 0.7); }
.alert-dot.warn { background: var(--warn); box-shadow: 0 0 10px rgba(240, 162, 2, 0.7); }
.alert-dot.ok { background: var(--ok); box-shadow: 0 0 10px rgba(61, 220, 151, 0.7); }
.alert-empty { color: var(--muted); font-size: 12px; padding: 18px 4px; }

.auto-bar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.auto-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 20px;
}
.auto-switches {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px 24px;
  flex: 1 1 720px;
}
.auto-switch {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.auto-interval { display: grid; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 500; }
.auto-interval span { display: flex; align-items: center; gap: 6px; }
.auto-interval input { width: 76px; }
.soap-mode-form { margin: 0; display: flex; }
#soap-mode-form { position: absolute; width: 0; height: 0; overflow: hidden; }
.auto-last { margin: 8px 0 0; }
.reset-form { margin: 10px 0 0; }
.switch {
  display: inline-block;
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 40px;
  vertical-align: middle;
}
.switch input,
.table-card .switch input[type="checkbox"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: 0;
  width: 40px;
  height: 22px;
  opacity: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.slider {
  position: absolute;
  inset: 0;
  background: #2a3346;
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  pointer-events: none;
  transition: background 0.15s ease;
}
.slider:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}
.switch input:checked + .slider { background: var(--ok); box-shadow: 0 0 10px rgba(61, 220, 151, 0.35); }
.switch input:checked + .slider:before { transform: translateX(18px); }

button, .button {
  display: inline-block;
  background: var(--accent);
  color: #1a1406;
  border: 0;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
button:hover, .button:hover { filter: brightness(1.06); }
button:disabled, .button:disabled { opacity: 0.55; cursor: wait; filter: none; }
button.secondary, .button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
button.danger, .button.danger {
  background: transparent;
  color: var(--err);
  border: 1px solid rgba(255, 92, 108, 0.35);
}
button.danger:hover, .button.danger:hover { background: rgba(255, 92, 108, 0.1); filter: none; }
body.dlg-open { overflow: hidden; }
.dlg {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}
.dlg[hidden] { display: none !important; }
.dlg-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.72);
  backdrop-filter: blur(8px);
}
.dlg-card {
  position: relative;
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  padding: 18px 20px 16px;
}
.dlg-card .eyebrow { margin: 0 0 6px; }
.dlg-title {
  margin: 0 0 8px !important;
  font-size: 1.12rem !important;
  letter-spacing: -0.02em !important;
  text-transform: none !important;
  color: #fff;
}
.dlg-body {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
}
.dlg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.stats article {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stats strong { display: block; font-size: 1.25rem; color: #fff; font-weight: 700; letter-spacing: -0.03em; }
.stats span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
}
.accordion {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 14px 0 12px;
  overflow: hidden;
}
.accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  background: #0d1524;
  color: #fff;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  user-select: none;
}
.accordion[open] > summary { border-bottom-color: var(--accent); }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary::marker { content: ""; }
.acc-title {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.acc-count {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 700;
  background: rgba(232, 197, 71, 0.14);
  color: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
}
.acc-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--accent-soft);
  border-bottom: 2px solid var(--accent-soft);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex: 0 0 auto;
}
.accordion[open] > summary .acc-chevron {
  transform: rotate(225deg);
  margin-top: 3px;
}
.accordion .table-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}
.accordion .table-actions {
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #0d1524;
}
.accordion .mapping-copy {
  padding: 12px 14px 0;
}
.accordion .mapping-copy .muted,
.accordion .mapping-copy .hint,
.accordion .mapping-copy .flash {
  margin: 0 0 8px;
  box-shadow: none;
}
.accordion table.mapping {
  margin: 0;
}
.accordion .acc-pad { padding: 0 14px 14px; }
html.is-live .accordion .acc-body { opacity: 0.78; }
.table-scroll {
  overflow: auto;
  max-height: min(72vh, 840px);
}
.table-card table { background: transparent; min-width: 760px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); }
th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 12px;
}
th {
  font-size: 10px;
  color: #c5d0de;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #0d1524;
  white-space: nowrap;
}
.table-card thead tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 2px solid var(--accent);
}
.table-card thead tr:first-child th:not(:last-child) {
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}
.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #d7e0ea;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.sort-link:hover { color: #fff; }
.sort-link.active { color: #fff; }
.sort-ind {
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-bottom: 5px solid currentColor;
  opacity: 0.28;
  transform: translateY(1px);
}
.sort-link.active.asc .sort-ind { opacity: 1; color: var(--accent-soft); }
.sort-link.active.desc .sort-ind {
  opacity: 1;
  color: var(--accent-soft);
  border-bottom: 0;
  border-top: 5px solid currentColor;
  transform: translateY(-1px);
}
.sort-stack { display: flex; flex-wrap: nowrap; gap: 4px 14px; align-items: center; }
.sort-stack .sort-link { text-transform: uppercase; letter-spacing: 0.06em; }
.sort-stack.ratio-head { gap: 2px 4px; }
.sort-sep { color: var(--muted); font-weight: 500; }
.ratio { font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.filter-row th {
  position: sticky;
  top: 36px;
  z-index: 2;
  background: #141c2c;
  padding: 6px 8px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.col-filter {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0b1220;
  color: var(--text);
  box-shadow: none;
}
.col-filter::placeholder { color: #6b7688; }
.filter-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filter-actions .col-filter { flex: 1 1 80px; }
.filter-actions button { padding: 5px 10px; font-size: 11px; height: 28px; }
.filter-stack { display: flex; flex-direction: column; gap: 4px; }
tr.filter-row th.filter-blank {
  background: #141c2c;
  box-shadow: none;
}
.table-card tbody tr td {
  background: #101826;
  transition: background 0.12s ease;
}
.table-card tbody tr:nth-child(even) td { background: #0e1624; }
.table-card tbody tr:hover td { background: #172033; }
.table-card tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
.table-card tbody td:not(:last-child) { border-right: 1px solid rgba(255, 255, 255, 0.03); }
.table-card tbody a {
  color: #e8eef8;
  font-weight: 600;
  text-decoration: none;
}
.table-card tbody a:hover { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 2px; }
.table-card tbody code {
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--accent-soft);
}
.num { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; white-space: nowrap; }
th.num .sort-link { justify-content: flex-end; width: 100%; }
th.check, td.check { width: 36px; text-align: center; padding-left: 10px; padding-right: 6px; }
.nowrap { white-space: nowrap; }
.cell-main { font-weight: 600; color: #fff; }
.cell-sub { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); font-weight: 400; }
.map-list { display: grid; gap: 3px; font-size: 11px; line-height: 1.25; color: var(--muted); }
.map-list b {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-weight: 500;
  color: #e8eef8;
  font-size: 10.5px;
}
.empty-row td {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  background: #0e1624 !important;
  border-right: 0 !important;
  box-shadow: none !important;
  font-size: 12px;
}
.table-card input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  vertical-align: middle;
}
.row-action {
  background: none !important;
  border: 0 !important;
  color: var(--accent-soft) !important;
  padding: 0 !important;
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  filter: none !important;
}
.row-action:hover { color: #fff !important; }
.table-actions {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 18px;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
  padding: 9px 12px;
  font-size: 11px;
  color: var(--muted);
  background: #0d1524;
  border-top: 1px solid var(--line);
}
.pager-meta { font-variant-numeric: tabular-nums; }
.pager-links { display: flex; gap: 6px; align-items: center; }
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 11px;
}
.pager-btn:hover { border-color: var(--accent); color: #fff; }
.pager-btn.is-off {
  color: #5d6778;
  background: transparent;
  border-color: transparent;
  min-width: 0;
}
.pager-clear { border-color: rgba(232, 197, 71, 0.4); color: var(--accent); }
code { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 11px; }

.pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(77, 166, 255, 0.12);
  color: var(--info);
}
.pill.ok { background: rgba(61, 220, 151, 0.12); color: var(--ok); }
.pill.warn { background: rgba(240, 162, 2, 0.14); color: var(--warn); }
.pill.err { background: rgba(255, 92, 108, 0.14); color: var(--err); }

.flash {
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--card);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 12px;
  box-shadow: var(--shadow);
}
.flash.ok { border-left-color: var(--ok); }
.flash.err { border-left-color: var(--err); }
.flash.warn { border-left-color: var(--warn); }

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.grid-form label, .stack label, .login-card label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
input, select {
  font: inherit;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #0b1220;
  font-size: 12px;
}
input:focus, select:focus {
  outline: 2px solid rgba(232, 197, 71, 0.28);
  border-color: var(--accent);
}
.form-actions { display: flex; gap: 8px; margin: 12px 0 6px; }
.grid-form .form-actions { grid-column: 1 / -1; margin-top: 6px; }
.grid-form label.check {
  display: flex !important;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  grid-column: 1 / -1;
  width: auto;
  text-align: left;
  padding: 6px 0 2px;
}
.grid-form label.check input { margin-top: 2px; }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form .form-section {
  grid-column: 1 / -1;
  margin: 8px 0 0;
}
.grid-form .form-section:first-child { margin-top: 0; }
.grid-form .hint a { color: var(--accent-soft); }
tr.is-inactive td { opacity: 0.72; }

.mapping-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 14px;
  box-shadow: var(--shadow);
}
.mapping-card h2 { margin-top: 0; }
.mapping { margin-top: 8px; min-width: 0; }
.mapping th { position: static; }
.mapping td { vertical-align: top; }
.mapping tbody tr:hover td { background: #172033; }
.mapping input { width: 100%; min-width: 160px; }
.mapping tr.group-row th {
  background: #141c2c;
  color: var(--accent-soft);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mapping tbody tr.group-row:hover th { background: #141c2c; }

.filters { display: flex; gap: 8px; margin-bottom: 12px; }
.filters input, .filters select { min-width: 140px; }
.inline-upload { display: flex; gap: 8px; margin-top: 10px; }
.sftp-home { scroll-margin-top: 12px; }
.sftp-home-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}
.sftp-home-head h2 { margin: 0; }
.sftp-home-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.sftp-home .sftp-today-hint,
.sftp-home .sftp-empty-today { display: none; }
.sftp-home.today-only.has-files .sftp-today-hint { display: block; }
.sftp-home.today-only .sftp-older { display: none; }
.sftp-home.today-only.has-files:not(.has-today) .files { display: none; }
.sftp-home.today-only.has-files:not(.has-today) .sftp-empty-today { display: block; }
.files {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 12px;
}
.files li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
.files .file-mtime { color: var(--muted); font-size: 11px; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
.meta dt { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.meta dd { margin: 0; font-size: 12px; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(800px 400px at 50% 0%, rgba(232, 197, 71, 0.14), transparent 55%),
    var(--bg);
}
.login-card {
  width: 380px;
  background: var(--card);
  padding: 24px 26px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.login-card h1 { margin-bottom: 6px; font-size: 1.35rem; }
.stack { display: grid; gap: 10px; margin-top: 14px; }
.stack button { justify-self: start; }

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cell-with-icon {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.icon-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  text-decoration: none !important;
  font-weight: 400 !important;
  box-shadow: none;
}
.icon-btn:hover {
  color: var(--accent-soft) !important;
  border-color: rgba(232, 197, 71, 0.45);
  background: rgba(232, 197, 71, 0.08);
  text-decoration: none !important;
  filter: none;
}
.table-card tbody a.icon-btn:hover { text-decoration: none; }
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
  min-height: calc(100vh - 160px);
}
.preview-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.preview-pane header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.preview-pane h2 { margin: 0; }
.preview-name { margin-top: 4px; }
.preview-meta {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.preview-body {
  margin: 0;
  padding: 12px 14px 16px;
  overflow: auto;
  flex: 1;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.45;
  white-space: pre;
  color: var(--text);
  background: #0b1220;
}
.preview-empty {
  margin: 0;
  padding: 36px 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .ops-grid, .donut-wrap { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  body.app { grid-template-columns: 1fr; }
  .rail { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid-form, .meta { grid-template-columns: 1fr; }
  .auto-switches { grid-template-columns: 1fr; }
  .top .shell { flex-wrap: wrap; padding: 8px 0; }
  .preview-grid { grid-template-columns: 1fr; min-height: 0; }
}
