/* ═══════════════════════════════════════════════════════
   LA BÓVEDA v3 — CSS MAESTRO — Modern Flat + Neumorphism
   ═══════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

:root {
  --gold:        #FFD700;
  --gold-dark:   #d4af37;
  --gold-light:  #ffe566;
  --gold-dim:    rgba(255,215,0,0.08);
  --bg:          #080810;
  --bg2:         #0d0d18;
  --card:        #12121e;
  --card2:       #16162a;
  --text:        #f0f0f8;
  --text-muted:  #8888a8;
  --text-dim:    #44445a;
  --border:      rgba(255,215,0,0.12);
  --border-h:    rgba(255,215,0,0.35);
  --success:     #3dd68c;
  --danger:      #ff5757;
  --warning:     #ffab40;
  --info:        #64b5f6;
  --r:           10px;
  --r-lg:        16px;
  --ease:        0.2s cubic-bezier(.4,0,.2,1);
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-gold: 0 0 24px rgba(255,215,0,0.12);
  --header-h:    60px;
  --sidebar-w:   248px;
  --bottom-h:    68px;
  --font:        'DM Sans', system-ui, sans-serif;
  --mono:        'DM Mono', monospace;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: var(--font); }

/* ── SCROLLBAR ───────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,215,0,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,215,0,0.4); }

/* ══════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════ */
.header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo-main {
  font-size: 17px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.5px;
}
.logo-sub {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.3px;
  margin-top: 2px;
}
.h-actions { display: flex; align-items: center; gap: 12px; }
.h-user { display: flex; align-items: center; gap: 10px; }
.h-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: #000;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255,215,0,0.25);
}
.h-avatar img { width: 100%; height: 100%; object-fit: cover; }
.h-name { font-size: 13px; font-weight: 500; color: var(--text); }
.h-nivel {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--gold-dim);
  border: 1px solid var(--border);
  color: var(--gold);
  font-weight: 600;
}
.btn-exit {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid rgba(255,87,87,0.25);
  color: var(--danger);
  border-radius: var(--r);
  font-size: 12px;
  font-weight: 600;
  transition: var(--ease);
  cursor: pointer;
}
.btn-exit:hover {
  background: rgba(255,87,87,0.1);
  border-color: rgba(255,87,87,0.5);
}

/* ══════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ══════════════════════════════════════════════ */
.app-wrap {
  display: flex;
  min-height: calc(100vh - var(--header-h));
  max-width: 1440px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-menu { list-style: none; padding: 0 12px; }
.sidebar-menu li { margin-bottom: 2px; }
.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--text-muted);
  border-radius: var(--r);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--ease);
  position: relative;
}
.sidebar-menu a:hover,
.sidebar-menu a.on {
  background: var(--gold-dim);
  color: var(--gold);
}
.sidebar-menu a.on::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  background: var(--gold);
  border-radius: 0 3px 3px 0;
}
.sidebar-menu .ico {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.8;
}
.sidebar-section {
  padding: 16px 26px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}
.sidebar-user-info {
  padding: 16px 26px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.sidebar-pts {
  font-size: 11px;
  color: var(--text-muted);
}
.sidebar-pts strong { color: var(--gold); }

/* ══════════════════════════════════════════════
   CONTENIDO PRINCIPAL
   ══════════════════════════════════════════════ */
.page-content {
  flex: 1;
  padding: 28px;
  width: 0;
  min-width: 0;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 400;
}

/* ══════════════════════════════════════════════
   BOTTOM NAV MOVIL
   ══════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  height: var(--bottom-h);
  z-index: 200;
  backdrop-filter: blur(12px);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 500;
  padding: 6px 4px;
  position: relative;
  transition: var(--ease);
}
.bottom-nav a.on { color: var(--gold); }
.bottom-nav a.on::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--gold);
  border-radius: 0 0 4px 4px;
}
.bottom-nav .nav-ico {
  font-size: 18px;
  line-height: 1;
}

/* ══════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: var(--ease);
}
.card:hover { border-color: var(--border-h); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: var(--ease);
}
.kpi::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle at top right, rgba(255,215,0,0.06), transparent 70%);
  border-radius: 0 var(--r-lg) 0 80px;
}
.kpi:hover { border-color: var(--border-h); box-shadow: var(--shadow-gold); }
.kpi-val {
  font-size: 30px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  font-family: var(--mono);
  margin-bottom: 6px;
}
.kpi-lbl {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.kpi-bar {
  margin-top: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 99px;
  height: 4px;
  overflow: hidden;
}
.kpi-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  transition: width 0.8s cubic-bezier(.4,0,.2,1);
}
.kpi-next {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* ══════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════ */
.form-group { margin-bottom: 20px; }
.label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 7px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  border-radius: var(--r);
  font-size: 14px;
  font-family: var(--font);
  transition: var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255,215,0,0.03);
  box-shadow: 0 0 0 3px rgba(255,215,0,0.08);
}
.input::placeholder { color: var(--text-dim); }
.textarea { min-height: 100px; resize: vertical; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted);
  pointer-events: none;
}
.input[type="file"] {
  padding: 10px 14px;
  cursor: pointer;
}
.input[type="file"]::file-selector-button {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
  transition: var(--ease);
}

/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: var(--r);
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--ease);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255,215,0,0.25);
}
.btn:active { transform: translateY(0); }
.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
  box-shadow: none;
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255,87,87,0.25);
}
.btn-danger:hover {
  background: rgba(255,87,87,0.1);
  border-color: rgba(255,87,87,0.5);
  box-shadow: none;
}
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--r);
}
.btn-icon:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
  box-shadow: none;
}
.btn:disabled, .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ══════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; background: var(--card); }
thead tr { background: rgba(255,215,0,0.03); }
th {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 13px;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,0.015); }

/* ══════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-ok  { background: rgba(61,214,140,0.12); color: var(--success); border: 1px solid rgba(61,214,140,0.2); }
.badge-warn{ background: rgba(255,171,64,0.12); color: var(--warning); border: 1px solid rgba(255,171,64,0.2); }
.badge-err { background: rgba(255,87,87,0.12);  color: var(--danger);  border: 1px solid rgba(255,87,87,0.2); }
.badge-gold{ background: var(--gold-dim);        color: var(--gold);    border: 1px solid var(--border); }
.badge-info{ background: rgba(100,181,246,0.12); color: var(--info);    border: 1px solid rgba(100,181,246,0.2); }

/* ══════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal.show { display: flex; }
.modal-box {
  background: var(--card2);
  border: 1px solid rgba(255,215,0,0.18);
  border-radius: var(--r-lg);
  padding: 32px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.modal-box h3 {
  color: var(--text);
  margin-bottom: 24px;
  font-size: 18px;
  font-weight: 700;
  padding-right: 36px;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: var(--ease);
}
.modal-close:hover { color: var(--text); border-color: var(--text-dim); }

/* ══════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════ */
.alert {
  padding: 13px 18px;
  border-radius: var(--r);
  font-size: 13px;
  margin-bottom: 20px;
  font-weight: 500;
}
.alert-ok   { background: rgba(61,214,140,0.08);  border: 1px solid rgba(61,214,140,0.25);  color: var(--success); }
.alert-err  { background: rgba(255,87,87,0.08);   border: 1px solid rgba(255,87,87,0.25);   color: var(--danger); }
.alert-warn { background: rgba(255,171,64,0.08);  border: 1px solid rgba(255,171,64,0.25);  color: var(--warning); }
.alert-info { background: rgba(100,181,246,0.08); border: 1px solid rgba(100,181,246,0.25); color: var(--info); }

/* ══════════════════════════════════════════════
   MISC UTILITIES
   ══════════════════════════════════════════════ */
.text-gold  { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 11px; }
.fw-700     { font-weight: 700; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8  { gap: 8px; }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
  color: var(--gold);
}
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }

/* Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,215,0,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .page-content {
    padding: 18px;
    padding-bottom: calc(var(--bottom-h) + 20px);
  }
}
@media (max-width: 768px) {
  .h-name { display: none; }
  .h-nivel { display: none; }
  .exit-label { display: none; }
  .logo-sub { display: none; }
  .page-content { padding: 14px; padding-bottom: calc(var(--bottom-h) + 16px); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
