/* style.css — painel do anunciante */

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

:root {
  --bg:       #f5f4f0;
  --surface:  #ffffff;
  --border:   #e5e3dc;
  --border-md:#ccc9bf;
  --text:     #1a1916;
  --muted:    #7a7870;
  --accent:   #2d6a4f;
  --accent-bg:#e8f5ee;
  --accent-lt:#d1ead9;
  --danger:   #c0392b;
  --warning:  #e67e22;
  --radius:   10px;
  --radius-lg:16px;
  --sidebar:  220px;
  font-family: 'Inter', system-ui, sans-serif;
}

body { background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
}

.sidebar-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  padding: 0 8px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
}

.sidebar-logo span { color: var(--accent); }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

.nav-link:hover  { background: var(--bg); color: var(--text); }
.nav-link.active { background: var(--accent-bg); color: var(--accent); }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-spacer { flex: 1; }

.sidebar-brand {
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.brand-name { font-size: 13px; font-weight: 600; color: var(--text); }
.brand-email { font-size: 12px; color: var(--muted); margin-top: 2px; }

.balance-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--accent-bg);
  border-radius: 8px;
}

.balance-label { font-size: 11px; color: var(--accent); font-weight: 600; }
.balance-value { font-size: 14px; font-weight: 700; color: var(--accent); }

/* ── Main ───────────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar);
  padding: 28px 32px 60px;
  max-width: calc(var(--sidebar) + 900px);
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
}

/* ── Metric cards ───────────────────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.metric-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.metric-value { font-size: 26px; font-weight: 700; letter-spacing: -1px; }
.metric-sub   { font-size: 12px; color: var(--muted); margin-top: 4px; }
.metric-card.accent { background: var(--accent); border-color: var(--accent); }
.metric-card.accent .metric-label,
.metric-card.accent .metric-sub   { color: var(--accent-lt); }
.metric-card.accent .metric-value  { color: #fff; }

/* ── Tabela de campanhas ────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title { font-size: 16px; font-weight: 600; }

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--bg); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge.active   { background: var(--accent-bg); color: var(--accent); }
.badge.paused   { background: #fef3e2; color: #b7791f; }
.badge.pending  { background: #ebf4ff; color: #2b6cb0; }
.badge.rejected { background: #fff5f5; color: var(--danger); }

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}

/* ── Formulários ────────────────────────────────────────────────────── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 620px;
}

.form-group { margin-bottom: 18px; }

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

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=url], select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

.radio-group { display: flex; gap: 12px; }
.radio-opt {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.radio-opt.selected { border-color: var(--accent); background: var(--accent-bg); }
.radio-opt input { display: none; }
.radio-opt-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.radio-opt-desc  { font-size: 12px; color: var(--muted); }
.radio-opt.selected .radio-opt-desc { color: var(--accent); }

/* ── Botões ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.12s, opacity 0.12s;
  text-decoration: none;
}

.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { background: #333; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-accent  { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #235c41; }
.btn-ghost   { background: none; border: 1px solid var(--border-md); color: var(--text); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger  { background: none; border: 1px solid #fca5a5; color: var(--danger); }
.btn-danger:hover { background: #fff5f5; }
.btn-sm      { padding: 6px 12px; font-size: 13px; }
.btn svg     { width: 16px; height: 16px; }

/* ── Auth ───────────────────────────────────────────────────────────── */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-box {
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.auth-logo span { color: var(--accent); }

.auth-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.auth-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.auth-section { display: none; }
.auth-section.active { display: block; }

.error-msg { font-size: 13px; color: var(--danger); margin-top: 10px; display: none; }
.success-msg { font-size: 13px; color: var(--accent); margin-top: 10px; display: none; }

/* ── Toast ──────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.2s;
  pointer-events: none;
  z-index: 999;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Loading ────────────────────────────────────────────────────────── */
.loading { text-align: center; padding: 40px; color: var(--muted); font-size: 14px; }
.spinner { width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 48px 20px; }
.empty-icon  { font-size: 36px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-text  { font-size: 14px; color: var(--muted); margin-bottom: 20px; }

/* ── Depósito modal ─────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  margin: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 16px; font-weight: 600; }
.modal-body  { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

.icon-btn {
  width: 32px; height: 32px;
  border: none; background: none;
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}

.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

@media (max-width: 680px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px 16px 60px; }
  .form-row { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
}
