/* =========================================================
   CSS UNIFICADO – Autogestión Empresa Cabrera
   Combina: index.css + css/styles autogestion.css
   ========================================================= */

/* --- 1. Variables y reset global --- */
:root {
  /* Paleta unificada y moderna */
  --primary: #005F73;
  --primary-dark: #004756;
  --secondary: #0A9396;
  --secondary-dark: #087e81;
  --accent: #94D2BD;
  --accent-light: #c5ebe0;
  --background: #F8FAF9;
  --surface: #FFFFFF;
  --text: #0f172a;
  --text-muted: #64748b;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html, body {
  width: 100%;
  height: 100%;
}
.container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}
a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
h1, h2, h3, h4 {
  font-weight: 600;
  color: var(--primary);
}

/* =========================================================
   2. LAYOUT APP (estilo Turnos)
   ========================================================= */
.app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--background);
}

/* =========================================================
   3. HEADER NUEVO (estilo Turnos)
   ========================================================= */
header.header,
header.header.scrolled {
  position: static !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  min-height: 74px !important;
  height: auto !important;
  padding: 12px 18px !important;
  background: #ffffff !important;
  background-image: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  flex: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: none !important;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-logo {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.brand-text strong {
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
}
.brand-text span {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.back-btn {
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(10, 147, 150, .18);
  border-radius: 12px;
  background: rgba(10, 147, 150, .08);
  color: var(--primary-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.back-btn:active {
  transform: scale(.96);
}

/* Responsive Header */
@media (max-width: 1024px) {
  header.header,
  header.header.scrolled {
    height: auto !important;
    min-height: 74px !important;
    padding-bottom: 12px !important;
  }
}
@media (max-width: 768px) {
  header.header,
  header.header.scrolled {
    height: auto !important;
    min-height: 70px !important;
    padding-bottom: 12px !important;
  }
}
@media (max-width: 480px) {
  .app {
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
  header.header,
  header.header.scrolled {
    min-height: 68px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-bottom: 12px !important;
    height: auto !important;
  }
  .brand { gap: 8px; }
  .brand-logo { width: 40px; height: 40px; }
  .brand-text strong { font-size: 13px; }
  .brand-text span { font-size: 11px; }
  .back-btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 12px;
  }
  .back-btn span { display: none; }
  .back-btn i { font-size: 17px; }
}
@media (min-width: 768px) {
  body {
    background: #e9eef0;
  }
  .app {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--background);
    box-shadow: 0 0 40px rgba(0, 0, 0, .10);
  }
}

/* =========================================================
   4. HEADER ANTIGUO (desactivado – estilos funcionales legacy)
   Se mantienen comentados para referencia.
   =========================================================
   header {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     z-index: 1000;
     transition: background-color 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease, height 0.4s ease;
     height: auto;
     min-height: 100px;
     padding-bottom: 10px;
     background: linear-gradient(to bottom,  rgba(0, 95, 115, 0.95), rgba(0, 95, 115, 0.8));
   }
   ... (resto de estilos del header antiguo)
   ========================================================= */

/* --- Legacy wrapper, desactivado --- */
.body-content-wrapper { padding-top: 0; }
.logo-container,
.desktop-nav,
.header-actions .contact-buttons,
.mobile-menu-btn,
.mobile-nav,
.mobile-overlay { display: none !important; }

/* =========================================================
   5. CARRUSEL (LEGACY)
   ========================================================= */
.carousel-section {
  padding: 0;
  margin-top: 20px;
}
.carousel-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
.carousel-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.carousel-slide {
  flex-shrink: 0;
  width: 100%;
  height: 400px;
  position: relative;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 15px 10px;
  border-radius: 8px;
  z-index: 10;
  transition: background-color 0.3s ease, color 0.3s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.carousel-nav-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  color: var(--accent);
}
.carousel-nav-btn.prev { left: 20px; }
.carousel-nav-btn.next { right: 20px; }
.carousel-dots-container {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}
.carousel-dots-container .dot {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.carousel-dots-container .dot.active {
  background: var(--accent);
  transform: scale(1.2);
  border: 1px solid var(--accent);
}
@media (max-width: 768px) {
  .carousel-slide { height: 250px; }
  .carousel-nav-btn {
    font-size: 1.2rem;
    padding: 10px 8px;
  }
  .carousel-nav-btn.prev { left: 10px; }
  .carousel-nav-btn.next { right: 10px; }
}
.dot {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.dot.active { background: var(--accent); transform: scale(1.2); }

/* =========================================================
   6. UBICACIONES / LOCATIONS (LEGACY)
   ========================================================= */
.locations { padding: 30px 20px; background-color: var(--white); }
.locations .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.location-card {
  background-color: var(--background);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}
.location-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px var(--shadow);
}
.location-card h3 {
  font-size: 1.05rem;
  margin-bottom: 15px;
  text-align: center;
}
.location-details {
  margin-bottom: 15px;
  flex-grow: 1;
}
.location-details p {
  font-size: 0.75rem;
  margin-bottom: 10px;
  color: var(--text-muted, #555);
  display: flex;
  align-items: center;
  gap: 10px;
}
.location-details i {
  color: var(--secondary);
  font-size: 1rem;
  width: 20px;
  text-align: center;
}
.locations .map-link {
  display: inline-block;
  padding: 10px 15px;
  background-color: var(--secondary);
  color: var(--white);
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  width: 100%;
}
.locations .map-link:hover {
  background-color: var(--primary);
  color: var(--white);
  transform: scale(1.03);
}

/* =========================================================
   7. HERO / FAQS / REVIEWS (LEGACY)
   ========================================================= */
.hero {
  color: var(--white);
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}
.hero h2 { font-size: 2.2rem; margin-bottom: 16px; color: var(--white); }
.hero p { font-size: 1.1rem; max-width: 600px; margin: 0 auto 24px; }
.hero .contact-buttons { justify-content: center; }
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }
section { padding: 60px 20px; }
.section-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #1f2933;
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.section-title i {
  color: var(--secondary);
  font-size: 1.4rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.card {
  background: white;
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border: 1px solid #eef2f4;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card i {
  font-size: 2.5rem;
  color: var(--secondary);
  margin-bottom: 12px;
  display: block;
}
.card h3 {
  margin: 0 0 14px;
  font-size: 1.1rem;
  color: #1f2933;
  font-weight: 700;
}
.card p { font-size: 0.9rem; color: #555; }
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.map-link {
  display: inline-block;
  background: var(--secondary);
  color: white;
  padding: 10px 22px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}
.map-link:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}
.map-link:active {
  transform: translateY(0);
}
#about {
  padding: 80px 20px;
  background: linear-gradient(rgba(0, 95, 115, 0.8), rgba(10, 147, 150, 0.8));
  color: var(--white);
  border-radius: 12px;
  margin: 40px 0;
  border: 2px solid var(--accent);
}
#about .section-title { color: var(--white); margin-bottom: 32px; }
#about .about-icon { font-size: 3rem; color: var(--accent); margin-bottom: 20px; text-align: center; display: block; }
#about .about-content { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 900px; margin: 0 auto; }
#about p { font-size: 1.1rem; line-height: 1.8; }
#reviews .card { background-color: #f0f7f7; border: 1px solid var(--accent); }
#reviews .stars { font-size: 1.2rem; color: #FFD700; margin-bottom: 12px; }
#reviews .card p { font-style: italic; }
#reviews .card small { color: #777; font-size: 0.8rem; }

.faq-item {
  margin-bottom: 16px;
  background-color: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px var(--shadow);
}
.faq-question {
  padding: 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  color: var(--primary);
}
.faq-question span { transition: transform 0.3s ease; }
.faq-item.active .faq-question span { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; }
.faq-answer p { padding: 0 16px 16px; font-size: 0.9rem; }

/* =========================================================
   8. POPUP / MODAL GENERAL (LEGACY)
   ========================================================= */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}
.popup-overlay.active { display: flex; }
.popup-content {
  background: var(--white);
  padding: 30px;
  border-radius: 12px;
  max-width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 8px 16px var(--shadow);
}
.popup-content img {
  max-width: 300px;
  border-radius: 8px;
  margin: 0 auto 30px auto;
  display: block;
}
.popup-content h3 { font-size: 1.2rem; margin-bottom: 16px; }
.popup-content p { font-size: 0.9rem; margin-bottom: 20px; color: #555; }
.popup-content a {
  background-color: var(--secondary);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 600;
  display: inline-block;
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.popup-content a:hover { background-color: var(--accent); transform: scale(1.05); }
.close-popup { position: absolute; top: 12px; right: 12px; font-size: 1.5rem; cursor: pointer; color: var(--primary); }

@media (max-width: 480px) {
  .popup-content {
    padding: 20px;
    border-radius: 10px;
    width: 92%;
    max-width: 320px;
  }
  .popup-content img {
    max-width: 230px;
    margin: 0 auto 30px auto;
    display: block;
  }
  .popup-content h3 { font-size: 0.95rem; }
  .popup-content p { font-size: 0.8rem; }
  .popup-content a { font-size: 0.85rem; padding: 8px 16px; }
  .close-popup { font-size: 1.2rem; top: 8px; right: 10px; }
}

/* =========================================================
   9. FOOTER (ELIMINADO)
   Se mantienen las clases referenciadas pero ocultas.
   ========================================================= */
footer { display: none !important; }
.footer-content,
.footer-privacy,
.social-icons { display: none !important; }

/* =========================================================
   10. SISTEMA DE PESTAÑAS / TABS
   ========================================================= */
:root {
  --bg: #F1F5F9;
  --tab-border: #e5e7eb;
  --shadow: rgba(0,0,0,0.10);
  --shadow-strong: rgba(0,0,0,0.25);
}

/* Sistema de pestañas */
.tab-container {
  max-width: 900px;
  margin: 40px auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 25px var(--shadow);
  border: 1px solid var(--tab-border);
  overflow: hidden;
}
.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--tab-border);
  background: #fdfdfd;
}
.tab-button {
  flex: 1;
  padding: 18px 10px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  background: none;
  color: #475569;
  transition: all 0.3s ease;
  border-bottom: 4px solid transparent;
  white-space: nowrap;
}
.tab-button:hover { background: #f9fafb; color: var(--primary-dark); }
.tab-button.active { color: var(--secondary); border-bottom-color: var(--secondary); }
.tab-content { display: none; padding: 20px 10px; }
.tab-content.active { display: block; }

/* =========================================================
   11. CONSULTA DE CUOTAS / TURNOS
   ========================================================= */
.consulta-section {
  background: var(--surface);
  padding: 24px 20px 48px 20px;
  border-top: none;
}
.consulta-box {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 24px auto;
  flex-wrap: wrap;
}
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
}
#turnosTabContent .input-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
}
#turnosTabContent .input-wrapper { max-width: 400px; }

.search-wrapper i,
#turnosTabContent .input-wrapper i {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--secondary);
  pointer-events: none;
}
.search-input-styled,
#turnosTabContent select,
#turnosTabContent input {
  width: 100%;
  padding: 16px 18px 16px 50px;
  background: #F8FAFC;
  border-radius: 14px;
  border: 2px solid #e5e7eb;
  font-size: 1rem;
  font-weight: 500;
  color: #0f172a;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-input-styled:hover,
#turnosTabContent select:hover,
#turnosTabContent input:hover {
  background: #ffffff;
  border-color: #94D2BD;
}
.search-input-styled:focus,
#turnosTabContent select:focus,
#turnosTabContent input:focus {
  border-color: var(--secondary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(10,147,150,0.15), 0 0 12px rgba(10,147,150,0.2);
  outline: none;
}
.search-input-styled:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(10,147,150,0.15);
}
.search-input-styled.valid { border-color: #2ecc71; background-color: #f0fdf4; }
.search-input-styled.invalid { border-color: #e74c3c; background-color: #fef2f2; }

.btn-consultar {
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 16px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.btn-consultar:hover {
  background: var(--secondary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-consultar:active {
  transform: translateY(0);
}

.resultado-consulta {
  margin-top: 25px;
  text-align: center;
  min-height: 40px;
}
.resultado-card {
  background: var(--surface);
  display: inline-block;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: left;
  width: 100%;
  max-width: 450px;
  border-left: 5px solid var(--secondary);
  vertical-align: top;
  margin: 0 auto;
  animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.resultado-card h3 { margin-top: 0; color: var(--secondary); font-size: 1.1rem; font-weight: 700; }
.resultado-card table { width: 100%; margin-top: 0; border-collapse: collapse; font-size: 0.9rem; word-break: break-word; }
.resultado-card th, .resultado-card td { padding: 8px 2px; border-bottom: 1px dashed #eee; }
.resultado-card tr:last-child td { border-bottom: none; }

/* Tabla de cuotas */
.tabla-cuotas th:nth-child(4),
.tabla-cuotas td:nth-child(4) { text-align: right; width: 120px; }
.tabla-cuotas td { vertical-align: middle; }
.cuotas-card { padding: 16px 18px; }
.cuotas-card h3 { margin-bottom: 8px; }
.cuotas-card > p { margin: 0 0 10px; }
.tabla-cuotas th, .tabla-cuotas td { padding: 6px 4px; line-height: 1.2; }
.tabla-cuotas thead th { font-size: 0.82rem; }
.tabla-cuotas tbody td { font-size: 0.84rem; }
.btn-cuota-pagar { padding: 6px 10px; font-size: 0.78rem; justify-content: center; min-width: 82px; gap: 6px; }
.cuota-accion { white-space: nowrap; }
.cuotas-total-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-top: 10px; }
.cuotas-total-label { margin: 0; font-weight: 700; color: #c0392b; }
.btn-pagar-todo { padding: 8px 12px; justify-content: center; min-width: 120px; }

/* Grid Mis Turnos */
#resultadoMisTurnos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 850px;
  margin: 25px auto 0;
}
.turno-card-styled {
  padding: 0 !important;
  border-left: none !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.turno-banner {
  background-color: var(--secondary);
  color: white;
  padding: 12px 15px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.turno-body { padding: 15px 20px; flex-grow: 1; }

.alias-box {
  background-color: #f0fdf4;
  border: 1px dashed #22c55e;
  padding: 12px;
  border-radius: 8px;
  margin: 14px 0;
  text-align: center;
}
.alias-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: #166534;
  margin: 5px 0;
  cursor: pointer;
  user-select: all;
}
.contact-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.btn-email {
  background: #64748b; color: white; border: none; border-radius: 8px;
  padding: 12px; font-weight: 600; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: 0.3s; text-decoration: none;
}
.btn-email:hover { background: #475569; }
.loading-text { color: var(--secondary); font-weight: 600; animation: blink 1.2s infinite; grid-column: 1 / -1; }
@keyframes blink { 50% { opacity: 0.5; } }

/* Page Wrapper */
.page-wrapper { max-width: 960px; margin: 0 auto; padding: 24px 20px 48px 20px; }
@media (max-width: 768px) {
  .page-wrapper { padding: 20px 15px 40px 15px; }
  .btn-consultar { padding: 12px 16px; font-size: 0.95rem; }
  .tabla-cuotas th:nth-child(4),
  .tabla-cuotas td:nth-child(4) { width: 98px; }
  .tabla-cuotas th, .tabla-cuotas td { padding: 5px 3px; }
  .btn-cuota-pagar { min-width: 80px; padding: 6px 8px; font-size: 0.76rem; }
  .cuotas-total-row { grid-template-columns: 1fr; }
  .btn-pagar-todo { width: 100%; min-width: 0; }
}

/* =========================================================
   12. MODALES – app-modal, recibos, pagos, guía
   ========================================================= */
.app-modal {
  display: none;
  position: fixed;
  z-index: 99998;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 64px;
}
.app-modal.open { display: flex; }
.app-modal-content {
  width: min(900px, 95vw);
  max-height: 85vh;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-xl);
  border: 1px solid #e2e8f0;
  overflow: auto;
  animation: modalSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.app-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.app-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.app-modal-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0f172a;
  transform: rotate(90deg);
}
#sociosModalBody { padding: 10px; }
#appModalBody { padding: 10px; }
.app-modal .tab-content { display: block; padding: 0; }

@media (max-width: 768px) {
  .app-modal { padding-top: 24px; align-items: center; }
  .app-modal-content { width: 92vw; max-height: 80vh; border-radius: 12px; }
  .app-modal-header { padding: 10px 12px; }
}

/* Botones específicos */
.btn-descargar {
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.btn-descargar:hover {
  background: var(--secondary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-descargar:active { transform: translateY(0); }

.btn-recibo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--secondary);
  color: white;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  margin-top: 5px;
}
.btn-recibo:hover {
  background: var(--secondary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}
.btn-recibo:active { transform: translateY(0); }
.btn-recibo i { font-size: 1.1rem; }

/* =========================================================
   13. WIZARD SOLICITAR TURNO
   ========================================================= */
#turnosTabContent .page-container {
  max-width: 600px; margin: 10px auto; background: #ffffff; padding: 0;
  border-radius: 0; box-shadow: none; border: none; overflow: hidden;
}
#turnosTabContent .patient-info {
  background: var(--secondary); color: #fff; font-weight: 600; padding: 10px 20px;
  border-radius: 14px; text-align: center; margin-bottom: 20px;
  opacity: 0; transform: translateY(-20px); transition: all 0.5s ease;
}
#turnosTabContent .patient-info.show { opacity: 1; transform: translateY(0); }
#turnosTabContent h1 { text-align: center; color: #005F73; font-size: 2rem; margin-bottom: 8px; font-weight: 700; }
#turnosTabContent p.desc { text-align: center; color: var(--text-muted); font-size: 1rem; margin-top: 0; margin-bottom: 30px; }
#turnosTabContent .turnos-box {
  display: flex; flex-direction: column; gap: 18px; align-items: center; width: 100%;
  transition: height 0.3s ease-out; overflow: hidden;
}
#turnosTabContent .step {
  display: none; flex-direction: column; gap: 18px; opacity: 0;
  transition: all 0.5s ease; width: 100%; align-items: center;
}
#turnosTabContent .step.show { display: flex; opacity: 1; transform: translateX(0); }
#turnosTabContent .step-buttons {
  display: flex; justify-content: space-between; width: 100%; max-width: 400px; margin-top: 10px; gap: 10px;
}
#turnosTabContent .step-buttons button {
  padding: 12px 18px; font-size: 1rem; border-radius: 10px; border: none; cursor: pointer;
  font-weight: 600; background: var(--secondary); color: #fff; transition: 0.3s;
}
#turnosTabContent .step-buttons button:hover { background: var(--secondary-dark); }
#turnosTabContent .action-button {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: white; border: none; width: 100%; max-width: 400px;
  padding: 14px; font-size: 1rem; border-radius: 14px; cursor: pointer;
  font-weight: 700; box-shadow: 0 4px 14px rgba(0,150,150,0.25);
  transition: all 0.3s ease; margin-top: 10px;
}
#turnosTabContent .step-buttons button.btn-back { background: #D9534F; color: white; flex-grow: 1; }
#turnosTabContent .summary-box {
  background: #F8FAFC; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 6px 8px; width: 100%; max-width: 350px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05); color: #333;
}
#turnosTabContent .summary-box h3 {
  color: #005F73; text-align: center; margin-top: 0; margin-bottom: 10px; font-size: 1.4rem;
}
#turnosTabContent .summary-item {
  display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed #cbd5e1;
}
#turnosTabContent .summary-item:last-child { border-bottom: none; }

/* Farmacia de Turno */
.pharmacy-on-duty { background-color: #f8fafc; padding: 40px 0; }
.pharmacy-container { margin-top: 20px; }
.pharmacy-list-dynamic {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 20px;
  align-items: stretch;
}
.pharmacy-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.28);
  padding: 24px;
  max-width: 500px;
  width: 100%;
  border-top: 5px solid #0A9396;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: transform 0.3s ease;
}
.pharmacy-card:hover { transform: translateY(-5px); }
.pharmacy-header {
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
}
.pharmacy-logo { width: 60px; height: 60px; object-fit: contain; }
.pharmacy-badge {
  background: #0A9396; color: white;
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
}
.pharmacy-info h3 { margin: 0; color: #005F73; font-size: 1.3rem; }
.pharmacy-details p {
  margin: 8px 0; display: flex; align-items: center; gap: 10px;
  color: #475569; font-size: 0.95rem;
}
.pharmacy-details i { color: #0A9396; width: 20px; text-align: center; }
.pharmacy-actions { display: flex; gap: 10px; }
.btn-map, .btn-call {
  flex: 1; padding: 12px; border-radius: 10px; text-align: center;
  font-weight: 600; transition: 0.3s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
.btn-map { background: #0A9396; color: white !important; }
.btn-map:hover { background: #087e81; }
.btn-call {
  background: #f1f5f9; color: #005F73 !important; border: 1px solid #e2e8f0;
}
.btn-call:hover { background: #e2e8f0; }
@media (max-width: 768px) {
  .pharmacy-list-dynamic { grid-template-columns: 1fr; }
}

/* Mensajes y Modales turno */
.turno-mensaje {
  background: #d9fbe9; border-left: 6px solid #10b981; padding: 16px;
  border-radius: 12px; margin-top: 12px; color: #065f46;
  font-weight: 600; text-align: center; display: none;
  animation: fadeIn 0.4s ease;
}
.turno-mensaje.error { background: #ffe1e1; border-left-color: #ef4444; color: #b91c1c; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.turno-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  align-items: flex-start;
  justify-content: center;
  padding: 500px 20px 20px;
}
.turno-modal-content {
  background: #fff;
  padding: 26px 22px;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  margin: 0;
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(-18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.icon-wrap { width: 96px; height: 96px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; }
.check-svg { width: 88px; height: 88px; overflow: visible; }
.check-svg .bg, .check-svg .check-circle, .check-svg .check-check {
  transform-box: fill-box; transform-origin: 50% 50%;
}
.check-svg .bg { transform: scale(0); transition: transform 200ms cubic-bezier(.2,.9,.3,1) 100ms; opacity: 0; }
.check-svg .check-circle { stroke-dasharray: 157; stroke-dashoffset: 157; transition: stroke-dashoffset 600ms cubic-bezier(.2,.9,.3,1); }
.check-svg .check-check { stroke-dasharray: 48; stroke-dashoffset: 48; transition: stroke-dashoffset 380ms cubic-bezier(.2,.9,.3,1) 380ms; }
.check-svg.play .bg { transform: scale(1); opacity: 1; }
.check-svg.play .check-circle { stroke-dashoffset: 0; }
.check-svg.play .check-check { stroke-dashoffset: 0; }
.modal-texto { font-size: 1rem; color: #163a3a; margin: 6px 0 12px; }
.modal-btn {
  padding: 10px 18px; border: none; background: #0a7f70; color: #fff;
  border-radius: 9px; cursor: pointer; font-weight: 600;
  transition: transform .12s ease, background .12s ease;
}
.modal-btn:hover { transform: translateY(-2px); background: #0b6f61; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.hero-action {
  background: var(--secondary); color: #fff; border: none; border-radius: 12px;
  padding: 12px 18px; font-size: 1rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.hero-action:hover { background: var(--secondary-dark); }

@media (max-width: 768px) {
  .turno-modal { padding: 120px 12px 12px; }
  .turno-modal-content { max-width: 340px; padding: 20px 16px; }
}
@media (max-width: 600px) {
  .tab-container { margin: 20px 10px; border-radius: 16px; }
  .tab-nav { gap: 0; flex-wrap: wrap; }
  .tab-button { flex: 1 1 50%; font-size: 0.8rem; padding: 12px 4px; white-space: normal; line-height: 1.2; }
  #turnosTabContent h1 { font-size: 1.5rem; }
  .resultado-card { width: 100%; max-width: 100%; }
}

/* =========================================================
   14. SPINNER / TOAST / CONFIRM / OFFLINE STATE
   ========================================================= */
.spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border-left-color: #ffffff;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100000;
}
.toast {
  background: #333; color: #fff;
  padding: 12px 20px; border-radius: 8px;
  margin-top: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex; align-items: center; gap: 10px;
  opacity: 0; transform: translateY(20px);
  animation: slideIn 0.3s forwards;
}
.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }
.toast.info { background: #3b82f6; }
@keyframes slideIn { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-20px); } }

/* TOAST UNIFICADO */
.ui-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #ffffff;
  color: #1f2937;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 99999;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  display: flex; align-items: center; gap: 12px;
  min-width: 260px; max-width: 360px;
}
.ui-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ui-toast-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.ui-toast-text { flex: 1; line-height: 1.3; }
.ui-toast.success { border-left: 6px solid #10b981; }
.ui-toast.success .ui-toast-icon { background: #dcfce7; color: #059669; }
.ui-toast.error { border-left: 6px solid #e74c3c; }
.ui-toast.error .ui-toast-icon { background: #fee2e2; color: #dc2626; }
.ui-toast.warning { border-left: 6px solid #f59e0b; }
.ui-toast.warning .ui-toast-icon { background: #fef3c7; color: #d97706; }

/* CONFIRM MODERNO */
.ui-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
}
.ui-confirm-box {
  background: #fff;
  width: 100%;
  max-width: 380px;
  border-radius: 16px;
  padding: 26px 24px 22px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0,0,0,0.35);
  animation: confirmPop 0.25s ease;
}
.ui-confirm-box.danger { border-top: 6px solid #e74c3c; }
.ui-confirm-icon {
  width: 60px; height: 60px; margin: 0 auto 10px; border-radius: 50%;
  background: #fee2e2; color: #dc2626;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.ui-confirm-title { margin: 10px 0 6px; font-size: 1.25rem; font-weight: 700; color: #7f1d1d; }
.ui-confirm-text { font-size: 0.95rem; color: #444; margin-bottom: 22px; }
.ui-confirm-actions { display: flex; gap: 12px; }
.ui-btn-cancel,
.ui-btn-confirm {
  flex: 1; padding: 12px; font-size: 0.95rem;
  border-radius: 10px; border: none; cursor: pointer;
  font-weight: 600;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s;
}
.ui-btn-cancel { background: #f1f5f9; color: #334155; }
.ui-btn-cancel:hover { background: #e2e8f0; }
.ui-btn-confirm {
  background: #e74c3c; color: white;
  box-shadow: 0 6px 16px rgba(231,76,60,0.35);
}
.ui-btn-confirm:hover { background: #c0392b; transform: translateY(-1px); }
@keyframes confirmPop {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Farmacia estado / botón reintentar */
.farmacia-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  padding: 24px 16px; text-align: center;
}
.farmacia-state__icon { font-size: 42px; color: #dc2626; }
.farmacia-state--offline .farmacia-state__icon { color: #16a34a; }
.farmacia-state__text {
  font-size: 15px; color: #374151; line-height: 1.4; margin: 0;
}
.btn-retry {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; font-size: 14px; font-weight: 600;
  border-radius: 999px; border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.btn-retry--error { background: #dc2626; color: #fff; }
.btn-retry--error:hover { background: #b91c1c; transform: translateY(-1px); }
.btn-retry--offline { background: #16a34a; color: #fff; }
.btn-retry--offline:hover { background: #15803d; transform: translateY(-1px); }
.btn-retry:focus-visible { outline: 3px solid #fde047; outline-offset: 3px; }
@media (max-width: 480px) {
  .btn-retry { width: 100%; justify-content: center; }
}
.btn-retry.is-loading { pointer-events: none; opacity: 0.8; }
.btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* =========================================================
   15. PAGO / CHECKOUT (Mercado Pago / QR)
   ========================================================= */
.pago-card { text-align: center; }
.checkout-card {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
  background: white;
  border-radius: 16px;
  padding: 30px 25px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  animation: fadeInUp .4s ease;
}
.checkout-icon {
  font-size: 38px; color: #0a9396; margin-bottom: 10px;
}
.checkout-card h3 { margin: 10px 0; font-size: 1.5rem; color: #1e293b; }
.checkout-text { color: #555; margin-bottom: 20px; font-size: 0.95rem; }
.checkout-actions a {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px; background: #009ee3; color: white;
  padding: 14px 22px; border-radius: 12px;
  font-weight: 600; text-decoration: none;
  transition: 0.25s;
}
.checkout-actions a:hover {
  background: #0077b6; transform: translateY(-2px);
}
.checkout-info {
  margin-top: 15px; font-size: 0.85rem; color: #777;
}
.btn-volver {
  margin-top: 18px; background: #f1f5f9; border: none;
  padding: 10px 18px; border-radius: 10px;
  cursor: pointer; font-size: 0.9rem;
}
.btn-volver:hover { background: #e2e8f0; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.checkout-loading {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 30px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(0,0,0,0.08);
  animation: fadeInUp .4s ease;
}
.secure-icon {
  font-size: 32px; color: #0a9396; margin-bottom: 10px;
}
.card-animation {
  font-size: 42px; color: #334155;
  margin: 10px 0 20px;
  animation: cardMove 1.2s ease-in-out infinite alternate;
}
.checkout-loading h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
  color: #1e293b;
}
.checkout-loading p {
  font-size: 0.9rem; color: #64748b; margin-bottom: 20px;
}
.bank-spinner {
  width: 60px; height: 60px; border-radius: 50%;
  border: 4px solid #e2e8f0;
  border-top-color: #0a9396;
  margin: auto;
  animation: spin .8s linear infinite;
}
.progress-bar {
  width: 100%; height: 6px;
  background: #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
}
.progress-fill {
  width: 40%; height: 100%;
  background: #0a9396;
  animation: progressMove 1.5s infinite;
}
.secure-text { margin-top: 14px; font-size: 0.8rem; color: #64748b; }
@keyframes progressMove {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}
@keyframes cardMove {
  from { transform: translateY(0px); }
  to { transform: translateY(-6px); }
}
.checkout-success {
  text-align: center; padding: 40px;
  animation: fadeInUp .4s ease;
}
.success-check {
  font-size: 52px; color: #2ecc71;
  margin-bottom: 10px; animation: popCheck .35s ease;
}
@keyframes popCheck {
  0% { transform: scale(.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.mp-logo { text-align: center; margin-bottom: 18px; }
.mp-logo img {
  width: 160px; max-width: 100%;
  display: block; margin: 0 auto;
}

/* =========================================================
   16. ANIMACIONES GLOBALES / EMPTY STATE
   ========================================================= */
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
}
.empty-state__icon {
  font-size: 4rem; color: var(--accent);
  margin-bottom: 16px; animation: bounce 2s infinite;
}
.empty-state__title {
  font-size: 1.25rem; font-weight: 600;
  color: var(--text); margin-bottom: 8px;
}
.empty-state__text {
  font-size: 0.95rem; max-width: 400px;
  margin: 0 auto; line-height: 1.6;
}
