:root {
  --bg:        #0a0e1a;
  --surface:   #131929;
  --card:      #1c2333;
  --card2:     #222d42;
  --border:    #2d3748;
  --accent:    #4299e1;
  --accent-dk: #2b6cb0;
  --accent-gl: rgba(66,153,225,0.12);
  --teal:      #38b2ac;
  --success:   #48bb78;
  --danger:    #fc8181;
  --warning:   #f6ad55;
  --text:      #e2e8f0;
  --muted:     #718096;
  --muted2:    #4a5568;
  --nav-h:     64px;
  --top-h:     58px;
  --sat:       env(safe-area-inset-top, 0px);
  --sab:       env(safe-area-inset-bottom, 0px);
  --sal:       env(safe-area-inset-left, 0px);
  --sar:       env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%; height: 100dvh;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  font-size: 15px; overflow: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px; }

/* ── Login ── */
#login-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  min-height: 100vh; min-height: 100dvh;
  padding: calc(var(--sat) + 32px) 24px calc(var(--sab) + 32px);
  gap: 14px;
  background: radial-gradient(ellipse at 50% 0%, #1a2744 0%, var(--bg) 70%);
}
.login-logo-owl {
  margin-bottom: 4px;
  filter: drop-shadow(0 0 18px rgba(255,100,0,0.6));
}
.login-title { font-size: 26px; font-weight: 700; letter-spacing: -.3px; }
.login-sub   { color: var(--muted); font-size: 14px; margin-bottom: 8px; }

/* ── App shell ── */
#app { display: none; flex-direction: column; height: 100vh; height: 100dvh; }

.topbar {
  height: calc(var(--top-h) + var(--sat));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sat) 16px 0;
  flex-shrink: 0;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-brand svg { width: 26px; height: 26px; color: var(--accent); }
.topbar-title { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-user {
  font-size: 12px; color: var(--muted);
  background: var(--card); padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border);
}

/* ── Tab system ── */
.tab-content {
  display: none; flex-direction: column; flex: 1;
  overflow-y: auto;
  padding: 16px calc(var(--sar) + 16px) calc(var(--nav-h) + var(--sab) + 16px) calc(var(--sal) + 16px);
}
.tab-content.active { display: flex; }

/* ── Bottom nav ── */
.bottom-nav {
  height: calc(var(--nav-h) + var(--sab));
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; flex-shrink: 0;
  padding-bottom: var(--sab);
  padding-left: var(--sal);
  padding-right: var(--sar);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; cursor: pointer;
  color: var(--muted); font-size: 11px; font-weight: 500;
  border: none; background: none; transition: color .2s;
  position: relative;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--accent); }
.nav-item.active::after {
  content: ''; position: absolute; top: 0; left: 25%; right: 25%;
  height: 2px; background: var(--accent); border-radius: 0 0 2px 2px;
}

/* ── Home: Dashboard ── */
.welcome-section {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.welcome-text h2 { font-size: 22px; font-weight: 700; }
.welcome-text p  { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stats-pill {
  background: var(--accent-gl); border: 1px solid var(--accent);
  border-radius: 20px; padding: 6px 14px; text-align: center;
}
.stats-pill strong { display: block; font-size: 18px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stats-pill span   { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }

.action-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px 18px; cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex; flex-direction: row; align-items: center; gap: 14px;
}
.action-card:active { transform: scale(.96); }
.action-card.identify {
  background: linear-gradient(135deg, #1a2f50 0%, #0f1e36 100%);
  border-color: var(--accent-dk);
}
.action-card.identify:active { box-shadow: 0 0 0 3px rgba(66,153,225,.2); }
.action-card.search {
  background: linear-gradient(135deg, #1a2f2f 0%, #0f1e1e 100%);
  border-color: #2c5f5d;
}
.action-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.action-icon.blue   { background: var(--accent-gl); color: var(--accent); }
.action-icon.teal   { background: rgba(56,178,172,.12); color: var(--teal); }
.action-icon.purple { background: rgba(159,122,234,.15); color: #9f7aea; }
.action-icon svg    { width: 24px; height: 24px; }
.action-card.phone-card { border-color: rgba(159,122,234,.3); margin-bottom: 12px; }
.action-card.phone-card:active { box-shadow: 0 0 0 3px rgba(159,122,234,.2); }
.btn-purple {
  background: #6b46c1; color: #fff; border: none;
  padding: 10px 20px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-purple:active { background: #553c9a; }

/* ── Modal Consulta Telefone ────────────────────────────────────────────────── */
#telefone-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.7); display: flex;
  align-items: flex-end; justify-content: center;
  padding-bottom: calc(var(--sab) + var(--nav-h));
}
.tel-modal-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px 20px 0 0; padding: 20px 20px 20px;
  width: 100%; max-width: 480px;
}
.tel-tabs {
  display: flex; gap: 6px; margin-bottom: 16px;
}
.tel-tab {
  flex: 1; padding: 9px 6px; font-size: 11px; font-weight: 700;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--muted); cursor: pointer;
  letter-spacing: 0.3px; transition: background .15s, color .15s, border-color .15s;
}
.tel-tab.active {
  background: rgba(159,122,234,.15); color: #9f7aea; border-color: #9f7aea;
}
.tel-input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; color: var(--text);
  font-size: 16px; margin-bottom: 14px;
}
.tel-input:focus { outline: none; border-color: #9f7aea; }
.tel-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.tel-result-card {
  margin-top: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.tel-row {
  display: flex; padding: 10px 14px; border-bottom: 1px solid var(--border);
  gap: 10px;
}
.tel-row:last-child { border-bottom: none; }
.tel-key { font-size: 12px; color: var(--muted); width: 100px; flex-shrink: 0; padding-top: 1px; }
.tel-val { font-size: 14px; font-weight: 600; color: var(--text); }
.tel-empty { color: var(--muted); font-size: 14px; margin-top: 12px; text-align: center; }
.tel-error { color: var(--danger); font-size: 14px; margin-top: 12px; }
.tel-banco-match {
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px; padding: 12px 14px;
  background: #0d2200; border: 1px solid #16a34a;
  border-radius: 12px; cursor: pointer; transition: background .15s;
}
.tel-banco-match:active { background: #14350a; }
.tel-banco-foto {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; border: 2px solid #16a34a; flex-shrink: 0;
}
.tel-banco-info { flex: 1; min-width: 0; }
.tel-banco-label { font-size: 11px; color: #4ade80; margin-bottom: 2px; }
.tel-banco-nome  { font-size: 14px; font-weight: 700; color: #86efac; }
.tel-banco-arrow { color: #4ade80; font-size: 22px; flex-shrink: 0; }
.action-label { font-size: 15px; font-weight: 700; line-height: 1.2; }
.action-sub   { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

.action-card-wide {
  background: linear-gradient(135deg, #1a3320 0%, #0f1e14 100%);
  border: 1px solid #2d5a38; border-radius: 16px;
  padding: 16px 18px; cursor: pointer; margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
  transition: transform .15s;
}
.action-card-wide:active { transform: scale(.98); }
.action-card-wide .action-icon { background: rgba(72,187,120,.12); color: var(--success); }
.action-card-wide-text strong { display: block; font-size: 15px; font-weight: 700; }
.action-card-wide-text span   { font-size: 12px; color: var(--muted); }

.donate-card {
  background: linear-gradient(135deg, #1a2333 0%, #131c2e 100%);
  border: 1px solid #2b6cb0; border-radius: 16px;
  padding: 16px 18px; margin-bottom: 20px;
}
.donate-card-text strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.donate-card-text span   { font-size: 12px; color: var(--muted); line-height: 1.5; }
.donate-pix-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; margin-top: 12px; flex-wrap: wrap;
}
.donate-pix-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.donate-pix-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.donate-pix-key   { font-size: 15px; font-weight: 700; color: var(--text); }
.donate-pix-owner { font-size: 11px; color: var(--muted); }
.donate-copy-btn  { white-space: nowrap; }

.home-search-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 0 14px; transition: border-color .15s;
}
.home-search-wrap:focus-within { border-color: var(--accent); }
.home-search-wrap .search-icon-abs {
  flex-shrink: 0; color: var(--muted); width: 18px; height: 18px;
  position: static; transform: none;
}
.home-search-wrap input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px; padding: 13px 0;
}
.home-search-wrap input::placeholder { color: var(--muted2); }

/* ── Loading: Face Scanner ── */
.face-scanner-wrap {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; gap: 16px; padding: 40px 0;
}
.face-scanner {
  position: relative; width: 240px; height: 240px;
  border-radius: 12px; overflow: hidden;
}
.scan-preview-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.scan-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: rgba(10, 18, 30, 0.52);
}
.face-scanner-svg {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2;
}
.scan-line {
  position: absolute; left: 5%; right: 5%; height: 2px; z-index: 3;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 10px 3px rgba(66,153,225,.7);
  animation: scanMove 1.8s ease-in-out infinite;
  top: 10%;
}
@keyframes scanMove {
  0%, 100% { top: 10%; opacity: .6; }
  50%       { top: 88%; opacity: 1; }
}
.scanner-label { font-size: 15px; font-weight: 600; color: var(--accent); }
.scanner-sub   { font-size: 13px; color: var(--muted); }

/* ── Result: Match ── */
.result-photo-wrap {
  width: 100%; border-radius: 16px; overflow: hidden;
  margin-bottom: 16px; position: relative; max-height: 300px;
}
.result-photo-wrap img {
  width: 100%; height: 300px; object-fit: cover; display: block; cursor: pointer;
}
.result-photo-badge {
  position: absolute; bottom: 12px; right: 12px;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  border-radius: 20px; padding: 5px 12px; font-size: 13px; font-weight: 700;
  border: 1px solid rgba(255,255,255,.1);
}

.result-name-row { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.result-name { font-size: 22px; font-weight: 800; letter-spacing: -.3px; flex: 1; }
.match-badge {
  display: flex; align-items: center; gap: 5px; padding: 5px 12px;
  border-radius: 20px; font-size: 12px; font-weight: 700; flex-shrink: 0; margin-left: 12px;
}
.match-badge.high   { background: #1a3b20; color: var(--success); border: 1px solid #2d6a35; }
.match-badge.medium { background: #3b2d10; color: var(--warning); border: 1px solid #6a4d1a; }
.match-badge.low    { background: #3b1a1a; color: var(--danger);  border: 1px solid #6a2a2a; }

.conf-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.conf-track { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.conf-fill  { height: 100%; border-radius: 3px; transition: width .6s ease-out; }
.conf-label { font-size: 13px; font-weight: 700; min-width: 36px; text-align: right; }

.data-section { margin-bottom: 12px; }
.data-section-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px; padding-left: 2px;
}
.data-section-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.data-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 14px; border-bottom: 1px solid var(--border); gap: 8px;
}
.data-row:last-child { border-bottom: none; }
.data-key   { font-size: 13px; color: var(--muted); flex-shrink: 0; margin-right: 4px; }
.data-val   { font-size: 13px; text-align: right; word-break: break-word; flex: 1; min-width: 0; }
.copy-btn {
  flex-shrink: 0; width: 26px; height: 26px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; border: none; background: transparent; color: var(--muted);
  cursor: pointer; transition: background .15s, color .15s;
}
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn:hover  { background: var(--border); color: var(--text); }
.copy-btn.copied { color: var(--success); }

.photo-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.photo-gallery img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: pointer;
}

/* ── Search: Chips ── */
.chips-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px;
  scrollbar-width: none;
}
.chips-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border); background: var(--card);
  color: var(--muted); transition: all .15s;
}
.chip.active {
  background: var(--accent-gl); border-color: var(--accent); color: var(--accent);
}

.search-bar-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 0 14px; margin-bottom: 4px;
  transition: border-color .15s;
}
.search-bar-wrap:focus-within { border-color: var(--accent); }
.search-bar-wrap .search-icon-abs {
  flex-shrink: 0; color: var(--muted); width: 18px; height: 18px;
  position: static; transform: none;
}
.search-bar-wrap input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px; padding: 13px 0;
}
.search-bar-wrap input::placeholder { color: var(--muted2); }

.result-count { font-size: 12px; color: var(--muted); margin-bottom: 12px; padding-left: 2px; }

.result-item {
  display: flex; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.result-item:active { border-color: var(--accent); transform: scale(.98); }
.result-thumb {
  width: 54px; height: 54px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
}
.result-thumb-ph {
  width: 54px; height: 54px; border-radius: 10px; background: var(--surface);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--muted2);
}
.result-thumb-ph svg { width: 26px; height: 26px; }
.result-info-name { font-size: 15px; font-weight: 600; }
.result-info-sub  { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* ── Cadastro ── */
.cad-header { margin-bottom: 20px; }
.cad-title  { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.cad-sub    { font-size: 13px; color: var(--muted); }

.step-bar { display: flex; gap: 3px; margin-bottom: 20px; }
.step-seg {
  flex: 1; height: 3px; border-radius: 2px; background: var(--border); transition: background .3s;
}
.step-seg.done    { background: var(--success); }
.step-seg.current { background: var(--accent); }

.photo-drop {
  border: 2px dashed var(--border); border-radius: 14px;
  padding: 36px 16px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s; margin-bottom: 14px;
}
.photo-drop:hover  { border-color: var(--accent); background: var(--accent-gl); }
.photo-drop svg    { width: 44px; height: 44px; color: var(--muted); margin-bottom: 10px; }
.photo-drop p      { color: var(--muted); font-size: 14px; }
.photo-drop small  { font-size: 12px; color: var(--muted2); margin-top: 4px; display: block; }

.photo-preview-img {
  width: 100%; height: 220px; object-fit: cover;
  border-radius: 14px; margin-bottom: 14px; display: block;
}

/* ── Admin ── */
.stat-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.stat-card  {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px;
}
.stat-val   { font-size: 30px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.user-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 14px; margin-bottom: 8px;
}
.user-item-name { font-weight: 600; font-size: 15px; }
.user-item-role { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; width: 100%; }
label { font-size: 13px; color: var(--muted); font-weight: 500; }
input[type="text"], input[type="password"], input[type="search"],
input[type="date"], select, textarea {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 12px 14px;
  font-size: 15px; width: 100%; outline: none; transition: border-color .15s;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: none; min-height: 80px; }

/* ── Buttons ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; border-radius: 12px; font-size: 15px; font-weight: 600;
  border: none; cursor: pointer; transition: opacity .15s, transform .1s; width: 100%;
}
.btn:active { transform: scale(.97); opacity: .85; }
.btn-primary { background: linear-gradient(135deg, var(--accent-dk), #1a4a8a); color: #fff; }
.btn-success { background: linear-gradient(135deg, #276749, #1c4f38); color: #fff; }
.btn-danger  { background: linear-gradient(135deg, #c53030, #9b2c2c); color: #fff; }
.btn-ghost   { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-teal    { background: linear-gradient(135deg, #285e61, #1d4044); color: #fff; }
.btn-sm      { padding: 8px 14px; font-size: 13px; width: auto; border-radius: 8px; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge-blue    { background: var(--accent-gl); color: var(--accent); border: 1px solid var(--accent-dk); }
.badge-green   { background: rgba(72,187,120,.12); color: var(--success); border: 1px solid #276749; }
.badge-red     { background: rgba(252,129,129,.1); color: var(--danger);  border: 1px solid #c53030; }
.badge-yellow  { background: rgba(246,173,85,.1);  color: var(--warning); border: 1px solid #975a16; }

/* ── Section title ── */
.sec-title {
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted); margin: 20px 0 10px;
}

/* ── Misc ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.mt-8  { margin-top: 8px;  } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.text-muted { color: var(--muted); } .text-center { text-align: center; }
.text-danger { color: var(--danger); } .text-success { color: var(--success); }
.flex { display: flex; } .gap-8 { gap: 8px; } .flex-col { flex-direction: column; }

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 48px 0; color: var(--muted);
}
.empty-state svg { width: 52px; height: 52px; opacity: .3; }
.empty-state p   { font-size: 14px; }

.spinner {
  width: 34px; height: 34px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 32px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-sm {
  width: 16px; height: 16px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
.bnmp-cad-loading {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  color: var(--muted); font-size: 13px; margin-top: 12px;
}
.bnmp-cad-warn {
  background: #1c1a00; border: 1px solid #854d0e;
  border-radius: 10px; padding: 12px 14px;
  color: #fbbf24; font-size: 13px; margin-top: 12px;
}
.bnmp-auto-alert, .bnmp-auto-clear { margin-top: 12px; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + var(--sab) + 16px);
  left: 50%; transform: translateX(-50%);
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 22px; font-size: 14px; font-weight: 500;
  z-index: 1000; white-space: nowrap; box-shadow: 0 8px 32px rgba(0,0,0,.4);
  animation: toastIn .2s ease-out;
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--danger);  color: var(--danger); }
@keyframes toastIn { from { opacity:0; transform: translateX(-50%) translateY(10px); } }

/* ── FABs ── */
#fab-home, #fab-admin {
  display: none; position: fixed;
  width: 52px; height: 52px; border-radius: 50%;
  border: none; cursor: pointer;
  align-items: center; justify-content: center;
  z-index: 500; transition: transform .15s, opacity .2s, box-shadow .15s;
}
#fab-home {
  bottom: calc(var(--nav-h) + var(--sab) + 16px); right: calc(var(--sar) + 16px);
  background: var(--accent-dk);
  box-shadow: 0 4px 16px rgba(43,108,176,.5);
}
#fab-admin {
  top: calc(var(--sat) + var(--top-h) + 14px); right: calc(var(--sar) + 16px);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
}
#fab-home:active, #fab-admin:active { transform: scale(.92); }
#fab-home svg { width: 22px; height: 22px; color: #fff; }
#fab-admin svg { width: 28px; height: 28px; color: var(--accent); }
#fab-admin.active {
  background: var(--accent-dk); border-color: var(--accent);
  box-shadow: 0 8px 28px rgba(43,108,176,.45);
}
#fab-admin.active svg { color: #fff; }

/* ── Bottom sheet (câmera / galeria) ── */
.sheet-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 900;
}
.sheet-overlay.open { display: block; }

.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 12px calc(var(--sar) + 16px) calc(var(--sab) + 16px) calc(var(--sal) + 16px);
  z-index: 901; transform: translateY(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.bottom-sheet.open { transform: translateY(0); }
.sheet-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 0 auto 16px;
}
.sheet-title {
  font-size: 13px; font-weight: 600; color: var(--muted);
  text-align: center; margin-bottom: 14px;
  text-transform: uppercase; letter-spacing: .6px;
}
.sheet-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 16px 14px; border: none;
  background: var(--card); border-radius: 12px;
  color: var(--text); font-size: 16px; font-weight: 500;
  cursor: pointer; margin-bottom: 10px; transition: opacity .15s;
}
.sheet-btn:active { opacity: .7; }
.sheet-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.sheet-btn-cancel {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 14px; border: none;
  background: none; color: var(--muted); font-size: 15px;
  cursor: pointer; margin-top: 4px;
}

/* ── Lightbox ── */
#lightbox {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.9);
  z-index: 2000; align-items: center; justify-content: center;
}
#lightbox.open { display: flex; }
#lightbox img  { max-width: 96vw; max-height: 96vh; border-radius: 10px; }

/* Oraculo */
.oraculo-section { margin-top: 14px; }
.oraculo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.oraculo-head .data-section-title { margin-bottom: 8px; }
.oraculo-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; overflow: hidden;
}
.oraculo-report { max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.oraculo-row {
  display: grid; grid-template-columns: minmax(94px, 34%) 1fr; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.oraculo-row:last-child { border-bottom: none; }
.bnmp-mandado-row { border-left: 3px solid #dc2626; padding-left: 8px; margin-bottom: 4px; }
.bnmp-mandado-header {
  grid-column: 1 / -1; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; margin-bottom: 2px;
}
.btn-pdf-mandado {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 7px; border: 1px solid #dc2626;
  background: rgba(220,38,38,.1); color: #f87171;
  font-size: 11px; font-weight: 700; cursor: pointer; transition: background .15s;
  flex-shrink: 0;
}
.btn-pdf-mandado:hover  { background: rgba(220,38,38,.2); }
.btn-pdf-mandado:active { background: rgba(220,38,38,.3); }
.btn-pdf-mandado:disabled { opacity: .5; cursor: default; }
.oraculo-key { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; word-break: break-word; }
.oraculo-val { color: var(--text); font-size: 13px; line-height: 1.45; word-break: break-word; white-space: pre-wrap; }
.oraculo-line {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  color: var(--text); font-size: 13px; line-height: 1.45; word-break: break-word;
}
.oraculo-line:last-child { border-bottom: none; }
.oraculo-empty, .oraculo-cpf { color: var(--muted); font-size: 13px; line-height: 1.45; }
.oraculo-cpf { margin-top: 8px; text-align: center; }
.oraculo-action { margin-top: 12px; width: 100%; }
.oraculo-loading { padding: 12px 0; text-align: center; color: var(--muted); font-size: 13px; }
.oraculo-loading .spinner { margin: 12px auto; }
.oraculo-raw {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; color: var(--text); white-space: pre-wrap; word-break: break-word;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; max-height: 360px; overflow-y: auto;
}
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

@media (max-width: 380px) {
  .oraculo-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ── BNMP Auto-check banner (pós-reconhecimento) ───────────────────────────── */
#bnmp-auto-banner { margin-bottom: 14px; transition: opacity .6s; }
.bnmp-auto-loading {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  color: var(--muted); font-size: 13px;
}
.bnmp-auto-clear {
  display: flex; align-items: center; gap: 8px;
  background: #052e16; border: 1px solid #16a34a;
  border-radius: 10px; padding: 12px 14px;
  color: #4ade80; font-size: 14px; font-weight: 600;
}
/* ── Painel Cruzamento — Procurados no banco ───────────────────────────────── */
#bnmp-cruzamento-panel {
  background: #1a0000; border: 2px solid #dc2626;
  border-radius: 14px; overflow: hidden; margin-bottom: 14px;
}
.bnmp-cruz-header {
  display: flex; align-items: center; gap: 8px;
  background: #dc2626; color: #fff;
  padding: 10px 14px; font-size: 13px; font-weight: 700; letter-spacing: .3px;
}
.bnmp-cruz-count {
  margin-left: auto; background: rgba(0,0,0,.25);
  border-radius: 20px; padding: 2px 9px; font-size: 12px;
}
.bnmp-cruz-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid #3f0000;
  cursor: pointer; transition: background .15s;
}
.bnmp-cruz-item:last-child { border-bottom: none; }
.bnmp-cruz-item:active { background: #2a0000; }
.bnmp-cruz-foto {
  width: 54px; height: 54px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2.5px solid #dc2626;
  background: #2d1a1a;
  box-shadow: 0 0 0 1px rgba(220,38,38,.35);
}
.bnmp-cruz-foto--vep {
  border-color: #7c3aed;
  box-shadow: 0 0 0 1px rgba(124,58,237,.35);
}
.bnmp-cruz-foto--ent {
  border-color: #b45309;
  box-shadow: 0 0 0 1px rgba(180,83,9,.35);
}
.bnmp-cruz-info { flex: 1; min-width: 0; }
.bnmp-cruz-nome { font-size: 14px; font-weight: 700; color: #fca5a5; }
.bnmp-cruz-detalhe { font-size: 12px; color: #f87171; margin-top: 2px; }
.bnmp-cruz-orgao { font-size: 11px; color: #ef4444; margin-top: 2px; }
.bnmp-cruz-arrow { color: #f87171; font-size: 22px; flex-shrink: 0; }

.bnmp-auto-alert {
  background: #1a0000; border: 2px solid #dc2626;
  border-radius: 12px; overflow: hidden;
}
.bnmp-auto-alert-header {
  display: flex; align-items: center; gap: 10px;
  background: #dc2626; color: #fff;
  padding: 10px 14px; font-size: 14px; font-weight: 700;
  letter-spacing: .3px;
}
.bnmp-auto-mandados { padding: 10px 14px; }
.bnmp-compact-item {
  padding: 7px 0; border-bottom: 1px solid #3f0000;
}
.bnmp-compact-item:last-child { border-bottom: none; }
.bnmp-compact-tipo  { font-size: 13px; font-weight: 600; color: #fca5a5; }
.bnmp-compact-detalhe { font-size: 12px; color: #f87171; margin-top: 2px; }

/* ── Painel BNMP Área ──────────────────────────────────────────────────────── */
.bnmp-area-panel {
  background: var(--surface); border: 1px solid #f97316; border-radius: 14px;
  margin: 0 0 20px; overflow: hidden;
}
.bnmp-area-header {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg,#7c2d12,#c2410c);
  padding: 10px 14px; gap: 8px;
}
.bnmp-area-title {
  display: flex; align-items: center; gap: 7px;
  color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.bnmp-area-title svg { color: #fed7aa; }
.bnmp-area-mes {
  color: #fed7aa; font-size: 12px; white-space: nowrap; flex-shrink: 0;
}
.bnmp-area-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 14px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.bnmp-area-chip {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  border-radius: 999px; font-size: 11px; font-weight: 600;
  padding: 4px 10px; cursor: pointer; white-space: nowrap;
}
.bnmp-area-chip.active {
  background: #c2410c; border-color: #c2410c; color: #fff;
}
#bnmp-area-body { padding: 0; }
.bnmp-area-count {
  padding: 7px 14px 6px; font-size: 11px; font-weight: 700;
  color: #c2410c; border-bottom: 1px solid var(--border);
  letter-spacing: .5px; text-transform: uppercase;
}
.bnmp-area-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
}
.bnmp-area-item:last-child { border-bottom: none; }
.bnmp-area-data-pill {
  flex-shrink: 0; background: #fff7ed; color: #c2410c;
  border: 1px solid #fed7aa; border-radius: 6px;
  font-size: 11px; font-weight: 700; padding: 3px 7px;
  margin-top: 1px; white-space: nowrap;
}
.bnmp-area-main { flex: 1; min-width: 0; }
.bnmp-area-nome {
  font-size: 13px; font-weight: 600; color: var(--text);
  line-height: 1.3; word-break: break-word;
}
.bnmp-alcunha {
  font-weight: 400; color: var(--muted); font-size: 12px; font-style: italic;
}
.bnmp-area-orgao-short {
  font-size: 12px; color: var(--muted); margin-top: 2px;
}
.bnmp-area-item.bnmp-tj {
  background: rgba(220,38,38,.07);
  border-left: 3px solid #dc2626;
  padding-left: 11px;
}
.bnmp-tj-badge {
  display: inline-block; background: #dc2626; color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 4px;
  padding: 1px 5px; vertical-align: middle; letter-spacing: .3px;
}
.bnmp-fonte-vep {
  display: inline-block; background: #7c3aed; color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 4px;
  padding: 1px 5px; vertical-align: middle; letter-spacing: .3px;
}
.bnmp-fonte-ent {
  display: inline-block; background: #b45309; color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 4px;
  padding: 1px 5px; vertical-align: middle; letter-spacing: .3px;
}
.bnmp-area-item.bnmp-tj .bnmp-area-nome { color: #f87171; }
.bnmp-area-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 18px 14px; color: var(--muted); font-size: 13px;
}
.mini-spinner {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); border-top-color: #c2410c;
  animation: spin .7s linear infinite;
}
.bnmp-area-empty { padding: 14px; color: var(--muted); font-size: 13px; text-align: center; }

/* ── Auditoria de Fotos ── */
.aud-card {
  background: #1e293b; border-radius: 10px; padding: 14px;
  margin-bottom: 14px; border: 1px solid #334155;
}
.aud-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.aud-card-nome { color: #f1f5f9; font-weight: 600; font-size: 14px; }
.aud-card-id   { color: #64748b; font-size: 12px; }
.aud-fotos-row { display: flex; gap: 14px; align-items: flex-start; }
.aud-grupo     { display: flex; flex-direction: column; gap: 6px; }
.aud-grupo-auts { flex: 1; min-width: 0; }
.aud-label     { color: #94a3b8; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.aud-thumb     {
  width: 90px; height: 90px; object-fit: cover;
  border-radius: 8px; border: 2px solid #334155; display: block;
}
.aud-sem-foto  {
  width: 90px; height: 90px; background: #334155;
  border-radius: 8px; display: flex; align-items: center;
  justify-content: center; color: #64748b; font-size: 11px;
}
.aud-auts-scroll {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.aud-foto-wrap {
  display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.aud-del-btn {
  font-size: 11px; padding: 3px 8px; white-space: nowrap;
}
.aud-foto-data {
  font-size: 10px; color: #64748b; white-space: nowrap;
}
.aud-foto-wrap.aud-divergente .aud-thumb {
  border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220,38,38,.25);
}
.aud-foto-capturado {
  font-size: 10px; color: #94a3b8; max-width: 90px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.aud-foto-wrap.aud-divergente .aud-foto-capturado {
  color: #fca5a5; font-weight: 600;
}
.aud-foto-motivo {
  font-size: 9px; color: #fbbf24; max-width: 90px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.aud-card-badge {
  background: #7f1d1d; color: #fecaca; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; margin-left: 8px;
}
.aud-bulk-del-btn {
  font-size: 11px; padding: 4px 10px; margin-left: auto;
}
