/*
 * Conecte — Design System global
 *
 * Esta camada é carregada após as folhas legadas para unificar superfícies,
 * tipografia, estados e responsividade sem alterar IDs, eventos ou rotas.
 */

:root,
html[data-bps-theme="light"] {
  color-scheme: light;
  --bg-app: #f3f6fa;
  --bg-sidebar: #f8fafc;
  --surface-1: #fbfcfe;
  --surface-2: #f6f8fc;
  --surface-3: #eef3f8;
  --surface-inverse: #15233f;
  --border-subtle: #e1e8f0;
  --border-medium: #cbd7e5;
  --text-primary: #17233f;
  --text-secondary: #40516c;
  --text-muted: #71809a;
  --brand-primary: #1664c0;
  --brand-hover: #0e529f;
  --brand-soft: #e8f1ff;
  --brand-strong: #123c79;
  --success: #197a4a;
  --success-soft: #e8f7ef;
  --warning: #a76208;
  --warning-soft: #fff4df;
  --danger: #bb3d44;
  --danger-soft: #fceced;
  --info: #5661c9;
  --info-soft: #efefff;
  --shadow-xs: 0 1px 2px rgba(24, 38, 64, .035);
  --shadow-sm: 0 7px 20px rgba(24, 38, 64, .055);
  --shadow-md: 0 16px 42px rgba(24, 38, 64, .09);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --transition-ui: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;

  /* Aliases de compatibilidade para os módulos existentes. */
  --bg: var(--bg-app);
  --surface: var(--surface-1);
  --panel: var(--surface-1);
  --line: var(--border-subtle);
  --border: var(--border-subtle);
  --on-surface: var(--text-primary);
  --muted: var(--text-muted);
  --navy: var(--brand-strong);
  --navy2: #122b54;
  --blue: var(--brand-primary);
  --cyan: #3a82c4;
  --green: var(--success);
  --red: var(--danger);
  --amber: var(--warning);
  --white: #fbfcfe;
  --radius: var(--radius-lg);
  --shadow: var(--shadow-md);
  --brand-gradient: linear-gradient(135deg, #2375d1, var(--brand-primary));
}

html[data-bps-theme="dark"] {
  color-scheme: dark;
  --bg-app: #111a29;
  --bg-sidebar: #141e2e;
  --surface-1: #182334;
  --surface-2: #1d2a3d;
  --surface-3: #243247;
  --surface-inverse: #e8edf5;
  --border-subtle: #2b3b52;
  --border-medium: #40536d;
  --text-primary: #e7edf5;
  --text-secondary: #bdc9d9;
  --text-muted: #8fa0b8;
  --brand-primary: #72b8ff;
  --brand-hover: #a0d0ff;
  --brand-soft: #1b3654;
  --brand-strong: #cae3ff;
  --success: #68cf96;
  --success-soft: #173d31;
  --warning: #f1bf68;
  --warning-soft: #453619;
  --danger: #f08d94;
  --danger-soft: #45272d;
  --info: #aab1ff;
  --info-soft: #303257;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .18);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .18);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, .24);
  --bg: var(--bg-app);
  --surface: var(--surface-1);
  --panel: var(--surface-1);
  --line: var(--border-subtle);
  --border: var(--border-subtle);
  --on-surface: var(--text-primary);
  --muted: var(--text-muted);
  --navy: var(--brand-strong);
  --navy2: #dceafa;
  --blue: var(--brand-primary);
  --cyan: #8bc9ff;
  --green: var(--success);
  --red: var(--danger);
  --amber: var(--warning);
  --white: #edf3fa;
  --brand-gradient: linear-gradient(135deg, #539ce2, #327bc8);
}

html { background: var(--bg-app); }

body {
  background: var(--bg-app);
  color: var(--text-primary);
  text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea { font-family: var(--bps-ui-font-family, Inter, "Segoe UI", Arial, sans-serif); }

::selection { color: var(--text-primary); background: var(--brand-soft); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-primary) 46%, transparent);
  outline-offset: 3px;
}

button,
a,
input,
select,
textarea { transition: var(--transition-ui); }

/* Fundamentos e componentes transversais. */
.btn,
.topbar-button,
.topbar-icon-button,
.user-menu-button,
.small-btn,
.toolbar-button,
.quick-action-button,
.sidebar-support,
.logout-btn,
.quote-action,
.photo-input-button {
  border-radius: var(--radius-sm);
}

.btn {
  min-height: 42px;
  border: 1px solid transparent;
  padding: 10px 16px;
  letter-spacing: 0;
  font-weight: 650;
}

.btn.primary,
.btn[data-bps-action="save"],
.topbar-button-primary,
.toolbar-button-primary,
.quote-action-primary {
  border-color: var(--brand-primary);
  color: #f8fbff;
  background: var(--brand-primary);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-primary) 20%, transparent);
}

.btn.primary:hover:not(:disabled),
.btn[data-bps-action="save"]:hover:not(:disabled),
.topbar-button-primary:hover:not(:disabled),
.toolbar-button-primary:hover:not(:disabled),
.quote-action-primary:hover:not(:disabled) {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
  box-shadow: 0 9px 20px color-mix(in srgb, var(--brand-primary) 25%, transparent);
  transform: translateY(-1px);
}

.btn.secondary,
.small-btn,
.toolbar-button:not(.toolbar-button-primary):not(.toolbar-button-new),
.quick-action-button,
.topbar-button:not(.topbar-button-primary) {
  border-color: var(--border-subtle);
  color: var(--text-secondary);
  background: var(--surface-1);
  box-shadow: var(--shadow-xs);
}

.btn.secondary:hover:not(:disabled),
.small-btn:hover:not(:disabled),
.toolbar-button:not(.toolbar-button-primary):not(.toolbar-button-new):hover:not(:disabled),
.quick-action-button:hover:not(:disabled),
.topbar-button:not(.topbar-button-primary):hover:not(:disabled) {
  border-color: var(--border-medium);
  color: var(--brand-primary);
  background: var(--surface-2);
}

.btn.danger,
.small-btn.danger,
.logout-btn,
.user-menu-logout {
  border-color: color-mix(in srgb, var(--danger) 24%, transparent);
  color: var(--danger);
  background: var(--danger-soft);
  box-shadow: none;
}

.btn.danger:hover:not(:disabled),
.small-btn.danger:hover:not(:disabled),
.logout-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--danger-soft) 78%, var(--danger) 22%); }

.toolbar-button-new,
.small-btn.release { border-color: var(--success); color: #f5fff9; background: var(--success); }

button:disabled,
.btn:disabled { cursor: not-allowed; opacity: .54; box-shadow: none; transform: none; }

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-height: 42px;
  border-color: var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: var(--surface-1);
  box-shadow: inset 0 1px 1px rgba(24, 38, 64, .018);
}

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover { border-color: var(--border-medium); }

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: var(--brand-primary);
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 16%, transparent);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] { border-color: var(--danger); background: color-mix(in srgb, var(--danger-soft) 56%, var(--surface-1)); }

input:disabled,
select:disabled,
textarea:disabled { color: var(--text-muted); background: var(--surface-2); opacity: .72; }

input::placeholder,
textarea::placeholder { color: var(--text-muted); opacity: .86; }

input[type="checkbox"],
input[type="radio"] { accent-color: var(--brand-primary); }

.panel-card,
.panel-form,
.metric-card,
.report-card,
.client-card,
.operation-panel,
.form-section,
.settings-card,
.contract-stage,
.contract-service-card,
.contract-review-card,
.contract-review-pendencies,
.contract-issue-confirmation,
.contract-issued-actions,
.details-grid article,
.public-request-card,
.financial-summary span,
.comparison-grid article,
.guarantee-financial-summary article,
.payment-financial-summary article,
.contract-draft-card,
.vehicle-card,
.maintenance-list-card,
.maintenance-completion-card,
.fleet-groups-list-card,
.additional-list-summary,
.quote-card {
  border-color: var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--surface-1);
  box-shadow: var(--shadow-xs);
}

.panel-card,
.panel-form,
.operation-panel,
.settings-card,
.contract-stage { box-shadow: var(--shadow-sm); }

.section-title h2,
.page-section-title h2,
.panel-top-context strong,
.panel-brand-copy strong,
.contract-stage-title,
.fleet-form h3,
.settings-card-heading h3,
.vehicle-card h3,
.client-card h3 { color: var(--text-primary); }

.eyebrow,
.metric-card span,
.report-card span,
.client-card span,
.section-description,
.form-help,
.field-help,
.panel-form label small,
label small { color: var(--text-muted); }

.eyebrow { color: var(--brand-primary); font-size: .7rem; font-weight: 750; letter-spacing: .1em; }

.panel-form label,
.compact-form label,
.request-filters label,
.status-update-form label,
.client-filter-fields label,
.permissions-toolbar label,
.fleet-filter-bar label,
.dashboard-filter-bar label { color: var(--text-secondary); font-weight: 650; }

/* Shell administrativo. */
body.panel-page {
  --panel-surface-muted: var(--surface-2);
  --panel-border: var(--border-subtle);
  --panel-border-strong: var(--border-medium);
  --panel-text: var(--text-primary);
  --panel-text-muted: var(--text-muted);
  --panel-active: var(--brand-soft);
  --panel-active-strong: var(--brand-primary);
  background: var(--bg-app);
}

body.panel-page .sidebar {
  gap: 10px;
  padding: 14px 10px;
  color: var(--text-secondary);
  background: var(--bg-sidebar);
  border-right-color: var(--border-subtle);
}

body.panel-page .sidebar-header,
body.panel-page .sidebar-footer { border-color: var(--border-subtle); }

body.panel-page .panel-brand { color: var(--text-primary); }
body.panel-page .panel-brand-copy strong { font-size: 13px; }

body.panel-page .sidebar-collapse-button,
body.panel-page .topbar-icon-button { color: var(--text-secondary); }

body.panel-page .sidebar-collapse-button:hover,
body.panel-page .topbar-icon-button:hover,
body.panel-page .user-menu-button:hover { border-color: transparent; background: var(--surface-3); }

body.panel-page .sidebar-search input,
body.panel-page .panel-global-search input { background: var(--surface-2); }

body.panel-page .nav-group { border-color: transparent; }
body.panel-page .nav-group-trigger { color: var(--text-muted); font-size: 10px; letter-spacing: .075em; }
body.panel-page .nav-group-trigger:hover { color: var(--text-secondary); background: var(--surface-2); }

body.panel-page .nav-tab {
  min-height: 38px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
}

body.panel-page .nav-tab:hover { color: var(--brand-primary); background: var(--surface-2); }

body.panel-page .nav-tab.active,
body.panel-page .nav-tab[aria-current="page"] {
  color: var(--brand-primary);
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand-primary);
}

body.panel-page .sidebar-support { color: var(--brand-primary); background: transparent; }
body.panel-page .sidebar-support:hover { background: var(--brand-soft); }
body.panel-page .logout-btn { margin-top: 2px; }

body.panel-page .panel-main { padding: 16px 18px 34px; }

body.panel-page .panel-top {
  min-height: 64px;
  margin: -16px -18px 20px;
  padding: 10px 18px;
  border-color: var(--border-subtle);
  background: color-mix(in srgb, var(--bg-app) 88%, transparent);
  box-shadow: 0 2px 14px rgba(24, 38, 64, .035);
}

body.panel-page .panel-context-mark {
  border-radius: var(--radius-sm);
  color: var(--brand-primary);
  background: var(--brand-soft);
}

body.panel-page .topbar-button,
body.panel-page .topbar-icon-button,
body.panel-page .user-menu-button { min-height: 38px; border-radius: var(--radius-sm); }

body.panel-page .topbar-badge { border-color: var(--surface-1); background: var(--danger); }

body.panel-page .user-avatar { border-radius: 9px; background: linear-gradient(145deg, var(--brand-primary), #4d8bd2); }

body.panel-page .panel-search-results,
body.panel-page .topbar-popover {
  border-color: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  box-shadow: var(--shadow-md);
}

body.panel-page .panel-search-result,
body.panel-page .panel-alert-item { color: var(--text-secondary); background: var(--surface-1); border-color: var(--border-subtle); }
body.panel-page .panel-search-result:hover,
body.panel-page .panel-alert-item:hover,
body.panel-page .topbar-popover > button:hover,
body.panel-page .topbar-popover > a:hover { background: var(--surface-2); }

body.panel-page .page-section-title { border-color: var(--border-subtle); }
body.panel-page .entity-toolbar { border-color: var(--border-subtle); background: var(--surface-2); }
body.panel-page .module-tabs { border-color: var(--border-subtle); }
body.panel-page .module-tabs button { color: var(--text-muted); }
body.panel-page .module-tabs button:hover { color: var(--text-secondary); background: var(--surface-2); }
body.panel-page .module-tabs button.active,
body.panel-page .module-tabs button[aria-selected="true"] { color: var(--brand-primary); border-color: var(--brand-primary); background: transparent; }
body.panel-page .module-tab-count { color: var(--text-secondary); background: var(--surface-3); }

/* Indicadores e dashboard. */
body.panel-page .metric-card,
body.panel-page .report-card { padding: 18px; }

body.panel-page .metric-card strong { color: var(--text-primary); font-size: clamp(1.5rem, 2vw, 1.9rem); }

body.panel-page #dashboardMetrics .metric-card,
body.panel-page #dashboardSecondaryMetrics .metric-card {
  --metric-accent: var(--brand-primary);
  --metric-tint: var(--brand-soft);
  min-height: 126px;
  border: 1px solid var(--border-subtle);
  border-top: 0;
  border-radius: var(--radius-md);
  background: var(--surface-1);
  box-shadow: var(--shadow-xs);
}

body.panel-page #dashboardMetrics .metric-card::after,
body.panel-page #dashboardSecondaryMetrics .metric-card::after { opacity: .48; }
body.panel-page #dashboardMetrics .metric-card--primary,
body.panel-page #dashboardSecondaryMetrics .metric-card--primary { --metric-accent: var(--brand-primary); --metric-tint: var(--brand-soft); background: var(--surface-1); }
body.panel-page #dashboardMetrics .metric-card--success,
body.panel-page #dashboardSecondaryMetrics .metric-card--success { --metric-accent: var(--success); --metric-tint: var(--success-soft); background: var(--surface-1); }
body.panel-page #dashboardMetrics .metric-card--warning,
body.panel-page #dashboardSecondaryMetrics .metric-card--warning { --metric-accent: var(--warning); --metric-tint: var(--warning-soft); background: var(--surface-1); }
body.panel-page #dashboardMetrics .metric-card--danger,
body.panel-page #dashboardSecondaryMetrics .metric-card--danger { --metric-accent: var(--danger); --metric-tint: var(--danger-soft); background: var(--surface-1); }
body.panel-page #dashboardMetrics .metric-card strong,
body.panel-page #dashboardSecondaryMetrics .metric-card strong { color: var(--text-primary); }
body.panel-page #dashboardMetrics .metric-card__icon,
body.panel-page #dashboardSecondaryMetrics .metric-card__icon { border-radius: var(--radius-sm); }

body.panel-page .dashboard-secondary-metrics { border-color: var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-1); box-shadow: var(--shadow-xs); }
body.panel-page .dashboard-secondary-metrics summary { color: var(--brand-primary); }
body.panel-page .dashboard-vehicle-consultation { padding: 20px; }

/* Tabelas, listas e estados. */
body.panel-page .table-wrap { border-radius: var(--radius-sm); }
body.panel-page table { color: var(--text-secondary); }
body.panel-page th {
  border-color: var(--border-subtle);
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .075em;
}
body.panel-page td { border-color: var(--border-subtle); color: var(--text-secondary); }
body.panel-page tbody tr { transition: background-color .15s ease; }
body.panel-page tbody tr:hover > td { background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface-1)); }

.status-pill,
.status-badge,
.contract-draft-status,
.settings-status {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.25;
}

.status-confirmada,
.status-disponivel,
.status-concluida,
.status-resolvido,
.status-valido,
.status-paga,
.status-reserva-criada { color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 18%, transparent); }

.status-pendente,
.status-em-limpeza,
.status-agendada,
.status-a-vencer,
.status-atencao,
.status-aberto,
.status-parcialmente-paga,
.status-em-manutencao { color: var(--warning); background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 18%, transparent); }

.status-reservado,
.status-em-andamento,
.status-alugado,
.status-locado,
.status-informativo,
.contract-draft-status { color: var(--brand-primary); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand-primary) 17%, transparent); }

.status-cancelada,
.status-bloqueado,
.status-inativo,
.status-vencido,
.status-critico { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 18%, transparent); }

.empty-state,
.panel-search-empty,
.panel-alert-empty,
.vehicle-grid-message,
.permissions-empty {
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: var(--surface-2);
}

body.panel-page .empty-state:not(td) { padding: 14px 16px; }

/* Cards de frota e detalhes. */
body.panel-page .vehicle-card {
  overflow: hidden;
  border-color: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  box-shadow: var(--shadow-xs);
}

body.panel-page .vehicle-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

body.panel-page .vehicle-card-media {
  border-color: var(--border-subtle);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-3));
}
body.panel-page .vehicle-card-media::after { background: radial-gradient(ellipse at 50% 92%, color-mix(in srgb, var(--text-primary) 8%, transparent), transparent 52%); }
body.panel-page .vehicle-card-media > .status-pill { box-shadow: var(--shadow-xs); backdrop-filter: none; }
body.panel-page .vehicle-card h3,
body.panel-page .vehicle-card-body > header strong,
body.panel-page .vehicle-card dd,
body.panel-page .vehicle-details-grid dd { color: var(--text-primary); }
body.panel-page .vehicle-card dt,
body.panel-page .vehicle-card footer small { color: var(--text-muted); }
body.panel-page .vehicle-card footer { border-color: var(--border-subtle); }

/* Modais, dropdowns, mensagens e carregamento. */
dialog,
[role="dialog"],
.modal,
.modal-content,
.dialog,
.drawer,
.sheet,
.panel-confirmation-dialog,
.quote-proposal-dialog,
.audit-details-dialog,
.report-empty-dialog {
  border-color: var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  background: var(--surface-1);
  box-shadow: var(--shadow-md);
}

dialog::backdrop,
.panel-confirmation-dialog::backdrop,
.quote-proposal-dialog::backdrop { background: rgba(10, 20, 36, .48); backdrop-filter: blur(3px); }

.contract-toast {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--surface-1);
  box-shadow: var(--shadow-md);
}
.contract-toast[data-state="success"] { border-color: color-mix(in srgb, var(--success) 35%, var(--border-subtle)); }
.contract-toast[data-state="error"] { border-color: color-mix(in srgb, var(--danger) 35%, var(--border-subtle)); }
.contract-toast[data-state="warning"] { border-color: color-mix(in srgb, var(--warning) 35%, var(--border-subtle)); }

[aria-busy="true"]:not(.mobile-dashboard-card)::after { border-color: var(--brand-primary); }

/* Login e criação de acesso. */
.login-page {
  background:
    radial-gradient(circle at 88% 10%, color-mix(in srgb, var(--brand-primary) 22%, transparent), transparent 28rem),
    linear-gradient(145deg, #132442, #1a3159 60%, #214e87);
}

html[data-bps-theme="dark"] .login-page {
  background: radial-gradient(circle at 88% 10%, rgba(114, 184, 255, .14), transparent 28rem), linear-gradient(145deg, #0d1727, #13233b 60%, #1a365c);
}

.login-card {
  border-color: color-mix(in srgb, var(--border-subtle) 70%, transparent);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface-1) 96%, transparent);
  box-shadow: var(--shadow-md);
}
.login-logo img {
  display: block;
  width: 100%;
  height: 145px;
  margin-bottom: 22px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: linear-gradient(135deg, #10294d, #18548c);
}
.login-card h1 { color: var(--text-primary); }
.login-copy { color: var(--text-muted); }
.back-link { color: var(--brand-primary); }

/* Site público, cotação e documento de privacidade usam a mesma linguagem. */
.topbar { background: color-mix(in srgb, #122b54 92%, transparent); border-color: rgba(218, 232, 249, .14); }
.hero { background: linear-gradient(135deg, #122b54, #173968 58%, #2464aa); }
.hero-bg { opacity: .72; }
.quote-entry-card,
.quote-card,
.reservation-form { border-color: color-mix(in srgb, var(--border-subtle) 68%, transparent); border-radius: var(--radius-lg); background: var(--surface-1); box-shadow: var(--shadow-sm); }
.quote-entry-card { color: var(--text-secondary); }
.quote-entry-card h2 { color: var(--text-primary); }

.quote-page {
  color: var(--text-primary);
  background: radial-gradient(circle at 8% 12%, color-mix(in srgb, var(--brand-primary) 12%, transparent), transparent 27rem), var(--bg-app);
}
.quote-page-header,
.quote-shell-header,
.quote-page-footer { background: #142b51; }
.quote-page-intro h1,
.quote-stage-heading h3,
.quote-period-panel-heading h4,
.quote-category-heading h3,
.quote-selected-category-copy strong,
.quote-financial-summary-heading h4,
.quote-review-card h4,
.quote-success h3 { color: var(--text-primary); }
.quote-page-intro > p:not(.quote-kicker),
.quote-stage-heading p,
.quote-category-heading p,
.quote-field small,
.quote-review-card p { color: var(--text-muted); }
.quote-shell { border-color: var(--border-subtle); border-radius: var(--radius-lg); background: var(--surface-1); box-shadow: var(--shadow-sm); }
.quote-period-panel,
.quote-review-card { border-color: var(--border-subtle); background: var(--surface-2); }
.quote-trust-row span { color: var(--text-secondary); background: var(--surface-1); box-shadow: var(--shadow-xs); }
.quote-field { color: var(--text-secondary); }
.quote-field input,
.quote-field select,
.quote-field textarea { border-color: var(--border-subtle); color: var(--text-primary); background: var(--surface-1); }
.quote-field input:focus,
.quote-field select:focus,
.quote-field textarea:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 16%, transparent); }
.quote-extra-service,
.quote-financial-summary,
.quote-notice { border-color: var(--border-subtle); background: var(--surface-2); }
.quote-extra-service.is-selected { border-color: color-mix(in srgb, var(--brand-primary) 40%, var(--border-subtle)); background: var(--brand-soft); }
.quote-action { border-radius: var(--radius-sm); }

.privacy-page { background: radial-gradient(circle at 90% 5%, color-mix(in srgb, var(--brand-primary) 12%, transparent), transparent 26rem), var(--bg-app); }
.privacy-document { border-color: var(--border-subtle); border-radius: var(--radius-xl); background: var(--surface-1); box-shadow: var(--shadow-sm); }
.privacy-heading { border-color: var(--border-subtle); }
.privacy-heading h1,
.privacy-document h2,
.privacy-company { color: var(--text-primary); }
.privacy-document p,
.privacy-document li { color: var(--text-secondary); }
.privacy-introduction { border-left-color: var(--brand-primary); background: var(--brand-soft); }
.privacy-acknowledgement { background: var(--surface-inverse); color: var(--bg-app) !important; }

/* Superfícies escuras que os estilos legados definem explicitamente. */
html[data-bps-theme="dark"] body.panel-page .panel-card,
html[data-bps-theme="dark"] body.panel-page .panel-form,
html[data-bps-theme="dark"] body.panel-page .metric-card,
html[data-bps-theme="dark"] body.panel-page .report-card,
html[data-bps-theme="dark"] body.panel-page .client-card,
html[data-bps-theme="dark"] body.panel-page .operation-panel,
html[data-bps-theme="dark"] body.panel-page .vehicle-card,
html[data-bps-theme="dark"] body.panel-page .settings-card,
html[data-bps-theme="dark"] body.panel-page .form-section,
html[data-bps-theme="dark"] body.panel-page .contract-stage,
html[data-bps-theme="dark"] body.panel-page .contract-service-card,
html[data-bps-theme="dark"] body.panel-page .contract-summary > div,
html[data-bps-theme="dark"] body.panel-page .contract-review-card,
html[data-bps-theme="dark"] body.panel-page .contract-review-pendencies,
html[data-bps-theme="dark"] body.panel-page .contract-issue-confirmation,
html[data-bps-theme="dark"] body.panel-page .contract-issued-actions,
html[data-bps-theme="dark"] body.panel-page .permission-group { border-color: var(--border-subtle); color: var(--text-primary); background: var(--surface-1); }

html[data-bps-theme="dark"] body.panel-page .sidebar { background: var(--bg-sidebar); }
html[data-bps-theme="dark"] body.panel-page .panel-top { background: color-mix(in srgb, var(--bg-app) 90%, transparent); }
html[data-bps-theme="dark"] body.panel-page .topbar-popover,
html[data-bps-theme="dark"] body.panel-page .panel-search-results,
html[data-bps-theme="dark"] body.panel-page .panel-search-result,
html[data-bps-theme="dark"] body.panel-page .panel-alert-item { background: var(--surface-1); color: var(--text-secondary); }
html[data-bps-theme="dark"] body.panel-page .vehicle-card-media { background: linear-gradient(180deg, var(--surface-2), var(--surface-3)); }
html[data-bps-theme="dark"] .quote-page,
html[data-bps-theme="dark"] .quote-shell,
html[data-bps-theme="dark"] .quote-entry-card,
html[data-bps-theme="dark"] .reservation-form,
html[data-bps-theme="dark"] .privacy-document { background: var(--surface-1); }
html[data-bps-theme="dark"] .quote-page-header,
html[data-bps-theme="dark"] .quote-shell-header,
html[data-bps-theme="dark"] .quote-page-footer,
html[data-bps-theme="dark"] .topbar { background: #101b2d; }

/*
 * A cor primária do tema escuro é propositalmente clara. Textos brancos
 * sobre essa superfície perdem contraste, portanto as ações preenchidas usam
 * tinta escura e os textos legados da cotação herdam os tokens do tema.
 */
html[data-bps-theme="dark"] .btn.primary,
html[data-bps-theme="dark"] .btn[data-bps-action="save"],
html[data-bps-theme="dark"] .topbar-button-primary,
html[data-bps-theme="dark"] .toolbar-button-primary,
html[data-bps-theme="dark"] .quote-action-primary { color: #10223a; }

html[data-bps-theme="dark"] .quote-period-panel-heading > span,
html[data-bps-theme="dark"] .category-scroll-hint { color: var(--text-muted); }

html[data-bps-theme="dark"] .quote-period-panel-heading small,
html[data-bps-theme="dark"] .category-scroll-hint span { color: var(--brand-primary); }

html[data-bps-theme="dark"] .quote-notice { color: var(--text-secondary); }
html[data-bps-theme="dark"] .quote-notice strong { color: var(--text-primary); }

@media (max-width: 820px) {
  body.panel-page .panel-main { padding: 12px 12px calc(80px + env(safe-area-inset-bottom)); }
  body.panel-page .panel-top { margin: -12px -12px 16px; padding-inline: 12px; }
  body.panel-page .panel-card,
  body.panel-page .panel-form { border-radius: var(--radius-md); }
  body.panel-page .metric-grid { gap: 10px; }
  body.panel-page .dashboard-vehicle-consultation { padding: 14px; }
  body.panel-page .vehicle-card:hover { transform: none; }
}

@media (max-width: 560px) {
  .btn { min-height: 42px; }
  .login-card { padding: 24px 20px; border-radius: var(--radius-lg); }
  .quote-page-main { width: min(100% - 24px, 1220px); }
  .quote-stage { padding: 22px 16px; }
  .quote-shell { border-radius: var(--radius-md); }
  .privacy-document { border-radius: var(--radius-md); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (prefers-contrast: more) {
  :root { --border-subtle: var(--border-medium); }
  .panel-card,
  .panel-form,
  .vehicle-card,
  .quote-shell { border-width: 1px; }
}

/*
 * Dashboard confortável — regra intencionalmente mais específica que o modo
 * compacto legado. Mantém a densidade produtiva no restante do sistema, mas
 * faz da visão geral uma área de leitura e decisão, não uma grade técnica.
 */
body.panel-page[data-current-view="dashboard"] {
  background:
    radial-gradient(circle at 92% 0, color-mix(in srgb, var(--brand-primary) 5%, transparent), transparent 28rem),
    var(--bg-app);
}

body.panel-page[data-current-view="dashboard"] .panel-main {
  padding-bottom: 44px;
}

body.panel-page[data-current-view="dashboard"] .dashboard-primary-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

body.panel-page[data-current-view="dashboard"][data-density="compact"]:not(.contract-focus-mode) .dashboard-primary-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card,
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card {
  min-height: 148px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  border-left: 0;
  border-top: 0;
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card::after,
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card::after {
  display: block;
  top: -40px;
  right: -40px;
  width: 118px;
  height: 118px;
  opacity: .38;
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__header,
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card__header {
  min-height: 42px;
  gap: 11px;
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__header > span:last-child,
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card__header > span:last-child {
  color: var(--text-secondary);
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.25;
  white-space: normal;
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__icon,
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card__icon {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-radius: 13px;
  font-size: 1rem;
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__icon .ui-icon,
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card__icon .ui-icon {
  width: 21px;
  height: 21px;
  stroke-width: 1.9;
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card strong,
body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card--emphasis strong,
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card strong,
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card--emphasis strong {
  margin-top: 14px;
  color: var(--text-primary);
  font-size: clamp(1.7rem, 2.15vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1;
}

body.panel-page[data-current-view="dashboard"] .dashboard-secondary-metrics {
  margin: 0 0 24px;
  border-color: transparent;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-1) 70%, transparent);
  box-shadow: none;
}

body.panel-page[data-current-view="dashboard"] .dashboard-secondary-metrics summary {
  padding: 11px 14px;
  font-size: .78rem;
  font-weight: 650;
}

body.panel-page[data-current-view="dashboard"] .dashboard-secondary-metrics .metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 14px 14px;
}

body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card {
  min-height: 112px;
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card__header { min-height: 34px; }
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card__icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card__icon .ui-icon { width: 17px; height: 17px; }
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card strong,
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card--emphasis strong { margin-top: 10px; font-size: 1.45rem; }

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-consultation,
body.panel-page[data-current-view="dashboard"] .dashboard-columns > .panel-card {
  border-color: transparent;
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-consultation {
  margin-bottom: 24px;
  padding: 26px;
}

body.panel-page[data-current-view="dashboard"] .dashboard-columns { gap: 20px; }
body.panel-page[data-current-view="dashboard"] .dashboard-columns > .panel-card { padding: 24px; }

body.panel-page[data-current-view="dashboard"] .compact-section-title {
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 0;
  border-bottom: 0;
}

body.panel-page[data-current-view="dashboard"] .compact-section-title .eyebrow {
  margin-bottom: 5px;
  font-size: .72rem;
}

body.panel-page[data-current-view="dashboard"] .compact-section-title h2 {
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

body.panel-page[data-current-view="dashboard"] .compact-section-title > .small-btn {
  min-height: 38px;
  padding-inline: 12px;
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: transparent;
  font-size: .75rem;
  font-weight: 700;
}

body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar {
  align-items: end;
  gap: 14px;
  margin: 0 0 22px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar label {
  min-width: 185px;
  gap: 6px;
  color: var(--text-secondary);
  font-size: .72rem;
  font-weight: 650;
}

body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar input,
body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar select {
  min-height: 43px;
  padding: 9px 12px;
  border-color: transparent;
  border-radius: 10px;
  background: var(--surface-1);
  box-shadow: var(--shadow-xs);
  font-size: .85rem;
}

body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar input:focus,
body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 15%, transparent);
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card {
  border-color: transparent;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-sm);
  transform: translateY(-3px);
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-media,
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-image {
  height: clamp(156px, 13vw, 192px);
  min-height: clamp(156px, 13vw, 192px);
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-image { object-fit: contain; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-media { border-color: transparent; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-media > .status-pill { top: 10px; right: 10px; }

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body {
  gap: 14px;
  padding: 16px;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-body { gap: 14px; padding: 16px; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body > header { gap: 10px; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body > header strong { color: var(--text-primary); font-size: .98rem; font-weight: 700; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body > header span { margin-top: 3px; color: var(--text-muted); font-size: .73rem; line-height: 1.35; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body > header small { color: var(--brand-primary); font-size: .65rem; }

body.panel-page[data-current-view="dashboard"] .vehicle-card-rate {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--brand-soft);
}

body.panel-page[data-current-view="dashboard"] .vehicle-card-rate small { color: var(--brand-primary); font-size: .64rem; font-weight: 650; letter-spacing: .025em; }
body.panel-page[data-current-view="dashboard"] .vehicle-card-rate strong { color: var(--brand-strong); font-size: 1rem; font-weight: 700; letter-spacing: -.015em; }

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card dl { gap: 11px 12px; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card dt { color: var(--text-muted); font-size: .6rem; font-weight: 650; letter-spacing: .055em; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card dd { color: var(--text-secondary); font-size: .76rem; font-weight: 650; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card footer { gap: 10px; padding-top: 0; border-top: 0; }

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-actions .small-btn {
  min-height: 36px;
  border-color: transparent;
  border-radius: 10px;
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-soft) 65%, var(--surface-1));
  font-size: .72rem;
  font-weight: 700;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-actions .small-btn:hover {
  color: #f8fbff;
  background: var(--brand-primary);
}

body.panel-page[data-current-view="dashboard"] .compact-dashboard-table {
  max-height: 365px;
  border: 0;
  border-radius: 0;
}

body.panel-page[data-current-view="dashboard"] .compact-dashboard-table table { min-width: 0; }
body.panel-page[data-current-view="dashboard"] .compact-dashboard-table th {
  padding: 8px 10px 10px;
  border-bottom-color: transparent;
  color: var(--text-muted);
  background: transparent;
  font-size: .64rem;
  font-weight: 700;
}

body.panel-page[data-current-view="dashboard"] .compact-dashboard-table td {
  padding: 14px 10px;
  border-bottom-color: color-mix(in srgb, var(--border-subtle) 68%, transparent);
  color: var(--text-secondary);
  font-size: .8rem;
  line-height: 1.45;
}

body.panel-page[data-current-view="dashboard"] .compact-dashboard-table tbody tr:hover > td { background: var(--surface-2); }
body.panel-page[data-current-view="dashboard"] .compact-dashboard-table .status-pill { min-height: 26px; padding: 5px 8px; font-size: .67rem; }
body.panel-page[data-current-view="dashboard"] .compact-dashboard-table .empty-state { padding: 28px 16px; }

body.panel-page[data-current-view="dashboard"] .sidebar { padding-top: 16px; }
body.panel-page[data-current-view="dashboard"] .nav-group { padding-block: 5px; }
body.panel-page[data-current-view="dashboard"] .nav-tab { min-height: 40px; }
body.panel-page[data-current-view="dashboard"] .panel-top {
  min-height: 68px;
  margin: -12px -14px 20px;
}
body.panel-page[data-current-view="dashboard"] .panel-global-search input { min-height: 42px; }

@media (max-width: 1399px) and (min-width: 1041px) {
  body.panel-page[data-current-view="dashboard"] .dashboard-primary-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1040px) and (min-width: 821px) {
  body.panel-page[data-current-view="dashboard"] .dashboard-primary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.panel-page[data-current-view="dashboard"][data-density="compact"]:not(.contract-focus-mode) .dashboard-primary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.panel-page[data-current-view="dashboard"] .dashboard-secondary-metrics .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  body.panel-page[data-current-view="dashboard"] .panel-main { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  body.panel-page[data-current-view="dashboard"] .dashboard-primary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body.panel-page[data-current-view="dashboard"][data-density="compact"]:not(.contract-focus-mode) .dashboard-primary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card { min-height: 124px; padding: 16px; border-radius: var(--radius-md); }
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__icon { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; }
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card strong,
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card--emphasis strong { margin-top: 11px; font-size: 1.55rem; }
  body.panel-page[data-current-view="dashboard"] .dashboard-secondary-metrics { margin-bottom: 18px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-secondary-metrics .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 10px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-consultation,
  body.panel-page[data-current-view="dashboard"] .dashboard-columns > .panel-card { padding: 18px 16px; border-radius: var(--radius-lg); }
  body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 12px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar label { min-width: 0; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid { display: flex; grid-template-columns: none; gap: 12px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x mandatory; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid > .vehicle-card { flex: 0 0 min(82vw, 320px); scroll-snap-align: start; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-media,
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-image { height: 172px; min-height: 172px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-columns { grid-template-columns: 1fr; gap: 16px; }
  body.panel-page[data-current-view="dashboard"] .compact-dashboard-table { overflow-x: auto; }
  body.panel-page[data-current-view="dashboard"] .compact-dashboard-table table { min-width: 580px; }
}

/* Ajuste final de densidade do Dashboard — isolado da área pública. */
body.panel-page[data-current-view="dashboard"] .panel-main,
body.panel-page[data-current-view="dashboard"] .panel-view,
body.panel-page[data-current-view="dashboard"] .dashboard-kpis,
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-consultation,
body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar,
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid {
  min-width: 0;
  max-width: 100%;
}

body.panel-page[data-current-view="dashboard"] .panel-main { padding-bottom: 24px; }
body.panel-page[data-current-view="dashboard"] .panel-top { min-height: 58px; margin-bottom: 12px; }

body.panel-page[data-current-view="dashboard"] .dashboard-kpis {
  margin: 0 0 12px;
}

body.panel-page[data-current-view="dashboard"] .dashboard-primary-metrics,
body.panel-page[data-current-view="dashboard"][data-density]:not(.contract-focus-mode) .dashboard-primary-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card {
  display: flex;
  min-height: 112px;
  height: 112px;
  flex-direction: column;
  padding: 16px 18px;
  border-radius: 14px;
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card::after {
  top: -46px;
  right: -46px;
  width: 92px;
  height: 92px;
  opacity: .28;
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__header {
  min-height: 36px;
  gap: 10px;
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__icon {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 10px;
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__icon .ui-icon {
  width: 18px;
  height: 18px;
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__header > span:last-child {
  font-size: 13px;
  font-weight: 600;
}

body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card strong,
body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card--emphasis strong {
  margin-top: auto;
  font-size: clamp(1.625rem, 2vw, 2rem);
  line-height: 1;
}

body.panel-page[data-current-view="dashboard"] .dashboard-kpis__toggle {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, transparent);
  border-radius: 10px;
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

body.panel-page[data-current-view="dashboard"] .dashboard-kpis__toggle .ui-icon {
  width: 16px;
  height: 16px;
  transition: transform .18s ease;
}

body.panel-page[data-current-view="dashboard"] .dashboard-kpis__toggle[aria-expanded="true"] .ui-icon { transform: rotate(90deg); }
body.panel-page[data-current-view="dashboard"] .dashboard-kpis__toggle:hover { background: var(--brand-soft); }
body.panel-page[data-current-view="dashboard"] .dashboard-kpis__toggle:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 22%, transparent);
}

body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics.dashboard-kpis__secondary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

body.panel-page[data-current-view="dashboard"] .dashboard-kpis__secondary[hidden] { display: none; }

body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card {
  min-height: 100px;
  height: 100px;
  padding: 14px 16px;
}

body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card__header { min-height: 32px; gap: 9px; }
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card__header > span:last-child { font-size: 12px; }
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card strong,
body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics .metric-card--emphasis strong { margin-top: 8px; font-size: 1.55rem; }

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-consultation {
  container-type: inline-size;
  margin-bottom: 16px;
  padding: 16px;
}

body.panel-page[data-current-view="dashboard"] .compact-section-title {
  min-width: 0;
  align-items: center;
  margin-bottom: 12px;
}

body.panel-page[data-current-view="dashboard"] .compact-section-title > div,
body.panel-page[data-current-view="dashboard"] .compact-section-title > .small-btn { min-width: 0; }
body.panel-page[data-current-view="dashboard"] .compact-section-title h2 { font-size: 1.15rem; }

body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar {
  display: grid;
  grid-template-columns: 160px minmax(280px, 1fr);
  gap: 12px;
  margin: 0 0 14px;
  padding: 0;
  background: transparent;
}

body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar label,
body.panel-page[data-current-view="dashboard"] .dashboard-filter-search { min-width: 0; }

body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar input,
body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar select {
  min-width: 0;
  min-height: 40px;
  height: 40px;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-carousel {
  position: relative;
  min-width: 0;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 24%, var(--border-subtle));
  border-radius: 50%;
  place-items: center;
  color: #fff;
  background: color-mix(in srgb, var(--brand-primary) 92%, #071827);
  box-shadow: 0 8px 22px rgba(7, 24, 39, .24);
  cursor: pointer;
  transform: translateY(-50%);
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav[hidden] { display: none; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav--previous { left: -12px; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav--next { right: -12px; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav--previous .ui-icon { transform: rotate(180deg); }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav .ui-icon { width: 21px; height: 21px; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav:hover:not(:disabled) { filter: brightness(1.1); }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-primary) 28%, transparent); outline-offset: 3px; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav:disabled { opacity: .28; cursor: default; }

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid {
  --dashboard-visible-cards: 5;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - ((var(--dashboard-visible-cards) - 1) * 12px)) / var(--dashboard-visible-cards));
  grid-template-columns: none;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 2px 10px;
  scroll-snap-type: inline mandatory;
  scrollbar-width: thin;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid > .vehicle-card {
  min-width: 0;
  min-height: 365px;
  scroll-snap-align: start;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--dashboard {
  display: flex;
  flex-direction: column;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-media,
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-image,
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-placeholder {
  min-height: 145px;
  height: 145px;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-image {
  width: 100%;
  object-fit: cover;
  object-position: center;
  background: var(--surface-2);
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body,
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 56px;
  align-items: start;
  gap: 8px;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body > header > div {
  min-width: 0;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body > header strong {
  font-size: 16px;
  line-height: 1.2;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body > header span {
  display: -webkit-box;
  min-height: 32px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body > header small {
  align-self: start;
  max-width: 108px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.panel-page[data-current-view="dashboard"] .vehicle-card-rate {
  min-height: 50px;
  padding: 9px 12px;
  border-radius: 10px;
}

body.panel-page[data-current-view="dashboard"] .vehicle-card-rate small { font-size: 11px; }
body.panel-page[data-current-view="dashboard"] .vehicle-card-rate strong { font-size: 17px; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card dl { gap: 8px 12px; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card dt { font-size: 11px; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card dd { font-size: 13px; }
body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card footer { margin-top: auto; }

body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-actions .small-btn {
  min-height: 38px;
  height: 38px;
  font-size: 13px;
}

@container (max-width: 1279px) {
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid { --dashboard-visible-cards: 4; }
}

@container (max-width: 1039px) {
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid { --dashboard-visible-cards: 3; }
}

@container (max-width: 779px) {
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid { --dashboard-visible-cards: 2; }
}

@container (max-width: 519px) {
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid { --dashboard-visible-cards: 1; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav { width: 40px; height: 40px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav--previous { left: 4px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav--next { right: 4px; }
}

/* O card de destaque da frota é compartilhado pelo dashboard e pela tela de veículos. */
body.panel-page .vehicle-card--dashboard {
  display: flex;
  min-height: 365px;
  flex-direction: column;
  border-color: transparent;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

body.panel-page .vehicle-card--dashboard:hover {
  border-color: transparent;
  box-shadow: var(--shadow-sm);
  transform: translateY(-3px);
}

body.panel-page .vehicle-card--dashboard .vehicle-card-media {
  border-color: transparent;
}

body.panel-page .vehicle-card--dashboard .vehicle-card-media > .status-pill {
  top: 10px;
  right: 10px;
}

body.panel-page .vehicle-card--dashboard .vehicle-card-body,
body.panel-page .vehicle-card--dashboard.vehicle-card--compact .vehicle-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}

body.panel-page .vehicle-card--dashboard .vehicle-card-body > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 56px;
  align-items: start;
  gap: 8px;
}

body.panel-page .vehicle-card--dashboard .vehicle-card-body > header > div {
  min-width: 0;
}

body.panel-page .vehicle-card--dashboard .vehicle-card-body > header strong {
  font-size: 16px;
  line-height: 1.2;
}

body.panel-page .vehicle-card--dashboard .vehicle-card-body > header span {
  display: -webkit-box;
  min-height: 32px;
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

body.panel-page .vehicle-card--dashboard .vehicle-card-body > header small {
  align-self: start;
  max-width: 108px;
  overflow: hidden;
  color: var(--brand-primary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.panel-page .vehicle-card--dashboard .vehicle-card-rate {
  display: grid;
  min-height: 50px;
  gap: 3px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--brand-soft);
}

body.panel-page .vehicle-card--dashboard .vehicle-card-rate small {
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .025em;
}

body.panel-page .vehicle-card--dashboard .vehicle-card-rate strong {
  color: var(--brand-strong);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.015em;
}

body.panel-page .vehicle-card--dashboard dl {
  gap: 8px 12px;
}

body.panel-page .vehicle-card--dashboard dt {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .055em;
}

body.panel-page .vehicle-card--dashboard dd {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 650;
}

body.panel-page .vehicle-card--dashboard footer {
  margin-top: auto;
  padding-top: 0;
  border-top: 0;
}

body.panel-page .vehicle-card--dashboard .vehicle-card-actions .small-btn {
  min-height: 38px;
  height: 38px;
  border-color: transparent;
  border-radius: 10px;
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-soft) 65%, var(--surface-1));
  font-size: 13px;
  font-weight: 700;
}

body.panel-page .vehicle-card--dashboard .vehicle-card-actions .small-btn:hover:not(:disabled) {
  color: #f8fbff;
  background: var(--brand-primary);
}

body.panel-page .vehicle-card--dashboard .vehicle-card-actions .small-btn.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

body.panel-page .vehicle-card--dashboard .vehicle-card-actions .small-btn.danger:hover:not(:disabled) {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger-soft) 78%, var(--danger) 22%);
}

/* Na consulta, o tamanho da foto continua acompanhando a quantidade escolhida por página. */
body.panel-page[data-current-view="frota"] .vehicle-carousel-track .vehicle-card--dashboard .vehicle-card-image {
  object-fit: contain;
}

@media (max-width: 1499px) and (min-width: 1041px) {
  body.panel-page[data-current-view="dashboard"] .dashboard-primary-metrics,
  body.panel-page[data-current-view="dashboard"][data-density]:not(.contract-focus-mode) .dashboard-primary-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1040px) and (min-width: 520px) {
  body.panel-page[data-current-view="dashboard"] .dashboard-primary-metrics,
  body.panel-page[data-current-view="dashboard"][data-density]:not(.contract-focus-mode) .dashboard-primary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar { grid-template-columns: minmax(0, 1fr); }
  body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics.dashboard-kpis__secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 519px) {
  body.panel-page[data-current-view="dashboard"] .dashboard-primary-metrics,
  body.panel-page[data-current-view="dashboard"][data-density]:not(.contract-focus-mode) .dashboard-primary-metrics { grid-template-columns: minmax(0, 1fr); }
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card { min-height: 108px; height: 108px; }
  body.panel-page[data-current-view="dashboard"] #dashboardSecondaryMetrics.dashboard-kpis__secondary { grid-template-columns: minmax(0, 1fr); }
}

/*
 * Navegação institucional: o menu lateral mantém a mesma identidade visual em
 * todas as empresas e não acompanha a preferência de tema do conteúdo.
 */
body.panel-page .sidebar {
  --sidebar-background: linear-gradient(180deg, #031a38 0%, #062349 52%, #03172f 100%);
  --sidebar-border: rgba(153, 184, 222, .18);
  --sidebar-text: #dce7f5;
  --sidebar-muted: #9eafc7;
  --sidebar-hover: rgba(31, 111, 209, .18);
  --sidebar-active: linear-gradient(135deg, #0871e8, #0759c8);
  color: var(--sidebar-text);
  background: var(--sidebar-background);
  border-right-color: var(--sidebar-border);
}

/* A cabecalho e o rodape ficam estaveis; somente os modulos do menu rolam. */
body.panel-page .sidebar .panel-nav {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(117, 200, 255, .58) rgba(3, 19, 41, .34);
}

body.panel-page .sidebar .panel-nav::-webkit-scrollbar {
  width: 8px;
}

body.panel-page .sidebar .panel-nav::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(3, 19, 41, .34);
}

body.panel-page .sidebar .panel-nav::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(117, 200, 255, .58);
  background-clip: padding-box;
}

body.panel-page .sidebar .panel-nav::-webkit-scrollbar-thumb:hover {
  background-color: rgba(117, 200, 255, .82);
}

body.panel-page .sidebar .sidebar-header,
body.panel-page .sidebar .sidebar-footer,
body.panel-page .sidebar .nav-group {
  border-color: var(--sidebar-border);
}

body.panel-page .sidebar .panel-brand,
body.panel-page .sidebar .panel-brand-copy strong {
  color: #ffffff;
}

body.panel-page .sidebar .panel-brand-copy small,
body.panel-page .sidebar .nav-group-trigger,
body.panel-page .sidebar .sidebar-version {
  color: var(--sidebar-muted);
}

body.panel-page .sidebar .sidebar-collapse-button {
  border-color: rgba(166, 193, 226, .22);
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, .05);
}

body.panel-page .sidebar .sidebar-search {
  color: #aebed3;
}

body.panel-page .sidebar .sidebar-search input {
  border-color: rgba(166, 193, 226, .22);
  color: #f4f8fd;
  background: rgba(3, 19, 41, .58);
}

body.panel-page .sidebar .sidebar-search input::placeholder {
  color: #9eafc7;
}

body.panel-page .sidebar .nav-group-trigger:hover,
body.panel-page .sidebar .sidebar-collapse-button:hover {
  color: #ffffff;
  background: var(--sidebar-hover);
}

body.panel-page .sidebar .nav-tab {
  color: var(--sidebar-text);
  background: transparent;
}

body.panel-page .sidebar .nav-tab:hover {
  color: #ffffff;
  background: var(--sidebar-hover);
}

body.panel-page .sidebar .nav-tab.active,
body.panel-page .sidebar .nav-tab[aria-current="page"] {
  color: #ffffff;
  background: var(--sidebar-active);
  box-shadow: 0 8px 18px rgba(0, 75, 174, .28);
}

body.panel-page .sidebar .sidebar-support {
  color: #32a9ff;
  background: transparent;
}

body.panel-page .sidebar .sidebar-support:hover {
  color: #75c8ff;
  background: var(--sidebar-hover);
}

body.panel-page .sidebar .logout-btn {
  color: #ff747c;
  background: transparent;
}

body.panel-page .sidebar .logout-btn:hover:not(:disabled) {
  color: #ff9ca2;
  background: rgba(205, 50, 61, .15);
}

body.sidebar-collapsed.panel-page .sidebar .sidebar-search {
  border-color: rgba(166, 193, 226, .22);
  color: #aebed3;
  background: rgba(3, 19, 41, .58);
}

/* Dashboard operacional: composição desktop inspirada no painel de referência. */
@media (min-width: 821px) {
  body.panel-page {
    --panel-sidebar-width: 256px;
    --panel-topbar-height: 86px;
    background: #f4f7fb;
  }

  body.panel-page .sidebar {
    gap: 12px;
    padding: 14px 10px 12px;
  }

  body.panel-page .sidebar-header {
    min-height: 66px;
    padding: 2px 8px 13px;
  }

  body.panel-page .panel-brand img {
    width: 78px;
    height: 40px;
    flex-basis: 78px;
  }

  body.panel-page .sidebar-search { display: none; }
  body.panel-page .panel-nav { padding-top: 2px; }
  body.panel-page .nav-group { padding: 5px 0; }
  body.panel-page .nav-group-trigger {
    min-height: 26px;
    padding: 5px 16px;
    pointer-events: none;
  }
  body.panel-page .nav-group-chevron { display: none; }
  body.panel-page .nav-group-items { gap: 3px; padding: 0; }
  body.panel-page .nav-tab {
    min-height: 44px;
    gap: 13px;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
  }
  body.panel-page .nav-icon { width: 18px; height: 18px; flex-basis: 18px; }
  body.panel-page .nav-tab.active,
  body.panel-page .nav-tab[aria-current="page"] {
    box-shadow: 0 8px 20px rgba(0, 83, 190, .26);
  }

  body.panel-page .panel-main { padding: 20px 22px 30px; }
  body.panel-page .panel-top,
  body.panel-page[data-current-view="dashboard"] .panel-top {
    min-height: 86px;
    grid-template-columns: minmax(260px, .8fr) minmax(420px, 1.5fr) auto;
    gap: 22px;
    margin: -20px -22px 20px;
    padding: 13px 26px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 1px 0 var(--border-subtle);
  }
  body.panel-page .panel-context-mark { display: none; }
  body.panel-page .panel-top-context > div { gap: 2px; }
  body.panel-page .panel-top-context small { order: 2; font-size: 13px; font-weight: 500; text-transform: none; }
  body.panel-page .panel-top-context strong { order: 1; font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
  body.panel-page .panel-global-search { width: 100%; max-width: 600px; justify-self: center; }
  body.panel-page .panel-global-search input,
  body.panel-page[data-current-view="dashboard"] .panel-global-search input {
    min-height: 42px;
    border-color: #e1e7f0;
    border-radius: 8px;
    background: #fff;
  }
  body.panel-page .panel-top-actions { gap: 10px; }
  body.panel-page .topbar-button,
  body.panel-page .topbar-icon-button,
  body.panel-page .user-menu-button { min-height: 42px; }
  body.panel-page .topbar-button { padding-inline: 16px; }

  body.panel-page[data-current-view="dashboard"] .dashboard-kpis { margin: 0 0 16px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-primary-metrics,
  body.panel-page[data-current-view="dashboard"][data-density]:not(.contract-focus-mode) .dashboard-primary-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
  }
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card {
    min-height: 136px;
    height: 136px;
    padding: 20px 18px 17px;
    border: 1px solid #e6ebf2;
    border-radius: 13px;
    box-shadow: 0 6px 18px rgba(22, 40, 70, .055);
  }
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card::after { display: none; }
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__header {
    min-height: 42px;
    gap: 12px;
  }
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 11px;
  }
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__icon .ui-icon { width: 21px; height: 21px; }
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__header > span:last-child { font-size: 13px; }
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card strong,
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card--emphasis strong {
    margin-top: 6px;
    font-size: clamp(1.45rem, 1.8vw, 1.82rem);
  }
  body.panel-page[data-current-view="dashboard"] #dashboardMetrics .metric-card__detail {
    display: block;
    margin-top: auto;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-kpis__toggle { display: none; }

  body.panel-page[data-current-view="dashboard"] .dashboard-operation-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.48fr) minmax(340px, 1fr);
    gap: 16px;
    margin-bottom: 16px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-operation-grid > .panel-card,
  body.panel-page[data-current-view="dashboard"] .dashboard-fleet-row > .panel-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid #e6ebf2;
    border-radius: 14px;
    background: var(--surface-1);
    box-shadow: 0 6px 18px rgba(22, 40, 70, .05);
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-card-heading {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-card-heading h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -.015em;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-card-heading p {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 12px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-heading-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: var(--brand-primary);
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-heading-icon .ui-icon { width: 22px; height: 22px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-heading-icon--danger { color: var(--danger); }
  body.panel-page[data-current-view="dashboard"] .dashboard-card-heading > .small-btn {
    min-height: 34px;
    border-color: #dfe8f5;
    color: var(--brand-primary);
    background: #f5f8fd;
    box-shadow: none;
  }

  body.panel-page[data-current-view="dashboard"] .dashboard-operation-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-operation-tabs button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 8px 14px;
    color: var(--text-muted);
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-operation-tabs button.active {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-operation-tabs span {
    display: inline-grid;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-3);
    font-size: 11px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-operation-tabs button.active span { background: var(--brand-soft); }
  body.panel-page[data-current-view="dashboard"] .dashboard-today-table {
    min-height: 105px;
    max-height: 184px;
    border: 0;
    border-radius: 0;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-today-table table { min-width: 610px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-today-table th { background: transparent; }
  body.panel-page[data-current-view="dashboard"] .dashboard-today-table th,
  body.panel-page[data-current-view="dashboard"] .dashboard-today-table td { padding: 10px 11px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-today-table tbody tr:hover > td { background: #f8faff; }
  body.panel-page[data-current-view="dashboard"] .dashboard-card-link {
    display: block;
    min-width: 260px;
    min-height: 34px;
    margin: 10px auto 0;
    border: 1px solid #e2e8f3;
    border-radius: 7px;
    color: var(--brand-primary);
    background: #f6f8fc;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-card-link:hover { background: var(--brand-soft); }

  body.panel-page[data-current-view="dashboard"] .dashboard-attention-list {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 28px 16px;
    min-height: 48px;
    align-items: center;
    gap: 9px;
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    padding: 7px 10px;
    color: var(--text-secondary);
    background: transparent;
    text-align: left;
    cursor: pointer;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-item:last-child { border-bottom: 0; }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-item:hover { background: var(--surface-2); }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    color: var(--brand-primary);
    background: var(--brand-soft);
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-item--danger .dashboard-attention-icon { color: var(--danger); background: var(--danger-soft); }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-item--warning .dashboard-attention-icon { color: var(--warning); background: var(--warning-soft); }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-icon .ui-icon { width: 17px; height: 17px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-copy { display: grid; gap: 2px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-copy strong { color: var(--text-primary); font-size: 12px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-copy small { color: var(--text-muted); font-size: 10px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-count {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    color: var(--warning);
    background: var(--warning-soft);
    font-size: 12px;
    font-weight: 750;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-item--danger .dashboard-attention-count { color: var(--danger); background: var(--danger-soft); }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-item--primary .dashboard-attention-count { color: var(--brand-primary); background: var(--brand-soft); }
  body.panel-page[data-current-view="dashboard"] .dashboard-attention-chevron { width: 14px; height: 14px; color: var(--text-muted); }

  body.panel-page[data-current-view="dashboard"] .dashboard-fleet-row {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(270px, 1fr);
    gap: 16px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-consultation {
    margin: 0;
    padding: 18px;
    border-radius: 14px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-fleet-heading {
    grid-template-columns: 30px minmax(190px, 1fr) minmax(380px, .95fr);
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(170px, .7fr);
    gap: 9px;
    margin: 0;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar input,
  body.panel-page[data-current-view="dashboard"] .dashboard-filter-bar select { min-height: 38px; height: 38px; margin: 0; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid {
    --dashboard-visible-cards: 5;
    gap: 8px;
    grid-auto-columns: calc((100% - ((var(--dashboard-visible-cards) - 1) * 8px)) / var(--dashboard-visible-cards));
    padding: 0 1px 5px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid > .vehicle-card,
  body.panel-page .vehicle-card--dashboard { min-height: 202px; border: 1px solid var(--border-subtle); border-radius: 10px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-media,
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-image,
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-placeholder {
    min-height: 98px;
    height: 98px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-image { object-fit: contain; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body,
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card--compact .vehicle-card-body {
    gap: 6px;
    padding: 9px 10px 10px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body > header {
    display: block;
    min-height: 38px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body > header strong { font-size: 13px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body > header span { min-height: 0; margin-top: 1px; font-size: 10px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-body > header small,
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card dl,
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card footer { display: none; }
  body.panel-page[data-current-view="dashboard"] .vehicle-card-rate,
  body.panel-page .vehicle-card--dashboard .vehicle-card-rate {
    min-height: 0;
    margin-top: auto;
    padding: 0;
    background: transparent;
  }
  body.panel-page[data-current-view="dashboard"] .vehicle-card-rate small,
  body.panel-page .vehicle-card--dashboard .vehicle-card-rate small { color: var(--text-muted); font-size: 9px; }
  body.panel-page[data-current-view="dashboard"] .vehicle-card-rate strong,
  body.panel-page .vehicle-card--dashboard .vehicle-card-rate strong { color: var(--text-primary); font-size: 12px; }
  body.panel-page[data-current-view="dashboard"] .vehicle-card-media > .status-pill { top: 7px; left: 7px; right: auto; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid .vehicle-card-media > .status-pill {
    inset-inline: 7px auto;
    width: max-content;
    max-width: calc(100% - 14px);
    min-height: 22px;
    justify-self: start;
    padding: 3px 8px;
    overflow: hidden;
    background: color-mix(in srgb, var(--success-soft) 88%, var(--surface-1));
    box-shadow: 0 3px 10px rgba(22, 40, 70, .1);
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav { width: 36px; height: 36px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav--previous { left: -9px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-nav--next { right: -9px; }

  body.panel-page[data-current-view="dashboard"] .dashboard-operational-summary { display: flex; flex-direction: column; }
  body.panel-page[data-current-view="dashboard"] .dashboard-operational-summary dl {
    overflow: hidden;
    margin: 7px 0 0;
    border: 1px solid var(--border-subtle);
    border-radius: 9px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-operational-summary dl > div {
    display: flex;
    min-height: 39px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border-subtle);
    padding: 8px 12px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-operational-summary dl > div:last-child { border-bottom: 0; }
  body.panel-page[data-current-view="dashboard"] .dashboard-operational-summary dt { color: var(--text-muted); font-size: 11px; }
  body.panel-page[data-current-view="dashboard"] .dashboard-operational-summary dd { margin: 0; color: var(--text-primary); font-size: 12px; font-weight: 750; }
  body.panel-page[data-current-view="dashboard"] .dashboard-summary-updated {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: auto 0 0;
    padding-top: 16px;
    color: var(--text-muted);
    font-size: 10px;
  }
  body.panel-page[data-current-view="dashboard"] .dashboard-summary-updated .ui-icon { width: 14px; height: 14px; color: var(--brand-primary); }
}

@media (max-width: 1399px) and (min-width: 821px) {
  body.panel-page[data-current-view="dashboard"] .dashboard-primary-metrics,
  body.panel-page[data-current-view="dashboard"][data-density]:not(.contract-focus-mode) .dashboard-primary-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  body.panel-page[data-current-view="dashboard"] .dashboard-operation-grid { grid-template-columns: minmax(0, 1.3fr) minmax(320px, .9fr); }
  body.panel-page[data-current-view="dashboard"] .dashboard-fleet-row { grid-template-columns: minmax(0, 2.25fr) minmax(250px, .85fr); }
  body.panel-page[data-current-view="dashboard"] .dashboard-fleet-heading { grid-template-columns: 30px minmax(150px, .8fr) minmax(320px, 1.2fr); }
  body.panel-page[data-current-view="dashboard"] .dashboard-vehicle-grid { --dashboard-visible-cards: 4; }
}

@media (max-width: 1100px) and (min-width: 821px) {
  body.panel-page { --panel-sidebar-width: 224px; }
  body.panel-page .panel-top { grid-template-columns: minmax(180px, .6fr) minmax(280px, 1.2fr) auto; }
  body.panel-page[data-current-view="dashboard"] .dashboard-primary-metrics,
  body.panel-page[data-current-view="dashboard"][data-density]:not(.contract-focus-mode) .dashboard-primary-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.panel-page[data-current-view="dashboard"] .dashboard-operation-grid,
  body.panel-page[data-current-view="dashboard"] .dashboard-fleet-row { grid-template-columns: 1fr; }
  body.panel-page[data-current-view="dashboard"] .dashboard-fleet-heading { grid-template-columns: 30px minmax(160px, 1fr); }
  body.panel-page[data-current-view="dashboard"] .dashboard-fleet-heading .dashboard-filter-bar { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  #view-dashboard > .dashboard-fleet-row { display: block; }
  #view-dashboard > .dashboard-fleet-row > .dashboard-operational-summary { display: none; }
  #view-dashboard > .dashboard-fleet-row > .dashboard-vehicle-consultation { display: block; }
  body.panel-page[data-current-view="dashboard"] .dashboard-fleet-heading { display: block; }
  body.panel-page[data-current-view="dashboard"] .dashboard-fleet-heading > .dashboard-heading-icon { display: none; }
  body.panel-page[data-current-view="dashboard"] .dashboard-fleet-heading .dashboard-filter-bar { margin-top: 12px; }
}
