/* ════════════════════════════════════════════════════════════════════
   Credito de Carbono — Midnight Editorial Dashboard
   ════════════════════════════════════════════════════════════════════
   Paleta midnight blue · tipografia serifada editorial
   Acentos: dourado (gold) · azul-aco (azure) · azul-gelo (ice)
   ════════════════════════════════════════════════════════════════════ */



:root {
    --ink-void:       #0a1220;
    --ink-deep:       #0c1526;
    --ink-raised:     #111d33;
    --ink-elevated:   #162640;
    --ink-highest:    #1c304d;

    --paper:          #e0dff0;
    --paper-bright:   #f0eff6;
    --paper-dim:      #8a92a8;
    --paper-faint:    #5a6580;
    --paper-whisper:  #3a4560;

    --hairline:           rgba(224, 223, 240, 0.07);
    --hairline-bright:    rgba(224, 223, 240, 0.18);
    --hairline-strong:    rgba(224, 223, 240, 0.32);

    --gold:           #e2b84d;
    --gold-bright:    #f0ca65;
    --gold-glow:      rgba(226, 184, 77, 0.20);
    --azure:          #5d8fc9;
    --azure-glow:     rgba(93, 143, 201, 0.18);
    --steel:          #3a6ea5;
    --steel-bright:   #6da4d4;
    --steel-glow:     rgba(58, 110, 165, 0.18);
    --ice:            #8ab4e0;
    --ice-pale:       #a8c8eb;
    --coral:          #c96a4a;

    --font-display:   Helvetica, Arial, sans-serif;
    --font-body:      Helvetica, Arial, sans-serif;
    --font-mono:      Helvetica, Arial, sans-serif;

    --shell-max:      1400px;
    --shell-pad:      clamp(1.25rem, 3.5vw, 2.75rem);

    --ease-fluid:     cubic-bezier(0.2, 0.8, 0.2, 1);
    --shadow-button:  rgba(0, 0, 0, 0.18);
}


*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--ink-void);
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s var(--ease-fluid), color 0.3s var(--ease-fluid);
}


body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 900px 600px at 15% -10%, var(--gold-glow), transparent 58%),
        radial-gradient(ellipse 700px 500px at 95% 35%, var(--steel-glow), transparent 55%),
        radial-gradient(ellipse 500px 700px at 55% 110%, var(--azure-glow), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.88  0 0 0 0 0.87  0 0 0 0 0.94  0 0 0 0.7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    opacity: 0.04;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 1;
}


.shell {
    position: relative;
    z-index: 10;
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: 0 var(--shell-pad);
}

::selection {
    background: var(--gold);
    color: var(--ink-void);
}


.masthead {
    padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4.5rem);
    border-bottom: 1px solid var(--hairline);
    position: relative;
}

.masthead-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.masthead-text {
    flex: 1 1 auto;
    min-width: 0;
}

.masthead-team {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 2.5rem;
    border: 1px solid var(--hairline-bright);
    border-radius: 4px;
    background: rgba(255,255,255,0.03);
    min-width: 260px;
    max-width: 380px;
}

.masthead-team-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.25rem;
    display: block;
}

.masthead-team-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.masthead-team-list li {
    border-bottom: 1px solid var(--hairline);
}

.masthead-team-list li:last-child {
    border-bottom: none;
}

.masthead-team-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 0;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 400;
    color: var(--paper-dim);
    text-decoration: none;
    transition: color 0.18s ease;
    white-space: nowrap;
}

.masthead-team-link:hover {
    color: var(--paper-bright);
}

.masthead-team-link:hover .team-icon {
    color: var(--gold);
}

.team-icon {
    font-size: 13px;
    color: var(--paper-faint);
    transition: color 0.18s ease;
    line-height: 1;
}

.masthead-logos {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.75rem;
    padding-left: 2rem;
}

.masthead-logo {
    display: block;
    object-fit: contain;
}

.masthead-logo--bb {
    width: clamp(80px, 10vw, 120px);
    height: auto;
}

.masthead-logo--cesar {
    width: clamp(90px, 11vw, 130px);
    height: auto;
    filter: brightness(0) invert(1) opacity(0.75);
}

.masthead-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(3.5rem, 10vw, 8rem);
    line-height: 0.9;
    letter-spacing: -0.045em;
    color: var(--paper-bright);
    margin-bottom: 1.5rem;
}

.masthead-title em {
    font-style: italic;
    font-weight: 400;
    color: var(--paper-bright);
}

.masthead-standfirst {
    max-width: 640px;
    font-size: 17px;
    line-height: 1.55;
    color: var(--paper-dim);
    font-weight: 300;
    margin-top: 2.25rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--gold);
}

.masthead-standfirst strong {
    color: var(--paper-dim);
    font-weight: 600;
}


.rail {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--ink-void) 80%, transparent);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    border-bottom: 1px solid var(--hairline);
    margin: 0 calc(var(--shell-pad) * -1);
    padding: 14px var(--shell-pad);
    display: flex;
    gap: 2.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.rail::-webkit-scrollbar { display: none; }

.rail a {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--paper-faint);
    text-decoration: none;
    white-space: nowrap;
    padding: 4px 0;
    position: relative;
    transition: color 0.32s var(--ease-fluid);
}

.rail a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.32s var(--ease-fluid);
}

.rail a:hover,
.rail a[data-active="true"] {
    color: var(--paper-bright);
}

.rail a:hover::after,
.rail a[data-active="true"]::after {
    transform: scaleX(1);
}

.rail a .sec {
    color: var(--gold);
    margin-right: 0.55rem;
    font-weight: 600;
}


.hero {
    padding: clamp(3rem, 6vw, 4.5rem) 0;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: end;
    border-bottom: 1px solid var(--hairline);
}

.hero-label {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--paper-dim);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.hero-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--hairline-bright);
    max-width: 80px;
}

.hero-value {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(3.5rem, 10vw, 7.5rem);
    line-height: 0.92;
    letter-spacing: -0.04em;
    background: linear-gradient(175deg, var(--paper-bright) 20%, var(--gold) 130%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-unit {
    font-family: var(--font-body);
    font-size: 14.5px;
    color: var(--paper-dim);
    margin-top: 0.9rem;
    letter-spacing: 0.01em;
    font-weight: 300;
}

.hero-unit strong {
    color: var(--paper-dim);
    font-weight: 500;
}

.hero-side {
    display: grid;
    gap: 0;
    padding-bottom: 0.5rem;
}

.hero-side dl {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 2rem;
    align-items: baseline;
    padding: 1rem 0;
    border-top: 1px solid var(--hairline);
}

.hero-side dl:last-child {
    border-bottom: 1px solid var(--hairline);
}

.hero-side dt {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--paper-faint);
}

.hero-side dd {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 400;
    color: var(--paper-bright);
    letter-spacing: -0.025em;
    line-height: 1;
    text-align: right;
}

.hero-side dd small {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--paper-faint);
    font-weight: 500;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}


.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--hairline);
}

.kpi-tile {
    padding: 0.5rem 1.75rem;
    border-right: 1px solid var(--hairline);
    position: relative;
    transition:
        transform 0.4s var(--ease-fluid),
        box-shadow 0.4s var(--ease-fluid);
}

.kpi-tile::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--paper-whisper);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-fluid);
}

.kpi-tile[data-accent="gold"]::after { background: var(--gold); }
.kpi-tile[data-accent="azure"]::after { background: var(--ice-pale); }
.kpi-tile[data-accent="ice"]::after { background: var(--azure); }
.kpi-tile[data-accent="steel"]::after  { background: var(--steel-bright); }
.kpi-tile[data-accent="paper"]::after { background: var(--paper-dim); }

.kpi-tile:hover {
    transform: translateY(-4px);
}

.kpi-tile:hover::after {
    transform: scaleX(1);
}

.kpi-tile:hover .value {
    text-shadow: 0 0 18px currentColor;
}

.kpi-tile[data-accent="gold"]:hover { box-shadow: 0 12px 32px -18px var(--gold); }
.kpi-tile[data-accent="azure"]:hover { box-shadow: 0 12px 32px -18px var(--ice); }
.kpi-tile[data-accent="ice"]:hover { box-shadow: 0 12px 32px -18px var(--azure); }
.kpi-tile[data-accent="steel"]:hover  { box-shadow: 0 12px 32px -18px var(--steel); }
.kpi-tile[data-accent="paper"]:hover { box-shadow: 0 12px 32px -18px rgba(237,232,223,0.25); }

.kpi-tile:first-child { padding-left: 0; }
.kpi-tile:last-child  { border-right: none; padding-right: 0; }

.kpi-tile .label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--paper-faint);
    margin-bottom: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.kpi-tile .label::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--paper-whisper);
    transition: box-shadow 0.3s;
}

.kpi-tile[data-accent="gold"] .label::before { background: var(--gold);       box-shadow: 0 0 10px var(--gold); }
.kpi-tile[data-accent="azure"] .label::before { background: var(--ice-pale);  box-shadow: 0 0 10px var(--ice); }
.kpi-tile[data-accent="ice"] .label::before { background: var(--azure);       box-shadow: 0 0 10px var(--azure); }
.kpi-tile[data-accent="steel"]  .label::before { background: var(--steel-bright); box-shadow: 0 0 10px var(--steel); }
.kpi-tile[data-accent="paper"] .label::before { background: var(--paper-dim);   box-shadow: 0 0 8px rgba(237,232,223,0.25); }

.kpi-tile .value {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 3.6vw, 2.85rem);
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--paper-bright);
}

.kpi-tile .value em {
    font-style: italic;
    color: var(--gold);
    font-weight: 300;
}

.kpi-tile .sublabel {
    margin-top: 0.7rem;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--paper-faint);
}


.note {
    margin: 2.5rem 0;
    padding: 1.75rem 2rem;
    border: 1px solid var(--hairline);
    border-left: 2px solid var(--azure);
    background: linear-gradient(95deg,
        color-mix(in srgb, var(--azure) 5%, transparent),
        transparent 60%);
    border-radius: 2px;
    position: relative;
}

.note-kicker {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--azure);
    font-weight: 600;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.note-kicker::before {
    content: "§";
    font-family: var(--font-display);
    font-size: 18px;
    font-style: italic;
    line-height: 1;
    text-transform: none;
    letter-spacing: 0;
    color: var(--azure);
    font-weight: 400;
}

.note-body {
    font-size: 14px;
    line-height: 1.75;
    color: var(--paper-dim);
    max-width: 85ch;
    font-weight: 300;
}

.note-body strong { color: var(--paper-dim); font-weight: 600; }
.note-body em     { color: var(--paper-dim); font-style: italic; }


.chapter {
    padding: clamp(3.5rem, 7vw, 5.5rem) 0 clamp(2rem, 4vw, 2.75rem);
    border-bottom: 1px solid var(--hairline);
}

.chapter-head {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
    align-items: start;
}

.chapter-num {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 68px;
    line-height: 0.9;
    color: var(--gold);
    letter-spacing: -0.05em;
    font-style: italic;
    padding-top: 0.15em;
    position: relative;
}

.chapter-num::after {
    content: "";
    position: absolute;
    bottom: 0.15em;
    left: 0;
    width: 28px;
    height: 1px;
    background: var(--gold);
}

.chapter-kicker {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--paper-faint);
    margin-bottom: 0.6rem;
}

.chapter-heading {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.85rem, 3.2vw, 2.7rem);
    color: var(--paper-bright);
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.chapter-heading em {
    font-style: italic;
    color: var(--paper-bright);
    font-weight: 400;
}

.chapter-deck {
    font-size: 16px;
    color: var(--paper-dim);
    max-width: 62ch;
    line-height: 1.55;
    font-weight: 300;
}

.chapter-deck strong {
    color: var(--paper-dim);
    font-weight: 600;
}


.chart-card {
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--ink-raised) 92%, transparent),
            color-mix(in srgb, var(--ink-deep) 88%, transparent));
    border: 1px solid var(--hairline);
    border-radius: 4px;
    padding: 24px 14px 12px;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    transition:
        border-color 0.3s var(--ease-fluid),
        transform 0.4s var(--ease-fluid),
        box-shadow 0.4s var(--ease-fluid);
}

.chart-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--hairline-strong),
        transparent);
}

.chart-card:hover {
    border-color: var(--hairline-bright);
    transform: translateY(-2px);
    box-shadow: 0 14px 36px -20px rgba(0,0,0,0.55);
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-grid .chart-card { margin-bottom: 0; }


.data-table-wrap {
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--ink-raised) 92%, transparent),
            color-mix(in srgb, var(--ink-deep) 88%, transparent));
    border: 1px solid var(--hairline);
    border-radius: 4px;
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    transition: border-color 0.3s var(--ease-fluid);
    -webkit-overflow-scrolling: touch;
}

.data-table-wrap::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--hairline-strong),
        transparent);
    z-index: 2;
}

.data-table-wrap:hover { border-color: var(--hairline-bright); }

.data-table-wrap::-webkit-scrollbar { height: 8px; }
.data-table-wrap::-webkit-scrollbar-track { background: transparent; }
.data-table-wrap::-webkit-scrollbar-thumb {
    background: var(--hairline-bright);
    border-radius: 4px;
}
.data-table-wrap::-webkit-scrollbar-thumb:hover { background: var(--hairline-strong); }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--paper);
}

.data-table thead th {
    position: sticky;
    top: 0;
    background: var(--ink-elevated);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--paper-bright);
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid var(--hairline-bright);
    white-space: nowrap;
    z-index: 1;
}

.data-table thead th.num { text-align: right; }
.data-table thead th.th-uf { text-align: center; }

.data-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--hairline);
    vertical-align: middle;
    line-height: 1.4;
    transition:
        padding-left 0.22s var(--ease-fluid),
        color 0.22s var(--ease-fluid),
        background 0.22s var(--ease-fluid);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:nth-child(even) td {
    background: rgba(20, 23, 29, 0.4);
}

.data-table tbody tr:hover td {
    background: color-mix(in srgb, var(--gold) 8%, transparent);
}

.data-table tbody tr:hover td:first-child {
    padding-left: 20px;
}

.data-table tbody tr:hover td.total {
    color: var(--gold-bright);
}

.data-table td.empresa {
    font-weight: 500;
    color: var(--paper-bright);
    max-width: 320px;
    min-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table td.uf {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--gold);
}

.data-table td.num {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--paper);
    white-space: nowrap;
    font-size: 12.5px;
}

.data-table td.num.total {
    color: var(--paper-bright);
    font-weight: 600;
}

.data-table td.cell-tag { text-align: center; }

.data-table .tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    line-height: 1.4;
}

.data-table .tag-yes {
    background: color-mix(in srgb, var(--steel) 18%, transparent);
    color: var(--steel-bright);
    border: 1px solid color-mix(in srgb, var(--steel) 32%, transparent);
}

.data-table .nz-year {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--azure);
}

.data-table .muted {
    color: var(--paper-whisper);
    font-family: var(--font-mono);
}



.table-view-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border: 1px solid var(--hairline-bright);
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
}

.view-btn {
    background: var(--ink-raised);
    color: var(--paper-dim);
    border: none;
    padding: 0.55rem 1.4rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition:
        background 0.25s var(--ease-fluid),
        color 0.25s var(--ease-fluid);
}

.view-btn:hover {
    background: var(--ink-elevated);
    color: var(--paper-bright);
}

.view-btn.active {
    background: var(--gold);
    color: var(--ink-deep);
    font-weight: 600;
}

.view-btn + .view-btn {
    border-left: 1px solid var(--hairline-bright);
}

.table-view[hidden] {
    display: none;
}


.table-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.table-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 400px;
    min-width: 200px;
    background: var(--ink-raised);
    border: 1px solid var(--hairline-bright);
    border-radius: 8px;
    padding: 0 14px;
    transition:
        border-color 0.25s var(--ease-fluid),
        box-shadow 0.25s var(--ease-fluid);
}

.table-search:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.table-search-icon {
    flex-shrink: 0;
    color: var(--paper-faint);
    transition: color 0.25s var(--ease-fluid);
}

.table-search:focus-within .table-search-icon {
    color: var(--gold);
}

.table-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    color: var(--paper-bright);
    padding: 10px 10px;
    letter-spacing: 0.01em;
}

.table-search-input::placeholder {
    color: var(--paper-whisper);
    font-weight: 400;
}

.table-search-clear {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--paper-faint);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color 0.2s var(--ease-fluid),
        background 0.2s var(--ease-fluid);
}

.table-search-clear:hover {
    color: var(--paper-bright);
    background: var(--hairline);
}

.table-search-no-results {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--paper-faint);
    text-align: center;
    padding: 2.5rem 1rem;
}


.filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--ink-raised);
    border: 1px solid var(--hairline-bright);
    border-radius: 8px;
    padding: 9px 16px;
    color: var(--paper-dim);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    white-space: nowrap;
    transition:
        color 0.25s var(--ease-fluid),
        border-color 0.25s var(--ease-fluid),
        background 0.25s var(--ease-fluid);
}

.filter-toggle:hover {
    color: var(--paper-bright);
    border-color: var(--gold);
    background: color-mix(in srgb, var(--gold) 6%, transparent);
}

.filter-toggle[aria-expanded="true"] {
    color: var(--gold);
    border-color: var(--gold);
    background: color-mix(in srgb, var(--gold) 10%, transparent);
}

.filter-badge {
    background: var(--gold);
    color: var(--ink-void);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}


.filter-panel {
    background: var(--ink-raised);
    border: 1px solid var(--hairline-bright);
    border-radius: 10px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    animation: filterSlideDown 0.3s var(--ease-fluid);
}

@keyframes filterSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.filter-panel-inner {
    padding: 1.25rem 1.5rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem 2rem;
}

.filter-section {
    min-width: 0;
}

.filter-heading {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.65rem;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-select {
    flex: 1;
    background: var(--ink-deep);
    border: 1px solid var(--hairline);
    border-radius: 6px;
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 13px;
    padding: 7px 10px;
    cursor: pointer;
    transition: border-color 0.2s var(--ease-fluid);
    appearance: auto;
}

.filter-select:focus {
    outline: none;
    border-color: var(--gold);
}


.sort-dir-group {
    display: flex;
    gap: 2px;
    background: var(--ink-deep);
    border-radius: 6px;
    padding: 2px;
}

.sort-dir-btn {
    background: transparent;
    border: none;
    color: var(--paper-faint);
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color 0.2s var(--ease-fluid),
        background 0.2s var(--ease-fluid);
}

.sort-dir-btn:hover {
    color: var(--paper-bright);
}

.sort-dir-btn.active {
    background: var(--ink-elevated);
    color: var(--gold);
}


.filter-uf-actions {
    margin-bottom: 0.5rem;
}

.filter-link {
    background: none;
    border: none;
    color: var(--azure);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s var(--ease-fluid);
}

.filter-link:hover {
    color: var(--ice);
}

.filter-uf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 4px 8px;
    max-height: 140px;
    overflow-y: auto;
    padding-right: 4px;
}

.filter-uf-grid::-webkit-scrollbar { width: 5px; }
.filter-uf-grid::-webkit-scrollbar-track { background: transparent; }
.filter-uf-grid::-webkit-scrollbar-thumb {
    background: var(--hairline-strong);
    border-radius: 3px;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--paper-dim);
    cursor: pointer;
    user-select: none;
    transition: color 0.15s var(--ease-fluid);
}

.filter-check:hover {
    color: var(--paper-bright);
}

.filter-check input[type="checkbox"] {
    accent-color: var(--gold);
    width: 14px;
    height: 14px;
    cursor: pointer;
}


.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--hairline);
}

.filter-apply {
    background: var(--gold);
    color: var(--ink-void);
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 20px;
    cursor: pointer;
    transition:
        background 0.2s var(--ease-fluid),
        transform 0.15s var(--ease-fluid);
}

.filter-apply:hover {
    background: var(--gold-bright);
}

.filter-apply:active {
    transform: scale(0.97);
}

.filter-reset {
    background: none;
    border: 1px solid var(--hairline-bright);
    border-radius: 6px;
    color: var(--paper-dim);
    font-family: var(--font-body);
    font-size: 13px;
    padding: 8px 16px;
    cursor: pointer;
    transition:
        color 0.2s var(--ease-fluid),
        border-color 0.2s var(--ease-fluid);
}

.filter-reset:hover {
    color: var(--paper-bright);
    border-color: var(--paper-faint);
}

.data-carousel {
    position: relative;
    margin-top: 1rem;
}

.carousel-viewport {
    position: relative;
    overflow: hidden;
    transition: height 0.35s var(--ease-fluid);
}

.carousel-track {
    position: relative;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(40px);
    transition:
        opacity 0.42s var(--ease-fluid),
        transform 0.42s var(--ease-fluid);
}

.carousel-slide[data-active="true"] {
    position: relative;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.carousel-slide.exiting {
    position: absolute;
    opacity: 0;
    transform: translateX(-40px);
}

.carousel-slide.entering-from-left {
    transform: translateX(-40px);
}

.carousel-slide.exiting-to-right {
    transform: translateX(40px);
}

@media (prefers-reduced-motion: reduce) {
    .carousel-slide,
    .carousel-viewport {
        transition-duration: 0.01ms !important;
    }
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.carousel-btn {
    background: transparent;
    border: 1px solid var(--hairline-bright);
    color: var(--paper-dim);
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition:
        color 0.25s var(--ease-fluid),
        border-color 0.25s var(--ease-fluid),
        background 0.25s var(--ease-fluid),
        transform 0.15s var(--ease-fluid);
}

.carousel-btn:hover:not(:disabled) {
    color: var(--paper-bright);
    border-color: var(--gold);
    background: color-mix(in srgb, var(--gold) 10%, transparent);
}

.carousel-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.carousel-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.carousel-btn .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: color-mix(in srgb, var(--gold) 35%, transparent);
    pointer-events: none;
    animation: carousel-ripple 0.45s var(--ease-fluid);
}

@keyframes carousel-ripple {
    to { transform: scale(3); opacity: 0; }
}

.carousel-pages {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    font-family: var(--font-mono);
}

.carousel-page {
    background: transparent;
    border: none;
    color: var(--paper-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    padding: 6px 10px;
    min-width: 30px;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition:
        color 0.2s var(--ease-fluid),
        border-color 0.2s var(--ease-fluid);
}

.carousel-page:hover {
    color: var(--paper-bright);
}

.carousel-page[aria-current="page"] {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.carousel-ellipsis {
    color: var(--paper-whisper);
    padding: 0 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    user-select: none;
}

.carousel-meta {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper-faint);
    text-align: center;
}

.carousel-meta strong {
    color: var(--paper-bright);
    font-weight: 600;
}

@media (max-width: 920px) {
    .data-table thead th,
    .data-table tbody td {
        padding: 10px 10px;
        font-size: 12px;
    }
    .data-table td.empresa { max-width: 220px; }
}


.js-plotly-plot,
.js-plotly-plot .plotly,
.js-plotly-plot .plot-container {
    background: transparent !important;
}

.js-plotly-plot .plotly .modebar {
    background: transparent !important;
    top: 4px !important;
    right: 4px !important;
}

.js-plotly-plot .plotly .modebar-btn svg path { fill: var(--paper-faint) !important; }
.js-plotly-plot .plotly .modebar-btn:hover svg path { fill: var(--gold) !important; }
.js-plotly-plot .plotly .modebar-btn--active svg path { fill: var(--gold) !important; }

.js-plotly-plot .table-header-text { fill: var(--paper-bright) !important; }
.js-plotly-plot .table-cell-text   { fill: var(--paper) !important; }

#tabela .chart-card {
    background: var(--ink-raised);
    overflow-x: auto;
}

#tabela .chart-card .plotly-graph-div {
    min-width: 1100px;
}


@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.masthead, .rail, .hero, .kpi-row, .note, .chapter {
    animation: fadeUp 0.9s var(--ease-fluid) backwards;
}

.masthead   { animation-delay: 0.05s; }
.rail       { animation-delay: 0.18s; }
.hero       { animation-delay: 0.30s; }
.kpi-row    { animation-delay: 0.42s; }
.note       { animation-delay: 0.54s; }
.chapter    { animation-delay: 0.66s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01s !important;
        animation-delay: 0s !important;
        transition-duration: 0.01s !important;
    }
}


@media (max-width: 920px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .chapter-head {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chapter-num { font-size: 52px; }

    .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .kpi-tile {
        padding: 1.25rem 0;
        border-right: none;
        border-bottom: 1px solid var(--hairline);
    }
    .kpi-tile:last-child { border-bottom: none; }
    .kpi-row { padding: 1.25rem 0; }

    .hero-value { font-size: clamp(3.5rem, 18vw, 5rem); }

    .masthead-title { font-size: clamp(2.75rem, 14vw, 4.5rem); }

    .masthead-content { flex-direction: column; align-items: flex-start; }
    .masthead-team { min-width: 0; width: 100%; padding: 1rem 1.25rem; }
    .masthead-logos { flex-direction: row; padding-left: 0; padding-top: 1.5rem; gap: 2rem; }
    .masthead-logo--bb { width: 70px; }
    .masthead-logo--cesar { width: 80px; }

    .rail { gap: 1.25rem; }
    .rail a { font-size: 10.5px; }
}

/* ════════════════════════════════════════════════════════════════════
   Modo Claro — sobrescreve variáveis de cor
   ════════════════════════════════════════════════════════════════════ */

[data-theme="light"] {
    --ink-void:       #ffffff;
    --ink-deep:       #f5f6fa;
    --ink-raised:     #ebedf5;
    --ink-elevated:   #dde0ee;
    --ink-highest:    #cdd2e6;

    --paper:          #1a2340;
    --paper-bright:   #0c1526;
    --paper-dim:      #4a5270;
    --paper-faint:    #6a7290;
    --paper-whisper:  #8a90a8;

    --hairline:           rgba(26, 35, 64, 0.07);
    --hairline-bright:    rgba(26, 35, 64, 0.18);
    --hairline-strong:    rgba(26, 35, 64, 0.32);

    --gold-glow:      rgba(226, 184, 77, 0.10);
    --azure-glow:     rgba(93, 143, 201, 0.10);
    --steel-glow:     rgba(58, 110, 165, 0.10);

    --shadow-button:  rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse 900px 600px at 15% -10%, var(--gold-glow), transparent 58%),
        radial-gradient(ellipse 700px 500px at 95% 35%, var(--steel-glow), transparent 55%),
        radial-gradient(ellipse 500px 700px at 55% 110%, var(--azure-glow), transparent 60%);
}

[data-theme="light"] body::after {
    opacity: 0.02;
}

/* ════════════════════════════════════════════════════════════════════
   Botão de alternância de tema
   ════════════════════════════════════════════════════════════════════ */

.theme-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: var(--ink-elevated);
    border: 1px solid var(--hairline-strong);
    border-radius: 4px;
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition:
        background 0.2s var(--ease-fluid),
        border-color 0.2s var(--ease-fluid),
        color 0.2s var(--ease-fluid),
        box-shadow 0.2s var(--ease-fluid),
        transform 0.1s var(--ease-fluid);
}

.theme-toggle:hover {
    background: var(--ink-highest);
    border-color: var(--hairline-bright);
    box-shadow: 0 4px 16px var(--shadow-button);
}

.theme-toggle:active {
    transform: translateY(1px);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.theme-toggle-icon {
    font-size: 15px;
    line-height: 1;
}

@media print {
    .carousel-viewport {
        height: auto !important;
        overflow: visible !important;
    }
    .carousel-slide {
        position: static !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 1.5rem;
    }
    .carousel-controls,
    .carousel-meta {
        display: none !important;
    }
}
