/*
 * Fundação visual do tema Noite — exclusivamente Relatórios.
 * Escuridão de alto contraste: superfícies quase pretas e luz funcional.
 */

html[data-theme="dark"] #page-relatorios {
    color-scheme: dark;
    --rel-night-void: #020509;
    --rel-night-bg: #050910;
    --rel-night-surface: #0a111b;
    --rel-night-raised: #101b29;
    --rel-night-hover: #172638;
    --rel-night-field: #070d15;
    --rel-night-line: rgba(180, 211, 238, .18);
    --rel-night-line-strong: rgba(198, 225, 248, .34);
    --rel-night-text: #f4f9ff;
    --rel-night-text-soft: #c5d3e1;
    --rel-night-muted: #8fa2b5;
    --rel-night-blue: #55b7ff;
    --rel-night-blue-strong: #8bd0ff;
    --rel-night-blue-rgb: 85, 183, 255;
    --rel-night-shadow: 0 1.125rem 3rem -1.75rem rgba(0, 0, 0, .96);
    --rel-night-focus: 0 0 0 0.1875rem rgba(var(--rel-night-blue-rgb), .38);
    --rel-night-motion: 180ms cubic-bezier(.2, .8, .2, 1);

    --rel-ink-strong: var(--rel-night-text);
    --rel-ink-deep: var(--rel-night-text);
    --rel-ink-2: var(--rel-night-text-soft);
    --muted: var(--rel-night-muted);
    --rel-accent: var(--rel-night-blue);
    --rel-accent-chart: var(--rel-night-blue);
    --rel-accent-strong: var(--rel-night-blue-strong);
    --rel-accent-deep: #1679c1;
    --rel-accent-ink: var(--rel-night-blue-strong);
    --rel-accent-rgb: var(--rel-night-blue-rgb);
    --rel-accent-chart-rgb: var(--rel-night-blue-rgb);
    --rel-accent-glow: rgba(var(--rel-night-blue-rgb), .22);
    --rel-wash-info: rgba(var(--rel-night-blue-rgb), .14);
    --rel-wash-info-soft: rgba(var(--rel-night-blue-rgb), .08);
    --rel-thead-1: #060a14;
    --rel-thead-2: #0a1428;
    --rel-thead-3: #122640;
    --rel-thead-4: #1a3558;
    --rel-scroll-thumb: rgba(154, 193, 224, .34);
    --rel-scroll-thumb-hover: rgba(188, 220, 246, .58);
    /* Cabeçalho Noite: azul profundo (lilás mínimo). */
    --rel-night-thead-band: linear-gradient(105deg, #0a1428, #122640 52%, #1a3558);
    --tk-thead-grad: var(--rel-night-thead-band);
    --rel-night-thead-highlight: inset 0 0.0625rem rgba(180, 210, 255, 0.1), inset 0 -0.0625rem rgba(0, 0, 0, 0.72);
    --rel-night-thead-edge: rgba(140, 180, 220, 0.16);

    /* Cards: superfície / blur / sombra / highlight / ativo (ajuste fino). */
    --rel-night-card-bg: rgba(7, 14, 28, 0.82);
    --rel-night-card-bg-hover: rgba(10, 20, 36, 0.88);
    --rel-night-card-bg-on: rgba(14, 33, 54, 0.9);
    --rel-night-card-blur: 0.375rem;
    --rel-night-card-shadow: 0 0.25rem 0.875rem rgba(0, 0, 0, 0.22), 0 0.75rem 1.75rem -1.125rem rgba(0, 0, 0, 0.45);
    --rel-night-card-highlight: inset 0 0.0625rem 0 rgba(180, 210, 255, 0.045);
    --rel-night-card-edge: rgba(120, 160, 210, 0.05);
    --rel-night-card-glow-on: 0 0 0.875rem rgba(45, 150, 230, 0.08);

    background: var(--rel-night-bg) !important;
    color: var(--rel-night-text);
}

html[data-theme="dark"] #page-relatorios.page.active {
    background:
        radial-gradient(circle at 78% -12%, rgba(39, 120, 178, .10), transparent 31rem),
        linear-gradient(180deg, var(--rel-night-void), var(--rel-night-bg) 18rem) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd {
    /* Tokens semânticos explícitos — evita herdar --ink/--field claros do :root. */
    --ink: var(--rel-night-text);
    --muted: var(--rel-night-muted);
    --line: var(--rel-night-line);
    --field: var(--rel-night-raised);
    --bg-app: var(--rel-night-bg);
    --surface: var(--rel-night-surface);
    --surface-2: var(--rel-night-raised);
    --surface-3: var(--rel-night-hover);
    --blue: var(--rel-night-blue);
    --blue-600: var(--rel-night-blue-strong);
    --blue-text: var(--rel-night-blue-strong);
    --f-blue: var(--rel-night-blue);
    --f-blue-bg: rgba(var(--rel-night-blue-rgb), .12);
    --s-blue: var(--rel-night-blue);
    --s-blue-bg: rgba(var(--rel-night-blue-rgb), .12);
    --a-blue: var(--rel-night-blue);
    --a-blue-bg: rgba(var(--rel-night-blue-rgb), .12);
    --p-blue: var(--rel-night-blue);
    --p-blue-bg: rgba(var(--rel-night-blue-rgb), .12);
    --j-blue: var(--rel-night-blue);
    --j-blue-bg: rgba(var(--rel-night-blue-rgb), .12);
    --rel-chart-status: #55b7ff,#ffc857,#ff6670,#43d995;
    /* Última barra um pouco mais clara para não sumir no fundo. */
    --rel-chart-rank: #e4f5ff,#9edaff,#55b7ff,#3a9ee0,#1f7ec4;
    --rel-chart-avatar: #55b7ff,#b894ff,#47d7e8,#ff9d5c,#58d68d,#aab8c6,#e979e9,#7894b0;
    --rel-chart-dept: #55b7ff,#47d7e8,#ff6670,#b894ff,#ff9d5c,#58d68d,#aab8c6,#7894b0;
    --rel-chart-report: #e4f5ff,#55b7ff,#268fd8,#47d7e8,#58d68d,#aab8c6,#b894ff;
    --rel-chart-stream: #55b7ff,#47d7e8,#ff9d5c,#b894ff,#58d68d,#ff6670,#aab8c6;
    --rel-chart-prio: #ff6670,#ff9d5c,#55b7ff,#aab8c6,#71869a;
    color: var(--rel-night-text);
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .chart-card, .tickets-card, .config-panel, .fpanel, .dpanel, .spanel,
    .apanel, .kcol, .tk-tablewrap, .clientes-panel-rank,
    .clientes-panel-chart, .rel-filter-card, .rel-indic-panel
) {
    background-color: var(--rel-night-surface) !important;
    border-color: var(--rel-night-line) !important;
    box-shadow: var(--rel-night-shadow);
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    input, select, textarea, .fdsel-trigger, .flt-trig, .rp-search-input,
    .rel-search-input, .filter-input
) {
    background: var(--rel-night-field) !important;
    border-color: var(--rel-night-line-strong) !important;
    color: var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(input, select, textarea)::placeholder {
    color: var(--rel-night-muted) !important;
    opacity: 1;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    input, select, textarea, button, .fdsel-trigger, .flt-trig
):focus-visible {
    outline: none !important;
    box-shadow: var(--rel-night-focus) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .chart-head, .fp-head, .dp-head, .sp-head, .ap-head,
    .chart-foot, .tk-foot
) {
    background: var(--rel-night-raised) !important;
    border-color: var(--rel-night-line) !important;
    color: var(--rel-night-text) !important;
}

/* Lista de chamados / Clientes / Visão: título e totais no mesmo fundo do card. */
html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card > .tk-head,
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes .clientes-head.tk-head,
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.visao > .chart-head {
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    color: var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.visao > .chart-head .ch-tot,
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.visao > .chart-head .ch-act {
    background: transparent !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    h1, h2, h3, h4, .title, .card-value, .kpi-value, .tk-title,
    .chart-title, th, strong
) {
    color: var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .muted, .sub, .hint, .label, .meta, .tk-sub, .chart-sub, small
) {
    color: var(--rel-night-text-soft) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.subtab, .prj-tab, .ra-item, .tk-mini) {
    color: var(--rel-night-text-soft) !important;
    border-color: var(--rel-night-line) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.subtab, .prj-tab, .ra-item, .tk-mini):hover {
    background: var(--rel-night-hover) !important;
    color: var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.subtab.on, .subtab.active, .prj-tab.on, .prj-tab.active, .ra-item.active) {
    background: rgba(var(--rel-night-blue-rgb), .18) !important;
    border-color: rgba(var(--rel-night-blue-rgb), .55) !important;
    color: var(--rel-night-blue-strong) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.btn.primary, .button-primary) {
    background: var(--rel-night-blue) !important;
    border-color: var(--rel-night-blue) !important;
    color: #02070c !important;
    box-shadow: 0 0 0 0.0625rem rgba(255,255,255,.08), 0 0.5rem 1.5rem -0.75rem rgba(var(--rel-night-blue-rgb), .85);
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.btn.primary, .button-primary):hover:not(:disabled) {
    background: var(--rel-night-blue-strong) !important;
    border-color: var(--rel-night-blue-strong) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(table, .tk-table) {
    color: var(--rel-night-text-soft);
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(thead, .tk-thead) {
    background: var(--tk-thead-grad) !important;
    color: var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd tbody tr {
    background: var(--rel-night-surface);
    border-color: var(--rel-night-line) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd tbody tr:hover {
    background: var(--rel-night-hover) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(td, th) {
    border-color: var(--rel-night-line) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .modal, .modal-card, .drawer, .fdsel-menu, .flt-menu, .popover,
    .dropdown-menu, .calendar-popover
) {
    background: #080f18 !important;
    border-color: var(--rel-night-line-strong) !important;
    color: var(--rel-night-text) !important;
    box-shadow: 0 1.75rem 5rem -1.75rem #000;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .modal-backdrop {
    background: rgba(0, 2, 5, .84) !important;
    backdrop-filter: blur(0.25rem);
}

html[data-theme="dark"] #page-relatorios .relatorios-fd ::-webkit-scrollbar-thumb {
    background: var(--rel-scroll-thumb);
}

html[data-theme="dark"] #page-relatorios .relatorios-fd ::-webkit-scrollbar-thumb:hover {
    background: var(--rel-scroll-thumb-hover);
}

html[data-theme="dark"] .main-content:has(#page-relatorios.active) .app-topbar {
    background: rgba(2, 5, 9, .96) !important;
    border-bottom-color: rgba(180, 211, 238, .16) !important;
    box-shadow: 0 0.75rem 2.25rem -1.75rem #000 !important;
}

html[data-theme="dark"] .main-content:has(#page-relatorios.active) .app-topbar :is(
    .topbar-page-title, .topbar-page-subtitle
) {
    color: #f4f9ff !important;
}

html[data-theme="dark"] .main-content:has(#page-relatorios.active) .app-topbar :is(
    .topbar-hamburger, .topbar-chats-quick-btn, .topbar-perfil-btn,
    .notificacoes-btn, .topbar-theme-switch
) {
    background: #0a111b !important;
    border-color: rgba(180, 211, 238, .22) !important;
    color: #d9e8f5 !important;
}

/* Etapas 2–5: chrome, filtros, Central e sistema compartilhado. */
html[data-theme="dark"] body:has(#page-relatorios.active) :is(.app-sidebar, .sidebar) {
    background: #03070c !important;
    border-color: var(--rel-night-line) !important;
}

html[data-theme="dark"] body:has(#page-relatorios.active) :is(.app-sidebar, .sidebar) .nav-item { color: var(--rel-night-text-soft) !important; }
html[data-theme="dark"] body:has(#page-relatorios.active) :is(.app-sidebar, .sidebar) .nav-item:hover { background: rgba(255,255,255,.055) !important; color: var(--rel-night-text) !important; }
html[data-theme="dark"] body:has(#page-relatorios.active) :is(.app-sidebar, .sidebar) .nav-item.active { background: rgba(var(--rel-night-blue-rgb),.16) !important; color: var(--rel-night-blue-strong) !important; box-shadow: inset 0.1875rem 0 var(--rel-night-blue); }

html[data-theme="dark"] #page-relatorios .relatorios-fd .config-panel:not(.rel-indic-panel) { background: linear-gradient(180deg,var(--rel-night-raised),var(--rel-night-surface)) !important; }

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-card,
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-indic-panel.config-panel {
    background:
      radial-gradient(ellipse 50% 38% at 68% 18%, rgba(8, 14, 36, 0.45), transparent 60%),
      linear-gradient(160deg, #01030a 0%, #020510 40%, #030817 72%, #050a19 100%) !important;
    /* Mesma leitura da borda superior da Visão Executiva (azul-gelo discreto + highlight). */
    border: 0.0625rem solid var(--rel-night-line) !important;
    box-shadow: var(--rel-night-card-highlight) !important;
}

/* Poeira Noite: grãos compartilhados; nebulosa procedural (canvas) em login-cosmic-dust.css. */
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.rel-filter-card,.rel-indic-panel.config-panel) .tf-cosmic-dust {
    opacity: 1;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.rel-filter-card,.rel-indic-panel.config-panel) .tf-cosmic-dust .cosmic-dust-grain {
    mix-blend-mode: screen;
}

/* Nebulosa atravessa levemente a barra de filtros (atrás dos botões, intensidade menor). */
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-card .tk-filterbar,
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-card .filterbar.fb-line {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Contornos discretos: filtros e busca fundem no void (sem halo lilás/azul). */
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-card .tk-filterbar-search input,
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-card .flt-trig,
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-card .filterbar.fb-line :is(.fdsel-trigger,.morefilters,.dr-btn) {
    background: rgba(4, 8, 16, 0.42) !important;
    border-color: rgba(120, 150, 180, 0.1) !important;
    box-shadow: none;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-card .tk-filterbar-search input:hover,
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-card .flt-trig:hover,
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-card .filterbar.fb-line :is(.fdsel-trigger,.morefilters,.dr-btn):hover {
    background: rgba(12, 22, 36, 0.55) !important;
    border-color: rgba(140, 170, 200, 0.16) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-card .flt.open .flt-trig,
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-card .flt.active .flt-trig {
    background: rgba(16, 32, 52, 0.58) !important;
    border-color: rgba(140, 170, 200, 0.14) !important;
}

/* Filtros ativos: sem card lilás — faixa escura discreta (sombra no bloco de elevação abaixo). */
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-summary {
    background: rgba(8, 12, 22, 0.72) !important;
    border: 0.0625rem solid rgba(100, 130, 160, 0.08) !important;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-summary .chips .lead {
    color: var(--rel-night-text-soft) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .filterbar.fb-line { background:rgba(5,9,16,.76) !important; border-color:var(--rel-night-line) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .filterbar.fb-line :is(.fdsel-trigger,.morefilters),
html[data-theme="dark"] #page-relatorios .relatorios-fd .dr-btn {
    background:var(--rel-night-field) !important; border-color:var(--rel-night-line-strong) !important; color:var(--rel-night-text-soft) !important;
    transition:background var(--rel-night-motion),border-color var(--rel-night-motion),color var(--rel-night-motion),box-shadow var(--rel-night-motion);
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .filterbar.fb-line :is(.fdsel-trigger,.morefilters):hover,
html[data-theme="dark"] #page-relatorios .relatorios-fd .dr-btn:hover { background:var(--rel-night-hover) !important; border-color:rgba(var(--rel-night-blue-rgb),.42) !important; color:var(--rel-night-text) !important; }

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.dr-pop,.cal-pop,.more-pop,.fdsel-menu,.fdsel-pop,.flt-menu) {
    background:linear-gradient(180deg,#0d1622,#080f18) !important;
    border:0.0625rem solid var(--rel-night-line-strong) !important;
    border-radius:0.25rem !important;
    box-shadow:0 1.375rem 3.5rem -1.5rem #000, inset 0 0.0625rem rgba(198,225,248,.08) !important;
    color:var(--rel-night-text) !important;
}

/* Menu suspenso Noite — reforça viewport N×linha (já canônico no shell Dia). */
html[data-theme="dark"] #page-relatorios .relatorios-fd .flt-menu:not(.cal-menu):not(.flt-cat-menu):not(.flt-cat-tree-menu) {
    --flt-menu-pad: 0;
    --flt-menu-rows: 7;
    max-height:calc(var(--flt-menu-rows) * var(--flt-menu-row-h, 2.25rem)) !important;
    padding:0 !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .flt-opt {
    color:#e8f1fa !important;
    font-size:0.8125rem !important;
    font-weight:600 !important;
    letter-spacing:-0.009375rem;
    text-shadow:0 0.0625rem 0 rgba(0,0,0,.35);
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .flt-opt:hover {
    background:var(--rel-night-hover) !important;
    color:var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .flt-opt.sel {
    background:rgba(var(--rel-night-blue-rgb),.16) !important;
    color:var(--rel-night-blue-strong) !important;
    font-weight:700 !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .flt-opt.all {
    color:#f4f9ff !important;
    font-weight:700 !important;
    letter-spacing:.02em;
    border-bottom-color:rgba(198,225,248,.22) !important;
    background:rgba(255,255,255,.03) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .flt-opt::before {
    border-color:rgba(198,225,248,.42) !important;
    background:rgba(7,13,21,.88) !important;
    border-radius:0.1875rem;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .flt-opt.sel::before {
    background:var(--rel-night-blue) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2302070c' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center no-repeat !important;
    border-color:var(--rel-night-blue) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .flt-cat-tree-menu > .flt-opt.all {
    background:var(--rel-night-surface) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .flt-cat-exp {
    color:var(--rel-night-blue-strong);
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .flt-cat-tick {
    border-color:var(--rel-night-blue-strong);
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .fdsel-list {
    --fdsel-pad: 0;
    max-height:calc(var(--fdsel-rows, 7) * var(--fdsel-row-h, 2.25rem)) !important;
    padding:0 !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .fdsel-opt {
    color:#e8f1fa !important;
    font-weight:600 !important;
    letter-spacing:-0.009375rem;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .fdsel-opt:hover,
html[data-theme="dark"] #page-relatorios .relatorios-fd .fdsel-opt.active {
    background:var(--rel-night-hover) !important;
    color:var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .fdsel-opt.selected {
    background:rgba(var(--rel-night-blue-rgb),.16) !important;
    color:var(--rel-night-blue-strong) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.fdsel-opt,.flt-opt,.more-opt,.cal-day):hover { background:var(--rel-night-hover) !important; color:var(--rel-night-text) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.fdsel-opt.selected,.fdsel-opt[aria-selected="true"],.flt-opt.active,.cal-day.selected) { background:rgba(var(--rel-night-blue-rgb),.18) !important; color:var(--rel-night-blue-strong) !important; }

html[data-theme="dark"] #page-relatorios .relatorios-fd .indic {
    background: rgba(7, 14, 28, 0.78) !important;
    border-color: var(--rel-night-card-edge, rgba(120, 160, 210, 0.05)) !important;
    color: var(--rel-night-text-soft) !important;
    box-shadow: inset 0 0.0625rem 0 rgba(180, 210, 255, 0.035), 0 0.1875rem 0.625rem rgba(0, 0, 0, 0.18) !important;
    -webkit-backdrop-filter: blur(0.25rem);
    backdrop-filter: blur(0.25rem);
    transition: background var(--rel-night-motion), border-color var(--rel-night-motion), color var(--rel-night-motion), transform var(--rel-night-motion), box-shadow var(--rel-night-motion);
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .indic:not(.on):not([data-soon]):hover {
    background: rgba(10, 20, 36, 0.86) !important;
    border-color: rgba(140, 170, 200, 0.1) !important;
    color: var(--rel-night-text) !important;
    box-shadow: inset 0 0.0625rem 0 rgba(180, 210, 255, 0.055), 0 0.25rem 0.75rem rgba(0, 0, 0, 0.22) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .indic.on {
    background: var(--rel-night-card-bg-on, rgba(14, 33, 54, 0.9)) !important;
    border-color: rgba(var(--rel-night-blue-rgb), 0.22) !important;
    color: var(--rel-night-blue-strong) !important;
    box-shadow:
        inset 0 0.0625rem 0 rgba(180, 210, 255, 0.07),
        0 0.25rem 0.875rem rgba(0, 0, 0, 0.2),
        var(--rel-night-card-glow-on, 0 0 0.875rem rgba(45, 150, 230, 0.08)) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .indic[data-soon] {
    background: rgba(7, 13, 21, 0.72) !important;
    border-color: rgba(100, 130, 160, 0.04) !important;
    color: var(--rel-night-muted) !important;
    opacity: 0.66;
    box-shadow: inset 0 0.0625rem 0 rgba(180, 210, 255, 0.02), 0 0.125rem 0.5rem rgba(0, 0, 0, 0.16) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.btn,.cc-ibtn,.list-pagination-btn,.drawer .dw-foot button,.anl-drawer .adw-foot button) { border-color:var(--rel-night-line) !important; transition:background var(--rel-night-motion),border-color var(--rel-night-motion),color var(--rel-night-motion),transform var(--rel-night-motion),box-shadow var(--rel-night-motion); }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.btn:not(.primary):not(.dark):not(.warn),.cc-ibtn,.list-pagination-btn,.drawer .dw-foot button:not(.primary),.anl-drawer .adw-foot button:not(.primary)) { background:var(--rel-night-raised) !important; color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.btn,.cc-ibtn,.list-pagination-btn,.drawer .dw-foot button,.anl-drawer .adw-foot button):hover:not(:disabled) { background:var(--rel-night-hover) !important; border-color:var(--rel-night-line-strong) !important; color:var(--rel-night-text) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.btn.primary,.btn.dark,.drawer .dw-foot button.primary,.anl-drawer .adw-foot button.primary) { background:var(--rel-night-blue) !important; border-color:var(--rel-night-blue) !important; color:#02070c !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.btn.primary,.btn.dark,.drawer .dw-foot button.primary,.anl-drawer .adw-foot button.primary):hover:not(:disabled) { background:var(--rel-night-blue-strong) !important; border-color:var(--rel-night-blue-strong) !important; color:#02070c !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd button:disabled { opacity:.48; box-shadow:none !important; cursor:not-allowed; }

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.chip,.rel-filter-summary .chip) {
    background: rgba(12, 18, 28, 0.55) !important;
    border-color: rgba(100, 130, 160, 0.12) !important;
    color: var(--rel-night-text-soft) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.chip .x,.rel-filter-summary .chip .x) { color:var(--rel-night-muted) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.chip .x,.rel-filter-summary .chip .x):hover { background:rgba(255,102,112,.16) !important; color:#ffadb2 !important; }

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.empty-state,.tk-empty,.clientes-empty-cell,.loading-state) { background:rgba(16,27,41,.64) !important; border-color:var(--rel-night-line) !important; color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.skeleton,[class*="skeleton"]) { background:linear-gradient(90deg,#0c1520 24%,#1c3046 38%,#0c1520 62%) !important; background-size:220% 100% !important; }

@media (prefers-reduced-motion: reduce) {
    html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.indic,.subtab,.prj-tab,.fdsel-trigger,.morefilters,.dr-btn,.btn,.cc-ibtn) { transition:none !important; }
    /* Poeira: login-cosmic-dust.css. Skeletons param. */
    html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.skeleton,[class*="skeleton"]) { animation:none !important; }
}

/* Etapa 6: tabelas e paginação. */
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.tk-tablewrap,.anl-table-wrap,.dep-table,.clientes-rank-scroll) {
    background:var(--rel-night-surface) !important; border-color:var(--rel-night-line) !important; box-shadow:var(--rel-night-shadow);
}
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.tk-table,.atbl,.clientes-rank-table) thead th { background:transparent !important; color:var(--rel-night-text) !important; text-shadow:0 0.0625rem #000; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.tk-table,.atbl,.clientes-rank-table) tbody tr { background:#0a111b !important; transition:background var(--rel-night-motion),box-shadow var(--rel-night-motion); }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.tk-table,.atbl,.clientes-rank-table) tbody tr:nth-child(even) { background:#0d1622 !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.tk-table,.atbl,.clientes-rank-table) tbody tr:hover { background:var(--rel-night-hover) !important; box-shadow:inset 0.1875rem 0 var(--rel-night-blue); }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.tk-table tbody tr.selected,.tk-table tbody tr[aria-selected="true"],.atbl tbody tr.selected,.clientes-rank-table tbody tr.cli-rank-row--hl) { background:rgba(var(--rel-night-blue-rgb),.16) !important; box-shadow:inset 0.25rem 0 var(--rel-night-blue); }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.tk-table,.atbl,.clientes-rank-table) tbody td { color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.tk-colrow th.sorted,.atbl th.sorted,.clientes-rank-table th.sorted) { color:var(--rel-night-blue-strong) !important; box-shadow:inset 0 -0.125rem var(--rel-night-blue); }
html[data-theme="dark"] #page-relatorios .relatorios-fd .list-pagination-bar {
    background: var(--rel-night-thead-band) !important;
    border-color: rgba(180, 160, 220, 0.18) !important;
    box-shadow: inset 0 0.0625rem rgba(210, 190, 255, 0.12), inset 0 -0.0625rem rgba(0, 0, 0, 0.72) !important;
    color: var(--rel-night-text) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.list-pagination-btn,.list-pagination-page) {
    background: var(--rel-night-field) !important;
    border-color: var(--rel-night-line) !important;
    color: var(--rel-night-text-soft) !important;
    box-shadow: none !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.list-pagination-page.is-current,.list-pagination-page.active,[aria-current="page"].list-pagination-page) { background:rgba(var(--rel-night-blue-rgb),.18) !important; border-color:rgba(var(--rel-night-blue-rgb),.48) !important; color:var(--rel-night-blue-strong) !important; }

/* Etapas 7–11: cards pai canônicos (Visão, Tickets, Clientes, Incidentes, Financeiro). */
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .chart-card.visao,
    .chart-card.tickets-card,
    .chart-card.clientes.clientes--modern,
    .chart-card.dep,
    .chart-card.fin
) {
    background: var(--rel-night-card-bg) !important;
    border: 0.0625rem solid var(--rel-night-line) !important;
    box-shadow: var(--rel-night-card-highlight), var(--rel-night-card-shadow) !important;
    -webkit-backdrop-filter: blur(var(--rel-night-card-blur));
    backdrop-filter: blur(var(--rel-night-card-blur));
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .vkg-grid>.sk { background:transparent !important; border-color:transparent !important; box-shadow:none !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.visao .vkg-grid>.sk,.visao .vpanel,.visao .spanel,.visao .apanel) { color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .visao-cat-xlab {
    color: var(--rel-night-text-soft) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .visao-cat-col .cap {
    color: var(--rel-night-blue-strong) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .visao-cat-xlab::before {
    background: rgba(198, 225, 248, .34) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .visao-alert {
    background: var(--rel-night-raised) !important;
    border-color: var(--rel-night-line-strong) !important;
    color: var(--rel-night-text-soft) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .visao-alert--neutral {
    background: rgba(16, 27, 41, .92) !important;
    border-color: rgba(198, 225, 248, .28) !important;
    border-left-color: var(--rel-night-muted) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .visao-alert--neutral .visao-alert-title {
    color: var(--rel-night-text) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .visao-alert--info {
    background: rgba(var(--rel-night-blue-rgb), .12) !important;
    border-color: rgba(var(--rel-night-blue-rgb), .42) !important;
    border-left-color: var(--rel-night-blue) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .visao-alert--info .visao-alert-title {
    color: var(--rel-night-blue-strong) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .visao-alert--warn {
    background: rgba(224, 161, 6, .14) !important;
    border-color: rgba(224, 161, 6, .42) !important;
    border-left-color: #e0a106 !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .visao-alert--warn .visao-alert-title {
    color: #f1b53d !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .visao-alert--crit {
    background: rgba(207, 59, 64, .16) !important;
    border-color: rgba(229, 72, 77, .42) !important;
    border-left-color: #e5484d !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .visao-alert--crit .visao-alert-title {
    color: #f1797d !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .visao-alert-desc {
    color: var(--rel-night-text-soft) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .tk-stat .sl { color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .tk-stat .sv { color:var(--rel-night-text) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .tk-stat.hero .sv { color:var(--rel-night-blue-strong) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .tk-stat.alert .sv { color:#ff7b84 !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .tk-stat.alert .sl { color:#ffadb2 !important; }

html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-table tbody :is(td:first-child,.tk-id) { color:var(--rel-night-blue-strong) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-tablewrap.is-empty,
html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-tablewrap.is-empty .tk-table tbody tr { background:var(--rel-night-surface) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-tablewrap.is-empty .tk-table tbody tr:hover { box-shadow:none; }

html[data-theme="dark"] #page-relatorios .relatorios-fd .kcol { background:var(--rel-night-field) !important; border-color:var(--rel-night-line) !important; box-shadow:inset 0 0.0625rem rgba(255,255,255,.025); }
html[data-theme="dark"] #page-relatorios .relatorios-fd .kcol.k-atend { background:linear-gradient(180deg,rgba(88,214,141,.10),var(--rel-night-field) 5.25rem) !important; border-top-color:rgba(88,214,141,.52) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .kcol.k-paus { background:linear-gradient(180deg,rgba(255,200,87,.10),var(--rel-night-field) 5.25rem) !important; border-top-color:rgba(255,200,87,.52) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .kcol .kcount { background:var(--rel-night-raised) !important; border-color:var(--rel-night-line) !important; color:var(--rel-night-text) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .tkt { background:var(--rel-night-raised) !important; border-color:var(--rel-night-line) !important; box-shadow:0 0.625rem 1.375rem -1.125rem #000; transition:border-color var(--rel-night-motion),box-shadow var(--rel-night-motion),transform var(--rel-night-motion); }
html[data-theme="dark"] #page-relatorios .relatorios-fd .tkt:hover { border-color:rgba(var(--rel-night-blue-rgb),.52) !important; box-shadow:inset 0.1875rem 0 var(--rel-night-blue),0 0.875rem 1.75rem -1.125rem #000; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .tkt :is(.t-meta,.t-foot) { background:var(--rel-night-field) !important; border-color:var(--rel-night-line) !important; }

html[data-theme="dark"] #page-relatorios .relatorios-fd .clientes.clientes--modern :is(.clientes-panel-rank,.clientes-panel-chart) { background:var(--rel-night-raised) !important; border:0.0625rem solid var(--rel-night-line) !important; box-shadow:0 0.875rem 2rem -1.625rem #000; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.clientes-rank-scroll,.clientes-vol-list) { background:var(--rel-night-raised) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.clientes-rank-table tbody tr.cli-rank-row:hover,.cli-vol-row:hover) { background:var(--rel-night-hover) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.clientes-rank-table tbody tr.cli-rank-row--hl,.cli-vol-row--hl) { background:rgba(var(--rel-night-blue-rgb),.16) !important; box-shadow:inset 0.25rem 0 var(--rel-night-blue); }
html[data-theme="dark"] #page-relatorios .relatorios-fd .cli-avatar { background:linear-gradient(145deg,#162638,#0b1520) !important; border:0.0625rem solid var(--rel-night-line-strong) !important; color:var(--rel-night-text) !important; box-shadow:0 0.3125rem 0.75rem -0.5625rem #000; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.cli-name,.cli-num) { color:var(--rel-night-text) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.cli-muted,.cli-vol-meta) { color:var(--rel-night-muted) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .cli-vol-track { background:#050a10 !important; border:0.0625rem solid var(--rel-night-line) !important; box-shadow:inset 0 0.0625rem 0.1875rem #000; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .cli-vol-track>:is(i,span) { background:linear-gradient(90deg,var(--rel-accent-deep),var(--rel-night-blue)) !important; box-shadow:0 0 0.625rem -0.3125rem rgba(var(--rel-night-blue-rgb),.9); }
html[data-theme="dark"] #page-relatorios .relatorios-fd .cli-vol-pct { color:var(--rel-night-blue-strong) !important; }

/* Etapa 10: Categorias, Incidentes e Departamentos. */
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.dep>.chart-head { background:transparent !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd #depSubnav { background:transparent !important; border-color:transparent !important; box-shadow:none !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(#depSubnav,#finSubnav) .subtab:not(.on) { background:var(--rel-night-raised) !important; border-color:var(--rel-night-line) !important; color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(#depSubnav,#finSubnav) .subtab:not(.on):hover { background:var(--rel-night-hover) !important; color:var(--rel-night-text) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(#depSubnav,#finSubnav) .subtab.on { background:rgba(var(--rel-night-blue-rgb),.18) !important; border-color:rgba(var(--rel-night-blue-rgb),.55) !important; color:var(--rel-night-blue-strong) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inner-panel { background:var(--rel-night-raised) !important; border-color:var(--rel-night-line) !important; box-shadow:0 0.875rem 2rem -1.625rem #000; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body { background:transparent !important; }
/* Rótulos do eixo X: superfície do painel Noite — abaixo da pilha, sem transparência. */
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.plot .xrow,.dep-plot-x-band .xrow) {
    background: var(--rel-night-raised, var(--surface)) !important;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inner-panel :is(.plot.dep-plot-patched,.plot.dep-plot-patched .gridbars) { border-color:var(--rel-night-line) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inner-panel .gridbars :is(.grid,.gl) { border-color:rgba(180,211,238,.12) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inner-panel .legend.dep-leg-card { background:linear-gradient(180deg,rgba(23,38,56,.92),rgba(7,13,21,.92)) !important; border-color:var(--rel-night-line-strong) !important; box-shadow:inset 0 0.0625rem rgba(255,255,255,.035); }
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inner-panel .legend.dep-leg-card .dep-leg-head { border-bottom-color:var(--rel-night-line) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inner-panel .dep-leg-sort-btn { background:var(--rel-night-field) !important; border-color:var(--rel-night-line) !important; color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inner-panel .dep-leg-sort-btn:is(:hover,.on) { background:rgba(var(--rel-night-blue-rgb),.16) !important; border-color:rgba(var(--rel-night-blue-rgb),.48) !important; color:var(--rel-night-blue-strong) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.dep-inc-card,.dep-cat-card,.dep-rank-item,.dep-incident-row) { background:var(--rel-night-surface) !important; border-color:var(--rel-night-line) !important; color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.dep-inc-card,.dep-cat-card,.dep-rank-item,.dep-incident-row):hover { background:var(--rel-night-hover) !important; border-color:var(--rel-night-line-strong) !important; }

/* Etapa 11: Financeiro. Azul = investimento, âmbar = custo, verde = economia. */
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.fin {
    --f-blue: var(--rel-night-blue);
    --f-blue-bg: rgba(var(--rel-night-blue-rgb), .14);
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.fin>.chart-head,
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.fin .fin-head-main>.chart-head { background:transparent !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.fin-body,.subsector) { background:transparent !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.fpanel,.fin-kpis,.fin-flow) { background:var(--rel-night-raised) !important; border-color:var(--rel-night-line) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .ff-node { background:var(--rel-night-surface) !important; border-color:var(--rel-night-line) !important; color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .ff-node:hover { background:var(--rel-night-hover) !important; border-color:var(--rel-night-line-strong) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .ff-node :is(.ff-v,.ff-ic) { color:var(--rel-night-blue-strong) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .ff-node.is-cost :is(.ff-v,.ff-ic),
html[data-theme="dark"] #page-relatorios .relatorios-fd .fk.ac-cost :is(.fk-v,.fk-dot) { color:#ffc857 !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .ff-node.is-margin :is(.ff-v,.ff-ic),
html[data-theme="dark"] #page-relatorios .relatorios-fd .fk.ac-ok :is(.fk-v,.fk-dot) { color:#62e6a7 !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .ff-arrow { color:rgba(var(--rel-night-blue-rgb),.55) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .fk { background:transparent !important; border-color:rgba(180,211,238,.12) !important; color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .fk .fk-v { color:var(--rel-night-text) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.fin-treemap,.fin-dept,.fin-clients,.fin-contatos,.ct-sum,.combo-wrap) { background:var(--rel-night-surface) !important; border-color:var(--rel-night-line) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .fin-evol-switch { background:var(--rel-night-field) !important; border-color:var(--rel-night-line-strong) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .fin-evol-switch-btn { color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .fin-evol-switch-btn:hover { background:var(--rel-night-hover) !important; color:var(--rel-night-text) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .fin-evol-switch-btn[aria-pressed="true"] { background:rgba(var(--rel-night-blue-rgb),.20) !important; color:var(--rel-night-blue-strong) !important; }

/* Etapa 12: camadas elevadas, detalhe e conversa. */
html[data-theme="dark"] #page-relatorios :is(.drawer,.anl-drawer,.modal,.repm-panel) { background:#080f18 !important; border-color:var(--rel-night-line-strong) !important; box-shadow:-1.125rem 0 4rem -1.375rem #000 !important; color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.drawer .dw-head,.drawer .dw-head::before,.anl-drawer .adw-head) { background:linear-gradient(145deg,#07111c,#10243a) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .drawer :is(.dw-crumb,.dw-crumb-inicio,.dw-sub,.dw-kpi .l) { color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .drawer .dw-kpi { background:rgba(255,255,255,.045) !important; border-color:var(--rel-night-line) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.drawer .dw-x,.anl-drawer .adw-close) { background:var(--rel-night-raised) !important; border-color:var(--rel-night-line-strong) !important; color:var(--rel-night-text) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.drawer .dw-x,.anl-drawer .adw-close):hover { background:rgba(255,102,112,.16) !important; border-color:rgba(255,102,112,.48) !important; color:#ffadb2 !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.drawer .dw-body,.anl-drawer .adw-body,.modal .m-body),
html[data-theme="dark"] #page-relatorios .repm-preview-scroll { background:var(--rel-night-surface) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.drawer .dw-foot,.anl-drawer .adw-foot,.modal .m-foot) { background:var(--rel-night-field) !important; border-color:var(--rel-night-line) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-tip { background:#050a10 !important; border-color:var(--rel-night-line-strong) !important; color:var(--rel-night-text) !important; box-shadow:0 1.25rem 3.375rem -1.375rem #000 !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .dd-overlay { background:rgba(0,2,5,.84) !important; backdrop-filter:blur(0.25rem); }
html[data-theme="dark"] #page-relatorios .relatorios-fd .cv-thread { background:#050910 !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .cv-head { background:var(--rel-night-raised) !important; border-color:var(--rel-night-line) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .cv-note { background:var(--rel-night-field) !important; border-color:var(--rel-night-line) !important; color:var(--rel-night-muted) !important; }

/* Etapa 13: plano cartesiano e SVGs acompanham a paleta dinâmica Noite. */
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(svg .grid,svg .grid-line,.chart-grid,.axis-line) { stroke:rgba(180,211,238,.12) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(svg text,.axis-label,.chart-label,.xlab,.ylab) { fill:var(--rel-night-text-soft); color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.legend,.combo-legend,.chart-legend) { color:var(--rel-night-text-soft) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-foot .upd .live { background:#62e6a7 !important; box-shadow:0 0 0 0.1875rem rgba(98,230,167,.12),0 0 0.75rem rgba(98,230,167,.32); }

/* Etapa 14: movimento funcional, lento e sem brilho decorativo excessivo. */
@keyframes rel-night-live-pulse {
    0%, 100% { box-shadow:0 0 0 0.1875rem rgba(98,230,167,.10),0 0 0.5rem rgba(98,230,167,.20); }
    50% { box-shadow:0 0 0 0.3125rem rgba(98,230,167,.04),0 0 0.875rem rgba(98,230,167,.34); }
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-foot .upd .live { animation:rel-night-live-pulse 2.8s ease-in-out infinite; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.chart-card,.config-panel,.fpanel,.dep-inner-panel,.clientes-panel-rank,.clientes-panel-chart) { transition:border-color var(--rel-night-motion),background-color var(--rel-night-motion),box-shadow var(--rel-night-motion); }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.chart-card,.config-panel,.fpanel,.dep-inner-panel,.clientes-panel-rank,.clientes-panel-chart):focus-within { border-color:rgba(var(--rel-night-blue-rgb),.34) !important; }
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.drawer,.anl-drawer,.modal,.chart-tip,.fdsel-menu,.flt-menu,.dr-pop,.cal-pop,.more-pop) { transition:border-color var(--rel-night-motion),box-shadow var(--rel-night-motion),opacity var(--rel-night-motion),transform var(--rel-night-motion); }

/* A responsividade é herdada integralmente do tema Dia: Noite não redefine geometria. */

/* Cards com lista: força o degradê Noite (shell redefine --tk-thead-grad no Dia). */
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .tickets-card,
    .chart-card.clientes.clientes--modern,
    .dep-detail-tablewrap
) {
    --tk-thead-grad: var(--rel-night-thead-band);
    --tk-thead-edge: var(--rel-night-thead-highlight);
}
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    #tkTable thead tr.tk-colrow,
    .tickets-card .tk-table thead tr,
    .clientes-rank-table thead tr,
    .dep-detail-table thead,
    .dep-detail-table thead tr.dep-detail-colrow
) {
    background:var(--rel-night-thead-band) !important;
    box-shadow:var(--rel-night-thead-highlight) !important;
}

/* Rodapés de tabela: mesma faixa azul escuro dos cabeçalhos. */
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .tickets-card .tk-list-pager.list-pagination-bar,
    .tickets-card #tkListaPagination.list-pagination-bar,
    .chart-card.clientes #clientesRankPagination.list-pagination-bar,
    .list-pagination-bar.is-table-footer,
    .dep-detail-tablewrap::after
) {
    background: var(--rel-night-thead-band) !important;
    border-color: var(--rel-night-thead-edge) !important;
    box-shadow: var(--rel-night-thead-highlight) !important;
    color: var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .tickets-card .tk-list-pager,
    .tickets-card #tkListaPagination,
    .chart-card.clientes #clientesRankPagination
) :is(.list-pagination-info, .list-pagination-label) {
    color: rgba(244, 249, 255, 0.88) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    #tkTable thead tr.tk-colrow th,
    .tickets-card .tk-table thead th,
    .clientes-rank-table thead th,
    .dep-detail-table thead th
) {
    background:transparent !important;
    color:var(--rel-night-text) !important;
    border-color:rgba(180,211,238,.12) !important;
    text-shadow:0 0.0625rem #000 !important;
}

/* Tabelas vazias: elimina os fundos claros sem tocar em altura, largura ou linhas. */
html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-tablewrap.is-empty,
html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-tablewrap.is-empty .tk-table,
html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-tablewrap.is-empty .tk-table tbody,
html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-table tbody.tk-body--empty {
    background:var(--rel-night-surface) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-tablewrap.is-empty .tk-table tbody tr,
html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-tablewrap.is-empty .tk-table tbody tr:nth-child(odd),
html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-table tbody.tk-body--empty tr,
html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-table tbody.tk-body--empty tr:nth-child(odd) {
    background:#0a111b !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-tablewrap.is-empty .tk-table tbody tr:nth-child(even),
html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-table tbody.tk-body--empty tr:nth-child(even) {
    background:#0d1622 !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-tablewrap.is-empty .tk-table tbody tr td,
html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-table tbody.tk-body--empty tr td {
    background:transparent !important;
    border-bottom-color:rgba(180,211,238,.12) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-detail-tablewrap,
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-detail-table,
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-detail-table tbody,
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-detail-table tbody tr.dep-detail-empty-row,
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-detail-table tbody tr.dep-detail-empty-row td {
    background:var(--rel-night-surface) !important;
    color:var(--rel-night-text-soft) !important;
    border-color:rgba(180,211,238,.12) !important;
}

/*
 * Cards Noite — elevação sem contorno evidente (vars em #page-relatorios).
 */
/* Refinamento visual: superfície dark acima do espaço (sem moldura evidente). */
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .chart-card,
    .config-panel:not(.rel-indic-panel),
    .tickets-card,
    .dpanel,
    .fpanel,
    .spanel,
    .apanel,
    .vpanel,
    .jpanel,
    .repm-panel,
    .rel-period-panel,
    .dep-inner-panel,
    .dep-cat-card,
    .dep-dist-rank-card,
    .dep-inc-card,
    .dep-inc-kpi,
    .dep-inc-stack-card,
    .clientes-panel-rank,
    .clientes-panel-chart,
    .ct-sum-card,
    .cx-card,
    .dx-card,
    .fav-card,
    .hs-card,
    .fin-dept-panel,
    .fin-evol-panel,
    .ff-node,
    .fin-pacote-node
) {
    background: var(--rel-night-card-bg) !important;
    background-color: var(--rel-night-card-bg) !important;
    border-color: var(--rel-night-card-edge) !important;
    box-shadow: var(--rel-night-card-highlight), var(--rel-night-card-shadow) !important;
    -webkit-backdrop-filter: blur(var(--rel-night-card-blur));
    backdrop-filter: blur(var(--rel-night-card-blur));
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .chart-card,
    .tickets-card,
    .dpanel,
    .fpanel,
    .spanel,
    .apanel,
    .vpanel,
    .jpanel,
    .repm-panel,
    .dep-cat-card,
    .dep-dist-rank-card,
    .dep-inc-card,
    .clientes-panel-rank,
    .clientes-panel-chart,
    .ct-sum-card,
    .cx-card,
    .dx-card,
    .fav-card,
    .hs-card,
    .ff-node,
    .fin-pacote-node
):hover {
    background: var(--rel-night-card-bg-hover) !important;
    background-color: var(--rel-night-card-bg-hover) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-card,
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-indic-panel.config-panel {
    border: 0.0625rem solid var(--rel-night-line) !important;
    box-shadow: var(--rel-night-card-highlight) !important;
}

/*
 * Sombra mínima ao redor dos 3 blocos do topo (filtros / filtrados / indicadores).
 * No wrapper: overflow:hidden dos cards não corta a sombra; menus dos filtros intactos.
 */
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-top-section,
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-indic-section {
    position: relative;
    z-index: 1;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-top-section::after,
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-indic-section::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--fd-radius-card, 0.25rem);
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.4), 0 0.625rem 1.375rem rgba(0, 0, 0, 0.28);
    pointer-events: none;
    z-index: -1;
}

/* Filtros ativos: micro-elevação para não sumir no void do card. */
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-filter-summary {
    background: rgba(8, 12, 22, 0.72) !important;
    border: 0.0625rem solid rgba(100, 130, 160, 0.08) !important;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.28) !important;
}

/* Split/inner: iguais ao Dia (transparentes) — sem moldura contínua ligando KPIs à tabela. */
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .tk-inner-panel,
    .tk-tickets-split-panel
) {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Faixa de KPIs (.tk-stats): mesmo fundo do card (sem painel separado). */
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .tk-stats,
    .tickets-card .tk-stats,
    .tickets-card .tk-tickets-split-panel > .tk-stats,
    .chart-card.tickets-card .tk-inner-panel .tk-stats,
    .chart-card.clientes .clientes-stats.tk-stats
) {
    display: flex !important;
    gap: 0 !important;
    padding: 0.875rem 1.375rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden;
    background: transparent !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .tickets-card .tk-tickets-split-panel > .tk-stats {
    margin: 0 0 0.875rem !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.tickets-card .tk-inner-panel .tk-stats {
    margin: 0 !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes .clientes-stats.tk-stats {
    margin: 0 1.625rem !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .tk-stats > .tk-stat,
    .tickets-card .tk-stat,
    .chart-card.clientes .clientes-stats .tk-stat
) {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 0 1.125rem !important;
    background: transparent !important;
    border: 0 !important;
    border-left: 0.0625rem solid rgba(180, 211, 238, 0.12) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .tk-stats > .tk-stat:first-child,
    .tickets-card .tk-stat:first-child,
    .chart-card.clientes .clientes-stats .tk-stat:first-child
) {
    border-left: 0 !important;
}

/* Cabeçalhos de Incidentes: alto contraste noturno, mantendo a caixa original do Dia. */
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inc-kpi-head {
    background:var(--rel-night-thead-band) !important;
    border-bottom-color:var(--rel-night-thead-edge) !important;
    box-shadow:var(--rel-night-thead-highlight) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inc-kpi-head .dep-inc-kpi-t {
    color:#f4f9ff !important;
    text-shadow:0 0.0625rem #000 !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inc-kpi-head .dep-inc-kpi-s {
    color:#c5d3e1 !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inc-kpi-list {
    background:#0a111b !important;
}

/* Clientes vazio: substitui todas as superfícies claras pela hierarquia do Noite. */
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes.clientes--modern {
    background:var(--rel-night-surface) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes .clientes-body {
    background:#070d15 !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes :is(
    .clientes-panel-rank,
    .clientes-rank-body,
    .clientes-rank-scroll,
    .clientes-rank-table,
    .clientes-rank-table tbody
) {
    background:var(--rel-night-raised) !important;
    border-color:rgba(198,225,248,.18) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes .clientes-rank-scroll.is-empty .clientes-rank-table tbody tr,
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes .clientes-rank-scroll.is-empty .clientes-rank-table tbody tr:nth-child(odd),
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes .clientes-rank-scroll.is-empty .clientes-rank-table tbody tr.cli-pad-row,
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes .clientes-rank-scroll.is-empty .clientes-rank-table tbody tr.cli-pad-row:nth-child(odd),
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes .clientes-rank-scroll.is-empty .clientes-rank-table tbody tr.cli-pad-row:hover {
    background:#0a111b !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes .clientes-rank-scroll.is-empty .clientes-rank-table tbody tr:nth-child(even),
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes .clientes-rank-scroll.is-empty .clientes-rank-table tbody tr.cli-pad-row:nth-child(even),
html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes .clientes-rank-scroll.is-empty .clientes-rank-table tbody tr.cli-pad-row:nth-child(even):hover {
    background:#0d1622 !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .chart-card.clientes .clientes-rank-scroll.is-empty .clientes-rank-table tbody tr td {
    background:transparent !important;
    border-bottom-color:rgba(180,211,238,.12) !important;
}

/* Rodapés de tabela (Chamados, Clientes e demais): faixa + controles iguais. */
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .tickets-card .tk-list-pager.list-pagination-bar,
    .tickets-card #tkListaPagination.list-pagination-bar,
    .chart-card.clientes #clientesRankPagination.list-pagination-bar,
    .list-pagination-bar.is-table-footer
) {
    background: var(--rel-night-thead-band) !important;
    border-color: var(--rel-night-thead-edge) !important;
    border-top-color: var(--rel-night-thead-edge) !important;
    box-shadow: var(--rel-night-thead-highlight) !important;
    color: var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .tickets-card .tk-list-pager,
    .tickets-card #tkListaPagination,
    .chart-card.clientes #clientesRankPagination,
    .list-pagination-bar.is-table-footer
) :is(.list-pagination-btn, .list-pagination-page) {
    background: #0a111b !important;
    border-color: rgba(198, 225, 248, 0.20) !important;
    color: var(--rel-night-text-soft) !important;
    box-shadow: inset 0 0.0625rem rgba(198, 225, 248, 0.05) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .tickets-card .tk-list-pager,
    .tickets-card #tkListaPagination,
    .chart-card.clientes #clientesRankPagination,
    .list-pagination-bar.is-table-footer
) :is(.list-pagination-btn, .list-pagination-page):hover:not(:disabled) {
    background: var(--rel-night-hover) !important;
    border-color: var(--rel-night-line-strong) !important;
    color: var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .tickets-card .tk-list-pager,
    .tickets-card #tkListaPagination,
    .chart-card.clientes #clientesRankPagination,
    .list-pagination-bar.is-table-footer
) :is(.list-pagination-btn, .list-pagination-page):disabled {
    background: rgba(10, 17, 27, 0.55) !important;
    border-color: rgba(198, 225, 248, 0.12) !important;
    color: rgba(244, 249, 255, 0.42) !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(
    .tickets-card .tk-list-pager,
    .tickets-card #tkListaPagination,
    .chart-card.clientes #clientesRankPagination,
    .list-pagination-bar.is-table-footer
) :is(.list-pagination-page.is-current, .list-pagination-page.active, [aria-current="page"].list-pagination-page) {
    background: rgba(var(--rel-night-blue-rgb), 0.18) !important;
    border-color: rgba(var(--rel-night-blue-rgb), 0.48) !important;
    color: var(--rel-night-blue-strong) !important;
}

/* Gráfico temporal: valores nítidos sobre a linha, o preenchimento e a grade. */
html[data-theme="dark"] #page-relatorios .relatorios-fd .fin-evol-point-lbl,
html[data-theme="dark"] #page-relatorios .relatorios-fd .fin-evol-panel--historico .fin-evol-point-lbl {
    fill:#dff7ff !important;
    stroke:#06101a !important;
    stroke-opacity:.96;
    paint-order:stroke fill;
    filter:drop-shadow(0 0.0625rem 0.0625rem rgba(0,0,0,.78));
}

/* Custo por contato: o estado sem série deixa de parecer um gráfico quebrado. */
html[data-theme="dark"] #page-relatorios .relatorios-fd #finContatos .fin-contatos-list:not(:has(.ct-row)) {
    position:relative;
    background:linear-gradient(180deg,#09111b,#080f18) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd #finContatos .fin-contatos-list:not(:has(.ct-row))::after {
    content:"Sem custos por contato no período filtrado.";
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    color:var(--rel-night-text-soft);
    font-weight:700;
    letter-spacing:.01em;
    text-align:center;
    text-shadow:0 0.0625rem #000;
    pointer-events:none;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd #finContatos .ct-item.ct-pad-row {
    border-top-color:rgba(180,211,238,.10) !important;
    background:rgba(198,225,248,.012) !important;
}

/* Custo por departamento: mantém o mesmo estado vazio informativo. */
html[data-theme="dark"] #page-relatorios .relatorios-fd #finDept .fin-dept-list:not(:has(.fd-cat-row)) {
    position:relative;
    background:linear-gradient(180deg,#09111b,#080f18) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd #finDept .fin-dept-list:not(:has(.fd-cat-row))::after {
    content:"Sem custos por departamento no período filtrado.";
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    color:var(--rel-night-text-soft);
    font-weight:700;
    letter-spacing:.01em;
    text-align:center;
    text-shadow:0 0.0625rem #000;
    pointer-events:none;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd #finDept .fd-cat-item.fd-pad-row {
    border-top-color:rgba(180,211,238,.10) !important;
    background:rgba(198,225,248,.012) !important;
}

/* Visão Executiva: KPIs superiores repetem o contorno suave dos painéis inferiores. */
html[data-theme="dark"] #page-relatorios .relatorios-fd .visao .vkg-grid > .sk {
    border-color:rgba(198,225,248,.18) !important;
    box-shadow:inset 0 0 0 0.0625rem rgba(198,225,248,.08),0 1rem 2.125rem -1.875rem rgba(0,0,0,.96) !important;
}

/* Financeiro e Departamentos: sub-abas repetem o cabeçalho profundo do Noite. */
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(#depSubnav,#finSubnav) .subtab,
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(#depSubnav,#finSubnav) .subtab:not(.on) {
    background:
        radial-gradient(circle at 16% 24%,rgba(85,183,255,.16) 0,rgba(85,183,255,.05) 27%,transparent 50%),
        radial-gradient(circle at 70% 78%,rgba(0,0,0,.46) 0,transparent 52%),
        radial-gradient(circle at 92% 16%,rgba(139,208,255,.13) 0,transparent 40%),
        #0b1b2a !important;
    border-color:rgba(180,211,238,.12) !important;
    color:var(--rel-night-text-soft) !important;
    box-shadow:inset 0 0.0625rem rgba(198,225,248,.10),inset 0 0 1.125rem rgba(var(--rel-night-blue-rgb),.04) !important;
    text-shadow:0 0.0625rem #000;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(#depSubnav,#finSubnav) .subtab:hover {
    border-color:rgba(198,225,248,.30) !important;
    color:var(--rel-night-text) !important;
    filter:brightness(1.12);
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(#depSubnav,#finSubnav) .subtab.on,
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(#depSubnav,#finSubnav) .subtab.on:hover {
    background:
        radial-gradient(circle at 18% 22%,rgba(139,208,255,.25) 0,rgba(85,183,255,.08) 28%,transparent 50%),
        radial-gradient(circle at 68% 78%,rgba(0,15,31,.56) 0,transparent 54%),
        radial-gradient(circle at 90% 16%,rgba(85,183,255,.24) 0,transparent 42%),
        #143653 !important;
    border-color:rgba(var(--rel-night-blue-rgb),.48) !important;
    color:var(--rel-night-blue-strong) !important;
    box-shadow:inset 0 0.0625rem rgba(198,225,248,.14),inset 0 0 1.25rem rgba(var(--rel-night-blue-rgb),.08) !important;
}

/* Custo médio por horas disponíveis: tipografia neutra, sem amarelo no Noite. */
html[data-theme="dark"] #page-relatorios .relatorios-fd .ff-node.is-cost .ff-v {
    color:var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .ff-node.is-cost :is(.ff-l,.ff-x,.ff-cmp) {
    color:var(--rel-night-text-soft) !important;
}

/* Barra de filtros: ações coordenadas com a profundidade do tema Noite. */
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-clear-filters {
    background:linear-gradient(180deg,#571c23,#351015) !important;
    border-color:rgba(180, 90, 100, 0.28) !important;
    color:#ffd9dc !important;
    box-shadow:inset 0 0.0625rem rgba(255,194,199,.08),0 0.5rem 1.125rem -0.8125rem rgba(0,0,0,.92) !important;
    text-shadow:0 0.0625rem #000;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-clear-filters svg {
    color:#ff9ba3 !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-clear-filters:hover {
    background:linear-gradient(180deg,#6d2730,#43151b) !important;
    border-color:rgba(200, 110, 120, 0.4) !important;
    color:#fff0f1 !important;
    filter:none;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-clear-filters:focus-visible {
    background:linear-gradient(180deg,#64232b,#3d1319) !important;
    border-color:#ff9ba3 !important;
    color:#fff0f1 !important;
    box-shadow:0 0 0 0.1875rem rgba(255,123,132,.18),inset 0 0.0625rem rgba(255,194,199,.12) !important;
    filter:none;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-clear-filters:active {
    background:linear-gradient(180deg,#2c0b10,#22080c) !important;
    box-shadow:inset 0 0.125rem 0.25rem rgba(0,0,0,.48) !important;
}

/* Pesquisar Noite: azul profundo + tipografia clara (sem céu elétrico / tinta preta). */
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.rel-search-apply, .rp-search-btn),
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.rel-search-apply, .rp-search-btn):hover,
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.rel-search-apply, .rp-search-btn):focus,
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.rel-search-apply, .rp-search-btn):focus-visible,
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.rel-search-apply, .rp-search-btn):active {
    background: linear-gradient(180deg, #1a2a4a 0%, #121c36 55%, #0e1730 100%) !important;
    border-color: rgba(160, 150, 210, 0.35) !important;
    color: #f4f9ff !important;
    text-shadow: 0 0.0625rem rgba(0, 0, 0, 0.55) !important;
    box-shadow: inset 0 0.0625rem rgba(210, 190, 255, 0.12), 0 0.5rem 1.125rem -0.875rem rgba(0, 0, 0, 0.85) !important;
    filter: none !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.rel-search-apply, .rp-search-btn):hover:not(:disabled),
html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.rel-search-apply, .rp-search-btn):focus-visible {
    background: linear-gradient(180deg, #243658 0%, #1a2744 55%, #152038 100%) !important;
    border-color: rgba(180, 170, 230, 0.48) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.rel-search-apply, .rp-search-btn):active:not(:disabled) {
    background: linear-gradient(180deg, #0c1428 0%, #0a1020 100%) !important;
    box-shadow: inset 0 0.125rem 0.3125rem rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd :is(.rel-search-apply, .rp-search-btn) svg {
    color: #f4f9ff !important;
    stroke: currentColor;
}

/* Modo expandido: Voltar alinhado ao Pesquisar Noite. */
html[data-theme="dark"] #page-relatorios.relatorios-print-focus .rp-focus-bar .rp-focus-back {
    background: linear-gradient(180deg, #1a2a4a 0%, #121c36 55%, #0e1730 100%) !important;
    border-color: rgba(160, 150, 210, 0.35) !important;
    color: #f4f9ff !important;
    box-shadow: inset 0 0.0625rem rgba(210, 190, 255, 0.12), 0 0.5rem 1.125rem -0.875rem rgba(0, 0, 0, 0.85) !important;
    text-shadow: 0 0.0625rem rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] #page-relatorios.relatorios-print-focus .rp-focus-bar .rp-focus-back:hover {
    background: linear-gradient(180deg, #243658 0%, #1a2744 55%, #152038 100%) !important;
    border-color: rgba(180, 170, 230, 0.48) !important;
    color: #fff !important;
}

html[data-theme="dark"] #page-relatorios.relatorios-print-focus .rp-focus-bar .rp-focus-back:focus-visible {
    background: linear-gradient(180deg, #243658 0%, #1a2744 55%, #152038 100%) !important;
    border-color: rgba(180, 170, 230, 0.48) !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.1875rem rgba(100, 90, 180, 0.22), inset 0 0.0625rem rgba(210, 190, 255, 0.12) !important;
    outline: none;
}

html[data-theme="dark"] #page-relatorios.relatorios-print-focus .rp-focus-bar .rp-focus-back:active {
    background: linear-gradient(180deg, #0c1428 0%, #0a1020 100%) !important;
    box-shadow: inset 0 0.125rem 0.3125rem rgba(0, 0, 0, 0.45) !important;
}

/* —— Menu Período (calendário + atalhos) → Noite —— */
html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-period-panel {
    background:var(--rel-night-surface) !important;
    border-color:var(--rel-night-line-strong) !important;
    border-radius:0.25rem !important;
    box-shadow:0 1.75rem 4rem -1.75rem #000, inset 0 0.0625rem rgba(198,225,248,.08) !important;
    color:var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-period-panel-cal {
    background: var(--rel-night-surface) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-range-header {
    background:var(--rel-night-thead-band) !important;
    color:#f4f9ff !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-range-title {
    background:rgba(255,255,255,.08) !important;
    color:#f4f9ff !important;
    box-shadow:inset 0 0.0625rem rgba(255,255,255,.12) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-range-title:hover {
    background:rgba(255,255,255,.14) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-nav {
    background:rgba(255,255,255,.08) !important;
    color:#f4f9ff !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-nav:hover {
    background:rgba(255,255,255,.16) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-period-panel-cal .acomp-period-range-body,
html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-range-body {
    background:var(--rel-night-surface) !important;
    color:var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-wd span {
    color:var(--rel-night-muted) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-num {
    color:var(--rel-night-text-soft) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-cell:hover:not(.muted):not(.dis) .cal-num {
    background:rgba(var(--rel-night-blue-rgb),.18) !important;
    color:var(--rel-night-blue-strong) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-cell.is-start .cal-num,
html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-cell.cal-pick-month.is-start .cal-num,
html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-cell.cal-pick-year.is-start .cal-num,
html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-cell.rng-main.is-start .cal-num,
html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-cell.rng-main.is-end .cal-num,
html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-cell.is-start:hover:not(.muted):not(.dis) .cal-num,
html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-cell.rng-main.is-start:hover:not(.muted):not(.dis) .cal-num,
html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-cell.rng-main.is-end:hover:not(.muted):not(.dis) .cal-num {
    background:var(--rel-night-blue) !important;
    color:#02070c !important;
    box-shadow:0 0.375rem 0.875rem -0.375rem rgba(var(--rel-night-blue-rgb),.85) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-cell.muted .cal-num,
html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-cell.dis .cal-num {
    color:rgba(143,162,181,.42) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-cell.rng-main::before {
    background:rgba(var(--rel-night-blue-rgb),.16) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-cal-grid .cal-cell.rng-main.rng-prev::before {
    background:rgba(var(--rel-night-blue-rgb),.10) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-panel-sum-wrap {
    border-top-color:var(--rel-night-line) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-panel-sum {
    color:var(--rel-night-text-soft) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-panel-sum .acomp-period-psum-range {
    color:var(--rel-night-blue-strong) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-panel-sum .acomp-period-psum-days {
    color:var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-panel-sum.empty,
html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-range-hint {
    color:var(--rel-night-muted) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-period-panel-cal .acomp-period-range-foot,
html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-range-foot {
    background: var(--rel-night-surface) !important;
    border-top-color: var(--rel-night-line) !important;
    padding: 0.375rem 0.625rem !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-tip {
    background: rgba(255, 196, 72, 0.14) !important;
    border: 0.0625rem solid rgba(240, 200, 100, 0.42) !important;
    box-shadow: none !important;
    padding: 0.375rem 0.625rem !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-tip-txt {
    color: #f5dfa0 !important;
    font-weight: 650 !important;
    font-size: 0.71875rem !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-clear {
    background:var(--rel-night-raised) !important;
    border-color:var(--rel-night-line) !important;
    color:var(--rel-night-text-soft) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .acomp-period-apply {
    background:var(--rel-night-blue) !important;
    color:#02070c !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .rel-period-panel-aside {
    border-left-color:var(--rel-night-line) !important;
    background:linear-gradient(165deg,#101b29 0%,#0a111b 55%,#070d15 100%) !important;
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
    box-shadow:inset 0.0625rem 0 0 rgba(198,225,248,.06) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .dr-presets--stack button {
    color:var(--rel-night-text-soft) !important;
    background:transparent !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .dr-presets--stack button:hover {
    background:var(--rel-night-hover) !important;
    color:var(--rel-night-text) !important;
}

html[data-theme="dark"] #page-relatorios .relatorios-fd .dr-presets--stack button.on {
    background:rgba(var(--rel-night-blue-rgb),.92) !important;
    color:#02070c !important;
    box-shadow:0 0.375rem 1rem -0.625rem rgba(var(--rel-night-blue-rgb),.9) !important;
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme="dark"] #page-relatorios .relatorios-fd *,
    html[data-theme="dark"] #page-relatorios .relatorios-fd *::before,
    html[data-theme="dark"] #page-relatorios .relatorios-fd *::after {
        scroll-behavior:auto !important;
        animation-duration:.01ms !important;
        animation-iteration-count:1 !important;
        transition-duration:.01ms !important;
    }
}
