/* ============================================================
   Portal PDD — Design System
   Linguagem visual inspirada no Claude: fundo neutro quente,
   bordas finas em vez de sombra pesada, cantos generosos,
   tipografia calma. Identidade PDD (vermelho + dourado) preservada.
   ============================================================ */
:root {
  --primary: #C8102E;
  --primary-dark: #8A0B20;
  --primary-soft: #FBEAEC;
  --accent: #D97757;
  --accent-dark: #B85C3F;
  --accent-soft: #F5E4DA;
  --gold: #C89116;
  --gold-soft: #F7EFDA;
  --estat: #6B4C8A;
  --estat-soft: #F1EBF7;
  --good: #21895E;
  --good-soft: #E8F3EC;
  --alert: #C1443A;
  --alert-soft: #F8E9E7;
  --ink: #26221C;
  --muted: #6F6A5E;
  --line: #E7E2D6;
  --line-strong: #D8D2C2;
  --card: #F0ECE1;
  --cream: #F7F4EA;
  --surface: #FFFFFF;
  --bg: #F7F5EE;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(38,34,28,0.05);
  --shadow-lg: 0 2px 4px rgba(38,34,28,0.06), 0 8px 20px rgba(38,34,28,0.06);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.1px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== CONVOCAÇÃO BANNER ===== */
.convocacao {
  background: var(--primary);
  color: white;
  padding: 9px 0;
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}
.convocacao.urgente { background: var(--alert); animation: pulse-bg 1.4s ease-in-out infinite; }
@keyframes pulse-bg { 50% { filter: brightness(1.1); } }
.convocacao-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.convocacao-msg {
  font-weight: 600; letter-spacing: 0.2px; font-size: 14px;
}
.msg-imperativo { color: var(--gold-soft); }
.cronometro {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px; font-weight: 600;
  background: rgba(255,255,255,0.14); padding: 5px 12px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.2);
}
.cronometro.urgente { color: var(--gold-soft); border-color: rgba(255,255,255,0.4); }

/* ===== HEADER ===== */
.hdr {
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 41px; z-index: 50;
}
.hdr-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 24px;
}
.logo { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-mark {
  font-weight: 800; color: white;
  background: var(--primary); padding: 5px 10px; border-radius: var(--radius-sm);
  font-size: 15px; letter-spacing: 0.5px;
}
.logo-sub { color: var(--muted); font-size: 12px; }
.nav { display: flex; gap: 2px; flex: 1; align-items: center; }
.nav a, .nav button {
  color: var(--ink); padding: 8px 12px; border-radius: var(--radius-sm);
  font-weight: 500; font-size: 14px;
}
.nav a:hover, .nav button:hover { background: var(--card); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.user-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); padding: 6px 14px; border-radius: 999px;
  font-size: 13px; cursor: pointer; border: 1px solid transparent;
}
.user-badge:hover { border-color: var(--line-strong); }
.user-badge .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}

/* ===== APP / CONTAINERS ===== */
.app {
  max-width: 1120px; margin: 0 auto; padding: 32px 20px 72px;
  min-height: 60vh;
}
.loading {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
h1 { font-size: 27px; font-weight: 700; margin: 0 0 10px; color: var(--ink); letter-spacing: -0.2px; }
h2 { font-size: 19px; font-weight: 700; margin: 0 0 12px; color: var(--ink); }
h3 { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.section-sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }

/* ===== CARDS ===== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 14px;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--line-strong); }
.card-accent { border-left: 3px solid var(--gold); }
.card-primary { border-left: 3px solid var(--primary); }
.card-estat { border-left: 3px solid var(--estat); background: var(--estat-soft); }

.card-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.card-title { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.card-meta { font-size: 12px; color: var(--muted); }

/* ===== BOTÕES ===== */
.btn {
  display: inline-block; padding: 10px 20px;
  border-radius: 999px; border: 1px solid var(--primary);
  background: var(--primary); color: white; font-weight: 600;
  cursor: pointer; font-size: 14px; transition: all 0.15s;
  font-family: inherit; text-decoration: none;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--card); }
.btn-accent { background: var(--accent); color: white; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { background: var(--alert); border-color: var(--alert); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-lg { padding: 13px 26px; font-size: 15px; }

/* ===== FORMULÁRIOS ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink); }
.form-control {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--ink);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-error { color: var(--alert); font-size: 13px; margin-top: 8px; }

/* ===== LOGIN ===== */
.login-wrap {
  max-width: 420px; margin: 40px auto;
}
.login-card {
  background: var(--surface); padding: 32px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); border-top: 3px solid var(--primary);
}
.login-card h1 { text-align: center; margin-bottom: 24px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab {
  flex: 1; padding: 12px; text-align: center; cursor: pointer;
  font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== PAUTAS / FEED ===== */
.pauta-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  margin-bottom: 14px; box-shadow: var(--shadow);
  border-top: 3px solid var(--gold);
  display: block; color: inherit; text-decoration: none;
  transition: border-color 0.15s;
}
.pauta-card:hover { border-color: var(--line-strong); text-decoration: none; }
.pauta-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.pauta-titulo { font-weight: 700; color: var(--ink); font-size: 16px; flex: 1; min-width: 200px; }
.pauta-descricao { color: var(--ink); font-size: 14px; margin: 8px 0 12px; line-height: 1.5; }
.pauta-footer { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.pauta-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.7;
  background: var(--card); color: var(--ink);
}
.tag-primary { background: var(--primary); color: white; }
.tag-accent { background: var(--gold-soft); color: #6B4E0C; }
.tag-good { background: var(--good-soft); color: var(--good); }
.tag-alert { background: var(--alert-soft); color: var(--alert); }
.tag-estat { background: var(--estat); color: white; }
.tag-muted { background: var(--card); color: var(--muted); }
.tag-nivel { background: var(--primary-dark); color: white; }

/* ===== PAUTA DETALHE ===== */
.pauta-detail .section {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  margin-bottom: 14px; box-shadow: var(--shadow);
}
.gate-wrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 640px) { .gate-wrap { grid-template-columns: 1fr; } }
.gate-side {
  padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.gate-side.pro { background: var(--good-soft); border-color: #B9DBC7; }
.gate-side.contra { background: var(--alert-soft); border-color: #E7BEB8; }
.gate-label { font-weight: 700; margin-bottom: 8px; font-size: 14px; }
.gate-side.pro .gate-label { color: var(--good); }
.gate-side.contra .gate-label { color: var(--alert); }
.gate-progress {
  background: var(--surface); border-radius: 999px; height: 8px; margin-top: 12px; overflow: hidden;
  border: 1px solid var(--line);
}
.gate-progress-fill {
  height: 100%; background: var(--good); transition: width 0.3s;
}
.gate-side.contra .gate-progress-fill { background: var(--alert); }
.gate-status {
  text-align: center; padding: 16px; margin-top: 16px;
  border-radius: var(--radius-sm); font-weight: 600;
}
.gate-status.incompleto { background: var(--card); color: var(--muted); }
.gate-status.completo { background: var(--good); color: white; }

.voto-buttons {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 16px;
}
.voto-btn {
  padding: 18px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; font-weight: 700; font-size: 16px;
  font-family: inherit; transition: all 0.15s;
}
.voto-btn:not(:disabled):hover { border-color: var(--primary); background: var(--card); }
.voto-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.voto-btn.sim { color: var(--good); }
.voto-btn.sim:not(:disabled):hover { border-color: var(--good); background: var(--good-soft); }
.voto-btn.nao { color: var(--alert); }
.voto-btn.nao:not(:disabled):hover { border-color: var(--alert); background: var(--alert-soft); }
.voto-btn.abster { color: var(--muted); }
.voto-btn.selecionado { background: var(--primary); color: white; border-color: var(--primary); }

.video-frame {
  background: #1c1a15; border-radius: var(--radius-sm); aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
  color: white; cursor: pointer; position: relative; overflow: hidden;
  margin-bottom: 12px;
}
.video-frame .play-icon {
  font-size: 48px; opacity: 0.85;
}
.video-frame.consumido { border: 2px solid var(--good); }

/* ===== COFRE DE VIDRO ===== */
.cofre-resumo {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  border-left: 3px solid var(--gold); box-shadow: var(--shadow);
}
.kpi-value { font-size: 27px; font-weight: 800; color: var(--ink); }
.kpi-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table.data {
  width: 100%; border-collapse: collapse; background: var(--surface);
  font-size: 13px;
}
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { background: var(--card); color: var(--ink); font-weight: 700; font-size: 12px; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover { background: var(--cream); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .neg { color: var(--good); font-weight: 600; }
table.data .pos { color: var(--alert); font-weight: 600; }
.hash { font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); }

/* ===== REGIÕES ===== */
.regiao-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.regiao-card {
  background: var(--surface); padding: 20px; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  display: block; color: inherit; text-decoration: none;
  transition: border-color 0.15s;
}
.regiao-card:hover { border-color: var(--line-strong); text-decoration: none; }
.regiao-numero { font-size: 23px; font-weight: 800; color: var(--ink); }
.regiao-uf { display: inline-block; padding: 2px 9px; background: var(--gold-soft); color: #6B4E0C;
            font-size: 11px; font-weight: 700; border-radius: 999px; vertical-align: middle; }
.regiao-stats { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--muted); }

/* ===== MANDATÁRIOS ===== */
.mandatario-card {
  display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line);
  padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 3px solid var(--primary);
}
.mandatario-foto {
  width: 64px; height: 64px; border-radius: 50%; background: var(--card);
}
.mandatario-info { flex: 1; }
.fidelidade-bar {
  background: var(--card); border-radius: 999px; height: 6px; margin-top: 6px; overflow: hidden;
}
.fidelidade-fill {
  height: 100%; background: var(--good);
}

/* ===== UTILITÁRIOS ===== */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-small { font-size: 12px; }
.text-good { color: var(--good); }
.text-alert { color: var(--alert); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--gold); }
.hidden, [hidden] { display: none !important; }

.alert-box {
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--alert-soft); color: var(--alert); font-size: 14px;
  border-left: 3px solid var(--alert); margin-bottom: 16px;
}
.alert-box.success { background: var(--good-soft); color: var(--good); border-left-color: var(--good); }
.alert-box.info    { background: var(--accent-soft); color: var(--accent-dark); border-left-color: var(--accent); }
.alert-box.estat   { background: var(--estat-soft); color: var(--estat); border-left-color: var(--estat); font-size: 12px; }

/* ===== FOOTER ===== */
.ftr { background: var(--ink); color: #E8E4D6; padding: 26px 0; margin-top: 64px; border-top: 3px solid var(--primary); }
.ftr-inner { max-width: 1120px; margin: 0 auto; padding: 0 20px; text-align: center; font-size: 13px; }
.ftr-sep { color: var(--gold); margin: 0 8px; }

/* ===== RESPONSIVO ===== */
@media (max-width: 720px) {
  .nav { display: none; }
  .hdr-inner { gap: 12px; }
  .convocacao-inner { font-size: 13px; }
  .cronometro { font-size: 14px; }
}

/* Fix sobreposição: sem o banner de convocação (oculto), o cabeçalho cola no topo (sem fresta de 41px) */
#convocacao-banner[hidden] ~ .hdr { top: 0; }
