/* Invelion Drone Health: shared design tokens and components (dark theme by design). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: dark;
  --bg: #060a11;
  --surface-1: #0d131c;
  --surface-2: #131b26;
  --surface-3: #1a2431;
  --glass: rgba(10, 16, 25, 0.74);
  --glass-strong: rgba(10, 16, 25, 0.88);
  --border: rgba(148, 163, 184, 0.13);
  --border-strong: rgba(148, 163, 184, 0.24);
  --text-primary: #e8edf4;
  --text-secondary: #9aa8ba;
  --text-tertiary: #66768a;
  --accent: #3fd0ff;
  --accent-2: #7b8cff;
  --accent-glow: rgba(63, 208, 255, 0.35);
  /* chart series (validated dark steps) */
  --series-1: #338ced;
  --series-2: #e76624;
  --series-3: #00a888;
  --series-4: #d28e05;
  /* status: never alone, always with icon + label */
  --good: #0aac23;
  --warning: #fbb315;
  --serious: #f18a59;
  --critical: #dc3c3d;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text-primary); font-family: var(--font);
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-secondary); }
.dim { color: var(--text-tertiary); }
.hidden { display: none !important; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-primary); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-word { font-weight: 700; letter-spacing: 0.18em; font-size: 13px; }
.brand-sub { font-weight: 500; color: var(--text-secondary); font-size: 13px; letter-spacing: 0.02em; padding-left: 10px;
  border-left: 1px solid var(--border-strong); }

/* ---------- glass panels ---------- */
.glass { background: var(--glass); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-title { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-tertiary); margin: 0 0 10px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-primary); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:hover { background: var(--surface-3); border-color: rgba(148, 163, 184, 0.36); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, #2bb8f0, #5a7cff); border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 6px 24px rgba(63, 160, 255, 0.35); }
.btn-primary:hover { background: linear-gradient(135deg, #45c4f5, #6d8bff); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: rgba(148, 163, 184, 0.08); color: var(--text-primary); }
.btn svg { width: 16px; height: 16px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: rgba(6, 10, 17, 0.6); border: 1px solid var(--border); border-radius: 11px; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary);
  font-size: 12.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text-primary); }
.seg button.on { background: var(--surface-3); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--border-strong); }
.seg button svg { width: 15px; height: 15px; }

/* ---------- status chips (icon + label, never colour alone) ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; font-size: 12px;
  font-weight: 600; border: 1px solid; white-space: nowrap; }
.chip svg { width: 13px; height: 13px; }
.chip.good { color: #5fdc6f; border-color: rgba(10, 172, 35, 0.45); background: rgba(10, 172, 35, 0.12); }
.chip.watch, .chip.warn { color: var(--warning); border-color: rgba(251, 179, 21, 0.45); background: rgba(251, 179, 21, 0.10); }
.chip.service, .chip.crit { color: #ff7b7c; border-color: rgba(220, 60, 61, 0.55); background: rgba(220, 60, 61, 0.14); }
.chip.info { color: var(--accent); border-color: rgba(63, 208, 255, 0.35); background: rgba(63, 208, 255, 0.08); }
.chip.neutral { color: var(--text-secondary); border-color: var(--border-strong); background: rgba(148, 163, 184, 0.06); }

/* ---------- life bars ---------- */
.bar { position: relative; height: 6px; border-radius: 999px; background: rgba(148, 163, 184, 0.12); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.bar > i.good { background: var(--good); }
.bar > i.watch { background: var(--warning); }
.bar > i.service { background: var(--critical); }
.bar > b { position: absolute; top: 0; bottom: 0; background: #fff; opacity: 0.9; border-radius: 999px; }

/* ---------- top bar ---------- */
.topbar { position: fixed; z-index: 20; top: 12px; left: 12px; right: 12px; height: 56px; display: flex; align-items: center; gap: 16px;
  padding: 0 10px 0 16px; }
.topbar .spacer { flex: 1; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: linear-gradient(135deg, #1f3a5a, #2a2f6b); color: #cfe6ff; border: 1px solid var(--border-strong); }

/* ---------- tooltip ---------- */
.tip { position: fixed; z-index: 100; pointer-events: none; padding: 8px 10px; border-radius: 9px; background: var(--glass-strong);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 12px; color: var(--text-primary); max-width: 280px;
  backdrop-filter: blur(10px); transform: translate(-50%, calc(-100% - 12px)); transition: opacity .1s; }
.tip .tip-t { color: var(--text-tertiary); font-size: 11px; margin-bottom: 2px; }

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.18); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--bg); transition: opacity .6s; }
.loader.done { opacity: 0; pointer-events: none; }
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; color: var(--text-secondary); font-size: 13px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(63, 208, 255, 0.15); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cesium chrome ---------- */
.cesium-viewer-bottom, .cesium-widget-credits { display: none !important; }
.credits { position: fixed; z-index: 15; font-size: 10.5px; color: var(--text-tertiary); }
.credits img { height: 14px; vertical-align: middle; opacity: 0.8; }
.credits a { color: var(--text-secondary); }
.credits .cesium-credit-lightbox-overlay { z-index: 300; }
