/* Visual redesign layer - 2026-09-23 */
:root {
  --font-ui: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --type-xs: 12px;
  --type-sm: 14px;
  --type-base: 16px;
  --type-section: 18px;
  --type-mobile-title: 20px;
  --type-module: 22px;
  --type-page: 26px;
  --radius-panel: 12px;
  --radius-control: 10px;
  --radius-secondary: 8px;
  --radius-pill: 999px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 24px;
  --space-6: 28px;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #dde4ea;
  --text: #111827;
  --ink: #111827;
  --muted: #64748b;
  --dark: #0f172a;
  --dark-2: #172033;
  --navy: #0f172a;
  --green: #047857;
  --green-hot: #10b981;
  --amber: #c88a05;
  --rose: #be123c;
  --sky: #0369a1;
  --primary: #0f766e;
  --primary-soft: #e9f7f3;
  --success: #059669;
  --success-soft: #dcfce7;
  --warning: #c88a05;
  --warning-soft: #fff7d6;
  --danger: #be123c;
  --danger-soft: #ffe4e6;
  --info: #0369a1;
  --info-soft: #e0f2fe;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 1px 0 rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.06);
}

body {
  background:
    radial-gradient(circle at 28% -10%, rgba(15, 118, 110, 0.08), transparent 30%),
    linear-gradient(180deg, #f8fafc 0, var(--bg) 300px, #eef2f5 100%);
  color: var(--text);
}

.app {
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  border-right: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(23, 32, 51, 0.98)),
    var(--dark);
  box-shadow: 12px 0 34px rgba(15, 23, 42, 0.16);
}

.brand {
  padding: 18px 16px;
}

.brand-copy {
  min-width: 0;
}

.brand-copy .muted {
  max-width: 180px;
  margin: 4px 0 0;
  line-height: 1.25;
}

.logout-chip {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
}

.logout-form {
  margin: 0;
}

.logout-link {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.nav-logout-form {
  display: contents;
}

.nav-logout-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.logout-chip:hover {
  background: rgba(16, 185, 129, 0.22);
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0;
}

.brand .muted {
  font-size: 12px;
}

.nav {
  gap: 6px;
  padding: 14px 12px;
}

.nav a {
  position: relative;
  min-height: 42px;
  border: 1px solid transparent;
  padding: 10px 12px;
  color: #d3dce8;
  font-size: 13px;
}

.nav a::before {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #a7f3d0;
  font-size: 13px;
  font-weight: 900;
  content: "•";
}

.nav a[href*="partido"]::before { content: "▦"; }
.nav a[href*="presidente"]::before { content: "◎"; }
.nav a[href*="equipe"]::before { content: "◫"; }
.nav a[href*="entregas"]::before { content: "◆"; }
.nav a[href*="lider"]::before { content: "L"; }
.nav a[href*="apoiadores"]::before { content: "A"; }
.nav a[href*="atendimentos"]::before { content: "+"; }
.nav a[href*="apoiador"]::before { content: "◇"; }
.nav a[href*="tarefas"]::before { content: "✓"; }
.nav a[href*="campo"]::before { content: "⌖"; }
.nav a[href*="movimentacao"]::before { content: "↗"; }
.nav a[href="/logout"]::before { content: "←"; }

.nav a.active,
.nav a:hover {
  border-color: rgba(16, 185, 129, 0.26);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--green-hot);
}

.nav a.active::before,
.nav a:hover::before {
  background: var(--green-hot);
  color: #06291f;
}

.nav a[href="/logout"] {
  display: none;
}

.mobile-nav-shell > summary {
  display: none;
}

.topbar {
  z-index: 15;
  gap: 16px;
  border-bottom: 1px solid rgba(221, 228, 234, 0.9);
  background: rgba(245, 246, 248, 0.92);
  padding: 12px 28px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.topbar .eyebrow {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
}

.topbar h1 {
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.12;
}

.top-actions {
  gap: 10px;
}

.top-actions .button {
  min-height: 38px;
  border-color: #d8e0e7;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.content {
  width: 100%;
  max-width: 1360px;
  padding: var(--space-5) var(--space-6) 44px;
}

h1 {
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  line-height: 1.18;
}

h3 {
  font-size: 17px;
}

.module-title {
  margin-bottom: 16px;
  border: 0;
  border-radius: var(--radius-control);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 118, 110, 0.92)),
    var(--dark);
  padding: 18px 20px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
  font-size: 22px;
}

.module-title::before {
  color: #99f6e4;
  font-size: 10px;
}

.panel,
.item,
.row,
.hero {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.panel {
  margin-bottom: var(--space-4);
  padding: var(--space-4);
}

.panel::before {
  display: none;
}

.panel-head {
  gap: 14px;
  margin: -6px -6px 18px;
  border: 1px solid #edf1f5;
  border-bottom-color: #dfe6ed;
  border-radius: var(--radius-control);
  background:
    linear-gradient(135deg, var(--panel-soft), #ffffff);
  padding: 16px;
}

.panel-head .eyebrow::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--primary);
  content: "";
}

.hero {
  border-color: #d9e8e4;
  background:
    linear-gradient(135deg, #ffffff 0, #f3faf7 100%);
  padding: 20px;
}

.item {
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.row {
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.grid {
  gap: var(--space-3);
}

.pill {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
}

.pill.ok,
.pill.ativo,
.pill.quente {
  background: var(--success-soft);
  color: #047857;
}

.pill.morno {
  background: var(--warning-soft);
  color: #9a6700;
}

.pill.frio {
  background: var(--info-soft);
  color: var(--info);
}

.pill.rejeitada,
.pill.bloqueado,
.pill.cancelada {
  background: var(--danger-soft);
  color: var(--danger);
}

.button,
button {
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
}

.button {
  border-color: #d7e0e7;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.leader-form,
.field-form,
.login-form,
.stack-form,
.toolbar-form {
  gap: 18px;
}

.leader-form label,
.field-form label,
.login-form label,
.stack-form label,
.toolbar-form label,
.public-form-grid label {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.leader-form input,
.leader-form select,
.leader-form textarea,
.field-form input,
.field-form select,
.field-form textarea,
.login-form input,
.login-form select,
.login-form textarea,
.stack-form input,
.stack-form select,
.stack-form textarea,
.toolbar-form input,
.toolbar-form select,
.public-form-grid input,
.public-form-grid select,
.public-form-grid textarea,
.copy-link {
  min-height: 44px;
  border-color: #d7e0e7;
  border-radius: 10px;
  background: #f9fbfc;
}

.leader-form input:focus,
.leader-form select:focus,
.leader-form textarea:focus,
.field-form input:focus,
.field-form select:focus,
.field-form textarea:focus,
.login-form input:focus,
.login-form select:focus,
.login-form textarea:focus,
.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus,
.toolbar-form input:focus,
.toolbar-form select:focus,
.public-form-grid input:focus,
.public-form-grid select:focus,
.public-form-grid textarea:focus,
.copy-link:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.leader-form button,
.field-form button,
.login-form button,
.profile-photo-submit,
.tracker-actions button,
.task-qr-actions button,
.form-submit-bar button {
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
  font-weight: 900;
}

.leader-form button::before,
.field-form button::before,
.login-form button::before {
  content: "✓";
}

.leader-metrics {
  gap: 12px;
}

.leader-metrics span,
.tracker-card,
.supporter-kpis article,
.route-summary span {
  border-color: #dfe7ed;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.leader-metrics strong,
.tracker-card strong,
.supporter-kpis strong,
.route-summary strong {
  color: var(--ink);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: 0;
}

.leader-metrics small,
.supporter-kpis span,
.route-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.notice {
  border-color: #bbf7d0;
  border-radius: 10px;
  background: #f0fdf4;
  color: #047857;
}

.login-error {
  border-radius: 10px;
}

.supporter-command {
  border-left: 0;
  border-radius: 12px;
  background:
    linear-gradient(135deg, #ffffff, #f3faf7);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.supporter-tabs {
  top: 70px;
  border-color: #dfe7ed;
  border-radius: 12px;
}

.supporter-tabs a {
  border: 1px solid #e4ebf1;
}

.supporter-tabs a:hover {
  border-color: #a7f3d0;
  background: var(--primary-soft);
  color: var(--primary);
}

.page-apoiadores .supporter-list-panel .leader-metrics span,
.page-apoiadores .supporter-section .leader-metrics span:last-child {
  flex: 0 1 auto;
  min-width: max-content;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.page-apoiadores .supporter-list-panel .leader-metrics strong,
.page-apoiadores .supporter-section .leader-metrics span:last-child strong {
  font-size: var(--type-sm);
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  font-variant-numeric: tabular-nums;
}

.page-apoiadores .heat-cell.verde { background: var(--success-soft); }
.page-apoiadores .heat-cell.amarelo { background: var(--warning-soft); }
.page-apoiadores .heat-cell.vermelho { background: var(--danger-soft); }

@media (max-width: 1000px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 25;
    height: auto;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--bg);
  }

  .brand {
    padding: 10px 12px;
  }

  .nav {
    padding: 8px 10px 10px;
  }

  .nav a {
    min-height: 40px;
    padding: 8px 10px;
  }

  .nav a::before {
    width: 26px;
    height: 26px;
  }

  .nav a[href="/logout"] {
    margin-top: 0;
    border-top: 0;
    padding-top: 8px;
  }

  .topbar {
    padding: 12px;
  }

  .topbar h1 {
    font-size: var(--type-mobile-title);
  }

  .content {
    padding: 12px;
  }

  .module-title {
    padding: 15px;
    font-size: var(--type-mobile-title);
  }

  .panel,
  .hero {
    padding: 15px;
    border-radius: 12px;
  }

  .panel-head {
    margin: -3px -3px 14px;
    padding: 13px;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .leader-metrics strong,
  .tracker-card strong,
  .supporter-kpis strong,
  .route-summary strong {
    font-size: 22px;
  }
}

:focus-visible {
  outline: 3px solid var(--primary) !important;
  outline-offset: 2px;
}

.sidebar :focus-visible,
.mobile-nav-shell .nav :focus-visible {
  outline-color: #fff !important;
}

@media (prefers-reduced-motion: reduce) {
  .button,
  button {
    transition: none;
  }

  .button:hover,
  button:hover {
    transform: none;
  }
}

.page-apoiadores .supporter-tabs {
  background: var(--panel);
  isolation: isolate;
}

/* Mobile navigation polish */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-copy {
  min-width: 0;
}

.brand-copy .muted {
  max-width: 220px;
  margin: 4px 0 0;
  line-height: 1.25;
}

.logout-chip {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.nav a[href="/logout"] {
  display: none;
}

@media (max-width: 640px) {
  .brand {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
  }

  .app-mark {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .brand strong {
    display: block;
    font-size: 15px;
    line-height: 1.1;
  }

  .brand-copy .muted {
    max-width: none;
    font-size: 11px;
    line-height: 1.2;
  }

  .logout-chip {
    min-height: 36px;
    padding: 0 12px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 9px 12px 12px;
    scroll-padding-inline: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .nav a {
    min-height: 42px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
}

/* Final mobile app layer - keep this at EOF so iOS/Capacitor wins over legacy rules. */
@media (max-width: 760px) {
  html,
  body,
  .app,
  .content,
  .main,
  .panel,
  .hero,
  .module-title,
  .president-workspace,
  .president-roster,
  .president-map-card,
  .president-map-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .content {
    padding: 10px 8px 24px;
  }

  .topbar {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: max(12px, env(safe-area-inset-top)) 10px 10px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-actions .button {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .president-hero,
  .president-kpis {
    display: none;
  }

  .president-nav {
    position: static;
    margin: 0 0 10px;
    border-radius: 10px;
    padding: 6px;
  }

  .president-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .president-roster,
  .president-map-card {
    border-radius: 12px;
  }

  .president-roster-head,
  .president-map-head {
    gap: 8px;
    padding: 12px;
  }

  .president-roster-head h2,
  .president-map-head h2 {
    font-size: 18px;
    line-height: 1.12;
  }

  .president-state-filter,
  .president-select {
    padding: 10px 12px;
  }

  .president-state-filter select,
  .president-select select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .president-rep-list {
    grid-template-columns: 1fr;
    max-height: 54vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 8px 10px;
  }

  .president-rep-list a {
    grid-template-areas:
      "avatar dot info"
      "status dot info";
    grid-template-columns: 44px 10px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 5px;
    width: 100%;
    min-width: 0;
    padding: 10px;
  }

  .president-rep-list .avatar-small {
    grid-area: avatar;
    align-self: center;
    justify-self: center;
  }

  .president-rep-list .office-dot {
    grid-area: dot;
    width: 9px;
    height: 58px;
    align-self: center;
  }

  .president-rep-list a > span {
    grid-area: info;
    min-width: 0;
    align-self: center;
  }

  .president-rep-list strong,
  .president-rep-list small {
    max-width: 100%;
    white-space: normal;
  }

  .president-rep-list strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 13px;
  }

  .president-rep-list small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 10px;
    line-height: 1.25;
  }

  .president-rep-list em {
    grid-area: status;
    align-self: start;
    justify-self: center;
    padding: 4px 7px;
  }

  .president-selected-card {
    grid-template-columns: 44px 10px minmax(0, 1fr);
    gap: 10px;
    margin: 10px;
    padding: 12px;
  }

  .president-selected-card .office-dot {
    width: 9px;
    height: 62px;
  }

  .president-selected-card strong,
  .president-selected-card small,
  .president-selected-card .muted {
    overflow-wrap: anywhere;
  }

  .president-back-link {
    margin: 0 10px 10px;
  }

  .president-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .president-metrics article {
    min-width: 0;
    padding: 10px;
  }

  .president-metrics strong {
    overflow-wrap: anywhere;
    font-size: 18px;
  }

  .president-map-panel {
    margin: 0 10px 10px;
  }

  .president-map {
    height: 360px;
    min-height: 320px;
  }

  .president-legend,
  .president-readout {
    margin-right: 10px;
    margin-left: 10px;
    padding-right: 10px;
    padding-left: 10px;
  }
}

/* Painéis suspensos do mandato: o HTML permanece aberto quando o JavaScript não existe. */
html.has-suspended-panel-js .page-role-politico details.suspended-panel[data-suspended-panel="true"]:not([data-suspended-panel-booted="true"]) > :not(summary),
html.has-suspended-panel-js .page-role-deputado details.suspended-panel[data-suspended-panel="true"]:not([data-suspended-panel-booted="true"]) > :not(summary) {
  display: none;
}

.page-role-politico details.suspended-panel,
.page-role-deputado details.suspended-panel {
  padding: 0;
}

.page-role-politico details.suspended-panel > summary.panel-head,
.page-role-deputado details.suspended-panel > summary.panel-head {
  position: relative;
  min-height: 44px;
  margin: 0;
  padding-right: 54px;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
}

.page-role-politico details.suspended-panel > summary.panel-head::-webkit-details-marker,
.page-role-deputado details.suspended-panel > summary.panel-head::-webkit-details-marker {
  display: none;
}

.page-role-politico details.suspended-panel > summary.panel-head::after,
.page-role-deputado details.suspended-panel > summary.panel-head::after {
  position: absolute;
  top: 50%;
  right: 20px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--primary-dark);
  border-bottom: 2px solid var(--primary-dark);
  content: "";
  transform: translateY(-70%) rotate(45deg);
  transition: transform 160ms ease;
}

.page-role-politico details.suspended-panel[open] > summary.panel-head,
.page-role-deputado details.suspended-panel[open] > summary.panel-head {
  margin-bottom: 16px;
}

.page-role-politico details.suspended-panel[open] > summary.panel-head::after,
.page-role-deputado details.suspended-panel[open] > summary.panel-head::after {
  transform: translateY(-30%) rotate(-135deg);
}

.page-role-politico details.suspended-panel > :not(summary),
.page-role-deputado details.suspended-panel > :not(summary) {
  margin-right: 14px;
  margin-left: 14px;
}

.page-role-politico details.suspended-panel > :last-child,
.page-role-deputado details.suspended-panel > :last-child {
  margin-bottom: 14px;
}

.page-role-politico details.suspended-panel > summary.panel-head:focus-visible,
.page-role-deputado details.suspended-panel > summary.panel-head:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 55%, white);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .page-role-politico details.suspended-panel > summary.panel-head::after,
  .page-role-deputado details.suspended-panel > summary.panel-head::after {
    transition: none;
  }
}

@media (max-width: 760px) {
  .page-role-politico details.suspended-panel > summary.panel-head,
  .page-role-deputado details.suspended-panel > summary.panel-head {
    padding-right: 50px;
  }

  .page-role-politico details.suspended-panel > summary.panel-head::after,
  .page-role-deputado details.suspended-panel > summary.panel-head::after {
    right: 18px;
  }
}

/* Native app login: no browser-like overscroll, centered first screen. */
html.is-native-app,
body.is-native-app.page-login {
  overscroll-behavior: none;
}

body.is-native-app.page-login {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.12), transparent 32%),
    linear-gradient(135deg, #f8fafc, #e8f4ef);
}

body.is-native-app.page-login .login-screen {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
}

body.is-native-app.page-login .login-card {
  width: min(100%, 390px);
  max-height: calc(100dvh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: hidden;
  border-radius: 10px;
  padding: clamp(18px, 4.5vh, 28px);
}

body.is-native-app.page-login .login-logo {
  width: min(100%, 292px);
  max-height: 150px;
}

body.is-native-app.page-login .login-brand {
  gap: clamp(8px, 2vh, 14px);
  margin-bottom: clamp(10px, 2.2vh, 18px);
}

body.is-native-app.page-login .login-brand h1 {
  font-size: clamp(22px, 6vw, 26px);
}

body.is-native-app.page-login .login-card > .muted {
  margin-bottom: clamp(10px, 2vh, 16px);
}

body.is-native-app.page-login .login-form {
  gap: clamp(8px, 1.5vh, 12px);
  margin-top: clamp(10px, 2vh, 18px);
}

body.is-native-app.page-login .login-form input,
body.is-native-app.page-login .login-form button {
  min-height: 44px;
}

@media (max-height: 720px) {
  body.is-native-app.page-login .login-card {
    padding: 16px 18px;
  }

  body.is-native-app.page-login .login-logo {
    max-height: 118px;
  }

  body.is-native-app.page-login .login-brand {
    margin-bottom: 8px;
  }

  body.is-native-app.page-login .login-card > .muted {
    margin-bottom: 8px;
  }
}

/* iOS/phone fit layer: keep executive pages inside the viewport. */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app,
  .content,
  .main,
  .panel,
  .hero,
  .module-title,
  .president-workspace,
  .president-roster,
  .president-map-card,
  .president-map-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .content {
    padding: 10px 8px 24px;
  }

  .topbar {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: max(12px, env(safe-area-inset-top)) 10px 10px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-actions .button {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .module-title {
    margin-bottom: 10px;
    border-radius: 10px;
    padding: 14px 12px;
    font-size: 18px;
  }

  .president-hero,
  .president-kpis {
    display: none;
  }

  .president-nav {
    position: static;
    margin: 0 0 10px;
    border-radius: 10px;
    padding: 6px;
  }

  .president-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .president-roster,
  .president-map-card {
    border-radius: 12px;
    overflow: hidden;
  }

  .president-roster-head,
  .president-map-head {
    gap: 8px;
    padding: 12px;
  }

  .president-roster-head h2,
  .president-map-head h2 {
    font-size: 18px;
    line-height: 1.12;
  }

  .president-state-filter,
  .president-select {
    padding: 10px 12px;
  }

  .president-state-filter label,
  .president-select label {
    min-width: 0;
  }

  .president-state-filter select,
  .president-select select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .president-rep-list {
    grid-template-columns: 1fr;
    max-height: 54vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 8px 10px;
  }

  .president-rep-list a {
    grid-template-areas:
      "avatar dot info"
      "status dot info";
    grid-template-columns: 44px 10px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 5px;
    width: 100%;
    min-width: 0;
    padding: 10px;
  }

  .president-rep-list .avatar-small {
    grid-area: avatar;
    align-self: center;
    justify-self: center;
  }

  .president-rep-list .office-dot {
    grid-area: dot;
    width: 9px;
    height: 58px;
    align-self: center;
  }

  .president-rep-list a > span {
    grid-area: info;
    min-width: 0;
    align-self: center;
  }

  .president-rep-list strong,
  .president-rep-list small {
    max-width: 100%;
    white-space: normal;
  }

  .president-rep-list strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 13px;
  }

  .president-rep-list small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 10px;
    line-height: 1.25;
  }

  .president-rep-list em {
    grid-area: status;
    align-self: start;
    justify-self: center;
    padding: 4px 7px;
  }

  .president-selected-card {
    grid-template-columns: 44px 10px minmax(0, 1fr);
    gap: 10px;
    margin: 10px;
    padding: 12px;
  }

  .president-selected-card .office-dot {
    width: 9px;
    height: 62px;
  }

  .president-selected-card strong,
  .president-selected-card small,
  .president-selected-card .muted {
    overflow-wrap: anywhere;
  }

  .president-back-link {
    margin: 0 10px 10px;
  }

  .president-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .president-metrics article {
    min-width: 0;
    padding: 10px;
  }

  .president-metrics strong {
    overflow-wrap: anywhere;
    font-size: 18px;
  }

  .president-map-panel {
    margin: 0 10px 10px;
  }

  .president-map {
    height: 360px;
    min-height: 320px;
  }

  .president-legend,
  .president-readout {
    margin-right: 10px;
    margin-left: 10px;
    padding-right: 10px;
    padding-left: 10px;
  }
}

/* Presidente: camada final para o painel executivo prevalecer sobre regras antigas. */
.president-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 118, 110, 0.92));
  padding: 24px;
  color: #ffffff;
}

.president-hero h2,
.president-hero .eyebrow,
.president-hero .muted {
  color: #ffffff;
}

.president-score {
  min-width: 190px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  padding: 18px;
}

.president-score strong {
  display: block;
  color: #ffffff;
  font-size: 42px;
}

.president-nav {
  position: sticky;
  top: 75px;
  z-index: 9;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
  border: 1px solid #dfe7ed;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px;
}

.president-nav a {
  flex: 0 0 auto;
  border-radius: 999px;
  color: #334155;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
}

.president-kpis,
.president-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.president-kpis {
  margin-bottom: 18px;
}

.president-kpi,
.president-metrics article,
.president-roster,
.president-map-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.president-kpi,
.president-metrics article {
  padding: 16px;
}

.president-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.president-roster {
  position: sticky;
  top: 136px;
  overflow: hidden;
}

.president-rep-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
  padding: 0 12px 14px;
}

.president-rep-list a {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #e5edf2;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
  color: var(--ink);
  text-decoration: none;
}

.office-dot {
  width: 9px;
  height: 34px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.filter-clear-link {
  justify-self: start;
  color: var(--primary);
  font-size: 11px;
  font-weight: 950;
  text-decoration: none;
}

.president-rep-list a.active,
.president-rep-list a:hover {
  border-color: rgba(15, 118, 110, 0.35);
  background: var(--primary-soft);
}

.president-map {
  height: min(62vh, 660px);
  min-height: 460px;
}

.president-map-panel {
  margin: 0 16px 12px;
  border-radius: 14px;
}

@media (max-width: 1100px) {
  .president-workspace {
    grid-template-columns: 1fr;
  }

  .president-roster {
    position: static;
  }

  .president-rep-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }
}

@media (max-width: 760px) {
  .president-hero,
  .president-kpis,
  .president-metrics,
  .president-rep-list {
    grid-template-columns: 1fr;
  }

  .president-map {
    height: 420px;
    min-height: 360px;
  }
}

.president-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 118, 110, 0.92)),
    var(--dark);
  padding: 24px;
  color: #ffffff;
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.18);
}

.president-hero .eyebrow,
.president-hero .muted {
  color: rgba(255, 255, 255, 0.78);
}

.president-hero h2 {
  max-width: 760px;
  margin-bottom: 8px;
  color: #ffffff;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.05;
}

.president-score {
  min-width: 190px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  padding: 18px;
  text-align: right;
}

.president-score strong {
  display: block;
  color: #ffffff;
  font-size: 42px;
  line-height: 1;
}

.president-score span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.president-nav {
  position: sticky;
  top: 75px;
  z-index: 9;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
  border: 1px solid #dfe7ed;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  padding: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.president-nav a {
  flex: 0 0 auto;
  border-radius: 999px;
  color: #334155;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
}

.president-nav a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.president-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.president-kpi {
  border: 1px solid #dfe7ed;
  border-radius: 14px;
  background: #ffffff;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.president-kpi span,
.president-kpi small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.president-kpi strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
}

.president-kpi.is-hot {
  border-color: rgba(34, 197, 94, 0.3);
  background: linear-gradient(180deg, #ffffff, #f0fdf4);
}

.president-kpi.is-warm {
  border-color: rgba(245, 158, 11, 0.32);
  background: linear-gradient(180deg, #ffffff, #fffbeb);
}

.president-kpi.is-cold {
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(180deg, #ffffff, #eff6ff);
}

.president-create {
  margin-bottom: 18px;
}

.president-create > summary {
  cursor: pointer;
}

.president-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.president-roster,
.president-map-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.president-roster {
  position: sticky;
  top: 136px;
  overflow: hidden;
}

.president-roster-head,
.president-map-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #e5edf2;
  background: linear-gradient(135deg, #f8fafc, #ffffff);
  padding: 16px;
}

.president-roster-head h2,
.president-map-head h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.president-select,
.president-state-filter {
  padding: 14px 16px;
}

.president-state-filter {
  padding-bottom: 0;
}

.president-select label,
.president-state-filter label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 12px;
  font-weight: 950;
}

.president-select select,
.president-state-filter select {
  min-height: 44px;
  border: 1px solid #d7e0e7;
  border-radius: 10px;
  background: #f9fbfc;
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.president-rep-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
  padding: 0 12px 14px;
}

.president-rep-list a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #e5edf2;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
  color: var(--ink);
  text-decoration: none;
}

.president-rep-list a:hover,
.president-rep-list a.active {
  border-color: rgba(15, 118, 110, 0.35);
  background: var(--primary-soft);
}

.president-rep-list strong,
.president-rep-list small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.president-rep-list strong {
  font-size: 13px;
}

.president-rep-list small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.president-rep-list em {
  border-radius: 999px;
  padding: 4px 7px;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.president-rep-list em.quente {
  background: var(--success-soft);
  color: #047857;
}

.president-rep-list em.morno {
  background: var(--warning-soft);
  color: #9a6700;
}

.president-rep-list em.frio {
  background: var(--info-soft);
  color: var(--info);
}

.president-selected-card {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 14px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  padding: 14px;
}

.president-selected-card strong,
.president-selected-card small {
  display: block;
  min-width: 0;
}

.president-selected-card strong {
  color: var(--ink);
  font-size: 15px;
}

.president-selected-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.president-selected-card .muted {
  margin: 8px 0 0;
  font-size: 12px;
}

.president-back-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin: 0 14px 14px;
  border: 1px solid #99f6e4;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
  text-decoration: none;
}

.president-back-link::before {
  margin-right: 8px;
  content: "←";
}

.president-map-card {
  overflow: hidden;
}

.president-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
}

.president-metrics article {
  border: 1px solid #e5edf2;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
}

.president-metrics strong,
.president-metrics span {
  display: block;
}

.president-metrics strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.president-metrics span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.president-map-panel {
  margin: 0 16px 12px;
  border-radius: 14px;
}

.president-map {
  height: min(62vh, 660px);
  min-height: 460px;
}

.president-map-marker {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.2);
}

.president-map-marker.square {
  border-radius: 5px;
}

.president-map-marker.diamond {
  border-radius: 4px;
  transform: rotate(45deg);
}

.president-meetings-panel {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
}

.president-meetings-head {
  margin-bottom: 12px;
}

.president-meeting-filter,
.president-meeting-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.president-meeting-filter {
  margin-bottom: 14px;
}

.president-meeting-filter a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.president-meeting-filter a:hover,
.president-meeting-filter a:focus-visible,
.president-meeting-filter a.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.president-meeting-map {
  min-height: 380px;
}

.president-meeting-legend {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.meeting-confirmed-dot {
  background: var(--primary);
}

.meeting-optional-dot {
  border: 2px dashed var(--warning);
  background: var(--warning-soft);
}

.president-meeting-empty {
  margin: 0;
  padding: 8px 0;
  color: var(--muted);
}

.president-legend {
  padding: 0 16px 12px;
}

.president-readout {
  margin: 0 16px 16px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
  padding: 13px 14px;
}

.president-readout strong {
  display: block;
  margin-bottom: 4px;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.president-readout p {
  margin: 0;
  color: #334155;
}

@media (max-width: 1100px) {
  .president-workspace {
    grid-template-columns: 1fr;
  }

  .president-roster {
    position: static;
  }

  .president-rep-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }
}

@media (max-width: 760px) {
  .president-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .president-score {
    min-width: 0;
    text-align: left;
  }

  .president-nav {
    top: 64px;
    border-radius: 14px;
  }

  .president-kpis,
  .president-metrics,
  .president-rep-list {
    grid-template-columns: 1fr;
  }

  .president-map {
    height: 420px;
    min-height: 360px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #dfe7e2 0, var(--bg) 360px, #e6ece8 100%);
  color: var(--text);
  font-family: var(--font-ui);
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, var(--dark), var(--dark-2));
  color: #fff;
  box-shadow: 8px 0 32px rgba(16, 24, 40, 0.14);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-copy {
  min-width: 0;
}

.brand-copy .muted {
  max-width: 180px;
  margin: 4px 0 0;
  line-height: 1.25;
}

.logout-chip {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.logout-chip:hover {
  background: rgba(16, 185, 129, 0.22);
}

.app-mark {
  display: block;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.logo {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-hot);
  color: #fff;
  font-weight: 800;
}

.logo-image {
  display: block;
  width: 92px;
  height: 52px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.sidebar .logo-image {
  width: 52px;
  height: 34px;
  flex: 0 0 auto;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.sidebar .muted {
  color: #cbd5e1;
}

.nav {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.nav a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 8px 12px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 700;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(233, 238, 235, 0.94);
  padding: 14px 28px;
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
}

.content {
  max-width: 1320px;
  padding: 22px 28px 40px;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 4vw, 34px);
}

.module-title {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(90deg, #101828, #182338);
  color: #fff;
  box-shadow: inset 4px 0 0 #10b981, 0 10px 24px rgba(16, 24, 40, 0.14);
}

.module-title::before {
  content: "MODULO";
  display: block;
  margin-bottom: 4px;
  color: #86efac;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.panel,
.item,
.row,
.hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.05);
}

.hero {
  margin-bottom: 18px;
  padding: 18px;
  background: linear-gradient(135deg, #fff 0, #f3f8f6 54%, #e8f3ee 100%);
}

.panel {
  margin-bottom: 18px;
  padding: 18px;
  overflow: hidden;
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--green), #0ea5e9, var(--amber));
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
  margin: -4px -4px 16px;
  padding: 14px;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 6px;
  background: var(--panel-soft);
}

.grid {
  display: grid;
  gap: 16px;
}

.two {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
}

.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.item {
  padding: 15px;
  box-shadow: inset 0 3px 0 #cbd5e1, 0 1px 0 rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.05);
}

.empty-state {
  display: grid;
  gap: 10px;
  border-style: dashed;
  background: #f8fafc;
  box-shadow: none;
}

.empty-state .button {
  width: fit-content;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  box-shadow: inset 3px 0 0 #d1d5db, 0 1px 0 rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.05);
}

.pill {
  display: inline-flex;
  border-radius: 5px;
  background: #eef2f7;
  padding: 4px 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.pill.quente {
  background: #ffe4e6;
  color: #be123c;
}

.pill.morno {
  background: #fff3c4;
  color: #a16207;
}

.pill.frio {
  background: #dff1ff;
  color: #0369a1;
}

.pill.ok {
  background: #dff5e8;
  color: #047857;
}

.bar {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #e2e8f0;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.avatar {
  display: inline-grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--sky));
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  object-fit: cover;
}

img.avatar {
  object-fit: cover;
}

.avatar-small {
  width: 28px;
  height: 28px;
  border-width: 1px;
  font-size: 10px;
  box-shadow: none;
}

.avatar-large {
  width: 82px;
  height: 82px;
  font-size: 24px;
}

.person-heading,
.profile-chip {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.person-heading h2,
.person-heading h3,
.person-heading strong {
  margin: 0;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.quick-actions .button {
  min-height: 42px;
}

.quick-actions .secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.supporter-command {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 253, 245, 0.82)),
    #fff;
  padding: 16px;
  box-shadow: var(--shadow);
}

.supporter-command h2 {
  margin: 4px 0 8px;
  font-size: 24px;
  line-height: 1.15;
}

.supporter-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.supporter-action-row .button {
  min-height: 44px;
}

.supporter-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-content: stretch;
}

.supporter-kpis article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px;
}

.supporter-kpis strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.supporter-kpis span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.supporter-tabs {
  position: sticky;
  top: 80px;
  z-index: 14;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 12px 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  scrollbar-width: none;
}

.supporter-tabs::-webkit-scrollbar {
  display: none;
}

.supporter-tabs a {
  flex: 0 0 auto;
  min-height: 36px;
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.supporter-share-panel {
  border-left-color: var(--green);
}

.supporter-share-actions {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.supporter-share-actions label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.supporter-filter-panel .panel-head,
.supporter-list-panel .panel-head,
.supporter-section .panel-head {
  margin-bottom: 16px;
}

.profile-menu {
  position: relative;
}

.profile-menu summary {
  cursor: pointer;
  list-style: none;
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-menu-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.profile-photo-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.profile-file-picker {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-file-picker span {
  color: var(--ink);
}

.profile-file-picker input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  font: inherit;
}

.profile-photo-remove-form {
  margin-top: 8px;
}

.profile-photo-submit,
.profile-photo-form button,
.profile-photo-remove-form button {
  display: inline-flex;
  min-height: 44px;
  width: 100%;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  padding: 12px;
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.profile-photo-remove-form button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.disclosure-panel {
  padding: 0;
}

.disclosure-panel > summary {
  cursor: pointer;
  list-style: none;
  margin: 0;
}

.disclosure-panel > summary::-webkit-details-marker {
  display: none;
}

.disclosure-panel > summary::after {
  content: "Abrir";
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.disclosure-panel[open] > summary::after {
  content: "Fechar";
}

.disclosure-panel > :not(summary) {
  margin-right: 14px;
  margin-left: 14px;
}

.disclosure-panel > :last-child {
  margin-bottom: 14px;
}

.children-list {
  display: grid;
  gap: 10px;
}

.child-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(130px, 0.8fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.hero-person {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.alert {
  margin-bottom: 18px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fff7df;
  padding: 12px 14px;
  color: #7c2d12;
  font-size: 14px;
  font-weight: 600;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(16, 24, 40, 0.05), rgba(16, 185, 129, 0.1)),
    var(--bg);
}

.login-card {
  width: min(100%, 460px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 30px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.16);
}

.login-brand {
  display: grid;
  gap: 14px;
  justify-items: center;
  margin-bottom: 18px;
  text-align: center;
}

.login-brand .logo-image {
  width: min(100%, 240px);
  height: auto;
  flex: 0 0 auto;
}

.login-logo {
  display: block;
  width: min(100%, 340px);
  height: auto;
  margin: 0 auto 4px;
  object-fit: contain;
}

.login-brand h1 {
  margin: 2px 0 0;
  font-size: 26px;
}

.login-card > .muted {
  text-align: center;
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.login-form label {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.login-form input,
.login-form select,
.login-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  outline: none;
}

.login-form input:focus,
.login-form select:focus,
.login-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.login-form button {
  min-height: 44px;
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.login-form button:hover {
  background: var(--green);
}

.login-error {
  margin-top: 14px;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  background: #fff1f2;
  padding: 10px 12px;
  color: #be123c;
  font-size: 14px;
  font-weight: 700;
}

.privacy-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.privacy-link:hover {
  color: var(--green);
}

.privacy-screen {
  place-items: start center;
}

.privacy-card {
  width: min(100%, 760px);
}

.privacy-card h2 {
  margin: 18px 0 8px;
  font-size: 18px;
}

.privacy-card p {
  color: #334155;
  line-height: 1.6;
}

.privacy-updated {
  margin-top: 20px;
  color: var(--muted) !important;
  font-size: 13px;
  font-weight: 800;
}

.notice {
  margin-bottom: 18px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  padding: 12px 14px;
  color: #166534;
  font-size: 14px;
  font-weight: 700;
}

.leader-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.leader-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.leader-form input,
.leader-form select,
.leader-form textarea,
.stack-form input,
.stack-form select,
.stack-form textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 11px;
  color: var(--text);
  font: inherit;
  outline: none;
}

.leader-form input:focus,
.leader-form select:focus,
.leader-form textarea:focus,
.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.leader-form button,
.stack-form button {
  align-self: end;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.leader-form button:hover,
.stack-form button:hover {
  background: var(--green);
}

.stack-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.leader-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 0.8fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: inset 3px 0 0 #10b981, 0 8px 22px rgba(15, 23, 42, 0.05);
}

.leader-row.compact-row {
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 0.9fr);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.inline-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inline-form select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 800;
}

.inline-form button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.leader-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.leader-metrics.metrics-six {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.leader-metrics.metrics-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.leader-metrics span {
  display: grid;
  gap: 2px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.leader-metrics small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.leader-actions {
  display: grid;
  gap: 8px;
  min-width: 120px;
}

.leader-actions form {
  margin: 0;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe5e1;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.leader-actions button {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.leader-actions button:hover {
  border-color: var(--green);
  color: var(--green);
}

.detail-grid {
  margin-top: 16px;
}

.event-card {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 0.8fr) minmax(180px, 0.5fr);
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: inset 3px 0 0 var(--cyan), 0 8px 22px rgba(15, 23, 42, 0.05);
}

.qr-box {
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.qr-box img {
  width: 140px;
  height: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.qr-box form {
  margin: 0;
}

.qr-box button {
  min-height: 40px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  cursor: pointer;
  padding: 10px 12px;
  font: inherit;
  font-weight: 800;
}

.invite-share {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 12px;
}

.invite-qr {
  display: grid;
  place-items: center;
  width: 180px;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.invite-qr img {
  width: 160px !important;
  height: 160px !important;
  display: block;
}

.whatsapp-send-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  width: 100%;
}

.whatsapp-send-form label {
  margin: 0;
}

.whatsapp-send-form input {
  min-height: 42px;
}

.whatsapp-send-form.has-error input {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.gps-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.qr-scanner {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.scanner-preview {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
}

.scanner-preview video,
.scanner-preview canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-preview canvas {
  display: none;
}

.scanner-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.field-form {
  display: grid;
  gap: 16px;
}

.field-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.field-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.field-form input,
.field-form select,
.field-form textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 11px;
  color: var(--text);
  font: inherit;
  outline: none;
}

.field-form textarea {
  resize: vertical;
}

.field-form input:focus,
.field-form select:focus,
.field-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.field-form button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.field-form button:hover {
  filter: brightness(1.05);
}

.field-form .inline-field-action,
.leader-form .inline-field-action {
  min-height: 36px;
  width: max-content;
  border: 1px solid #b8d8d2;
  background: #eefaf7;
  color: #0f766e;
  padding: 7px 11px;
  font-size: 12px;
}

.delivery-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.delivery-form .wide-field {
  grid-column: 1 / -1;
}

.delivery-form .delivery-map-box {
  display: grid;
  gap: 12px;
  margin-top: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
}

.delivery-form .compact-head {
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

.delivery-form .delivery-map {
  height: 340px;
  min-height: 300px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
}

.delivery-form > button[type="submit"] {
  grid-column: 1 / span 2;
  width: min(100%, 260px);
}

.delivery-status-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.delivery-status-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.delivery-status-form select {
  min-height: 40px;
  width: 100%;
  border: 1px solid #d7e0e7;
  border-radius: 10px;
  background: #f9fbfc;
  padding: 8px 10px;
  color: var(--text);
  font: inherit;
  outline: none;
}

.delivery-status-form select:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.delivery-status-form button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
}

.fixed-task-window {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(120px, 180px));
  gap: 12px;
  align-items: end;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  padding: 14px;
}

.fixed-task-window[hidden] {
  display: none;
}

.fixed-task-window [data-fixed-task-end][hidden] {
  display: none;
}

.fixed-task-window strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
}

.inline-action-form {
  margin: -4px 0 12px;
}

.inline-action-form button {
  min-height: 34px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #991b1b;
  padding: 7px 10px;
  font-weight: 900;
  cursor: pointer;
}

.wide {
  grid-column: span 2;
}

.tracker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tracker-card {
  border: 1px solid #dbe5e0;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff, #f3f8f6);
  padding: 16px;
}

.tracker-card strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.tracker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tracker-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  cursor: pointer;
  padding: 10px 14px;
  font: inherit;
  font-weight: 800;
}

.tracker-actions button:nth-child(2) {
  background: var(--amber);
}

.tracker-actions button:nth-child(3) {
  background: var(--green);
}

.tracker-actions button:disabled {
  cursor: not-allowed;
  background: #94a3b8;
}

.map-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.grid + .map-panel {
  margin-top: 16px;
}

.toolbar-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar-form label {
  max-width: 520px;
}

.president-map {
  height: 560px;
}

.map-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 12px 14px;
}

.map-head h3 {
  margin-bottom: 0;
}

.field-map {
  position: relative;
  height: 380px;
  min-height: 320px;
  width: 100%;
  background: #e2e8f0;
}

.movement-map {
  height: 520px;
}

.map-feedback {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: var(--type-sm);
}

.supporter-map-marker span {
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px var(--ink);
}

.supporter-map-delivery span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--panel);
  background: var(--warning);
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--ink);
}

.movement-list-details > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  margin-bottom: 0;
}

.movement-list-details > summary::-webkit-details-marker {
  display: none;
}

.movement-list-details > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}

.movement-list-details[open] > summary {
  margin-bottom: 14px;
}

.movement-list-details[open] > summary::after {
  transform: rotate(225deg);
}

.movement-list-row[hidden],
.supporter-list-row[hidden],
.movement-list-more[hidden] {
  display: none;
}

.supporter-list-details > summary.panel-head {
  align-items: center;
  min-height: 44px;
  margin-bottom: 0;
}

.supporter-list-details[open] > summary.panel-head {
  margin-bottom: 16px;
}

.supporter-list-row {
  min-width: 0;
}

.movement-list-row .leader-metrics {
  grid-template-columns: minmax(110px, 1fr);
}

.movement-list-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 8px 0 0;
  color: var(--muted);
}

.movement-list-dates span,
.movement-list-dates time {
  white-space: nowrap;
}

.movement-list-more {
  min-height: 44px;
  margin-top: 14px;
}

.route-map {
  height: 340px;
}

.route-planner {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.route-planner-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
}

.task-route-map {
  position: relative;
  z-index: 1;
  height: 300px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: crosshair;
  touch-action: manipulation;
}

.task-route-map.is-interactive {
  background: #eefaf6;
  background: color-mix(in srgb, var(--task-color, #0ea5e9) 16%, #ffffff);
  border-color: color-mix(in srgb, var(--task-color, #0ea5e9) 42%, var(--line));
}

.route-point-marker {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 3px solid #0f172a;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.24);
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.form-submit-bar {
  position: sticky;
  bottom: 10px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: rgba(240, 253, 244, 0.96);
  padding: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.form-submit-bar span {
  color: #047857;
  font-size: 13px;
  font-weight: 800;
}

.form-submit-bar button {
  min-width: 220px;
  min-height: 48px;
  border: 0;
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
  font-size: 15px;
  opacity: 1;
}

.form-submit-bar button:hover,
.form-submit-bar button:focus {
  background: #047857;
  color: #ffffff;
}

.form-submit-bar button:disabled {
  background: #334155;
  color: #ffffff;
  cursor: not-allowed;
  opacity: 1;
  box-shadow: none;
}

.task-tracker-panel[hidden] {
  display: none;
}

.task-tracker-context {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.task-tracker-context > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.task-tracker-context strong {
  display: block;
  overflow-wrap: anywhere;
}

.route-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: stretch;
}

.route-summary span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.route-summary strong {
  overflow-wrap: anywhere;
}

.route-summary small {
  color: var(--muted);
  font-weight: 800;
}

.route-summary button {
  min-height: 42px;
}

.tracker-help {
  margin-top: 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  padding: 10px 12px;
  color: #047857;
  font-weight: 800;
}

.tracker-help.compact {
  margin: 10px 0;
  padding: 8px 10px;
  font-size: 13px;
}

.task-card.is-tracking {
  border-color: #34d399;
  box-shadow: inset 4px 0 0 #10b981, 0 12px 26px rgba(16, 185, 129, 0.12);
}

.task-qr-card,
.task-qr-context {
  display: grid;
  gap: 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  padding: 12px;
}

.task-qr-card {
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  margin-top: 12px;
}

.task-qr-card:has(.task-qr-unit) {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.task-qr-unit {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.task-qr-card img {
  width: 120px;
  height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.task-qr-card img.meeting-qr {
  height: 220px;
  width: 220px;
}

.task-qr-card .copy-link {
  margin-top: 6px;
}

.task-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.task-qr-actions button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  padding: 8px 12px;
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.task-qr-actions button:first-child {
  background: #047857;
}

.task-qr-context {
  margin: 12px 0;
}

.task-qr-context span {
  color: var(--muted);
  font-weight: 800;
}

.task-qr-dialog {
  border: 0;
  border-radius: 10px;
  box-shadow: 0 18px 52px rgba(15, 23, 42, .35);
  max-width: min(94vw, 620px);
  padding: 20px;
}

.task-qr-dialog::backdrop { background: rgba(15, 23, 42, .76); }
.task-qr-dialog strong { display: block; margin: 0 0 12px; }
.task-qr-dialog img { display: block; height: auto; max-width: min(84vw, 520px); width: 100%; }
.task-qr-dialog button { float: right; min-height: 44px; }

@media (max-width: 760px) {
  .task-qr-card img.meeting-qr {
    height: min(220px, 72vw);
    width: min(220px, 72vw);
  }
}

.movement-legend {
  margin-top: 12px;
}

.map-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.map-filter-bar label {
  display: grid;
  min-width: min(100%, 280px);
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.map-filter-bar select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
}

.leaflet-container {
  overflow: hidden;
  font: inherit;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-container img.leaflet-tile {
  max-width: none !important;
  max-height: none !important;
}

.leaflet-tile {
  width: 256px !important;
  height: 256px !important;
  border: 0 !important;
  outline: 1px solid transparent;
  backface-visibility: hidden;
  user-select: none;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.heat-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.heat-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 99px;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.heat-cell {
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: #0f172a;
}

.heat-cell p {
  margin: 6px 0;
  color: #334155;
  font-size: 13px;
}

.heat-cell small {
  color: #475569;
  font-weight: 800;
}

.verde,
.heat-cell.verde {
  background: #bbf7d0;
}

.amarelo,
.heat-cell.amarelo {
  background: #fde68a;
}

.vermelho,
.heat-cell.vermelho {
  background: #fecdd3;
}

.affiliate-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 248, 0.94)),
    #fff;
  overflow-x: auto;
}

.affiliate-tree {
  position: relative;
  display: grid;
  gap: 18px;
  min-width: 760px;
  margin-bottom: 20px;
  padding: 8px 10px 12px;
}

.affiliate-tree + .affiliate-tree {
  border-top: 1px solid #e2e8f0;
  padding-top: 22px;
}

.affiliate-level {
  display: flex;
  justify-content: center;
}

.affiliate-level-top {
  position: relative;
}

.affiliate-level-top::after {
  content: "";
  position: absolute;
  bottom: -18px;
  left: 50%;
  width: 2px;
  height: 18px;
  background: #94a3b8;
}

.affiliate-branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  align-items: start;
  padding-top: 18px;
  justify-content: center;
}

.affiliate-branches::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: #94a3b8;
}

.affiliate-branch {
  position: relative;
  display: grid;
  gap: 14px;
  justify-items: center;
}

.affiliate-branch::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 50%;
  width: 2px;
  height: 18px;
  background: #94a3b8;
}

.affiliate-supporters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  width: 100%;
  gap: 10px;
  align-items: start;
}

.affiliate-node {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.affiliate-node strong {
  max-width: 180px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.affiliate-node small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.affiliate-node .avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.leader-node {
  min-width: 260px;
  border-color: #86efac;
  box-shadow: inset 0 4px 0 var(--green), 0 12px 24px rgba(4, 120, 87, 0.12);
}

.leader-node .avatar {
  background: var(--green);
}

.subleader-node {
  min-width: 210px;
  border-color: #bae6fd;
  box-shadow: inset 0 4px 0 #0ea5e9, 0 10px 20px rgba(3, 105, 161, 0.08);
}

.subleader-node .avatar {
  background: var(--sky);
}

.supporter-node {
  min-width: 120px;
  padding: 10px;
  box-shadow: inset 0 3px 0 #64748b, 0 6px 14px rgba(15, 23, 42, 0.05);
}

.supporter-node .avatar {
  width: 34px;
  height: 34px;
  background: #334155;
  font-size: 12px;
}

.empty-node,
.more-node {
  background: #f8fafc;
  border-style: dashed;
}

.mini-stack {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-weight: 800;
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
}

.filter-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.filter-form input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 11px;
  color: var(--text);
  font: inherit;
  outline: none;
}

.filter-form button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  cursor: pointer;
  padding: 9px 14px;
  font: inherit;
  font-weight: 800;
}

.check-field {
  display: flex !important;
  grid-column: span 2;
  gap: 10px !important;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 11px;
}

.check-field input {
  width: auto;
  min-height: auto;
}

.copy-link {
  width: min(100%, 560px);
  min-height: 36px;
  margin-top: 8px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  padding: 8px 10px;
  color: #166534;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

#rede-apoiadores, #funil-apoiadores, #meu-link-apoiador, #filtro-apoiadores { scroll-margin-top: 140px; }
.supporter-tabs a[aria-current="location"] { background: #0f766e; color: white; }
.supporter-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 20px 0 0; }
.supporter-details > div { min-width: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.supporter-details dt { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.supporter-details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.supporter-invite-link { display: block; box-sizing: border-box; width: 100%; margin: 8px 0 16px; padding: 12px; resize: vertical; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.invite-share:has(.supporter-whatsapp) { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.invite-share:has(.supporter-whatsapp) .tracker-actions { display: grid; min-width: 0; gap: 16px; }
.supporter-whatsapp { display: grid; gap: 8px; min-width: 0; }
.supporter-whatsapp input, .supporter-whatsapp textarea { box-sizing: border-box; width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.supporter-whatsapp button { justify-self: start; }
@media (max-width: 600px) {
  .supporter-details { grid-template-columns: minmax(0, 1fr); }
  .invite-share:has(.supporter-whatsapp) { grid-template-columns: minmax(0, 1fr); }
}

.public-card {
  width: min(100%, 720px);
}

.page-indicar .login-screen {
  align-items: start;
  min-height: 100dvh;
  padding-block: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-bottom));
}

.page-indicar .public-card { width: min(100%, 860px); }
.public-form-section { padding-block: 20px; border-top: 1px solid var(--line); }
.public-form-section h2 { margin: 0 0 16px; font-size: var(--type-section); }
.public-form-section .public-form-grid { margin-bottom: 0; }
.public-field-error { display: block; color: var(--danger); font-weight: 700; }
.public-field-error[hidden] { display: none; }
.public-form-section [aria-invalid="true"] { border-color: var(--danger); }
.page-indicar input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.page-indicar input[type="number"]::-webkit-inner-spin-button,
.page-indicar input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.supporter-location-map { height: 340px; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius-control); }
.supporter-location-map .leaflet-control-attribution { display: block; max-width: calc(100% - 12px); }
.supporter-location-icon { background: none; border: 0; }
.supporter-location-icon span { display: block; width: 36px; height: 36px; margin: 3px auto; border: 4px solid #fff; border-radius: 50% 50% 50% 0; background: var(--primary); box-shadow: 0 2px 8px #0006; transform: rotate(-45deg); }
.supporter-location-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.supporter-location-actions button { min-height: 44px; }
.page-indicar .public-form-section:last-child > button[type="submit"] { width: 100%; min-height: 48px; }

@media (max-width: 760px) {
  .page-indicar .public-form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-indicar .public-form-grid .wide { grid-column: auto; }
  .supporter-location-map { height: 320px; }
  .supporter-location-actions { display: grid; grid-template-columns: 1fr; }
  .supporter-location-actions button { width: 100%; }
}

.public-card .login-brand {
  justify-items: start;
  grid-template-columns: auto minmax(0, 1fr);
  text-align: left;
}

.public-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.public-form-grid label {
  display: grid;
  gap: 6px;
}

.public-form-grid .wide,
.public-extra .wide {
  grid-column: 1 / -1;
}

.public-extra {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.public-extra summary {
  cursor: pointer;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.public-extra[open] summary {
  margin-bottom: 12px;
}

@media (max-width: 1000px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two,
  .three,
  .four,
  .five,
  .supporter-command,
  .field-form-grid,
  .fixed-task-window,
  .public-form-grid,
  .tracker-grid,
  .heatmap {
    grid-template-columns: 1fr;
  }

  .leader-form,
  .leader-row,
  .leader-row.compact-row,
  .leader-metrics,
  .event-card,
  .invite-share,
  .whatsapp-send-form,
  .qr-scanner,
  .top-actions,
  .task-tracker-context,
  .route-summary,
  .filter-form {
    grid-template-columns: 1fr;
  }

  .task-qr-card {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .field-map,
  .movement-map {
    height: 320px;
  }

  .affiliate-panel {
    padding-bottom: 18px;
  }

  .affiliate-tree {
    min-width: 640px;
  }
}

@media (max-width: 640px) {
  body {
    background: #e9eeeb;
    overflow-x: hidden;
  }

  .login-screen {
    align-items: start;
    padding: 14px;
  }

  .login-card {
    padding: 18px;
  }

  .public-card .login-brand {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .app {
    display: block;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    max-height: none;
    overflow: visible;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  }

  .brand {
    padding: 12px 14px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand .muted {
    font-size: 12px;
  }

  .logo-image {
    width: 86px;
    height: 42px;
  }

  .sidebar .logo-image {
    width: 46px;
    height: 30px;
  }

  .mobile-nav-shell {
    position: relative;
    padding: 0 12px 10px;
  }

  .mobile-nav-shell > summary {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border: 1px solid rgba(167, 243, 208, 0.24);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    list-style: none;
  }

  .mobile-nav-shell > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-nav-shell > summary::after {
    content: "▾";
    color: #a7f3d0;
    font-size: 16px;
  }

  .mobile-nav-shell[open] > summary::after {
    content: "▴";
  }

  .mobile-nav-shell > summary span {
    color: #a7f3d0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .mobile-nav-shell > summary strong {
    margin-left: auto;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-shell .nav {
    display: grid;
    gap: 5px;
    max-height: min(55vh, 430px);
    overflow-y: auto;
    padding: 8px 0 0;
  }

  .nav a {
    width: 100%;
    min-height: 34px;
    white-space: nowrap;
    padding: 8px 12px;
  }

  .topbar {
    position: static;
    display: grid;
    gap: 12px;
    padding: 14px;
  }

  .topbar h1 {
    font-size: 23px;
    line-height: 1.15;
  }

  .top-actions {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .top-actions .button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .child-row {
    grid-template-columns: 1fr;
  }

  .content {
    width: 100%;
    max-width: none;
    overflow-x: hidden;
    padding: 14px;
  }

  .module-title {
    font-size: 20px;
    line-height: 1.15;
    padding: 13px 14px;
  }

  .hero,
  .panel,
  .item,
  .row {
    width: 100%;
    max-width: 100%;
  }

  .hero,
  .panel {
    padding: 14px;
  }

  .panel-head {
    display: grid;
    margin: -2px -2px 14px;
    padding: 12px;
  }

  h1,
  h2,
  h3 {
    overflow-wrap: anywhere;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 17px;
  }

  .muted {
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .leader-form,
  .field-form-grid,
  .delivery-form,
  .public-form-grid,
  .supporter-command,
  .leader-row,
  .leader-row.compact-row,
  .leader-metrics,
  .leader-metrics.metrics-five,
  .event-card,
  .invite-share,
  .whatsapp-send-form,
  .qr-scanner,
  .route-summary,
  .heatmap,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .delivery-form .wide-field,
  .delivery-form > button[type="submit"] {
    grid-column: 1 / -1;
    width: 100%;
  }

  .delivery-form .delivery-map {
    height: 300px;
  }

  .supporter-command {
    gap: 12px;
    padding: 14px;
  }

  .supporter-command h2 {
    font-size: 21px;
    line-height: 1.12;
  }

  .supporter-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .supporter-action-row .button {
    width: 100%;
    justify-content: center;
    padding: 11px 10px;
  }

  .supporter-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .supporter-kpis article {
    padding: 10px 8px;
  }

  .supporter-kpis strong {
    font-size: 18px;
  }

  .supporter-kpis span {
    font-size: 11px;
  }

  .supporter-tabs {
    top: 0;
    margin: 10px -2px 2px;
    padding: 7px;
  }

  .supporter-tabs a {
    min-height: 38px;
    padding: 10px 12px;
  }

  .supporter-share-panel,
  .supporter-filter-panel,
  .supporter-list-panel,
  .supporter-section,
  .compact-disclosure {
    margin-top: 12px;
  }

  .supporter-share-actions .tracker-actions,
  .supporter-share-actions .whatsapp-send-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .supporter-share-actions button,
  .supporter-share-actions .button,
  .supporter-filter-panel .filter-form button,
  .supporter-filter-panel .filter-form .button {
    width: 100%;
    justify-content: center;
  }

  .invite-qr {
    display: flex;
    justify-content: center;
  }

  .invite-qr img {
    width: min(180px, 70vw);
    height: auto;
  }

  .leader-actions {
    min-width: 0;
  }

  .field-map,
  .movement-map,
  .route-map {
    height: 280px;
    min-height: 260px;
  }

  .map-panel {
    max-width: 100%;
  }

  .leaflet-control-container {
    font-size: 12px;
  }

  .affiliate-panel {
    overflow-x: visible;
  }

  .affiliate-tree {
    min-width: 0;
    width: 100%;
    gap: 14px;
    padding: 4px 0 8px;
  }

  .affiliate-level-top::after,
  .affiliate-branches::before,
  .affiliate-branch::before {
    display: none;
  }

  .affiliate-branches,
  .affiliate-supporters {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .affiliate-node,
  .leader-node,
  .subleader-node,
  .supporter-node {
    min-width: 0;
    width: 100%;
    justify-items: start;
    text-align: left;
  }

  .affiliate-node strong {
    max-width: 100%;
  }

  .affiliate-node .avatar {
    justify-self: start;
  }

  .login-screen {
    padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  }

  .login-card {
    padding: 22px;
  }

  .login-brand {
    justify-items: center;
    text-align: center;
  }

  .login-brand .logo-image {
    width: min(100%, 220px);
    height: auto;
  }

  .login-logo {
    width: min(100%, 300px);
  }
}

/* Final visual overrides - keep after legacy rules */
body {
  background:
    radial-gradient(circle at 28% -10%, rgba(15, 118, 110, 0.08), transparent 30%),
    linear-gradient(180deg, #f8fafc 0, var(--bg) 300px, #eef2f5 100%);
  color: var(--text);
}

.app {
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  border-right: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(23, 32, 51, 0.98)),
    var(--dark);
  box-shadow: 12px 0 34px rgba(15, 23, 42, 0.16);
}

.brand {
  padding: 18px 16px;
}

.nav {
  gap: 6px;
  padding: 14px 12px;
}

.nav a {
  position: relative;
  min-height: 42px;
  border: 1px solid transparent;
  padding: 10px 12px;
  color: #d3dce8;
  font-size: 13px;
}

.nav a::before {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #a7f3d0;
  font-size: 13px;
  font-weight: 900;
  content: "•";
}

.nav a[href*="partido"]::before { content: "▦"; }
.nav a[href*="presidente"]::before { content: "◎"; }
.nav a[href*="equipe"]::before { content: "◫"; }
.nav a[href*="entregas"]::before { content: "◆"; }
.nav a[href*="lider"]::before { content: "L"; }
.nav a[href*="apoiadores"]::before { content: "A"; }
.nav a[href*="atendimentos"]::before { content: "+"; }
.nav a[href*="apoiador"]::before { content: "◇"; }
.nav a[href*="tarefas"]::before { content: "✓"; }
.nav a[href*="campo"]::before { content: "⌖"; }
.nav a[href*="movimentacao"]::before { content: "↗"; }
.nav a[href="/logout"]::before { content: "←"; }

.nav a.active,
.nav a:hover {
  border-color: rgba(16, 185, 129, 0.26);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--green-hot);
}

.nav a.active::before,
.nav a:hover::before {
  background: var(--green-hot);
  color: #06291f;
}

.nav a[href="/logout"] {
  display: none;
}

.topbar {
  z-index: 15;
  gap: 16px;
  border-bottom: 1px solid rgba(221, 228, 234, 0.9);
  background: rgba(245, 246, 248, 0.92);
  padding: 12px 28px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.topbar .eyebrow {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
}

.topbar h1 {
  font-size: var(--type-page);
  line-height: 1.12;
}

.top-actions {
  gap: 10px;
}

.top-actions .button {
  min-height: 38px;
  border-color: #d8e0e7;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.content {
  width: 100%;
  max-width: 1360px;
  padding: var(--space-5) var(--space-6) 44px;
}

.module-title {
  margin-bottom: 16px;
  border: 0;
  border-radius: var(--radius-control);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 118, 110, 0.92)),
    var(--dark);
  padding: 18px 20px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
  font-size: var(--type-module);
}

.module-title::before {
  color: #99f6e4;
  font-size: 10px;
}

.panel,
.item,
.row,
.hero {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.panel {
  margin-bottom: var(--space-4);
  padding: var(--space-4);
}

.panel::before {
  display: none;
}

.panel-head {
  gap: 14px;
  margin: -6px -6px 18px;
  border: 1px solid #edf1f5;
  border-bottom-color: #dfe6ed;
  border-radius: 10px;
  background:
    linear-gradient(135deg, var(--panel-soft), #ffffff);
  padding: 16px;
}

.panel-head .eyebrow::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--primary);
  content: "";
}

.item,
.row {
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.leader-row,
.leader-row.compact-row {
  border-color: var(--line);
  border-radius: var(--radius-panel);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.grid {
  gap: var(--space-3);
}

.pill {
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 5px 9px;
  font-size: var(--type-xs);
}

.pill.ok,
.pill.ativo,
.pill.quente {
  background: var(--success-soft);
  color: #047857;
}

.pill.morno {
  background: var(--warning-soft);
  color: #9a6700;
}

.pill.frio {
  background: var(--info-soft);
  color: var(--info);
}

.pill.rejeitada,
.pill.bloqueado,
.pill.cancelada {
  background: var(--danger-soft);
  color: var(--danger);
}

.button,
button {
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
}

.leader-form label,
.field-form label,
.login-form label,
.stack-form label,
.toolbar-form label,
.public-form-grid label {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.leader-form input,
.leader-form select,
.leader-form textarea,
.field-form input,
.field-form select,
.field-form textarea,
.login-form input,
.login-form select,
.login-form textarea,
.stack-form input,
.stack-form select,
.stack-form textarea,
.toolbar-form input,
.toolbar-form select,
.public-form-grid input,
.public-form-grid select,
.public-form-grid textarea,
.copy-link {
  min-height: 44px;
  border-color: #d7e0e7;
  border-radius: 10px;
  background: #f9fbfc;
}

.leader-form input:focus,
.leader-form select:focus,
.leader-form textarea:focus,
.field-form input:focus,
.field-form select:focus,
.field-form textarea:focus,
.login-form input:focus,
.login-form select:focus,
.login-form textarea:focus,
.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus,
.toolbar-form input:focus,
.toolbar-form select:focus,
.public-form-grid input:focus,
.public-form-grid select:focus,
.public-form-grid textarea:focus,
.copy-link:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.leader-form button,
.field-form button,
.login-form button,
.profile-photo-submit,
.tracker-actions button,
.task-qr-actions button,
.form-submit-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
  font-weight: 900;
}

.leader-form button::before,
.field-form button::before,
.login-form button::before {
  content: "✓";
}

.leader-metrics span,
.tracker-card,
.supporter-kpis article,
.route-summary span {
  border-color: #dfe7ed;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.leader-metrics strong,
.tracker-card strong,
.supporter-kpis strong,
.route-summary strong {
  color: var(--ink);
  font-size: 26px;
  font-weight: 950;
  letter-spacing: 0;
}

.leader-metrics small,
.supporter-kpis span,
.route-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.supporter-command {
  border-left: 0;
  border-radius: 12px;
  background:
    linear-gradient(135deg, #ffffff, #f3faf7);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.supporter-tabs {
  top: 70px;
  border-color: #dfe7ed;
  border-radius: 12px;
}

.supporter-tabs a:hover {
  border-color: #a7f3d0;
  background: var(--primary-soft);
  color: var(--primary);
}

.agenda-request-list {
  display: grid;
  gap: var(--space-3);
}

.agenda-request-item {
  display: grid;
  gap: 12px;
}

.agenda-request-item p {
  margin: 0;
}

.agenda-request-objective {
  display: grid;
  gap: 6px;
}

.agenda-request-objective strong {
  color: var(--muted);
  font-size: var(--type-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.agenda-request-title,
.agenda-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agenda-request-title h3 {
  margin: 2px 0 0;
}

.agenda-request-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0;
}

.agenda-request-details div {
  min-width: 0;
}

.agenda-request-details dt {
  color: var(--muted);
  font-size: var(--type-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.agenda-request-details dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: var(--type-sm);
  font-weight: 700;
}

.agenda-meeting-form {
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.95fr);
  grid-template-areas:
    "details location"
    ". submit";
  align-items: stretch;
  gap: 18px 24px;
}

.agenda-meeting-details {
  grid-area: details;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 14px;
}

.agenda-meeting-date-time,
.agenda-meeting-purpose {
  grid-column: 1 / -1;
}

.agenda-meeting-date-time {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.agenda-meeting-date-time label,
.agenda-meeting-location > label,
.agenda-meeting-purpose {
  display: grid;
  gap: 6px;
}

.agenda-meeting-purpose textarea {
  min-height: 170px;
  resize: vertical;
}

.agenda-meeting-location {
  grid-area: location;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.agenda-meeting-address-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.45fr) minmax(0, 1fr);
  gap: 14px;
}

.agenda-meeting-address-row label {
  display: grid;
  gap: 6px;
}

.agenda-map-field {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 10px;
}

.agenda-map-heading {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
}

.agenda-map-heading .pill {
  align-self: flex-start;
}

.agenda-map-heading h2 {
  margin: 0;
  font-size: var(--type-section);
}

.agenda-meeting-map {
  min-height: 380px;
  flex: 1;
  border: 1px solid #d7e0e7;
  border-radius: 10px;
}

.agenda-meeting-map .leaflet-control-attribution {
  font-size: var(--type-xs);
}

.agenda-meeting-submit {
  grid-area: submit;
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.agenda-meeting-submit button {
  min-width: 190px;
}

.agenda-day-hero {
  margin-bottom: 16px;
}

.agenda-day-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.agenda-day-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agenda-day-controls form {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 10px;
}

.agenda-day-controls form button,
.agenda-navigation-links .secondary-action,
.agenda-day-controls .secondary-action {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 800;
}

.agenda-day-controls form button {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}

.agenda-navigation-links .secondary-action,
.agenda-day-controls .secondary-action {
  background: #fff;
  color: var(--ink);
}

.agenda-day-controls label {
  display: grid;
  gap: 6px;
  min-width: 164px;
}

.agenda-day-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 18px;
}

.agenda-day-map-panel,
.agenda-day-list-panel {
  min-width: 0;
}

.agenda-day-map {
  height: 440px;
  min-height: 380px;
  border: 1px solid #d7e0e7;
  border-radius: 10px;
}

.agenda-day-map-empty,
.agenda-day-empty {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 0;
  text-align: left;
}

.agenda-day-empty {
  min-height: auto;
}

.meeting-task-card .task-objective-label {
  margin: 12px 0 2px;
  color: var(--muted);
  font-size: var(--type-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.meeting-task-card .meeting-accept-help {
  margin: 8px 0 0;
}

.agenda-day-list {
  display: grid;
  gap: 12px;
}

.agenda-day-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  padding: 14px;
}

.agenda-day-item p {
  margin: 12px 0 0;
}

.agenda-day-item-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.agenda-day-item-head h3 {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.agenda-day-number,
.agenda-map-number-marker span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 8px #0f172a4d;
  color: #fff;
  font-size: var(--type-sm);
  font-weight: 900;
}

.agenda-day-details {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.agenda-day-details div {
  min-width: 0;
}

.agenda-day-details dt {
  color: var(--muted);
  font-size: var(--type-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.agenda-day-details dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.agenda-navigation-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.agenda-navigation-links .secondary-action,
.agenda-day-controls .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.agenda-optional {
  background: var(--warning-soft);
  color: var(--warning);
}

/* Lucide-style masks keep every sidebar item legible without text glyph icons. */
.nav a {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E");
}

.nav a::before {
  content: "";
  background: var(--green-hot);
  -webkit-mask: var(--nav-icon) center / 17px 17px no-repeat;
  mask: var(--nav-icon) center / 17px 17px no-repeat;
}

.nav a[href*="partido"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V7l8-4v18M19 21V11l-6-4M9 9h1M9 13h1M9 17h1M15 15h1M15 19h1'/%3E%3C/svg%3E"); }
.nav a[href*="presidente"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 4 3 12h14l3-12-6 7-4-7-4 7-6-7ZM5 20h14'/%3E%3C/svg%3E"); }
.nav a[href*="equipe"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.nav a[href*="entregas"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 22 9-18 9 18M5 18h14M7 14h10M9 10h6'/%3E%3C/svg%3E"); }
.nav a[href*="lider"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0M19 8v4M21 10h-4'/%3E%3C/svg%3E"); }
.nav a[href*="apoiadores"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M3 21v-2a6 6 0 0 1 12 0v2M16 3.13a4 4 0 0 1 0 7.75M21 21v-2a6 6 0 0 0-4.5-5.8'/%3E%3C/svg%3E"); }
.nav a[href*="atendimentos"], .nav a[href*="solicitacoes"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2ZM8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01'/%3E%3C/svg%3E"); }
.nav a[href*="apoiador"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }
.nav a[href*="tarefas"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='16' height='18' x='4' y='3' rx='2'/%3E%3Cpath d='m9 12 2 2 4-4M8 7h8'/%3E%3C/svg%3E"); }
.nav a[href*="campo"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 5-8 11-8 11S4 15 4 10a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E"); }
.nav a[href*="movimentacao"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='19' r='3'/%3E%3Cpath d='M9 19h4.5a3.5 3.5 0 0 0 0-7H10a3 3 0 0 1 0-6h8M18 3l3 3-3 3'/%3E%3C/svg%3E"); }

.nav a.active::before,
.nav a:hover::before {
  background: var(--dark);
}

.agenda-action-row {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.agenda-action-row button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  padding: 10px 14px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.agenda-action-row button::before {
  content: none;
}

.agenda-action-row .secondary-action {
  border: 1px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.agenda-action-row .danger-action {
  border: 1px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.agenda-action-row button:hover,
.agenda-day-controls form button:hover {
  background: var(--green);
  color: #fff;
}

.agenda-action-row .secondary-action:hover {
  background: var(--primary);
  color: #fff;
}

.agenda-action-row .danger-action:hover {
  background: var(--danger);
  color: #fff;
}

.agenda-action-row button:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--primary);
}

@media (max-width: 1000px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 25;
    height: auto;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--bg);
  }

  .brand {
    padding: 10px 12px;
  }

  .nav {
    padding: 8px 10px 10px;
  }

  .nav a {
    min-height: 40px;
    padding: 8px 10px;
  }

  .nav a::before {
    width: 26px;
    height: 26px;
  }

  .nav a[href="/logout"] {
    margin-top: 0;
    border-top: 0;
    padding-top: 8px;
  }

  .topbar {
    padding: 12px;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .content {
    padding: 12px;
  }

  .module-title {
    padding: 15px;
    font-size: 20px;
  }

  .panel,
  .hero {
    padding: 15px;
    border-radius: var(--radius-panel);
  }

  .panel-head {
    margin: -3px -3px 14px;
    padding: 13px;
  }

  .leader-metrics strong,
  .tracker-card strong,
  .supporter-kpis strong,
  .route-summary strong {
    font-size: 22px;
  }

  .agenda-meeting-map {
    min-height: 260px;
  }

  .agenda-meeting-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "details"
      "location"
      "submit";
    gap: 16px;
  }

  .agenda-meeting-details,
  .agenda-meeting-date-time {
    grid-template-columns: 1fr;
  }

  .agenda-meeting-date-time,
  .agenda-meeting-purpose {
    grid-column: auto;
  }

  .agenda-meeting-purpose textarea {
    min-height: 144px;
  }

  .agenda-meeting-submit,
  .agenda-meeting-submit button {
    width: 100%;
  }

  .agenda-request-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .agenda-request-details {
    grid-template-columns: 1fr;
  }

  .agenda-action-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .agenda-action-row button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .agenda-meeting-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "details"
      "location"
      "submit";
    gap: 16px;
  }

  .agenda-meeting-details,
  .agenda-meeting-date-time,
  .agenda-meeting-address-row,
  .agenda-day-layout {
    grid-template-columns: 1fr;
  }

  .agenda-meeting-date-time,
  .agenda-meeting-purpose {
    grid-column: auto;
  }

  .agenda-meeting-details {
    grid-template-rows: none;
  }

  .agenda-meeting-purpose textarea {
    height: auto;
  }

  .agenda-meeting-map {
    height: 260px;
    min-height: 260px;
  }

  .agenda-meeting-submit,
  .agenda-meeting-submit button {
    width: 100%;
  }

  .agenda-day-controls,
  .agenda-day-controls form {
    align-items: stretch;
    flex-direction: column;
  }

  .agenda-day-controls form,
  .agenda-day-controls form button,
  .agenda-day-controls .secondary-action,
  .agenda-day-navigation {
    width: 100%;
  }

  .agenda-day-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agenda-day-navigation .secondary-action {
    justify-content: center;
  }

  .agenda-day-controls label {
    min-width: 0;
  }

  .agenda-day-map {
    height: 300px;
    min-height: 260px;
  }

  .agenda-day-item-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .agenda-day-item-head .agenda-optional {
    grid-column: 2;
    justify-self: start;
  }

  .president-meetings-panel {
    padding: 14px;
  }

  .president-meeting-filter {
    display: grid;
    grid-template-columns: 1fr;
  }

  .president-meeting-filter a {
    justify-content: center;
  }

  .president-meeting-map {
    min-height: 300px;
  }
}

@media (min-width: 761px) {
  .agenda-meeting-map {
    height: 380px;
    min-height: 380px;
  }
}

/* Fase 6: pedidos de material mantêm a leitura operacional em desktop e celular. */
.material-request-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
}

.material-request-form .wide {
  grid-column: 1 / -1;
}

.material-request-form textarea {
  min-height: 116px;
  resize: vertical;
}

.material-form-submit {
  display: flex;
  justify-content: flex-end;
}

.material-form-submit button {
  min-height: 44px;
}

.material-request-list {
  display: grid;
  gap: 12px;
}

.material-request-item {
  display: grid;
  gap: 12px;
}

.material-request-item p {
  margin: 0;
  overflow-wrap: anywhere;
}

.material-request-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.material-request-title h3 {
  margin: 2px 0 0;
}

.material-request-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0;
}

.material-request-details div {
  min-width: 0;
}

.material-request-details dt {
  color: var(--muted);
  font-size: var(--type-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.material-request-details dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: var(--type-sm);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.material-request-observation {
  display: grid;
  gap: 6px;
}

.material-request-observation strong {
  color: var(--muted);
  font-size: var(--type-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.material-request-observation p {
  margin: 0;
}

.material-decision-form {
  display: grid;
  grid-template-columns: minmax(210px, 0.65fr) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
}

.material-decision-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.material-decision-form input {
  min-height: 44px;
  border: 1px solid #d7e0e7;
  border-radius: 10px;
  background: #f9fbfc;
}

.material-decision-form input:focus-visible {
  outline: 0;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.material-action-row {
  align-self: end;
}

.pill.material-status-aprovado,
.pill.material-status-entregue {
  background: var(--success-soft);
  color: var(--green);
}

.pill.material-status-aprovado_parcialmente {
  background: var(--warning-soft);
  color: var(--warning);
}

.pill.material-status-despachado,
.material-awaiting-confirmation {
  background: var(--warning-soft);
  color: var(--warning);
}

.material-awaiting-confirmation {
  border: 1px solid var(--warning);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 800;
}

.material-receive-form button {
  min-height: 44px;
}

.pill.material-status-recusado {
  background: var(--danger-soft);
  color: var(--danger);
}

@media (max-width: 760px) {
  .material-request-form,
  .material-request-details,
  .material-decision-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .material-request-form .wide {
    grid-column: auto;
  }

  .material-form-submit,
  .material-form-submit button,
  .material-action-row,
  .material-action-row button {
    width: 100%;
  }

  .material-request-title {
    flex-direction: column;
  }
}

/* Acabamento do painel do Presidente: revelação progressiva sem alterar dados. */
.president-nav {
  position: static;
  z-index: auto;
  margin-bottom: 18px;
  scroll-margin-top: 16px;
}

.president-nav a:focus-visible,
.president-back-link:focus-visible,
.president-meeting-filter a:focus-visible,
.president-roster-disclosure > summary:focus-visible,
.president-meetings-panel > summary:focus-visible,
.president-map-head select:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.35);
  outline-offset: 3px;
}

.president-roster-disclosure,
.president-meetings-panel {
  margin: 0;
}

.president-roster-disclosure > summary,
.president-meetings-panel > summary {
  cursor: pointer;
  list-style: none;
}

.president-roster-disclosure > summary::-webkit-details-marker,
.president-meetings-panel > summary::-webkit-details-marker {
  display: none;
}

.president-roster-disclosure > summary::after,
.president-meetings-panel > summary::after {
  flex: 0 0 auto;
  color: var(--primary);
  content: "+";
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.president-roster-disclosure[open] > summary::after,
.president-meetings-panel[open] > summary::after {
  content: "−";
}

.president-roster-disclosure > summary {
  border-bottom: 1px solid #e5edf2;
}

.president-roster-disclosure[open] > summary {
  border-bottom-color: transparent;
}

.president-roster-body {
  border-top: 1px solid #e5edf2;
}

.president-map-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(180px, 220px);
  align-items: start;
}

.president-map-head > div,
.president-map-head label {
  min-width: 0;
}

.president-map-head label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.president-map-head select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #b9c8d4;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  padding: 0 34px 0 12px;
}

.president-meetings-panel {
  overflow: hidden;
  padding: 0;
}

.president-meetings-panel > summary {
  border-bottom: 1px solid #e5edf2;
  margin: 0;
}

.president-meetings-panel[open] > summary {
  border-bottom-color: transparent;
}

.president-meetings-body {
  border-top: 1px solid #e5edf2;
  padding: 16px;
}

.president-meeting-filter {
  margin-bottom: 16px;
}

.president-meeting-empty {
  border: 1px solid rgba(15, 118, 110, 0.28);
  background: var(--primary-soft);
  padding: 12px 14px;
}

@media (min-width: 1101px) {
  .president-workspace.is-roster-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .president-workspace.is-roster-collapsed .president-roster,
  .president-workspace.is-roster-collapsed .president-map-card {
    grid-column: 1 / -1;
  }

  .president-workspace.is-roster-collapsed .president-roster {
    position: static;
  }
}

@media (max-width: 760px) {
  .president-hero {
    gap: 14px;
    margin-bottom: 12px;
    padding: 18px;
  }

  .president-hero h2 {
    font-size: 26px;
    line-height: 1.12;
  }

  .president-score {
    width: 100%;
  }

  .president-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
  }

  .president-kpi {
    min-width: 0;
    padding: 14px;
  }

  .president-kpi strong {
    font-size: 26px;
  }

  .president-nav {
    gap: 6px;
    margin-bottom: 14px;
    border-radius: 10px;
    padding: 6px;
  }

  .president-nav a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
  }

  .president-map-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .president-map-head .pill {
    justify-self: start;
  }

  .president-map-head label {
    width: 100%;
  }

  .president-rep-list {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
  }

  .president-meetings-body {
    padding: 14px;
  }

  .president-meetings-head,
  .president-roster-head {
    gap: 10px;
    padding: 14px;
  }

  .president-meeting-map {
    min-height: 300px;
  }
}

/* Leaflet recebe tiles no tamanho nativo, evitando frestas claras entre blocos. */
.leaflet-container img.leaflet-tile,
.leaflet-container .leaflet-tile {
  max-width: none !important;
  max-height: none !important;
  border: 0 !important;
  outline: 1px solid transparent;
}

/* Revisão mobile do Presidente: o mapa é a leitura inicial; a lista é sob demanda. */
.president-representative-search,
.president-show-more {
  display: none;
}

.president-show-more[hidden] {
  display: none !important;
}

.president-create > summary {
  align-items: center;
  cursor: pointer;
}

.president-create > summary::after {
  color: var(--primary);
  content: "+";
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.president-create[open] > summary::after {
  content: "−";
}

@media (max-width: 760px) {
  .page-presidente .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
  }

  .page-presidente .brand {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 10px;
  }

  .page-presidente .app-mark,
  .page-presidente .sidebar .app-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .page-presidente .brand strong {
    font-size: 14px;
  }

  .page-presidente .brand-copy .muted {
    display: none;
  }

  .page-presidente .logout-chip {
    min-height: 34px;
    padding: 0 10px;
  }

  .page-presidente .mobile-nav-shell {
    padding: 0 10px 8px;
  }

  .page-presidente .mobile-nav-shell > summary {
    min-height: 36px;
    padding: 7px 10px;
  }

  .page-presidente .topbar,
  .page-presidente .president-hero,
  .page-presidente .president-nav {
    display: none;
  }

  .page-presidente .content {
    padding-top: 8px;
  }

  .page-presidente .module-title {
    min-height: 44px;
    margin: 0 0 10px;
    padding: 11px 12px;
    font-size: 19px;
  }

  .page-presidente .president-module-prefix {
    display: none;
  }

  .page-presidente .president-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }

  .page-presidente .president-kpi {
    min-height: 112px;
    padding: 12px;
  }

  .page-presidente .president-kpi strong {
    font-size: 25px;
  }

  .page-presidente .president-create {
    margin-bottom: 12px;
  }

  .page-presidente .president-create > summary {
    margin-bottom: 0;
  }

  .page-presidente .president-workspace {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .page-presidente .president-map-card {
    order: 1;
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .page-presidente .president-roster {
    order: 2;
    width: 100%;
    min-width: 0;
    position: static;
    overflow: visible;
  }

  .page-presidente .president-roster-disclosure > summary {
    border-bottom-color: #e5edf2;
  }

  .page-presidente .president-roster-disclosure[open] > summary {
    border-bottom-color: transparent;
  }

  .page-presidente .president-roster-body {
    border-top-color: #e5edf2;
  }

  .page-presidente .president-state-filter,
  .page-presidente .president-select,
  .page-presidente .president-representative-search {
    display: grid;
    gap: 7px;
    padding: 12px;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
  }

  .page-presidente .president-representative-search input {
    width: 100%;
    min-height: 44px;
    border: 1px solid #b9c8d4;
    border-radius: 10px;
    background: #f8fafc;
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    padding: 0 12px;
  }

  .page-presidente .president-rep-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: none;
    overflow: visible;
    padding: 0 12px 12px;
  }

  .page-presidente .president-rep-list a {
    grid-template-areas: "avatar info";
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    min-height: 60px;
    padding: 10px;
  }

  .page-presidente .president-rep-list .avatar-small {
    grid-area: avatar;
    width: 34px;
    height: 34px;
    align-self: start;
    justify-self: start;
  }

  .page-presidente .president-rep-list .office-dot,
  .page-presidente .president-rep-list em[hidden] {
    display: none;
  }

  .page-presidente .president-rep-list a > span {
    grid-area: info;
    align-self: start;
    text-align: left;
  }

  .page-presidente .president-rep-list strong,
  .page-presidente .president-rep-list small {
    white-space: normal;
    text-align: left;
  }

  .page-presidente .president-show-more {
    display: flex;
    width: calc(100% - 24px);
    min-height: 44px;
    align-items: center;
    justify-content: center;
    margin: 0 12px 12px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    background: #ffffff;
    color: var(--primary);
    font: inherit;
    font-size: 13px;
    font-weight: 900;
  }

  .page-presidente .president-map-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .page-presidente .president-map-head .pill {
    justify-self: start;
  }

  .page-presidente .president-map-head label {
    width: 100%;
  }

  .page-presidente .president-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .page-presidente .president-map-panel {
    width: calc(100% - 16px);
    max-width: none;
    min-width: 0;
    margin: 0 8px 10px;
  }

  .page-presidente .president-map,
  .page-presidente .president-map .leaflet-container,
  .page-presidente .president-map .leaflet-pane {
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
  }

  .page-presidente .president-map {
    height: 320px;
    min-height: 320px;
  }

  .page-presidente .president-map .leaflet-bottom {
    right: 0;
    left: 0;
  }

  .page-presidente .president-map .leaflet-control-attribution {
    float: right;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 9px;
    line-height: 14px;
    padding: 0 3px;
    white-space: nowrap;
  }
}

/* Sobreposição mínima de meio pixel evita frestas de renderização do Leaflet. */
.leaflet-container .leaflet-tile {
  width: 257px !important;
  height: 257px !important;
  margin: -0.5px !important;
  transform: translateZ(0);
}

/* Camadas da interface ficam acima dos mapas; os z-index internos do Leaflet permanecem intactos. */
.map-panel,
.field-map,
.movement-map,
.route-map,
.task-route-map,
.supporter-location-map,
.agenda-day-map-panel,
.agenda-day-map,
.agenda-meeting-map,
.president-map-card,
.president-map-panel,
.president-map,
.president-meeting-map,
.delivery-map-box,
.delivery-map {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* O cabeçalho e a navegação inferior não podem ser cobertos por painéis Leaflet. */
.sidebar,
.topbar {
  z-index: 1200 !important;
  isolation: isolate;
}

.sidebar {
  background: #0f172a !important;
}

.topbar {
  background: #f5f6f8 !important;
}

.mobile-bottom-nav {
  z-index: 1201 !important;
  background: #ffffff !important;
  isolation: isolate;
}

@media (max-width: 760px) {
  .sidebar {
    z-index: 1200 !important;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .mobile-bottom-nav {
    padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
  }
}

/* Casca compacta do mandato no celular; os demais perfis mantêm a navegação atual. */
.page-role-politico .deputy-mobile-identity,
.page-role-deputado .deputy-mobile-identity {
  display: none;
}

@media (max-width: 760px) {
  .page-role-politico .sidebar,
  .page-role-deputado .sidebar {
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.2);
  }

  .page-role-politico .sidebar .brand,
  .page-role-deputado .sidebar .brand {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 48px;
    padding: 5px 10px;
  }

  .page-role-politico .sidebar .app-mark,
  .page-role-deputado .sidebar .app-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .page-role-politico .sidebar .brand strong,
  .page-role-deputado .sidebar .brand strong {
    font-size: 14px;
  }

  .page-role-politico .sidebar .brand-copy .muted,
  .page-role-deputado .sidebar .brand-copy .muted {
    display: none;
  }

  .page-role-politico .sidebar .logout-chip,
  .page-role-deputado .sidebar .logout-chip {
    min-height: 44px;
    padding: 0 10px;
  }

  .page-role-politico .mobile-nav-shell,
  .page-role-deputado .mobile-nav-shell {
    padding: 0 10px 8px;
  }

  .page-role-politico .mobile-nav-shell > summary,
  .page-role-deputado .mobile-nav-shell > summary {
    min-height: 44px;
    padding: 7px 10px;
  }

  .page-role-politico .topbar,
  .page-role-deputado .topbar {
    display: none;
  }

  .page-role-politico .content,
  .page-role-deputado .content {
    padding-top: 8px;
    padding-bottom: max(24px, calc(24px + env(safe-area-inset-bottom, 0px)));
  }

  .page-role-politico .mobile-nav-shell[open] .deputy-mobile-identity,
  .page-role-deputado .mobile-nav-shell[open] .deputy-mobile-identity {
    display: grid;
    gap: 3px;
    padding: 10px 12px 2px;
    color: #d8f3eb;
    font-size: 13px;
    line-height: 1.45;
  }

  .page-role-politico .mobile-nav-shell[open] .nav,
  .page-role-deputado .mobile-nav-shell[open] .nav {
    top: 100%;
  }
}
