/* ═══════════════════════════════════════════════════════════════
   ALT MOTHER SHIP — COCKPIT CSS
   Dark glassmorphism theme · Staging dashboard
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Color Palette ── */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-glass: rgba(30, 41, 59, 0.6);
  --bg-glass-hover: rgba(30, 41, 59, 0.8);
  --border-glass: rgba(100, 116, 139, 0.25);
  --border-active: rgba(99, 102, 241, 0.5);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #818cf8;

  --accent-indigo: #6366f1;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-pink: #ec4899;
  --accent-purple: #a855f7;

  --gradient-brand: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  --gradient-critical: linear-gradient(135deg, #ef4444, #f97316);
  --gradient-warning: linear-gradient(135deg, #f59e0b, #eab308);
  --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --sidebar-width: 240px;
  --topbar-height: 64px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

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

html { font-size: 14px; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  z-index: 100;
  backdrop-filter: blur(20px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-glass);
}

.brand-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
}

.brand-title {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  width: 100%;
  text-align: left;
}

.nav-btn:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.nav-btn.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo);
  font-weight: 600;
}

.nav-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent-indigo);
  border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 16px; min-width: 20px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--accent-red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.nav-badge:empty, .nav-badge[data-count="0"] { display: none; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-glass);
}

.mode-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-amber);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.mode-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent-amber);
}

.sync-status {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  /* The header contains several operator controls.  A fixed 64px height
     clipped the right-hand controls at browser zoom 100%; let the two rows
     breathe and wrap instead. */
  min-height: var(--topbar-height);
  height: auto;
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 20px;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 180px;
  gap: 8px;
}

.screen-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.screen-env {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 12px;
  padding: 2px 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 4px;
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 680px;
  min-width: 0;
  gap: 8px;
  flex-wrap: wrap;
}

.authority-mode-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-accent);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Accounting-style economics table ───────────────────────── */
.accounting-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.accounting-kicker {
  color: #fbbf24;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.accounting-header h3 {
  margin-top: 3px;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 800;
}

.accounting-header p {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.45;
}

.accounting-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(16, 185, 129, .32);
  border-radius: 999px;
  color: #86efac;
  background: rgba(16, 185, 129, .09);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
}

.accounting-explainer {
  margin: 0 0 10px;
  padding: 10px 11px;
  border: 1px solid rgba(56, 189, 248, .2);
  border-radius: 8px;
  background: rgba(8, 20, 38, .48);
  color: #cbd5e1;
  font-size: 10.5px;
  line-height: 1.5;
}

.accounting-formula { color: #bae6fd; font-size: 11px; }
.formula-step { color: #f8fafc; font-weight: 700; }
.accounting-note { margin-top: 4px; color: #fbbf24; }
.accounting-basis { margin-top: 5px; color: #94a3b8; }
.accounting-details { margin-top: 6px; color: #94a3b8; }
.accounting-details summary { cursor: pointer; color: #7dd3fc; }
.accounting-details a { color: #bae6fd; }

.accounting-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.accounting-summary-card {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(15, 23, 42, .52);
}

.accounting-summary-card.primary {
  border-color: rgba(245, 158, 11, .42);
  background: rgba(120, 53, 15, .18);
}

.accounting-summary-card span,
.accounting-summary-card small {
  display: block;
  color: #94a3b8;
  font-size: 9.5px;
  line-height: 1.3;
}

.accounting-summary-card strong {
  display: block;
  margin: 4px 0 2px;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.accounting-summary-card.primary strong { color: #fbbf24; }

.runtime-reconciliation-details {
  margin-top: 14px;
  border-top: 1px solid rgba(56, 189, 248, .14);
  padding-top: 9px;
}

.runtime-reconciliation-details > summary {
  cursor: pointer;
  color: #7dd3fc;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
}

.runtime-economics-entry-details {
  margin-top: 10px;
  border: 1px solid rgba(245, 158, 11, .22);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(30, 20, 5, .18);
}

.runtime-economics-entry-details > summary {
  cursor: pointer;
  color: #fbbf24;
  font-size: 10.5px;
  font-weight: 800;
}

.token-breakdown-details {
  margin-top: 8px;
  border-top: 1px solid rgba(245, 158, 11, .14);
  padding-top: 7px;
}

.token-breakdown-details > summary {
  cursor: pointer;
  color: #fbbf24;
  font-size: 10px;
  font-weight: 700;
}

.accounting-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(245, 158, 11, .2);
  border-radius: 9px;
  background: rgba(15, 23, 42, .42);
}

.accounting-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 10.5px;
}

.accounting-table th,
.accounting-table td {
  padding: 8px 9px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}

.accounting-table thead th {
  color: #fbbf24;
  background: rgba(30, 20, 5, .42);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.25;
}

.accounting-table thead th:first-child,
.accounting-table tbody th { text-align: left; }
.accounting-table thead small { color: #94a3b8; font-weight: 600; }
.accounting-table tbody td { color: #e2e8f0; font-weight: 700; }
.accounting-table tbody tr:last-child th,
.accounting-table tbody tr:last-child td { border-bottom: 0; }
.accounting-table tbody tr:hover { background: rgba(56, 189, 248, .05); }
.accounting-table .accounting-highlight { color: #fbbf24; font-size: 11px; }
.accounting-table .accounting-number { font-variant-numeric: tabular-nums; }
.accounting-scope-kind {
  display: block;
  color: #7dd3fc;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .08em;
}
.accounting-scope-label { display: block; margin-top: 2px; color: #f8fafc; }
.accounting-table td small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 8px;
  font-weight: 600;
}
.accounting-table .accounting-metric > span {
  display: block;
  min-height: 1.15em;
}
.accounting-table .accounting-field-status {
  font-size: 7.5px;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.accounting-table .accounting-field-status.ok { color: #86efac; }
.accounting-table .accounting-field-status.warn { color: #fbbf24; }
.accounting-table .accounting-field-status.muted { color: #94a3b8; }
.accounting-table .accounting-reference { color: #bae6fd; }
.accounting-status { font-weight: 800; white-space: nowrap; }
.accounting-status.ok { color: #86efac; }
.accounting-status.warn { color: #fbbf24; }
.accounting-status.muted { color: #94a3b8; }
.accounting-empty {
  padding: 11px;
  border: 1px dashed rgba(245, 158, 11, .32);
  border-radius: 8px;
  color: #fbbf24;
  font-size: 11px;
}

.measurement-details {
  margin-top: 10px;
  border-top: 1px solid rgba(56, 189, 248, .12);
  padding-top: 8px;
}
.measurement-details summary {
  cursor: pointer;
  color: #7dd3fc;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .07em;
}
.measurement-details summary span {
  color: #64748b;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
}

@media (max-width: 800px) {
  .accounting-header { flex-direction: column; }
  .accounting-summary-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .accounting-table { min-width: 1120px; }
}

@media (max-width: 480px) {
  .accounting-summary-grid { grid-template-columns: 1fr; }
}

/* ── Cockpit session/login ──────────────────────────────────── */
.cockpit-session-btn {
  border: 1px solid rgba(16, 185, 129, 0.42);
  border-radius: 6px;
  padding: 5px 8px;
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.12);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.cockpit-session-btn:hover { background: rgba(16, 185, 129, 0.24); }
.cockpit-session-btn-muted {
  border-color: rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.08);
}
.cockpit-session-btn-muted:hover { background: rgba(148, 163, 184, 0.18); }

.cockpit-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.84);
  backdrop-filter: blur(8px);
}

.cockpit-login-overlay[hidden] { display: none; }
.cockpit-login-card {
  width: min(100%, 420px);
  box-sizing: border-box;
  padding: 22px;
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 14px;
  background: #0b1329;
  color: #e2e8f0;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.72), 0 0 34px rgba(56, 189, 248, 0.12);
}

.cockpit-login-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.cockpit-login-kicker {
  color: #38bdf8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}
.cockpit-login-card h2 {
  margin: 5px 0 0;
  color: #f8fafc;
  font-size: 20px;
}
.cockpit-login-help {
  margin: 8px 0 18px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}
.cockpit-login-close {
  border: 0;
  color: #94a3b8;
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.cockpit-login-close:hover { color: #f8fafc; }
.cockpit-login-field {
  display: block;
  margin-top: 13px;
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}
.cockpit-login-field input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 10px 11px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 8px;
  outline: none;
  color: #f8fafc;
  background: rgba(2, 8, 23, .76);
  font: inherit;
}
.cockpit-login-field input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .13);
}
.cockpit-login-error {
  min-height: 18px;
  margin-top: 10px;
  color: #fda4af;
  font-size: 11px;
}
.cockpit-login-submit {
  width: 100%;
  margin-top: 4px;
  padding: 11px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  cursor: pointer;
  font-weight: 800;
}
.cockpit-login-submit:disabled { opacity: .65; cursor: wait; }
.cockpit-login-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 11px;
}
.cockpit-login-footer a { color: #7dd3fc; }
.cockpit-login-footer button {
  border: 0;
  color: #94a3b8;
  background: transparent;
  cursor: pointer;
}
.cockpit-login-footer button:hover { color: #f8fafc; }

@media (max-width: 900px) {
  .user-chip .user-name { display: none; }
  .cockpit-session-btn { padding: 5px 6px; }
}

/* ── Screens ── */
.screen {
  display: none;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── KPI Grid ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.kpi-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.kpi-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.kpi-icon { font-size: 18px; }

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.kpi-green {
  background: var(--gradient-success) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}

.kpi-detail {
  font-size: 12px;
  color: var(--text-muted);
}

.kpi-p0 { color: var(--accent-red); font-weight: 600; margin-right: 8px; }
.kpi-p1 { color: var(--accent-amber); font-weight: 600; }

.kpi-mode-text {
  font-size: 22px !important;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Charts ── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(10px);
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 100px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 20px;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.bar-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 28px;
}

/* ── Section Cards ── */
.section-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
  margin-bottom: 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.section-note {
  font-size: 12px;
  color: var(--accent-amber);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--accent-amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Incident List ── */
.incident-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.incident-item:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-active);
}

.severity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.severity-dot.critical { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }
.severity-dot.high { background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }
.severity-dot.medium { background: var(--accent-blue); }
.severity-dot.low { background: var(--accent-green); }

.incident-info { flex: 1; min-width: 0; }

.incident-id {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-accent);
  font-family: 'JetBrains Mono', monospace;
}

.incident-summary {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.incident-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-NEW { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.status-TRIAGED { background: rgba(168, 85, 247, 0.2); color: var(--accent-purple); }
.status-REMEDIATION_PROPOSED { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }
.status-REMEDIATION_APPROVED { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.status-QA_PENDING { background: rgba(6, 182, 212, 0.2); color: var(--accent-cyan); }
.status-QA_FAILED { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }
.status-CANARY { background: rgba(236, 72, 153, 0.2); color: var(--accent-pink); }
.status-ROLLOUT { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }
.status-RESOLVED { background: rgba(16, 185, 129, 0.3); color: var(--accent-green); }
.status-ROLLBACK_REQUIRED { background: rgba(239, 68, 68, 0.3); color: var(--accent-red); }
.status-ROLLED_BACK { background: rgba(245, 158, 11, 0.3); color: var(--accent-amber); }
.status-ESCALATED { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }
.status-CLOSED { background: rgba(100, 116, 139, 0.2); color: var(--text-muted); }

.sla-timer {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.sla-ok { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.sla-warn { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.sla-breach { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); animation: pulse 1s infinite; }

/* ── SLA Countdown ── */
.sla-countdown-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.countdown-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-red);
  min-width: 80px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Toolbar / Filters ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 6px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.filter-select:hover { border-color: var(--border-active); }
.filter-select:focus { outline: none; border-color: var(--accent-indigo); }

/* ── Data Table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-glass);
}

.data-table td {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(100, 116, 139, 0.1);
}

.data-table tr:hover td { background: var(--bg-glass); }

/* ── Modes Grid ── */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.mode-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.3s ease;
}

.mode-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow);
}

.mode-card.active {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.08);
}

.mode-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.mode-card-label {
  font-size: 11px;
  color: var(--text-accent);
  margin-bottom: 8px;
}

.mode-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Org Chart ── */
.org-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.org-node {
  padding: 12px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.org-node.level-0 {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.org-node.level-1 { margin-left: 24px; }
.org-node.level-2 { margin-left: 48px; }

.org-node-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.org-node-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Timeline ── */
.timeline-item {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(100, 116, 139, 0.1);
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-indigo);
  margin-top: 4px;
  flex-shrink: 0;
}

.timeline-content { flex: 1; }

.timeline-event-type {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-accent);
  font-family: 'JetBrains Mono', monospace;
}

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

.timeline-details {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Detail Panel ── */
.detail-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: 480px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-glass);
  z-index: 200;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.detail-panel.hidden { display: none; }

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
}

.detail-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-accent);
}

.btn-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-glass);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.btn-close:hover { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 13px;
  color: var(--text-primary);
}

/* ── Approval Items ── */
.approval-item {
  padding: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.approval-action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-approve, .btn-reject {
  padding: 6px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-approve {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-approve:hover { background: rgba(16, 185, 129, 0.3); }

.btn-reject {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-reject:hover { background: rgba(239, 68, 68, 0.25); }

/* ── Feedback Items ── */
.feedback-item {
  padding: 14px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.feedback-summary {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.feedback-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

/* ── Responsive ── */
/* At common laptop widths the sidebar leaves too little horizontal room for
   the title plus all command controls.  The controls move to a second,
   readable row at 100% browser zoom instead of requiring 80% zoom. */
@media (max-width: 1400px) {
  .topbar-left { flex: 1 1 100%; }
  .topbar-right { flex-basis: 100%; justify-content: flex-start; }
}

@media (max-width: 1024px) {
  .sidebar { width: 60px; }
  .sidebar-brand .brand-text,
  .nav-label,
  .sidebar-footer { display: none; }
  .main-content { margin-left: 60px; }
  /* Keep the telemetry/session controls usable at 100% zoom when the
     compact sidebar is active.  The previous fixed-height bar could clip
     controls instead of wrapping them. */
  .topbar { gap: 8px 12px; padding: 10px 16px; }
  .topbar-left { min-width: 0; flex: 1 1 220px; }
  .topbar-right { min-width: 0; flex: 1 1 100%; justify-content: flex-end; flex-wrap: wrap; }
  .charts-row { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .topbar-left { align-items: flex-start; flex-direction: column; gap: 4px; }
  .topbar-right { justify-content: flex-start; gap: 7px; }
  .screen { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .detail-panel { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   CHẾ ĐỘ TỰ LÁI (AUTOPILOT CONTROLLER) & CEO INTERVENTION MODAL
   ═══════════════════════════════════════════════════════════════ */

.authority-mode-selector-wrapper {
  display: flex;
  align-items: center;
}

.authority-mode-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mode-select-btn {
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.mode-select-btn:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
}

.mode-select-btn.active[data-mode="autopilot_safe"],
.mode-select-btn.active[data-mode="autopilot_guarded"] {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.45));
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

.mode-select-btn.active[data-mode="co_drive"] {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.45));
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.35);
}

.mode-select-btn.active[data-mode="manual"] {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.45));
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

.mode-select-btn.active[data-mode="frozen"] {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(14, 165, 233, 0.45));
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.mode-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.mode-led.pulse-green {
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulseGreenGlow 1.8s infinite;
}

@keyframes pulseGreenGlow {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Modal Can Thiệp Chỉ Đạo */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.2s ease;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  position: relative;
  background: #0f172a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 30px rgba(245, 158, 11, 0.15);
  overflow: hidden;
}

.ceo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   FEEDBACK GOOGLE SHEET RESPONSE TABLE & LIGHTBOX
   ═══════════════════════════════════════════════════════════════ */

/* View Mode Buttons */
.view-mode-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.view-mode-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.view-mode-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(29, 78, 216, 0.45));
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.25);
}

/* Filter Toolbar */
.sheet-filter-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.65);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
}

.sheet-search-input {
  background: rgba(10, 14, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  padding: 6px 12px;
  font-size: 12px;
  min-width: 220px;
  outline: none;
  transition: border-color 0.2s;
}

.sheet-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.sheet-select-filter {
  background: rgba(10, 14, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #cbd5e1;
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.sheet-stats-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sheet-stat-pill {
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 20px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sheet-stat-pill strong {
  color: #fff;
}

/* Google Sheet Style Table */
.sheet-table-wrapper {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(11, 15, 25, 0.85);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
  line-height: 1.45;
  white-space: normal;
}

.sheet-table th {
  background: #141e33;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.sheet-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
  color: #e2e8f0;
}

.sheet-table tr:hover td {
  background: rgba(59, 130, 246, 0.07);
}

.sheet-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.012);
}

.sheet-table tr:nth-child(even):hover td {
  background: rgba(59, 130, 246, 0.07);
}

/* Screenshot Preview in Table */
.sheet-screenshot-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.sheet-screenshot-thumb {
  width: 68px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  background: #000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sheet-screenshot-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.5);
  border-color: #3b82f6;
}

.sheet-screenshot-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.sheet-screenshot-badge:hover {
  background: rgba(59, 130, 246, 0.28);
  color: #93c5fd;
}

/* Lightbox Modal */
.lightbox-container {
  width: 90%;
  max-width: 920px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  animation: fadeIn 0.2s ease;
}

.lightbox-header {
  background: #1e293b;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-body {
  padding: 16px;
  background: #090d16;
  max-height: 80vh;
  overflow-y: auto;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   TICKET DIRECTORY & PROGRESS TRACKER STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Directory Grid & Cards */
.directory-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.directory-search {
  flex: 1;
  min-width: 260px;
  background: #111927;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.directory-search:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.directory-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.directory-card {
  background: #131b2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.2s ease;
}

.directory-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.directory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.directory-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.directory-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.35);
}

.directory-user-name {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.directory-user-code-badge {
  font-family: monospace;
  font-size: 11px;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.directory-user-contact {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.directory-stats {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.directory-stat-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.directory-stat-total {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.directory-stat-active {
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.directory-stat-resolved {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.directory-tickets-wrapper {
  background: #0d1322;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  margin-top: 10px;
}

/* Visual Progress Stepper 6 Steps */
.stepper-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  margin: 24px 0 32px 0;
  padding: 0 10px;
}

.stepper-progress-line {
  position: absolute;
  top: 20px;
  left: 30px;
  right: 30px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.stepper-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 0.4s ease;
  border-radius: 2px;
}

.stepper-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.stepper-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #94a3b8;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.stepper-step.completed .stepper-circle {
  background: #10b981;
  border-color: #34d399;
  color: #fff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.stepper-step.current .stepper-circle {
  background: #2563eb;
  border-color: #60a5fa;
  color: #fff;
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.6);
  animation: pulseBlue 1.8s infinite;
}

.stepper-step.current-ceo .stepper-circle {
  background: #f59e0b;
  border-color: #fde047;
  color: #000;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.7);
  animation: pulseAmber 1.8s infinite;
}

.stepper-step.current-escalated .stepper-circle {
  background: #ef4444;
  border-color: #fca5a5;
  color: #fff;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.7);
  animation: pulseRed 1.8s infinite;
}

.stepper-label {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  margin-top: 8px;
}

.stepper-step.completed .stepper-label {
  color: #34d399;
}

.stepper-step.current .stepper-label {
  color: #60a5fa;
}

.stepper-step.current-ceo .stepper-label {
  color: #fbbf24;
}

.stepper-step.current-escalated .stepper-label {
  color: #f87171;
}

.stepper-desc {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
  max-width: 100px;
  line-height: 1.25;
}

@keyframes pulseBlue {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
  70% { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

@keyframes pulseAmber {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes pulseRed {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* SLA Bar Meter */
.sla-meter-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.sla-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12.5px;
}

.sla-meter-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.sla-meter-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s ease;
}

.sla-status-safe {
  background: linear-gradient(90deg, #10b981, #059669);
}

.sla-status-warning {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.sla-status-breached {
  background: linear-gradient(90deg, #ef4444, #b91c1c);
}

/* ═══════════════════════════════════════════════════════════════
   TOPBAR QUICK-LAUNCH DROPDOWN: 18 TÀU CON & TELEGRAM BOTS
   ═══════════════════════════════════════════════════════════════ */
.quick-launch-dropdown-wrapper {
  position: relative;
}

.quick-launch-trigger-btn {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(37, 99, 235, 0.25));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.15);
}

.quick-launch-trigger-btn:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(37, 99, 235, 0.4));
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.quick-launch-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  background: #0b1120;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  z-index: 1000;
  overflow: hidden;
  animation: fadeIn 0.18s ease;
}

.quick-launch-header {
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(15, 23, 42, 0.9));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.quick-launch-search-box {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.quick-launch-search-box input {
  width: 100%;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}

.quick-launch-search-box input:focus {
  border-color: #38bdf8;
}

.quick-launch-items {
  max-height: 380px;
  overflow-y: auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-launch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.quick-launch-item:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.25);
}

.quick-launch-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.quick-launch-item-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.quick-launch-item-name {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.quick-launch-item-sub {
  font-size: 10.5px;
  color: #94a3b8;
  font-family: monospace;
}

.quick-launch-item-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.quick-action-link {
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}

.quick-action-web {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.quick-action-web:hover {
  background: #38bdf8;
  color: #000;
}

.quick-action-tg {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.quick-action-tg:hover {
  background: #3b82f6;
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   SCREEN 4: CHILD SHIPS HUB & INTERACTIVE CARDS
   ═══════════════════════════════════════════════════════════════ */
.branch-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.branch-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.branch-tab-btn.active {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.ship-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.ship-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.ship-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.ship-card-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ship-card-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ship-card-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}

.ship-card-id {
  font-family: monospace;
  font-size: 11px;
  color: #38bdf8;
  font-weight: 600;
}

.ship-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.ship-badge-branch {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ship-badge-online {
  font-size: 10px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ship-card-desc {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.22);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.ship-card-readiness {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ship-readiness-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
}

.ship-readiness-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.ship-readiness-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.ship-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.ship-btn {
  flex: 1;
  min-width: 90px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ship-btn-web {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.ship-btn-web:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.ship-btn-tg {
  background: rgba(37, 99, 235, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(37, 99, 235, 0.35);
}

.ship-btn-tg:hover {
  background: #2563eb;
  color: #fff;
}

.ship-btn-manifest {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ship-btn-manifest:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   CREATE SHIP & BOT MODAL STYLING
   ═══════════════════════════════════════════════════════════════ */
.icon-quick-chip {
  transition: all 0.15s ease;
  user-select: none;
}

.icon-quick-chip:hover {
  background: rgba(16, 185, 129, 0.3) !important;
  transform: scale(1.18);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.form-section-box input:focus,
.form-section-box select:focus,
.form-section-box textarea:focus {
  outline: none;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

@keyframes shipHighlight {
  0% { box-shadow: 0 0 0 rgba(16, 185, 129, 0); }
  50% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.8), inset 0 0 15px rgba(16, 185, 129, 0.2); border-color: #10b981; }
  100% { box-shadow: 0 0 0 rgba(16, 185, 129, 0); }
}

.ship-card-new-highlight {
  animation: shipHighlight 3s ease-out;
}

/* ═══════════════════════════════════════════════════════════════
   SCREEN 9: TELEMETRY & MULTI-AGENT OBSERVABILITY STYLES
   ═══════════════════════════════════════════════════════════════ */
.tm-header-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.tm-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tm-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.tm-kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tm-kpi-val {
  font-size: 22px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
}

.tm-kpi-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.tm-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  display: inline-block;
}
.tm-pill.green { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }
.tm-pill.blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.tm-pill.warn { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.4); }
.tm-pill.red { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.4); }

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

.tm-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}
.tm-progress-fill.cyan { background: linear-gradient(90deg, #06b6d4, #3b82f6); }
.tm-progress-fill.purple { background: linear-gradient(90deg, #8b5cf6, #a855f7); }
.tm-progress-fill.amber { background: linear-gradient(90deg, #f59e0b, #eab308); }

.tm-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.tm-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.tm-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.tm-chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tm-pill-role {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
}
.tm-pill-role.badge-ma {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.tm-pill-role.badge-std {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.row-agent {
  background: rgba(56, 189, 248, 0.03);
}

.tm-mini-bar {
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.tm-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 2px;
}

.tm-status-tag {
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tm-status-tag.tag-up { color: #10b981; }
.tm-status-tag.tag-down { color: #ef4444; }

.pulse {
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.tm-filter-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tm-filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.tm-filter-pill.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
  color: #22d3ee;
  font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════════
   2-MODE CONTROLLER & ANOMALY WATCHDOG STYLES
   ═══════════════════════════════════════════════════════════════ */

.authority-mode-selector-wrapper {
  display: flex;
  align-items: center;
}

.authority-mode-selector {
  display: flex;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.mode-select-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.mode-select-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.mode-select-btn.active[data-mode="autopilot_100"],
.mode-select-btn.active[data-mode="autopilot_safe"] {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.35));
  border-color: rgba(52, 211, 153, 0.6);
  color: #34d399;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
}

.mode-select-btn.active[data-mode="co_drive"] {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(59, 130, 246, 0.35));
  border-color: rgba(96, 165, 250, 0.6);
  color: #60a5fa;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.35);
}

.mode-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.pulse-green {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 1.6s infinite ease-in-out;
}

.blue-led {
  background: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
}

/* Watchdog Topbar Badge */
.watchdog-topbar-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 11.5px;
  color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.watchdog-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a855f7;
  box-shadow: 0 0 8px #a855f7;
  animation: pulseDot 2s infinite ease-in-out;
}

.btn-watchdog-test-dm {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.5);
  color: #c084fc;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-watchdog-test-dm:hover {
  background: rgba(139, 92, 246, 0.4);
  color: #fff;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

/* Overview Banner: 2-Mode Command & Watchdog */
.watchdog-command-banner {
  background: radial-gradient(circle at top left, rgba(16, 185, 129, 0.15), rgba(15, 23, 42, 0.95)), var(--bg-card);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 14px;
  padding: 18px 24px;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  transition: all 0.3s ease;
}

.watchdog-command-banner.mode-codrive {
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.15), rgba(15, 23, 42, 0.95)), var(--bg-card);
  border-color: rgba(59, 130, 246, 0.35);
}

.wcb-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
  min-width: 320px;
}

.wcb-status-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
}

.wcb-pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 12px #10b981;
  animation: pulseDot 1.8s infinite ease-in-out;
}

.watchdog-command-banner.mode-codrive .wcb-pulse {
  background: #3b82f6;
  box-shadow: 0 0 12px #3b82f6;
}

.wcb-mode-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  white-space: nowrap;
}

.watchdog-command-banner.mode-codrive .wcb-mode-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}

.wcb-info h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 800;
  color: #34d399;
  letter-spacing: 0.3px;
}

.watchdog-command-banner.mode-codrive .wcb-info h3 {
  color: #60a5fa;
}

.wcb-info p {
  margin: 0 0 10px 0;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  max-width: 850px;
}

.wcb-metrics-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.wcb-metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.wcb-micon {
  font-size: 14px;
}

.wcb-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-watchdog-action {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: 1px solid rgba(59, 130, 246, 0.5);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-watchdog-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.btn-watchdog-test {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.5);
  color: #c084fc;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-watchdog-test:hover {
  background: rgba(139, 92, 246, 0.35);
  color: #fff;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.4);
}

/* ═════════════════════════════════════════════════════════════════
   WATCHDOG 6 TIÊU CHUẨN GIÁM SÁT 24/7 MODAL & FLEET MATRIX
   ═════════════════════════════════════════════════════════════════ */

.btn-watchdog-standards {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.35));
  border: 1px solid rgba(52, 211, 153, 0.6);
  color: #34d399;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-watchdog-standards:hover {
  background: rgba(16, 185, 129, 0.45);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

/* Modal Container */
.watchdog-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.watchdog-modal-card {
  background: #0b1329;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  width: 100%;
  max-width: 1150px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.15);
  overflow: hidden;
  animation: wdFadeIn 0.25s ease-out;
}

@keyframes wdFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.wd-header {
  padding: 18px 24px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.8));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wd-title-box h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wd-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.wd-tabs-bar {
  display: flex;
  gap: 4px;
  padding: 8px 24px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wd-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wd-tab-btn:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
}

.wd-tab-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.wd-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

/* 6 Pillars Grid */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.pillar-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: all 0.2s ease;
}

.pillar-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.pillar-badge-num {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  padding: 2px 8px;
}

.pillar-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pillar-icon {
  font-size: 20px;
}

.pillar-header h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.pillar-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

.pillar-details-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.pillar-details-list li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.pillar-details-list li strong {
  color: #38bdf8;
  min-width: 80px;
}

/* Health Matrix Tables */
.health-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.health-table th {
  background: rgba(15, 23, 42, 0.9);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.health-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.status-pill.online {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-pill.offline {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-pill.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Registry-driven fleet activity panel.  Keep UNKNOWN visually distinct from
   LIVE so a missing heartbeat can never look like an idle/healthy worker. */
.fleet-activity-panel {
  margin: 16px 0 24px;
  padding: 18px 20px;
  border: 1px solid rgba(56, 189, 248, .24);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(8, 20, 38, .92), rgba(15, 23, 42, .78));
  box-shadow: 0 12px 32px rgba(0, 0, 0, .20);
}

.fleet-activity-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.fleet-activity-kicker {
  color: #38bdf8;
  font: 800 10px/1.2 'JetBrains Mono', monospace;
  letter-spacing: .11em;
}

.fleet-activity-head h2 {
  margin: 5px 0 4px;
  color: #f8fafc;
  font-size: 17px;
}

.fleet-activity-head p {
  max-width: 760px;
  margin: 0;
  color: #94a3b8;
  font-size: 11.5px;
  line-height: 1.45;
}

.fleet-activity-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fleet-activity-status {
  color: #fbbf24;
  font: 700 10px/1.2 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.fleet-activity-status.live { color: #34d399; }
.fleet-activity-status.error { color: #fda4af; }

#fleet-activity-refresh {
  padding: 7px 10px;
  color: #7dd3fc;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(56, 189, 248, .08);
  border: 1px solid rgba(56, 189, 248, .30);
  border-radius: 7px;
  cursor: pointer;
}

#fleet-activity-refresh:disabled { opacity: .55; cursor: wait; }

.fleet-activity-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 10px;
  color: #cbd5e1;
  font-size: 11px;
}

.fleet-activity-summary .summary-chip,
.fleet-activity-teams .team-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, .17);
  background: rgba(15, 23, 42, .55);
}

.fleet-activity-summary .summary-chip.live { color: #34d399; border-color: rgba(16, 185, 129, .30); }
.fleet-activity-summary .summary-chip.unknown { color: #fbbf24; border-color: rgba(245, 158, 11, .28); }

.fleet-activity-teams {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fleet-activity-teams:empty { display: none; }
.fleet-activity-teams .team-chip { color: #94a3b8; font-size: 10px; }
.fleet-activity-teams .team-chip strong { color: #e2e8f0; }

.fleet-activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 9px;
}

.fleet-activity-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 9px;
  background: rgba(15, 23, 42, .64);
}

.fleet-activity-card.live { border-color: rgba(16, 185, 129, .34); }
.fleet-activity-card.unknown { border-color: rgba(245, 158, 11, .20); }

.fleet-activity-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 7px;
}

.fleet-activity-card-name { color: #f8fafc; font-size: 11.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-activity-card-id { margin-top: 2px; color: #64748b; font: 9px/1.3 'JetBrains Mono', monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fleet-activity-badge {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 5px;
  color: #fbbf24;
  font: 800 9px/1.1 'JetBrains Mono', monospace;
  background: rgba(245, 158, 11, .10);
  border: 1px solid rgba(245, 158, 11, .26);
}

.fleet-activity-badge.live { color: #34d399; background: rgba(16, 185, 129, .10); border-color: rgba(16, 185, 129, .30); }
.fleet-activity-row { margin-top: 8px; color: #94a3b8; font-size: 10px; line-height: 1.4; }
.fleet-activity-row strong { color: #cbd5e1; }
.fleet-activity-task { color: #e2e8f0; font-size: 10.5px; line-height: 1.4; }
.fleet-activity-task.ledger { color: #fbbf24; }
.fleet-activity-source { margin-top: 8px; color: #64748b; font: 9px/1.35 'JetBrains Mono', monospace; word-break: break-word; }
.fleet-activity-empty { grid-column: 1 / -1; padding: 18px; color: #94a3b8; font-size: 11px; text-align: center; border: 1px dashed rgba(148, 163, 184, .22); border-radius: 8px; }

@media (max-width: 640px) {
  .fleet-activity-panel { padding: 14px; }
  .fleet-activity-grid { grid-template-columns: 1fr; }
}
