@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --champagne-50: #FBF6EC;
  --champagne-100: #F7E9D6;
  --champagne-200: #F7E7CE;
  --champagne-300: #EAE0C8;

  --gold-300: #D8C99A;
  --gold-400: #C2B280;
  --gold-500: #A57D38;
  --gold-600: #8A6429;

  --black: #000000;
  --ink-800: #1A1A1A;
  --ink-600: #4A4A4A;
  --gray-400: #AAAAAA;
  --gray-200: #E0E0E0;
  --white: #FFFFFF;

  --surface-page: var(--champagne-200);
  --surface-page-soft: var(--champagne-50);
  --surface-card: var(--white);
  --surface-ink: var(--ink-800);

  --text-primary: var(--ink-800);
  --text-secondary: var(--ink-600);
  --text-muted: var(--gray-400);
  --text-on-dark: var(--white);

  --accent: var(--gold-500);
  --accent-strong: var(--gold-600);

  --border-hairline: var(--gray-200);
  --border-gold: var(--gold-400);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(43, 33, 16, 0.06);
  --shadow-md: 0 8px 24px rgba(43, 33, 16, 0.08);
  --shadow-lg: 0 18px 48px rgba(43, 33, 16, 0.10);

  --font-sans: "Plus Jakarta Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--surface-page);
  color: var(--text-primary);
}

.wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
}

.logo {
  display: block;
  height: 40px;
  margin: 0 auto 20px;
}

.eyebrow {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

h1 {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--text-primary);
}

.subtitulo {
  text-align: center;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 28px;
}

.campo {
  margin-bottom: 18px;
}

.campo label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.campo input,
.campo select {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  font-family: var(--font-sans);
  border: 1.5px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--surface-page-soft);
  color: var(--text-primary);
  outline: none;
  transition: border-color 140ms ease;
}

.campo input:focus,
.campo select:focus {
  border-color: var(--accent);
}

.campo small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.consentimento {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 20px 0 24px;
}

.consentimento input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.consentimento label {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.btn {
  width: 100%;
  padding: 15px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--white);
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(165, 125, 56, 0.28);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.erro {
  color: #B3261E;
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  min-height: 16px;
}

.tela-obrigado {
  text-align: center;
}

.tela-obrigado .icone {
  font-size: 48px;
  margin-bottom: 12px;
}

.tela-obrigado p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.oculto { display: none !important; }

/* ---------- Admin ---------- */

.admin-shell {
  min-height: 100dvh;
  background: var(--surface-page);
}

.admin-topo {
  background: var(--surface-ink);
  color: var(--white);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-topo .titulo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 15px;
}

.admin-topo .titulo img { height: 26px; }

.admin-topo a, .admin-topo button {
  color: var(--white);
  background: rgba(255,255,255,0.12);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.admin-body {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.stat-card .valor {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-card .label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-hairline);
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--surface-card);
}

.btn-sec {
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-gold);
  background: var(--surface-card);
  color: var(--accent-strong);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-sec:hover { background: var(--champagne-100); }
.btn-sec:disabled { opacity: 0.5; cursor: not-allowed; }

.tabela-wrap {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13.5px;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-hairline);
  white-space: nowrap;
  overflow: hidden;
}

.truncar {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.celula-contato {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.35;
}

.celula-contato .contato-email {
  font-size: 12px;
  color: var(--text-secondary);
}

.paginacao {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.paginacao-info {
  font-size: 13px;
  color: var(--text-secondary);
}

.paginacao-controles {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.paginacao-controles select {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-hairline);
  font-family: var(--font-sans);
  font-size: 13px;
  background: var(--surface-card);
}

#paginacao-atual {
  white-space: nowrap;
  min-width: 110px;
  text-align: center;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 700;
}

tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}

.badge-criado { background: #E4F3E6; color: #216E2F; }
.badge-atualizado { background: #E4ECF9; color: #1E4FA0; }
.badge-erro { background: #FBE4E2; color: #B3261E; }
.badge-sim { background: var(--champagne-100); color: var(--gold-600); }
.badge-nao { background: var(--gray-200); color: var(--text-secondary); }

.link-detalhe {
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  font-size: 12px;
}

.modal-fundo {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-caixa {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-caixa h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.modal-caixa pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  background: var(--surface-page-soft);
  border-radius: var(--radius-md);
  padding: 12px;
  color: var(--text-secondary);
}

.modal-acoes {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.login-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-page);
  padding: 20px;
}
