/* Gerência VPN — visual do FiberOn ERP (design system "workspace").
   Tokens copiados de erp-fiberon/frontend-admin/src/design-system/css/tokens.css
   + camada de vidro do workspace.css; os nomes antigos do painel (--label,
   --fill, --green...) viram apelidos desses tokens, então todas as telas
   herdam o visual sem reescrever cada componente. */

@font-face { font-family: Urbanist; src: url('/assets/fonts/Urbanist-variable.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; }

/* ---- tokens do ERP ---- */
:root,
[data-ds-theme="light"] {
  color-scheme: light;
  --bg-rgb: 233 236 231;
  --surface-rgb: 255 255 255;
  --surface-raised-rgb: 250 251 248;
  --line-rgb: 193 198 189;
  --line-strong-rgb: 142 151 140;
  --text-rgb: 19 23 26;
  --text-muted-rgb: 51 57 54;
  --text-faint-rgb: 76 83 77;
  --accent-rgb: 73 99 16;
  --accent-hover-rgb: 60 86 21;
  --positive-rgb: 34 197 94;        
  --negative-rgb: 239 68 68;        
  --warning-rgb: 245 158 11;        
  --info-rgb: 14 165 233;           
  --accent-ink-rgb: 56 83 20;
  --positive-ink-rgb: 21 128 61;    
  --negative-ink-rgb: 220 38 38;    
  --warning-ink-rgb: 180 83 9;      
  --info-ink-rgb: 3 105 161;        
  --neutral-ink-rgb: 71 85 105;     
  --tint-alpha: 0.12;               
  --shadow-card: 0 1px 2px rgb(15 23 42 / 0.04), 0 8px 24px rgb(15 23 42 / 0.06);
  --shadow-card-hover: 0 2px 4px rgb(15 23 42 / 0.05), 0 12px 32px rgb(15 23 42 / 0.10);
  --shadow-float: 0 4px 6px -2px rgb(15 23 42 / 0.06), 0 20px 48px -6px rgb(15 23 42 / 0.20);
  --card-border: rgb(var(--line-rgb) / 0.7);
  --overlay: rgb(15 23 42 / 0.45);
  --hover-tint: rgb(var(--text-rgb) / 0.035);
  --accent-tint: rgb(var(--accent-rgb) / 0.10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-rgb: 17 21 19;
    --surface-rgb: 20 23 23;
    --surface-raised-rgb: 36 40 37;
    --line-rgb: 65 70 65;
    --line-strong-rgb: 92 106 96;
    --text-rgb: 242 244 240;
    --text-muted-rgb: 203 208 198;
    --text-faint-rgb: 163 173 160;
    --accent-rgb: 196 239 79;
    --accent-hover-rgb: 201 238 129;
    --positive-rgb: 74 222 128;       
    --negative-rgb: 248 113 113;      
    --warning-rgb: 251 191 36;        
    --info-rgb: 56 189 248;           
    --accent-ink-rgb: 201 238 129;
    --positive-ink-rgb: 74 222 128;
    --negative-ink-rgb: 248 113 113;
    --warning-ink-rgb: 251 191 36;
    --info-ink-rgb: 56 189 248;
    --neutral-ink-rgb: 203 213 225;
    --tint-alpha: 0.16;
    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.20), 0 8px 24px rgb(0 0 0 / 0.35);
    --shadow-card-hover: 0 2px 4px rgb(0 0 0 / 0.25), 0 12px 32px rgb(0 0 0 / 0.45);
    --shadow-float: 0 0 0 1px rgb(var(--line-rgb)), 0 20px 48px rgb(0 0 0 / 0.55);
    --card-border: rgb(var(--line-rgb) / 0.8);
    --overlay: rgb(2 6 23 / 0.65);
    --hover-tint: rgb(var(--text-rgb) / 0.045);
    --accent-tint: rgb(var(--accent-rgb) / 0.16);
  }
}
:root[data-theme="dark"],
[data-ds-theme="dark"] {
  color-scheme: dark;
  --bg-rgb: 17 21 19;
  --surface-rgb: 20 23 23;
  --surface-raised-rgb: 36 40 37;
  --line-rgb: 65 70 65;
  --line-strong-rgb: 92 106 96;
  --text-rgb: 242 244 240;
  --text-muted-rgb: 203 208 198;
  --text-faint-rgb: 163 173 160;
  --accent-rgb: 196 239 79;
  --accent-hover-rgb: 201 238 129;
  --positive-rgb: 74 222 128;
  --negative-rgb: 248 113 113;
  --warning-rgb: 251 191 36;
  --info-rgb: 56 189 248;
  --accent-ink-rgb: 201 238 129;
  --positive-ink-rgb: 74 222 128;
  --negative-ink-rgb: 248 113 113;
  --warning-ink-rgb: 251 191 36;
  --info-ink-rgb: 56 189 248;
  --neutral-ink-rgb: 203 213 225;
  --tint-alpha: 0.16;
  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.20), 0 8px 24px rgb(0 0 0 / 0.35);
  --shadow-card-hover: 0 2px 4px rgb(0 0 0 / 0.25), 0 12px 32px rgb(0 0 0 / 0.45);
  --shadow-float: 0 0 0 1px rgb(var(--line-rgb)), 0 20px 48px rgb(0 0 0 / 0.55);
  --card-border: rgb(var(--line-rgb) / 0.8);
  --overlay: rgb(2 6 23 / 0.65);
  --hover-tint: rgb(var(--text-rgb) / 0.045);
  --accent-tint: rgb(var(--accent-rgb) / 0.16);
}
:root,
[data-ds-theme] {
  --bg: rgb(var(--bg-rgb));
  --surface: rgb(var(--surface-rgb));
  --surface-raised: rgb(var(--surface-raised-rgb));
  --line: rgb(var(--line-rgb));
  --line-strong: rgb(var(--line-strong-rgb));
  --text: rgb(var(--text-rgb));
  --text-muted: rgb(var(--text-muted-rgb));
  --text-faint: rgb(var(--text-faint-rgb));
  --accent: rgb(var(--accent-rgb));
  --accent-hover: rgb(var(--accent-hover-rgb));
  --positive: rgb(var(--positive-rgb));
  --negative: rgb(var(--negative-rgb));
  --warning: rgb(var(--warning-rgb));
  --info: rgb(var(--info-rgb));
}
:root {
  --chart-1-rgb: 112 156 51;
  --chart-2-rgb: 66 151 197;
  --chart-3-rgb: 47 161 139;
  --chart-4-rgb: 208 151 67;
  --chart-5-rgb: 202 123 111;
  --chart-6-rgb: 155 128 188;
}
:root {
  --font-sans: 'Urbanist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: var(--font-sans);
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-28: 28px;
  --fs-40: 40px;
  --lh-base: 1.45;
  --lh-tight: 1.2;
  --tracking-label: 0.06em;
  --radius-sm: 12px;  
  --radius: 12px;     
  --radius-lg: 22px;  
  --radius-full: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --gutter: 24px;
  --content-max: 1440px;
  --control-h: 36px;
  --control-h-sm: 30px;
  --row-h: 44px;
  --dur-fast: 150ms;
  --dur: 200ms;
  --ease: ease-out;
}

/* ---- camada de vidro do workspace (ERP) ---- */
:root, [data-ds-theme='light'] {
  --action-fill: #c4ef4f; --action-fill-hover: #d0f578; --action-text: #151b0d;
  --glass-panel: rgb(255 255 255 / .58); --glass-control: rgb(255 255 255 / .46);
  --glass-sidebar: rgb(255 255 255 / .59); --glass-active: rgb(255 255 255 / .92);
  --glass-border: rgb(255 255 255 / .75); --scene-shade: rgb(244 245 239 / .57);
  --glass-solid: rgb(249 250 246 / .98);
  --on-accent: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --glass-panel: rgb(20 23 23 / .64); --glass-control: rgb(20 23 23 / .56);
    --glass-sidebar: rgb(10 15 13 / .72); --glass-active: rgb(255 255 255 / .18);
    --glass-border: rgb(255 255 255 / .14); --scene-shade: rgb(7 11 9 / .57);
    --glass-solid: rgb(30 34 30 / .98);
    --on-accent: #151b0d;
  }
}
:root[data-theme='dark'], [data-ds-theme='dark'] {
  --glass-panel: rgb(20 23 23 / .64); --glass-control: rgb(20 23 23 / .56);
  --glass-sidebar: rgb(10 15 13 / .72); --glass-active: rgb(255 255 255 / .18);
  --glass-border: rgb(255 255 255 / .14); --scene-shade: rgb(7 11 9 / .57);
  --glass-solid: rgb(30 34 30 / .98);
  --on-accent: #151b0d;
}

/* ---- apelidos: nomes antigos do painel -> tokens do ERP ----
   Declarados em :root e em cada escopo de tema para recalcularem com ele. */
:root, :root[data-theme], [data-ds-theme] {
  --surface-secondary: rgb(var(--text-rgb) / .045);
  --surface-tertiary: rgb(var(--text-rgb) / .08);
  --fill: rgb(var(--text-rgb) / .07);
  --fill-strong: rgb(var(--text-rgb) / .12);
  --pressed: var(--hover-tint);
  --material: var(--glass-panel);
  --material-thick: var(--glass-solid);
  --sidebar-bg: var(--glass-sidebar);
  --label: var(--text);
  --label-secondary: var(--text-muted);
  --label-tertiary: var(--text-faint);
  --separator: rgb(var(--line-rgb) / .55);
  --separator-opaque: var(--line);
  --accent-strong: var(--accent-hover);
  --green: rgb(var(--positive-ink-rgb));
  --green-dot: var(--positive);
  --green-tint: rgb(var(--positive-rgb) / var(--tint-alpha));
  --red: rgb(var(--negative-ink-rgb));
  --red-dot: var(--negative);
  --red-tint: rgb(var(--negative-rgb) / var(--tint-alpha));
  --orange: rgb(var(--warning-ink-rgb));
  --orange-dot: var(--warning);
  --orange-tint: rgb(var(--warning-rgb) / var(--tint-alpha));
  --indigo: rgb(var(--info-ink-rgb));
  --indigo-tint: rgb(var(--info-rgb) / var(--tint-alpha));
  --shadow-raised: var(--shadow-float);
  --radius-md: 16px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.8, .2, .8, 0);
  --font-system: var(--font-sans);
  --font-display: var(--font-sans);
}

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--label);
  font-family: var(--font-system);
  font-size: 14px;
  letter-spacing: -.006em;
  line-height: 1.43;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .3s ease, color .3s ease;
}

::selection { background: var(--accent-tint); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

code {
  background: var(--fill);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: .88em;
  letter-spacing: 0;
  padding: 1px 5px;
}

[hidden] { display: none !important; }

.visually-hidden {
  border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute; white-space: nowrap; width: 1px;
}

.muted { color: var(--label-secondary); font-weight: 400; }
.text-danger { color: var(--red); }
.text-warning { color: var(--orange); }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* --------------------------------------------------------------- shell */

.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  background: var(--sidebar-bg);
  border-right: .5px solid var(--separator);
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100vh;
  padding: 18px 12px 14px;
  position: sticky;
  top: 0;
}

.sidebar-brand {
  align-items: center;
  border-radius: var(--radius-md);
  color: var(--label);
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  padding: 6px 8px;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand strong { display: block; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.sidebar-brand small { color: var(--label-secondary); display: block; font-size: 11.5px; }

.brand-glyph {
  align-items: center;
  background: linear-gradient(160deg, #0a84ff, #5e5ce6);
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(10, 132, 255, .35), inset 0 .5px 0 rgba(255, 255, 255, .35);
  color: #fff;
  display: flex;
  flex: none;
  height: 32px;
  justify-content: center;
  width: 32px;
}
.brand-glyph svg { height: 19px; width: 19px; }

.sidebar-nav { display: grid; gap: 1px; }

.nav-item {
  align-items: center;
  border-radius: var(--radius-sm);
  color: var(--label);
  display: flex;
  font-size: 13.5px;
  font-weight: 500;
  gap: 10px;
  min-height: 32px;
  padding: 5px 10px;
  transition: background-color .12s ease;
}
.nav-item:hover { background: var(--pressed); text-decoration: none; }
.nav-item:active { background: var(--fill-strong); }
.nav-item svg { color: var(--accent); flex: none; height: 18px; width: 18px; }
.nav-item.active { background: var(--accent); color: var(--on-accent); }
.nav-item.active svg { color: var(--on-accent); }

.sidebar-spacer { flex: 1; }

.sidebar-footer { display: grid; gap: 10px; }

.appearance-control {
  background: var(--fill);
  border-radius: 9px;
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(3, 1fr);
  padding: 2px;
}
.appearance-control button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--label-secondary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  gap: 3px;
  justify-content: center;
  padding: 6px 2px;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.appearance-control button svg { height: 15px; width: 15px; }
.appearance-control button.active { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); color: var(--label); }
.appearance-control-standalone { position: fixed; right: 20px; top: 18px; z-index: 10; }
.appearance-control-standalone button { padding: 8px; }
.appearance-control-standalone button svg { height: 16px; width: 16px; }

.logout-form { align-items: center; display: flex; gap: 8px; justify-content: space-between; padding: 0 4px 0 8px; }
.user-chip { color: var(--label-secondary); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--label-secondary);
  cursor: pointer;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  transition: background-color .12s ease, transform .1s ease;
  width: 30px;
}
.icon-button:hover { background: var(--pressed); color: var(--label); }
.icon-button:active { transform: scale(.92); }
.icon-button svg { height: 18px; width: 18px; }

.main { min-width: 0; }

.page { margin: 0 auto; max-width: 1180px; padding: 34px 32px 96px; }

.flash-stack { display: grid; gap: 10px; margin-bottom: 18px; }

.alert {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  font-size: 13.5px;
  margin-bottom: 14px;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 11px 14px 11px 40px;
  position: relative;
}
.alert::before {
  border-radius: 50%;
  color: #fff;
  content: "i";
  font-size: 12px;
  font-weight: 700;
  height: 18px;
  left: 13px;
  line-height: 18px;
  position: absolute;
  text-align: center;
  top: 12px;
  width: 18px;
}
.flash-stack .alert { margin: 0; }
.alert.success::before { background: var(--green-dot); content: "✓"; }
.alert.danger::before, .alert.error::before { background: var(--red-dot); content: "!"; }
.alert.warning::before { background: var(--orange-dot); content: "!"; }
.alert a { font-weight: 600; }

/* ------------------------------------------------------------- headers */

.page-header { align-items: flex-end; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 22px; }
.page-header h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.022em;
  line-height: 1.1;
  margin: 0;
}
.page-subtitle { color: var(--label-secondary); font-size: 13.5px; margin: 6px 0 0; max-width: 62ch; }
.router-picker .field { min-width: 180px; }

/* ------------------------------------------------------------- buttons */

.button {
  align-items: center;
  background: var(--fill);
  border: 0;
  border-radius: 8px;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  flex: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 590;
  gap: 6px;
  justify-content: center;
  letter-spacing: -.01em;
  min-height: 32px;
  padding: 6px 14px;
  text-decoration: none;
  transition: background-color .12s ease, transform .1s var(--ease-out), opacity .12s ease;
  white-space: nowrap;
}
.button:hover { background: var(--fill-strong); text-decoration: none; }
.button:active { transform: scale(.97); }
.button.primary { background: var(--accent); color: var(--on-accent); }
.button.primary:hover { background: var(--accent-strong); }
.button.small { border-radius: 7px; font-size: 12.5px; min-height: 28px; padding: 4px 11px; }
.button.large { border-radius: 11px; font-size: 15px; min-height: 44px; padding: 10px 18px; }
.button.destructive { color: var(--red); }
.button:disabled, .button[disabled] { cursor: default; opacity: .4; transform: none; }

summary.button { list-style: none; }
summary.button::-webkit-details-marker { display: none; }

.disclosure-link { color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 500; list-style: none; }
.disclosure-link::-webkit-details-marker { display: none; }
.disclosure-link::before { content: "›"; display: inline-block; margin-right: 6px; transition: transform .2s var(--ease-out); }
details[open] > .disclosure-link::before { transform: rotate(90deg); }

/* -------------------------------------------------------------- fields */

.field {
  appearance: none;
  background: var(--surface);
  border: .5px solid var(--separator-opaque);
  border-radius: 8px;
  box-shadow: inset 0 .5px 1px rgba(0, 0, 0, .04);
  color: var(--label);
  font: inherit;
  font-size: 14px;
  min-height: 34px;
  min-width: 0;
  padding: 6px 10px;
  transition: border-color .12s ease, box-shadow .12s ease;
  width: 100%;
}
.field::placeholder { color: var(--label-tertiary); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 30%, transparent); outline: none; }
.field:disabled { opacity: .5; }
select.field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 4.5 6 2l2.5 2.5M3.5 7.5 6 10l2.5-2.5' fill='none' stroke='%238e8e93' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 12px;
  cursor: pointer;
  padding-right: 28px;
}

.form-field { display: grid; gap: 5px; min-width: 0; }
.form-field > span, .field-label-row label { color: var(--label-secondary); font-size: 12px; font-weight: 500; }

.form-row { align-items: end; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.form-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-top: 16px; }

.inline-form { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.inline-form .field { flex: 1 1 180px; width: auto; }

.footnote { color: var(--label-secondary); font-size: 12.5px; line-height: 1.45; margin: 8px 16px 0; }
.inset-card .footnote, .access-card .footnote, .form-actions .footnote { margin: 0; }

.checkbox { align-items: center; display: flex; font-size: 13px; font-weight: 500; gap: 9px; min-height: 36px; }
.checkbox input { accent-color: var(--accent); height: 16px; margin: 0; width: 16px; }

/* Switch, like UISwitch/NSSwitch; the native checkbox stays for semantics. */
.toggle-list { display: grid; gap: 2px; margin-top: 14px; }
.toggle { align-items: center; cursor: pointer; display: flex; font-size: 13.5px; gap: 12px; min-height: 36px; }
.toggle input {
  appearance: none;
  background: var(--fill-strong);
  border-radius: 999px;
  cursor: pointer;
  flex: none;
  height: 22px;
  margin: 0;
  position: relative;
  transition: background-color .2s ease;
  width: 38px;
}
.toggle input::after {
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 0 0 .5px rgba(0, 0, 0, .04);
  content: "";
  height: 18px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: transform .25s var(--ease-out);
  width: 18px;
}
.toggle input:checked { background: var(--green-dot); }
.toggle input:checked::after { transform: translateX(16px); }

/* ------------------------------------------------------ segmented control */

.segmented {
  background: var(--fill);
  border-radius: 9px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segment { flex: 1 1 0; min-width: max-content; position: relative; }
.segment input { opacity: 0; pointer-events: none; position: absolute; }
.segment > span {
  align-items: center;
  border-radius: 7px;
  color: var(--label);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 500;
  gap: 7px;
  justify-content: center;
  min-height: 30px;
  padding: 5px 12px;
  transition: background-color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.segment > span svg { color: var(--label-secondary); height: 16px; width: 16px; }
.segment > span small { color: var(--label-secondary); font-family: var(--font-mono); font-size: 11px; }
.segment > span:active { background: var(--pressed); }
.segment input:checked + span { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); font-weight: 600; }
.segment input:checked + span svg { color: var(--accent); }
.segment input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); }

/* -------------------------------------------------------- access card */

.access-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 14px;
  margin-bottom: 26px;
  padding: 16px;
}
.access-now { align-items: center; display: flex; gap: 14px; min-width: 0; }
.access-icon {
  align-items: center;
  background: var(--fill);
  border-radius: 12px;
  color: var(--label-secondary);
  display: flex;
  flex: none;
  height: 48px;
  justify-content: center;
  transition: background-color .25s ease, color .25s ease;
  width: 48px;
}
.access-icon svg { height: 26px; width: 26px; }
.access-card.has-selection .access-icon { background: var(--accent); color: var(--on-accent); }
.access-text { display: grid; flex: 1; gap: 1px; min-width: 0; }
.access-label { color: var(--label-secondary); font-size: 12.5px; font-weight: 500; }
.access-target {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.018em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.access-hint { color: var(--label-secondary); font-size: 12.5px; }
.onboarding .access-target { font-size: 18px; }

.detect-hint { background: var(--accent-tint); border-radius: var(--radius-md); display: grid; gap: 10px; padding: 12px; }
.detect-hint-text { font-size: 13.5px; font-weight: 500; margin: 0; }
.detect-hint .chip { background: var(--surface); box-shadow: var(--shadow-card); font-weight: 600; }
.detect-hint .chip:hover { background: var(--accent); color: var(--on-accent); }
.detect-hint-new { display: flex; gap: 8px; }
.detect-hint-new .field { flex: 1; min-height: 30px; }

.field-label-row { align-items: baseline; display: flex; gap: 10px; justify-content: space-between; }
.link-action { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; padding: 0; }
.link-action:hover { text-decoration: underline; }
.link-action:disabled { color: var(--label-secondary); cursor: progress; text-decoration: none; }

/* ------------------------------------------------------ grouped lists */

.list-toolbar {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  margin: 0 -8px 8px;
  padding: 10px 8px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.search-field {
  align-items: center;
  background: var(--fill);
  border-radius: 10px;
  color: var(--label-secondary);
  display: flex;
  gap: 7px;
  padding: 0 10px;
  transition: box-shadow .15s ease;
}
.search-field:focus-within { box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 30%, transparent); }
.search-field svg { flex: none; height: 16px; width: 16px; }
.search-field input {
  background: transparent;
  border: 0;
  color: var(--label);
  font: inherit;
  font-size: 15px;
  min-height: 38px;
  outline: none;
  width: 100%;
}
.search-field input::placeholder { color: var(--label-secondary); }

.list-group { margin-bottom: 26px; }
.list-group.is-filtered-out { display: none; }
.list-header {
  color: var(--label-secondary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -.004em;
  margin: 0 16px 7px;
}
.list-header code { font-size: .92em; }
.list-empty { color: var(--label-secondary); margin: 14px 16px; text-align: center; }

.inset-list {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  list-style: none;
  margin: 0;
  overflow: hidden;
  padding: 0;
}
.inset-list > li { position: relative; }
/* Separators start after the leading icon, as in iOS/macOS lists. */
.inset-list > li + li::before {
  border-top: .5px solid var(--separator);
  content: "";
  left: 44px;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 1;
}
.inset-list > li.plain-row + li::before, .inset-list > li + li.plain-row::before { left: 58px; }
.inset-list > li.user-row + li.user-row::before { left: 16px; }

.inset-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 16px; }

/* ---------------------------------------------------------- client rows */

.client-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.client-select { min-width: 0; }
.client-hit {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--label);
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 12px;
  min-height: 56px;
  padding: 9px 6px 9px 16px;
  text-align: left;
  transition: background-color .15s ease;
  width: 100%;
}
.client-hit:hover { background: var(--pressed); }
/* Feedback on press, not on release. */
.client-hit:active { background: var(--fill-strong); transition-duration: 0s; }
.client-hit:disabled { cursor: default; }
.client-hit:disabled:hover { background: transparent; }

.client-status { background: var(--label-tertiary); border-radius: 50%; flex: none; height: 10px; width: 10px; }
.client-status.is-up { background: var(--green-dot); box-shadow: 0 0 0 3px var(--green-tint); }
.client-status.is-degraded { background: var(--orange-dot); box-shadow: 0 0 0 3px var(--orange-tint); }
.client-status.is-off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--label-tertiary); }

.client-text { display: grid; flex: 1; gap: 1px; min-width: 0; }
.client-name { font-size: 14.5px; font-weight: 590; letter-spacing: -.012em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-sub { color: var(--label-secondary); font-size: 12.5px; overflow: hidden; overflow-wrap: anywhere; text-overflow: ellipsis; }
.client-row .client-sub { white-space: nowrap; }

.tag {
  background: var(--fill);
  border-radius: 999px;
  color: var(--label-secondary);
  flex: none;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
}
.tag-people { background: var(--indigo-tint); color: var(--indigo); }

.client-check { color: var(--accent); display: flex; flex: none; height: 20px; opacity: 0; transform: scale(.6); transition: opacity .18s ease, transform .3s var(--ease-out); width: 20px; }
.client-check svg { height: 20px; stroke-width: 2.4; width: 20px; }
.client-row.is-current .client-check { opacity: 1; transform: scale(1); }
.client-row.is-current .client-name { color: var(--accent); }

.spinner {
  animation: spin .8s linear infinite;
  border: 2px solid var(--fill-strong);
  border-radius: 50%;
  border-top-color: var(--accent);
  display: none;
  flex: none;
  height: 18px;
  width: 18px;
}
.client-row.is-pending .spinner { display: block; }
.client-row.is-pending .client-check { display: none; }
body.is-busy .client-hit { cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }

.client-more {
  align-items: center;
  align-self: stretch;
  background: transparent;
  border: 0;
  color: var(--label-tertiary);
  cursor: pointer;
  display: flex;
  justify-content: center;
  padding: 0 14px 0 8px;
  transition: color .12s ease;
}
.client-more:hover { color: var(--label-secondary); }
.client-more svg { height: 16px; stroke-width: 2.2; transition: transform .25s var(--ease-out); width: 16px; }
.client-more[aria-expanded="true"] svg { transform: rotate(90deg); }

.client-detail {
  animation: reveal .25s var(--ease-out);
  border-top: .5px solid var(--separator);
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  margin-left: 44px;
  padding: 12px 16px 14px 0;
}
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }

.detail-list { display: grid; gap: 6px; margin: 0; }
.detail-list > div { display: grid; gap: 2px 12px; grid-template-columns: minmax(140px, 220px) 1fr; }
.detail-list dt { align-items: center; display: flex; font-size: 13px; font-weight: 500; gap: 8px; min-width: 0; }
.detail-list dd { color: var(--label-secondary); font-size: 13px; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dot { background: var(--label-tertiary); border-radius: 50%; flex: none; height: 7px; width: 7px; }
.dot.on { background: var(--green-dot); }
.dot.off { background: var(--red-dot); }

.ping-form { display: flex; gap: 8px; max-width: 420px; }

.inset-list.is-muted .client-name { color: var(--label-secondary); }

/* ------------------------------------------------------- plain/user rows */

.plain-row { align-items: center; display: flex; gap: 12px; min-height: 56px; padding: 9px 12px 9px 16px; }
.row-icon {
  align-items: center;
  background: var(--fill);
  border-radius: 8px;
  color: var(--accent);
  display: flex;
  flex: none;
  height: 30px;
  justify-content: center;
  width: 30px;
}
.row-icon svg { height: 18px; width: 18px; }
.plain-row form { flex: none; }

.user-row { display: grid; gap: 10px; padding: 12px 16px; }
.user-main { align-items: center; display: flex; gap: 12px; min-width: 0; }
.user-main > form { flex: none; }
.avatar {
  align-items: center;
  background: linear-gradient(160deg, #a1a1a6, #7c7c80);
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex: none;
  font-size: 13px;
  font-weight: 600;
  height: 32px;
  justify-content: center;
  width: 32px;
}
.user-row .client-status { margin: 0 11px; }

.row-menu { flex: none; position: relative; }
.row-menu.wide { flex: 1 1 100%; }
.row-menu-body { display: grid; gap: 12px; padding-top: 12px; }
.user-main .row-menu[open] { flex-basis: 100%; }
.user-main:has(.row-menu[open]) { flex-wrap: wrap; }

.chip-row { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; }
.user-row .chip-row { padding-left: 44px; }
.chip {
  align-items: center;
  background: var(--fill);
  border: 0;
  border-radius: 999px;
  color: var(--label);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 12.5px;
  gap: 4px;
  min-height: 28px;
  padding: 3px 11px;
  transition: background-color .12s ease, transform .1s ease;
}
.chip:hover { background: var(--fill-strong); }
.chip:active { transform: scale(.97); }
.chip.active { background: var(--accent); color: var(--on-accent); }
.chip code { background: transparent; padding: 0; }
.chip-removable { cursor: default; padding-right: 4px; }
.chip-removable button {
  align-items: center;
  background: var(--fill-strong);
  border: 0;
  border-radius: 50%;
  color: var(--label-secondary);
  cursor: pointer;
  display: flex;
  font-size: 14px;
  height: 20px;
  justify-content: center;
  line-height: 1;
  width: 20px;
}
.chip-removable button:hover { background: var(--red-dot); color: #fff; }
.chip-add { align-items: center; display: inline-flex; gap: 6px; }
.chip-add .field { border-radius: 999px; min-height: 28px; padding: 3px 12px; width: 170px; }

.device-form .segmented { margin-bottom: 14px; max-width: 360px; }
.device-form .chip-row { margin-top: 10px; }

/* --------------------------------------------------------------- tables */

.table-shell { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); margin-bottom: 26px; max-width: 100%; overflow-x: auto; }
table { border-collapse: collapse; font-size: 13px; width: 100%; }
th { color: var(--label-secondary); font-size: 12px; font-weight: 500; padding: 10px 14px; text-align: left; white-space: nowrap; }
td { border-top: .5px solid var(--separator); padding: 10px 14px; vertical-align: top; }
tbody tr:hover td { background: var(--pressed); }
tr.is-disabled td { color: var(--label-tertiary); }

.status-label { border-radius: 999px; display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; white-space: nowrap; }
.status-label.success { background: var(--green-tint); color: var(--green); }
.status-label.error, .status-label.danger { background: var(--red-tint); color: var(--red); }
.status-label.warning, .status-label.pending { background: var(--orange-tint); color: var(--orange); }

.empty-state { display: grid; gap: 10px; justify-items: center; padding: 80px 20px; text-align: center; }
.empty-state h1 { font-family: var(--font-display); font-size: 26px; letter-spacing: -.02em; margin: 0; }
.empty-state p { color: var(--label-secondary); margin: 0; }

/* ---------------------------------------------------------------- toast */

.toast {
  align-items: center;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  background: var(--material-thick);
  border-radius: 14px;
  bottom: 24px;
  box-shadow: var(--shadow-raised);
  display: flex;
  gap: 10px;
  left: 50%;
  max-width: min(560px, calc(100vw - 32px));
  min-height: 48px;
  opacity: 0;
  padding: 8px 8px 8px 14px;
  position: fixed;
  transform: translate(-50%, 16px) scale(.96);
  transition: opacity .2s ease, transform .35s var(--ease-out);
  z-index: 50;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast-icon { background: var(--green-dot); border-radius: 50%; flex: none; height: 8px; width: 8px; }
.toast[data-kind="error"] .toast-icon { background: var(--red-dot); }
.toast[data-kind="neutral"] .toast-icon { background: var(--label-tertiary); }
.toast-message { flex: 1; font-size: 13.5px; font-weight: 500; min-width: 0; padding: 4px 0; }
.toast-action {
  background: var(--fill);
  border: 0;
  border-radius: 8px;
  color: var(--accent);
  cursor: pointer;
  flex: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  min-height: 32px;
  padding: 4px 12px;
}
.toast-action:hover { background: var(--fill-strong); }
.toast:not(:has(.toast-action:not([hidden]))) { padding-right: 16px; }

@media (min-width: 861px) {
  .authenticated-page .toast { left: calc(50% + 124px); }
}

/* --------------------------------------------------------------- dialog */

.confirm-dialog {
  background: var(--material-thick);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow-raised);
  color: var(--label);
  max-width: min(360px, calc(100vw - 32px));
  padding: 22px 18px 16px;
  text-align: center;
}
.confirm-dialog[open] { animation: dialog-in .28s var(--ease-out); }
.confirm-dialog::backdrop { background: rgba(0, 0, 0, .28); }
@keyframes dialog-in { from { opacity: 0; transform: scale(1.06); } }
.confirm-title { font-size: 15px; font-weight: 650; letter-spacing: -.012em; margin: 0 0 6px; }
.confirm-dialog p { font-size: 13.5px; margin: 0 0 18px; }
.confirm-actions { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.confirm-actions .button { min-height: 36px; width: 100%; }

/* ----------------------------------------------------------- responsive */

@media (max-width: 600px) {
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-header h1 { font-size: 28px; }
  .nav-item svg { display: none; }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .detail-list > div { grid-template-columns: 1fr; }
  .client-detail { margin-left: 16px; }
  .tag-people { display: none; }
  .access-target { font-size: 20px; }
  .user-row .chip-row { padding-left: 0; }
  .ping-form { max-width: none; }
}

/* ------------------------------------------------ wide layouts / columns */

.dashboard { display: grid; gap: 0 28px; }
.columns { display: grid; gap: 0 28px; }
/* One column: the client list comes right after "my access"; the
   secondary panels (who is connected, general selector) go last. */
@media (max-width: 1179px) {
  .dashboard { display: flex; flex-direction: column; }
  .dash-side { display: contents; }
  .dash-main { order: 1; }
  .dash-side > .list-group { order: 2; }
}
@media (min-width: 1180px) {
  .dashboard { align-items: start; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); }
  .dash-side { max-height: calc(100vh - 40px); overflow-y: auto; position: sticky; scrollbar-width: none; top: 20px; }
  .dash-side::-webkit-scrollbar { display: none; }
  .dash-main .list-toolbar { padding-top: 0; }
  .columns { align-items: start; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
}
@media (min-width: 1500px) {
  html.sidebar-hidden .page, .page { max-width: 1320px; }
}

/* Devices: vertical list reads better than a crowded segmented control. */
.device-list { display: grid; gap: 4px; }
.device-option { cursor: pointer; display: block; position: relative; }
.device-option input { opacity: 0; pointer-events: none; position: absolute; }
.device-option-body {
  align-items: center;
  border-radius: var(--radius-md);
  display: flex;
  gap: 10px;
  min-height: 44px;
  padding: 6px 10px;
  transition: background-color .15s ease;
}
.device-option-body:hover { background: var(--pressed); }
.device-option-body:active { background: var(--fill-strong); transition-duration: 0s; }
.device-option-body > svg { color: var(--label-secondary); flex: none; height: 20px; width: 20px; }
.device-option-text { display: grid; flex: 1; min-width: 0; }
.device-option-text strong { font-size: 13.5px; font-weight: 590; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-option-text small { color: var(--label-secondary); font-family: var(--font-mono); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-option-state { color: var(--accent); flex: none; font-size: 12px; font-weight: 600; }
.device-option input:checked + .device-option-body { background: var(--accent-tint); }
.device-option input:checked + .device-option-body > svg { color: var(--accent); }
.device-option input:focus-visible + .device-option-body { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.device-addresses { font-family: var(--font-mono); font-size: 11.5px; margin: 0; }
.manual-add { display: grid; gap: 8px; }
.manual-add[open] > summary { margin-bottom: 8px; }
.manual-add .footnote { margin: 6px 0 0; }

.address-list { display: grid; gap: 2px; list-style: none; margin: 0; padding: 0 0 0 44px; }
.address-list li { align-items: center; display: flex; flex-wrap: wrap; font-size: 13px; gap: 4px 10px; min-height: 30px; }
.address-list form { margin-left: auto; }
.link-action.destructive { color: var(--red); }

.nav-list a { align-items: center; color: var(--label); display: flex; gap: 12px; min-height: 48px; padding: 0 16px; }
.nav-list a:hover { background: var(--pressed); text-decoration: none; }
.nav-list a::after { color: var(--label-tertiary); content: "›"; font-size: 20px; margin-left: auto; }
.nav-list svg { color: var(--accent); height: 20px; width: 20px; }
.appearance-inline { max-width: 360px; }
.button.wide { width: 100%; }
.footnote.center { margin-top: 10px; text-align: center; }
.lan-field { margin-top: 14px; }
.lan-field .footnote { margin: 2px 0 0; }
.mobile-only { display: none; }

/* ------------------------------------------------------- sidebar hiding */

.sidebar-top { align-items: center; display: flex; gap: 4px; margin-bottom: 14px; }
.sidebar-top .sidebar-brand { flex: 1; margin: 0; min-width: 0; }
.sidebar-close { flex: none; }
.sidebar-open {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: var(--material);
  box-shadow: var(--shadow-card);
  display: none;
  height: 34px;
  left: 14px;
  position: fixed;
  top: 14px;
  width: 34px;
  z-index: 30;
}
html.sidebar-hidden .shell { grid-template-columns: minmax(0, 1fr); }
html.sidebar-hidden .sidebar { display: none; }
html.sidebar-hidden .sidebar-open { display: inline-flex; }
html.sidebar-hidden .page { padding-left: 64px; padding-right: 64px; }
html.sidebar-hidden .authenticated-page .toast { left: 50%; }

/* ------------------------------------------------------ Google sign-in */

.login-divider { align-items: center; color: rgba(235, 235, 245, .45); display: flex; font-size: 12px; gap: 12px; width: 100%; }
.login-divider::before, .login-divider::after { border-top: 1px solid rgba(255, 255, 255, .12); content: ""; flex: 1; }
.google-button {
  align-items: center;
  background: #fff;
  border-radius: 11px;
  color: #1f1f1f;
  display: flex;
  font-size: 15px;
  font-weight: 600;
  gap: 10px;
  justify-content: center;
  min-height: 44px;
  transition: transform .1s var(--ease-out), background-color .12s ease;
  width: 100%;
}
.google-button:hover { background: #f2f2f2; text-decoration: none; }
.google-button:active { transform: scale(.98); }
.google-button svg { height: 18px; width: 18px; }

/* ------------------------------------------------------ phone: tab bar */

.tabbar { display: none; }

@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar, html.sidebar-hidden .sidebar, .sidebar-open, html.sidebar-hidden .sidebar-open { display: none; }
  html.sidebar-hidden .page, .page { padding: calc(18px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-left)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right)); }
  .mobile-only { display: block; }
  .tabbar {
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    background: var(--material-thick);
    border-top: .5px solid var(--separator);
    bottom: 0;
    display: flex;
    left: 0;
    padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    position: fixed;
    right: 0;
    z-index: 40;
  }
  .tab-item {
    align-items: center;
    border-radius: 10px;
    color: var(--label-secondary);
    display: flex;
    flex: 1;
    flex-direction: column;
    font-size: 10.5px;
    font-weight: 600;
    gap: 3px;
    justify-content: center;
    min-height: 48px;
    transition: color .12s ease, transform .1s ease;
  }
  .tab-item:hover { text-decoration: none; }
  .tab-item:active { transform: scale(.94); }
  .tab-item svg { height: 24px; width: 24px; }
  .tab-item.active { color: var(--accent); }
  .authenticated-page .toast, html.sidebar-hidden .authenticated-page .toast { bottom: calc(76px + env(safe-area-inset-bottom)); left: 50%; }
  .list-toolbar { top: 0; }
  .page-header h1 { font-size: 30px; }
  .router-picker { width: 100%; }
  .router-picker .field { min-height: 40px; width: 100%; }
  .client-hit { min-height: 60px; }
  .field { font-size: 16px; min-height: 40px; } /* 16px: iOS does not zoom on focus */
  .search-field input { font-size: 16px; }
  .address-list { padding-left: 0; }
}

/* --------------------------------------------------------- accessibility */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .toast, .client-check, .client-more svg, .toggle input::after { transition: opacity .15s ease !important; }
  .toast, .toast.is-visible { transform: translate(-50%, 0); }
  .button:active, .chip:active, .icon-button:active { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .sidebar, .toast, .confirm-dialog, .list-toolbar, .tabbar, .sidebar-open { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabbar, .sidebar-open { background: var(--surface); }
  .sidebar { background: var(--surface-secondary); }
  .toast, .confirm-dialog { background: var(--surface); }
  .list-toolbar { background: var(--bg); }
}

@media (prefers-contrast: more) {
  :root { --separator: rgba(60, 60, 67, .5); --label-secondary: rgba(60, 60, 67, .85); }
  .inset-list, .inset-card, .access-card, .table-shell { box-shadow: 0 0 0 1px var(--separator-opaque); }
}

/* ---------- login ---------- */

.login-shell {
  align-items: center;
  display: grid;
  min-height: 100vh;
  place-items: center;
  width: 100%;
}

.login-topbar {
  align-items: center;
  display: flex;
  left: 0;
  padding: 18px 22px;
  position: fixed;
  top: 0;
  width: 100%;
}

.login-wordmark {
  align-items: center;
  color: var(--label);
  display: inline-flex;
  font-size: 15px;
  font-weight: 650;
  gap: 8px;
}

.login-wordmark svg {
  height: 18px;
  opacity: .85;
  width: 18px;
}

.login-card {
  background: rgba(30, 30, 32, .97);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .4);
  color: #f5f5f7;
  display: grid;
  gap: 20px;
  justify-items: center;
  max-width: 440px;
  padding: 52px 40px 40px;
  text-align: center;
  width: 100%;
}

.login-ring {
  align-items: center;
  display: flex;
  height: 140px;
  justify-content: center;
  margin-bottom: 8px;
  position: relative;
  width: 140px;
}

.login-ring-dots {
  animation: login-ring-spin 26s linear infinite;
  inset: 0;
  position: absolute;
}

@media (prefers-reduced-motion: reduce) {
  .login-ring-dots {
    animation: none;
  }
}

@keyframes login-ring-spin {
  to {
    transform: rotate(360deg);
  }
}

.login-ring-dot {
  background: var(--accent);
  border-radius: 999px;
  height: 9px;
  left: 50%;
  margin: -4.5px 0 0 -4.5px;
  position: absolute;
  top: 50%;
  width: 9px;
}

.login-ring-dot:nth-child(1)  { transform: rotate(0deg)   translateY(-62px); background: #ff3b30; }
.login-ring-dot:nth-child(2)  { transform: rotate(30deg)  translateY(-62px); background: #ff9500; }
.login-ring-dot:nth-child(3)  { transform: rotate(60deg)  translateY(-62px); background: #ffcc00; }
.login-ring-dot:nth-child(4)  { transform: rotate(90deg)  translateY(-62px); background: #34c759; }
.login-ring-dot:nth-child(5)  { transform: rotate(120deg) translateY(-62px); background: #00c7be; }
.login-ring-dot:nth-child(6)  { transform: rotate(150deg) translateY(-62px); background: #32ade6; }
.login-ring-dot:nth-child(7)  { transform: rotate(180deg) translateY(-62px); background: #007aff; }
.login-ring-dot:nth-child(8)  { transform: rotate(210deg) translateY(-62px); background: #5856d6; }
.login-ring-dot:nth-child(9)  { transform: rotate(240deg) translateY(-62px); background: #af52de; }
.login-ring-dot:nth-child(10) { transform: rotate(270deg) translateY(-62px); background: #ff2d55; }
.login-ring-dot:nth-child(11) { transform: rotate(300deg) translateY(-62px); background: #ff6482; }
.login-ring-dot:nth-child(12) { transform: rotate(330deg) translateY(-62px); background: #ff8a3d; }

.login-glyph {
  align-items: center;
  background: linear-gradient(160deg, var(--accent), var(--indigo));
  border-radius: 24px;
  box-shadow: 0 10px 26px rgba(0, 113, 227, .38);
  color: #fff;
  display: flex;
  height: 88px;
  justify-content: center;
  position: relative;
  width: 88px;
  z-index: 1;
}

.login-glyph svg {
  height: 42px;
  width: 42px;
}

.login-card h1 {
  font-size: 25px;
  font-weight: 650;
  margin: 0;
}

.login-card > p {
  color: rgba(235, 235, 245, .6);
  font-size: 14px;
  margin: -10px 0 0;
}

.login-card form {
  display: grid;
  gap: 16px;
  text-align: left;
  width: 100%;
}

.field-group {
  background: rgba(255, 255, 255, .08);
  border-radius: 12px;
  overflow: hidden;
}

.floating-field {
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  display: grid;
  gap: 2px;
  padding: 10px 16px;
}

.floating-field:last-child {
  border-bottom: 0;
}

.floating-field span {
  color: rgba(235, 235, 245, .5);
  font-size: 11.5px;
  font-weight: 500;
}

.floating-field input {
  background: transparent;
  border: 0;
  color: #f5f5f7;
  font-size: 15px;
  min-height: 24px;
  padding: 0;
  width: 100%;
}

.floating-field input:focus {
  outline: none;
}

.login-remember {
  color: rgba(235, 235, 245, .75);
}

.login-card .alert {
  background: rgba(255, 159, 10, .16);
  border-left-color: #ff9f0a;
  color: #ffb340;
  text-align: left;
}

.login-card .alert code {
  background: rgba(255, 255, 255, .12);
  color: #f5f5f7;
}

.login-card .primary {
  min-height: 44px;
  width: 100%;
}
.auth-page .shell { display: block; min-height: 100svh; }
.auth-page .page { max-width: none; padding: 0; }
.auth-page .login-shell { min-height: 100svh; padding: 84px 20px 32px; }
.auth-page .login-topbar { padding-right: 150px; }
.auth-page .flash-stack { margin: 0; padding: 76px 16px 0; }
.auth-page .flash-stack + .login-shell { min-height: auto; padding-top: 24px; }
.login-card, .login-card form, .field-group { min-width: 0; }
.login-card .floating-field input { font-size: 16px; }
.floating-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Copy registrations from another MikroTik */
.copy-offer { display: grid; gap: 10px; }
.copy-offer .footnote { margin: 6px 2px 0; }
.chip-add select.field { border-radius: 999px; min-height: 28px; padding: 3px 26px 3px 12px; width: auto; }

/* =====================================================================
   FiberOn workspace — mesma linguagem visual do erp.fiberon.network:
   paisagem ao fundo, sidebar flutuante de vidro, painéis translúcidos,
   botão principal verde-limão, Urbanist em tudo.
   ===================================================================== */

body {
  background: linear-gradient(var(--scene-shade), var(--scene-shade)), url('/assets/workspace-landscape.svg') center / cover fixed, var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  letter-spacing: 0;
}
button, input, select, textarea { font-family: inherit; }
code { background: rgb(var(--text-rgb) / .08); border-radius: 6px; font-family: var(--font-mono); }

/* ---- shell: sidebar flutuante ---- */
.shell { grid-template-columns: 288px minmax(0, 1fr); }
.sidebar {
  background: var(--glass-sidebar);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  height: calc(100vh - 32px);
  margin: 16px 0 16px 16px;
  padding: 12px 12px 14px;
  top: 16px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.sidebar-top { align-items: center; display: flex; gap: 8px; justify-content: space-between; padding: 4px 2px 10px 4px; }
.sidebar-brand { margin: 0; padding: 4px; gap: 11px; }
.sidebar-brand strong { font-size: 19px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; }
.sidebar-brand small { color: var(--text-faint); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; margin-top: 2px; }
.brand-glyph {
  background: var(--action-fill);
  border-radius: 12px 12px 12px 3px;
  box-shadow: none;
  color: var(--action-text);
  font-size: 15px;
  font-weight: 700;
  height: 34px;
  width: 34px;
}
.sidebar-close, .sidebar-open {
  background: var(--glass-control);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  height: 32px;
  width: 32px;
}
.sidebar-section-label {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .1em;
  margin: 10px 12px 6px;
  text-transform: uppercase;
}
.sidebar-nav { gap: 2px; padding: 0 1px; }
.nav-item {
  border-radius: 15px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  gap: 16px;
  min-height: 40px;
  padding: 0 15px;
}
.nav-item svg { color: inherit; height: 18px; width: 18px; }
.nav-item:hover { background: var(--hover-tint); }
.nav-item.active { background: var(--glass-active); color: var(--text); font-weight: 600; }
.nav-item.active svg { color: var(--text); }
.nav-item.active::after {
  background: var(--action-fill);
  border: 1px solid rgb(50 65 22 / .35);
  border-radius: 50%;
  content: '';
  height: 6px;
  margin-left: -6px;
  width: 6px;
}
.sidebar-footer { gap: 8px; padding: 0 2px; }
.appearance-control { background: var(--glass-control); border: 1px solid var(--glass-border); border-radius: 999px; padding: 3px; }
.appearance-control button { border-radius: 999px; color: var(--text-muted); flex-direction: row; font-size: 11.5px; gap: 5px; padding: 6px 4px; }
.appearance-control button svg { height: 14px; width: 14px; }
.appearance-control button.active { background: var(--glass-active); box-shadow: none; color: var(--text); }
.logout-form { border-top: 1px solid var(--line); gap: 10px; padding: 12px 4px 0; }
.user-avatar {
  align-items: center;
  background: var(--glass-active);
  border: 2px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text);
  display: flex;
  flex: none;
  font-size: 12px;
  font-weight: 650;
  height: 34px;
  justify-content: center;
  width: 34px;
}
.user-meta { display: grid; flex: 1; min-width: 0; }
.user-chip { color: var(--text); font-size: 13px; font-weight: 600; }
.user-role { color: var(--text-faint); font-size: 11px; }
.icon-button { border-radius: 50%; color: var(--text-muted); }
.icon-button:hover { background: var(--hover-tint); color: var(--text); }

.page { max-width: 1320px; padding: 26px 28px 96px 22px; }

/* ---- cabeçalho de página ---- */
.page-header { align-items: center; margin-bottom: 22px; }
.page-header h1 {
  font-size: 31px;
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.15;
  text-decoration: underline;
  text-decoration-color: rgb(196 239 79 / .62);
  text-decoration-skip-ink: none;
  text-decoration-thickness: .15em;
  text-underline-offset: -.05em;
}
.page-subtitle { color: var(--text-muted); font-size: 13.5px; }

/* ---- botões (pílula) ---- */
.button {
  background: var(--glass-control);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  min-height: 34px;
  padding: 6px 15px;
}
.button:hover { background: var(--glass-active); }
.button.primary, .button.primary:hover { background: var(--action-fill); border-color: transparent; color: var(--action-text); }
.button.primary:hover { background: var(--action-fill-hover); }
.button.small { border-radius: 999px; font-size: 12px; min-height: 28px; padding: 3px 12px; }
.button.large { border-radius: 999px; }
.button.destructive { border-color: rgb(var(--negative-rgb) / .28); color: var(--red); }
.link-action, .disclosure-link, a { color: var(--accent); }

/* ---- campos ---- */
.field {
  background: var(--glass-control);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: none;
  color: var(--text);
  min-height: 38px;
  padding: 7px 12px;
}
.field:focus { border-color: rgb(var(--accent-rgb) / .6); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .18); }
.search-field { background: var(--glass-control); border: 1px solid var(--glass-border); border-radius: 999px; padding: 0 14px; }
.search-field:focus-within { box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .18); }
.list-toolbar { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.segmented, .toggle input { background: rgb(var(--text-rgb) / .1); }
.segmented { border: 1px solid var(--glass-border); border-radius: 999px; padding: 3px; }
.segment > span { border-radius: 999px; }
.segment input:checked + span { background: var(--glass-active); box-shadow: none; }
.toggle input:checked { background: var(--action-fill); }
.toggle input:checked::after { background: var(--action-text); }

/* ---- painéis de vidro ---- */
.inset-list, .inset-card, .access-card, .alert, .table-shell, .empty-state {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--glass-panel);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: none;
}
.alert { border-radius: 16px; }
.alert.info::before { background: var(--info); }
.list-header { color: var(--text-muted); font-size: 10.5px; font-weight: 650; letter-spacing: .1em; margin: 0 14px 8px; text-transform: uppercase; }
.inset-list > li + li::before { border-top-color: var(--line); border-top-width: 1px; opacity: .6; }

/* ---- cartão "onde estou / o que acesso" ---- */
.access-card { gap: 14px; padding: 18px; }
.access-icon { background: rgb(var(--text-rgb) / .08); border-radius: 16px 16px 16px 5px; color: var(--text-muted); }
.access-card.has-selection .access-icon { background: var(--action-fill); color: var(--action-text); }
.access-target { font-size: 24px; font-weight: 650; letter-spacing: -.03em; }
.access-label, .access-hint { color: var(--text-muted); }
.here-badge {
  align-items: center;
  background: rgb(var(--positive-rgb) / .16);
  border-radius: 999px;
  color: var(--green);
  display: inline-flex;
  font-size: 11.5px;
  font-weight: 600;
  gap: 7px;
  justify-self: start;
  padding: 4px 11px 4px 9px;
}
.here-dot { background: var(--positive); border-radius: 50%; box-shadow: 0 0 0 3px rgb(var(--positive-rgb) / .25); height: 7px; width: 7px; }
.here-elsewhere { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.detect-hint { background: rgb(var(--accent-rgb) / .1); border-radius: 16px; }

/* ---- linhas de cliente ---- */
.client-hit:hover, .client-more:hover { background: var(--hover-tint); }
.client-row.is-current .client-name { font-weight: 650; }
.client-row.is-current .client-check { color: var(--accent); }
.client-status.is-up { background: var(--positive); }
.client-status.is-degraded { background: var(--warning); }
.client-status.is-off { background: rgb(var(--text-rgb) / .25); }
.tag { background: rgb(var(--text-rgb) / .1); border-radius: 999px; color: var(--text); font-size: 11px; font-weight: 550; padding: 3px 10px; }
.tag-people { background: #8bc3ff; color: #112131; }
.chip { background: var(--glass-control); border: 1px solid var(--glass-border); border-radius: 999px; }

/* ---- tabelas, toast, diálogo ---- */
.table-shell { overflow: hidden; }
.toast { background: var(--glass-solid); border: 1px solid var(--glass-border); border-radius: 999px; box-shadow: var(--shadow-float); color: var(--text); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); }
.confirm-dialog { background: var(--glass-solid); border: 1px solid var(--glass-border); border-radius: 22px; box-shadow: var(--shadow-float); color: var(--text); }
.confirm-dialog::backdrop { background: var(--overlay); backdrop-filter: blur(4px); }

/* ---- celular: barra de abas de vidro ---- */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 18px 14px 110px; }
  .tabbar { background: var(--glass-sidebar); border: 1px solid var(--glass-border); border-radius: 26px; margin: 0 10px 10px; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
  .tab-item.active { color: var(--text); }
  .page-header h1 { font-size: 27px; }
}

/* ---- login ---- */
.auth-page .login-card { background: var(--glass-panel); border: 1px solid var(--glass-border); border-radius: 26px; box-shadow: none; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
/* login: o cartão antigo era escuro com texto branco fixo; no vidro claro
   o texto sumia. Tudo passa a seguir os tokens do tema. */
.auth-page .login-card { color: var(--text); }
.auth-page .login-card > p,
.auth-page .floating-field span,
.auth-page .login-remember { color: var(--text-muted); }
.auth-page .field-group { background: var(--glass-control); border: 1px solid var(--glass-border); border-radius: 16px; }
.auth-page .floating-field { border-bottom-color: var(--line); }
.auth-page .floating-field input { color: var(--text); }
.auth-page .floating-field input::placeholder { color: var(--text-faint); }
.auth-page .login-divider { color: var(--text-faint); }
.auth-page .login-divider::before, .auth-page .login-divider::after { border-top-color: var(--line); }
.auth-page .login-glyph { background: var(--action-fill); box-shadow: none; color: var(--action-text); border-radius: 26px 26px 26px 8px; }
.auth-page .login-card .alert { background: rgb(var(--warning-rgb) / .16); color: var(--orange); }
.auth-page .login-card .alert code { background: rgb(var(--text-rgb) / .1); color: var(--text); }
.auth-page .google-button { background: var(--glass-control); border: 1px solid var(--glass-border); color: var(--text); }
.avatar { background: rgb(var(--text-rgb) / .14); color: var(--text); }
