/* Result MotherAdmin R1 — Operator Console
   Theme: dark navy/slate + amber accents. Desktop-first, responsive. */

:root {
  --bg-deep: #0b1220;
  --bg: #0f172a;
  --bg-panel: #1e293b;
  --bg-panel-2: #243044;
  --bg-elevated: #273449;
  --bg-hover: #2d3a50;
  --border: #334155;
  --border-soft: #293548;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.14);
  --amber-border: rgba(245, 158, 11, 0.45);
  --cyan: #38bdf8;
  --green: #34d399;
  --red: #f87171;
  --orange: #fb923c;
  --blue: #60a5fa;
  --sidebar-w: 232px;
  --tree-w: 280px;
  --detail-w: 320px;
  --filter-h: auto;
  --topbar-h: 48px;
  --font: "IBM Plex Sans", "Source Sans 3", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

.empty-dash {
  color: var(--text-dim);
}

/* ─── App shell ─── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #111c31 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-dim);
  flex-shrink: 0;
}

.brand-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px 16px;
}

.nav-section {
  margin-top: 12px;
  margin-bottom: 4px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.nav-section:first-child {
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  transition: background 0.12s, color 0.12s;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--amber-dim);
  color: var(--amber);
  font-weight: 500;
}

.nav-item .nav-ico {
  width: 16px;
  text-align: center;
  opacity: 0.7;
  font-size: 11px;
}

.nav-item.indent {
  padding-left: 28px;
  font-size: 12.5px;
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.operator-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.badge-ro {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid var(--amber-border);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 12px;
}
.btn-ghost:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

/* ─── Main ─── */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.92);
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.page-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}

.crumb {
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}
.status-dot.ok {
  background: var(--green);
}
.status-dot.warn {
  background: var(--amber);
}
.status-dot.err {
  background: var(--red);
}

.health-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Filter bar ─── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-panel);
  flex-shrink: 0;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 110px;
}

.filter-group label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="date"],
.filter-group input[type="search"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 8px;
  min-height: 30px;
  color: var(--text);
  outline: none;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--amber-border);
  box-shadow: 0 0 0 2px var(--amber-dim);
}

.filter-group.grow {
  flex: 1;
  min-width: 180px;
}

.date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: flex-end;
  padding-bottom: 1px;
}

.chip-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  min-height: 28px;
}
.chip-btn:hover {
  border-color: var(--text-dim);
  color: var(--text);
}
.chip-btn.active {
  background: var(--amber-dim);
  border-color: var(--amber-border);
  color: var(--amber);
}

.custom-range {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-left: auto;
}

.btn-primary {
  background: var(--amber);
  color: #1a1205;
  border: 0;
  border-radius: var(--radius);
  padding: 6px 14px;
  font-weight: 600;
  font-size: 12px;
  min-height: 30px;
}
.btn-primary:hover {
  filter: brightness(1.05);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 12px;
  min-height: 30px;
}
.btn-secondary:hover {
  background: var(--bg-hover);
}

/* ─── Workspace (tree | center | detail) ─── */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: var(--tree-w) 1fr var(--detail-w);
  min-height: 0;
  overflow: hidden;
}

.workspace.no-tree {
  grid-template-columns: 1fr var(--detail-w);
}

.workspace.no-detail {
  grid-template-columns: var(--tree-w) 1fr;
}

.workspace.single {
  grid-template-columns: 1fr;
}

.panel {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.panel-tree {
  border-right: 1px solid var(--border);
  background: #121a2b;
}

.panel-detail {
  border-left: 1px solid var(--border);
  background: #121a2b;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  background: rgba(30, 41, 59, 0.55);
}

.panel-head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.panel-body {
  flex: 1;
  overflow: auto;
  padding: 8px;
}

/* ─── Event tree ─── */
.tree-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

.tree-node {
  user-select: none;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  font-size: 12.5px;
}
.tree-row:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.tree-row.active {
  background: var(--amber-dim);
  color: var(--amber);
}
.tree-row .twisty {
  width: 14px;
  color: var(--text-dim);
  font-size: 10px;
  flex-shrink: 0;
}
.tree-children {
  padding-left: 12px;
  border-left: 1px solid var(--border-soft);
  margin-left: 14px;
}
.tree-meta {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--mono);
}
.hist-badge {
  margin-left: 6px;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid var(--amber-border);
  background: var(--amber-dim);
  border-radius: 3px;
  padding: 1px 5px;
  vertical-align: middle;
}
.hist-badge.hist-partial {
  color: var(--orange);
}
.hist-badge.hist-backfill {
  color: var(--cyan);
}
.metric-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 12px;
}
.metric {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  min-width: 120px;
}
.metric-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.metric-val {
  font-family: var(--mono);
  font-size: 16px;
}
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.filter-row select,
.filter-row .chk {
  font: inherit;
  font-size: 12px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
}

/* ─── Center content ─── */
.content-scroll {
  flex: 1;
  overflow: auto;
  padding: 12px 16px 24px;
  min-height: 0;
}

.metrics-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.metric {
  flex: 1;
  min-width: 100px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.metric-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.metric-value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.metric-value.warn {
  color: var(--amber);
}
.metric-value.ok {
  color: var(--green);
}
.metric-value.err {
  color: var(--red);
}

.event-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}

.event-header h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  font-size: 11px;
  color: var(--text-muted);
}
.pill.amber {
  border-color: var(--amber-border);
  background: var(--amber-dim);
  color: var(--amber);
}
.pill.green {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
}
.pill.red {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.1);
  color: var(--red);
}
.pill.blue {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.1);
  color: var(--blue);
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: -1px;
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

/* Cards / tables */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card .big {
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.card .sub {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
}

.market-group {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-panel);
}

.market-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--border);
}

.market-group-head h3 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
}

.market-group-head .count {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table th {
  text-align: left;
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: rgba(15, 23, 42, 0.55);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

.data-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  color: var(--text);
}

.data-table tr:hover td {
  background: rgba(245, 158, 11, 0.04);
}

.data-table tr.selected td {
  background: var(--amber-dim);
}

.data-table.dense td,
.data-table.dense th {
  padding: 5px 8px;
  font-size: 12px;
}

.data-table .actions-cell {
  white-space: nowrap;
}

.btn-action {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  margin-right: 4px;
  cursor: not-allowed;
  opacity: 0.55;
  position: relative;
}

.btn-action[disabled] {
  pointer-events: auto;
}

.btn-action:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0b1220;
  color: var(--amber);
  border: 1px solid var(--amber-border);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
  box-shadow: var(--shadow);
}

/* Detail panel */
.detail-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

.detail-block {
  margin-bottom: 14px;
}

.detail-block h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 4px 8px;
  font-size: 12px;
}

.kv dt {
  color: var(--text-dim);
}
.kv dd {
  margin: 0;
  color: var(--text);
  word-break: break-all;
  font-family: var(--mono);
  font-size: 11.5px;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.btn-block {
  width: 100%;
  text-align: center;
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-dim);
  cursor: not-allowed;
  opacity: 0.6;
  position: relative;
}

.btn-block:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0b1220;
  color: var(--amber);
  border: 1px solid var(--amber-border);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
}

.banner {
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 12px;
  border: 1px solid var(--border);
}
.banner.info {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--cyan);
}
.banner.warn {
  background: var(--amber-dim);
  border-color: var(--amber-border);
  color: var(--amber);
}
.banner.err {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--red);
}

.placeholder-note {
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(30, 41, 59, 0.35);
}

.placeholder-note strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
  font-size: 14px;
}

.loading {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
}

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-width: 360px;
  font-size: 12.5px;
  animation: toast-in 0.18s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Casino list */
.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.game-tile {
  text-align: left;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
  transition: border-color 0.12s, background 0.12s;
}
.game-tile:hover {
  border-color: var(--amber-border);
  background: var(--bg-elevated);
}
.game-tile.active {
  border-color: var(--amber);
  background: var(--amber-dim);
}
.game-tile .name {
  font-weight: 600;
  font-size: 13px;
}
.game-tile .id {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(245, 158, 11, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(56, 189, 248, 0.06), transparent 50%),
    var(--bg-deep);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 28px 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.login-card .brand-title {
  font-size: 18px;
}

.login-card .brand-sub {
  margin-bottom: 22px;
}

.form-field {
  margin-bottom: 14px;
}

.form-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.form-field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  outline: none;
}

.form-field input:focus {
  border-color: var(--amber-border);
  box-shadow: 0 0 0 2px var(--amber-dim);
}

.login-error {
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--red);
  font-size: 12.5px;
}

.login-card .btn-primary {
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
  font-size: 13px;
}

.login-note {
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

/* Mobile / tablet */
@media (max-width: 1200px) {
  :root {
    --detail-w: 280px;
    --tree-w: 240px;
  }
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
  }
  .sidebar.open {
    transform: none;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
  }
  .sidebar-backdrop.show {
    display: block;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .panel-tree,
  .panel-detail {
    border: 0;
    max-height: 280px;
    border-bottom: 1px solid var(--border);
  }
  .panel-detail {
    order: 3;
    max-height: 320px;
    border-top: 1px solid var(--border);
  }
  .menu-toggle {
    display: inline-flex !important;
  }
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}

.table-wrap {
  overflow-x: auto;
}

.selections-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ops-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ops-modal.hidden { display: none; }
.ops-modal-card {
  background: var(--panel, #1b1f24);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  max-width: 440px;
  width: 92%;
}
.ops-modal-card h2 { margin: 0 0 8px; font-size: 16px; }
.ops-modal-card p { margin: 0 0 12px; color: var(--text-muted); font-size: 13px; }
.ops-modal-card input {
  width: 100%;
  margin: 6px 0 14px;
  padding: 8px;
}
.ops-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.audit-line { font-size: 11px; margin: 4px 0; color: var(--text-muted); }
.actions-cell { white-space: nowrap; }
.actions-cell .btn-action { margin: 1px; font-size: 10px; padding: 2px 6px; }
