/* ==========================================================================
   STYLES — Sistema de Diseño Responsive, Temas Duales y Componentes PWA
   Proyecto: AquaVecinos (PWA Comunal de Reparto de Agua)
   Última actualización: 2026-09-09
   ========================================================================== */

/* --- IMPORTACIÓN DE FUENTES GOOGLE FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

/* --- VARIABLES Y TOKENS DE DISEÑO --- */
:root {
  /* Paleta Temática Agua Cristalina (Modo Claro) */
  --bg-primary: #f0f9ff;
  --bg-secondary: #e0f2fe;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #cbd5e1;
  --border-light: #e2e8f0;

  /* Acentos y Semánticos */
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --accent: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  --accent-glow: rgba(2, 132, 199, 0.25);

  --success: #10b981;
  --success-light: #dcfce7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #3b82f6;
  --info-light: #dbeafe;

  /* Elevaciones */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-aqua: 0 8px 25px rgba(2, 132, 199, 0.18);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- MODO OSCURO (DUAL-MODE) --- */
[data-theme="dark"] {
  --bg-primary: #0a0f1d;
  --bg-secondary: #131b2e;
  --bg-card: #182238;
  --bg-card-hover: #1f2d4a;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.05);

  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-light: rgba(56, 189, 248, 0.15);
  --accent: #22d3ee;
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #0284c7 100%);
  --accent-glow: rgba(56, 189, 248, 0.25);

  --success-light: rgba(16, 185, 129, 0.18);
  --danger-light: rgba(239, 68, 68, 0.18);
  --warning-light: rgba(245, 158, 11, 0.18);
  --info-light: rgba(59, 130, 246, 0.18);

  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.45);
  --shadow-aqua: 0 8px 30px rgba(2, 132, 199, 0.28);
}

/* --- RESET GLOBAL & BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 14px;
}

/* --- CONTENEDOR PRINCIPAL ULTRA-COMPACTO (ALTA DENSIDAD, CERO ESPACIO PERDIDO) --- */
.app-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2px 4px;
  display: flex;
  flex-direction: column;
  gap: 2.5px;
  min-height: 100vh;
  box-sizing: border-box;
}

/* --- BARRA SUPERIOR INTEGRADA NATIVA (32px DE ALTO) --- */
.app-topbar {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  min-height: 32px;
  box-sizing: border-box;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.topbar-logo {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  flex-shrink: 0;
}

.topbar-titles {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex-wrap: nowrap;
}

.topbar-asoc {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.topbar-pileta-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-pileta-badge.libre {
  background: var(--success-light);
  color: #166534;
}

.topbar-pileta-badge.en-uso {
  background: var(--danger-light);
  color: #991b1b;
  animation: pulseDot 1.5s infinite;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

.libre .status-dot { background: var(--success); }
.en-uso .status-dot { background: var(--danger); }

@keyframes pulseDot {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.icon-btn-compact {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  width: 26px;
  height: 26px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
}

.btn-directiva-pill {
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 26px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.2);
}

/* --- BARRA DE PESTAÑAS PRINCIPAL COMPACTA --- */
.tabs-nav {
  display: flex;
  background: var(--bg-secondary);
  padding: 1.5px;
  border-radius: 6px;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
  box-sizing: border-box;
}
.tabs-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 0 0 auto;
  min-width: max-content;
  padding: 3px 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 10.5px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: var(--transition);
  min-height: 26px;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* --- VISTAS / CONTENIDO DE PESTAÑAS --- */
.tab-content {
  display: none;
  animation: fadeIn 0.15s ease-out forwards;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- SECCIÓN 1: CALENDARIO & RESERVAS (SOCIOS) --- */
.reserva-unified-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  box-sizing: border-box;
}

.step-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  padding: 3.5px 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.step-label {
  font-family: 'Outfit', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2.5px;
}

.step-num {
  background: var(--primary);
  color: #ffffff;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  font-size: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.aviso-cerrado {
  background: var(--danger-light);
  color: #991b1b;
  border-left: 3px solid var(--danger);
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 10.5px;
  margin-top: 3px;
}

/* Selector de Días Compacto (Sin scrollbar visible) */
.days-carousel {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 1px 0 2px 0;
  margin-bottom: 0;
}
.days-carousel::-webkit-scrollbar { display: none; }

.day-pill {
  flex: 0 0 48px;
  min-height: 40px;
  background: var(--bg-secondary);
  border: 1.5px solid transparent;
  border-radius: 5px;
  padding: 2px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.day-pill:hover {
  border-color: var(--primary-light);
}

.day-pill.active {
  background: var(--primary-light);
  border-color: var(--primary);
}

.day-pill .day-name {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.day-pill.active .day-name {
  color: var(--primary);
}

.day-pill .day-number {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.day-pill.active .day-number {
  color: var(--primary);
}

.day-pill .day-badge {
  font-size: 7.5px;
  color: var(--text-muted);
}

.day-pill.domingo {
  opacity: 0.65;
}

/* Selector de Tanques Compacto (Segmented Style) */
.tanques-selector-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 100%;
}

.tanque-card-btn {
  background: var(--bg-secondary);
  border: 1.5px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-height: 34px;
}

.tanque-card-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
}

.tanque-title {
  font-family: 'Outfit', sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.tanque-card-btn.active .tanque-title {
  color: var(--primary);
}

.tanque-sub {
  font-size: 8px;
  color: var(--text-secondary);
  line-height: 1.2;
}

.tanque-price {
  font-family: 'Outfit', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--success);
  margin-top: 1px;
  line-height: 1.2;
}

/* Botón Destacado: Llenar Ahora Mismo (Turno Inmediato) */
.slot-ahora-wrapper {
  margin-bottom: 6px;
  width: 100%;
}

.btn-slot-ahora {
  width: 100%;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(2, 132, 199, 0.15) 100%);
  border: 1.5px solid var(--success);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.btn-slot-ahora:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(2, 132, 199, 0.25) 100%);
  transform: translateY(-1px);
}

.btn-slot-ahora.selected {
  background: linear-gradient(135deg, #10b981 0%, #0284c7 100%) !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

.btn-slot-ahora.selected * {
  color: #ffffff !important;
}

.pulse-zap {
  font-size: 18px;
  animation: pulseZap 1.2s infinite;
}

@keyframes pulseZap {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.slot-ahora-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.slot-ahora-info strong {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  color: var(--text-primary);
}

.slot-ahora-info span {
  font-size: 9.5px;
  color: var(--text-secondary);
}

.slot-ahora-tag {
  background: var(--success);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.slot-ahora-en-curso-banner {
  width: 100%;
  background: rgba(2, 132, 199, 0.12);
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 6px;
}

.slot-ahora-en-curso-banner strong {
  color: var(--primary);
  display: block;
  font-size: 12px;
}

.slot-ahora-en-curso-banner span {
  color: var(--text-secondary);
  font-size: 10px;
}

.btn-ver-reloj-mini {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn-ver-reloj-mini:hover {
  background: #0284c7;
  transform: scale(1.03);
}

.btn-ver-reloj-mini:active {
  transform: scale(0.97);
}

/* Botón Rápido de Atención en Puerta (Encargada) */
.btn-atender-puerta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  margin-bottom: 12px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-atender-puerta:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-atender-puerta:active {
  transform: scale(0.98);
}

.btn-atender-puerta.ocupado {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1.5px dashed var(--warning);
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0.95;
}

.btn-atender-puerta.ocupado:hover {
  filter: none;
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-light);
  box-shadow: none;
}

/* Grilla de Horarios AM / PM Compacta */
.horarios-grid-container {
  max-height: none;
  padding-right: 0;
}

.horarios-grupo-header {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  margin: 1.5px 0 1.5px 0;
}

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

@media (max-width: 480px) {
  .horarios-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
  }
}

.hora-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1.5px 1px;
  font-family: 'Outfit', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  text-align: center;
  min-height: 23px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  transition: var(--transition);
}

.hora-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.hora-btn.selected {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.3);
}

.hora-btn:disabled {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-color: transparent;
  cursor: not-allowed;
  opacity: 0.35;
}

.hora-btn .hora-sub {
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}

/* Badge de Lote en el Banner */
.badge-lote-tag {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff !important;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.3);
  display: inline-flex;
  align-items: center;
}

/* Slots Ocupados / En Llenado: ROJO VIBRANTE Y DIDÁCTICO */
.hora-btn.slot-en-llenado,
.hora-btn.slot-ocupado-lote {
  background: #fef2f2 !important;
  border: 1.5px solid #ef4444 !important;
  color: #1e293b !important;
  opacity: 1 !important;
  box-shadow: 0 1.5px 5px rgba(239, 68, 68, 0.18);
  cursor: pointer !important;
}

.hora-btn.slot-en-llenado .hora-val,
.hora-btn.slot-ocupado-lote .hora-val {
  font-weight: 800 !important;
  color: #991b1b !important;
}

/* Badge del Lote (LT 5) en ROJO VIVO DE ALTO CONTRASTE */
.hora-sub-lote,
.hora-btn.slot-en-llenado .hora-sub,
.hora-btn.slot-ocupado-lote .hora-sub {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 7.5px !important;
  padding: 1.5px 5px !important;
  border-radius: 4px !important;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.4) !important;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* Slots Libres: VERDE ESMERALDA DIDÁCTICO */
.hora-sub-libre,
.hora-btn:not(.selected):not(.slot-en-llenado):not(.slot-ocupado-lote):not(:disabled) .hora-sub {
  color: #047857 !important;
  background: rgba(16, 185, 129, 0.14) !important;
  font-weight: 800 !important;
  font-size: 7px !important;
  padding: 1.5px 4px !important;
  border-radius: 3px !important;
}

/* Slot Pasado */
.hora-btn:disabled .hora-sub {
  color: var(--text-muted) !important;
  background: transparent !important;
}

/* Modo Oscuro */
body.dark .hora-btn.slot-en-llenado,
body.dark .hora-btn.slot-ocupado-lote {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: #ef4444 !important;
  color: #fee2e2 !important;
}

body.dark .hora-btn.slot-en-llenado .hora-val,
body.dark .hora-btn.slot-ocupado-lote .hora-val {
  color: #fecaca !important;
}

body.dark .hora-sub-libre {
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.2) !important;
}

/* Caja de Transparencia de Lotes del Día */
.transparencia-lotes-box {
  margin-top: 5px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 7px;
  font-size: 10px;
}

/* En celulares y tablets (<1024px) NUNCA se muestra para ahorrar 100% de espacio vertical */
@media (max-width: 1024px) {
  .transparencia-lotes-box {
    display: none !important;
  }
}

.transparencia-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 9px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  margin-bottom: 3px;
}

.transparencia-chips {
  display: flex;
  flex-direction: column;
  gap: 2.5px;
  max-height: 80px;
  overflow-y: auto;
}

.transparencia-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 9.5px;
}

.transparencia-chip.en-curso {
  border-color: var(--primary);
  background: rgba(2, 132, 199, 0.08);
  font-weight: 700;
}

.chip-hora {
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  margin-right: 4px;
}

.chip-lote {
  flex: 1;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-lote strong {
  color: var(--text-primary);
}

.chip-estado {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}

.chip-estado.llenando {
  background: rgba(2, 132, 199, 0.2);
  color: #0284c7;
}

.chip-estado.programado {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

/* Inputs Compactos */
.inputs-inline-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3px;
}

.input-compact {
  width: 100%;
  padding: 3px 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 11px;
  color: var(--text-primary);
  min-height: 25px;
  box-sizing: border-box;
}

.input-compact:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Barra de Resumen y Confirmación Directa */
.resumen-confirm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 3px 6px;
  gap: 4px;
  margin-top: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.resumen-hora {
  font-size: 10px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.resumen-costo {
  font-size: 8.5px;
  color: var(--text-secondary);
}

.btn-pedir-agua {
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
  padding: 4px 10px;
  border-radius: 5px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  min-height: 28px;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2);
  transition: var(--transition);
  white-space: nowrap;
}

.btn-pedir-agua:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================================
   ESCALADO RESPONSIVO ADAPTATIVO POR PANTALLA (MÓVILES ALTOS & COMPUTADORAS)
   ========================================================================== */

/* --- NIVEL 2: SMARTPHONES MEDIANOS Y ALTOS (720px A 839px DE ALTURA) --- */
@media (max-width: 699px) and (min-height: 720px) {
  .app-container {
    padding: clamp(6px, 1.4vh, 12px);
    gap: clamp(6px, 1.2vh, 10px);
    max-width: 520px;
  }
  .app-topbar {
    min-height: clamp(38px, 5vh, 44px);
    padding: 4px 10px;
    border-radius: 9px;
  }
  .topbar-logo { width: 26px; height: 26px; }
  .topbar-asoc { font-size: 13.5px; }
  .tabs-nav { padding: 3px; gap: 4px; }
  .tab-btn { min-height: 32px; font-size: 11.5px; padding: 4px 12px; }
  .step-section { padding: clamp(6px, 1.4vh, 10px); border-radius: 9px; }
  .step-label { font-size: 12px; margin-bottom: 5px; }
  .day-pill { min-height: clamp(48px, 6.5vh, 58px); flex: 0 0 54px; }
  .day-pill .day-number { font-size: 14px; }
  .tanque-card-btn { min-height: clamp(38px, 5vh, 46px); padding: 6px 10px; }
  .tanque-title { font-size: 12px; }
  .horarios-grid { gap: 3.5px; }
  .hora-btn { min-height: clamp(28px, 3.8vh, 34px); font-size: 11px; padding: 3px 2px; }
  .input-compact { min-height: clamp(32px, 4.2vh, 38px); font-size: 12.5px; padding: 6px 9px; }
  .resumen-confirm-bar { padding: 6px 10px; border-radius: 8px; }
  .resumen-hora { font-size: 11.5px; }
  .btn-pedir-agua { min-height: clamp(36px, 5vh, 42px); font-size: 12.5px; padding: 6px 16px; }
}

/* --- NIVEL 3: SMARTPHONES PREMIUM / EXTRA-ALTOS (IPHONE 14/15 PRO MAX, GALAXY ULTRA, 840px+) --- */
@media (max-width: 699px) and (min-height: 840px) {
  .app-container {
    padding: 14px 16px;
    gap: 12px;
    max-width: 540px;
  }
  .app-topbar {
    min-height: 48px;
    padding: 6px 14px;
    border-radius: 12px;
  }
  .topbar-logo { width: 32px; height: 32px; }
  .topbar-asoc { font-size: 15px; max-width: 180px; }
  .topbar-pileta-badge { font-size: 11px; padding: 3px 8px; }
  .icon-btn-compact { width: 32px; height: 32px; font-size: 14px; }
  .btn-directiva-pill { min-height: 32px; font-size: 11.5px; padding: 4px 10px; }
  .tabs-nav { padding: 4px; gap: 5px; border-radius: 8px; }
  .tab-btn { min-height: 36px; font-size: 12.5px; padding: 6px 14px; border-radius: 6px; }
  .step-section { padding: 12px 14px; border-radius: 12px; }
  .step-label { font-size: 13.5px; margin-bottom: 8px; }
  .step-num { width: 18px; height: 18px; font-size: 11px; }
  .day-pill { min-height: 64px; flex: 0 0 64px; border-radius: 8px; }
  .day-pill .day-number { font-size: 16px; }
  .day-pill .day-name { font-size: 10.5px; }
  .day-pill .day-badge { font-size: 9px; }
  .tanques-selector-compact { gap: 8px; }
  .tanque-card-btn { min-height: 52px; padding: 8px 12px; border-radius: 8px; }
  .tanque-title { font-size: 13px; }
  .tanque-price { font-size: 14px; }
  .horarios-grupo-header { font-size: 10.5px; margin: 4px 0; }
  .horarios-grid { gap: 5px; }
  .hora-btn { min-height: 38px; font-size: 12px; border-radius: 6px; }
  .hora-btn .hora-sub { font-size: 8px; }
  .inputs-inline-grid { gap: 6px; }
  .input-compact { min-height: 40px; font-size: 13px; padding: 8px 10px; border-radius: 8px; }
  .resumen-confirm-bar { padding: 10px 14px; border-radius: 10px; margin-top: 6px; }
  .resumen-hora { font-size: 12.5px; }
  .resumen-costo { font-size: 10.5px; }
  .btn-pedir-agua { min-height: 44px; font-size: 13.5px; padding: 8px 20px; border-radius: 8px; }
}

/* --- NIVEL 4: TABLETS, LAPTOPS Y COMPUTADORAS DE ESCRITORIO (>= 700px) --- */
@media (min-width: 700px) {
  .app-container {
    max-width: 1140px;
    padding: 16px 20px;
    gap: 16px;
  }
  .app-topbar {
    min-height: 54px;
    padding: 8px 18px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
  }
  .topbar-logo { width: 36px; height: 36px; }
  .topbar-asoc { font-size: 18px; max-width: none; }
  .topbar-pileta-badge { font-size: 12px; padding: 4px 10px; }
  .icon-btn-compact { width: 36px; height: 36px; font-size: 16px; }
  .btn-directiva-pill { min-height: 36px; font-size: 12.5px; padding: 6px 14px; }

  .tabs-nav {
    padding: 4px;
    gap: 8px;
    border-radius: 10px;
  }
  .tab-btn {
    min-height: 40px;
    padding: 8px 20px;
    font-size: 13.5px;
    border-radius: 8px;
  }

  /* LAYOUT EN 2 COLUMNAS GENEROSAS PARA RESERVAS EN ESCRITORIO */
  .reserva-unified-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: 
      "paso1 paso3"
      "paso2 paso3"
      "paso4 paso3";
    gap: 14px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
  }

  #pasoDia {
    grid-area: paso1;
    padding: 12px 16px;
    border-radius: 12px;
    min-width: 0;
  }
  #pasoTanques {
    grid-area: paso2;
    padding: 12px 16px;
    border-radius: 12px;
    min-width: 0;
  }
  #seccionHorarios {
    grid-area: paso3;
    padding: 14px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  #formReservaAgua {
    grid-area: paso4;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
  }
  #formReservaAgua .step-section {
    padding: 12px 16px;
    border-radius: 12px;
    min-width: 0;
  }

  .step-label { font-size: 14px; margin-bottom: 10px; }
  .step-num { width: 20px; height: 20px; font-size: 12px; }

  .day-pill {
    min-height: 66px;
    flex: 0 0 70px;
    border-radius: 8px;
  }
  .day-pill .day-number { font-size: 18px; }
  .day-pill .day-name { font-size: 11px; }

  .tanques-selector-compact { gap: 10px; }
  .tanque-card-btn {
    min-height: 56px;
    padding: 10px 16px;
    border-radius: 8px;
  }
  .tanque-title { font-size: 14px; }
  .tanque-price { font-size: 15px; }

  .horarios-grid-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
  }
  .horarios-grupo-header { font-size: 11.5px; margin: 8px 0 6px 0; }
  .horarios-grid { gap: 6px; }
  .hora-btn {
    min-height: 42px;
    font-size: 12.5px;
    border-radius: 8px;
  }
  .hora-btn .hora-sub { font-size: 8.5px; }

  .inputs-inline-grid { gap: 8px; }
  .input-compact {
    min-height: 42px;
    font-size: 13.5px;
    padding: 8px 12px;
    border-radius: 8px;
  }

  .resumen-confirm-bar {
    padding: 12px 18px;
    border-radius: 10px;
  }
  .resumen-hora { font-size: 13.5px; }
  .resumen-costo { font-size: 11px; }
  .btn-pedir-agua {
    min-height: 46px;
    font-size: 14px;
    padding: 10px 24px;
    border-radius: 8px;
  }
}

.horario-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.horario-hora {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-pendiente { background: var(--warning-light); color: #b45309; }
.badge-confirmado { background: var(--info-light); color: #1d4ed8; }
.badge-en-curso { background: var(--danger-light); color: #b91c1c; }
.badge-finalizado { background: var(--success-light); color: #15803d; }

/* --- SECCIÓN 2: TIMER DE LLENADO EN TIEMPO REAL --- */
.timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
}

.timer-circle-wrap {
  position: relative;
  width: 250px;
  height: 250px;
  margin: 20px auto;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg-circle {
  fill: none;
  stroke: var(--bg-secondary);
  stroke-width: 14;
}

.timer-progress-circle {
  fill: none;
  stroke: var(--primary);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 691; /* 2 * PI * 110 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-circle-wrap.warning .timer-progress-circle { stroke: var(--warning); }
.timer-circle-wrap.danger .timer-progress-circle { stroke: var(--danger); }

.timer-inner-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-time {
  font-family: 'Outfit', sans-serif;
  font-size: 44px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
}

.timer-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 6px;
}

.timer-socio-info {
  background: var(--bg-secondary);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.timer-audio-test {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.btn-audio-test {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

/* --- SECCIÓN 3: PANEL ADMINISTRATIVO (ENCARGADA / PRESIDENTA) --- */

/* KPIs en Grid 2x2 para Móviles (<768px) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .kpi-card {
    padding: 8px 10px;
    gap: 8px;
  }
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .kpi-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

.kpi-icon.blue { background: var(--primary-light); color: var(--primary); }
.kpi-icon.green { background: var(--success-light); color: var(--success); }
.kpi-icon.amber { background: var(--warning-light); color: var(--warning); }
.kpi-icon.purple { background: #f3e8ff; color: #7e22ce; }

.kpi-content .kpi-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

.kpi-content .kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

@media (max-width: 768px) {
  .kpi-content .kpi-value {
    font-size: 16px;
  }
}

/* Cabecera del Panel y Controles */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

.filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-pill {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.filter-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Conmutador de Vistas: Tarjetas 🎴 vs Tabla 📑 */
.view-switch {
  display: flex;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.view-btn {
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Vista Tarjetas Modulares */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.turno-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}

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

.turno-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ticket-tag {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 13px;
  background: var(--bg-secondary);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.socio-header-name {
  font-size: 15px;
  font-weight: 700;
}

.socio-lote {
  font-size: 12px;
  color: var(--text-secondary);
}

.turno-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.turno-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn-action {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  transition: var(--transition);
}

.btn-action.success { background: var(--success); color: white; }
.btn-action.primary { background: var(--primary); color: white; }
.btn-action.wa { background: #25d366; color: white; text-decoration: none; }
.btn-action.danger { background: var(--danger-light); color: var(--danger); }
.btn-action.outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }

/* Vista Tabla DataGrid */
.datagrid-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.datagrid {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.datagrid th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.datagrid td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.datagrid tr:hover {
  background: var(--bg-card-hover);
}

/* --- BANNER DE CIERRE DE CAJA (ARQUEO YAPE / EFECTIVO) --- */
.caja-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .caja-banner {
    flex-direction: column;
    align-items: stretch;
  }
}

.caja-breakdown {
  display: flex;
  gap: 24px;
}

.caja-item .lbl { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; }
.caja-item .amount { font-size: 18px; font-family: 'Outfit', sans-serif; font-weight: 800; color: var(--text-primary); }
.caja-item.total .amount { color: var(--success); font-size: 22px; }

/* --- MODALES GLASSMORPHISM / BOTTOM SHEET (<768px) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: modalEnter 0.25s ease-out;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* Soporte estricto de flexbox para forms dentro de modales: evita desbordes y habilita scroll interno */
.modal-content > form,
.modal-content form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  height: 100%;
}

@media (max-width: 768px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal-content {
    max-width: 100% !important;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .modal-header {
    padding: 12px 16px;
  }
  .modal-body {
    padding: 12px 16px;
  }
  .modal-footer {
    padding: 10px 16px;
  }
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg-card);
  z-index: 5;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  line-height: 1;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--bg-card);
  z-index: 10;
}

/* Regla obligatoria: botones destructivos a la izquierda */
.modal-footer.has-destructive {
  justify-content: space-between;
}

/* Chips táctiles rápidos para excusas de mora */
.btn-chip {
  background: #ffffff;
  border: 1px solid #fdba74;
  color: #9a3412;
  border-radius: 16px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.2;
}
.btn-chip:hover {
  background: #ffedd5;
  border-color: #ea580c;
}
.btn-chip.active {
  background: #ea580c;
  color: #ffffff;
  border-color: #c2410c;
}

/* --- FORMULARIOS GLOBALES Y MODALES --- */
.form-group {
  margin-bottom: 14px;
  width: 100%;
  box-sizing: border-box;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  display: block;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* --- ESTILOS DEL MODAL DE ACCESO DIRECTIVA --- */
.modal-auth-directiva {
  max-width: 440px;
}

.login-tabs-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.login-tab-btn {
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.login-tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.pin-display-wrapper {
  display: flex;
  justify-content: center;
  margin: 10px 0 16px 0;
}

.pin-input-display {
  text-align: center;
  font-size: 26px !important;
  font-weight: 800;
  letter-spacing: 12px;
  padding: 12px 16px;
  border: 2px solid var(--primary);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  max-width: 220px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* --- TOASTS DE NOTIFICACIÓN FLOTANTE --- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast.show {
  transform: translateX(0);
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-info { border-left: 4px solid var(--info); }

.toast-icon { font-size: 20px; }
.toast-msg { font-size: 13px; font-weight: 500; color: var(--text-primary); }

/* --- SKELETON LOADERS SHIMMER --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-light) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   OPTIMIZACIONES MÓVILES EXCLUSIVAS (<768px) — EXPERIENCIA NATIVA DE APP 📱
   ========================================================================== */
@media (max-width: 768px) {
  /* Contenedor sin márgenes perdidos */
  .app-container {
    padding: 8px 6px;
    gap: 10px;
    max-width: 100vw;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Cabecera compacta que nunca se corta ni solapa */
  .app-header {
    padding: 8px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }

  .brand-section {
    gap: 8px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .brand-title {
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 165px;
  }

  .brand-subtitle {
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 165px;
  }

  .header-controls {
    gap: 6px;
    flex-shrink: 0;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
    font-size: 15px;
    border-radius: 8px;
  }

  .btn-login {
    padding: 6px 10px;
    font-size: 11.5px;
    min-height: 34px;
    border-radius: 8px;
    gap: 4px;
    white-space: nowrap;
  }

  /* Monitor de Pileta Compacto */
  .pileta-monitor-card {
    padding: 10px 12px;
    gap: 10px;
    border-radius: 12px;
  }

  .monitor-status-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .monitor-badge {
    font-size: 9px;
    padding: 1px 7px;
    margin-bottom: 2px;
  }

  .monitor-title {
    font-size: 13.5px;
    margin-bottom: 1px;
  }

  .monitor-desc {
    font-size: 11.5px;
    line-height: 1.25;
  }

  /* Barra de Pestañas Móvil Fluida con Deslizamiento Táctil */
  .tabs-nav {
    padding: 3px;
    gap: 4px;
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
  }

  .tab-btn {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    padding: 7px 11px !important;
    font-size: 11px !important;
    min-height: 36px !important;
    gap: 4px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
  }

  /* Tarjetas y Formularios Compactos */
  .card {
    padding: 12px 10px;
    border-radius: 12px;
  }

  .card-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .card-title {
    font-size: 14.5px;
  }

  .form-group {
    margin-bottom: 10px;
  }

  .form-label {
    font-size: 11.5px;
    margin-bottom: 3px;
  }

  .form-control {
    padding: 8px 10px;
    font-size: 15px;
    min-height: 42px;
    border-radius: 8px;
  }

  /* Selector Segmentado Móvil Garantizado */
  .segmented-control {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 10px !important;
  }

  .segment-btn {
    min-width: 0 !important;
    width: 100% !important;
    padding: 6px 2px !important;
    min-height: 40px !important;
    border-radius: 8px !important;
  }

  .segment-btn strong {
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
  }

  .segment-btn .subtext {
    font-size: 8.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    margin-top: 1px !important;
  }

  /* Selector de Días */
  .days-carousel {
    gap: 6px;
    padding-bottom: 6px;
    margin-bottom: 10px;
  }

  .day-pill {
    flex: 0 0 54px;
    min-height: 58px;
    padding: 4px 2px;
    border-radius: 8px;
  }

  .day-pill .day-number {
    font-size: 16px;
  }

  .day-pill .day-name {
    font-size: 9.5px;
  }

  .day-pill .day-badge {
    font-size: 8px;
  }

  /* Resumen Dinámico */
  .summary-box {
    padding: 8px 10px;
    margin-bottom: 12px;
    border-radius: 8px;
  }

  .summary-item .label {
    font-size: 10px;
  }

  .summary-item .val {
    font-size: 14px;
  }

  .btn-primary {
    padding: 11px 12px;
    font-size: 14px;
    min-height: 44px;
    border-radius: 10px;
  }

  /* Lista de Horarios */
  .horarios-list {
    max-height: 260px;
    gap: 6px;
  }

  .horario-item {
    padding: 8px 10px;
  }

  .horario-hora {
    font-size: 13px;
  }

  /* Timer Móvil */
  .timer-circle-wrap {
    width: 200px;
    height: 200px;
    margin: 12px auto;
  }

  .timer-time {
    font-size: 36px;
  }

  .timer-socio-info {
    padding: 6px 12px;
    font-size: 11px;
    gap: 6px;
    margin-bottom: 12px;
  }

  .timer-audio-test {
    flex-direction: column;
    width: 100%;
    gap: 6px;
  }

  .btn-audio-test {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }
}

/* Chips rápidos de 1 toque (excusas / motivos) */
.btn-chip {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-chip:hover {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
  transform: translateY(-1px);
}

.btn-chip.active {
  background: #ea580c;
  border-color: #ea580c;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.3);
}

/* --- INTEGRACIÓN CSIFACT POS (IMPRESIÓN TÉRMICA ANDROID) --- */
.android-print-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 182, 212, 0.12) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 12px;
}

.android-badge-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.android-badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.android-badge-text strong {
  color: var(--success);
  font-weight: 700;
  font-size: 12.5px;
}

.android-badge-text small {
  color: var(--text-secondary);
  font-size: 11px;
}

.btn-action.btn-csifact {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  border: 1px solid #047857 !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-action.btn-csifact:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.45);
  transform: translateY(-1px);
}

.btn-action.btn-csifact:active {
  transform: scale(0.97);
}

