/* ============================================================
   Seido Operations — Design System
   ============================================================
   Aesthetic: dark ops-center / command-deck.
   Typography pair: Bricolage Grotesque (display) + IBM Plex Sans
   (body) + IBM Plex Mono (data). Distinctive, technical, calm.
   ------------------------------------------------------------ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Palette */
  --bg-0: #0a0c10;          /* page */
  --bg-1: #11141a;          /* surface */
  --bg-2: #181c25;          /* raised */
  --bg-3: #1f2532;          /* hover */
  --bg-input: #0f1218;
  --border: #1a2438;
  --border-strong: #1e3a58;
  --text: #e8eaf0;
  --text-dim: #5aafd4;
  --text-muted: #3a7ea8;

  /* Accent — Seido electric blue */
  --accent: #1e72e4;
  --accent-soft: #1e72e415;
  --accent-strong: #4da8ff;

  /* Status — must be vivid, glanceable */
  --status-green: #4ade80;
  --status-yellow: #facc15;
  --status-red: #f87171;
  --status-blue: #60a5fa;

  /* Glow halos for status lights */
  --glow-green: #4ade8055;
  --glow-yellow: #facc1555;
  --glow-red: #f8717155;
  --glow-blue: #60a5fa55;

  /* Type */
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* Spacing rhythm */
  --r-1: 4px; --r-2: 8px; --r-3: 12px; --r-4: 16px; --r-5: 24px;
  --r-6: 32px; --r-7: 48px; --r-8: 64px;

  /* Radii — zero curve, angular like the Seido triangle */
  --rad-1: 0px; --rad-2: 0px; --rad-3: 0px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Subtle background grid — adds atmosphere, doesn't compete */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(circle at 50% 30%, black 0%, transparent 80%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

button { font-family: inherit; }

/* ============================================================
   Layout shell — sidebar + main
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  padding: var(--r-5) var(--r-3);
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex; align-items: baseline; gap: var(--r-2);
  padding: 0 var(--r-3) var(--r-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--r-4);
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-mark::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
  box-shadow: 0 0 12px var(--accent);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav {
  display: flex; flex-direction: column;
  gap: 2px;
  flex: 1;
}
.nav a {
  display: flex; align-items: center; gap: var(--r-3);
  padding: var(--r-3);
  border-radius: 0;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  border-left: 3px solid transparent;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  transition: background 120ms, color 120ms, border-color 120ms;
}
/* Razor blade line across each nav item */
.nav a::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom left,
    rgba(160, 210, 250, 0.04) 0%,
    rgba(160, 210, 250, 0.04) calc(50% - 1px),
    rgba(150, 200, 245, 0.22) calc(50% - 1px),
    rgba(150, 200, 245, 0.22) 50%,
    rgba(0, 0, 0, 0.06)       50%,
    rgba(0, 0, 0, 0.06)       100%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms;
}
.nav a:hover {
  background: var(--bg-2);
  color: var(--text);
}
.nav a:hover::before { opacity: 1; }
/* Horizontal flare spreading edge-to-edge on hover/active */
.nav a::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(
    ellipse 100% 70% at 50% 100%,
    rgba(120, 205, 255, 0.55) 0%,
    rgba(60,  160, 255, 0.3)  40%,
    transparent               75%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}
.nav a:hover::after { opacity: 1; }
.nav a.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-left-color: var(--accent);
}
.nav a.active::before { opacity: 1; }
.nav a.active::after  { opacity: 1; }
.nav a .nav-icon {
  width: 18px; height: 18px;
  opacity: 0.85;
  flex-shrink: 0;
}
.nav-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--r-4) var(--r-3) var(--r-2);
}

.sidebar-footer {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: var(--r-3);
  border-top: 1px solid var(--border);
  margin-top: var(--r-4);
}
.sidebar-footer .pulse {
  color: var(--status-green);
}
.sidebar-footer .pulse::before {
  content: '●';
  display: inline-block;
  margin-right: 6px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.main {
  padding: var(--r-6) var(--r-7);
  max-width: 1600px;
}
@media (max-width: 1100px) {
  .main { padding: var(--r-5); }
}

/* ============================================================
   Page header
   ============================================================ */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--r-5);
  margin-bottom: var(--r-6);
  padding-bottom: var(--r-4);
  border-bottom: 1px solid var(--border);
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.05;
}
.page-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.page-head-actions { display: flex; gap: var(--r-3); flex-wrap: wrap; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--rad-2);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 120ms;
}
.btn:hover { background: var(--bg-3); border-color: var(--accent); }
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}
.btn-danger:hover {
  border-color: var(--status-red);
  color: var(--status-red);
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon {
  padding: 6px;
  width: 30px; height: 30px;
  justify-content: center;
}

/* ============================================================
   KPI cards (dashboard hero stats)
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--r-4);
  margin-bottom: var(--r-6);
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi {
  background: linear-gradient(135deg, #1f2c3f 0%, #141d2c 48%, #0c1420 100%);
  border: 1px solid rgba(80, 130, 195, 0.22);
  border-top: 1px solid rgba(155, 200, 240, 0.32);
  border-left: 1px solid rgba(130, 180, 225, 0.26);
  border-radius: 0;
  padding: var(--r-4) var(--r-5);
  position: relative;
  overflow: hidden;
  min-width: 0;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  transition: border-color 200ms, box-shadow 400ms;
}
.kpi::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom left,
    rgba(160, 210, 250, 0.07) 0%,
    rgba(160, 210, 250, 0.07) calc(50% - 1px),
    rgba(150, 200, 245, 0.5)  calc(50% - 1px),
    rgba(150, 200, 245, 0.5)  50%,
    rgba(0, 0, 0, 0.15)       50%,
    rgba(0, 0, 0, 0.15)       100%
  );
  pointer-events: none;
  z-index: 0;
}
.kpi::after {
  content: '';
  position: absolute;
  top: 75%; left: 50%;
  width: 600px; height: 400px;
  margin: -200px 0 0 -300px;
  background:
    /* Center node */
    radial-gradient(circle 55px at 50% 60%,
      rgba(220, 242, 255, 0.18) 0%,
      rgba(130, 205, 255, 0.12) 50%,
      transparent                100%
    ),
    /* Horizontal arm */
    radial-gradient(ellipse 95% 18% at 50% 60%,
      rgba(170, 225, 255, 0.15) 0%,
      rgba(80,  175, 255, 0.09) 45%,
      transparent                80%
    ),
    /* Vertical arm */
    radial-gradient(ellipse 10% 90% at 50% 60%,
      rgba(200, 235, 255, 0.11) 0%,
      rgba(80,  170, 255, 0.05) 50%,
      transparent                80%
    );
  pointer-events: none;
  z-index: 1;
  transform: scale(0);
  opacity: 0;
  transition: transform 350ms ease, opacity 350ms ease;
}
.kpi > * { position: relative; z-index: 2; }
.kpi:hover {
  border-color: rgba(80, 130, 195, 0.55);
  border-top-color: rgba(155, 200, 240, 0.65);
}
.kpi:hover::after {
  transform: scale(1);
  opacity: 1;
}
.kpi-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--r-2);
}
.kpi-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(16px, 2.2vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}
.kpi-projected {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: var(--r-3);
}
.kpi-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: var(--r-2);
  display: flex; gap: var(--r-3); flex-wrap: wrap;
}
.kpi-sub-item .label {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 4px;
}

/* Asset-type breakdown row inside KPI cards */
.kpi-asset-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--r-2);
  margin-top: var(--r-3);
  padding-top: var(--r-3);
  border-top: 1px solid var(--border);
}
.kpi-asset {
  background: var(--bg-2);
  border-radius: 8px;
  padding: 10px 12px;
}
.kpi-asset-count {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.kpi-asset-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
}
.kpi-asset-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-top: 4px;
}

/* Asset-type chips (tower / pole authorization) */
.chip.chip-tower {
  background: rgba(91, 192, 235, 0.15);
  color: var(--status-blue);
  border: 1px solid var(--status-blue);
}
.chip.chip-pole {
  background: rgba(76, 217, 100, 0.15);
  color: var(--status-green);
  border: 1px solid var(--status-green);
}

/* ============================================================
   Section header
   ============================================================ */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: var(--r-7) 0 var(--r-4);
  gap: var(--r-4);
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 0;
}
.section-head .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============================================================
   Card grid (pilot cards, drone cards, kit cards, etc.)
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--r-4);
}

.card {
  background: linear-gradient(135deg, #1f2c3f 0%, #141d2c 48%, #0c1420 100%);
  border: 1px solid rgba(80, 130, 195, 0.22);
  border-top: 1px solid rgba(155, 200, 240, 0.32);
  border-left: 1px solid rgba(130, 180, 225, 0.26);
  border-radius: 0;
  padding: var(--r-4);
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  transition: border-color 200ms, filter 400ms ease;
}
/* Diagonal blade line — top-left to bottom-right, lit upper face / shadow lower face */
.card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom left,
    rgba(160, 210, 250, 0.07) 0%,
    rgba(160, 210, 250, 0.07) calc(50% - 1px),
    rgba(150, 200, 245, 0.5)  calc(50% - 1px),
    rgba(150, 200, 245, 0.5)  50%,
    rgba(0, 0, 0, 0.15)       50%,
    rgba(0, 0, 0, 0.15)       100%
  );
  pointer-events: none;
  z-index: 0;
}
/* Sunrise flare — horizontal line spreads edge-to-edge, thin vertical spike rises up */
.card::after {
  content: '';
  position: absolute;
  top: 75%; left: 50%;
  width: 600px; height: 500px;
  margin: -250px 0 0 -300px;
  background:
    /* Center node */
    radial-gradient(circle 55px at 50% 60%,
      rgba(220, 242, 255, 0.18) 0%,
      rgba(130, 205, 255, 0.12) 50%,
      transparent                100%
    ),
    /* Horizontal arm */
    radial-gradient(ellipse 95% 18% at 50% 60%,
      rgba(170, 225, 255, 0.15) 0%,
      rgba(80,  175, 255, 0.09) 45%,
      transparent                80%
    ),
    /* Vertical arm */
    radial-gradient(ellipse 10% 90% at 50% 60%,
      rgba(200, 235, 255, 0.11) 0%,
      rgba(80,  170, 255, 0.05) 50%,
      transparent                80%
    );
  pointer-events: none;
  z-index: 1;
  transform: scale(0);
  opacity: 0;
  transition: transform 350ms ease, opacity 350ms ease;
}
.card > * { position: relative; z-index: 2; }
/* Hover — electric blue radial from center, toned down so text stays readable */
.card:hover {
  border-color: rgba(80, 130, 195, 0.55);
  border-top-color: rgba(155, 200, 240, 0.65);
}
.card:hover::after {
  transform: scale(1);
  opacity: 1;
}

.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--r-3);
  margin-bottom: var(--r-3);
}
.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}
.card-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

.card-body { display: flex; flex-direction: column; gap: var(--r-3); }
.card-actions {
  display: flex; gap: var(--r-2);
  margin-top: var(--r-3);
  padding-top: var(--r-3);
  border-top: 1px solid var(--border);
}

/* ============================================================
   Status lights
   ============================================================ */
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-green  { background: var(--status-green);  box-shadow: 0 0 8px var(--glow-green),  0 0 16px var(--glow-green); }
.dot-yellow { background: var(--status-yellow); box-shadow: 0 0 8px var(--glow-yellow), 0 0 16px var(--glow-yellow); }
.dot-red    { background: var(--status-red);    box-shadow: 0 0 8px var(--glow-red),    0 0 16px var(--glow-red); }
.dot-blue   { background: var(--status-blue);   box-shadow: 0 0 8px var(--glow-blue),   0 0 16px var(--glow-blue); }
.dot-off    { background: var(--bg-3); border: 1px solid var(--border); box-shadow: none; }

.status.green  { color: var(--status-green); }
.status.yellow { color: var(--status-yellow); }
.status.red    { color: var(--status-red); }
.status.blue   { color: var(--status-blue); }

/* ============================================================
   Stat rows inside cards (income, etc.)
   ============================================================ */
.stat-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.stat-row:last-child { border-bottom: 0; }
.stat-row .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat-row .value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.stat-row .value.accent { color: var(--accent); }
.stat-row .value.green { color: var(--status-green); }

/* ============================================================
   Tags / chips
   ============================================================ */
.chip {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.chip.accent { border-color: var(--accent); color: var(--accent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap {
  background: linear-gradient(148deg, #1e2b3e 0%, #141d2c 45%, #0d1521 100%);
  border: 1px solid rgba(80, 130, 195, 0.22);
  border-top: 1px solid rgba(155, 200, 240, 0.32);
  border-left: 1px solid rgba(130, 180, 225, 0.26);
  border-radius: 0;
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  background: var(--bg-2);
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--r-3) var(--r-4);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: var(--r-3) var(--r-4);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-2); }
td.num, th.num { text-align: right; font-family: var(--font-mono); }

/* ============================================================
   Forms (modal)
   ============================================================ */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(5, 7, 11, 0.85);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  padding: var(--r-5);
  z-index: 100;
}
.modal-back.open { display: flex; }
.modal {
  background: linear-gradient(148deg, #1e2b3e 0%, #141d2c 45%, #0d1521 100%);
  border: 1px solid rgba(80, 130, 195, 0.3);
  border-top: 1px solid rgba(155, 200, 240, 0.4);
  border-left: 1px solid rgba(130, 180, 225, 0.3);
  border-radius: 0;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  padding: var(--r-5);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 40px rgba(30, 114, 228, 0.08);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
}
.modal h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  margin: 0 0 var(--r-4);
  letter-spacing: -0.015em;
}
.modal-actions {
  display: flex; justify-content: flex-end; gap: var(--r-3);
  margin-top: var(--r-5);
  padding-top: var(--r-4);
  border-top: 1px solid var(--border);
}

.field {
  display: flex; flex-direction: column;
  gap: 6px;
  margin-bottom: var(--r-3);
}
.field label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field input, .field select, .field textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--rad-2);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 120ms;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 70px; font-family: var(--font-body); }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--r-3);
}

/* ============================================================
   Empty state
   ============================================================ */
.empty {
  background: var(--bg-1);
  border: 1px dashed var(--border-strong);
  border-radius: var(--rad-3);
  padding: var(--r-7);
  text-align: center;
  color: var(--text-dim);
}
.empty h3 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 var(--r-2);
  color: var(--text);
}
.empty p { margin: 0; }

/* ============================================================
   Tabs
   ============================================================ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--r-5);
}
.tab {
  padding: var(--r-3) var(--r-4);
  background: none;
  border: 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 120ms, border-color 120ms;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   Slot cards (cell sheet)
   ============================================================ */

/* Outer page: 2-column grid of cell cards */
#cell-grid {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 900px) { #cell-grid { grid-template-columns: 1fr; } }

/* Internal card layout — manager / seniors / ops stacked */
.cell-slot-layout {
  display: flex;
  flex-direction: column;
  gap: var(--r-2);
  margin-top: var(--r-3);
}
.cell-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--r-2);
}

/* Base slot tile */
.slot {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--rad-2);
  padding: var(--r-3);
  display: flex; flex-direction: column;
  gap: 5px;
}
.slot.manager     { border-color: var(--status-blue);   background: linear-gradient(180deg, var(--status-blue)12 0%, var(--bg-2) 70%); }
.slot.senior      { border-color: var(--status-green);  background: linear-gradient(180deg, var(--status-green)12 0%, var(--bg-2) 70%); }
.slot.operational { border-color: var(--status-yellow); background: linear-gradient(180deg, var(--status-yellow)12 0%, var(--bg-2) 70%); }

/* Compact manager bar — single horizontal row */
.slot.slot-compact {
  flex-direction: row;
  align-items: center;
  gap: var(--r-3);
  padding: 8px var(--r-3);
  min-height: unset;
}
.slot-compact-name {
  flex: 1;
  text-align: right;
  font-size: 14px !important;
}

.slot-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}
.slot-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.slot-empty {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: var(--r-5); right: var(--r-5);
  background: var(--bg-2);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: var(--r-3) var(--r-4);
  border-radius: var(--rad-2);
  font-size: 13px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: toast-in 200ms ease-out;
}
@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   Utility
   ============================================================ */
.row { display: flex; gap: var(--r-3); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--r-3); }
.mono { font-family: var(--font-mono); }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.spacer-1 { height: var(--r-2); }
.spacer-2 { height: var(--r-4); }
.flex-1 { flex: 1; }

/* Sub-card (for batteries inside drone cards, etc.) */
.subcard {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--rad-2);
  padding: 10px var(--r-3);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--r-3);
}
.subcard-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* Gear tile grid (pilot dashboard kit card) */
.gear-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.gear-tile {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--rad-2);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.gear-tile-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gear-tile-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gear-tile-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.gear-tile-dot.green  { background: var(--status-green);  box-shadow: 0 0 6px var(--glow-green); }
.gear-tile-dot.yellow { background: var(--status-yellow); box-shadow: 0 0 6px var(--glow-yellow); }
.gear-tile-dot.red    { background: var(--status-red);    box-shadow: 0 0 6px var(--glow-red); }
.gear-tile-dot.off    { background: var(--bg-3); border: 1px solid var(--border); }

/* Day-by-day payroll calendar row */
.payroll-day {
  display: grid;
  grid-template-columns: 110px 1fr 100px 100px 100px;
  gap: var(--r-3);
  padding: 10px var(--r-3);
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
}
.payroll-day:last-child { border-bottom: 0; }
.payroll-day.header {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-2);
}
.payroll-day .num { text-align: right; }

/* QA flag badge */
.qa-flag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px;
  background: var(--status-yellow)20;
  color: var(--status-yellow);
  border: 1px solid var(--status-yellow);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Refresh button spinner */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Profitability / investment recovery tracker */
.recovery-track {
  height: 6px;
  background: var(--border);
  border-radius: 0;
  margin: 8px 0 4px;
  overflow: hidden;
}
.recovery-fill {
  height: 100%;
  border-radius: 0;
  background: var(--accent);
  transition: width 0.4s ease;
}
.recovery-fill.complete { background: var(--status-green); }
.recovery-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
