/* ==========================================
   PADEL PRO - Clean Emerald Design System
   ========================================== */

/* Las tipografias se cargan desde <link> en el <head> de index.html.
   Un @import aqui encadenaba tres viajes antes de pintar texto: primero este
   CSS, luego el CSS de las fuentes, luego las fuentes. */

:root {
  /* Color Palette - SaaS Clean Emerald */
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #ecfdf5;
  --secondary: #0f172a;
  --secondary-light: #1e293b;
  
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border: #e2e8f0;
  --border-focus: #a7f3d0;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --mobile-gutter: clamp(1rem, 5vw, 1.5rem);
  --transition: color 180ms var(--ease-out), background-color 180ms var(--ease-out), border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out), transform 160ms var(--ease-out), opacity 160ms var(--ease-out);
}

/* ==========================================
   Resets & Base Styles
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
a,
[role="button"] {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--secondary);
  font-weight: 700;
}

/* ==========================================
   Utility Classes & Layouts
   ========================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

/* ==========================================
   Header & Dynamic Navigation
   ========================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 72px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================
   CONTROLES QUE ANTES ERAN ENLACES

   El logo, la navegación, las insignias y el selector privado/social eran
   <a> sin href o <div onclick>: no se podían enfocar ni pulsar con Intro,
   así que con teclado no se podía navegar por el sitio. Ahora son <button>.

   El navegador impone a <button> su propia tipografía (Arial 13px), y esto
   la devuelve a la del documento. Va AQUÍ, antes de cada componente y con la
   misma especificidad, para que cada uno siga mandando sobre la suya: puesto
   al final del fichero, `button.logo` ganaba a `.logo` y le borraba el Outfit
   de 1,5 rem.
   ========================================== */
.logo,
.nav-link,
.link,
.mode-radio,
.user-badge,
.wallet-badge,
.slot-item,
.rank-name {
  font: inherit;
  background: none;
  border: none;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
}

.logo {
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--secondary);
  text-decoration: none;
  cursor: pointer;
}

.logo span {
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
}

.nav-link:hover {
  color: var(--primary);
  background-color: var(--primary-light);
}

.nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--secondary-light);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.user-badge:hover {
  background-color: var(--secondary);
}

.wallet-badge {
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(5, 150, 105, 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--secondary);
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-menu-toggle:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-light);
}

/* ==========================================
   Módulo 1: Landing Page (Pública)
   ========================================== */
.hero {
  padding: 5rem 0 4rem 0;
  background: radial-gradient(circle at 80% 20%, #f0fdf4 0%, var(--bg-page) 100%);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(5, 150, 105, 0.1);
}

.hero h1 {
  font-size: 3.5rem;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.hero h1 span {
  color: var(--primary);
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 550px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.btn-secondary {
  background-color: #fff;
  color: var(--secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--bg-page);
  transform: translateY(-2px);
}

.hero-image-container {
  position: relative;
  height: 380px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #dcfce7 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
  box-shadow: var(--shadow-xl);
}

.hero-court-graphic {
  flex-grow: 1;
  border: 2px dashed rgba(5, 150, 105, 0.3);
  border-radius: var(--radius-md);
  margin: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: rgba(255,255,255,0.4);
}

.hero-court-graphic::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 2px dashed rgba(5, 150, 105, 0.3);
}

.hero-court-graphic::after {
  content: '🎾';
  font-size: 2rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(15deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.section-padding {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-title h2 {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.section-title p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.courts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.court-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.court-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.court-image {
  height: 180px;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
}

.court-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--secondary);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.court-features {
  padding: 1.5rem;
}

.court-features h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.court-features p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.feature-tag {
  font-size: 0.75rem;
  background-color: var(--bg-page);
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.court-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.court-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
}

.court-price span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Tariff Board */
.tariff-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-top: 2rem;
}

.tariff-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.tariff-table th, .tariff-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.tariff-table th {
  font-family: 'Outfit', sans-serif;
  color: var(--secondary);
  font-weight: 600;
}

.tariff-table tr:last-child td {
  border-bottom: none;
}

.contact-section {
  background-color: var(--secondary);
  color: #fff;
  padding: 5rem 0;
  border-radius: var(--radius-lg);
  margin-top: 3rem;
  position: relative;
  overflow: hidden;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.contact-info h2 {
  color: #fff;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.contact-info p {
  color: var(--text-light);
  margin-bottom: 2rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.contact-form {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background-color: rgba(255, 255, 255, 0.12);
}

/* ==========================================
   Módulo 2: App de Usuario (Reservas)
   ========================================== */
.booking-section {
  padding: 3rem 0;
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

.search-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

.search-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}

.search-filters label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.search-filters select, .search-filters input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.search-filters select:focus, .search-filters input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.date-selector-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
  scrollbar-width: none; /* Firefox */
}

.date-selector-strip::-webkit-scrollbar {
  display: none; /* Safari & Chrome */
}

.date-nav { display: flex; align-items: stretch; gap: 0.5rem; margin-bottom: 1.5rem; }
.date-arrow {
  flex: 0 0 36px; border: 1px solid var(--border); background: var(--bg-card);
  border-radius: var(--radius-md); cursor: pointer; font-size: 1.3rem; line-height: 1;
  color: var(--secondary); transition: var(--transition);
}
.date-arrow:hover:not(:disabled) { background: var(--primary-light); color: var(--primary); border-color: var(--primary-light); }
.date-arrow:disabled { opacity: 0.35; cursor: not-allowed; }

.date-btn {
  flex: 1 1 0;
  min-width: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.date-btn em { font-size: 0.62rem; font-style: normal; text-transform: uppercase; color: var(--text-light); margin-top: 0.1rem; }
.date-btn.active em { color: rgba(255,255,255,0.85); }
.date-jump-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.75rem; }

.date-btn:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.date-btn.active {
  border-color: var(--primary);
  background-color: var(--primary);
  color: #fff;
}

.date-btn.active span {
  color: rgba(255, 255, 255, 0.8);
}

.date-btn.active strong {
  color: #fff;
}

.date-btn span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
}

.date-btn strong {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--secondary);
  margin-top: 0.25rem;
}

/* Scheduler Hourly Board */
.courts-slots-board {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.court-slots-row {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.court-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.court-row-title h3 {
  font-size: 1.1rem;
}

.court-row-title span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.slot-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: var(--bg-page);
}

.slot-item:hover:not(.booked) {
  border-color: var(--primary);
  background-color: var(--primary-light);
  transform: translateY(-2px);
}

.slot-item.active {
  border-color: var(--primary);
  background-color: var(--primary);
  color: #fff;
}

.slot-item.active .slot-price {
  color: rgba(255, 255, 255, 0.9);
}

.slot-time {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary);
}

.slot-item.active .slot-time {
  color: #fff;
}

.slot-price {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 0.15rem;
}

.slot-item.booked {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
  color: var(--text-light);
  cursor: not-allowed;
}

.slot-item.booked .slot-time {
  color: var(--text-light);
  text-decoration: line-through;
}

.slot-item.booked .slot-price {
  color: var(--text-light);
}

/* Sidebar Drawer/Panel */
.booking-summary-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 96px;
}

.booking-summary-card h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.summary-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.summary-detail-row span:first-child {
  color: var(--text-muted);
}

.summary-detail-row span:last-child {
  font-weight: 600;
  color: var(--secondary);
}

.summary-total {
  border-top: 1px dashed var(--border);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.booking-mode-select {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.mode-radio {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8rem;
  font-weight: 600;
}

.mode-radio:hover {
  background-color: var(--bg-page);
}

.mode-radio.active {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary);
}

/* Social Open Matches Tab */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.match-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.match-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.match-level {
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.match-time {
  font-weight: 700;
  font-size: 1rem;
}

.match-players-slots {
  display: flex;
  gap: 0.35rem;
  margin: 1rem 0;
}

.player-bubble {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: var(--bg-page);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.player-bubble.joined {
  background-color: var(--secondary-light);
  border-color: var(--secondary);
  color: #fff;
}

.player-bubble.empty {
  border-style: dashed;
  color: var(--text-light);
}

.match-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

/* User Wallet Card */
.wallet-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

.wallet-balance-box {
  background: radial-gradient(circle at 10% 20%, #059669 0%, #047857 100%);
  color: #fff;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}

.wallet-balance-box span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.wallet-balance-box strong {
  font-size: 2.25rem;
  font-weight: 800;
  display: block;
  margin-top: 0.25rem;
}

.wallet-refill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.refill-btn {
  background-color: var(--bg-page);
  border: 1px solid var(--border);
  padding: 0.5rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
}

.refill-btn:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* User Profile & History */
.profile-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle at 30% 20%, #059669 0%, #047857 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-identity h3 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.profile-level-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
  background-color: var(--primary-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.profile-level-badge strong {
  color: var(--primary);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.profile-stat {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.profile-stat span {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.profile-stat strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--secondary);
  margin-top: 0.25rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-page);
}

.history-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.history-icon.private {
  background-color: var(--primary-light);
}

.history-icon.social {
  background-color: #e0f2fe;
}

.history-info {
  flex-grow: 1;
  min-width: 0;
}

.history-info strong {
  display: block;
  font-size: 0.95rem;
  color: var(--secondary);
}

.history-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.history-meta strong {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
}

/* ==========================================
   Módulo 3: Admin Dashboard
   ========================================== */
.admin-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.admin-sidebar {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  height: fit-content;
}

.admin-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-menu-btn {
  text-align: left;
  background: none;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.admin-menu-btn:hover {
  background-color: var(--bg-page);
  color: var(--primary);
}

.admin-menu-btn.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.metric-info strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--secondary);
}

.admin-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.admin-table th {
  font-family: 'Outfit', sans-serif;
  color: var(--secondary);
  background-color: var(--bg-page);
  font-weight: 600;
}

.admin-table tr:hover td {
  background-color: rgba(248, 250, 252, 0.5);
}

.badge-status {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.badge-maintenance {
  background-color: #fef3c7;
  color: var(--warning);
}

.badge-game-private {
  background-color: #f1f5f9;
  color: var(--text-muted);
}

.badge-game-social {
  background-color: #e0f2fe;
  color: var(--info);
}

.action-btn-del {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.action-btn-del:hover {
  background-color: #fee2e2;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Quick Notify Modal style */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--secondary);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  font-weight: 500;
  font-size: 0.9rem;
  z-index: 1000;
  animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================
   Identity switcher (login simulado)
   ========================================== */
.user-badge svg { opacity: 0.7; }

.identity-menu {
  position: absolute;
  top: 60px;
  right: 0;
  width: 280px;
  background-color: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 0.5rem;
  z-index: 200;
}

.identity-menu-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  font-weight: 700;
  padding: 0.5rem 0.75rem;
}

.identity-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.identity-option:hover { background-color: var(--bg-page); }
.identity-option.active { background-color: var(--primary-light); }

.identity-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background-color: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.identity-meta { flex-grow: 1; min-width: 0; }
.identity-meta strong { display: block; font-size: 0.9rem; color: var(--secondary); }
.identity-meta span { font-size: 0.78rem; color: var(--text-muted); }
.identity-check { color: var(--primary); font-weight: 800; }

/* ==========================================
   Inputs sobre fondo claro (admin / modal)
   ========================================== */
.form-control.input-light {
  background-color: var(--bg-page);
  border: 1px solid var(--border);
  color: var(--text-main);
}
.form-control.input-light:focus {
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}
.lbl-dark { color: var(--text-muted) !important; }

/* ==========================================
   Modal
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background-color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background-color: #fff;
}

.modal-header h3 { font-size: 1.2rem; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.modal-close:hover { background-color: var(--bg-page); color: var(--danger); }

.modal-body { padding: 1.5rem; }

/* ==========================================
   Wallet info + transacciones
   ========================================== */
.wallet-info-box {
  background-color: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.wallet-info-box strong { font-size: 0.9rem; color: var(--secondary); display: block; margin-bottom: 0.35rem; }
.wallet-info-box p { font-size: 0.82rem; color: var(--text-muted); }

.tx-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-page);
}
.tx-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; flex-shrink: 0;
}
.tx-icon.credit { background-color: var(--primary-light); color: var(--primary); }
.tx-icon.debit { background-color: #fee2e2; color: var(--danger); }
.tx-info { flex-grow: 1; min-width: 0; }
.tx-info strong { display: block; font-size: 0.88rem; color: var(--secondary); }
.tx-info span { font-size: 0.75rem; color: var(--text-muted); }
.tx-amount { font-weight: 800; font-size: 0.95rem; }
.tx-amount.credit { color: var(--primary); }
.tx-amount.debit { color: var(--danger); }

/* ==========================================
   Mini-botones (editar / cancelar)
   ========================================== */
.mini-btn {
  border: 1px solid var(--border);
  background-color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.mini-btn.edit { color: var(--info); border-color: #bfdbfe; }
.mini-btn.edit:hover { background-color: #e0f2fe; }
.mini-btn.cancel { color: var(--danger); border-color: #fecaca; }
.mini-btn.cancel:hover { background-color: #fee2e2; }

.history-actions { display: flex; gap: 0.4rem; margin-top: 0.35rem; }
.lock-note { font-size: 0.72rem; color: var(--text-light); font-weight: 600; }

/* ==========================================
   Gestión de pistas (admin) — miniaturas
   ========================================== */
.court-admin-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-page);
}
.court-thumb {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.court-thumb.placeholder {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
}

/* ==========================================
   Editor de contenido
   ========================================== */
.editor-group-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.editor-group-title:first-child { margin-top: 0; }

/* ==========================================
   Panel de fondos (superadmin)
   ========================================== */
.fund-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
  background-color: var(--bg-page);
}
.fund-user { display: flex; align-items: center; gap: 0.65rem; min-width: 180px; }
.fund-user strong { color: var(--secondary); font-size: 0.92rem; }
.fund-balance { font-weight: 800; color: var(--primary); font-size: 1.1rem; min-width: 80px; }
.fund-form { display: flex; gap: 0.5rem; flex-wrap: wrap; flex-grow: 1; align-items: center; }

/* Hero con imagen de fondo */
.hero-court-graphic.has-image::after { display: none; }
.hero-court-graphic.has-image { border-style: solid; }

/* ==========================================
   Auth: botones header, enlaces, login admin
   ========================================== */
.auth-actions { display: flex; align-items: center; gap: 0.65rem; }

.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.85rem; }

.link {
  padding: 0;
  text-decoration: underline;
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.link:hover { text-decoration: underline; }

.admin-login-head { text-align: center; margin-bottom: 1.5rem; }
.admin-login-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  border-radius: var(--radius-full);
  background: radial-gradient(circle at 30% 20%, #059669 0%, #047857 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
}

@media (max-width: 768px) {
  .auth-actions .btn-sm { padding: 0.4rem 0.6rem; font-size: 0.78rem; }
}

/* Spinner (anti doble-submit) */
.spin {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Medidor de fortaleza de contraseña / barras de progreso */
.pw-meter { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 0.4rem 0 0.15rem; }
.pw-bar { height: 100%; width: 0; background: var(--danger); transition: width 0.25s, background 0.25s; }

/* Skeleton de carga */
.sk-line { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%); background-size: 400% 100%; animation: skload 1.2s ease infinite; }
@keyframes skload { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Calendario del jugador */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.7rem; font-weight: 700; color: var(--text-light); padding: 2px 0; }
.cal-cell { position: relative; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; border-radius: var(--radius-sm); background: var(--bg-page); color: var(--text-muted); }
.cal-cell.empty { background: transparent; }
.cal-cell.today { outline: 2px solid var(--primary); color: var(--secondary); font-weight: 700; }
.cal-cell.has { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.cal-dot { position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }

/* Filtro de partidos sociales */
.social-filter-bar { grid-column: 1/-1; margin-bottom: 0.25rem; }

/* Selector de equipos (resultado) */
.team-picker { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.5rem 0 1rem; }
.team-pick { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-page); font-size: 0.88rem; }
.team-pick-opts { display: flex; gap: 0.75rem; }
.team-pick-opts label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); cursor: pointer; }

/* Today: etiqueta Finalizado */
.today-tag.fin { background: #e2e8f0; color: var(--text-muted); }
.today-item.is-finished { opacity: 0.7; }

/* Avatar grande (perfil/edición/público) + avatar con imagen */
.avatar-lg { width: 72px; height: 72px; border-radius: var(--radius-full); background-size: cover; background-position: center; flex-shrink: 0; }
.avatar-lg.placeholder { background: radial-gradient(circle at 30% 20%, #059669 0%, #047857 100%); color: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.6rem; }
.profile-avatar.img { background-size: cover; background-position: center; color: transparent; }

/* Perfil público */
.pp-info { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.pp-row { display: flex; justify-content: space-between; padding: 0.55rem 0.85rem; font-size: 0.88rem; border-bottom: 1px solid var(--border); }
.pp-row:last-child { border-bottom: none; }
.pp-row span { color: var(--text-muted); }
.pp-row strong { color: var(--secondary); }

/* Fila de ranking clicable */
.rank-row:hover td { background-color: var(--primary-light); }

/* Filas de configuración de notificaciones */
.notif-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.notif-row:last-of-type { border-bottom: none; }
.notif-info strong { display: block; font-size: 0.92rem; color: var(--secondary); }
.notif-info span { font-size: 0.78rem; color: var(--text-muted); }

/* Reserva rápida */
.quickbook-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.quickbook-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }

/* Valoración media en tarjeta de pista */
.court-rating { font-size: 0.85rem; font-weight: 700; color: #d97706; background: #fffbeb; padding: 0.1rem 0.45rem; border-radius: var(--radius-full); white-space: nowrap; }

/* Chat del partido */
.chat-box { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.4rem; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.75rem; background: var(--bg-page); }
.chat-msg { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.4rem 0.65rem; font-size: 0.85rem; max-width: 85%; }
.chat-msg.mine { align-self: flex-end; background: var(--primary-light); border-color: var(--primary-light); }
.chat-author { display: block; font-size: 0.68rem; font-weight: 700; color: var(--text-muted); margin-bottom: 0.1rem; }

/* Mapa de calor de ocupación */
.heat-grid { display: grid; grid-template-columns: 52px repeat(7, 1fr); gap: 3px; min-width: 460px; }
.heat-h { text-align: center; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); padding: 2px 0; }
.heat-row { font-size: 0.68rem; color: var(--text-light); display: flex; align-items: center; }
.heat-cell { aspect-ratio: 2.4/1; min-height: 22px; border-radius: 4px; background: var(--bg-page); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; }

/* Ficha de pista */
.cd-hero { height: 220px; border-radius: var(--radius-md); background-size: cover; background-position: center; background-color: var(--secondary); }
.cd-hero.placeholder { display: flex; align-items: center; justify-content: center; color: #fff; font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.3rem; background: linear-gradient(135deg, var(--secondary), var(--secondary-light)); }
.cd-thumbs { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.cd-thumb { width: 64px; height: 44px; border-radius: var(--radius-sm); background-size: cover; background-position: center; cursor: pointer; border: 1px solid var(--border); }

/* Gráfico de barras (dashboard) */
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 0.5rem 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-col .bar { width: 70%; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; transition: height 0.3s; }
.bar-col span { font-size: 0.6rem; color: var(--text-light); margin-top: 2px; }

/* Solicitudes de amistad */
.friend-reqs { background: var(--primary-light); border-radius: var(--radius-md); padding: 0.75rem; margin-bottom: 0.5rem; }

/* Footer legal + vista legal */
.footer-legal { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: flex-end; }
.footer-legal .link { font-size: 0.8rem; color: var(--text-light); }
.footer-legal .link:hover { color: #fff; }
.legal-body { font-size: 0.95rem; line-height: 1.7; color: var(--text-main); }
.legal-body h3 { margin: 1.2rem 0 0.5rem; }

/* ==========================================
   Partidos Hoy (hero)
   ========================================== */
.today-list { flex-grow: 1; display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0; overflow-y: auto; }
.today-item {
  display: flex; align-items: center; gap: 0.75rem;
  background: rgba(255, 255, 255, 0.75); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.55rem 0.75rem;
}
.today-time { font-family: 'Outfit', sans-serif; font-weight: 800; color: var(--primary); font-size: 0.95rem; min-width: 42px; }
.today-info { flex-grow: 1; min-width: 0; }
.today-info strong { display: block; font-size: 0.85rem; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-info span { font-size: 0.72rem; color: var(--text-muted); }
.today-tag { font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: var(--radius-full); white-space: nowrap; }
.today-tag.social { background: #e0f2fe; color: var(--info); }
.today-tag.priv { background: var(--primary-light); color: var(--primary); }

/* ==========================================
   Ranking
   ========================================== */
.ranking-table td:first-child { font-size: 1.05rem; width: 48px; text-align: center; }

/* ==========================================
   Detalle de partido / equipos / resultado
   ========================================== */
.teams-vs { display: flex; align-items: stretch; gap: 0.75rem; }
.team-box { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.85rem; background: var(--bg-page); }
.team-box.a { border-top: 3px solid var(--primary); }
.team-box.b { border-top: 3px solid var(--info); }
.team-title { font-size: 0.75rem; text-transform: uppercase; font-weight: 700; color: var(--text-muted); margin-bottom: 0.5rem; }
.team-box ul { list-style: none; padding: 0; margin: 0; }
.team-box li { font-size: 0.9rem; padding: 0.2rem 0; color: var(--secondary); }
.vs { display: flex; align-items: center; font-weight: 800; color: var(--text-light); }
.result-box { text-align: center; margin-top: 1rem; padding: 1rem; background: var(--primary-light); border-radius: var(--radius-md); }
.result-score { font-family: 'Outfit', sans-serif; font-size: 2rem; font-weight: 800; color: var(--primary); }

/* Toggle inline (privacidad de stats) */
.toggle-inline { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted); cursor: pointer; }
.toggle-inline input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* Historial de usuario (admin) */
.hist-ev { display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.hist-ev:last-child { border-bottom: none; }
.hist-ev-ic { font-size: 1rem; width: 24px; text-align: center; flex-shrink: 0; }
.hist-ev strong { display: block; font-size: 0.85rem; color: var(--secondary); font-weight: 600; }
.hist-ev span { font-size: 0.75rem; color: var(--text-muted); }

/* ==========================================
   Animación de click (escritorio): pala + pelota
   ========================================== */
.click-fx { position: fixed; z-index: 9999; pointer-events: none; transform: translate(-50%, -50%); font-size: 20px; will-change: transform; }
.click-fx .cfx-ball { display: inline-block; animation: cfxBall 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
.click-fx .cfx-paddle { position: absolute; left: -20px; top: -6px; display: inline-block; transform-origin: bottom right; animation: cfxPaddle 0.4s ease-out forwards; }
@keyframes cfxBall {
  0% { transform: translate(0, 0) scale(0.5) rotate(0deg); opacity: 1; }
  100% { transform: translate(36px, -44px) scale(1) rotate(260deg); opacity: 0; }
}
@keyframes cfxPaddle {
  0% { transform: rotate(-40deg) scale(0.7); opacity: 0; }
  35% { opacity: 1; }
  60% { transform: rotate(12deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(0.85); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .click-fx { display: none; } }

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .hero h1 {
    font-size: 2.75rem;
  }
  
  .hero p {
    margin: 0 auto 2rem auto;
  }
  
  .hero-image-container {
    height: 300px;
    max-width: 500px;
    margin: 0 auto;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .app-grid {
    grid-template-columns: 1fr;
  }
  
  .booking-summary-card {
    position: static;
    margin-top: 2rem;
  }
  
  .admin-grid {
    /* minmax(0, …): con 1fr a secas la columna no puede encogerse. */
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  /* El nav se convierte en un panel desplegable bajo el header */
  .nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0.25rem;
    background-color: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 1.5rem 1rem;
  }

  .nav.nav-open {
    display: flex;
  }

  .nav-link {
    padding: 0.85rem 1rem;
  }
}

@media (max-width: 576px) {
  /* Subnav de la app scrollable horizontalmente para no apilar las pestañas */
  .app-subnav {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .app-subnav::-webkit-scrollbar {
    display: none;
  }

  .app-subnav button {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* En pantallas muy compactas ocultamos el nombre para dejar espacio al saldo */
  .user-badge #header-username {
    display: none;
  }

  .user-badge {
    padding: 0.5rem 0.65rem;
  }

  .header-actions {
    gap: 0.5rem;
  }
}

/* ==========================================
   CONTROL DE ACCESO (puertas)
   ========================================== */

/* --- Tarjeta de apertura del usuario --- */
.door-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.door-card.is-ready { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.door-card.is-open { border-color: var(--success); background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 60%); }
.door-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.85rem; }
.door-card-head strong { font-family: 'Outfit', sans-serif; font-size: 1.35rem; color: var(--secondary); }
.door-badge {
  background: var(--primary-light); color: var(--primary);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.25rem 0.6rem; border-radius: var(--radius-full);
}
.door-court { color: var(--text-muted); font-size: 0.88rem; }
.door-status {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem;
  font-size: 0.92rem; font-weight: 500; color: var(--text-main);
  padding: 0.7rem 0.85rem; border-radius: var(--radius-md);
  background: #f1f5f9; margin-bottom: 1rem;
}
.door-status.good { background: var(--primary-light); color: var(--primary-dark); }
.door-status-ic { font-size: 1.1rem; }
.door-detail { font-size: 0.78rem; color: var(--text-muted); width: 100%; }
.door-card.is-open .door-detail { color: var(--primary-dark); }
.door-open-btn {
  width: 100%; border: none; cursor: pointer;
  background: var(--primary); color: #fff;
  font-family: 'Outfit', sans-serif; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 1.1rem 1rem; border-radius: var(--radius-md);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.door-open-btn:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.door-open-btn:active:not(:disabled) { transform: translateY(0); }
.door-open-btn:disabled { background: #cbd5e1; color: #64748b; cursor: not-allowed; }
.door-card.is-open .door-open-btn { background: var(--success); color: #fff; }
.door-card.is-open .door-open-btn:disabled { background: var(--success); color: #fff; opacity: 1; }
.door-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.6rem; line-height: 1.5; display: block; }

@media (max-width: 640px) {
  .door-card-head strong { font-size: 1.15rem; }
  .door-open-btn { font-size: 1.05rem; padding: 1.2rem 1rem; }
}

/* --- Panel de administración --- */
.access-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.access-tab {
  background: #fff; border: 1px solid var(--border); color: var(--text-muted);
  padding: 0.5rem 1rem; border-radius: var(--radius-md); cursor: pointer;
  font-family: 'Outfit', sans-serif; font-size: 0.9rem; font-weight: 500; transition: var(--transition);
}
.access-tab.active { background: var(--primary-light); border-color: var(--primary-light); color: var(--primary); font-weight: 600; }

.access-alert {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem;
  padding: 0.85rem 1.1rem; border-radius: var(--radius-md); margin-bottom: 1.25rem;
  font-weight: 600; font-size: 0.92rem;
}
.access-alert.ok { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #a7f3d0; }
.access-alert.danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.access-stats { margin-bottom: 1.5rem; }
.kpi-mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; }
.kpi-mini {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.25rem;
}
.kpi-mini span { font-size: 0.75rem; color: var(--text-muted); }
.kpi-mini strong { font-family: 'Outfit', sans-serif; font-size: 1.5rem; }

.sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.sys-item {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.2rem;
}
.sys-item strong { font-size: 0.92rem; color: var(--secondary); }
.sys-item span { font-size: 0.78rem; color: var(--text-muted); }

.door-row {
  display: grid; grid-template-columns: 1fr auto; gap: 0.75rem 1rem;
  padding: 1rem 0; border-bottom: 1px solid var(--border);
}
.door-row:last-child { border-bottom: none; }
.door-row-main strong { display: block; font-size: 1rem; color: var(--secondary); font-family: 'Outfit', sans-serif; }
.door-row-sub { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }
.door-row-state { text-align: right; }
.door-row-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ready-strip { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.ready-item { font-size: 0.72rem; color: var(--text-muted); background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-full); padding: 0.15rem 0.55rem; }

.pill {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  padding: 0.2rem 0.6rem; border-radius: var(--radius-full);
  background: #f1f5f9; color: var(--text-muted);
}
.pill.ok { background: var(--primary-light); color: var(--primary); }
.pill.warn { background: #fef3c7; color: #92400e; }

.access-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.access-filters .form-control { max-width: 190px; }

.diag-row { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.diag-row:last-child { border-bottom: none; }
.diag-row strong { display: block; font-size: 0.88rem; color: var(--secondary); }
.diag-row span + div span { display: block; font-size: 0.78rem; color: var(--text-muted); }

.cred-box {
  background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem; font-size: 0.8rem; color: var(--text-muted);
  word-break: break-all; margin-bottom: 0.5rem;
}
.cred-box.selectable { user-select: all; color: var(--text-main); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.chk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.35rem; }
.chk-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--text-main); padding: 0.35rem 0; cursor: pointer; }

.wz-dots { display: flex; gap: 0.4rem; justify-content: center; margin-bottom: 1.25rem; }
.wz-dot { width: 34px; height: 4px; border-radius: var(--radius-full); background: var(--border); }
.wz-dot.on { background: var(--primary); }

@media (max-width: 768px) {
  .door-row { grid-template-columns: 1fr; }
  .door-row-state { text-align: left; }
  .access-filters .form-control { max-width: none; flex: 1 1 140px; }
}

/* ---- Asistente de configuración de puertas ---- */
.wz-rail { display: flex; gap: 0.3rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.wz-step {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.68rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.03em;
}
.wz-step i { width: 22px; height: 3px; border-radius: var(--radius-full); background: var(--border); display: block; }
.wz-step.done i { background: var(--primary-light); }
.wz-step.now i { background: var(--primary); }
.wz-step.now { color: var(--primary); font-weight: 700; }

.wz-lead { font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 600; color: var(--secondary); margin: 0 0 0.75rem; }
.wz-note { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; margin: 0.5rem 0; }
.wz-note a { color: var(--primary); }
.wz-ok { font-size: 0.85rem; color: var(--primary); font-weight: 600; margin: 0.5rem 0; }
.wz-big { font-size: 1.05rem; padding: 0.8rem 0.9rem; }

.wz-list { display: flex; flex-direction: column; gap: 0.75rem; margin: 1.25rem 0; }
.wz-list > div {
  background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.75rem 0.9rem;
}
.wz-list b { display: block; font-size: 0.9rem; color: var(--secondary); }
.wz-list span { font-size: 0.82rem; color: var(--text-muted); }

.wz-steps-list { font-size: 0.88rem; line-height: 1.9; padding-left: 1.2rem; color: var(--text-main); margin: 0.75rem 0; }
.wz-steps-list code { background: #f1f5f9; padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.85em; }

.wz-choice {
  display: flex; align-items: flex-start; gap: 0.85rem; width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 2px solid var(--border); border-radius: var(--radius-md);
  padding: 1rem; margin-bottom: 0.75rem; transition: var(--transition); font-family: inherit;
}
.wz-choice:hover { border-color: var(--primary-light); background: #fafffe; }
.wz-choice.on { border-color: var(--primary); background: var(--primary-light); }
.wz-choice.small { padding: 0.8rem; }
.wz-choice-ic { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.wz-choice b { display: block; font-size: 0.95rem; color: var(--secondary); margin-bottom: 0.15rem; }
.wz-choice em { display: block; font-style: normal; font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

.wz-locate {
  width: 100%; cursor: pointer; font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 600;
  background: var(--secondary); color: #fff; border: none; border-radius: var(--radius-md);
  padding: 1rem; transition: var(--transition);
}
.wz-locate:hover { background: var(--secondary-light); }
.wz-locate.on { background: var(--primary); }

.wz-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.wz-pill {
  cursor: pointer; font-size: 0.82rem; font-family: inherit;
  background: #fff; border: 1px solid var(--border); color: var(--text-muted);
  border-radius: var(--radius-full); padding: 0.4rem 0.85rem; transition: var(--transition);
}
.wz-pill:hover { border-color: var(--primary-light); }
.wz-pill.on { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }

.wz-window { display: grid; grid-template-columns: 1fr; gap: 0.6rem; margin: 1rem 0; }
.wz-window > div { display: flex; align-items: center; gap: 0.75rem; }
.wz-window input { width: 90px; text-align: center; }
.wz-window span { font-size: 0.88rem; color: var(--text-main); }
.wz-window-mid {
  justify-content: center; font-size: 0.85rem; color: var(--primary);
  background: var(--primary-light); border-radius: var(--radius-md); padding: 0.5rem; font-weight: 600;
}
.wz-sensor { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; }

.wz-checks { display: flex; flex-direction: column; gap: 0.1rem; margin: 1rem 0; }
.wz-check { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.wz-check:last-child { border-bottom: none; }
.wz-check b { display: block; font-size: 0.88rem; color: var(--secondary); font-weight: 600; }
.wz-check em { display: block; font-style: normal; font-size: 0.78rem; color: var(--text-muted); }

.wz-activate {
  width: 100%; cursor: pointer; border: none; margin: 1rem 0 0.5rem;
  background: var(--primary); color: #fff;
  font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 1.05rem; border-radius: var(--radius-md); transition: var(--transition);
}
.wz-activate:hover { background: var(--primary-dark); box-shadow: var(--shadow-lg); }

.wz-nav { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 1.5rem; }
.wz-nav .btn { min-width: 120px; }
.wz-nav button[disabled] { opacity: 0.45; cursor: not-allowed; }

.wz-spinner {
  width: 26px; height: 26px; margin: 1.5rem auto;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite; /* keyframes ya definidos arriba */
}

.wz-empty { text-align: center; padding: 2.5rem 1rem; }
.wz-empty-ic { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.wz-empty h4 { font-family: 'Outfit', sans-serif; font-size: 1.15rem; color: var(--secondary); margin: 0 0 0.5rem; }
.wz-empty p { font-size: 0.88rem; color: var(--text-muted); max-width: 440px; margin: 0 auto 1.25rem; line-height: 1.6; }

@media (max-width: 640px) {
  .wz-rail .wz-step { font-size: 0; gap: 0; }
  .wz-rail .wz-step i { width: 100%; min-width: 16px; }
  .wz-rail { gap: 0.25rem; }
  .wz-nav .btn { min-width: 0; flex: 1; }
}

/* ---- Manual de buenas prácticas ---- */
.rules-intro { font-size: 0.88rem; color: var(--text-muted); margin: 0 0 0.85rem; line-height: 1.6; }
.rules-body {
  max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1rem 1.1rem; background: #fcfdfe;
  font-size: 0.88rem; line-height: 1.7; color: var(--text-main);
}
.rules-body h3 {
  font-family: 'Outfit', sans-serif; font-size: 0.95rem; color: var(--secondary);
  margin: 1.2rem 0 0.4rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--border);
}
.rules-body h3:first-child { margin-top: 0; }
.rules-body ul { padding-left: 1.15rem; margin: 0.4rem 0; }
.rules-body li { margin-bottom: 0.35rem; }
.rules-end { text-align: center; color: var(--text-light); font-size: 0.78rem; margin: 1.25rem 0 0.25rem; }
.rules-hint { font-size: 0.8rem; color: var(--text-muted); margin: 0.6rem 0 0.25rem; text-align: center; }
.rules-hint.ok { color: var(--primary); font-weight: 600; }
.rules-check { margin-bottom: 0.85rem; }
.rules-check input:disabled + * , .rules-check input:disabled { cursor: not-allowed; }
.access-alert.plain {
  background: #f8fafc; border: 1px solid var(--border); color: var(--text-muted); font-weight: 500;
}
.identity-option.door-quick { background: var(--primary-light); }
.identity-option.door-quick strong { color: var(--primary-dark); }

/* ---- Recargas de saldo ---- */
.wallet-topups { margin-bottom: 1.5rem; }
.topup-method {
  display: flex; align-items: center; gap: 0.85rem; width: 100%; text-align: left;
  background: #fff; border: 2px solid var(--border); border-radius: var(--radius-md);
  padding: 0.9rem 1rem; margin-bottom: 0.65rem; font-family: inherit; transition: var(--transition);
}
.topup-method.on { cursor: pointer; }
.topup-method.on:hover { border-color: var(--primary); background: var(--primary-light); }
.topup-method.soon { opacity: 0.6; background: #f8fafc; }
.topup-method b { display: block; font-size: 0.95rem; color: var(--secondary); }
.topup-method em { display: block; font-style: normal; font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; }
.topup-method > span:nth-child(2) { flex-grow: 1; }
.topup-ic { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.topup-go { color: var(--primary); font-weight: 700; }
.topup-soon {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--border); color: var(--text-muted); padding: 0.2rem 0.5rem; border-radius: var(--radius-full);
  white-space: nowrap;
}
.topup-pending {
  display: flex; align-items: center; gap: 0.75rem;
  background: #fef3c7; border: 1px solid #fde68a; border-radius: var(--radius-md);
  padding: 0.8rem 1rem; margin-bottom: 0.85rem;
}
.topup-pending > span:first-child { font-size: 1.3rem; }
.topup-pending div { flex-grow: 1; }
.topup-pending strong { display: block; font-size: 0.9rem; color: #92400e; }
.topup-pending span { font-size: 0.8rem; color: #a16207; }
.topup-row {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.8rem 0; border-bottom: 1px solid var(--border);
}
.topup-row:last-child { border-bottom: none; }
.topup-row-main { flex-grow: 1; min-width: 180px; }
.topup-row-main strong { display: block; font-size: 0.95rem; color: var(--secondary); }
.topup-row-main span { display: block; font-size: 0.8rem; color: var(--text-muted); }
.topup-note { font-style: italic; color: var(--text-light) !important; }
.topup-row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.menu-badge {
  display: inline-block; background: var(--danger); color: #fff;
  font-size: 0.68rem; font-weight: 700; min-width: 18px; text-align: center;
  padding: 0.05rem 0.35rem; border-radius: var(--radius-full); margin-left: 0.3rem;
}

/* ==========================================
   REFERIDOS (prefijo .ref-)
   ========================================== */
.ref-loading,
.ref-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.5rem 0;
}

.ref-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.ref-stat {
  background: var(--bg-soft, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.6rem 0.4rem;
  text-align: center;
}
.ref-stat strong {
  display: block;
  font-size: 1.15rem;
  font-family: 'Outfit', sans-serif;
}
.ref-stat span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ref-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  max-height: 14rem;
  overflow-y: auto;
}
.ref-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.2rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}
.ref-item:last-child { border-bottom: none; }
.ref-name { flex: 1; font-weight: 600; }
.ref-state { font-size: 0.75rem; color: var(--text-muted); }
.ref-amount { font-weight: 700; color: var(--success, #2ecc71); }

/* Una invitación descartada se ve apagada; el motivo solo está en el panel. */
.ref-item.ref-blocked { opacity: 0.5; }

.ref-mine {
  margin-top: 0.75rem;
  padding: 0.6rem 0.7rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.ref-rules { margin-bottom: 1rem; }
.ref-row-blocked td { opacity: 0.6; }

@media (max-width: 640px) {
  .ref-stats { grid-template-columns: repeat(3, 1fr); }
  .ref-rules > div[style*='grid'] { grid-template-columns: 1fr !important; }
}

/* ==========================================
   HONESTY PADEL SHOP
   Reutiliza las variables y los componentes existentes (.btn, .form-control,
   .mini-btn, .admin-card, .admin-table). Todo lo nuevo va prefijado `shop-`.
   ========================================== */

.shop-header { margin-bottom: 1.25rem; }
.shop-header h3 { font-family: 'Outfit'; font-size: 1.3rem; color: var(--secondary); }
.shop-header p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.2rem; }

.shop-notice {
  background: var(--primary-light); border: 1px solid var(--border-focus);
  border-radius: var(--radius-md); padding: 0.8rem 1rem; margin-bottom: 1.25rem;
  font-size: 0.88rem; color: var(--primary-dark);
}
.shop-empty {
  text-align: center; padding: 2rem 1rem; color: var(--text-light); font-size: 0.9rem;
}
.shop-hint { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.9rem; line-height: 1.5; }

/* ---- Catálogo ---- */
.shop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem;
}
.shop-card {
  display: flex; flex-direction: column; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition);
}
.shop-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.shop-card-img {
  height: 140px; background-size: cover; background-position: center; background-color: var(--bg-page);
}
.shop-card-img-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; opacity: 0.35;
}
.shop-card-body { padding: 0.9rem 1rem 0.6rem; flex-grow: 1; }
.shop-card-body h4 { font-family: 'Outfit'; font-size: 1.02rem; color: var(--secondary); }
.shop-card-desc {
  font-size: 0.82rem; color: var(--text-muted); margin-top: 0.25rem; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.shop-card-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.7rem;
}
.shop-price { font-size: 1.1rem; color: var(--primary); font-family: 'Outfit'; }
.shop-limit { display: block; font-size: 0.74rem; color: var(--text-light); margin-top: 0.35rem; }
.shop-buy-btn { margin: 0 1rem 1rem; }

.shop-badge {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem; border-radius: var(--radius-full); white-space: nowrap;
}
.shop-badge.ok { background: var(--primary-light); color: var(--primary-dark); }
.shop-badge.low { background: #fef3c7; color: #92400e; }
.shop-badge.out { background: #fee2e2; color: #991b1b; }

/* ---- Ficha de compra ---- */
.shop-modal-desc { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; }
.shop-variants { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.shop-variant {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem;
  background: #fff; border: 2px solid var(--border); border-radius: var(--radius-md);
  padding: 0.55rem 0.8rem; cursor: pointer; font-family: inherit; text-align: left;
  transition: var(--transition);
}
.shop-variant strong { font-size: 0.9rem; color: var(--secondary); }
.shop-variant span { font-size: 0.75rem; color: var(--text-muted); }
.shop-variant:hover:not(:disabled) { border-color: var(--primary); }
.shop-variant.on { border-color: var(--primary); background: var(--primary-light); }
.shop-variant.out { opacity: 0.45; cursor: not-allowed; }

.shop-total-box {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--primary-light); border-radius: var(--radius-md);
  padding: 0.8rem 1rem; margin: 0.9rem 0 0.5rem;
}
.shop-total-box span { font-size: 0.85rem; color: var(--primary-dark); font-weight: 600; }
.shop-total-box strong { font-family: 'Outfit'; font-size: 1.35rem; color: var(--primary-dark); }
.shop-wallet-line { font-size: 0.82rem; color: var(--text-muted); }

/* ---- Mis compras ---- */
.shop-purchases { margin-top: 1.75rem; }
.shop-purchase-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.65rem 0; border-bottom: 1px solid var(--border);
}
.shop-purchase-row:last-child { border-bottom: none; }
.shop-purchase-row strong { font-size: 0.9rem; color: var(--secondary); display: block; }
.shop-purchase-row span { font-size: 0.78rem; color: var(--text-muted); }
.shop-refunded { text-decoration: line-through; color: var(--text-light) !important; }

/* ---- Panel del club ---- */
.shop-admin-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.shop-table-wrap { overflow-x: auto; }
.shop-actions { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.shop-row-off td { opacity: 0.55; }
.shop-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }

.shop-alerts {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-md);
  padding: 0.85rem 1rem; margin-bottom: 1.1rem;
}
.shop-alerts > strong { display: block; font-size: 0.9rem; color: #92400e; margin-bottom: 0.5rem; }
.shop-alert-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.4rem 0; border-top: 1px solid #fde68a; font-size: 0.85rem;
}
.shop-alert-row > span:first-child { flex-grow: 1; color: var(--secondary); font-weight: 600; }
.shop-alert-row.out > span:nth-child(2) { color: #991b1b; font-weight: 700; }
.shop-alert-row.low > span:nth-child(2) { color: #a16207; font-weight: 700; }

.shop-variant-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.7rem 0; border-bottom: 1px solid var(--border);
}
.shop-variant-row:last-of-type { border-bottom: none; }
.shop-variant-row > div:first-child { flex-grow: 1; min-width: 160px; }
.shop-variant-row strong { display: block; font-size: 0.92rem; color: var(--secondary); }
.shop-variant-row span { font-size: 0.78rem; color: var(--text-muted); }
.shop-variant-row.off { opacity: 0.55; }

@media (max-width: 640px) {
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
  .shop-card-img { height: 105px; }
  .shop-buy-btn { margin: 0 0.6rem 0.7rem; font-size: 0.82rem; }
}

/* ==========================================
   SOPORTE Y EMERGENCIAS  (prefijo .sup-)
   Reutiliza los tokens del sistema: --primary, --danger, --border, --radius-*.
   ========================================== */

/* Botón del header. Discreto en gris hasta que se pasa por encima; en rojo
   solo cuando hay algo que leer, para que no compita con el saldo. */
.sup-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}
.sup-btn:hover, .sup-btn:focus-visible {
  color: var(--danger);
  border-color: #fecaca;
  background-color: #fef2f2;
}
.sup-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  background-color: var(--danger);
  border: 2px solid var(--bg-card);
}

/* ---- Selección de categoría ---- */
.sup-cat {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: var(--transition);
}
.sup-cat:hover { border-color: var(--primary); background: var(--primary-light); }
.sup-cat.sos { border-color: #fecaca; background: #fef2f2; }
.sup-cat.sos:hover { border-color: var(--danger); background: #fee2e2; }
.sup-cat.sos b { color: #b91c1c; }
.sup-cat-txt { flex-grow: 1; }
.sup-cat b { display: block; font-size: 0.95rem; color: var(--secondary); }
.sup-cat em { display: block; font-style: normal; font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; }
.sup-cat-ic { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.sup-cat-go { color: var(--primary); font-weight: 700; }
.sup-cat.sos .sup-cat-go { color: var(--danger); }

/* ---- Medios de contacto ---- */
.sup-contacts, .sup-hist { margin-top: 1.1rem; }
.sup-contacts-t {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}
.sup-contact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.45rem;
  text-decoration: none;
  transition: var(--transition);
}
.sup-contact:hover { border-color: var(--primary); background: var(--primary-light); }
.sup-contact b { display: block; font-size: 0.88rem; color: var(--secondary); }
.sup-contact em { display: block; font-style: normal; font-size: 0.78rem; color: var(--text-muted); }
.sup-contact-ic { font-size: 1.2rem; line-height: 1; }

/* ---- Emergencia: lo primero y lo más grande de la pantalla ---- */
.sup-sos { display: flex; flex-direction: column; gap: 0.6rem; }
.sup-sos-btn {
  display: block;
  padding: 1.1rem 1rem;
  border-radius: var(--radius-md);
  background-color: var(--danger);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.sup-sos-btn:hover { background-color: #dc2626; transform: translateY(-1px); }
.sup-sos-btn span {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.9;
  margin-top: 0.15rem;
}
.sup-sos-btn.whatsapp { background-color: #16a34a; }
.sup-sos-btn.whatsapp:hover { background-color: #15803d; }
.sup-sos-none {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  font-size: 0.88rem;
  color: #92400e;
  line-height: 1.5;
}
.sup-sos-note {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.sup-sos-state {
  margin-top: 0.9rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}
.sup-sos-state.ok { color: var(--primary-dark); font-weight: 600; }
.sup-sos-state.err { color: var(--danger); font-weight: 600; }

/* ---- Contexto adjunto ---- */
.sup-ctx {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.9rem;
}
.sup-ctx-t {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}
.sup-ctx span { display: block; font-size: 0.78rem; color: var(--text-muted); }

/* ---- Estados ---- */
.sup-status {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.sup-status.pend { background: #fef3c7; color: #92400e; }
.sup-status.wip { background: #dbeafe; color: #1d4ed8; }
.sup-status.ok { background: var(--primary-light); color: var(--primary-dark); }

/* ---- Histórico del jugador ---- */
.sup-hist-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.sup-hist-row:last-child { border-bottom: none; }
.sup-hist-main { flex-grow: 1; min-width: 0; }
.sup-hist-main strong { display: block; font-size: 0.85rem; color: var(--secondary); }
.sup-hist-main > span { display: block; font-size: 0.78rem; color: var(--text-muted); }
.sup-reply {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--primary-dark);
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  line-height: 1.45;
}

/* ---- Panel de administración ---- */
.sup-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sup-ticket {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}
.sup-ticket.sos { border-color: #fecaca; background: #fef2f2; }
.sup-ticket-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sup-ticket-head strong { font-size: 0.95rem; color: var(--secondary); }
.sup-ticket-when { font-size: 0.75rem; color: var(--text-light); margin-left: auto; }
.sup-ticket-who { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
.sup-ticket-msg {
  font-size: 0.88rem;
  color: var(--text-main);
  margin: 0.55rem 0;
  white-space: pre-wrap;
  line-height: 1.5;
}
.sup-ticket-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem; }
.sup-cfg-row { display: flex; align-items: flex-start; gap: 0.85rem; margin-bottom: 0.9rem; }
.sup-cfg-main { flex-grow: 1; }
.sup-cfg-main strong { display: block; font-size: 0.85rem; color: var(--secondary); margin-bottom: 0.3rem; }

@media (max-width: 576px) {
  .sup-btn { width: 34px; height: 34px; }
  .sup-ticket-when { margin-left: 0; width: 100%; }
}

/* ==========================================
   PAGOS DE RESERVA — clases con prefijo .bp-
   ========================================== */

.bp-panel { margin-top: 0.5rem; }

.bp-head {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.8rem; border-radius: 12px;
  background: var(--primary-light); border: 1px solid var(--border-focus);
  margin-bottom: 0.75rem;
}
.bp-mode { font-weight: 700; font-size: 0.85rem; color: var(--primary-dark); }
.bp-total { font-weight: 800; font-size: 0.95rem; color: var(--primary-dark); white-space: nowrap; }

.bp-list { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.bp-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.2rem; border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.bp-row:last-child { border-bottom: none; }
.bp-row.me { background: var(--primary-light); border-radius: 8px; padding-left: 0.5rem; padding-right: 0.5rem; }
.bp-ic { font-size: 1.05rem; line-height: 1; }
.bp-who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bp-who em { font-style: normal; font-size: 0.75rem; color: var(--text-muted); }
.bp-amt { font-weight: 700; white-space: nowrap; }
.bp-amt em { font-style: normal; font-weight: 600; font-size: 0.78rem; color: var(--danger); }
.bp-acts { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.bp-pending { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 0.75rem; }
.bp-done { font-size: 0.85rem; color: var(--primary-dark); font-weight: 600; margin: 0 0 0.75rem; }
.bp-hint { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; margin: 0.5rem 0; }
.bp-cta { width: 100%; margin-top: 0.5rem; }

.bp-resume {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.7rem 0.8rem; border-radius: 12px; background: var(--bg-page);
  border: 1px solid var(--border); margin: 0.75rem 0;
  font-size: 0.88rem;
}
.bp-resume b { font-size: 1.05rem; }

.bp-warn {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.75rem 0.9rem; border-radius: 12px; margin-bottom: 0.75rem;
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
}
.bp-warn.ok { background: var(--primary-light); border-color: var(--border-focus); color: var(--primary-dark); }
.bp-warn span { font-size: 0.8rem; opacity: 0.85; }

.bp-tag { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--bg-page); color: var(--text-muted); }
.bp-tag.ok { background: var(--primary-light); color: var(--primary-dark); }

/* Selector del modo de pago al reservar */
.bp-modes { display: grid; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.bp-mode-opt {
  display: flex; flex-direction: column; gap: 0.15rem; text-align: left;
  padding: 0.75rem 0.9rem; border-radius: 12px; cursor: pointer;
  background: var(--bg-card); border: 2px solid var(--border);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.bp-mode-opt:hover { border-color: var(--border-focus); }
.bp-mode-opt.on { border-color: var(--primary); background: var(--primary-light); }
.bp-mode-opt b { font-size: 0.9rem; }
.bp-mode-opt em { font-style: normal; font-size: 0.78rem; color: var(--text-muted); }

@media (max-width: 480px) {
  .bp-head { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
  .bp-row { flex-wrap: wrap; }
}

/* ==========================================
   SOCIAL — enlace de invitación y solicitudes para unirse
   Clases prefijadas con .social- para no colisionar.
   ========================================== */

.social-link-box {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin: .75rem 0;
}

.social-link-input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
  padding: .55rem .7rem;
  border: 1px solid var(--border, #d6d9e0);
  border-radius: 8px;
  background: var(--bg-soft, #f6f7f9);
  color: inherit;
}

.social-warn {
  font-size: .82rem;
  border-left: 3px solid var(--warning, #e0a800);
  padding-left: .6rem;
}

.btn-whatsapp {
  background: #25d366;
  color: #08310f;
  border-color: #25d366;
}

/* ---- Vista previa del enlace ---- */

.social-preview {
  border: 1px solid var(--border, #d6d9e0);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.social-preview-when { font-size: 1.15rem; margin: 0 0 .15rem; }
.social-preview-where { margin: 0 0 .35rem; }

.social-players {
  list-style: none;
  margin: .75rem 0;
  padding: 0;
  display: grid;
  gap: .35rem;
}

.social-players li {
  padding: .45rem .7rem;
  border-radius: 8px;
  background: var(--bg-soft, #f6f7f9);
}

.social-slot-free {
  border: 1px dashed var(--border, #d6d9e0);
  background: transparent;
  opacity: .7;
}

.social-cost { margin: .5rem 0 0; }

.social-payer {
  border: 1px solid var(--border, #d6d9e0);
  border-radius: 10px;
  padding: .75rem 1rem;
  margin: 1rem 0;
}

.social-payer legend { padding: 0 .4rem; font-weight: 600; }
.social-payer label { display: block; padding: .3rem 0; cursor: pointer; }

/* ---- Solicitudes para unirse ---- */

.social-request {
  border: 1px solid var(--border, #d6d9e0);
  border-radius: 12px;
  padding: .85rem 1rem;
  margin-bottom: .75rem;
}

.social-request-head { margin: 0 0 .2rem; }

.social-request-comment {
  font-style: italic;
  margin: .5rem 0;
  padding-left: .7rem;
  border-left: 3px solid var(--border, #d6d9e0);
}

.badge-pending { background: #fff3cd; color: #6b5200; }
.badge-approved { background: #d8f5e0; color: #0f5127; }
.badge-rejected { background: #fadbd8; color: #7a1f16; }
.badge-expired,
.badge-cancelled { background: #e9ecef; color: #495057; }

@media (max-width: 520px) {
  .social-link-box { flex-direction: column; align-items: stretch; }
}

/* ==========================================
   Nivel y estadísticas de jugador
   Todas las clases van prefijadas con .lvl- para no colisionar.
   ========================================== */

/* ---- Cabecera: insignia de nivel + fiabilidad ---- */
.lvl-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.lvl-badge {
  flex-shrink: 0; width: 76px; height: 76px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}
.lvl-badge-n { font-family: 'Outfit', sans-serif; font-size: 1.9rem; font-weight: 800; line-height: 1; }
.lvl-badge-t { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; margin-top: 2px; }
.lvl-head-meta { flex-grow: 1; min-width: 0; }
.lvl-rel-row { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.lvl-hint { display: block; font-size: 0.72rem; color: var(--text-light); margin-top: 0.3rem; }
.lvl-trend { display: inline-block; font-size: 0.75rem; font-weight: 700; margin-top: 0.35rem; }
.lvl-trend.up { color: var(--success); }
.lvl-trend.down { color: var(--danger); }

/* ---- Gráfica de evolución (SVG en línea) ---- */
.lvl-chart-box {
  background: var(--primary-light); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.5rem 0.25rem 0; margin-bottom: 1rem;
}
.lvl-chart { display: block; width: 100%; height: auto; }
.lvl-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; }
.lvl-axis { font-size: 9px; fill: var(--text-light); font-family: 'Inter', sans-serif; }
.lvl-line { stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.lvl-dot { fill: #fff; stroke: var(--primary); stroke-width: 2; }
.lvl-fill-top { stop-color: var(--primary); stop-opacity: 0.22; }
.lvl-fill-bottom { stop-color: var(--primary); stop-opacity: 0; }
.lvl-empty { font-size: 0.82rem; color: var(--text-light); text-align: center; padding: 1.25rem 0.5rem; margin: 0; }

/* ---- Racha y forma reciente ---- */
.lvl-streak-win { color: var(--success); }
.lvl-streak-loss { color: var(--danger); }
.lvl-streak-tie, .lvl-streak-none { color: var(--text-muted); }
.lvl-form { display: flex; gap: 4px; margin: 0.75rem 0 0.25rem; flex-wrap: wrap; }
.lvl-form-i {
  width: 22px; height: 22px; border-radius: var(--radius-sm); display: inline-flex;
  align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 800; color: #fff;
}
.lvl-form-W { background: var(--success); }
.lvl-form-L { background: var(--danger); }
.lvl-form-T { background: var(--text-light); }
.lvl-note { font-size: 0.75rem; color: var(--text-muted); margin: 0.5rem 0 0; }

/* ---- Tipo de partido ---- */
.lvl-type {
  display: inline-block; font-size: 0.66rem; font-weight: 700; padding: 2px 7px;
  border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.03em;
}
.lvl-type-competitive { background: var(--primary-light); color: var(--primary-dark); }
.lvl-type-friendly { background: #eff6ff; color: var(--info); }
.lvl-type-incomplete { background: #f1f5f9; color: var(--text-muted); }
.lvl-tag { font-size: 0.68rem; font-weight: 700; color: var(--warning); }

/* ---- Resultados pendientes de confirmar ---- */
.lvl-pending {
  border: 1px solid var(--border); border-left: 3px solid var(--warning);
  border-radius: var(--radius-md); padding: 0.75rem; margin-top: 0.75rem; background: var(--bg-card);
}
.lvl-pending-head { font-size: 0.78rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.lvl-pending-score {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin: 0.6rem 0; font-size: 0.85rem;
}
.lvl-pending-score span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lvl-pending-score span:last-child { text-align: right; }
.lvl-pending-score strong { font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 800; white-space: nowrap; }
.lvl-score-in { width: 52px; text-align: center; padding: 0.3rem; }
.lvl-pending-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.lvl-pending-actions .btn { flex: 1; min-width: 130px; padding: 0.5rem; font-size: 0.85rem; }

/* ---- Explicación del sistema ---- */
.lvl-info { font-size: 0.88rem; line-height: 1.55; color: var(--text-main); }
.lvl-info ul { margin: 0.5rem 0 0.75rem 1.1rem; padding: 0; }
.lvl-info li { margin-bottom: 0.4rem; }

/* ---- Móvil ---- */
@media (max-width: 480px) {
  .lvl-head { gap: 0.75rem; }
  .lvl-badge { width: 62px; height: 62px; }
  .lvl-badge-n { font-size: 1.5rem; }
  .lvl-pending-score { flex-direction: column; align-items: stretch; text-align: center; }
  .lvl-pending-score span:last-child { text-align: center; }
  .lvl-pending-actions .btn, .lvl-pending-actions .mini-btn { width: 100%; }
}

/* ==========================================
   SOCIAL — enlace de invitación y solicitudes para unirse
   Clases prefijadas con .social- para no colisionar.
   ========================================== */

.social-link-box {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin: .75rem 0;
}

.social-link-input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
  padding: .55rem .7rem;
  border: 1px solid var(--border, #d6d9e0);
  border-radius: 8px;
  background: var(--bg-soft, #f6f7f9);
  color: inherit;
}

.social-warn {
  font-size: .82rem;
  border-left: 3px solid var(--warning, #e0a800);
  padding-left: .6rem;
}

.btn-whatsapp {
  background: #25d366;
  color: #08310f;
  border-color: #25d366;
}

/* ---- Vista previa del enlace ---- */

.social-preview {
  border: 1px solid var(--border, #d6d9e0);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.social-preview-when { font-size: 1.15rem; margin: 0 0 .15rem; }
.social-preview-where { margin: 0 0 .35rem; }

.social-players {
  list-style: none;
  margin: .75rem 0;
  padding: 0;
  display: grid;
  gap: .35rem;
}

.social-players li {
  padding: .45rem .7rem;
  border-radius: 8px;
  background: var(--bg-soft, #f6f7f9);
}

.social-slot-free {
  border: 1px dashed var(--border, #d6d9e0);
  background: transparent;
  opacity: .7;
}

.social-cost { margin: .5rem 0 0; }

.social-payer {
  border: 1px solid var(--border, #d6d9e0);
  border-radius: 10px;
  padding: .75rem 1rem;
  margin: 1rem 0;
}

.social-payer legend { padding: 0 .4rem; font-weight: 600; }
.social-payer label { display: block; padding: .3rem 0; cursor: pointer; }

/* ---- Solicitudes para unirse ---- */

.social-request {
  border: 1px solid var(--border, #d6d9e0);
  border-radius: 12px;
  padding: .85rem 1rem;
  margin-bottom: .75rem;
}

.social-request-head { margin: 0 0 .2rem; }

.social-request-comment {
  font-style: italic;
  margin: .5rem 0;
  padding-left: .7rem;
  border-left: 3px solid var(--border, #d6d9e0);
}

.badge-pending { background: #fff3cd; color: #6b5200; }
.badge-approved { background: #d8f5e0; color: #0f5127; }
.badge-rejected { background: #fadbd8; color: #7a1f16; }
.badge-expired,
.badge-cancelled { background: #e9ecef; color: #495057; }

@media (max-width: 520px) {
  .social-link-box { flex-direction: column; align-items: stretch; }
}

/* ==========================================
   SALUD DEL SISTEMA
   Lo que falló por debajo sin que el usuario lo notara.
   ========================================== */
.health-ok { background: var(--primary-light); color: var(--primary-dark); border-radius: 12px; padding: 0.8rem 1rem; font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; }
.health-alert { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; border-radius: 12px; padding: 0.8rem 1rem; font-size: 0.9rem; line-height: 1.5; margin-bottom: 1rem; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; margin-bottom: 1.2rem; }
.health-card { background: var(--bg-page); border: 1px solid var(--border); border-radius: 12px; padding: 0.8rem; }
.health-card.warn { border-color: #fde68a; background: #fffbeb; }
.health-card-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 700; }
.health-card-num { font-size: 1.6rem; font-weight: 800; font-family: 'Outfit', sans-serif; color: var(--text-main); line-height: 1.2; }
.health-card-sub { font-size: 0.72rem; color: var(--text-light); }
.health-tag { display: inline-block; background: var(--bg-page); border: 1px solid var(--border); border-radius: 6px; padding: 0.1rem 0.4rem; font-size: 0.72rem; color: var(--text-muted); margin: 0.1rem 0.15rem 0.1rem 0; font-family: ui-monospace, monospace; }

/* Banda de "sin conexión": el service worker sirve una copia y hay que decirlo. */
.aviso-sin-red { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; background: #92400e; color: #fff; text-align: center; font-size: 0.82rem; font-weight: 600; padding: 0.4rem 1rem; letter-spacing: 0.01em; }
.aviso-sin-red.hidden { display: none; }
body.sin-red { padding-top: 1.9rem; }

/* Aviso de correo sin confirmar. Informa, no bloquea. */
.aviso-verificar { display: flex; align-items: center; justify-content: center; gap: 0.7rem; flex-wrap: wrap; background: var(--primary-light); color: var(--primary-dark); border-bottom: 1px solid var(--border-focus); font-size: 0.82rem; font-weight: 600; padding: 0.5rem 1rem; text-align: center; }
.aviso-verificar.hidden { display: none; }

/* Cuadro de mando: el dinero. */
.kpi-money-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.7rem; margin-bottom: 1rem; }
.kpi-money { background: var(--bg-page); border: 1px solid var(--border); border-radius: 12px; padding: 0.85rem; }
.kpi-money.destacado { background: var(--primary-light); border-color: var(--border-focus); }
.kpi-money.alerta { background: #fffbeb; border-color: #fde68a; }
.kpi-money-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 700; }
.kpi-money-num { font-size: 1.5rem; font-weight: 800; font-family: 'Outfit', sans-serif; color: var(--text-main); line-height: 1.25; }
.kpi-money-sub { font-size: 0.74rem; color: var(--text-light); line-height: 1.35; }

/* ==========================================
   MÓVIL: QUE NADA SE SALGA DE LA PANTALLA
   ==========================================

   Medido en un teléfono de 390 px: el documento ocupaba 466 px. Nadie lo veía
   porque `body { overflow-x: hidden }` lo tapaba — y eso no arregla el
   desbordamiento, lo esconde: la parte que sobra queda inalcanzable. En la
   pantalla de reservar se comían el borde derecho de los dos desplegables y del
   botón "Limpiar Selección".

   Dos causas, las dos de manual:

   1. `.app-grid` usaba `grid-template-columns: 1fr 340px`. Un track `1fr` no
      baja de su contenido (`min-width: auto`), así que el contenido lo estiraba
      a 451 px dentro de una rejilla de 390. Con `minmax(0, 1fr)` sí puede
      encogerse. Lo mismo con `min-width: 0` en los hijos, que son columnas flex.

   2. La cabecera exigía 490 px de mínimo: logo + hamburguesa + soporte + saldo,
      ninguno dispuesto a encogerse. En un teléfono de 390 px eso no cabe en
      ningún caso, y el nombre de la marca acababa debajo del botón de menú.
   ========================================== */

.app-grid {
  /* minmax(0, …) en vez de 1fr: si no, la columna no puede encoger. */
  grid-template-columns: minmax(0, 1fr) 340px;
}

/* Las columnas flex de dentro tampoco bajaban de su contenido. */
.app-grid > *,
.app-col {
  min-width: 0;
}

.app-col {
  display: flex;
  flex-direction: column;
}

/* La cabecera tiene que caber siempre; lo que sobre, se recorta con puntos
   suspensivos en vez de empujar la página entera. */
.header-container {
  gap: 0.75rem;
  min-width: 0;
}

.logo {
  min-width: 0;
  flex-shrink: 1;
}

.logo .brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo svg {
  flex-shrink: 0;
}

.header-actions {
  min-width: 0;
  flex-shrink: 0;
}

.user-badge {
  min-width: 0;
}

.user-badge #header-username {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Las tablas anchas se desplazan dentro de su caja, no arrastran la página. */
.tariff-table-wrap,
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================
   OBJETIVOS DE TOQUE
   Medido: el botón de menú 44x39, el de soporte 34x34, el de cerrar un modal
   32x32 y los botones de la cabecera 33 px de alto. La guía pide 44x44 en
   pantalla táctil; por debajo de eso se falla el toque y se pulsa otra cosa.
   Solo se aplica con puntero grueso: con ratón, 32 px está bien.
   ========================================== */
@media (pointer: coarse) {
  .btn,
  .mini-btn,
  .mobile-menu-toggle,
  .modal-close,
  #support-btn,
  .nav-link,
  .app-subnav button {
    min-height: 44px;
  }

  .mobile-menu-toggle,
  .modal-close,
  #support-btn {
    min-width: 44px;
  }
}

/* Sin el retardo de ~300 ms que el navegador reserva por si es doble toque. */
button,
a,
[role="button"],
input,
select,
textarea,
label {
  touch-action: manipulation;
}

/* Al llegar al final de un modal, dejaba de desplazarse el modal y empezaba a
   moverse la página de detrás. */
.modal,
.modal-overlay,
.shop-table-wrap,
.app-subnav {
  overscroll-behavior: contain;
}

/* ==========================================
   LOS AVISOS FIJOS Y LA MUESCA DEL MÓVIL
   La banda de "sin conexión" se colocaba en top:0 y en un iPhone queda debajo
   de la barra de estado. En navegadores sin muesca, env() vale 0 y no cambia
   nada.
   ========================================== */
.aviso-sin-red {
  padding-top: calc(0.4rem + env(safe-area-inset-top, 0px));
  padding-left: calc(1rem + env(safe-area-inset-left, 0px));
  padding-right: calc(1rem + env(safe-area-inset-right, 0px));
}

body.sin-red {
  padding-top: calc(1.9rem + env(safe-area-inset-top, 0px));
}

/* El reset de estos botones vive arriba, antes de cada componente: si va al
   final, `button.logo` gana a `.logo` por especificidad y le borra la
   tipografía. Ver "CONTROLES QUE ANTES ERAN ENLACES". */

/* Las cifras de dinero en columna, para que los dígitos alineen. */
.tx-amount,
.kpi-money-num,
.admin-table td,
.lvl-stat strong,
.profile-stat strong {
  font-variant-numeric: tabular-nums;
}

/* ==========================================
   PANTALLAS ESTRECHAS (320 px: iPhone SE y similares)
   ==========================================

   Quedaban dos restos del desbordamiento:

   1. La media query de 992 px volvía a poner `grid-template-columns: 1fr`, sin
      el `minmax(0, …)`, así que la columna volvía a no poder encogerse y el
      panel lateral de la reserva se salía 52 px.

   2. `.date-btn { flex: 1 1 0 }` repartía siete días entre 320 px: botones de
      12 px de ancho. Imposibles de acertar con el dedo. En pantallas estrechas
      la tira de días se desplaza en lugar de comprimirse.
   ========================================== */
@media (max-width: 992px) {
  .app-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  /* La tira de días se desplaza; cada día conserva un tamaño que se puede tocar. */
  .date-strip {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .date-btn {
    flex: 0 0 auto;
    min-width: 56px;
    scroll-snap-align: start;
  }

  #date-prev,
  #date-next {
    min-width: 44px;
  }

  /* La cabecera, aún más apretada: aquí no cabe el nombre de la marca. */
  .header-container {
    gap: 0.5rem;
    padding: 0 0.75rem;
  }

  .logo {
    font-size: 1.15rem;
  }

  .user-badge {
    padding: 0.5rem 0.7rem;
    gap: 0.4rem;
  }
}

@media (max-width: 480px) {
  /* En el móvil el nombre de la marca no cabe junto al menú, el botón de
     soporte y el saldo (o los dos botones de acceso). Truncarlo a "Diade…"
     queda peor que no ponerlo: se deja
     el icono, que sigue llevando a la portada, y el nombre pasa a ser el texto
     accesible del botón. */
  .logo .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* El logo también es un objetivo táctil. */
@media (pointer: coarse) {
  .logo,
  .user-badge,
  .wallet-badge,
  .date-btn,
  #date-prev,
  #date-next {
    min-height: 44px;
  }

  .logo {
    min-width: 44px;
  }

  /* Los enlaces del pie median 19 px de alto. */
  button.link,
  .footer a,
  .footer button {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    display: inline-block;
  }
}

/* Las franjas horarias y los nombres del ranking pasaron de <div>/<tr> a
   <button> para poder usarse con teclado. Estas reglas les devuelven el aspecto
   que tenían: un <button> trae fuente, borde y ancho propios del navegador. */
button.slot-item {
  font: inherit;
  width: 100%;
  color: inherit;
}

button.slot-item:disabled {
  cursor: default;
}

button.rank-name {
  font: inherit;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  padding: 0;
}

button.rank-name:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ==========================================
   CABECERA A 320 px
   Medido: logo 32 + menú 44 + soporte 44 + saldo 111 + usuario 69 + huecos =
   356 px en una pantalla de 320. Se recorta lo prescindible sin esconder nada
   que haga falta: el saldo sigue viéndose (es lo que la gente mira) y el menú
   de usuario sigue abriéndose.
   ========================================== */
@media (max-width: 400px) {
  .wallet-badge svg,
  .user-badge > svg {
    display: none;
  }

  .wallet-badge,
  .user-badge {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .header-container {
    gap: 0.4rem;
  }

  /* El aviso flotante también se salía por la derecha. */
  .toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
  }
}

/* Los enlaces de texto (pie, "ya tengo cuenta", nombres del ranking) median
   entre 19 y 22 px de alto. Con puntero grueso se les da altura suficiente sin
   cambiar cómo se ven. */
@media (pointer: coarse) {
  button.link,
  .footer button,
  .footer a {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  button.rank-name {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }
}

/* Los últimos milímetros: la insignia de usuario se quedaba en 41 px de ancho y
   los enlaces de texto en 43 de alto. */
@media (pointer: coarse) {
  .user-badge {
    min-width: 44px;
    justify-content: center;
  }

  button.link,
  .footer button,
  .footer a,
  button.rank-name {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
  }
}

/* ==========================================
   EL PANEL DE ADMINISTRACIÓN EN EL MÓVIL

   Mismo fallo que en la pantalla de reservar, y por el mismo motivo: la rejilla
   usaba `1fr`, que no baja de su contenido. Con las etiquetas largas del menú
   ("🚪 Control de acceso", "📈 Cuadro Mando") el panel exigía 534 px en una
   pantalla de 390, y el personal del club veía el menú cortado.

   No se vio antes porque la cuenta con la que se auditó era de jugador: sin rol
   de personal, esta pantalla no llega a pintarse.
   ========================================== */
.admin-grid {
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
}

.admin-sidebar,
.admin-menu,
.admin-panel {
  min-width: 0;
}

.admin-menu-btn {
  min-width: 0;
  /* Antes de recortar, que el texto pase a la línea siguiente. */
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 992px) {
  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (pointer: coarse) {
  .admin-menu-btn {
    min-height: 44px;
  }
}

/* ==========================================
   LA PORTADA A 320 px

   Tercera aparición del mismo fallo: `.hero-grid` usaba `1.1fr 0.9fr`, y un
   track `fr` no baja de su contenido. A 320 px el titular y el párrafo
   empujaban la portada a 360 px de ancho.

   Se arregla en la raíz (minmax) y, además, se reduce el margen lateral y el
   tamaño del titular en las pantallas más estrechas: a 56 px de cuerpo,
   "Pádel," ya no cabe en 272 px por mucho que se permita partir palabras.
   ========================================== */
.hero-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

/* El override anterior vive después de las media queries históricas. La
   columna única debe declararse aquí para que móvil no vuelva a heredar el
   grid de escritorio. */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hero-content,
.hero-grid > * {
  min-width: 0;
}

/* Una palabra larga parte antes de desbordar la pantalla. */
h1, h2, h3,
.hero-badge,
.hero-content p {
  overflow-wrap: break-word;
}

@media (max-width: 360px) {
  .container {
    padding: 0 1rem;
  }

  .hero h1,
  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-badge {
    font-size: 0.68rem;
  }
}

/* ==========================================
   QUÉ ENCOGE PRIMERO EN LA CABECERA

   Al permitir que la cabecera se encogiera (antes desbordaba y empujaba la
   página entera), quien cedía era el logo: con sesión de personal, en un
   escritorio de 1440 px, la marca salía como "Diad…" y los enlaces partían
   palabras a mitad.

   El orden correcto es el contrario: la marca y los enlaces no se tocan, y lo
   que cede es el nombre del usuario, que es lo único prescindible.
   ========================================== */
@media (min-width: 769px) {
  .logo {
    flex-shrink: 0;
  }

  .nav {
    flex-shrink: 1;
    min-width: 0;
  }

  .nav-link {
    white-space: nowrap;
  }

  /* Lo que cede es el nombre: se recorta con puntos suspensivos. */
  .user-badge #header-username {
    max-width: 14ch;
  }
}

/* ==========================================
   MOBILE NATIVE PASS — Emil Kowalski
   ========================================== */

/* Feedback inmediato al posar el dedo. Solo transform: no fuerza layout. */
.btn,
.mobile-menu-toggle,
.user-badge,
.wallet-badge,
.nav-link,
.app-subnav button,
.date-btn,
.slot-item,
.action-btn,
.mini-btn {
  transition: var(--transition);
}

.btn:active,
.mobile-menu-toggle:active,
.user-badge:active,
.wallet-badge:active,
.nav-link:active,
.app-subnav button:active,
.date-btn:active,
.slot-item:active,
.action-btn:active,
.mini-btn:active {
  transform: scale(0.97);
}

@media (pointer: coarse) {
  input,
  textarea,
  select {
    font-size: 16px;
  }
}

/* En una pantalla táctil el :hover simulado no debe dejar controles elevados
   o coloreados después de tocarlos. */
@media (hover: none) {
  .btn-primary:hover,
  .btn-secondary:hover,
  .court-card:hover,
  .shop-card:hover,
  .match-card:hover,
  .door-open-btn:hover:not(:disabled),
  .sup-sos-btn:hover {
    transform: none;
  }

  .court-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-md);
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: max(var(--mobile-gutter), env(safe-area-inset-left, 0px));
    padding-right: max(var(--mobile-gutter), env(safe-area-inset-right, 0px));
  }

  .header {
    min-height: calc(72px + env(safe-area-inset-top, 0px));
    height: auto;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .nav {
    top: calc(72px + env(safe-area-inset-top, 0px));
    left: var(--mobile-gutter);
    right: var(--mobile-gutter);
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 16px 16px;
  }

  .hero {
    padding: 2.5rem 0 3.25rem;
  }

  .hero-grid {
    gap: 2rem;
    text-align: left;
  }

  .hero-badge {
    margin-bottom: 1rem;
    font-size: 0.72rem;
    max-width: 100%;
  }

  .hero h1,
  .hero-content h1 {
    max-width: 13ch;
    margin-bottom: 1rem;
    font-size: clamp(2.45rem, 11vw, 3.15rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
  }

  .hero p {
    max-width: 36ch;
    margin: 0 0 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
  }

  .hero-content .flex-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem !important;
  }

  .hero-content .flex-actions .btn {
    width: 100%;
    min-height: 48px;
    padding-inline: 1rem;
  }

  .hero-image-container {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 280px;
    padding: 1.25rem;
    text-align: left;
    border-radius: 18px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  }

  .hero-court-graphic {
    min-height: 150px;
  }

  .section-padding {
    padding: 3.5rem 0;
  }

  .section-title {
    margin-bottom: 2.25rem;
    text-align: left;
  }

  .section-title h2 {
    font-size: 1.9rem;
    line-height: 1.1;
  }

  .section-title p {
    margin: 0;
  }

  .tariff-container {
    margin-top: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .tariff-table-wrap {
    padding: 0;
    overflow: visible;
  }

  .tariff-table {
    min-width: 0;
    display: block;
  }

  .tariff-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .tariff-table tbody {
    display: grid;
    gap: 0.9rem;
  }

  .tariff-table tr {
    display: grid;
    gap: 0;
    padding: 0.35rem 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
  }

  .tariff-table th,
  .tariff-table td {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) auto;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    padding: 0.78rem 0;
    border-bottom: 1px solid var(--border);
    white-space: normal;
    text-align: right;
  }

  .tariff-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: left;
  }

  .tariff-table tr:last-child td,
  .tariff-table td:last-child {
    border-bottom: 0;
  }

  .court-card,
  .match-card,
  .booking-summary-card,
  .shop-card,
  .admin-panel {
    border-radius: 16px;
  }

  .court-features {
    padding: 1.25rem;
  }

  .court-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
  }

  .court-footer > div:last-child {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.65rem !important;
  }

  .court-footer > div:last-child .btn {
    min-height: 44px;
    padding-inline: 0.75rem !important;
  }

  .contact-section {
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  }

  .contact-grid {
    padding: 2rem 1.25rem;
  }

  .contact-form {
    padding: 1.25rem;
    border-radius: 14px;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: var(--mobile-gutter);
    padding-bottom: max(var(--mobile-gutter), env(safe-area-inset-bottom, 0px));
  }

  .modal {
    width: 100%;
    max-width: none;
    max-height: min(88dvh, 760px);
    border-radius: 20px;
  }

  .modal-header,
  .modal-body {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .footer {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  }

  .toast {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 380px) {
  .header-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .hero-content .flex-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero h1,
  .hero-content h1 {
    font-size: clamp(2rem, 11.5vw, 2.55rem);
  }

  .tariff-table th,
  .tariff-table td {
    grid-template-columns: minmax(6.5rem, 1fr) auto;
    gap: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn:active,
  .mobile-menu-toggle:active,
  .user-badge:active,
  .wallet-badge:active,
  .nav-link:active,
  .app-subnav button:active,
  .date-btn:active,
  .slot-item:active,
  .action-btn:active,
  .mini-btn:active {
    transform: none;
  }
}
/* Membership, shop entry and mobile-safe transactional surfaces */
.profile-shop-card{display:flex;align-items:center;justify-content:space-between;gap:1.5rem;padding:1.25rem}.profile-shop-copy{max-width:34rem}.profile-shop-copy p{color:var(--text-muted);margin:.4rem 0 1rem}.profile-shop-qr{display:block;border:1px solid var(--border);border-radius:16px;padding:8px;background:#fff}.eyebrow{font-size:.7rem;font-weight:800;letter-spacing:.12em;color:var(--primary)}
.status-callout{padding:1rem;border-left:4px solid var(--warning);background:color-mix(in srgb,var(--warning) 10%,white);border-radius:10px}.status-callout.rejected{border-color:var(--danger);background:color-mix(in srgb,var(--danger) 8%,white)}
.registration-legal{margin:1rem 0}.registration-legal>p{font-size:.82rem;color:var(--text-muted)}.registration-document{border:1px solid var(--border);border-radius:12px;padding:.75rem;margin:.65rem 0}.registration-document summary{cursor:pointer;font-weight:700}.registration-document summary small{float:right;color:var(--text-muted)}.legal-copy{max-height:13rem;overflow:auto;padding:.8rem 0;font-size:.85rem}.legal-accept{display:flex;gap:.55rem;align-items:flex-start;margin-top:.5rem;font-size:.82rem}.legal-accept input{margin-top:.15rem}
.shop-cart{margin:1rem 0;padding:1rem;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface)}
.approval-actions{display:inline-flex;gap:.25rem;margin-right:.35rem}.approval-state{display:inline-block;font-size:.68rem;font-weight:800;margin-right:.35rem}.approval-state.pending{color:var(--warning)}.approval-state.rejected{color:var(--danger)}
@media(max-width:720px){.container{padding-left:max(1rem,env(safe-area-inset-left));padding-right:max(1rem,env(safe-area-inset-right))}.booking-section{padding-top:1rem}.app-subnav{overflow-x:auto;scrollbar-width:none;gap:.5rem!important;margin:0 -1rem 1rem!important;padding:0 1rem .65rem!important}.app-subnav .btn{flex:0 0 auto;min-height:44px}.profile-card{align-items:flex-start;flex-wrap:wrap}.profile-card .btn{margin-left:0!important;width:100%}.profile-shop-card{align-items:flex-start;flex-direction:column}.profile-shop-qr{width:132px;height:132px}.shop-grid{grid-template-columns:1fr!important}.shop-card{min-width:0}.admin-table{min-width:720px}.modal{width:calc(100vw - 1.5rem)!important;max-height:calc(100dvh - 1.5rem);margin:.75rem}.modal-body{overflow:auto}.registration-document{padding:.65rem}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
