* { box-sizing: border-box; }
:root { color-scheme: dark; font-family: "Segoe UI", Arial, sans-serif; color: #e4edf3; background: #151c24; }
body { margin: 0; }
header { background: linear-gradient(115deg, #172b31, #202b38); border-bottom: 1px solid #354450; color: white; padding: 32px max(24px, calc((100% - 1392px)/2)); display: flex; justify-content: space-between; gap: 20px; align-items: center; }
header a { color: white; white-space: nowrap; }
h1 { font-size: clamp(1.7rem, 3vw, 2.5rem); margin: 10px 0; }
h2 { font-size: 1.15rem; color: #e4edf3; margin-top: 0; }
h3 { font-size: .97rem; }
p { line-height: 1.5; }
.eyebrow { font-size: .73rem; font-weight: bold; letter-spacing: .12em; color: #83cdbc; }
main { max-width: 1440px; padding: 24px; margin: auto; }
.dashboard-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; border-bottom: 1px solid #354450; padding-bottom: 12px; }
.dashboard-tabs button { background: transparent; color: #b6c7d4; border: 0; padding: 14px 18px; }
.dashboard-tabs button[aria-pressed="true"] { color: #10251f; background: #68cfb4; box-shadow: 0 4px 10px #0002; }
[data-aba].aba-inativa { display: none; }
.kpi:first-child { background: linear-gradient(130deg, #22694e, #215a50); color: white; }
.kpi:first-child strong, .kpi:first-child p { color: white; }
.kpi { min-height: 160px; }
section, .filters, .kpi { padding: 24px; border: 1px solid #354450; border-radius: 14px; background: #242f3b; box-shadow: 0 6px 20px #0002; }
section { margin-bottom: 20px; min-width: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
label { display: flex; flex-direction: column; font-size: .8rem; font-weight: bold; gap: 6px; flex: 1 1 160px; }
select, input, button { font: inherit; border: 1px solid #536574; border-radius: 7px; padding: 10px; min-height: 42px; }
select, input { width: 100%; background: #18232e; color: #e4edf3; }
button { cursor: pointer; color: #10251f; background: #68cfb4; font-weight: bold; }
button:hover:not(:disabled) { filter: brightness(1.12); }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid #bb8700; outline-offset: 3px; }
.toolbar { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin: 20px 0; }
.toolbar button { margin: 4px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { border-top: 4px solid #68cfb4; }
.kpi:nth-child(2) { border-color: #69b8e4; background: #23465d; }
.kpi:nth-child(3) { border-color: #e8ad50; background: #554530; }
.kpi:nth-child(4) { border-color: #ac9ce5; background: #3d3b59; }
.kpi strong { display: block; font-size: 2.3rem; color: #fff; margin: 12px 0 6px; font-variant-numeric: tabular-nums; }
.kpi p, .hint { color: #b6c7d4; font-size: .82rem; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bar-row { margin: 18px 0; font-size: .84rem; }
.bar-caption { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.bar-track { background: #151f29; border-radius: 5px; height: 18px; overflow: hidden; display: flex; }
.mean-bar { background: linear-gradient(90deg, #328e8e, #68cfb4); transition: width .4s ease; }
.segment { height: 100%; }
.note-1 { background: #dc7581; } .note-2 { background: #e59b56; } .note-3 { background: #e5cd77; } .note-4 { background: #83cdbc; } .note-5 { background: #2f9f94; }
.segment:focus { outline: 2px solid white; outline-offset: -2px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .75rem; }
.legend span { border-bottom: 4px solid; padding-bottom: 3px; }
.legend span:nth-child(1) { border-color: #b64951; } .legend span:nth-child(2) { border-color: #d98b45; } .legend span:nth-child(3) { border-color: #d7bc5c; } .legend span:nth-child(4) { border-color: #69b5a2; } .legend span:nth-child(5) { border-color: #176e69; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 12px; border-bottom: 1px solid #3c4b58; text-align: left; }
th { color: #bed0df; background: #1b2733; }
.alpha { border-left: 5px solid #68cfb4; }
.alpha-card { padding: 18px; background: #1b2733; border: 1px solid #354450; border-radius: 9px; }
.alpha-card strong { display: block; font-size: 1.7rem; color: #83dcc5; }
li { margin-bottom: 10px; line-height: 1.5; }
summary { cursor: pointer; padding: 10px 0; font-weight: bold; }
footer { color: #b6c7d4; font-size: .8rem; }
.demo { background: #4a3b1e; color: #ffe2a1; border: 1px solid #a87f31; border-radius: 8px; padding: 16px; font-weight: bold; }
#dashboardStatus[role="alert"] { color: #a71c30; background: #fff0f0; padding: 16px; }
.comment { white-space: pre-wrap; border-bottom: 1px solid #dfe7ed; padding: 12px 0; overflow-wrap: anywhere; }
.panorama-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.donut-layout { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; padding: 16px 0; }
.donut { width: 180px; height: 180px; flex: 0 0 180px; border-radius: 50%; display: grid; place-items: center; }
.donut-center { border-radius: 50%; background: #242f3b; width: 132px; height: 132px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.donut-center strong { font-size: 2rem; }
.donut-center span { font-size: .8rem; color: #b6c7d4; }
.event-legend { display: flex; flex-direction: column; gap: 12px; }
.event-chip { background: #1b2733; color: #e4edf3; border-left: 5px solid #4fc3ac; text-align: left; }
.event-chip.mic { border-left-color: #e8ad50; }
.event-chip[aria-pressed="true"] { outline: 2px solid #b6c7d4; }
#serieEnvios { max-height: 260px; overflow-y: auto; padding: 0 10px; }
.report-heading { display: flex; gap: 20px; justify-content: space-between; align-items: center; }
#textoRelatorio { max-width: 100ch; }
#textoRelatorio p { white-space: pre-line; line-height: 1.8; }
#textoRelatorio h3 { margin-top: 28px; color: #83dcc5; }
.comparison-group { padding: 8px 0 16px; border-bottom: 1px solid #3c4b58; break-inside: avoid; }
.comparison-row { display: grid; grid-template-columns: 72px minmax(60px, 1fr) 155px; align-items: center; gap: 12px; margin: 10px 0; font-size: .82rem; }
.comparison-row > span:last-child { font-variant-numeric: tabular-nums; }
.comparison-bar { transition: width .4s ease; }
.comparison-bar.fecitac { background: #4fc3ac; }
.comparison-bar.mic { background: #e8ad50; }
.public-filter { background: transparent; color: #c9e6f4; border: 0; text-align: left; padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }
.public-filter[aria-pressed="true"] { color: #83dcc5; }
.perception-track { height: 28px; }
.perception-track .segment { display: grid; place-items: center; font-size: .75rem; font-weight: bold; color: #101b26; white-space: nowrap; }
.percepcao-baixa { background: #dc7581; }
.percepcao-media { background: #e5cd77; }
.percepcao-alta { background: #83cdbc; }
.percepcao-legend span:nth-child(1) { border-color: #dc7581; }
.percepcao-legend span:nth-child(2) { border-color: #e5cd77; }
.percepcao-legend span:nth-child(3) { border-color: #83cdbc; }
.heatmap caption { padding: 12px 0; text-align: left; font-size: .8rem; }
.heat-cell { min-width: 135px; text-align: center; }
.heat-cell strong, .heat-cell span { display: block; }
.heat-cell span { font-size: .75rem; margin-top: 6px; }
.heat-value { color: white; border: 3px solid #242f3b; }
@media (prefers-reduced-motion: reduce) { .mean-bar { transition: none; } }
@media (prefers-reduced-motion: reduce) { .comparison-bar { transition: none; } }
[hidden] { display: none !important; }
@media (max-width: 800px) { .grid, .panorama-grid { grid-template-columns: 1fr; } .kpis { grid-template-columns: 1fr 1fr; } header, .toolbar, .report-heading { flex-direction: column; align-items: flex-start; } main { padding: 14px; } section { padding: 16px; } }
@media (max-width: 420px) { .kpis { grid-template-columns: 1fr; } .dashboard-tabs button { flex: 1 1 100%; text-align: left; } }
@media (max-width: 600px) {
    .comparison-row { grid-template-columns: 65px minmax(50px, 1fr); gap: 6px; }
    .comparison-row > span:last-child { grid-column: 2; }
    .perception-track .segment { font-size: .65rem; }
}
@media print {
    @page { size: A4; margin: 12mm; }
    :root, body { color-scheme: light; background: white; color: #111; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    header { padding: 16px; background: white; color: #111; }
    header a, .filters, .toolbar button, .comments, #dashboardStatus, .dashboard-tabs, #copiarRelatorio { display: none !important; }
    .aba-inativa:not(.comments) { display: block; }
    main { padding: 0; }
    section, .kpi, .kpi:first-child, .kpi:nth-child(2), .kpi:nth-child(3), .kpi:nth-child(4), .alpha-card, .donut-center, th, .event-chip { background: white; color: #111; box-shadow: none; }
    section, .kpi { padding: 14px; border-color: #ccc; }
    tr, .kpi, .alpha-card, .donut-layout { break-inside: avoid; }
    h2, h3, .eyebrow, .hint, footer, .kpi p, .kpi:first-child p, .kpi strong, .kpi:first-child strong, .alpha-card strong, #textoRelatorio h3, .donut-center span { color: #222; }
    .grid { display: block; }
    .kpis[data-aba] { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .kpi strong { font-size: 1.4rem; }
    .table-wrap { overflow: visible; }
    table { font-size: 9pt; }
    th, td { padding: 6px; }
    .alpha-card { margin-bottom: 12px; }
    #serieEnvios { max-height: none; overflow: visible; }
    #textoRelatorio { max-width: none; }
    .public-filter { color: #222; }
    .heat-cell { min-width: 0; }
    .heat-value { color: white; border: 2px solid white; }
    details > * { display: block !important; }
    h2 { break-after: avoid; }
}
