
/* ───────────────────────────────────────────────────────────────────────────
   ConnectedIS Web Design System — editorial theme.
   Tokens are FR-7.1 verbatim. Fonts are bundled locally (FR-7.2) because the
   app has to work with no internet connection.
   ─────────────────────────────────────────────────────────────────────────── */

/* The brand's three faces (Branding Guidelines, refreshed October 2026): Sora
   headings, Geist body, Geist Mono labels. Self-hosted rather than fetched from
   Google Fonts: no external dependency, and the content security policy stays
   closed. Variable, latin subset, SIL OFL. */
@font-face {
  font-family: 'Sora';
  src: url('/fonts/sora.woff2') format('woff2-variations');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/geist-mono.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand: Notion → Branding Guidelines (October 2026 refresh). Navy-deep is
     the hover shade of navy (lighter); navy-ink is the deep band colour. */
  --navy: #1A2B6B;
  --navy-deep: #22378A;
  --navy-ink: #0B1638;
  --blue: #1F5DA8;
  --green: #5FD36E;        /* signal green: fills only, never text on white */
  --green-hot: #4CBF5C;
  --green-text: #137A3A;   /* green as text or icons on light grounds */
  --logo-green: #22A447;
  --green-soft: #E3F7E6;

  /* Surfaces. */
  --bg: #F3F5FA;
  --card: #FFFFFF;
  --surface-2: var(--card);
  --surface: #F3F5FA;
  --paper: var(--card);

  --rule: rgba(26, 43, 107, 0.12);
  --rule-soft: rgba(26, 43, 107, 0.06);

  /* Uptime sets body text in navy rather than near-black; it is a large part
     of why the two apps did not look related. */
  --text: #1A2B6B;
  --ink: #0B1430;
  --muted: #4A5675;
  --topbar: rgba(255, 255, 255, 0.86);

  /* Severity, taken from the pairs Uptime already tuned per theme. Green
     still means healthy or resolved only (FR-7.7). */
  --sev-critical: #B3261E;
  --sev-high: #C77700;
  --sev-medium: var(--navy);
  --sev-low: #4A5675;
  --ok: #2F7D32;

  /* Chart bars and map markers: navy reads on the light ground and vanishes
     into the dark one, so it is a token rather than a constant. */
  --data-mark: var(--navy);
  --map-point: var(--data-mark);

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Geist', system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;

  /* Label sizes, as tokens so they can grow on a phone. */
  --micro: 10px;
  --small: 11px;

  --sidebar-w: 220px;
}

/* ── Dark, matching Uptime exactly: a slate ground, not a navy one ──────────
   The theme is always written onto the root element, light or dark, the same
   way the Uptime app does it — so there is no prefers-color-scheme branch and
   no third "auto" state to keep in step. */
:root[data-theme='dark'] {
  --bg: #0f172a;
  --card: #1e293b;
  --surface-2: var(--card);
  --surface: #253347;
  --paper: var(--card);

  --rule: #334155;
  --rule-soft: rgba(255, 255, 255, 0.06);

  --text: #e2e8f0;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --blue: #93c5fd;
  --topbar: rgba(15, 23, 42, 0.82);

  --sev-critical: #fca5a5;
  --sev-high: #fbbf24;
  --sev-medium: #93c5fd;
  --sev-low: #94a3b8;
  --ok: #86efac;

  --data-mark: #93c5fd;
  --green-text: var(--green);
  --map-point: var(--data-mark);

  color-scheme: dark;
}






* { box-sizing: border-box; }

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

::selection { background: var(--green); color: var(--navy-ink); }

/* FR-7.8 — honour reduced motion by turning all animation off. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Signature 1: italic mid-line headings, "Sign-in *explorer.*" ─────────── */
.h-editorial {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  /* Inherits, so the same heading works on the navy hero and on light pages. */
  color: inherit;
  margin: 0;
}
.h-editorial em {
  /* Geist Mono has no italic. Hanken does, so the accent word carries the
     editorial slant properly instead of a synthesised slant of a monospace. */
  font-family: var(--font-body);
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.01em;
}

/* ── Signature 2: mono eyebrow with a 24px green dash ────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--green);
  flex-shrink: 0;
}

/* ── Wordmark (FR-7.4) ───────────────────────────────────────────────────── */
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  color: var(--navy);
}
.wordmark .is { color: var(--logo-green); }
.wordmark.reverse { color: #fff; }
.wordmark .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  margin-left: 3px;
  align-self: center;
  animation: brandpulse 2.4s ease-in-out infinite;
}
@keyframes brandpulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* ── Buttons, matching the Uptime app ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: var(--font-body);
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(26, 43, 107, 0.55);
}
.btn-primary:hover:not(:disabled) { background: var(--navy-deep); transform: translateY(-1px); }

.btn-secondary,
/* .btn-ghost predates the move to Uptime's names; kept as an alias so every
   existing call site keeps working rather than being touched in one sweep. */
.btn-ghost {
  background: var(--card);
  color: var(--navy);
  border: 1px solid var(--rule);
}
.btn-secondary:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
  background: var(--surface);
  border-color: rgba(26, 43, 107, 0.22);
}
:root[data-theme='dark'] .btn-primary { background: var(--blue); color: #0f172a; }
:root[data-theme='dark'] .btn-primary:hover:not(:disabled) { background: #bfdbfe; }
:root[data-theme='dark'] .btn-secondary,
:root[data-theme='dark'] .btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--rule);
}
:root[data-theme='dark'] .btn-secondary:hover:not(:disabled),
:root[data-theme='dark'] .btn-ghost:hover:not(:disabled) { background: var(--rule); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Cards (FR-7.6): white, 1px --rule border, 16px radius ───────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
}

/* ── Mono status pills with an LED dot (FR-7.6) ──────────────────────────── */
.pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 10px 3px 8px;
  border: 1px solid var(--rule);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.pill .led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.pill-ok       { color: var(--green-hot); }
.pill-critical { color: var(--sev-critical); }
.pill-high     { color: var(--sev-high); }
.pill-medium   { color: var(--sev-medium); }
.pill-low      { color: var(--sev-low); }
.pill-muted    { color: var(--muted); }

.mono { font-family: var(--font-mono); }

label.field {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--text);
}
.input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 43, 107, 0.1);
}

/* ── App shell, matching the Uptime app ──────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  transition: width 0.15s ease;
}
:root[data-theme='dark'] .sidebar { background: #020617; }

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-logo .brand {
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
}
.sidebar-logo .brand .is { color: var(--green); }
.sidebar-logo .tagline {
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 5px;
}

.brand-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  margin-left: 3px;
  align-self: center;
  animation: brandpulse 2.4s ease-in-out infinite;
}
@keyframes brandpulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.7); }
}

.collapse-btn {
  display: flex;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: rgba(255, 255, 255, 0.5);
  align-items: center;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.collapse-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.collapse-btn svg { width: 18px; height: 18px; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-item.active {
  background: rgba(95, 211, 110, 0.12);
  color: var(--green);
  border-left-color: var(--green);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.sidebar-user {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-footer .btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  font-size: 12px;
  padding: 6px 14px;
}
.sidebar-footer .btn:hover { background: rgba(255, 255, 255, 0.16); }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.15s ease;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(16px, 3vw, 34px);
  background: var(--topbar);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

footer {
  padding: 18px clamp(16px, 3vw, 34px);
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
footer a { color: var(--muted); }
footer .wordmark { font-size: 13px; }

/* Collapsed: a 64px icon rail, the same as Uptime's. */
body.sidebar-collapsed .sidebar { width: 64px; overflow: hidden; }
body.sidebar-collapsed .sidebar-brand,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .sidebar-user { display: none !important; }
body.sidebar-collapsed .sidebar-logo { padding: 22px 0 18px; justify-content: center; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 12px; }
body.sidebar-collapsed .sidebar-footer { padding: 16px 8px; text-align: center; }
body.sidebar-collapsed .sidebar-footer .btn { padding: 6px 8px; font-size: 11px; }
body.sidebar-collapsed .main { margin-left: 64px; }

/* The hamburger is for phones only. */
.mob-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: var(--text);
  align-items: center;
  border-radius: 6px;
}
.mob-menu-btn:hover { background: var(--surface); }
.mob-menu-btn svg { width: 22px; height: 22px; }

.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(11, 22, 56, 0.4);
  z-index: 45;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0, 0, 0, 0.3); }
  .sidebar.open { transform: translateX(0); }
  .main,
  body.sidebar-collapsed .main { margin-left: 0; }
  .mob-menu-btn { display: inline-flex; }
  /* Collapsing is a desktop affordance; the drawer already handles a phone. */
  .collapse-btn { display: none; }
}

/* Wide tables and charts scroll inside their own container, never the page. */
.scroll-x { overflow-x: auto; max-width: 100%; }

/* The wordmark is navy on light grounds; on dark ones the navy half would sink
   into the background, so it takes the body text colour instead. */
:root[data-theme='dark'] .wordmark:not(.reverse) { color: var(--text); }


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

.data-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13px;
}

.data-table tbody tr:hover { background: var(--rule-soft); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Detail drawer ───────────────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 22, 56, 0.42);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}

.drawer {
  width: min(560px, 100%);
  height: 100%;
  overflow-y: auto;
  background: var(--surface-2);
  border-left: 1px solid var(--rule);
  padding: 22px clamp(16px, 3vw, 26px) 40px;
  animation: drawer-in 0.18s ease;
}

@keyframes drawer-in {
  from { transform: translateX(16px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.detail-list { margin: 0; }

.detail-row {
  display: flex;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.detail-row dt {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  width: 150px;
  flex-shrink: 0;
  padding-top: 2px;
}

.detail-row dd {
  margin: 0;
  font-size: 13px;
  word-break: break-word;
  flex: 1;
}

.raw-json {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 420px;
}

@media (max-width: 620px) {
  .detail-row { flex-direction: column; gap: 3px; }
  .detail-row dt { width: auto; }
}

/* Stat tiles link into the explorer, so they need to look pressable. */
.stat-tile { transition: border-color 0.16s, transform 0.16s, box-shadow 0.16s; }
.stat-tile:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -16px rgba(26, 43, 107, 0.5);
}
:root[data-theme='dark'] .stat-tile:hover {
  border-color: var(--map-point);
  box-shadow: 0 12px 24px -16px rgba(0, 0, 0, 0.6);
}



/* ── Theme toggle ────────────────────────────────────────────────────────── */
.theme-toggle {
  padding: 5px 9px;
  font-size: 15px;
  line-height: 1;
}

.alert-row { transition: border-color 0.16s; }
.alert-row:hover { border-color: var(--data-mark); }
textarea.input { resize: vertical; font-family: var(--font-body); }

/* ── Sortable table headings ─────────────────────────────────────────────── */
.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.th-sort:hover { color: var(--data-mark); }
.th-sort.active { color: var(--data-mark); }

/* The idle arrow stays faint so the sorted column is obvious at a glance. */
.th-arrow { opacity: 0.35; font-size: var(--micro); }
.th-sort.active .th-arrow { opacity: 1; }

/* ═══ Phones ═════════════════════════════════════════════════════════════════
   The tables are the reason the app read badly on a phone: seven columns in a
   390px viewport meant scrolling sideways by half a screen to finish one row.
   Below this width each row becomes its own small card, labelled, read top to
   bottom — the same information without the sideways journey.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  /* The headings move onto each cell, so the header row has nothing left to do. */
  .data-table thead { display: none; }

  .data-table tr {
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--surface-2);
  }
  .data-table tbody tr:hover { background: var(--surface-2); }

  .data-table td {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 5px 0;
    border: none;
    white-space: normal;
  }

  .data-table td::before {
    content: attr(data-label);
    flex: 0 0 84px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }

  /* Cells sized for a wide table would otherwise clip inside a narrow card. */
  .cell-when, .cell-user, .cell-app {
    max-width: none !important;
    white-space: normal !important;
    overflow: visible !important;
    word-break: break-word;
  }

  /* The table wrapper has nothing left to scroll once rows are cards, but the
     override must not reach the chart, which still needs its scroller — and
     lost it here, so the chart's minimum width pushed the page sideways. */
  .scroll-x:has(.data-table) { overflow-x: visible; }
}

/* Touch input needs a target it can actually hit. Apple's guidance is 44px;
   the buttons here were 31. Keyed off the pointer rather than the width, so a
   narrow desktop window keeps its compact controls. */
@media (pointer: coarse) {
  .btn {
    min-height: 44px;
    padding: 11px 18px;
  }
  .input,
  select.input,
  textarea.input {
    min-height: 44px;
    font-size: 16px;   /* below 16px, iOS zooms the page on focus */
  }
  input[type='checkbox'] {
    width: 22px;
    height: 22px;
  }
  .th-sort { min-height: 44px; }
  /* The hamburger is not a .btn, so it missed the sizing above. */
  .mob-menu-btn { min-height: 44px; min-width: 44px; justify-content: center; }
  .collapse-btn { min-height: 44px; min-width: 44px; justify-content: center; }
  .worldmap-controls .btn {
    min-height: 40px;
    padding: 8px 14px;
  }
  .nav-item { padding: 14px 20px; }
  /* Footer links sat at 20px tall, which is a miss more often than a hit. */
  footer a { display: inline-block; padding: 8px 0; }
}

/* Ten-pixel labels are legible on a desktop at arm's length and not on a phone. */
@media (max-width: 700px) {
  :root {
    --micro: 12px;
    --small: 13px;
  }
  .eyebrow { font-size: 12px; }
  .pill { font-size: 12px; }
  label.field { font-size: 12px; }
  .detail-row dt { font-size: 12px; }
  .data-table th { font-size: 12px; }
  .mono { font-size: inherit; }
  /* Uptime sets this at 9px. That reads at arm's length on a desktop and not
     in a hand, so the phone gets a larger one; the desktop stays identical. */
  .sidebar-logo .tagline { font-size: 11px; }

  /* A pill that cannot wrap cannot shrink, and one long enough — a full
     timestamp, say — widens the whole page rather than itself. */
  .pill {
    white-space: normal;
    text-align: left;
  }

  /* Long values with no spaces (addresses, identifiers) otherwise do the same. */
  body { overflow-wrap: break-word; }
}

/* A footer link at twenty pixels tall is a miss more often than a hit. */
@media (pointer: coarse) {
  footer a {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    padding: 0;
  }
  input[type='checkbox'] { width: 26px; height: 26px; }

  /* The box is tapped through its label, so the label is the target that has
     to be big enough — it was collapsing to the height of the box itself. */
  label:has(> input[type='checkbox']) {
    min-height: 44px;
    align-items: center;
  }
}


/* The login card keeps itself light in dark mode — see `.login-card` below,
   which sets its own white background and navy text rather than inheriting the
   theme. The rule that used to live here targeted `.login-hero .card`, and the
   login screen no longer has a `.card` on it. */

/* ── Customer switcher (top bar) ───────────────────────────────────────────
   Uptime puts the same control in the same corner. The badge only appears
   while one customer is selected, so "all customers" is the quiet state and
   looking at somebody's data is the one that announces itself. */
.org-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.org-switcher select {
  font-family: var(--font-body);
  font-size: 12px;
  padding: 6px 9px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--card);
  color: var(--text);
  max-width: 180px;
  cursor: pointer;
}
.org-switcher select:disabled { opacity: 0.6; cursor: progress; }

.org-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--rule-soft);
  color: var(--green-hot);
  border: 1px solid var(--rule);
  white-space: nowrap;
}

/* On a phone the top bar holds the menu button, the switcher and the theme
   toggle; the customer name is what gives way, not the controls. */
@media (max-width: 560px) {
  .org-switcher select { max-width: 120px; }
  .org-badge { display: none; }
}
@media (max-width: 380px) {
  .org-switcher select { max-width: 92px; }
}

/* ── Version badge (sidebar) ───────────────────────────────────────────────
   Uptime shows its version in the same place. Quiet until asked: the number
   is small, and the build stamp that actually settles "did the upgrade take?"
   opens on click. */
.version-badge { margin-top: 8px; }

.version-badge > button {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  background: none;
  border: 0;
  padding: 2px 0;
  cursor: pointer;
}
.version-badge > button:hover { color: rgba(255, 255, 255, 0.8); }

/* A dot beside the number after an upgrade, so a changed version announces
   itself without needing to be remembered. */
.version-new {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: middle;
}

.version-detail {
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.45);
}
.version-detail .mono { font-size: 10px; }
.version-upgraded { color: var(--green); }

body.sidebar-collapsed .version-badge { display: none; }

/* ── Directory provider choice ─────────────────────────────────────────────
   Two cards rather than a dropdown: which vendor runs the directory changes
   every field below it, so it deserves to be visibly a fork in the form and
   not a line of small print. */
.provider-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.provider-option {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.provider-option:hover { border-color: var(--muted); }
.provider-option.selected {
  border-color: var(--green-hot);
  box-shadow: inset 0 0 0 1px var(--green-hot);
}

.provider-title { font-weight: 600; font-size: 14px; }
.provider-hint { font-size: 11px; color: var(--muted); }

/* A short explanation under a field, where the label alone would not do. */
.field-note {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

textarea.input { resize: vertical; min-height: 96px; line-height: 1.5; }

@media (pointer: coarse) {
  .provider-option { padding: 14px; min-height: 44px; }
}

/* ── Printing a report ─────────────────────────────────────────────────────
   A posture report gets taken into a meeting, so Print has to produce
   something worth handing over: no sidebar, no top bar, no buttons, and every
   customer's detail open rather than collapsed behind a control nobody can
   click on paper. */
@media print {
  .sidebar,
  .topbar,
  footer,
  .sidebar-scrim,
  .btn,
  .org-switcher { display: none !important; }

  .shell { display: block; }
  .main { margin: 0 !important; }
  main { padding: 0 !important; }

  body { background: #fff; }
  .card {
    background: #fff;
    border: 1px solid #ccd;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Keep a customer and its findings on one page where they fit. */
  .card { margin-bottom: 10px; }

  a[href]::after { content: ''; }
}

/* ── Login, copied from the Uptime app ─────────────────────────────────────
   Ported rule for rule from Monitor_App's #login-screen, so the two front
   doors are the same screen with a different product name on the eyebrow.
   Values are Uptime's, not approximations of them. */
.login-hero {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--navy-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

/* The faint grid, faded out towards the edges by a radial mask. */
.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask: radial-gradient(ellipse 70% 70% at 50% 38%, #000, transparent 78%);
  mask: radial-gradient(ellipse 70% 70% at 50% 38%, #000, transparent 78%);
}

/* Off since the October 2026 brand refresh: no gradients; depth comes from flat colour and hairlines. */
.login-glow {
  display: none;
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(95, 211, 110, 0.2), transparent 65%);
  top: -120px;
  right: -60px;
  pointer-events: none;
  filter: blur(10px);
}
.login-glow.g2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(59, 158, 232, 0.16), transparent 65%);
  bottom: -80px;
  left: -40px;
  top: auto;
  right: auto;
}

.login-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border: 1px solid rgba(26, 43, 107, 0.12);
  border-radius: 18px;
  padding: 40px 36px;
  width: 100%;
  max-width: 412px;
  box-shadow: 0 24px 60px -20px rgba(11, 22, 56, 0.45);
}

.login-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 16px;
}
.login-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--green);
}

.login-logo {
  display: flex;
  align-items: baseline;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 27px;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin-bottom: 16px;
}
.login-logo .is { color: var(--logo-green); }
.login-logo .brand-dot { align-self: center; }

.login-title {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-bottom: 26px;
}
.login-title .italic {
  font-style: italic;
  font-weight: 500;
  color: rgba(26, 43, 107, 0.7);
}

.login-error {
  background: #fee2e2;
  color: #991b1b;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* The front door stays light and on-brand even when the app is in dark mode:
   a slate card on the navy hero sits at 1.12:1, which is no edge at all. */
.login-card .field {
  text-align: center;
  color: var(--navy);
}
.login-card .input {
  background: #fff;
  color: var(--navy);
  border-color: rgba(26, 43, 107, 0.16);
}
.login-card .input::placeholder { color: rgba(26, 43, 107, 0.38); }

/* The sign-in CTA: solid signal-green pill with deep-ink text (never white on green, no gradient). */
.login-card .btn-primary {
  width: 100%;
  background: var(--green);
  border-color: transparent;
  color: var(--navy-ink);
  box-shadow: 0 10px 24px -12px rgba(11, 22, 56, 0.35);
}
.login-card .btn-primary:hover:not(:disabled) {
  background: var(--green-hot);
  transform: translateY(-1px);
}
.login-card .btn-secondary {
  width: 100%;
  background: #fff;
  color: var(--navy);
  border-color: rgba(26, 43, 107, 0.16);
}

@media (max-width: 420px) {
  .login-card { padding: 30px 22px; }
  .login-logo { font-size: 24px; }
  .login-title { font-size: 22px; }
}

/* ── Logo (fiber-cable lockup, never retyped) ───────────────────────────────
   Primary on light grounds, reverse on dark ones and in dark mode. */
.logo { display: inline-flex; line-height: 0; }
.logo img { height: 100%; width: auto; display: block; }
.logo .logo-reverse { display: none; }
.logo.on-dark .logo-primary,
:root[data-theme='dark'] .logo:not(.on-light) .logo-primary { display: none; }
.logo.on-dark .logo-reverse,
:root[data-theme='dark'] .logo:not(.on-light) .logo-reverse { display: block; }
.sidebar-logo .logo { height: 30px; }
.login-logo .logo { height: 40px; }
footer .logo { height: 18px; }
