/* =====================================================================================================
   Central Operacional — sistema visual (redesenho 2026-11)
   Tokens únicos para o portal e os módulos. Cores: escala neutra fria (slate) + azul Movistar (#1D5C8A)
   + estados (ok, alerta, erro). Tipo: IBM Plex Sans / Plex Mono. As cores fixas antigas do CSS foram
   convertidas para estas mesmas escalas por tools/design/recolor.py.
   Este arquivo vem por ÚLTIMO no index.html. Os seletores do portal usam #shell, #authGate, #userMenu,
   #modalLayer e #toast para não alcançar nada dentro de um módulo ([data-module-root]).
   ===================================================================================================== */
:root {
  --ds-font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ds-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --ds-n0: #ffffff; --ds-n50: #f8fafc; --ds-n100: #f1f5f9; --ds-n200: #e2e8f0; --ds-n300: #cbd5e1;
  --ds-n400: #94a3b8; --ds-n500: #5a687d; --ds-n600: #475569; --ds-n700: #334155; --ds-n800: #1e293b; --ds-n900: #0f172a;
  --ds-b50: #eef4f9; --ds-b100: #dce9f3; --ds-b200: #bcd4e8; --ds-b300: #8fb6d6; --ds-b500: #2f73a6;
  --ds-b600: #1d5c8a; --ds-b700: #174b71; --ds-b800: #123a58; --ds-b900: #0d2a40;
  --ds-ok: #15803d; --ds-ok-bg: #f0fdf4; --ds-ok-line: #bbf7d0;
  --ds-warn: #b45309; --ds-warn-bg: #fffbeb; --ds-warn-line: #fde68a;
  --ds-danger: #b91c1c; --ds-danger-bg: #fef2f2; --ds-danger-line: #fecaca;

  --ds-bg: var(--ds-n100); --ds-surface: var(--ds-n0); --ds-surface-2: var(--ds-n50);
  --ds-ink: var(--ds-n900); --ds-ink-2: var(--ds-n700); --ds-muted: var(--ds-n500);
  --ds-line: var(--ds-n200); --ds-line-strong: var(--ds-n300);
  --ds-brand: var(--ds-b600); --ds-brand-hover: var(--ds-b700); --ds-brand-soft: var(--ds-b50); --ds-brand-ink: var(--ds-b800);

  --ds-r-sm: 6px; --ds-r: 8px; --ds-r-lg: 12px; --ds-r-xl: 16px;
  --ds-shadow-1: 0 1px 2px rgb(15 23 42 / 5%);
  --ds-shadow-2: 0 4px 14px rgb(15 23 42 / 8%);
  --ds-shadow-3: 0 18px 48px rgb(15 23 42 / 18%);
  --ds-ring: 0 0 0 3px rgb(29 92 138 / 22%);
  --ds-ease: cubic-bezier(.2, .7, .2, 1);

  /* nomes antigos do portal: passam a apontar para os tokens */
  --blue: var(--ds-b600); --blue-dark: var(--ds-b700); --ink: var(--ds-ink); --muted: var(--ds-muted);
  --paper: var(--ds-bg); --surface: var(--ds-surface); --line: var(--ds-line); --accent: var(--ds-b600);
  --font: var(--ds-font); --sidebar: 256px; --topbar: 64px;
}

html { -webkit-text-size-adjust: 100%; }
body { font: 14px/1.5 var(--ds-font); color: var(--ds-ink); background: var(--ds-bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a, button { touch-action: manipulation; }

/* ------------------------------------------------------------------ menu lateral */
#shell .sidebar { padding: 16px 12px 12px; background: var(--ds-surface); border-right: 1px solid var(--ds-line); }
#shell .brand { min-height: 44px; gap: 10px; padding: 0 6px; }
#shell .brand-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; background: var(--ds-brand); font-size: 17px; font-weight: 700; box-shadow: inset 0 -2px 0 rgb(0 0 0 / 15%); }
#shell .brand-name strong { font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--ds-ink); }
#shell .brand-name small { font-size: 12px; color: var(--ds-muted); }
#shell .collapse-button { width: 30px; height: 30px; border-radius: var(--ds-r); color: var(--ds-n500); font-size: 20px; }
#shell .collapse-button:hover { color: var(--ds-brand); background: var(--ds-n100); }
#shell .tenant { min-height: 56px; margin: 18px 0 18px; padding: 10px; background: var(--ds-n50); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); }
#shell .tenant-mark { width: 32px; height: 32px; flex-basis: 32px; border-radius: var(--ds-r); background: var(--ds-b100); color: var(--ds-b700); font-size: 12px; font-weight: 600; }
#shell .tenant strong { font-size: 13px; font-weight: 600; }
#shell .tenant small { font-size: 12px; }
#shell .nav { gap: 2px; }
#shell .nav-section-title { margin: 6px 0 6px; padding: 0 10px; color: var(--ds-n500); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
#shell .nav-section-gap { margin-top: 18px; }
#shell .nav-item { position: relative; min-height: 40px; gap: 11px; padding: 0 10px; color: var(--ds-n600); border-radius: var(--ds-r); font-size: 14px; font-weight: 500; }
#shell .nav-item svg { width: 18px; height: 18px; flex-basis: 18px; color: var(--ds-n400); transition: color .15s var(--ds-ease); }
#shell .nav-item:hover { color: var(--ds-ink); background: var(--ds-n100); }
#shell .nav-item:hover svg { color: var(--ds-n600); }
#shell .nav-item.active { color: var(--ds-b700); background: var(--ds-b50); font-weight: 600; }
#shell .nav-item.active svg { color: var(--ds-brand); }
#shell .nav-item.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ds-brand); }
#shell .nav-item:focus-visible { outline: 2px solid var(--ds-brand); outline-offset: 2px; }
#shell .sidebar-bottom { min-height: 52px; gap: 10px; padding: 12px 8px 2px; border-top: 1px solid var(--ds-line); }
#shell .state-mark { background: var(--ds-ok); box-shadow: 0 0 0 3px var(--ds-ok-bg); }
#shell .sidebar-bottom strong { font-size: 13px; font-weight: 600; }
#shell .sidebar-bottom small { font-size: 12px; }

/* ------------------------------------------------------------------ topo */
#shell .topbar { min-height: var(--topbar); padding: 0 24px; background: var(--ds-surface); border-bottom: 1px solid var(--ds-line); }
#shell .breadcrumb { gap: 8px; color: var(--ds-muted); font-size: 14px; }
#shell .breadcrumb svg { width: 14px; height: 14px; color: var(--ds-n400); }
#shell .breadcrumb strong { color: var(--ds-ink); font-size: 14px; font-weight: 600; }
#shell .sync-indicator { gap: 8px; padding: 5px 11px; color: var(--ds-n600); background: var(--ds-n50); border: 1px solid var(--ds-line); font-size: 12px; font-weight: 500; }
#shell .sync-indicator i { background: var(--ds-ok); box-shadow: 0 0 0 3px var(--ds-ok-bg); }
#shell .sync-indicator[data-status="loading"] i { background: #d97706; box-shadow: 0 0 0 3px var(--ds-warn-bg); }
#shell .sync-indicator[data-status="error"] i { background: #dc2626; box-shadow: 0 0 0 3px var(--ds-danger-bg); }
#shell .refresh-global { min-height: 38px; gap: 8px; padding: 0 14px; color: var(--ds-ink-2); background: var(--ds-surface); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-r); font: 500 14px var(--ds-font); box-shadow: var(--ds-shadow-1); }
#shell .refresh-global:hover { color: var(--ds-ink); background: var(--ds-n50); border-color: var(--ds-n400); transform: none; }
#shell .refresh-global:active { transform: translateY(1px); }
#shell .global-search { width: min(320px, 30vw); height: 38px; gap: 8px; padding: 0 10px; color: var(--ds-n400); background: var(--ds-n50); border: 1px solid var(--ds-line); border-radius: var(--ds-r); }
#shell .global-search:focus-within { background: var(--ds-surface); border-color: var(--ds-brand); box-shadow: var(--ds-ring); }
#shell .global-search svg { width: 16px; height: 16px; flex-basis: 16px; }
#shell .global-search input { font-size: 14px; color: var(--ds-ink); }
#shell .global-search input::placeholder { color: var(--ds-n400); }
#shell .global-search kbd { padding: 2px 6px; color: var(--ds-n500); background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-sm); font: 500 11px var(--ds-mono); }
#shell .top-separator { height: 24px; background: var(--ds-line); }
#shell .user-badge, #userMenu .user-badge { width: 36px; height: 36px; color: var(--ds-b700); background: var(--ds-b100); border: 0; font-size: 13px; font-weight: 600; cursor: pointer; }
#shell .user-badge:hover { box-shadow: 0 0 0 3px var(--ds-b100); }

/* ------------------------------------------------------------------ área principal */
#shell .main-content, #shell .module-mount { background: var(--ds-bg); }
#shell .home-view { width: min(1320px, 100%); padding: clamp(20px, 3vw, 36px); }
#shell .special-view { width: min(1320px, 100%); padding: clamp(20px, 3vw, 36px); }
#shell .home-heading, #shell .special-heading { margin-bottom: 24px; }
#shell .home-heading p, #shell .special-heading p { margin: 0 0 6px; color: var(--ds-brand); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
#shell .home-heading h1, #shell .special-heading h1 { font-size: clamp(26px, 2.4vw, 32px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; color: var(--ds-ink); text-wrap: balance; }
#shell .home-heading span, #shell .special-heading small { color: var(--ds-muted); font-size: 14px; }

/* cartões */
#shell :is(.hm-card, .hm-kpi, .special-panel, .module-card, .kpi-card, .pt-container) { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); box-shadow: var(--ds-shadow-1); }
#shell .module-card:hover { border-color: var(--ds-b300); box-shadow: var(--ds-shadow-2); transform: translateY(-1px); }

/* Início: KPIs (números grandes em algarismos proporcionais; tabelas e eixos em tabulares) */
#shell .hm-top { margin-bottom: 18px; }
#shell .hm-top-status { font-size: 13px; }
#shell .hm-seg { padding: 4px; gap: 2px; background: var(--ds-n200); border-radius: 10px; }
#shell .hm-seg button { padding: 7px 14px; color: var(--ds-n600); border-radius: var(--ds-r); font: 500 13px var(--ds-font); }
#shell .hm-seg button:hover { color: var(--ds-ink); }
#shell .hm-seg button[aria-pressed="true"] { color: var(--ds-ink); background: var(--ds-surface); box-shadow: 0 1px 3px rgb(15 23 42 / 12%); }
#shell .hm-kpis { gap: 14px; margin-bottom: 18px; }
#shell .hm-kpi { gap: 6px; padding: 18px 20px; }
#shell .hm-kpi > span { color: var(--ds-muted); font-size: 13px; font-weight: 500; }
#shell .hm-kpi > strong { color: var(--ds-ink); font-size: clamp(26px, 2.2vw, 32px); font-weight: 600; letter-spacing: -.02em; }
#shell .hm-kpi > small { font-size: 13px; color: var(--ds-muted); }
#shell .hm-delta { padding: 2px 8px; font-size: 12px; font-weight: 600; border-radius: 999px; }
#shell .hm-delta.good { color: var(--ds-ok); background: var(--ds-ok-bg); }
#shell .hm-delta.bad { color: var(--ds-danger); background: var(--ds-danger-bg); }
#shell .hm-delta.flat { color: var(--ds-n600); background: var(--ds-n100); }
#shell .hm-grid { gap: 14px; margin-bottom: 18px; }
#shell .hm-card { padding: 18px 20px; }
#shell .hm-card > header { margin-bottom: 14px; }
#shell .hm-card > header strong { font-size: 15px; font-weight: 600; letter-spacing: -.005em; color: var(--ds-ink); }
#shell .hm-card > header span { color: var(--ds-muted); font-size: 12px; letter-spacing: 0; text-transform: none; }
#shell .hm-notice { color: var(--ds-warn); background: var(--ds-warn-bg); border-color: var(--ds-warn-line); border-radius: var(--ds-r-lg); font-size: 14px; }
#shell .hm-notice.soft { color: var(--ds-n600); background: var(--ds-surface); border-color: var(--ds-line); }
#shell .hm-table { font-size: 14px; }
#shell .hm-table th { padding: 8px 10px; color: var(--ds-muted); background: var(--ds-n50); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; border-bottom: 1px solid var(--ds-line); }
#shell .hm-table td { padding: 10px; color: var(--ds-ink-2); border-bottom: 1px solid var(--ds-n100); }
#shell .hm-table tbody tr:hover td { background: var(--ds-n50); }
#shell .hm-table .hm-warn { color: var(--ds-danger); font-weight: 600; }
#shell .hm-bar-cell i { background: var(--ds-b100); border-radius: 4px; }
#shell .hm-fleet-link { color: var(--ds-b700); border-bottom: 1px solid var(--ds-b200); }
#shell .hm-fleet-link:hover { color: var(--ds-brand); border-bottom-color: currentColor; }
#shell .hm-list li { padding: 8px 6px; }
#shell .hm-list li i { height: 3px; background: var(--ds-b100); }
#shell .hm-rank { color: var(--ds-n500); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
#shell .hm-name b { font-size: 14px; font-weight: 500; color: var(--ds-ink); }
#shell .hm-name small { font-size: 12px; }
#shell .hm-val { font-size: 14px; font-weight: 600; color: var(--ds-ink); }
#shell .hm-empty { font-size: 14px; color: var(--ds-muted); }
#shell .hm-attn { gap: 8px; }
#shell .hm-attn li { padding: 10px 12px; background: var(--ds-warn-bg); border-left: 3px solid #d97706; border-radius: var(--ds-r); font-size: 14px; }
#shell .hm-attn li.consumo { background: var(--ds-danger-bg); border-left-color: #dc2626; }
#shell .hm-attn li.parados { background: var(--ds-n50); border-left-color: var(--ds-n400); }
#shell .hm-attn small { font-size: 13px; }
#shell .hm-modules-title { color: var(--ds-muted); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }

/* Início: gráficos de colunas (dataviz: barras de até 24px, ponta arredondada, base reta, linha de grade fina,
   rótulo só no pico e no último dia; o valor de cada coluna aparece ao passar o mouse ou com o teclado) */
#shell .hm-chart .hm-plot { position: relative; }
#shell .hm-chart svg.hm-bars { display: block; width: 100%; height: 132px; overflow: visible; }
#shell .hm-bars .hm-grid-line { stroke: var(--ds-n200); stroke-width: 1; shape-rendering: crispEdges; }
#shell .hm-bars .hm-base { stroke: var(--ds-n300); stroke-width: 1; shape-rendering: crispEdges; }
#shell .hm-bars .hm-col { fill: #257de0; transition: fill .12s var(--ds-ease); }
#shell .hm-bars g:hover .hm-col, #shell .hm-bars g:focus-within .hm-col { fill: #1d5c8a; }
#shell .hm-bars .hm-hit { fill: transparent; outline: none; }
#shell svg.hm-bars:focus-visible { outline: 2px solid var(--ds-brand); outline-offset: 4px; border-radius: 4px; }
#shell .hm-bars .hm-hit:focus-visible { stroke: var(--ds-ink); stroke-width: 1.5; }
#shell .hm-bars .hm-cap { fill: var(--ds-ink); font: 600 11px var(--ds-font); font-variant-numeric: tabular-nums; }
#shell .hm-bars .hm-tick { fill: var(--ds-muted); font: 11px var(--ds-font); font-variant-numeric: tabular-nums; }
#shell .hm-chart footer { margin-top: 8px; font-size: 12px; color: var(--ds-muted); }
#shell .hm-tip { position: absolute; z-index: 2; pointer-events: none; padding: 6px 10px; color: #fff; background: var(--ds-n900); border-radius: var(--ds-r); font-size: 12px; line-height: 1.35; white-space: nowrap; transform: translate(-50%, calc(-100% - 8px)); opacity: 0; transition: opacity .12s var(--ds-ease); }
#shell .hm-tip.is-on { opacity: 1; }
#shell .hm-tip b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }

/* páginas especiais: Logs, Usuários e permissões */
#shell .special-panel { overflow: hidden; }
#shell .special-panel-head { min-height: 56px; padding: 12px 18px; border-bottom: 1px solid var(--ds-line); }
#shell .special-panel-head strong { font-size: 15px; font-weight: 600; }
#shell .special-panel-head small { font-size: 13px; }
#shell .special-filters { gap: 12px; padding: 14px 18px; background: var(--ds-n50); border-bottom: 1px solid var(--ds-line); }
#shell .special-filters label, #shell .profile-panel > label, #shell .permission-user-label { gap: 6px; color: var(--ds-n600); font-size: 13px; font-weight: 500; }
#shell :is(.special-filters, .profile-panel, .permission-user-label) :is(input, select),
#modalLayer .modal-card input { height: 38px; min-height: 38px; padding: 0 12px; color: var(--ds-ink); background: var(--ds-surface); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-r); font: 14px var(--ds-font); }
#shell :is(.special-filters, .profile-panel, .permission-user-label) :is(input, select):focus,
#modalLayer .modal-card input:focus { border-color: var(--ds-brand); box-shadow: var(--ds-ring); outline: 0; }
#shell .special-table th { height: 40px; padding: 0 16px; color: var(--ds-muted); background: var(--ds-n50); border-bottom: 1px solid var(--ds-line); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
#shell .special-table td { height: 46px; padding: 0 16px; color: var(--ds-ink-2); border-bottom: 1px solid var(--ds-n100); font-size: 14px; font-variant-numeric: tabular-nums; }
#shell .special-table tbody tr:hover td { background: var(--ds-n50); }
#shell .special-empty strong { font-size: 15px; color: var(--ds-ink-2); }
#shell .special-empty p { font-size: 14px; }
#shell .special-notice { padding: 12px 14px; color: var(--ds-n600); background: var(--ds-n50); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); font-size: 14px; }
#shell .level-label { padding: 3px 8px; color: var(--ds-b700); background: var(--ds-b50); border-radius: 999px; font-size: 12px; font-weight: 600; }
#shell .kpi-card span { font-size: 13px; color: var(--ds-muted); }
#shell .kpi-card strong { color: var(--ds-ink); font-size: 28px; font-weight: 600; }

/* botões do portal */
:is(#shell, #modalLayer, #toast) :is(.small-action, .modal-actions button) {
  min-height: 38px; padding: 0 14px; color: var(--ds-ink-2); background: var(--ds-surface); border: 1px solid var(--ds-line-strong);
  border-radius: var(--ds-r); font: 500 14px var(--ds-font); box-shadow: var(--ds-shadow-1); cursor: pointer; transition: background-color .12s var(--ds-ease), border-color .12s var(--ds-ease), color .12s var(--ds-ease);
}
:is(#shell, #modalLayer, #toast) :is(.small-action, .modal-actions button):hover { color: var(--ds-ink); background: var(--ds-n50); border-color: var(--ds-n400); }
:is(#shell, #modalLayer, #toast) :is(.small-action, .modal-actions button):active { transform: translateY(1px); }
:is(#shell, #modalLayer, #toast) :is(.small-action.primary, .modal-actions button.primary) { color: #fff; background: var(--ds-brand); border-color: var(--ds-brand); }
:is(#shell, #modalLayer, #toast) :is(.small-action.primary, .modal-actions button.primary):hover { background: var(--ds-brand-hover); border-color: var(--ds-brand-hover); }
:is(#shell, #modalLayer) :is(.small-action, .modal-actions button):focus-visible { outline: 2px solid var(--ds-brand); outline-offset: 2px; }

/* ------------------------------------------------------------------ login */
#authGate { background: rgb(15 23 42 / 60%); backdrop-filter: none; }
#authGate .auth-card { gap: 8px; width: min(100%, 400px); padding: 32px; border: 1px solid var(--ds-line); border-radius: var(--ds-r-xl); box-shadow: var(--ds-shadow-3); }
#authGate .brand-mark { width: 44px; height: 44px; margin-bottom: 8px; border-radius: 12px; background: var(--ds-brand); font-size: 20px; font-weight: 700; }
#authGate .auth-card p { margin: 0; color: var(--ds-muted); font-size: 14px; }
#authGate .auth-card h1 { margin: 0 0 14px; color: var(--ds-ink); font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
#authGate .auth-card label { margin-top: 6px; color: var(--ds-n700); font-size: 14px; font-weight: 500; }
#authGate .auth-card input { min-height: 44px; padding: 0 12px; color: var(--ds-ink); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-r); font: 15px var(--ds-font); }
#authGate .auth-card input:focus { border-color: var(--ds-brand); box-shadow: var(--ds-ring); outline: 0; }
#authGate .auth-error { min-height: 20px; color: var(--ds-danger); font-size: 14px; }
#authGate .auth-card button.primary { min-height: 44px; border-radius: var(--ds-r); background: var(--ds-brand); font: 600 15px var(--ds-font); }
#authGate .auth-card button.primary:hover { background: var(--ds-brand-hover); }
#authGate .auth-card button.primary:focus-visible { outline: 2px solid var(--ds-brand); outline-offset: 2px; }

/* ------------------------------------------------------------------ camadas: menu do usuário, modais, aviso */
#userMenu { top: 60px; right: 20px; width: 232px; padding: 6px; border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); box-shadow: var(--ds-shadow-2); }
#userMenu .user-menu-title { gap: 10px; padding: 8px 8px 10px; border-bottom: 1px solid var(--ds-line); }
#userMenu .user-menu-title strong { font-size: 14px; font-weight: 600; }
#userMenu .user-menu-title small { font-size: 12px; }
#userMenu > button, #userMenu > a { min-height: 38px; padding: 0 10px; color: var(--ds-n700); border-radius: var(--ds-r-sm); font: 14px var(--ds-font); }
#userMenu > button:hover, #userMenu > a:hover { color: var(--ds-ink); background: var(--ds-n100); }
#userMenu > button:last-child { border-top: 1px solid var(--ds-line); border-radius: 0 0 var(--ds-r-sm) var(--ds-r-sm); color: var(--ds-danger); }
#modalLayer .modal-shade { background: rgb(15 23 42 / 50%); backdrop-filter: none; overscroll-behavior: contain; }
#modalLayer .modal-card { border: 1px solid var(--ds-line); border-radius: var(--ds-r-xl); box-shadow: var(--ds-shadow-3); }
#modalLayer .modal-card h2 { padding: 20px 22px 6px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
#modalLayer .modal-card p { padding: 0 22px 14px; font-size: 14px; }
#modalLayer .modal-card label { gap: 6px; padding: 8px 22px 0; color: var(--ds-n700); font-size: 14px; font-weight: 500; }
#modalLayer .modal-actions { gap: 8px; padding: 18px 22px 20px; }
#modalLayer .hm-fleet-modal { padding: 22px; }
#modalLayer .hm-fleet-modal h2 { padding: 0; }
#modalLayer .hm-fleet-cols li { border-color: var(--ds-line); border-radius: var(--ds-r); font-size: 13px; }
#modalLayer .global-search-modal-head { padding: 20px 22px 14px; border-bottom: 1px solid var(--ds-line); }
#modalLayer .global-search-modal-head p { color: var(--ds-brand); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
#modalLayer .global-search-modal-head h2 { padding: 0; font-size: 18px; }
#modalLayer .global-search-modal-head > button { width: 36px; min-height: 36px; border-radius: var(--ds-r); }
#modalLayer .global-search-group { padding: 12px; background: var(--ds-n50); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); }
#modalLayer .global-search-group h3 { font-size: 14px; font-weight: 600; }
#modalLayer .global-search-group div { font-size: 13px; }
#toast { right: 20px; bottom: 20px; max-width: 380px; padding: 12px 16px; color: var(--ds-ink-2); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); box-shadow: var(--ds-shadow-2); font-size: 14px; }
#toast[data-kind="success"] { border-left: 3px solid var(--ds-ok); }
#toast[data-kind="warning"] { border-left: 3px solid #d97706; }
#toast[data-kind="error"] { border-left: 3px solid #dc2626; }

/* ------------------------------------------------------------------ recolhido, tablet e celular */
#shell.collapsed .nav-item.active::before { left: -12px; }
@media (max-width: 900px) { #shell .topbar { padding: 0 16px; } }
@media (max-width: 700px) {
  #shell .topbar { min-height: 56px; padding: 0 10px; }
  #shell .sidebar { box-shadow: var(--ds-shadow-3); }
  #shell .global-search { width: min(46vw, 240px); height: 38px; }
  #shell .home-view, #shell .special-view { padding: 18px 14px; }
  #shell .hm-kpi { padding: 14px 16px; }
  #shell .hm-kpi > strong { font-size: 24px; }
  #shell .hm-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { #shell *, #modalLayer *, #toast { transition: none !important; } }

/* respiro interno dos painéis de Logs e Permissões (o aviso, o seletor e a árvore não encostam na borda) */
#shell .special-panel > .special-notice { margin: 16px 18px; }
#shell .special-panel > .permission-user-label { max-width: 380px; margin: 16px 18px 12px; }
#shell .special-panel > .pt-container { margin: 0 18px 18px; box-shadow: none; }
#shell .special-panel > .special-table-wrap { border-top: 0; }

/* sem enfeite: o rodapé do menu só repetia texto genérico e a seta do bloco da empresa sugeria um seletor que não existe */
#shell .sidebar-bottom { display: none; }
#shell .tenant > svg { display: none; }

/* Início: painel de vencimentos (tacógrafos e extintores). Estado em texto + cor; a tabela rola se a lista for longa. */
#shell .hm-due-wrap { max-height: 320px; overflow: auto; }
#shell .hm-due-table th { position: sticky; top: 0; z-index: 1; text-align: left; }
#shell .hm-due-table td { text-align: left; }
#shell .hm-due-table th:first-child, #shell .hm-due-table td:first-child { width: auto; color: var(--ds-ink); }
#shell .hm-due { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
#shell .hm-due.late { color: var(--ds-danger); background: var(--ds-danger-bg); }
#shell .hm-due.soon { color: var(--ds-warn); background: var(--ds-warn-bg); }
#shell .hm-due.ok { color: var(--ds-n700); background: var(--ds-n100); }
#shell .hm-due-note { margin-top: 10px; color: var(--ds-muted); font-size: 12px; }
@media (max-width: 640px) { #shell .hm-due-table th:nth-child(2), #shell .hm-due-table td:nth-child(2), #shell .hm-due-table th:nth-child(4), #shell .hm-due-table td:nth-child(4) { display: none; } }

/* ------------------------------------------------------------------ ficha da frota (#frota/<código>) */
#shell .fleet-heading { align-items: flex-end; }
#shell .fleet-heading .hm-seg { flex: 0 0 auto; }
#shell .fleet-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
#shell .fleet-grid { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 14px; align-items: start; }
#shell .fleet-side { display: grid; gap: 14px; }
#shell .fleet-side .special-notice { margin: 0; }
#shell .fleet-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 0; padding: 16px 18px; }
#shell .fleet-fields div { min-width: 0; }
#shell .fleet-fields dt { color: var(--ds-muted); font-size: 12px; }
#shell .fleet-fields dd { margin: 2px 0 0; color: var(--ds-ink); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
#shell .fleet-due { display: grid; gap: 0; margin: 0; padding: 4px 18px 12px; list-style: none; }
#shell .fleet-due li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ds-n100); }
#shell .fleet-due li:last-child { border-bottom: 0; }
#shell .fleet-due b { display: block; font-size: 14px; font-weight: 500; }
#shell .fleet-due small { color: var(--ds-muted); font-size: 12px; }
#shell .fleet-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px; border-bottom: 1px solid var(--ds-line); }
#shell .fleet-chip { min-height: 32px; padding: 0 12px; color: var(--ds-n700); background: var(--ds-surface); border: 1px solid var(--ds-line-strong); border-radius: 999px; font: 500 13px var(--ds-font); cursor: pointer; }
#shell .fleet-chip span { color: var(--ds-muted); font-variant-numeric: tabular-nums; }
#shell .fleet-chip:hover { border-color: var(--ds-n400); color: var(--ds-ink); }
#shell .fleet-chip[aria-pressed="true"] { color: var(--ds-b700); background: var(--ds-b50); border-color: var(--ds-b300); }
#shell .fleet-chip:focus-visible, #shell .fleet-heading .hm-seg button:focus-visible { outline: 2px solid var(--ds-brand); outline-offset: 2px; }
#shell .fleet-events { margin: 0; padding: 4px 18px 16px; list-style: none; max-height: 70vh; overflow: auto; }
#shell .fleet-month { position: sticky; top: 0; z-index: 1; padding: 12px 0 6px; color: var(--ds-n600); background: var(--ds-surface); font-size: 13px; font-weight: 600; }
#shell .fleet-event { display: grid; grid-template-columns: 48px 132px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--ds-n100); }
#shell .fleet-event time { color: var(--ds-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
#shell .fleet-type { display: inline-flex; align-items: center; gap: 6px; color: var(--ds-n700); font-size: 12px; font-weight: 600; }
#shell .fleet-type::before { content: ""; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--ds-n400); }
#shell .fleet-event[data-type="abastecimento"] .fleet-type::before { background: #257de0; }
#shell .fleet-event[data-type="os"] .fleet-type::before { background: #d97706; }
#shell .fleet-event[data-type="escala"] .fleet-type::before { background: #15803d; }
#shell .fleet-event[data-type="manutencao"] .fleet-type::before { background: #7c3aed; }
#shell .fleet-text b { display: block; font-size: 14px; font-weight: 500; color: var(--ds-ink); }
#shell .fleet-text small { display: block; margin-top: 2px; color: var(--ds-muted); font-size: 13px; overflow-wrap: anywhere; }
#modalLayer .global-search-actions { padding: 14px 16px 0; }
#modalLayer .hm-fleet-modal footer { gap: 8px; }
@media (max-width: 1100px) { #shell .fleet-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } #shell .fleet-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  #shell .fleet-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #shell .fleet-heading { align-items: flex-start; }
  #shell .fleet-fields { grid-template-columns: 1fr; }
  #shell .fleet-event { grid-template-columns: 44px minmax(0, 1fr); }
  #shell .fleet-type { grid-column: 2; }
  #shell .fleet-text { grid-column: 2; }
  #shell .fleet-events { max-height: none; }
}

/* ------------------------------------------------------------------ logos reais (img/LOGO MOVISTAR.png e img/LOGO DESTRO.png) */
#shell .brand-link { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
#shell .brand-logo { display: block; width: auto; height: 38px; max-width: 190px; object-fit: contain; }
#shell .brand-mark { display: none; }
#shell .brand-name small { margin: 0; color: var(--ds-muted); font-size: 12px; }
#shell .tenant { justify-content: center; min-height: 64px; padding: 10px 12px; background: var(--ds-surface); }
#shell .tenant-logo { display: block; width: auto; height: 44px; max-width: 100%; object-fit: contain; }
#shell.collapsed .brand-logo { display: none; }
#shell.collapsed .brand-mark { display: grid; }
#shell.collapsed .tenant { min-height: 48px; padding: 6px; }
#shell.collapsed .tenant-logo { width: 40px; height: auto; }
#authGate .auth-logos { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
#authGate .auth-logos img { display: block; width: auto; height: 42px; object-fit: contain; }
#authGate .auth-logos img + img { height: 48px; padding-left: 18px; border-left: 1px solid var(--ds-line); }
@media (max-width: 700px) { #shell.collapsed .brand-logo { display: block; } #shell.collapsed .brand-mark { display: none; } #shell.collapsed .tenant-logo { width: auto; height: 44px; } }

/* ------------------------------------------------------------------ consulta central (busca do topo): indicadores, registros por tipo e painel lateral */
#modalLayer .consulta-modal { width: min(1080px, 100%); max-height: min(92vh, 900px); display: flex; flex-direction: column; overflow: hidden; }
#modalLayer .consulta-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--ds-line); }
#modalLayer .consulta-title p { margin: 0 0 4px; padding: 0; color: var(--ds-brand); font-size: 13px; font-weight: 600; }
#modalLayer .consulta-title h2 { margin: 0; padding: 0; font-size: 20px; }
#modalLayer .consulta-title small { display: block; margin-top: 4px; color: var(--ds-muted); font-size: 13px; }
#modalLayer .consulta-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
#modalLayer .consulta-head-actions .hm-seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--ds-n200); border-radius: 10px; }
#modalLayer .consulta-head-actions .hm-seg button { padding: 7px 12px; color: var(--ds-n600); background: transparent; border: 0; border-radius: var(--ds-r); font: 500 13px var(--ds-font); cursor: pointer; }
#modalLayer .consulta-head-actions .hm-seg button[aria-pressed="true"] { color: var(--ds-ink); background: var(--ds-surface); box-shadow: 0 1px 3px rgb(15 23 42 / 12%); }
#modalLayer .consulta-head-actions .small-action { text-decoration: none; white-space: nowrap; }
#modalLayer .consulta-close { width: 36px; min-height: 36px; padding: 0; color: var(--ds-n600); background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r); font-size: 20px; line-height: 1; cursor: pointer; }
#modalLayer .consulta-body { padding: 18px 22px 22px; overflow: auto; }
#modalLayer .consulta-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
#modalLayer .consulta-kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); }
#modalLayer .consulta-kpi > span { color: var(--ds-muted); font-size: 12px; font-weight: 600; }
#modalLayer .consulta-kpi > strong { color: var(--ds-ink); font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
#modalLayer .consulta-kpi > small { color: var(--ds-n600); font-size: 12px; line-height: 1.4; }
#modalLayer .consulta-kpi .hm-due { align-self: flex-start; margin-top: 4px; white-space: normal; }
#modalLayer .hm-due { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
#modalLayer .hm-due.late { color: var(--ds-danger); background: var(--ds-danger-bg); }
#modalLayer .hm-due.soon { color: var(--ds-warn); background: var(--ds-warn-bg); }
#modalLayer .hm-due.ok { color: var(--ds-n700); background: var(--ds-n100); }
#modalLayer .hm-due.ok-strong { color: var(--ds-ok); background: var(--ds-ok-bg); }
#modalLayer .consulta-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 16px; align-items: start; }
#modalLayer .consulta-feed { min-width: 0; border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); overflow: hidden; }
#modalLayer .consulta-tabs { display: flex; gap: 2px; padding: 6px; overflow-x: auto; background: var(--ds-n50); border-bottom: 1px solid var(--ds-line); }
#modalLayer .consulta-tabs button { flex: 0 0 auto; padding: 7px 12px; color: var(--ds-n600); background: transparent; border: 0; border-radius: var(--ds-r); font: 500 13px var(--ds-font); cursor: pointer; }
#modalLayer .consulta-tabs button span { margin-left: 4px; color: var(--ds-muted); font-variant-numeric: tabular-nums; }
#modalLayer .consulta-tabs button[aria-selected="true"] { color: var(--ds-ink); background: var(--ds-surface); box-shadow: 0 1px 3px rgb(15 23 42 / 12%); }
#modalLayer .consulta-list { margin: 0; padding: 0; list-style: none; }
#modalLayer .consulta-list li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 10px 14px; border-top: 1px solid var(--ds-line); }
#modalLayer .consulta-list li:first-child { border-top: 0; }
#modalLayer .consulta-list time { padding-top: 1px; color: var(--ds-muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
#modalLayer .consulta-list b { display: block; color: var(--ds-ink); font-size: 13px; font-weight: 600; }
#modalLayer .consulta-list small { display: block; margin-top: 2px; color: var(--ds-n600); font-size: 12px; overflow-wrap: anywhere; }
#modalLayer .consulta-more { display: block; padding: 10px 14px; color: var(--ds-brand); border-top: 1px solid var(--ds-line); font-size: 13px; font-weight: 600; text-decoration: none; }
#modalLayer .consulta-side { display: flex; flex-direction: column; gap: 12px; }
#modalLayer .consulta-side > section, #modalLayer .consulta-rank { padding: 12px 14px; background: var(--ds-n50); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); }
#modalLayer .consulta-side h3 { margin: 0 0 8px; color: var(--ds-ink); font-size: 13px; font-weight: 600; }
#modalLayer .consulta-side ul, #modalLayer .consulta-side ol { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
#modalLayer .consulta-last li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; font-size: 12px; }
#modalLayer .consulta-last li span { grid-column: 1 / -1; color: var(--ds-muted); }
#modalLayer .consulta-last li b { color: var(--ds-ink); font-weight: 600; }
#modalLayer .consulta-last li small { color: var(--ds-n600); }
#modalLayer .consulta-rank li, #modalLayer .consulta-due li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
#modalLayer .consulta-rank li span, #modalLayer .consulta-due li > span:first-child { min-width: 0; overflow: hidden; color: var(--ds-ink-2); text-overflow: ellipsis; white-space: nowrap; }
#modalLayer .consulta-rank li b { color: var(--ds-n600); font-variant-numeric: tabular-nums; }
#modalLayer .consulta-modal .global-search-state { padding: 28px 8px; text-align: center; }
#modalLayer .consulta-modal .global-search-state p { padding: 6px 0 0; color: var(--ds-muted); }
#modalLayer .consulta-modal button:focus-visible, #modalLayer .consulta-modal a:focus-visible { outline: 2px solid var(--ds-brand); outline-offset: 2px; }
@media (max-width: 820px) {
  #modalLayer .consulta-head { flex-direction: column; }
  #modalLayer .consulta-head-actions { justify-content: flex-start; }
  #modalLayer .consulta-grid { grid-template-columns: 1fr; }
  #modalLayer .consulta-body { padding: 14px 16px 18px; }
  #modalLayer .consulta-head { position: relative; padding-right: 64px; }
  #modalLayer .consulta-close { position: absolute; top: 16px; right: 16px; }
  #modalLayer .consulta-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #modalLayer .consulta-kpi { padding: 12px; }
  #modalLayer .consulta-kpi > strong { font-size: 19px; }
}

/* ------------------------------------------------------------------ lixeira (#lixeira) */
#shell .lixeira-lista { display: flex; flex-direction: column; }
#shell .lixeira-lista > .ds-skeleton, #shell .lixeira-lista > .special-empty { margin: 0 18px 18px; }
#shell .lixeira-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px; border-top: 1px solid var(--ds-line); }
#shell .lixeira-main { min-width: 0; }
#shell .lixeira-main h2 { margin: 4px 0 2px; color: var(--ds-ink); font-size: 16px; font-weight: 600; }
#shell .lixeira-tag { display: inline-block; padding: 1px 8px; color: var(--ds-n700); background: var(--ds-n100); border-radius: 999px; font-size: 12px; font-weight: 600; }
#shell .lixeira-meta { margin: 0; color: var(--ds-muted); font-size: 13px; }
:is(#shell, #modalLayer) .lixeira-juntos { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
:is(#shell, #modalLayer) .lixeira-juntos li { padding: 3px 10px; color: var(--ds-ink-2); background: var(--ds-n50); border: 1px solid var(--ds-line); border-radius: 999px; font-size: 12px; font-weight: 500; }
#shell .lixeira-nota { margin: 8px 0 0; color: var(--ds-n600); font-size: 12px; }
#shell .lixeira-nota.warn { color: var(--ds-warn); }
#shell .lixeira-acoes { display: flex; flex: 0 0 auto; gap: 8px; }
:is(#shell, #modalLayer) :is(.small-action.danger, .modal-actions button.danger) { color: #fff; background: var(--ds-danger); border-color: var(--ds-danger); }
:is(#shell, #modalLayer) :is(.small-action.danger, .modal-actions button.danger):hover { color: #fff; background: #991b1b; border-color: #991b1b; }
#shell .lixeira-acoes .small-action.danger { color: var(--ds-danger); background: var(--ds-surface); border-color: var(--ds-danger-line); }
#shell .lixeira-acoes .small-action.danger:hover { color: #fff; background: var(--ds-danger); border-color: var(--ds-danger); }
#modalLayer .lixeira-modal { width: min(480px, 100%); }
#modalLayer .lixeira-modal .lixeira-juntos { padding: 0 22px; margin: 0 0 4px; }
@media (max-width: 640px) {
  #shell .lixeira-item { flex-direction: column; }
  #shell .lixeira-acoes { width: 100%; flex-wrap: wrap; }
}

/* ------------------------------------------------------------------ Início: Visão do gestor */
#shell .hm-gestor { margin-bottom: 22px; }
#shell .hm-gestor-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; color: var(--ds-ink); font-size: 18px; font-weight: 600; }
#shell .hm-gestor-title small { color: var(--ds-muted); font-size: 13px; font-weight: 400; }
#shell .hm-gestor-avisos { margin-bottom: 14px; border-left: 3px solid var(--ds-warn); }
#shell .hm-gestor-avisos .hm-attn { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
#shell .hm-gestor-avisos .aviso { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 10px; background: var(--ds-n50); border-radius: var(--ds-r); font-size: 14px; }
#shell .hm-gestor-avisos .aviso.grave { background: var(--ds-danger-bg); }
#shell .hm-gestor-avisos .aviso b { color: var(--ds-ink); font-weight: 600; }
#shell .hm-gestor-avisos .aviso span, #shell .hm-gestor-avisos .aviso a { color: var(--ds-n600); font-size: 13px; }
#shell .hm-gestor-avisos .aviso a { color: var(--ds-brand); font-weight: 600; }
#shell .hm-gestor .hm-kpis { margin-bottom: 14px; }
#shell .hm-gestor-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
#shell .hm-gestor-list { margin: 0; padding: 0; list-style: none; }
#shell .hm-gestor-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--ds-line); }
#shell .hm-gestor-list li:first-child { border-top: 0; }
#shell .hm-gestor-list .hm-name { display: flex; flex-direction: column; min-width: 0; }
#shell .hm-gestor-list .hm-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#shell .hm-gestor-list .hm-name small, #shell .hm-gestor-list .hm-val small { display: block; color: var(--ds-muted); font-size: 12px; font-weight: 400; }
#shell .hm-gestor-list .hm-val { flex: 0 0 auto; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
#shell .hm-gestor-list .hm-val small.late { color: var(--ds-danger); font-weight: 600; }
#shell .hm-sub { margin: 10px 0 2px; color: var(--ds-muted); font-size: 12px; font-weight: 600; }
#shell .hm-sub:first-of-type { margin-top: 0; }
#shell .hm-gestor-sub { margin: 16px 0 8px; color: var(--ds-n600); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
#shell .hm-gestor-duo { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
#shell .hm-gestor-duo .hm-kpis { margin-bottom: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
#shell .hm-gestor-mais { margin-top: 18px; border: 1px solid var(--ds-line); border-radius: var(--ds-r); padding: 0 14px; }
#shell .hm-gestor-mais > summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--ds-ink); }
#shell .hm-gestor-mais[open] > summary { border-bottom: 1px solid var(--ds-line); margin-bottom: 14px; }
#shell .hm-gestor-mais .hm-kpis { margin-bottom: 14px; }
#shell .hm-gestor-mais .hm-gestor-grid { padding-bottom: 14px; }
@media (max-width: 860px) { #shell .hm-gestor-duo { grid-template-columns: 1fr; } }

/* sem a logo da Destro, o bloco da Movistar respira antes do primeiro grupo do menu */
#shell .brand { margin-bottom: 18px; }
