/* ============================================================================
   CadCesol — Tema visual CESOL (identidade do Centro Público de Economia
   Solidária da Bahia). Arquivo ÚNICO de estilo customizado.
   Servido diretamente de /public (sem build/Vite neste ambiente).
   ========================================================================= */

:root {
    --cesol-cream:       #FFFDE8;   /* fundo principal */
    --cesol-cream-dark:  #FFF9CC;   /* fundo secundário / cards */
    --cesol-gold:        #F5A623;   /* destaque, bordas, ícones */
    --cesol-orange:      #E8721A;   /* botões primários, hover */
    --cesol-red:         #C0392B;   /* ações críticas, alertas */
    --cesol-maroon:      #7B1A1A;   /* footer, navbar escura */
    --cesol-white:       #FFFFFF;
    --cesol-text:        #3D2B1F;   /* texto principal (marrom escuro) */
    --cesol-text-muted:  #7A6050;   /* texto secundário */

    /* Gradiente de marca (barra decorativa / header PDF) */
    --cesol-gradient: linear-gradient(to right, #F5A623, #E8721A, #C0392B, #7B1A1A);
    --cesol-shadow-soft: 0 2px 10px rgba(61, 43, 31, .08);

    /* Par tipográfico da identidade */
    --font-display: 'Baloo 2', 'Nunito', system-ui, sans-serif;
    --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ------------------------------------------------------------- Tipografia */
body { font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
h1, h2, h3, h4, h5, h6, .section-title, .stat-num, .card-title,
.cesol-wordmark, .cesol-wordmark-light, .auth-heading, .navbar-brand {
    font-family: var(--font-display);
}
h1, .h1, h2, .h2 { letter-spacing: -.02em; }
h3, .h3, h4, .h4 { letter-spacing: -.01em; }
.table, .stat-num, .dx-stat-value { font-variant-numeric: tabular-nums; }
.btn { font-family: var(--font-body); }

/* ------------------------------------------------ Ícones Lucide (stroke) */
svg.lucide {
    width: 20px; height: 20px; stroke-width: 2; flex-shrink: 0;
    vertical-align: -0.25em; display: inline-block;
}
.btn-sm svg.lucide, .small svg.lucide, small svg.lucide { width: 18px; height: 18px; }
.table-actions svg.lucide { width: 18px; height: 18px; }
.dropdown-item svg.lucide, .breadcrumb svg.lucide { width: 16px; height: 16px; vertical-align: -0.2em; }

/* ---------------------------------------------------------------- Botões */
.btn-cesol-primary {
    background: linear-gradient(90deg, var(--cesol-orange), var(--cesol-gold));
    border: none;
    color: var(--cesol-white);
    font-weight: 600;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn-cesol-primary:hover,
.btn-cesol-primary:focus {
    background: linear-gradient(90deg, var(--cesol-red), var(--cesol-orange));
    color: var(--cesol-white);
    box-shadow: 0 4px 14px rgba(192, 57, 43, .3);
}

.btn-cesol-secondary {
    background: transparent;
    border: 2px solid var(--cesol-gold);
    color: var(--cesol-text);
    font-weight: 600;
    transition: all .2s ease;
}
.btn-cesol-secondary:hover,
.btn-cesol-secondary:focus {
    background: var(--cesol-gold);
    color: var(--cesol-white);
}

/* ---------------------------------------------------------------- Cards */
.card-cesol {
    background: var(--cesol-white);
    border: none;
    border-left: 4px solid var(--cesol-gold);
    border-radius: 8px;
    box-shadow: var(--cesol-shadow-soft);
}

/* ---------------------------------------------------------------- Badges */
.badge-cesol {
    background: var(--cesol-orange);
    color: var(--cesol-white);
    font-weight: 600;
}

/* ---------------------------------------------------------- Títulos de seção */
.section-title {
    color: var(--cesol-text);
    font-weight: 700;
    display: inline-block;
    padding-bottom: 4px;
    border-bottom: 3px solid var(--cesol-gold);
    margin-bottom: 1rem;
}

/* ------------------------------------------------------- Barra de gradiente */
.cesol-gradient-bar {
    height: 6px;
    width: 100%;
    background: var(--cesol-gradient);
    border: none;
}
.cesol-gradient-bar.thin { height: 4px; }

/* --------------------------------------------------------------- Animações */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
    animation: fadeInUp .4s ease both;
}

@keyframes pulseGold {
    0%   { box-shadow: 0 0 0 0 rgba(245, 166, 35, .55); }
    70%  { box-shadow: 0 0 0 12px rgba(245, 166, 35, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0); }
}
.pulse-gold {
    animation: pulseGold 1.8s infinite;
    border-radius: 50%;
}

/* Utilitários de cor da paleta (para uso pontual sem style inline) */
.text-cesol        { color: var(--cesol-text) !important; }
.text-cesol-muted  { color: var(--cesol-text-muted) !important; }
.text-cesol-gold   { color: var(--cesol-gold) !important; }
.text-cesol-orange { color: var(--cesol-orange) !important; }
.text-cesol-red    { color: var(--cesol-red) !important; }
.bg-cesol-cream    { background-color: var(--cesol-cream) !important; }
.bg-cesol-maroon   { background-color: var(--cesol-maroon) !important; }

/* ============================================================================
   ETAPA B — Layout base (navbar + sidebar + footer)
   ========================================================================= */

body {
    background-color: var(--cesol-cream);
    color: var(--cesol-text);
}
.tab-pane { padding-top: 1.25rem; }
.table thead th { white-space: nowrap; }

/* ---- Marca estilizada (fallback quando não há logo-cesol.png) ---- */
.cesol-wordmark {
    font-weight: 800; letter-spacing: .5px; line-height: 1; font-size: 1.5rem;
    background: linear-gradient(90deg, var(--cesol-gold), var(--cesol-orange), var(--cesol-red));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cesol-wordmark-light {
    font-weight: 800; letter-spacing: .5px; color: #fff; font-size: 1.4rem;
}
.cesol-logo-img { height: 40px; width: auto; }

/* ============================================================================
   HEADER v2 — topbar glass, contexto de página, busca (Ctrl+K), ações
   ========================================================================= */
.cesol-navbar {
    position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; gap: 14px;
    padding: 0 18px; min-height: 64px;
    color: #fff;
    background: linear-gradient(90deg, rgba(123,26,26,.82), rgba(74,16,16,.86));
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,.10);
    transition: min-height .25s ease, padding .25s ease, background .25s ease;
}
.cesol-navbar.is-scrolled {
    min-height: 56px; padding-top: 0; padding-bottom: 0;
    background: linear-gradient(90deg, rgba(123,26,26,.92), rgba(74,16,16,.94));
}
/* Fio inferior: hairline normal → gradiente animado quando rolado */
.cesol-navbar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: var(--cesol-gradient); background-size: 300% 100%;
    opacity: 0; transition: opacity .3s ease;
}
.cesol-navbar.is-scrolled::after { opacity: 1; animation: hdrHairline 8s linear infinite; }
@keyframes hdrHairline { from { background-position: 0 0; } to { background-position: 300% 0; } }

.hdr-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.hdr-center { flex: 0 1 420px; display: flex; justify-content: center; }
.hdr-right { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; flex: 1 1 auto; justify-content: flex-end; }

.btn-hamburger { color: #fff; border: none; background: transparent; padding: 6px; border-radius: 10px; display: inline-flex; }
.btn-hamburger:hover { background: rgba(255,255,255,.12); }
.cesol-navbar .navbar-brand .cesol-logo-img { height: 34px; width: auto; }

/* Contexto da página (título + trilha) */
.hdr-context { min-width: 0; }
.hdr-title {
    font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; line-height: 1.15;
    margin: 0; color: #fff; letter-spacing: -.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw;
    animation: hdrTitleIn .25s ease both;
}
@keyframes hdrTitleIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hdr-crumbs { display: flex; align-items: center; gap: 5px; font-size: .74rem; color: rgba(255,255,255,.62); margin-top: 1px; }
.hdr-crumb { color: rgba(255,255,255,.62); text-decoration: none; white-space: nowrap; }
.hdr-crumb:hover { color: #fff; }
.hdr-crumb.current { color: var(--cesol-gold); font-weight: 600; }
.hdr-crumb-home { display: inline-flex; }
.hdr-crumbs svg.lucide { width: 13px; height: 13px; }
.hdr-sep { color: rgba(255,255,255,.32); }
.is-scrolled .hdr-crumbs { display: none; }
@media (max-width: 767.98px) {
    .hdr-crumbs { display: none; }
    .hdr-title { font-size: 1rem; max-width: 46vw; }
}

/* Busca (pill) */
.hdr-search {
    display: inline-flex; align-items: center; gap: 9px; width: 100%; max-width: 420px;
    padding: 8px 12px; border-radius: 12px; cursor: text;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); color: rgba(255,255,255,.85);
    transition: background .15s ease, border-color .15s ease;
}
.hdr-search:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.28); }
.hdr-search:focus-visible { outline: 3px solid rgba(245,166,35,.6); outline-offset: 2px; }
.hdr-search svg.lucide { width: 18px; height: 18px; opacity: .8; }
.hdr-search-hint { flex: 1; text-align: left; font-size: .86rem; color: rgba(255,255,255,.7);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .3s ease; }
.hdr-kbd {
    font-family: var(--font-body); font-size: .68rem; font-weight: 700; color: rgba(255,255,255,.85);
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18);
    border-radius: 6px; padding: 2px 6px; line-height: 1; white-space: nowrap;
}
.hdr-kbd-mod { opacity: .85; }
@media (max-width: 767.98px) {
    .hdr-center { flex: 0 0 auto; }
    .hdr-search { width: 40px; padding: 8px; justify-content: center; }
    .hdr-search .hdr-search-hint, .hdr-search .hdr-kbd { display: none; }
}

/* Ações: sino + usuário */
.hdr-icon-btn {
    position: relative; color: #fff; background: transparent; border: none;
    width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s ease;
}
.hdr-icon-btn:hover { background: rgba(255,255,255,.12); }
.hdr-icon-btn:focus-visible, .hdr-user:focus-visible { outline: 3px solid rgba(245,166,35,.6); outline-offset: 2px; }
.notif-bell svg.lucide { width: 20px; height: 20px; }
.notif-bell:hover svg.lucide { animation: bellShake .5s ease; transform-origin: 50% 4px; }
@keyframes bellShake { 0%,100%{transform:rotate(0)} 20%{transform:rotate(12deg)} 40%{transform:rotate(-9deg)} 60%{transform:rotate(6deg)} 80%{transform:rotate(-3deg)} }
.notif-count {
    position: absolute; top: 4px; right: 4px; min-width: 15px; height: 15px; padding: 0 3px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .6rem; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums;
    background: var(--cesol-gold); color: #3d2b1f; border-radius: 10px;
    animation: countPop .3s ease;
}
@keyframes countPop { from { transform: scale(.4); } 60% { transform: scale(1.2); } to { transform: scale(1); } }

.hdr-user {
    display: inline-flex; align-items: center; gap: 9px; background: transparent; border: none; color: #fff;
    padding: 5px 10px 5px 5px; border-radius: 999px; transition: background .15s ease;
}
.hdr-user:hover { background: rgba(255,255,255,.12); }
.hdr-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--cesol-gold), var(--cesol-orange));
    color: #fff; font-family: var(--font-display); font-weight: 700; font-size: .88rem;
    box-shadow: 0 0 0 0 rgba(245,166,35,.5); transition: box-shadow .18s ease;
}
.hdr-user:hover .hdr-avatar { box-shadow: 0 0 0 3px rgba(245,166,35,.35); }
.hdr-user-meta { flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.hdr-user-name { font-size: .84rem; font-weight: 700; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.hdr-user-role { font-size: .7rem; color: rgba(255,255,255,.62); white-space: nowrap; }
.hdr-user-caret svg.lucide { width: 16px; height: 16px; opacity: .7; }

/* Dropdowns animados + stagger */
.hdr-dropdown { border: none; border-radius: 14px; box-shadow: 0 16px 40px rgba(15,23,42,.18); padding: .4rem; min-width: 232px; }
.hdr-dropdown.show { animation: ddIn .18s cubic-bezier(.4,0,.2,1) both; transform-origin: top right; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.hdr-dropdown .dropdown-item { border-radius: 9px; font-size: .88rem; padding: .5rem .7rem; }
.hdr-dropdown.show .dropdown-item { animation: ddItem .22s ease both; }
.hdr-dropdown.show li:nth-child(1) .dropdown-item { animation-delay: .03s; }
.hdr-dropdown.show li:nth-child(2) .dropdown-item { animation-delay: .06s; }
.hdr-dropdown.show li:nth-child(3) .dropdown-item { animation-delay: .09s; }
.hdr-dropdown.show li:nth-child(4) .dropdown-item { animation-delay: .12s; }
.hdr-dropdown.show li:nth-child(5) .dropdown-item { animation-delay: .15s; }
@keyframes ddItem { from { opacity: 0; transform: translateX(4px); } to { opacity: 1; transform: none; } }

/* Command palette */
.cmdk-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; justify-content: center; align-items: flex-start;
    padding-top: 12vh; background: rgba(15,23,42,.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cmdk-panel {
    width: min(600px, calc(100vw - 32px)); background: #fff; color: var(--cesol-text);
    border-radius: 16px; box-shadow: 0 24px 70px rgba(15,23,42,.35); overflow: hidden;
}
.cmdk-enter { transition: opacity .2s ease, transform .2s cubic-bezier(.4,0,.2,1); }
.cmdk-enter-start { opacity: 0; transform: translateY(-10px) scale(.97); }
.cmdk-enter-end { opacity: 1; transform: none; }
.cmdk-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #eee3d6; }
.cmdk-input-row svg.lucide { width: 20px; height: 20px; color: var(--cesol-orange); }
.cmdk-input { flex: 1; border: none; outline: none; font-size: 1rem; font-family: var(--font-body); color: var(--cesol-text); background: transparent; }
.cmdk-input-row .hdr-kbd { color: var(--cesol-text-muted); background: #f1ece2; border-color: #e6ddce; }
.cmdk-list { list-style: none; margin: 0; padding: 8px; max-height: 52vh; overflow-y: auto; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--cesol-text); }
.cmdk-item.active { background: linear-gradient(90deg, rgba(245,166,35,.16), rgba(232,114,26,.08)); }
.cmdk-item-ic { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--cesol-cream-dark); color: var(--cesol-orange);
    font-family: var(--font-display); font-weight: 700; font-size: .95rem; text-transform: uppercase; }
.cmdk-item.active .cmdk-item-ic { background: linear-gradient(135deg, var(--cesol-gold), var(--cesol-orange)); color: #fff; }
.cmdk-item-label { flex: 1; font-weight: 600; font-size: .92rem; }
.cmdk-item-grupo { font-size: .7rem; color: var(--cesol-text-muted); text-transform: uppercase; letter-spacing: .05em; }
.cmdk-empty { padding: 22px 12px; text-align: center; color: var(--cesol-text-muted); font-size: .9rem; }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid #eee3d6; font-size: .74rem; color: var(--cesol-text-muted); }
.cmdk-foot .hdr-kbd { color: var(--cesol-text-muted); background: #f1ece2; border-color: #e6ddce; }

/* Movimento reduzido: estados finais diretos */
@media (prefers-reduced-motion: reduce) {
    .cesol-navbar, .cesol-navbar.is-scrolled::after, .hdr-title, .hdr-dropdown.show,
    .hdr-dropdown.show .dropdown-item, .notif-bell:hover svg.lucide, .notif-count,
    .cmdk-enter, .hdr-search, .hdr-search-hint, .hdr-avatar {
        animation: none !important; transition: none !important;
    }
}

/* ---- Shell (sidebar + conteúdo) ---- */
.app-shell { display: flex; align-items: stretch; min-height: calc(100vh - 64px); }
.app-content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-content > main { flex: 1 0 auto; }

/* ---- Sidebar (retrátil no desktop) ---- */
.cesol-sidebar {
    background: linear-gradient(180deg, var(--cesol-maroon), #4A1010);
    --bs-offcanvas-width: 270px;
}
@media (min-width: 992px) {
    .cesol-sidebar {
        position: relative; overflow: visible;
        width: 256px; flex: 0 0 auto; min-height: calc(100vh - 64px);
        transition: width .22s cubic-bezier(.4, 0, .2, 1);
    }
    html.sb-mini .cesol-sidebar { width: 76px; }
    html.sb-mini .cesol-sidebar .nav-label { display: none; }
    html.sb-mini .cesol-sidebar .nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
    html.sb-mini .cesol-sidebar .sidebar-group {
        border-top: 1px solid rgba(255,255,255,.14); height: 0; margin: .55rem 1rem; padding: 0; overflow: hidden;
    }
    /* Marca: horizontal expandida ↔ ícone no mini */
    .cesol-sidebar .sb-logo-mini { display: none; }
    html.sb-mini .cesol-sidebar .sb-logo-full { display: none; }
    html.sb-mini .cesol-sidebar .sb-logo-mini { display: block; }
    html.sb-mini .sb-brand { justify-content: center; }
    html.sb-mini .sb-user { justify-content: center; padding-left: 0; padding-right: 0; }
    html.sb-mini .sb-logout-form { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .cesol-sidebar { transition: none; }
}

.sb-brand { align-items: center; gap: .6rem; padding: 1rem 1.1rem .8rem; text-decoration: none; }
.sb-brand .sb-logo-full { height: 44px; width: auto; max-width: 200px; }
.sb-brand .sb-logo-mini { height: 40px; width: 40px; }
.offcanvas-header .sb-logo-full { height: 40px; width: auto; }

/* Toggle no rail (borda direita) */
.sb-toggle {
    position: absolute; right: -13px; top: 26px; z-index: 1041;
    width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center;
    background: var(--cesol-gold); color: #3d2b1f; border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer; padding: 0;
    transition: transform .22s cubic-bezier(.4, 0, .2, 1), background .18s ease;
}
.sb-toggle:hover { background: var(--cesol-orange); color: #fff; }
.sb-toggle:focus-visible { outline: 3px solid rgba(245,166,35,.6); outline-offset: 2px; }
.sb-toggle svg.lucide { width: 15px; height: 15px; stroke-width: 2.6; }
html.sb-mini .sb-toggle { transform: rotate(180deg); }

.cesol-sidebar .offcanvas-body { padding: .5rem 0; }
.cesol-sidebar .sidebar-group {
    color: rgba(255,255,255,.55); font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; padding: .9rem 1.1rem .3rem; white-space: nowrap;
}
.cesol-sidebar hr { border-color: rgba(255,255,255,.12); margin: .35rem 1rem; }
.cesol-sidebar .nav-link {
    color: rgba(255,255,255,.82); padding: .68rem 1.1rem; min-height: 44px;
    display: flex; align-items: center; gap: .7rem;
    border-left: 3px solid transparent; transition: background .18s ease, border-color .18s ease;
    font-size: .93rem; white-space: nowrap;
}
.cesol-sidebar .nav-link svg.lucide { width: 20px; height: 20px; }
.cesol-sidebar .nav-link:hover {
    background: linear-gradient(90deg, rgba(245,166,35,.22), transparent);
    color: #fff;
}
.cesol-sidebar .nav-link.active {
    background: rgba(245,166,35,.16); color: #fff; border-left-color: var(--cesol-gold); font-weight: 600;
}
.cesol-sidebar .nav-link:focus-visible { outline: 3px solid rgba(245,166,35,.6); outline-offset: -3px; }

/* Rodapé: usuário + sair */
.sb-user {
    display: flex; align-items: center; gap: .65rem; padding: .8rem 1.1rem;
    border-top: 1px solid rgba(255,255,255,.12); min-height: 60px;
}
.sb-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--cesol-gold), var(--cesol-orange));
    color: #fff; font-family: var(--font-display); font-weight: 700; font-size: .9rem;
}
.sb-user-info { display: flex; flex-direction: column; min-width: 0; }
.sb-user-name { color: #fff; font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { color: rgba(255,255,255,.6); font-size: .72rem; white-space: nowrap; }
.sb-logout-form { margin-left: auto; }
.sb-logout {
    background: transparent; border: none; color: rgba(255,255,255,.7); padding: .45rem;
    border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
}
.sb-logout:hover { color: #fff; background: rgba(192,57,43,.35); }
.sb-logout:focus-visible { outline: 3px solid rgba(245,166,35,.6); }
.sb-logout svg.lucide { width: 18px; height: 18px; }

/* ---- Footer ---- */
.cesol-footer { margin-top: auto; }
.cesol-footer .footer-bar { background: var(--cesol-maroon); color: #fff; font-size: 12px; padding: 10px 16px; }

/* ============================================================================
   ETAPA C — Tela de Login (duas colunas + curva CESOL)
   ========================================================================= */

.auth-split { display: flex; min-height: 100vh; }
.auth-split .auth-left,
.auth-split .auth-right { flex: 1 1 50%; position: relative; }

/* Coluna esquerda decorativa */
.auth-left {
    background: var(--cesol-cream);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding: 2rem 3rem;
}
.auth-left-bar { position: absolute; top: 0; left: 0; bottom: 0; width: 6px; background: var(--cesol-gradient); }
/* Curva CESOL (sol nascente) via círculo grande no rodapé */
.auth-left::before {
    content: ''; position: absolute; left: 50%; bottom: -55%;
    width: 130%; padding-bottom: 130%; transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, rgba(245,166,35,.35), rgba(232,114,26,.18) 55%, transparent 72%);
    pointer-events: none;
}
.auth-left .auth-brand { position: relative; z-index: 2; text-align: center; max-width: 420px; }
.auth-logo { max-width: 220px; max-height: 200px; width: auto; height: auto; margin-bottom: 1.2rem; }
.auth-left .auth-title { color: var(--cesol-text); font-weight: 800; font-size: 1.35rem; line-height: 1.3; }
.auth-left .auth-subtitle { color: var(--cesol-text-muted); font-size: .95rem; }

/* Ícones flutuantes animados */
.float-icon { position: absolute; color: var(--cesol-orange); opacity: .35; z-index: 1; animation: floatY 5s ease-in-out infinite; }
.float-icon.i1 { top: 14%; left: 18%; width: 2rem; height: 2rem; animation-delay: 0s; }
.float-icon.i2 { top: 24%; right: 16%; width: 2.6rem; height: 2.6rem; color: var(--cesol-gold); animation-delay: .8s; }
.float-icon.i3 { bottom: 22%; left: 14%; width: 2.4rem; height: 2.4rem; color: var(--cesol-red); animation-delay: 1.6s; }
.float-icon.i4 { bottom: 16%; right: 20%; width: 2rem; height: 2rem; color: var(--cesol-maroon); animation-delay: 2.4s; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* Coluna direita — formulário */
.auth-right { background: var(--cesol-white); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .auth-heading { color: var(--cesol-text); font-weight: 700; }
.cesol-wordmark-lg { font-size: 2.6rem; }

/* Responsivo: empilha em telas pequenas, some a coluna decorativa */
@media (max-width: 767.98px) {
    .auth-split { flex-direction: column; min-height: auto; }
    .auth-split .auth-left { display: none; }
    .auth-split .auth-right { min-height: 100vh; }
}

/* ============================================================================
   ETAPA D — Dashboard (cards de estatística + curva decorativa)
   ========================================================================= */

.stat-card {
    background: var(--cesol-white); border: none; border-top: 4px solid var(--cesol-gold);
    border-radius: 10px; box-shadow: var(--cesol-shadow-soft); position: relative; overflow: hidden;
}
.stat-card .stat-num { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--cesol-text); }
.stat-card .stat-label { color: var(--cesol-text-muted); font-size: .85rem; }
.stat-icon {
    width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 1.5rem; color: #fff; background: var(--cesol-gold);
    flex: 0 0 auto;
}
.stat-gold   { border-top-color: var(--cesol-gold); }   .stat-gold   .stat-icon { background: var(--cesol-gold); }
.stat-orange { border-top-color: var(--cesol-orange); } .stat-orange .stat-icon { background: var(--cesol-orange); }
.stat-green  { border-top-color: #2d6a4f; }             .stat-green  .stat-icon { background: #2d6a4f; }
.stat-maroon { border-top-color: var(--cesol-maroon); } .stat-maroon .stat-icon { background: var(--cesol-maroon); }
.stat-blue      { border-top-color: #264653; } .stat-blue      .stat-icon { background: #264653; }
.stat-darkgreen { border-top-color: #1b4332; } .stat-darkgreen .stat-icon { background: #1b4332; }

/* Delays escalonados para animação de entrada */
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }
.delay-4 { animation-delay: .4s; }
.delay-5 { animation-delay: .5s; }

/* Caixa de gráfico (Chart.js) — altura fixa p/ responsividade */
.chart-card .chart-title { color: var(--cesol-text); font-weight: 700; font-size: .95rem; margin-bottom: .25rem; }
.chart-box { position: relative; height: 280px; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 280px;
    color: var(--cesol-text-muted); font-size: .9rem; }

/* Curva decorativa sutil no canto inferior direito */
.dash-curve {
    position: fixed; right: -160px; bottom: -160px; width: 380px; height: 380px; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(245,166,35,.16), rgba(232,114,26,.10) 55%, transparent 72%);
    pointer-events: none; z-index: 0;
}

/* ============================================================================
   ETAPA E — Listagens (cabeçalho/breadcrumb, ações, paginação, badges)
   ========================================================================= */

/* Cabeçalho de página */
.page-header .breadcrumb { margin: 0; font-size: .82rem; }
.page-header .breadcrumb-item a { color: var(--cesol-orange); text-decoration: none; }
.page-header .breadcrumb-item.active { color: var(--cesol-text-muted); }
.page-header .breadcrumb-item + .breadcrumb-item::before { color: var(--cesol-text-muted); }

/* Grupo de ações em ícone */
.table-actions .btn {
    --bs-btn-padding-y: .28rem; --bs-btn-padding-x: .5rem;
    border-color: #e2ddd4; color: var(--cesol-text-muted); background: #fff;
}
.table-actions .btn:hover { background: var(--cesol-cream-dark); color: var(--cesol-text); border-color: var(--cesol-gold); }
.table-actions .btn.act-edit:hover   { color: var(--cesol-orange); }
.table-actions .btn.act-pdf:hover    { color: var(--cesol-red); }
.table-actions .btn.act-add:hover    { color: #2d6a4f; }
.table-actions .btn.act-ok:hover     { color: #2d6a4f; }
.table-actions .btn.act-del:hover    { color: #fff; background: var(--cesol-red); border-color: var(--cesol-red); }

/* Cabeçalho de tabela com identidade */
.table-cesol thead th { background: var(--cesol-cream-dark); color: var(--cesol-text); border-bottom: 2px solid var(--cesol-gold); }

/* Badges de status */
.badge-ativo    { background: #2d6a4f; color: #fff; }
.badge-inativo  { background: #adb5bd; color: #fff; }
.badge-carteira { background: var(--cesol-gold); color: #3d2b1f; }

/* Paginação laranja */
.pagination { --bs-pagination-color: var(--cesol-orange); --bs-pagination-hover-color: var(--cesol-red);
    --bs-pagination-focus-color: var(--cesol-red); --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(232,114,26,.25); }
.pagination .page-item.active .page-link {
    background-color: var(--cesol-orange); border-color: var(--cesol-orange); color: #fff;
}

/* ============================================================================
   ETAPA F — Formulário EES (stepper, campos, botões)
   ========================================================================= */

/* Stepper horizontal */
.stepper { display: flex; overflow-x: auto; gap: 0; padding: .25rem 0 .5rem; }
.stepper .step {
    flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: .25rem .55rem; border: none; background: transparent; min-width: 84px; cursor: pointer;
}
.stepper .step .step-circle {
    width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; background: #e9ecef; color: #6c757d; transition: all .2s ease; font-size: 1rem;
}
.stepper .step .step-label { font-size: .66rem; margin-top: .3rem; color: var(--cesol-text-muted); max-width: 88px; line-height: 1.15; }
.stepper .step.active .step-circle { background: var(--cesol-orange); color: #fff; box-shadow: 0 0 0 4px rgba(232,114,26,.18); }
.stepper .step.active .step-label { color: var(--cesol-text); font-weight: 600; }
.stepper .step.completed .step-circle { background: #2d6a4f; color: #fff; }
.stepper .step-circle .chk { display: none; }
.stepper .step.completed .step-circle .num { display: none; }
.stepper .step.completed .step-circle .chk { display: inline; }
.stepper-progress { height: 6px; background: #e9ecef; border-radius: 3px; overflow: hidden; margin: .1rem 0 1rem; }
.stepper-progress .bar { height: 100%; background: var(--cesol-gradient); width: 0; transition: width .35s ease; }

/* Campos: foco dourado + checks laranja/dourado */
.form-control:focus, .form-select:focus {
    border-color: var(--cesol-gold); box-shadow: 0 0 0 .2rem rgba(245,166,35,.25);
}
.form-check-input:checked { background-color: var(--cesol-orange); border-color: var(--cesol-orange); }
.form-check-input:focus { border-color: var(--cesol-gold); box-shadow: 0 0 0 .2rem rgba(245,166,35,.25); }

/* Separador de seção do formulário */
.form-section-title {
    color: var(--cesol-text); font-weight: 700; font-size: .95rem;
    border-bottom: 2px solid var(--cesol-gold); padding-bottom: .3rem; margin: .5rem 0 1rem;
}

/* Botão grande de carteira */
.btn-carteira { font-weight: 700; padding: .7rem 1.6rem; }

/* ============================================================================
   ETAPA G — Uploads (dropzone, grade de miniaturas, pills)
   ========================================================================= */

.nav-cesol .nav-link { color: var(--cesol-text-muted); font-size: .85rem; }
.nav-cesol .nav-link.active { background: var(--cesol-orange); color: #fff; }

.upload-dropzone {
    display: block; border: 2px dashed var(--cesol-gold); border-radius: 10px; padding: 1.5rem;
    text-align: center; cursor: pointer; background: var(--cesol-cream); transition: all .2s ease;
}
.upload-dropzone:hover, .upload-dropzone.dragging { background: var(--cesol-cream-dark); border-color: var(--cesol-orange); }
.upload-dropzone > svg.lucide { width: 3rem; height: 3rem; color: var(--cesol-gold); display: block; margin-bottom: .4rem; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.media-item { border: 1px solid #e6e0d6; border-radius: 8px; overflow: hidden; background: #fff; }
.media-thumb { display: flex; align-items: center; justify-content: center; height: 90px; background: var(--cesol-cream); text-decoration: none; overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb svg.lucide { width: 2.5rem; height: 2.5rem; }
.media-meta { padding: .4rem .5rem; }
.media-name { font-size: .72rem; font-weight: 600; color: var(--cesol-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-size { font-size: .68rem; color: var(--cesol-text-muted); }
.media-actions { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #f0ece4; padding: .1rem .3rem; }
.media-actions .btn { --bs-btn-padding-y: .1rem; --bs-btn-padding-x: .4rem; color: var(--cesol-text-muted); }

/* ============================================================================
   ETAPA H — Relatórios (cards por categoria)
   ========================================================================= */

.report-card { transition: transform .2s ease, box-shadow .2s ease; }
.report-card:hover { transform: scale(1.02); box-shadow: 0 8px 24px rgba(61,43,31,.14); }
.report-icon {
    width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center;
    justify-content: center; font-size: 1.7rem; color: #fff;
}
.report-icon.ic-ees { background: var(--cesol-gold); }
.report-icon.ic-benef { background: var(--cesol-orange); }
.report-icon.ic-quest { background: var(--cesol-maroon); }
.btn-excel { background: #1D6F42; border-color: #1D6F42; color: #fff; }
.btn-excel:hover, .btn-excel:focus { background: #155a35; border-color: #155a35; color: #fff; }
.btn-pdf { background: var(--cesol-red); border-color: var(--cesol-red); color: #fff; }
.btn-pdf:hover, .btn-pdf:focus { background: #a5281c; border-color: #a5281c; color: #fff; }

/* ============================================================================
   ETAPA I — Auditoria (badges de ação)
   ========================================================================= */
.badge-acao { color: #fff; font-weight: 600; }
.badge-acao-created     { background: #2d6a4f; }
.badge-acao-updated     { background: #2563eb; }
.badge-acao-deleted     { background: var(--cesol-red); }
.badge-acao-activated,
.badge-acao-deactivated { background: var(--cesol-orange); }
.badge-acao-login       { background: #0ea5e9; }
.badge-acao-logout      { background: #64748b; }

/* ============================================================================
   ETAPA K — Polimento (modais, alertas, spinner)
   ========================================================================= */

/* Modais com header colorido (exceto os que definem cor própria via .bg-*) */
.modal-header { background: var(--cesol-orange); color: #fff; }
.modal-header .modal-title { color: #fff; }
.modal-header .btn-close { filter: brightness(0) invert(1); opacity: .9; }

/* Alertas/toasts com identidade CESOL */
.alert-success { border-left: 4px solid var(--cesol-gold); }
.alert-danger  { border-left: 4px solid var(--cesol-red); }

/* Spinner dourado para operações assíncronas */
.spinner-cesol { color: var(--cesol-gold); }

/* ---- Badges por perfil (role) — classes de cor semânticas ---- */
.badge-role { color: #fff; font-weight: 600; }
.badge-role-marrom   { background: var(--cesol-maroon); }
.badge-role-vermelho { background: var(--cesol-red); }
.badge-role-laranja  { background: var(--cesol-orange); }
.badge-role-dourado  { background: var(--cesol-gold); color: #3d2b1f; }
.badge-role-azul     { background: #2563eb; }
.badge-role-roxo     { background: #7c3aed; }
.badge-role-verde    { background: #2d6a4f; }
.badge-role-cinza    { background: #6b7280; }

/* Ajustes pós-Lucide */
.cesol-navbar .btn-hamburger svg.lucide { width: 24px; height: 24px; }
.cesol-navbar .notif-bell svg.lucide { width: 20px; height: 20px; }
.guest-logo { max-width: 190px; height: auto; }
.stepper .step-label svg.lucide { width: 16px; height: 16px; }

/* ============================================================================
   TOM SELECT — autocomplete nos selects, com a paleta CESOL
   (carregado via CDN; este bloco sobrescreve o tema bootstrap5 do Tom Select)
   ========================================================================= */
.ts-wrapper .ts-control {
    border-radius: 10px;
    border-color: #dee2e6;
    min-height: 38px;
    font-family: var(--font-body);
    font-size: .95rem;
    color: var(--cesol-text);
}
.ts-wrapper.focus .ts-control {
    border-color: var(--cesol-gold);
    box-shadow: 0 0 0 .2rem rgba(245, 166, 35, .2);
}
.ts-wrapper.disabled .ts-control { background: #e9ecef; opacity: 1; }
.ts-wrapper .ts-control input { font-family: var(--font-body); color: var(--cesol-text); }
.ts-wrapper.single .ts-control::after { border-top-color: var(--cesol-text-muted); }

.ts-dropdown {
    border-radius: 10px; border-color: #e2ddd4;
    box-shadow: var(--cesol-shadow-soft);
    font-family: var(--font-body);
}
.ts-dropdown .option { padding: .5rem .75rem; }
.ts-dropdown .option:hover,
.ts-dropdown .active { background: rgba(245, 166, 35, .14); color: var(--cesol-text); }
.ts-dropdown .active.selected,
.ts-dropdown .selected { background: var(--cesol-orange); color: #fff; }
.ts-dropdown .no-results { color: var(--cesol-text-muted); }
.ts-dropdown .optgroup-header { color: var(--cesol-text-muted); font-weight: 700; font-size: .78rem; }

.ts-wrapper .clear-button { color: var(--cesol-red); opacity: .6; }
.ts-wrapper .clear-button:hover { opacity: 1; }

/* Estado de erro do Bootstrap refletido no wrapper */
.ts-wrapper.is-invalid .ts-control,
select.is-invalid + .ts-wrapper .ts-control { border-color: var(--cesol-red); }

/* ---- Seções de formulário (card com cabeçalho) — usado no form de beneficiário */
.form-section {
    background: var(--cesol-white); border: 1px solid #eee3d6; border-radius: 14px;
    box-shadow: var(--cesol-shadow-soft); margin-bottom: 1rem; overflow: hidden;
}
.form-section-head {
    display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem;
    background: linear-gradient(90deg, rgba(245, 166, 35, .14), rgba(232, 114, 26, .04));
    border-bottom: 1px solid rgba(245, 166, 35, .25);
    font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: #b45309;
}
.form-section-head svg.lucide { width: 18px; height: 18px; }
.form-section-body { padding: 1rem; }
