/* ============================================================
   HERMES MISSION CONTROL — sci-fi command-center theme
   Deep black/blue field, thick neon-green edges, amber/orange
   accents, halve-transparante witte pijl detail.
   ============================================================ */

:root {
  --bg:        #02060a;
  --bg-2:      #04101a;
  --panel:     rgba(8, 22, 18, 0.72);
  --panel-2:   rgba(6, 30, 22, 0.55);
  --grid-line: rgba(0, 255, 153, 0.06);
  --edge:      #00ff88;          /* helder neon-groen */
  --edge-dim:  rgba(0, 255, 136, 0.35);
  --edge-glow: rgba(0, 255, 136, 0.55);
  --green:     #00ff8c;
  --amber:     #ffb020;
  --orange:    #ff6a2b;
  --red:       #ff3b3b;
  --cyan:     #36e6ff;
  --accent-2: #6ef58a;
  --blue:     #2f7bff;
  --purple:    #b06bff;
  --fiver:     #ff7ad9;
  --content:   #ffb020;
  --dev:       #36c2ff;
  --faint:     #6f8c84;
  --text:      #cfeede;
  --text-dim:  #7fa597;
  --white-arrow: rgba(255,255,255,0.5);
  --mono: "SFMono-Regular", "JetBrains Mono", "Consolas", ui-monospace, monospace;
  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(0,255,136,0.07), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(47,123,255,0.08), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  overflow: hidden;
}
/* faint engineering grid overlay */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
  z-index: 0;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  position: relative; z-index: 2;
  background: linear-gradient(180deg, rgba(2,16,12,0.96), rgba(2,10,8,0.96));
  border-right: 2px solid var(--edge);
  box-shadow: 4px 0 24px rgba(0,255,136,0.10), inset -1px 0 0 var(--edge-glow);
  display: flex; flex-direction: column;
  padding: 14px 0 10px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 18px 16px;
  border-bottom: 1px solid rgba(0,255,136,0.18);
  margin-bottom: 12px;
}
.brand-mark {
  font-family: var(--mono);
  font-size: 22px; color: var(--edge);
  text-shadow: 0 0 12px var(--edge-glow);
}
.brand-title {
  font-family: var(--mono); font-weight: 700; letter-spacing: 2px;
  font-size: 13px; color: #eafff5; text-shadow: 0 0 10px var(--edge-glow);
}
.brand-sub {
  font-size: 10px; letter-spacing: 3px; color: var(--text-dim);
}
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-dim); font-family: var(--mono);
  font-size: 12.5px; letter-spacing: 0.5px;
  text-align: left; padding: 10px 12px; cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.14s ease;
}
.nav-item:hover { color: var(--text); background: rgba(0,255,136,0.06); }
.nav-item.active {
  color: #eafff5;
  background: linear-gradient(90deg, rgba(0,255,136,0.16), rgba(0,255,136,0.02));
  border-left: 3px solid var(--edge);
  box-shadow: inset 0 0 18px rgba(0,255,136,0.10);
}
.nav-ico { font-size: 15px; color: var(--edge); width: 18px; text-align: center; }
.nav-count {
  margin-left: auto; background: var(--amber); color: #1a1200;
  font-weight: 700; font-size: 10px; border-radius: 10px;
  padding: 1px 7px; box-shadow: 0 0 10px rgba(255,176,32,0.6);
}
.sidebar-foot { padding: 12px 18px 4px; border-top: 1px solid rgba(0,255,136,0.16); }
.conn {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 1px;
  color: var(--amber); text-shadow: 0 0 8px rgba(255,176,32,0.5);
}
.conn.ok { color: var(--green); text-shadow: 0 0 10px var(--edge-glow); }
.conn.bad { color: var(--red); text-shadow: 0 0 10px rgba(255,59,59,0.5); }
.clock { font-family: var(--mono); font-size: 13px; color: var(--text); margin-top: 4px; letter-spacing: 1px; }

/* ===================== MAIN ===================== */
.main {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
}

/* top status bar with green blockjes */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 9px 18px;
  background: linear-gradient(180deg, rgba(0,40,28,0.95), rgba(0,24,18,0.92));
  border-bottom: 2px solid var(--edge);
  box-shadow: 0 4px 22px rgba(0,255,136,0.10), inset 0 -1px 0 var(--edge-glow);
}
.topbar-blocks { display: flex; gap: 4px; align-items: center; }
.topbar-blocks .blk {
  width: 12px; height: 16px; border-radius: 2px;
  background: rgba(0,255,136,0.18);
  box-shadow: inset 0 0 0 1px rgba(0,255,136,0.4);
}
.topbar-blocks .blk.on {
  background: var(--green);
  box-shadow: 0 0 10px var(--edge-glow), inset 0 0 0 1px var(--edge);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.server-time { font-family: var(--mono); font-size: 12px; color: var(--text-dim); letter-spacing: 1px; }

/* ===== LIVE TOPBAR KPI PILLS (neon-groen, glow) ===== */
.topbar-kpis {
  display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap;
  margin-left: 10px;
}
.kpi-pill {
  display: flex; align-items: center; gap: 9px;
  background: linear-gradient(180deg, rgba(0,40,28,0.65), rgba(0,24,18,0.5));
  border: 1px solid rgba(0,255,136,0.28);
  border-left: 3px solid var(--edge);
  border-radius: 8px;
  padding: 5px 13px 5px 11px;
  box-shadow: inset 0 0 18px rgba(0,255,136,0.07), 0 0 12px rgba(0,255,136,0.10);
  position: relative; overflow: hidden;
  min-width: 132px;
}
.kpi-pill::after {
  content: ""; position: absolute; right: -12px; top: -12px;
  width: 34px; height: 34px;
  background: radial-gradient(circle, var(--edge-glow), transparent 70%);
  opacity: 0.22;
}
.kpi-ico { font-size: 20px; line-height: 1; filter: drop-shadow(0 0 6px rgba(0,255,136,0.4)); }
.kpi-pill-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-pill-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-dim); font-weight: 600;
  white-space: nowrap;
}
.kpi-pill-big {
  font-family: var(--mono); font-size: 17px; color: #eafff5;
  line-height: 1.15; margin-top: 1px; white-space: nowrap;
  text-shadow: 0 0 12px rgba(0,255,136,0.30);
  overflow: hidden; text-overflow: ellipsis;
}
.kpi-pill-sub {
  font-size: 10px; color: var(--text-dim); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* omzet-pill: extra groen + glow */
.kpi-rev { border-left-color: var(--green); }
.kpi-rev .kpi-pill-big {
  color: var(--green);
  text-shadow: 0 0 16px rgba(0,255,140,0.55);
  font-size: 19px;
}
.kpi-rev { box-shadow: inset 0 0 20px rgba(0,255,136,0.10), 0 0 16px rgba(0,255,136,0.18); }
/* agents-pill: cyan accent */
.kpi-agents { border-left-color: var(--cyan); }
.kpi-agents .kpi-pill-big { color: var(--cyan); text-shadow: 0 0 12px rgba(54,230,255,0.4); }
/* meeting-pill: purple accent */
.kpi-meeting { border-left-color: var(--purple); }
.kpi-meeting .kpi-pill-big { color: #d9b6ff; text-shadow: 0 0 10px rgba(176,107,255,0.35); }

/* Fiverr Orders sectie */
.fiverr-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fiverr-hint { color: var(--text-dim); font-size: 12px; }
.fiverr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.fiv-card { background: var(--panel); border: 1px solid var(--grid-line); border-radius: 8px; padding: 12px 14px; box-shadow: inset 0 0 24px rgba(255,122,217,0.06); }
.fiv-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fiv-ref { font-family: var(--mono); font-weight: 700; color: var(--fiver); letter-spacing: 0.5px; }
.fiv-type { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin: 6px 0 4px; }
.fiv-brief { color: var(--text); font-size: 13px; line-height: 1.5; }
.fiv-qa { color: var(--cyan); font-size: 12px; margin-top: 6px; }
.fiv-out { font-size: 11px; margin-top: 4px; word-break: break-all; }
.fiv-foot { font-size: 11px; margin-top: 8px; }


@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; }
  .topbar-kpis { width: 100%; order: 3; margin-left: 0; margin-top: 4px; }
  .topbar-right { margin-left: auto; }
}
/* KPI strip */
.kpi-strip {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px 4px;
}
.kpi {
  flex: 1 1 150px; min-width: 140px;
  background: var(--panel);
  border: 1px solid rgba(0,255,136,0.22);
  border-left: 3px solid var(--edge);
  border-radius: 6px;
  padding: 11px 14px;
  box-shadow: inset 0 0 22px rgba(0,255,136,0.05);
  position: relative; overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; right: -10px; top: -10px;
  width: 40px; height: 40px;
  background: radial-gradient(circle, var(--edge-glow), transparent 70%);
  opacity: 0.25;
}
.kpi h3 {
  margin: 0; font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim); font-weight: 600;
}
.kpi .big { font-family: var(--mono); font-size: 24px; color: #eafff5; margin-top: 3px; line-height: 1.1; text-shadow: 0 0 12px rgba(0,255,136,0.25); }
.kpi .sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ===================== CONTENT / SECTIONS ===================== */
.content { flex: 1; overflow-y: auto; padding: 8px 18px 36px; }
.section { display: none; }
.section.active { display: block; animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; } }

.section-title {
  font-family: var(--mono); font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--edge);
  margin: 22px 0 12px; padding-left: 10px;
  border-left: 3px solid var(--edge);
  text-shadow: 0 0 8px var(--edge-glow);
}

/* ===================== PINNED APPROVALS ===================== */
.pin-approvals {
  background: linear-gradient(180deg, rgba(40,26,0,0.55), rgba(20,14,0,0.45));
  border: 1px solid rgba(255,176,32,0.35);
  border-left: 3px solid var(--amber);
  border-radius: 6px;
  padding: 12px 14px;
  position: sticky; top: 0; z-index: 5;
  box-shadow: inset 0 0 26px rgba(255,176,32,0.07);
}
.pin-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pin-title { font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; color: var(--amber); text-shadow: 0 0 8px rgba(255,176,32,0.5); }
.pin-count { background: var(--amber); color: #1a1200; font-weight: 700; font-size: 11px; border-radius: 10px; padding: 1px 8px; }
.pin-body { display: flex; flex-direction: column; gap: 8px; }
.approve-box {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,176,32,0.3);
  border-radius: 5px; padding: 10px 12px;
}
.approve-box .ttl { font-weight: 600; color: #ffe6b8; }
.approve-box .ttl .flag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  background: var(--amber); color: #1a1200; border-radius: 3px; padding: 1px 6px; margin-right: 6px;
}
.approve-box .det { font-size: 12px; color: var(--text-dim); margin: 4px 0 8px; }
.actions { display: flex; gap: 8px; }
.btn {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.5px;
  background: rgba(0,255,136,0.12); color: var(--green);
  border: 1px solid var(--edge); border-radius: 4px;
  padding: 6px 12px; cursor: pointer; transition: all 0.14s;
}
.btn:hover { background: rgba(0,255,136,0.25); box-shadow: 0 0 12px var(--edge-glow); }
.btn.approve { color: var(--green); }
.btn.reject { color: var(--red); border-color: var(--red); background: rgba(255,59,59,0.10); }
.btn.reject:hover { background: rgba(255,59,59,0.22); box-shadow: 0 0 12px rgba(255,59,59,0.4); }
.btn.ghost { background: transparent; border-color: rgba(0,255,136,0.3); color: var(--edge); font-size: 16px; padding: 4px 10px; }
.btn.tiny { font-size: 10.5px; letter-spacing: 0.5px; padding: 3px 9px; }
.btn.small { font-size: 11px; letter-spacing: 0.5px; padding: 4px 10px; }
.empty-note { color: var(--text-dim); font-style: italic; font-size: 13px; padding: 6px 2px; }

/* ===================== ROOMS GRID ===================== */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.room {
  position: relative;
  background:
    linear-gradient(180deg, rgba(6,26,20,0.85), rgba(3,14,11,0.9));
  border: 1px solid rgba(0,255,136,0.18);
  border-left: 4px solid var(--glow, var(--edge));
  border-radius: 7px;
  padding: 14px 15px 13px 18px;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0,255,136,0.05);
  transition: box-shadow 0.2s, transform 0.2s;
}
/* thick neon-green edge glow per status */
.room.working { box-shadow: inset 0 0 34px rgba(0,255,140,0.12), 0 0 16px rgba(0,255,140,0.18); border-color: rgba(0,255,140,0.5); border-left-color: var(--green); }
.room.pending { border-left-color: var(--amber); box-shadow: inset 0 0 30px rgba(255,176,32,0.10), 0 0 14px rgba(255,176,32,0.16); }
.room.idle    { border-left-color: var(--faint); box-shadow: inset 0 0 20px rgba(120,140,135,0.05); opacity: 0.86; }
.room:hover { transform: translateY(-2px); }

/* halve-transparante witte pijl detail */
.room::after {
  content: "▶";
  position: absolute; right: 10px; bottom: 6px;
  color: var(--white-arrow); font-size: 26px;
  opacity: 0.18; pointer-events: none;
}
.room-left {
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--glow, var(--edge));
  box-shadow: 0 0 14px var(--glow, var(--edge-glow));
  opacity: 0.9;
}
.room-top { display: flex; justify-content: space-between; align-items: center; }
.room-id {
  font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px;
  color: var(--text-dim); text-transform: uppercase;
  background: rgba(0,0,0,0.4); border: 1px solid rgba(0,255,136,0.2);
  border-radius: 3px; padding: 2px 7px;
}
.live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(0,255,140,0.7);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0,255,140,0.65); }
  70%  { box-shadow: 0 0 0 11px rgba(0,255,140,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,255,140,0); }
}
.room-head { display: flex; align-items: center; gap: 13px; margin: 11px 0 9px; }
.avatar {
  width: 50px; height: 50px; flex: 0 0 50px;
  display: grid; place-items: center;
  font-size: 26px; color: var(--glow, var(--edge));
  border: 1.5px solid var(--glow, var(--edge));
  border-radius: 10px;
  background: radial-gradient(circle at 50% 30%, rgba(0,255,136,0.12), rgba(0,0,0,0.3));
  box-shadow: 0 0 16px -2px var(--glow, var(--edge-glow));
  position: relative;
}
.name { font-size: 15px; font-weight: 600; color: #eafff5; }
.role { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; margin-top: 2px; }

.status-line { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.5px;
  text-transform: uppercase; padding: 2px 8px; border-radius: 3px;
  border: 1px solid currentColor;
}
.b-working, .b-live, .b-active, .b-connected, .b-ok, .b-done { color: var(--green); }
.b-pending, .b-waiting { color: var(--amber); }
.b-idle, .b-ended { color: var(--text-dim); }
.b-error, .b-failed, .b-rejected { color: var(--red); }
.b-run, .b-running { color: var(--cyan); }

.task { font-size: 12.5px; color: var(--text); margin-top: 6px; display: flex; gap: 8px; }
.task .label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; flex: 0 0 84px; padding-top: 2px; }
.task span:last-child { color: var(--text); }

/* Laatste bevinding (finding) — visueel onderscheiden van 'huidige taak' */
.task.finding { margin-top: 8px; align-items: flex-start; }
.task.finding .label { color: var(--accent-2); }
.task.finding span:last-child {
  color: var(--text);
  background: rgba(110, 245, 138, 0.07);
  border-left: 2px solid var(--accent-2);
  padding: 5px 8px;
  border-radius: 0 6px 6px 0;
  line-height: 1.4;
  font-size: 12px;
}

/* flowing progress bar for active rooms */
.progress {
  height: 6px; margin-top: 12px; border-radius: 4px;
  background: rgba(0,255,136,0.10);
  border: 1px solid rgba(0,255,136,0.2);
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 35%;
  background: linear-gradient(90deg, rgba(0,255,136,0.4), var(--green));
  box-shadow: 0 0 12px var(--edge-glow);
  animation: flow 2.4s linear infinite;
  background-size: 200% 100%;
}
@keyframes flow {
  0%   { background-position: 200% 0; }
  100% { background-position: -60% 0; }
}
.room.idle .progress-fill, .room.pending .progress-fill {
  width: 8%; animation: none; background: var(--faint); box-shadow: none;
}

.approval-flag {
  margin-top: 11px; font-family: var(--mono); font-size: 11px;
  color: var(--amber); border: 1px solid rgba(255,176,32,0.4);
  border-radius: 4px; padding: 5px 8px; background: rgba(255,176,32,0.07);
}
.meta { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.pill {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.5px;
  color: var(--text-dim); border: 1px solid rgba(0,255,136,0.18);
  border-radius: 12px; padding: 2px 9px;
}

/* ===================== TABLES ===================== */
.table-wrap {
  background: var(--panel-2);
  border: 1px solid rgba(0,255,136,0.14);
  border-radius: 6px; overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th {
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--edge); text-align: left; padding: 9px 12px;
  background: rgba(0,255,136,0.06); border-bottom: 1px solid rgba(0,255,136,0.18);
}
tbody td { padding: 9px 12px; border-bottom: 1px solid rgba(0,255,136,0.06); color: var(--text); }
tbody tr:hover { background: rgba(0,255,136,0.04); }
.muted { color: var(--text-dim); }
.cell-clip { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===================== LOGS + METRICS ===================== */
.logs {
  background: #020806; border: 1px solid rgba(0,255,136,0.16);
  border-radius: 6px; padding: 10px 12px; max-height: 460px; overflow-y: auto;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.65;
}
.logline { color: var(--text-dim); }
.logline .src { color: var(--edge); }

.card { background: var(--panel-2); border: 1px solid rgba(0,255,136,0.14); border-radius: 6px; padding: 12px 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.metric {
  background: var(--panel); border: 1px solid rgba(0,255,136,0.2); border-radius: 6px;
  padding: 13px 15px;
}
.metric h3 { margin: 0; font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); }
.metric .big { font-family: var(--mono); font-size: 26px; color: #eafff5; margin: 4px 0 8px; text-shadow: 0 0 12px rgba(0,255,136,0.25); }
.bar { height: 7px; border-radius: 4px; background: rgba(0,255,136,0.1); overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); box-shadow: 0 0 10px var(--edge-glow); }

/* scrollbar */
.content::-webkit-scrollbar, .logs::-webkit-scrollbar { width: 9px; }
.content::-webkit-scrollbar-thumb, .logs::-webkit-scrollbar-thumb { background: rgba(0,255,136,0.25); border-radius: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }

/* demo banner */
.demo-banner {
  background: rgba(255,176,32,0.12); border: 1px solid var(--amber);
  border-radius: 5px; padding: 8px 12px; margin: 0 0 6px;
  font-family: var(--mono); font-size: 11.5px; color: var(--amber);
}

/* ============================================================
   RUIMTE-STRUCTUUR (spaces) — tabs, statue, zones, drag&drop
   ============================================================ */
.space-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px;
}
.space-tab {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); color: var(--text-dim);
  border: 1px solid var(--edge-dim); border-radius: 6px;
  padding: 7px 12px; font-family: var(--mono); font-size: 12px;
  letter-spacing: .5px; cursor: pointer; text-transform: uppercase;
  transition: all .15s ease;
}
.space-tab:hover { color: var(--text); border-color: var(--edge); }
.space-tab.active {
  color: var(--bg); background: var(--edge);
  border-color: var(--edge); box-shadow: 0 0 14px var(--edge-glow);
}
.space-tab .st-ico { font-size: 13px; }
.space-tab .st-count {
  background: rgba(0,0,0,0.25); border-radius: 10px;
  padding: 1px 7px; font-size: 11px; margin-left: 2px;
}

/* stage that holds the central OVERLORD statue + zones */
.spaces-stage { position: relative; }

/* ---- OVERLORD STANDBEELD (centraal) ---- */
.overlord-statue {
  position: relative;
  margin: 0 auto 26px;
  max-width: 460px;
  text-align: center;
  padding: 26px 24px 22px;
  border: 3px solid var(--edge);
  border-radius: 14px;
  background:
    radial-gradient(240px 160px at 50% 0%, rgba(176,107,255,0.16), transparent 70%),
    var(--panel);
  box-shadow: 0 0 30px var(--edge-glow), inset 0 0 40px rgba(176,107,255,0.08);
  overflow: hidden;
}
.overlord-statue .statue-glow {
  position: absolute; inset: -40% 30% auto 30%; height: 200px;
  background: radial-gradient(closest-side, rgba(176,107,255,0.35), transparent);
  filter: blur(24px); pointer-events: none;
}
.overlord-statue .statue-icon {
  font-size: 58px; line-height: 1; color: var(--purple);
  text-shadow: 0 0 22px rgba(176,107,255,0.8);
  animation: statue-float 4s ease-in-out infinite;
}
@keyframes statue-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.overlord-statue .statue-name {
  margin-top: 10px; font-family: var(--mono); font-size: 20px;
  letter-spacing: 2px; color: var(--text); text-transform: uppercase;
}
.overlord-statue .statue-sub {
  margin-top: 4px; color: var(--text-dim); font-size: 12.5px;
  max-width: 340px; margin-left: auto; margin-right: auto;
}
.overlord-statue .statue-status { margin-top: 12px; }
.overlord-statue.live { border-color: var(--green); box-shadow: 0 0 40px var(--edge-glow); }

/* ---- ruimtes-grid ---- */
.spaces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.space-zone {
  border: 2px solid var(--zone, var(--edge-dim));
  border-radius: 12px;
  background: var(--panel-2);
  padding: 14px;
  box-shadow: inset 0 0 30px rgba(0,255,136,0.04);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.space-zone.drop-hover {
  border-color: var(--edge);
  box-shadow: 0 0 22px var(--edge-glow), inset 0 0 30px rgba(0,255,136,0.10);
}
.space-zone-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px dashed var(--edge-dim);
  font-family: var(--mono);
}
.space-zone-head .sz-ico { font-size: 18px; color: var(--zone, var(--edge)); }
.space-zone-head .sz-name { font-size: 15px; letter-spacing: 1px; color: var(--text); text-transform: uppercase; }
.space-zone-head .sz-tag { font-size: 10px; color: var(--faint); letter-spacing: 1px; }
.space-zone-head .sz-count {
  margin-left: auto; background: var(--zone, var(--edge));
  color: var(--bg); border-radius: 10px; padding: 1px 9px; font-size: 12px;
}
.space-drop { display: grid; gap: 12px; min-height: 60px; }

/* dragging state on room cards */
.space-zone .room { cursor: grab; }
.space-zone .room.dragging { opacity: .45; cursor: grabbing; }

/* ---- FACTORY koppelstatus ---- */
.factory-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.link-chip {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .5px;
  padding: 4px 10px; border-radius: 20px; border: 1px solid var(--edge-dim);
  color: var(--text-dim);
}
.link-chip.on { color: var(--green); border-color: var(--green); box-shadow: 0 0 10px rgba(0,255,140,0.35); }
.link-chip.off { color: var(--orange); border-color: var(--orange); }
.link-chip.unknown { color: var(--faint); }

/* ---- FINANCE kaarten (echte omzet) ---- */
.finance-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.fin-card {
  position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--edge-dim);
  border-radius: 14px;
  padding: 16px 18px;
  overflow: hidden;
}
.fin-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--green); box-shadow: 0 0 14px rgba(0,255,140,0.5);
}
.fin-label { font-size: 12px; letter-spacing: .6px; text-transform: uppercase; color: var(--text-dim); }
.fin-value {
  font-family: var(--mono); font-size: 28px; font-weight: 700; margin-top: 6px;
  color: var(--green); text-shadow: 0 0 18px rgba(0,255,140,0.25);
}
.fin-value.empty { color: var(--faint); text-shadow: none; font-size: 19px; font-weight: 600; }
.fin-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }
.fin-status {
  font-family: var(--mono); font-size: 12px; padding: 8px 12px; border-radius: 10px;
  margin-bottom: 14px; border: 1px solid var(--edge-dim);
}
.fin-status.ok { color: var(--green); border-color: rgba(0,255,140,0.4); }
.fin-status.warn { color: var(--orange); border-color: rgba(255,170,60,0.4); }

/* ---- AGENT ACTIVITEIT bord (wie doet wat) ---- */
.activity-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.act-card {
  position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--edge-dim);
  border-radius: 14px;
  padding: 14px 16px 16px;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.act-card:hover { transform: translateY(-2px); }
.act-card.working { border-color: rgba(0,255,140,0.45); }
.act-card.pending { border-color: rgba(255,207,92,0.5); }
.act-bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--glow, var(--green)); box-shadow: 0 0 14px var(--glow, var(--green));
}
.act-head { display: flex; align-items: center; gap: 12px; }
.act-avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-size: 20px; background: rgba(255,255,255,0.04); border: 1px solid var(--edge-dim);
}
.act-id { flex: 1; min-width: 0; }
.act-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-role { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-status {
  display: flex; align-items: center; gap: 6px; font-size: 12px;
  font-family: var(--mono); color: var(--text-dim); white-space: nowrap;
}
.act-status .dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--faint);
  box-shadow: 0 0 0 0 rgba(0,255,140,0);
}
.act-status .dot.on { background: var(--green); box-shadow: 0 0 10px rgba(0,255,140,0.8); animation: pulse 1.6s infinite; }
.act-space { margin: 10px 0 8px; }
.act-task, .act-last {
  display: flex; flex-direction: column; gap: 2px; margin-top: 8px;
  font-size: 13px;
}
.act-task .label, .act-last .label {
  font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--faint);
}
.act-task .task-text { color: var(--text); line-height: 1.35; }
.act-last span:last-child { color: var(--text-dim); font-size: 12.5px; }
.act-card.working .task-text { color: var(--green); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,255,140,0.6); }
  70% { box-shadow: 0 0 0 7px rgba(0,255,140,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,255,140,0); }
}

/* ============================================================
   WAR ROOM — 2D agent-sim
   ============================================================ */
.wr-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  height: calc(100vh - 160px);
  min-height: 480px;
}
.wr-map-wrap {
  position: relative;
  border: 2px solid var(--edge);
  border-radius: 14px;
  background:
    radial-gradient(900px 500px at 50% 45%, rgba(0,255,136,0.05), transparent 60%),
    linear-gradient(180deg, rgba(2,12,9,0.9), rgba(2,8,6,0.95));
  box-shadow: 0 0 26px rgba(0,255,136,0.10), inset 0 0 40px rgba(0,255,136,0.04);
  overflow: hidden;
}
#warroom-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.wr-hud {
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 12px;
  pointer-events: none;
  font-family: var(--mono);
}
.wr-status {
  font-size: 12px; letter-spacing: 2px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
  color: var(--faint); border: 1px solid var(--edge-dim);
  background: rgba(2,16,12,0.6);
}
.wr-status.live { color: var(--purple); border-color: var(--purple); box-shadow: 0 0 16px rgba(176,107,255,0.5); }
.wr-status.bad { color: var(--red); border-color: var(--red); }
.wr-title { font-size: 13px; color: var(--text); letter-spacing: 1px; text-shadow: 0 0 8px var(--edge-glow); }

.wr-side {
  display: flex; flex-direction: column;
  border: 2px solid var(--edge-dim);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}
.wr-side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid rgba(0,255,136,0.16);
}
.wr-side-ttl { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--text-dim); }
.wr-reports { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.wr-report {
  border: 1px solid var(--edge-dim);
  border-left: 3px solid var(--purple);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
}
.wr-rep-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.wr-rep-ttl { font-family: var(--mono); font-size: 12.5px; color: var(--text); letter-spacing: .5px; }
.wr-rep-time { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.wr-rep-body { font-size: 12.5px; line-height: 1.45; color: var(--text-dim); }
.wr-att { font-size: 11px; color: var(--cyan); margin-top: 6px; }
.wr-rep-author { font-size: 10.5px; color: var(--faint); margin-top: 4px; text-align: right; }

@media (max-width: 1024px) {
  .wr-layout { grid-template-columns: 1fr; height: auto; }
  .wr-map-wrap { min-height: 420px; }
}

/* ============================================================
   WAR ROOM 2.0 — groen-terminal (phosphor / CRT) look
   Laag 1: EMPIRE MAP · Laag 2: AGENT-PROFILE · Laag 3: ROOM-TERMINAL
   ============================================================ */

/* ---- CRT scanlines + flicker overlay (op de hele war-room) ---- */
#section-warroom { position: relative; }
#section-warroom::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none; z-index: 30;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.0) 0px,
    rgba(0, 0, 0, 0.0) 2px,
    rgba(0, 0, 0, 0.28) 3px,
    rgba(0, 0, 0, 0.28) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
}
#section-warroom::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none; z-index: 31;
  background: radial-gradient(ellipse at 50% 50%, rgba(0,255,136,0.05), transparent 70%);
  animation: wr2-flicker 5.5s infinite steps(60);
}
@keyframes wr2-flicker {
  0%, 96%, 100% { opacity: 0.0; }
  97% { opacity: 0.06; }
  98% { opacity: 0.0; }
  99% { opacity: 0.05; }
}

/* boot-text typewriter */
.wr2-boot {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--green);
  text-shadow: 0 0 8px var(--edge-glow);
  min-height: 16px;
  margin: 4px 0 10px;
  white-space: pre-wrap;
  letter-spacing: 0.5px;
}
.wr2-boot .cursor { animation: wr2-blink 1s steps(2) infinite; }
@keyframes wr2-blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }

.wr2 {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 14px;
  align-items: stretch;
  height: calc(100vh - 220px);
  min-height: 560px;
}

/* ---- EMPIRE MAP ---- */
.wr2-empire {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  border: 2px solid var(--edge);
  border-radius: 14px;
  background:
    radial-gradient(900px 520px at 50% 45%, rgba(0,255,136,0.06), transparent 62%),
    linear-gradient(180deg, rgba(1,10,7,0.96), rgba(1,7,5,0.98));
  box-shadow: 0 0 26px rgba(0,255,136,0.12), inset 0 0 44px rgba(0,255,136,0.05);
  overflow: hidden;
  position: relative;
}
.wr2-map-head {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(0,255,136,0.18);
  font-family: var(--mono);
}
.wr2-title {
  font-size: 14px; letter-spacing: 3px; font-weight: 700;
  color: var(--green); text-shadow: 0 0 12px var(--edge-glow);
}
.wr2-sub { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; }
.wr2-legend {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: 1px; color: var(--text-dim);
}
.wr2-legend .lg {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 3px;
  vertical-align: middle;
}
.wr2-legend .lg.ok { background: var(--green); box-shadow: 0 0 8px var(--edge-glow); }
.wr2-legend .lg.alert { background: var(--red); box-shadow: 0 0 8px rgba(255,59,59,0.6); }
.wr2-legend .lg.idle { background: var(--faint); }

.wr2-map-wrap {
  position: relative;
  overflow: hidden;
}
#warroom-canvas { display: block; width: 100%; height: 100%; }

.wr2-hud {
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 12px;
  pointer-events: none; font-family: var(--mono);
}
.wr2-status {
  font-size: 11px; letter-spacing: 2px; font-weight: 700;
  padding: 3px 11px; border-radius: 18px;
  color: var(--faint); border: 1px solid var(--edge-dim);
  background: rgba(1,12,8,0.65);
}
.wr2-status.live { color: var(--purple); border-color: var(--purple); box-shadow: 0 0 16px rgba(176,107,255,0.5); }
.wr2-status.bad { color: var(--red); border-color: var(--red); }
.wr2-title-sm { font-size: 12px; color: var(--text); letter-spacing: 1px; text-shadow: 0 0 8px var(--edge-glow); }

.wr2-node-tip {
  position: absolute; z-index: 20; pointer-events: none;
  font-family: var(--mono); font-size: 11px;
  background: rgba(1,10,7,0.92); color: var(--green);
  border: 1px solid var(--edge); border-radius: 6px;
  padding: 4px 8px; box-shadow: 0 0 14px rgba(0,255,136,0.3);
  white-space: nowrap; transform: translate(-50%, -120%);
}

/* room-lijst sidebar (klikbaar) */
.wr2-rooms {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid rgba(0,255,136,0.18);
  max-height: 132px; overflow-y: auto;
}
.wr2-room-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.5px;
  background: rgba(0,255,136,0.05);
  border: 1px solid var(--edge-dim); border-radius: 14px;
  padding: 4px 10px; cursor: pointer; color: var(--text-dim);
  transition: all 0.14s ease;
}
.wr2-room-chip:hover { color: #eafff5; background: rgba(0,255,136,0.12); box-shadow: 0 0 10px rgba(0,255,136,0.2); }
.wr2-room-chip.active { color: #eafff5; background: rgba(0,255,136,0.18); border-color: var(--edge); box-shadow: inset 0 0 14px rgba(0,255,136,0.18); }
.wr2-room-chip .dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px;
  background: var(--faint);
}
.wr2-room-chip .dot.ok { background: var(--green); box-shadow: 0 0 8px var(--edge-glow); }
.wr2-room-chip .dot.alert { background: var(--red); box-shadow: 0 0 8px rgba(255,59,59,0.6); }

/* ---- SIDE: AGENT-PROFILE + ROOM-TERMINAL ---- */
.wr2-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
  min-height: 0;
}

/* AGENT-PROFILE */
.wr2-profile {
  border: 2px solid var(--edge); border-radius: 14px;
  background: linear-gradient(180deg, rgba(1,12,8,0.95), rgba(1,8,6,0.97));
  box-shadow: 0 0 22px rgba(0,255,136,0.10), inset 0 0 36px rgba(0,255,136,0.04);
  overflow-y: auto; padding: 14px 16px;
}
.wr2-profile-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; height: 100%; text-align: center;
  color: var(--text-dim); font-family: var(--mono); font-size: 12px;
}
.wr2-blip { font-size: 30px; color: var(--green); text-shadow: 0 0 16px var(--edge-glow); }

.wr2-prof-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  border-bottom: 1px solid rgba(0,255,136,0.2); padding-bottom: 10px;
}
.wr2-prof-avatar {
  width: 46px; height: 46px; flex: 0 0 46px;
  display: grid; place-items: center; font-size: 24px;
  border: 1.5px solid var(--edge); border-radius: 10px;
  background: radial-gradient(circle at 50% 30%, rgba(0,255,136,0.14), rgba(0,0,0,0.3));
  box-shadow: 0 0 16px -2px var(--edge-glow);
}
.wr2-prof-name { font-family: var(--mono); font-size: 15px; color: #eafff5; letter-spacing: 1px; text-shadow: 0 0 10px var(--edge-glow); }
.wr2-prof-roomid { font-size: 10.5px; color: var(--text-dim); letter-spacing: 1px; margin-top: 2px; }

.wr2-prof-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-family: var(--mono); font-size: 11.5px; }
.wr2-prof-grid .k { color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; font-size: 10px; align-self: center; }
.wr2-prof-grid .v { color: var(--text); }
.wr2-prof-grid .v.acc { color: var(--green); text-shadow: 0 0 8px var(--edge-glow); }

.wr2-thought {
  margin-top: 14px;
  border: 1px solid rgba(0,255,136,0.2); border-radius: 8px;
  background: rgba(0,255,136,0.03); padding: 10px 12px;
}
.wr2-thought-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 2px;
  color: var(--green); text-shadow: 0 0 8px var(--edge-glow);
}
.wr2-thought-head .live-dot { width: 8px; height: 8px; }
.wr2-thought-stream { font-family: var(--mono); font-size: 11px; line-height: 1.5; display: flex; flex-direction: column; gap: 4px; }
.wr2-thought-stream .t { color: var(--text-dim); }
.wr2-thought-stream .t .ts { color: var(--edge); opacity: 0.7; margin-right: 6px; }

/* PER-AGENT CHAT (onderaan het AGENT-PROFILE) */
.wr2-chat {
  margin-top: 14px;
  border: 1px solid rgba(0,255,136,0.2); border-radius: 8px;
  background: rgba(0,255,136,0.02); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.wr2-chat-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 2px;
  color: var(--green); text-shadow: 0 0 8px var(--edge-glow);
}
.wr2-chat-messages {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 240px; overflow-y: auto; padding: 2px 4px; min-height: 48px;
}
.wr2-chat-empty { color: var(--faint); font-size: 11px; font-family: var(--mono); }
.wr2-msg { display: flex; flex-direction: column; max-width: 92%; }
.wr2-msg .who {
  font-family: var(--mono); font-size: 9px; letter-spacing: 1px;
  color: var(--text-dim); margin: 0 2px 2px; text-transform: uppercase;
}
.wr2-msg .bubble {
  padding: 7px 10px; border-radius: 10px; font-size: 12.5px; line-height: 1.45;
  border: 1px solid rgba(0,255,136,0.2);
  background: rgba(0,255,136,0.05); color: var(--text);
  word-break: break-word;
}
.wr2-msg.user { align-self: flex-end; align-items: flex-end; }
.wr2-msg.user .bubble {
  background: linear-gradient(180deg, rgba(47,123,255,0.22), rgba(47,123,255,0.12));
  border-color: rgba(47,123,255,0.5); color: #eaf2ff;
  border-bottom-right-radius: 3px;
}
.wr2-msg.user .who { color: var(--blue); }
.wr2-msg.agent { align-self: flex-start; align-items: flex-start; }
.wr2-msg.agent .bubble { border-bottom-left-radius: 3px; }
.wr2-msg.agent .bubble.pending { opacity: 0.65; font-style: italic; }
.wr2-chat-form { display: flex; gap: 8px; }
.wr2-chat-input {
  flex: 1; min-width: 0; padding: 8px 10px; font-size: 12.5px;
  font-family: var(--sans); color: var(--text);
  background: rgba(1,10,7,0.6); border: 1px solid rgba(0,255,136,0.3);
  border-radius: 8px; outline: none;
}
.wr2-chat-input:focus { border-color: var(--edge); box-shadow: 0 0 10px rgba(0,255,136,0.25); }
.wr2-send { white-space: nowrap; }
.wr2-send:hover { background: rgba(0,255,136,0.25); box-shadow: 0 0 12px var(--edge-glow); }

/* ROOM-TERMINAL */
.wr2-terminal {
  border: 2px solid var(--edge-dim); border-radius: 14px;
  background:
    repeating-linear-gradient(to bottom, rgba(0,255,136,0.02) 0, rgba(0,255,136,0.02) 2px, transparent 3px, transparent 5px),
    linear-gradient(180deg, rgba(1,10,7,0.97), rgba(0,6,4,0.99));
  box-shadow: inset 0 0 36px rgba(0,255,136,0.05);
  display: flex; flex-direction: column; overflow: hidden;
}
.wr2-term-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-bottom: 1px solid rgba(0,255,136,0.2);
  font-family: var(--mono); font-size: 12px; letter-spacing: 2px;
  color: var(--green); text-shadow: 0 0 10px var(--edge-glow);
  background: rgba(0,255,136,0.04);
}
.wr2-cursor { animation: wr2-blink 1s steps(2) infinite; }
.wr2-term-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: rgba(0,255,136,0.12);
  border-bottom: 1px solid rgba(0,255,136,0.2);
}
.wr2-term-stats .stat {
  background: rgba(1,10,7,0.9); padding: 8px 6px; text-align: center;
  font-family: var(--mono);
}
.wr2-term-stats .stat .n { font-size: 18px; color: #eafff5; text-shadow: 0 0 10px var(--edge-glow); }
.wr2-term-stats .stat .l { font-size: 9px; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; margin-top: 2px; }
.wr2-term-feed {
  flex: 1; overflow-y: auto; padding: 10px 12px;
  font-family: var(--mono); font-size: 11px; line-height: 1.55;
}
.wr2-line { color: var(--text); }
.wr2-line .ts { color: var(--edge); opacity: 0.65; margin-right: 6px; }
.wr2-line.dim { color: var(--faint); }
.wr2-line.alert { color: var(--red); }
.wr2-line.ok { color: var(--green); }

@media (max-width: 1100px) {
  .wr2 { grid-template-columns: 1fr; height: auto; }
  .wr2-empire { min-height: 480px; }
  .wr2-side { grid-template-rows: 360px 320px; }
}

/* ============================================================
   MOBILE (telefoon, portrait ≤ 768px)
   - sidebar → vaste bottom-nav (icon-only, horizontaal scrollbaar)
   - content padding 8px, sections stapelen
   - KPI's 2-per-rij grid
   - tabellen horizontal-scroll i.p.v. breken
   - War Room canvas schaalt naar 100% breedte, touch-vriendelijk
   - chat-input sticky boven toetsenbord
   ============================================================ */
@media (max-width: 768px) {
  /* ---- layout: enkele kolom, sidebar naar beneden ---- */
  body { grid-template-columns: 1fr; }
  .main { padding-bottom: 60px; }   /* ruimte voor bottom-nav */

  /* ---- sidebar → vaste bottom-nav bar ---- */
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    z-index: 60;
    flex-direction: row; align-items: stretch;
    height: 58px; padding: 4px 0;
    border-right: none; border-top: 2px solid var(--edge);
    box-shadow: 0 -4px 24px rgba(0,255,136,0.12), inset 0 1px 0 var(--edge-glow);
  }
  .brand, .sidebar-foot { display: none; }
  .nav {
    flex: 1; flex-direction: row; align-items: stretch;
    gap: 2px; padding: 0 6px; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item {
    flex: 0 0 auto;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 1px; padding: 6px 10px;
    font-size: 0; line-height: 1;            /* verberg label-tekst (icon-only) */
    border-left: none; border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
    position: relative;
  }
  .nav-item.active {
    border-left: none; border-bottom: 3px solid var(--edge);
    background: linear-gradient(180deg, rgba(0,255,136,0.16), rgba(0,255,136,0.02));
  }
  .nav-ico { font-size: 19px; width: auto; }
  .nav-count {
    margin-left: 0; position: absolute; top: 1px; right: 2px;
    padding: 0 5px; font-size: 9px;
  }

  /* ---- topbar + KPI's ---- */
  .topbar { padding: 8px 12px; gap: 10px; }
  .topbar-kpis {
    width: 100%; order: 3; margin-left: 0; margin-top: 6px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  }
  .kpi-pill { min-width: 0; padding: 5px 10px; }
  .kpi-pill-big { font-size: 15px; }
  .kpi-rev .kpi-pill-big { font-size: 16px; }

  /* ---- KPI-strip compact ---- */
  .kpi-strip { padding: 8px 8px 4px; }
  .kpi { flex: 1 1 44%; min-width: 0; padding: 9px 10px; }

  /* ---- content padding 8px, sections stapelen ---- */
  .content { padding: 8px; }
  .section-title { margin: 16px 0 10px; }
  .pin-approvals { position: sticky; top: 0; }

  /* ---- tabellen: horizontal-scroll i.p.v. breken ---- */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table, .tbl { width: max-content; min-width: 100%; }
  .cell-clip { max-width: 220px; }

  /* ---- grids stapelen strakker ---- */
  .rooms-grid, .activity-board, .fiverr-grid,
  .space-zone { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }

  /* ---- War Room 2.0: 1-kolom, canvas full-width, touch-tap ---- */
  #section-warroom { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .wr2 {
    grid-template-columns: 1fr;
    grid-auto-rows: min-content;
    height: auto; min-height: 0; gap: 12px;
  }
  .wr2-empire { min-height: 0; height: auto; }
  .wr2-map-wrap {
    width: 100%;
    height: 56vh;            /* canvas krijgt een echte hoogte op mobiel (anders collapse naar 0) */
    min-height: 320px;
    touch-action: manipulation;  /* directe tap, geen 300ms-delay / zoom */
  }
  #warroom-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    touch-action: manipulation;
  }
  .wr2-node-tip { display: none; }   /* hover-tip overbodig op touch (tap toont selectie) */
  .wr2-map-head { flex-wrap: wrap; gap: 8px; }
  .wr2-legend { display: none; }     /* ruimte besparen in map-head */
  .wr2-meet { order: 2; margin-left: auto; }

  /* ROOM-CHIPS — wrappen op smalle schermen */
  .wr2-rooms {
    max-height: none; overflow-y: visible;
    flex-wrap: wrap; justify-content: flex-start;
  }
  .wr2-room-chip { font-size: 12px; padding: 8px 12px; }  /* grotere tikdoelen */

  /* SIDE: AGENT-PROFILE + ROOM-TERMINAL — full-width onder de map */
  .wr2-side {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    width: 100%; min-height: 0;
  }
  .wr2-profile, .wr2-terminal { width: 100%; }
  .wr2-terminal { min-height: 360px; }

  /* PER-AGENT CHAT — full-width, input sticky onderaan */
  .wr2-chat {
    position: sticky; bottom: 0; z-index: 4;
    margin: 14px -16px -8px; padding: 10px 12px 10px;
    background: linear-gradient(180deg, rgba(1,12,8,0.6), rgba(1,10,7,0.98) 30%);
    border-top: 1px solid rgba(0,255,136,0.25);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  }
  .wr2-chat-input { font-size: 16px; }   /* voorkom iOS-zoom bij focus */
  .wr2-chat-messages { max-height: 40vh; }
}

/* ============================================================
   AGENT UNIVERSE — OVERLORD centraal (sleepbaar) + rooms + sidebars
   ============================================================ */
#section-universe { padding-bottom: 28px; }
.uni-grid {
  display: grid;
  grid-template-columns: 252px 1fr 252px;
  gap: 14px;
  margin-top: 6px;
}
.uni-panel {
  background: var(--panel);
  border: 1px solid rgba(0,255,136,0.18);
  border-left: 3px solid var(--edge);
  border-radius: 10px;
  padding: 12px;
  max-height: 560px;
  overflow-y: auto;
  box-shadow: inset 0 0 26px rgba(0,255,136,0.05);
}
.uni-panel-head {
  font-family: var(--mono); font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--edge);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px dashed var(--edge-dim);
  text-shadow: 0 0 8px var(--edge-glow);
}
.uni-panel-ico { margin-right: 6px; }

/* linker zijbalk: AGENTS */
.uni-agent {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 8px; border-radius: 7px;
  border: 1px solid rgba(0,255,136,0.12);
  background: rgba(0,0,0,0.22);
  margin-bottom: 9px;
}
.uni-agent.working, .uni-agent.ok { box-shadow: inset 0 0 18px rgba(0,255,140,0.06); }
.uni-agent.alert { border-color: rgba(255,59,59,0.4); }
.uni-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.uni-dot.ok { background: var(--green); box-shadow: 0 0 8px var(--edge-glow); animation: pulse 1.4s infinite; }
.uni-dot.alert { background: var(--red); box-shadow: 0 0 8px rgba(255,59,59,0.6); }
.uni-dot.idle { background: var(--faint); }
.uni-agent-ico { font-size: 20px; flex: 0 0 22px; text-align: center; }
.uni-agent-body { flex: 1; min-width: 0; }
.uni-agent-name { font-size: 13px; color: #eafff5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uni-agent-role { font-family: var(--mono); font-size: 9.5px; letter-spacing: .5px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 5px; }
.uni-agent-pct { font-family: var(--mono); font-size: 12px; flex: 0 0 auto; }

/* universe stage */
.uni-stage {
  position: relative;
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 12px;
  background:
    radial-gradient(700px 420px at 50% 45%, rgba(176,107,255,0.07), transparent 65%),
    radial-gradient(500px 360px at 50% 50%, rgba(0,255,136,0.05), transparent 70%),
    rgba(2,8,6,0.6);
  min-height: 560px;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0,255,136,0.05);
}
.uni-stage-head {
  position: absolute; top: 10px; left: 0; right: 0; text-align: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: 3px;
  color: var(--text-dim); text-transform: uppercase; z-index: 1;
}
.uni-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.uni-nodes {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
  padding: 46px 40px 30px;
}
.uni-hint {
  position: absolute; bottom: 8px; left: 0; right: 0; text-align: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  color: var(--text-dim); opacity: .7; z-index: 1; pointer-events: none;
}

/* nodes */
.uni-node {
  position: relative; z-index: 2;
  width: 132px; text-align: center;
  padding: 14px 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(6,26,20,0.9), rgba(3,14,11,0.92));
}
.uni-node-ico { font-size: 30px; line-height: 1; text-shadow: 0 0 14px currentColor; }
.uni-node-name { font-family: var(--mono); font-size: 13px; letter-spacing: 1.5px; color: #eafff5; margin-top: 7px; text-transform: uppercase; }
.uni-node-sub { font-size: 10px; color: var(--text-dim); margin-top: 3px; min-height: 12px; }
.uni-bar { height: 5px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 8px; }
.uni-bar span { display: block; height: 100%; box-shadow: 0 0 10px currentColor; }

/* OVERLORD hub — groter, groene glow, sleepbaar */
.uni-overlord {
  grid-column: 2; grid-row: 2;
  width: 188px; padding: 22px 16px 18px;
  border: 3px solid var(--purple);
  box-shadow: 0 0 38px rgba(176,107,255,0.5), inset 0 0 40px rgba(176,107,255,0.12);
  cursor: grab; user-select: none;
}
.uni-overlord.drag { cursor: grabbing; box-shadow: 0 0 54px rgba(176,107,255,0.7); z-index: 5; }
.uni-overlord-glow {
  position: absolute; inset: -30% -10% auto -10%; height: 150px;
  background: radial-gradient(closest-side, rgba(0,255,140,0.35), transparent);
  filter: blur(20px); pointer-events: none; z-index: -1;
}
.uni-overlord .uni-node-ico { font-size: 50px; color: var(--purple); text-shadow: 0 0 22px rgba(176,107,255,0.85); animation: statue-float 4s ease-in-out infinite; }
.uni-overlord .uni-node-name { font-size: 17px; color: #fff; }
.uni-overlord-wing, .uni-overlord-foot { position: absolute; font-size: 22px; color: var(--green); text-shadow: 0 0 12px var(--edge-glow); opacity: .85; }
.uni-overlord-wing { left: 8px; top: 50%; transform: translateY(-50%) rotate(0deg); }
.uni-overlord-foot { right: 8px; top: 50%; transform: translateY(-50%); }
.uni-overlord-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  background: var(--green); color: #02110a; border-radius: 10px;
  padding: 2px 10px; box-shadow: 0 0 12px var(--edge-glow);
}

/* room-nodes: gekleurde glow per ruimte */
.uni-room { border: 2px solid var(--rc); box-shadow: 0 0 18px -2px var(--rc), inset 0 0 26px rgba(255,255,255,0.03); }
.uni-room-glow { position: absolute; inset: -40% -20% auto -20%; height: 90px; background: radial-gradient(closest-side, var(--rc), transparent 70%); filter: blur(16px); opacity: .35; pointer-events: none; z-index: -1; }
.uni-room.ok { box-shadow: 0 0 22px -2px var(--rc), inset 0 0 26px rgba(0,255,140,0.05); }
.uni-room.alert { border-color: var(--red); }
.uni-room.idle { opacity: .8; }

/* rechter zijbalk: ACTIVE TASKS */
.uni-task { padding: 10px 9px; border-radius: 7px; border: 1px solid rgba(0,255,136,0.12); background: rgba(0,0,0,0.22); margin-bottom: 9px; }
.uni-task-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.uni-task-title { font-size: 12.5px; color: var(--text); line-height: 1.3; }
.uni-prio { font-family: var(--mono); font-size: 9px; letter-spacing: .5px; text-transform: uppercase; padding: 2px 7px; border-radius: 10px; flex: 0 0 auto; }
.uni-prio.high { color: #02110a; background: var(--red); }
.uni-prio.med { color: #1a1200; background: var(--amber); }
.uni-prio.low { color: var(--text-dim); border: 1px solid var(--edge-dim); }
.uni-task-meta { margin: 7px 0 8px; font-family: var(--mono); font-size: 10px; color: var(--text-dim); letter-spacing: .5px; }
.uni-task-agent { color: var(--accent-2); }
.uni-task-bar { height: 6px; border-radius: 4px; background: rgba(0,255,136,0.1); overflow: hidden; }
.uni-task-bar span { display: block; height: 100%; background: linear-gradient(90deg, rgba(0,255,136,0.4), var(--green)); box-shadow: 0 0 10px var(--edge-glow); }

/* onderste rij */
.uni-bottom { display: grid; grid-template-columns: 1.3fr 1.5fr 1.1fr; gap: 14px; margin-top: 14px; }
.uni-card {
  background: var(--panel);
  border: 1px solid rgba(0,255,136,0.18);
  border-left: 3px solid var(--edge);
  border-radius: 10px;
  padding: 12px;
  box-shadow: inset 0 0 26px rgba(0,255,136,0.05);
  display: flex; flex-direction: column;
  min-height: 200px;
}
.uni-card-head {
  font-family: var(--mono); font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--edge);
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px dashed var(--edge-dim);
  text-shadow: 0 0 8px var(--edge-glow);
}

/* activity log */
.uni-activity { flex: 1; overflow-y: auto; font-family: var(--mono); font-size: 11px; line-height: 1.6; }
.uni-logline { display: flex; align-items: flex-start; gap: 7px; padding: 3px 0; border-bottom: 1px solid rgba(0,255,136,0.05); }
.uni-log-ts { color: var(--text-dim); flex: 0 0 auto; }
.uni-log-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 4px; flex: 0 0 7px; }
.uni-log-dot.info { background: var(--cyan); }
.uni-log-dot.ok { background: var(--green); }
.uni-log-dot.warn { background: var(--amber); }
.uni-log-dot.error { background: var(--red); }
.uni-log-msg { color: var(--text); flex: 1; min-width: 0; word-break: break-word; }
.uni-log-msg b { color: #eafff5; }

/* taken-over-tijd chart */
.uni-chart-card { padding-bottom: 8px; }
#uni-chart-canvas { flex: 1; width: 100%; min-height: 150px; display: block; }

/* systeem bronnen gauges */
.uni-resources { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: center; }
.uni-gauge { text-align: center; }
.uni-gauge-dial { position: relative; width: 84px; height: 84px; margin: 0 auto; }
.uni-gauge-dial svg { width: 100%; height: 100%; }
.uni-gauge-val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 20px; font-weight: 700; }
.uni-gauge-val small { font-size: 10px; margin-left: 2px; }
.uni-gauge-label { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; color: var(--text-dim); margin-top: 4px; text-transform: uppercase; }

/* uni-panel + stage scrollbars */
.uni-panel::-webkit-scrollbar, .uni-activity::-webkit-scrollbar { width: 8px; }
.uni-panel::-webkit-scrollbar-thumb, .uni-activity::-webkit-scrollbar-thumb { background: rgba(0,255,136,0.25); border-radius: 6px; }
.uni-panel::-webkit-scrollbar-track, .uni-activity::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1180px) {
  .uni-grid { grid-template-columns: 1fr; }
  .uni-panel { max-height: none; }
  .uni-stage { min-height: 520px; }
  .uni-bottom { grid-template-columns: 1fr; }
  .uni-activity { max-height: 260px; }
}
@media (max-width: 560px) {
  .uni-nodes { grid-template-columns: 1fr; grid-template-rows: auto; gap: 14px; padding: 50px 16px 60px; }
  .uni-overlord { grid-column: auto; grid-row: auto; margin: 0 auto; }
  .uni-node { width: 100%; max-width: 220px; margin: 0 auto; }
}
