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

:root {
  --primary: #0b7a63;
  --primary-dark: #075e4e;
  --accent: #25d366;
  --accent-dark: #1fb855;
  --bg: #f6f7f9;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --text: #1a1a1a;
  --text-muted: #6b7280;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 60px;
}

/* ===== HEADER ===== */
header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.header-title h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.3px; }
.header-title .subtitle { font-size: 13px; opacity: 0.85; margin-top: 4px; }

.header-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-email {
  font-size: 13px;
  opacity: 0.9;
  background: rgba(255,255,255,0.12);
  padding: 6px 12px;
  border-radius: 20px;
}

.btn-logout {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-logout:hover { background: rgba(255,255,255,0.28); }

/* ===== TABS ===== */
.tabs {
  display: flex;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.tab-btn {
  padding: 16px 26px;
  border: none;
  background: none;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover { color: var(--primary); }

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
}

.tab-content { display: none; padding: 28px 32px; max-width: 1100px; margin: 0 auto; }
.tab-content.active { display: block; }

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.card h2 {
  font-size: 15px;
  margin-bottom: 14px;
  color: var(--primary-dark);
  font-weight: 700;
}

.card h3 { font-size: 13.5px; margin: 18px 0 10px; color: #333; font-weight: 700; }

label { display: block; font-size: 12.5px; font-weight: 700; margin: 14px 0 6px; color: #444; text-transform: uppercase; letter-spacing: 0.3px; }
label:first-child { margin-top: 0; }

input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
  background: #fbfbfc;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

textarea { resize: vertical; }

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

.row { display: flex; gap: 16px; }
.row .col { flex: 1; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 13px 30px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { background: #b0b0b0; cursor: not-allowed; }

.btn-full { width: 100%; margin-top: 18px; }

.btn-secondary {
  background: #eef2f0;
  color: var(--primary-dark);
  border: 1.5px solid var(--border);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
}

.btn-secondary:hover { background: #e2e8e5; }

/* ===== WABAS GRID ===== */
.wabas-grid { display: flex; flex-direction: column; gap: 16px; }

.produto-grupo {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: #fafbfc;
}

.produto-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 12px;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.waba-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: white;
  transition: border-color 0.15s;
}

.waba-item:hover { border-color: #c9d4cf; }

.waba-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
}

.waba-item-numeros {
  margin-top: 8px;
  margin-left: 24px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}

.waba-badge {
  display: inline-block;
  background: #e6f6ee;
  color: #1a8a4a;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
  text-transform: uppercase;
}

.multi-numero-tag {
  display: inline-block;
  background: #fff3cd;
  color: #8a6d1a;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  margin-left: 8px;
}

/* ===== RESULTADOS ===== */
.resultado-lista { display: flex; flex-direction: column; gap: 8px; }

.resultado-item {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid transparent;
}

.resultado-created { background: #e6f6ee; color: #1a8a4a; border-color: #b8e6cc; }
.resultado-exists { background: #fff3cd; color: #8a6d1a; border-color: #ffe08a; }
.resultado-error { background: #fdecea; color: #c62828; border-color: #f5c6cb; }
.resultado-pending { background: #eef2f5; color: #607d8b; border-color: #dbe3e8; }

/* ===== BOTOES DO TEMPLATE (form) ===== */
.botao-item {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: flex-end;
}

.botao-item .col { flex: 1; }

.remove-botao {
  background: #fdecea;
  color: #c62828;
  border: 1.5px solid #f5c6cb;
  border-radius: 8px;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.variavel-item {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.variavel-item span {
  font-size: 13px;
  font-weight: 700;
  min-width: 44px;
  color: var(--primary-dark);
  background: #eef2f0;
  padding: 6px 10px;
  border-radius: 6px;
  text-align: center;
}

#previewTemplate {
  margin-top: 14px;
  padding: 14px;
  background: #f0f4f2;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  display: none;
}

/* ===== LOGIN PAGE ===== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0b7a63 0%, #043d31 100%);
  padding: 20px;
}

.login-box {
  background: white;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.login-logo { text-align: center; margin-bottom: 28px; }

.login-logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 26px;
  font-weight: 800;
  margin: 0 auto 16px;
}

.login-logo h1 { font-size: 18px; color: var(--primary-dark); font-weight: 700; }
.login-logo p { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

.login-error {
  background: #fdecea;
  color: #c62828;
  border: 1px solid #f5c6cb;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

.login-form label { margin-top: 16px; }
.login-form label:first-child { margin-top: 0; }
