/* ============================================================
   Sistema de Redirecionamento WhatsApp — Estilos Globais
   Paleta inspirada na LATAM: azul escuro, vermelho, branco
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy-deep: #0D1B3E;
  --navy:      #1B3A6B;
  --blue:      #003087;
  --red:       #CC0000;
  --white:     #FFFFFF;
  --gray-50:   #F0F4F8;
  --gray-100:  #E2EAF4;
  --gray-400:  #94A3B8;
  --gray-600:  #475569;
  --green:     #16a34a;
  --radius:    12px;
  --shadow:    0 4px 24px rgba(13,27,62,.12);
  --shadow-lg: 0 8px 40px rgba(13,27,62,.20);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: #1E293B;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ── Página pública de redirecionamento ───────────────────── */
.go-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, var(--navy-deep) 0%, var(--navy) 100%);
}
.go-page::before, .go-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.go-page::before {
  width: 500px; height: 500px;
  top: -150px; right: -150px;
  background: radial-gradient(circle, rgba(204,0,0,.15), transparent 70%);
}
.go-page::after {
  width: 400px; height: 400px;
  bottom: -150px; left: -100px;
  background: radial-gradient(circle, rgba(255,255,255,.07), transparent 70%);
}

.go-container {
  position: relative; z-index: 1;
  width: 100%; max-width: 380px;
  animation: fadeUp .6s ease-out both;
}

.go-header { text-align: center; margin-bottom: 1.5rem; }
.go-logo { height: 56px; margin: 0 auto 1rem; display: block; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(0,0,0,.3)); }
.go-logo-placeholder {
  width: 56px; height: 56px; margin: 0 auto 1rem;
  background: rgba(255,255,255,.15); backdrop-filter: blur(8px);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
}
.go-logo-placeholder svg { width: 28px; height: 28px; color: #fff; }
.go-title { font-size: 1.5rem; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.go-subtitle {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: .5rem; color: rgba(255,255,255,.7); font-size: .875rem;
}
.go-pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red); position: relative; flex-shrink: 0;
  animation: pulse 1.5s ease-in-out infinite;
}

.go-card {
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  overflow: hidden;
}

.go-progress-wrap { padding: 1.25rem 1.5rem .5rem; }
.go-progress-label {
  display: flex; justify-content: space-between;
  font-size: .7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: rgba(255,255,255,.5);
  margin-bottom: .5rem;
}
.go-progress-bar {
  height: 6px; background: rgba(255,255,255,.1);
  border-radius: 999px; overflow: hidden;
}
.go-progress-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--red), #FF4444);
  box-shadow: 0 0 10px rgba(204,0,0,.6);
  transition: width .04s linear;
}

.go-steps { padding: .75rem 1.5rem 1rem; display: flex; flex-direction: column; gap: .75rem; }
.go-step {
  display: flex; align-items: flex-start; gap: .75rem;
  opacity: .3; transition: opacity .3s ease;
}
.go-step.active { opacity: 1; }
.go-step.done   { opacity: .6; }
.go-step-num {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.4);
  transition: all .3s ease;
}
.go-step.active .go-step-num { background: var(--red); color: #fff; }
.go-step.done  .go-step-num  { background: var(--green); color: #fff; }
.go-step-text  { font-size: .875rem; font-weight: 500; color: rgba(255,255,255,.4); padding-top: .35rem; transition: color .3s ease; }
.go-step.active .go-step-text { color: #fff; font-weight: 600; }
.go-step.done  .go-step-text  { color: rgba(255,255,255,.65); }

.go-footer {
  padding: .75rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: .5rem;
  font-size: .75rem; color: rgba(255,255,255,.4);
}
.go-footer svg { flex-shrink: 0; }

.go-btn {
  display: block; width: 100%; margin-top: 1.25rem;
  padding: 1rem; border-radius: 14px; text-align: center;
  font-weight: 700; font-size: .95rem; color: #fff;
  cursor: pointer; border: none;
  transition: transform .15s, box-shadow .15s;
  animation: fadeIn 1s 1.5s both;
}
.go-btn:hover { transform: scale(1.02); }
.go-btn:active { transform: scale(.98); }

.go-error {
  text-align: center; color: #fff;
}
.go-error svg { opacity: .5; margin-bottom: 1rem; }
.go-error h2 { font-size: 1.2rem; margin-bottom: .5rem; }
.go-error p  { color: rgba(255,255,255,.5); font-size: .875rem; }

/* ── Layout Admin ─────────────────────────────────────────── */
.admin-body { display: flex; min-height: 100vh; background: var(--gray-50); }

.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--navy-deep);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transition: transform .2s ease;
}
.sidebar-brand {
  height: 60px; display: flex; align-items: center; gap: 10px;
  padding: 0 1.25rem; border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff; font-weight: 700; font-size: 1.1rem;
  white-space: nowrap; overflow: hidden;
}
.sidebar-brand img { height: 34px; object-fit: contain; }
.sidebar-brand-icon {
  width: 34px; height: 34px; background: var(--red);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand-icon svg { width: 18px; height: 18px; color: #fff; }
.sidebar-nav { flex: 1; padding: 1rem .75rem; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: .65rem .9rem; border-radius: 8px; font-size: .875rem; font-weight: 500;
  color: rgba(255,255,255,.55); transition: all .15s ease;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.9); }
.sidebar-nav a.active { background: var(--red); color: #fff; }
.sidebar-nav a svg { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar-footer {
  padding: .75rem; border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 8px;
  padding: .6rem .9rem; border-radius: 8px; font-size: .8rem;
  color: rgba(255,255,255,.4); transition: all .15s ease;
}
.sidebar-footer a:hover { color: rgba(255,255,255,.8); background: rgba(255,255,255,.06); }
.sidebar-footer a svg { width: 15px; height: 15px; }

.main-wrap { margin-left: 240px; flex: 1; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; padding: 0 2rem;
  font-size: .85rem; color: var(--gray-400);
}
.topbar strong { color: #1E293B; }
.page-content { padding: 2rem; flex: 1; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; color: #0F172A; }
.page-header p  { color: var(--gray-400); margin-top: .35rem; font-size: .9rem; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--gray-100); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-100);
}
.card-header h2 { font-size: 1rem; font-weight: 600; }
.card-header p  { font-size: .8rem; color: var(--gray-400); margin-top: .2rem; }
.card-body { padding: 1.5rem; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.stat-card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--gray-100); box-shadow: var(--shadow);
  padding: 1.25rem;
}
.stat-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .75rem; }
.stat-card-label { font-size: .8rem; color: var(--gray-400); font-weight: 500; }
.stat-card-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat-card-icon svg { width: 18px; height: 18px; }
.stat-card-value { font-size: 1.75rem; font-weight: 800; color: #0F172A; }
.stat-card-desc  { font-size: .75rem; color: var(--gray-400); margin-top: .2rem; }
.ic-blue   { background: #EFF6FF; color: #3B82F6; }
.ic-indigo { background: #EEF2FF; color: #6366F1; }
.ic-violet { background: #F5F3FF; color: #7C3AED; }
.ic-navy   { background: #EFF3FF; color: var(--blue); }
.ic-red    { background: #FEF2F2; color: var(--red); }

/* ── Tabela ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data-table th {
  text-align: left; padding: .85rem 1rem; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--gray-400); background: var(--gray-50); border-bottom: 1px solid var(--gray-100);
}
table.data-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--gray-50); }
.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: .8rem; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: .2rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
}
.badge-green  { background: #DCFCE7; color: #16a34a; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }
.badge-red    { background: #FEE2E2; color: var(--red); }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--gray-100); transition: background .2s;
}
.toggle input:checked + .toggle-track { background: var(--green); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .2s;
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(18px); }

/* ── Formulários ─────────────────────────────────────────────── */
.form-grid { display: grid; gap: 1.25rem; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.form-group { display: flex; flex-direction: column; gap: .45rem; }
.form-label { font-size: .8rem; font-weight: 600; color: #374151; }
.form-hint  { font-size: .75rem; color: var(--gray-400); }
.form-control {
  padding: .6rem .85rem; border: 1.5px solid var(--gray-100);
  border-radius: 8px; font-size: .875rem; color: #1E293B; background: #fff;
  transition: border-color .15s, box-shadow .15s; outline: none; width: 100%;
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,48,135,.1); }
.form-control-color { width: 44px; height: 38px; padding: .2rem; cursor: pointer; }
.color-group { display: flex; gap: .5rem; align-items: center; }
.color-group .form-control { flex: 1; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Botões ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: .6rem 1.1rem; border-radius: 8px; font-size: .875rem; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s ease; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary   { background: var(--blue);       color: #fff; }
.btn-primary:hover   { background: #002570; }
.btn-red       { background: var(--red);        color: #fff; }
.btn-red:hover { background: #A80000; }
.btn-green     { background: var(--green);      color: #fff; }
.btn-green:hover { background: #148042; }
.btn-outline   { background: transparent; color: var(--gray-600); border: 1.5px solid var(--gray-100); }
.btn-outline:hover { background: var(--gray-50); }
.btn-ghost     { background: transparent; color: var(--gray-400); }
.btn-ghost:hover { color: #1E293B; background: var(--gray-50); }
.btn-danger    { background: transparent; color: var(--red); }
.btn-danger:hover { background: #FEE2E2; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; border-radius: 6px; }
.btn-lg { padding: .8rem 1.6rem; font-size: 1rem; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Alertas e feedback ─────────────────────────────────────── */
.alert {
  padding: .9rem 1.1rem; border-radius: 10px; font-size: .875rem;
  display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem;
}
.alert-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }

/* ── Paginação ─────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; }
.pagination-info { font-size: .8rem; color: var(--gray-400); }
.pagination-btns { display: flex; gap: .5rem; }

/* ── Login ─────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--navy-deep); padding: 1.5rem;
}
.login-card {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .5s ease-out both;
}
.login-header {
  padding: 2rem 2rem 1.5rem; text-align: center;
  background: linear-gradient(135deg, rgba(0,48,135,.06), rgba(204,0,0,.04));
  border-bottom: 1px solid var(--gray-100);
}
.login-icon {
  width: 52px; height: 52px; margin: 0 auto 1rem;
  background: var(--blue); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.login-icon svg { width: 28px; height: 28px; color: #fff; }
.login-header h1 { font-size: 1.4rem; font-weight: 700; color: #0F172A; }
.login-header p  { font-size: .875rem; color: var(--gray-400); margin-top: .35rem; }
.login-body { padding: 1.75rem 2rem 2rem; }

/* ── Upload de logo ─────────────────────────────────────────── */
.logo-drop {
  border: 2px dashed var(--gray-100); border-radius: 12px; padding: 2rem;
  text-align: center; cursor: pointer; transition: all .2s ease;
}
.logo-drop:hover { border-color: var(--blue); background: #EFF3FF; }
.logo-drop svg  { color: var(--gray-400); margin-bottom: .5rem; }
.logo-drop p    { font-size: .8rem; color: var(--gray-400); }
.logo-preview   { display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--gray-100); border-radius: 12px; background: var(--gray-50); }
.logo-preview img { height: 56px; object-fit: contain; border-radius: 6px; background: #fff; padding: 4px; border: 1px solid var(--gray-100); }

/* ── Animações ─────────────────────────────────────────────── */
@keyframes fadeUp  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse   { 0%,100%{ box-shadow: 0 0 0 0 rgba(204,0,0,.4); } 70%{ box-shadow: 0 0 0 8px rgba(204,0,0,0); } }
@keyframes spin    { to { transform: rotate(360deg); } }

.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 4px solid rgba(204,0,0,.2);
  border-top-color: var(--red);
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

/* ── Responsivo ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .topbar { padding: 0 1rem; }
  .page-content { padding: 1rem; }
  .form-grid-2, .form-grid-4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99;
  }
  .sidebar-overlay.show { display: block; }
}
