/* ============================================================
   Portal PDD — Design System (cores PDD: azul + amarelo)
   ============================================================ */
:root {
  --primary: #0B3B8C;
  --primary-dark: #061E47;
  --accent: #FFB400;
  --accent-soft: #FFE8A8;
  --accent-bg: #FFFBEB;
  --estat: #5B2A86;
  --estat-soft: #F3EBF9;
  --good: #21A179;
  --good-soft: #EAF7F1;
  --alert: #E45757;
  --alert-soft: #FDE8E8;
  --ink: #12172B;
  --muted: #5E6275;
  --line: #E5E7EB;
  --card: #F2F4F8;
  --cream: #F7F4EC;
  --bg: #FAFBFC;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.05), 0 10px 30px rgba(0,0,0,0.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", 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.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== CONVOCAÇÃO BANNER ===== */
.convocacao {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 8px 0;
  position: sticky; top: 0; z-index: 100;
  border-bottom: 3px solid var(--accent);
}
.convocacao.urgente { background: linear-gradient(90deg, var(--alert), #B53636); animation: pulse-bg 1.2s ease-in-out infinite; }
@keyframes pulse-bg { 50% { filter: brightness(1.15); } }
.convocacao-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.convocacao-msg {
  font-weight: 700; letter-spacing: 0.5px; font-size: 15px;
}
.msg-imperativo { color: var(--accent); }
.cronometro {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px; font-weight: 700;
  background: rgba(255,255,255,0.12); padding: 6px 12px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
}
.cronometro.urgente { color: var(--accent); border-color: var(--accent); }

/* ===== HEADER ===== */
.hdr {
  background: white; border-bottom: 1px solid var(--line);
  position: sticky; top: 41px; z-index: 50;
  box-shadow: var(--shadow);
}
.hdr-inner {
  max-width: 1100px; margin: 0 auto; padding: 12px 16px;
  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: 900; color: var(--accent);
  background: var(--primary); padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 16px; letter-spacing: 1px;
}
.logo-sub { color: var(--muted); font-size: 12px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: var(--ink); padding: 8px 12px; border-radius: var(--radius-sm);
  font-weight: 500; font-size: 14px;
}
.nav a:hover { background: var(--card); text-decoration: none; }
.nav a.active { background: var(--primary); color: white; }
.user-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); padding: 6px 12px; border-radius: 999px;
  font-size: 13px; cursor: pointer;
}
.user-badge:hover { background: var(--line); }
.user-badge .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}

/* ===== APP / CONTAINERS ===== */
.app {
  max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px;
  min-height: 60vh;
}
.loading {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
h1 { font-size: 28px; margin: 0 0 8px; color: var(--primary); }
h2 { font-size: 20px; margin: 0 0 12px; color: var(--primary); }
h3 { font-size: 16px; margin: 0 0 8px; }
.section-sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

/* ===== CARDS ===== */
.card {
  background: white; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 16px;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-accent { border-left: 4px solid var(--accent); }
.card-primary { border-left: 4px solid var(--primary); }
.card-estat { border-left: 4px 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(--primary); margin-bottom: 6px; }
.card-meta { font-size: 12px; color: var(--muted); }

/* ===== BOTÕES ===== */
.btn {
  display: inline-block; padding: 10px 18px;
  border-radius: var(--radius-sm); 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: white; color: var(--primary); }
.btn-secondary:hover { background: var(--card); }
.btn-accent { background: var(--accent); color: var(--primary-dark); border-color: var(--accent); }
.btn-accent:hover { background: #E5A100; border-color: #E5A100; }
.btn-danger { background: var(--alert); border-color: var(--alert); }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 16px; }

/* ===== 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 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,59,140,0.15); }
.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: white; padding: 32px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border-top: 4px solid var(--accent);
}
.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: 3px solid transparent;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== PAUTAS / FEED ===== */
.pauta-card {
  background: white; border-radius: var(--radius); padding: 20px;
  margin-bottom: 16px; box-shadow: var(--shadow);
  border-top: 3px solid var(--accent);
  display: block; color: inherit; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s;
}
.pauta-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); 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(--primary); font-size: 16px; flex: 1; min-width: 200px; }
.pauta-descricao { color: var(--ink); font-size: 14px; margin: 8px 0 12px; line-height: 1.4; }
.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 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.6;
  background: var(--card); color: var(--ink);
}
.tag-primary { background: var(--primary); color: white; }
.tag-accent { background: var(--accent); color: var(--primary-dark); }
.tag-good { background: var(--good); color: white; }
.tag-alert { background: var(--alert); color: white; }
.tag-estat { background: var(--estat); color: white; }
.tag-muted { background: var(--card); color: var(--muted); }
.tag-nivel { background: var(--primary-dark); color: var(--accent); }

/* ===== PAUTA DETALHE ===== */
.pauta-detail .section {
  background: white; border-radius: var(--radius); padding: 20px;
  margin-bottom: 16px; 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: var(--good); }
.gate-side.contra { background: var(--alert-soft); border-color: var(--alert); }
.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: white; 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: 2px solid var(--line);
  background: white; 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: #000; 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.8;
}
.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: 16px;
  margin-bottom: 20px;
}
.kpi {
  background: white; border-radius: var(--radius); padding: 20px;
  border-left: 4px solid var(--accent); box-shadow: var(--shadow);
}
.kpi-value { font-size: 28px; font-weight: 800; color: var(--primary); }
.kpi-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; background: white;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  font-size: 13px;
}
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { background: var(--primary); color: white; font-weight: 600; font-size: 12px; }
table.data tr:hover { background: var(--card); }
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: 16px; }
.regiao-card {
  background: white; padding: 20px; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  display: block; color: inherit; text-decoration: none;
}
.regiao-card:hover { box-shadow: var(--shadow-lg); text-decoration: none; }
.regiao-numero { font-size: 24px; font-weight: 800; color: var(--primary); }
.regiao-uf { display: inline-block; padding: 2px 8px; background: var(--accent); color: var(--primary-dark);
            font-size: 11px; font-weight: 700; border-radius: 4px; 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: white;
  padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 4px 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(--accent); }
.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: 4px 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-bg); color: var(--primary); 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(--primary-dark); color: white; padding: 24px 0; margin-top: 60px; }
.ftr-inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; text-align: center; font-size: 13px; }
.ftr-sep { color: var(--accent); margin: 0 8px; }

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