@import url('https://fonts.bunny.net/css?family=bricolage-grotesque:600,700&display=swap');

/* =====================================================================
   Atribuição — Redesign Visual (camada de interface)
   Branco + azul institucional. Implementa o PRD v1.0 dentro do Filament.
   Somente cosmético — nenhuma regra de negócio. Editou? bump o ?v= no
   AppServiceProvider (render hook) para furar o cache do browser.
   ===================================================================== */

/* ------------------------------------------------------------------ */
/*  §4 — DESIGN TOKENS (fonte única de verdade)                        */
/* ------------------------------------------------------------------ */
:root {
    /* 4.1 Azul institucional */
    --blue-50:  #EEF3FF;
    --blue-100: #D9E4FF;
    --blue-200: #B3C9FF;
    --blue-300: #85A6FF;
    --blue-400: #5480F5;
    --blue-500: #2E5FE6;
    --blue-600: #1E4FD8;   /* primária */
    --blue-700: #183FB0;
    --blue-800: #163688;
    --blue-900: #12285E;
    --ink:      #0B1E3D;

    /* 4.2 Neutros (slate azulado) */
    --bg:            #F4F7FC;
    --surface:       #FFFFFF;
    --surface-2:     #F9FBFE;
    --border:        #E3E9F4;
    --border-strong: #CBD5E9;
    --text:          #0B1E3D;
    --text-muted:    #5A6B8A;
    --text-subtle:   #8A99B5;

    /* 4.3 Semânticas */
    --success:     #1F9D6B;  --success-bg: #E7F7F0;
    --warning:     #B67A10;  --warning-bg: #FBF2DD;
    --danger:      #D6453D;  --danger-bg:  #FBE9E8;

    /* 4.4 Tipografia */
    --font-display: 'Bricolage Grotesque', 'Public Sans', ui-sans-serif, system-ui, sans-serif;

    /* 4.6 Raios */
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   14px;
    --radius-pill: 999px;

    /* 4.7 Elevação (tingida de navy) */
    --shadow-sm: 0 1px 2px rgba(11, 30, 61, .06);
    --shadow-md: 0 4px 16px -4px rgba(11, 30, 61, .10);
    --shadow-lg: 0 12px 32px -8px rgba(11, 30, 61, .14);

    /* 4.8 Movimento */
    --ease: cubic-bezier(.2, .7, .2, 1);
    --dur-fast: 120ms;
    --dur: 180ms;
    --dur-slow: 240ms;
}

html, body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Display font nos títulos, marca e headings de modal/seção (§4.4) */
.fi-header-heading,
.fi-simple-header-heading,
.fi-modal-heading,
.fi-section-header-heading,
.fi-logo {
    font-family: var(--font-display);
    letter-spacing: -.01em;
}

/* Números/datas alinhados (§4.4 tabular-nums) */
.fi-ta-text .fi-ta-text-item,
.fi-ta-cell time,
.fi-wi-stats-overview-stat-value {
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ */
/*  §5.1 — Shell · Sidebar (clara — decisão §12.2)                     */
/* ------------------------------------------------------------------ */
.fi-body { background: var(--bg); }

.fi-sidebar,
.fi-sidebar-header {
    background: var(--surface);
    border-color: var(--border);
}
.fi-sidebar { box-shadow: 0 0 44px -22px rgba(11, 30, 61, .16); }

.fi-sidebar-group-label {
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-subtle);
}
.fi-sidebar-item-button {
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-muted);
    transition: background-color var(--dur-fast) var(--ease),
                color var(--dur-fast) var(--ease),
                box-shadow var(--dur-fast) var(--ease);
}
.fi-sidebar-item-button:hover {
    background: var(--blue-50);
    color: var(--blue-700);
}
.fi-sidebar-item-active .fi-sidebar-item-button {
    background: var(--blue-600);
    box-shadow: 0 8px 18px -8px rgba(30, 79, 216, .55);
}
/* O Filament aplica text-primary-600 (azul) ao ícone e ao label do item ativo;
   sobre o fundo azul isso vira azul-sobre-azul. Força branco (vence a utility). */
.fi-sidebar-item-active .fi-sidebar-item-button,
.fi-sidebar-item-active .fi-sidebar-item-icon,
.fi-sidebar-item-active .fi-sidebar-item-label {
    color: #fff !important;
}

/* ------------------------------------------------------------------ */
/*  §5.2 — Shell · Topbar + marca                                      */
/* ------------------------------------------------------------------ */
.fi-topbar > nav {
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.fi-logo {
    font-weight: 700;
    color: var(--blue-700);
}
.fi-breadcrumbs-item, .fi-breadcrumbs-item a { color: var(--text-muted); }

/* ------------------------------------------------------------------ */
/*  §5.3 — Page header                                                 */
/* ------------------------------------------------------------------ */
.fi-header-heading { color: var(--text); font-weight: 700; }
.fi-header-subheading { color: var(--text-muted); }

/* ------------------------------------------------------------------ */
/*  §5.4 — Botões                                                      */
/* ------------------------------------------------------------------ */
.fi-btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: filter var(--dur-fast) var(--ease),
                background-color var(--dur-fast) var(--ease),
                transform var(--dur-fast) var(--ease);
}
.fi-btn:active { transform: translateY(1px); }

/* O preenchimento azul vale só para o botão sólido. A variante `outlined`
   do Filament vem com texto e borda em primary sobre fundo transparente —
   pintar o fundo aqui deixava texto azul sobre fundo azul, ilegível. */
.fi-btn.fi-color-primary:not(.fi-btn-outlined) {
    background-color: var(--blue-600);
    box-shadow: 0 8px 18px -10px rgba(30, 79, 216, .65);
}
.fi-btn.fi-color-primary:not(.fi-btn-outlined):hover { background-color: var(--blue-500); }

/* ------------------------------------------------------------------ */
/*  §5.5 — Badges / pills de status                                    */
/* ------------------------------------------------------------------ */
.fi-badge {
    border-radius: var(--radius-pill);
    font-weight: 600;
    letter-spacing: .01em;
}

/* ------------------------------------------------------------------ */
/*  §5.6/5.9 — Cartões, seções, inputs                                 */
/* ------------------------------------------------------------------ */
.fi-section,
.fi-ta-ctn,
.fi-fo-field-wrp .fi-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.fi-section { transition: box-shadow var(--dur) var(--ease); }
.fi-section:hover { box-shadow: var(--shadow-md); }

.fi-input-wrp {
    border-radius: var(--radius-sm);
    border-color: var(--border-strong);
    transition: box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.fi-input-wrp:focus-within {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px var(--blue-200);
}

/* ------------------------------------------------------------------ */
/*  §6.2 — Widgets de estatística (dashboard)                          */
/* ------------------------------------------------------------------ */
.fi-wi-stats-overview-stat {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.fi-wi-stats-overview-stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--blue-600), var(--blue-400));
}
.fi-wi-stats-overview-stat-value {
    color: var(--ink);
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: -.02em;
}
.fi-wi-stats-overview-stat-label { color: var(--text-muted); }

/* ------------------------------------------------------------------ */
/*  §5.6 — Data table (tela núcleo)                                    */
/* ------------------------------------------------------------------ */
.fi-ta-header-cell {
    background: var(--surface);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .04em;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.fi-ta-row { transition: background-color var(--dur-fast) var(--ease); }
.fi-ta-row:hover { background: var(--surface-2); }
/* slug como metadado sob o nome (§5.6 · §12.4) */
.fi-ta-record-content .fi-ta-text-item-description,
.fi-ta-col-wrp .fi-ta-text-item-description {
    color: var(--text-subtle);
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
}

/* Emblema de tenant (assinatura §5.6) */
.atrib-emblem {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .02em;
    font-family: var(--font-display);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), var(--shadow-sm);
    user-select: none;
}

/* ------------------------------------------------------------------ */
/*  §5.8 — Paginação                                                   */
/* ------------------------------------------------------------------ */
.fi-pagination .fi-btn { border-radius: var(--radius-md); }

/* ------------------------------------------------------------------ */
/*  §5.11 — Estado vazio                                               */
/* ------------------------------------------------------------------ */
.fi-ta-empty-state-icon-ctn {
    background: var(--blue-50);
    color: var(--blue-600);
    border-radius: var(--radius-lg);
}
.fi-ta-empty-state-heading { color: var(--text); font-weight: 600; }
.fi-ta-empty-state-description { color: var(--text-muted); }

/* ------------------------------------------------------------------ */
/*  §5.10 — Modais                                                     */
/* ------------------------------------------------------------------ */
.fi-modal-window { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }

/* ------------------------------------------------------------------ */
/*  Login (SimplePage) — fundo azul + cartão branco flutuante         */
/* ------------------------------------------------------------------ */
.fi-simple-layout {
    background:
        radial-gradient(900px 520px at 12% -8%, rgba(255, 255, 255, .28), transparent 55%),
        radial-gradient(800px 520px at 100% 110%, rgba(255, 255, 255, .12), transparent 50%),
        linear-gradient(155deg, var(--blue-700) 0%, var(--blue-600) 46%, var(--blue-500) 100%);
}
.fi-simple-main {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, .65);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 34px 64px -22px rgba(2, 8, 23, .5);
    backdrop-filter: blur(8px);
}
.fi-simple-header-heading { color: var(--text); font-weight: 700; }

/* ------------------------------------------------------------------ */
/*  §7 — Acessibilidade: foco visível                                 */
/* ------------------------------------------------------------------ */
.fi-btn:focus-visible,
.fi-sidebar-item-button:focus-visible,
.fi-ta-row a:focus-visible,
a:focus-visible {
    outline: 2px solid var(--blue-300);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------------ */
/*  §4.8/§7 — prefers-reduced-motion                                  */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: .001ms !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
    }
    .fi-btn:active { transform: none; }
}
