/* ── Google Font ───────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg: #f0f2f8;
  --nav-bg: #0f0e1a;
  --card-bg: #ffffff;
  --accent: #6366f1;
  --accent-light: #e0e7ff;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --shadow-hover: 0 4px 24px rgba(99,102,241,.15);
  --radius: 14px;
  --radius-sm: 8px;
}

/* ── Base ─────────────────────────────────────────────── */
body {
  background: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
}

/* ── Navbar ───────────────────────────────────────────── */
.navbar {
  background: var(--nav-bg) !important;
  box-shadow: 0 2px 16px rgba(0,0,0,.3);
  padding: 0.6rem 1.5rem;
}
.navbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
  color: #fff !important;
}
.navbar-brand i { color: var(--accent); }
.nav-link {
  border-radius: var(--radius-sm);
  margin: 0 2px;
  padding: 0.4rem 0.75rem !important;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.65) !important;
  transition: all 0.15s;
}
.nav-link:hover { background: rgba(255,255,255,0.08) !important; color: #fff !important; }
.nav-link.active { background: rgba(99,102,241,0.2) !important; color: #fff !important; }

/* ── Hero / Welcome ───────────────────────────────────── */
.hero-section {
  background: var(--nav-bg);
  margin: -1rem -0.75rem 1.5rem;
  padding: 2rem 2rem 3.5rem;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(99,102,241,0.25) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -60px; left: 30%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-title {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0;
}
.hero-subtitle { color: rgba(255,255,255,0.5); font-size: 0.85rem; margin: 0; }

/* ── KPI Cards ────────────────────────────────────────── */
.kpi-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
  margin-top: -2.2rem;
}
.kpi-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.kpi-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.kpi-label { font-size: 0.75rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-value { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.kpi-sub { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }

.badge-delta {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}
.badge-up { background: #dcfce7; color: #15803d; }
.badge-down { background: #fee2e2; color: #dc2626; }

/* ── Cards general ────────────────────────────────────── */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card-header {
  border-radius: var(--radius) var(--radius) 0 0 !important;
  padding: 1rem 1.25rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border) !important;
  background: var(--card-bg) !important;
}

/* ── Nav Tabs ─────────────────────────────────────────── */
.nav-tabs {
  border-bottom: 2px solid var(--border);
  gap: 4px;
}
.nav-tabs .nav-link {
  border: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
  color: var(--muted) !important;
  background: transparent !important;
  font-size: 0.85rem;
  padding: 0.5rem 1rem !important;
  margin: 0 !important;
}
.nav-tabs .nav-link:hover {
  color: var(--text) !important;
  background: var(--border) !important;
}
.nav-tabs .nav-link.active {
  color: var(--accent) !important;
  background: var(--card-bg) !important;
  border-bottom: 2px solid var(--accent) !important;
  font-weight: 600;
}

/* ── Section headers ──────────────────────────────────── */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

/* ── Tables ───────────────────────────────────────────── */
.table { font-size: 0.85rem; }
.table > :not(caption) > * > * { padding: 0.65rem 0.9rem; }
.table thead th { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border-bottom: 1px solid var(--border); }
.table-hover tbody tr:hover { background: #f8f9ff; }

/* ── Buttons ──────────────────────────────────────────── */
.btn { border-radius: var(--radius-sm); font-weight: 500; font-size: 0.85rem; }
.btn-accent { background: var(--accent); color: #fff; border: none; }
.btn-accent:hover { background: #4f46e5; color: #fff; }

/* ── Progress ─────────────────────────────────────────── */
.progress { border-radius: 99px; background: var(--accent-light); }
.progress-bar { border-radius: 99px; }

/* ── Badges ───────────────────────────────────────────── */
.badge { font-weight: 500; letter-spacing: 0.02em; border-radius: 6px; }

/* ── Modals ───────────────────────────────────────────── */
.modal-content { border-radius: 18px; border: none; box-shadow: 0 8px 40px rgba(0,0,0,.18); }
.modal-header { border-bottom: 1px solid var(--border); padding: 1.25rem 1.5rem; }
.modal-footer { border-top: 1px solid var(--border); }

/* ── Objetivo card ────────────────────────────────────── */
.objetivo-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: box-shadow 0.15s;
}
.objetivo-card:hover { box-shadow: var(--shadow-hover); }

/* ── Bottom nav (mobile) ──────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--nav-bg);
  display: flex; justify-content: space-around; align-items: center;
  height: 62px; z-index: 1000;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center;
  color: rgba(255,255,255,0.45); text-decoration: none;
  font-size: 10px; gap: 3px; padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.bottom-nav a i { font-size: 20px; }
.bottom-nav a.active { color: #fff; background: rgba(99,102,241,0.25); }
.bottom-nav a:hover:not(.active) { color: rgba(255,255,255,0.75); }

/* ── Alerts ───────────────────────────────────────────── */
.alert { border-radius: var(--radius-sm); border: none; font-size: 0.85rem; }

/* ── Form controls ────────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.875rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* ── Tarjeta cards ────────────────────────────────────── */
.tarjeta-card {
  border-radius: 16px;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 120px;
}
.tarjeta-card::after {
  content: '';
  position: absolute;
  bottom: -30px; right: -30px;
  width: 130px; height: 130px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

/* ── x-small ──────────────────────────────────────────── */
.x-small { font-size: 0.72rem; }

/* ── Border dashed ────────────────────────────────────── */
.border-dashed { border: 2px dashed var(--border) !important; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 576px) {
  h4 { font-size: 1rem; }
  .card-body { padding: 0.85rem; }
  .btn-sm { font-size: 0.78rem; }
  .table { font-size: 0.78rem; }
  .hero-title { font-size: 1.2rem; }
  .kpi-value { font-size: 1.15rem; }
}

/* ── Print ────────────────────────────────────────────── */
@media print {
  .navbar, .bottom-nav, .hero-section, .print-hide, .btn, form { display: none !important; }
  body { background: white; font-size: 12px; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  .container-fluid { padding: 0 !important; }
}
