/* ============================================================
   Arquivo: /assets/css/app.css
   IPMA - Sistema de Atualização Cadastral v2.0
   CSS principal — responsivo, mobile-first, sem frameworks externos
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --azul:       #0a2463;
  --azul2:      #1e3a8a;
  --azul-claro: #e8eef8;
  --verde:      #16a34a;
  --verde-claro:#dcfce7;
  --laranja:    #ea580c;
  --laranja-claro:#fff7ed;
  --vermelho:   #dc2626;
  --verm-claro: #fee2e2;
  --amarelo:    #ca8a04;
  --amar-claro: #fef9c3;
  --cinza-bg:   #f1f5f9;
  --cinza-brd:  #e2e8f0;
  --cinza-txt:  #64748b;
  --branco:     #ffffff;
  --sombra:     0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --sombra-md:  0 4px 6px -1px rgba(0,0,0,.10), 0 2px 4px -2px rgba(0,0,0,.10);
  --radius:     10px;
  --radius-sm:  6px;
  --trans:      all .18s ease;
}
html { font-size: 15px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--cinza-bg);
  color: #1e293b;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--azul2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
svg { display: inline-block; vertical-align: middle; }

/* ── Tipografia ───────────────────────────────────────────── */
h1,h2,h3,h4 { line-height: 1.3; }
.page-title { font-size: 1.25rem; font-weight: 700; color: var(--azul); margin-bottom: 2px; }
.page-sub   { font-size: .82rem; color: var(--cinza-txt); margin-bottom: 18px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border: none; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600; cursor: pointer; transition: var(--trans);
  text-decoration: none; white-space: nowrap;
}
.btn-primary  { background: var(--azul); color: #fff; }
.btn-primary:hover { background: var(--azul2); color: #fff; }
.btn-secondary { background: var(--cinza-bg); color: var(--azul); border: 1.5px solid var(--cinza-brd); }
.btn-secondary:hover { background: var(--azul-claro); border-color: var(--azul2); }
.btn-success  { background: var(--verde); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger   { background: var(--vermelho); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning  { background: var(--laranja); color: #fff; }
.btn-warning:hover { background: #c2410c; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: none; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; transition: var(--trans);
}
.btn-icon svg { width: 22px; height: 22px; }
.btn-icon:hover { background: var(--cinza-brd); }

/* ── Formulários ─────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field-group label {
  font-size: .8rem; font-weight: 600; color: #374151;
}
.field-group input, .field-group select, .field-group textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--cinza-brd);
  border-radius: var(--radius-sm); font-size: .9rem; color: #1e293b;
  background: var(--branco); transition: var(--trans);
  -webkit-appearance: none; appearance: none;
}
.field-group input:focus, .field-group select:focus, .field-group textarea:focus {
  outline: none; border-color: var(--azul2); box-shadow: 0 0 0 3px rgba(30,58,138,.12);
}
.field-group input[readonly], .field-group input[disabled] {
  background: #f8faff; color: #94a3b8; cursor: not-allowed;
}
.field-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 20px;
  padding-right: 32px;
}
.field-group textarea { resize: vertical; min-height: 72px; }
.required-star { color: var(--vermelho); }

.field-row { display: grid; gap: 10px; }
.field-row.col2 { grid-template-columns: 1fr 1fr; }
.field-row.col3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 480px) {
  .field-row.col2, .field-row.col3 { grid-template-columns: 1fr; }
}

/* ── Alertas ─────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: .85rem; margin-bottom: 14px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-erro    { background: var(--verm-claro); color: #991b1b; border: 1px solid #fca5a5; }
.alert-ok      { background: var(--verde-claro); color: #14532d; border: 1px solid #86efac; }
.alert-info    { background: var(--azul-claro); color: var(--azul); border: 1px solid #bfdbfe; }
.alert-aviso   { background: var(--amar-claro); color: #713f12; border: 1px solid #fde047; }

/* ── Badges / Chips ──────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px; font-size: .75rem; font-weight: 600;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; }
.chip-verde   { background: var(--verde-claro); color: #15803d; }
.chip-verde .chip-dot   { background: var(--verde); }
.chip-laranja { background: var(--laranja-claro); color: #c2410c; }
.chip-laranja .chip-dot { background: var(--laranja); }
.chip-vermelho { background: var(--verm-claro); color: var(--vermelho); }
.chip-vermelho .chip-dot { background: var(--vermelho); }
.chip-cinza   { background: var(--cinza-bg); color: var(--cinza-txt); }
.chip-cinza .chip-dot   { background: var(--cinza-txt); }
.chip-azul    { background: var(--azul-claro); color: var(--azul); }
.chip-azul .chip-dot    { background: var(--azul); }

/* ── Progress bar ─────────────────────────────────────────── */
.progress-wrap { padding: 8px 16px; background: var(--branco); border-bottom: 1px solid var(--cinza-brd); }
.progress-label { display: flex; justify-content: space-between; font-size: .78rem; color: var(--cinza-txt); margin-bottom: 5px; }
.progress-bar { background: var(--cinza-brd); border-radius: 4px; height: 7px; overflow: hidden; }
.progress-fill { background: linear-gradient(90deg, var(--azul2), var(--verde)); border-radius: 4px; height: 100%; transition: width .6s ease; }

/* ── Login ───────────────────────────────────────────────── */
.login-body { background: linear-gradient(135deg, var(--azul) 0%, var(--azul2) 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-wrap { width: 100%; max-width: 400px; }
.login-card { background: var(--branco); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.login-logo { background: linear-gradient(135deg, var(--azul) 0%, var(--azul2) 100%); padding: 28px 24px 22px; text-align: center; color: #fff; }
.logo-circle { width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,.15); border: 2.5px solid rgba(255,255,255,.5); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; overflow: hidden; }
.logo-circle svg { width: 46px; height: 46px; }
.login-logo h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: .5px; margin-bottom: 3px; }
.login-logo p  { font-size: .8rem; opacity: .85; line-height: 1.3; }
.login-box { padding: 24px 24px 28px; }
.login-box h2  { font-size: 1.1rem; font-weight: 700; color: var(--azul); margin-bottom: 2px; }
.login-sub     { font-size: .8rem; color: var(--cinza-txt); margin-bottom: 18px; }
.login-footer  { text-align: center; margin-top: 16px; }
.link-admin    { font-size: .8rem; color: var(--cinza-txt); transition: var(--trans); }
.link-admin:hover { color: var(--azul); text-decoration: none; }

/* ── Topbar (usuário) ─────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--azul);
  box-shadow: var(--sombra-md);
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-brand { display: block; font-size: 1rem; font-weight: 800; color: #fff; line-height: 1; }
.topbar-sub   { display: block; font-size: .72rem; color: rgba(255,255,255,.7); line-height: 1; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.topbar .btn-icon { color: rgba(255,255,255,.85); }
.topbar .btn-icon:hover { background: rgba(255,255,255,.15); }

/* ── Form sections (usuário) ─────────────────────────────── */
.form-section {
  background: var(--branco); margin: 12px; border-radius: var(--radius);
  padding: 16px; box-shadow: var(--sombra);
}
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .95rem; font-weight: 700; color: var(--azul);
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--azul-claro);
}
.section-icon { width: 28px; height: 28px; background: var(--azul-claro); border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.section-icon svg { width: 16px; height: 16px; fill: var(--azul); }

/* ── Avatar (usuário) ─────────────────────────────────────── */
.avatar-wrap { text-align: center; padding: 20px 16px 8px; }
.avatar-circle { width: 88px; height: 88px; border-radius: 50%; overflow: hidden; margin: 0 auto 10px; position: relative; cursor: pointer; border: 3px solid var(--azul); box-shadow: var(--sombra-md); }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-overlay { position: absolute; inset: 0; background: rgba(10,36,99,.65); display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; transition: var(--trans); }
.avatar-circle:hover .avatar-overlay { opacity: 1; }
.avatar-overlay svg { width: 22px; height: 22px; fill: #fff; }
.avatar-overlay span { font-size: .7rem; color: #fff; margin-top: 3px; }
.avatar-name { font-size: 1rem; font-weight: 700; color: var(--azul); }
.avatar-mat  { font-size: .8rem; color: var(--cinza-txt); margin-bottom: 6px; }
.avatar-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-ok      { background: var(--verde-claro); color: #15803d; }
.badge-pending { background: var(--amar-claro); color: var(--amarelo); }
.badge-missing { background: var(--verm-claro); color: var(--vermelho); }

/* ── Foto upload ──────────────────────────────────────────── */
.foto-upload-area {
  border: 2px dashed var(--cinza-brd); border-radius: var(--radius);
  padding: 24px 16px; text-align: center; cursor: pointer; transition: var(--trans);
}
.foto-upload-area:hover { border-color: var(--azul2); background: var(--azul-claro); }
.foto-upload-area svg { width: 40px; height: 40px; fill: var(--cinza-txt); margin: 0 auto 8px; }
.foto-upload-area strong { display: block; font-size: .9rem; color: #374151; margin-bottom: 4px; }
.foto-upload-area p { font-size: .8rem; color: var(--cinza-txt); }
.foto-preview { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius-sm); }

/* ── Dependentes cards ────────────────────────────────────── */
.dep-card { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--cinza-bg); border-radius: var(--radius-sm); margin-bottom: 8px; }
.dep-nome { font-size: .88rem; font-weight: 600; }
.dep-info { font-size: .78rem; color: var(--cinza-txt); }
.dep-del  { background: none; border: none; cursor: pointer; padding: 4px; color: var(--vermelho); opacity: .7; }
.dep-del:hover { opacity: 1; }
.dep-del svg { width: 18px; height: 18px; }

/* ── Sticky footer ──────────────────────────────────────────*/
.sticky-footer { position: sticky; bottom: 0; background: var(--branco); padding: 12px 16px; border-top: 1px solid var(--cinza-brd); box-shadow: 0 -2px 8px rgba(0,0,0,.08); z-index: 90; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; padding: 16px; align-items: flex-end; justify-content: center; }
.modal-overlay.active { display: flex; }
@media (min-width: 480px) { .modal-overlay { align-items: center; } }
.modal-box { background: var(--branco); border-radius: var(--radius); padding: 20px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title { font-size: 1rem; font-weight: 700; color: var(--azul); }
.modal-close { background: none; border: none; cursor: pointer; padding: 4px; color: var(--cinza-txt); }
.modal-close svg { width: 22px; height: 22px; fill: currentColor; }

/* ── Toast ────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 72px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1e293b; color: #fff; padding: 10px 20px; border-radius: 24px;
  font-size: .85rem; font-weight: 500; opacity: 0; pointer-events: none;
  transition: all .3s; z-index: 999; white-space: nowrap; max-width: 90vw;
}
#toast.show   { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok     { background: var(--verde); }
#toast.err    { background: var(--vermelho); }
#toast.aviso  { background: var(--laranja); }

/* ── Divider ──────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--cinza-brd); }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-16 { margin-bottom: 16px; }
.mb-0  { margin-bottom: 0; }

/* ── Título de busca título eleitor ─────────────────────────*/
.titulo-busca-btn {
  display: flex; align-items: center; gap: 6px; padding: 9px 14px;
  background: var(--azul-claro); color: var(--azul2); border: 1.5px solid var(--azul2);
  border-radius: var(--radius-sm); font-size: .82rem; font-weight: 600; cursor: pointer; transition: var(--trans);
  width: 100%;
}
.titulo-busca-btn:hover { background: var(--azul2); color: #fff; }
.titulo-busca-btn svg { width: 16px; height: 16px; }

/* ══════════════════════════════════════════════════════════
   ÁREA ADMINISTRATIVA
   ══════════════════════════════════════════════════════════ */
.admin-body { background: var(--cinza-bg); min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  position: fixed; top: 0; left: -260px; width: 260px; height: 100vh;
  background: var(--azul); z-index: 300; transition: left .25s ease;
  overflow-y: auto; display: flex; flex-direction: column;
}
.admin-sidebar.open { left: 0; box-shadow: 4px 0 20px rgba(0,0,0,.25); }
@media (min-width: 900px) {
  .admin-sidebar { left: 0; }
  .admin-main    { margin-left: 260px; }
  .sidebar-overlay { display: none !important; }
}
.sidebar-logo { padding: 20px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-logo-img { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 8px; }
.sidebar-logo-img img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-logo-img svg { width: 28px; height: 28px; fill: #fff; }
.sidebar-sigla { font-size: 1.1rem; font-weight: 800; color: #fff; line-height: 1; }
.sidebar-inst  { font-size: .72rem; color: rgba(255,255,255,.65); line-height: 1.3; margin-top: 2px; }
.sidebar-nav   { flex: 1; padding: 12px 8px; }
.nav-section   { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.45); padding: 10px 8px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 8px; color: rgba(255,255,255,.8); font-size: .88rem;
  font-weight: 500; cursor: pointer; transition: var(--trans); margin-bottom: 2px;
  text-decoration: none;
}
.nav-item svg { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 700; }
.nav-badge { margin-left: auto; background: var(--vermelho); color: #fff; font-size: .68rem; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; background: rgba(255,255,255,.08); }
.sidebar-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: .9rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.sidebar-username { font-size: .82rem; font-weight: 600; color: #fff; }
.sidebar-role     { font-size: .72rem; color: rgba(255,255,255,.6); }
.sidebar-overlay { display: none; }
.sidebar-overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 299; }

/* Admin main */
.admin-main { min-height: 100vh; }
.admin-topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: var(--branco);
  border-bottom: 1px solid var(--cinza-brd); box-shadow: var(--sombra);
}
.admin-topbar-left { display: flex; align-items: center; gap: 10px; }
.admin-topbar-title { font-size: 1rem; font-weight: 700; color: var(--azul); }
.admin-content { padding: 20px; max-width: 1200px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--branco); border-radius: var(--radius); padding: 16px; box-shadow: var(--sombra); border-left: 3px solid var(--cinza-brd); }
.stat-card.verde   { border-color: var(--verde); }
.stat-card.laranja { border-color: var(--laranja); }
.stat-card.vermelho { border-color: var(--vermelho); }
.stat-card.azul    { border-color: var(--azul); }
.stat-num   { font-size: 1.7rem; font-weight: 800; color: var(--azul); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: .78rem; color: var(--cinza-txt); font-weight: 500; line-height: 1.3; }

/* Table cards */
.table-card { background: var(--branco); border-radius: var(--radius); box-shadow: var(--sombra); overflow: hidden; margin-bottom: 20px; }
.table-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--cinza-brd); flex-wrap: wrap; gap: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table thead th { padding: 10px 14px; background: var(--cinza-bg); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--cinza-txt); text-align: left; border-bottom: 1px solid var(--cinza-brd); }
.data-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--cinza-brd); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--cinza-bg); }
.td-nome { font-weight: 600; }
.td-mat  { font-size: .78rem; color: var(--cinza-txt); }

/* Filtros admin */
.filtros-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filtros-bar input, .filtros-bar select { padding: 8px 12px; border: 1.5px solid var(--cinza-brd); border-radius: var(--radius-sm); font-size: .85rem; background: var(--branco); color: #1e293b; }
.filtros-bar input:focus, .filtros-bar select:focus { outline: none; border-color: var(--azul2); }
.filtros-bar input[type="text"], .filtros-bar input[type="search"] { min-width: 200px; }

/* Paginação */
.pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1.5px solid var(--cinza-brd); border-radius: var(--radius-sm);
  font-size: .82rem; color: var(--cinza-txt); text-decoration: none; transition: var(--trans);
}
.page-link:hover, .page-link.active { background: var(--azul); color: #fff; border-color: var(--azul); text-decoration: none; }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* Funcionário card (admin) */
.func-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--cinza-brd); transition: var(--trans); cursor: pointer; }
.func-card:hover { background: var(--cinza-bg); }
.func-card:last-child { border-bottom: none; }
.func-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--azul-claro); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .95rem; font-weight: 700; color: var(--azul); }
.func-avatar img { width: 100%; height: 100%; object-fit: cover; }
.func-info { flex: 1; min-width: 0; }
.func-nome { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.func-sub  { font-size: .78rem; color: var(--cinza-txt); }
.func-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════
   RELATÓRIO A4 (print + web)
   ══════════════════════════════════════════════════════════ */
.relatorio-wrap {
  max-width: 210mm; margin: 0 auto; padding: 20px;
}
.relatorio-acoes {
  background: var(--branco); border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 16px; box-shadow: var(--sombra);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.relatorio-acoes-title { font-size: .95rem; font-weight: 700; color: var(--azul); flex: 1; }

/* A4 paper */
.a4-paper {
  background: #fff;
  width: 100%;
  max-width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 12mm 14mm;
  box-shadow: var(--sombra-md);
  border-radius: 4px;
  font-size: 10pt;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: #1a1a1a;
}
.rlt-header { display: flex; align-items: center; gap: 14px; padding-bottom: 10px; border-bottom: 2.5px solid var(--azul); margin-bottom: 10px; }
.rlt-logo { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; border: 2px solid var(--azul); background: var(--azul-claro); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rlt-logo img { width: 100%; height: 100%; object-fit: contain; }
.rlt-logo svg { width: 36px; height: 36px; fill: var(--azul); }
.rlt-inst-nome { font-size: 11pt; font-weight: 800; color: var(--azul); line-height: 1.2; }
.rlt-inst-sub  { font-size: 8pt; color: var(--cinza-txt); line-height: 1.4; }
.rlt-titulo    { font-size: 11pt; font-weight: 700; text-transform: uppercase; color: var(--azul); text-align: right; margin-left: auto; letter-spacing: .04em; line-height: 1.3; }

.rlt-perfil   { display: flex; align-items: center; gap: 12px; background: var(--azul-claro); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.rlt-perfil-foto { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 2px solid var(--azul); flex-shrink: 0; background: #e2e8f0; }
.rlt-perfil-foto img { width: 100%; height: 100%; object-fit: cover; }
.rlt-perfil-nome { font-size: 12pt; font-weight: 800; color: var(--azul); line-height: 1.2; }
.rlt-perfil-mat  { font-size: 8.5pt; color: var(--cinza-txt); }
.rlt-perfil-status { margin-left: auto; text-align: right; }

.rlt-secao { margin-bottom: 8px; }
.rlt-secao-titulo {
  font-size: 8.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--branco); background: var(--azul);
  padding: 4px 8px; border-radius: 4px 4px 0 0; margin-bottom: 0;
}
.rlt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid #d1d5db; border-top: none; border-radius: 0 0 4px 4px; overflow: hidden; }
.rlt-grid.col2 { grid-template-columns: 1fr 1fr; }
.rlt-grid.col4 { grid-template-columns: repeat(4, 1fr); }
.rlt-campo {
  padding: 5px 8px; border-right: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb;
  position: relative;
}
.rlt-campo:nth-child(3n) { border-right: none; }
.rlt-grid.col2 .rlt-campo:nth-child(2n) { border-right: none; }
.rlt-grid.col4 .rlt-campo:nth-child(4n) { border-right: none; }
.rlt-campo.span2 { grid-column: span 2; }
.rlt-campo.span3 { grid-column: span 3; }
.rlt-campo.span4 { grid-column: span 4; }
.rlt-campo-label { font-size: 7pt; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; margin-bottom: 1px; }
.rlt-campo-valor { font-size: 9pt; color: #111827; font-weight: 500; min-height: 14px; }

/* ── Status: Verde = alterado, Cinza = mantido, Amarelo = pendente */
.rlt-campo.alterado { background: #f0fdf4; }
.rlt-campo.alterado .rlt-campo-valor { color: #15803d; font-weight: 700; }
.rlt-campo.alterado::after { content: '✓'; position: absolute; top: 3px; right: 5px; font-size: 8pt; color: #16a34a; }
.rlt-campo.pendente { background: #fffbeb; }
.rlt-campo.pendente .rlt-campo-valor { color: #92400e; font-style: italic; }
.rlt-campo.pendente::after { content: '⚠'; position: absolute; top: 3px; right: 5px; font-size: 7pt; color: #ca8a04; }

.rlt-legenda { display: flex; gap: 14px; margin: 8px 0; flex-wrap: wrap; }
.rlt-leg-item { display: flex; align-items: center; gap: 5px; font-size: 7.5pt; color: var(--cinza-txt); }
.rlt-leg-dot { width: 10px; height: 10px; border-radius: 2px; }
.rlt-leg-dot.verde   { background: #dcfce7; border: 1.5px solid #16a34a; }
.rlt-leg-dot.cinza   { background: #f1f5f9; border: 1.5px solid #cbd5e1; }
.rlt-leg-dot.amarelo { background: #fef9c3; border: 1.5px solid #ca8a04; }

.rlt-deps { margin-bottom: 8px; }
.rlt-deps-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; border: 1px solid #d1d5db; border-top: none; }
.rlt-deps-table th { background: #f8fafc; padding: 4px 8px; border-bottom: 1px solid #e5e7eb; border-right: 1px solid #e5e7eb; font-weight: 700; text-align: left; color: var(--cinza-txt); font-size: 7.5pt; text-transform: uppercase; }
.rlt-deps-table td { padding: 4px 8px; border-bottom: 1px solid #e5e7eb; border-right: 1px solid #e5e7eb; }
.rlt-deps-table tr:last-child td { border-bottom: none; }

.rlt-footer { border-top: 1.5px solid var(--azul); margin-top: 12px; padding-top: 8px; }
.rlt-assinatura { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 10px; }
.rlt-assin-bloco { text-align: center; }
.rlt-assin-linha { border-bottom: 1px solid #374151; margin-bottom: 4px; height: 28px; }
.rlt-assin-nome  { font-size: 8pt; font-weight: 600; color: #1e293b; }
.rlt-assin-cargo { font-size: 7pt; color: var(--cinza-txt); }
.rlt-rodape { text-align: center; font-size: 7.5pt; color: var(--cinza-txt); line-height: 1.4; }
.rlt-qrcode { text-align: right; margin-top: 8px; }
.rlt-data-emissao { font-size: 8pt; color: var(--cinza-txt); margin-bottom: 4px; }

/* ── Resumo de campos alterados (web) */
.resumo-alteracoes { margin: 10px 12px; }
.resumo-card { background: var(--branco); border-radius: var(--radius); box-shadow: var(--sombra); padding: 14px; }
.resumo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin-top: 10px; }
.resumo-item { padding: 6px 10px; border-radius: 6px; font-size: .8rem; }
.resumo-item.alterado { background: var(--verde-claro); color: #15803d; border: 1px solid #86efac; }
.resumo-item.pendente { background: var(--amar-claro); color: var(--amarelo); border: 1px solid #fde047; }
.resumo-item.igual    { background: var(--cinza-bg); color: var(--cinza-txt); border: 1px solid var(--cinza-brd); }
.resumo-item-label { font-weight: 700; font-size: .72rem; text-transform: uppercase; }
.resumo-item-val   { font-size: .82rem; word-break: break-word; }

/* ══════════════════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════════════════ */
@media print {
  body { background: #fff !important; }
  .relatorio-acoes, .topbar, .no-print { display: none !important; }
  .relatorio-wrap { padding: 0 !important; max-width: 100%; }
  .a4-paper { box-shadow: none !important; border-radius: 0 !important; min-height: auto; padding: 10mm 12mm; }
  @page { size: A4; margin: 0; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVIDADE EXTRA
   ══════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-content { padding: 12px; }
  .table-header { flex-direction: column; align-items: flex-start; }
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
  .rlt-grid.col3, .rlt-grid.col4 { grid-template-columns: 1fr 1fr; }
  .rlt-campo.span3, .rlt-campo.span4 { grid-column: span 2; }
  .rlt-assinatura { grid-template-columns: 1fr; }
  .a4-paper { padding: 6mm 6mm; font-size: 9pt; }
}
@media (max-width: 400px) {
  .rlt-grid.col2, .rlt-grid.col3, .rlt-grid.col4 { grid-template-columns: 1fr; }
  .rlt-campo.span2, .rlt-campo.span3, .rlt-campo.span4 { grid-column: span 1; }
  .rlt-header { flex-wrap: wrap; }
  .rlt-titulo { text-align: left; }
}

/* ── Tab nav (admin) ─────────────────────────────────────── */
.tab-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 2px solid var(--cinza-brd); padding-bottom: 0; }
.tab-nav a {
  padding: 8px 14px; font-size: .82rem; font-weight: 600; color: var(--cinza-txt);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: var(--trans); border-radius: 4px 4px 0 0;
}
.tab-nav a:hover { color: var(--azul); background: var(--azul-claro); }
.tab-nav a.active { color: var(--azul); border-bottom-color: var(--azul); background: var(--azul-claro); }

/* ── Card editable list (admin configurações) ─────────────── */
.cfg-list { list-style: none; }
.cfg-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--cinza-brd); transition: var(--trans);
}
.cfg-item:last-child { border-bottom: none; }
.cfg-item:hover { background: var(--cinza-bg); }
.cfg-item-nome { flex: 1; font-size: .88rem; font-weight: 600; }
.cfg-item-sub  { font-size: .75rem; color: var(--cinza-txt); }
.cfg-item-actions { display: flex; gap: 4px; }

/* ── Whatsapp button ─────────────────────────────────────── */
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1ebe5b; color: #fff; }
.btn-email    { background: var(--laranja); color: #fff; }
.btn-email:hover { background: #c2410c; color: #fff; }

/* ── Campo com botão embutido ──────────────────────────────── */
.input-with-btn { display: flex; gap: 6px; }
.input-with-btn input { flex: 1; }
.input-with-btn .btn-secondary { flex-shrink: 0; }

/* ── Banco confirmado highlight ─────────────────────────── */
.banco-dados-card { background: var(--cinza-bg); border: 1.5px solid var(--cinza-brd); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 12px; }
.banco-dados-card.correto { background: var(--verde-claro); border-color: #86efac; }
.banco-dados-card.incorreto { background: var(--verm-claro); border-color: #fca5a5; }

/* ── Collapse section ───────────────────────────────────── */
.collapse-header { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; }
.collapse-body { overflow: hidden; max-height: 0; transition: max-height .3s ease; }
.collapse-body.open { max-height: 2000px; }
.collapse-icon { transition: transform .25s; }
.collapse-icon.open { transform: rotate(180deg); }
