/* ============================================================================
   BNMP · Banco Nacional de Mandados de Prisão
   Tema escuro elegante (azul sóbrio) + wallpaper no login + motion graphics.
   ========================================================================== */

/* ── Tema ESCURO (padrão) — paleta sóbria, pouco "neon" ───────────────────── */
:root, :root[data-theme="dark"] {
  --bg: #0c0f16;
  --surface: #161b24;
  --surface-2: #11151d;
  --surface-3: #1f2530;
  --ink: #e9ebf0;
  --ink-2: #9aa1af;
  --ink-3: #636b79;
  --border: #232a35;
  --border-strong: #323a47;

  --accent: #4f7df2;
  --accent-hover: #3f6ee8;
  --accent-ink: #ffffff;
  --accent-grad: linear-gradient(180deg, #5786f4, #3f6ee8);
  --accent-soft: #1a2440;
  --accent-soft-ink: #93b2fb;

  --success: #3fbf93;
  --success-soft: #13271f;
  --success-ink: #6cd6ad;
  --warn: #d8a441;
  --warn-soft: #2a2413;
  --warn-ink: #ecc46f;
  --danger: #e76b7c;
  --danger-soft: #2a1820;
  --danger-ink: #f29aa6;
  --gold: #9d8cf3;
  --gold-soft: #1d1b33;
  --gold-ink: #bdb1f6;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 10px 28px -16px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 28px 70px -28px rgba(0, 0, 0, 0.75);
  --glow: 0 8px 20px -10px rgba(79, 125, 242, 0.45);

  --page-bg: radial-gradient(1100px 620px at 82% -320px, rgba(79, 125, 242, 0.06), transparent 60%);

  --font-serif: "Tiempos Text", Georgia, "Times New Roman", serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
}

/* ── Tema CLARO ───────────────────────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --surface-3: #e4e9f2;
  --ink: #161b25;
  --ink-2: #5b6478;
  --ink-3: #8b94a5;
  --border: #e6eaf1;
  --border-strong: #d2d9e6;

  --accent: #3f6ee8;
  --accent-hover: #2f5ad6;
  --accent-ink: #ffffff;
  --accent-grad: linear-gradient(180deg, #4f7df2, #3f6ee8);
  --accent-soft: #e7eefe;
  --accent-soft-ink: #2f5ad6;

  --success: #128a6a;
  --success-soft: #d7f1ea;
  --success-ink: #0d7457;
  --warn: #b07d1e;
  --warn-soft: #f6ecd4;
  --warn-ink: #8a6116;
  --danger: #d65167;
  --danger-soft: #fbe2e7;
  --danger-ink: #b23a4f;
  --gold: #7a5cf0;
  --gold-soft: #ece7fd;
  --gold-ink: #5a3fd0;

  --shadow-sm: 0 1px 2px rgba(20, 35, 70, 0.05);
  --shadow: 0 10px 28px -16px rgba(20, 35, 70, 0.16);
  --shadow-lg: 0 24px 60px -24px rgba(20, 35, 70, 0.22);
  --glow: 0 8px 18px -10px rgba(63, 110, 232, 0.3);

  --page-bg: radial-gradient(1000px 560px at 84% -300px, rgba(63, 110, 232, 0.07), transparent 60%);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--page-bg), var(--bg);
  background-attachment: fixed;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}
/* wallpaper de fundo no app (tema escuro), com overlay pra legibilidade */
:root[data-theme="dark"] body {
  background:
    linear-gradient(180deg, rgba(9, 12, 19, 0.82), rgba(9, 12, 19, 0.9)),
    url("/img/wallpaper.webp") center top / cover fixed,
    var(--bg);
}
/* aurora animada (motion graphics bem visível) atrás de todo o conteúdo */
.app::before, .app::after {
  content: ""; position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0; opacity: .65;
}
.app::before { width: 540px; height: 540px; top: -150px; left: 14%;
  background: radial-gradient(circle, rgba(79, 125, 242, 0.6), transparent 70%); animation: aurora1 16s ease-in-out infinite; }
.app::after { width: 500px; height: 500px; bottom: -170px; right: 5%;
  background: radial-gradient(circle, rgba(63, 191, 147, 0.42), transparent 70%); animation: aurora2 21s ease-in-out infinite; }
@keyframes aurora1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(150px, 100px) scale(1.18); } }
@keyframes aurora2 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-120px, -90px) scale(1.14); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.sidebar, .main { position: relative; z-index: 1; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
a { color: var(--accent-soft-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
svg { width: 18px; height: 18px; flex-shrink: 0; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 4px; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }

/* ── Motion graphics (sutil) ──────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes kenburns { from { transform: scale(1.06); } to { transform: scale(1.16) translate(-1.5%, -1%); } }
@keyframes drift { 0% { transform: translate(0, 0); } 50% { transform: translate(3%, 2%); } 100% { transform: translate(0, 0); } }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; } 50% { opacity: .6; box-shadow: 0 0 0 4px transparent; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } }

/* ── Botões ─────────────────────────────────────────────────────────────── */
.btn {
  appearance: none; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--ink); padding: 9px 15px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 550; cursor: pointer; transition: transform .12s ease, background .14s, border-color .14s, box-shadow .14s;
  display: inline-flex; align-items: center; gap: 8px; line-height: 1;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent-grad); border-color: transparent; color: var(--accent-ink); box-shadow: var(--glow); }
.btn-primary:hover { filter: brightness(1.06); border-color: transparent; box-shadow: 0 10px 24px -8px rgba(79, 125, 242, 0.55); }
.btn-danger { color: var(--danger-ink); border-color: var(--danger-soft); background: var(--surface); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }

/* ── Inputs ─────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink);
  font-size: 14px; font-family: inherit; transition: border-color .14s, box-shadow .14s;
}
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--ink-3); }
.select option { color: var(--ink); background: var(--surface); }
/* seta custom do select (em vez da feia do navegador) */
.select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa1af' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 36px;
}
:root[data-theme="light"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6478' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
/* ícone do calendário visível no tema escuro */
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.78); opacity: .85; cursor: pointer; }
:root[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator { filter: none; }
.hint { font-size: 12.5px; color: var(--ink-3); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.segmented button { border: none; background: transparent; padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .12s; }
.segmented button.on { background: var(--accent-grad); color: #fff; }

/* ── filtros (busca de pessoas) ───────────────────────────────────────────── */
.filter-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-top .input { flex: 0 1 170px; min-width: 120px; width: auto; }
.filter-top .grow { flex: 2 1 280px; }
.filter-top .btn { flex: 0 0 auto; }
.filter-adv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.filter-adv > * { min-width: 0; }          /* impede o overflow dos dropdowns */
.filter-adv .check { align-self: end; padding-bottom: 9px; }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--border);
}
.badge.owner { background: var(--gold-soft); color: var(--gold-ink); border-color: transparent; }
.badge.admin { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: transparent; }
.badge.parceiro { background: var(--surface-3); color: var(--ink-2); }
.badge.aberto { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.badge.voltado { background: var(--success-soft); color: var(--success-ink); border-color: transparent; }
.badge.off { background: var(--danger-soft); color: var(--danger-ink); border-color: transparent; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.voltado.dot::before { animation: pulse 2.6s ease-in-out infinite; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); animation: fadeUp .32s ease both; }
.card-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head h3 { font-size: 16px; }
.card-body { padding: 14px; }

/* ============================================================================
   LOGIN — wallpaper + card glass
   ========================================================================== */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; background: #070a10; }
.login-wrap::before { content: ""; position: absolute; inset: -5%; z-index: 0;
  background: url("/img/wallpaper.webp") center/cover no-repeat;
  animation: kenburns 30s ease-in-out infinite alternate; }
.login-wrap::after { content: ""; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(130% 110% at 28% 45%, rgba(7, 10, 16, 0.92), rgba(7, 10, 16, 0.55) 55%, rgba(7, 10, 16, 0.78)); }
.login-card { position: relative; z-index: 2; width: 100%; max-width: 406px;
  background: rgba(19, 23, 31, 0.66); backdrop-filter: blur(20px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.09); border-radius: var(--radius-lg);
  box-shadow: 0 34px 90px -34px rgba(0, 0, 0, 0.85); padding: 34px 30px; animation: popIn .55s cubic-bezier(.2, .8, .2, 1) both; }
.login-card .brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-card .brand img { width: 64px; height: 64px; filter: drop-shadow(0 10px 22px rgba(79, 125, 242, 0.45)); animation: floaty 5s ease-in-out infinite; }
.login-card .brand .wm { text-align: center; }
.login-card .brand .wm b { font-family: var(--font-serif); font-weight: 700; font-size: 22px; color: #f3f5fa; letter-spacing: .02em; }
.login-card .brand .wm small { display: block; font-family: var(--font-sans); font-size: 11px; font-weight: 500; color: #aab2c2; margin-top: 3px; }
.login-card h1 { font-size: 23px; margin-bottom: 3px; text-align: center; color: #f3f5fa; }
.login-card .sub { color: #aab2c2; font-size: 13.5px; margin-bottom: 24px; text-align: center; }
.login-card .field label { color: #c2c9d6; }
.login-card .input { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); color: #f3f5fa; }
.login-card .input::placeholder { color: #7f8799; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; padding: 12px; }
.login-error { background: rgba(231, 107, 124, 0.16); color: #f6b0b9; border: 1px solid rgba(231, 107, 124, 0.3); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; }
.login-foot { margin-top: 20px; text-align: center; font-size: 12px; color: #7f8799; }
.theme-fab { position: fixed; top: 18px; right: 18px; z-index: 10; }

/* ============================================================================
   APP SHELL
   ========================================================================== */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--surface-2), var(--bg)); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 14px; gap: 4px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.sidebar .brand .logo { width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0; }
.sidebar .brand .logo img { width: 36px; height: 36px; object-fit: contain; }
.sidebar .brand .t { font-family: var(--font-serif); font-weight: 600; font-size: 15px; line-height: 1.1; }
.sidebar .brand .t small { display: block; font-family: var(--font-sans); font-size: 10.5px; color: var(--ink-3); font-weight: 500; line-height: 1.25; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 14px; font-weight: 550; cursor: pointer; transition: all .14s; }
.nav a:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--ink); }
.nav a svg { width: 18px; height: 18px; opacity: .75; }
.nav a.active svg { color: var(--accent); opacity: 1; }
.sidebar .sb-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
.userchip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-grad); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; flex-shrink: 0; }
.userchip .nm { font-size: 13.5px; font-weight: 600; line-height: 1.15; }
.userchip .rl { font-size: 11.5px; color: var(--ink-3); }
.sb-actions { display: flex; gap: 6px; margin-top: 4px; }
.sb-actions .btn { flex: 1; justify-content: center; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 30px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.topbar h2 { font-size: 21px; }
.topbar .crumb { font-size: 13px; color: var(--ink-3); }
.content { padding: 26px 30px 60px; max-width: 1180px; width: 100%; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat .k { font-size: 12.5px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat .v { font-family: var(--font-serif); font-size: 30px; font-weight: 600; margin-top: 6px; line-height: 1; }
.stat .v small { font-size: 15px; color: var(--ink-3); font-family: var(--font-sans); }
.stat.accent .v { color: var(--accent); }

.meter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pips { display: inline-flex; gap: 5px; }
.pip { width: 13px; height: 13px; border-radius: 4px; background: var(--surface-3); border: 1px solid var(--border-strong); }
.pip.used { background: var(--accent); border-color: var(--accent); }
.pip.free { background: var(--success); border-color: var(--success); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); animation: fadeUp .32s ease both; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td .actions { display: flex; gap: 6px; justify-content: flex-end; }
td.right, th.right { text-align: right; }

.person { display: flex; align-items: flex-start; gap: 16px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(180deg, var(--surface), var(--surface-2)); box-shadow: var(--shadow); margin-bottom: 18px; animation: fadeUp .32s ease both; }
.person .pa { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-soft-ink); display: grid; place-items: center; font-family: var(--font-serif); font-weight: 700; font-size: 20px; flex-shrink: 0; }
.person .pn { font-family: var(--font-serif); font-size: 19px; font-weight: 600; }
.person .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.person .meta b { color: var(--ink); font-weight: 600; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 880px) {
  .two-col { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar .sb-foot { margin: 0 0 0 auto; border: none; padding: 0; }
  .sb-actions { margin-top: 0; }
}

.item { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface-2); }
.item:last-child { margin-bottom: 0; }
.item .t { font-weight: 600; font-size: 14px; }
.item .s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.item .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.item .actions .btn { padding: 5px 9px; font-size: 12px; gap: 5px; }
.item .actions .btn svg { width: 13px; height: 13px; }

/* linhas do card "Contramandados desta pessoa" (busca por CPF) */
.cm-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cm-row:last-of-type { border-bottom: none; }
.cm-info { min-width: 0; }
.cm-info .t { font-weight: 600; font-size: 14px; }
.cm-info .s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; word-break: break-word; }
.cm-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.empty svg { width: 34px; height: 34px; margin-bottom: 10px; opacity: .6; }
.empty .big { font-family: var(--font-serif); font-size: 17px; color: var(--ink-2); margin-bottom: 4px; }

.overlay { position: fixed; inset: 0; background: rgba(4, 6, 12, 0.66); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .12s ease; }
.modal { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: popIn .18s ease; }
.modal-head { padding: 20px 22px 0; }
.modal-head h3 { font-size: 19px; }
.modal-head p { color: var(--ink-2); font-size: 13.5px; margin: 6px 0 0; }
.modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }
.modal-error { background: var(--danger-soft); color: var(--danger-ink); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast { background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink); padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 14px; max-width: 360px; display: flex; align-items: flex-start; gap: 10px; animation: slidein .16s ease; }
.toast.ok { border-color: var(--success); }
.toast.ok svg { color: var(--success); }
.toast.err { border-color: var(--danger); }
.toast.err svg { color: var(--danger); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .6s linear infinite; }
.center-load { display: grid; place-items: center; padding: 50px; color: var(--ink-3); }

.section-title { font-size: 13px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin: 26px 0 12px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }

/* ── RENAJUD: ícone do veículo no cabeçalho do resultado ───────────────────── */
.person .pa svg { width: 26px; height: 26px; }

/* ============================================================================
   COMPROVANTE de exclusão (RENAJUD) — clone fiel do modal oficial (Bootstrap 5.3)
   ESCOPO BLINDADO: o seletor da moldura é `.modal.cmp-modal` (0,2,0) e as células
   levam prefixo `.cmp-body` (0,2,4), então VENCEM os globais do tema escuro
   (`.modal`, `thead th`, `tbody tr:last-child td`...) por ESPECIFICIDADE — nunca
   por ordem de carga. Valores batendo com o Bootstrap 5.3. "Imprimir" é só visual.
   ========================================================================== */
.modal.cmp-modal {
  width: 96vw; max-width: 500px; padding: 0; overflow: hidden; animation: none;
  background: #fff; color: #212529;
  border: 1px solid rgba(0, 0, 0, .175); border-radius: .5rem;
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; font-weight: 400; line-height: 1.5;
}
@media (min-width: 992px) { .modal.cmp-modal { max-width: 800px; } }   /* modal-xl */
@media (min-width: 1200px) { .modal.cmp-modal { max-width: 1140px; } }
.cmp-header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid #dee2e6; }
.cmp-title { margin: 0; font-family: inherit; font-size: 20px; font-weight: 500; line-height: 1.5; letter-spacing: normal; color: #212529; }
.cmp-close {
  box-sizing: content-box; width: 16px; height: 16px; padding: 8px; margin: -8px -8px -8px auto; border: 0; border-radius: .375rem; opacity: .5; cursor: pointer; font-size: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3E%3C/svg%3E") center / 16px auto no-repeat;
}
.cmp-close:hover { opacity: .75; }
/* Sem scroll enquanto couber: o corpo cresce com o conteúdo (igual à página
   normal). Só rola quando realmente passa da altura da tela (muitas restrições),
   descontando cabeçalho + rodapé + respiro do overlay. */
.cmp-body { padding: 16px; max-height: calc(100vh - 160px); overflow-y: auto; }
.cmp-alert { margin: 0 0 16px; padding: 16px; text-align: center; color: #41464b; background: #e2e3e5; border: 1px solid #d3d6d8; border-radius: .375rem; }
.cmp-alert h5 { margin: 0 0 8px; font-family: inherit; font-size: 20px; font-weight: 500; line-height: 1.2; letter-spacing: normal; color: inherit; }
.cmp-card { margin: 0 0 16px; background: #fff; border: 1px solid #212529; border-radius: .375rem; }
.cmp-card-h { padding: 8px 16px; font-weight: 700; font-size: 16px; color: #212529; background: rgba(33, 37, 41, .03); border-bottom: 1px solid rgba(0, 0, 0, .175); border-radius: calc(.375rem - 1px) calc(.375rem - 1px) 0 0; }
.cmp-card-b { padding: 16px; }
.cmp-card-b dl { margin: 0 0 24px; }
.cmp-card-b dt { margin: 0; font-weight: 700; font-size: 16px; color: #212529; }
.cmp-card-b dd { margin: 0; font-weight: 400; font-size: 16px; color: #212529; }
.cmp-table { width: 100%; margin: 0 0 16px; border-collapse: collapse; background: #fff; color: #212529; font-size: 16px; }
.cmp-body .cmp-table > thead > tr > th,
.cmp-body .cmp-table > tbody > tr > td {
  padding: 8px; text-align: left; vertical-align: middle; white-space: normal;
  color: #212529; background: #fff; border: 0; border-bottom: 1px solid #dee2e6;
  font-size: 16px; font-weight: 400; text-transform: none; letter-spacing: normal;
}
.cmp-body .cmp-table > thead > tr > th { font-weight: 700; }
.cmp-body .cmp-table > tbody > tr:hover > td { background: rgba(0, 0, 0, .075); }
.cmp-check { width: 42px; }
.cmp-ok { color: #10c000; font-size: 20px; font-weight: 700; }
.cmp-x { color: #dc3545; font-size: 20px; font-weight: 700; }
.cmp-footer { display: flex; align-items: center; justify-content: flex-end; padding: 12px; border-top: 1px solid #dee2e6; }
.cmp-footer > * { margin: 4px; }
.cmp-imprimir { padding: 6px 12px; font-family: inherit; font-size: 16px; font-weight: 400; line-height: 1.5; color: #fff; background: #6c757d; border: 1px solid #6c757d; border-radius: .375rem; cursor: pointer; }
.cmp-imprimir:hover { color: #fff; background: #5c636a; border-color: #565e64; }

/* resultado simples da inclusão de restrição (não é o comprovante oficial) */
.rj-ok { display: flex; align-items: flex-start; gap: 14px; }
.rj-ok-ic { width: 42px; height: 42px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; flex-shrink: 0; }
.rj-ok-ic.err { background: var(--danger-soft); color: var(--danger); }
.rj-ok-ic svg { width: 22px; height: 22px; }

/* ============================================================================
   COMPROVANTE DE RETIRADA DE MANDADO (BNMP) — réplica do documento CNJ.
   Mesma blindagem do cmp-modal: `.modal.cr-modal` vence o tema escuro por
   ESPECIFICIDADE — o documento é sempre branco, mesmo no tema escuro.
   ========================================================================== */
.modal.cr-modal {
  width: 96vw; max-width: 640px; max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 0; background: #fff; color: #1c2733;
  border: 1px solid rgba(0, 0, 0, .175); border-radius: .5rem;
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
.cr-doc { padding: 40px 48px 30px; background: #fff; }
.cr-logo { display: block; width: 108px; height: auto; margin: 0 auto 24px; }
.cr-title { text-align: center; font-size: 19px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #16233b; }
.cr-sub { text-align: center; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #9aa4b1; margin-top: 6px; }
.cr-emitido { width: fit-content; margin: 16px auto 0; padding: 5px 14px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #5c6f8a; background: #eef3f8; border-radius: 4px; }
.cr-rows { margin-top: 24px; border-top: 1px solid #e6e9ee; }
.cr-row { display: flex; gap: 24px; padding: 12px 2px; border-bottom: 1px solid #e6e9ee; }
.cr-label { flex: 0 0 34%; font-weight: 600; font-size: 13.5px; color: #33404f; }
.cr-value { flex: 1; font-size: 13.5px; color: #6b7686; overflow-wrap: anywhere; }
.cr-sign { display: block; width: 190px; height: auto; margin: 32px auto 0; }
.cr-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid #e6e9ee; background: #fff; }

/* imprime só o documento, sem o app atrás e sem a URL/data do navegador
   (@page margin 0 = sem margem de página → não sobra espaço p/ cabeçalho) */
@page { margin: 0; }
@media print {
  body { background: #fff !important; }
  body > *:not(#modal-root) { display: none !important; }
  #modal-root .overlay { position: static; display: block; padding: 0; background: none; backdrop-filter: none; animation: none; }
  .modal.cr-modal { width: auto; max-width: none; max-height: none; overflow: visible; border: none; border-radius: 0; box-shadow: none; animation: none; }
  .cr-doc { padding: 64px 72px; }
  .cr-foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
