/* ============================================================
   VARIABLES CSS - PERSONALIZA LOS COLORES AQUÍ
   ============================================================ */
:root {
  /* Colores primarios - Azul salud/confianza */
  --primary: #330935;
  --primary-dark: #240624;
  --primary-light: #f0ecf1;
  --primary-gradient: linear-gradient(135deg, #330935 0%, #240624 100%);

  /* Colores secundarios - Verde salud/naturaleza */
  --secondary: #2ecc71;
  --secondary-dark: #27ae60;
  --secondary-light: #e8f8f0;

  /* Neutros */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Estados */
  --success: #2ecc71;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;

  /* Tipografía */
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: "Inter", sans-serif;

  /* Sombras */
  --shadow-sm: 0 1px 2px 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);

  /* Bordes */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transiciones */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============================================================
   ESTILOS BASE
   ============================================================ */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  color: var(--gray-800);
  background-color: var(--white);
  line-height: 1.6;
}

/* ============================================================
   COMPONENTES REUTILIZABLES
   ============================================================ */

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  line-height: 1.2;
}

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

.btn-primary {
  background: var(--primary-gradient);
  color: var(--white);
  box-shadow: 0 4px 14px rgb(38 6 39 / 46%);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(26, 115, 232, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary-light);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: none;
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--secondary);
  color: var(--white);
}

.btn-success:hover {
  background: var(--secondary-dark);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.1rem;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  transition: all var(--transition-base);
  border: 1px solid var(--gray-100);
}

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

.card-service {
  text-align: center;
  padding: 32px 24px;
}

.card-service .icon-wrapper {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

.card-service:hover .icon-wrapper {
  background: var(--primary);
  color: var(--white);
}

.card-service .icon-wrapper svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
  transition: all var(--transition-base);
}

.card-service:hover .icon-wrapper svg {
  color: var(--white);
}

/* Modales */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9) translateY(20px);
  transition: all var(--transition-base);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* Formularios */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  background: var(--white);
  color: var(--gray-800);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group .error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Tablas */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

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

table th {
  background: var(--gray-50);
  color: var(--gray-700);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 2px solid var(--gray-200);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

table th:hover {
  background: var(--gray-100);
}

table th .sort-icon {
  display: inline-block;
  margin-left: 6px;
  opacity: 0.4;
  font-size: 0.75rem;
}

table th .sort-icon.active {
  opacity: 1;
  color: var(--primary);
}

table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.9rem;
}

table tr:hover {
  background: var(--gray-50);
}

table tr:last-child td {
  border-bottom: none;
}

/* Badges / Estados */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-new {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-processing {
  background: #fef3c7;
  color: #b45309;
}

.badge-responded {
  background: #d1fae5;
  color: #065f46;
}

.badge-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

/* Alertas / Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 16px 24px;
  border-radius: var(--radius-md);
  color: var(--white);
  font-weight: 500;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 400px;
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--danger);
}

.toast-info {
  background: var(--info);
}

/* Header/Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-100);
  transition: all var(--transition-base);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.navbar .container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 7px 40px 7px 1px;
  max-width: 1200px;
  margin: 0 auto;
}

.navbar .logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gray-900);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar .logo img {
  height: 60px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a:not(.nav-btn-cta)::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition-base);
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-700);
  padding: 8px;
}

/* Hero Section */
.hero {
  padding: 140px 24px 80px;
  background: linear-gradient(135deg, #f5f0ff 0%, #ffffff 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(26, 115, 232, 0.08) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--gray-900);
  margin-bottom: 16px;
}

.hero-text h1 span {
  color: var(--primary);
}

.hero-text p {
  font-size: 1.15rem;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 520px;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
}

.hero-image-back {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 99%;
  height: 99%;
  border-radius: var(--radius-xl);
  background: var(--primary);
  z-index: 0;
}

.hero-image-front {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 3px solid var(--primary);
  z-index: 1;
  background: var(--white);
}

.hero-image-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Secciones generales */
.section {
  padding: 50px 24px;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.section-header p {
  color: var(--gray-500);
  font-size: 1.05rem;
}

.container-section {
  max-width: 1200px;
  margin: 0 auto;
}

/* ============================================================
   GALERÍA / CARRUSEL
   ============================================================ */
.gallery-main {
  margin-bottom: 16px;
}

.gallery-main-image {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--gray-100);
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}

.gallery-arrow:hover {
  background: var(--white);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transform: translateY(-50%) scale(1.06);
}

.gallery-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.gallery-arrow svg {
  width: 22px;
  height: 22px;
}

.gallery-arrow-left {
  left: 14px;
}

.gallery-arrow-right {
  right: 14px;
}

.gallery-main-image img {
  width: 100%;
  height: 450px;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.gallery-main-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
}

.gallery-thumb {
  width: 90px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.gallery-thumb:hover {
  opacity: 0.85;
}

.gallery-thumb.active {
  border-color: var(--primary);
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(51, 9, 53, 0.15);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .gallery-main-image img {
    height: 260px;
  }
  .gallery-thumb {
    width: 64px;
    height: 48px;
  }
  .gallery-arrow {
    width: 36px;
    height: 36px;
  }
  .gallery-arrow svg {
    width: 18px;
    height: 18px;
  }
  .gallery-arrow-left {
    left: 8px;
  }
  .gallery-arrow-right {
    right: 8px;
  }
}

/* Grid de beneficios */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

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

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

/* Beneficios */
.benefit-card {
  text-align: center;
  padding: 32px 24px;
}

.benefit-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.benefit-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-900);
}

.benefit-card p {
  color: var(--gray-500);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Testimonios */
.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-100);
  position: relative;
}

.testimonial-card::before {
  content: '"';
  font-size: 4rem;
  color: var(--primary);
  opacity: 0.15;
  position: absolute;
  top: 8px;
  left: 20px;
  font-family: Georgia, serif;
  line-height: 1;
}

.testimonial-card p {
  font-style: italic;
  color: var(--gray-600);
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-author img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial-author div strong {
  display: block;
  font-size: 0.9rem;
  color: var(--gray-900);
}

.testimonial-author div span {
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* FAQ Acordeón */
.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: all var(--transition-base);
}

.faq-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.faq-question {
  width: 100%;
  background: var(--white);
  border: none;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-800);
  text-align: left;
  transition: all var(--transition-fast);
}

.faq-question:hover {
  background: var(--gray-50);
}

.faq-question .faq-icon {
  transition: transform var(--transition-base);
  font-size: 1.2rem;
  color: var(--gray-400);
}

.faq-item.active .faq-question .faq-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: all var(--transition-base);
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

.faq-answer p {
  padding: 0 24px 18px;
  color: var(--gray-600);
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0;
}

/* Animaciones */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.6s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.6s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Footer */
.footer {
  background: #240624;
  color: var(--gray-300);
  padding: 64px 24px 32px;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer h3 {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer p,
.footer a {
  color: var(--gray-400);
  font-size: 0.9rem;
  line-height: 1.8;
  text-decoration: none;
  display: block;
}

.footer a:hover {
  color: #ffffff;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--gray-700);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  color: var(--gray-400);
  transition: color var(--transition-fast);
}

.social-links a:hover {
  color: var(--primary);
}

/* Dashboard Layout */
.dashboard {
  display: flex;
  min-height: 100vh;
}

.dashboard-sidebar {
  width: 200px;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.dashboard-sidebar .logo {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.dashboard-sidebar .logo img {
  height: 36px;
  width: auto;
}

.dashboard-sidebar .logo span {
  font-weight: 700;
  font-size: 1rem;
  color: var(--gray-900);
}

.dashboard-nav {
  list-style: none;
  padding: 16px 0;
  margin: 0;
  flex: 1;
}

.dashboard-nav li {
  padding: 0 12px;
}

.dashboard-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.dashboard-nav a:hover {
  background: var(--gray-50);
  color: var(--primary);
}

.dashboard-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.dashboard-nav a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.dashboard-main {
  margin-left: 200px;
  flex: 1;
  background: var(--gray-50);
  min-height: 100vh;
}

.dashboard-header {
  background: var(--white);
  padding: 16px 32px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.dashboard-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.dashboard-content {
  padding: 28px 32px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--gray-500);
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gray-900);
}

.stat-card .stat-icon {
  float: right;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}

/* Toolbar de acciones */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Filtros */
.filter-select {
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.9rem;
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

.search-input {
  padding: 10px 14px 10px 36px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.9rem;
  width: 260px;
  transition: all var(--transition-fast);
  background: var(--white)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E")
    no-repeat 12px center;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .navbar .container {
    display: flex;
    padding: 6px 8px 6px 40px;
    justify-content: space-between;
    align-items: center;
  }

  .navbar .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: center;
    padding: 20px 24px;
    gap: 16px;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--gray-100);
  }

  .navbar .nav-links.open {
    display: flex;
  }

  .navbar .nav-links li {
    width: 100%;
    text-align: center;
  }

  .navbar .nav-links li a {
    justify-content: center;
  }

  .navbar .nav-links .nav-btn-cta {
    width: 100%;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text p {
    margin: 0 auto 32px;
  }

  .hero-text h1 {
    font-size: 2rem;
  }

  .hero-text .btn-lg {
    width: 100%;
    margin-left: 0 !important;
    margin-bottom: 12px;
  }

  .hero {
    padding: 120px 16px 60px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 60px 16px;
  }

  .section-header h2 {
    font-size: 1.6rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .dashboard-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px;
  }

  .dashboard-main {
    margin-left: 0;
  }

  .dashboard-nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
  }

  .dashboard-nav li {
    padding: 0;
  }

  .dashboard-nav a {
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .dashboard-content {
    padding: 20px 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left,
  .toolbar-right {
    flex-direction: column;
  }

  .search-input {
    width: 100%;
  }

  table th,
  table td {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

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

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-text h1 {
    font-size: 1.6rem;
  }

  .modal-content {
    padding: 24px 20px;
  }
}

/* ============================================================
   ESTADÍSTICAS - Estilo sistema clínico de referencia
   ============================================================ */
.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.neo-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.neo-card .header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--gray-50);
}
.neo-card .header-chart {
  padding: 20px 24px 12px;
}

.neo-card .container-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.neo-card .title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--gray-900);
}
.neo-card .details-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--gray-500);
  flex-wrap: wrap;
}
.neo-card .details-legend b {
  color: var(--gray-800);
  font-weight: 700;
}
.neo-card .rigth-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.primary-btn {
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: all 0.12s ease;
}
.primary-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--gray-700);
}

.chart-container {
  padding: 12px 16px 16px;
  height: 300px;
  position: relative;
}
.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.container-chart-mod {
  padding: 12px 16px 16px;
  height: 300px;
  position: relative;
}
.container-chart-mod canvas {
  width: 100% !important;
  height: 100% !important;
}

.totals-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-t {
  display: flex;
  align-items: center;
}
.card-t .item-t {
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-t .item-txt b {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gray-900);
}
.card-t .item-txt label {
  font-size: 0.7rem;
  color: var(--gray-500);
  display: block;
}
.card-h {
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--gray-100);
}
.img-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.p-i0 {
  background: #e8f0fe;
  color: #1a73e8;
}
.p-i {
  background: #fce7f3;
  color: #ec4899;
}
.p-i1 {
  background: #dbeafe;
  color: #2563eb;
}

.container-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.container-chart-patients {
  grid-column: 1;
}
.container-chart-main-by-age {
  grid-column: 2;
}
.container-chart {
  grid-column: 1 / -1;
}

@media (max-width: 1024px) {
  .container-charts {
    grid-template-columns: 1fr;
  }
  .container-chart-patients,
  .container-chart-main-by-age,
  .container-chart {
    grid-column: 1;
  }
  .card-h {
    border-left: none;
    padding-left: 0;
  }
}
