/* Fleet Control redesign (Medtax handover). Poppins is self-hosted (OFL).
   The handover also uses weight 500; only 400/600/700/800 files ship, so 500 renders as 400. */

@font-face { font-family: "Poppins"; src: url("/fonts/Poppins-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/Poppins-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/Poppins-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/Poppins-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/Poppins-800.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  /* accent */
  --accent: #0590bb;
  --accent-press: #06769a;
  --accent-tint: #e7f4f9;
  --accent-edge: #bfe2ee;
  /* neutrals */
  --text: #33302b;
  --muted: #5d5a52;
  --faint: #9aa0ab;
  --bg: #FFFFFF;
  --raised: #F4F5F7;
  --stripe: #EBECF0;
  --border: #E8EAEE;
  --border-strong: #DDE0E6;
  --inv-bg: #2B2823;
  --inv-text: #F7F5F2;
  /* semantic */
  --online: #1f7a6b;
  --online-fill: #e3f1ee;
  --toast-dot: #57c9b4;
  --warn: #9a6a16;
  --warn-fill: #fdf4e2;
  --warn-line: #f0dcb0;
  --warn-edge: #d9a441;
  /* error banner (not part of the handover set; kept for real failures) */
  --danger: #B4372E;
  --danger-soft: #FBEDEB;
  --danger-line: #E9B7B1;
  /* radius / shadow */
  --r-pill: 999px;
  --r-table: 16px;
  --r-card: 14px;
  --r-btn: 12px;
  --r-row: 10px;
  --r-item: 8px;
  --shadow-card: 0 18px 40px -26px rgba(20, 40, 55, .33);
  --shadow-pop: 0 18px 40px -18px rgba(20, 40, 55, .4);
  --font: "Poppins", system-ui, sans-serif;
  color-scheme: light;
  font: 400 14px/1.5 var(--font);
  color: var(--text);
  background: var(--raised);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--raised); }
a { color: var(--accent); }
a:hover { color: var(--accent-press); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { color: var(--text); margin: 0; }
input::placeholder { color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* ---------- base controls (used by the login form and the dense tabs) ---------- */
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select { height: 40px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-btn); background: var(--bg); font-size: 14px; }
input:focus, select:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--accent-tint); }
label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }

button.small { height: 32px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-btn); background: var(--bg); color: var(--accent-press); font-size: 13px; font-weight: 600; transition: background-color .15s; }
button.small:hover { background: var(--accent-tint); }
button.small:disabled, button.small:disabled:hover { opacity: .5; background: var(--bg); }
button.small.danger { border-color: var(--warn-line); background: var(--warn-fill); color: var(--warn); }
button.small.danger:hover { border-color: var(--warn-edge); }
button.ghost { height: 40px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--r-btn); background: var(--bg); font-size: 13px; font-weight: 600; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font: 600 15px var(--font); cursor: pointer; }
.linkbtn:hover { color: var(--accent-press); }

/* shared button system (handover) */
.btn { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font); font-weight: 600; cursor: pointer; transition: background-color .15s, border-color .15s; }
.btn-secondary { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-strong); background: var(--bg); color: var(--accent-press); border-radius: var(--r-btn); font: 600 14.5px var(--font); transition: background-color .15s; }
.btn-secondary:hover { background: var(--accent-tint); }
.btn-lg { height: 44px; padding: 0 18px; }
.btn-md { height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-primary { height: 46px; border: 0; border-radius: var(--r-btn); background: var(--accent); color: #FFFFFF; font: 600 14.5px var(--font); transition: background-color .15s; }
.btn-primary:hover { background: var(--accent-press); }
.btn-amber { height: 46px; border: 1px solid var(--warn-line); border-radius: var(--r-btn); background: var(--warn-fill); color: var(--warn); font: 600 14.5px var(--font); }
.btn-amber:hover { border-color: var(--warn-edge); }
.btn-icon { width: 40px; height: 40px; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--r-btn); background: var(--bg); color: var(--accent-press); font-size: 17px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; transition: background-color .15s; }
.btn-icon:hover { background: var(--accent-tint); }
.btn-icon:disabled { opacity: .5; }
.btn-close { width: 40px; height: 40px; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--r-btn); background: var(--bg); color: var(--muted); font-size: 18px; flex: none; }
.btn-close:hover { background: var(--raised); }

/* ---------- header ---------- */
.topbar { position: sticky; top: 0; z-index: 20; height: 72px; background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); }
.topbar-in { max-width: 1280px; margin: 0 auto; height: 100%; padding: 0 clamp(16px, 3vw, 32px); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.mark { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.brand h1 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.topbar-controls { display: flex; align-items: center; gap: 10px; }
.whoami { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px; border-radius: var(--r-pill); background: var(--raised); }
.avatar { width: 32px; height: 32px; border-radius: var(--r-pill); background: var(--inv-bg); color: var(--inv-text); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.who-name { font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.who-role { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--r-pill); background: var(--bg); color: var(--muted); margin-right: 4px; }

/* ---------- page shell ---------- */
.shell { max-width: 1280px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 32px) 64px; display: flex; flex-direction: column; gap: 24px; }
.shell > * { min-width: 0; }
.status-error { margin: 0; padding: 12px 16px; border-radius: var(--r-btn); background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger); font-size: 14px; font-weight: 600; }

/* ---------- data source bar ---------- */
.source-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card); padding: 10px; }
.source-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-width: 0; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--raised); }
.seg-btn { height: 36px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted); font: 600 14px var(--font); transition: background-color .15s, color .15s; }
.seg-btn[aria-pressed="true"] { background: var(--accent-press); color: #FFFFFF; }
.source-status { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; line-height: 1.45; min-width: 0; }
.source-status strong { font-weight: 600; }
.source-status .note { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--accent); flex: none; }
.dot.is-live { background: var(--online); }
.source-right { display: flex; align-items: center; gap: 10px; padding-right: 4px; }
.updated { font-size: 13.5px; color: var(--muted); }

/* ---------- KPI row ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi { border-radius: var(--r-card); padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; text-align: left; font-family: var(--font); color: inherit; }
.kpi-white { background: var(--bg); border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.kpi-amber { background: var(--warn-fill); border: 1px solid var(--warn-line); transition: border-color .15s; }
.kpi-amber:hover:not(:disabled), .kpi-amber.is-on { border-color: var(--warn-edge); }
.kpi-amber:disabled { opacity: .55; cursor: not-allowed; }
.kpi-label { font-size: 14px; font-weight: 500; color: var(--muted); }
.kpi-amber .kpi-label { color: var(--warn); }
.kpi-value { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-value.is-zero { color: var(--faint); }
.kpi-valrow { display: flex; align-items: baseline; gap: 8px; }
.kpi-of { font-size: 16px; color: var(--muted); }
.kpi-foot { font-size: 13px; color: var(--faint); }
.kpi-cta { font-size: 13px; color: var(--warn); font-weight: 500; }
.bar { height: 6px; border-radius: var(--r-pill); background: var(--stripe); overflow: hidden; }
.bar-fill { width: 0; height: 100%; background: var(--online); border-radius: var(--r-pill); }

/* ---------- two-person panel (inverted) ---------- */
.pending { background: var(--inv-bg); color: var(--inv-text); border-radius: var(--r-card); padding: 20px 24px; }
.pending h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--inv-text); }
.pending h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--toast-dot); }
.pending-list { list-style: none; margin: 0; padding: 0; }
.pending-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 14px; padding: 12px 0; border-top: 1px solid #4A463F; }
.pending button.small { background: transparent; border-color: #6B675F; color: var(--inv-text); }
.pending button.small:hover { background: var(--accent-press); border-color: var(--accent-press); }
.pending button.small:disabled, .pending button.small:disabled:hover { color: var(--faint); background: transparent; border-color: #5D5A52; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--muted); font: 500 14.5px var(--font); white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--accent-press); font-weight: 600; }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--warn-fill); color: var(--warn); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.count:empty { display: none; }

/* ---------- toolbar ---------- */
.panel-fleet { display: flex; flex-direction: column; gap: 16px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search { flex: 1 1 260px; max-width: 360px; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: var(--r-btn); background: var(--bg); border: 1px solid var(--border); font-weight: 400; color: var(--faint); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.search-ic { font-size: 15px; }
.search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: transparent; font: 400 14.5px var(--font); color: var(--text); }
.search input:focus { box-shadow: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--bg); color: var(--muted); font: 500 13.5px var(--font); display: flex; align-items: center; gap: 6px; }
.chip-count { opacity: .7; }
.chip.is-active { background: var(--accent-press); border-color: var(--accent-press); color: #FFFFFF; }
.chip.is-active.chip-attention { background: var(--warn-fill); border-color: var(--warn-edge); color: var(--warn); }
.chip-divider { width: 1px; height: 24px; background: var(--border-strong); }

/* ---------- fleet table ---------- */
.ftable-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-table); box-shadow: var(--shadow-card); }
.ftable-scroll { overflow-x: auto; border-radius: var(--r-table); }
.ftable { min-width: 980px; }
.frow { display: grid; grid-template-columns: minmax(230px, 2.4fr) 110px 150px 110px minmax(150px, 1.3fr) 110px 128px; gap: 16px; align-items: center; padding: 15px 22px; border-bottom: 1px solid var(--border); }
.compact .frow { padding-top: 10px; padding-bottom: 10px; }
.fhead { padding: 14px 22px; font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.fhead .right { text-align: right; }
.fbody { position: relative; background: var(--bg); cursor: pointer; }
.fbody:hover { background: var(--raised); }
.fbody.is-selected { background: var(--accent-tint); }
.fbody:focus-visible { outline-offset: -2px; }
.c-mac { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mac-name { font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.mac-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-set, .c-usb, .c-enroll { display: flex; justify-content: flex-start; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: var(--r-pill); white-space: nowrap; }
.pill-set, .pill-enrolled { background: var(--accent-tint); color: var(--accent-press); }
.pill-online { background: var(--online-fill); color: var(--online); }
.pill-attention { background: var(--warn-fill); color: var(--warn); }
.pill-usb { background: var(--stripe); color: var(--muted); }
.pill-none { background: transparent; color: var(--faint); padding-left: 0; }
.pill-online::before, .c-status .pill-attention::before { content: ""; width: 7px; height: 7px; border-radius: var(--r-pill); background: currentColor; }
.c-status { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.reason { font-size: 12px; color: var(--warn); padding-left: 4px; }
.c-check { display: flex; flex-direction: column; gap: 2px; }
.check-rel { font-size: 14px; font-weight: 500; color: var(--text); }
.check-rel.is-stale { color: var(--warn); }
.check-rel.is-none { color: var(--faint); }
.check-abs { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.acts { display: flex; justify-content: flex-end; gap: 6px; position: relative; }
.btn-row { height: 34px; padding: 0 14px; border-radius: var(--r-row); border: 1px solid var(--border-strong); background: var(--bg); color: var(--accent-press); font: 600 13px var(--font); }
.btn-row:hover { background: var(--accent-tint); }
.btn-more { width: 34px; height: 34px; padding: 0; border-radius: var(--r-row); border: 1px solid var(--border-strong); background: var(--bg); color: var(--muted); font: 700 15px var(--font); line-height: 1; }
.btn-more:hover, .btn-more.is-open { background: var(--raised); }
.ro { font-size: 12.5px; color: var(--faint); }
.menu { position: absolute; right: 0; top: 40px; z-index: 5; width: 200px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--r-btn); box-shadow: var(--shadow-pop); padding: 6px; display: flex; flex-direction: column; cursor: default; }
.menu-item { text-align: left; height: 38px; padding: 0 12px; border: 0; border-radius: var(--r-item); background: transparent; font: 500 14px var(--font); color: var(--text); }
.menu-item:hover, .menu-item:focus-visible { background: var(--raised); }
.menu-item.menu-retire { color: var(--warn); }
.menu-item.menu-retire:hover { background: var(--warn-fill); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.group-head { display: flex; align-items: center; gap: 10px; padding: 12px 22px; background: var(--raised); border-bottom: 1px solid var(--border); font-size: 13px; }
.g-label { font-weight: 600; }
.g-profile { color: var(--muted); }
.g-count { color: var(--faint); }
.ftable-empty { padding: 48px 22px; text-align: center; font-size: 15px; color: var(--muted); }
.foot { margin: 0; font-size: 13px; color: var(--faint); }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(43, 40, 35, .28); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(420px, 100%); background: var(--bg); box-shadow: -20px 0 50px -30px rgba(20, 40, 55, .5); display: flex; flex-direction: column; overflow-y: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 24px 18px; border-bottom: 1px solid var(--border); }
.drawer-title { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.drawer-title h2 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.callout { margin: 18px 24px 0; padding: 12px 16px; border-radius: var(--r-btn); background: var(--warn-fill); border: 1px solid var(--warn-line); font-size: 14px; color: var(--warn); font-weight: 500; }
.facts { padding: 18px 24px; display: flex; flex-direction: column; }
.fact { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.fact-k { color: var(--muted); }
.fact-v { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.drawer-foot { padding: 6px 24px 28px; display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-grid .btn-secondary { height: 46px; }
.ro-note { font-size: 14px; color: var(--muted); padding: 12px 16px; border-radius: var(--r-btn); background: var(--raised); }
.manage { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.manage-label { font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.manage .field { width: 100%; height: 40px; }
.manage-row { display: flex; gap: 8px; flex-wrap: wrap; }
.manage .muted { margin: 0; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 40; background: var(--inv-bg); color: var(--inv-text); font-size: 14.5px; padding: 14px 20px; border-radius: var(--r-btn); box-shadow: var(--shadow-pop); display: flex; gap: 10px; align-items: center; max-width: calc(100% - 32px); }
.toast-dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--toast-dot); flex: none; }

/* ---------- alerts ---------- */
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px 20px; }
.alert-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.alert-dot { width: 10px; height: 10px; border-radius: var(--r-pill); background: var(--warn-edge); flex: none; }
.alert-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.alert-reason { font-size: 15px; font-weight: 600; }
.alert-meta { font-size: 13px; color: var(--muted); }
.alert-actions { display: flex; gap: 8px; flex: none; }
.note-line { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.empty-card { margin: 0; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-table); padding: 48px 24px; text-align: center; font-size: 15px; color: var(--muted); }

/* ---------- other tabs: tables in one card ---------- */
.filters { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 16px; }
.filters input, .filters select { min-width: 200px; }
.table-wrap { overflow-x: auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-table); box-shadow: var(--shadow-card); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th { color: var(--faint); font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; padding: 14px 16px; white-space: nowrap; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; vertical-align: middle; overflow-wrap: anywhere; border-bottom: 1px solid var(--border); }
td:first-child, th:first-child { padding-left: 22px; }
td:last-child, th:last-child { padding-right: 22px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--raised); }
td:first-child { font-weight: 600; }
.secondary { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; }
td.row-actions { white-space: nowrap; text-align: right; }
td.row-actions > * + * { margin-left: 8px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--r-pill); background: var(--stripe); font-size: 12.5px; font-weight: 600; text-transform: capitalize; white-space: nowrap; color: var(--muted); vertical-align: middle; }
.badge.ok { background: var(--online-fill); color: var(--online); }
.badge.warn, .badge.bad { background: var(--warn-fill); color: var(--warn); }
.badge.bad { box-shadow: inset 0 0 0 1px var(--warn-edge); }
.badge.ok::before, .badge.warn::before, .badge.bad::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.redacted { background: var(--accent-tint); color: var(--accent-press); padding: 3px 10px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; }

.muted { color: var(--faint); font-size: 13px; font-weight: 400; }
.panel > .muted, .filters + .muted, .table-wrap + .muted { margin: 12px 4px 0; max-width: 78ch; line-height: 1.6; }

/* ---------- set profiles ---------- */
.profile { margin: 0 0 32px; }
.profile h3 { margin: 0 0 6px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.profile > .muted { margin: 0 0 12px; }
.artifacts { margin: 16px 0 0; padding: 20px 24px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.artifacts h4 { margin: 0 0 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.artifact { border-top: 1px solid var(--border); padding: 14px 0 8px; }
.artifact:first-of-type { border-top: 0; padding-top: 4px; }
.artifact summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.artifact summary code { background: var(--accent-tint); color: var(--accent-press); padding: 3px 10px; border-radius: var(--r-pill); font-size: 12.5px; }
.artifact > .muted { margin: 8px 0 12px; }
.artifact-code { margin: 0 0 12px; padding: 16px 18px; background: var(--inv-bg); color: var(--inv-text); border-radius: var(--r-row); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; white-space: pre; max-height: 320px; }
a.download { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; font-size: 13px; font-weight: 600; color: var(--accent-press); text-decoration: none; border: 1px solid var(--border-strong); background: var(--bg); border-radius: var(--r-row); }
a.download:hover { background: var(--accent-tint); }
.deploy-steps { margin: 6px 0 4px; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
footer { padding-top: 16px; border-top: 1px solid var(--border); color: var(--faint); font-size: 13px; }

/* ---------- live engine status panel ---------- */
.live-wrap { display: flex; flex-direction: column; gap: 12px; }
.live-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.live-facts > div { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card); padding: 10px 16px; }
.live-facts dt { font-size: 12px; color: var(--faint); }
.live-facts dd { margin: 2px 0 0; font-size: 14.5px; font-weight: 600; word-break: break-all; }
.live-empty { background: var(--bg); border: 1px dashed var(--border-strong); border-radius: var(--r-card); padding: 16px 20px; margin: 0; font-size: 14px; color: var(--muted); }
.live-ready { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px 18px; }
.live-ready h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.live-ready ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.live-ready li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.live-ready .live-mark { width: 1.2em; text-align: center; font-weight: 700; }
.live-ready .is-ready .live-mark { color: var(--online); }
.live-ready .is-pending { color: var(--faint); }
.live-all-ready { margin: 10px 0 0; font-weight: 600; font-size: 14px; }
.live-health { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; }
.live-health-label { font-size: 12px; color: var(--faint); }
.live-badge { display: inline-flex; align-items: center; height: 28px; padding: 0 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; }
.live-badge.is-up { background: var(--online-fill); color: var(--online); }
.live-badge.is-down { background: var(--warn-fill); color: var(--warn); }
.live-badge.is-checking { background: var(--stripe); color: var(--muted); }
.live-health-note { color: var(--muted); }

/* ---------- sign-in ---------- */
.login { min-height: calc(100vh - 72px); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px 64px; }
.login-card { width: 100%; max-width: 440px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-table); box-shadow: var(--shadow-card); padding: 40px; }
.login-card .eyebrow { display: block; }
.login-card h2 { margin: 6px 0 20px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.sim-note { margin: 0 0 24px; padding: 12px 16px; background: var(--accent-tint); border-radius: var(--r-btn); font-size: 13px; color: var(--muted); }
.login-card form { display: grid; gap: 18px; }
.login-card label { gap: 8px; font-size: 13px; }
.login-card input { height: 46px; }
.login-card button[type="submit"] { height: 46px; border: 0; border-radius: var(--r-btn); background: var(--accent); color: #FFFFFF; font: 600 14.5px var(--font); }
.login-card button[type="submit"]:hover { background: var(--accent-press); }
.login-actions { display: flex; gap: 12px; align-items: center; }
.mfa-note { margin: 0; font-size: 14px; color: var(--muted); }
.login-error { margin: 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.demo-accounts { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; }
.demo-accounts summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--faint); }
.demo-accounts ul { margin: 12px 0 8px; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.demo-accounts code { background: var(--accent-tint); color: var(--accent-press); padding: 2px 8px; border-radius: 6px; font-size: 12px; }

@media (max-width: 760px) {
  .brand-text .eyebrow { display: none; }
  .who-name { display: none; }
  .alert-card { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- REAL actions in Live (danger framing, distinct from simulated Lock) ---------- */
.btn-real { height: 34px; padding: 0 12px; margin-left: 6px; border-radius: var(--r-row); border: 1px solid var(--danger-line); background: var(--danger-soft); color: var(--danger); font: 600 13px var(--font); }
.btn-real:hover { border-color: var(--danger); }
.btn-danger { height: 46px; border: 0; border-radius: var(--r-btn); background: var(--danger); color: #FFFFFF; font: 600 14.5px var(--font); }
.btn-danger:hover { filter: brightness(.92); }
.real-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--danger-line); border-radius: var(--r-btn); background: var(--danger-soft); }
.real-warn { font-size: 13.5px; font-weight: 600; color: var(--danger); }
.lock-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 10px; border: 1px solid var(--danger); border-radius: var(--r-btn); background: var(--raised); }
.lock-text { font: 700 13px ui-monospace, Menlo, monospace; letter-spacing: .04em; user-select: all; }
.lock-note { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--muted); }

/* One lock at a time: a locked Mac's Lock button is disabled, not hidden, so the state is legible. */
.btn-real:disabled, .btn-real:disabled:hover { opacity: .5; border-color: var(--danger-line); background: var(--danger-soft); }
.btn-danger:disabled, .btn-danger:disabled:hover { opacity: .5; filter: none; }

/* Command activity: which Lock/Restart commands the Mac received vs still waiting in line. */
.cmd-activity { margin: 18px 24px 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--raised); }
.cmd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cmd-title { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.cmd-empty { margin: 0; font-size: 13px; color: var(--muted); }
.cmd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cmd-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-row); background: var(--bg); }
.cmd-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cmd-kind { font-weight: 700; font-size: 13px; }
.cmd-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-pill); }
.cmd-ok { background: var(--accent-tint); color: var(--accent-press); box-shadow: inset 0 0 0 1px var(--accent-edge); }
.cmd-wait { background: var(--warn-fill); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-edge); }
.cmd-other { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger-line); }
.cmd-pin { font: 700 12px ui-monospace, Menlo, monospace; letter-spacing: .04em; user-select: all; color: var(--text); }
.cmd-when { font-size: 12px; color: var(--muted); }
.cmd-foot { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- Users (admin accounts) ---------- */
.users-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 14px; }
.users-title { margin: 0; font-size: 16px; font-weight: 700; }
.users-table th, .users-table td { vertical-align: middle; }
.user-uname { font: 600 13px ui-monospace, Menlo, monospace; background: var(--raised); padding: 2px 7px; border-radius: 6px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.user-actions select { height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-btn); background: var(--bg); color: var(--text); font: 600 13px var(--font); }
.user-form { margin: 0 0 18px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-table); background: var(--raised); }
.user-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.user-field { display: flex; flex-direction: column; gap: 5px; }
.user-field-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.user-field input, .user-field select { height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-btn); background: var(--bg); color: var(--text); font: 500 14px var(--font); }
.user-form-foot { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }

/* One-time credentials modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(43, 40, 35, .34); }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 41; width: min(520px, calc(100% - 32px)); max-height: calc(100% - 48px); overflow-y: auto; background: var(--bg); border-radius: var(--r-table); box-shadow: var(--shadow-pop); padding: 22px 24px; }
.modal-title { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.modal-warn { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--r-btn); background: var(--warn-fill); border: 1px solid var(--warn-line); color: var(--warn); font-size: 13.5px; font-weight: 500; }
.cred-list { display: flex; flex-direction: column; gap: 10px; }
.cred-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; }
.cred-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.cred-val { font: 700 13px ui-monospace, Menlo, monospace; background: var(--raised); padding: 8px 10px; border-radius: 8px; user-select: all; word-break: break-all; }
.cred-wrap { font-weight: 500; font-size: 12px; }
.modal-foot { display: flex; justify-content: flex-end; margin-top: 20px; }

/* Live view: set profile, installed profiles, pending wipes (real Macs, red treatment) */
.real-controls { border-color: var(--danger-line); }
.profile-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.profile-row .btn-real { margin-left: 0; }
.profile-note { margin: 10px 0 0; padding: 8px 10px; border-radius: var(--r-row); font-size: 13px; font-weight: 500; }
.profile-note.is-ok { background: var(--accent-tint); color: var(--accent-press); }
.profile-note.is-wait { background: var(--warn-fill); color: var(--warn); }
.profile-note.is-bad { background: var(--danger-soft); color: var(--danger); }
.plist { margin-top: 8px; }
.plist-id { font: 500 12px ui-monospace, Menlo, monospace; color: var(--muted); word-break: break-all; }
.wipe-pending { background: var(--danger-soft); border: 1px solid var(--danger-line); border-radius: var(--r-card); padding: 14px 18px; }
.wipe-title { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--danger); }
.btn-sm.btn-danger { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-row); }
