@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

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

/* === TOKENS === */
:root {
  --bg: #f6f5f1;
  --surface: #fefefd;
  --ink: #0d0f14;
  --ink-2: #4b5060;
  --ink-3: #8a8f9c;
  --line: #ebe8e0;
  --line-2: #f0ede5;
  --accent: #1b3a2f;
  --accent-2: #d4e4d8;
  --amber: #b8842a;
  --amber-bg: #f7ecd3;
  --red: #a13a2b;
  --red-bg: #f5dcd6;
  --blue: #2d4a7c;
  --blue-bg: #dde5f2;
  --radius-sm: 8px;
  --radius-md: 9px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --radius-2xl: 16px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --ease: cubic-bezier(0.4,0,0.2,1);
  --dur-fast: 150ms;
  --dur-normal: 250ms;
  --dur-slow: 400ms;
}

/* === TYPOGRAPHY === */
body {
  font-family: 'Geist', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}
.mono { font-family: 'Geist Mono', monospace; font-feature-settings: 'tnum'; }
.serif { font-family: 'Instrument Serif', serif; font-weight: 400; letter-spacing: -0.01em; }

/* === LAYOUT === */
.app { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; background: var(--bg); }

/* === SIDEBAR === */
.sidebar {
  width: 224px;
  background: transparent;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px 20px 20px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 4px 24px 4px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: var(--radius-md);
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #f6f5f1;
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 3px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
}
.brand-text { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }

.plant-selector {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 10px 12px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--dur-fast) var(--ease);
}
.plant-selector:hover { box-shadow: var(--shadow-md); }
.plant-dot { width: 8px; height: 8px; border-radius: 50%; background: #4b8f6b; box-shadow: 0 0 0 3px rgba(75,143,107,0.13); }
.plant-name { font-size: 12px; font-weight: 500; }
.plant-sub { font-size: 10px; color: var(--ink-3); }

.nav-group { margin-bottom: 4px; }
.nav-label { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; padding: 10px 8px 4px; font-weight: 500; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--radius-md);
  color: var(--ink-2); font-size: 13px;
  cursor: pointer; margin-bottom: 1px;
  font-weight: 450;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nav-item:hover { background: rgba(0,0,0,0.03); color: var(--ink); }
.nav-item.active {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), inset 0 0 0 1px var(--line);
  font-weight: 500;
}
.nav-item.disabled { opacity: 0.5; cursor: not-allowed; }
.nav-item svg { width: 15px; height: 15px; stroke-width: 1.6; opacity: 0.85; flex-shrink: 0; }
.nav-count { margin-left: auto; font-size: 10px; color: var(--ink-3); font-family: 'Geist Mono', monospace; }
.nav-dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }

.side-footer {
  margin-top: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: box-shadow var(--dur-fast) var(--ease);
}
.side-footer:hover { box-shadow: var(--shadow-md); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #d4c4a8, #b89968);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 11px;
  flex-shrink: 0;
}
.side-name { font-size: 12px; font-weight: 500; }
.side-role { font-size: 10px; color: var(--ink-3); }

/* === MAIN === */
.main { flex: 1; min-width: 0; padding: 14px 20px 20px 4px; }

/* === TOP BAR === */
.top {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  position: sticky; top: 14px; z-index: 10;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.crumbs strong { color: var(--ink); font-weight: 500; }
.crumbs .sep { opacity: 0.4; }
.read-only-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-sm);
  background: var(--amber-bg); color: var(--amber);
  font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em;
  margin-left: 8px;
}
.top-search {
  margin-left: 18px; flex: 1; max-width: 320px;
  position: relative;
}
.top-search input {
  width: 100%; height: 34px; border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 0 12px 0 34px; font-size: 12.5px; font-family: inherit;
  background: var(--bg); color: var(--ink);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease);
}
.top-search input:focus { border-color: var(--accent); }
.top-search input::placeholder { color: var(--ink-3); }
.top-search svg { position: absolute; left: 11px; top: 9px; width: 15px; height: 15px; stroke: var(--ink-3); }
.top-search kbd {
  position: absolute; right: 10px; top: 8px;
  font-family: 'Geist Mono', monospace; font-size: 10px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 2px 6px; border-radius: 4px; color: var(--ink-3);
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* === CHIPS & BUTTONS === */
.chip {
  height: 30px; padding: 0 10px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-2); font-family: 'Geist Mono', monospace;
}
.chip .live-dot { width: 6px; height: 6px; border-radius: 50%; background: #4b8f6b; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  background: var(--bg); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface); box-shadow: var(--shadow-sm); }
.icon-btn svg { width: 15px; height: 15px; stroke: var(--ink-2); stroke-width: 1.7; }
.icon-btn .badge {
  position: absolute; top: 6px; right: 6px; width: 7px; height: 7px;
  background: var(--red); border-radius: 50%; border: 1.5px solid var(--surface);
}

.btn {
  height: 34px; padding: 0 13px; border-radius: var(--radius-md);
  border: 1px solid var(--line); background: var(--surface);
  font-family: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink);
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn:hover { box-shadow: var(--shadow-sm); background: #fff; }
.btn-dark {
  background: var(--ink); color: #f6f5f1; border-color: var(--ink);
}
.btn-dark:hover { background: #1a1d25; box-shadow: var(--shadow-md); }
.btn-accent {
  background: var(--accent); color: #f6f5f1; border-color: var(--accent);
}
.btn-accent:hover { background: #224a3a; }
.btn-red {
  background: var(--red); color: #fff; border-color: var(--red);
}
.btn-red:hover { background: #8b3124; }
.btn:disabled, .btn[disabled] {
  opacity: 0.5; cursor: not-allowed; pointer-events: none;
}

/* === HERO - BATCH CARD === */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 16px; }
.batch-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-2xl); padding: 22px 24px;
  position: relative; overflow: hidden;
}
.batch-card::before {
  content: ""; position: absolute; top: -40px; right: -30px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,228,216,0.5), transparent 70%);
}
.batch-head { display: flex; align-items: flex-start; justify-content: space-between; position: relative; }
.batch-eyebrow { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.batch-title { font-size: 32px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 500; margin-bottom: 4px; }
.batch-title .serif { font-size: 34px; color: var(--accent); }
.batch-meta { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.batch-meta .divider { width: 3px; height: 3px; background: var(--ink-3); border-radius: 50%; }
.status-tag {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: var(--radius-full);
  background: var(--accent-2); color: var(--accent);
  font-size: 11.5px; font-weight: 500;
  border: 1px solid rgba(27,58,47,0.12);
}
.status-tag .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
.status-tag.deviation { background: var(--red-bg); color: var(--red); border-color: rgba(161,58,43,0.15); }
.status-tag.deviation .live-dot { background: var(--red); }

.batch-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-2);
  position: relative;
}
.bm-label { font-size: 11px; color: var(--ink-3); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.bm-value { font-size: 20px; font-family: 'Geist Mono', monospace; font-weight: 500; letter-spacing: -0.02em; }
.bm-value .unit { font-size: 12px; color: var(--ink-3); font-family: 'Geist', sans-serif; }
.bm-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* === ALERT CARD === */
.alert-card {
  background: linear-gradient(135deg, #2a1815 0%, #1a1210 100%);
  color: #f5e6e0;
  border-radius: var(--radius-2xl); padding: 20px 22px;
  position: relative; overflow: hidden;
  border: 1px solid #3a2620;
}
.alert-card::before {
  content: ""; position: absolute; top: -50px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(220,80,60,0.25), transparent 70%);
  animation: glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }
.alert-card.resolved {
  background: linear-gradient(135deg, #1a2a1f 0%, #141e18 100%);
  border-color: #2a3f30;
}
.alert-card.resolved::before {
  background: radial-gradient(circle, rgba(75,143,107,0.2), transparent 70%);
  animation: none;
}
.alert-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: #d9877a; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.alert-eyebrow .pulse-red { width: 6px; height: 6px; border-radius: 50%; background: #e26855; box-shadow: 0 0 0 4px rgba(226,104,85,0.2); animation: pulse 1.4s infinite; }
.alert-heading { font-size: 17px; font-weight: 500; margin-bottom: 6px; line-height: 1.35; position: relative; }
.alert-body { font-size: 12.5px; color: #c9a89f; line-height: 1.55; position: relative; margin-bottom: 16px; }
.alert-timer-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding-top: 14px; border-top: 1px solid #3a2620;
  position: relative;
}
.timer-label { font-size: 10px; color: #d9877a; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 2px; }
.timer-value { font-size: 26px; font-family: 'Geist Mono', monospace; font-weight: 500; letter-spacing: -0.02em; }
.alert-actions { display: flex; gap: 6px; }
.btn-ack {
  background: #f5e6e0; color: #2a1815; border: none;
  padding: 8px 14px; border-radius: var(--radius-sm); font-family: inherit;
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.btn-ack:hover { background: #fff; }
.btn-alt {
  background: transparent; color: #f5e6e0; border: 1px solid #4a2f28;
  padding: 8px 12px; border-radius: var(--radius-sm); font-family: inherit;
  font-size: 12.5px; cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.btn-alt:hover { background: rgba(255,255,255,0.05); }

/* === KPI CARDS === */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-xl); padding: 16px 18px;
  position: relative; overflow: hidden;
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-eyebrow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi-name { font-size: 11.5px; color: var(--ink-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-badge { font-size: 10px; padding: 2px 7px; border-radius: 5px; font-weight: 500; font-family: 'Geist Mono', monospace; }
.badge-ok { background: var(--accent-2); color: var(--accent); }
.badge-warn { background: var(--amber-bg); color: var(--amber); }
.badge-crit { background: var(--red-bg); color: var(--red); }
.kpi-big { font-size: 30px; font-family: 'Geist Mono', monospace; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.kpi-unit { font-size: 13px; color: var(--ink-3); font-weight: 400; margin-left: 3px; }
.kpi-target { font-size: 11.5px; color: var(--ink-3); margin-top: 10px; display: flex; justify-content: space-between; align-items: baseline; }
.kpi-target b { color: var(--ink); font-weight: 500; font-family: 'Geist Mono', monospace; }
.kpi-viz { margin-top: 10px; height: 32px; position: relative; }

/* === PANELS === */
.split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; margin-bottom: 16px; }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-2xl); padding: 20px 22px;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.panel-title { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.panel-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

/* === SEGMENTED CONTROL === */
.seg {
  display: inline-flex; background: var(--bg); border-radius: var(--radius-sm); padding: 3px;
  border: 1px solid var(--line);
}
.seg-item {
  padding: 4px 10px; font-size: 11.5px; color: var(--ink-2);
  border-radius: 5px; cursor: pointer; font-family: 'Geist Mono', monospace;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.seg-item.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.seg-item:hover:not(.active) { color: var(--ink); }

/* === CHART === */
.chart-legend { display: flex; gap: 18px; font-size: 11.5px; color: var(--ink-2); margin-bottom: 12px; }
.legend { display: flex; align-items: center; gap: 6px; }
.legend-line { width: 14px; height: 2px; border-radius: 1px; }
.legend-line.d { background-image: repeating-linear-gradient(to right, var(--ink-3) 0 3px, transparent 3px 6px); }

/* === VESSEL === */
.vessel-wrap { position: relative; height: 380px; background: linear-gradient(180deg, #fbfaf7 0%, #f4f2eb 100%); border-radius: var(--radius-lg); border: 1px solid var(--line-2); overflow: hidden; }
.vessel-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px); background-size: 24px 24px; }
.probe-tag {
  position: absolute; display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 5px 9px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 11px;
  animation: scaleIn var(--dur-slow) var(--ease) both;
}
.probe-tag .d { width: 6px; height: 6px; border-radius: 50%; }
.probe-tag .n { color: var(--ink-3); font-family: 'Geist Mono', monospace; font-size: 10px; }
.probe-tag .v { font-family: 'Geist Mono', monospace; font-weight: 500; }

/* === TABS === */
.tabs-row { display: flex; gap: 4px; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: 14px; }
.tab-btn {
  flex: 1; padding: 6px 8px; text-align: center; font-size: 12px;
  color: var(--ink-2); border-radius: 6px; cursor: pointer; font-weight: 500;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.tab-btn.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.tab-btn:hover:not(.active) { color: var(--ink); }

/* === SENSOR ITEMS === */
.sensor-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line-2);
  transition: background var(--dur-fast) var(--ease);
}
.sensor-item:last-child { border-bottom: none; }
.sensor-item:hover { background: rgba(0,0,0,0.01); }
.sensor-item.deviation-row {
  background: linear-gradient(90deg, rgba(161,58,43,0.05), transparent);
  margin: 0 -22px; padding: 12px 22px;
}
.sensor-idx {
  width: 26px; height: 26px; border-radius: var(--radius-sm);
  background: var(--bg); font-family: 'Geist Mono', monospace;
  font-size: 11px; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.sensor-idx.crit { background: var(--red-bg); color: var(--red); border-color: #e8beb4; }
.sensor-info { flex: 1; min-width: 0; }
.sensor-nm { font-size: 12.5px; font-weight: 500; }
.sensor-nm .dev-label { color: var(--red); font-size: 10px; font-weight: 500; margin-left: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.sensor-tg { font-size: 10.5px; color: var(--ink-3); margin-top: 1px; }
.sensor-vv { text-align: right; flex-shrink: 0; }
.sensor-vv .n { font-family: 'Geist Mono', monospace; font-size: 13px; font-weight: 500; }
.sensor-vv .t { font-size: 10.5px; color: var(--ink-3); font-family: 'Geist Mono', monospace; margin-top: 1px; }

/* === CONTROLS === */
.control-item { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.control-item:last-child { border-bottom: none; }
.control-hd { display: flex; justify-content: space-between; margin-bottom: 8px; }
.control-nm { font-size: 12.5px; font-weight: 500; }
.control-nm .hint { font-size: 10.5px; color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.control-vl { font-family: 'Geist Mono', monospace; font-size: 13px; font-weight: 500; }
.track { position: relative; height: 6px; background: var(--bg); border-radius: 3px; border: 1px solid var(--line-2); }
.track-safe { position: absolute; top: 0; height: 100%; background: var(--accent-2); border-radius: 3px; }
.track-fill { position: absolute; top: 0; height: 100%; background: var(--accent); border-radius: 3px; transition: width var(--dur-normal) var(--ease); }
.track-knob {
  position: absolute; top: -6px; width: 16px; height: 16px;
  background: var(--surface); border: 2px solid var(--accent); border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: left var(--dur-normal) var(--ease);
  cursor: pointer;
}
.track-knob:hover { transform: scale(1.15); }
.track-scale { display: flex; justify-content: space-between; margin-top: 8px; font-family: 'Geist Mono', monospace; font-size: 10px; color: var(--ink-3); }

/* === EVENT LOG === */
.event { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.event:last-child { border-bottom: none; }
.event-line { width: 24px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 2px; }
.event-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.event-dot.act { background: var(--accent); }
.event-dot.warn { background: var(--amber); }
.event-dot.crit { background: var(--red); }
.event-tail { width: 1px; flex: 1; background: var(--line-2); }
.event-body { flex: 1; }
.event-title { font-weight: 500; }
.event-desc { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.event-time { color: var(--ink-3); font-family: 'Geist Mono', monospace; font-size: 11px; flex-shrink: 0; }

/* === BOTTOM ROW === */
.bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* === FOOTER === */
.footer-strip {
  margin-top: 20px; padding: 14px 22px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: var(--ink-3);
}
.footer-strip .set { display: flex; gap: 16px; align-items: center; }

/* === TOAST === */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 16px; border-radius: var(--radius-lg);
  background: var(--ink); color: #f6f5f1;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn var(--dur-normal) var(--ease);
  max-width: 380px;
}
.toast.success { background: var(--accent); }
.toast.warning { background: var(--amber); color: #fff; }
.toast.error { background: var(--red); color: #fff; }
.toast.leaving { animation: toastOut var(--dur-normal) var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(12px); } }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(13,15,20,0.5);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  animation: fadeIn var(--dur-fast) var(--ease);
}
.modal-card {
  background: var(--surface); border-radius: var(--radius-2xl);
  padding: 28px; width: 480px; max-width: 90vw;
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--dur-normal) var(--ease);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title { font-size: 17px; font-weight: 600; }
.modal-close {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: var(--bg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  transition: background var(--dur-fast) var(--ease);
}
.modal-close:hover { background: var(--line); }
.modal-body { margin-bottom: 20px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.modal-body textarea {
  width: 100%; min-height: 80px; border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 10px 12px;
  font-family: inherit; font-size: 13px; color: var(--ink);
  background: var(--bg); resize: vertical;
  outline: none; margin-top: 10px;
}
.modal-body textarea:focus { border-color: var(--accent); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; }

/* === LOGIN === */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(180deg, #0d0f14 0%, #1a1d25 50%, #252830 100%);
  padding: 40px;
}
.login-container { text-align: center; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; }
.login-brand-mark {
  width: 40px; height: 40px; border-radius: 12px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; color: #f6f5f1;
}
.login-brand-text { font-size: 22px; font-weight: 600; color: #f6f5f1; letter-spacing: -0.01em; }
.login-subtitle { font-size: 13px; color: #8a8f9c; margin-bottom: 40px; }
.login-label { font-size: 12px; color: #8a8f9c; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; margin-bottom: 16px; }
.user-cards { display: flex; gap: 16px; justify-content: center; margin-bottom: 32px; }
.user-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-2xl); padding: 24px; width: 200px;
  cursor: pointer; text-align: center;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.user-card:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
.user-card.selected { background: rgba(27,58,47,0.3); border-color: var(--accent); }
.user-card .avatar { width: 48px; height: 48px; margin: 0 auto 12px; font-size: 16px; }
.user-card .name { font-size: 14px; font-weight: 500; color: #f6f5f1; margin-bottom: 4px; }
.user-card .role { font-size: 11.5px; color: #8a8f9c; }
.user-card .shift { font-size: 10.5px; color: #6b7080; margin-top: 2px; }
.login-form { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.login-form input {
  width: 320px; height: 40px; border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04); color: #f6f5f1;
  padding: 0 14px; font-size: 13px; font-family: inherit;
  outline: none;
}
.login-form input:focus { border-color: var(--accent); }
.login-form input::placeholder { color: #6b7080; }
.login-btn {
  width: 320px; height: 42px; border-radius: var(--radius-md);
  background: var(--accent); color: #f6f5f1; border: none;
  font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.login-btn:hover { background: #224a3a; }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* === QA REVIEW === */
.qa-table { width: 100%; border-collapse: collapse; }
.qa-table th {
  text-align: left; font-size: 11px; font-weight: 500;
  color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.qa-table th.sortable { cursor: pointer; user-select: none; }
.qa-table th.sortable:hover { color: var(--ink); }
.qa-table th .sort-icon { display: inline-flex; margin-left: 4px; opacity: 0.5; vertical-align: middle; }
.qa-table th.sorted .sort-icon { opacity: 1; color: var(--accent); }
.qa-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
}
.qa-table tr:last-child td { border-bottom: none; }
.qa-table .mono-cell { font-family: 'Geist Mono', monospace; font-size: 12px; }
.pill {
  display: inline-flex; padding: 2px 8px; border-radius: 5px;
  font-size: 10px; font-weight: 500; font-family: 'Geist Mono', monospace;
}
.pill.ok { background: var(--accent-2); color: var(--accent); }
.pill.warn { background: var(--amber-bg); color: var(--amber); }
.pill.crit, .pill.deviation { background: var(--red-bg); color: var(--red); }
.pill.info { background: var(--blue-bg); color: var(--blue); }

/* Deviation review cards */
.deviation-card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px;
  margin-bottom: 12px;
}
.deviation-card:last-child { margin-bottom: 0; }
.deviation-timeline {
  display: flex; gap: 16px; margin-top: 12px;
  font-size: 11.5px; color: var(--ink-2);
}
.deviation-timeline .step {
  display: flex; align-items: center; gap: 6px;
}
.deviation-timeline .step .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3);
}
.deviation-timeline .step .dot.done { background: var(--accent); }
.deviation-timeline .step .dot.active { background: var(--amber); animation: pulse 1.6s infinite; }
.deviation-timeline .connector { width: 24px; height: 1px; background: var(--line); align-self: center; }

.qa-checkbox {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  font-size: 12px; color: var(--ink-2); cursor: pointer;
}
.qa-checkbox input[type="checkbox"] { accent-color: var(--accent); }

/* Decision panel */
.decision-panel { border: 2px solid var(--line); border-radius: var(--radius-2xl); padding: 24px; margin-top: 16px; }
.decision-panel textarea {
  width: 100%; min-height: 80px; border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 10px 12px;
  font-family: inherit; font-size: 13px; color: var(--ink);
  background: var(--bg); resize: vertical;
  outline: none;
  margin-bottom: 16px;
}
.decision-panel textarea:focus { border-color: var(--accent); }
.decision-actions { display: flex; gap: 10px; }
.decision-outcome {
  padding: 16px; border-radius: var(--radius-lg);
  font-size: 13px; font-weight: 500;
}
.decision-outcome.approved { background: var(--accent-2); color: var(--accent); }
.decision-outcome.rejected { background: var(--red-bg); color: var(--red); }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px; color: var(--ink-3); text-align: center;
}
.empty-state svg { margin-bottom: 12px; opacity: 0.5; }
.empty-state .title { font-size: 14px; font-weight: 500; margin-bottom: 4px; color: var(--ink-2); }
.empty-state .desc { font-size: 12px; }

/* No-active-alerts */
.no-alert-card {
  background: linear-gradient(135deg, #1a2a1f 0%, #141e18 100%);
  color: #c8e0cc;
  border-radius: var(--radius-2xl); padding: 28px;
  text-align: center;
  border: 1px solid #2a3f30;
}
.no-alert-card .check-icon { margin-bottom: 12px; color: #4b8f6b; }
.no-alert-card .heading { font-size: 17px; font-weight: 500; margin-bottom: 6px; }
.no-alert-card .sub { font-size: 12.5px; color: #7aa882; }

/* === TABLE ROW HOVER === */
.qa-table tbody tr { transition: background var(--dur-fast) var(--ease); }
.qa-table tbody tr:hover { background: rgba(0,0,0,0.015); }

/* === BATCH METRIC HOVER === */
.bm-clickable { transition: background var(--dur-fast) var(--ease); border-radius: var(--radius-sm); padding: 4px 8px; margin: -4px -8px; }
.bm-clickable:hover { background: rgba(0,0,0,0.02); }

/* === PROBE TAG HOVER === */
.probe-tag { transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); cursor: pointer; }
.probe-tag:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }

/* === SENSOR ITEM CURSOR === */
.sensor-item { cursor: pointer; }

/* === SORT HEADER AFFORDANCE === */
.qa-table th.sortable .sort-icon { transition: opacity var(--dur-fast) var(--ease); }
.qa-table th.sortable:not(.sorted) .sort-icon { opacity: 0.3; }
.qa-table th.sortable:hover .sort-icon { opacity: 0.7; }

/* === ANIMATIONS === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.fade-in { animation: fadeIn var(--dur-normal) var(--ease) both; }
.slide-up { animation: slideUp var(--dur-normal) var(--ease) both; }
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }

/* Spinner */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
