/* ===== Dashboard inside monitor ===== */
.dash-root {
  display: grid;
  grid-template-columns: 184px 1fr;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(800px 400px at 70% 0%, rgba(20, 184, 166, 0.12), transparent 60%),
    linear-gradient(180deg, #0a1018 0%, #060a10 100%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 11.5px;
  overflow: hidden;
}

/* SIDEBAR */
.dash-sidebar {
  border-right: 1px solid rgba(255,255,255,0.05);
  background: rgba(6, 10, 16, 0.6);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dash-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dash-brand-name { font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: -0.01em; }
.dash-brand-sub { font-size: 9px; color: var(--ink-4); letter-spacing: 0.1em; text-transform: uppercase; }

.dash-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--ink-4);
  font-size: 10.5px;
}
.dash-search kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: var(--ink-3);
  border: 1px solid rgba(255,255,255,0.05);
}

.dash-nav-group { display: flex; flex-direction: column; gap: 1px; }
.dash-nav-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 8px 8px 4px;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-2);
  font-size: 11px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.dash-nav-item .dash-nav-icon { color: var(--ink-3); display: inline-flex; }
.dash-nav-item.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.12), rgba(34, 211, 238, 0.02));
  border-color: rgba(34, 211, 238, 0.18);
  color: #d8fbff;
}
.dash-nav-item.active .dash-nav-icon { color: var(--cyan-2); }
.dash-nav-badge {
  margin-left: auto;
  font-size: 9px;
  padding: 1px 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  color: var(--ink-3);
}

.dash-sidebar-foot { margin-top: auto; }
.dash-health { padding: 9px 10px; border: 1px solid rgba(255,255,255,0.05); border-radius: 9px; background: rgba(255,255,255,0.02); }
.dash-health-top { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--ink-2); }
.dash-health-val { margin-left: auto; color: var(--cyan-2); font-family: var(--font-mono); }
.dash-pulse { width: 6px; height: 6px; border-radius: 999px; background: #5eead4; box-shadow: 0 0 6px #5eead4; }
.dash-health-bar { margin-top: 7px; height: 3px; background: rgba(255,255,255,0.05); border-radius: 999px; overflow: hidden; }
.dash-health-bar i { display: block; height: 100%; background: linear-gradient(90deg, #22d3ee, #5eead4); border-radius: inherit; }

/* MAIN */
.dash-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.dash-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  background: rgba(6, 10, 16, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2;
}

/* SCROLLABLE BODY */
.dash-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 12px;
  scroll-behavior: smooth;
}
.dash-body::-webkit-scrollbar { width: 6px; }
.dash-body::-webkit-scrollbar-track { background: transparent; }
.dash-body::-webkit-scrollbar-thumb {
  background: rgba(94, 234, 212, 0.18);
  border-radius: 999px;
}
.dash-body::-webkit-scrollbar-thumb:hover { background: rgba(94, 234, 212, 0.3); }
.dash-crumbs { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.dash-sep { color: var(--ink-4); }
.dash-tabs { display: flex; gap: 4px; margin-left: 18px; padding: 3px; background: rgba(255,255,255,0.03); border-radius: 8px; border: 1px solid rgba(255,255,255,0.04); }
.dash-tab {
  background: transparent;
  border: 0;
  color: var(--ink-3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10.5px;
  cursor: pointer;
}
.dash-tab.active { background: rgba(255,255,255,0.06); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04); }

.dash-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.dash-icon-btn {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.dash-icon-btn.small { width: 20px; height: 20px; border-radius: 5px; }
.dash-connect {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: #d8fbff;
  font-size: 10.5px;
  cursor: pointer;
}
.dash-connect-dot { width: 6px; height: 6px; border-radius: 999px; background: #5eead4; box-shadow: 0 0 6px #5eead4; }
.dash-avatar {
  width: 24px; height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #5eead4, #22d3ee 60%, #0d7e74);
  border: 1px solid rgba(255,255,255,0.1);
}

/* KPIs */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px 16px 6px;
}
.dash-kpi {
  padding: 11px 13px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.005));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.dash-kpi::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(150% 80% at 100% 0%, rgba(34, 211, 238, 0.06), transparent 60%);
  pointer-events: none;
}
.dash-kpi-label { font-size: 10px; color: var(--ink-3); letter-spacing: 0.04em; }
.dash-kpi-row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.dash-kpi-value { font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.dash-kpi-delta { font-size: 9.5px; font-family: var(--font-mono); }
.dash-kpi-delta.up { color: #5eead4; }
.dash-kpi-delta.down { color: #fb7185; }
.dash-kpi-delta.stable { color: var(--ink-3); }
.dash-kpi-spark { margin-top: 6px; opacity: 0.85; }

/* CONTENT */
.dash-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 200px);
  gap: 8px;
  padding: 6px 14px 14px;
}
.dash-chart-card { min-width: 0; }
.dash-action { min-width: 0; }
.dash-card-head { flex-wrap: wrap; gap: 8px 12px; }
.dash-legend { flex-wrap: wrap; gap: 6px 10px; }

.dash-chart-card {
  padding: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.005));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.dash-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.dash-card-eyebrow { font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-4); }
.dash-card-title { font-family: var(--font-display); font-size: 14px; font-weight: 500; margin-top: 2px; letter-spacing: -0.01em; }
.dash-legend { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 10px; color: var(--ink-3); }
.dash-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; vertical-align: middle; }
.dash-pill-btn {
  margin-left: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--ink-2);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.dash-chart { position: relative; flex: 1; min-height: 0; }
.dash-chart svg { display: block; }
.dash-chart-axis { display: flex; justify-content: space-between; font-size: 9px; color: var(--ink-4); padding: 6px 0 0; }
.dash-chart-tip {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  background: rgba(11, 18, 28, 0.92);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 9.5px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px -4px rgba(0,0,0,0.6);
}
.dash-chart-tip-label { color: var(--ink-3); }
.dash-chart-tip-val strong { font-family: var(--font-mono); color: #d8fbff; font-weight: 500; }

/* ACTION PANEL */
.dash-action {
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.005));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  display: flex; flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.dash-action-head { display: flex; align-items: center; }
.dash-action-title { font-family: var(--font-display); font-size: 12px; font-weight: 500; }
.dash-action-head .dash-icon-btn { margin-left: auto; }
.dash-action-metric { display: flex; flex-direction: column; }
.dash-action-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px dashed rgba(255,255,255,0.04);
  font-size: 10.5px;
}
.dash-action-row:last-child { border-bottom: 0; }
.dash-action-icon { color: var(--cyan-2); width: 18px; height: 18px; border-radius: 5px; background: rgba(34, 211, 238, 0.07); display: inline-flex; align-items: center; justify-content: center; }
.dash-action-val { margin-left: auto; font-family: var(--font-mono); color: var(--ink); }

.dash-action-deploy { padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.04); }
.dash-deploy-bars { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.dash-deploy-bars i { flex: 1; background: linear-gradient(180deg, #5eead4, #22d3ee); border-radius: 2px; min-height: 4px; }
.dash-deploy-meta { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--ink-3); margin-top: 6px; }
.dash-deploy-meta strong { font-family: var(--font-mono); color: var(--ink); font-weight: 500; }

.dash-deploy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, #5eead4, #22d3ee);
  color: #04141a;
  font-weight: 600;
  font-size: 11px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 6px 20px -6px rgba(34, 211, 238, 0.55), inset 0 1px 0 rgba(255,255,255,0.4);
}
.dash-deploy-btn svg:last-child { margin-left: auto; }

.dash-mini-list { display: flex; flex-direction: column; gap: 5px; }
.dash-mini-row {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 7px;
  font-size: 10px;
  color: var(--ink-2);
}
.dash-mini-row .dot { width: 5px; height: 5px; border-radius: 999px; }
.dash-mini-row .dot.ok { background: #5eead4; box-shadow: 0 0 4px #5eead4; }
.dash-mini-row .dot.warn { background: #fbbf24; box-shadow: 0 0 4px #fbbf24; }
.dash-mini-row .t { margin-left: auto; color: var(--ink-4); font-family: var(--font-mono); font-size: 9px; }

/* ===== Live number flicker ===== */
.live {
  font-variant-numeric: tabular-nums;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 6px rgba(94, 234, 212, 0.4); }
}

/* ===== Extra scroll sections ===== */
.dash-card {
  margin: 6px 16px 0;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.005));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
}

.dash-mini-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 9.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.25);
  color: #5eead4;
  margin-left: auto;
}
.dash-mini-pill .dot { width: 5px; height: 5px; border-radius: 999px; background: #5eead4; box-shadow: 0 0 4px #5eead4; }

/* Deployments table */
.dash-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 10.5px;
}
.dash-table th, .dash-table td {
  text-align: left;
  padding: 7px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dash-table th {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 500;
}
.dash-table td { color: var(--ink-2); }
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table-name { font-family: var(--font-display); font-weight: 500; color: var(--ink); font-size: 11px; }
.dash-mono { font-family: var(--font-mono); color: var(--ink-2); font-size: 10px; }

.dash-pill-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
}
.dash-pill-status .dot { width: 5px; height: 5px; border-radius: 999px; }
.dash-pill-status.live {
  background: rgba(94, 234, 212, 0.1);
  border: 1px solid rgba(94, 234, 212, 0.22);
  color: #5eead4;
}
.dash-pill-status.live .dot { background: #5eead4; box-shadow: 0 0 5px #5eead4; }
.dash-pill-status.syncing {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: #fbbf24;
}
.dash-pill-status.syncing .dot { background: #fbbf24; box-shadow: 0 0 5px #fbbf24; }

/* Module grid */
.dash-modules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 10px 16px 0;
}
.dash-module {
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.005));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
  overflow: hidden;
}
.dash-module::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 80% at 100% 0%, color-mix(in oklab, var(--c) 14%, transparent), transparent 60%);
  pointer-events: none;
}
.dash-module > * { position: relative; }
.dash-module-head { display: flex; align-items: center; gap: 8px; }
.dash-module-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  color: #04141a;
  background: var(--c);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}
.dash-module-name { font-family: var(--font-display); font-weight: 500; font-size: 12px; }
.dash-module-tag { font-size: 9px; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; }
.dash-module .dash-pill-status { margin-left: auto; }
.dash-module-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.dash-module-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, color-mix(in oklab, var(--c) 70%, transparent), var(--c));
  border-radius: inherit;
  transition: width 600ms ease;
}
.dash-module-foot {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--ink-3);
}

/* Events list */
.dash-events { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.dash-event {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  font-size: 10.5px;
}
.dash-event-sev {
  width: 6px; height: 6px;
  border-radius: 999px;
  justify-self: center;
}
.dash-event-sev.ok { background: #5eead4; box-shadow: 0 0 5px #5eead4; }
.dash-event-sev.warn { background: #fbbf24; box-shadow: 0 0 5px #fbbf24; }
.dash-event-sev.info { background: #22d3ee; box-shadow: 0 0 5px #22d3ee; }
.dash-event-txt { color: var(--ink); }
.dash-event-meta { color: var(--ink-4); font-size: 9.5px; }

/* ===== Monitor casing ===== */
.monitor-wrap {
  position: relative;
  perspective: 2200px;
  perspective-origin: 50% 40%;
  width: 100%;
  display: flex;
  justify-content: center;
}
.monitor {
  position: relative;
  width: min(960px, 100%);
  transform: rotateX(8deg) rotateY(-12deg) rotateZ(0.5deg);
  transform-style: preserve-3d;
  filter: drop-shadow(0 60px 80px rgba(0,0,0,0.55));
}
.monitor-bezel {
  position: relative;
  border-radius: 18px;
  padding: 14px 14px 16px;
  background:
    linear-gradient(180deg, #1a2230 0%, #0c121b 100%);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 0 0 1px rgba(0,0,0,0.5),
    0 1px 0 rgba(0,0,0,0.8);
}
.monitor-screen {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: #06090e;
  border: 1px solid rgba(0,0,0,0.6);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.04),
    inset 0 0 60px rgba(0,0,0,0.6);
}
.monitor-screen::after {
  /* subtle reflection */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(105deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 28%, rgba(255,255,255,0) 70%, rgba(255,255,255,0.02) 100%);
  mix-blend-mode: screen;
}
.monitor-cam {
  position: absolute;
  top: 5px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 999px;
  background: #1a2230;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05);
}
.monitor-brand {
  position: absolute;
  bottom: 3px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.18);
  text-transform: uppercase;
}
.monitor-stand-neck {
  width: 18%;
  margin: -2px auto 0;
  height: 56px;
  background:
    linear-gradient(180deg, #1a2230 0%, #0c121b 100%);
  border-left: 1px solid rgba(255,255,255,0.05);
  border-right: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(0,0,0,0.5);
  clip-path: polygon(15% 0, 85% 0, 100% 100%, 0% 100%);
  transform: rotateX(20deg) translateZ(-10px);
}
.monitor-stand-base {
  width: 36%;
  margin: -2px auto 0;
  height: 10px;
  background: linear-gradient(180deg, #1a2230 0%, #0a0f15 100%);
  border-radius: 100% 100% 20px 20px / 60% 60% 20px 20px;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 30px 40px -10px rgba(0,0,0,0.6);
}
