/* Portal ICA — admin (menu horizontal, light/dark) */

:root {
    --portal-surface: #f4f5f7;
    --portal-panel: #ffffff;
    --portal-line: #e2e5ea;
    --portal-ink: #1c2430;
    --portal-muted: #5b6573;
    --portal-hover: #eef0f3;
    --portal-stripe: #fafbfc;
    --portal-table-head: #f8f9fb;
    --portal-active-soft: #f3eaf7;
    --portal-accent: #6d2d81;
    --portal-radius: 0.25rem;
}

.dark {
    --portal-surface: #0f1419;
    --portal-panel: #171c24;
    --portal-line: #2a3340;
    --portal-ink: #e8edf4;
    --portal-muted: #9aa5b5;
    --portal-hover: #222a35;
    --portal-stripe: #1a212b;
    --portal-table-head: #1c2430;
    --portal-active-soft: #2a1a33;
    --portal-accent: #b57bc9;
}

html {
    color-scheme: light;
}

html.dark {
    color-scheme: dark;
}

/* Fundo e tipografia */
.fi-body {
    background-color: var(--portal-surface) !important;
    color: var(--portal-ink);
}

.fi-main,
.fi-main-ctn {
    max-width: none !important;
}

.fi-page-header-heading {
    font-weight: 600 !important;
    letter-spacing: -0.02em;
    color: var(--portal-ink) !important;
}

.fi-header-heading {
    font-weight: 600 !important;
    letter-spacing: -0.015em;
}

/* Topbar horizontal — logo à esquerda, menu centralizado, ações à direita */
.fi-topbar {
    background: var(--portal-panel) !important;
    border-bottom: 1px solid var(--portal-line) !important;
    box-shadow: none !important;
}

@media (min-width: 1024px) {
    .fi-topbar-with-navigation > nav {
        display: grid !important;
        grid-template-columns: minmax(12rem, 1fr) auto minmax(12rem, 1fr);
        align-items: center;
        column-gap: 1rem;
    }

    /* Marca / futura logo — mais respiro à esquerda */
    .fi-topbar-with-navigation > nav > div.me-6 {
        grid-column: 1;
        justify-self: start;
        margin-inline-end: 0 !important;
        max-width: 100%;
        min-width: 0;
    }

    /* Grupos de navegação no centro */
    .fi-topbar-with-navigation > nav > ul {
        grid-column: 2;
        justify-self: center;
        margin-inline: 0 !important;
        flex-wrap: nowrap;
    }

    /* Busca / tema / usuário à direita */
    .fi-topbar-with-navigation > nav > div.ms-auto {
        grid-column: 3;
        justify-self: end;
        margin-inline-start: 0 !important;
    }
}

.fi-topbar nav a,
.fi-topbar .fi-topbar-item-button {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--portal-muted) !important;
    border-radius: var(--portal-radius);
    box-shadow: none !important;
}

.fi-topbar nav a:hover,
.fi-topbar .fi-topbar-item-button:hover {
    color: var(--portal-ink) !important;
    background: var(--portal-hover) !important;
}

/* Ativo: chip discreto (sem sublinhado) */
.fi-topbar .fi-active > a,
.fi-topbar .fi-active > .fi-topbar-item-button,
.fi-topbar [aria-current="page"] {
    color: var(--portal-ink) !important;
    background: var(--portal-active-soft) !important;
    box-shadow: none !important;
    font-weight: 600;
}

.fi-topbar .fi-active > a::after,
.fi-topbar .fi-active > .fi-topbar-item-button::after,
.fi-topbar [aria-current="page"]::after {
    display: none !important;
    content: none !important;
}

.fi-logo {
    gap: 0.75rem;
}

/* Conteúdo: borda fina, sem sombra */
.fi-section,
.fi-ta-ctn,
.fi-fo-tabs,
.fi-wi-stats-overview-stat,
.fi-modal-window,
.fi-dropdown-panel {
    box-shadow: none !important;
}

.fi-section,
.fi-ta-ctn,
.fi-fo-tabs,
.fi-wi-stats-overview-stat,
.fi-modal-window,
.fi-dropdown-panel,
.fi-modal-content {
    border-radius: var(--portal-radius) !important;
}

.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat {
    border: 1px solid var(--portal-line) !important;
    background: var(--portal-panel) !important;
}

.fi-section-content-ctn,
.fi-section-header {
    border-color: var(--portal-line) !important;
}

/* Tabelas */
.fi-ta-table {
    font-size: 0.8125rem;
}

.fi-ta-header-cell,
.fi-ta-actions-header-cell,
.fi-ta-selection-cell.fi-ta-header-cell,
th.fi-ta-actions-header-cell,
.fi-ta-table thead th {
    background: var(--portal-table-head) !important;
    color: var(--portal-muted) !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    border-bottom: 1px solid var(--portal-line) !important;
}

/* Cabeçalho da coluna Ações — centralizado (Filament força justify-end) */
.fi-ta-actions-header-cell,
.fi-ta-table thead > tr > th.fi-ta-header-cell:last-child {
    text-align: center !important;
}

.fi-ta-table thead > tr > th.fi-ta-header-cell:last-child > span {
    justify-content: center !important;
}

.fi-ta-table thead > tr > th.fi-ta-header-cell:last-child .fi-ta-header-cell-label {
    text-align: center !important;
    width: 100%;
}

.fi-ta-row {
    border-color: var(--portal-line) !important;
}

.fi-ta-row:nth-child(even) .fi-ta-cell {
    background-color: var(--portal-stripe);
}

.fi-ta-cell {
    color: var(--portal-ink);
}

.fi-ta-filters,
.fi-ta-header-toolbar {
    gap: 0.5rem;
}

.fi-input-wrp,
.fi-select-input,
.fi-fo-field-wrp-label,
.fi-textarea-input,
.fi-input,
.fi-select,
.fi-checkbox-input,
.fi-radio-input,
.fi-btn,
.fi-icon-btn,
.fi-badge,
.fi-link-btn {
    border-radius: var(--portal-radius) !important;
}

.fi-btn {
    font-weight: 550 !important;
    box-shadow: none !important;
}

/* Filament usa rounded-lg/xl nos utilitários; unifica cards e campos */
.fi-body .rounded-md,
.fi-body .rounded-lg,
.fi-body .rounded-xl,
.fi-body .rounded-2xl,
.fi-body .rounded-3xl {
    border-radius: var(--portal-radius) !important;
}

.fi-body .rounded-full {
    border-radius: 9999px !important;
}

.fi-btn-primary {
    background-color: var(--portal-accent) !important;
}

.fi-btn-primary:hover {
    filter: brightness(0.95);
}

.dark .fi-btn-primary:hover {
    filter: brightness(1.08);
}

/* Cancelar / secundário nas modais — contraste maior que o gray outline padrão */
.fi-modal-footer .fi-btn.fi-color-gray,
.fi-modal-footer .fi-btn.fi-btn-color-gray {
    background-color: var(--portal-hover) !important;
    color: var(--portal-ink) !important;
    border: 1px solid var(--portal-line) !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    box-shadow: none !important;
}

.fi-modal-footer .fi-btn.fi-color-gray:hover,
.fi-modal-footer .fi-btn.fi-btn-color-gray:hover {
    background-color: #e4e7ec !important;
    border-color: #c9ced6 !important;
}

.dark .fi-modal-footer .fi-btn.fi-color-gray,
.dark .fi-modal-footer .fi-btn.fi-btn-color-gray {
    background-color: var(--portal-hover) !important;
    color: var(--portal-ink) !important;
    border-color: var(--portal-line) !important;
}

.dark .fi-modal-footer .fi-btn.fi-color-gray:hover,
.dark .fi-modal-footer .fi-btn.fi-btn-color-gray:hover {
    background-color: #2c3644 !important;
    border-color: #3d4a5c !important;
}

/* Login / auth: um único card (sem caixa interna sobreposta) */
.fi-simple-layout {
    background: var(--portal-surface) !important;
}

.fi-simple-main {
    background: var(--portal-panel) !important;
    border: 1px solid var(--portal-line) !important;
    box-shadow: none !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    --tw-ring-color: transparent !important;
    border-radius: var(--portal-radius) !important;
}

.fi-simple-page,
.fi-simple-page > section {
    background: transparent !important;
}

.fi-main > section,
.fi-page > .fi-header {
    padding-inline: clamp(1rem, 2vw, 1.75rem);
}

.fi-page-main {
    gap: 1rem !important;
}

.fi-wi-stats-overview {
    gap: 0.75rem !important;
}

.fi-wi-stats-overview-stat-value {
    font-weight: 650 !important;
    letter-spacing: -0.02em;
    color: var(--portal-ink) !important;
}

.fi-wi-stats-overview-stat-label {
    color: var(--portal-muted) !important;
    font-weight: 500 !important;
}

