/* SORS Control Center — redesigned 2026-06-17.
 * Unified design language with employee-ui. Class/id names are UNCHANGED from the
 * previous stylesheet (app-clean.js depends on them); only the visual design was
 * reworked. Safe to revert via the .bak on the VPS. */

:root {
  color-scheme: dark;
  /* surfaces */
  --bg: #060c0f;
  --bg-2: #08151a;
  --panel: #0c181d;
  --panel2: #0f1f25;
  --panel3: #14272d;
  --line: #21383f;
  --line-soft: #182c32;
  /* text */
  --text: #eef7fa;
  --muted: #93abb2;
  --faint: #6f878e;
  /* brand / semantic */
  --green: #4fe0a0;
  --green-deep: #16855f;
  --green-edge: #2fbd86;
  --cyan: #5fd6ef;
  --amber: #f5bc62;
  --red: #ff7e7e;
  /* effects */
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow: 0 24px 70px -28px #000c;
  --shadow-soft: 0 12px 30px -18px #000a;
  --ring: 0 0 0 3px #4fe0a055;
  --ease: 180ms cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }
::selection { background: #2fbd8655; }

html { scrollbar-color: #2a444c transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: #24414a; border: 3px solid transparent; background-clip: padding-box; border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: #315760; background-clip: padding-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1100px 520px at 12% -8%, #123a43 0, transparent 60%),
    radial-gradient(900px 480px at 92% -2%, #0f3a2a 0, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- typography ---- */
h1, h2, h3 { letter-spacing: -.01em; }
.muted, small { color: var(--muted); }
small { display: block; }
a { color: var(--cyan); }
code, pre {
  color: #b7f2ec;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  word-break: break-word;
}

/* ---- focus (a11y) ---- */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--green-deep); color: #fff; padding: 10px 14px; border-radius: 10px;
  transition: top var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---- controls ---- */
button, input, select { font: inherit; }
button, .button-link {
  appearance: none;
  border: 1px solid #2e4e58;
  border-radius: 11px;
  background: linear-gradient(180deg, #16282e, #122127);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  max-width: 100%;
  padding: 8px 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: border-color var(--ease), background var(--ease), transform var(--ease), box-shadow var(--ease);
}
button:hover:not(:disabled), .button-link:hover { border-color: var(--green-edge); background: linear-gradient(180deg, #1b333a, #15282f); }
button:active:not(:disabled), .button-link:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .45; }
button.primary, .button-link.primary {
  background: linear-gradient(180deg, #1ea177, var(--green-deep));
  border-color: var(--green-edge);
  color: #f2fffb;
  box-shadow: 0 10px 24px -14px #16855fcc;
}
button.primary:hover:not(:disabled), .button-link.primary:hover { background: linear-gradient(180deg, #25b487, #1a946c); border-color: var(--green); }
button.danger { background: linear-gradient(180deg, #3a1f24, #2b181c); border-color: #7d4248; color: #ffc5c5; }
button.danger:hover:not(:disabled) { border-color: var(--red); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover:not(:disabled) { background: #14272d; border-color: var(--line); }
.full { width: 100%; }
.hidden, .view { display: none !important; }
.view.active { display: block !important; animation: viewIn var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.spacer { flex: 1; }

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #071115;
  color: var(--text);
  padding: 10px 12px;
  transition: border-color var(--ease), box-shadow var(--ease);
}
input:hover, select:hover { border-color: #2c4a52; }
input:focus, select:focus { outline: none; border-color: var(--green-edge); box-shadow: var(--ring); }
input::placeholder { color: var(--faint); }

/* ---- brand ---- */
.brand { font-weight: 900; letter-spacing: .16em; font-size: 18px; }
.brand span { color: var(--green); margin-left: 4px; }
.brand.compact { font-size: 15px; }

/* ---- login ---- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(430px, 94vw);
  background: linear-gradient(160deg, #102229, #070f12 78%);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--green), var(--cyan), transparent);
  opacity: .8;
}
.login-card h1 { margin: 12px 0 4px; font-size: 33px; }
.login-card p { color: var(--muted); margin: 0 0 18px; }
label { color: var(--muted); display: block; margin: 13px 0 6px; font-size: 13px; }

/* ---- shell / topbar ---- */
.shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 70px;
  padding: 11px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #08131799, #07101399);
  backdrop-filter: blur(18px) saturate(1.2);
}
.topbar-brand { display: grid; gap: 2px; }
.topbar-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
#mainNav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  background: #07121699;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  min-width: 0;
  padding: 4px;
}
.nav {
  min-height: 34px;
  border-radius: 999px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 14px;
}
.nav:hover:not(:disabled) { background: #122830; border-color: transparent; color: var(--text); }
.nav.active { background: linear-gradient(180deg, #1a3b43, #163138); border-color: #2f6471; color: #e6fdff; box-shadow: inset 0 0 0 1px #2f647155; }
.live { color: var(--green); white-space: nowrap; font-weight: 600; font-size: 13px; }
.live.warn { color: var(--amber); }
.live i { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: currentColor; margin-right: 7px; box-shadow: 0 0 0 0 currentColor; animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 #4fe0a066; } 70% { box-shadow: 0 0 0 6px #4fe0a000; } 100% { box-shadow: 0 0 0 0 #4fe0a000; } }
.user { color: #bff3e6; font-weight: 600; }

main {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 64px;
}

/* ---- notices ---- */
.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 14px;
  background: #0a161a;
  color: #dbe9ed;
  margin: 0 0 16px;
  padding: 13px 16px;
}
.notice.good { border-color: #2f7659; border-left-color: var(--green); background: linear-gradient(180deg, #0d251d, #0a161a); }
.notice.warn { border-color: #80612d; border-left-color: var(--amber); background: linear-gradient(180deg, #2a2111, #0a161a); }
.notice.danger { border-color: #854348; border-left-color: var(--red); background: linear-gradient(180deg, #30191d, #0a161a); }
.notice.info { border-color: #2b6770; border-left-color: var(--cyan); background: linear-gradient(180deg, #0c242a, #0a161a); }
.notice.neutral { border-color: #263b42; border-left-color: #3a565d; background: #0b171b; }
.notice.muted { border-color: #1c2c31; border-left-color: #2a3f45; background: #0a1418; color: var(--muted); }
.notice.muted strong { color: var(--muted); font-weight: 600; }

/* ---- page head ---- */
.page-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 20px; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.page-head h1, .hero h1 { font-size: clamp(27px, 3vw, 42px); line-height: 1.05; margin: 7px 0 8px; }
.page-head p, .hero p { color: #c7d9de; font-size: 16px; margin: 0; max-width: 960px; }
.page-actions, .actions, .card-actions, .mini-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.page-actions > *, .actions > *, .card-actions > *, .mini-actions > * { min-width: 0; }

/* ---- hero ---- */
.hero {
  border: 1px solid #2c7b67;
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, #103931 0, #0a181c 62%);
  box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; background: radial-gradient(circle, #2fbd8633, transparent 70%); pointer-events: none; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; }

/* ---- metrics ---- */
.metric-strip, .summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 11px; margin-top: 18px; }
.metric, .summary-box {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0a151a, #071013);
  padding: 13px 14px;
  transition: border-color var(--ease), transform var(--ease);
}
.metric:hover, .summary-box:hover { border-color: #2c4a52; transform: translateY(-2px); }
.metric small, .summary-box small { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.metric strong, .summary-box strong { display: block; color: #eafdff; font-size: 26px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }

/* ---- layout grids ---- */
.grid { display: grid; gap: 14px; min-width: 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.split { grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); }

/* ---- panels / cards ---- */
.panel, .card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--panel2), #071013);
  min-width: 0;
  padding: 18px;
  box-shadow: var(--shadow-soft);
  transition: border-color var(--ease);
}
.panel:hover, .card:hover { border-color: #2a454d; }
.card.good, .panel.good { border-color: #2f7659; background: linear-gradient(160deg, #102f25, #071013); }
.card.warn, .panel.warn { border-color: #80612d; background: linear-gradient(160deg, #2a2111, #071013); }
.card.danger, .panel.danger { border-color: #854348; background: linear-gradient(160deg, #30191d, #071013); }
.card.neutral, .panel.neutral { border-color: #263b42; background: linear-gradient(160deg, #0b171b, #071013); }
.card h2, .card h3, .panel h2, .panel h3 { margin: 4px 0 8px; }
.card p, .panel p { color: #c7d9de; margin: 0 0 12px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.panel-head .actions { margin-left: auto; }
.card-actions { margin-top: 14px; }

/* ---- badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #14252a;
  color: #dcecef;
  font-size: 11px; font-weight: 600;
  min-height: 24px;
  padding: 3px 10px;
  white-space: nowrap;
}
.badge.good, .badge.online { color: #9bf7c2; border-color: #2f7659; background: #0e2d21; }
.badge.warn, .badge.pending { color: #ffd99a; border-color: #80612d; background: #2a2111; }
.badge.danger, .badge.offline, .badge.failed { color: #ffb8b8; border-color: #854348; background: #30191d; }
.badge.neutral { color: var(--muted); }
/* SORS Doctor health badge: same palette as status badges, with a help cursor
   to hint that hovering reveals the issue list in its title tooltip. */
.badge.health-badge { cursor: help; }

/* ---- field grids ---- */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 12px 0; }
.fields > div { border: 1px solid var(--line-soft); border-radius: 12px; background: #071013; min-width: 0; padding: 10px; }
.fields small { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.fields strong, .fields code { display: block; margin-top: 4px; }
.fields code.secret { user-select: all; }

/* ---- job monitor ---- */
.job-monitor { border: 1px solid #2b6770; border-radius: var(--radius-lg); background: linear-gradient(160deg, #0d2930, #071013); margin-bottom: 18px; padding: 16px; }
.job-monitor-head { display: flex; align-items: start; gap: 12px; }
.job-monitor-head h2 { margin: 2px 0 3px; }
.job-list { display: grid; gap: 10px; margin-top: 12px; }
.job { border: 1px solid var(--line-soft); border-radius: var(--radius); background: #071013; padding: 13px; }
.job.good { border-color: #2f7659; }
.job.warn { border-color: #80612d; }
.job.danger { border-color: #854348; }
.job.neutral { opacity: .78; border-color: #263b42; }
.job .top { display: flex; align-items: start; gap: 10px; }
.job .top strong { display: block; }
.progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 11px 0 5px; }
.progress span { height: 6px; border-radius: 999px; background: #22343a; }
.progress.stage-1 span:nth-child(1),
.progress.stage-2 span:nth-child(-n+2),
.progress.stage-3 span:nth-child(-n+3),
.progress.stage-4 span:nth-child(-n+4),
.progress.stage-5 span { background: linear-gradient(90deg, var(--green-deep), var(--green)); }
.progress.failure.stage-5 span:last-child { background: #ef6a70; }
.operation-stage-labels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; color: var(--muted); font-size: 9px; letter-spacing: .05em; text-transform: uppercase; }
.operation-stage-labels span:last-child { text-align: right; }
.operation-events { border-left: 1px solid #294048; display: grid; gap: 8px; list-style: none; margin: 12px 0; padding-left: 14px; }
.operation-events li { display: grid; gap: 2px; position: relative; }
.operation-events li::before { background: var(--green); border-radius: 50%; content: ""; height: 7px; left: -18px; position: absolute; top: 5px; width: 7px; }
.operation-events strong { color: #d8f5ef; font-size: 12px; }
.operation-events span { color: var(--muted); font-size: 11px; }
.job pre, .copy-pre {
  border: 1px solid var(--line-soft); border-radius: 12px;
  background: #050b0d; color: #d9fff8;
  margin: 11px 0 0; max-height: 340px; overflow: auto; padding: 11px;
  white-space: pre-wrap; font-size: 12.5px; line-height: 1.5;
}

/* ---- access tabs ---- */
.access-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.access-tab.active { background: linear-gradient(180deg, #1a3b43, #163138); border-color: #2f6471; color: #e6fdff; }
.proxy-card .big-endpoint { border: 1px dashed #355760; border-radius: var(--radius); background: #07131655; margin: 12px 0; padding: 13px; }
.big-endpoint strong { display: block; font-size: 22px; margin-top: 3px; word-break: break-all; color: #eafdff; }
.proxy-card, .proxy-card > *, .proxy-card .fields, .proxy-card .fields > div { min-width: 0; max-width: 100%; }
.proxy-card code, .proxy-card strong, .proxy-card p { overflow-wrap: anywhere; }

/* ---- steps ---- */
.use-steps { display: grid; gap: 8px; margin: 10px 0 12px; }
.use-steps > div { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; border: 1px solid var(--line-soft); border-radius: 12px; background: #071013; padding: 10px; }
.use-steps b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: linear-gradient(180deg, #1ea177, var(--green-deep)); color: #fff; }
.use-steps span { color: #d6e7eb; }
.steps { counter-reset: step; display: grid; gap: 9px; margin-top: 12px; }
.step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 11px; align-items: start; }
.step b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: linear-gradient(180deg, #1ea177, var(--green-deep)); color: #fff; }
.step span { color: #c7d9de; }

/* ---- devices ---- */
.device-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.device-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.device-title h3 { margin: 0; }
.path-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.path-pill { border: 1px solid #2b4148; border-radius: 999px; background: #071013; color: var(--muted); padding: 4px 10px; font-size: 12px; }
.path-pill.ready { color: #9bf7c2; border-color: #2f7659; background: #0e2d21; }
.path-pill.muted { color: var(--muted); border-color: #1c2c31; border-style: dashed; background: #0a1418; opacity: 0.85; }
.device-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .75fr); gap: 14px; }

/* ---- tables ---- */
.table-wrap { overflow: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line-soft); padding: 11px 12px; text-align: left; vertical-align: top; }
thead th { position: sticky; top: 0; background: #0c1a1f; z-index: 1; }
th { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
tbody tr { transition: background var(--ease); }
tbody tr:hover { background: #0c1a1f; }
tbody tr:last-child td { border-bottom: 0; }

/* ---- install / onboard ---- */
.install-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.install-output { border: 1px solid var(--line-soft); border-radius: var(--radius); background: #071013; margin-top: 14px; padding: 14px; }
.copybox { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; border: 1px solid var(--line-soft); border-radius: 12px; background: #050b0d; margin: 8px 0 12px; padding: 11px; }
.copybox code { user-select: all; }
.install-events { display: grid; gap: 8px; min-width: 0; }
.install-event {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-left: 4px solid #2b6770;
  border-radius: 12px;
  background: #071013;
  padding: 11px;
  overflow-wrap: anywhere;
}
.install-event.warn { border-left-color: var(--amber); }
.install-event.danger { border-left-color: var(--red); }
.install-event-hint { margin: 9px 0 0; }
.install-event-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.install-event-waiting { color: var(--muted); font-size: 11px; font-weight: 600; }

/* ---- readiness matrix ---- */
.readiness-matrix { border: 1px solid #27454d; border-radius: var(--radius-lg); background: linear-gradient(160deg, #0c2026, #071013); margin-top: 14px; padding: 17px; }
.ready-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 11px; }
.ready-cell { border: 1px solid var(--line-soft); border-radius: var(--radius); background: #071013; display: flex; min-height: 210px; flex-direction: column; padding: 14px; transition: transform var(--ease), border-color var(--ease); }
.ready-cell:hover { transform: translateY(-2px); }
.ready-cell.good { border-color: #2f7659; background: linear-gradient(160deg, #0e2b22, #071013); }
.ready-cell.warn { border-color: #80612d; background: linear-gradient(160deg, #2a2111, #071013); }
.ready-cell.danger { border-color: #854348; background: linear-gradient(160deg, #30191d, #071013); }
.ready-cell.neutral { opacity: .84; }
.ready-cell h3 { margin: 5px 0 8px; }
.ready-cell p { color: #c7d9de; margin: 0 0 12px; }
.ready-cell .actions { margin-top: auto; }

/* ---- operator launcher ---- */
.operator-launcher { border: 1px solid #27454d; border-radius: var(--radius-lg); background: linear-gradient(160deg, #0b1a1f, #071013); margin: 14px 0; padding: 17px; }
.operator-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 11px; }
.operator-card { border: 1px solid var(--line-soft); border-radius: var(--radius); background: #071013; display: flex; flex-direction: column; min-height: 180px; padding: 14px; transition: transform var(--ease), border-color var(--ease); }
.operator-card:hover { transform: translateY(-2px); border-color: #2c4a52; }
.operator-card.good { border-color: #2f7659; background: linear-gradient(160deg, #0e2b22, #071013); }
.operator-card.warn { border-color: #80612d; background: linear-gradient(160deg, #2a2111, #071013); }
.operator-card.danger { border-color: #854348; background: linear-gradient(160deg, #30191d, #071013); }
.operator-card.neutral { border-color: #263b42; }
.operator-card h3 { margin: 0 0 8px; }
.operator-card p { color: #c7d9de; margin: 0 0 12px; }
.operator-card .actions { margin-top: auto; }

/* ---- modal ---- */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: #000d; backdrop-filter: blur(4px); padding: 18px; animation: fade var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card { width: min(820px, 96vw); max-height: 92vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(160deg, #0d1a1f, #081216); box-shadow: var(--shadow); padding: 20px; animation: popIn var(--ease); }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-card.wide { width: min(1180px, 97vw); }
.modal-card.terminal-card { width: min(1180px, 98vw); }
.modal-card h2 { margin: 0 0 12px; }
.terminal-box { height: min(64vh, 620px); border: 1px solid var(--line-soft); border-radius: var(--radius); background: #020506; overflow: hidden; padding: 8px; }
.terminal-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

/* ---- toasts ---- */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: grid; gap: 8px; }
.toast { border: 1px solid #2e4e58; border-radius: 12px; background: linear-gradient(180deg, #15282e, #112127); color: var(--text); box-shadow: 0 14px 34px -18px #000c; padding: 12px 15px; animation: toastIn var(--ease); }
.toast.danger { background: linear-gradient(180deg, #30191d, #210f12); border-color: #854348; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---- responsive ---- */
@media (max-width: 1180px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  #mainNav { grid-column: 1 / -1; width: 100%; overflow: visible; justify-content: flex-start; }
  .split, .device-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  main { width: calc(100vw - 20px); padding-top: 14px; }
  .topbar { grid-template-columns: 1fr; padding: 10px; }
  #mainNav { grid-column: auto; }
  .nav { width: 100%; justify-content: flex-start; }
  .page-head, .hero-top, .copybox, .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .metric-strip, .summary-grid, .fields, .install-form, .ready-grid, .operator-grid { grid-template-columns: 1fr; }
  .terminal-box { height: 58vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Exits view (per-device / per-uplink exit catalog) — additive, 2026-06-18 */
.card.stat { display: grid; gap: 4px; align-content: start; }
.card.stat strong { font-size: 1.5rem; line-height: 1.1; }
.card.stat small { color: var(--ink-soft, #8aa); text-transform: uppercase; letter-spacing: .04em; font-size: .7rem; }
.exit-tiles { margin: 4px 0 18px; }
.exit-card .exit-uplink { border: 1px solid var(--line-soft); border-radius: 12px; background: #071013; padding: 11px; margin-top: 10px; }
.exit-card .exit-uplink:first-of-type { margin-top: 12px; }
.exit-uplink-name { display: inline-flex; align-items: center; gap: 7px; font-size: .95rem; }
.exit-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.exit-dot.online { background: #2ec27e; box-shadow: 0 0 0 3px rgba(46,194,126,.18); }
.exit-dot.offline { background: #6b7785; }
.exit-tag{font-size:.72rem;color:var(--muted,#9aa);border:1px solid var(--line-soft,#234);border-radius:999px;padding:1px 7px;margin-left:6px;}

/* 2026-07-16 task-first information architecture */
:root {
  --bg: #090e0d;
  --bg-2: #0d1412;
  --panel: #111917;
  --panel2: #131d1a;
  --panel3: #18231f;
  --line: #293630;
  --line-soft: #202b27;
  --text: #f1f6f3;
  --muted: #9aa9a2;
  --faint: #718079;
  --green: #65d39b;
  --green-deep: #267c59;
  --green-edge: #4cab7d;
  --cyan: #8bbcb0;
  --amber: #d9aa61;
  --red: #df7777;
  --radius: 10px;
  --radius-lg: 15px;
  --shadow: 0 28px 70px -38px #000;
  --shadow-soft: 0 15px 34px -28px #000;
}

body {
  background:
    radial-gradient(60rem 32rem at 14% -12%, rgba(48, 112, 84, .14), transparent 70%),
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 100% 32px, auto;
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
button, .button-link { border-radius: 8px; min-height: 36px; padding: 7px 12px; white-space: nowrap; }
button, .button-link, input, select { transition: border-color var(--ease), background-color var(--ease), color var(--ease), transform var(--ease); }
button, .button-link { background: #17211e; border-color: #33423c; }
button:hover:not(:disabled), .button-link:hover { background: #1c2925; border-color: #557067; }
button.primary, .button-link.primary { background: #2e8963; border-color: #55b484; box-shadow: none; }
button.primary:hover:not(:disabled), .button-link.primary:hover { background: #369b70; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  padding: 10px clamp(14px, 2vw, 28px);
  background: rgba(9, 14, 13, .94);
  border-bottom-color: #26332e;
  box-shadow: 0 14px 30px -28px #000;
}
.topbar-primary { display: flex; align-items: center; min-width: 0; gap: 24px; }
.topbar-brand { min-width: 142px; }
.topbar-brand small { font-size: 11px; white-space: nowrap; }
#mainNav { flex-wrap: nowrap; background: transparent; border: 0; border-radius: 0; padding: 0; gap: 2px; }
.nav { border-radius: 7px; min-height: 34px; padding: 6px 12px; }
.nav.active { background: #1b2d27; border-color: #36594a; color: #f3fff9; box-shadow: inset 0 -2px #5bc18e; }
.topbar-tools { flex-wrap: nowrap; }
.topbar-tools .top-action { display: inline-flex; }
.nav-toggle { display: none; }
.brand { letter-spacing: .12em; }

main { width: min(1500px, calc(100vw - 40px)); padding-top: 30px; }
.page-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(30px, 3.5vw, 48px); letter-spacing: -.035em; max-width: 19ch; }
.page-head p { max-width: 70ch; color: #b7c4be; }
.overview-head h1 { max-width: 22ch; }
.eyebrow, .section-kicker, .platform-label { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.panel, .card { background: var(--panel); border-color: var(--line); border-radius: var(--radius-lg); box-shadow: none; }
.panel:hover, .card:hover { border-color: #34443d; }
.panel-head h2 { font-size: 20px; letter-spacing: -.02em; }
.panel-head small { margin-top: 3px; }
.notice { background: #101816; border-radius: 9px; }
.notice.good { background: #102019; }
.notice.warn { background: #221c12; }
.notice.danger { background: #251516; }
.notice.info { background: #111d1b; }
.badge { border-radius: 5px; min-height: 22px; padding: 2px 7px; font-weight: 700; }

.overview-stats, .service-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #0e1513;
  margin-bottom: 16px;
  overflow: hidden;
}
.overview-stats > button, .service-summary > div {
  display: grid;
  justify-content: start;
  align-content: center;
  min-height: 92px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  padding: 15px 18px;
  text-align: left;
}
.overview-stats > button:last-child, .service-summary > div:last-child { border-right: 0; }
.overview-stats > button:hover { background: #14201c; }
.overview-stats small, .service-summary small { color: var(--muted); font-size: 11px; font-weight: 600; }
.overview-stats strong, .service-summary strong { color: var(--text); font-size: 29px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.overview-stats strong span { color: var(--faint); font-size: 16px; }
.service-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.service-summary > div { min-height: 82px; }

.overview-layout { display: grid; grid-template-columns: minmax(360px, .82fr) minmax(520px, 1.35fr); gap: 16px; align-items: start; }
.attention-list, .ready-service-list, .service-list, .platform-status-list { display: grid; gap: 0; }
.attention-row, .ready-service, .platform-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  padding: 14px 0;
}
.attention-row:first-child, .ready-service:first-child, .platform-status:first-child { border-top: 0; }
.attention-row h3, .ready-service h3, .platform-status h3, .attention-row p, .ready-service p, .platform-status p { margin: 0; }
.attention-row p, .ready-service p, .platform-status p { color: var(--muted); font-size: 13px; }
.attention-row .row-actions, .ready-service > button { align-self: center; }
.status-dot { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(101, 211, 155, .1); flex: none; }
.warn > .status-dot, .warn .status-dot, tr.warn .status-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(217, 170, 97, .1); }
.danger > .status-dot, .danger .status-dot, tr.danger .status-dot, .status-dot.offline { background: var(--red); box-shadow: 0 0 0 4px rgba(223, 119, 119, .1); }
.service-mark { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid #40544b; border-radius: 9px; background: #17231f; color: #cce8da; font: 800 11px/1 ui-monospace, monospace; letter-spacing: .06em; }
.service-mark.vpn { border-color: #49715e; background: #172a22; }
.service-mark.proxy { border-color: #746240; background: #282216; color: #eed7a7; }
.service-mark.terminal { border-color: #53645e; background: #1b2421; }
.ready-service.unavailable { opacity: .72; }
.overview-jobs { margin-top: 16px; }
.overview-jobs,
.overview-jobs > *,
.operations-layout,
.operations-layout > *,
.operations-layout .panel,
.job-list,
.job,
.job .top,
.job .top > div {
  max-width: 100%;
  min-width: 0;
}
.job .top {
  flex-wrap: wrap;
}
.job .top > div {
  flex: 1 1 260px;
}
.job .top > .spacer {
  display: none;
}
.job .top > button {
  flex: 0 1 auto;
  min-width: 0;
  white-space: normal;
}
.job p,
.job small,
.job strong {
  overflow-wrap: anywhere;
}
.empty-state { display: grid; justify-items: start; gap: 5px; min-height: 150px; align-content: center; padding: 22px; border: 1px dashed #33423c; border-radius: 10px; color: var(--muted); }
.empty-state strong { color: var(--text); font-size: 17px; }
.empty-state p { margin: 0 0 8px; }

.segmented { display: flex; gap: 5px; width: fit-content; max-width: 100%; padding: 4px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 11px; background: #0d1512; overflow: auto; }
.segmented > button { display: grid; justify-items: start; min-width: 180px; border: 0; background: transparent; color: var(--muted); }
.segmented > button small { font-size: 10px; }
.segmented > button.active { background: #1b2b25; color: var(--text); box-shadow: inset 0 0 0 1px #365546; }
.service-panel { padding: 0; overflow: hidden; }
.service-panel > .panel-head { padding: 18px 20px 14px; margin: 0; border-bottom: 1px solid var(--line-soft); }
.service-list { padding: 0 20px; }
.service-row { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(480px, 1.6fr); gap: 10px 24px; border-top: 1px solid var(--line-soft); padding: 20px 0; }
.service-row:first-child { border-top: 0; }
.service-identity { display: flex; gap: 12px; align-items: flex-start; }
.service-identity h3, .service-identity p { margin: 0; }
.service-identity h3 { font-size: 17px; }
.service-identity p { color: var(--muted); font-size: 12px; }
.service-facts { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)); gap: 9px; }
.service-facts > div, .evidence-grid > div { min-width: 0; }
.service-facts small, .evidence-grid small { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.service-facts strong, .service-facts code, .evidence-grid strong, .evidence-grid code { display: block; margin-top: 3px; font-size: 12px; }
.service-reason { grid-column: 1 / -1; margin: 0; padding: 8px 11px; border-left: 2px solid #53645e; background: #0d1512; color: #bac7c1; font-size: 12px; }
.service-row.good .service-reason { border-left-color: var(--green); }
.service-row.warn .service-reason { border-left-color: var(--amber); }
.service-row.danger .service-reason { border-left-color: var(--red); }
.service-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; }
.service-row > details { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 10px; }
details > summary { cursor: pointer; color: #c7d2cd; font-weight: 600; }
.evidence-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.evidence-grid > div { border: 1px solid var(--line-soft); border-radius: 8px; background: #0c1311; padding: 10px; }
.public-proxy-section { margin-top: 16px; }
.public-proxy-section > .panel { padding: 18px; }
.credential-panel { margin: 14px 0; border: 1px solid var(--line); border-radius: 9px; background: #0d1512; padding: 12px 14px; }
.credential-panel > summary { color: var(--text); }
.credential-panel > p { margin: 9px 0 12px; color: var(--muted); font-size: 12px; }
.public-gateway-list { display: grid; gap: 10px; margin-top: 14px; }
.public-gateway-card { display: grid; gap: 12px; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 10px; background: #0d1512; padding: 15px; }
.public-gateway-card.good { border-left-color: var(--green-edge); }
.public-gateway-card.danger { border-left-color: var(--red); }
.public-gateway-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.public-gateway-head > div { min-width: 0; }
.public-gateway-head h3, .public-gateway-head p { margin: 0; }
.public-gateway-head h3 { display: inline; margin-left: 8px; font-size: 16px; }
.public-gateway-head p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.protocol-mark { display: inline-flex; border: 1px solid #3e554b; border-radius: 5px; background: #16231e; color: #bfe3cf; padding: 3px 6px; font: 800 10px/1 ui-monospace, monospace; letter-spacing: .05em; }
.public-gateway-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.public-gateway-facts > div { min-width: 0; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.public-gateway-facts small, .public-gateway-facts strong, .public-gateway-facts code { display: block; }
.public-gateway-facts small { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.public-gateway-facts strong, .public-gateway-facts code { margin-top: 3px; overflow-wrap: anywhere; font-size: 12px; }
.public-gateway-reason { margin: 0; border-left: 2px solid var(--amber); background: #111a17; color: #c6d0cb; padding: 8px 10px; font-size: 12px; }
.public-gateway-card.good .public-gateway-reason { border-left-color: var(--green-edge); }
.public-gateway-card.danger .public-gateway-reason { border-left-color: var(--red); }
.public-gateway-controls { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(3, auto); align-items: center; gap: 7px; border-top: 1px dashed var(--line); padding-top: 11px; }
.public-gateway-controls > span { display: grid; gap: 2px; }
.public-gateway-controls > span small { color: var(--muted); }
.mode-choice.active { border-color: #4b8066; background: #1c3429; color: #d7f4e4; box-shadow: inset 0 0 0 1px #4b8066; }
.public-gateway-card > details { border-top: 1px dashed var(--line-soft); padding-top: 9px; }

.fleet-panel { padding: 0; overflow: hidden; }
.fleet-panel > .panel-head { padding: 18px 20px 12px; margin: 0; }
.fleet-panel .table-wrap { border-width: 1px 0 0; border-radius: 0; }
.workspace-loading { display: flex; align-items: center; gap: 12px; min-height: 120px; }
.device-workspace-tabs { width: 100%; margin-bottom: 16px; }
.device-workspace-tabs > button { flex: 1 1 150px; }
.device-workspace-body { min-width: 0; }
.workspace-span { grid-column: 1 / -1; }
.workspace-summary .panel { min-width: 0; }
.workspace-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.workspace-shortcuts button { display: grid; align-content: start; justify-items: start; gap: 4px; min-height: 76px; text-align: left; }
.workspace-shortcuts small { color: var(--muted); white-space: normal; }
.workspace-services { display: grid; gap: 16px; }
.workspace-services > .panel { padding: 0; overflow: hidden; }
.workspace-services > .panel > .panel-head { padding: 18px 20px; margin: 0; border-bottom: 1px solid var(--line-soft); }
.workspace-access { margin: 0; }
.workspace-recovery > .panel { min-width: 0; }
.fleet-table th, .fleet-table td, .remote-table th, .remote-table td, .people-table th, .people-table td { padding: 13px 12px; }
.fleet-table th:first-child, .fleet-table td:first-child, .remote-table th:first-child, .remote-table td:first-child { padding-left: 20px; }
.fleet-table th:last-child, .fleet-table td:last-child, .remote-table th:last-child, .remote-table td:last-child { padding-right: 20px; }
.device-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.device-cell strong, .device-cell small { display: block; }
.token-list { display: flex; flex-wrap: wrap; gap: 5px; min-width: 160px; }
.compact-token { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #3a4943; border-radius: 5px; background: #151e1b; color: #c7d2cd; padding: 3px 6px; font-size: 10px; }
.compact-token.good { border-color: #35654e; color: #aee7c8; }
.compact-token.warn { border-color: #6c5935; color: #e3c48e; }
.compact-token.danger { border-color: #704040; color: #e9aaaa; }
.compact-token.muted { opacity: .72; }
.compact-token code { font-size: 10px; }
.service-counts { display: flex; gap: 5px; }
.service-counts button { min-height: 29px; padding: 4px 7px; font-size: 10px; }
.service-counts strong { font-size: 13px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.row-actions button, .row-actions .button-link { min-height: 31px; padding: 5px 8px; font-size: 11px; }
.fleet-table .device-cell { min-width: 160px; }
.fleet-table .token-list { min-width: 140px; }
.fleet-row-actions { display: grid; grid-template-columns: 1fr; min-width: 112px; }
.fleet-row-actions > * { width: 100%; }

.people-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .55fr); gap: 16px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.policy-options { display: grid; gap: 8px; margin: 14px 0; padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.policy-options legend { color: var(--text); font-weight: 700; padding: 0 5px; }
.policy-options label { display: flex; align-items: center; gap: 8px; margin: 0; color: #cbd5d0; }
.policy-options input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--green-edge); }
.policy-options label:last-child { display: grid; }
.source-list { display: grid; gap: 9px; }
.source-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; border: 1px solid var(--line-soft); border-left: 3px solid var(--faint); border-radius: 9px; background: #0d1512; padding: 13px; }
.source-row.good { border-left-color: var(--green-edge); }
.source-row.warn { border-left-color: var(--amber); }
.source-row.muted { opacity: .84; }
.source-row-main { display: grid; min-width: 0; gap: 5px; }
.source-row-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.source-row-main p, .source-row-main small { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.source-row-main code { white-space: normal; overflow-wrap: anywhere; }
.source-policy-strip { display: flex; flex-wrap: wrap; gap: 5px; }
.source-policy { border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.source-policy.on { border-color: #35654e; color: #aee7c8; }
.source-policy.off { border-color: #704040; color: #e9aaaa; }
.source-history { border-top: 1px solid var(--line-soft); padding-top: 9px; }
.source-history summary { cursor: pointer; color: #cbd5d0; font-weight: 700; padding: 6px 2px; }
.source-history > .source-list { margin-top: 8px; }
.modal-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 13px; }
.modal-heading h2, .modal-heading p { margin: 2px 0 0; }
.modal-heading p { color: var(--muted); overflow-wrap: anywhere; }
.modal-loading { display: flex; align-items: center; gap: 16px; min-height: 130px; }
.modal-loading h2, .modal-loading p, .modal-load-failure h2, .modal-load-failure p { margin: 3px 0 0; }
.modal-loading p, .modal-load-failure p { color: var(--muted); }
.loading-ring { width: 28px; height: 28px; flex: 0 0 auto; border: 3px solid #34423d; border-top-color: var(--green-edge); border-radius: 50%; animation: loading-spin .75s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
.stale-data-banner { margin-bottom: 10px; }
.freshness-blocked { pointer-events: auto; cursor: not-allowed; opacity: .52; }
.source-observed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 13px 0; }
.source-observed > div { display: grid; min-width: 0; gap: 3px; border-top: 1px solid var(--line-soft); padding-top: 9px; }
.source-observed small { color: var(--faint); }
.source-observed code { white-space: normal; overflow-wrap: anywhere; }
.source-policy-form label { min-width: 0; }
.source-policy-form label > small { display: block; min-height: 34px; margin-top: 5px; color: var(--muted); line-height: 1.35; }
.source-policy-options label, .source-policy-options label:last-child { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px; }
.source-policy-options label > span { display: grid; gap: 3px; }
.source-policy-options label small { color: var(--muted); line-height: 1.4; }
.source-modal-actions { margin-top: 14px; }
.access-workflow, .handoff-panel { margin-bottom: 16px; }
.access-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.access-steps article { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 13px; border: 1px solid var(--line-soft); border-radius: 9px; background: #0d1512; }
.access-steps b, .onboard-step b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: #244636; color: #bce8d0; }
.access-steps h3, .access-steps p { margin: 0; }
.access-steps p { color: var(--muted); font-size: 12px; }
.access-person-list { display: grid; margin-top: 14px; }
.access-person-list article { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); padding: 11px 0; }
.access-person-list article > div { flex: 1; }
.access-person-list strong, .access-person-list small { display: block; }

.onboard-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.onboard-step { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; min-height: 116px; padding: 16px; border-left: 1px solid var(--line-soft); background: #0e1513; }
.onboard-step:first-child { border-left: 0; }
.onboard-step h2, .onboard-step p { margin: 0; }
.onboard-step h2 { font-size: 15px; }
.onboard-step p { color: var(--muted); font-size: 12px; }
.install-command-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.setup-page-callout { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.setup-page-callout h2, .setup-page-callout p { margin: 4px 0 0; }
.manual-install-commands { margin-bottom: 16px; }
.manual-install-commands > p { color: var(--muted); }
.manual-install-commands .install-command-grid { margin: 14px 0 0; }
.command-card h2 { margin-top: 7px; }
.command-copy { grid-template-columns: minmax(0, 1fr); }
.command-copy code { display: block; max-height: 95px; overflow: auto; }
.command-copy button { justify-self: start; }
.onboard-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 16px; margin-bottom: 16px; }

.operations-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 16px; align-items: start; }
.operations-side { display: grid; gap: 16px; }
.stack-actions { display: grid; gap: 8px; }
.stack-actions > * { width: 100%; }
.remote-principle { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.remote-principle > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 11px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #101816; }
.remote-principle .service-mark { grid-row: 1 / 3; }
.remote-principle p { margin: 0; color: var(--muted); font-size: 12px; }
.remote-panel { padding: 0; overflow: hidden; }
.remote-panel > .panel-head { padding: 18px 20px; margin: 0; }
.remote-device-list { display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.remote-device-card { min-width: 0; padding: 18px 20px; border-top: 1px solid var(--line-soft); }
.remote-device-card:first-child { border-top: 0; }
.remote-device-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.remote-device-version { display: grid; justify-items: end; gap: 4px; text-align: right; }
.remote-device-version small { color: var(--muted); }
.remote-channel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.remote-channel { display: flex; min-width: 0; min-height: 142px; flex-direction: column; border: 1px solid var(--line); border-top: 2px solid var(--faint); border-radius: 9px; background: #0d1512; padding: 12px; }
.remote-channel.ready { border-top-color: var(--green-edge); }
.remote-channel.down { border-top-color: var(--red); }
.remote-channel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.remote-channel p { margin: 7px 0 12px; color: var(--muted); font-size: 12px; }
.remote-channel-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.remote-channel-actions > button, .remote-channel-actions > .button-link {
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}
.remote-unavailable { color: var(--faint); font-size: 11px; font-weight: 700; }
.remote-tools { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.remote-tools summary { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.remote-tools .row-actions { margin-top: 10px; }
.remote-help { margin-top: 14px; }
.remote-help > summary { font-size: 13px; }
.remote-unsupported { border: 1px solid var(--line); border-radius: 9px; background: #0d1512; padding: 13px; }
.remote-unsupported p { color: var(--muted); }
.platform-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); gap: 16px; margin-bottom: 16px; }
.platform-status { grid-template-columns: auto minmax(0, 1fr) auto; }
.platform-status strong, .platform-status p { display: block; margin: 0; }
.release-current strong { display: block; margin: 5px 0; font: 800 38px/1 ui-monospace, monospace; color: var(--green); }

@media (max-width: 1230px) {
  .topbar { align-items: flex-start; }
  .topbar-tools .user { display: none; }
  .topbar-tools { gap: 6px; }
  .overview-layout, .people-layout, .operations-layout, .platform-layout, .onboard-layout { grid-template-columns: 1fr; }
  .service-row { grid-template-columns: 1fr; }
  .workspace-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .topbar { display: grid; grid-template-columns: 1fr; gap: 9px; }
  .topbar-primary { width: 100%; gap: 10px; }
  .nav-toggle { display: inline-flex; }
  #mainNav { display: none; position: absolute; top: 62px; left: 12px; right: 12px; z-index: 12; flex-direction: column; align-items: stretch; gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #0d1512; box-shadow: var(--shadow); }
  #mainNav.open { display: flex; }
  #mainNav .nav { width: 100%; justify-content: flex-start; }
  .topbar-brand { flex: 1; }
  .topbar-tools { width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 1px; }
  .topbar-tools .top-action { display: inline-flex; }
  .page-head { grid-template-columns: 1fr; align-items: start; }
  .overview-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview-stats > button:nth-child(3) { border-right: 0; }
  .overview-stats > button:nth-child(n+4) { border-top: 1px solid var(--line-soft); }
  .service-facts, .evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-gateway-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-gateway-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .public-gateway-controls > span { grid-column: 1 / -1; }
  .onboard-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .onboard-step:nth-child(3) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .onboard-step:nth-child(4) { border-top: 1px solid var(--line-soft); }
}

@media (max-width: 760px) {
  main { width: calc(100vw - 20px); }
  .topbar-tools .top-action { display: inline-flex; }
  .topbar-tools { justify-content: space-between; }
  .page-head h1 { font-size: 31px; }
  .overview-stats, .service-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-stats > button, .service-summary > div { min-height: 75px; border-top: 1px solid var(--line-soft); }
  .overview-stats > button:nth-child(1), .overview-stats > button:nth-child(2), .service-summary > div:nth-child(1), .service-summary > div:nth-child(2) { border-top: 0; }
  .overview-stats > button:nth-child(even), .service-summary > div:nth-child(even) { border-right: 0; }
  .attention-row, .ready-service { grid-template-columns: auto minmax(0, 1fr); }
  .attention-row .row-actions, .ready-service > button { grid-column: 2; justify-self: start; }
  .segmented { width: 100%; }
  .segmented > button { min-width: 145px; flex: 1; }
  .service-list { padding: 0 14px; }
  .service-facts, .evidence-grid, .form-grid, .access-steps, .remote-principle, .remote-channel-grid, .install-command-grid { grid-template-columns: 1fr; }
  .setup-page-callout { align-items: flex-start; flex-direction: column; }
  .remote-device-head { align-items: flex-start; flex-direction: column; }
  .remote-device-version { justify-items: start; text-align: left; }
  .remote-channel { min-height: 0; }
  .source-row { grid-template-columns: 1fr; }
  .device-workspace-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .device-workspace-tabs > button { min-width: 0; width: 100%; }
  .workspace-shortcuts { grid-template-columns: 1fr; }
  .source-row-actions button { width: 100%; }
  .source-observed { grid-template-columns: 1fr; }
  .public-gateway-head { display: grid; }
  .public-gateway-controls { grid-template-columns: 1fr; }
  .public-gateway-controls > span { grid-column: auto; }
  .public-gateway-controls > button { width: 100%; }
  .modal-heading { display: grid; gap: 8px; }
  .onboard-steps { grid-template-columns: 1fr; }
  .onboard-step { border-left: 0; border-top: 1px solid var(--line-soft); }
  .onboard-step:first-child { border-top: 0; }
  .table-wrap { overflow: visible; border: 0; }
  .fleet-table, .remote-table, .people-table { display: block; }
  .fleet-table thead, .remote-table thead, .people-table thead { display: none; }
  .fleet-table tbody, .remote-table tbody, .people-table tbody { display: grid; gap: 10px; }
  .fleet-table tr, .remote-table tr, .people-table tr { display: grid; border: 1px solid var(--line); border-radius: 10px; background: #0e1513; padding: 10px; }
  .fleet-table td, .remote-table td, .people-table td, .fleet-table td:first-child, .fleet-table td:last-child, .remote-table td:first-child, .remote-table td:last-child { display: grid; grid-template-columns: minmax(90px, .36fr) minmax(0, 1fr); gap: 8px; border: 0; border-top: 1px solid var(--line-soft); padding: 8px 0; }
  .fleet-table td:first-child, .remote-table td:first-child, .people-table td:first-child { border-top: 0; }
  .fleet-table td::before, .remote-table td::before, .people-table td::before { content: attr(data-label); color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
  .fleet-table td:first-child::before, .remote-table td:first-child::before { display: none; }
  .fleet-table td:first-child, .remote-table td:first-child { grid-template-columns: 1fr; }
  .service-actions > *, .row-actions > * { flex: 1 1 auto; }
  .modal { padding: 8px; }
  .modal-card { max-height: 96dvh; padding: 15px; }
}

@media (max-width: 410px) {
  .overview-stats, .service-summary { grid-template-columns: 1fr; }
  .overview-stats > button, .service-summary > div { border-right: 0; border-top: 1px solid var(--line-soft) !important; }
  .overview-stats > button:first-child, .service-summary > div:first-child { border-top: 0 !important; }
  .topbar-tools #refreshBtn { display: none; }
}

/* Browser-matrix corrections, 2026-07-16. Keep the five primary destinations
 * usable without horizontal scrolling at the contracted viewports. */
.view, .panel, .card, .job, .panel-head > div { min-width: 0; }
.job .top > div { min-width: 0; }

@media (max-width: 1150px) and (min-width: 1024px) {
  .topbar { gap: 12px; }
  .topbar-primary { gap: 14px; }
  .topbar-brand { min-width: 118px; }
  .topbar-brand small { display: none; }
  .topbar-tools #refreshBtn { display: none; }
  .nav { padding-inline: 9px; }
}

@media (max-width: 1100px) {
  .modal-card.wide .grid.three { grid-template-columns: 1fr; }
  .fleet-table-wrap, .remote-panel .table-wrap, .people-layout .table-wrap { overflow: visible; border: 0; }
  .fleet-table, .remote-table, .people-table { display: block; width: 100%; }
  .fleet-table thead, .remote-table thead, .people-table thead { display: none; }
  .fleet-table tbody, .remote-table tbody, .people-table tbody { display: grid; gap: 10px; }
  .fleet-table tr, .remote-table tr, .people-table tr { display: grid; border: 1px solid var(--line); border-radius: 10px; background: #0e1513; padding: 10px; }
  .fleet-table td, .remote-table td, .people-table td,
  .fleet-table td:first-child, .fleet-table td:last-child,
  .remote-table td:first-child, .remote-table td:last-child,
  .people-table td:first-child, .people-table td:last-child {
    display: grid; grid-template-columns: minmax(105px,.28fr) minmax(0,1fr); gap: 10px;
    border: 0; border-top: 1px solid var(--line-soft); padding: 9px 0;
  }
  .fleet-table td:first-child, .remote-table td:first-child, .people-table td:first-child { border-top: 0; }
  .fleet-table td::before, .remote-table td::before, .people-table td::before {
    content: attr(data-label); color: var(--faint); font-size: 10px; font-weight: 800;
    letter-spacing: .07em; text-transform: uppercase;
  }
  .fleet-table td:first-child::before, .remote-table td:first-child::before { display: none; }
  .fleet-table td:first-child, .remote-table td:first-child { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .topbar { max-width: 100vw; overflow: hidden; }
  .topbar-primary, .topbar-brand { min-width: 0; }
  .topbar-brand small { display: none; }
  .job .top { flex-wrap: wrap; }
  .job .top > div { flex: 1 1 180px; }
  .job .top .spacer { display: none; }
  .remote-channel-grid { grid-template-columns: 1fr; }
  .public-proxy-table-wrap { overflow: visible; border: 0; }
  .public-proxy-table { display: block; width: 100%; }
  .public-proxy-table thead { display: none; }
  .public-proxy-table tbody { display: grid; gap: 10px; }
  .public-proxy-table tr { display: grid; border: 1px solid var(--line); border-radius: 10px; background: #0e1513; padding: 10px; }
  .public-proxy-table td { display: grid; grid-template-columns: minmax(105px,.38fr) minmax(0,1fr); gap: 8px; border: 0; border-top: 1px solid var(--line-soft); padding: 8px 0; }
  .public-proxy-table td:first-child { border-top: 0; }
  .public-proxy-table td::before { content: attr(data-label); color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
  .public-proxy-table button { justify-self: start; white-space: normal; }
  .public-proxy-section > .panel { padding: 14px; }
}

@media (max-width: 600px) {
  .segmented { display: grid; grid-template-columns: 1fr; overflow: visible; }
  .segmented > button { min-width: 0; width: 100%; }
  .fleet-table td, .remote-table td, .people-table td,
  .fleet-table td:first-child, .fleet-table td:last-child,
  .remote-table td:first-child, .remote-table td:last-child,
  .people-table td:first-child, .people-table td:last-child,
  .public-proxy-table td { grid-template-columns: 1fr; gap: 3px; }
}

/* Live-data matrix corrections. Active jobs and long employee/device labels must
 * never change the width of the application shell. */
#main,
#jobMonitor,
.job-monitor,
.job-monitor-head,
.job-list,
.access-workflow,
.access-person-list,
.access-person-list article,
.access-person-list article > div {
  max-width: 100%;
  min-width: 0;
}

.job-monitor pre,
.job pre {
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 1500px) and (min-width: 1024px) {
  .topbar-brand small,
  .topbar-tools #refreshBtn {
    display: none;
  }
  .topbar-brand { min-width: 118px; width: 118px; }
  .topbar-primary { flex: 0 0 auto; gap: 14px; }
  #mainNav { flex: 0 0 auto; min-width: max-content; }
  .topbar-tools { min-width: 0; }
}

@media (max-width: 760px) {
  #main,
  #jobMonitor,
  .job-monitor,
  .job-list,
  .view.active {
    width: 100%;
  }
  .job-monitor { padding: 12px; }
  .job-monitor-head { flex-wrap: wrap; }
  .job-monitor-head > div { flex: 1 1 100%; min-width: 0; }
  .job-monitor-head .spacer { display: none; }
  .job-monitor-head > button { flex: 1 1 145px; white-space: normal; }
  .job .top > button { flex: 1 1 120px; white-space: normal; }
  .operation-stage-labels { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .operation-stage-labels span { overflow-wrap: anywhere; }
  .access-person-list article { align-items: stretch; flex-wrap: wrap; }
  .access-person-list article > div { flex: 1 1 100%; }
  .access-person-list article > button { flex: 1 1 145px; white-space: normal; }
}

/* Admin UX truth/navigation correction, 2026-07-17. Global employee access
 * and find stay visible at every contracted viewport; collapsed navigation
 * expands in document flow instead of covering the page tools. */
.topbar-tools .global-essential { display: inline-flex; }
.topbar-tools #refreshBtn { display: inline-flex; }
#globalFindBtn { min-width: 54px; }

.global-find-label { margin-top: 0; }
.global-find-label input { margin-top: 7px; font-size: 16px; }
.global-find-results {
  display: grid;
  gap: 7px;
  max-height: min(58dvh, 560px);
  margin-top: 12px;
  overflow: auto;
}
.global-find-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: stretch;
  gap: 16px;
  width: 100%;
  min-height: 68px;
  border-radius: 9px;
  background: #101916;
  padding: 10px 12px;
  text-align: left;
  white-space: normal;
}
.global-find-result > span { display: grid; min-width: 0; gap: 1px; }
.global-find-result small { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.global-find-result strong { color: var(--text); font-size: 14px; }
.global-find-result span span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.global-find-result > b { color: var(--muted); font-size: 11px; white-space: nowrap; }
.global-find-status { border-left: 2px solid var(--amber); color: var(--muted); padding: 8px 11px; }
.global-find-empty { min-height: 118px; }
.global-find-hint { margin-top: 10px; }

.device-workspace-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  overflow: visible;
}
.workspace-approval {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  border: 1px solid #80612d;
  border-left: 4px solid var(--amber);
  border-radius: 12px;
  background: #211a0f;
  margin: 0 0 16px;
  padding: 16px 18px;
}
.workspace-approval.ready { border-color: #2f7659; border-left-color: var(--green); background: #0e2119; }
.workspace-approval h2 { margin: 3px 0 5px; font-size: clamp(18px, 2vw, 25px); }
.workspace-approval p { max-width: 72ch; margin: 0; color: #c8d5cf; }
.workspace-approval > button { min-height: 44px; }
.device-workspace-tabs > button {
  width: 100%;
  min-width: 0;
  padding-inline: 8px;
  white-space: normal;
}
.workspace-shortcuts { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
.workspace-access-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line-soft);
  background: var(--line-soft);
}
.workspace-access-guide > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  background: #101816;
  padding: 12px 20px;
}
.workspace-access-guide small { color: var(--muted); }
.configuration-links { display: grid; gap: 7px; }
.configuration-links button {
  display: grid;
  justify-items: start;
  gap: 3px;
  min-height: 64px;
  text-align: left;
  white-space: normal;
}
.configuration-links small { color: var(--muted); white-space: normal; }

@media (min-width: 1024px) and (max-width: 1350px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 7px;
  }
  #mainNav {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-start;
  }
  .topbar-primary {
    display: flex;
    width: 100%;
    flex: none;
    justify-content: space-between;
  }
  .topbar-tools {
    width: 100%;
    min-width: 0;
    justify-content: flex-end;
    border-top: 1px solid var(--line-soft);
    padding-top: 7px;
  }
  .topbar-tools .global-essential { display: inline-flex; }
}

@media (max-width: 1023px) {
  .topbar { overflow: visible; }
  .topbar-primary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }
  #mainNav {
    position: static;
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 2px;
    box-shadow: none;
  }
  #mainNav.open { display: flex; }
  .topbar-tools {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow: visible;
  }
  .topbar-tools .top-action,
  .topbar-tools .global-essential { display: inline-flex; }
  .device-workspace-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .workspace-approval { grid-template-columns: 1fr; gap: 12px; }
  .workspace-approval > button { width: 100%; }
  .workspace-access-guide { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .device-workspace-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .topbar { padding-inline: 10px; }
  .topbar-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .topbar-tools #live { grid-column: 1 / -1; }
  .topbar-tools .top-action,
  .topbar-tools .global-essential,
  .topbar-tools #refreshBtn,
  .topbar-tools #logoutBtn {
    display: inline-flex;
    width: 100%;
    min-width: 0;
    padding-inline: 7px;
    font-size: 12px;
  }
  .topbar-tools #refreshBtn { grid-column: 1 / 2; }
  .topbar-tools #logoutBtn { grid-column: 2 / 4; }
  .topbar-tools .user { display: none; }
  .global-find-result { grid-template-columns: 1fr; gap: 4px; }
  .global-find-result > b { display: none; }
}
