/* =====================================================================
   AEE CONECTA — estilos da aplicação (sobre Bootstrap 5.3)
   Paleta derivada do logotipo: azul-marinho institucional + cores de apoio.
   Contraste verificado para WCAG 2.2 AA (texto normal ≥ 4,5:1).
   ===================================================================== */
/* Fonte da interface: Inter (variável, pesos 100–900; licença SIL OFL) — desenhada para tela,
   alta legibilidade, números bem distintos e algarismos tabulares para colunas alinhadas. */
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --ig-navy: #0b3b78;
    --ig-primary: #1559b0;
    --ig-primary-hover: #0f4890;
    --ig-cyan: #0e86c1;
    --ig-green: #2e7d32;
    --ig-orange: #b45309;
    --ig-purple: #6d32c2;
    --ig-red: #b42318;
    --ig-bg: #ffffff;
    --ig-surface: #ffffff;
    --ig-border: #dde4ee;
    --ig-text: #1d2939;
    --ig-muted: #526075;
    --ig-sidebar-w: 264px;
    --ig-radius: 12px;
    --ig-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);

    --bs-primary: var(--ig-primary);
    --bs-primary-rgb: 21, 89, 176;
    --bs-link-color: var(--ig-primary);
    --bs-link-color-rgb: 21, 89, 176;
    --bs-link-hover-color: var(--ig-primary-hover);
    --bs-body-color: var(--ig-text);
    --bs-body-bg: var(--ig-bg);
    --bs-border-color: var(--ig-border);
    --bs-font-sans-serif: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

body { background: var(--ig-bg); color: var(--ig-text); font-size: .95rem; line-height: 1.55;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
/* O Inter tem altura-x 0,546 (Segoe UI: 0,500): sem ajuste ele parece ~9% maior. font-size-adjust iguala a altura
   visual das letras à da fonte anterior em todo o sistema, sem mexer em espaçamentos. Ícones ficam fora do ajuste. */
html { font-size-adjust: 0.5; }
.fa-solid, .fa-regular, .fa-brands, .fa, [class^="fa-"], [class*=" fa-"] { font-size-adjust: none; }
@supports not (font-size-adjust: 0.5) { body { font-size: .87rem; } }
/* números alinhados em tabelas, indicadores, datas e CPF */
.table, .stat-value, .form-control, .badge-status { font-variant-numeric: tabular-nums; }

/* ---------- foco visível e acessibilidade ---------- */
:focus-visible { outline: 3px solid #0b3b78 !important; outline-offset: 2px; box-shadow: 0 0 0 5px #ffd24d !important; }
.skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 2000; padding: .6rem 1rem;
    background: var(--ig-navy); color: #fff; border-radius: 8px; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 8px; color: #fff; }
.required-mark { color: var(--ig-red); font-weight: 700; margin-left: 2px; }
.form-hint { font-size: .8rem; color: var(--ig-muted); }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- botões (sempre com cor) ---------- */
.btn { border-radius: 8px; font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--ig-primary); --bs-btn-border-color: var(--ig-primary); --bs-btn-hover-bg: var(--ig-primary-hover); --bs-btn-hover-border-color: var(--ig-primary-hover); --bs-btn-active-bg: var(--ig-navy); }
.btn-secondary { --bs-btn-bg: #475569; --bs-btn-border-color: #475569; --bs-btn-hover-bg: #334155; --bs-btn-hover-border-color: #334155; }
.btn-success { --bs-btn-bg: var(--ig-green); --bs-btn-border-color: var(--ig-green); --bs-btn-hover-bg: #256628; --bs-btn-hover-border-color: #256628; }
.btn-danger { --bs-btn-bg: var(--ig-red); --bs-btn-border-color: var(--ig-red); }
.btn-warning { --bs-btn-bg: #f5b400; --bs-btn-border-color: #f5b400; --bs-btn-color: #1d2939; }
/* Ações do estudo de caso: uma cor por etapa do processo (texto branco com contraste AA, exceto prioridade) */
.btn-step { --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; --bs-btn-bg: var(--step); --bs-btn-border-color: var(--step);
    --bs-btn-hover-bg: var(--step-dark); --bs-btn-hover-border-color: var(--step-dark); --bs-btn-active-bg: var(--step-dark); --bs-btn-active-border-color: var(--step-dark);
    --bs-btn-disabled-bg: var(--step); --bs-btn-disabled-border-color: var(--step); }
.step-receber { --step: #3949ab; --step-dark: #283593; }
.step-triagem { --step: #0f766e; --step-dark: #115e59; }
.step-prioridade { --step: #f5b400; --step-dark: #d99e00; --bs-btn-color: #1d2939; --bs-btn-hover-color: #1d2939; --bs-btn-active-color: #1d2939; }
.step-atribuir { --step: #6d32c2; --step-dark: #55259a; }
.step-espera { --step: #c2410c; --step-dark: #9a3412; }
.step-atendimento { --step: #0e7490; --step-dark: #155e75; }
.step-retomar { --step: #2e7d32; --step-dark: #256628; }
.step-encaminhar { --step: #be185d; --step-dark: #9d174d; }
.step-concluir { --step: #b42318; --step-dark: #912018; }
/* Painel: card de boas-vindas destacado do fundo da página */
.welcome-card { background: linear-gradient(120deg, #e8f1fd 0%, #eef6ff 55%, #f4efff 100%); border-color: #c9dcf5; }
/* PAEE: roteiro de etapas */
.paee-step { color: var(--ig-text); }
.paee-step:hover { background: #eef4fc; }
.paee-step.active { background: #e3eefc; }
.paee-step-n { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ig-border); display: inline-grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--ig-muted); flex-shrink: 0; background: #fff; }
.paee-step.active .paee-step-n { border-color: var(--ig-primary); color: var(--ig-primary); }
.area-group .btn-area-new { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .875rem; color: #fff;
    background: linear-gradient(135deg, #2e7d32, #1f9d55); border: 1px solid #23753a; padding-inline: .85rem; box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.area-group .btn-area-new i { font-size: 1rem; }
.area-group .btn-area-new:hover, .area-group .btn-area-new:focus-visible { background: linear-gradient(135deg, #256628, #188048); color: #fff; }
.area-group .btn-area-new:focus-visible { outline: 3px solid rgba(46,125,50,.35); outline-offset: 1px; }
.paee-step-n.done { background: var(--ig-green); border-color: var(--ig-green); color: #fff; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- layout ---------- */
.app-shell { min-height: 100vh; }
.app-sidebar {
    width: var(--ig-sidebar-w); background: var(--ig-surface); border-right: 1px solid var(--ig-border);
}
@media (min-width: 992px) {
    .app-sidebar { position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; }
    .app-main { margin-left: var(--ig-sidebar-w); }
}
.sidebar-brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.25rem; text-decoration: none; }
.sidebar-brand img { width: 44px; height: auto; }
.sidebar-brand .brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: .03em; color: var(--ig-navy); line-height: 1; white-space: nowrap; }
.sidebar-brand .brand-sub { display: block; font-size: .7rem; font-weight: 600; color: var(--ig-muted); letter-spacing: .02em; margin-top: 3px; }
.nav-section { padding: .9rem 1.25rem .35rem; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ig-muted); }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: .7rem; margin: 1px .75rem; padding: .55rem .75rem;
    border-radius: 8px; color: var(--ig-text); font-weight: 500;
}
.sidebar-nav .nav-link i { font-size: 1.1rem; color: var(--ig-primary); }
.sidebar-nav .nav-link:hover { background: #eaf1fb; color: var(--ig-navy); }
.sidebar-nav .nav-link.active { background: var(--ig-primary); color: #fff; }
.sidebar-nav .nav-link.active i { color: #fff; }

.app-header {
    position: sticky; top: 0; z-index: 1020; background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--ig-border); backdrop-filter: blur(6px);
}
.app-header .page-title { font-size: 1.15rem; font-weight: 700; color: var(--ig-navy); margin: 0; }
.user-chip { display: flex; align-items: center; gap: .6rem; text-align: right; }
.user-chip .avatar {
    width: 38px; height: 38px; border-radius: 50%; background: var(--ig-navy); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.user-chip .meta { line-height: 1.15; }
.user-chip .meta small { color: var(--ig-muted); }
.app-content { padding: 1.5rem; }
@media (max-width: 575.98px) { .app-content { padding: 1rem; } }

/* ---------- cartões ---------- */
.card { border: 1px solid var(--ig-border); border-radius: var(--ig-radius); box-shadow: var(--ig-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--ig-border); padding: .9rem 1.1rem; }
.card-header h2, .card-header .card-title { font-size: 1rem; font-weight: 700; color: var(--ig-navy); margin: 0; }

.stat-card { display: flex; flex-direction: row; gap: 1rem; align-items: center; padding: 1.1rem; text-decoration: none; color: inherit; height: 100%; }
.stat-card:hover { border-color: var(--ig-primary); color: inherit; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; color: var(--ig-navy); }
.stat-label { color: var(--ig-muted); font-weight: 600; font-size: .85rem; }
.tone-blue .stat-icon { background: #e3eefc; color: var(--ig-primary); }
.tone-green .stat-icon { background: #e5f4e6; color: var(--ig-green); }
.tone-orange .stat-icon { background: #fdf0e1; color: var(--ig-orange); }
.tone-purple .stat-icon { background: #efe7fb; color: var(--ig-purple); }

/* ---------- tabelas ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th {
    font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ig-muted);
    background: #f7f9fc; border-bottom: 1px solid var(--ig-border); white-space: nowrap; font-weight: 700;
}
.table > tbody td { vertical-align: middle; }
.table-responsive { border-radius: 0 0 var(--ig-radius) var(--ig-radius); }
.sort-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; gap: .25rem; align-items: center; }
.sort-btn[aria-sort="ascending"]::after { content: "▲"; font-size: .6rem; }
.sort-btn[aria-sort="descending"]::after { content: "▼"; font-size: .6rem; }
.row-link { color: var(--ig-primary); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; text-align: left; }
.row-link:hover { text-decoration: underline; }
.list-footer { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: .75rem 1.1rem; border-top: 1px solid var(--ig-border); }
.loading-row td { text-align: center; color: var(--ig-muted); padding: 2rem !important; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--ig-muted); }
.empty-state i { font-size: 2rem; display: block; margin-bottom: .5rem; color: #98a2b3; }

/* ---------- selos de situação (sempre com ícone + texto, nunca só cor) ---------- */
.badge-status { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; font-size: .78rem; padding: .3rem .6rem; border-radius: 999px; }
.badge-ok { background: #e5f4e6; color: #1e5e22; }
.badge-off { background: #eef0f3; color: #3f4a5a; }
.badge-warn { background: #fdf0e1; color: #8a3d05; }
.badge-danger { background: #fdeceb; color: #8f1d14; }
.badge-info { background: #e3eefc; color: #0f4890; }
.badge-purple { background: #efe7fb; color: #55259a; }

/* ---------- formulários ---------- */
.form-label { font-weight: 600; font-size: .87rem; margin-bottom: .3rem; }
.form-control, .form-select { border-radius: 8px; border-color: #c9d3e0; }
.form-control:focus, .form-select:focus { border-color: var(--ig-primary); box-shadow: 0 0 0 .2rem rgba(21, 89, 176, .2); }
.form-section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ig-primary); margin: 1rem 0 .6rem; padding-bottom: .3rem; border-bottom: 1px solid var(--ig-border); }
.modal-content { border-radius: var(--ig-radius); border: 0; }
.modal-header { border-bottom-color: var(--ig-border); }
.modal-title { font-weight: 700; color: var(--ig-navy); font-size: 1.1rem; }
.check-list { max-height: 220px; overflow-y: auto; border: 1px solid #c9d3e0; border-radius: 8px; padding: .5rem .75rem; }
.secret-box { font-family: Consolas, "Courier New", monospace; font-size: 1.15rem; letter-spacing: .05em; background: #f7f9fc; border: 1px dashed var(--ig-primary); border-radius: 8px; padding: .6rem .8rem; user-select: all; word-break: break-all; }

/* ---------- matriz de permissões ---------- */
.perm-matrix th.role-col { text-align: center; min-width: 120px; white-space: normal; }
.perm-matrix td.cell { text-align: center; }
.perm-matrix .module-row th { background: #eaf1fb; color: var(--ig-navy); text-transform: none; letter-spacing: 0; font-size: .85rem; }
.perm-matrix .form-check-input { width: 1.2em; height: 1.2em; cursor: pointer; }
.sticky-col { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 260px; }
thead .sticky-col { background: #f7f9fc; }

/* ---------- autenticação ---------- */
/* ---------- Login (inspirado no JAC): cartão central sobre fundo nas cores do logo AEE CONECTA ---------- */
.tela-login {
    min-height: 100vh; position: relative; overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 12%, rgba(119, 70, 190, .45), transparent 38%),
        radial-gradient(circle at 88% 12%, rgba(119, 70, 190, .45), transparent 38%),
        radial-gradient(circle at 8% 88%, rgba(3, 148, 171, .45), transparent 42%),
        radial-gradient(circle at 92% 88%, rgba(3, 148, 171, .45), transparent 42%),
        linear-gradient(180deg, #04264d 0%, #00498C 48%, #0b5fa8 100%);
}
/* textura sutil de pontos */
.tela-login::before {
    content: ""; position: fixed; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.4px);
    background-size: 22px 22px;
}
/* luzes desfocadas que flutuam devagar */
.login-luzes { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.login-luzes .luz { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: luz-flutua 18s ease-in-out infinite alternate; }
/* lados espelhados: roxo em cima e turquesa embaixo, à esquerda e à direita */
.luz-roxa { width: 340px; height: 340px; background: #7746BE; top: -90px; right: -60px; }
.luz-roxa-esq { width: 340px; height: 340px; background: #7746BE; top: -90px; left: -60px; animation-delay: -6s; }
.luz-turquesa { width: 260px; height: 260px; background: #0394AB; bottom: 6%; right: 6%; animation-delay: -9s; }
.luz-turquesa-esq { width: 260px; height: 260px; background: #0394AB; bottom: 6%; left: 6%; animation-delay: -3s; }
@keyframes luz-flutua {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(40px, -30px) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) { .login-luzes .luz { animation: none; } }

.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; }
.login-card {
    width: 100%; max-width: 440px; background: #fff; border-radius: 24px; padding: 34px 30px 30px; position: relative; overflow: hidden;
    box-shadow: 0 30px 60px rgba(2, 20, 45, .45), 0 0 0 1px rgba(255, 255, 255, .25);
}
/* faixa com as cores do logo no topo do cartão */
.login-card::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px;
    background: linear-gradient(90deg, #0071C6, #0394AB, #48A83C, #FCB803, #F97F0B, #7746BE);
}
.login-marca { text-align: center; margin-bottom: 18px; }
.login-logo { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; }
.login-card h1 { font-size: 1.3rem; font-weight: 800; color: #00498C; text-align: center; margin-bottom: .25rem; }
.login-card .lead-text { text-align: center; color: var(--ig-muted); font-size: .92rem; }
.input-icone { position: relative; }
.input-icone > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #0071C6; font-size: 1.15rem; pointer-events: none; z-index: 2; }
.input-icone > .form-control { padding-left: 2.75rem; border-radius: 12px; }
.input-icone > .form-control:focus { border-color: #0071C6; }
.input-icone + .form-hint { margin-top: .55rem; } /* afasta a dica do campo (anel de foco duplo) */
.btn-entrar { border-radius: 12px; font-weight: 700; background: linear-gradient(90deg, #00498C, #0071C6); border: 0; }
.btn-entrar:hover, .btn-entrar:focus-visible { background: linear-gradient(90deg, #003a70, #005fa8); }
.login-rodape { color: rgba(255, 255, 255, .85); font-size: .82rem; margin: 22px 0 0; text-align: center; max-width: 440px; line-height: 1.6; }
.login-rodape a { color: #fff; font-weight: 600; }
.login-frase { display: block; font-style: italic; font-size: .95rem; color: #fff; margin-bottom: 6px; }
/* cartão duplo (como no JAC): à esquerda brasão, administração municipal e Programa TransforMAR */
.login-card-duplo { max-width: 960px; padding: 0; display: grid; }
.login-form { padding: 34px 30px 30px; }
.login-arte { order: 2; background: #fff; border-top: 1px solid #e6ebf2; padding: 22px 20px 24px; text-align: center; }
.login-arte-topo { display: flex; align-items: center; justify-content: center; gap: 22px; }
.login-brasao, .login-prefeitura { width: 92px; height: auto; }
.login-arte-legenda { margin: 10px 0 14px; font-size: .82rem; font-weight: 700; color: #00498C; letter-spacing: .02em; }
.login-arte-link { display: inline-block; border-radius: 12px; transition: transform .2s ease; }
.login-arte-link:hover, .login-arte-link:focus-visible { transform: translateY(-2px) scale(1.03); }
@media (prefers-reduced-motion: reduce) { .login-arte-link { transition: none; } .login-arte-link:hover { transform: none; } }
.login-transformar { width: 100%; max-width: 200px; height: auto; }
@media (min-width: 992px) {
    .login-card-duplo { grid-template-columns: 1fr 1fr; }
    .login-arte { order: 0; border-top: 0; border-right: 1px solid #e6ebf2; padding: 40px 34px; display: flex; flex-direction: column; justify-content: center;
        background: radial-gradient(circle at 50% 0%, rgba(0, 113, 198, .07), transparent 60%), #fff; }
    .login-arte-topo { gap: 34px; }
    .login-brasao, .login-prefeitura { width: 120px; }
    .login-arte-legenda { margin: 18px 0 34px; font-size: .95rem; }
    .login-transformar { max-width: 240px; }
    .login-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
}
@media (max-width: 575.98px) { .login-form { padding: 30px 20px 24px; } }
/* crédito no canto inferior direito (em telas estreitas, centralizado abaixo do conteúdo) */
.login-credito { position: fixed; right: 18px; bottom: 12px; z-index: 2; color: rgba(255, 255, 255, .85); font-size: .78rem; font-weight: 500; text-align: right; }
@media (max-width: 767.98px) {
    .login-credito { position: relative; right: auto; bottom: auto; display: block; text-align: center; padding: 0 16px 16px; }
}
@media (max-width: 575.98px) { .login-card { padding: 30px 20px 24px; border-radius: 20px; } .login-card-duplo { padding: 0; } }
.password-wrap { position: relative; }
.password-wrap .form-control { padding-right: 3rem; }
.password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--ig-muted); width: 40px; height: 36px; border-radius: 6px; }
.password-toggle:hover { color: var(--ig-primary); }

/* ---------- toasts ---------- */
.toast-area { position: fixed; top: 1rem; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.ig-toast { display: flex; gap: .6rem; align-items: flex-start; background: #fff; border-left: 5px solid var(--ig-primary); border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .18); padding: .8rem 1rem; }
.ig-toast.success { border-left-color: var(--ig-green); }
.ig-toast.error { border-left-color: var(--ig-red); }
.ig-toast.warning { border-left-color: #f5b400; }
.ig-toast i { font-size: 1.2rem; }
.ig-toast.success i { color: var(--ig-green); }
.ig-toast.error i { color: var(--ig-red); }
.ig-toast .close-toast { margin-left: auto; border: 0; background: none; color: var(--ig-muted); }

/* ---------- páginas de erro ---------- */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.error-card { max-width: 480px; text-align: center; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--ig-primary); line-height: 1; }

/* ---------- assistente de cadastro ---------- */
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; counter-reset: none; }
.wizard-steps li { flex: 1 1 140px; }
.wizard-steps li > a, .wizard-steps li > span {
    display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem; border-radius: 10px;
    background: #fff; border: 1px solid var(--ig-border); color: var(--ig-muted); text-decoration: none; height: 100%; font-weight: 600; font-size: .85rem;
}
.wizard-steps li > a:hover { border-color: var(--ig-primary); color: var(--ig-navy); }
.wizard-steps .num { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #eef0f3; color: var(--ig-text); flex-shrink: 0; }
.wizard-steps li.done .num { background: #e5f4e6; color: var(--ig-green); }
.wizard-steps li.done .num::after { content: "✓"; margin-left: 1px; font-size: .7rem; }
.wizard-steps li.current > span { background: var(--ig-primary); border-color: var(--ig-primary); color: #fff; }
.wizard-steps li.current .num { background: #fff; color: var(--ig-primary); }
.wizard-steps span[aria-disabled="true"] { opacity: .6; }
.card-footer { background: #f7f9fc; border-top: 1px solid var(--ig-border); }
.review-list dt { color: var(--ig-muted); font-weight: 600; }
.review-list dd { margin-bottom: .5rem; }

/* ---------- ficha do estudante ---------- */
.student-header { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.student-avatar { width: 56px; height: 56px; border-radius: 14px; background: #e3eefc; color: var(--ig-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; flex-shrink: 0; }
.student-meta { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; color: var(--ig-muted); font-size: .88rem; }
.student-meta strong { color: var(--ig-text); }
.nav-tabs-scroll { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; }
.nav-tabs .nav-link { color: var(--ig-text); font-weight: 600; font-size: .88rem; }
.nav-tabs .nav-link.active { color: var(--ig-primary); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.5rem; border-left: 2px solid var(--ig-border); margin-left: .5rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--ig-primary); }
.timeline li:last-child { border-left-color: transparent; }
.kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: .35rem 1rem; }
.kv dt { color: var(--ig-muted); font-weight: 600; }
.kv dd { margin: 0; }
@media (max-width: 575.98px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: .4rem; } }

/* ---------- painel ---------- */
.chart-box { position: relative; width: 100%; }
.chart-card figcaption { margin: 0; }
.chart-card details summary { cursor: pointer; color: var(--ig-primary); }
a.stat-card:focus-visible { outline-offset: 3px; }

/* ======================= Acabamento (revisão visual) ======================= */
/* Botões nunca quebram ícone e texto em linhas diferentes */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: .15rem; }
.btn i.me-1 { margin-right: .3rem !important; }

/* Contêineres com rolagem horizontal não exibem barra vertical falsa */
.table-responsive { overflow-y: hidden; }
.nav-tabs-scroll { overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #c9d3e0 transparent; }
.nav-tabs-scroll::-webkit-scrollbar { height: 6px; }
.nav-tabs-scroll::-webkit-scrollbar-thumb { background: #c9d3e0; border-radius: 3px; }
@media (min-width: 1200px) {
    .nav-tabs-scroll { flex-wrap: wrap; overflow-x: visible; white-space: normal; }
}

/* Colunas de identificação das listagens com largura confortável (sem nomes em 4 linhas) */
#list-table > tbody > tr > td:first-child { min-width: 200px; }
#list-table > tbody > tr > td { padding-top: .7rem; padding-bottom: .7rem; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f5f8fd; }

/* Cartões de indicador: resposta ao passar o mouse e ao focar */
.stat-card { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.stat-card:hover, a.stat-card:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16, 24, 40, .10); border-color: #a9c4ea; }
.stat-label { line-height: 1.25; }
@media (max-width: 575.98px) {
    .stat-card { padding: .8rem; gap: .65rem; }
    .stat-icon { width: 38px; height: 38px; font-size: 1.1rem; border-radius: 10px; }
    .stat-value { font-size: 1.4rem; }
    .stat-label { font-size: .8rem; }
}

/* Cabeçalho da ficha/caso: ações alinhadas à direita */
.student-header > .flex-grow-1 { flex: 1 1 360px; min-width: 0; }
.student-header > .d-flex:last-child { margin-left: auto; align-self: flex-start; }

/* Selos dentro de rótulos não desalinham campos vizinhos */
.form-label .badge-status { padding: .05rem .45rem; font-size: .68rem; vertical-align: 1px; }

/* Cabeçalho de seção dos cartões com respiro e cartões com cantos suaves */
.card-header h2, .card-header .card-title { letter-spacing: -.01em; }
.app-header .page-title { letter-spacing: -.01em; }
.card { transition: box-shadow .15s ease; }

/* Painel: cartões em grade flexível — a última linha estica, sem lacunas */
.tile-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.tile-grid > .tile-cell { flex: 1 1 200px; min-width: 0; }
@media (max-width: 575.98px) { .tile-grid > .tile-cell { flex-basis: 140px; } }
/* Painel: gráficos em duas colunas equilibradas; o último cartão de cada coluna alcança a base */
.chart-col { display: flex; flex-direction: column; gap: 1rem; }
.chart-col > .chart-card:last-child { flex-grow: 1; }

/* ---------- Painel: cada cartão com um tom pastel próprio (sem repetir) ----------
   O tom (--h) vem do servidor; o fundo só dá cor e a situação (ok/atenção) continua no ícone, sobre base branca. */
.stat-card[style*="--h"], .chart-card[style*="--h"] { --tint: hsl(var(--h) var(--s, 85%) var(--l, 96.5%)); --tint-bd: hsl(var(--h) 55% 84%); }
.stat-card { background: var(--tint, #fff); border-color: var(--tint-bd, var(--ig-border)); }
.stat-card .stat-icon { background: #fff !important; box-shadow: 0 1px 3px rgba(16, 24, 40, .08); }
a.stat-card:hover, a.stat-card:focus-visible { border-color: var(--tint-bd, #a9c4ea); filter: saturate(1.15); }
.chart-card { border-color: var(--tint-bd, var(--ig-border)); }
.chart-card > .card-header { background: var(--tint, #fff); border-bottom-color: var(--tint-bd, var(--ig-border)); }

/* ---------- Botões de ação só com ícone (Font Awesome): compactos, do mesmo tamanho e lado a lado ---------- */
.btn-icon, td.text-end .btn-sm:has(> i:only-child) {
    width: 34px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-icon i, td.text-end .btn-sm > i:only-child { font-size: .9rem; margin: 0; }
td.text-end > .d-flex, td.text-end .d-flex.flex-wrap { flex-wrap: nowrap !important; }

/* Cartões de estatística do mesmo tamanho: todos numa linha em colunas iguais (telas largas); em telas menores, colunas iguais que quebram */
.tile-grid-equal { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
@media (min-width: 1200px) { .tile-grid-equal { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); } }
.tile-grid-equal > .tile-cell { min-width: 0; }
.tile-grid-equal .stat-label { overflow-wrap: break-word; }

/* ---------- Login sem rolagem em qualquer tela ----------
   O conteúdo cabe na altura visível; em telas baixas fica mais compacto e, se ainda assim não couber,
   o app.js reduz a escala (fitLogin). Rolagem só é liberada com o teclado do celular aberto. */
html:has(body.tela-login) { height: 100%; overflow: hidden; }
body.tela-login { height: 100%; height: 100dvh; overflow: hidden; }
body.tela-login.teclado-aberto { overflow-y: auto; }
html:has(body.tela-login.teclado-aberto) { overflow-y: auto; }
.tela-login .login-wrap { min-height: 0; height: 100%; height: 100dvh; padding: 16px 16px 34px; justify-content: center; transform-origin: top center; }
.tela-login .login-credito { position: fixed; left: 0; right: 0; bottom: 8px; padding: 0 16px; text-align: right; font-size: .74rem; }
@media (max-width: 991.98px) {
    /* celular/tablet: os três logos numa faixa só, abaixo do formulário */
    .login-arte { padding: 12px 14px 14px; }
    .login-arte { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: nowrap; }
    .login-arte-topo { gap: 10px; }
    .login-brasao, .login-prefeitura { width: 52px; }
    .login-arte-legenda { display: none; }
    .login-transformar { max-width: 120px; }
    .login-form { padding: 22px 20px 18px; }
    .login-logo { max-width: 230px; }
    .login-card h1 { font-size: 1.15rem; }
    .tela-login .login-credito { text-align: center; font-size: .7rem; }
}
@media (max-height: 820px) {
    .login-frase { display: none; }
    .login-rodape { margin-top: 10px; font-size: .76rem; line-height: 1.45; }
    .login-form { padding-top: 26px; padding-bottom: 22px; }
    .login-marca { margin-bottom: 10px; }
    .login-logo { max-width: 260px; }
    .login-card .lead-text { margin-bottom: 1rem !important; }
}
@media (max-height: 680px) {
    .login-rodape { display: none; }
    .login-logo { max-width: 210px; }
    .login-form .mb-3 { margin-bottom: .6rem !important; }
    .login-form .mb-4 { margin-bottom: .9rem !important; }
    .form-control-lg { padding-top: .4rem; padding-bottom: .4rem; }
}
.tela-login .login-wrap > * { flex-shrink: 0; } /* o cartão nunca é espremido: se faltar altura, o app.js reduz a escala */

/* ======================= Tema premium (mais cor) =======================
   Menu lateral azul-escuro com ícones coloridos por seção, fundo da página em tom suave,
   faixa com as cores do logo, cabeçalhos de cartão e títulos de seção com cor. */
:root {
    --ig-bg: #eef3fa;
    --ig-grad: linear-gradient(135deg, #0b3b78 0%, #1559b0 55%, #0e86c1 100%);
    --ig-rainbow: linear-gradient(90deg, #0071C6, #0394AB, #48A83C, #FCB803, #F97F0B, #7746BE);
}
body {
    background:
        radial-gradient(1200px 500px at 100% -10%, rgba(119, 70, 190, .07), transparent 60%),
        radial-gradient(900px 500px at 0% 110%, rgba(3, 148, 171, .08), transparent 60%),
        var(--ig-bg);
    background-attachment: fixed;
}

/* ---- menu lateral ---- */
.app-sidebar {
    background: linear-gradient(180deg, #062a55 0%, #0b3b78 55%, #0d4687 100%);
    border-right: 0; box-shadow: 4px 0 24px rgba(6, 42, 85, .18); color: #dbe7f7;
}
.app-sidebar::before { content: ""; display: block; height: 4px; background: var(--ig-rainbow); position: sticky; top: 0; z-index: 2; }
.sidebar-brand img { background: #fff; border-radius: 12px; padding: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.sidebar-brand .brand-name { color: #fff; }
.sidebar-brand .brand-sub { color: #a9c3e6; }
.nav-section { color: #8fb0dc; display: flex; align-items: center; gap: .5rem; }
.nav-section::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .12); }
.sidebar-nav .nav-link { color: #e3ecf8; }
.sidebar-nav .nav-link i { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; font-size: .95rem;
    flex-shrink: 0; color: var(--sec, #7cc4ff); background: rgba(255, 255, 255, .08); transition: background .15s ease, color .15s ease; }
.sidebar-nav .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-nav .nav-link:hover i { background: rgba(255, 255, 255, .14); }
.sidebar-nav .nav-link.active { background: linear-gradient(90deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .06)); color: #fff;
    box-shadow: inset 3px 0 0 var(--sec, #7cc4ff); }
.sidebar-nav .nav-link.active i { background: var(--sec, #7cc4ff); color: #062a55; }
.sidebar-nav .sec-1 { --sec: #6cc4ff; }
.sidebar-nav .sec-2 { --sec: #7ddc8a; }
.sidebar-nav .sec-3 { --sec: #ffc94d; }
.sidebar-nav .sec-4 { --sec: #f59ac6; }
.sidebar-nav .sec-5 { --sec: #b9a2ff; }
.sidebar-nav .sec-6 { --sec: #5fe0d2; }
.app-sidebar { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.app-sidebar :focus-visible { box-shadow: 0 0 0 3px #ffd24d !important; outline-color: #fff !important; }

/* ---- cabeçalho ---- */
.app-header { background: rgba(255, 255, 255, .92); border-bottom: 0; box-shadow: 0 2px 12px rgba(11, 59, 120, .08); }
.app-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--ig-rainbow); opacity: .85; }
.app-header .page-title { background: var(--ig-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.25rem; font-weight: 800; }
.user-chip .avatar { background: var(--ig-grad); box-shadow: 0 0 0 3px #fff, 0 0 0 5px #a9c8f0; }

/* ---- cartões ---- */
.card { border-color: #d6e1ef; box-shadow: 0 1px 2px rgba(11, 59, 120, .05), 0 6px 18px rgba(11, 59, 120, .06); }
.card-header { background: linear-gradient(90deg, #eaf2fd 0%, #f4f8fe 60%, #ffffff 100%); border-bottom-color: #d6e1ef;
    border-radius: var(--ig-radius) var(--ig-radius) 0 0 !important; position: relative; }
.card-header::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--ig-grad); }
.card-header h2, .card-header .card-title { color: #0b3b78; }
.card-footer { background: #f1f6fd; border-top-color: #d6e1ef; }

/* ---- títulos de seção dos formulários ---- */
.form-section-title { display: flex; align-items: center; gap: .55rem; color: #0b3b78; border-bottom: 0; padding: .45rem .75rem;
    background: linear-gradient(90deg, #e3eefc, rgba(227, 238, 252, 0)); border-left: 4px solid #1559b0; border-radius: 6px; margin-top: 1.4rem; }
.form-control, .form-select { background-color: #fbfdff; }
.form-control:hover, .form-select:hover { border-color: #9fb9da; }

/* ---- etapas do cadastro ---- */
.wizard-steps li > a, .wizard-steps li > span { border-color: #d6e1ef; box-shadow: 0 1px 2px rgba(11, 59, 120, .05); }
.wizard-steps li.current > span { background: var(--ig-grad); border-color: transparent; box-shadow: 0 6px 16px rgba(21, 89, 176, .3); }
.wizard-steps li.done > a, .wizard-steps li.done > span { background: #f0f9f1; border-color: #bfe3c3; color: #1e5e22; }
.wizard-steps li.done .num { background: #2e7d32; color: #fff; }
.wizard-steps .num { background: #e3eefc; color: #1559b0; font-weight: 700; }

/* ---- tabelas ---- */
.table > thead th { background: #e3eefc; color: #0b3b78; border-bottom: 2px solid #b9d0ef; }
thead .sticky-col { background: #e3eefc; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #eef5ff; }

/* ---- botões ---- */
.btn-primary { background-image: linear-gradient(135deg, #1559b0, #0e86c1); border: 0; box-shadow: 0 3px 10px rgba(21, 89, 176, .25); }
.btn-primary:hover, .btn-primary:focus-visible { background-image: linear-gradient(135deg, #0f4890, #0b6fa2); }
.btn-success { background-image: linear-gradient(135deg, #2e7d32, #1f9d55); border: 0; }
.btn-danger { background-image: linear-gradient(135deg, #b42318, #d1432f); border: 0; }
.btn-secondary { background-image: linear-gradient(135deg, #475569, #5b6b82); border: 0; }
.btn { transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.app-sidebar .btn:hover, .btn-icon:hover, td .btn:hover { transform: none; }

/* ---- ficha / cabeçalhos de registro ---- */
.student-avatar { background: var(--ig-grad); color: #fff; box-shadow: 0 6px 14px rgba(21, 89, 176, .3); }
.nav-tabs .nav-link.active { color: #0b3b78; border-top: 3px solid #1559b0; }
.modal-header { background: linear-gradient(90deg, #eaf2fd, #fff); border-radius: var(--ig-radius) var(--ig-radius) 0 0; }
/* usuário no cabeçalho: espaço entre o nome e o avatar (o .btn reduzia o gap) e folga para o anel do avatar */
.btn.user-chip { gap: 1rem; padding-right: 6px !important; }
