/* ============================================
   PADEL CLUB - Estilos Principales
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #1a6b3c;
  --primary-dark: #134d2c;
  --primary-light: #e8f5ed;
  --accent: #f0b429;
  --accent-dark: #c98a00;
  --bg: #f4f6f5;
  --card-bg: #ffffff;
  --text: #1a1f1c;
  --text-muted: #6b7a70;
  --border: #d6e4db;
  --sidebar-bg: #0f2e1d;
  --sidebar-text: #a8c5b2;
  --sidebar-active: #1a6b3c;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #0dcaf0;
  --success: #198754;
  --purple: #6f42c1;
  --orange: #fd7e14;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(26,107,60,0.08);
  --shadow-lg: 0 8px 32px rgba(26,107,60,0.14);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

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

/* ---- SIDEBAR ---- */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  min-height: 100vh;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo .logo-text {
  font-family: var(--font-display);
  font-size: 28px;
  color: #fff;
  letter-spacing: 2px;
  line-height: 1;
}

.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--sidebar-text);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-user {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.user-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.user-name {
  font-size: 14px; font-weight: 600;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.user-role {
  font-size: 11px; color: var(--sidebar-text);
  text-transform: uppercase; letter-spacing: 1px;
}

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-section-title {
  padding: 12px 24px 6px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(168,197,178,0.5);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 24px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px; font-weight: 400;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.nav-link.active {
  background: rgba(26,107,60,0.3);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 500;
}

.nav-link i { font-size: 18px; width: 20px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* ---- MAIN LAYOUT ---- */
.main-wrapper {
  margin-left: 260px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text);
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.main-content { padding: 28px; flex: 1; }

/* ---- CARDS ---- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px 24px;
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--text);
}

/* ---- STAT CARDS ---- */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 1px;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 13px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  font-weight: 500;
}

.stat-card .stat-accent {
  position: absolute;
  right: -10px; top: -10px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.07;
}

/* ---- BADGES & PILLS ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.badge-success  { background: #d4edda; color: #155724; }
.badge-danger   { background: #f8d7da; color: #721c24; }
.badge-warning  { background: #fff3cd; color: #856404; }
.badge-info     { background: #d1ecf1; color: #0c5460; }
.badge-secondary{ background: #e2e3e5; color: #383d41; }
.badge-primary  { background: var(--primary-light); color: var(--primary-dark); }
.badge-purple   { background: #ede4f5; color: #4b2b8a; }
.badge-orange   { background: #fff0e0; color: #8a4300; }

/* ---- NIVEL BADGE ---- */
.nivel-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px; font-weight: 600;
  color: #fff;
}

/* ---- PROGRESS BAR ---- */
.progress-wrap { background: var(--border); border-radius: 100px; height: 8px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s ease;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none; cursor: pointer;
  font-size: 14px; font-weight: 500;
  font-family: var(--font-body);
  transition: all 0.18s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent  { background: var(--accent); color: #1a1f1c; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b02a37; }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; }

table.data-table {
  width: 100%; border-collapse: collapse;
}

table.data-table thead tr {
  background: var(--bg);
}

table.data-table th {
  padding: 11px 14px;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: var(--bg); }

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

.form-label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--text); letter-spacing: 0.3px;
}

.form-control {
  width: 100%; padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px; font-family: var(--font-body);
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,107,60,0.12);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a70' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ---- ALERTS ---- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning  { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info     { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ---- CANCHA CARD ---- */
.cancha-card {
  border-radius: var(--radius);
  border: 2px solid var(--border);
  overflow: hidden;
  transition: all 0.2s;
  background: var(--card-bg);
}

.cancha-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.cancha-thumb {
  height: 130px;
  background: linear-gradient(135deg, var(--primary) 0%, #2d8a5c 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  position: relative;
}

.cancha-body { padding: 16px; }

.cancha-name {
  font-family: var(--font-display);
  font-size: 20px; letter-spacing: 1px;
  margin-bottom: 6px;
}

.cancha-price {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--primary);
  letter-spacing: 1px;
}

/* ---- RANKING / NIVEL ---- */
.ranking-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.ranking-row:last-child { border-bottom: none; }

.rank-pos {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-muted);
  width: 32px; text-align: center;
}

.rank-pos.gold   { color: #f0b429; }
.rank-pos.silver { color: #a8a8a8; }
.rank-pos.bronze { color: #cd7f32; }

/* ---- LOGIN PAGE ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--sidebar-bg);
}

.login-visual {
  flex: 1;
  background: linear-gradient(160deg, #1a6b3c 0%, #0f2e1d 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}

.login-visual::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border: 60px solid rgba(255,255,255,0.04);
  border-radius: 50%;
  top: -100px; right: -100px;
}

.login-visual::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border: 40px solid rgba(255,255,255,0.04);
  border-radius: 50%;
  bottom: -80px; left: -60px;
}

.login-form-wrap {
  width: 420px;
  background: var(--card-bg);
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 40px;
}

/* ---- SCHEDULE / CALENDAR ---- */
.hour-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: 8px; overflow: hidden;
  font-size: 12px;
}

.hour-cell {
  background: var(--card-bg);
  padding: 8px 6px;
  min-height: 42px;
  position: relative;
}

.hour-label { background: var(--bg); font-weight: 600; color: var(--text-muted); text-align: center; }
.hour-cell.reserved { background: #d4edda; }
.hour-cell.mine { background: #cce5ff; }

/* ---- UTILITIES ---- */
.text-primary   { color: var(--primary) !important; }
.text-accent    { color: var(--accent) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-danger    { color: var(--danger) !important; }
.text-success   { color: var(--success) !important; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.d-flex   { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.gap-16  { gap: 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.w-full { width: 100%; }

/* ---- RESPONSIVE ---- */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
  .login-visual { display: none; }
  .login-form-wrap { width: 100%; }
}
