*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    color: #1a1a1a;
    background: #eef1f4;
}

.header {
    padding: 1.35rem 1.25rem 1.5rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e40af 52%, #2563eb 100%);
    color: #fff;
}

.header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.header-brand {
    flex: 1 1 280px;
    min-width: 0;
}

.header-company {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.88);
}

.header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.header-tagline {
    max-width: 40rem;
}

.header-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
}

.toggle-present {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.95);
    user-select: none;
}

.toggle-present input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #93c5fd;
}

.btn-header {
    padding: 0.5rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    cursor: pointer;
    transition: filter 0.15s, background 0.15s;
}

.btn-header:hover {
    background: #bfdbfe;
}

a.btn-header {
    text-decoration: none;
    display: inline-block;
}

.btn-header--ghost {
    color: #eff6ff;
    background: transparent;
    border-color: rgba(236, 253, 245, 0.55);
}

.btn-header--ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #eff6ff;
}

.header .muted {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.875rem;
    max-width: 42rem;
}

.main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1rem 1.25rem 2.5rem;
}

.exec-intro {
    margin-bottom: 1rem;
    padding: 1.15rem 1.25rem 1.25rem;
    border-left: 4px solid #2563eb;
}

.exec-title {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
}

.exec-lead {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    color: #334155;
    line-height: 1.55;
}

.exec-bullets {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.86rem;
    color: #475569;
    line-height: 1.5;
}

.exec-bullets li {
    margin-bottom: 0.35rem;
}

.freshness-wrap {
    margin-bottom: 1rem;
    padding: 0;
    overflow: hidden;
}

.freshness-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem 1.5rem;
    padding: 0.9rem 1.15rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.freshness-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    padding: 0.65rem 1.15rem 0.9rem;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
}

.btn-clear-local {
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    cursor: pointer;
}

.btn-clear-local:hover {
    border-color: #94a3b8;
    color: #0f172a;
    background: #f8fafc;
}

.freshness-actions-hint {
    font-size: 0.78rem;
    color: #64748b;
    max-width: 42rem;
    line-height: 1.35;
}

.freshness-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.freshness-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.freshness-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

body.presentation-mode {
    font-size: 1.05rem;
}

body.presentation-mode .main {
    max-width: 1280px;
}

body.presentation-mode .section-title {
    font-size: 1.2rem;
}

body.presentation-mode .rule-card__desc {
    font-size: 1rem;
}

body.presentation-mode .header-tech,
body.presentation-mode .header-tech-inline {
    display: none;
}

.status-line {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: #3d4a54;
}

.status-line.is-offline {
    border-left: 3px solid #f59e0b;
    padding-left: 0.65rem;
    color: #92400e;
    background: rgba(251, 191, 36, 0.12);
}

.status-line.is-error {
    color: #b42318;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.15rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.toolbar {
    margin-bottom: 1rem;
}

.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.5rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1 1 200px;
    min-width: 160px;
}

.field-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #f8fafc;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input:hover {
    border-color: #94a3b8;
}

.input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(22, 95, 70, 0.15);
    background: #fff;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #334155;
    user-select: none;
}

.toggle input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #2563eb;
}

.meta {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    font-size: 0.85rem;
    color: #475569;
}

.meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
}

.meta-frota-line {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e2e8f0;
    font-size: 0.82rem;
    color: #64748b;
}

.meta-frota-line--muted {
    font-style: italic;
}

.meta-frota-err {
    color: #c2410c;
    font-weight: 600;
}

.meta-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.65rem;
    max-width: 28rem;
}

.meta-kpi {
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.meta-kpi--ok {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.meta-kpi--alert {
    background: #fff7ed;
    border-color: #fed7aa;
}

.meta-kpi-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.meta-kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
    line-height: 1.1;
}

.meta strong {
    color: #0f172a;
    font-weight: 600;
}

.meta-sep {
    opacity: 0.45;
    font-weight: 400;
}

.rule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.rule-card {
    border-radius: 12px;
    padding: 1.1rem 1.15rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.2s, transform 0.15s;
}

.rule-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.rule-card.is-hidden {
    display: none;
}

.rule-card--ok {
    border-left: 4px solid #2563eb;
}

.rule-card--warn {
    border-left: 4px solid #ea580c;
}

.rule-card--err {
    border-left: 4px solid #dc2626;
}

.rule-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.rule-card__id {
    font-size: 0.72rem;
    font-family: ui-monospace, monospace;
    color: #64748b;
    word-break: break-all;
}

.badge {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.badge--ok {
    background: #dbeafe;
    color: #1e40af;
}

.badge--alert {
    background: #ffedd5;
    color: #9a3412;
}

.badge--fail {
    background: #fee2e2;
    color: #991b1b;
}

.rule-card__desc {
    margin: 0 0 0.85rem;
    font-size: 0.92rem;
    color: #1e293b;
    line-height: 1.45;
}

.rule-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 1rem;
    font-size: 0.8rem;
}

.rule-metrics dt {
    margin: 0;
    color: #64748b;
    font-weight: 500;
}

.rule-metrics dd {
    margin: 0.15rem 0 0;
    font-weight: 600;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.rule-metrics__full {
    grid-column: 1 / -1;
}

.rule-card__obs {
    margin: 0.75rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}

.rule-card__err {
    margin: 0.75rem 0 0;
    padding: 0.5rem 0.65rem;
    background: #fef2f2;
    border-radius: 8px;
    font-size: 0.78rem;
    color: #991b1b;
    word-break: break-word;
}

.raw-wrap {
    margin-top: 1.5rem;
}

.raw-title {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: #475569;
}

.report {
    margin: 0;
    padding: 1rem;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    overflow: auto;
    font-size: 0.75rem;
    line-height: 1.45;
    max-height: 55vh;
}

.section-head {
    margin-bottom: 1rem;
}

.section-head--charts {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.section-head-text {
    flex: 1 1 220px;
    min-width: 0;
}

.btn-charts-fs {
    flex: 0 0 auto;
    padding: 0.5rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    border: 1px solid #1e40af;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-charts-fs:hover {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-color: #2563eb;
}

.btn-charts-fs:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

#chartsPanel:fullscreen,
#chartsPanel:-webkit-full-screen {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
    padding: 1.25rem 1.5rem 2rem;
    overflow: auto;
    background: linear-gradient(180deg, #f1f5f9 0%, #fff 35%);
    border: none;
    border-radius: 0;
    box-shadow: none;
}

#chartsPanel:fullscreen .charts-grid,
#chartsPanel:-webkit-full-screen .charts-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

#chartsPanel:fullscreen .chart-canvas-wrap,
#chartsPanel:-webkit-full-screen .chart-canvas-wrap {
    height: clamp(260px, 36vh, 520px);
}

#chartsPanel:fullscreen .chart-canvas-wrap--donut,
#chartsPanel:-webkit-full-screen .chart-canvas-wrap--donut {
    height: clamp(240px, 32vh, 440px);
    max-width: min(100%, 340px);
}

.charts-extra {
    display: none;
    margin-top: 1.35rem;
    padding-top: 1.35rem;
    border-top: 1px solid #e2e8f0;
}

.charts-extra-heading {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.02em;
}

#chartsPanel:fullscreen .charts-extra,
#chartsPanel:-webkit-full-screen .charts-extra,
#chartsPanel.is-fullscreen .charts-extra {
    display: block;
}

#chartsPanel:fullscreen .charts-grid--extra,
#chartsPanel:-webkit-full-screen .charts-grid--extra,
#chartsPanel.is-fullscreen .charts-grid--extra {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
}

#chartsPanel:fullscreen .charts-grid--extra .chart-canvas-wrap,
#chartsPanel:-webkit-full-screen .charts-grid--extra .chart-canvas-wrap,
#chartsPanel.is-fullscreen .charts-grid--extra .chart-canvas-wrap {
    height: clamp(240px, 30vh, 480px);
}

.section-title {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
}

.section-sub {
    margin: 0;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.45;
}

.mine {
    margin-bottom: 1rem;
}

.mine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem 1.25rem;
    align-items: end;
}

.field--date {
    min-width: 140px;
}

.input--select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    padding-right: 2rem;
}

.presets {
    grid-column: 1 / -1;
}

@media (min-width: 720px) {
    .presets {
        grid-column: auto;
    }
}

.preset-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.btn-preset {
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-preset:hover {
    background: #bfdbfe;
    border-color: #60a5fa;
}

.mine-hint {
    margin: 0.85rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

.charts-wrap {
    margin-bottom: 1rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

.chart-card {
    padding: 1rem 1.15rem 1.2rem;
    background: linear-gradient(
        165deg,
        #fafbfc 0%,
        #ffffff 42%,
        #f4f6f8 100%
    );
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 8px 24px -6px rgba(15, 23, 42, 0.08);
}

.chart-card--donut {
    max-width: 400px;
}

.chart-title {
    margin: 0 0 0.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.chart-caption {
    margin: 0 0 0.85rem;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.35;
}

.chart-canvas-wrap {
    position: relative;
    height: 280px;
}

.chart-canvas-wrap--donut {
    height: 240px;
    max-width: 280px;
    margin: 0 auto;
}

.view-hide-cards .panel-cards {
    display: none;
}

.view-hide-charts .panel-charts {
    display: none;
}

/* --- Mineração tabular (datamine) --- */
.dm {
    margin-bottom: 1rem;
}

.dm-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.field--narrow {
    flex: 0 0 110px;
    min-width: 100px;
}

.field--grow {
    flex: 1 1 200px;
    min-width: 180px;
}

.dm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.dm-pivot-period {
    flex: 1 1 100%;
    padding: 0.65rem 0.75rem;
    margin: 0 0 0.25rem;
    border-radius: 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.dm-pivot-period .toggle--block {
    align-items: flex-start;
    max-width: 48rem;
    line-height: 1.45;
    font-size: 0.82rem;
    color: #1e3a8a;
}

.btn-dm {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-dm:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.btn-dm--primary {
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    border-color: #1e40af;
}

.btn-dm--primary:hover {
    filter: brightness(1.06);
}

.dm-fields {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.dm-legend {
    padding: 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
}

.dm-legend-hint {
    font-weight: 500;
    opacity: 0.75;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.75rem;
}

.dm-snapshot {
    margin-bottom: 1rem;
}

.dm-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.dm-snap-card {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dm-snap-card--accent {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
}

.dm-snap-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.dm-snap-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    word-break: break-word;
}

.dm-snap-footnote {
    margin-top: 0.15rem;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.4;
    color: #64748b;
    max-width: 28rem;
}

.dm-snap-value--sm {
    font-size: 0.88rem;
    font-weight: 600;
}

.dm-checkgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.35rem 1rem;
    margin-top: 0.5rem;
}

.dm-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: #334155;
    cursor: pointer;
}

.dm-check input {
    accent-color: #2563eb;
}

.dm-status {
    min-height: 1.25rem;
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: #475569;
}

.dm-status.is-error {
    color: #b42318;
}

.dm-status-hint {
    margin: -0.35rem 0 0.85rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #64748b;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #cbd5e1;
}

.dm-status-hint:not([hidden]) {
    display: block;
}

.dm-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    margin-bottom: 0.65rem;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.dm-table-toolbar-filter {
    flex: 1 1 200px;
    min-width: 0;
    margin: 0;
}

.dm-table-meta {
    margin: 0;
    flex: 1 1 140px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    font-variant-numeric: tabular-nums;
}

.dm-table-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.dm-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    margin: 0;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: inherit;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.dm-sort-btn:hover {
    color: #2563eb;
}

.dm-sort-btn:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.dm-th-sorted-asc .dm-sort-btn::after,
.dm-th-sorted-desc .dm-sort-btn::after {
    content: "";
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.75;
}

.dm-th-sorted-asc .dm-sort-btn::after {
    border-bottom: 5px solid #2563eb;
    margin-top: 2px;
}

.dm-th-sorted-desc .dm-sort-btn::after {
    border-top: 5px solid #2563eb;
    margin-bottom: 2px;
}

.dm-empty-filter {
    text-align: center;
    padding: 1.5rem 1rem !important;
    color: #64748b;
    font-size: 0.88rem;
    background: #f8fafc;
}

.dm-table-footnote {
    margin: 0;
    padding: 0.45rem 0.65rem 0;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.4;
}

.dm-chart-card {
    margin-bottom: 1rem;
    padding: 1rem 1.15rem 1.2rem;
    background: linear-gradient(
        165deg,
        #fafbfc 0%,
        #ffffff 48%,
        #eff6ff 100%
    );
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 14px;
    box-shadow:
        0 1px 2px rgba(37, 99, 235, 0.06),
        0 10px 28px -8px rgba(30, 64, 175, 0.12);
}

.dm-chart-title {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

.dm-chart-caption {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.35;
}

.dm-chart-canvas-wrap {
    position: relative;
    height: min(320px, 48vh);
    max-width: 100%;
}

.dm-table-wrap {
    overflow: auto;
    max-height: min(62vh, 640px);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.dm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.dm-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #0f172a;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    border-bottom: 2px solid #cbd5e1;
    white-space: nowrap;
}

.dm-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.dm-table tbody tr:hover {
    background: #eff6ff;
}

.dm-table-wrap--pivot .dm-table tbody tr:nth-child(even) {
    background: #f1f5f9;
}

.dm-table-wrap--pivot .dm-table tbody tr:nth-child(odd) {
    background: #fff;
}

.dm-table-wrap--pivot .dm-table tbody tr:hover {
    background: #e2e8f0;
}

.dm-table td,
.dm-table tfoot th {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    color: #1e293b;
}

.dm-table tfoot th {
    position: sticky;
    bottom: 0;
    background: #0f172a;
    color: #f8fafc;
    font-weight: 600;
    border-top: 2px solid #334155;
}

.dm-table .dm-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dm-table .dm-total-label {
    text-align: right;
    padding-right: 1rem;
}

@media (max-width: 520px) {
    .rule-metrics {
        grid-template-columns: 1fr;
    }
}

@media print {
    body {
        background: #fff;
        font-size: 11pt;
        color: #000;
    }

    .no-print,
    .header-tools,
    .status-line,
    .dm-toolbar,
    .dm-fields,
    .toolbar,
    .mine-grid,
    .chart-caption {
        display: none !important;
    }

    .header {
        background: #2563eb !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-root {
        max-width: none !important;
        padding: 0.5rem 0.75rem 1rem;
    }

    .card,
    .exec-intro,
    .freshness-wrap,
    .freshness-bar,
    .dm-snapshot,
    .dm-table-wrap,
    .chart-card,
    .rule-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }

    .dm-table-wrap {
        max-height: none !important;
        overflow: visible !important;
    }

    .chart-canvas-wrap {
        height: 200px;
    }

    .dm-table thead th {
        background: #e5e7eb !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .dm-table tfoot th {
        background: #1f2937 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

.site-footer {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.25rem 1.75rem;
    text-align: center;
    font-size: 0.78rem;
    color: #64748b;
}

.site-footer p {
    margin: 0;
}

body.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #eff6ff 0%, #eef1f4 45%, #e2e8f0 100%);
}

.login-wrap {
    width: 100%;
    max-width: 400px;
    padding: 1.25rem;
}

.login-card {
    padding: 1.5rem 1.35rem 1.65rem;
}

.login-company {
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #1e40af;
}

.login-title {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
}

.login-sub {
    margin: 0 0 1.15rem;
    font-size: 0.86rem;
    color: #64748b;
}

.login-error {
    margin: 0 0 1rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.85rem;
}

.login-submit {
    width: 100%;
    margin-top: 0.5rem;
}

/* Hub inicial (menu de módulos) */
.hub-page .header {
    padding-bottom: 1.5rem;
}

.hub-nav {
    padding: 0.55rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hub-nav-link {
    color: #1d4ed8;
    font-weight: 600;
    text-decoration: none;
}

.hub-nav-link:hover {
    text-decoration: underline;
}

.hub-nav-current {
    color: #64748b;
}

.hub-nav-sep {
    color: #cbd5e1;
    user-select: none;
}

.hub-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2.5rem;
}

.hub-title {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #0f172a;
}

.hub-lead {
    margin: 0;
    font-size: 0.92rem;
    color: #475569;
    line-height: 1.55;
}

.hub-intro {
    margin-bottom: 1.5rem;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.hub-card {
    display: flex;
    flex-direction: column;
    padding: 1.35rem 1.25rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-card--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.hub-card--link:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.hub-card-title {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
}

.hub-card-desc {
    margin: 0;
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.45;
    flex: 1;
}

.hub-card-cta {
    margin-top: 1rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: #1d4ed8;
}

.hub-badge {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f1f5f9;
    color: #64748b;
    align-self: flex-start;
}

.frota-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.frota-kpi-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.frota-kpi-desc {
    margin: 0 0 0.75rem;
    font-size: 0.86rem;
    color: #64748b;
    line-height: 1.45;
}

.frota-kpi-status {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #94a3b8;
}

.frota-toolbar {
    margin-bottom: 1.25rem;
}

.frota-block-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
}

.frota-block-desc {
    margin: 0 0 1rem;
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.45;
}

.frota-block-desc code {
    font-size: 0.82rem;
    background: #f1f5f9;
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
}

.frota-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
}

.frota-report {
    margin-bottom: 1.25rem;
}

.frota-actions {
    margin-bottom: 0.65rem;
}

.frota-actions--split {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.viagem-actions {
    margin-top: 0.9rem;
}

.frota-status {
    margin: 0 0 0.35rem;
    font-size: 0.86rem;
    color: #475569;
    min-height: 1.25rem;
}

.frota-status.is-error {
    color: #b91c1c;
    font-weight: 600;
}

.frota-meta {
    margin: 0 0 0.65rem;
    font-size: 0.78rem;
    color: #94a3b8;
}

.frota-table-host {
    min-height: 2rem;
}

.frota-table-scroll {
    max-height: min(70vh, 720px);
    overflow: auto;
}

.frota-dm-table {
    font-size: 0.78rem;
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.frota-dm-table th,
.frota-dm-table td {
    white-space: nowrap;
}

.frota-empty {
    margin: 0;
    padding: 1rem;
    color: #64748b;
    font-size: 0.88rem;
}

.toggle--block {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    max-width: 42rem;
    margin-top: 0.65rem;
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.45;
}

.toggle--block input {
    margin-top: 0.2rem;
}

.viagem-toggle-full {
    margin-top: 0.35rem;
}

.viagem-grid-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 1rem;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.viagem-grid-toolbar-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    flex: 1 1 100%;
}

.viagem-grid-page-size {
    flex: 0 0 140px;
}

.viagem-grid-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.viagem-grid-meta {
    margin: 0;
    flex: 1 1 200px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}
