:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --card: #ffffff;
  --surface-sidebar: #ffffff;
  --surface-hover: #e7f1f0;
  --border: #e6e9f0;
  --text: #1f2430;
  --muted: #7d879a;
  /* Paleta baseada em agraria.com.br: verde-azulado escuro da marca
     (nav/rodapé do site) como primária, com o verde-oliva claro do
     ícone do logo só como toque de destaque (.brand-dot) — ver
     style.css do site, sem reaproveitar a fonte licenciada deles. */
  --primary: #125854;
  --primary-dark: #0c403c;
  --accent: #9bb933;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --navbar-bg: #125854;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Radius scale */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-pill: 999px;

  /* Type scale */
  --text-xs: 0.78rem;
  --text-sm: 0.88rem;
  --text-base: 0.95rem;
  --text-lg: 1.1rem;
  --text-xl: 1.4rem;

  /* Elevation */
  --shadow-card: 0 1px 2px rgba(20, 30, 60, 0.04), 0 2px 8px rgba(20, 30, 60, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Layout: top navbar + sidebar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 60px;
  background: var(--navbar-bg);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  box-shadow: 0 2px 8px rgba(20, 30, 60, 0.12);
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: var(--space-4); }

.topbar .brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--text-lg);
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.topbar .user { font-size: var(--text-sm); color: rgba(255, 255, 255, 0.9); }
.topbar-logout {
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}
.topbar-logout:hover { background: rgba(255, 255, 255, 0.15); }
.topbar-logout .nav-icon { width: 16px; height: 16px; }

.mobile-nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-base);
  cursor: pointer;
}

.app-shell { display: flex; align-items: stretch; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--space-5) 0 var(--space-4);
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
}

.sidebar nav { flex: 1; overflow-y: auto; }

.nav-group { margin-bottom: var(--space-5); padding: 0 var(--space-3); }

.nav-group h3 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0 var(--space-3);
  margin: 0 0 var(--space-2);
}

.nav-group a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: var(--text-base);
}

.nav-icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--muted); }

.nav-group a:hover { background: var(--surface-hover); }

.nav-group a.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.nav-group a.active .nav-icon { color: #fff; }

@media (max-width: 820px) {
  .app-shell { flex-direction: column; }
  .mobile-nav-toggle { display: inline-block; }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: var(--space-3) 0;
    position: static;
    height: auto;
    display: none;
  }
  .sidebar.nav-open { display: flex; }
}

.container { flex: 1; min-width: 0; max-width: 1320px; margin: 0 auto; padding: var(--space-6) var(--space-5); width: 100%; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
  flex-wrap: wrap;
}

h1 { font-size: var(--text-xl); margin: 0 0 var(--space-4); }
h2 { font-size: var(--text-lg); margin: var(--space-6) 0 var(--space-2); }

.hint { color: var(--muted); font-size: var(--text-sm); margin: calc(-1 * var(--space-2)) 0 var(--space-4); }

.raw-log {
  background: #14181f;
  color: #d7dce2;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-xs);
  line-height: 1.5;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.button, button[type="submit"] {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  font-size: var(--text-base);
  display: inline-block;
}

.button:hover, button[type="submit"]:hover { opacity: 0.9; }

.button-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  text-align: center;
}

.login-box .button-secondary { width: 100%; }

.divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--muted);
  font-size: var(--text-sm);
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Shared confirmation dialog (base.html) — replaces native confirm() on
   every destructive form. Native <dialog> handles the backdrop, Esc-to-
   cancel, and focus trapping for free. */
.confirm-modal {
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-5);
  max-width: 380px;
  width: calc(100% - var(--space-6));
  box-shadow: var(--shadow-card);
  color: var(--text);
}
.confirm-modal::backdrop { background: rgba(15, 23, 42, 0.45); }
.confirm-modal p { margin: 0; font-size: var(--text-base); }
.confirm-modal-actions { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-5); }

table.devices {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

table.devices th, table.devices td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-base);
}

table.devices th {
  background: #fafbfc;
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.sort-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.sort-link:hover { color: var(--primary); }
.sort-arrow { font-size: 0.7em; }

table.devices tbody tr:nth-child(even) { background: #fbfcfd; }
table.devices tbody tr:hover { background: var(--surface-hover); }
table.devices tr:last-child td { border-bottom: none; }
table.devices .empty { text-align: center; color: var(--muted); padding: var(--space-6); }

.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
/* Scoped to table-row actions only — .actions is reused by page-header button
   groups (e.g. logs.html), where this color rule out-specificities .button's
   white text and makes primary buttons render as invisible blue-on-blue.
   :not(.icon-btn) so the colored icon-button circles below keep their own
   color instead of being forced blue by this higher-specificity rule. */
td.actions > a:not(.icon-btn) { color: var(--primary); text-decoration: none; }

/* Row-scoped icon action buttons (Editar/Excluir/etc as circular icon
   buttons instead of text links) — mirrors the Abstack table reference.
   `button[type="submit"].icon-btn` (not just `.icon-btn`) so this reliably
   beats the generic `button[type="submit"]` rule above regardless of source
   order — same specificity fix already applied to .link-button: an
   attribute selector + element carries the same weight as two classes, so
   a bare `.icon-btn` class lost and rendered as a solid blue rectangle. */
.icon-btn, button[type="submit"].icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}
.icon-btn .nav-icon { width: 15px; height: 15px; }
.icon-btn-blue,  button[type="submit"].icon-btn-blue  { background: #dcece9; color: var(--primary); }
.icon-btn-green, button[type="submit"].icon-btn-green { background: #e2f6ea; color: var(--success); }
.icon-btn-red,   button[type="submit"].icon-btn-red   { background: #fce7e7; color: var(--danger); }
.icon-btn-amber, button[type="submit"].icon-btn-amber { background: #fdf1de; color: var(--warning); }
.icon-btn:hover { filter: brightness(0.95); }

/* Table row name/title used as a link (e.g. device name -> histórico) —
   styled as normal text with a hover affordance instead of a stray
   underlined blue link sitting inside an otherwise plain cell. */
.row-link { color: var(--text); font-weight: 600; text-decoration: none; }
.row-link:hover { color: var(--primary); text-decoration: underline; }

.count-link { color: var(--primary); text-decoration: none; }
.count-link:hover { text-decoration: underline; }

/* Liberado/Bloqueado toggle switch (Abstack "Active?" pattern) */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; vertical-align: middle; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.switch input:checked + .switch-slider { background: var(--success); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }
.switch input:disabled + .switch-slider { cursor: default; opacity: 0.6; }

.status-cell { display: flex; align-items: center; gap: var(--space-2); flex-wrap: nowrap; white-space: nowrap; }
.lock-badge { display: inline-flex; color: var(--danger); }
.lock-badge .nav-icon { width: 15px; height: 15px; }

.badge {
  display: inline-block;
  white-space: nowrap;
  padding: 0.15rem var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: capitalize;
}

.log-group-count {
  background: var(--surface-hover);
  color: var(--muted);
  margin-left: var(--space-2);
  cursor: help;
  font-size: 0.75rem;
  padding: 1px 6px;
}

.badge-pendente { background: #fef3c7; color: var(--warning); }
.badge-liberado { background: #dcfce7; color: var(--success); }
.badge-bloqueado { background: #fee2e2; color: var(--danger); }
.badge-offline { background: #e5e7eb; color: var(--muted); }
.badge-erro { background: #fef3c7; color: var(--warning); border: 1px solid #fde68a; }
.badge-acl-restrito { background: #dbeafe; color: #1d4ed8; text-transform: none; }

.mac-lookup {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.mac-lookup:hover { color: var(--primary); }

.table-scroll { overflow-x: auto; }
.conn-time { color: var(--muted); font-size: var(--text-xs); margin-top: 2px; }
.motivo-cell { color: var(--muted); font-size: var(--text-xs); }

/* table-layout: fixed makes the <colgroup> widths in logs.html actually
   stick — under the default "auto" layout, a wide cell (ex: MAC in
   monospace) can still force its column wider than the % given. Scoped
   to .logs-table only, other .devices tables keep auto-sizing to content. */
.logs-table { table-layout: fixed; }
.logs-table td { overflow-wrap: break-word; }
.log-date-cell { display: inline-flex; align-items: baseline; gap: var(--space-2); white-space: nowrap; }
.unknown-clients-panel {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.unknown-clients-panel table { background: var(--card); }

.reveal-secret-card {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
}
.reveal-secret-card > p { margin: 0 0 var(--space-3); }
.reveal-secret-card .form-grid { align-items: end; }

.inline { display: inline; }

/* button[type="submit"].link-button (not just .link-button) so this reliably
   beats the button[type="submit"] rule above regardless of source order —
   confirmed live: Bloquear/Excluir/Sair were rendering as solid blue
   buttons instead of plain text links, since [type="submit"] and a bare
   class carry the same specificity weight. */
button[type="submit"].link-button, a.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  cursor: pointer;
  font-size: var(--text-base);
  text-decoration: none;
}

/* Must beat button[type="submit"].link-button's own color (0,2,1) —
   plain .link-success/.link-danger (0,1,0) would otherwise lose. */
button[type="submit"].link-success, a.link-success { color: var(--success); }
button[type="submit"].link-danger, a.link-danger { color: var(--danger); }

.form, .login-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: var(--shadow-card);
}

.login-box { margin: 4rem auto 0; }
.login-box h1 { text-align: center; }
/* .login-box's flex+gap only spaces its direct children (h1, form, divider,
   ...) — the <form> itself has no layout, so its label/label/button stacked
   with no gap, gluing "Entrar" to the password field. */
.login-box form { display: flex; flex-direction: column; gap: var(--space-4); }

label { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); color: var(--muted); }

.required-mark { color: var(--danger); margin-left: 2px; }

/* Wider card + grouped sections for longer forms (Configurações, Novo
   dispositivo) — the plain .form (480px, one field per row) still fits
   every other, shorter form in the app unchanged. */
.form-wide { max-width: 720px; }

/* A .form-section is a plain div, not the flex row .form itself — without
   its own flex+gap, labels/checkbox-row/hints inside it just stacked with
   only their own (often negative, tuned for .form's gap) margins, so
   everything read as glued together. */
.form-section { display: flex; flex-direction: column; gap: var(--space-4); }
.form-section + .form-section { margin-top: var(--space-2); padding-top: var(--space-5); border-top: 1px solid var(--border); }

.form-section-header { display: flex; align-items: center; gap: var(--space-3); }
.form-section-header .nav-icon {
  width: 32px;
  height: 32px;
  padding: 7px;
  box-sizing: content-box;
  border-radius: var(--radius-md);
  background: #dcece9;
  color: var(--primary);
  flex-shrink: 0;
}
.form-section-header h2 { margin: 0; font-size: var(--text-base); }
.form-section-header p { margin: 2px 0 0; color: var(--muted); font-size: var(--text-sm); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.form-grid + .hint { margin-top: var(--space-1); }

details.hint-details { font-size: var(--text-sm); }
details.hint-details summary { color: var(--primary); cursor: pointer; width: fit-content; }
details.hint-details p { color: var(--muted); margin: var(--space-2) 0 0; }

/* Step-by-step wizard (device/antenna forms) — see wizard.js. Degrades
   gracefully with JS off: every .wizard-step-only element (indicator,
   Voltar/Próximo) starts hidden via inline style in the template, but
   nothing depends on the wizard actually running — all .form-section
   blocks stay visible and the plain Salvar/Cancelar row still works. */
.wizard-steps { display: flex; align-items: center; margin-bottom: var(--space-5); }
.wizard-step { display: flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: var(--text-sm); cursor: default; }
.wizard-step.done { cursor: pointer; }
.wizard-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-xs);
  flex-shrink: 0;
  background: var(--card);
}
.wizard-step.active { color: var(--text); font-weight: 600; }
.wizard-step.active .wizard-step-num { border-color: var(--primary); color: var(--primary); }
.wizard-step.done .wizard-step-num { background: var(--primary); border-color: var(--primary); color: #fff; }
.wizard-step-label { white-space: nowrap; }
@media (max-width: 640px) { .wizard-step-label { display: none; } }
.wizard-connector { flex: 1; height: 2px; background: var(--border); margin: 0 var(--space-2); min-width: var(--space-4); }
.wizard-connector.done { background: var(--primary); }

.wizard-nav { display: flex; align-items: center; gap: var(--space-4); }
.wizard-nav .wizard-spacer { flex: 1; }
.wizard-submit-actions { display: flex; align-items: center; gap: var(--space-4); }

input, textarea, select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-family: inherit;
  color: var(--text);
}

/* Checkboxes/radios aren't text fields — the padding/border/radius above
   makes native browsers render them stretched and lopsided instead of a
   plain square. Reset the box model, let the browser draw its own
   control (accent-color just tints it to match the theme). */
input[type="checkbox"], input[type="radio"] {
  padding: 0;
  border: none;
  border-radius: 0;
  width: auto;
  accent-color: var(--primary);
}

input[readonly] { background: #f3f4f6; color: var(--muted); }

.form-actions { display: flex; gap: var(--space-4); align-items: center; }
.form-actions a { color: var(--muted); text-decoration: none; }

.checklist-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.checklist-fieldset legend { padding: 0 var(--space-2); font-size: var(--text-sm); color: var(--muted); }
.checkbox-inline {
  flex-direction: row !important;
  align-items: center;
  gap: var(--space-2) !important;
  font-size: var(--text-base);
  color: var(--text);
}
.checkbox-inline input { width: auto; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); }
.checklist-empresa { margin-top: var(--space-2); }
.checklist-empresa:first-child { margin-top: 0; }
.checklist-setor { font-size: var(--text-xs); color: var(--muted); margin: var(--space-1) 0 var(--space-1) var(--space-2); }
.checklist-local { margin-left: var(--space-4); }

.error {
  background: #fee2e2;
  color: var(--danger);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.success {
  background: #dcfce7;
  color: var(--success);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding: var(--space-3) 0;
  font-size: var(--text-sm);
  color: var(--muted);
}
.pagination-nav a { margin-right: var(--space-3); color: var(--primary); text-decoration: none; }
.pagination-perpage { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.pagination-perpage select { padding: 0.25rem var(--space-2); font-size: var(--text-xs); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-card);
}
.filter-bar label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--muted);
}
.filter-bar input, .filter-bar select { min-width: 140px; }
.filter-bar .filter-actions { display: flex; gap: var(--space-2); align-items: center; }

.bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  background: var(--card);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-card);
}
/* O atributo `hidden` some/mostra a barra via JS (bulk-actions.js) — sem
   isso, `.bulk-toolbar { display: flex }` acima teria a mesma
   especificidade do `[hidden] { display: none }` do navegador e, por vir
   depois na cascata, venceria, deixando a barra visível mesmo escondida. */
.bulk-toolbar[hidden] { display: none; }
.bulk-toolbar .bulk-count { color: var(--muted); font-size: var(--text-sm); margin-right: auto; }

.log-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-card);
}
.log-stats-item { display: flex; flex-direction: column; gap: 2px; }
.log-stats-label { font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.log-stats-value { font-size: var(--text-lg); font-weight: 700; }
.log-stats-link { margin-left: auto; color: var(--primary); text-decoration: none; font-size: var(--text-sm); }
.log-stats-link:hover { text-decoration: underline; }

/* ---------- Dashboard ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-card);
}
.stat-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.stat-card .stat-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1.3; margin-top: var(--space-1); }
.stat-card:hover { box-shadow: 0 2px 4px rgba(20,30,60,0.06), 0 6px 16px rgba(20,30,60,0.1); }

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon .nav-icon { width: 20px; height: 20px; }
.stat-icon-blue   { background: #dcece9; color: var(--primary); }
.stat-icon-green  { background: #e2f6ea; color: var(--success); }
.stat-icon-amber  { background: #fdf1de; color: var(--warning); }
.stat-icon-red    { background: #fce7e7; color: var(--danger); }
.stat-icon-purple { background: #ede6fb; color: #7c3aed; }
.stat-icon-gray   { background: #eef0f4; color: var(--muted); }

.dashboard-section { margin-bottom: var(--space-6); }
.dashboard-section h2 { margin-top: 0; }
.dashboard-section table.devices { margin-bottom: 0; }
