/* ── Wealth Club · Reportes — tema dark azul ─────────────────── */
:root {
  /* Fondos */
  --bg-primary: #060A14;   --background: #060A14;
  --bg-secondary: #0A1120; --card: #0D1626;
  --bg-tertiary: #0F1B30;  --popover: #0A1120;
  --bg-surface: #15233B;
  /* Acento azul */
  --primary: #2D7DFF; --gold: #2D7DFF; --accent-gold: #2D7DFF;
  --gold-hover: #4F9BFF;
  --gold-muted: #2D7DFF33;
  --primary-foreground: #FFFFFF;
  /* Texto */
  --text-primary: #E8EEF8; --foreground: #E8EEF8;
  --text-secondary: #8A97AD;
  --text-muted: #5C6B82;
  /* Semántico */
  --positive: #34D399; --warning: #FBBF24;
  --negative: #F87171; --info: #38BDF8;
  --destructive: #F87171;
  /* Superficies / bordes / foco */
  --secondary: #0F1B30; --muted: #15233B; --accent: #15233B;
  --border: rgba(45,125,255,0.14); --input: rgba(45,125,255,0.14);
  --ring: #2D7DFF;
  /* Charts */
  --chart-1: #2D7DFF; --chart-2: #38BDF8; --chart-3: #34D399;
  --chart-4: #FBBF24; --chart-5: #F87171;
  /* Sidebar */
  --sidebar: #0A1120; --sidebar-primary: #2D7DFF;
  --sidebar-accent: #15233B; --sidebar-border: rgba(45,125,255,0.10);
  /* Radio */
  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) * .6); --radius-md: calc(var(--radius) * .8);
  --radius-lg: var(--radius); --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); }

/* ── Layout ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.main { flex: 1; min-width: 0; padding: 28px 32px 48px; }

.brand { display: flex; gap: 10px; align-items: center; padding: 20px 18px; border-bottom: 1px solid var(--sidebar-border); }
.brand-mark {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--gold), #1B5FD6);
  color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { display: block; font-weight: 700; font-size: 15px; color: var(--text-primary); }
.brand-name em { font-style: normal; color: var(--gold); }
.brand-sub { display: block; font-size: 10.5px; color: var(--text-muted); }

.nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-md);
  color: var(--text-secondary); font-weight: 600; font-size: 13.5px;
}
.nav-link:hover { background: var(--sidebar-accent); color: var(--text-primary); }
.nav-link.active { background: var(--gold-muted); color: var(--gold-hover); }
.nav-icon { font-size: 15px; width: 18px; text-align: center; }
.sidebar-foot {
  margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--sidebar-border);
  font-size: 11px; color: var(--text-muted);
  display: flex; justify-content: space-between; align-items: center;
}

/* ── Encabezados ── */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
h1 { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -0.3px; }
.subtitle { color: var(--text-secondary); font-size: 13px; margin: 4px 0 0; }
h2 { font-size: 13px; font-weight: 700; margin: 0; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .4px; }

/* ── Cards / KPIs ── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 18px 20px;
}
.grid { display: grid; gap: 14px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

.kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.kpi-value { font-size: 24px; font-weight: 800; margin-top: 4px; }
.kpi-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.pos { color: var(--positive); } .neg { color: var(--negative); }
.warn { color: var(--warning); } .info { color: var(--info); }

/* ── Tablas ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); font-weight: 700;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 9px 12px; border-bottom: 1px solid rgba(45,125,255,0.06); vertical-align: middle; }
tr:hover td { background: rgba(45,125,255,0.04); }
.t-right { text-align: right; } .t-center { text-align: center; }
.cell-main { font-weight: 600; color: var(--text-primary); }
.cell-sub { font-size: 11.5px; color: var(--text-muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--text-secondary); }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.badge-approved { background: rgba(52,211,153,.12); color: var(--positive); }
.badge-refunded { background: rgba(248,113,113,.12); color: var(--negative); }
.badge-canceled { background: var(--muted); color: var(--text-secondary); }
.badge-pending  { background: rgba(251,191,36,.12); color: var(--warning); }

/* ── Controles ── */
input[type=text], input[type=password], input[type=date], input[type=search], select, textarea {
  background: var(--bg-tertiary); color: var(--text-primary);
  border: 1px solid var(--input); border-radius: var(--radius-md);
  padding: 8px 11px; font: inherit; font-size: 13px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ring); outline-offset: -1px; }
input[type=color] { border: 1px solid var(--input); border-radius: var(--radius-sm); background: var(--bg-tertiary); height: 36px; width: 56px; padding: 3px; }
label { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 4px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold); color: var(--primary-foreground);
  border: none; border-radius: var(--radius-md);
  padding: 9px 16px; font: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: var(--gold-hover); color: #fff; }
.btn-ghost { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-danger { background: transparent; color: var(--negative); border: 1px solid rgba(248,113,113,.35); }
.btn-danger:hover { background: rgba(248,113,113,.1); color: var(--negative); }
.btn-sm { padding: 6px 11px; font-size: 12px; }

/* Checkboxes de onboarding */
input[type=checkbox].ob {
  appearance: none; width: 17px; height: 17px; cursor: pointer;
  border: 1.5px solid var(--text-muted); border-radius: 5px;
  background: transparent; position: relative; vertical-align: middle;
}
input[type=checkbox].ob:checked { background: var(--gold); border-color: var(--gold); }
input[type=checkbox].ob:checked::after {
  content: "✓"; color: #fff; font-size: 12px; font-weight: 800;
  position: absolute; top: -1px; left: 2.5px;
}

select.status-select { padding: 4px 8px; font-size: 12px; font-weight: 600; border-radius: 999px; }

/* ── Filtros (chips) ── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--border); color: var(--text-secondary);
  background: transparent; cursor: pointer;
}
.chip.on { color: #fff; border-color: transparent; }

/* ── Funnel ── */
.funnel-row { margin-bottom: 12px; }
.funnel-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.funnel-track { height: 20px; background: var(--bg-tertiary); border-radius: var(--radius-sm); overflow: hidden; }
.funnel-bar { height: 100%; background: linear-gradient(90deg, var(--gold), var(--info)); border-radius: var(--radius-sm); }

/* ── Campañas grid ── */
.camp-card { display: block; color: inherit; }
.camp-card:hover { border-color: var(--gold-muted); color: inherit; }
.camp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.camp-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; text-align: center; margin-top: 14px; gap: 8px; }
.camp-stats b { display: block; font-size: 17px; }
.camp-stats span { font-size: 10.5px; color: var(--text-muted); }

/* ── Modal ── */
.modal-back {
  position: fixed; inset: 0; background: rgba(3,6,12,.7); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--popover); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 22px; width: 100%; max-width: 440px;
}
.hidden { display: none !important; }

/* ── Login ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }

/* ── Utilidades ── */
.mt { margin-top: 22px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.spacer { flex: 1; }
.warn-note {
  background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.25);
  color: var(--warning); border-radius: var(--radius-lg);
  padding: 10px 14px; font-size: 13px; margin-bottom: 18px;
}
.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 6px 11px; border-radius: var(--radius-md); font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); color: var(--text-secondary);
}
.pagination .cur { background: var(--gold); color: #fff; border-color: transparent; }
.chart-box { height: 280px; position: relative; }

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .nav { flex-direction: row; overflow-x: auto; }
  .sidebar-foot { display: none; }
  .main { padding: 18px 14px 40px; }
}
