/* AEGIS Control Panel V3 — Command Centre Tab Styles */

/* Owner-ordered operator console: platinum instrument surface on the existing V3 shell. */
:root {
  --bg-dark:#090a0b; --bg-surface:#111315; --bg-card:#171a1d; --bg-card-hover:#202428;
  --border-subtle:rgba(225,229,232,.16); --border-active:rgba(211,216,220,.42);
  --text-main:#f1f3f4; --text-muted:#c2c7cb; --text-dim:#a3a9ae;
  --accent-cyan:#d0d4d7; --accent-gold:#c4c8cb; --accent-indigo:#b2b8bd;
  --color-ok:#d6dade; --color-warn:#dfb65e; --color-bad:#ee7771; --color-unverified:#b6bdc2;
}
.legacy-command-centre[hidden] { display:none !important; }
.ops-console {
  --ops-bg: #101214;
  --ops-panel: #171a1d;
  --ops-line: #41464b;
  --ops-text: #f3f4f5;
  --ops-muted: #bdc2c7;
  --ops-metal: #c5c9cd;
  margin: 0 0 26px;
  padding: clamp(16px, 2.1vw, 28px);
  color: var(--ops-text);
  background: linear-gradient(145deg, #1b1e21, var(--ops-bg) 56%);
  border: 1px solid #62686e;
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.08);
}
.ops-console * { min-width: 0; }
.ops-console-head, .ops-section-heading, .ops-action-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.ops-console-head { padding-bottom:20px; border-bottom:1px solid var(--ops-line); }
.ops-console-head h2 { margin:4px 0; font:700 clamp(24px,3vw,34px)/1.12 var(--font-brand); letter-spacing:-.03em; }
.ops-console-head p { max-width:70ch; color:var(--ops-muted); }
.ops-console-tools { display:flex; align-items:center; justify-content:flex-end; gap:10px; }
.ops-updated, .ops-source { color:var(--ops-muted); font:500 11px/1.4 var(--font-mono); }
.ops-section { margin-top:20px; padding:18px; background:rgba(3,4,5,.36); border:1px solid var(--ops-line); border-radius:9px; }
.ops-section-heading { padding-bottom:13px; margin-bottom:14px; border-bottom:1px solid #34393d; }
.ops-section-heading > div { display:flex; align-items:center; gap:10px; }
.ops-section-heading h3 { font:650 17px/1.2 var(--font-brand); letter-spacing:.01em; }
.ops-index { color:var(--ops-metal); font:600 11px var(--font-mono); }
.ops-device-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.ops-device { padding:13px; background:var(--ops-panel); border:1px solid #41474d; border-radius:7px; }
.ops-sandbox-item[aria-pressed="true"] { outline:2px solid var(--ops-metal); outline-offset:2px; }
.ops-device strong { display:block; font-size:14px; }
.ops-device-state { display:flex; align-items:center; gap:7px; margin:7px 0; color:var(--ops-text); font:600 11px var(--font-mono); text-transform:uppercase; }
.ops-state-dot { width:8px; height:8px; flex:0 0 8px; border-radius:50%; background:#969da3; }
.ops-state-dot[data-state="online"], .ops-state-dot[data-state="healthy"] { background:#d3d7da; box-shadow:0 0 8px rgba(230,234,237,.42); }
.ops-state-dot[data-state="degraded"], .ops-state-dot[data-state="warning"] { background:#d4a853; }
.ops-state-dot[data-state="offline"], .ops-state-dot[data-state="error"] { background:#dc6c68; }
.ops-device small { display:block; color:var(--ops-muted); font-size:11px; line-height:1.45; overflow-wrap:anywhere; }
.ops-task-layout { display:grid; grid-template-columns:minmax(260px,.8fr) minmax(0,1.2fr); gap:18px; }
.ops-task-controls { display:grid; align-content:start; gap:8px; }
.ops-console label, .ops-label { color:var(--ops-muted); font-size:12px; font-weight:600; }
.ops-console select, .ops-console textarea { width:100%; min-height:44px; padding:10px 12px; color:var(--ops-text); background:#090b0d; border:1px solid #656b71; border-radius:5px; font:500 13px var(--font-sans); }
.ops-console textarea { min-height:80px; resize:vertical; }
.ops-console :focus-visible { outline:3px solid #e1e4e7; outline-offset:2px; }
.ops-button { min-height:44px; padding:9px 14px; color:#0c0e10; background:linear-gradient(#e1e4e7,#bfc4c8); border:1px solid #f6f7f8; border-radius:5px; font:700 11px var(--font-mono); letter-spacing:.035em; text-transform:uppercase; cursor:pointer; }
.ops-button:hover:not(:disabled) { filter:brightness(1.08); }
.ops-button-secondary { color:var(--ops-text); background:#22272b; border-color:#697077; }
.ops-button:disabled { opacity:.45; cursor:not-allowed; }
.ops-action-row { justify-content:flex-start; flex-wrap:wrap; margin-top:11px; }
.ops-note { color:var(--ops-muted); font-size:11px; line-height:1.5; }
.ops-task-evidence { padding:14px; background:#0b0d0f; border:1px solid #383e43; border-radius:6px; }
.ops-task-evidence h4 { margin:0 0 8px; font-size:14px; }
.ops-task-evidence ul { max-height:180px; margin:8px 0 0; padding:0 0 0 18px; overflow:auto; color:var(--ops-muted); font-size:11px; line-height:1.55; }
.ops-task-evidence li { margin:4px 0; overflow-wrap:anywhere; }
.ops-kv { display:grid; grid-template-columns:130px minmax(0,1fr); gap:7px 12px; font-size:12px; }
.ops-kv dt { color:var(--ops-muted); }
.ops-kv dd { margin:0; overflow-wrap:anywhere; }
.ops-kv a { color:#e2e6e9; }
.ops-error { margin-top:9px; padding:9px; color:#ffd4d1; background:#291716; border-left:3px solid #d66a63; font-size:12px; overflow-wrap:anywhere; }
.ops-workstream-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.ops-workstream-grid .ops-section { margin-top:14px; }
.ops-workstream-body { min-height:80px; color:var(--ops-text); font-size:13px; }
.ops-workstream-body video { display:block; width:100%; max-height:300px; margin-top:10px; background:#000; border:1px solid var(--ops-line); }
.ops-sandbox-banner { margin:0 0 12px; padding:8px 10px; color:#e6d6b4; background:#272116; border:1px solid #685a39; font:700 10px var(--font-mono); letter-spacing:.04em; }
.ops-result { min-height:20px; margin-top:10px; color:var(--ops-muted); font-size:12px; overflow-wrap:anywhere; }
.ops-empty { padding:12px; color:var(--ops-muted); background:#0d0f11; border:1px dashed #575d62; font-size:12px; }
.ops-console [hidden] { display:none !important; }
@media (max-width:1100px) { .ops-device-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:760px) {
  .ops-console { margin:0 -8px 20px; padding:14px; border-radius:8px; }
  .ops-console-head, .ops-section-heading { align-items:flex-start; flex-direction:column; }
  .ops-console-tools { width:100%; justify-content:space-between; }
  .ops-device-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ops-task-layout, .ops-workstream-grid { grid-template-columns:1fr; }
  .ops-section { padding:13px; }
  .ops-action-row > .ops-button { flex:1 1 145px; }
  .ops-kv { grid-template-columns:100px minmax(0,1fr); }
}
@media (max-width:390px) { .ops-device-grid { grid-template-columns:1fr 1fr; } .ops-device { padding:10px; } }
@media (prefers-reduced-motion:reduce) { .ops-console *, .ops-console *::before, .ops-console *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; scroll-behavior:auto !important; } }

/* ── STATUS STRIP ── */
.cc-status-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.cc-status-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 70px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.cc-status-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cc-status-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 4px;
}

/* ── METRICS GRID ── */
.cc-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.cc-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.cc-metric-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cc-metric-value {
  font-family: var(--font-brand);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
}

.cc-metric-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ── COMMAND CANVAS MAIN ── */
.cc-canvas-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.cc-table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  white-space: nowrap;
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 13px;
}

.cc-table th, .cc-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.cc-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.2);
}

.cc-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* ── TELEMETRY GAUGES ── */
.cc-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.cc-telemetry-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 12px;
}

.cc-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.cc-progress-fill {
  height: 100%;
  background: var(--accent-cyan);
  transition: width 0.3s ease;
}

.cc-progress-fill.warn { background: var(--accent-gold); }
.cc-progress-fill.bad { background: var(--color-bad); }

/* ── QUEUE PIPELINE BARS ── */
.cc-queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.cc-queue-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 12px;
}

.cc-queue-count {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-top: 4px;
}

/* ── ACTION MUTATION CONTROLS (GATED) ── */
.cc-action-panel {
  border: 1px solid var(--border-gold);
  background: rgba(245, 158, 11, 0.04);
}

.cc-btn-action {
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--accent-gold);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cc-btn-action:hover {
  background: var(--accent-gold);
  color: #000;
}

/* ── LOG VIEWER ── */
.cc-log-box {
  background: #03050a;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ── RESPONSIVE OVERRIDES ── */
@media (max-width: 1024px) {
  .cc-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cc-canvas-grid {
    grid-template-columns: 1fr;
  }
  .cc-telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .cc-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cc-canvas-grid {
    grid-template-columns: 1fr;
  }
  .cc-telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .cc-table {
    font-size: 11px;
  }
  .cc-table th, .cc-table td {
    padding: 6px 8px;
  }
  .cc-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cc-canvas-grid {
    grid-template-columns: 1fr;
  }
  .cc-telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cc-queue-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cc-queue-card {
    padding: 10px;
  }
}

@media (max-width: 420px) {
  .cc-status-strip {
    grid-template-columns: 1fr;
  }
  .cc-metrics-grid {
    grid-template-columns: 1fr;
  }
  .cc-telemetry-grid {
    grid-template-columns: 1fr;
  }
  .cc-metric-value {
    font-size: 22px;
  }
  .cc-table {
    font-size: 10px;
  }
  .cc-table th, .cc-table td {
    padding: 6px 6px;
  }
  .cc-canvas-grid {
    grid-template-columns: 1fr;
  }
  .cc-table th, .cc-table td {
    padding: 4px 6px;
    white-space: nowrap;
  }
}

/* ── INTEGRATION ACCEPTANCE / READINESS EVIDENCE ── */
.cc-acceptance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.cc-evidence-list, .cc-readiness-map {
  display: grid;
  gap: 10px;
}
.cc-evidence-row {
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  padding: 10px 12px;
}
.cc-evidence-row strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cc-evidence-row span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}
@media (max-width: 900px) {
  .cc-acceptance-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .cc-evidence-row { padding: 9px; }
  .cc-evidence-row strong { font-size: 10px; }
}

.cc-map-link{display:inline-block;color:var(--accent-cyan);font-family:var(--font-mono);font-size:12px;text-transform:uppercase;letter-spacing:.6px}


/* Raw worker terminal monitor */
.cc-worker-monitor-card{margin:16px 0}
.cc-worker-monitor-help{margin:0 0 12px;color:var(--text-muted);font-size:12px;line-height:1.5}
.cc-worker-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:8px}
.cc-worker-btn{min-width:0;text-align:left;border:1px solid var(--line-2);background:rgba(5,7,11,.72);color:var(--text);padding:11px;border-radius:4px;cursor:pointer}
.cc-worker-btn:hover,.cc-worker-btn:focus-visible{border-color:var(--accent-cyan);outline:none}
.cc-worker-btn[data-state="WORKING"]{border-left:3px solid var(--color-ok)}
.cc-worker-btn[data-state="STALLED"],.cc-worker-btn[data-state="STALE_STATE"],.cc-worker-btn[data-state="SUBMITTED_STALE_STATE"]{border-left:3px solid var(--accent-gold)}
.cc-worker-name{display:flex;align-items:center;justify-content:space-between;gap:8px;font-family:var(--font-mono);font-size:12px;font-weight:700;text-transform:uppercase}
.cc-worker-detail{margin-top:7px;color:var(--text-muted);font-family:var(--font-mono);font-size:10px;line-height:1.45;overflow-wrap:anywhere}
.cc-worker-empty{color:var(--text-dim);font-family:var(--font-mono);font-size:12px}
.cc-worker-terminal-dialog{width:min(1100px,94vw);max-height:88%;border:1px solid var(--line-2);border-radius:6px;background:#05070b;color:var(--text);padding:0}
.cc-worker-terminal-dialog::backdrop{background:rgba(0,0,0,.78)}
.cc-terminal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px;border-bottom:1px solid var(--line-2)}
.cc-terminal-head h2{margin:2px 0 0;font-size:20px}
.cc-terminal-meta,.cc-terminal-route{font-family:var(--font-mono);font-size:11px;color:var(--text-muted);overflow-wrap:anywhere}
.cc-terminal-route{padding:9px 16px;border-bottom:1px solid var(--line);background:rgba(10,27,46,.38)}
.cc-terminal-close{min-width:44px;min-height:44px;border:1px solid var(--line-2);background:transparent;color:var(--text);font-size:24px;cursor:pointer}
.cc-worker-terminal-output{margin:0;padding:16px;min-height:360px;max-height:62vh;overflow:auto;background:#020409;color:#d7e2ec;font:11px/1.5 var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:640px){
  .cc-worker-grid{grid-template-columns:1fr;max-height:520px;overflow:auto;padding-right:4px;overscroll-behavior:contain}
  .cc-evidence-list,.cc-readiness-map{max-height:440px;overflow:auto;padding-right:4px;overscroll-behavior:contain}
  .cc-worker-terminal-dialog{width:96vw}
  .cc-worker-terminal-output{min-height:300px;font-size:10px}
}

/* Actionable review queue: metric number is an operator control, not dead telemetry. */
.cc-metric-button{font:inherit;text-align:left;width:100%;color:inherit;cursor:pointer;appearance:none}
.cc-metric-button:hover,.cc-metric-button:focus-visible{border-color:var(--accent-gold);outline:none;box-shadow:0 0 0 1px rgba(245,158,11,.18)}
.cc-review-dialog{width:min(1380px,96vw);height:min(860px,92vh);border:1px solid var(--line-2);border-radius:7px;background:#05070b;color:var(--text);padding:0}
.cc-review-dialog::backdrop{background:rgba(0,0,0,.82)}
.cc-review-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;padding:16px;border-bottom:1px solid var(--line-2)}
.cc-review-head h2{margin:2px 0 4px;font-size:20px}.cc-review-summary{font:11px/1.5 var(--font-mono);color:var(--text-muted)}
.cc-review-toolbar{display:grid;grid-template-columns:220px minmax(260px,1fr);gap:12px;padding:12px 16px;border-bottom:1px solid var(--line)}
.cc-review-toolbar label{display:grid;gap:5px;font:10px var(--font-mono);color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px}
.cc-review-toolbar select,.cc-review-toolbar input{min-height:44px;border:1px solid var(--line-2);background:#080c12;color:var(--text);padding:8px;font:12px var(--font-mono)}
.cc-review-layout{display:grid;grid-template-columns:minmax(340px,.9fr) minmax(0,1.6fr);height:calc(92vh - 150px);max-height:710px}
.cc-review-queue{min-width:0;border-right:1px solid var(--line-2);display:flex;flex-direction:column;overflow:hidden}
.cc-review-list{overflow:auto;min-height:0;flex:1}.cc-review-item{width:100%;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--text);padding:11px 14px;text-align:left;cursor:pointer}
.cc-review-item:hover,.cc-review-item:focus-visible,.cc-review-item[aria-current="true"]{background:rgba(12,38,59,.5);outline:none}.cc-review-item strong{display:block;font:12px var(--font-mono);color:var(--accent-cyan)}
.cc-review-item span{display:block;margin-top:5px;font:11px/1.35 var(--font-mono);color:var(--text-muted)}.cc-review-item .state{color:var(--accent-gold);font-weight:700}
.cc-review-pager{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px;border-top:1px solid var(--line-2);font:11px var(--font-mono)}
.cc-review-pager button{min-height:44px;border:1px solid var(--line-2);background:#080c12;color:var(--text);padding:7px 12px;cursor:pointer}.cc-review-pager button:disabled{opacity:.35;cursor:default}
.cc-review-detail{overflow:auto;padding:16px;font-size:12px;line-height:1.5}.cc-review-detail h3{margin:0 0 6px;font-size:17px}.cc-review-detail h4{margin:18px 0 8px;font:11px var(--font-mono);text-transform:uppercase;letter-spacing:.6px;color:var(--text-muted)}
.cc-review-kv{display:grid;grid-template-columns:140px 1fr;gap:7px 12px}.cc-review-kv dt{font:10px var(--font-mono);color:var(--text-dim);text-transform:uppercase}.cc-review-kv dd{margin:0;overflow-wrap:anywhere}
.cc-review-criteria,.cc-review-artifacts{display:grid;gap:7px}.cc-review-criterion,.cc-review-artifact{border:1px solid var(--line);background:rgba(255,255,255,.018);padding:9px 10px;overflow-wrap:anywhere}
.cc-review-artifact{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px}.cc-review-artifact a{border:1px solid var(--line-2);padding:6px 9px;color:var(--accent-cyan);text-decoration:none;font:10px var(--font-mono);text-transform:uppercase}.cc-review-artifact code{font-size:10px}
.cc-review-empty{padding:18px;color:var(--text-muted);font:12px var(--font-mono)}
@media(max-width:760px){.cc-review-dialog{width:98vw;height:94vh}.cc-review-toolbar{grid-template-columns:1fr}.cc-review-layout{grid-template-columns:1fr;height:calc(94vh - 205px);max-height:none}.cc-review-queue{border-right:0;border-bottom:1px solid var(--line-2);max-height:42vh}.cc-review-detail{min-height:0}.cc-review-kv{grid-template-columns:1fr}.cc-review-artifact{grid-template-columns:1fr}.cc-review-artifact a{justify-self:start}}
