.mfa-qr {
  display: block;
  width: 320px;
  max-width: 100%;
  height: auto;
  margin: 1.25rem auto;
  background: #fff;
  image-rendering: pixelated;
}
.mfa-manual { margin: 1rem 0; }
.mfa-manual summary { cursor: pointer; font-size: 0.875rem; }
:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172536;
  background: #f3f6f9;
  font-size: 16px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --navy: #111c2b;
  --navy-soft: #1b2b3e;
  --teal: #087e87;
  --teal-dark: #06656d;
  --line: #dfe6ec;
  --muted: #647487;
  --surface: #fff;
  --danger: #a33d45;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid #23b4bd; outline-offset: 2px; }
.boot-message { padding: 3rem; color: var(--muted); }
.layout { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { background: var(--navy); color: #f5f8fa; padding: 28px 18px 20px; display: flex; flex-direction: column; gap: 38px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #a8f0ed; background: #0f5b64; font-weight: 750; letter-spacing: -.04em; }
.brand-name { font-weight: 700; letter-spacing: .01em; }
.brand-sub { display: block; margin-top: 3px; color: #aab8c7; font-size: 13px; font-weight: 450; }
.nav-label, .eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: 12px; font-weight: 700; }
.nav-label { color: #8192a5; padding: 0 12px 10px; }
.nav { display: grid; gap: 5px; }
.nav button { border: 0; background: transparent; text-align: left; color: #c5d0da; padding: 12px; border-radius: 8px; font-size: 14px; }
.nav button:hover, .nav button[aria-current="page"] { color: white; background: #22364b; }
.nav button[aria-current="page"] { box-shadow: inset 3px 0 #39c0c1; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #314153; padding: 18px 10px 0; color: #aab8c7; font-size: 13px; line-height: 1.55; }
.main { min-width: 0; }
.topbar { height: 76px; background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 0 clamp(20px, 4vw, 54px); }
.topbar-title { color: #536477; font-size: 14px; }
.user-menu { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.user-role { color: var(--muted); font-size: 13px; }
.content { width: min(1200px, 100%); padding: 34px clamp(20px, 4vw, 54px) 60px; margin: 0 auto; }
h1 { font-size: clamp(25px, 3vw, 31px); letter-spacing: -.035em; margin: 0; color: #142336; }
h2 { font-size: 18px; margin: 0; letter-spacing: -.015em; }
h3 { font-size: 15px; margin: 0; }
p { line-height: 1.55; }
.page-head { display: flex; gap: 20px; justify-content: space-between; align-items: flex-end; margin-bottom: 26px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.page-head p { color: var(--muted); margin: 8px 0 0; max-width: 660px; }
.eyebrow { color: var(--teal); margin: 0 0 9px; }
.button { border: 1px solid #ced8e0; border-radius: 7px; background: #fff; color: #24364a; padding: 9px 14px; min-height: 40px; font-size: 14px; font-weight: 620; }
.button:hover { background: #f6f9fb; }
.button.primary { border-color: var(--teal); color: #fff; background: var(--teal); }
.button.primary:hover { background: var(--teal-dark); }
.button.danger { color: var(--danger); border-color: #e5c8ca; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 7px #10243a08; }
.panel-pad { padding: 22px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); }
.field, .select { border: 1px solid #cbd6df; border-radius: 7px; background: #fff; color: #1b2b3b; min-height: 40px; padding: 8px 11px; }
.search { min-width: min(320px, 100%); flex: 1; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: #68798b; font-size: 12px; text-transform: uppercase; letter-spacing: .065em; font-weight: 700; background: #f9fbfc; }
th, td { padding: 14px 18px; border-bottom: 1px solid #e9eef2; white-space: nowrap; }
td { font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
.device-name { font-weight: 650; color: #192a3c; }
.subtext { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 450; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #8493a2; }
.status.online::before, .status.ready::before { background: #15936c; }
.status.pending::before { background: #d69b32; }
.status.tunnelPending::before { background: #d69b32; }
.status.offline::before { background: #8493a2; }
.empty { text-align: center; padding: 48px 22px; color: var(--muted); }
.empty strong { display: block; color: #24364a; font-size: 16px; margin-bottom: 7px; }
.notice { padding: 12px 14px; border-radius: 7px; background: #edf7f7; color: #215e63; border: 1px solid #cce8e7; font-size: 14px; line-height: 1.5; }
.error { padding: 12px 14px; border-radius: 7px; background: #fff3f2; color: #87373d; border: 1px solid #f0d0ce; font-size: 14px; line-height: 1.5; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-row { display: grid; gap: 7px; }
label { color: #415367; font-size: 14px; font-weight: 600; }
.form-actions { display: flex; gap: 9px; align-items: center; margin-top: 4px; }
.full { grid-column: 1 / -1; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 18px; }
.service { padding: 15px 0; border-top: 1px solid #e9eef2; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.service:first-of-type { margin-top: 14px; }
.service-name { font-weight: 620; }
.code-box { display: block; word-break: break-all; padding: 12px; background: #f2f6f8; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.download-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
a.button { display: inline-flex; align-items: center; text-decoration: none; }
.user-list { display: grid; gap: 10px; }
.user-option { display: flex; align-items: center; gap: 10px; font-weight: 500; padding: 10px; border: 1px solid #e5ebef; border-radius: 7px; }
.user-option input { accent-color: var(--teal); width: 17px; height: 17px; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 55% 0, #e6f2f3, transparent 48%), #f3f6f9; }
.auth-card { width: min(440px, 100%); padding: 32px; }
.auth-card .brand { padding: 0; margin-bottom: 32px; color: #18293b; }
.auth-card h1 { font-size: 25px; }
.auth-card .form-row { margin-top: 17px; }
.auth-card .button.primary { width: 100%; margin-top: 22px; }
.invite-link { display: block; margin-top: 14px; }
.auth-note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.bootstrap-link { margin-top: 20px; }
.auth-back { margin-top: 18px; text-align: center; }
.bootstrap-note { margin: 18px 0; }
.key-label { display: block; margin: 15px 0 7px; }
.action-gap { height: 12px; }
.modal-actions { justify-content: flex-end; margin-top: 20px; }
.link-button { background: none; border: 0; padding: 0; color: var(--teal-dark); text-decoration: underline; font-size: 14px; }
.modal-shade { position: fixed; inset: 0; background: #0b1725a6; display: grid; place-items: center; padding: 18px; z-index: 4; }
.modal { width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 24px; }
.modal h2 { margin-bottom: 8px; }
.audit-list { display: grid; }
.audit-row { display: grid; grid-template-columns: 160px 1fr 1fr; gap: 16px; padding: 15px 2px; border-bottom: 1px solid #e8edf1; font-size: 14px; }
.audit-row:last-child { border: 0; }
.audit-time { color: var(--muted); font-size: 13px; }
.mobile-brand { display: none; }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { gap: 18px; padding: 14px 16px; }
  .brand { display: none; }
  .nav-label, .sidebar-foot { display: none; }
  .nav { display: flex; overflow-x: auto; }
  .nav button { white-space: nowrap; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 12px; }
  .main { min-width: 0; }
  .topbar { height: 60px; }
  .detail-grid, .grid-two { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page-head { align-items: flex-start; flex-direction: column; }
  .head-actions { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .content { padding-top: 24px; }
  .topbar { padding: 0 16px; }
  .user-role, .topbar-title { display: none; }
  .audit-row { grid-template-columns: 1fr; gap: 5px; }
  .auth-card { padding: 25px; }
}
