:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --border: #2d3f56;
  --text: #e8edf4;
  --text-muted: #8fa3bc;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #10b981;
  --accent-hover: #059669;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(145deg, #0a0e14 0%, #121a26 50%, #0f1419 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
.app { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.logo { font-size: 2.5rem; background: var(--surface); width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; box-shadow: var(--shadow); }
header h1 { font-size: 1.6rem; font-weight: 700; }
header p { color: var(--text-muted); font-size: 0.95rem; margin-top: 0.25rem; }
main { display: grid; gap: 1.25rem; }
@media (min-width: 900px) { main { grid-template-columns: 1.4fr 1fr; align-items: start; } .editor-panel { grid-row: span 2; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.panel h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.panel-header h2 { margin-bottom: 0; }
.quick-actions { display: flex; gap: 0.5rem; }
textarea { width: 100%; min-height: 320px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.95rem; font-family: inherit; padding: 1rem; resize: vertical; line-height: 1.6; }
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }
.tags { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag { display: inline-block; font-size: 0.8rem; color: var(--text-muted); background: var(--surface-2); padding: 0.35rem 0.65rem; border-radius: 999px; }
.control-group { margin-bottom: 1rem; }
.control-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.control-group label span { color: var(--primary); font-weight: 600; }
select,
input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  padding: 0.6rem 0.75rem;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
input[type="range"] { width: 100%; accent-color: var(--primary); }
.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.vozes-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 500px) { .vozes-grid { grid-template-columns: 1fr 1fr; column-gap: 1rem; } }
.voz-rapida { margin-bottom: 0.75rem; }
.voz-row { display: flex; gap: 0.5rem; align-items: stretch; }
.voz-row select { flex: 1; min-width: 0; }
.btn-amostra { white-space: nowrap; flex-shrink: 0; padding: 0.6rem 0.75rem; font-size: 0.82rem; }
.btn-toggle-vozes { width: 100%; margin-bottom: 0.75rem; }
.btn-toggle-vozes[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
.vozes-panel { margin-bottom: 1rem; padding: 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.voz-item .voz-row { margin-top: 0.35rem; }
.voz-rapida-hint { margin: 0; font-size: 0.82rem; }
.playback { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }
.btn { border: none; border-radius: 8px; font-size: 0.9rem; font-weight: 600; padding: 0.65rem 1rem; cursor: pointer; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-accent { background: var(--accent); color: white; width: 100%; margin-top: 0.5rem; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); font-size: 0.8rem; padding: 0.4rem 0.65rem; }
.btn-large { flex: 1; min-width: 140px; padding: 0.85rem 1.25rem; font-size: 1rem; }
.status { display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem; padding: 0.75rem; background: var(--surface-2); border-radius: 8px; font-size: 0.85rem; color: var(--text-muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.status.falando .status-dot { background: var(--accent); animation: pulse 1s infinite; }
.status.pausado .status-dot { background: #f59e0b; }
.status.erro .status-dot { background: var(--danger); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.builder-form { display: flex; flex-direction: column; gap: 0.6rem; }
.opcao-row { display: grid; grid-template-columns: 70px 1fr; gap: 0.5rem; }
footer { margin-top: 2rem; text-align: center; color: var(--text-muted); font-size: 0.8rem; }

/* Auth / Admin */
.auth-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; gap: 1.25rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); text-align: center; }
.auth-logo { font-size: 3rem; margin-bottom: 0.5rem; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: 0.35rem; }
.auth-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.auth-form { text-align: left; }
.auth-btn { width: 100%; margin-top: 0.5rem; }
.auth-hint { margin-top: 1.25rem; font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; }
.auth-setup { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.auth-msg { margin-top: 1rem; padding: 0.75rem; border-radius: 8px; font-size: 0.85rem; text-align: left; }
.auth-msg.erro { background: #450a0a; border: 1px solid var(--danger); color: #fca5a5; }
.auth-msg.ok { background: #14532d; border: 1px solid var(--accent); color: #86efac; }
.auth-footer { margin-top: 1.5rem; font-size: 0.9rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.auth-card-wide { max-width: 460px; }
.preco-box {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #243044 100%);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  text-align: center;
}
.preco-label { display: block; font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.35rem; }
.preco-valor { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.preco-periodo { display: block; margin-top: 0.35rem; font-size: 0.85rem; font-weight: 700; color: var(--accent); letter-spacing: 0.02em; text-transform: none; }
.cadastro-sucesso { text-align: center; }
.cadastro-sucesso-msg { text-align: center; line-height: 1.6; font-size: 0.95rem; margin-bottom: 1rem; }

.header-bar { justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.header-left { display: flex; align-items: center; gap: 1rem; }
.header-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.user-badge { font-size: 0.85rem; color: var(--text-muted); background: var(--surface-2); padding: 0.4rem 0.75rem; border-radius: 999px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-align: center; }
.stat-val { display: block; font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

.admin-main { display: flex; flex-direction: column; gap: 1.25rem; }
.panel-full { grid-column: 1 / -1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.admin-form { display: flex; flex-direction: column; gap: 0.75rem; }
.admin-check { display: flex; align-items: flex-end; padding-bottom: 0.5rem; }
.admin-check label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; color: var(--text); }

.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th, .admin-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.admin-table th { color: var(--text-muted); font-weight: 600; background: var(--surface-2); }
.col-texto { max-width: 400px; word-break: break-word; white-space: pre-wrap; }
.col-data { white-space: nowrap; }
.vazio { text-align: center; color: var(--text-muted); padding: 1.5rem !important; }
.badge-admin { font-size: 0.7rem; background: #1e3a5f; color: #93c5fd; padding: 0.15rem 0.4rem; border-radius: 4px; }
.badge-uso { background: var(--surface-2); padding: 0.2rem 0.5rem; border-radius: 999px; font-weight: 600; color: var(--accent); }
.badge-ativo { color: var(--accent); }
.badge-inativo { color: var(--danger); }
.acoes-cell { white-space: nowrap; }
.btn-sm { font-size: 0.75rem !important; padding: 0.35rem 0.5rem !important; }
.btn-danger-text { color: #fca5a5 !important; }
.filtro-select { max-width: 220px; }

.site-seguro {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  max-width: 420px;
  width: 100%;
  padding: 1rem 1.1rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius);
  text-align: left;
}
.site-seguro-wide { max-width: 460px; }
.site-seguro-app { max-width: 1100px; margin: 0 auto; }
.site-seguro-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}
.site-seguro strong {
  display: block;
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.site-seguro p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.site-seguro a {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.site-seguro a:hover { text-decoration: underline; }

.seguranca-page { max-width: 720px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.seguranca-header { text-align: center; margin-bottom: 2rem; }
.seguranca-header .auth-logo { font-size: 3rem; margin-bottom: 0.5rem; }
.seguranca-header h1 { font-size: 1.6rem; margin-bottom: 0.35rem; }
.seguranca-header p { color: var(--text-muted); }
.seguranca-list { display: flex; flex-direction: column; gap: 1rem; }
.seguranca-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}
.seguranca-item h2 { font-size: 1rem; color: var(--accent); margin-bottom: 0.45rem; }
.seguranca-item p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin: 0; }
.seguranca-voltar { display: block; text-align: center; margin-top: 2rem; }