/* =====================================================================
   COMITÊ DE FAMÍLIAS — Design system (gestão + famílias)
   Identidade: azul-marinho Cervantes + faixa vermelha do edital.
   Linguagem visual alinhada ao Portal IB (menu claro, conteúdo em cards).
   Base: Bootstrap 5.3 (componentes JS) + estas regras.
   ===================================================================== */
:root {
    --navy: #0a2e5c; --navy-2: #12407a; --navy-3: #1d5aa3; --navy-soft: #eaf0f8;
    --red: #c8102e; --red-soft: #fdecee;
    --bg: #f5f7fa; --card: #ffffff; --line: #ebeff3; --line-2: #dfe5ec;
    --tx: #1f2933; --tx-2: #5c6b7a; --tx-3: #8c99a6;
    --nav-hover: #f2f5f8; --nav-active-bg: #e8f7ef; --nav-active-tx: #0d7a4f;
    --green: #14a05e; --green-soft: #e8f7ef; --amber: #b06d05; --amber-soft: #fdf3e3;
    --purple: #7c3aed; --purple-soft: #f4f0fd; --blue: #1f6fd0; --blue-soft: #e9f2fd;
    --r: 14px; --r-sm: 9px;
    --sh: 0 1px 2px rgba(31,41,51,.04), 0 1px 3px rgba(31,41,51,.06);
    --sh-2: 0 6px 20px rgba(31,41,51,.08);
    --sh-3: 0 24px 60px rgba(15,25,35,.22);
    --ease: cubic-bezier(.22,.61,.36,1);
    --sidebar-w: 248px; --sidebar-w-min: 72px;

    --bs-primary: var(--navy); --bs-primary-rgb: 10,46,92;
    --bs-body-font-family: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --bs-body-color: var(--tx); --bs-body-bg: var(--bg); --bs-border-color: var(--line-2);
    --bs-link-color: var(--navy-3); --bs-link-hover-color: var(--navy);
}
* { -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--tx); font-size: 14.5px; line-height: 1.5; }
h1, h2, h3, h4, h5, h6 { color: var(--tx); letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted, .tx-2 { color: var(--tx-2) !important; }
.tx-3 { color: var(--tx-3) !important; }
.fw-650 { font-weight: 650; }
.label-up { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--tx-3); }

/* ------------------------------ BOTÕES ------------------------------ */
.btn { border-radius: var(--r-sm); font-weight: 600; font-size: 13.5px; padding: .5rem 1rem;
       display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
       transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease); }
.btn-lg { padding: .75rem 1.4rem; font-size: 15px; border-radius: 11px; }
.btn-sm { padding: .3rem .65rem; font-size: 12.5px; }
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(29,90,163,.25); }
.btn-primary, .btn-brand { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover, .btn-brand:hover, .btn-primary:focus, .btn-brand:focus { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn-primary:disabled, .btn-brand:disabled { background: #9aabbf; border-color: #9aabbf; }
.btn-light-brand { background: var(--navy-soft); color: var(--navy); border-color: transparent; }
.btn-light-brand:hover { background: #dce6f3; color: var(--navy); }
.btn-outline-secondary { color: var(--tx-2); border-color: var(--line-2); background: var(--card); }
.btn-outline-secondary:hover { background: var(--nav-hover); color: var(--tx); border-color: var(--line-2); }
.btn-success { background: var(--green); border-color: var(--green); }
.btn-danger { background: #d63b4f; border-color: #d63b4f; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: var(--r-sm); color: var(--tx-3); background: transparent; border: 1px solid transparent; }
.btn-icon:hover { background: var(--nav-hover); color: var(--tx); }
.btn-icon.ok:hover { background: var(--green-soft); color: var(--green); }
.btn-icon.no:hover { background: var(--amber-soft); color: var(--amber); }
.btn-icon.del:hover { background: var(--red-soft); color: var(--red); }

/* ----------------------------- FORMULÁRIOS ----------------------------- */
.form-label { font-weight: 600; font-size: 13px; color: var(--tx); margin-bottom: .35rem; }
.form-control, .form-select { border-radius: var(--r-sm); border-color: var(--line-2); font-size: 14px; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(29,90,163,.14); }
.form-text { color: var(--tx-3); font-size: 12.5px; }
.form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }
.char-counter { font-size: 12px; color: var(--tx-3); text-align: right; }
.char-counter.limite { color: var(--red); font-weight: 600; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--tx-3); pointer-events: none; }
.input-icon > .form-control { padding-left: 2.4rem; }

/* ------------------------------ CARTÕES ------------------------------ */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.panel + .panel { margin-top: 18px; }
.panel-hd { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-hd h2, .panel-hd h3 { font-size: 15.5px; font-weight: 650; margin: 0; }
.panel-hd small { display: block; color: var(--tx-3); font-size: 12.5px; }
.panel-hd .ms-auto { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-bd { padding: 20px; }
.ico-box { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0;
           background: var(--navy-soft); color: var(--navy-3); font-size: 16px; }
.ico-box.green { background: var(--green-soft); color: var(--green); }
.ico-box.amber { background: var(--amber-soft); color: var(--amber); }
.ico-box.red { background: var(--red-soft); color: var(--red); }
.ico-box.purple { background: var(--purple-soft); color: var(--purple); }

/* KPIs com faixa lateral (como no Portal IB) */
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh);
       padding: 18px 20px; position: relative; overflow: hidden; height: 100%; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--navy); }
.kpi.green::before { background: var(--green); } .kpi.amber::before { background: #f59e0b; }
.kpi.purple::before { background: #a855f7; } .kpi.red::before { background: var(--red); } .kpi.blue::before { background: #3b82f6; }
.kpi-value { font-size: 30px; font-weight: 750; line-height: 1.1; color: var(--tx); letter-spacing: -.02em; }
.kpi-label { font-size: 13px; color: var(--tx-2); display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.kpi-sub { font-size: 12px; color: var(--tx-3); margin-top: 6px; }
/* Cartões de indicador que funcionam como filtro */
.kpi-btn { cursor: pointer; transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease); }
.kpi-btn:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.kpi-btn:focus-visible { outline: 3px solid rgba(29,90,163,.3); outline-offset: 2px; }
.kpi-btn .kpi-filtro-ico { opacity: 0; transition: opacity .16s var(--ease); }
.kpi-btn:hover .kpi-filtro-ico, .kpi-btn.ativo .kpi-filtro-ico { opacity: .7; }
.kpi-btn.ativo { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10,46,92,.14); }
.progress { height: 7px; border-radius: 99px; background: #eef2f6; }
.progress-bar { background: var(--navy-3); border-radius: 99px; }

/* ---------------------------- ETIQUETAS ---------------------------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
       font-size: 11.5px; font-weight: 650; white-space: nowrap; line-height: 1.6; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.no-dot::before { display: none; }
.tag-lg { font-size: 13px; padding: 5px 13px; }
.t-blue { background: var(--blue-soft); color: var(--blue); } .t-green { background: var(--green-soft); color: #0d7a4f; }
.t-amber { background: var(--amber-soft); color: var(--amber); } .t-gray { background: #f1f4f7; color: #64748b; }
.t-purple { background: var(--purple-soft); color: var(--purple); } .t-red { background: var(--red-soft); color: #b0122a; }
.t-navy { background: var(--navy-soft); color: var(--navy); }

/* ----------------------------- TABELAS ----------------------------- */
.table-modern { width: 100%; margin: 0; }
.table-modern thead th { background: #f6f8fb; color: var(--tx-3); font-size: 10.8px; font-weight: 700; letter-spacing: .08em;
                         text-transform: uppercase; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-modern tbody td { padding: 12px 16px; border-bottom: 1px solid #f1f4f7; vertical-align: middle; font-size: 13.8px; }
.table-modern tbody tr:last-child td { border-bottom: 0; }
.table-modern tbody tr:hover td { background: #fafbfd; }
.table-modern tbody tr.linha-empate td { background: #fff8e6; }
.table-modern tbody tr.linha-corte td { border-bottom: 2px dashed #c9d6e6; }
.table-wrap { overflow-x: auto; }
/* Tabelas longas: rolagem dentro do painel (barra horizontal sempre visível) e cabeçalho fixo */
.table-scroll { max-height: calc(100vh - 230px); min-height: 240px; overflow: auto; }
.table-scroll thead th { position: sticky; top: 0; z-index: 2; }
.cell-strong { font-weight: 600; color: var(--tx); }
.cell-sub { font-size: 12px; color: var(--tx-3); }

/* ---------------------------- AVATARES ---------------------------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--navy-soft);
          display: inline-grid; place-items: center; color: var(--navy); font-weight: 700; font-size: 13px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.avatar-sm { width: 32px; height: 32px; font-size: 11px; }
.avatar-lg { width: 96px; height: 96px; font-size: 26px; }
.avatar-xl { width: 128px; height: 128px; font-size: 34px; }

/* -------------------------- LINHA DO TEMPO -------------------------- */
.stepper { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; position: relative; }  /* uma coluna por etapa (4 ou 5) */
.step { position: relative; text-align: center; padding: 0 6px; }
.step::before { content: ""; position: absolute; top: 19px; left: -50%; right: 50%; height: 3px; background: var(--line-2); z-index: 0; }
.step:first-child::before { display: none; }
.step .dot { width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; position: relative; z-index: 1;
             background: #fff; border: 2px solid var(--line-2); color: var(--tx-3); font-size: 15px; transition: all .2s var(--ease); }
.step .t { font-weight: 650; font-size: 13.5px; color: var(--tx-2); }
.step .d { font-size: 12px; color: var(--tx-3); line-height: 1.35; }
.step.concluida .dot { background: var(--green); border-color: var(--green); color: #fff; }
.step.concluida::before, .step.atual::before { background: var(--green); }
.step.atual .dot { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 0 0 6px rgba(10,46,92,.12); }
.step.atual .t { color: var(--navy); }
@media (max-width: 575.98px) {
    .stepper { grid-auto-flow: row; grid-template-columns: 1fr; gap: 14px; }
    .step { display: flex; text-align: left; gap: 12px; align-items: center; }
    .step::before { display: none; }
    .step .dot { margin: 0; }
}

/* ------------------------------ ESTADOS ------------------------------ */
.empty { text-align: center; padding: 44px 20px; color: var(--tx-3); }
.empty i { font-size: 34px; margin-bottom: 12px; color: #c3ccd6; display: block; }
.empty p { margin: 0; }
.alert { border-radius: var(--r-sm); border: 1px solid transparent; font-size: 13.8px; }
.alert-success { background: var(--green-soft); color: #0d6b45; border-color: #c3ead6; }
.alert-danger { background: var(--red-soft); color: #a0172c; border-color: #f6cdd3; }
.alert-warning { background: var(--amber-soft); color: #8a5504; border-color: #f4dfb7; }
.alert-info { background: var(--blue-soft); color: #1d5aa3; border-color: #cfe1f7; }
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.toast-stack .alert { box-shadow: var(--sh-2); margin: 0; }

/* ------------------------------ MODAIS ------------------------------ */
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--sh-3); }
.modal-header { border-bottom: 1px solid var(--line); padding: 16px 22px; }
.modal-header .modal-title { font-size: 16.5px; font-weight: 650; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--line); padding: 14px 22px; gap: 8px; }
.modal-backdrop.show { opacity: .45; }

/* =====================================================================
   LAYOUT DA GESTÃO (menu lateral claro)
   ===================================================================== */
.app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--line);
               display: flex; flex-direction: column; z-index: 1040; transition: width .28s var(--ease), transform .28s var(--ease); }
.app-brand { display: flex; align-items: center; gap: 11px; padding: 16px 16px; min-height: 70px; border-bottom: 1px solid var(--line); }
.app-brand img { width: 36px; height: auto; }
.app-brand b { display: block; font-size: 14px; color: var(--navy); line-height: 1.15; white-space: nowrap; }
.app-brand small { display: block; font-size: 10px; font-weight: 700; color: var(--tx-3); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.side-controls { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.side-nav { list-style: none; padding: 10px; margin: 0; flex: 1; overflow-y: auto; }
.side-nav .sec { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tx-3); padding: 14px 12px 6px; white-space: nowrap; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: var(--r-sm);
              color: var(--tx-2); font-weight: 550; font-size: 14px; white-space: nowrap; position: relative;
              transition: background-color .16s var(--ease), color .16s var(--ease); }
.side-nav a i { width: 18px; text-align: center; font-size: 15px; opacity: .85; }
.side-nav a:hover { background: var(--nav-hover); color: var(--tx); }
.side-nav a.active { background: var(--nav-active-bg); color: var(--nav-active-tx); font-weight: 650; }
.side-nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--amber-soft); color: var(--amber); border-radius: 99px; padding: 1px 8px; }
.side-footer { padding: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.side-footer .who { min-width: 0; }
.side-footer .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-footer .who small { color: var(--tx-3); font-size: 11.5px; }
.side-footer .avatar { background: linear-gradient(135deg, var(--navy-3), var(--navy)); color: #fff; border: 0; box-shadow: none; }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .28s var(--ease); }
.app-topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1030;
              display: flex; align-items: center; gap: 10px; padding: 0 24px; }
.app-topbar .env { margin-right: auto; }
.top-btn { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; border: 0; background: #f2f5f8; color: var(--tx-2);
           transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.top-btn:hover { transform: translateY(-1px); box-shadow: var(--sh-2); color: var(--tx); }
.top-btn.cfg { background: var(--blue-soft); color: var(--blue); }
.top-btn.out { background: var(--red-soft); color: var(--red); }
.app-content { padding: 22px 28px 48px; flex: 1; max-width: 1480px; width: 100%; }
.crumbs { font-size: 13px; color: var(--tx-3); margin-bottom: 4px; }
.crumbs a { color: var(--navy-3); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.crumbs .sep { margin: 0 .45rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; font-weight: 750; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--tx-2); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

body.sidebar-min .app-sidebar { width: var(--sidebar-w-min); }
body.sidebar-min .app-main { margin-left: var(--sidebar-w-min); }
body.sidebar-min .app-brand { justify-content: center; padding: 16px 0; }
body.sidebar-min .app-brand div, body.sidebar-min .side-nav .lbl, body.sidebar-min .side-nav .sec,
body.sidebar-min .side-nav .count, body.sidebar-min .side-footer .who, body.sidebar-min #pinBtn { display: none; }
body.sidebar-min .side-nav a { justify-content: center; }
body.sidebar-min .side-controls, body.sidebar-min .side-footer { justify-content: center; }
body.sidebar-min .side-nav a[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    background: #0f1923; color: #fff; padding: 5px 10px; border-radius: 7px; font-size: 12.5px; white-space: nowrap; z-index: 2000; }
.sidebar-overlay { display: none; }
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; box-shadow: var(--sh-3); }
    body.sidebar-open .app-sidebar { transform: none; }
    body.sidebar-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(15,25,35,.4); z-index: 1035; }
    .app-main { margin-left: 0 !important; }
    .app-content { padding: 18px 16px 40px; }
    body.sidebar-min .app-brand div, body.sidebar-min .side-nav .lbl, body.sidebar-min .side-nav .sec, body.sidebar-min .side-footer .who { display: block; }
    body.sidebar-min .side-nav a { justify-content: flex-start; }
    #pinBtn, #collapseBtn { display: none; }
}

/* Abas */
.nav-pills-soft { gap: 6px; flex-wrap: wrap; }
.nav-pills-soft .nav-link { border-radius: 99px; color: var(--tx-2); font-weight: 600; font-size: 13px; padding: 6px 14px; background: #f2f5f8; border: 0; }
.nav-pills-soft .nav-link.active { background: var(--navy); color: #fff; }
.nav-pills-soft .nav-link .n { opacity: .7; margin-left: 4px; }

/* Blocos clicáveis (atalhos e seleção de eleição/segmento) */
.tile { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line);
        box-shadow: var(--sh); color: var(--tx); height: 100%; transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
a.tile:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: #d3dde8; color: var(--tx); }
.tile h3 { font-size: 15.5px; font-weight: 650; margin: 0 0 3px; }
.tile p { margin: 0; font-size: 13px; color: var(--tx-2); }
.tile .go { margin-left: auto; color: var(--tx-3); align-self: center; }
.tile.disabled { opacity: .55; pointer-events: none; }

.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.dl-grid > div { background: #f8fafc; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 13px; }
.dl-grid .v { font-weight: 650; font-size: 14px; }

/* =====================================================================
   PORTAL DAS FAMÍLIAS
   ===================================================================== */
.fam-topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1030; }
.fam-topbar .inner { max-width: 1120px; margin: 0 auto; padding: 0 18px; height: 66px; display: flex; align-items: center; gap: 14px; }
.fam-brand { display: flex; align-items: center; gap: 11px; color: var(--navy); }
.fam-brand img { width: 36px; }
.fam-brand b { display: block; font-size: 15px; line-height: 1.1; }
.fam-brand small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tx-3); }
.fam-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.fam-user .nm { text-align: right; line-height: 1.15; }
.fam-user .nm b { display: block; font-size: 13.5px; }
.fam-user .nm small { color: var(--tx-3); font-size: 11.5px; }
.fam-stripe { height: 4px; background: linear-gradient(90deg, var(--navy) 0 82%, var(--red) 82% 100%); }
.fam-content { max-width: 1120px; margin: 0 auto; padding: 26px 18px 60px; }
.fam-footer { text-align: center; color: var(--tx-3); font-size: 12.5px; padding: 24px 16px 32px; }

.hero { border-radius: 20px; padding: 28px 30px; color: #fff; position: relative; overflow: hidden;
        background: radial-gradient(1200px 300px at 100% 0, rgba(255,255,255,.08), transparent 60%), linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); box-shadow: var(--sh-2); }
.hero::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 10px; background: var(--red); }
.hero h1 { color: #fff; font-size: 26px; font-weight: 750; margin: 6px 0 4px; }
.hero p { color: rgba(255,255,255,.82); margin: 0; }
.hero .tag { background: rgba(255,255,255,.14); color: #fff; }
.hero .label-up { color: rgba(255,255,255,.7); }

.action-card { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line);
               box-shadow: var(--sh); height: 100%; color: var(--tx); transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
a.action-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: #cfdae6; color: var(--tx); }
.action-card .ico-box { width: 48px; height: 48px; font-size: 19px; border-radius: 13px; }
.action-card h3 { font-size: 17px; font-weight: 700; margin: 0; }
.action-card p { font-size: 13.5px; color: var(--tx-2); margin: 0; }
.action-card .cta { margin-top: auto; font-weight: 650; color: var(--navy-3); font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.action-card.off { background: #fafbfc; box-shadow: none; }
.action-card.off .ico-box { background: #eef1f4; color: #a3afbb; }
.action-card.off h3 { color: var(--tx-2); }
.action-card.off .cta { color: var(--tx-3); }

/* Cartões de candidato (visualização e voto) */
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cand-card { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 20px 16px 16px; text-align: center;
             transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cand-card h4 { font-size: 15.5px; font-weight: 700; margin: 6px 0 0; }
.cand-card .bio { font-size: 13px; color: var(--tx-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cand-card .more { font-size: 12.5px; font-weight: 600; color: var(--navy-3); background: none; border: 0; padding: 0; }
/* Painel de divulgação: apresentação inteira (até 500 caracteres), sem seleção */
.cand-card.divulga .bio { display: block; -webkit-line-clamp: unset; overflow: visible; text-align: left; white-space: pre-line; }
label.cand-card { cursor: pointer; }
label.cand-card:hover { border-color: #b8c8da; box-shadow: var(--sh-2); transform: translateY(-2px); }
.cand-card input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.cand-card .check { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff;
                    display: grid; place-items: center; color: transparent; font-size: 12px; transition: all .18s var(--ease); }
.cand-card:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(10,46,92,.10); }
.cand-card:has(input:checked) .check { background: var(--navy); border-color: var(--navy); color: #fff; }
.cand-card:has(input:focus-visible) { outline: 3px solid rgba(29,90,163,.35); outline-offset: 2px; }

.seg-card { scroll-margin-top: 90px; }
.seg-done { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--green-soft); border-radius: var(--r-sm); color: #0d6b45; }
.seg-done i { font-size: 26px; }
.vote-bar { position: sticky; bottom: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-top: 1px solid var(--line);
            padding: 14px 20px; margin: 18px -20px -20px; border-radius: 0 0 var(--r) var(--r); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Pódio de resultados */
.podium { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.podium .pc { border-radius: 16px; border: 1px solid var(--line); padding: 20px 14px; text-align: center; background: var(--card); position: relative; }
.podium .pc.titular { border-color: #c9d6e6; background: linear-gradient(180deg, #f3f7fc, #fff); }
.podium .pc .pos { position: absolute; top: 12px; left: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.podium .pc.suplente .pos { background: #8c99a6; }
.podium .pc h4 { font-size: 15px; font-weight: 700; margin: 10px 0 4px; }
@media (max-width: 991.98px) { .podium { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .podium { grid-template-columns: 1fr; } }

/* =====================================================================
   LOGIN (dois portais)
   ===================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-visual { position: relative; background: var(--navy) center/cover no-repeat; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 44px; overflow: hidden; }
.auth-visual::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(10,46,92,.88) 0%, rgba(10,46,92,.72) 55%, rgba(10,46,92,.94) 100%); }
.auth-visual::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 10px; background: var(--red); }
.auth-visual > * { position: relative; z-index: 1; }
.auth-visual .wordmark { width: 220px; }
.auth-visual h2 { color: #fff; font-size: 34px; font-weight: 750; line-height: 1.15; margin: 0 0 12px; max-width: 460px; }
.auth-visual p { color: rgba(255,255,255,.82); max-width: 440px; margin: 0; font-size: 15px; }
.auth-visual .facts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 26px; }
.auth-visual .facts div { font-size: 13px; color: rgba(255,255,255,.8); }
.auth-visual .facts b { display: block; color: #fff; font-size: 20px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--sh-2); padding: 34px 32px; }
.auth-card .logo { width: 54px; margin-bottom: 18px; }
.auth-card h1 { font-size: 24px; font-weight: 750; margin: 0 0 4px; }
.auth-card .sub { color: var(--tx-2); margin-bottom: 24px; font-size: 14px; }
.auth-card .form-control { padding: .75rem .9rem .75rem 2.5rem; font-size: 15px; }
.auth-card .help { font-size: 12.5px; color: var(--tx-3); margin-top: 18px; text-align: center; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--tx-3); width: 34px; height: 34px; }
@media (max-width: 991.98px) {
    .auth { grid-template-columns: 1fr; }
    .auth-visual { min-height: 210px; padding: 26px 24px; }
    .auth-visual h2 { font-size: 24px; }
    .auth-visual .facts, .auth-visual .desk { display: none; }
}

/* ------------------------------ IMPRESSÃO ------------------------------ */
/* ------------------------- RELATÓRIOS (documento para tela e impressão) ------------------------- */
.doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 28px 32px; }
.doc-head { display: flex; gap: 16px; align-items: center; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 3px solid var(--navy); }
.doc-head img { width: 54px; height: 54px; object-fit: contain; }
.doc-head h2 { font-size: 21px; font-weight: 750; margin: 2px 0; color: var(--navy); }
.doc-head p { margin: 0; color: var(--tx-2); font-size: 13.5px; }
.doc-meta { margin-left: auto; text-align: right; font-size: 12px; color: var(--tx-3); white-space: nowrap; }
.doc-sec { margin-bottom: 24px; }
.doc-sec h3 { font-size: 15.5px; font-weight: 700; color: var(--navy); margin: 0 0 10px; }
.doc-sec h3 small, .doc-bloco h4 small { font-weight: 500; font-size: 12.5px; color: var(--tx-3); margin-left: 6px; }
.doc-bloco { margin-bottom: 18px; }
.doc-bloco h4 { font-size: 14px; font-weight: 700; margin: 0 0 6px; }
.doc-nota { font-size: 12.5px; color: var(--tx-2); background: #f6f8fb; border-left: 3px solid #c9d6e6; padding: 6px 10px; margin: 0 0 8px; }
.doc-kv { width: 100%; font-size: 13.5px; }
.doc-kv th { width: 210px; color: var(--tx-2); font-weight: 600; padding: 5px 0; vertical-align: top; }
.doc-kv td { padding: 5px 0; }
.doc-table thead th { background: #f3f6fa; }
.doc-table tbody td { padding: 8px 12px; font-size: 13px; }
.doc-table tr.doc-total td { font-weight: 700; background: #f3f6fa; }
.doc-barra { display: inline-block; width: calc(100% - 56px); max-width: 220px; height: 8px; border-radius: 4px; background: #e2e8ee; margin-right: 8px; vertical-align: middle; overflow: hidden; }
.doc-barra span { display: block; height: 100%; background: var(--green, #14a05e); }
.doc-horas { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 180px; align-items: end; }
.doc-horas > div { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.doc-horas span { display: block; width: 100%; background: var(--navy); border-radius: 3px 3px 0 0; min-height: 1px; }
.doc-horas small { font-size: 10px; color: var(--tx-3); margin-top: 3px; }
.doc-assina { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 48px; }
.doc-assina div { text-align: center; font-size: 12px; color: var(--tx-2); }
.doc-assina span { display: block; border-top: 1px solid #1d2733; margin-bottom: 6px; }
.doc-foot { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--tx-3); text-align: center; }
@media (max-width: 767.98px) { .doc { padding: 18px; } .doc-head { flex-wrap: wrap; } .doc-meta { margin-left: 0; text-align: left; } .doc-assina { grid-template-columns: 1fr; } }

.doc-table tbody.doc-grupo tr.doc-grupo-hd td { background: var(--navy-soft); color: var(--navy); font-weight: 700; padding: 6px 12px; }

/* Tabela de página dos relatórios: na tela é só um contêiner */
.doc-pagina { width: 100%; border-collapse: collapse; }
.doc-pagina > thead > tr > td, .doc-pagina > tbody > tr > td, .doc-pagina > tfoot > tr > td { padding: 0; border: 0; vertical-align: top; }
.doc-pagina-rodape { display: none; }

/*
 * Impressão / PDF: A4 retrato (Candidaturas em paisagem, classe .doc-paisagem).
 * - Laterais: padding do body (valem mesmo com "Margens: Nenhuma" no diálogo, que o Chrome lembra).
 * - Topo: o cabeçalho do relatório se repete em cada folha (thead da .doc-pagina), com o espaço do topo
 *   dentro dele; o tfoot reserva o espaço de baixo.
 * - Número da página: caixa de margem do @page, que só aparece com "Margens: Padrão".
 */
@page { size: A4 portrait; margin: 0 0 10mm;
    @bottom-left { content: "Miguel de Cervantes · Comitê de Famílias"; padding-left: 13mm; font-size: 7.5pt;
                   color: #8c99a6; font-family: "Segoe UI", Arial, sans-serif; vertical-align: top; }
    @bottom-right { content: "Página " counter(page) " de " counter(pages); padding-right: 13mm; font-size: 8pt;
                    color: #5c6b7a; font-family: "Segoe UI", Arial, sans-serif; vertical-align: top; } }
@page paisagem { size: A4 landscape; }
@media print {
    .app-sidebar, .app-topbar, .no-print, .toast-stack, .fam-topbar, .fam-footer, .crumbs, .sidebar-overlay { display: none !important; }
    html, body { width: auto !important; min-width: 0 !important; }
    body { background: #fff !important; padding: 0 13mm !important; margin: 0 !important; }
    .app-main { margin: 0 !important; width: auto !important; min-height: 0 !important; display: block !important; }
    .app-content { padding: 0 !important; max-width: none !important; width: auto !important; }
    .panel, .kpi { box-shadow: none; break-inside: avoid; }
    .doc { border: 0; border-radius: 0; padding: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .doc-paisagem { page: paisagem; }
    /* a folha impressa tem menos de 768px: desfaz o layout de celular do documento */
    .doc-pagina > thead { display: table-header-group; }
    .doc-pagina > tfoot { display: table-footer-group; }
    .doc-pagina > thead > tr > td { padding-top: 10mm; }
    .doc-pagina-rodape { display: block; height: 5mm; }
    .doc-head { padding-bottom: 8px; margin-bottom: 12px; flex-wrap: nowrap !important; }
    .doc-meta { margin-left: auto !important; text-align: right !important; font-size: 8pt; }
    .doc-assina { grid-template-columns: repeat(3, 1fr) !important; }
    .doc-inteira { break-inside: avoid; }
    .doc-colunas { display: grid !important; grid-template-columns: 5fr 7fr; gap: 18px; margin: 0 !important; }
    .doc-colunas > div { width: auto !important; max-width: none !important; padding: 0 !important; margin: 0 !important; }
    .doc-horas { height: 130px; }
    .doc-table .tag { padding: 1px 7px; font-size: 7.5pt; }
    .doc-head img { width: 44px; height: 44px; }
    .doc-head h2 { font-size: 17pt; }
    .doc-sec { margin-bottom: 16px; }
    .doc-sec h3, .doc-bloco h4 { break-after: avoid; }
    .doc-sec h3 { font-size: 12pt; }
    .doc-nota { font-size: 9pt; }
    .doc-kv { font-size: 10pt; }
    .table-wrap { overflow: visible !important; }
    .table-scroll { max-height: none !important; min-height: 0 !important; overflow: visible !important; }
    .table-scroll thead th { position: static; }
    .doc-table { width: 100%; }
    .doc-table thead { display: table-header-group; }
    .doc-table thead th { font-size: 7.5pt; padding: 5px 6px; }
    .doc-table tbody td { padding: 3px 6px; font-size: 8.5pt; line-height: 1.3; }
    .doc-table tr { break-inside: avoid; }
    .doc-table .cell-sub { font-size: 8pt; }
    .doc-bloco, .doc-assinaturas { break-inside: avoid; }
    .doc-table tbody.doc-grupo + tbody.doc-grupo { break-before: page; }
    .doc-assina { margin-top: 36px; }
    .doc-foot { margin-top: 14px; font-size: 8pt; }
}

/* ------------------------- EDITOR DE FOTO (Cropper.js) ------------------------- */
.foto-editor { text-align: center; }
.foto-editor-area { height: 380px; background: #0f1923; border-radius: 12px; overflow: hidden; }
.foto-editor-area img { display: block; max-width: 100%; }
.foto-editor-area .cropper-view-box, .foto-editor-area .cropper-face { border-radius: 50%; }
.foto-editor-area .cropper-view-box { outline: 0; box-shadow: 0 0 0 2px #fff; }
.foto-editor-area .cropper-modal { background: #0f1923; opacity: .6; }
@media (max-width: 575.98px) { .foto-editor-area { height: 300px; } }
