/* ================================================================
   PENHA – Proteção Empenhada  |  app.css
   Paleta:
     #5B2C83  roxo profundo  (primária)
     #7D4BA3  roxo claro     (secundária)
     #B86BAE  rosa-orquídea  (destaque)
     #E7D7F0  lavanda suave  (fundo/hover)
     #0E3D4D  teal escuro    (texto/contraste)
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --cor-primaria:   #5B2C83;   /* era #6a0f49 */
    --cor-secundaria: #7D4BA3;   /* era #9c1f6e */
    --cor-accent:     #B86BAE;
    --cor-lavanda:    #E7D7F0;
    --cor-teal:       #0E3D4D;
    --cor-texto-hdr:  #ffffff;
    --topnav-h:       46px;
    --header-h:       64px;
    --radius:         8px;
    --shadow:         0 2px 8px rgba(91,44,131,.12);
    --bg:             #faf7fc;
    --card-bg:        #ffffff;
    --border:         #e5dbec;
    --text:           #2c2c2c;
    --text-muted:     #777;
}

html, body { height: 100%; font-family: 'Segoe UI', Arial, sans-serif; font-size: 15px; color: var(--text); background: var(--bg); }

/* ── HEADER ──────────────────────────────────────────────────── */
.header {
    position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
    background: #ffffff; color: var(--cor-primaria);
    display: flex; align-items: center; z-index: 200;
    box-shadow: 0 2px 12px rgba(91,44,131,.10);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--cor-primaria) 0%, var(--cor-secundaria) 55%, var(--cor-accent) 100%) 1;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0 24px; }
.header-brand { display: flex; align-items: center; gap: 14px; }
.header-logo  { height: 46px; width: auto; transition: transform .2s; }
.header-logo:hover { transform: scale(1.04); }
.header-title    { display: block; font-size: 1.15rem; font-weight: 700; letter-spacing: .5px; color: var(--cor-primaria); line-height: 1.1; }
.header-subtitle { display: block; font-size: .72rem; color: var(--cor-accent); font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; margin-top: 2px; }
.header-user  { display: flex; align-items: center; gap: 14px; font-size: .9rem; color: var(--cor-primaria); }
.header-username { color: var(--cor-primaria); font-weight: 600; }
.header-username small { opacity: .75; font-weight: 400; }
.btn-logout {
    background: var(--cor-primaria); color: #fff; border: 1px solid var(--cor-primaria);
    padding: 6px 14px; border-radius: var(--radius); text-decoration: none; font-size: .85rem;
    transition: background .2s, color .2s;
}
.btn-logout:hover { background: var(--cor-secundaria); border-color: var(--cor-secundaria); }

/* ── TOPNAV ──────────────────────────────────────────────────── */
.topnav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    height: var(--topnav-h);
    background: linear-gradient(90deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    z-index: 100; display: flex; align-items: center;
    box-shadow: 0 2px 8px rgba(91,44,131,.30);
}
.topnav-menu {
    list-style: none; display: flex; align-items: stretch;
    height: 100%; margin: 0; padding: 0 8px;
}
.topnav-item {
    position: relative; display: flex; align-items: stretch;
}
.topnav-link {
    display: flex; align-items: center; gap: 6px;
    padding: 0 16px; color: #fff; text-decoration: none;
    font-size: .88rem; font-weight: 500; white-space: nowrap;
    background: none; border: none; cursor: pointer;
    transition: background .15s;
    font-family: inherit;
}
.topnav-link svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.topnav-link:hover, .topnav-item.open > .topnav-link {
    background: rgba(255,255,255,.15);
}
.topnav-link.active { background: rgba(255,255,255,.2); font-weight: 700; }
.topnav-caret { width: 18px !important; height: 18px !important; margin-left: 2px; transition: transform .2s; }
.topnav-item.open .topnav-caret { transform: rotate(180deg); }

/* Dropdown menu */
.topnav-dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0;
    min-width: 210px; background: #fff; list-style: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.18); border-radius: 0 0 var(--radius) var(--radius);
    z-index: 300; padding: 4px 0;
    border-top: 3px solid var(--cor-secundaria);
}
.topnav-item.open .topnav-dropdown-menu { display: block; }
.topnav-dd-link {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 18px; color: var(--cor-primaria);
    text-decoration: none; font-size: .88rem;
    transition: background .12s, color .12s;
    border-left: 3px solid transparent;
}
.topnav-dd-link svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.topnav-dd-link:hover { background: var(--cor-lavanda); color: var(--cor-primaria); border-left-color: var(--cor-secundaria); }
.topnav-dd-link.active { background: var(--cor-lavanda); font-weight: 700; border-left-color: var(--cor-primaria); }

/* ── WRAP ────────────────────────────────────────────────────── */
.wrap { display: block; margin-top: calc(var(--header-h) + var(--topnav-h)); min-height: calc(100vh - var(--header-h) - var(--topnav-h) - 56px); padding-bottom: 64px; }

/* ── MAIN ────────────────────────────────────────────────────── */
.main { flex: 1; padding: 28px 32px; }

/* ── FOOTER ──────────────────────────────────────────────────── */
.footer {
    position: fixed; bottom: 0; left: 0; right: 0; min-height: 56px;
    background: var(--cor-teal); color: #e8eef0; font-size: .78rem;
    display: flex; align-items: center; justify-content: center; z-index: 99;
    padding: 8px 20px; line-height: 1.45; text-align: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,.15);
}
.footer .footer-inner { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.footer .footer-row   { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.footer strong        { color: #ffffff; font-weight: 600; }
.footer .footer-sep   { opacity: .45; }
.footer a             { color: #E7D7F0; text-decoration: none; }
.footer a:hover       { color: #ffffff; text-decoration: underline; }

/* ── PAGE HEADER ─────────────────────────────────────────────── */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--border);
}
.page-header h2 { font-size: 1.4rem; color: var(--cor-primaria); }
.page-header p  { margin-top: 3px; color: var(--text-muted); font-size: .9rem; }

/* ── CARD ────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 16px; color: var(--cor-primaria); }
.mt-4 { margin-top: 24px; }
.mb-4 { margin-bottom: 24px; }

/* ── FORMULÁRIOS ─────────────────────────────────────────────── */
.form-group  { margin-bottom: 16px; }
.form-row    { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1 1 200px; }
label        { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; color: #444; }
.req         { color: #e74c3c; }
.form-control {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: .9rem; color: var(--text);
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}
.form-control:focus { outline: none; border-color: var(--cor-secundaria); box-shadow: 0 0 0 3px rgba(106,15,73,.15); }
select.form-control { cursor: pointer; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Color picker */
.input-color { display: flex; align-items: center; gap: 8px; }
.form-control-color { width: 48px; height: 40px; padding: 2px 4px; border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer; }

/* Input com olhinho */
.input-eye { position: relative; }
.input-eye .form-control { padding-right: 44px; }
.btn-eye {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 1rem; color: #888;
}

/* ── TABELA ──────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--cor-lavanda); color: var(--cor-primaria); font-weight: 600; white-space: nowrap; }
.table tbody tr:hover { background: #fdf5fb; }
.row-inativo td { opacity: .55; }
.td-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }

/* ── BADGES ──────────────────────────────────────────────────── */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.badge-admin       { background: #2c3e50; color: #fff; }
.badge-coordenacao { background: var(--cor-primaria); color: #fff; }
.badge-tecnico     { background: #2980b9; color: #fff; }
.badge-recepcao    { background: #27ae60; color: #fff; }
.badge-ativo       { background: #d5f5e3; color: #1e8449; }
.badge-inativo     { background: #f5d5d5; color: #922b21; }
.badge-warning     { background: #fef9c3; color: #854d0e; }
.badge-sucesso     { background: #d5f5e3; color: #1e8449; }
.badge-default     { background: #e9ecef; color: #555; }
.badge-lg          { font-size: .85rem; padding: 5px 14px; }

/* ── BOTÕES ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius); font-size: .88rem;
    font-weight: 600; cursor: pointer; text-decoration: none;
    border: none; transition: opacity .2s, transform .1s;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.98); }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-primary   { background: var(--cor-primaria);   color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-success   { background: #27ae60; color: #fff; }
.btn-warning   { background: #f39c12; color: #fff; }
.btn-danger    { background: #e74c3c; color: #fff; }

/* ── ALERTAS ─────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: .9rem;
}
.alert-sucesso { background: #d5f5e3; color: #1e8449; border-left: 4px solid #27ae60; }
.alert-erro    { background: #fdedec; color: #922b21; border-left: 4px solid #e74c3c; }
.alert-aviso   { background: #fef9e7; color: #7d6608; border-left: 4px solid #f1c40f; }
.alert-info    { background: #eaf4fb; color: #1a5276; border-left: 4px solid #3498db; }
.alert-close   { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: inherit; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* ── STATS DASHBOARD ─────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card  { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; align-items: center; gap: 16px; }
.stat-icon  { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 28px; height: 28px; fill: #fff; }
.stat-label { display: block; font-size: .78rem; color: var(--text-muted); font-weight: 500; }
.stat-value { display: block; font-size: 1.6rem; font-weight: 700; color: var(--cor-primaria); }

/* ── CHECKLIST ───────────────────────────────────────────────── */
.checklist    { list-style: none; padding: 0; }
.checklist li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.checklist li:last-child { border: none; }

/* ── LOGIN ───────────────────────────────────────────────────── */
.login-body  { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 50%, var(--cor-teal) 100%); }
.login-wrap  { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 20px; }
.login-card  { background: #fff; border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,.3); padding: 40px 36px; width: 100%; max-width: 400px; }
.login-logo  { text-align: center; margin-bottom: 28px; }
.login-logo img { height: 120px; margin-bottom: 12px; }
.login-logo h1  { font-size: 1.8rem; color: var(--cor-primaria); letter-spacing: 1px; }
.login-logo p   { color: var(--cor-accent); font-size: .78rem; margin-top: 4px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }
.login-form .form-group { margin-bottom: 18px; }
.login-footer { color: rgba(255,255,255,.5); font-size: .78rem; margin-top: 16px; }

/* ── ERROS ───────────────────────────────────────────────────── */
.error-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.error-card { text-align: center; padding: 40px; }
.error-card h1 { font-size: 6rem; color: var(--cor-primaria); line-height: 1; }
.error-card p  { font-size: 1.2rem; margin: 12px 0 24px; color: var(--text-muted); }

/* ── RESPONSIVO ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .topnav { overflow-x: auto; }
    .topnav-link { padding: 0 10px; font-size: .8rem; }
    .main { padding: 16px; }
    .form-row { flex-direction: column; }
}

/* ── FORMULÁRIOS (form-card / form-section) ───────────────────── */
.form-card    { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.form-section { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: none; }
.form-section h3 { font-size: .95rem; font-weight: 700; color: var(--cor-primaria); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .05em; }
.form-actions { padding: 16px 24px; display: flex; gap: 10px; align-items: center; background: #fafafa; border-top: 1px solid var(--border); }
.form-grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.form-grid-2 .full  { grid-column: 1 / -1; }
.form-group   { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: .82rem; font-weight: 600; color: #555; }
.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
    font-size: .9rem; font-family: inherit; background: #fff; color: var(--text);
    transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--cor-primaria); }
.req { color: #e74c3c; margin-left: 2px; }

/* ── RADIO / CHECKBOX ─────────────────────────────────────────── */
.radio-group   { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 6px 0; }
.radio-label,
.checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: .9rem; }
.checkbox-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; padding: 6px 0; }

/* ── INPUT WITH BUTTON ────────────────────────────────────────── */
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }

/* ── BUSCA / FILTROS ─────────────────────────────────────────── */
.form-busca  { display: flex; gap: 8px; margin-bottom: 12px; }
.input-busca { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: .9rem; min-width: 260px; }
.filtros-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filtros-bar select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: .88rem; }
.btn-xs { padding: 4px 10px; font-size: .78rem; }
.btn-link { background: none; color: var(--cor-primaria); text-decoration: underline; }

/* ── DETALHES (show pages) ────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; padding: 12px 0; }
.detail-list dt { font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; padding-top: 2px; }
.detail-list dd { font-size: .9rem; margin: 0; }
.detail-list-inline { column-gap: 24px; }
.detail-obs { padding: 0 0 8px 0; font-size: .9rem; line-height: 1.6; }
.status-strip { background: #f8f9fa; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 16px; font-size: .9rem; }

/* ── MULHER SELECIONADA / BUSCA AJAX ─────────────────────────── */
.selected-mulher { display: flex; align-items: center; justify-content: space-between; background: #eaf6ff; border: 1px solid #90cdf4; border-radius: 8px; padding: 10px 14px; }
.mulher-search-box .search-results { border: 1px solid var(--border); border-radius: 6px; background: #fff; max-height: 280px; overflow-y: auto; box-shadow: var(--shadow); }
.search-result-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: .9rem; transition: background .15s; }
.search-result-item:last-child { border: none; }
.search-result-item:hover { background: #f5f0ff; }

/* ── ENCAMINHAMENTOS ─────────────────────────────────────────── */
.encam-row { display: flex; align-items: flex-end; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.encam-row:last-child { border: none; }
.encam-row .form-grid-3 { flex: 1; }

/* ── PAGINAÇÃO ───────────────────────────────────────────────── */
.paginacao { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }

/* ── TABELAS ─────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

/* ── IMPORTAÇÃO ────────────────────────────────────────────────── */
.import-layout     { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width:768px) { .import-layout { grid-template-columns: 1fr; } }

.import-card h3,
.import-info h3   { margin-top: 0; margin-bottom: .75rem; font-size: 1rem; color: var(--cor-primaria); }
.import-card p    { color: #555; font-size: .9rem; }

/* Sumário de contadores */
.import-summary   { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.summary-card     { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px;
                    padding: .75rem 1.25rem; text-align: center; min-width: 120px; }
.summary-card .summary-num  { display: block; font-size: 2rem; font-weight: 700; line-height: 1.1; }
.summary-card .summary-lbl  { display: block; font-size: .78rem; color: #6c757d; margin-top: .2rem; }
.summary-novo     { border-color: #28a745; }
.summary-novo .summary-num  { color: #28a745; }
.summary-duplicado{ border-color: #e08a00; }
.summary-duplicado .summary-num { color: #e08a00; }
.summary-erro     { border-color: #dc3545; }
.summary-erro .summary-num  { color: #dc3545; }

/* Tabela de prévia */
.table-scroll     { overflow-x: auto; }
.import-preview-table { min-width: 900px; font-size: .82rem; }
.import-preview-table th { white-space: nowrap; background: #f1f3f5; }
.import-preview-table td { vertical-align: top; padding: 6px 8px; }

/* ── Relatórios ─────────────────────────────────────────────────────── */
.rel-filter-form        { margin-bottom: 1.5rem; }
.rel-filter-row         { display: flex; gap: 1.5rem; align-items: flex-end; flex-wrap: wrap; }
.btn-group              { display: flex; gap: .5rem; flex-wrap: wrap; }
.rel-available-months   { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--cor-borda); font-size: .85rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.badge-mes              { display: inline-block; background: #e8f0fe; color: #4472c4; border-radius: 20px; padding: 3px 12px; font-size: .78rem; font-weight: 600; text-decoration: none; transition: background .15s; }
.badge-mes:hover        { background: #c5d8fc; }

/* ── Abas de status (tab-bar) ───────────────────────────────────────── */
.tab-bar        { display: flex; gap: 4px; border-bottom: 2px solid var(--cor-borda, #dee2e6); margin-bottom: 12px; }
.tab            { padding: 6px 18px; font-size: .9rem; text-decoration: none; color: #555; border-bottom: 3px solid transparent; margin-bottom: -2px; border-radius: 4px 4px 0 0; transition: color .15s; }
.tab:hover      { color: var(--cor-primaria, #6a0f49); background: #f5f5f5; }
.tab-active     { color: var(--cor-primaria, #6a0f49); border-bottom-color: var(--cor-primaria, #6a0f49); font-weight: 600; background: #fff; }

/* ── Grid de filhos por faixa etária ──────────────────────────────── */
.filhos-grid            { border: 1px solid var(--cor-borda, #dee2e6); border-radius: 8px; overflow: hidden; }
.filhos-header,
.filhos-row             { display: grid; grid-template-columns: 1fr 120px 120px; }
.filhos-header          { background: #f1f3f5; font-weight: 600; font-size: .85rem; }
.filhos-header span,
.filhos-row span        { padding: 8px 12px; display: flex; align-items: center; }
.filhos-row             { border-top: 1px solid var(--cor-borda, #dee2e6); }
.filhos-row input[type=number] { width: 80px; text-align: center; margin: 6px auto; }
.filhos-row:nth-child(even) { background: #fafafa; }

/* ── FRIDA form ─────────────────────────────────────────────────────── */
.frida-questao          { padding: 14px 0; border-bottom: 1px solid #eee; }
.frida-questao:last-child { border-bottom: none; }
.frida-condicional      { padding-left: 24px; background: #fafafe; border-left: 3px solid #c5d8fc; margin-left: 20px; }
.frida-pergunta         { font-size: .95rem; margin-bottom: 8px; }
.frida-num              { font-weight: 700; color: var(--cor-primaria, #6a0f49); margin-right: 6px; }
.frida-opcoes           { display: flex; flex-wrap: wrap; gap: 12px; }
.frida-opt              { display: flex; align-items: center; gap: 5px; font-size: .88rem; cursor: pointer;
                          padding: 5px 12px; border: 1px solid #dee2e6; border-radius: 20px; transition: background .15s; }
.frida-opt:has(input:checked) { background: var(--cor-primaria, #6a0f49); color: #fff; border-color: var(--cor-primaria, #6a0f49); }
.frida-opt input[type=radio]  { display: none; }

/* FRIDA show ─────────────────────────────────────────────────────────── */
.frida-resumo           { display: flex; flex-direction: column; gap: 0; }
.frida-item             { display: grid; grid-template-columns: 40px 1fr 120px; gap: 8px; padding: 10px 0; border-bottom: 1px solid #eee; align-items: start; }
.frida-item:last-child  { border-bottom: none; }
.frida-item-num         { font-weight: 700; color: var(--cor-primaria, #6a0f49); }
.frida-item-resp        { font-weight: 600; text-align: right; }
.frida-sim              { color: #c0392b; }
.frida-nao              { color: #27ae60; }
.frida-nao_sabe         { color: #e08a00; }
.frida-nao_se_aplica    { color: #888; }

/* ── Presença ────────────────────────────────────────────────────────── */
.presenca-header        { font-size: 1.05rem; font-weight: 600; margin-bottom: 12px; color: var(--cor-primaria, #6a0f49); }
.row-presente           { background: #f0fff4; }

/* ── Dashboard bar chart ─────────────────────────────────────────────── */
.bar-chart              { display: flex; gap: 12px; align-items: flex-end; height: 140px; padding: 8px 0; }
.bar-item               { display: flex; flex-direction: column; align-items: center; flex: 1; gap: 4px; height: 100%; }
.bar-label              { font-size: .72rem; color: #888; white-space: nowrap; }
.bar-track              { flex: 1; width: 100%; display: flex; align-items: flex-end; background: #f0f0f0; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 20px; }
.bar-fill               { width: 100%; border-radius: 4px 4px 0 0; transition: height .4s; }
.bar-val                { font-size: .8rem; font-weight: 600; }

/* ── Quick links dashboard ──────────────────────────────────────────── */
.quick-links            { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 0; }
.quick-link             { display: flex; flex-direction: column; align-items: center; gap: 6px;
                          padding: 16px 20px; border: 1px solid var(--cor-borda, #dee2e6);
                          border-radius: 10px; text-decoration: none; color: #333; font-size: .85rem;
                          transition: box-shadow .15s, transform .15s; min-width: 110px; text-align: center; }
.quick-link span        { font-size: 1.8rem; }
.quick-link:hover       { box-shadow: 0 4px 12px rgba(0,0,0,.12); transform: translateY(-2px); color: var(--cor-primaria, #6a0f49); }

/* ── grid-info card ─────────────────────────────────────────────────── */
.grid-info              { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 8px 24px; }

/* ── Filter bar genérica ─────────────────────────────────────────────── */
.filter-bar             { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar input,
.filter-bar select      { flex: 1; min-width: 160px; max-width: 300px; }

/* ── form-grid-3 ─────────────────────────────────────────────────────── */
.form-grid-3            { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
@media (max-width: 700px) { .form-grid-3 { grid-template-columns: 1fr; } }

/* ── table compact ──────────────────────────────────────────────────── */
.table-compact td, .table-compact th { padding: 6px 10px; }
.text-right             { text-align: right; }


.row-status-erro        { background: #fff5f5; }
.row-status-duplicado   { background: #fffbf0; }
.row-status-novo        { background: #f5fff7; }

.d-block { display: block; }
.text-muted { color: #6c757d; font-size: .82rem; }

.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { background: #f8f9fa; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; text-align: left; border-bottom: 2px solid var(--border); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: #faf7ff; }
.row-inativo td { opacity: .55; }
.table-sm th, .table-sm td { padding: 6px 8px; }
.text-center { text-align: center; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag  { background: #f0eaff; color: var(--cor-primaria); font-size: .72rem; padding: 2px 7px; border-radius: 20px; font-weight: 600; }

/* ── CARDS SECTION ───────────────────────────────────────────── */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 12px 16px; font-weight: 700; font-size: .9rem; background: #f8f9fa; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card p.detail-obs { padding: 12px 16px; }
.card .detail-list { padding: 12px 16px; }
.card .table { margin: 0; }
.card .p-1 { padding: 12px 16px; }
.card .text-muted.p-1 { padding: 12px 16px; }

/* ── UTILIDADES ─────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); font-size: .9rem; }
.mt-1   { margin-top: 12px; }
.mt-2   { margin-top: 20px; }
.mb-2   { margin-bottom: 20px; }
.p-1    { padding: 12px 16px; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 8px; }
.page-header h2 { font-size: 1.4rem; color: var(--cor-primaria); }

@media (max-width: 900px) {
    .form-grid-2, .form-grid-3, .detail-grid { grid-template-columns: 1fr; }
    .table-situacoes { font-size: .75rem; }
}

/* -- LOGIN: powered by PENHA (quando h� branding de organiza��o) ------- */
.login-poweredby {
    margin-top: 22px; padding-top: 16px;
    border-top: 1px dashed #e5dbec;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    opacity: .6; transition: opacity .2s;
}
.login-poweredby:hover { opacity: 1; }
.login-poweredby-by {
    font-size: .65rem; color: #888; text-transform: uppercase; letter-spacing: 1.4px; font-weight: 600;
}
.login-poweredby img { height: 22px; width: auto; }
.login-poweredby-name {
    font-size: .75rem; font-weight: 700; color: var(--cor-primaria); letter-spacing: .5px;
}
/* ================================================================
   PENHA – Proteção Empenhada  |  app.css
   Paleta:
     #5B2C83  roxo profundo  (primária)
     #7D4BA3  roxo claro     (secundária)
     #B86BAE  rosa-orquídea  (destaque)
     #E7D7F0  lavanda suave  (fundo/hover)
     #0E3D4D  teal escuro    (texto/contraste)
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --cor-primaria:   #5B2C83;   /* era #6a0f49 */
    --cor-secundaria: #7D4BA3;   /* era #9c1f6e */
    --cor-accent:     #B86BAE;
    --cor-lavanda:    #E7D7F0;
    --cor-teal:       #0E3D4D;
    --cor-texto-hdr:  #ffffff;
    --topnav-h:       46px;
    --header-h:       64px;
    --radius:         8px;
    --shadow:         0 2px 8px rgba(91,44,131,.12);
    --bg:             #faf7fc;
    --card-bg:        #ffffff;
    --border:         #e5dbec;
    --text:           #2c2c2c;
    --text-muted:     #777;
}

html, body { height: 100%; font-family: 'Segoe UI', Arial, sans-serif; font-size: 15px; color: var(--text); background: var(--bg); }

/* ── HEADER ──────────────────────────────────────────────────── */
.header {
    position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
    background: #ffffff; color: var(--cor-primaria);
    display: flex; align-items: center; z-index: 200;
    box-shadow: 0 2px 12px rgba(91,44,131,.10);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--cor-primaria) 0%, var(--cor-secundaria) 55%, var(--cor-accent) 100%) 1;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0 24px; }
.header-brand { display: flex; align-items: center; gap: 14px; }
.header-logo  { height: 46px; width: auto; transition: transform .2s; }
.header-logo:hover { transform: scale(1.04); }
.header-title    { display: block; font-size: 1.15rem; font-weight: 700; letter-spacing: .5px; color: var(--cor-primaria); line-height: 1.1; }
.header-subtitle { display: block; font-size: .72rem; color: var(--cor-accent); font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; margin-top: 2px; }
.header-user  { display: flex; align-items: center; gap: 14px; font-size: .9rem; color: var(--cor-primaria); }
.header-username { color: var(--cor-primaria); font-weight: 600; }
.header-username small { opacity: .75; font-weight: 400; }
.btn-logout {
    background: var(--cor-primaria); color: #fff; border: 1px solid var(--cor-primaria);
    padding: 6px 14px; border-radius: var(--radius); text-decoration: none; font-size: .85rem;
    transition: background .2s, color .2s;
}
.btn-logout:hover { background: var(--cor-secundaria); border-color: var(--cor-secundaria); }

/* ── TOPNAV ──────────────────────────────────────────────────── */
.topnav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    height: var(--topnav-h);
    background: linear-gradient(90deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    z-index: 100; display: flex; align-items: center;
    box-shadow: 0 2px 8px rgba(91,44,131,.30);
}
.topnav-menu {
    list-style: none; display: flex; align-items: stretch;
    height: 100%; margin: 0; padding: 0 8px;
}
.topnav-item {
    position: relative; display: flex; align-items: stretch;
}
.topnav-link {
    display: flex; align-items: center; gap: 6px;
    padding: 0 16px; color: #fff; text-decoration: none;
    font-size: .88rem; font-weight: 500; white-space: nowrap;
    background: none; border: none; cursor: pointer;
    transition: background .15s;
    font-family: inherit;
}
.topnav-link svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.topnav-link:hover, .topnav-item.open > .topnav-link {
    background: rgba(255,255,255,.15);
}
.topnav-link.active { background: rgba(255,255,255,.2); font-weight: 700; }
.topnav-caret { width: 18px !important; height: 18px !important; margin-left: 2px; transition: transform .2s; }
.topnav-item.open .topnav-caret { transform: rotate(180deg); }

/* Dropdown menu */
.topnav-dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0;
    min-width: 210px; background: #fff; list-style: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.18); border-radius: 0 0 var(--radius) var(--radius);
    z-index: 300; padding: 4px 0;
    border-top: 3px solid var(--cor-secundaria);
}
.topnav-item.open .topnav-dropdown-menu { display: block; }
.topnav-dd-link {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 18px; color: var(--cor-primaria);
    text-decoration: none; font-size: .88rem;
    transition: background .12s, color .12s;
    border-left: 3px solid transparent;
}
.topnav-dd-link svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.topnav-dd-link:hover { background: var(--cor-lavanda); color: var(--cor-primaria); border-left-color: var(--cor-secundaria); }
.topnav-dd-link.active { background: var(--cor-lavanda); font-weight: 700; border-left-color: var(--cor-primaria); }

/* ── WRAP ────────────────────────────────────────────────────── */
.wrap { display: block; margin-top: calc(var(--header-h) + var(--topnav-h)); min-height: calc(100vh - var(--header-h) - var(--topnav-h) - 56px); padding-bottom: 64px; }

/* ── MAIN ────────────────────────────────────────────────────── */
.main { flex: 1; padding: 28px 32px; }

/* ── FOOTER ──────────────────────────────────────────────────── */
.footer {
    position: fixed; bottom: 0; left: 0; right: 0; min-height: 56px;
    background: var(--cor-teal); color: #e8eef0; font-size: .78rem;
    display: flex; align-items: center; justify-content: center; z-index: 99;
    padding: 8px 20px; line-height: 1.45; text-align: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,.15);
}
.footer .footer-inner { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.footer .footer-row   { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.footer strong        { color: #ffffff; font-weight: 600; }
.footer .footer-sep   { opacity: .45; }
.footer a             { color: #E7D7F0; text-decoration: none; }
.footer a:hover       { color: #ffffff; text-decoration: underline; }

/* ── PAGE HEADER ─────────────────────────────────────────────── */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--border);
}
.page-header h2 { font-size: 1.4rem; color: var(--cor-primaria); }
.page-header p  { margin-top: 3px; color: var(--text-muted); font-size: .9rem; }

/* ── CARD ────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 16px; color: var(--cor-primaria); }
.mt-4 { margin-top: 24px; }
.mb-4 { margin-bottom: 24px; }

/* ── FORMULÁRIOS ─────────────────────────────────────────────── */
.form-group  { margin-bottom: 16px; }
.form-row    { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1 1 200px; }
label        { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; color: #444; }
.req         { color: #e74c3c; }
.form-control {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: .9rem; color: var(--text);
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}
.form-control:focus { outline: none; border-color: var(--cor-secundaria); box-shadow: 0 0 0 3px rgba(106,15,73,.15); }
select.form-control { cursor: pointer; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Color picker */
.input-color { display: flex; align-items: center; gap: 8px; }
.form-control-color { width: 48px; height: 40px; padding: 2px 4px; border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer; }

/* Input com olhinho */
.input-eye { position: relative; }
.input-eye .form-control { padding-right: 44px; }
.btn-eye {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 1rem; color: #888;
}

/* ── TABELA ──────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--cor-lavanda); color: var(--cor-primaria); font-weight: 600; white-space: nowrap; }
.table tbody tr:hover { background: #fdf5fb; }
.row-inativo td { opacity: .55; }
.td-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }

/* ── BADGES ──────────────────────────────────────────────────── */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.badge-admin       { background: #2c3e50; color: #fff; }
.badge-coordenacao { background: var(--cor-primaria); color: #fff; }
.badge-tecnico     { background: #2980b9; color: #fff; }
.badge-recepcao    { background: #27ae60; color: #fff; }
.badge-ativo       { background: #d5f5e3; color: #1e8449; }
.badge-inativo     { background: #f5d5d5; color: #922b21; }
.badge-warning     { background: #fef9c3; color: #854d0e; }
.badge-sucesso     { background: #d5f5e3; color: #1e8449; }
.badge-default     { background: #e9ecef; color: #555; }
.badge-lg          { font-size: .85rem; padding: 5px 14px; }

/* ── BOTÕES ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius); font-size: .88rem;
    font-weight: 600; cursor: pointer; text-decoration: none;
    border: none; transition: opacity .2s, transform .1s;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.98); }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-primary   { background: var(--cor-primaria);   color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-success   { background: #27ae60; color: #fff; }
.btn-warning   { background: #f39c12; color: #fff; }
.btn-danger    { background: #e74c3c; color: #fff; }

/* ── ALERTAS ─────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: .9rem;
}
.alert-sucesso { background: #d5f5e3; color: #1e8449; border-left: 4px solid #27ae60; }
.alert-erro    { background: #fdedec; color: #922b21; border-left: 4px solid #e74c3c; }
.alert-aviso   { background: #fef9e7; color: #7d6608; border-left: 4px solid #f1c40f; }
.alert-info    { background: #eaf4fb; color: #1a5276; border-left: 4px solid #3498db; }
.alert-close   { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: inherit; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* ── STATS DASHBOARD ─────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card  { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; align-items: center; gap: 16px; }
.stat-icon  { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 28px; height: 28px; fill: #fff; }
.stat-label { display: block; font-size: .78rem; color: var(--text-muted); font-weight: 500; }
.stat-value { display: block; font-size: 1.6rem; font-weight: 700; color: var(--cor-primaria); }

/* ── CHECKLIST ───────────────────────────────────────────────── */
.checklist    { list-style: none; padding: 0; }
.checklist li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.checklist li:last-child { border: none; }

/* ── LOGIN ───────────────────────────────────────────────────── */
.login-body  { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 50%, var(--cor-teal) 100%); }
.login-wrap  { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 20px; }
.login-card  { background: #fff; border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,.3); padding: 40px 36px; width: 100%; max-width: 400px; }
.login-logo  { text-align: center; margin-bottom: 28px; }
.login-logo img { height: 120px; margin-bottom: 12px; }
.login-logo h1  { font-size: 1.8rem; color: var(--cor-primaria); letter-spacing: 1px; }
.login-logo p   { color: var(--cor-accent); font-size: .78rem; margin-top: 4px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }
.login-form .form-group { margin-bottom: 18px; }
.login-footer { color: rgba(255,255,255,.5); font-size: .78rem; margin-top: 16px; }

/* ── ERROS ───────────────────────────────────────────────────── */
.error-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.error-card { text-align: center; padding: 40px; }
.error-card h1 { font-size: 6rem; color: var(--cor-primaria); line-height: 1; }
.error-card p  { font-size: 1.2rem; margin: 12px 0 24px; color: var(--text-muted); }

/* ── RESPONSIVO ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .topnav { overflow-x: auto; }
    .topnav-link { padding: 0 10px; font-size: .8rem; }
    .main { padding: 16px; }
    .form-row { flex-direction: column; }
}

/* ── FORMULÁRIOS (form-card / form-section) ───────────────────── */
.form-card    { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.form-section { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: none; }
.form-section h3 { font-size: .95rem; font-weight: 700; color: var(--cor-primaria); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .05em; }
.form-actions { padding: 16px 24px; display: flex; gap: 10px; align-items: center; background: #fafafa; border-top: 1px solid var(--border); }
.form-grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.form-grid-2 .full  { grid-column: 1 / -1; }
.form-group   { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: .82rem; font-weight: 600; color: #555; }
.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
    font-size: .9rem; font-family: inherit; background: #fff; color: var(--text);
    transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--cor-primaria); }
.req { color: #e74c3c; margin-left: 2px; }

/* ── RADIO / CHECKBOX ─────────────────────────────────────────── */
.radio-group   { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 6px 0; }
.radio-label,
.checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: .9rem; }
.checkbox-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; padding: 6px 0; }

/* ── INPUT WITH BUTTON ────────────────────────────────────────── */
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }

/* ── BUSCA / FILTROS ─────────────────────────────────────────── */
.form-busca  { display: flex; gap: 8px; margin-bottom: 12px; }
.input-busca { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: .9rem; min-width: 260px; }
.filtros-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filtros-bar select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: .88rem; }
.btn-xs { padding: 4px 10px; font-size: .78rem; }
.btn-link { background: none; color: var(--cor-primaria); text-decoration: underline; }

/* ── DETALHES (show pages) ────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; padding: 12px 0; }
.detail-list dt { font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; padding-top: 2px; }
.detail-list dd { font-size: .9rem; margin: 0; }
.detail-list-inline { column-gap: 24px; }
.detail-obs { padding: 0 0 8px 0; font-size: .9rem; line-height: 1.6; }
.status-strip { background: #f8f9fa; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 16px; font-size: .9rem; }

/* ── MULHER SELECIONADA / BUSCA AJAX ─────────────────────────── */
.selected-mulher { display: flex; align-items: center; justify-content: space-between; background: #eaf6ff; border: 1px solid #90cdf4; border-radius: 8px; padding: 10px 14px; }
.mulher-search-box .search-results { border: 1px solid var(--border); border-radius: 6px; background: #fff; max-height: 280px; overflow-y: auto; box-shadow: var(--shadow); }
.search-result-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: .9rem; transition: background .15s; }
.search-result-item:last-child { border: none; }
.search-result-item:hover { background: #f5f0ff; }

/* ── ENCAMINHAMENTOS ─────────────────────────────────────────── */
.encam-row { display: flex; align-items: flex-end; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.encam-row:last-child { border: none; }
.encam-row .form-grid-3 { flex: 1; }

/* ── PAGINAÇÃO ───────────────────────────────────────────────── */
.paginacao { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }

/* ── TABELAS ─────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

/* ── IMPORTAÇÃO ────────────────────────────────────────────────── */
.import-layout     { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width:768px) { .import-layout { grid-template-columns: 1fr; } }

.import-card h3,
.import-info h3   { margin-top: 0; margin-bottom: .75rem; font-size: 1rem; color: var(--cor-primaria); }
.import-card p    { color: #555; font-size: .9rem; }

/* Sumário de contadores */
.import-summary   { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.summary-card     { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px;
                    padding: .75rem 1.25rem; text-align: center; min-width: 120px; }
.summary-card .summary-num  { display: block; font-size: 2rem; font-weight: 700; line-height: 1.1; }
.summary-card .summary-lbl  { display: block; font-size: .78rem; color: #6c757d; margin-top: .2rem; }
.summary-novo     { border-color: #28a745; }
.summary-novo .summary-num  { color: #28a745; }
.summary-duplicado{ border-color: #e08a00; }
.summary-duplicado .summary-num { color: #e08a00; }
.summary-erro     { border-color: #dc3545; }
.summary-erro .summary-num  { color: #dc3545; }

/* Tabela de prévia */
.table-scroll     { overflow-x: auto; }
.import-preview-table { min-width: 900px; font-size: .82rem; }
.import-preview-table th { white-space: nowrap; background: #f1f3f5; }
.import-preview-table td { vertical-align: top; padding: 6px 8px; }

/* ── Relatórios ─────────────────────────────────────────────────────── */
.rel-filter-form        { margin-bottom: 1.5rem; }
.rel-filter-row         { display: flex; gap: 1.5rem; align-items: flex-end; flex-wrap: wrap; }
.btn-group              { display: flex; gap: .5rem; flex-wrap: wrap; }
.rel-available-months   { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--cor-borda); font-size: .85rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.badge-mes              { display: inline-block; background: #e8f0fe; color: #4472c4; border-radius: 20px; padding: 3px 12px; font-size: .78rem; font-weight: 600; text-decoration: none; transition: background .15s; }
.badge-mes:hover        { background: #c5d8fc; }

/* ── Abas de status (tab-bar) ───────────────────────────────────────── */
.tab-bar        { display: flex; gap: 4px; border-bottom: 2px solid var(--cor-borda, #dee2e6); margin-bottom: 12px; }
.tab            { padding: 6px 18px; font-size: .9rem; text-decoration: none; color: #555; border-bottom: 3px solid transparent; margin-bottom: -2px; border-radius: 4px 4px 0 0; transition: color .15s; }
.tab:hover      { color: var(--cor-primaria, #6a0f49); background: #f5f5f5; }
.tab-active     { color: var(--cor-primaria, #6a0f49); border-bottom-color: var(--cor-primaria, #6a0f49); font-weight: 600; background: #fff; }

/* ── Grid de filhos por faixa etária ──────────────────────────────── */
.filhos-grid            { border: 1px solid var(--cor-borda, #dee2e6); border-radius: 8px; overflow: hidden; }
.filhos-header,
.filhos-row             { display: grid; grid-template-columns: 1fr 120px 120px; }
.filhos-header          { background: #f1f3f5; font-weight: 600; font-size: .85rem; }
.filhos-header span,
.filhos-row span        { padding: 8px 12px; display: flex; align-items: center; }
.filhos-row             { border-top: 1px solid var(--cor-borda, #dee2e6); }
.filhos-row input[type=number] { width: 80px; text-align: center; margin: 6px auto; }
.filhos-row:nth-child(even) { background: #fafafa; }

/* ── FRIDA form ─────────────────────────────────────────────────────── */
.frida-questao          { padding: 14px 0; border-bottom: 1px solid #eee; }
.frida-questao:last-child { border-bottom: none; }
.frida-condicional      { padding-left: 24px; background: #fafafe; border-left: 3px solid #c5d8fc; margin-left: 20px; }
.frida-pergunta         { font-size: .95rem; margin-bottom: 8px; }
.frida-num              { font-weight: 700; color: var(--cor-primaria, #6a0f49); margin-right: 6px; }
.frida-opcoes           { display: flex; flex-wrap: wrap; gap: 12px; }
.frida-opt              { display: flex; align-items: center; gap: 5px; font-size: .88rem; cursor: pointer;
                          padding: 5px 12px; border: 1px solid #dee2e6; border-radius: 20px; transition: background .15s; }
.frida-opt:has(input:checked) { background: var(--cor-primaria, #6a0f49); color: #fff; border-color: var(--cor-primaria, #6a0f49); }
.frida-opt input[type=radio]  { display: none; }

/* FRIDA show ─────────────────────────────────────────────────────────── */
.frida-resumo           { display: flex; flex-direction: column; gap: 0; }
.frida-item             { display: grid; grid-template-columns: 40px 1fr 120px; gap: 8px; padding: 10px 0; border-bottom: 1px solid #eee; align-items: start; }
.frida-item:last-child  { border-bottom: none; }
.frida-item-num         { font-weight: 700; color: var(--cor-primaria, #6a0f49); }
.frida-item-resp        { font-weight: 600; text-align: right; }
.frida-sim              { color: #c0392b; }
.frida-nao              { color: #27ae60; }
.frida-nao_sabe         { color: #e08a00; }
.frida-nao_se_aplica    { color: #888; }

/* ── Presença ────────────────────────────────────────────────────────── */
.presenca-header        { font-size: 1.05rem; font-weight: 600; margin-bottom: 12px; color: var(--cor-primaria, #6a0f49); }
.row-presente           { background: #f0fff4; }

/* ── Dashboard bar chart ─────────────────────────────────────────────── */
.bar-chart              { display: flex; gap: 12px; align-items: flex-end; height: 140px; padding: 8px 0; }
.bar-item               { display: flex; flex-direction: column; align-items: center; flex: 1; gap: 4px; height: 100%; }
.bar-label              { font-size: .72rem; color: #888; white-space: nowrap; }
.bar-track              { flex: 1; width: 100%; display: flex; align-items: flex-end; background: #f0f0f0; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 20px; }
.bar-fill               { width: 100%; border-radius: 4px 4px 0 0; transition: height .4s; }
.bar-val                { font-size: .8rem; font-weight: 600; }

/* ── Quick links dashboard ──────────────────────────────────────────── */
.quick-links            { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 0; }
.quick-link             { display: flex; flex-direction: column; align-items: center; gap: 6px;
                          padding: 16px 20px; border: 1px solid var(--cor-borda, #dee2e6);
                          border-radius: 10px; text-decoration: none; color: #333; font-size: .85rem;
                          transition: box-shadow .15s, transform .15s; min-width: 110px; text-align: center; }
.quick-link span        { font-size: 1.8rem; }
.quick-link:hover       { box-shadow: 0 4px 12px rgba(0,0,0,.12); transform: translateY(-2px); color: var(--cor-primaria, #6a0f49); }

/* ── grid-info card ─────────────────────────────────────────────────── */
.grid-info              { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 8px 24px; }

/* ── Filter bar genérica ─────────────────────────────────────────────── */
.filter-bar             { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar input,
.filter-bar select      { flex: 1; min-width: 160px; max-width: 300px; }

/* ── form-grid-3 ─────────────────────────────────────────────────────── */
.form-grid-3            { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
@media (max-width: 700px) { .form-grid-3 { grid-template-columns: 1fr; } }

/* ── table compact ──────────────────────────────────────────────────── */
.table-compact td, .table-compact th { padding: 6px 10px; }
.text-right             { text-align: right; }


.row-status-erro        { background: #fff5f5; }
.row-status-duplicado   { background: #fffbf0; }
.row-status-novo        { background: #f5fff7; }

.d-block { display: block; }
.text-muted { color: #6c757d; font-size: .82rem; }

.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { background: #f8f9fa; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; text-align: left; border-bottom: 2px solid var(--border); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: #faf7ff; }
.row-inativo td { opacity: .55; }
.table-sm th, .table-sm td { padding: 6px 8px; }
.text-center { text-align: center; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag  { background: #f0eaff; color: var(--cor-primaria); font-size: .72rem; padding: 2px 7px; border-radius: 20px; font-weight: 600; }

/* ── CARDS SECTION ───────────────────────────────────────────── */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 12px 16px; font-weight: 700; font-size: .9rem; background: #f8f9fa; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card p.detail-obs { padding: 12px 16px; }
.card .detail-list { padding: 12px 16px; }
.card .table { margin: 0; }
.card .p-1 { padding: 12px 16px; }
.card .text-muted.p-1 { padding: 12px 16px; }

/* ── UTILIDADES ─────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); font-size: .9rem; }
.mt-1   { margin-top: 12px; }
.mt-2   { margin-top: 20px; }
.mb-2   { margin-bottom: 20px; }
.p-1    { padding: 12px 16px; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 8px; }
.page-header h2 { font-size: 1.4rem; color: var(--cor-primaria); }

@media (max-width: 900px) {
    .form-grid-2, .form-grid-3, .detail-grid { grid-template-columns: 1fr; }
    .table-situacoes { font-size: .75rem; }
}

/* -- LOGIN: powered by PENHA (quando h� branding de organiza��o) ------- */
.login-poweredby {
    margin-top: 22px; padding-top: 16px;
    border-top: 1px dashed #e5dbec;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    opacity: .6; transition: opacity .2s;
}
.login-poweredby:hover { opacity: 1; }
.login-poweredby-by {
    font-size: .65rem; color: #888; text-transform: uppercase; letter-spacing: 1.4px; font-weight: 600;
}
.login-poweredby img { height: 22px; width: auto; }
.login-poweredby-name {
    font-size: .75rem; font-weight: 700; color: var(--cor-primaria); letter-spacing: .5px;
}

/* ── User menu dropdown (header) ──────────────────────────────────────── */
.user-menu { position: relative; display: inline-block; }
/* Container que empurra o user-menu para a direita do topnav */
.topnav-user { margin-left: auto; padding: 0 12px; display: flex; align-items: center; height: 100%; }

.user-menu-trigger {
    display: flex; align-items: center; gap: 10px;
    background: transparent; border: 1px solid transparent;
    padding: 6px 10px; border-radius: 999px; cursor: pointer;
    color: #fff; font: inherit;
    transition: background .15s, border-color .15s;
}
.user-menu-trigger:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.25); }
.user-menu.open .user-menu-trigger { background: rgba(255,255,255,.20); border-color: rgba(255,255,255,.35); }
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #fff; color: var(--cor-primaria, #5b3782);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.user-name { font-weight: 600; font-size: .9rem; }
.user-perfil { font-size: .72rem; opacity: .7; text-transform: capitalize; }
.user-caret { transition: transform .15s; opacity: .7; }
.user-menu.open .user-caret { transform: rotate(180deg); }

.user-menu-dropdown {
    position: absolute; top: calc(100% + 6px); right: 0;
    min-width: 240px; max-width: 320px;
    background: #fff; border: 1px solid #e5dbec; border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    list-style: none; margin: 0; padding: 6px 0;
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .12s, transform .12s, visibility .12s;
    z-index: 1000;
}
.user-menu.open .user-menu-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.user-menu-dropdown li { margin: 0; }
.user-menu-dropdown a {
    display: block; padding: 9px 14px; color: #333;
    text-decoration: none; font-size: .9rem; transition: background .12s;
}
.user-menu-dropdown a:hover { background: #f6f0fb; color: var(--cor-primaria, #5b3782); }
.user-menu-dropdown a.user-menu-logout { color: #b14545; }
.user-menu-dropdown a.user-menu-logout:hover { background: #fbeaea; color: #8c2b2b; }
.user-menu-info { padding: 10px 14px 8px; }
.user-menu-info-name { font-weight: 700; color: #333; font-size: .92rem; }
.user-menu-info-perfil { font-size: .78rem; color: #666; margin-top: 2px; text-transform: capitalize; }
.user-menu-info-email { font-size: .78rem; color: #888; margin-top: 2px; word-break: break-all; }
.user-menu-sep { height: 1px; background: #ece3f3; margin: 6px 0; }

@media (max-width: 600px) {
    .user-meta { display: none; }
    .user-menu-dropdown { right: -6px; min-width: 220px; }
}

/* ── Header: PENHA powered-by (lateral à marca da organização) ──────── */
.header-brand { min-width: 0; }
.header-poweredby {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: 6px; padding-left: 12px;
    border-left: 1px solid rgba(91,44,131,.18);
    color: var(--cor-primaria);
    line-height: 1; flex-shrink: 0;
}
.header-poweredby img {
    height: 32px; width: auto; max-height: calc(var(--header-h) - 24px);
    display: block; flex-shrink: 0;
}
.header-poweredby-by   { font-size: .68rem; color: var(--text-muted, #888); font-weight: 500; text-transform: lowercase; }
.header-poweredby-name { font-size: .8rem; font-weight: 700; letter-spacing: .5px; }
@media (max-width: 720px) {
    .header-poweredby-by, .header-poweredby-name { display: none; }
    .header-poweredby { padding-left: 8px; margin-left: 4px; }
}
/* -- MOBILE MENU (hamburger) ----------------------------------- */
.topnav-mobile-btn {
    display: none;
    background: none;
    border: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 40px;
    width: 44px;
    margin: 0 6px 0 auto;
    padding: 0;
    cursor: pointer;
    z-index: 999;
}
.topnav-mobile-btn span {
    display: block;
    width: 26px;
    height: 3px;
    margin: 3px 0;
    background: #fff;
    border-radius: 2px;
    transition: all .25s;
}
body.menu-aberto .topnav-mobile-btn span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
body.menu-aberto .topnav-mobile-btn span:nth-child(2) { opacity: 0; }
body.menu-aberto .topnav-mobile-btn span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

@media (max-width: 900px) {
    .topnav { justify-content: flex-end; padding: 0 4px; }
    .topnav-mobile-btn { display: flex; }

    .topnav-menu {
        position: fixed;
        top: calc(var(--header-h) + var(--topnav-h));
        left: 0; right: 0;
        background: #ffffff;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0 24px 0;
        height: calc(100vh - var(--header-h) - var(--topnav-h));
        overflow-y: auto;
        transform: translateY(-120%);
        transition: transform .28s ease;
        z-index: 1000;
        border-top: 1px solid var(--border);
    }
    body.menu-aberto .topnav-menu {
        transform: translateY(0);
        box-shadow: 0 12px 24px rgba(0,0,0,.18);
    }

    .topnav-item {
        flex-direction: column;
        align-items: stretch;
        border-bottom: 1px solid var(--border);
    }
    .topnav-item:last-child { border-bottom: none; }

    .topnav-link {
        padding: 14px 22px;
        font-size: 1rem;
        color: var(--cor-primaria);
        gap: 12px;
        line-height: 1.3;
        justify-content: flex-start;
        width: 100%;
        text-align: left;
    }
    .topnav-link svg { width: 20px; height: 20px; }
    .topnav-link:hover,
    .topnav-item.open > .topnav-link {
        background: var(--cor-lavanda);
        color: var(--cor-primaria);
    }
    .topnav-link.active {
        background: var(--cor-lavanda);
        color: var(--cor-primaria);
        border-left: 4px solid var(--cor-secundaria);
        padding-left: 18px;
    }
    .topnav-toggle { justify-content: space-between; }
    .topnav-caret { margin-left: auto; }

    .topnav-dropdown-menu {
        position: static;
        display: none;
        min-width: 0;
        box-shadow: none;
        border-radius: 0;
        border-top: none;
        background: #faf7fc;
        padding: 4px 0 8px 0;
    }
    .topnav-item.open .topnav-dropdown-menu { display: block; }
    .topnav-dd-link {
        padding: 12px 22px 12px 56px;
        font-size: .95rem;
        gap: 10px;
    }
    .topnav-dd-link svg { width: 18px; height: 18px; }

    /* Trava scroll do body quando menu aberto */
    body.menu-aberto { overflow: hidden; }
}

@media (max-width: 600px) {
    .header-inner { padding: 0 10px; }
    .header-title { font-size: 1rem; }
    .header-subtitle { font-size: .65rem; }
    .header-poweredby { display: none; }
    .main { padding: 18px 6px; }
}
