/* AGSAP | Design novo (camada final, só apresentação).
 * Carregar POR ÚLTIMO, depois de ags-material-unificado-h642.css. Para desfazer: remover a linha
 * <link ... design-agsap.css> dos HTML (marcada com <!-- design-agsap -->); nenhum outro arquivo foi alterado.
 *
 * Referências: Linear (listas e tabelas), IBM Carbon (estrutura de módulos, acessibilidade), SAP (barra de aplicação).
 * Princípios: profundidade por borda (sem sombras grandes), raios 6/10px, números tabulares, um azul para interação,
 * cores de estado fixas, foco sempre visível.
 * Estratégia: sobrescrever os TOKENS (--ags-*, --platform-*, --ls-*) que os 17 arquivos antigos já consomem. */

:root{
  --ags-primary:#1b5fc1;
  --ags-primary-dark:#144a99;
  --ags-secondary:#0e7c86;
  --ags-secondary-dark:#0a5f67;
  --ags-background:#f5f7fa;
  --ags-surface:#ffffff;
  --ags-text:#111827;
  --ags-muted:#4b5563;
  --ags-disabled:#9aa3af;
  --ags-border:#e0e5ec;
  --ags-error:#b42318;
  --ags-info:#1b5fc1;
  --ags-success:#067647;
  --ags-warning:#a15c07;
  --ags-appbar:#18233a;
  --ags-appbar-dark:#101a2c;
  --ags-radius:10px;
  --ags-control-radius:6px;
  --ags-shadow:0 0 0 1px rgba(16,24,40,.06),0 1px 2px rgba(16,24,40,.05);
  --ags-shadow-soft:0 0 0 1px rgba(16,24,40,.05);
  --platform-accent-soft:#e8f0fc;
  --ls-radius:10px;
  --ls-shadow:0 0 0 1px rgba(16,24,40,.06),0 1px 2px rgba(16,24,40,.05);
  --ls-primary:var(--ags-primary)!important;
  --ls-primary-strong:var(--ags-primary-dark)!important;
}

html[data-theme="dark"],body[data-theme="dark"],body.theme-dark{
  --ags-primary:#5b9bff;
  --ags-primary-dark:#3d7fe6;
  --ags-secondary:#3dc4cf;
  --ags-background:#0b1220;
  --ags-surface:#111a2b;
  --ags-text:#eef2f8;
  --ags-muted:#aab6c8;
  --ags-disabled:#6b7a92;
  --ags-border:#24324d;
  --ags-error:#ff7b72;
  --ags-success:#4ade80;
  --ags-warning:#fbbf24;
  --ags-menu-active:#17233a;
  --ags-appbar:#0e1627;
  --ags-appbar-dark:#0a111e;
  --ags-shadow:0 0 0 1px rgba(255,255,255,.06);
  --ags-shadow-soft:0 0 0 1px rgba(255,255,255,.05);
  --platform-accent-soft:#12233f;
}

/* tipografia: números alinhados em tabelas e indicadores; títulos mais firmes */
body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;-webkit-font-smoothing:antialiased}
table,td,th,.kpi,.metric,[class*="kpi"] strong,[class*="stat"] strong{font-variant-numeric:tabular-nums}
h1,h2,h3{letter-spacing:-.015em}
h1{font-weight:650}

/* foco visível e único (azul), em qualquer superfície */
:focus-visible{outline:2px solid var(--ags-primary)!important;outline-offset:2px!important;box-shadow:none!important}

/* sem sombras de elevação em cartões e painéis: borda hairline */
.card,.ls-card,.panel,.kpi-card,.metric-card,.access-card,.chart-card,.activity-card,.table-wrap{
  box-shadow:0 0 0 1px rgba(16,24,40,.06),0 1px 2px rgba(16,24,40,.04)!important;
  border:1px solid var(--ags-border)!important;
  border-radius:var(--ags-radius)!important;
}
html[data-theme="dark"] .card,html[data-theme="dark"] .ls-card,html[data-theme="dark"] .panel,html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .metric-card,html[data-theme="dark"] .access-card,html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .activity-card,html[data-theme="dark"] .table-wrap{box-shadow:none!important}

/* tabelas: cabeçalho discreto, linhas com hover (modelo Linear) */
table th{font-size:12px;font-weight:600;color:var(--ags-muted);text-transform:none;letter-spacing:0}
table tbody tr{transition:background .15s ease}
table tbody tr:hover{background:color-mix(in srgb,var(--ags-primary) 5%,transparent)}

/* botões: raio de controle de 6px, sem sombra; ação principal em azul sólido */
button,.button,.ls-btn,.primary-action,.filter-button,[role="button"]{border-radius:var(--ags-control-radius);box-shadow:none}
button:disabled,.button[disabled]{opacity:.5;cursor:not-allowed}

/* portal de módulos: cartões limpos com hover por borda azul */
.modules-page{background:var(--ags-background)!important}
.modules-page .module-card{
  background:var(--ags-surface)!important;border:1px solid var(--ags-border)!important;border-radius:var(--ags-radius)!important;
  box-shadow:none!important;transition:border-color .15s ease,transform .15s ease;
}
.modules-page .module-card:hover{border-color:var(--ags-primary)!important;transform:translateY(-1px)}
.modules-page .module-icon{background:var(--platform-accent-soft)!important;color:var(--ags-primary)!important;border-radius:8px!important}
.modules-page .module-tags i{border-radius:999px;font-style:normal}
.modules-page .module-cta{color:var(--ags-primary)!important;font-weight:600}

@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ===== Painel do gestor/operador: cartões de indicador e blocos =====
   Vários CSS antigos são injetados por script DEPOIS deste arquivo (trip-stages, ui-polish, enterprise, quick-dock, manager-final);
   por isso estas regras usam :root:root para ganhar na especificidade em vez de depender da ordem.
   Os arquivos antigos usam !important nestes seletores; aqui o !important só iguala a prioridade (a camada vem por último). */
:root:root body .kpi-card,
:root:root body .manager-block,
:root:root body .manager-inner-panel,
:root:root body .h534-card-light,
:root:root body .manager-summary-grid>*,
:root:root body .ops-metric-strip>*,
:root:root body .panel{
  background:var(--ags-surface)!important;
  border:1px solid var(--ags-border)!important;
  border-radius:var(--ags-radius)!important;
  box-shadow:none!important;
}
/* faixa colorida lateral dos KPIs sai; a cor fica só no ícone */
:root:root body .kpi-card{border-left:1px solid var(--ags-border)!important}
:root:root body .kpi-card::before,:root:root body .kpi-card::after{display:none!important}
:root:root body .kpi-card strong,:root:root body .kpi-card .kpi-value{font-weight:600;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
:root:root body .kpi-card:hover{border-color:var(--ags-primary)!important}
:root:root body .kpi-icon{border-radius:8px!important;box-shadow:none!important}
:root:root body .panel-header{border-bottom:1px solid var(--ags-border)}
:root:root body .panel-tag{border-radius:999px}
/* barra superior: mais baixa e sem sombra */
:root:root body .topbar,:root:root body header.app-header,:root:root body .dashboard-topbar{box-shadow:0 1px 0 rgba(255,255,255,.06)!important}
/* navegação em grupos (pílulas) */
:root:root body .nav-group-pill{border-radius:var(--ags-control-radius)!important;box-shadow:none!important;border:1px solid var(--ags-border)}
:root:root body .nav-group-pill.active{border-color:var(--ags-primary);background:var(--platform-accent-soft)}
:root:root body .nav-dropdown{border-radius:var(--ags-radius)!important;box-shadow:0 8px 24px rgba(16,24,40,.12)!important;border:1px solid var(--ags-border)}
:root:root body .bottom-dock,:root:root body [class*="quick-dock"]{box-shadow:0 8px 24px rgba(16,24,40,.18)!important}

/* prioridade extra: o tema antigo é reinserido depois por script; .dashboard-shell eleva a especificidade */
:root:root body .dashboard-shell .kpi-card,
:root:root body .dashboard-shell .metric-card,
:root:root body .dashboard-shell .ops-metric-strip>article,
:root:root body .dashboard-shell .manager-summary-grid>article{
  border:1px solid var(--ags-border)!important;
  border-left-width:1px!important;
  box-shadow:none!important;
  border-radius:var(--ags-radius)!important;
}
:root:root body .dashboard-shell .kpi-card:hover{border-color:var(--ags-primary)!important}
:root:root body .dashboard-shell .manager-block,
:root:root body .dashboard-shell .panel,
:root:root body .dashboard-shell .chart-card{box-shadow:none!important}

/* KPIs do início do gestor: o manager-final.css usa seletor com #dashboard; igualar o id e subir uma classe */
:root:root body .dashboard-shell.manager-app main.main-dashboard > section#dashboard.manager-grid > article.kpi-card:nth-child(n){
  border:1px solid var(--ags-border)!important;
  border-left-width:1px!important;
  border-radius:var(--ags-radius)!important;
  box-shadow:none!important;
  background:var(--ags-surface)!important;
  padding:16px!important;
}
:root:root body .dashboard-shell.manager-app main.main-dashboard > section#dashboard.manager-grid > article.kpi-card:nth-child(n):hover{
  border-color:var(--ags-primary)!important;
}

/* faixa operacional (veículos, motoristas, apps, km) e cartões de leitura rápida */
:root:root body .dashboard-shell.manager-app .ops-metric-strip > article:nth-child(n),
:root:root body .dashboard-shell.manager-app .manager-summary-grid > *:nth-child(n){
  border:1px solid var(--ags-border)!important;
  border-left-width:1px!important;
  border-radius:var(--ags-radius)!important;
  box-shadow:none!important;
}
:root:root body .dashboard-shell.manager-app .ops-metric-strip > article:nth-child(n):hover{border-color:var(--ags-primary)!important}
/* barra de grupos e cabeçalho: sem sombra pesada */
:root:root body .dashboard-shell.manager-app .grouped-nav,
:root:root body .dashboard-shell.manager-app nav.main-tabs,
:root:root body .dashboard-shell.manager-app .app-header,
:root:root body .dashboard-shell .topbar{box-shadow:none!important;border-bottom:1px solid var(--ags-border)}
