:root {
  color-scheme: light;
  /* Law&Crime brand: navy, antique gold, and burgundy (lawandcrime.com). */
  --navy: #121c38;
  --navy-2: #21364d;
  --gold: #af8f53;
  --gold-dark: #896840;
  --gold-soft: #f7f2e8;
  --burgundy: #811917;
  --ink: #172033;
  --muted: #687386;
  --line: #dfe5ec;
  --paper: #fff;
  --canvas: #f5f5f4;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
.topbar { min-height: 72px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--navy); border-bottom: 4px solid var(--gold); color: #fff; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-logo { display: block; width: auto; height: 22px; }
.brand-product { padding-left: 14px; border-left: 1px solid rgba(175, 143, 83, .55); color: var(--gold); font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
nav { display: flex; align-items: center; gap: 22px; color: #d8e2f4; font-size: 13px; }
nav a, .link-button { color: white; font-weight: 650; }
nav form { margin: 0; }
.link-button { border: 0; padding: 0; background: transparent; text-decoration: underline; cursor: pointer; font: inherit; }
main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 70px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 7px; color: var(--burgundy); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; color: var(--navy); font-size: clamp(32px, 4vw, 48px); line-height: 1.08; letter-spacing: -.04em; }
h2 { margin: 0 0 20px; color: var(--navy); font-size: 20px; letter-spacing: -.02em; }
.hero p:not(.eyebrow), .login-card p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); font-size: 16px; }
.refresh { flex: none; display: grid; grid-template-columns: 11px auto; gap: 0 9px; align-items: center; padding: 13px 17px; border: 1px solid #cfe8df; border-radius: 12px; background: #edf9f4; color: #176b50; font-size: 13px; font-weight: 700; }
.refresh small { grid-column: 2; color: #4e7669; font-weight: 500; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #20a67a; }
.refresh.stale { border-color: #f1d49a; background: #fff9e9; color: #805b13; }
.refresh.stale .status-dot { background: #e2a52c; }
.table-card, .panel, .empty { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 8px 25px rgba(9, 30, 65, .05); }
.table-tools { display: flex; align-items: end; gap: 14px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.table-tools label { gap: 5px; }
.system-search { flex: 1 1 360px; max-width: 520px; }
.status-filter { flex: 0 0 170px; }
.table-tools input, .table-tools select { padding: 9px 11px; }
.system-count { flex: 1 0 auto; margin: 0 0 9px; color: var(--muted); font-size: 13px; text-align: right; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 15px 18px; background: #f8fafc; color: #718096; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
th:first-child { border-radius: 16px 0 0; }
th:last-child { border-radius: 0 16px 0 0; }
td { padding: 18px; border-top: 1px solid #edf0f4; white-space: nowrap; }
td strong { color: var(--navy); }
.sort-button { display: inline-flex; align-items: center; gap: 7px; padding: 0; border-radius: 0; background: transparent; color: inherit; font-size: inherit; font-weight: inherit; letter-spacing: inherit; text-transform: inherit; }
.sort-button:hover { color: var(--navy); }
.sort-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.sort-button span { min-width: 10px; color: #9aa5b4; font-size: 13px; }
th[aria-sort="ascending"] .sort-button, th[aria-sort="descending"] .sort-button { color: var(--navy); }
.filter-empty { padding: 36px 18px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
code { padding: 3px 6px; border-radius: 5px; background: #f1f4f7; color: #34435a; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px; border-radius: 999px; background: #f0f2f5; color: #596475; font-size: 12px; font-weight: 700; }
.pill span { width: 7px; height: 7px; border-radius: 50%; background: #8c96a4; }
.pill.online { background: #ebf8f3; color: #147354; }
.pill.online span { background: #1aa476; }
.pill.offline { background: #fff0ef; color: #a3372e; }
.pill.offline span { background: #df4a3f; }
.pill[data-last-seen], .port-stale[data-last-seen] { cursor: help; }
.platform-icon { display: inline-flex; align-items: center; }
.platform-icon svg { width: 18px; height: 18px; fill: currentColor; }
.platform-icon.macos { color: #1d1d1f; }
.platform-icon.windows { color: #0078d4; }
.status-detail { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.action { text-align: right; }
button, .google-button { border: 0; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 750; }
.connect, .primary, .google-button { padding: 10px 15px; background: var(--navy); color: white; }
.connect:hover, .primary:hover, .google-button:hover { background: var(--navy-2); }
button:disabled { cursor: not-allowed; opacity: .45; }
.hint { margin: 14px 4px; color: var(--muted); font-size: 12px; }
.empty { padding: 50px; text-align: center; }
.empty p { color: var(--muted); }
#toast { position: fixed; right: 24px; bottom: 24px; max-width: 360px; padding: 14px 18px; border-radius: 10px; background: #172033; color: white; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
#toast.show { opacity: 1; transform: translateY(0); }
.login-card { width: min(440px, 100%); margin: 7vh auto; padding: 44px; border: 1px solid var(--line); border-radius: 20px; background: white; text-align: center; box-shadow: 0 18px 50px rgba(9, 30, 65, .09); }
.login-card .login-logo { display: block; width: auto; height: 30px; margin: 0 auto 26px; }
.login-card h1 { font-size: 36px; }
.google-button { display: block; margin-top: 28px; text-decoration: none; }
.admin-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.4fr); gap: 22px; }
.panel { padding: 24px; }
.provision { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #536074; font-size: 13px; font-weight: 700; }
input, select { width: 100%; border: 1px solid #cfd6df; border-radius: 9px; padding: 11px 12px; background: white; color: var(--ink); font: inherit; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 0; border-top: 1px solid #edf0f4; }
.user-row:first-child { border-top: 0; padding-top: 0; }
.user-row small { display: block; color: var(--muted); text-transform: capitalize; }
.danger { padding: 7px 10px; background: #fff0ef; color: var(--danger); }
.audit { margin-top: 22px; }
.notice { margin: -8px 0 20px; padding: 12px 16px; border: 1px solid #f1d49a; border-radius: 10px; background: #fff9e9; color: #805b13; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .topbar { padding: 0 20px; }
  nav span { display: none; }
  main { width: min(100% - 24px, 1180px); padding-top: 34px; }
  .hero { align-items: start; flex-direction: column; }
  .refresh { width: 100%; }
  .admin-grid { grid-template-columns: 1fr; }
  .table-tools { align-items: stretch; flex-wrap: wrap; }
  .system-search { flex-basis: 100%; max-width: none; }
  .status-filter { flex: 1 1 160px; }
  .system-count { align-self: end; margin-bottom: 9px; }
  td, th { padding: 14px; }
}
.connect-alternate { margin-right: 8px; padding: 10px 12px; line-height: 22.5px; background: transparent; color: var(--navy); box-shadow: inset 0 0 0 1px #cfd6df; font-size: 13px; }
.connect-alternate:hover { background: #f1f4f7; }
nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 6px; }
nav a:not([aria-current]) { text-decoration: none; }
.admin-tabs { display: flex; gap: 8px; margin: -8px 0 22px; }
.admin-tabs a { padding: 8px 14px; border-radius: 999px; color: var(--navy); font-size: 14px; font-weight: 700; text-decoration: none; box-shadow: inset 0 0 0 1px #cfd6df; }
.admin-tabs a[aria-current="page"] { background: var(--navy); color: white; box-shadow: none; }
.utility-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.utility-form input { width: 220px; padding: 7px 10px; }
.utility-form .primary { padding: 7px 14px; }
.secondary { padding: 7px 10px; background: #eef1f5; color: var(--ink); }
.secondary:hover { background: #e2e7ee; }
.empty a { color: var(--navy); font-weight: 700; }
.station-label { color: #d8e2f4; font-weight: 700; }
.code-panel { margin-bottom: 22px; border-color: #dcc9a3; background: var(--gold-soft); }
.code-panel h2 { margin-bottom: 8px; }
.code-panel p { margin: 8px 0 0; color: var(--muted); }
.enroll-code code { display: inline-block; padding: 8px 14px; font-size: 26px; font-weight: 700; letter-spacing: .08em; }
.enroll-form { display: grid; gap: 14px; margin-top: 24px; text-align: left; }
.enroll-form input { font: 18px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
.login-card .enroll-address { margin-top: 18px; font-size: 13px; }
.form-notice { margin: 18px 0 0; text-align: left; }
.station-meta { text-transform: none !important; }
.station-actions { display: flex; gap: 6px; margin: 0; }
.settings-panel { max-width: 560px; }
.field-hint { margin: -8px 0 0; }
.checkbox-label { display: flex; align-items: center; gap: 9px; }
.checkbox-label input { width: auto; }
.form-actions { display: flex; align-items: center; gap: 16px; }
.form-actions a { color: var(--navy); font-weight: 700; }
.station-warning { display: block; margin-top: 4px; color: #805b13; font-size: 12px; }
.credential-row { border-top: 1px solid #edf0f4; padding: 13px 0; }
.credential-row:first-child { border-top: 0; padding-top: 0; }
.credential-row summary { cursor: pointer; list-style: none; }
.credential-row summary::-webkit-details-marker { display: none; }
.credential-row summary small { display: block; color: var(--muted); }
.credential-edit { max-width: 480px; margin-top: 14px; }
/* All Devices: two-line device cell, inline settings. */
.device-table td { padding-top: 14px; padding-bottom: 14px; }
.device-table th { white-space: nowrap; }
.device-cell { width: 100%; white-space: normal; }
.device-name { display: flex; align-items: center; gap: 9px; }
.device-name .platform-icon { flex: none; width: 18px; height: 18px; }
.platform-icon.none { display: inline-block; }
.device-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 0 27px; color: var(--muted); font-size: 12px; }
.vnc-unseen { color: #9a6a12; }
.port-detail { color: var(--muted); }
.port-stale { color: #9a6a12; }
.port-speed { font-weight: 800; }
.port-speed.fast { color: #147354; }
.port-speed.gigabit { color: var(--navy); }
.port-speed.slow { color: #a3372e; }
.link-action { padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--navy); font: inherit; font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-action:hover { color: var(--navy-2); }
.link-action:disabled { opacity: .5; }
.utility-toggle[aria-pressed="true"] { color: var(--gold-dark); }
.settings-toggle[aria-expanded="true"] { text-decoration-thickness: 2px; text-decoration-color: var(--gold); }
.settings-row td { padding: 0 18px 18px 45px; border-top: 0; background: #fbfcfe; white-space: normal; }
.inline-settings { display: grid; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.inline-settings-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; align-items: start; }
.inline-settings input, .inline-settings select { padding: 8px 10px; }
.utility-fields { display: grid; gap: 10px; }
.field-help { color: var(--muted); font-size: 11px; font-weight: 500; }
.field-help a { color: var(--navy); }
.edit-note { align-self: center; margin: 0; }
.inline-settings-actions { display: flex; align-items: center; gap: 10px; }
.inline-settings-actions .primary, .inline-settings-actions .secondary { padding: 8px 14px; }
.inline-settings-status { color: var(--muted); font-size: 12px; }
.settings-panel .field-help { margin-top: -2px; }

/* Walk-up stations: summary above, controls below. */
.station-list { display: grid; }
.station-row { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid #edf0f4; }
.station-row:first-child { padding-top: 0; border-top: 0; }
.station-summary small { display: block; }
.station-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.station-actions button { padding: 6px 11px; font-size: 13px; white-space: nowrap; }
.switch { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { position: relative; flex: none; width: 36px; height: 20px; border-radius: 999px; background: #cfd6df; transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked + .switch-track { background: #1aa476; }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--gold); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .5; }
.switch-state { color: var(--muted); font-weight: 600; }
