:root {
  --blue-main: #0066ff;
  --blue-main-dark: #004fcc;
  --blue-soft: #eef2ff;

  --text-main: #111827;
  --text-muted: #6b7280;

  --card-bg: #ffffff;
  --border: rgba(2, 8, 23, 0.10);

  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.12);
  --shadow-sm: 0 8px 18px rgba(2, 8, 23, 0.08);

  --radius-card: 24px;
  --radius: 14px;

  --header-h: 56px;
}

/* Reset controlado */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* =========================================================
   ✅ NOVO: FUNDO GLOBAL (map vibe sem API) + PADRONIZAÇÃO
   ========================================================= */

/* garante camadas corretas */
.app-shell {
  position: relative;
  z-index: 1; /* acima do fundo */
}

/* fundo global */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none; /* não atrapalha cliques */
  overflow: hidden;
}

/* “map vibe” sem imagem/API: grid + linhas + pontos */
.app-bg__map {
  position: absolute;
  inset: -40px;
  opacity: 0.55;
  transform: translateZ(0);
  background:
    /* “ruas” horizontais */
    linear-gradient(to bottom, rgba(2, 8, 23, 0.05) 1px, transparent 1px) 0 0 / 100% 44px,
    /* “ruas” verticais */
    linear-gradient(to right, rgba(2, 8, 23, 0.05) 1px, transparent 1px) 0 0 / 44px 100%,
    /* “avenidas” mais fortes */
    linear-gradient(to bottom, rgba(2, 8, 23, 0.07) 1px, transparent 1px) 0 0 / 100% 140px,
    linear-gradient(to right, rgba(2, 8, 23, 0.07) 1px, transparent 1px) 0 0 / 140px 100%,
    /* pontinhos */
    radial-gradient(circle at 25% 30%, rgba(2, 8, 23, 0.06) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 55%, rgba(2, 8, 23, 0.06) 0 2px, transparent 3px),
    radial-gradient(circle at 45% 75%, rgba(2, 8, 23, 0.06) 0 2px, transparent 3px);
}

/* overlay que “tinta” o mapa e mantém sua paleta */
.app-bg__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 800px at 30% 15%, rgba(255,255,255,0.85), rgba(255,255,255,0.45) 45%, rgba(255,255,255,0.20)),
    radial-gradient(900px 650px at 75% 60%, rgba(255,255,255,0.55), rgba(255,255,255,0.10) 55%, rgba(255,255,255,0.00));
  opacity: 0.95;
}

/* modo escuro: deixa o fundo bem mais discreto */
.app-body.dark-theme .app-bg__map {
  opacity: 0.35;
  background:
    linear-gradient(to bottom, rgba(229, 231, 235, 0.06) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(to right, rgba(229, 231, 235, 0.06) 1px, transparent 1px) 0 0 / 44px 100%,
    linear-gradient(to bottom, rgba(229, 231, 235, 0.08) 1px, transparent 1px) 0 0 / 100% 140px,
    linear-gradient(to right, rgba(229, 231, 235, 0.08) 1px, transparent 1px) 0 0 / 140px 100%,
    radial-gradient(circle at 25% 30%, rgba(229, 231, 235, 0.06) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 55%, rgba(229, 231, 235, 0.06) 0 2px, transparent 3px),
    radial-gradient(circle at 45% 75%, rgba(229, 231, 235, 0.06) 0 2px, transparent 3px);
}

.app-body.dark-theme .app-bg__overlay {
  background:
    radial-gradient(1200px 800px at 30% 15%, rgba(2,6,23,0.92), rgba(2,6,23,0.65) 45%, rgba(2,6,23,0.35)),
    radial-gradient(900px 650px at 75% 60%, rgba(2,6,23,0.75), rgba(2,6,23,0.30) 55%, rgba(2,6,23,0.00));
  opacity: 1;
}

/* wrapper padrão para todas as telas (não força card, só organiza) */
.page-shell {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 22px 16px 24px;
}

.page-panel {
  width: 100%;
  max-width: 1100px; /* padrão “todas iguais” */
  margin: 0 auto;
  /* importante: transparente pra não quebrar cards existentes */
  background: transparent;
}

/* =========================================================
   BASE
   ========================================================= */

.app-body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--blue-soft);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.35;
}

/* Tema escuro */
.app-body.dark-theme {
  --blue-soft: #020617;
  --card-bg: #020817;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;

  --blue-main: #2563eb;
  --blue-main-dark: #1d4ed8;

  --border: rgba(229, 231, 235, 0.12);
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 10px 22px rgba(0, 0, 0, 0.35);
}

/* =========================================================
   ✅ CONTROLES PADRÃO (radio/checkbox/select/input)
   ========================================================= */
input[type="radio"],
input[type="checkbox"]{
  width: 16px;
  height: 16px;
  accent-color: var(--blue-main);
}

select, input[type="text"], input[type="number"], input[type="email"], input[type="password"], textarea {
  font-family: inherit;
  text-align: left;
}

select:disabled,
input:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* =========================================================
   HEADER / TOPBAR
   ========================================================= */
.appbar {
  position: sticky;
  top: 0;
  height: var(--header-h);
  background: var(--blue-main);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.30);
  z-index: 60;
}

.appbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.appbar-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.appbar-nav {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0 12px;
  font-size: 14px;
}

.appbar-nav a {
  text-decoration: none;
  color: #fff;
  opacity: 0.95;
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 999px;
  position: relative;
}

.appbar-nav a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

.appbar-nav a.active,
.appbar-nav a[aria-current="page"] {
  opacity: 1;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
  text-decoration: none;
}

.appbar-nav a.active::after,
.appbar-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -8px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
}

.icon-button {
  border: none;
  background: transparent;
  color: inherit;
  padding: 6px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 18px;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
  border-radius: 12px;
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 260px;
  height: 100vh;
  background: var(--card-bg);
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.25);
  padding: 16px 18px;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 70;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 800;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.sidebar-nav .nav-link {
  text-decoration: none;
  color: var(--text-main);
  padding: 10px 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  display: block;
  position: relative;
}

.sidebar-nav .nav-link:hover {
  background: rgba(59, 130, 246, 0.10);
  color: #1d4ed8;
}

.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link[aria-current="page"] {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
}

.sidebar-nav .nav-link.active::before,
.sidebar-nav .nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
  background: var(--blue-main);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 65;
}

body.sidebar-open .sidebar,
.app-body.sidebar-open .sidebar { transform: translateX(0); }

body.sidebar-open .sidebar-backdrop,
.app-body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: all;
}

body.sidebar-open { overflow: hidden; }

/* =========================================================
   MAIN / LAYOUT
   ========================================================= */
.app-main {
  padding-top: 16px;
  padding-bottom: 28px;
  min-height: calc(100vh - var(--header-h));
}

.page {
  width: 100%;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 24px;
}

.center-container {
  width: 100%;
  max-width: 980px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0 16px;
  margin: 0 auto;
}

/* =========================================================
   CARD
   ========================================================= */
.app-card,
.card {
  width: 100%;
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 34px 24px 24px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.home-card { max-width: 560px; }
.process-card { max-width: 560px; min-height: 520px; }

/* =========================================================
   ✅ HOME – trava imagem e impede “susto”
   ========================================================= */
.home-card { overflow: hidden; }

.home-card img {
  max-width: 220px;
  width: 100%;
  height: auto;
  display: block;
  margin: 18px auto 0;
  object-fit: contain;
  opacity: 0.90;
}

/* =========================================================
   TIPOGRAFIA / UTIL
   ========================================================= */
.section-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 10px;
}

.section-title--center { text-align: center; }
.section-title--left { text-align: left; margin-top: 6px; }

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0 20px;
}

.divider--big { margin: 24px 0; }

.file-name {
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 12px;
  color: #1f3b8f;
  word-break: break-word;
}

.app-body.dark-theme .file-name { color: #93c5fd; }

.file-footer {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-word;
}

/* =========================================================
   BOTÕES
   ========================================================= */
.btn,
a.btn,
label.btn,
button.btn,
input[type="button"].btn,
input[type="submit"].btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.1;
  user-select: none;
}

.btn-primary,
a.btn-primary,
label.btn-primary,
button.btn-primary,
input[type="button"].btn-primary,
input[type="submit"].btn-primary {
  background: var(--blue-main);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
}

.btn-primary:hover { background: var(--blue-main-dark); transform: translateY(-1px); }

.btn-secondary,
a.btn-secondary,
label.btn-secondary,
button.btn-secondary,
input[type="button"].btn-secondary,
input[type="submit"].btn-secondary {
  background: rgba(37, 99, 235, 0.10);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.app-body.dark-theme .btn-secondary {
  background: rgba(147, 197, 253, 0.10);
}

.btn-secondary:hover { filter: brightness(0.98); transform: translateY(-1px); }

/* =========================================================
   ✅ NOVO: BOTÃO DE PERIGO
   ========================================================= */
.btn-danger,
a.btn-danger,
label.btn-danger,
button.btn-danger,
input[type="button"].btn-danger,
input[type="submit"].btn-danger {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.35);
}

.btn-danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

.app-body.dark-theme .btn-danger {
  box-shadow: 0 12px 26px rgba(220, 38, 38, 0.25);
}

.big-btn { min-height: 44px; padding: 12px 18px; }
.btn-compact { padding: 8px 10px; border-radius: 12px; font-size: 13px; min-height: 36px; }

.btn-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  row-gap: 10px;
  align-items: center;
}

.btn-row--import { margin-top: 6px; }

.btn-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =========================================================
   ✅ RESPIRO PADRÃO dentro do card
   ========================================================= */
.app-card > * + * { margin-top: 10px; }
.app-card hr.divider { margin-top: 18px; margin-bottom: 18px; }

/* =========================================================
   STATUS (texto)
   ========================================================= */
.status-text {
  font-size: 13px;
  color: var(--text-muted);
  margin: 6px 0 14px;
}

.status-text--rotas { margin-top: 0; }

.status-error { color: #b91c1c; font-weight: 900; }
.status-success { color: #166534; font-weight: 900; }

/* =========================================================
   STATUS LOCAL (ENTREGAS)
   ========================================================= */
.status-local {
  text-align: left;
  background: rgba(2, 8, 23, 0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 12px;
  margin: 10px 0 10px;
}

.app-body.dark-theme .status-local { background: rgba(229, 231, 235, 0.04); }

.status-local__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.status-local__title { font-size: 13px; font-weight: 900; color: var(--text-main); }
.status-local__subtitle { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-left: 6px; }

.status-local__right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.chip {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(2, 8, 23, 0.03);
  color: var(--text-main);
  white-space: nowrap;
}

.chip--pendente { background: rgba(2, 8, 23, 0.04); }
.chip--parcial  { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.20); }
.chip--concluido { background: rgba(16, 185, 129, 0.16); border-color: rgba(16, 185, 129, 0.20); }

.status-local__hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  max-width: 54ch;
}

/* =========================================================
   ROTAS — CRITÉRIO (PILLS)
   ========================================================= */
.criterio-form { text-align: center; }

.criterio-pills {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.option-pill {
  border: 1px solid rgba(2, 8, 23, 0.16);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 900;
  background: rgba(2, 8, 23, 0.02);
  color: var(--text-main);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.10);
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.08s ease;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.app-body.dark-theme .option-pill {
  background: rgba(229, 231, 235, 0.06);
  border-color: rgba(229, 231, 235, 0.16);
}

.option-pill:hover {
  background: rgba(37, 99, 235, 0.10);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
  transform: translateY(-1px);
}

.option-pill.active {
  background: var(--blue-main);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.20);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.45);
}

.option-pill.active::before {
  content: "✓";
  font-size: 12px;
  font-weight: 900;
  margin-right: 6px;
  opacity: 0.95;
}

/* =========================================================
   ROTAS — ORIGEM
   ========================================================= */
.origem {
  text-align: left;
  margin-top: 10px;
  padding-top: 6px;
}

.origem__radios {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 8px 0 10px;
  font-size: 14px;
}

.origem__radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(2, 8, 23, 0.02);
}

.app-body.dark-theme .origem__radio { background: rgba(229, 231, 235, 0.04); }

.origem__select { margin-top: 10px; }

.label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  display: inline-block;
  margin-bottom: 6px;
}

.select {
  width: 100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-main);
  font-size: 14px;
}

.origem__coords {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
}

.field__input {
  width: 100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-main);
  font-size: 14px;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 62ch;
}

/* ação principal */
.main-action { margin-top: 14px; text-align: center; }

/* links */
.map-link { margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.map-link a { color: var(--blue-main); font-weight: 800; text-decoration: none; }
.map-link a:hover { text-decoration: underline; }
.map-link--center { text-align: center; }

/* =========================================================
   RELATÓRIOS
   ========================================================= */
.btn-column--reports { margin-top: 2px; }

.report-form { margin: 0; padding: 0; }
.report-form + .report-form { margin-top: 8px; }

/* =========================================================
   PROCESSAR (toggle-pill antigo)
   ========================================================= */
.toggle-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.toggle-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-pill span {
  border: 1px solid rgba(2, 8, 23, 0.16);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 900;
  background: rgba(2, 8, 23, 0.02);
  color: var(--text-main);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.10);
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.08s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toggle-pill:hover span {
  background: rgba(37, 99, 235, 0.10);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

.toggle-pill input[type="radio"]:checked + span {
  background: var(--blue-main);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.20);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.45);
}

/* =========================================================
   MODAL / ALERTAS (mantém)
   ========================================================= */
.alert-error {
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.86rem;
  text-align: left;
}

.alert-success {
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #ecfdf3;
  color: #166534;
  font-size: 0.86rem;
  text-align: left;
}

.alert-small-path {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(2, 8, 23, 0.70);
  word-break: break-all;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 18px;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  background: var(--card-bg);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.modal-card h2 {
  font-size: 20px;
  font-weight: 900;
  margin-top: 6px;
}

.modal-icon-success {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #dcfce7;
  color: #166534;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
}

.modal-message {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.35;
}

.modal-subtitle {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.modal-path {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(2, 8, 23, 0.05);
  font-size: 12px;
  text-align: left;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.35;
}

/* =========================================================
   INPUT FILE oculto
   ========================================================= */
.hidden-file { display: none; }

/* =========================================================
   RESPONSIVO
   ========================================================= */
@media (max-width: 768px) {
  .center-container { padding: 0 10px; }
  .app-card, .card { margin: 0 8px; padding: 30px 16px 18px; }

  .appbar { padding: 0 12px; }
  .appbar-nav { display: none; }
  .appbar-left { min-width: 0; }
  .appbar-title { font-size: 16px; font-weight: 900; }

  .process-card { min-height: auto; }

  .status-local__hint { max-width: 100%; }

  /* ✅ novo wrapper: respira melhor no mobile */
  .page-shell { padding: 18px 12px 18px; }
}

@media (max-width: 600px) {
  .page { padding: 22px 12px 18px; }

  .criterio-pills { gap: 8px; }
  .option-pill { padding: 10px 12px; min-height: 42px; }

  .origem__coords { grid-template-columns: 1fr; }
}

/* F4#03 — espaçamento vertical entre botões grandes (mantém) */
.app-card .btn-full + .btn-full { margin-top: 14px; }
@media (max-width: 600px) {
  .app-card .btn-full + .btn-full { margin-top: 16px; }
}

/* =========================================================
   HOME — AÇÃO PRINCIPAL
   ========================================================= */
.home-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin-top: 22px;
  flex-wrap: wrap;
}

.home-actions .btn {
  min-width: 190px;
  min-height: 48px;
  font-size: 14px;
  font-weight: 900;
}

.home-actions .btn-primary {
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
}

.home-actions .btn-secondary {
  background: rgba(37, 99, 235, 0.12);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.home-actions .btn-secondary:hover {
  background: rgba(37, 99, 235, 0.18);
}

@media (max-width: 600px) {
  .home-actions {
    flex-direction: column;
    gap: 12px;
  }

  .home-actions .btn {
    width: 100%;
    max-width: 320px;
  }
}

/* =========================================================
   GESTOR — Correção Manual (layout sem inline)
   ========================================================= */
.gestor-card {
  max-width: 980px;
  width: 100%;
}

.gestor-help {
  margin: 10px 0 18px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
}

.gestor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gestor-col { text-align: left; }

.gestor-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.gestor-actions--left { justify-content: flex-start; }

.gestor-h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 900;
  color: var(--text-main);
}

.gestor-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gestor-two-cols--mt { margin-top: 10px; }

.gestor-textarea {
  min-height: 88px;
  resize: vertical;
}

.gestor-panel {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
  min-height: 120px;
}

.gestor-panels { margin-top: 12px; }

.gestor-panel--log {
  min-height: 320px;
  height: 320px;
  overflow: auto;
  background: #0b1220;
  color: #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.35;
}

.gestor-muted { font-size: 13px; color: var(--text-muted); }

.gestor-footnote { color: var(--text-muted); font-size: 13px; text-align: left; }

/* Responsivo */
@media (max-width: 900px) {
  .gestor-grid { grid-template-columns: 1fr; }
  .gestor-two-cols { grid-template-columns: 1fr; }
}

/* =========================================================
   ✅ GESTOR — UI gerada pelo JS (badges/painéis)
   ========================================================= */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  word-break: break-word;
}

.inline-error {
  color: #dc2626;
  font-weight: 900;
}

.panel-stack > * + * { margin-top: 10px; }

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-row--wrap { flex-wrap: wrap; }

.panel-row-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-title {
  font-weight: 900;
  color: var(--text-main);
}

.panel-body {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-main);
}

.panel-spacer { margin-top: 8px; }

.panel-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
}

.panel-card--dashed {
  border-style: dashed;
  border-color: rgba(2, 8, 23, 0.25);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.badge--ok { background: #16a34a; }
.badge--warn { background: #f59e0b; }
.badge--err { background: #dc2626; }
.badge--muted { background: #6b7280; }

/* tabela chave/valor do saneamento */
.kv-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
}

.kv-table {
  width: 100%;
  border-collapse: collapse;
}

.kv-td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(2, 8, 23, 0.08);
  font-size: 13px;
  text-align: left;
}

.kv-td--k { width: 42%; }
