/* H642 | Tema visual unico baseado na Plataforma AGS Atencao Primaria.
 * Somente apresentacao: estrutura, menus, eventos, dados e regras permanecem.
 */
:root{
  --ags-primary:#1867C0;
  --ags-primary-dark:#1F5592;
  --ags-secondary:#48A9A6;
  --ags-secondary-dark:#018786;
  --ags-background:#F4F4F4;
  --ags-surface:#FFFFFF;
  --ags-text:rgba(0,0,0,.87);
  --ags-muted:rgba(0,0,0,.60);
  --ags-disabled:rgba(0,0,0,.38);
  --ags-border:rgba(0,0,0,.12);
  --ags-error:#B00020;
  --ags-info:#2196F3;
  --ags-success:#4CAF50;
  --ags-warning:#FB8C00;
  --ags-appbar:#4C516E;
  --ags-appbar-dark:#3B3F55;
  --ags-radius:8px;
  --ags-control-radius:4px;
  --ags-shadow:0 2px 4px -1px rgba(0,0,0,.20),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12);
  --ags-shadow-soft:0 2px 3px -1px rgba(0,0,0,.16),0 2px 4px rgba(0,0,0,.10),0 1px 7px rgba(0,0,0,.08);
  --ags-brand-primary:var(--ags-appbar);
  --ags-brand-secondary:var(--ags-appbar-dark);
  --platform-brand:var(--ags-appbar);
  --platform-brand-strong:var(--ags-appbar-dark);
  --platform-accent:var(--ags-primary);
  --platform-accent-soft:#E8F1FB;
  --platform-canvas:var(--ags-background);
  --platform-surface:var(--ags-surface);
  --platform-text:var(--ags-text);
  --platform-muted:var(--ags-muted);
  --platform-border:var(--ags-border);
  --platform-border-neutral:var(--ags-border);
  --platform-radius:var(--ags-radius);
  --platform-radius-control:var(--ags-control-radius);
  --platform-shadow:var(--ags-shadow);
  --platform-shadow-raised:var(--ags-shadow);
  --ls-primary:var(--ags-primary)!important;
  --ls-primary-strong:var(--ags-primary-dark)!important;
}

/* H644 | Modo escuro - tokens do preset "dashboard" do tweakcn (shadcn/ui). */
html[data-theme="dark"],body[data-theme="dark"],body.theme-dark{
  --ags-primary:oklch(0.5430 0.2046 271.1153);
  --ags-primary-dark:oklch(0.3383 0.1155 271.7354);
  --ags-secondary:oklch(0.4626 0.1706 271.5939);
  --ags-secondary-dark:oklch(0.3808 0.1351 271.5278);
  --ags-background:oklch(0.2404 0.0045 196.8600);
  --ags-surface:oklch(0.2039 0.0025 247.9507);
  --ags-text:oklch(0.9317 0.0272 279.0566);
  --ags-muted:oklch(0.7080 0 0);
  --ags-disabled:oklch(0.7080 0 0/.45);
  --ags-border:oklch(0.3329 0 0);
  --ags-error:oklch(0.5928 0.2081 26.3434);
  --ags-menu-active:oklch(0.3200 0.0040 247.9507);
  --ags-appbar:oklch(0.1600 0.0025 247.9507);
  --ags-appbar-dark:oklch(0.1150 0.0020 247.9507);
  --ags-shadow:0 2px 4px -1px rgba(0,0,0,.45),0 4px 5px 0 rgba(0,0,0,.38),0 1px 10px 0 rgba(0,0,0,.32);
  --ags-shadow-soft:0 2px 3px -1px rgba(0,0,0,.36),0 2px 4px rgba(0,0,0,.30),0 1px 7px rgba(0,0,0,.24);
  --platform-accent-soft:oklch(0.3383 0.1155 271.7354/.35);
}

*,*::before,*::after{box-sizing:border-box}
html,html body{
  background:var(--ags-background)!important;
  color:var(--ags-text)!important;
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif!important;
  -webkit-font-smoothing:antialiased;
}
html body :where(h1,h2,h3,h4,h5,h6,strong,b,label,legend,th){color:var(--ags-text)}
html body :where(p,small,.muted,.subtitle,.description,.hint,.helper-text){color:var(--ags-muted)}
html body a{color:var(--ags-primary)}
html body :where(button,a,input,select,textarea,summary){font-family:inherit}
html body :where(button,a,input,select,textarea,summary):focus-visible{outline:3px solid rgba(24,103,192,.22)!important;outline-offset:2px!important}

/* Compatibilidade de largura: a grade existente ja reserva o menu. */
html body .dashboard-shell,
html body .dashboard-shell.manager-app,
html body .dashboard-shell.operator-app,
html body :where(.main-dashboard,.main-container,.app-screen){background:var(--ags-background)!important}
html body .dashboard-shell>.main-dashboard{min-width:0!important;max-width:none!important;margin-left:0!important}
html body .dashboard-shell>.side-nav+.main-dashboard{width:auto!important}

/* Cabecalho de 64 px e elevacao Material medidos na referencia. */
html body .dashboard-shell :where(.topbar,.topbar.h623-standard-header,.topbar.h624-standard-header),
html body[data-manager-screen] .dashboard-shell.manager-app .topbar.h624-standard-header{
  min-height:64px!important;
  height:64px!important;
  border:0!important;
  border-radius:0!important;
  background:var(--ags-appbar)!important;
  color:#FFFFFF!important;
  box-shadow:var(--ags-shadow)!important;
}
html body .dashboard-shell .topbar :where(.top-title,.top-title span,.top-title h1,.top-title h2,.h623-header-title,.h624-panel-label,.profile-pill,.profile-pill strong,.profile-pill small,.h623-profile-pill,.h623-profile-pill strong,.h623-profile-pill small){color:#FFFFFF!important;-webkit-text-fill-color:#FFFFFF!important}
html body .dashboard-shell .topbar :where(.profile-pill,.h623-profile-pill){min-width:0!important;width:auto!important;height:auto!important;padding:0 4px!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
html body .dashboard-shell .topbar :where(.profile-avatar,.h623-profile-avatar){border:2px solid #FFFFFF!important;background:#B896A4!important;color:#FFFFFF!important}
html body .dashboard-shell .topbar :where(.icon-button,.h623-header-button):not([data-logout]):not(#logoutBtn){border:1px solid rgba(255,255,255,.32)!important;border-radius:var(--ags-control-radius)!important;background:transparent!important;color:#FFFFFF!important;box-shadow:none!important}
html body .dashboard-shell .topbar :where(.icon-button,.h623-header-button):not([data-logout]):not(#logoutBtn):hover{border-color:#FFFFFF!important;background:rgba(255,255,255,.12)!important}

/* Mesmo menu, mesmos links e mesma ordem; somente a aparencia e unificada. */
html body .dashboard-shell .side-nav{border-color:var(--ags-border)!important;background:#FFFFFF!important;box-shadow:0 2px 4px rgba(0,0,0,.10)!important}
html body .dashboard-shell .side-nav :where(.tab-pill,.nav-group-pill>summary){border-radius:var(--ags-control-radius)!important;color:var(--ags-text)!important;font-weight:500!important}
html body .dashboard-shell .side-nav :where(.tab-pill,.nav-group-pill>summary):hover{background:rgba(24,103,192,.07)!important;color:var(--ags-primary)!important}
html body .dashboard-shell .side-nav .tab-pill.active,
html body .dashboard-shell .side-nav .nav-group-pill.active>summary,
html body .dashboard-shell .side-nav .nav-group-pill[open]>summary{border-color:rgba(24,103,192,.30)!important;background:#E8F1FB!important;color:var(--ags-primary-dark)!important;box-shadow:inset 0 -3px 0 var(--ags-primary)!important}
html body .dashboard-shell .side-nav .tab-dot{background:var(--ags-primary)!important}
html body .dashboard-shell :where(.nav-dropdown,.menu-dropdown){border:1px solid var(--ags-border)!important;border-radius:var(--ags-radius)!important;background:#FFFFFF!important;box-shadow:var(--ags-shadow)!important}
html body .dashboard-shell :where(.nav-dropdown,.menu-dropdown) a{color:var(--ags-text)!important}
html body .dashboard-shell :where(.nav-dropdown,.menu-dropdown) a:hover{background:rgba(24,103,192,.07)!important;color:var(--ags-primary)!important}

/* Titulos e caminho da pagina. */
html body :where(.page-heading,.h628-agenda-heading,.h630-new-trip-heading){border-color:transparent!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
html body :where(.page-heading,.h628-agenda-heading,.h630-new-trip-heading) :where(h1,h2,h3){color:var(--ags-text)!important;font-weight:700!important;letter-spacing:-.01em!important}
html body :where(.page-heading,.h628-agenda-heading,.h630-new-trip-heading) p{color:var(--ags-muted)!important}
html body :where(.h628-breadcrumb,.h630-breadcrumb,.breadcrumbs,.breadcrumb){color:var(--ags-muted)!important}
html body :where(.h628-breadcrumb,.h630-breadcrumb,.breadcrumbs,.breadcrumb) a{color:var(--ags-primary)!important}

/* Componente de superficie compartilhado por todas as telas. */
html body :where(
  .dashboard-shell .panel,
  .dashboard-shell .form-panel,
  .dashboard-shell .table-panel,
  .dashboard-shell .manager-block,
  .dashboard-shell .manager-functional-screen,
  .dashboard-shell .manager-single-panel,
  .dashboard-shell .kpi-card,
  .dashboard-shell .metric-card,
  .dashboard-shell .ops-metric-strip>article,
  .dashboard-shell .trip-ops-summary>article,
  .dashboard-shell .manager-summary-grid>article,
  .dashboard-shell .manager-report-grid>article,
  .dashboard-shell .communication-kpi,
  .dashboard-shell .h534-card-light,
  .dashboard-shell .h630-process-strip>article,
  .dashboard-shell .trip-command-panel,
  .dashboard-shell .trip-drawer-panel,
  .access-card,
  body>.card
){border:1px solid var(--ags-border)!important;border-radius:var(--ags-radius)!important;background:var(--ags-surface)!important;color:var(--ags-text)!important;box-shadow:var(--ags-shadow)!important}
html body .dashboard-shell :where(.panel,.form-panel,.table-panel,.manager-block,.kpi-card,.metric-card,.ops-metric-strip>article):hover{border-color:rgba(0,0,0,.18)!important}
html body .dashboard-shell :where(.panel-header,.form-header){border-bottom:1px solid var(--ags-border)!important}
html body .dashboard-shell :where(.panel-header,.form-header) :where(h1,h2,h3){color:var(--ags-text)!important;font-weight:700!important}
html body .dashboard-shell :where(.panel-header,.form-header) small{color:var(--ags-muted)!important}

/* Indicadores compactos com as faixas de cor da referencia. */
html body .dashboard-shell :where(.kpi-card,.metric-card,.ops-metric-strip>article,.trip-ops-summary>article,.manager-summary-grid>article){min-width:0!important;min-height:96px!important;padding:16px!important;border-left-width:4px!important}
html body .dashboard-shell :where(.kpi-card,.metric-card,.ops-metric-strip>article,.trip-ops-summary>article,.manager-summary-grid>article) :where(span,small){color:var(--ags-muted)!important}
html body .dashboard-shell :where(.kpi-card,.metric-card,.ops-metric-strip>article,.trip-ops-summary>article,.manager-summary-grid>article)>strong,
html body .dashboard-shell .kpi-card>div>strong{color:var(--ags-text)!important;font-weight:700!important}
html body .dashboard-shell :where(.blue-kpi,.kpi-card:nth-child(6n+1),.metric-card:nth-child(6n+1),.ops-metric-strip>article:nth-child(6n+1)){border-left-color:#2196F3!important}
html body .dashboard-shell :where(.green-kpi,.kpi-card:nth-child(6n+2),.metric-card:nth-child(6n+2),.ops-metric-strip>article:nth-child(6n+2)){border-left-color:#4CAF50!important}
html body .dashboard-shell :where(.yellow-kpi,.kpi-card:nth-child(6n+3),.metric-card:nth-child(6n+3),.ops-metric-strip>article:nth-child(6n+3)){border-left-color:#FB8C00!important}
html body .dashboard-shell :where(.purple-kpi,.kpi-card:nth-child(6n+4),.metric-card:nth-child(6n+4),.ops-metric-strip>article:nth-child(6n+4)){border-left-color:#7E57C2!important}
html body .dashboard-shell :where(.red-kpi,.kpi-card:nth-child(6n+5),.metric-card:nth-child(6n+5),.ops-metric-strip>article:nth-child(6n+5)){border-left-color:#B00020!important}
html body .dashboard-shell :where(.slate-kpi,.kpi-card:nth-child(6n),.metric-card:nth-child(6n),.ops-metric-strip>article:nth-child(6n)){border-left-color:#909399!important}

/* Campos no padrao Material da pagina modelo. */
html body :where(.dashboard-shell,.access-shell) :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){min-height:44px!important;border:1px solid rgba(0,0,0,.24)!important;border-radius:var(--ags-control-radius)!important;background:#FFFFFF!important;color:var(--ags-text)!important;box-shadow:none!important;outline:0!important}
html body :where(.dashboard-shell,.access-shell) :where(input,textarea)::placeholder{color:var(--ags-disabled)!important;opacity:1!important}
html body :where(.dashboard-shell,.access-shell) :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea):hover{border-color:rgba(0,0,0,.50)!important}
html body :where(.dashboard-shell,.access-shell) :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea):focus{border-color:var(--ags-primary)!important;box-shadow:0 0 0 2px rgba(24,103,192,.16)!important}
html body :where(.dashboard-shell,.access-shell) label{color:var(--ags-text)!important}
html body :where(.dashboard-shell,.access-shell) label>span{color:var(--ags-muted)!important}
html body :where(.dashboard-shell,.access-shell) fieldset{border-color:var(--ags-border)!important;border-radius:var(--ags-radius)!important}

/* Botoes primarios e secundarios. */
html body :where(.dashboard-shell,.access-shell) :where(button,a.primary-action,a.button,.button){border-radius:var(--ags-control-radius)!important;font-weight:600!important;letter-spacing:0!important;text-transform:none!important}
html body :where(.dashboard-shell,.access-shell) :where(button[type="submit"],.primary-action,.primary-button,.driver-action.primary,.h534-action:not(.secondary),.action-primary){border-color:var(--ags-primary)!important;background:var(--ags-primary)!important;color:#FFFFFF!important;-webkit-text-fill-color:#FFFFFF!important;box-shadow:0 2px 4px rgba(24,103,192,.24)!important}
html body :where(.dashboard-shell,.access-shell) :where(button[type="submit"],.primary-action,.primary-button,.driver-action.primary,.h534-action:not(.secondary),.action-primary):hover{border-color:var(--ags-primary-dark)!important;background:var(--ags-primary-dark)!important;color:#FFFFFF!important}
html body .dashboard-shell :where(.secondary-action,.filter-button,.page-actions button:not(.primary-action),.quick-actions button:not(.primary-action),.panel-header button,.h534-action.secondary){border:1px solid rgba(0,0,0,.20)!important;background:#FFFFFF!important;color:var(--ags-primary)!important;box-shadow:none!important}
html body .dashboard-shell :where(.secondary-action,.filter-button,.page-actions button:not(.primary-action),.quick-actions button:not(.primary-action),.panel-header button,.h534-action.secondary):hover{border-color:var(--ags-primary)!important;background:rgba(24,103,192,.07)!important}
html body :where(button,a)[disabled],html body :where(button,a).disabled{opacity:.55!important;box-shadow:none!important}

/* Tabelas brancas, cabecalho cinza e divisores neutros. */
html body .dashboard-shell :where(.table-wrap,.h534-table-wrap){border:1px solid var(--ags-border)!important;border-radius:var(--ags-radius)!important;background:#FFFFFF!important;box-shadow:none!important}
html body .dashboard-shell :where(.data-table,.h534-table){background:#FFFFFF!important;color:var(--ags-text)!important}
html body .dashboard-shell :where(.data-table,.h534-table) th{padding:10px 12px!important;border-bottom:1px solid var(--ags-border)!important;background:#F5F5F5!important;color:var(--ags-muted)!important;font-size:.75rem!important;font-weight:700!important;letter-spacing:.02em!important;text-transform:uppercase!important}
html body .dashboard-shell :where(.data-table,.h534-table) td{padding:10px 12px!important;border-bottom:1px solid var(--ags-border)!important;background:#FFFFFF!important;color:var(--ags-text)!important}
html body .dashboard-shell :where(.data-table,.h534-table) tbody tr:hover td{background:rgba(24,103,192,.07)!important}

/* Chips e estados compactos. */
html body .dashboard-shell :where(.badge,.status-badge,.panel-tag,.h584-mini-badge,.h534-badge,.trip-status,.driver-status-badge,.app-connection-badge,.driver-code-state,.trip-unread-summary){min-height:24px!important;padding:2px 12px!important;border-radius:9999px!important;border-color:transparent!important;font-size:.75rem!important;font-weight:600!important;line-height:20px!important;box-shadow:none!important}
html body .dashboard-shell :where(.success,.status-success,.badge-success,[data-status="success"]){background:#E8F5E9!important;color:#1E7201!important}
html body .dashboard-shell :where(.warning,.status-warning,.badge-warning,[data-status="warning"]){background:#FFF3E0!important;color:#A65300!important}
html body .dashboard-shell :where(.danger,.error,.status-danger,.badge-danger,[data-status="danger"]){background:#FCE8EC!important;color:#B00020!important}
html body .dashboard-shell :where(.info,.status-info,.badge-info,[data-status="info"]){background:#E3F2FD!important;color:#0D5FA8!important}

/* Login, recuperacao e portal. */
html body :where(.access-shell,.portal-shell){background:var(--ags-background)!important}
html body :where(.access-brand,.portal-brand){background:var(--ags-appbar)!important;color:#FFFFFF!important}
html body :where(.access-brand,.portal-brand) :where(h1,h2,h3,p,span,small,strong){color:#FFFFFF!important}
html body .access-card{border:1px solid var(--ags-border)!important;border-radius:var(--ags-radius)!important;background:#FFFFFF!important;color:var(--ags-text)!important;box-shadow:var(--ags-shadow)!important}
html body .access-card :where(.eyebrow,a){color:var(--ags-primary)!important}
html body .access-card :where(h1,h2,h3,strong){color:var(--ags-text)!important}
html body .access-card :where(p,span,small){color:var(--ags-muted)!important}

/* Credenciais do motorista: largura livre e linhas sem sobreposicao. */
html body .dashboard-shell.operator-app .qr-instructions .panel-header{display:grid!important;grid-template-columns:minmax(0,1fr)!important;align-items:start!important}
html body .dashboard-shell.operator-app #driverQrStatus{display:block!important;max-width:100%!important;line-height:1.4!important;overflow-wrap:anywhere!important}
html body .dashboard-shell.operator-app .qr-display-panel .qr-box{width:100%!important;min-width:0!important;justify-items:stretch!important}
html body .dashboard-shell.operator-app .qr-display-panel .qr-render:has(.driver-credentials-card),
html body .dashboard-shell.operator-app .qr-display-panel .qr-render:has(.activation-code-card),
html body .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials,
html body .dashboard-shell.operator-app #driverQrCanvas.has-activation-code{box-sizing:border-box!important;display:block!important;width:100%!important;max-width:none!important;height:auto!important;min-height:0!important;padding:0!important;border:0!important;background:transparent!important}
html body .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .driver-credentials-card{width:100%!important;max-width:620px!important;margin-inline:auto!important}
html body .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .credential-row{grid-template-columns:110px minmax(180px,1fr) auto!important;width:100%!important}
html body .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .credential-row>strong{min-width:0!important;white-space:normal!important;word-break:normal!important;overflow-wrap:anywhere!important}

/* Sair permanece azul com texto e icone brancos. */
html body [data-logout],html body #logoutBtn,html body .nav-logout{border-color:var(--ags-primary)!important;background:var(--ags-primary)!important;color:#FFFFFF!important;-webkit-text-fill-color:#FFFFFF!important;box-shadow:0 2px 7px rgba(24,103,192,.28)!important}
html body [data-logout] *,html body #logoutBtn *,html body .nav-logout *{color:#FFFFFF!important;-webkit-text-fill-color:#FFFFFF!important;stroke:#FFFFFF!important}
html body [data-logout]:hover,html body [data-logout]:focus-visible,html body #logoutBtn:hover,html body #logoutBtn:focus-visible,html body .nav-logout:hover,html body .nav-logout:focus-visible{border-color:var(--ags-primary-dark)!important;background:var(--ags-primary-dark)!important;color:#FFFFFF!important}

@media(max-width:920px){html body .main-dashboard{margin-left:0!important}}
@media(max-width:760px){
  html body .dashboard-shell :where(.topbar,.h624-standard-header){min-height:58px!important;height:58px!important}
  html body .dashboard-shell :where(.data-table,.h534-table) :where(th,td){padding:9px 10px!important}
  html body .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .credential-row{grid-template-columns:minmax(0,1fr) auto!important}
  html body .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .credential-row>span{grid-column:1/-1!important}
}
@media(max-width:440px){
  html body .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .credential-row{grid-template-columns:1fr!important}
  html body .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .credential-row>button,
  html body .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .credential-copy{width:100%!important;justify-self:stretch!important}
}
@media(prefers-reduced-motion:reduce){html body *,html body *::before,html body *::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}

/* H642.1 | Prioridade sobre valores visuais embutidos nas folhas de layout. */
html body[data-theme][data-theme],html body.portal-page.portal-page{background:var(--ags-background)!important;background-color:var(--ags-background)!important;background-image:none!important;color:var(--ags-text)!important;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell :is(.main-dashboard,.main-container,.app-screen){background:var(--ags-background)!important;background-color:var(--ags-background)!important;background-image:none!important;color:var(--ags-text)!important}

html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar{box-sizing:border-box!important;display:flex!important;min-height:64px!important;height:64px!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;padding:6px clamp(14px,1.7vw,24px)!important;overflow:visible!important;border:0!important;border-radius:0!important;background:var(--ags-appbar)!important;background-color:var(--ags-appbar)!important;background-image:none!important;color:#fff!important;box-shadow:var(--ags-shadow)!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar::before,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar::after{background:none!important;background-image:none!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar .top-title.top-title{display:flex!important;min-width:0!important;align-items:center!important;gap:9px!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar .top-title.top-title::after{display:none!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar .topbar-logo.topbar-logo{display:block!important;width:38px!important;min-width:38px!important;max-width:38px!important;height:46px!important;max-height:46px!important;margin:0!important;padding:0!important;object-fit:contain!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar .top-title.top-title h1{margin:0!important;color:#fff!important;font-size:1.16rem!important;font-weight:700!important;line-height:1.12!important;letter-spacing:-.01em!important;white-space:nowrap!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar .top-title.top-title span{color:rgba(255,255,255,.82)!important;font-size:.68rem!important;font-weight:600!important;line-height:1.1!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar .top-actions.top-actions{display:flex!important;min-width:0!important;align-items:center!important;justify-content:flex-end!important;flex-wrap:nowrap!important;gap:7px!important;margin-left:auto!important}
html body[data-manager-screen][data-manager-screen] .dashboard-shell.manager-app .topbar.topbar .top-actions.top-actions{overflow-x:auto!important;scrollbar-width:thin}
html body[data-manager-screen][data-manager-screen] .dashboard-shell.manager-app .topbar.topbar select.filter-button.filter-button{width:auto!important;min-width:0!important;max-width:170px!important;height:40px!important;min-height:40px!important;padding:0 28px 0 10px!important;border:1px solid rgba(255,255,255,.42)!important;border-radius:var(--ags-control-radius)!important;background-color:#fff!important;color:var(--ags-text)!important;font-size:.82rem!important;box-shadow:none!important}

html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .page-heading.page-heading{border:0!important;border-radius:0!important;background:transparent!important;background-image:none!important;box-shadow:none!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .panel.panel,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .form-panel.form-panel,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .table-panel.table-panel,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .manager-block.manager-block,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .manager-functional-screen.manager-functional-screen,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .manager-single-panel.manager-single-panel,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .kpi-card.kpi-card,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .metric-card.metric-card,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .ops-metric-strip.ops-metric-strip>article,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .trip-ops-summary.trip-ops-summary>article{border-top-color:var(--ags-border)!important;border-right-color:var(--ags-border)!important;border-bottom-color:var(--ags-border)!important;border-radius:var(--ags-radius)!important;background:var(--ags-surface)!important;background-image:none!important;color:var(--ags-text)!important;box-shadow:var(--ags-shadow)!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .kpi-card.kpi-card,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .metric-card.metric-card,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .ops-metric-strip.ops-metric-strip>article,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .trip-ops-summary.trip-ops-summary>article{min-width:0!important;min-height:96px!important;padding:16px!important;border-left-width:4px!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell :is(.kpi-card.kpi-card,.metric-card.metric-card):nth-child(6n+1),html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .ops-metric-strip.ops-metric-strip>article:nth-child(6n+1){border-left-color:#2196f3!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell :is(.kpi-card.kpi-card,.metric-card.metric-card):nth-child(6n+2),html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .ops-metric-strip.ops-metric-strip>article:nth-child(6n+2){border-left-color:#4caf50!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell :is(.kpi-card.kpi-card,.metric-card.metric-card):nth-child(6n+3),html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .ops-metric-strip.ops-metric-strip>article:nth-child(6n+3){border-left-color:#fb8c00!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell :is(.kpi-card.kpi-card,.metric-card.metric-card):nth-child(6n+4),html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .ops-metric-strip.ops-metric-strip>article:nth-child(6n+4){border-left-color:#7e57c2!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell :is(.kpi-card.kpi-card,.metric-card.metric-card):nth-child(6n+5),html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .ops-metric-strip.ops-metric-strip>article:nth-child(6n+5){border-left-color:#b00020!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell :is(.kpi-card.kpi-card,.metric-card.metric-card):nth-child(6n),html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .ops-metric-strip.ops-metric-strip>article:nth-child(6n){border-left-color:#909399!important}

html body[data-theme][data-theme] .dashboard-shell.dashboard-shell :is(.table-wrap.table-wrap,.h534-table-wrap.h534-table-wrap){border-color:var(--ags-border)!important;border-radius:var(--ags-radius)!important;background:#fff!important;box-shadow:none!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell :is(.data-table.data-table,.h534-table.h534-table) th{border-bottom-color:var(--ags-border)!important;background:#f5f5f5!important;color:var(--ags-muted)!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell :is(.data-table.data-table,.h534-table.h534-table) td{border-bottom-color:var(--ags-border)!important;background:#fff!important;color:var(--ags-text)!important}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell input:not([type="checkbox"]):not([type="radio"]),html body[data-theme][data-theme] .dashboard-shell.dashboard-shell select,html body[data-theme][data-theme] .dashboard-shell.dashboard-shell textarea,html body.portal-page.portal-page .access-shell.access-shell input:not([type="checkbox"]):not([type="radio"]),html body.portal-page.portal-page .access-shell.access-shell select,html body.portal-page.portal-page .access-shell.access-shell textarea{border:1px solid rgba(0,0,0,.24)!important;border-radius:var(--ags-control-radius)!important;background:#fff!important;background-image:none!important;color:var(--ags-text)!important;box-shadow:none!important}

html body.portal-page.portal-page :is(.access-shell,.portal-shell){background:var(--ags-background)!important;background-color:var(--ags-background)!important;background-image:none!important}
html body.portal-page.portal-page .access-card.access-card{border:1px solid var(--ags-border)!important;border-radius:var(--ags-radius)!important;background:#fff!important;background-image:none!important;color:var(--ags-text)!important;box-shadow:var(--ags-shadow)!important}

html body [data-logout][data-logout][data-logout][data-logout][data-logout][data-logout],html body #logoutBtn#logoutBtn,html body .nav-logout.nav-logout.nav-logout.nav-logout.nav-logout.nav-logout{border-color:var(--ags-primary)!important;border-radius:var(--ags-control-radius)!important;background:var(--ags-primary)!important;background-color:var(--ags-primary)!important;background-image:none!important;color:#fff!important;-webkit-text-fill-color:#fff!important;box-shadow:0 2px 7px rgba(24,103,192,.28)!important}
html body [data-logout][data-logout][data-logout][data-logout][data-logout][data-logout] *,html body #logoutBtn#logoutBtn *,html body .nav-logout.nav-logout.nav-logout.nav-logout.nav-logout.nav-logout *{color:#fff!important;-webkit-text-fill-color:#fff!important;stroke:#fff!important}
html body [data-logout][data-logout][data-logout][data-logout][data-logout][data-logout]:hover,html body #logoutBtn#logoutBtn:hover,html body .nav-logout.nav-logout.nav-logout.nav-logout.nav-logout.nav-logout:hover{border-color:var(--ags-primary-dark)!important;background:var(--ags-primary-dark)!important;color:#fff!important}

@media(max-width:760px){html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar{min-height:58px!important;height:58px!important;padding:6px 10px!important}html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar .topbar-logo.topbar-logo{width:34px!important;min-width:34px!important;max-width:34px!important;height:40px!important}html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar .top-title.top-title h1{font-size:1rem!important}}

/* H642.2 | Cabecalho contido sem ocultar filtros ou acoes. */
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar{
  width:calc(100% + 40px)!important;
  min-width:0!important;
  max-width:calc(100% + 40px)!important;
}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar .top-title.top-title{
  flex:0 1 auto!important;
  max-width:320px!important;
}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar #managerScreenTitle,
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar #screenTitle{
  margin:0!important;
  color:#FFFFFF!important;
  font-size:1.16rem!important;
  font-weight:700!important;
  line-height:1.12!important;
  letter-spacing:-.01em!important;
  white-space:nowrap!important;
}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar .top-actions.top-actions{
  width:auto!important;
  max-width:calc(100% - 270px)!important;
  flex:0 1 auto!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
}

@media(max-width:760px){
  html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar{
    width:calc(100% + 20px)!important;
    max-width:calc(100% + 20px)!important;
  }
  html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar .top-title.top-title{
    flex:1 1 auto!important;
    max-width:calc(100% - 110px)!important;
  }
  html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar .top-actions.top-actions{
    width:auto!important;
    max-width:none!important;
    flex:0 0 auto!important;
    overflow:visible!important;
  }
  html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar #managerScreenTitle,
  html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar #screenTitle{
    max-width:190px!important;
    overflow:hidden!important;
    font-size:1rem!important;
    text-overflow:ellipsis!important;
  }
}

/* H642.3 | Acabamento final do perfil e das credenciais do motorista. */
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar :is(.profile-pill,.h623-profile-pill)>div{
  display:grid!important;
  min-width:0!important;
  gap:1px!important;
  line-height:1.05!important;
}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar :is(.profile-pill,.h623-profile-pill)>div>strong{
  display:block!important;
  color:#fff!important;
  font-size:.8rem!important;
  line-height:1.1!important;
}
html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar :is(.profile-pill,.h623-profile-pill)>div>:is(span,small){
  display:block!important;
  margin:0!important;
  color:rgba(255,255,255,.86)!important;
  font-size:.65rem!important;
  line-height:1.1!important;
}
html body[data-theme][data-theme] .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .driver-credentials-card.driver-credentials-card{
  border:1px solid var(--ags-border)!important;
  border-radius:var(--ags-radius)!important;
  background:#fff!important;
  color:var(--ags-text)!important;
  box-shadow:var(--ags-shadow)!important;
}
html body[data-theme][data-theme] .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .credential-row.credential-row{
  border:1px solid var(--ags-border)!important;
  border-radius:var(--ags-control-radius)!important;
  background:#fff!important;
  color:var(--ags-text)!important;
  box-shadow:none!important;
}
html body[data-theme][data-theme] .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .credential-row.credential-row>span{
  color:var(--ags-muted)!important;
}
html body[data-theme][data-theme] .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .credential-row.credential-row>strong{
  color:var(--ags-text)!important;
}
/* So os "Copiar" de cada linha sao secundarios. O "Copiar login e senha"
   (.credential-copy) e a acao principal do cartao e fica com o visual primario
   do painel, definido em ui-h584.css. Ele estava incluido aqui e virava um
   botao branco - mas como tambem casa com a regra de botao primario mais acima,
   que forca -webkit-text-fill-color branco, e o fill vence o color na hora de
   pintar o texto, o rotulo sumia: letra branca sobre fundo branco. */
html body[data-theme][data-theme] .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .credential-row>button{
  border:1px solid var(--ags-primary)!important;
  border-radius:var(--ags-control-radius)!important;
  background:#fff!important;
  color:var(--ags-primary)!important;
  -webkit-text-fill-color:var(--ags-primary)!important;
  box-shadow:none!important;
}

/* H643 | No celular, preserva o avatar e recolhe apenas o texto auxiliar do perfil. */
@media(max-width:760px){
  html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar :is(.profile-pill,.h623-profile-pill)>div{
    display:none!important;
  }
  html body[data-theme][data-theme] .dashboard-shell.dashboard-shell .topbar.topbar :is(.profile-pill,.h623-profile-pill){
    display:none!important;
    flex:0 0 auto!important;
    padding:0!important;
  }
}

/* H644.1 | Modo escuro - substitui os brancos fixos que as regras acima nao herdam via variavel. */
html[data-theme="dark"] .dashboard-shell .side-nav{background:var(--ags-surface)!important;box-shadow:0 2px 4px rgba(0,0,0,.45)!important}
html[data-theme="dark"] .dashboard-shell .side-nav .nav-group-pill.active>summary,
html[data-theme="dark"] .dashboard-shell .side-nav .nav-group-pill[open]>summary{background:color-mix(in srgb,var(--ags-primary) 22%,var(--ags-surface) 78%)!important}
html[data-theme="dark"] .dashboard-shell :where(.nav-dropdown,.menu-dropdown){background:var(--ags-surface)!important}

html[data-theme="dark"] :where(.dashboard-shell,.access-shell) :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){background:var(--ags-surface)!important;color:var(--ags-text)!important;border-color:rgba(255,255,255,.24)!important}
html[data-theme="dark"] :where(.dashboard-shell,.access-shell) :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea):hover{border-color:rgba(255,255,255,.5)!important}
html[data-theme="dark"] .dashboard-shell :where(.secondary-action,.filter-button,.page-actions button:not(.primary-action),.quick-actions button:not(.primary-action),.panel-header button,.h534-action.secondary){background:var(--ags-surface)!important;border-color:rgba(255,255,255,.2)!important}
html[data-theme="dark"] .dashboard-shell .topbar select.filter-button.filter-button{background-color:var(--ags-surface)!important;color:var(--ags-text)!important;border-color:rgba(255,255,255,.3)!important}

html[data-theme="dark"] .dashboard-shell :where(.table-wrap,.h534-table-wrap,.data-table,.h534-table),
html[data-theme="dark"] .dashboard-shell :where(.data-table,.h534-table) td{background:var(--ags-surface)!important}
html[data-theme="dark"] .dashboard-shell :where(.data-table,.h534-table) th{background:var(--ags-background)!important}
html[data-theme="dark"] .dashboard-shell :where(.data-table,.h534-table) tbody tr:hover td{background:color-mix(in srgb,var(--ags-primary) 14%,var(--ags-surface) 86%)!important}

html[data-theme="dark"] .dashboard-shell :where(.success,.status-success,.badge-success,[data-status="success"]){background:rgba(76,175,80,.20)!important;color:#A5D6A7!important}
html[data-theme="dark"] .dashboard-shell :where(.warning,.status-warning,.badge-warning,[data-status="warning"]){background:rgba(251,140,0,.20)!important;color:#FFCC80!important}
html[data-theme="dark"] .dashboard-shell :where(.danger,.error,.status-danger,.badge-danger,[data-status="danger"]){background:rgba(217,60,90,.22)!important;color:#FF9EB0!important}
html[data-theme="dark"] .dashboard-shell :where(.info,.status-info,.badge-info,[data-status="info"]){background:rgba(33,150,243,.20)!important;color:#90CAF9!important}

html[data-theme="dark"] .access-card,
html[data-theme="dark"] body.portal-page .access-card.access-card{background:var(--ags-surface)!important}

html[data-theme="dark"] .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .driver-credentials-card.driver-credentials-card,
html[data-theme="dark"] .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .credential-row.credential-row,
html[data-theme="dark"] .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials :is(.credential-copy,.credential-row>button){background:var(--ags-surface)!important}

/* H647 | Modo escuro para o menu horizontal (navigation-h605.css) e o sistema
   de estilos ui-h584.css, que estilizam boa parte do painel com cores fixas
   sem nenhuma variavel de tema. */
html[data-theme="dark"]{
  --h584-bg:var(--ags-background);
  --h584-card:var(--ags-surface);
  --h584-soft:var(--ags-surface);
  --h584-border:var(--ags-border);
  --h584-text:var(--ags-text);
  --h584-muted:var(--ags-muted);
  --h584-navy:var(--ags-surface);
}

html[data-theme="dark"] body .dashboard-shell .side-nav{background:var(--ags-surface)!important;border-bottom-color:var(--ags-border)!important}
html[data-theme="dark"] body .dashboard-shell .side-nav .nav-section{background:var(--ags-background)!important;border-color:var(--ags-border)!important}
html[data-theme="dark"] body .dashboard-shell .side-nav :where(.tab-pill,.nav-group-pill>summary){background:var(--ags-surface)!important;color:var(--ags-text)!important;border-color:var(--ags-border)!important}
html[data-theme="dark"] body .dashboard-shell .side-nav :where(.tab-pill,.nav-group-pill>summary):hover,
html[data-theme="dark"] body .dashboard-shell .side-nav .nav-group-pill[open]>summary{background:color-mix(in srgb,var(--ags-primary) 18%,var(--ags-surface) 82%)!important;border-color:var(--ags-primary)!important;color:var(--ags-text)!important}
html[data-theme="dark"] body .dashboard-shell .side-nav .tab-pill.active,
html[data-theme="dark"] body .dashboard-shell .side-nav .nav-group-pill.active>summary{background:var(--ags-menu-active)!important;border-color:rgba(255,255,255,.4)!important;color:#fff!important}
html[data-theme="dark"] body .dashboard-shell .side-nav :where(.tab-label,.nav-group-label){color:var(--ags-text)!important}
html[data-theme="dark"] body .dashboard-shell .side-nav .tab-sub{color:var(--ags-muted)!important}
html[data-theme="dark"] body .dashboard-shell .side-nav .tab-pill.active .tab-sub,
html[data-theme="dark"] body .dashboard-shell .side-nav .nav-group-pill.active>summary .tab-sub{color:rgba(255,255,255,.85)!important}
html[data-theme="dark"] body .dashboard-shell .side-nav .tab-dot{background:var(--ags-muted)!important}
html[data-theme="dark"] body .dashboard-shell .side-nav .tab-pill.active .tab-dot,
html[data-theme="dark"] body .dashboard-shell .side-nav .nav-group-pill.active>summary .tab-dot{background:#fff!important}
html[data-theme="dark"] body .dashboard-shell.operator-app .side-nav,
html[data-theme="dark"] body .dashboard-shell.manager-app .side-nav{background:var(--ags-surface)!important}
html[data-theme="dark"] body .dashboard-shell.operator-app .side-nav :where(.tab-pill,.nav-group-pill>summary),
html[data-theme="dark"] body .dashboard-shell.manager-app .side-nav :where(.tab-pill,.nav-group-pill>summary){background:var(--ags-surface)!important;color:var(--ags-text)!important}
html[data-theme="dark"] body .dashboard-shell.operator-app .side-nav :where(.tab-pill,.nav-group-pill>summary) :where(.tab-label,.nav-group-label,.tab-sub),
html[data-theme="dark"] body .dashboard-shell.manager-app .side-nav :where(.tab-pill,.nav-group-pill>summary) :where(.tab-label,.nav-group-label,.tab-sub){color:var(--ags-text)!important}
html[data-theme="dark"] body .dashboard-shell.operator-app .side-nav .tab-pill.active,
html[data-theme="dark"] body .dashboard-shell.operator-app .side-nav .nav-group-pill.active>summary,
html[data-theme="dark"] body .dashboard-shell.manager-app .side-nav .tab-pill.active,
html[data-theme="dark"] body .dashboard-shell.manager-app .side-nav .nav-group-pill.active>summary{background:var(--ags-menu-active)!important;color:#fff!important}
html[data-theme="dark"] body .dashboard-shell.operator-app .nav-section a,
html[data-theme="dark"] body .dashboard-shell.manager-app .nav-section a{background:transparent!important;color:var(--ags-text)!important}
html[data-theme="dark"] body .dashboard-shell.operator-app .nav-section a:hover,
html[data-theme="dark"] body .dashboard-shell.operator-app .nav-section a.active,
html[data-theme="dark"] body .dashboard-shell.manager-app .nav-section a:hover,
html[data-theme="dark"] body .dashboard-shell.manager-app .nav-section a.active{background:var(--ags-menu-active)!important;color:#fff!important}

html[data-theme="dark"] body .dashboard-shell.manager-app .kpi-icon,
html[data-theme="dark"] body .kpi-icon{background:var(--ags-surface)!important;border-color:var(--ags-border)!important}

html[data-theme="dark"] :is(
  .menu-button,.icon-button,.filter-button,.text-button,
  .profile-pill,.date-card,.table-wrap,
  .ops-metric-strip article,.h584-rail-item,.h584-quick-actions a,
  .trip-command-panel,.trip-command-panel>header,.trip-command-tabs,
  .trip-command-grid>div,.mapa-resumo.compact-stats article,
  .mapa-rota-historico,.mapa-rota-historico button,
  .h584-trip-summary .route,.h584-timeline-step i,
  .app-screen[data-screen-panel="registrations"] .quick-menu-card,
  .driver-card-row,.optional-fields,.manager-grid .kpi-card,
  .manager-summary-grid article,.h584-demand-cards div
){background:var(--ags-surface)!important;border-color:var(--ags-border)!important;color:var(--ags-text)!important}

html[data-theme="dark"] .data-table thead{background:var(--ags-background)!important}
html[data-theme="dark"] .data-table tbody tr:hover{background:color-mix(in srgb,var(--ags-primary) 12%,var(--ags-surface) 88%)!important}
html[data-theme="dark"] :is(.menu-button,.icon-button,.filter-button,.text-button):hover,
html[data-theme="dark"] .h584-quick-actions a:hover,
html[data-theme="dark"] .app-screen[data-screen-panel="registrations"] .quick-menu-card:hover{background:color-mix(in srgb,var(--ags-primary) 16%,var(--ags-surface) 84%)!important;border-color:var(--ags-primary)!important;color:var(--ags-text)!important}

html[data-theme="dark"] .system-online{background:rgba(76,175,80,.20)!important;border-color:rgba(76,175,80,.4)!important;color:#A5D6A7!important}
html[data-theme="dark"] .h584-mini-badge{background:rgba(217,60,90,.22)!important;color:#FF9EB0!important}
html[data-theme="dark"] .operator-trip-table tbody tr.selected,
html[data-theme="dark"] .operator-trip-table tbody tr[aria-selected="true"]{background:rgba(76,175,80,.16)!important}
html[data-theme="dark"] .trip-command-tabs button.active,
html[data-theme="dark"] .mapa-rota-historico button:nth-of-type(3){background:color-mix(in srgb,var(--ags-primary) 22%,var(--ags-surface) 78%)!important;color:var(--ags-text)!important;border-color:var(--ags-primary)!important}

/* H648 | ui-polish-h583.css: caixas de icone de estado vazio/erro nas tabelas. */
html[data-theme="dark"] .ls-table-state{color:var(--ags-muted)!important}
html[data-theme="dark"] .ls-table-state-icon{background:var(--ags-surface)!important;border-color:var(--ags-border)!important;color:var(--ags-text)!important}
html[data-theme="dark"] .ls-table-state--error .ls-table-state-icon{background:rgba(217,60,90,.2)!important;border-color:rgba(217,60,90,.4)!important;color:#FF9EB0!important}
html[data-theme="dark"] .ls-table-state-copy strong{color:var(--ags-text)!important}
html[data-theme="dark"] .ls-table-state-copy small{color:var(--ags-muted)!important}
html[data-theme="dark"] .ls-table-state-skeleton i{background:var(--ags-border)!important}
html[data-theme="dark"] .empty-row td{color:var(--ags-muted)!important}

/* H644.2 | Contrapartida escura das regras H642.1/H642.3, que fixam branco com seletores reforçados. */
html[data-theme="dark"] body[data-manager-screen][data-manager-screen] .dashboard-shell.manager-app .topbar.topbar select.filter-button.filter-button{background-color:var(--ags-surface)!important;border-color:rgba(255,255,255,.3)!important}
html[data-theme="dark"] body[data-theme][data-theme] .dashboard-shell.dashboard-shell :is(.table-wrap.table-wrap,.h534-table-wrap.h534-table-wrap){background:var(--ags-surface)!important}
html[data-theme="dark"] body[data-theme][data-theme] .dashboard-shell.dashboard-shell :is(.data-table.data-table,.h534-table.h534-table) th{background:var(--ags-background)!important}
html[data-theme="dark"] body[data-theme][data-theme] .dashboard-shell.dashboard-shell :is(.data-table.data-table,.h534-table.h534-table) td{background:var(--ags-surface)!important}
html[data-theme="dark"] body[data-theme][data-theme] .dashboard-shell.dashboard-shell input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] body[data-theme][data-theme] .dashboard-shell.dashboard-shell select,
html[data-theme="dark"] body[data-theme][data-theme] .dashboard-shell.dashboard-shell textarea,
html[data-theme="dark"] body.portal-page.portal-page .access-shell.access-shell input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] body.portal-page.portal-page .access-shell.access-shell select,
html[data-theme="dark"] body.portal-page.portal-page .access-shell.access-shell textarea{background:var(--ags-surface)!important;background-image:none!important;border-color:rgba(255,255,255,.24)!important}
html[data-theme="dark"] body.portal-page.portal-page .access-card.access-card{background:var(--ags-surface)!important}
html[data-theme="dark"] body[data-theme][data-theme] .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .driver-credentials-card.driver-credentials-card{background:var(--ags-surface)!important}
html[data-theme="dark"] body[data-theme][data-theme] .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials .credential-row.credential-row{background:var(--ags-surface)!important}
html[data-theme="dark"] body[data-theme][data-theme] .dashboard-shell.operator-app #driverQrCanvas.has-driver-credentials :is(.credential-copy,.credential-row>button){background:var(--ags-surface)!important}

/* H645 | Botao de alternar tema (claro/escuro). */
.theme-toggle-btn{display:inline-flex!important;align-items:center;justify-content:center;width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important;padding:0!important;font-size:1.05rem;line-height:1;cursor:pointer;}
.theme-toggle-btn.floating-theme-toggle{position:fixed;right:18px;top:18px;z-index:120;width:46px!important;height:46px!important;border-radius:50%!important;border:1px solid var(--ags-border)!important;background:var(--ags-surface)!important;color:var(--ags-text)!important;box-shadow:var(--ags-shadow)!important;}
.theme-toggle-btn.floating-theme-toggle:hover{border-color:var(--ags-primary)!important;}

/* H658 | Botao "alternar painel" (Gestor <-> Operador), visivel so para contas ADMIN. */
.panel-switch-btn{display:inline-flex!important;align-items:center;justify-content:center;width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important;padding:0!important;text-decoration:none!important;cursor:pointer;}
.panel-switch-btn svg{width:19px;height:19px;}
.topbar .panel-switch-btn,
.topbar .panel-switch-btn *{color:#fff!important;stroke:#fff!important;}

/* H646 | Rede de seguranca do modo escuro: as folhas de login (login-ags-h608.css etc.) fixam
   texto em rgba(0,0,0,x) com !important. O seletor [data-theme="dark"] repetido eleva a
   especificidade acima de qualquer regra dessas folhas sem precisar copiar cada uma. */
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body.portal-page :where(h1,h2,h3,h4,strong,b,label){color:var(--ags-text)!important}
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body.portal-page :where(p,span,small){color:var(--ags-muted)!important}
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body.portal-page :where(a){color:var(--ags-primary)!important}
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body.portal-page :where(.access-card,.login-solo-card,.login-uni-card){background:var(--ags-surface)!important;border-color:var(--ags-border)!important}
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body.portal-page :where(.login-uni-shell,.access-shell){background:transparent!important}
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body.portal-page :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){background:var(--ags-surface)!important;color:var(--ags-text)!important;border-color:rgba(255,255,255,.24)!important}
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body.portal-page{
  background-color:var(--ags-background)!important;
  background-image:url("../img/login-background-dark.png")!important;
  background-repeat:repeat!important;
  background-position:center!important;
  background-attachment:fixed!important;
  color:var(--ags-text)!important;
}

/* H649 | Topbar escura: linha fina nas bordas e botao Sair em cinza escuro com contorno branco. */
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] .dashboard-shell .topbar{border:1px solid rgba(255,255,255,.22)!important}
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body [data-logout],
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body #logoutBtn,
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body .nav-logout{background:var(--ags-surface)!important;border:1px solid rgba(255,255,255,.55)!important;color:#fff!important;box-shadow:none!important}
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body [data-logout]:hover,
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body #logoutBtn:hover,
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body .nav-logout:hover{background:color-mix(in srgb,var(--ags-surface) 70%,#fff 30%)!important;border-color:#fff!important;color:#fff!important}

/* H650 | Submenus dos grupos de navegacao (nav-dropdown/menu-dropdown): titulo e
   descricao fixos em preto (#111827/#3f5063) em header-standard-h623/h624.css e
   navigation-h605.css. */
html[data-theme="dark"] body .dashboard-shell :where(.nav-dropdown,.menu-dropdown) a strong{color:var(--ags-text)!important}
html[data-theme="dark"] body .dashboard-shell :where(.nav-dropdown,.menu-dropdown) a small{color:var(--ags-muted)!important}
html[data-theme="dark"] body .dashboard-shell.operator-app :where(.nav-dropdown,.menu-dropdown) :where(strong,small){color:var(--ags-text)!important}
html[data-theme="dark"] body .dashboard-shell :where(.nav-dropdown,.menu-dropdown) a:hover,
html[data-theme="dark"] body .dashboard-shell :where(.nav-dropdown,.menu-dropdown) a.active,
html[data-theme="dark"] body .dashboard-shell.operator-app :where(.nav-dropdown,.menu-dropdown) a:hover,
html[data-theme="dark"] body .dashboard-shell.operator-app :where(.nav-dropdown,.menu-dropdown) a.active,
html[data-theme="dark"] body .dashboard-shell.manager-app :where(.nav-dropdown,.menu-dropdown) a:hover,
html[data-theme="dark"] body .dashboard-shell.manager-app :where(.nav-dropdown,.menu-dropdown) a.active{background:var(--ags-primary)!important;color:#fff!important}
html[data-theme="dark"] body .dashboard-shell :where(.nav-dropdown,.menu-dropdown) a:hover :where(strong,small),
html[data-theme="dark"] body .dashboard-shell :where(.nav-dropdown,.menu-dropdown) a.active :where(strong,small){color:#fff!important}

/* H651 | Padrao global: neutraliza manager-final.css (--h539-*, "claro com texto
   escuro" deliberado) e enterprise-h570.css (dark mode proprio em azul-marinho,
   que conflita com a paleta tweakcn usada no resto do site). */
html[data-theme="dark"]{
  --h539-gestor-bg:var(--ags-background);
  --h539-topbar:var(--ags-appbar);
  --h539-card:var(--ags-surface);
  --h539-card-border:var(--ags-border);
  --h539-text:var(--ags-text);
  --h539-muted:var(--ags-muted);
  --h539-soft:var(--ags-muted);
  --h539-light:var(--ags-surface);
  --h539-light-muted:var(--ags-border);
}

html[data-theme="dark"] body[data-manager-screen] .dashboard-shell.manager-app .ops-metric-strip>article,
html[data-theme="dark"] body .dashboard-shell.manager-app .ops-metric-strip>article,
html[data-theme="dark"] body[data-manager-screen] .dashboard-shell.manager-app .manager-placeholder-grid>article,
html[data-theme="dark"] body .dashboard-shell.manager-app .manager-placeholder-grid>article{background:var(--ags-surface)!important;color:var(--ags-text)!important;border-color:var(--ags-border)!important}
html[data-theme="dark"] body[data-manager-screen] .dashboard-shell.manager-app :is(.panel,.chart-card,.table-wrap,.data-table,.h534-card-light,.h534-table-wrap,.security-panel,.lgpd-panel),
html[data-theme="dark"] body .dashboard-shell.manager-app :is(.panel,.chart-card,.table-wrap,.data-table,.h534-card-light,.h534-table-wrap,.security-panel,.lgpd-panel){background:var(--ags-surface)!important;color:var(--ags-text)!important;border-color:var(--ags-border)!important}
html[data-theme="dark"] body[data-manager-screen] .dashboard-shell.manager-app :is(.panel,.chart-card,.table-wrap,.data-table,.h534-card-light,.h534-table-wrap,.security-panel,.lgpd-panel) :is(h1,h2,h3,h4,h5,h6,strong,b,p,label,li,dt,dd,td,th,span,small),
html[data-theme="dark"] body .dashboard-shell.manager-app :is(.panel,.chart-card,.table-wrap,.data-table,.h534-card-light,.h534-table-wrap,.security-panel,.lgpd-panel) :is(h1,h2,h3,h4,h5,h6,strong,b,p,label,li,dt,dd,td,th,span,small){color:var(--ags-text)!important}

html[data-theme="dark"] body :where(.panel,.card,.kpi-card,.table-wrap,.data-table,.h534-card-light,.h534-table-wrap,.security-panel,.lgpd-panel,.emergency-panel,.infra-panel,.infra-cards article,.status-strip article,.command-panel,.map-zone,.metric-card,.stat-card,.summary-card,.overview-card,.communication-kpi,.quick-menu-card){background:var(--ags-surface)!important;background-image:none!important;color:var(--ags-text)!important;border-color:var(--ags-border)!important}

/* H651.1 | Contraataque com especificidade elevada para os casos que ainda perderem
   a batalha de cascata contra folhas antigas com seletores muito reforcados. */
html[data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"][data-theme="dark"] body :is(.panel,.card,.kpi-card,.metric-card,.table-wrap,.data-table,.h534-card-light,.h534-table-wrap,.security-panel,.lgpd-panel,.emergency-panel,.infra-panel,.command-panel,.map-zone,.stat-card,.summary-card,.overview-card,.communication-kpi,.quick-menu-card,.ops-metric-strip>article,.manager-placeholder-grid>article,.chart-card){background:var(--ags-surface)!important;background-image:none!important;color:var(--ags-text)!important;border-color:var(--ags-border)!important}

/* H652 | trips-workspace-h596.css: modulo inteiro (kanban, calendario, tabela,
   gaveta de detalhes, notificacoes) sem nenhum !important e sem suporte a tema. */
html[data-theme="dark"] :is(.grp-tab,.trip-workspace-toolbar,.trip-workspace-toolbar input,.trip-workspace-toolbar select,.trip-workspace-toolbar>button,.trip-column-picker summary,.trip-column-picker>div,#viagensResumo article,.viagens-table-wrap,.trip-pagination button,.trip-calendar-nav button,.trip-calendar-grid,.trip-calendar-day,.trip-board-column,.trip-board-card,.trip-card-move button,.trip-card-menu,.trip-detail-drawer,.trip-detail-drawer>header,.trip-detail-drawer header button,.trip-detail-field,.trip-upload-drop,.trip-upload-item,.trip-attachment,.trip-attachment button,.notification-center-button,.notification-panel,.notification-panel header){background:var(--ags-surface)!important;border-color:var(--ags-border)!important;color:var(--ags-text)!important}
html[data-theme="dark"] :is(.trip-view-switch,.trip-workspace-toolbar,.viagens-table th,.trip-calendar-weekday,.trip-board-column,.trip-detail-field,.trip-upload-drop,.trip-board-header){background:var(--ags-background)!important}
html[data-theme="dark"] :is(.viagens-table td,.trip-board-card>span,.trip-detail-field strong,.grp-tab,.trip-pagination button,.notification-item strong){color:var(--ags-text)!important}
html[data-theme="dark"] :is(#viagensResumo span,#viagensResumo small,.viagens-table th,.trip-table-footer,.trip-board-card small,.trip-detail-field span,.trip-upload-drop small,.notification-item span,.notification-empty,.trip-board-empty,.trip-calendar-more){color:var(--ags-muted)!important}
html[data-theme="dark"] .viagens-table tbody tr:hover{background:color-mix(in srgb,var(--ags-primary) 12%,var(--ags-surface) 88%)!important}
html[data-theme="dark"] .trip-view-switch button.active,
html[data-theme="dark"] .grp-tab.active,
html[data-theme="dark"] .trip-pagination button[aria-current=page]{background:var(--ags-primary)!important;color:#fff!important}
html[data-theme="dark"] .trip-board-count{background:var(--ags-border)!important;color:var(--ags-text)!important}
html[data-theme="dark"] .trip-calendar-day.is-outside{background:var(--ags-background)!important;color:var(--ags-muted)!important}

/* H653 | painel-acesso.css: seu proprio modo escuro esta morto (seletor
   "[data-theme=""]", que nunca casa com data-theme="dark"). Redefinindo as
   variaveis diretamente para --ags-* corrige .panel-tag e tudo mais que usa
   var(--panel)/var(--muted)/var(--line)/var(--text)/var(--bg) neste arquivo. */
html[data-theme="dark"]{
  --bg:var(--ags-background);
  --panel:var(--ags-surface);
  --panel-2:var(--ags-surface);
  --text:var(--ags-text);
  --muted:var(--ags-muted);
  --line:var(--ags-border);
  --navy:var(--ags-appbar);
  --navy-2:var(--ags-appbar);
  --navy-3:var(--ags-appbar-dark);
}

/* H654 | mapas.css: mensagens vazio/erro sobre o mapa, botao "minha localizacao"
   e popup do marcador, todos em branco fixo. */
html[data-theme="dark"] .mapa-vazio{color:var(--ags-text)!important;background:rgba(20,24,32,.92)!important;border-color:var(--ags-border)!important}
html[data-theme="dark"] .mapa-erro{color:#FF9EB0!important;background:rgba(80,20,28,.92)!important;border-color:rgba(217,60,90,.4)!important}
html[data-theme="dark"] .mapa-localizacao-botao{background:var(--ags-surface)!important;color:var(--ags-text)!important}
html[data-theme="dark"] .mapa-localizacao-botao:hover,
html[data-theme="dark"] .mapa-localizacao-botao:focus-visible{background:var(--ags-background)!important;color:var(--ags-primary)!important}
html[data-theme="dark"] .mapa-popup{background:var(--ags-surface)!important;color:var(--ags-text)!important}
html[data-theme="dark"] .mapa-popup span{color:var(--ags-muted)!important}
html[data-theme="dark"] .mapa-popup-link{background:var(--ags-background)!important;color:var(--ags-text)!important}

/* H655 | functional-fixes-h579.css: selo de conexao do app (Pessoas/Motoristas). */
html[data-theme="dark"] .app-connection-badge.connected{background:rgba(76,175,80,.20)!important;color:#A5D6A7!important}
html[data-theme="dark"] .app-connection-badge.pending{background:rgba(251,140,0,.20)!important;color:#FFCC80!important}
html[data-theme="dark"] .app-connection-badge.offline{background:var(--ags-border)!important;color:var(--ags-text)!important}

/* H659 | Assistente IA flutuante (painel-acesso.css .floating-ai-*): totalmente
   claro, sem nenhum suporte a tema. */
html[data-theme="dark"] .floating-ai-panel{background:var(--ags-surface)!important;border-color:var(--ags-border)!important}
html[data-theme="dark"] .floating-ai-header{background:var(--ags-appbar)!important}
html[data-theme="dark"] .floating-ai-messages{background:var(--ags-background)!important}
html[data-theme="dark"] .ai-bubble.bot{background:var(--ags-surface)!important;border-color:var(--ags-border)!important;color:var(--ags-text)!important}
html[data-theme="dark"] .ai-bubble.user{background:var(--ags-primary)!important;color:#fff!important}
html[data-theme="dark"] .ai-bubble.error{background:rgba(217,60,90,.18)!important;border-color:rgba(217,60,90,.4)!important;color:#FF9EB0!important}
html[data-theme="dark"] .floating-ai-form{background:var(--ags-surface)!important;border-top-color:var(--ags-border)!important}
html[data-theme="dark"] .floating-ai-form textarea{background:var(--ags-background)!important;border-color:var(--ags-border)!important;color:var(--ags-text)!important}

/* H656 | painel-acesso.css .list-icon (glifo "!" etc.): a regra .red/.green/...
   define color:var(--red) sem !important, e nossas regras globais de texto
   claro (para o modo escuro) acabavam vencendo, apagando o glifo sobre o
   fundo pastel claro que continua de proposito. */
html[data-theme="dark"] .list-icon.red{color:#b91c1c!important}
html[data-theme="dark"] .list-icon.green{color:#15803d!important}
html[data-theme="dark"] .list-icon.yellow{color:#a16207!important}
html[data-theme="dark"] .list-icon.blue{color:#1d4ed8!important}

/* H657 | .small-action (Recuperar acesso / Gerar nova senha): botao sem CSS
   proprio, herdando o cinza padrao do navegador. */
html[data-theme="dark"] .small-action:not(.danger){background:var(--ags-surface)!important;color:var(--ags-text)!important;border:1px solid var(--ags-border)!important}
html[data-theme="dark"] .small-action:not(.danger):hover{background:color-mix(in srgb,var(--ags-primary) 16%,var(--ags-surface) 84%)!important;border-color:var(--ags-primary)!important}

/* H660 | Bug pre-existente (nao introduzido nesta sessao): a regra de prioridade
   H642.1 "html body[data-theme][data-theme],html body.portal-page.portal-page"
   forca background-image:none!important em qualquer tema, apagando a foto
   original do login (login-ags-h608.css) tanto no claro quanto no escuro.
   Restaura a foto apenas no modo claro; o escuro ja usa o padrao (H646). */
html:not([data-theme="dark"]) body.portal-page.portal-page{
  background-color:#2d405d!important;
  background-image:linear-gradient(rgba(22,37,61,.08),rgba(22,37,61,.08)),url("../img/login-background.jpg")!important;
  background-position:center!important;
  background-repeat:no-repeat!important;
  background-size:cover!important;
  background-attachment:fixed!important;
}
html:not([data-theme="dark"]) body.portal-page.portal-page :is(.access-shell,.portal-shell){background:transparent!important;background-image:none!important}

/* H661 | operator-agenda-h628.css: rotulo "HOJE" do date-card fixo em azul-cinza escuro. */
html[data-theme="dark"] .operator-home-screen .date-card span{color:var(--ags-muted)!important}
html[data-theme="dark"] .operator-home-screen .date-card strong{color:var(--ags-text)!important}

/* H671 | Triagem clinica de elegibilidade (contrato 1.2.I) no formulario de
   cadastro do operador. O checkbox precisa ficar na mesma linha do rotulo,
   senao o .quick-actions em grid quebra a caixa para longe do texto. */
.quick-actions .check-inline{display:flex;align-items:center;gap:8px;font-size:.86rem;font-weight:600;white-space:nowrap}
.quick-actions .check-inline input[type="checkbox"]{width:18px;height:18px;margin:0;flex:0 0 auto}
