/* ═══════════════════════════════════════════════
   LA ZONA GYM — Global Styles
   Dark industrial theme with cyan accent
   ═══════════════════════════════════════════════ */

:root {
  --cyan: #00b4d8;
  --cyan-dark: #0077a8;
  --cyan-glow: rgba(0,180,216,0.25);
  --bg-dark: #0d0d1a;
  --bg-card: #13131f;
  --bg-card2: #1a1a2e;
  --bg-input: #0f0f1c;
  --border: rgba(0,180,216,0.18);
  --border-subtle: rgba(255,255,255,0.07);
  --text: #e8e8f0;
  --text-muted: #6b6b8a;
  --text-dim: #9898b8;
  --red: #f72585;
  --green: #06d6a0;
  --yellow: #ffd166;
  --orange: #fb8500;
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-cyan: 0 0 20px rgba(0,180,216,0.15);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Barlow', sans-serif;
  --font-cond: 'Barlow Condensed', sans-serif;
  --transition: all 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ══════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-logo-img {
  width: 100%;
  max-width: 190px;
  height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.sidebar-nav {
  padding: 12px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}
.nav-item svg {
  width: 18px; height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}
.nav-item:hover { background: rgba(0,180,216,0.1); color: var(--cyan); }
.nav-item.active { background: rgba(0,180,216,0.15); color: var(--cyan); border-left: 3px solid var(--cyan); padding-left: 9px; }

.nav-divider { height: 1px; background: var(--border-subtle); margin: 8px 0; }
.nav-label { font-family: var(--font-cond); font-size: 11px; color: var(--text-muted); letter-spacing: 1.5px; padding: 4px 12px; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-info { display: flex; align-items: center; gap: 10px; flex: 1; overflow: hidden; }
.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--cyan-dark), var(--cyan));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--bg-dark);
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); font-family: var(--font-cond); letter-spacing: 0.5px; }
.logout-btn { color: var(--text-muted); transition: var(--transition); cursor: pointer; }
.logout-btn:hover { color: var(--red); }
.logout-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* ── Topbar (mobile) ── */
.topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 200;
}
.topbar-logo { height: 36px; object-fit: contain; border-radius: 4px; }
.topbar-logout { margin-left: auto; color: var(--text-muted); }
.topbar-logout svg { width: 22px; height: 22px; fill: currentColor; }

.hamburger {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 5px; padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--cyan); border-radius: 2px;
  transition: var(--transition);
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* ── Main content ── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 28px;
}

/* ══════════════════════════════════════════════
   LOGIN
══════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,180,216,0.08) 0%, transparent 70%);
  top: -200px; right: -200px;
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(247,37,133,0.05) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow), var(--shadow-cyan);
  animation: slideUp 0.4s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-logo {
  width: 140px;
  height: 80px;
  object-fit: contain;
  display: block;
  margin: 0 auto 24px;
  border-radius: 8px;
}
.login-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 3px;
  color: var(--cyan);
  text-align: center;
  margin-bottom: 4px;
}
.login-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 32px;
  font-family: var(--font-cond);
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-family: var(--font-cond);
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: var(--bg-card2); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ══════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; fill: currentColor; }

.btn-primary {
  background: var(--cyan);
  color: var(--bg-dark);
}
.btn-primary:hover { background: var(--cyan-dark); transform: translateY(-1px); box-shadow: 0 4px 16px var(--cyan-glow); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-danger { background: rgba(247,37,133,0.15); color: var(--red); border: 1px solid rgba(247,37,133,0.3); }
.btn-danger:hover { background: rgba(247,37,133,0.25); }

.btn-success { background: rgba(6,214,160,0.15); color: var(--green); border: 1px solid rgba(6,214,160,0.3); }
.btn-success:hover { background: rgba(6,214,160,0.25); }

.btn-warning { background: rgba(255,209,102,0.15); color: var(--yellow); border: 1px solid rgba(255,209,102,0.3); }
.btn-warning:hover { background: rgba(255,209,102,0.25); }

.btn-full { width: 100%; justify-content: center; padding: 12px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: 6px; }

/* ══════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--text);
}
.page-title span { color: var(--cyan); }

/* ══════════════════════════════════════════════
   STATS CARDS
══════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent, var(--cyan));
}
.stat-card:hover { border-color: var(--accent, var(--cyan)); transform: translateY(-2px); }
.stat-value {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
  color: var(--accent, var(--cyan));
  margin-bottom: 4px;
}
.stat-label {
  font-family: var(--font-cond);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.card-title {
  font-family: var(--font-cond);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text);
}
.card-body { padding: 20px; }

/* ══════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}
tbody tr:hover { background: rgba(0,180,216,0.04); }
tbody tr:last-child { border-bottom: none; }
td { padding: 12px 14px; vertical-align: middle; }

/* ══════════════════════════════════════════════
   BADGES / STATUS
══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font-cond);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-green { background: rgba(6,214,160,0.15); color: var(--green); border: 1px solid rgba(6,214,160,0.3); }
.badge-red { background: rgba(247,37,133,0.15); color: var(--red); border: 1px solid rgba(247,37,133,0.3); }
.badge-yellow { background: rgba(255,209,102,0.15); color: var(--yellow); border: 1px solid rgba(255,209,102,0.3); }
.badge-cyan { background: rgba(0,180,216,0.15); color: var(--cyan); border: 1px solid rgba(0,180,216,0.3); }
.badge-gray { background: rgba(107,107,138,0.2); color: var(--text-muted); border: 1px solid var(--border-subtle); }

/* Insignia */
.insignia { font-size: 13px; }
.insignia-bronce { color: #cd7f32; }
.insignia-plata { color: #a8a9ad; }
.insignia-oro { color: #ffd700; }

/* ══════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.2s ease;
  box-shadow: var(--shadow);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; transition: var(--transition);
}
.modal-close:hover { color: var(--red); }
.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--cyan);
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px; z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 260px;
  max-width: 360px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-error { border-left: 3px solid var(--red); }
.toast.toast-info { border-left: 3px solid var(--cyan); }

/* ══════════════════════════════════════════════
   FILTERS BAR
══════════════════════════════════════════════ */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 140px; flex: 1; }
.filter-label {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════
   ALERT / ERROR
══════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error { background: rgba(247,37,133,0.1); border: 1px solid rgba(247,37,133,0.3); color: var(--red); }
.alert-success { background: rgba(6,214,160,0.1); border: 1px solid rgba(6,214,160,0.3); color: var(--green); }

/* ══════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; fill: var(--border); margin-bottom: 12px; }
.empty-state p { font-family: var(--font-cond); font-size: 14px; letter-spacing: 0.5px; }

/* ══════════════════════════════════════════════
   TABS
══════════════════════════════════════════════ */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition);
}
.tab:hover { border-color: var(--cyan); color: var(--cyan); }
.tab.active { background: rgba(0,180,216,0.15); border-color: var(--cyan); color: var(--cyan); }

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  .topbar { display: flex; }
  .main-content { margin-left: 0; padding: 72px 16px 24px; }

  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .filter-bar { flex-direction: column; }
  .filter-group { min-width: 100%; }

  .modal { padding: 20px; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
  .tabs { gap: 6px; }
  .tab { padding: 6px 12px; font-size: 12px; }
}

/* ══════════════════════════════════════════════
   MISC UTILITIES
══════════════════════════════════════════════ */
.text-cyan { color: var(--cyan); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.fw-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Glow line accent */
.glow-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  margin: 20px 0;
  opacity: 0.4;
}
