/* Hash: 6486f78bf8412240c6e10e7c4027919d: 8e171bda1389bf6a88fbb32757b77fff | e3fe6d057f44794ab6098de4ada86d80: 4f6a086bc020299bc1605cd6b8ac1cde */
/* Bridge Fiscal panel. Palette of the Bridge Fiscal logo (blue). */
/*
 * Bridge Fiscal — tema do painel e gráficos.
 * Paleta da marca (bridgefiscal.com.br): azul royal #1769e8, ciano #20c4f4, midnight #0b1730, cinza gelo #f3f5f7,
 * ardósia #475569, linha #dde5f0 e verde #0f7a43 (estado "bom"); vermelho #c00000 só para erro/rejeição.
 * Séries dos gráficos (contraste ≥ 3:1 sobre branco): azul #1b4db5 e ciano #0e94be.
 * Sem estilo inline: a CSP do painel só aceita folhas de estilo do próprio servidor e do jsDelivr.
 */
/* Geist e Geist Mono (Vercel, licença SIL OFL 1.1 em fonts/OFL.txt), variáveis: pesos 100 a 900. Servidas daqui
   porque a CSP não permite o Google Fonts. */
@font-face {
    font-family: "Geist";
    src: url("fonts/Geist-Variable.woff2") format("woff2");
    font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Geist Mono";
    src: url("fonts/GeistMono-Variable.woff2") format("woff2");
    font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
    --bs-font-sans-serif: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-font-monospace: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --bs-body-font-family: var(--bs-font-sans-serif);
    --af-primary: #1769e8;
    --af-primary-deep: #1258c4;
    --af-accent: #20c4f4;
    --af-navy-950: #0b1730;
    --af-navy-900: #101e3c;
    --af-navy-800: #172a4f;
    --af-navy-700: #1f3a66;
    --af-ink: #0b1730;
    --af-ink-soft: #475569;
    --af-line: #dde5f0;
    --af-line-strong: #b7c4d8;
    --af-paper: #ffffff;
    --af-paper-warm: #f3f5f7;

    /* gráficos: séries (identidade) e situação (estado) */
    --af-s1: #1b4db5;
    --af-s2: #0e94be;
    --af-good: #0f7a43;
    --af-warn: #c99a00;
    --af-crit: #c00000;
    --af-neutral: #8794a8;
    --af-serious: #8a0000;
    --af-pending: #b7c4d8;
    --af-track: #e8eef6;
    --af-surface: #ffffff;

    --bs-primary: #1769e8;
    --bs-primary-rgb: 23, 105, 232;
    --bs-link-color: #1b4db5;
    --bs-link-color-rgb: 27, 77, 181;
    --bs-link-hover-color: #0b3f94;
    --bs-link-hover-color-rgb: 138, 0, 0;
    --bs-body-color: #0b1730;
    --bs-body-color-rgb: 29, 16, 18;
    --bs-secondary-color: #475569;
    --bs-border-color: #dde5f0;
    --bs-tertiary-bg: #f3f5f7;
    --bs-tertiary-bg-rgb: 250, 246, 241;
    --bs-focus-ring-color: rgba(23, 105, 232, .2);
}

body { background-color: var(--af-paper-warm); color: var(--af-ink); font-feature-settings: "ss01"; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { letter-spacing: -.02em; font-weight: 600; }
/* Geist Mono: números, chaves de acesso, códigos e valores tabulares */
code, kbd, pre, samp, .font-monospace, .af-mono, .af-stat-value, .ch-tick, .ch-hvalue, .ch-tip, .af-data-table table, .af-period a {
    font-family: var(--bs-font-monospace);
}
code { color: var(--af-s1); }

/* ---- Bootstrap na cor da marca ---- */
.btn-primary {
    --bs-btn-bg: var(--af-primary); --bs-btn-border-color: var(--af-primary);
    --bs-btn-hover-bg: var(--af-primary-deep); --bs-btn-hover-border-color: var(--af-primary-deep);
    --bs-btn-active-bg: var(--af-primary-deep); --bs-btn-active-border-color: var(--af-primary-deep);
    --bs-btn-disabled-bg: var(--af-primary); --bs-btn-disabled-border-color: var(--af-primary);
    --bs-btn-focus-shadow-rgb: 23, 105, 232;
}
.btn-outline-primary {
    --bs-btn-color: var(--af-primary); --bs-btn-border-color: var(--af-primary);
    --bs-btn-hover-bg: var(--af-primary); --bs-btn-hover-border-color: var(--af-primary);
    --bs-btn-active-bg: var(--af-primary-deep); --bs-btn-active-border-color: var(--af-primary-deep);
    --bs-btn-focus-shadow-rgb: 23, 105, 232;
}
/* Secondary (outlined) buttons: dark text and a visible border, so they never look disabled; brand red on hover.
   Uses the theme tokens, so the dark theme gets light text automatically. */
.btn-outline-secondary {
    --bs-btn-color: var(--af-ink); --bs-btn-border-color: var(--af-ink-soft); --bs-btn-bg: var(--af-surface);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--af-s1); --bs-btn-hover-border-color: var(--af-s1);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--af-s1); --bs-btn-active-border-color: var(--af-s1);
    --bs-btn-focus-shadow-rgb: 23, 105, 232; font-weight: 500;
}
.btn-outline-secondary .bi { color: var(--af-s1); }
.btn-outline-secondary:hover .bi, .btn-outline-secondary:focus-visible .bi, .btn-outline-secondary:active .bi { color: inherit; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #8db6f5;
    box-shadow: 0 0 0 .25rem rgba(23, 105, 232, .15);
}
.form-check-input:checked { background-color: var(--af-primary); border-color: var(--af-primary); }
.pagination {
    --bs-pagination-color: var(--af-s1);
    --bs-pagination-hover-color: var(--af-primary-deep);
    --bs-pagination-active-bg: var(--af-primary);
    --bs-pagination-active-border-color: var(--af-primary);
    --bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(23, 105, 232, .15);
}
.card { --bs-card-border-color: var(--af-line); --bs-card-cap-bg: #f6f8fb; border-radius: 12px; }

/* ---- Estrutura: menu lateral ---- */
.af-skip { position: absolute; z-index: 1100; top: .5rem; left: .5rem; background: #fff; padding: .5rem .75rem; border-radius: 8px; }

.af-brand {
    display: flex; align-items: center; gap: .55rem;
    color: #fff; text-decoration: none; font-size: 1.05rem; letter-spacing: -.01em;
}
.af-brand:hover { color: #fff; }
.af-brand strong { color: var(--af-accent); font-weight: 700; }
.af-brand-mark {
    display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
    background: var(--af-primary); color: #fff; font-size: 1rem;
}

.af-topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem 1rem; background: var(--af-navy-950);
}
.af-menu-btn { color: #fff; font-size: 1.5rem; line-height: 1; padding: .25rem .5rem; border: 0; }
.af-menu-btn:hover, .af-menu-btn:focus-visible { color: var(--af-accent); }

.af-shell { display: flex; min-height: 100vh; }
.af-main { flex: 1 1 auto; min-width: 0; }
.af-content { padding: 1.5rem 1rem 2.5rem; max-width: 1440px; }

.af-sidebar { --bs-offcanvas-width: 264px; --bs-offcanvas-bg: var(--af-navy-950); --bs-offcanvas-color: #fff; }
.af-sidebar .af-sidebar-body {
    display: flex; flex-direction: column; gap: 1.25rem;
    padding: 1rem .875rem 1.25rem; min-height: 100%;
}

@media (min-width: 992px) {
    .af-sidebar-wrap {
        flex: 0 0 248px; width: 248px;
        position: sticky; top: 0; height: 100vh; overflow-y: auto;
        background: linear-gradient(180deg, var(--af-navy-950) 0%, var(--af-navy-900) 100%);
        border-right: 1px solid rgba(255, 255, 255, .06);
    }
    .af-sidebar, .af-sidebar .af-sidebar-body { height: 100%; }
    .af-sidebar .af-sidebar-body { padding: 1.25rem 1rem; }
    .af-content { padding: .75rem 2rem 3rem; }
}

/* O .nav do Bootstrap tem flex-wrap: wrap. Com flex-column e a altura limitada pela animação do collapse, os itens que não cabem
   quebravam para uma 2ª coluna (parecia uma linha que depois "caía" em coluna, item a item). Sem quebra: sempre uma coluna. */
.af-nav { gap: 2px; flex-wrap: nowrap; }
.af-nav .nav-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .55rem .75rem; border-radius: 10px;
    color: rgba(255, 255, 255, .74); font-size: .925rem;
    border-left: 3px solid transparent;
}
.af-nav .nav-link .bi { font-size: 1.05rem; width: 1.25rem; text-align: center; }
.af-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.af-nav .nav-link:focus-visible { outline: 2px solid var(--af-accent); outline-offset: 1px; }
.af-nav .nav-link.active {
    color: #fff; background: rgba(255, 255, 255, .1);
    border-left-color: var(--af-accent);
}
.af-nav .nav-link.active .bi { color: var(--af-accent); }

.af-user {
    margin-top: auto; padding: .875rem; border-radius: 12px;
    background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08);
    color: #fff; font-size: .875rem;
}
.af-user-name { font-weight: 600; margin-bottom: .25rem; overflow-wrap: anywhere; }
.af-role { background: rgba(32, 196, 244, .16); color: var(--af-accent); font-weight: 500; }
.af-user-actions { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .75rem; }
.af-btn-ghost {
    --bs-btn-color: rgba(255, 255, 255, .8); --bs-btn-border-color: rgba(255, 255, 255, .18);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: rgba(255, 255, 255, .08); --bs-btn-hover-border-color: rgba(255, 255, 255, .3);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: rgba(255, 255, 255, .12);
}
.af-sidebar-foot { font-size: .75rem; color: rgba(255, 255, 255, .45); }

/* barra do desktop com o botão de ocultar o menu (a classe af-menu-oculto fica no <html>) */
.af-deskbar {
    position: sticky; top: 0; z-index: 1010;
    align-items: center; gap: .75rem;
    padding: .75rem 2rem .5rem; background: var(--af-paper-warm);
}
.af-toggle {
    display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0;
    border-radius: 10px; border: 1px solid var(--af-line); background: #fff;
    color: var(--af-ink-soft); font-size: 1.1rem;
}
.af-toggle:hover, .af-toggle:focus-visible { color: var(--af-primary); border-color: var(--af-line-strong); background: #fff; }
.af-deskbar-brand { display: none; color: var(--af-ink); text-decoration: none; font-weight: 500; }
.af-deskbar-brand strong { color: var(--af-primary); }
.af-menu-oculto .af-deskbar-brand { display: inline; }
@media (min-width: 992px) {
    /* Sem animação: animar a margem refaz o layout da página inteira a cada quadro (tabelas e gráficos) e dá a sensação de travar. */
    .af-menu-oculto .af-sidebar-wrap { margin-left: -248px; visibility: hidden; }
}

/* Botões expansíveis (Bootstrap collapse): a altura animada em 0,35 s parecia lenta; 0,15 s mantém a transição e responde na hora. */
.collapsing { transition: height .15s ease; }
@media (prefers-reduced-motion: reduce) {
    .collapsing { transition: none; }
}

/* Linhas clicáveis das listas (tr[data-af-href], panel.js): a linha inteira abre a página do registro. */
tr[data-af-href] { cursor: pointer; }
tr[data-af-href]:hover > * { --bs-table-bg-state: var(--bs-table-hover-bg); }

/* ---- Documentos ---- */
.af-col-model { min-width: 5.5rem; white-space: nowrap; }
/* destinatário: pessoa jurídica (azul) e pessoa física (verde), só para diferenciar */
.af-pj { color: #0d6efd; }
.af-pf { color: #198754; }
/* situação: código + mensagem curta; a mensagem completa vai no title */
.af-err { max-width: 11rem; cursor: help; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
/* arquivos: um botão embaixo do outro, para a coluna não alargar a grade */
.af-files { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.af-docs > :not(caption) > * > * { padding: .45rem .7rem; }
/* filtros numa linha só no desktop: modelo e datas com largura fixa (≈ metade), empresa e chave dividem o resto */
@media (min-width: 1200px) {
    .af-f-model { width: 7.5rem; }
    .af-f-date { width: 8.75rem; }
}

/* ---- Dashboard ---- */
.af-period { display: inline-flex; padding: 3px; border-radius: 10px; background: #fff; border: 1px solid var(--af-line); }
.af-period a {
    padding: .3rem .75rem; border-radius: 7px; font-size: .8125rem;
    color: var(--af-ink-soft); text-decoration: none;
}
.af-period a:hover { color: var(--af-ink); background: var(--af-paper-warm); }
.af-period a.active { background: var(--af-navy-950); color: #fff; }

.af-stat .af-stat-label { font-size: .8125rem; color: var(--af-ink-soft); }
.af-stat .af-stat-value { font-size: 1.75rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }

.af-chart .card-body { padding: 1rem 1.125rem 1.125rem; }
.af-chart { position: relative; }
.af-chart-title { font-size: .95rem; font-weight: 600; margin: 0; padding-right: 2.4rem; }
/* gráficos interativos: expandir, e marcas que abrem a lista correspondente */
.af-chart-expand, .af-chart-close {
    position: absolute; top: .75rem; right: .75rem; width: 2rem; height: 2rem; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid var(--af-line); background: var(--af-surface); color: var(--af-ink-soft); font-size: .8rem;
    transition: color .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.af-chart-expand:hover, .af-chart-expand:focus-visible, .af-chart-close:hover, .af-chart-close:focus-visible {
    color: var(--af-s1); border-color: var(--af-s1); transform: scale(1.08); box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.af-chart-close { top: 1rem; right: 1rem; width: 2.3rem; height: 2.3rem; font-size: 1rem; z-index: 2; }
.ch-link { cursor: pointer; }
.ch-link:focus-visible { outline: 2px solid var(--af-s1); outline-offset: 2px; }
.af-chart-dialog {
    width: min(1120px, 94vw); max-height: 92vh; padding: 0; border: 0; border-radius: 20px; overflow: auto; color: var(--af-ink);
    background: var(--af-surface); box-shadow: 0 30px 90px rgba(20, 8, 10, .45); animation: af-dialog-in .22s ease-out;
}
.af-chart-dialog::backdrop { background: rgba(20, 8, 10, .55); backdrop-filter: blur(3px); }
.af-chart-expanded .card-body { padding: 1.6rem 1.9rem 1.8rem; }
.af-chart-expanded .af-chart-title { font-size: 1.2rem; }
.af-chart-expanded .af-chart-sub { font-size: .9rem; }
.af-chart-hint { margin: 1rem 0 0; font-size: .82rem; color: var(--af-ink-soft); }
.af-chart-hint .bi { color: var(--af-s1); }
.af-chart-expanded .ch-donut-wrap { max-width: 360px; }
.af-chart-expanded .ch-legend-list { font-size: .9rem; }
@keyframes af-dialog-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .af-chart-dialog { animation: none; } .af-chart-expand, .af-chart-close { transition: none; } }
/* Dashboard personalizável: barra "Personalizar", ferramentas de cada cartão e modo de edição */
.af-dash-edit.is-active { background: var(--af-s1); border-color: var(--af-s1); color: #fff; }
.af-dash-edit.is-active .bi { color: #fff; }
.af-dash-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; padding: .8rem 1rem; margin-bottom: 1.5rem;
    border: 1px dashed var(--af-s1); border-radius: 14px; background: rgba(27, 77, 181, .06);
}
.af-dash-bar[hidden] { display: none; }
.af-dash-bar-main { display: flex; flex-direction: column; gap: .15rem; flex: 1 1 22rem; min-width: 0; }
.af-dash-help { font-size: .8rem; color: var(--af-ink-soft); }
.af-dash-hidden { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; flex: 1 1 14rem; font-size: .8rem; }
.af-dash-hidden-label { color: var(--af-ink-soft); }
.af-dash-chip {
    display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
    border: 1px solid var(--af-s1); background: var(--af-surface); color: var(--af-s1); transition: .15s;
}
.af-dash-chip[hidden], .af-dash-none[hidden] { display: none; }
.af-dash-chip:hover, .af-dash-chip:focus-visible { background: var(--af-s1); color: #fff; }
.af-dash-none { color: var(--af-ink-soft); }
.af-dash-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.af-dash-status { font-size: .78rem; color: var(--af-good, #198754); min-width: 6rem; text-align: right; }
.af-dash-status.is-bad { color: var(--af-crit, #c00000); }
.af-widget { position: relative; }
.af-widget-body { height: 100%; }
.af-widget-tools {
    display: none; position: absolute; top: -1.15rem; left: 50%; transform: translateX(-50%); z-index: 6; gap: .1rem; padding: .15rem .3rem;
    background: var(--af-surface); border: 1px solid var(--af-s1); border-radius: 999px; box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
}
.af-dash.is-editing { padding-top: .8rem; }
.af-dash.is-editing .af-chart-expand { visibility: hidden; }
.af-dash.is-editing .af-widget-tools { display: flex; }
.af-widget-btn {
    width: 1.9rem; height: 1.9rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%;
    background: transparent; color: var(--af-ink-soft); font-size: .95rem; transition: .12s;
}
.af-widget-btn:hover, .af-widget-btn:focus-visible { background: var(--af-paper-warm); color: var(--af-s1); }
.af-widget-grip { cursor: grab; touch-action: none; } /* touch-action: the finger drags the card instead of scrolling the page */
.af-widget-grip:active { cursor: grabbing; }
.af-dash.is-editing .af-widget-body { pointer-events: none; outline: 2px dashed var(--af-line-strong, var(--af-line)); outline-offset: 3px; border-radius: 16px; }
.af-widget.is-dragging { opacity: .45; }
.af-widget.is-new .af-widget-body { animation: af-widget-new 1.4s ease-out; }
@keyframes af-widget-new { 0% { box-shadow: 0 0 0 0 rgba(27, 77, 181, .55); } 100% { box-shadow: 0 0 0 18px rgba(27, 77, 181, 0); } }
@media (prefers-reduced-motion: reduce) { .af-widget.is-new .af-widget-body { animation: none; } }
/* KPIs: o cartão inteiro abre a lista */
.af-kpi { transition: box-shadow .15s, transform .15s; }
.af-kpi:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .1); transform: translateY(-2px); }
.af-kpi:has(.af-kpi-link:focus-visible) { outline: 2px solid var(--af-s1); outline-offset: 2px; }
.af-chart-sub { font-size: .8125rem; color: var(--af-ink-soft); margin: .125rem 0 .75rem; }
.af-chart-empty { font-size: .875rem; color: var(--af-ink-soft); padding: 2.5rem 0; text-align: center; }

/* ---- Gráficos (SvgChart) ---- */
.ch-s1 { fill: var(--af-s1); background-color: var(--af-s1); }
.ch-s2 { fill: var(--af-s2); background-color: var(--af-s2); }
.ch-good { fill: var(--af-good); background-color: var(--af-good); }
.ch-warn { fill: var(--af-warn); background-color: var(--af-warn); }
.ch-crit { fill: var(--af-crit); background-color: var(--af-crit); }
.ch-neutral { fill: var(--af-neutral); background-color: var(--af-neutral); }
.ch-serious { fill: var(--af-serious); background-color: var(--af-serious); }
.ch-pending { fill: var(--af-pending); background-color: var(--af-pending); }

/* rosca (situação) */
.ch-donut-wrap { max-width: 205px; margin: 0 auto; }
.ch-donut { display: block; width: 100%; height: auto; overflow: visible; }
.ch-slice path { stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
.ch-slice { transition: opacity .12s ease; }
.ch-donut .ch-plot:hover .ch-slice { opacity: .5; }
.ch-donut .ch-plot .ch-slice:hover { opacity: 1; }
.ch-callout line { stroke: var(--af-crit); stroke-width: 1.5; }
.ch-callout text { fill: var(--af-ink); font-size: 12px; font-weight: 600; }
.ch-center-value { fill: var(--af-ink); font-size: 30px; font-weight: 600; font-family: var(--bs-font-monospace); }
.ch-center-label { fill: var(--af-ink); font-size: 12px; font-weight: 500; }
.ch-center-sub { fill: var(--af-ink-soft); font-size: 10.5px; }

.af-cta {
    display: flex; align-items: flex-start; gap: .6rem; margin: .75rem 0 .5rem;
    padding: .65rem .8rem; border-radius: 10px;
    background: #e8f1fe; border: 1px solid #bfd6f7; color: var(--af-ink);
    font-size: .8125rem; line-height: 1.35; text-decoration: none;
}
.af-cta .bi-exclamation-triangle-fill { color: var(--af-crit); font-size: 1rem; line-height: 1.2; }
.af-cta .bi-arrow-right { margin-left: auto; color: var(--af-crit); align-self: center; }
.af-cta:hover { background: #d6e6fc; color: var(--af-ink); }
.af-cta:hover span { text-decoration: underline; }

/* legenda em colunas: a rosca fica compacta e o cartão não estica o gráfico ao lado */
.ch-legend-list { list-style: none; margin: .25rem 0 0; padding: 0; font-size: .8125rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(8.75rem, 1fr)); column-gap: .9rem; }
.ch-legend-list a {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .4rem;
    padding: .25rem .375rem; margin: 0 -.375rem; border-radius: 8px; color: var(--af-ink); text-decoration: none;
}
.ch-legend-list a:hover { background: var(--af-paper-warm); }
.ch-legend-list .ch-key { margin: 0; }
.ch-legend-list .is-hl a { font-weight: 600; }
.ch-legend-value, .ch-legend-pct { text-align: right; font-family: var(--bs-font-monospace); font-variant-numeric: tabular-nums; }
.ch-legend-pct { color: var(--af-ink-soft); display: none; } /* a porcentagem fica na dica e no gráfico expandido */
.af-chart-expanded .ch-legend-list a { grid-template-columns: auto minmax(0, 1fr) auto 3.4rem; }
.af-chart-expanded .ch-legend-pct { display: block; }

/* colunas flex do Bootstrap têm min-width: auto; sem isto o SVG largo empurra a página no celular */
.af-content .row > * { min-width: 0; }
.ch-wrap { overflow-x: auto; max-width: 100%; }
.ch-svg { display: block; width: 100%; min-width: 420px; height: auto; overflow: visible; }
.ch-grid { stroke: var(--af-line); stroke-width: 1; }
.ch-baseline { stroke: var(--af-line-strong); stroke-width: 1; }
.ch-tick { fill: var(--af-ink-soft); font-size: 11px; font-variant-numeric: tabular-nums; }
.ch-hit { fill: transparent; }
.ch-col { transition: opacity .12s ease; }
.ch-plot:hover .ch-col { opacity: .55; }
.ch-plot .ch-col:hover { opacity: 1; }
.ch-line { fill: none; stroke: var(--af-s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill: var(--af-s1); fill-opacity: .1; }
.ch-solo { fill: var(--af-s1); }
.ch-cross { stroke: var(--af-line-strong); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.ch-dot { fill: var(--af-s1); stroke: #fff; stroke-width: 2; opacity: 0; }
.ch-pt:hover .ch-cross, .ch-pt:hover .ch-dot { opacity: 1; }

.ch-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .8125rem; color: var(--af-ink-soft); margin-bottom: .5rem; }
.ch-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .375rem; vertical-align: -1px; }

.ch-hbars { display: flex; flex-direction: column; gap: .125rem; }
.ch-hrow {
    display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr) auto; gap: .625rem; align-items: center;
    padding: .3rem .375rem; margin: 0 -.375rem; border-radius: 8px;
    font-size: .8125rem; color: var(--af-ink); text-decoration: none;
}
a.ch-hrow:hover { background: var(--af-paper-warm); color: var(--af-ink); }
a.ch-hrow:hover .ch-hlabel { text-decoration: underline; }
.ch-hlabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-hbar { display: block; width: 100%; height: 12px; border-radius: 4px; overflow: hidden; }
.ch-track { fill: var(--af-track); }
.ch-hvalue { min-width: 2.75rem; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.ch-tip {
    position: fixed; z-index: 1090; pointer-events: none; max-width: 280px;
    padding: .45rem .6rem; border-radius: 8px;
    background: var(--af-navy-950); color: #fff; font-size: .75rem; line-height: 1.4;
    white-space: pre-line; font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 4px rgb(29 16 18 / 8%), 0 12px 28px -8px rgb(29 16 18 / 35%);
    opacity: 0; transition: opacity .08s ease;
}
.ch-tip.show { opacity: 1; }

.af-data-table summary { font-size: .8125rem; color: var(--af-s1); cursor: pointer; }
.af-data-table table { font-size: .8125rem; font-variant-numeric: tabular-nums; }

@media (forced-colors: active) {
    .ch-s1, .ch-s2, .ch-good, .ch-warn, .ch-crit, .ch-neutral, .ch-serious, .ch-pending, .ch-solo, .ch-dot { fill: CanvasText; }
    .ch-line { stroke: CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
    .ch-col, .ch-tip, .ch-slice { transition: none; }
}

/* ===== Menu lateral: tema e tour ===== */
.af-side-tools { margin-top: auto; display: flex; flex-direction: column; gap: .375rem; }
.af-side-tools + .af-user { margin-top: 0; }
/* botões de ponta a ponta na largura do menu */
.af-side-btn {
    display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem .75rem; border-radius: 10px; text-align: left;
    border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .04); color: rgba(255, 255, 255, .85); font-size: .8125rem;
}
.af-side-btn:hover, .af-side-btn:focus-visible { color: #fff; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); }
.af-side-btn .bi { color: var(--af-accent); }

/* ===== Tour guiado ===== */
.af-tour-block { position: fixed; inset: 0; z-index: 1065; }
.af-tour-spot {
    position: fixed; z-index: 1066; border-radius: 10px; pointer-events: none;
    box-shadow: 0 0 0 3px var(--af-accent), 0 0 0 9999px rgba(5, 10, 24, .62);
    transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease;
}
.af-tour-spot.is-center { width: 0; height: 0; box-shadow: 0 0 0 9999px rgba(5, 10, 24, .62); }
.af-tour-pop {
    position: fixed; z-index: 1070; width: min(340px, calc(100vw - 24px));
    background: var(--af-surface); color: var(--af-ink); border: 1px solid var(--af-line);
    border-radius: 14px; padding: 1rem 1.1rem .9rem; box-shadow: 0 2px 4px rgb(0 0 0 / 10%), 0 24px 48px -12px rgb(0 0 0 / 45%);
}
.af-tour-pop h2 { font-size: 1rem; margin: 0 0 .35rem; display: flex; align-items: center; gap: .45rem; }
.af-tour-pop h2 .bi { color: var(--af-primary); }
.af-tour-pop p { font-size: .875rem; margin: 0 0 .85rem; color: var(--af-ink-soft); line-height: 1.45; }
.af-tour-foot { display: flex; align-items: center; gap: .4rem; }
.af-tour-count { font-family: var(--bs-font-monospace); font-size: .75rem; color: var(--af-ink-soft); margin-right: auto; }
.af-tour-skip { font-size: .8125rem; }
@media (prefers-reduced-motion: reduce) { .af-tour-spot { transition: none; } }

/* ===== Tema escuro (as cores dos gráficos foram validadas contra o fundo #101c36) ===== */
:root[data-bs-theme="dark"] {
    --af-ink: #e6ecf5;
    --af-ink-soft: #a9b6cb;
    --af-line: #24334d;
    --af-line-strong: #34466a;
    --af-paper: #101c36;
    --af-paper-warm: #0b1428;
    --af-surface: #101c36;
    --af-track: #17274a;
    --af-s1: #5b9bff;
    --af-s2: #0e94be;
    --af-good: #2f9e66;
    --af-warn: #c99a00;
    --af-crit: #e5484d;
    --af-serious: #a8434d;
    --af-neutral: #8a9ab5;
    --af-pending: #52627f;

    --bs-body-bg: #0b1428;
    --bs-body-bg-rgb: 11, 20, 40;
    --bs-body-color: #e6ecf5;
    --bs-body-color-rgb: 230, 236, 245;
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: #a9b6cb;
    --bs-secondary-bg: #101c36;
    --bs-tertiary-bg: #0f1a31;
    --bs-tertiary-bg-rgb: 15, 26, 49;
    --bs-border-color: #24334d;
    --bs-link-color: #7db2ff;
    --bs-link-color-rgb: 125, 178, 255;
    --bs-link-hover-color: #a8ccff;
    --bs-link-hover-color-rgb: 168, 204, 255;
    color-scheme: dark;
}
[data-bs-theme="dark"] .card { --bs-card-bg: var(--af-surface); --bs-card-cap-bg: #14223f; --bs-card-border-color: var(--af-line); }
[data-bs-theme="dark"] .bg-white { background-color: var(--af-surface) !important; }
[data-bs-theme="dark"] .table { --bs-table-bg: var(--af-surface); --bs-table-color: var(--af-ink); --bs-table-border-color: var(--af-line); }
[data-bs-theme="dark"] .af-period, [data-bs-theme="dark"] .af-toggle, [data-bs-theme="dark"] .af-skip { background: var(--af-surface); }
[data-bs-theme="dark"] .af-toggle:hover, [data-bs-theme="dark"] .af-toggle:focus-visible { background: var(--af-surface); color: #7db2ff; }
[data-bs-theme="dark"] .af-period a.active { background: var(--af-ink); color: #0b1730; }
[data-bs-theme="dark"] .af-period a:hover, [data-bs-theme="dark"] a.ch-hrow:hover,
[data-bs-theme="dark"] .ch-legend-list a:hover { background: rgba(255, 255, 255, .05); }
[data-bs-theme="dark"] .ch-slice path, [data-bs-theme="dark"] .ch-dot { stroke: var(--af-surface); }
[data-bs-theme="dark"] .af-cta { background: rgba(229, 72, 77, .12); border-color: rgba(229, 72, 77, .35); }
[data-bs-theme="dark"] .af-cta:hover { background: rgba(229, 72, 77, .18); }
[data-bs-theme="dark"] .ch-tip { background: #060c1c; border: 1px solid var(--af-line-strong); }
[data-bs-theme="dark"] .af-tour-pop h2 .bi { color: #7db2ff; }

/* ===== Estilo de dashboard (referência: cartões com rótulo em maiúsculas, ícone, variação e mini-indicadores) ===== */
.card { border-radius: 14px; box-shadow: 0 1px 2px rgb(16 24 40 / 4%); }
.af-page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.af-page-head h1 { font-size: 1.65rem; margin: 0; }
.af-page-head p { margin: .2rem 0 0; font-size: .8125rem; color: var(--af-ink-soft); }
.af-head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.af-pill {
    display: inline-flex; align-items: center; gap: .5rem; height: 36px; padding: 0 .85rem;
    border: 1px solid var(--af-line); border-radius: 10px; background: var(--af-surface);
    font-size: .8125rem; font-family: var(--bs-font-monospace); color: var(--af-ink);
}
.af-pill .bi { color: var(--af-ink-soft); }
/* Dashboard: period with dates opens a small calendar form (De / Até) */
.af-range { position: relative; }
.af-range > summary { list-style: none; cursor: pointer; }
.af-range > summary::-webkit-details-marker { display: none; }
.af-range > summary:hover, .af-pill.is-active { border-color: var(--af-s1); color: var(--af-s1); }
.af-pill.is-active .bi, .af-range > summary:hover .bi { color: var(--af-s1); }
.af-range-caret { font-size: .7rem; transition: transform .15s; }
.af-range[open] .af-range-caret { transform: rotate(180deg); }
.af-range-form {
    position: absolute; right: 0; top: calc(100% + .4rem); z-index: 1040; width: 21rem; max-width: calc(100vw - 2rem);
    display: flex; flex-wrap: wrap; align-items: end; gap: .5rem .75rem; padding: .85rem;
    background: var(--af-surface); border: 1px solid var(--af-line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}
.af-range-form > div { flex: 1 1 8.5rem; }
.af-range-form > p { flex-basis: 100%; }
/* "Período" field of the lists: a select-looking trigger that opens the range calendar */
.af-range-field > summary.af-range-trigger { display: block; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-range-field > summary.af-range-trigger::-webkit-details-marker { display: none; }
.af-range-field .af-range-form { left: 0; right: auto; }
.af-range-field.af-range-end .af-range-form { left: auto; right: 0; }
.af-range-field .af-range-form:not(.has-picker) { width: 18rem; }
/* Range calendar (two months, airline style) */
.af-range-form.has-picker { width: auto; max-width: calc(100vw - 2rem); display: block; }
.af-cal { position: relative; }
.af-cal-head { position: absolute; left: 0; right: 0; top: -.15rem; display: flex; justify-content: space-between; pointer-events: none; }
.af-cal-nav { pointer-events: auto; border: 0; background: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; color: var(--af-ink); }
.af-cal-nav:hover:not(:disabled) { background: var(--af-paper-warm, rgba(0, 0, 0, .05)); color: var(--af-s1); }
.af-cal-nav:disabled { opacity: .3; }
.af-cal-months { display: flex; gap: 1.5rem; }
.af-cal-month { width: 16.5rem; }
.af-cal-title { text-align: center; font-weight: 600; line-height: 2rem; margin-bottom: .35rem; }
.af-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: .15rem; }
.af-cal-wd { text-align: center; font-size: .75rem; color: var(--af-ink-soft); text-transform: capitalize; padding-bottom: .25rem; }
.af-cal-day { height: 2.3rem; border: 0; background: none; color: var(--af-ink); font-variant-numeric: tabular-nums; border-radius: 0; }
.af-cal-day:hover:not(:disabled) { outline: 2px solid var(--af-s1); outline-offset: -2px; border-radius: 50%; }
.af-cal-day:disabled { color: var(--af-ink-soft); opacity: .35; cursor: not-allowed; }
.af-cal-day.is-today { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.af-cal-day.in-range { background: rgba(23, 105, 232, .1); }
.af-cal-day.is-start, .af-cal-day.is-end, .af-cal-day.is-hover { background: var(--af-s1); color: #fff; border-radius: 50%; font-weight: 600; }
.af-cal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--af-line); }
.af-cal-summary { margin-right: auto; font-weight: 500; }
.af-range-form.has-picker > p { margin-top: .5rem; }
@media (max-width: 640px) {
    .af-cal-month + .af-cal-month { display: none; }
    .af-cal-month { width: min(16.5rem, calc(100vw - 4rem)); }
}
.af-head-tools .af-period { height: 36px; align-items: center; }

.af-kpi .card-body { padding: 1rem 1.15rem .95rem; }
.af-kpi-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.af-kpi-label { font-size: .6875rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 600; color: var(--af-ink-soft); padding-top: .3rem; }
.af-chip { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 1rem; }
.af-chip-good { background: rgb(15 122 67 / 10%); color: var(--af-good); }
.af-chip-bad { background: rgb(192 0 0 / 8%); color: var(--af-crit); }
.af-chip-warn { background: rgb(201 154 0 / 14%); color: #8f6d00; }
.af-chip-info { background: rgb(27 77 181 / 8%); color: var(--af-s1); }
.af-chip-neutral { background: var(--af-track); color: var(--af-ink-soft); }
.af-kpi-value { font-family: var(--bs-font-monospace); font-size: 1.85rem; font-weight: 600; line-height: 1.15; margin: .35rem 0 .35rem; font-variant-numeric: tabular-nums; }
.af-kpi-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .75rem; color: var(--af-ink-soft); }
.af-delta { font-family: var(--bs-font-monospace); font-size: .6875rem; font-weight: 600; padding: .05rem .45rem; border-radius: 6px; }
.af-delta.is-good { background: rgb(15 122 67 / 12%); color: var(--af-good); }
.af-delta.is-bad { background: rgb(192 0 0 / 9%); color: var(--af-crit); }
.af-delta.is-neutral { background: var(--af-track); color: var(--af-ink-soft); }

.af-chart .card-body { padding: 1.15rem 1.25rem 1.2rem; }
.af-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.af-card-link { font-size: .8125rem; white-space: nowrap; text-decoration: none; padding-top: .1rem; }
.af-card-link:hover { text-decoration: underline; }
.af-ministats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem 1.25rem;
    margin-top: 1rem; padding-top: .95rem; border-top: 1px solid var(--af-line);
}
.af-ministat-label { font-size: .75rem; color: var(--af-ink-soft); }
.af-ministat-value { font-family: var(--bs-font-monospace); font-size: 1.05rem; font-weight: 600; margin-top: .1rem; }
.af-ministat-sub { font-size: .6875rem; color: var(--af-ink-soft); margin-top: .1rem; }

.ch-rank { list-style: none; margin: .25rem 0 0; padding: 0; }
.ch-rank-row {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; column-gap: .65rem; row-gap: .4rem;
    padding: .55rem .4rem .5rem; margin: 0 -.4rem; border-radius: 8px; color: var(--af-ink); text-decoration: none; font-size: .8125rem;
}
a.ch-rank-row:hover { background: var(--af-paper-warm); color: var(--af-ink); }
a.ch-rank-row:hover .ch-rank-label { text-decoration: underline; }
.ch-rank-pos { font-family: var(--bs-font-monospace); font-size: .75rem; color: var(--af-ink-soft); min-width: 1.6rem; }
.ch-rank-row .ch-key { margin: 0; border-radius: 99px; width: 8px; height: 8px; }
.ch-rank-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ch-rank-meta { font-family: var(--bs-font-monospace); font-size: .75rem; color: var(--af-ink-soft); }
.ch-rank-value { font-family: var(--bs-font-monospace); font-weight: 600; text-align: right; min-width: 3.2rem; }
.ch-rank-bar { grid-column: 1 / -1; display: block; width: 100%; height: 3px; border-radius: 3px; overflow: hidden; }

[data-bs-theme="dark"] .card { box-shadow: none; }
[data-bs-theme="dark"] .af-chip-warn { color: var(--af-warn); }
[data-bs-theme="dark"] .af-chip-info { background: rgb(210 76 90 / 14%); }
[data-bs-theme="dark"] .af-chip-good, [data-bs-theme="dark"] .af-delta.is-good { background: rgb(47 158 102 / 16%); }
[data-bs-theme="dark"] .af-chip-bad, [data-bs-theme="dark"] .af-delta.is-bad { background: rgb(229 72 77 / 14%); }
[data-bs-theme="dark"] a.ch-rank-row:hover { background: rgb(255 255 255 / 5%); }

/* ===== O mesmo estilo em todo o painel ===== */
:root { --af-surface-alt: #f6f8fb; --bs-border-radius: 10px; --bs-border-radius-sm: 8px; --bs-border-radius-lg: 14px; }
:root[data-bs-theme="dark"] { --af-surface-alt: #14223f; }
.af-content h1.h3 { font-size: 1.65rem; font-weight: 650; letter-spacing: -.02em; }
.af-page-head .btn { height: 36px; display: inline-flex; align-items: center; gap: .4rem; }
.af-head-tools .form-select { height: 36px; border-radius: 10px; }
.btn { font-weight: 500; }

/* cartões e cabeçalhos de cartão */
.af-content .card-header { background: transparent; border-bottom: 1px solid var(--af-line); font-weight: 600; font-size: .95rem; padding: .85rem 1.15rem; }
.af-content .card-body h2.h6 { font-size: .95rem; font-weight: 600; }
.af-filters { padding: .9rem 1rem 1rem; }

/* tabelas: soltas na página viram cartão; cabeçalho em maiúsculas pequenas, como os rótulos dos indicadores */
.af-content .table-responsive:not(.card .table-responsive) {
    background: var(--af-surface); border: 1px solid var(--af-line); border-radius: 14px; box-shadow: 0 1px 2px rgb(16 24 40 / 4%); margin-bottom: 1rem;
}
.af-content .table-responsive > .table { margin-bottom: 0; }
.af-content .table { --bs-table-bg: transparent; --bs-table-color: var(--af-ink); font-size: .875rem; }
.af-content .table > thead > tr > th {
    font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--af-ink-soft);
    background: var(--af-surface-alt); border-bottom: 1px solid var(--af-line); padding: .65rem .9rem; white-space: nowrap;
}
.af-content .table > tbody > tr > td, .af-content .table > tfoot > tr > td { padding: .6rem .9rem; border-color: var(--af-line); }
.af-content .table > tbody > tr:last-child > td { border-bottom-width: 0; }
.af-content .table > tfoot > tr > td { border-top: 1px solid var(--af-line-strong); border-bottom-width: 0; }

/* formulários */
.af-content .form-label { font-size: .8125rem; font-weight: 500; color: var(--af-ink-soft); }
.af-content .form-control, .af-content .form-select { border-color: var(--af-line-strong); }

/* selos suaves (como as variações dos indicadores) */
.badge { font-weight: 600; border-radius: 6px; padding: .32em .55em; letter-spacing: .01em; }
.badge.text-bg-success { background-color: rgb(15 122 67 / 12%) !important; color: var(--af-good) !important; }
.badge.text-bg-danger { background-color: rgb(192 0 0 / 9%) !important; color: var(--af-crit) !important; }
.badge.text-bg-warning { background-color: rgb(201 154 0 / 18%) !important; color: #7a5c00 !important; }
.badge.text-bg-info { background-color: rgb(27 77 181 / 9%) !important; color: var(--af-s1) !important; }
.badge.text-bg-secondary, .badge.text-bg-light { background-color: var(--af-track) !important; color: var(--af-ink-soft) !important; }
.badge.text-bg-dark { background-color: var(--af-ink) !important; color: var(--af-surface) !important; }
[data-bs-theme="dark"] .badge.text-bg-warning { color: var(--af-warn) !important; }
[data-bs-theme="dark"] .badge.text-bg-success { background-color: rgb(47 158 102 / 16%) !important; }
[data-bs-theme="dark"] .badge.text-bg-danger { background-color: rgb(229 72 77 / 14%) !important; }
[data-bs-theme="dark"] .badge.text-bg-info { background-color: rgb(210 76 90 / 14%) !important; }

/* alertas, abas e listas */
.alert { border-radius: 12px; font-size: .875rem; }
.af-content .nav-tabs { border-bottom-color: var(--af-line); }
.af-content .nav-tabs .nav-link { color: var(--af-ink-soft); font-weight: 500; }
.af-content .nav-tabs .nav-link.active { color: var(--af-ink); font-weight: 600; background: var(--af-surface); border-color: var(--af-line) var(--af-line) var(--af-surface); }
.af-content .list-group-item { border-color: var(--af-line); }
.af-content .breadcrumb { font-size: .8125rem; }
.af-content dl dt { font-weight: 500; color: var(--af-ink-soft); }

/* login */
body.bg-body-tertiary .card { border-radius: 16px; }
.af-head-tools .form-select { width: auto; min-width: 11rem; }
.af-head-tools label { margin: 0; }
/* cartões de número das outras telas no mesmo padrão dos indicadores do dashboard */
.af-stat .card-body { padding: .95rem 1.15rem !important; }
.af-stat .af-stat-label { font-size: .6875rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 600; color: var(--af-ink-soft); }
.af-stat .af-stat-value { font-size: 1.85rem; margin-top: .3rem; }
/* bloco do usuário acima dos botões do rodapé do menu (tema, tour, trocar senha, sair) */
.af-user + .af-side-tools { margin-top: .75rem; }
.af-user .af-role { margin-top: .15rem; }
a.af-side-btn { text-decoration: none; }

/* desktop: o botão de ocultar o menu fica na mesma linha do título (sem faixa própria), ganhando altura para os dados */
@media (min-width: 992px) {
    .af-main { position: relative; }
    .af-deskbar { position: absolute; top: 1rem; left: 2rem; padding: 0; background: transparent; z-index: 5; }
    .af-content { padding-top: 1rem; }
    .af-content > :first-child { margin-left: 52px; }
    .af-menu-oculto .af-deskbar-brand { display: none; }
}
.af-page-head { margin-bottom: .9rem; }
.af-page-head p { margin-top: .1rem; }
.af-filters { padding: .75rem 1rem .85rem; margin-bottom: .75rem !important; }

/* ===== Login e 2FA: caixa centralizada na tela e um pouco maior ===== */
.af-auth { background: var(--af-paper-warm) !important; }
.af-auth-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 16px; }
.af-auth-box { width: 100%; max-width: 460px; margin-bottom: 6vh; }
.af-auth-brand { display: flex; align-items: center; justify-content: center; gap: .65rem; margin-bottom: 1.5rem; }
.af-auth-brand h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.02em; }
.af-auth-brand h1 strong { color: var(--af-primary); }
.af-auth-brand .af-brand-mark { width: 40px; height: 40px; border-radius: 11px; font-size: 1.2rem; }
.af-auth .card { border-radius: 18px; box-shadow: 0 2px 4px rgb(29 16 18 / 5%), 0 24px 48px -16px rgb(29 16 18 / 18%); }
.af-auth .card-body { padding: 2rem 2.1rem; }
.af-auth .form-control { height: 44px; }
.af-auth .btn { height: 44px; }
[data-bs-theme="dark"] .af-auth-brand h1 strong { color: #7db2ff; }

/* ===== Login em cartão dividido: marca à esquerda, formulário à direita ===== */
.af-auth-card {
    width: 100%; max-width: 900px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden;
    background: var(--af-surface); border: 1px solid var(--af-line); border-radius: 22px;
    box-shadow: 0 2px 4px rgb(29 16 18 / 5%), 0 30px 60px -20px rgb(29 16 18 / 22%); margin-bottom: 4vh;
}
.af-auth-side {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: 3rem 2rem 6.5rem; overflow: hidden; border-right: 1px solid var(--af-line);
    background: linear-gradient(160deg, #fff 0%, #eef3fa 55%, #dce8fb 100%);
}
.af-auth-emblem { position: relative; width: 104px; height: 104px; margin-bottom: 1rem; }
.af-auth-shield { font-size: 96px; line-height: 1; color: var(--af-primary); }
.af-auth-receipt {
    position: absolute; right: -6px; bottom: 2px; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
    background: var(--af-navy-950); color: var(--af-accent); font-size: 1.2rem; box-shadow: 0 0 0 4px #fff;
}
.af-auth-name { font-size: 2.2rem; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; color: var(--af-navy-950); }
.af-auth-name strong { color: var(--af-primary); }
.af-auth-tagline { margin: 1rem 0 .25rem; font-size: .95rem; color: var(--af-ink-soft); max-width: 15rem; }
.af-auth-models { margin: 0; font-family: var(--bs-font-monospace); font-size: .75rem; color: var(--af-ink-soft); }
.af-auth-waves { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 120px; }
.af-wave-1 { fill: rgb(23 105 232 / 10%); }
.af-wave-2 { fill: rgb(27 77 181 / 16%); }
.af-wave-3 { fill: rgb(23 105 232 / 85%); }
.af-auth-form { padding: 2.75rem 2.75rem 1.75rem; display: flex; flex-direction: column; justify-content: center; }
.af-auth-title { font-size: 1.9rem; font-weight: 700; text-align: center; margin: 0; letter-spacing: -.02em; color: var(--af-navy-950); }
.af-auth-sub { text-align: center; color: var(--af-ink-soft); margin: .2rem 0 1.5rem; }
.af-input-icon { position: relative; }
.af-input-icon > .bi { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--af-ink-soft); font-size: 1.05rem; pointer-events: none; }
.af-input-icon .form-control { padding-left: 2.6rem; height: 46px; }
.af-input-icon .form-control:has(+ .af-reveal) { padding-right: 2.75rem; }
.af-reveal {
    position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 8px;
    background: transparent; color: var(--af-ink-soft); display: grid; place-items: center;
}
.af-reveal:hover, .af-reveal:focus-visible { color: var(--af-ink); background: var(--af-track); }
.af-auth-submit { height: 46px; display: flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 600; margin-top: .25rem; }
.af-auth-foot { margin: 1.75rem 0 0; text-align: center; font-size: .75rem; color: var(--af-ink-soft); }
.af-auth-mobile-brand { display: none; }
.af-auth .af-auth-form h2.h5 { font-size: 1.35rem; font-weight: 700; text-align: center; }

@media (max-width: 767.98px) {
    .af-auth-card { grid-template-columns: 1fr; max-width: 460px; }
    .af-auth-side { display: none; }
    .af-auth-form { padding: 2rem 1.5rem 1.5rem; }
    .af-auth-mobile-brand { display: flex; align-items: center; justify-content: center; gap: .55rem; font-size: 1.25rem; font-weight: 600; margin-bottom: 1.25rem; }
    .af-auth-mobile-brand strong { color: var(--af-primary); }
}

[data-bs-theme="dark"] .af-auth-side { background: linear-gradient(160deg, #0b1428 0%, #0f1a31 60%, #0f1a31 100%); }
[data-bs-theme="dark"] .af-auth-name, [data-bs-theme="dark"] .af-auth-title { color: var(--af-ink); }
[data-bs-theme="dark"] .af-auth-name strong { color: #7db2ff; }
[data-bs-theme="dark"] .af-auth-receipt { box-shadow: 0 0 0 4px var(--af-surface); }

/* ===== Login em tela cheia: marca na metade esquerda, formulário na direita ===== */
.af-auth-main { padding: 0; align-items: stretch; }
.af-auth-card {
    max-width: none; min-height: 100vh; margin: 0; border: 0; border-radius: 0; box-shadow: none;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.af-auth-side { padding: 4rem 3rem 12rem; }
.af-auth-emblem { width: 132px; height: 132px; margin-bottom: 1.4rem; }
.af-auth-shield { font-size: 124px; }
.af-auth-receipt { width: 50px; height: 50px; border-radius: 12px; font-size: 1.5rem; }
.af-auth-name { font-size: 3rem; }
.af-auth-tagline { font-size: 1.1rem; max-width: 20rem; }
.af-auth-models { font-size: .85rem; }
.af-auth-waves { height: 26vh; min-height: 170px; }
.af-auth-form { align-items: center; padding: 3rem 2rem; background: var(--af-surface); }
.af-auth-form > * { width: 100%; max-width: 420px; }
.af-auth-title { font-size: 2.3rem; }
.af-auth-sub { font-size: 1.05rem; margin-bottom: 2rem; }
.af-auth-foot { margin-top: 2.5rem; }
@media (max-width: 767.98px) {
    .af-auth-card { grid-template-columns: 1fr; }
    .af-auth-form { padding: 2.5rem 16px; }
}

/* ===== Escala: em telas grandes o painel é desenhado a 80% (o visual que antes exigia o zoom do navegador em 80%).
   Alturas de tela cheia são divididas pelo zoom para continuar ocupando a janela toda. ===== */
:root { --af-zoom: 1; }
@media (min-width: 1200px) {
    :root { --af-zoom: 1; } /* was .8: owner asked for larger texts (accessibility) */
    html { zoom: var(--af-zoom); }
}
.af-shell { min-height: calc(100vh / var(--af-zoom)); }
.af-auth-main, .af-auth-card { min-height: calc(100vh / var(--af-zoom)); }
@media (min-width: 992px) {
    .af-sidebar-wrap { height: calc(100vh / var(--af-zoom)); }
}

/* cartões de arquivo na tela da nota: o que é, "Ver" e "Baixar" */
.af-filecards { display: flex; flex-wrap: wrap; gap: .6rem; }
.af-filecard {
    display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem .5rem .75rem; background: var(--af-surface);
    border: 1px solid var(--af-line); border-radius: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .04);
}
.af-filecard-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 2.3rem; height: 2.3rem; border-radius: 10px;
    background: rgba(237, 0, 0, .08); color: var(--af-s1); font-size: 1.2rem;
}
.af-filecard-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 7.5rem; }
.af-filecard-text strong { font-size: .88rem; }
.af-filecard-text small { font-size: .72rem; color: var(--af-ink-soft); }
.af-filecard-actions { display: flex; gap: .35rem; margin-left: .3rem; }
.af-filecard-btn {
    display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .8rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
    text-decoration: none; border: 1px solid var(--af-line); background: var(--af-surface); color: var(--af-ink); transition: .15s;
}
.af-filecard-btn:hover, .af-filecard-btn:focus-visible { border-color: var(--af-s1); color: var(--af-s1); transform: translateY(-1px); }
.af-filecard-btn .bi { color: inherit; }
.af-filecard-btn.is-primary { background: var(--af-s1); border-color: var(--af-s1); color: #fff; }
.af-filecard-btn.is-primary:hover, .af-filecard-btn.is-primary:focus-visible { background: #1769e8; border-color: #1769e8; color: #fff; }

/* botões de arquivo na lista de emissões (DANFE / XML) */
.af-file-btn {
    display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .5rem; margin: 0 .1rem; border-radius: 7px;
    border: 1px solid var(--af-line); background: var(--af-surface); color: var(--af-ink); font-size: .75rem; font-weight: 500; text-decoration: none;
}
a.af-file-btn:hover, a.af-file-btn:focus-visible { border-color: var(--af-s1); color: var(--af-s1); }
.af-file-btn .bi { font-size: .9rem; color: var(--af-s1); }
.af-file-btn.is-off { opacity: .4; cursor: not-allowed; }
.af-file-btn.is-off .bi { color: var(--af-ink-soft); }
.af-flag-icon { font-size: 1.45rem; line-height: 1; }
.af-date { display: inline-block; line-height: 1.25; text-align: center; }
/* Live filters and sortable headers */
[data-af-results] { transition: opacity .15s; }
[data-af-results].af-loading { opacity: .5; pointer-events: none; }
.af-filter-bar { padding-top: .25rem; }
.af-clear { font-weight: 600; border-color: var(--af-s1); color: var(--af-s1); }
.af-clear:hover, .af-clear:focus-visible { background: var(--af-s1); border-color: var(--af-s1); color: #fff; }
a.af-sort { color: inherit; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: .25rem; }
a.af-sort .bi { font-size: .75em; opacity: .4; }
a.af-sort:hover .bi, a.af-sort.is-active .bi { opacity: 1; color: var(--af-s1); }
a.af-sort:hover, a.af-sort.is-active { color: var(--af-s1); }
/* Sub-pages: "Voltar" button next to the breadcrumb */
.af-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.af-back { font-weight: 600; }
/* Collapsible system cards (Integrações) */
.af-system > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.af-system > summary::-webkit-details-marker { display: none; }
.af-system-caret { color: var(--af-s1); transition: transform .15s; }
.af-system[open] .af-system-caret { transform: rotate(180deg); }
.af-system > summary:hover h2 { color: var(--af-s1); }

/* Type-to-search combobox of the filter selects (panel.js) */
.af-combo { position: relative; }
.af-combo-list {
    position: absolute; z-index: 1050; top: 100%; left: 0; min-width: 100%; max-width: min(40rem, 92vw); max-height: 18rem; overflow-y: auto;
    margin: .2rem 0 0; padding: .25rem 0; list-style: none; background: var(--af-surface); border: 1px solid var(--af-line);
    border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}
.af-combo-list li { padding: .4rem .7rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-combo-list li.is-selected { font-weight: 600; }
.af-combo-list li.is-active { background: var(--af-s1); color: #fff; }
.af-combo-list li.is-empty { color: var(--af-ink-soft); cursor: default; }

/* Numeração: inutilização manual recolhida (exceção) */
.af-manual summary { font-size: .875rem; font-weight: 600; color: var(--af-ink-soft); cursor: pointer; }
.af-manual summary .bi { color: var(--af-s1); }
.af-manual[open] summary { color: var(--af-ink); }

/* Configurações: chave de produção e pré-requisitos */
.af-prod.is-on { border-color: var(--af-crit); box-shadow: 0 0 0 1px var(--af-crit); }
.af-prod .af-chart-title .bi { color: var(--af-accent); }
.af-checklist { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .55rem; }
.af-checklist li { display: flex; gap: .6rem; align-items: flex-start; font-size: .875rem; }
.af-checklist li > .bi { font-size: 1.05rem; margin-top: .05rem; }
.af-checklist .is-ok > .bi { color: var(--af-good); }
.af-checklist .is-fail > .bi { color: var(--af-crit); }
.af-checklist .is-warn > .bi { color: var(--af-warn); }
.af-env-prod { display: inline-block; background: var(--af-crit); color: #fff; font-weight: 700; font-size: .7rem; letter-spacing: .08em; padding: .1rem .45rem; border-radius: 5px; margin-right: .3rem; }

/* ---- Bridge Fiscal: logo of the brand instead of the icon marks ---- */
.af-brand-logo { background: transparent; width: 34px; height: 34px; }
.af-brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.af-auth-logo { width: 112px; height: 112px; }
.af-auth-logo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 14px rgb(18 88 196 / 22%)); }
.af-auth-brand .af-brand-logo, .af-auth-mobile-brand .af-brand-logo { width: 40px; height: 40px; }

/* Two-factor QR code: always white background (also in the dark theme) and real size, undoing the page zoom,
   so phone cameras can read it. */
.af-qr { background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--af-line); line-height: 0; zoom: calc(1 / var(--af-zoom)); }
.af-qr svg { width: 260px; height: 260px; max-width: 100%; }

/* Row actions (emission configurations): pop-over card opened by <details>. */
.af-actions { width: 320px; z-index: 1030; }
details > summary.btn { list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }
td:has(> details[open]) { position: relative; }

/* Language switch (flags): side menu and login page. */
.af-lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: rgb(255 255 255 / 6%); border: 1px solid rgb(255 255 255 / 10%); }
.af-lang a { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 6px; opacity: .55; transition: opacity .15s, background-color .15s; }
.af-lang a:hover, .af-lang a:focus-visible { opacity: 1; }
.af-lang a[aria-current] { opacity: 1; background: rgb(255 255 255 / 12%); }
.pp-flag { display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgb(0 0 0 / 25%); }
.af-side-lang { padding: .35rem .25rem 0; }
.af-auth-lang { display: flex; justify-content: flex-end; margin: -1rem -1rem .75rem 0; }
.af-auth-lang .af-lang { background: var(--af-track); border-color: var(--af-line); }
.af-auth-lang .af-lang a[aria-current] { background: var(--af-surface); box-shadow: 0 1px 3px rgb(0 0 0 / 12%); }

/* ===== Light theme: the side menu follows the theme (dark wine only in the dark theme) ===== */
[data-bs-theme="light"] .af-sidebar { --bs-offcanvas-bg: #fff; --bs-offcanvas-color: var(--af-ink); }
@media (min-width: 992px) {
    [data-bs-theme="light"] .af-sidebar-wrap { background: var(--af-paper-warm); border-right: 1px solid var(--af-line); }
}
[data-bs-theme="light"] .af-sidebar .af-brand, [data-bs-theme="light"] .af-sidebar .af-brand:hover,
[data-bs-theme="light"] .af-topbar .af-brand, [data-bs-theme="light"] .af-topbar .af-brand:hover { color: var(--af-ink); }
[data-bs-theme="light"] .af-sidebar .af-brand strong, [data-bs-theme="light"] .af-topbar .af-brand strong { color: var(--af-primary); }
[data-bs-theme="light"] .af-nav .nav-link { color: var(--af-ink-soft); }
[data-bs-theme="light"] .af-nav .nav-link:hover { color: var(--af-ink); background: rgb(23 105 232 / 6%); }
[data-bs-theme="light"] .af-nav .nav-link:focus-visible { outline-color: var(--af-primary); }
[data-bs-theme="light"] .af-nav .nav-link.active { color: var(--af-primary-deep); background: rgb(23 105 232 / 9%); border-left-color: var(--af-primary); font-weight: 600; }
[data-bs-theme="light"] .af-nav .nav-link.active .bi { color: var(--af-primary); }
[data-bs-theme="light"] .af-user { background: #fff; border-color: var(--af-line); color: var(--af-ink); }
[data-bs-theme="light"] .af-role { background: rgb(23 105 232 / 8%); color: var(--af-primary-deep); }
[data-bs-theme="light"] .af-side-btn { border-color: var(--af-line); background: #fff; color: var(--af-ink); }
[data-bs-theme="light"] .af-side-btn:hover, [data-bs-theme="light"] .af-side-btn:focus-visible { background: var(--af-track); border-color: var(--af-line-strong); color: var(--af-ink); }
[data-bs-theme="light"] .af-side-btn .bi { color: var(--af-primary); }
[data-bs-theme="light"] .af-sidebar-foot { color: var(--af-ink-soft); }
[data-bs-theme="light"] .af-sidebar .btn-close-white { filter: none; }
[data-bs-theme="light"] .af-topbar { background: #fff; border-bottom: 1px solid var(--af-line); }
[data-bs-theme="light"] .af-menu-btn { color: var(--af-ink); }
[data-bs-theme="light"] .af-menu-btn:hover, [data-bs-theme="light"] .af-menu-btn:focus-visible { color: var(--af-primary); }
[data-bs-theme="light"] .af-sidebar .af-lang { background: var(--af-track); border-color: var(--af-line); }
[data-bs-theme="light"] .af-sidebar .af-lang a[aria-current] { background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 12%); }

/* Items-per-page selector of the lists. */
.af-per-page { width: auto; display: inline-block; }

/* Expandable groups of the "Gestão do Bridge Fiscal" menu (Bootstrap collapse). */
.af-nav .af-nav-group { width: 100%; border: 0; background: none; text-align: left; }
.af-nav .af-nav-group .af-chevron { font-size: .75rem; width: auto; transition: transform .15s ease; }
.af-nav .af-nav-group:not(.collapsed) .af-chevron { transform: rotate(90deg); }
.af-subnav { gap: 2px; margin: 2px 0 4px; }
.af-subnav .nav-link { padding-left: 2.25rem; font-size: .925rem; }
@media (prefers-reduced-motion: reduce) { .af-nav .af-nav-group .af-chevron { transition: none; } }

/* Cookie notice (only essential cookies: information, no consent needed). Hidden once confirmed (html.af-cookies-ok). */
.af-cookie { position: fixed; left: 1rem; bottom: 1rem; z-index: 1080; max-width: 26rem; display: flex; gap: .75rem; align-items: flex-start;
    padding: .875rem 1rem; border-radius: 12px; border: 1px solid var(--bs-border-color); border-left: 4px solid #1769e8;
    background: var(--bs-body-bg); color: var(--bs-body-color); box-shadow: 0 10px 30px rgb(0 0 0 / 18%); font-size: .85rem; line-height: 1.45; }
.af-cookie > .bi { color: #1769e8; font-size: 1.25rem; line-height: 1; margin-top: .1rem; }
.af-cookie p { margin: 0 0 .5rem; }
.af-cookie a { color: #1769e8; font-weight: 600; }
[data-bs-theme="dark"] .af-cookie > .bi, [data-bs-theme="dark"] .af-cookie a { color: #5b9bff; }
.af-cookies-ok .af-cookie { display: none; }
@media (max-width: 575.98px) { .af-cookie { left: .75rem; right: .75rem; bottom: .75rem; max-width: none; } }
@media print { .af-cookie { display: none; } }

/* Public page "Privacidade e Cookies". */
.af-privacy { max-width: 56rem; }
.af-privacy-doc { font-size: .925rem; line-height: 1.6; }
.af-privacy-doc h3 { scroll-margin-top: 1rem; }

/* Hash: a1acd94f9aa84f55e775a45efebc9cc2: 6db3a0d37641ce96c2ccd86fd5c24af0 | bac953e88f6d79514b0b6fc42eb6f3b7: 43a6da8ce435f585b4e067c2b153bc99 */
