/*
 * Sprint 8/12 — onda Nublado: Dashboard + Acompanhamento.
 * Autoridade cromática apenas; nenhuma medida ou estrutura é redefinida.
 */

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
html[data-theme="cinza"] #page-dashboard .dash2 {
    --blue: var(--nuv-navy) !important;
    --ink: var(--nuv-text) !important;
    --muted: var(--nuv-text-soft) !important;
    --line: var(--nuv-line-subtle) !important;
    --field: var(--nuv-field) !important;
    --surface: var(--nuv-surface-parent) !important;
    --bg-app: var(--nuv-bg) !important;
    --text-body: var(--nuv-text-soft) !important;
    --text-nano: var(--nuv-text-muted) !important;
    --ok: var(--nuv-success) !important;
    --ok-dot: #15683f !important;
    --ok-bg: var(--nuv-success-bg) !important;
    --warn: var(--nuv-warning) !important;
    --warn-dot: #8a5210 !important;
    --warn-bg: var(--nuv-warning-bg) !important;
    --bad: var(--nuv-danger) !important;
    --bad-dot: #97231f !important;
    --bad-bg: var(--nuv-danger-bg) !important;
    --info: var(--nuv-info) !important;
    --info-bg: var(--nuv-info-bg) !important;
    --elev-1: var(--nuv-shadow-card) !important;
    --elev-2: var(--nuv-shadow-raised) !important;
    --elev-3: var(--nuv-shadow-popover) !important;
}

html[data-theme="cinza"] #page-dashboard.page.active {
    background:
        radial-gradient(circle at 12% 8%, var(--nuv-nebula-1), transparent 31%),
        radial-gradient(circle at 84% 18%, var(--nuv-nebula-3), transparent 34%),
        var(--nuv-bg) !important;
    color: var(--nuv-text) !important;
}

html[data-theme="cinza"] #page-dashboard .dash2 :where(
    .pulse,
    .panel,
    .kpi,
    .pz-sla,
    .dash-tarefas-resumo,
    .dash-tarefa-stat,
    .dashboard-analista-card
) {
    background-color: var(--nuv-surface-parent) !important;
    border-color: var(--nuv-line) !important;
    color: var(--nuv-text) !important;
    box-shadow: inset 0 0 0 0.0625rem var(--nuv-line-subtle), var(--nuv-shadow-card) !important;
}

html[data-theme="cinza"] #page-dashboard .dash2 :where(
    .panel .p-head,
    .pz-sla-head,
    .dash-tarefas-resumo > header
) {
    background: var(--nuv-header-band) !important;
    border-color: var(--nuv-line-on-header) !important;
    color: var(--nuv-text-on-header) !important;
}

html[data-theme="cinza"] #page-dashboard .dash2 :where(
    .panel .p-head,
    .pz-sla-head,
    .dash-tarefas-resumo > header
) :where(h2, h3, p, span, .p-sub, .p-tag) {
    color: var(--nuv-text-on-header) !important;
}

html[data-theme="cinza"] #page-dashboard .dash2 :where(
    .pz-col,
    .snap,
    .df-row,
    .dash-tarefa-status,
    .dashboard-op-card
) {
    border-color: var(--nuv-line-subtle) !important;
}

html[data-theme="cinza"] #page-dashboard .dash2 :where(.df-row, .dash-tarefa-stat):hover {
    background-color: var(--nuv-surface-hover) !important;
}

html[data-theme="cinza"] #page-dashboard .dash2 :where(
    .pz-verdict,
    .snap .s-v,
    .kpi .k-value,
    .df-title,
    .df-count,
    .dash-tarefa-stat strong
) {
    color: var(--nuv-text) !important;
}

html[data-theme="cinza"] #page-dashboard .dash2 :where(
    .pz-eyebrow,
    .pz-narrative,
    .snap .s-l,
    .snap .s-x,
    .kpi .k-label,
    .kpi .k-foot2 .fl,
    .df-sub,
    .dash-tarefa-stat span
) {
    color: var(--nuv-text-soft) !important;
}

/* O Nublado deixa de herdar o caderno noturno. */
html[data-theme="cinza"] #page-dashboard .dash2 .dash-notebook-page {
    --nb-paper: var(--nuv-surface-child) !important;
    --nb-paper-deep: var(--nuv-surface-parent) !important;
    --nb-line: var(--nuv-line-subtle) !important;
    --nb-line-alt: rgba(var(--nuv-navy-rgb), .08) !important;
    --nb-margin: rgba(var(--nuv-navy-rgb), .32) !important;
    --nb-margin-soft: rgba(var(--nuv-navy-rgb), .14) !important;
    background-color: var(--nuv-surface-child) !important;
    border-color: var(--nuv-line) !important;
    color: var(--nuv-text) !important;
    box-shadow: var(--nuv-shadow-card) !important;
}

html[data-theme="cinza"] #page-dashboard .dash2 .dash-agenda-notebook-body {
    --nb-paper: var(--nuv-surface-child) !important;
    --nb-paper-deep: var(--nuv-surface-parent) !important;
    --nb-sheet: var(--nuv-surface-grandchild) !important;
    --nb-sheet-2: var(--nuv-surface-raised) !important;
    background: color-mix(in srgb, var(--nuv-surface-parent) 72%, var(--nuv-surface-child)) !important;
    color: var(--nuv-text) !important;
    box-shadow: var(--nuv-shadow-raised) !important;
}

/* --------------------------------------------------------------------------
   Acompanhamento
   -------------------------------------------------------------------------- */
html[data-theme="cinza"] #page-acompanhamento {
    --acomp-border: var(--nuv-line-subtle) !important;
    --acomp-border-strong: var(--nuv-line) !important;
    --acomp-surface: var(--nuv-surface-parent) !important;
    --acomp-bg-soft: rgba(var(--nuv-navy-rgb), .06) !important;
    --acomp-teal: var(--nuv-navy) !important;
    --acomp-chip-bg: var(--nuv-info-bg) !important;
    --acomp-chip-border: rgba(var(--nuv-navy-rgb), .34) !important;
    --acomp-shadow-card: var(--nuv-shadow-card) !important;
    --acomp-filter-panel-fill: var(--nuv-header-band) !important;
    --acomp-filter-panel-border: var(--nuv-line-on-header) !important;
    --acomp-brand: var(--nuv-navy) !important;
    --acomp-brand-600: var(--nuv-navy-strong) !important;
    --acomp-brand-50: var(--nuv-info-bg) !important;
    --acomp-ink-900: var(--nuv-text) !important;
    --acomp-ink-600: var(--nuv-text-soft) !important;
    --acomp-ink-400: var(--nuv-text-muted) !important;
    --acomp-line: var(--nuv-line-subtle) !important;
    --acomp-canvas: var(--nuv-bg) !important;
    --acomp-danger: var(--nuv-danger) !important;
    --acomp-danger-50: var(--nuv-danger-bg) !important;
}

html[data-theme="cinza"] #page-acompanhamento.page.active {
    background:
        radial-gradient(circle at 14% 10%, var(--nuv-nebula-1), transparent 30%),
        radial-gradient(circle at 88% 82%, rgba(var(--nuv-navy-rgb), .10), transparent 38%),
        var(--nuv-bg) !important;
    color: var(--nuv-text) !important;
}

html[data-theme="cinza"] #page-acompanhamento :where(
    .acomp-kpi-card,
    .acomp-kcol,
    .acomp-ticket-card,
    .acomp-list-wrap,
    .acomp-results-bar,
    .acomp-empty-state
) {
    background-color: var(--nuv-surface-parent) !important;
    border-color: var(--nuv-line) !important;
    color: var(--nuv-text) !important;
    box-shadow: inset 0 0 0 0.0625rem var(--nuv-line-subtle), var(--nuv-shadow-card) !important;
}

html[data-theme="cinza"] #page-acompanhamento :where(
    .acomp-kcol-head,
    .acomp-results-bar,
    .acomp-modal-head
) {
    background: var(--nuv-header-band) !important;
    border-color: var(--nuv-line-on-header) !important;
    color: var(--nuv-text-on-header) !important;
}

html[data-theme="cinza"] #page-acompanhamento :where(
    .acomp-kcol-head,
    .acomp-results-bar,
    .acomp-modal-head
) :where(h1, h2, h3, p, span, strong, button) {
    color: var(--nuv-text-on-header) !important;
}

html[data-theme="cinza"] #page-acompanhamento .acomp-filter-panel {
    background: var(--nuv-header-band) !important;
    border-color: var(--nuv-line-on-header) !important;
    box-shadow: var(--nuv-shadow-card) !important;
}

html[data-theme="cinza"] #page-acompanhamento .acomp-filter-panel :where(label, .acomp-filter-prefix) {
    color: var(--nuv-text-on-header-soft) !important;
}

html[data-theme="cinza"] #page-acompanhamento :where(
    .acomp-search,
    .acomp-filter-select,
    .acomp-filter-control,
    .acomp-filter-control .enc-select-trigger
) {
    background-color: rgba(222, 235, 242, .14) !important;
    border-color: var(--nuv-line-on-header) !important;
    color: var(--nuv-text-on-header) !important;
    box-shadow: inset 0 0.0625rem 0.125rem rgba(5, 25, 38, .18) !important;
}

html[data-theme="cinza"] #page-acompanhamento :where(
    .acomp-search,
    .acomp-filter-select,
    .acomp-filter-control .enc-select-trigger
):focus,
html[data-theme="cinza"] #page-acompanhamento :where(
    .acomp-search,
    .acomp-filter-select,
    .acomp-filter-control .enc-select-trigger
):focus-visible {
    outline: none !important;
    border-color: rgba(231, 243, 248, .74) !important;
    box-shadow: 0 0 0 0.1875rem rgba(218, 236, 244, .34) !important;
}

html[data-theme="cinza"] #page-acompanhamento :where(
    .acomp-ticket-card,
    .acomp-kpi-card
):hover {
    background-color: var(--nuv-surface-hover) !important;
    border-color: var(--nuv-line-strong) !important;
    box-shadow: inset 0 0 0 0.0625rem var(--nuv-line), var(--nuv-shadow-raised) !important;
}

html[data-theme="cinza"] #page-acompanhamento :where(
    .acomp-kpi-value,
    .acomp-kcard-nm,
    .acomp-kcard-assunto,
    .acomp-results-title
) {
    color: var(--nuv-text) !important;
}

html[data-theme="cinza"] #page-acompanhamento :where(
    .acomp-kpi-label,
    .acomp-kpi-hint,
    .acomp-kcard-bubble-label,
    .acomp-results-sub
) {
    color: var(--nuv-text-soft) !important;
}

html[data-theme="cinza"] #page-acompanhamento .acomp-modal-backdrop {
    background-color: rgba(7, 25, 38, .58) !important;
}

html[data-theme="cinza"] #page-acompanhamento .acomp-modal-dialog {
    background-color: var(--nuv-surface-parent) !important;
    border-color: var(--nuv-line) !important;
    color: var(--nuv-text) !important;
    box-shadow: inset 0 0 0 0.0625rem var(--nuv-line-subtle), var(--nuv-shadow-popover) !important;
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme="cinza"] #page-dashboard .dash2 *,
    html[data-theme="cinza"] #page-acompanhamento * {
        transition: none !important;
    }
}
