/*
 * Tema do Financeiro do Grupo, seguindo o DESIGN.md (linguagem visual do Base Web).
 * Carregado depois do CSS do Filament 5 pelo render hook STYLES_AFTER (sem build do Vite).
 * Regras: fundo branco, uma cor de destaque, tipografia forte nos números, sem sombras
 * em cards, tabelas sem divisórias. A coluna de 624px e o botão flutuante do DESIGN.md
 * não se aplicam: o painel é largo por natureza.
 */
@import url("https://fonts.bunny.net/css?family=archivo:700&display=swap");

:root {
    --tema-bg: #ffffff;
    --tema-surface: #f7f7f7;
    --tema-surface-hover: #f0f0f0;
    --tema-surface-accent: #dcf1ff;
    --tema-text: #222222;
    --tema-text-muted: #8e8e8e;
    --tema-on-accent-soft: #00118a;
    --tema-accent: #0000ff;
    --tema-accent-disabled: #a9a8ff;
    --tema-ink: #0a0b0d;
    --tema-secondary-btn: #eef0f2;
    --tema-border: #eeeeee;
    --tema-border-strong: #dadada;
    --tema-overlay: rgba(20, 20, 60, 0.3);
    --tema-shadow-pop: 0 4px 16px rgba(0, 0, 0, 0.08);
    --tema-shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.12);
    --tema-font-display: "Archivo", "Figtree", system-ui, sans-serif;
}

/* ---------- Base ---------- */
body.fi-body {
    background-color: var(--tema-bg);
    color: var(--tema-text);
}

body .fi-main {
    padding-top: 0.5rem;
}

/* Números sempre tabulares. */
body .fi-ta-cell,
body .fi-wi-stats-overview-stat-value,
body .fi-ta-text-item,
body table {
    font-variant-numeric: tabular-nums;
}

/* ---------- Tipografia de destaque ---------- */
body .fi-header-heading {
    font-family: var(--tema-font-display);
    font-size: 28px;
    line-height: 36px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--tema-text);
}

body .fi-header-subheading {
    color: var(--tema-text-muted);
    font-size: 14px;
}

body .fi-logo {
    font-family: var(--tema-font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--tema-text);
}

body .fi-section-header-heading,
body .fi-modal-heading {
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
    color: var(--tema-text);
}

body .fi-section-header-description,
body .fi-modal-description {
    color: var(--tema-text-muted);
}

/* ---------- Sidebar ---------- */
body .fi-sidebar {
    background-color: var(--tema-bg);
    box-shadow: none;
    border-inline-end: 0;
}

body .fi-sidebar-nav {
    padding-inline: 12px;
}

body .fi-sidebar-item-btn {
    min-height: 44px;
    border-radius: 12px;
    padding-inline: 16px;
    gap: 14px;
    font-size: 15px;
    font-weight: 500;
    color: var(--tema-text-muted);
}

body .fi-sidebar-item-btn > .fi-icon {
    color: var(--tema-text-muted);
}

body .fi-sidebar-item-btn:hover {
    background-color: var(--tema-surface);
    color: var(--tema-text);
}

body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background-color: var(--tema-surface);
}

body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon,
body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label {
    color: var(--tema-text);
}

body .fi-sidebar-group-label {
    color: var(--tema-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ---------- Barra superior ---------- */
body .fi-topbar {
    background-color: var(--tema-bg);
    box-shadow: none;
    border-bottom: 1px solid var(--tema-border);
}

/* ---------- Superfícies: cards, seções, tabelas, abas ---------- */
body .fi-section:not(.fi-section-not-contained):not(.fi-aside),
body .fi-wi-stats-overview-stat,
body .fi-ta-ctn,
body .fi-tabs:not(.fi-contained),
body .fi-fo-tabs {
    border-radius: 20px;
    box-shadow: 0 0 0 1px var(--tema-border);
}

body .fi-tabs:not(.fi-contained) {
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    gap: 4px;
}

body .fi-tabs-item {
    border-radius: 9999px;
    color: var(--tema-text-muted);
    font-weight: 500;
}

body .fi-tabs-item.fi-active {
    background-color: var(--tema-surface);
    color: var(--tema-text);
}

body .fi-tabs-item.fi-active .fi-tabs-item-label,
body .fi-tabs-item.fi-active .fi-icon {
    color: var(--tema-text);
}

body .fi-section:not(.fi-section-not-contained) > .fi-section-content-ctn > .fi-section-footer,
body .fi-ta-ctn .fi-ta-header {
    border-color: var(--tema-border);
}

/* Cartões de KPI: número protagonista. */
body .fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-value {
    font-family: var(--tema-font-display);
    font-size: 32px;
    line-height: 40px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--tema-text);
}

body .fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-label {
    color: var(--tema-text-muted);
    font-size: 13px;
    font-weight: 600;
}

/* ---------- Tabelas: lista de dados, não planilha ---------- */
body .fi-ta-header-cell {
    color: var(--tema-text-muted);
    font-size: 13px;
    font-weight: 500;
}

body .fi-ta-header-cell .fi-ta-header-cell-label,
body .fi-ta-header-cell-sort-icon {
    color: var(--tema-text-muted);
}

body .fi-ta-table > thead,
body .fi-ta-table > thead > tr {
    background-color: transparent;
    border-bottom: 1px solid var(--tema-border);
}

body .fi-ta-table > tbody > tr,
body .fi-ta-table > tbody > tr > td {
    border-color: transparent;
}

body .fi-ta-row {
    height: 52px;
}

body .fi-ta-row.fi-clickable:hover,
body .fi-ta-row:hover {
    background-color: var(--tema-surface);
}

body .fi-ta-row.fi-striped {
    background-color: transparent;
}

body .fi-ta-text-item {
    color: var(--tema-text);
}

body .fi-ta-text-item.fi-color-gray,
body .fi-in-text-item.fi-color-gray {
    color: var(--tema-text-muted);
}

body .fi-ta-empty-state-heading {
    font-size: 14px;
    font-weight: 600;
}

body .fi-ta-empty-state-description {
    color: var(--tema-text-muted);
}

/* Tabelas próprias das páginas (Caixa projetado, DRE, widgets). */
body .tema-tabela {
    font-size: 14px;
}

body .tema-tabela thead th {
    color: var(--tema-text-muted);
    font-weight: 500;
    font-size: 13px;
    padding-block: 10px;
    border-bottom: 1px solid var(--tema-border);
}

body .tema-tabela tbody td {
    padding-block: 9px;
}

body .tema-tabela tbody tr:hover {
    background-color: var(--tema-surface);
}

/* ---------- Botões: sempre pill ---------- */
body .fi-btn {
    border-radius: 9999px;
    font-weight: 600;
    padding-inline: 16px;
}

body .fi-btn.fi-size-md {
    min-height: 40px;
}

/* Botão neutro (Cancelar, secundários): cinza preenchido, sem contorno. */
body .fi-btn:not(.fi-color):not(.fi-outlined),
body .fi-btn:not(.fi-color):not(.fi-outlined):hover {
    background-color: var(--tema-secondary-btn);
    color: var(--tema-text);
    box-shadow: none;
}

body .fi-btn:not(.fi-color):not(.fi-outlined):hover {
    background-color: #e3e6e9;
}

body .fi-btn.fi-outlined {
    box-shadow: 0 0 0 1px var(--tema-border-strong);
}

body .fi-btn.fi-disabled,
body .fi-btn[disabled] {
    opacity: 1;
}

body .fi-btn.fi-color.fi-color-primary.fi-disabled,
body .fi-btn.fi-color.fi-color-primary[disabled] {
    background-color: var(--tema-accent-disabled);
}

body .fi-icon-btn {
    border-radius: 9999px;
}

body .fi-link {
    font-weight: 600;
}

/* ---------- Formulários ---------- */
body .fi-input-wrp {
    border-radius: 8px;
    box-shadow: 0 0 0 1px var(--tema-border-strong);
}

body .fi-input-wrp:not(.fi-disabled):not(:has(.fi-ac-action:focus)):focus-within {
    --tw-ring-color: var(--tema-text);
}

body .fi-fo-field-label-content {
    font-size: 13px;
    font-weight: 600;
    color: var(--tema-text);
}

body .fi-fo-field-hint,
body .fi-fo-field-helper-text {
    color: var(--tema-text-muted);
}

/* ---------- Modais, dropdowns, badges, notificações ---------- */
body .fi-modal > .fi-modal-close-overlay {
    background-color: var(--tema-overlay);
}

body .fi-modal-window {
    border-radius: 24px;
    box-shadow: var(--tema-shadow-modal);
}

body .fi-modal-header,
body .fi-modal-footer {
    border-color: var(--tema-border);
}

body .fi-dropdown-panel {
    border-radius: 12px;
    box-shadow: var(--tema-shadow-pop), 0 0 0 1px var(--tema-border);
}

body .fi-badge {
    border-radius: 9999px;
    font-weight: 600;
}

body .fi-no-notification,
body .fi-notification {
    border-radius: 9999px;
    box-shadow: var(--tema-shadow-pop);
}

/* ---------- Gráficos ---------- */
body .fi-wi-chart canvas {
    border-radius: 12px;
}

/* ---------- Login ---------- */
body .fi-simple-main {
    border-radius: 24px;
    box-shadow: 0 0 0 1px var(--tema-border);
}

/* ---------- Utilitários usados nos blades próprios ----------
 * O projeto não tem build do Vite, então as classes do Tailwind escritas nos blades
 * (Caixa projetado, DRE, widgets, seletor de empresa) não existem no CSS do Filament.
 * Este bloco cobre exatamente as que os blades usam, já com as cores do tema.
 */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 768px) { .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.inline-block { display: inline-block; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.space-y-1 > * + * { margin-top: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.w-full { width: 100%; }
.h-2 { height: 8px; }
.w-2 { width: 8px; }
.mt-1 { margin-top: 4px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.pt-1 { padding-top: 4px; }
.pt-4 { padding-top: 16px; }
.pb-1 { padding-bottom: 4px; }
.pb-2 { padding-bottom: 8px; }
.px-2 { padding-inline: 8px; }
.py-1 { padding-block: 4px; }
.py-1\.5 { padding-block: 6px; }
.py-2 { padding-block: 8px; }
.ps-3 { padding-inline-start: 12px; }
.pe-8 { padding-inline-end: 32px; }
.overflow-x-auto { overflow-x: auto; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-xs { font-size: 12px; line-height: 16px; }
.text-sm { font-size: 14px; line-height: 20px; }
.text-base { font-size: 16px; line-height: 24px; }
.text-2xl { font-family: var(--tema-font-display); font-size: 24px; line-height: 32px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; letter-spacing: 0.02em; }
.whitespace-nowrap { white-space: nowrap; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 8px; }
.shadow-sm { box-shadow: none; }
.cursor-pointer { cursor: pointer; }
.border { border: 1px solid var(--tema-border); }
.border-t { border-top: 1px solid var(--tema-border); }
.border-b { border-bottom: 1px solid var(--tema-border); }
.border-t-2 { border-top: 2px solid var(--tema-border-strong); }
.border-gray-100, .border-gray-200 { border-color: var(--tema-border); }
.border-gray-300 { border-color: var(--tema-border-strong); }
.bg-white { background-color: var(--tema-bg); }
.bg-gray-50, .bg-gray-100 { background-color: var(--tema-surface); }
.bg-yellow-100 { background-color: #fff7d6; }
.bg-success-500 { background-color: #2a8a5e; }
.bg-warning-500 { background-color: #f59e0b; }
.bg-danger-500 { background-color: #ce1f2f; }
.bg-gray-400 { background-color: #b4b4b4; }
.text-gray-500 { color: var(--tema-text-muted); }
.text-gray-950 { color: var(--tema-text); }
.text-success-600 { color: #2a8a5e; }
.text-danger-600 { color: #ce1f2f; }
.text-warning-600 { color: #b45309; }
.hover\:bg-gray-50:hover { background-color: var(--tema-surface); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
