/* ============================================================
   CGE · Letícia Batista 2026 · Sistema visual
   Cores: #2946ED (azul) · #F98043 (laranja) · #A52B99 (roxo) · #191956 (marinho)
   Tipografia oficial do kit:
     · Lotus Eden (Thin→Black, 10 pesos + itálico)
     · Surgena (display)
     · Manrope (UI sans, neutra de suporte)
   ============================================================ */

/* ===== Lotus Eden (serif do kit) ===== */
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-Thin-e1711474.otf") format("opentype");        font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-ThinItalic-7ad63233.otf") format("opentype");  font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-UltraLight-4a259a30.otf") format("opentype"); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-UltraLightItalic-8755baa2.otf") format("opentype"); font-weight: 200; font-style: italic; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-ExtraLight-7529235b.otf") format("opentype"); font-weight: 250; font-style: normal; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-ExtraLightItalic-b3ceef41.otf") format("opentype"); font-weight: 250; font-style: italic; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-Light-3dabd4a6.otf") format("opentype");       font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-LightItalic-d92a1b56.otf") format("opentype"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-Regular-fc049493.otf") format("opentype");     font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-Italic-0ce87f6d.otf") format("opentype");      font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-Medium-50a0c5cf.otf") format("opentype");      font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-MediumItalic-27bac35b.otf") format("opentype"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-Bold-b9152a3c.otf") format("opentype");        font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-BoldItalic-b6c23095.otf") format("opentype");  font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-ExtraBold-f1d6f377.otf") format("opentype");   font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-ExtraBoldItalic-8a17db4e.otf") format("opentype"); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-UltraBold-37131a34.otf") format("opentype");   font-weight: 850; font-style: normal; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-UltraBoldItalic-42713210.otf") format("opentype"); font-weight: 850; font-style: italic; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-Black-2b28ddda.otf") format("opentype");       font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Lotus Eden"; src: url("/assets/LotusEden-BlackItalic-46b81c8e.otf") format("opentype"); font-weight: 900; font-style: italic; font-display: swap; }

/* ===== Surgena (display do kit) ===== */
@font-face { font-family: "Surgena"; src: url("/assets/Surgena-6d24133d.ttf") format("truetype"); font-weight: 400 900; font-style: normal; font-display: swap; }


:root {
  /* Marca */
  --azul: #2946ED;
  --azul-soft: #4762F1;
  --laranja: #F98043;
  --laranja-soft: #FCA83A;
  --roxo: #A52B99;
  --marinho: #191956;
  --marinho-2: #0F0F3B;

  /* Neutros */
  --ink: #0E1230;
  --ink-2: #2A2F55;
  --muted: #6A6F8E;
  --line: #E4E2DC;
  --line-2: #EFEDE6;
  --bg: #F6F3EB;
  --surface: #FFFFFF;
  --surface-warm: #FBF9F2;
  --cream: #F1ECE0;

  /* Status */
  --ok: #1F8A5B;
  --warn: #B97511;
  --bad: #B43C30;

  /* Tipografia oficial: arquivos .otf/.ttf carregados via @font-face acima. */
  --f-serif: "Lotus Eden", "Newsreader", Georgia, serif;
  --f-sans: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  --f-display: "Surgena", "Big Shoulders Display", "Manrope", sans-serif;

  /* Gradientes */
  --grad-inst: linear-gradient(135deg, #361CF4 0%, #2946ED 45%, #191956 100%);
  --grad-energy: linear-gradient(135deg, #FCA83A 0%, #FF5B00 55%, #84066C 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

/* ============================================================
   App shell
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(41,70,237,0.45), transparent 60%),
    linear-gradient(180deg, #191956 0%, #0E0E3B 100%);
  color: #F4ECDE;
  padding: 22px 18px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.brand {
  padding: 6px 6px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand__row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand__mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  padding: 6px;
}
.brand__mark img { width: 100%; height: 100%; object-fit: contain; }
.brand__name {
  font-family: var(--f-serif);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #fff;
}
.brand__name em {
  color: var(--laranja);
  font-style: normal;
}
.brand__role {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244,236,222,0.6);
}
.brand__tagline {
  margin-top: 14px;
  font-family: var(--f-display);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--laranja-soft);
}

.nav { display: grid; gap: 4px; }
.nav__group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(244,236,222,0.4);
  padding: 14px 12px 6px;
}
.nav-link {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 8px;
  border-radius: 10px;
  color: rgba(244,236,222,0.78);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
}
.nav-link__icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  font-family: var(--f-display);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(244,236,222,0.85);
  transition: background 120ms, color 120ms;
}
.nav-link.is-active .nav-link__icon {
  background: var(--laranja);
  border-color: var(--laranja);
  color: #fff;
}
.nav-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-link.is-active {
  background: rgba(41,70,237,0.32);
  color: #fff;
  box-shadow: inset 2px 0 0 var(--laranja);
}
.nav-link__count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(249,128,67,0.18);
  color: var(--laranja-soft);
  padding: 2px 8px;
  border-radius: 999px;
}
.nav-link.is-active .nav-link__count { background: var(--laranja); color: #fff; }

.sidebar__user {
  margin-top: auto;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
}
.sidebar__user-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--grad-energy);
  display: grid; place-items: center;
  font-family: var(--f-display);
  color: #fff;
  font-size: 14px;
}
.sidebar__user-info { display: grid; line-height: 1.25; }
.sidebar__user-name { color: #fff; font-size: 13px; font-weight: 600; }
.sidebar__user-role { color: rgba(244,236,222,0.55); font-size: 11px; }

/* ============================================================
   Main content
   ============================================================ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 32px;
  background: var(--surface-warm);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.topbar__crumb {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.topbar__crumb b { color: var(--ink); font-weight: 700; }
.topbar__search {
  flex: 1;
  max-width: 420px;
  margin-left: auto;
  position: relative;
}
.topbar__search input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px 10px 38px;
  font-size: 14px;
  color: var(--ink);
}
.topbar__search input::placeholder { color: var(--muted); }
.topbar__search svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--muted);
}
.topbar__actions { display: flex; gap: 10px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  display: grid; place-items: center;
  color: var(--ink);
  position: relative;
}
.icon-btn .pip {
  position: absolute;
  top: 7px; right: 7px;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--laranja);
  border: 2px solid #fff;
}
.icon-btn svg { width: 18px; height: 18px; }

.content {
  padding: 28px 32px 60px;
  flex: 1;
}

/* Mobile bottom navigation bar (hidden on desktop) */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  gap: 2px;
  box-shadow: 0 -1px 20px rgba(0,0,0,0.07);
}
.mobile-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px 5px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 120ms, background 120ms;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  user-select: none;
}
.mobile-nav__item svg {
  width: 22px; height: 22px;
  flex-shrink: 0;
}
.mobile-nav__item.is-active { color: var(--azul); }
.mobile-nav__item.is-active svg { stroke-width: 2.4; }
.mobile-nav__item:active {
  background: rgba(41, 70, 237, 0.07);
  transform: scale(0.94);
  transition: transform 80ms;
}

/* ============================================================
   Page header
   ============================================================ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-head > div:first-child { min-width: 0; flex: 1 1 480px; }
.page-head__eyebrow {
  font-family: var(--f-display);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--laranja);
}
.page-head__title {
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: 46px;
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 6px 0 0;
  color: var(--ink);
  white-space: normal;
  text-wrap: pretty;
}
.page-head__title em {
  font-style: italic;
  color: var(--azul);
  font-weight: 500;
}
.page-head__sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  max-width: 560px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: filter 120ms, transform 80ms, background 120ms;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--azul);
  color: #fff;
  box-shadow: 0 4px 14px rgba(41,70,237,0.28);
}
.btn--primary:hover { background: #1F36C7; }
.btn--orange {
  background: var(--laranja);
  color: #fff;
  box-shadow: 0 4px 14px rgba(249,128,67,0.32);
}
.btn--orange:hover { filter: brightness(0.95); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover { background: var(--surface-warm); }
.btn--dark {
  background: var(--marinho);
  color: #fff;
}
.btn svg { width: 16px; height: 16px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}
.card--warm { background: var(--surface-warm); }
.card--dark {
  background: var(--marinho);
  color: #F4ECDE;
  border: 0;
}
.card--gradient {
  background: var(--grad-inst);
  color: #fff;
  border: 0;
}

/* Pillar colored cards */
.pillar {
  border-radius: 18px;
  padding: 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.pillar__head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pillar__chip {
  font-family: var(--f-display);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.16);
  padding: 4px 9px;
  border-radius: 999px;
}
.pillar__name {
  font-family: var(--f-serif);
  font-size: 26px;
  line-height: 1.1;
  font-weight: 600;
  margin: 14px 0 4px;
  letter-spacing: -0.01em;
}
.pillar__name em { font-style: italic; font-weight: 500; opacity: 0.88; }
.pillar__sub { font-size: 13px; opacity: 0.78; }
.pillar--servidores { background: linear-gradient(140deg, #2946ED 0%, #191956 100%); }
.pillar--esporte    { background: linear-gradient(140deg, #FCA83A 0%, #F98043 50%, #C7411A 100%); }
.pillar--cultura    { background: linear-gradient(140deg, #A52B99 0%, #5B0F70 100%); }
.pillar--link {
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}
.pillar--link:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(25, 25, 86, 0.18);
  filter: saturate(1.04);
}
.pillar--link:focus-visible {
  outline: 3px solid rgba(41,70,237,0.35);
  outline-offset: 3px;
}
.pillar__action {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.86;
}

.pillar__decoration {
  position: absolute;
  right: -32px; bottom: -32px;
  width: 160px; height: 160px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}
.pillar__stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.pillar__num {
  font-family: var(--f-serif);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
}
.pillar__delta { font-size: 12px; opacity: 0.85; }

/* KPI strip */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.kpi__label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.kpi__value {
  font-family: var(--f-serif);
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.kpi__foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.kpi__delta--up { color: var(--ok); font-weight: 700; }
.kpi__delta--down { color: var(--bad); font-weight: 700; }
.kpi__bar {
  margin-top: 6px;
  height: 4px;
  background: var(--line-2);
  border-radius: 999px;
  overflow: hidden;
}
.kpi__bar > span {
  display: block;
  height: 100%;
  background: var(--azul);
  border-radius: 999px;
}

/* Layout grids */
.row { display: grid; gap: 18px; }
.row--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.row--2-1 { grid-template-columns: 2fr 1fr; }
.row--1-1 { grid-template-columns: 1fr 1fr; }
.row--3-1 { grid-template-columns: 3fr 1fr; }
.row--2 { grid-template-columns: 1fr 1fr; }

/* Section header */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 16px;
}
.section-head h2 {
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.01em;
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.2;
}
.section-head__hint { color: var(--muted); font-size: 13px; white-space: nowrap; flex-shrink: 0; }

/* Filters bar */
.filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}
.filters .field { display: grid; gap: 4px; }
.filters label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.filters input,
.filters select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink);
  min-width: 0;
}
.filters input:focus,
.filters select:focus {
  outline: 2px solid rgba(41,70,237,0.22);
  border-color: var(--azul);
}

/* Tables */
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow-x: auto;
  overflow-y: hidden;
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-warm);
}
.table-toolbar__title {
  font-family: var(--f-serif);
  font-size: 20px;
  font-weight: 600;
}
.table-toolbar__title span { color: var(--muted); font-size: 13px; font-family: var(--f-sans); margin-left: 8px; }
.table-toolbar__right { display: flex; gap: 8px; align-items: center; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 12px 16px;
  background: var(--surface-warm);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  color: var(--ink-2);
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #FBF9F2; }

.cell-name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--f-display);
  flex-shrink: 0;
}
.avatar--blue { background: rgba(41,70,237,0.12); color: var(--azul); }
.avatar--orange { background: rgba(249,128,67,0.16); color: #B65124; }
.avatar--purple { background: rgba(165,43,153,0.12); color: var(--roxo); }
.avatar--marinho { background: var(--marinho); color: #fff; }

.name-primary { font-weight: 600; color: var(--ink); }
.name-secondary { font-size: 12px; color: var(--muted); }

/* Badges / status pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge .dot {
  width: 6px; height: 6px; border-radius: 999px; background: currentColor;
}
.badge--ok { background: rgba(31,138,91,0.12); color: var(--ok); }
.badge--warn { background: rgba(185,117,17,0.14); color: var(--warn); }
.badge--bad { background: rgba(180,60,48,0.12); color: var(--bad); }
.badge--neutral { background: var(--line-2); color: var(--muted); }
.badge--blue { background: rgba(41,70,237,0.10); color: var(--azul); }
.badge--orange { background: rgba(249,128,67,0.14); color: #B65124; }
.badge--purple { background: rgba(165,43,153,0.10); color: var(--roxo); }
.badge--marinho { background: var(--marinho); color: var(--laranja-soft); }

/* Activity / right rail */
.activity {
  display: grid;
  gap: 14px;
}
.activity__item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 12px;
  align-items: flex-start;
}
.activity__dot {
  width: 26px; height: 26px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}
.activity__dot--blue { background: rgba(41,70,237,0.14); color: var(--azul); }
.activity__dot--orange { background: rgba(249,128,67,0.18); color: #B65124; }
.activity__dot--purple { background: rgba(165,43,153,0.14); color: var(--roxo); }

.activity__text { font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.activity__text b { font-weight: 700; color: var(--ink); }
.activity__time { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Agenda list */
.agenda-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}
.agenda-item:last-child { border-bottom: 0; }
.agenda-date {
  text-align: center;
  font-family: var(--f-serif);
  line-height: 1;
}
.agenda-date .d { font-size: 28px; font-weight: 700; display: block; color: var(--ink); }
.agenda-date .m { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-family: var(--f-sans); font-weight: 600; }
.agenda-title { font-weight: 600; color: var(--ink); }
.agenda-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* Login */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.login__hero {
  background: var(--grad-inst);
  color: #fff;
  padding: 56px 56px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login__hero::before {
  content: "";
  position: absolute;
  inset: auto -120px -180px auto;
  width: 480px; height: 480px;
  background: radial-gradient(closest-side, var(--laranja) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}
.login__hero::after {
  content: "";
  position: absolute;
  inset: -120px -80px auto auto;
  width: 360px; height: 360px;
  background: radial-gradient(closest-side, var(--roxo) 0%, transparent 70%);
  opacity: 0.35;
  pointer-events: none;
}
.login__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}
.login__brand-mark {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: #fff;
  display: grid; place-items: center;
  padding: 10px;
}
.login__brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.login__brand-name {
  font-family: var(--f-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.login__brand-role {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-top: 4px;
}
.login__claim {
  position: relative;
  z-index: 2;
  max-width: 460px;
}
.login__quote {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-weight: 500;
}
.login__quote em {
  font-style: normal;
  color: var(--laranja-soft);
  font-weight: 600;
}
.login__sig {
  font-family: var(--f-display);
  font-size: 11px;
  letter-spacing: 0.22em;
  margin-top: 18px;
  color: var(--laranja-soft);
}
.login__pillars {
  display: flex;
  gap: 18px;
  position: relative;
  z-index: 2;
  margin-top: 32px;
}
.login__pillar {
  font-family: var(--f-display);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
}
.login__foot {
  font-size: 11px;
  letter-spacing: 0.12em;
  opacity: 0.6;
  position: relative;
  z-index: 2;
  text-transform: uppercase;
}
.login__form-wrap {
  display: grid;
  place-items: center;
  padding: 60px;
}
.login__form {
  width: 100%;
  max-width: 380px;
}
.login__h {
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: 38px;
  line-height: 1.05;
  margin: 0 0 6px;
}
.login__h em { font-style: italic; color: var(--azul); font-weight: 500; }
.login__sub {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 14px;
}
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}
.field label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.field input {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 14px;
  color: var(--ink);
}
.field input:focus {
  outline: 2px solid rgba(41,70,237,0.22);
  border-color: var(--azul);
}
.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 18px;
  font-size: 13px;
  color: var(--muted);
}
.checkbox-row label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-row a { color: var(--azul); font-weight: 600; }
.btn--block { width: 100%; justify-content: center; padding: 13px 18px; }
.login__alt {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Demandas kanban */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: flex-start;
}
.kanban__col {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  min-height: 400px;
}
.kanban__col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 12px;
}
.kanban__col-title {
  font-family: var(--f-serif);
  font-size: 17px;
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.kanban__col-title .swatch {
  width: 10px; height: 10px;
  border-radius: 3px;
}
.kanban__col-count {
  font-size: 11px;
  font-weight: 700;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 999px;
}
.kanban__cards { display: grid; gap: 10px; }
.kanban-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: grab;
  transition: box-shadow 120ms, transform 120ms;
  border-left: 3px solid transparent;
}
.kanban-card:hover {
  box-shadow: 0 6px 20px rgba(14,18,48,0.06);
  transform: translateY(-1px);
}
.kanban-card--alta { border-left-color: var(--laranja); }
.kanban-card--urgente { border-left-color: var(--bad); }
.kanban-card--media { border-left-color: var(--azul); }
.kanban-card--baixa { border-left-color: var(--muted); }
.kanban-card__title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  line-height: 1.3;
  color: var(--ink);
}
.kanban-card__meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.kanban-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

/* Mapa */
.mapa-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}
.mapa-canvas {
  background: var(--marinho);
  border-radius: 18px;
  color: #fff;
  padding: 20px;
  position: relative;
  overflow: hidden;
  min-height: 560px;
}
.mapa-canvas__title {
  font-family: var(--f-serif);
  font-size: 22px;
  font-weight: 600;
}
.mapa-canvas__sub {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244,236,222,0.55);
  margin-bottom: 12px;
}
.mapa-svg {
  width: 100%;
  height: auto;
  display: block;
}
.mapa-city {
  fill: var(--laranja);
  cursor: pointer;
  transition: r 120ms, fill 120ms, filter 120ms;
}
.mapa-city:hover { filter: brightness(1.2); }
.mapa-city--critical { fill: #FF5B00; }
.mapa-city--ok { fill: #57C97B; }
.mapa-city--warn { fill: var(--laranja-soft); }
.mapa-label {
  fill: #F4ECDE;
  font-size: 10px;
  font-family: var(--f-sans);
  font-weight: 600;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.mapa-legend {
  position: absolute;
  bottom: 16px; right: 16px;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; gap: 14px;
  font-size: 11px;
}
.mapa-legend .l { display: flex; align-items: center; gap: 6px; }
.mapa-legend .l .sw { width: 8px; height: 8px; border-radius: 999px; }

.mapa-side {
  display: grid;
  gap: 14px;
  align-content: start;
}
.coverage-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}
.coverage-card__name {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.coverage-card__name h4 {
  margin: 0;
  font-family: var(--f-serif);
  font-size: 18px;
  font-weight: 600;
}
.coverage-card__name span { font-size: 12px; color: var(--muted); }
.coverage-bar {
  height: 8px;
  background: var(--line-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.coverage-bar > span {
  display: block; height: 100%;
  background: var(--azul);
  border-radius: 999px;
}
.coverage-bar.is-warn > span { background: var(--laranja-soft); }
.coverage-bar.is-bad > span { background: var(--bad); }
.coverage-card__foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.coverage-card__foot b { color: var(--ink); font-weight: 700; }

/* Empty mini state */
.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
}

/* Utility */
.muted { color: var(--muted); }
.right { margin-left: auto; }
.divider { height: 1px; background: var(--line-2); margin: 12px 0; }
.spacer-y-l { height: 28px; }

.scroll-x { overflow-x: auto; }

/* Sort caret */
.sort-caret { opacity: 0.4; margin-left: 4px; font-size: 9px; }
.th-sortable { cursor: pointer; user-select: none; }
.th-sortable:hover { color: var(--ink); }
.th-sortable.is-active .sort-caret { opacity: 1; color: var(--azul); }

/* Footer */
.legal {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.legal__brand {
  font-family: var(--f-display);
  letter-spacing: 0.14em;
  color: var(--marinho);
}

/* Mini chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  margin-top: 8px;
}
.bar-chart .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--azul-soft), var(--azul));
  border-radius: 4px 4px 0 0;
  min-height: 6px;
  position: relative;
}
.bar-chart .bar--accent { background: linear-gradient(180deg, var(--laranja-soft), var(--laranja)); }
.bar-chart-labels {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.bar-chart-labels span {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}

/* Donut */
.donut {
  --p: 50;
  --c1: var(--azul);
  --c2: var(--laranja);
  --c3: var(--roxo);
  width: 120px; height: 120px;
  border-radius: 999px;
  background:
    conic-gradient(var(--c1) 0 calc(var(--p1) * 1%),
                    var(--c2) calc(var(--p1) * 1%) calc((var(--p1) + var(--p2)) * 1%),
                    var(--c3) calc((var(--p1) + var(--p2)) * 1%) 100%);
  display: grid; place-items: center;
  position: relative;
}
.donut::before {
  content: "";
  position: absolute;
  inset: 14px;
  background: #fff;
  border-radius: 999px;
}
.donut__label {
  position: relative;
  text-align: center;
  font-family: var(--f-serif);
}
.donut__label .v { display: block; font-size: 24px; font-weight: 700; line-height: 1; }
.donut__label .s { display: block; font-size: 10px; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; margin-top: 4px; font-family: var(--f-sans); font-weight: 600; }

/* ============================================================
   App-specific additions (não fazem parte do kit de design)
   ============================================================ */

/* Density tweaks (body[data-density="compact"]) */
[data-density="compact"] .content { padding: 20px 24px 40px; }
[data-density="compact"] .kpi { padding: 14px 14px 12px; }
[data-density="compact"] table.data td { padding: 10px 12px; }
[data-density="compact"] table.data th { padding: 9px 12px; }
[data-density="compact"] .card { padding: 16px; }
[data-density="compact"] .page-head__title { font-size: 38px; }
[data-density="compact"] .kanban__col { min-height: 320px; }

/* Flash messages */
.flash-stack { position: fixed; top: 16px; right: 16px; z-index: 50; display: grid; gap: 10px; max-width: 360px; }
.flash { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--azul); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); box-shadow: 0 8px 24px rgba(14,18,48,0.10); }
.flash strong { color: var(--ink); font-weight: 700; }
.flash--notice { border-left-color: var(--ok); }
.flash--alert, .flash--error { border-left-color: var(--bad); }

/* Form errors */
.form-errors { background: rgba(180,60,48,0.06); border: 1px solid rgba(180,60,48,0.22); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; color: var(--bad); font-size: 13px; }
.form-errors h3 { margin: 0 0 8px; font-size: 14px; }
.form-errors ul { margin: 0; padding-left: 18px; }

/* Forms (alinhados ao kit) */
.form-card { max-width: 760px; }
.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.form-card label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; display: block; margin-bottom: 6px; }
.form-card input[type=text], .form-card input[type=email], .form-card input[type=password],
.form-card input[type=number], .form-card input[type=date], .form-card input[type=tel],
.form-card select, .form-card textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 11px 14px; font-size: 14px; color: var(--ink);
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus { outline: 2px solid rgba(41,70,237,0.22); border-color: var(--azul); }

/* Mapa — campo de bolhas por município */
.bubble-field {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center;
  padding: 24px 12px; min-height: 420px; align-content: center;
}
.bubble {
  border: 2px solid rgba(255,255,255,0.65); border-radius: 999px; color: #fff;
  display: grid; place-items: center; text-align: center; padding: 4px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25); transition: transform 120ms, box-shadow 120ms;
  line-height: 1.05;
}
.bubble:hover { transform: translateY(-2px) scale(1.04); }
.bubble.is-selected { outline: 3px solid var(--laranja); outline-offset: 2px; }
.bubble__name { font-size: 11px; font-weight: 700; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
.bubble__pct { font-family: var(--f-serif); font-size: 13px; font-weight: 700; }

/* Agenda — barra de controle, calendário e legenda */
.agenda-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.seg-toggle { display: flex; gap: 6px; background: #fff; border: 1px solid var(--line); padding: 4px; border-radius: 12px; }
.agenda-monthnav { display: flex; gap: 12px; align-items: center; }

.calendar-card { padding: 0; overflow: hidden; }
.calendar__dow { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-warm); border-bottom: 1px solid var(--line); }
.calendar__dow > div { padding: 12px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 700; border-right: 1px solid var(--line); }
.calendar__dow > div:last-child { border-right: 0; }
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar__cell { min-height: 110px; padding: 8px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); background: #fff; }
.calendar__cell.is-empty { background: var(--surface-warm); opacity: 0.5; }
.calendar__cell.is-today { background: var(--surface-warm); }
.calendar__day { font-family: var(--f-serif); font-size: 18px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.calendar__cell.is-today .calendar__day { color: var(--azul); font-weight: 700; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: rgba(41,70,237,0.10); }
.calendar__events { display: grid; gap: 3px; }
.cal-event { display: block; padding: 3px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event b { opacity: 0.7; font-weight: 700; }
.cal-more { font-size: 10px; color: var(--muted); font-weight: 600; padding: 0 6px; }

.agenda-legend { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding: 12px 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; }
.agenda-legend__item { display: inline-flex; align-items: center; gap: 8px; }
.agenda-legend__item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Kanban — estados de drag-and-drop */
.kanban__cards { min-height: 60px; }
.kanban-card.is-dragging { opacity: 0.5; }
.kanban__col.is-over { outline: 2px dashed var(--azul); outline-offset: -4px; background: rgba(41,70,237,0.04); }
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card[draggable="true"]:active { cursor: grabbing; }

/* Dropdown de ações (details/summary nativo) */
.dropdown { position: relative; display: inline-block; }
.dropdown__trigger {
  list-style: none; cursor: pointer; width: 30px; height: 30px;
  display: inline-grid; place-items: center; border-radius: 8px;
  color: var(--muted); font-size: 18px; line-height: 1; user-select: none;
}
.dropdown__trigger::-webkit-details-marker { display: none; }
.dropdown__trigger:hover { background: var(--surface-warm); color: var(--ink); }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 500;
  min-width: 160px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 6px; display: grid; gap: 2px;
  box-shadow: 0 8px 24px rgba(14,18,48,0.10);
}
.dropdown__menu a {
  display: block; padding: 8px 10px; border-radius: 8px; font-size: 13px;
  font-weight: 500; color: var(--ink-2);
}
.dropdown__menu a:hover { background: var(--surface-warm); color: var(--ink); }

/* ============================================================
   Mapa de Votos — SVG geographic map
   ============================================================ */

/* State polygon */
.mapa-state {
  fill: rgba(255,255,255,0.04);
  stroke: rgba(255,255,255,0.22);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

/* Connection lines from capital */
.mapa-connection {
  stroke: rgba(255,255,255,0.10);
  stroke-width: 1;
  stroke-dasharray: 5 5;
  pointer-events: none;
}

/* City group */
.mapa-city-group {
  cursor: pointer;
}
.mapa-city-group:focus { outline: none; }

/* Selection ring */
.mapa-city-ring {
  opacity: 0;
  transition: opacity 200ms;
  stroke-dasharray: 4 3;
}
.mapa-city-group.is-selected .mapa-city-ring { opacity: 1; }

/* City dot */
.mapa-city-dot {
  transition: filter 120ms, r 120ms;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
.mapa-city-group:hover .mapa-city-dot { filter: brightness(1.18) drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }

/* City label */
.mapa-label {
  font-family: var(--f-sans);
  font-size: 11px;
  font-weight: 600;
  fill: rgba(244,236,222,0.88);
  letter-spacing: 0.03em;
  pointer-events: none;
}
.mapa-city-group.is-selected .mapa-label { fill: #fff; }

/* Ranking rows */
.rank-row {
  padding: 9px 0;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  transition: background 100ms;
  border-radius: 6px;
  padding-left: 6px;
  padding-right: 6px;
}
.rank-row:last-child { border-bottom: 0; }
.rank-row:hover { background: var(--surface-warm); }
.rank-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}
.rank-row__name { font-size: 13px; font-weight: 500; color: var(--ink); }
.rank-row__pct  { font-family: var(--f-serif); font-size: 13px; font-weight: 700; color: var(--ink); }
.rank-row__tracks { display: grid; gap: 3px; }
.rank-track {
  height: 4px;
  background: var(--line-2);
  border-radius: 999px;
  overflow: hidden;
}
.rank-track__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 300ms ease;
}
.rank-track__fill--blue   { background: var(--azul); }
.rank-track__fill--orange { background: var(--laranja-soft); }

/* ============================================================
   Dashboard redesign additions
   ============================================================ */

/* Taller growth bar chart */
.dash-growth-chart {
  height: 150px;
  gap: 5px;
}

/* Donut – large variant */
.donut--lg {
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}
.donut--lg::before { inset: 22px; }
.donut--lg .donut__label .v { font-size: 28px; }

/* Donut row (chart bottom section) */
.dash-donut-row {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
}

/* Pillar legend beside donut */
.dash-pillar-legend {
  display: grid;
  gap: 12px;
  flex: 1;
}
.dash-legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.dash-legend-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.dash-legend-dot--servidores { background: var(--azul); }
.dash-legend-dot--esporte    { background: var(--laranja); }
.dash-legend-dot--cultura    { background: var(--roxo); }
.dash-legend-name { color: var(--ink-2); font-weight: 500; min-width: 0; }
.dash-legend-val  { font-weight: 700; color: var(--ink); font-family: var(--f-serif); font-size: 15px; }
.dash-legend-pct  { color: var(--muted); font-size: 12px; min-width: 36px; text-align: right; }

/* City row (compact, no footer line) */
.city-row {
  margin-bottom: 13px;
}
.city-row:last-child { margin-bottom: 0; }
.city-row .coverage-card__name h4 {
  font-family: var(--f-sans);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.city-row .coverage-bar { margin-top: 5px; height: 6px; }

/* Pagination (Pagy) */
.pagy { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.pagy a, .pagy span { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pagy a:hover { background: var(--surface-warm); }
.pagy .current, .pagy a[aria-current="page"] { background: var(--azul); border-color: var(--azul); color: #fff; }
.pagy .gap { border: 0; background: transparent; }

/* ============================================================
   Eleitores form/show refinements
   ============================================================ */
.eleitor-form__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.eleitor-form__main {
  display: grid;
  gap: 18px;
}
.eleitor-form .field {
  margin-bottom: 0;
}
.eleitor-form .field--span-2 {
  grid-column: 1 / -1;
}
.eleitor-form textarea {
  min-height: 132px;
  resize: vertical;
}
.eleitor-form__aside {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 18px;
}
.eleitor-form__summary {
  display: grid;
  gap: 12px;
}
.eleitor-form__summary h2 {
  margin: 0;
  font-family: var(--f-serif);
  font-size: 28px;
  line-height: 1.05;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.eleitor-form__summary p {
  margin: 0;
  color: rgba(244,236,222,0.68);
  font-size: 13px;
}
.eleitor-form__avatar,
.eleitor-profile__avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 800;
  background: rgba(255,255,255,0.12);
  color: var(--laranja-soft);
}
.eleitor-form__chips,
.eleitor-profile__chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.eleitor-form__tips h3 {
  margin: 0 0 8px;
  font-family: var(--f-serif);
  font-size: 22px;
  font-weight: 600;
}
.eleitor-form__tips p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.eleitor-form__actions {
  display: grid;
  gap: 10px;
}
.eleitor-form__actions .btn {
  justify-content: center;
}
.eleitor-show-head .page-head__title {
  white-space: normal;
}
.eleitor-profile {
  display: grid;
  gap: 18px;
}
.eleitor-profile__hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 320px);
  gap: 18px;
  align-items: center;
}
.eleitor-profile__identity {
  min-width: 0;
}
.eleitor-profile__eyebrow {
  font-family: var(--f-display);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--laranja-soft);
  margin-bottom: 8px;
}
.eleitor-profile__identity h2 {
  margin: 0 0 12px;
  font-family: var(--f-serif);
  font-size: 36px;
  line-height: 1.05;
  font-weight: 600;
  color: #fff;
  overflow-wrap: anywhere;
}
.eleitor-profile__quick {
  display: grid;
  gap: 10px;
}
.eleitor-profile__quick > div {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.06);
}
.eleitor-profile__quick span,
.eleitor-detail span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 5px;
}
.eleitor-profile__quick span {
  color: rgba(244,236,222,0.62);
}
.eleitor-profile__quick strong {
  display: block;
  color: #fff;
  overflow-wrap: anywhere;
}
.eleitor-profile__kpis .kpi__value {
  font-size: 28px;
  overflow-wrap: anywhere;
}
.eleitor-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.eleitor-detail {
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 13px 14px;
  background: #fff;
  min-width: 0;
}
.eleitor-detail strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.eleitor-territory {
  display: grid;
  gap: 8px;
}
.eleitor-territory strong {
  font-family: var(--f-serif);
  font-size: 28px;
  line-height: 1;
}
.eleitor-territory span {
  color: var(--azul);
  font-weight: 700;
}
.eleitor-territory p {
  margin: 4px 0 10px;
  color: var(--muted);
  line-height: 1.5;
}
.eleitor-notes__body {
  color: var(--ink-2);
  line-height: 1.6;
}
.eleitor-notes__body p {
  margin: 0;
}

@media (max-width: 1080px) {
  .eleitor-form__layout,
  .eleitor-profile__hero,
  .eleitor-profile__body {
    grid-template-columns: 1fr;
  }
  .eleitor-form__aside {
    position: static;
  }
}

@media (max-width: 720px) {
  .eleitor-form .form-row,
  .eleitor-detail-grid {
    grid-template-columns: 1fr;
  }
  .eleitor-profile__identity h2 {
    font-size: 30px;
  }
  .eleitor-form__summary h2,
  .eleitor-territory strong {
    font-size: 24px;
  }
}

/* ============================================================
   Record forms/show shared refinements
   ============================================================ */
.record-form__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
.record-form__main,
.record-form__aside,
.record-show {
  display: grid;
  gap: 18px;
}
.record-form .field { margin-bottom: 0; }
.record-form .field--span-2 { grid-column: 1 / -1; }
.record-form textarea { min-height: 124px; resize: vertical; }
.record-form__aside { position: sticky; top: 18px; }
.record-summary { display: grid; gap: 12px; }
.record-summary__mark {
  width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center;
  font-family: var(--f-display); font-size: 22px; font-weight: 800;
  background: rgba(255,255,255,0.12); color: var(--laranja-soft);
}
.record-summary h2 { margin: 0; font-family: var(--f-serif); font-size: 27px; line-height: 1.05; font-weight: 600; overflow-wrap: anywhere; }
.record-summary p { margin: 0; color: rgba(244,236,222,0.68); font-size: 13px; line-height: 1.45; }
.record-summary__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.record-tips h3 { margin: 0 0 8px; font-family: var(--f-serif); font-size: 21px; font-weight: 600; }
.record-tips p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.record-form__actions { display: grid; gap: 10px; }
.record-form__actions .btn { justify-content: center; }
.record-show-head .page-head__title { white-space: normal; }
.record-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(220px, 320px); gap: 18px; align-items: center; }
.record-hero__mark {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  font-family: var(--f-display); font-size: 24px; font-weight: 800;
  background: rgba(255,255,255,0.12); color: var(--laranja-soft);
}
.record-hero__eyebrow { font-family: var(--f-display); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--laranja-soft); margin-bottom: 8px; }
.record-hero h2 { margin: 0 0 12px; font-family: var(--f-serif); font-size: 36px; line-height: 1.05; font-weight: 600; color: #fff; overflow-wrap: anywhere; }
.record-hero__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.record-hero__quick { display: grid; gap: 10px; }
.record-hero__quick > div { border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; padding: 12px; background: rgba(255,255,255,0.06); }
.record-hero__quick span,
.record-detail span { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.record-hero__quick span { color: rgba(244,236,222,0.62); }
.record-hero__quick strong { display: block; color: #fff; overflow-wrap: anywhere; }
.record-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.record-detail { border: 1px solid var(--line-2); border-radius: 12px; padding: 13px 14px; background: #fff; min-width: 0; }
.record-detail strong { display: block; color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.record-notes__body { color: var(--ink-2); line-height: 1.6; }
.record-notes__body p { margin: 0; }

@media (max-width: 1080px) {
  .record-form__layout,
  .record-hero,
  .record-show .row--2-1 { grid-template-columns: 1fr; }
  .record-form__aside { position: static; }
}
@media (max-width: 720px) {
  .record-form .form-row,
  .record-detail-grid { grid-template-columns: 1fr; }
  .record-hero h2 { font-size: 30px; }
  .record-summary h2 { font-size: 24px; }
}

/* ============================================================
   Responsive app shell
   ============================================================ */

/* 1180px — sidebar comprime */
@media (max-width: 1180px) {
  .app {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .row--3, .row--3-1, .row--2-1, .mapa-grid {
    grid-template-columns: 1fr;
  }
  .kanban {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* 900px — sidebar vira ícone-only slim */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .sidebar {
    padding: 14px 8px;
    gap: 8px;
    overflow: visible;
    align-items: center;
    border-right: 1px solid rgba(255,255,255,0.05);
  }

  .brand {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .brand__row { justify-content: center; }
  .brand__name, .brand__role, .brand__tagline { display: none; }
  .brand__mark { width: 38px; height: 38px; border-radius: 10px; }

  .nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
  }

  .nav__group-label { display: none; }

  .nav-link {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 9px 4px;
    border-radius: 10px;
    position: relative;
  }

  .nav-link > span:not(.nav-link__icon):not(.nav-link__count) { display: none; }

  .nav-link__icon {
    width: 36px; height: 36px;
    margin: 0;
  }

  .nav-link__count {
    position: absolute;
    top: 4px; right: 2px;
    padding: 1px 4px;
    font-size: 8px;
    border-radius: 999px;
  }

  .sidebar__user {
    margin-top: auto;
    padding: 8px 4px;
    border-radius: 10px;
    flex-direction: column;
    gap: 5px;
    align-items: center;
  }

  .sidebar__user-info { display: none; }
  .sidebar__user-avatar { width: 32px; height: 32px; border-radius: 8px; font-size: 12px; }

  .topbar {
    padding: 14px 18px;
  }
  .topbar__search { max-width: 280px; }

  .content { padding: 20px 18px 44px; }

  .page-head__title { font-size: 36px; }

  .row--2, .row--1-1, .form-row, .dash-donut-row, .legal {
    grid-template-columns: 1fr;
  }
  .dash-donut-row, .legal { display: grid; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .section-head__hint { white-space: normal; }
}

/* 640px — mobile: sidebar escondida, bottom nav */
@media (max-width: 640px) {
  body { font-size: 14px; }

  .app {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    min-height: 100dvh;
  }

  .sidebar { display: none; }
  .mobile-nav { display: flex; }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 11px 14px;
    gap: 10px;
    flex-wrap: wrap;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(251, 249, 242, 0.94);
    border-bottom: 1px solid var(--line);
  }

  .topbar__crumb {
    flex: 1 1 auto;
    font-size: 11px;
    letter-spacing: 0.1em;
  }

  .topbar__search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
  }

  .topbar__search input {
    border-radius: 12px;
    padding: 10px 14px 10px 36px;
    font-size: 14px;
  }

  .topbar__actions { gap: 8px; }

  .icon-btn { width: 36px; height: 36px; border-radius: 10px; }

  .content {
    padding: 16px 14px calc(80px + env(safe-area-inset-bottom, 0px));
    flex: 1;
  }

  /* Page header */
  .page-head { gap: 12px; margin-bottom: 16px; }
  .page-head > div:first-child { flex-basis: 100%; }
  .page-head__eyebrow { font-size: 9px; letter-spacing: 0.13em; }
  .page-head__title { font-size: 26px; line-height: 1.08; margin-top: 4px; }
  .page-head__sub { font-size: 13px; line-height: 1.45; margin-top: 6px; }
  .page-head > div:last-child { width: 100%; gap: 8px !important; flex-wrap: wrap; }

  /* Buttons */
  .btn, .table-toolbar__right .btn, .form-actions .btn {
    min-height: 38px; padding: 9px 14px;
    border-radius: 10px; font-size: 13px; white-space: normal; width: auto;
  }
  .page-head .btn, .form-actions .btn,
  .record-form__actions .btn, .eleitor-form__actions .btn, .btn--block {
    width: 100%; justify-content: center;
  }

  /* Cards */
  .card, .pillar { border-radius: 16px; padding: 16px; }
  .table-card, .coverage-card, .calendar-card { border-radius: 16px; }

  /* Grids */
  .row, .kpis, .activity,
  .eleitor-form__main, .record-form__main,
  .record-form__aside, .record-show { gap: 10px; }

  .row--2, .row--1-1, .row--3, .row--3-1, .row--2-1,
  .form-row, .dash-donut-row, .legal, .mapa-grid { grid-template-columns: 1fr; }
  .dash-donut-row, .legal { display: grid; }

  /* KPIs */
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 14px !important;
  }
  .kpi { padding: 13px; border-radius: 14px; gap: 5px; }
  .kpi__label { font-size: 9px; letter-spacing: 0.1em; line-height: 1.2; }
  .kpi__value { font-size: 26px; }
  .kpi__foot { font-size: 11px; }

  /* Pillars */
  .pillar { min-height: 150px; }
  .pillar__chip, .pillar__action { font-size: 9px; }
  .pillar__name { font-size: 22px; margin-top: 10px; }
  .pillar__sub { font-size: 12px; }
  .pillar__num { font-size: 34px; }
  .pillar__decoration { width: 110px; height: 110px; }

  /* Section heads */
  .section-head { gap: 4px; margin-bottom: 12px; align-items: flex-start; flex-direction: column; }
  .section-head h2, .table-toolbar__title { font-size: 18px; }
  .section-head__hint { font-size: 12px; white-space: normal; }

  /* Filters */
  .filters {
    grid-template-columns: 1fr !important;
    gap: 8px; padding: 12px; border-radius: 14px; margin-bottom: 12px;
  }
  .filters .field, .field { gap: 4px; margin-bottom: 10px; }
  .filters label, .field label, .form-card label { font-size: 9px; letter-spacing: 0.1em; }
  .filters input, .filters select,
  .field input,
  .form-card input[type=text], .form-card input[type=email],
  .form-card input[type=password], .form-card input[type=number],
  .form-card input[type=date], .form-card input[type=tel],
  .form-card select, .form-card textarea {
    border-radius: 10px; padding: 10px 12px; font-size: 14px;
  }
  .form-card, .form-grid, .record-form__layout, .eleitor-form__layout { gap: 10px; }
  .form-card textarea, .record-form textarea, .eleitor-form textarea { min-height: 96px; }

  /* Tables */
  .table-toolbar { gap: 8px; padding: 12px 14px; }
  .table-toolbar, .table-toolbar__right, .form-actions, .agenda-bar, .agenda-monthnav {
    align-items: stretch; flex-direction: column;
  }
  .table-toolbar__right { display: flex; flex-direction: column; gap: 8px; }
  table.data { font-size: 13px; min-width: 700px; }
  table.data th, table.data td { padding: 10px 12px; }
  .badge { padding: 3px 8px; font-size: 10px; }

  /* Agenda */
  .agenda-item { gap: 8px; padding: 10px 0; }
  .agenda-date .d { font-size: 24px; }

  /* Activity */
  .activity__item { gap: 7px; }
  .activity__dot { width: 26px; height: 26px; }
  .activity__time { white-space: normal; }

  /* Donut */
  .dash-donut-row { gap: 14px; margin-top: 12px; padding-top: 12px; }
  .donut--lg { width: 130px; height: 130px; justify-self: center; }
  .donut--lg::before { inset: 18px; }
  .dash-legend-item { grid-template-columns: 10px minmax(0,1fr) auto; gap: 8px; }
  .dash-legend-pct { display: none; }

  /* Record hero */
  .record-hero, .eleitor-profile__hero { gap: 12px; }
  .record-hero__mark, .eleitor-profile__avatar, .eleitor-form__avatar {
    width: 52px; height: 52px; border-radius: 14px; font-size: 20px;
  }
  .record-hero h2, .eleitor-profile__identity h2 { font-size: 26px; }
  .record-detail, .eleitor-detail { padding: 10px 12px; border-radius: 10px; }
  .record-summary h2, .eleitor-form__summary h2 { font-size: 22px; }

  /* Map */
  .mapa-canvas { min-height: 380px; padding: 14px; }
  .mapa-legend { position: static; margin-top: 12px; flex-wrap: wrap; }

  /* Calendar */
  .calendar-card { overflow-x: auto; }
  .calendar__dow, .calendar__grid { min-width: 720px; }

  /* Flash */
  .flash-stack { left: 12px; right: 12px; max-width: none; }

  /* Kanban */
  .kanban { grid-template-columns: 1fr; }

  /* Login */
  .login { grid-template-columns: 1fr; }
  .login__hero { min-height: auto; padding: 24px 18px; gap: 20px; }
  .login__quote { font-size: 32px; }
  .login__pillars, .login__foot { display: none; }
  .login__form-wrap { padding: 24px 18px 32px; place-items: start stretch; }
  .login__h { font-size: 30px; }
}

/* 390px — telas muito pequenas */
@media (max-width: 390px) {
  .kpis { grid-template-columns: 1fr; }
  .page-head__title { font-size: 22px; }
}

