/* ==========================================================================
   EL ESTRÉS DE MAMÁ - SISTEMA DE DISEÑO Y ESTILOS
   ========================================================================== */

:root {
  /* Paleta Oficial del Proyecto: Blumine, Wedgewood, Neptuno, Nueva Orleans y Ponche */
  --c-blumine: #1e5c80;          /* Blumine: Azul océano profundo */
  --c-wedgewood: #4f8a9c;        /* Wedgewood: Azul pizarra suave */
  --c-neptuno: #7ec4b2;          /* Neptuno: Verde menta/marino sereno */
  --c-nueva-orleans: #f1c9a2;    /* Nueva Orleans: Arena / Melocotón cálido */
  --c-ponche: #d68a38;           /* Ponche: Ámbar vibrante / Terracota */

  /* Asignación de Roles del Sistema de Diseño */
  --primary: var(--c-blumine);
  --primary-hover: #154561;
  --primary-light: rgba(30, 92, 128, 0.12);
  
  --secondary: var(--c-wedgewood);
  --secondary-hover: #3d6e7d;
  
  --accent: var(--c-ponche);
  --accent-hover: #b8722a;
  --accent-light: rgba(214, 138, 56, 0.14);
  
  --warm-gold: var(--c-nueva-orleans);
  
  /* Colores para la Logística de Custodia */
  --mom-color: var(--c-neptuno);         /* Neptuno para Mamá */
  --dad-color: var(--c-blumine);         /* Blumine para Papá */
  --switch-color: var(--c-ponche);       /* Ponche para Transición */
  --event-color: var(--c-wedgewood);     /* Wedgewood para Eventos */
  
  --bg-main: #fbf9f6;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-glass: rgba(255, 255, 255, 0.72);
  
  --text-main: #142a36;
  --text-muted: #4e6775;
  --text-light: #7a94a2;
  --border-light: rgba(79, 138, 156, 0.22);
  --shadow-sm: 0 4px 14px rgba(30, 92, 128, 0.05);
  --shadow-md: 0 8px 24px rgba(30, 92, 128, 0.09);
  --shadow-lg: 0 16px 40px rgba(30, 92, 128, 0.14);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Formas Decorativas Orgánicas en el Fondo */
.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
}
.bg-shape-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(232, 168, 124, 0.35) 0%, rgba(217, 119, 100, 0.15) 100%);
  top: -100px;
  right: -100px;
}
.bg-shape-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(72, 130, 112, 0.3) 0%, rgba(92, 160, 139, 0.1) 100%);
  bottom: -150px;
  left: -150px;
}
.bg-shape-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(224, 104, 83, 0.25) 0%, rgba(248, 246, 242, 0) 100%);
  top: 40%;
  left: 30%;
}

/* App Layout con Menú Lateral Izquierdo */
.app-layout {
  display: flex;
  gap: 24px;
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  align-items: flex-start;
}

/* ==========================================================================
   MENÚ LATERAL IZQUIERDO (SIDEBAR)
   ========================================================================== */
.app-sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  background: linear-gradient(165deg, #e8f3ee 0%, #d2e6dc 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(72, 130, 112, 0.35);
  border-radius: var(--radius-lg);
  padding: 16px 14px 24px 14px;
  box-shadow: 0 10px 32px rgba(45, 90, 75, 0.14);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, box-shadow 0.3s ease;
  z-index: 90;
}

/* Barra de desplazamiento personalizada para la barra lateral */
.app-sidebar::-webkit-scrollbar {
  width: 6px;
}
.app-sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
}
.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(30, 92, 128, 0.25);
  border-radius: 10px;
}
.app-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(30, 92, 128, 0.45);
}

/* Modo Reducido / Auto-Ocultar (72px) */
.app-sidebar.auto-hide {
  width: 72px;
  padding: 14px 8px;
  cursor: pointer;
}

.app-sidebar.auto-hide .brand-text-block,
.app-sidebar.auto-hide .quick-quote-widget,
.app-sidebar.auto-hide .mini-calendar-widget,
.app-sidebar.auto-hide .nav-section-label,
.app-sidebar.auto-hide .pin-btn {
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  display: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, max-height 0.2s ease;
}

.app-sidebar.auto-hide .brand-logo-container {
  padding: 4px 0 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.app-sidebar.auto-hide .brand-logo-img {
  width: 56px;
  height: 56px;
  max-width: 56px;
  max-height: 56px;
  margin: 4px auto;
  display: block;
}

.app-sidebar.auto-hide .nav-tab {
  min-width: 0 !important;
  width: 100%;
  padding: 12px 0;
  justify-content: center;
  align-items: center;
  border-radius: var(--radius-md);
}

.app-sidebar.auto-hide .nav-tab span {
  display: none;
  opacity: 0;
  visibility: hidden;
  white-space: nowrap;
}

.app-sidebar.auto-hide .nav-tab i,
.app-sidebar.auto-hide .nav-tab svg {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  margin: 0 auto;
  display: block;
  stroke-width: 2.2px;
  color: var(--primary);
  transition: transform 0.2s ease, color 0.2s ease;
}

.app-sidebar.auto-hide .nav-tab:hover i,
.app-sidebar.auto-hide .nav-tab:hover svg {
  transform: scale(1.15);
  color: var(--primary-hover);
}

.app-sidebar.auto-hide .nav-tab.active {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(18, 77, 62, 0.15);
}

.app-sidebar.auto-hide .nav-tab.active i,
.app-sidebar.auto-hide .nav-tab.active svg {
  color: var(--primary);
}

/* Despliegue al pasar el ratón por encima (Hover) en modo reducido */
.app-sidebar.auto-hide:hover {
  width: 300px;
  padding: 16px 14px;
  box-shadow: 0 16px 48px rgba(35, 75, 62, 0.28);
  border-color: var(--primary);
}

.app-sidebar.auto-hide:hover .brand-text-block,
.app-sidebar.auto-hide:hover .quick-quote-widget,
.app-sidebar.auto-hide:hover .mini-calendar-widget,
.app-sidebar.auto-hide:hover .nav-section-label,
.app-sidebar.auto-hide:hover .pin-btn {
  opacity: 1;
  visibility: visible;
  display: flex;
  max-height: 600px;
  pointer-events: auto;
}

.app-sidebar.auto-hide:hover .mini-calendar-widget {
  display: block;
}

.app-sidebar.auto-hide:hover .brand-logo-img {
  width: 120px;
  height: 120px;
  max-width: 120px;
  max-height: 120px;
}

.app-sidebar.auto-hide:hover .nav-tab span {
  display: inline-block;
  opacity: 1;
  visibility: visible;
}

.app-sidebar.auto-hide:hover .nav-tab {
  min-width: 140px !important;
  justify-content: flex-start;
  padding: 11px 14px;
}

.app-sidebar.auto-hide:hover .nav-tab i,
.app-sidebar.auto-hide:hover .nav-tab svg {
  margin: 0;
}

/* Cabecera del Logo Centrado */
.brand-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 8px 14px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
  width: 100%;
}

.brand-logo-img {
  width: 120px;
  height: 120px;
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  margin: 4px auto 8px auto;
  display: block;
  filter: drop-shadow(0 4px 14px rgba(30, 92, 128, 0.16));
  transition: all 0.3s ease;
}

.brand-text-block {
  text-align: center;
  width: 100%;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  letter-spacing: -0.3px;
  margin: 0;
}

.brand-subtitle {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.pin-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(72, 130, 112, 0.35);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.pin-btn .office-pin-icon,
.pin-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2px;
  transform: rotate(45deg); /* Chincheta suelta / inclinada */
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.pin-btn:hover {
  background: #ffffff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 10px rgba(18, 77, 62, 0.15);
  transform: scale(1.08);
}

.pin-btn.pinned {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(18, 77, 62, 0.25);
}

.pin-btn.pinned .office-pin-icon,
.pin-btn.pinned svg {
  transform: rotate(0deg); /* Chincheta recta clavada verticalmente estilo Office */
  color: #ffffff;
}

/* WIDGET: FRASES MOTIVADORAS / REFLEXIONES */
.quick-quote-widget {
  background: linear-gradient(135deg, #fffcf5 0%, #fef3c7 100%);
  border: 1.5px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 14px 14px 12px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.12);
  transition: all 0.3s ease;
  width: 100%;
}

.quick-quote-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: #b45309;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
  text-transform: uppercase;
}

.quick-quote-body {
  font-size: 0.88rem;
  font-weight: 600;
  color: #78350f;
  line-height: 1.45;
  font-style: italic;
  margin: 0 0 10px 0;
  text-align: center;
  width: 100%;
}

.quick-quote-btn {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 auto;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.12);
}

.quick-quote-btn:hover {
  background: #fde68a;
  color: #78350f;
  transform: rotate(180deg) scale(1.12);
  box-shadow: 0 4px 10px rgba(180, 83, 9, 0.22);
}

/* WIDGET: MINI CALENDARIO DE CUSTODIA */
.mini-calendar-widget {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(72, 130, 112, 0.22);
  border-radius: var(--radius-md);
  padding: 12px 10px 14px 10px;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.25s ease;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
  min-height: max-content;
}

.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mini-month-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.mini-cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  width: 100%;
}

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  width: 100%;
}

.mini-day {
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 50%;
  color: var(--text-main);
  transition: all 0.15s ease;
  margin: 0 auto;
}

.mini-day.other-month {
  opacity: 0.25;
}

.mini-day.is-today {
  box-shadow: 0 0 0 1.5px var(--primary);
  font-weight: bold;
}

/* ==========================================================================
   CABECERA HERO CON MARCA Y REFLEXIÓN DESTACADA
   ========================================================================== */
.app-hero-header {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 55%, #e0f2fe 100%);
  border: 1.5px solid rgba(126, 196, 178, 0.35);
  border-radius: 24px;
  padding: 22px 24px;
  box-shadow: 0 8px 24px rgba(30, 92, 128, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 22px;
}

.hero-text-block {
  width: 100%;
}

.hero-app-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--c-blumine);
  margin: 0 0 4px 0;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.hero-flower-emoji {
  font-size: 1.4rem;
  vertical-align: middle;
}

.hero-app-subtitle {
  font-size: 0.94rem;
  color: var(--c-wedgewood);
  margin: 0;
  font-weight: 500;
  max-width: 850px;
  line-height: 1.5;
}

.hero-quote-box {
  background: linear-gradient(135deg, #fffcf5 0%, #fef3c7 100%);
  border: 1.5px solid #fde68a;
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.1);
  width: 100%;
}

.quote-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fef3c7;
  border: 1.5px solid #fcd34d;
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quote-content-block {
  flex: 1;
  min-width: 0;
}

.quote-pill-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #b45309;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: inline-block;
  margin-bottom: 3px;
}

.hero-quote-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #78350f;
  font-style: italic;
  margin: 0;
  line-height: 1.45;
}

.hero-quote-author {
  font-size: 0.78rem;
  color: #92400e;
  font-weight: 500;
  margin-top: 3px;
  display: block;
}

.quote-refresh-btn {
  background: #ffffff;
  border: 1px solid #fcd34d;
  color: #b45309;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.12);
}

.quote-refresh-btn:hover {
  background: #fde68a;
  color: #78350f;
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.22);
}

.mini-day.custody-mom {
  background: var(--mom-color);
  color: #fff;
}

.mini-day.custody-dad {
  background: var(--dad-color);
  color: #fff;
}

.mini-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.05);
  font-size: 0.72rem;
  font-weight: 600;
}

.mini-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mini-legend-item span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* MENÚ DE NAVEGACIÓN EN SIDEBAR */
.app-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
}

.nav-section-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-light);
  margin-bottom: 4px;
  padding-left: 4px;
}

.nav-tab {
  width: 100%;
  justify-content: flex-start;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

/* ÁREA PRINCIPAL DERECHA */
.app-main-area {
  flex-grow: 1;
  min-width: 0;
}

.app-header {
  position: sticky;
  top: 10px;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.welcome-badge {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.social-header-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.social-icon-circle:hover {
  transform: translateY(-2px) scale(1.08);
}

.social-icon-circle.telegram-circle {
  background: #0088cc;
}
.social-icon-circle.telegram-circle:hover {
  background: #0077b5;
  box-shadow: 0 6px 16px rgba(0, 136, 204, 0.4);
}

.social-icon-circle.whatsapp-circle {
  background: #25D366;
}
.social-icon-circle.whatsapp-circle:hover {
  background: #1eb857;
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.social-icon-circle.instagram-circle {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}
.social-icon-circle.instagram-circle:hover {
  box-shadow: 0 6px 16px rgba(220, 39, 67, 0.45);
  filter: brightness(1.08);
}

/* ==========================================================================
   BOTONES Y ELEMENTOS DE CONTROL
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  outline: none;
}

.btn i {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(72, 130, 112, 0.3);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(72, 130, 112, 0.4);
}

.btn-secondary {
  background: rgba(72, 130, 112, 0.08);
  color: var(--primary);
}
.btn-secondary:hover {
  background: rgba(72, 130, 112, 0.16);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-main);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sos {
  background: linear-gradient(135deg, var(--accent) 0%, #e88472 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(217, 119, 100, 0.35);
}
.btn-sos:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 119, 100, 0.45);
}

.pulse-glow {
  animation: pulseGlow 3s infinite;
}
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(217, 119, 100, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(217, 119, 100, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 119, 100, 0); }
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-icon:hover {
  color: var(--primary);
  background: #fff;
  border-color: var(--primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}
.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   FRASE DIARIA TARJETA
   ========================================================================== */
.daily-quote-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(232, 168, 124, 0.15) 0%, rgba(217, 119, 100, 0.08) 100%);
  border: 1px solid rgba(232, 168, 124, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.quote-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #fff;
  border-radius: 50%;
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.quote-content {
  flex-grow: 1;
}

.quote-content p {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  color: #4a342e;
  font-style: italic;
}

.quote-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   NAVEGACIÓN DE PESTAÑAS
   ========================================================================== */
.app-nav {
  display: flex;
  gap: 10px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.nav-tab {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.nav-tab i {
  width: 18px;
  height: 18px;
}

.nav-tab:hover {
  color: var(--primary);
  background: rgba(72, 130, 112, 0.06);
}

.nav-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   PANELES Y TARJETAS GENERICAS
   ========================================================================== */
.tab-panel {
  display: none;
  animation: fadeIn 0.35s ease-out;
}
.tab-panel.active {
  display: block;
}

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

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.panel-header h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.panel-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.panel-controls {
  display: flex;
  gap: 10px;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-header h3 i {
  color: var(--primary);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   PESTAÑA 1: AGENDA Y CUSTODIA
   ========================================================================== */
.legend-bar {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot-mom { background-color: var(--mom-color); }
.dot-dad { background-color: var(--dad-color); }
.dot-switch { background-color: var(--switch-color); }
.dot-event { background-color: var(--event-color); }

.calendar-container {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.calendar-header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.calendar-header-nav h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  min-width: 180px;
  text-align: center;
}

.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  width: 100%;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
  width: 100%;
  box-sizing: border-box;
}

.cal-day {
  min-height: 90px;
  border-radius: 10px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.cal-day:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cal-day.other-month {
  background: rgba(248, 250, 252, 0.4) !important;
  border: 1px dashed #cbd5e1 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

.cal-day.is-today {
  border: 2px solid var(--primary);
  font-weight: bold;
}

.cal-day.custody-mom {
  background: var(--mom-bg, rgba(126, 196, 178, 0.15));
  border-left: 4px solid var(--mom-color);
}
.cal-day.custody-dad {
  background: var(--dad-bg, rgba(30, 92, 128, 0.15));
  border-left: 4px solid var(--dad-color);
}

.cal-day-number {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custody-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.tag-mom { background: var(--mom-color); color: #fff; }
.tag-dad { background: var(--dad-color); color: #fff; }

.cal-day-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.event-pill {
  font-size: 0.72rem;
  padding: 2px 6px;
  background: var(--event-color);
  color: #fff;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Eventos Próximos Lista */
.upcoming-events-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.event-card-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.event-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  flex-shrink: 0;
}
.event-date-badge .day { font-size: 1.2rem; font-weight: 800; line-height: 1; }
.event-date-badge .month { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }

.event-info h4 { font-size: 0.95rem; font-weight: 600; }
.event-info p { font-size: 0.8rem; color: var(--text-muted); }

/* ==========================================================================
   PESTAÑA 2: GASTOS COMPARTIDOS
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.metric-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  color: #fff;
  flex-shrink: 0;
}
.mom-bg { background: var(--mom-color); }
.dad-bg { background: var(--dad-color); }
.balance-bg { background: var(--primary); }

.metric-info .metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-info h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.balance-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.highlight-card {
  background: linear-gradient(135deg, rgba(30, 92, 128, 0.08) 0%, rgba(79, 138, 156, 0.04) 100%);
  border-color: rgba(30, 92, 128, 0.3);
}

/* ==========================================================================
   BANNER DE DEUDA Y REEMBOLSO DIRECTO (SIN CÁLCULOS MENTALES)
   ========================================================================== */
.debt-banner-alert {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.debt-banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.debt-banner-content h4 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
}

.debt-banner-content p {
  font-size: 0.9rem;
  margin-top: 3px;
}

/* Estado: Papá te debe dinero a ti (Verde Neptuno / Reembolso a tu favor) */
.debt-banner-alert.status-mom-owed {
  background: linear-gradient(135deg, rgba(126, 196, 178, 0.22) 0%, rgba(126, 196, 178, 0.08) 100%);
  border-color: rgba(126, 196, 178, 0.5);
}
.debt-banner-alert.status-mom-owed .debt-banner-icon {
  background: var(--c-neptuno);
}
.debt-banner-alert.status-mom-owed h4 {
  color: #124d3e;
}
.debt-banner-alert.status-mom-owed p {
  color: #276152;
}

/* Estado: Tú le debes a Papá (Naranja Ponche / Ajuste a abonar) */
.debt-banner-alert.status-dad-owed {
  background: linear-gradient(135deg, rgba(214, 138, 56, 0.22) 0%, rgba(214, 138, 56, 0.08) 100%);
  border-color: rgba(214, 138, 56, 0.5);
}
.debt-banner-alert.status-dad-owed .debt-banner-icon {
  background: var(--c-ponche);
}
.debt-banner-alert.status-dad-owed h4 {
  color: #7a3e07;
}
.debt-banner-alert.status-dad-owed p {
  color: #8c4c11;
}

/* Estado: Cuentas 100% al día */
.debt-banner-alert.status-balanced {
  background: linear-gradient(135deg, rgba(30, 92, 128, 0.12) 0%, rgba(79, 138, 156, 0.05) 100%);
  border-color: rgba(30, 92, 128, 0.3);
}
.debt-banner-alert.status-balanced .debt-banner-icon {
  background: var(--c-blumine);
}
.debt-banner-alert.status-balanced h4 {
  color: var(--c-blumine);
}
.local-privacy-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(72, 130, 112, 0.12) 0%, rgba(30, 92, 128, 0.08) 100%);
  border: 1px solid rgba(72, 130, 112, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 20px;
  font-size: 0.86rem;
  color: #124d3e;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(72, 130, 112, 0.08);
}

.privacy-notice-icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
  flex-shrink: 0;
}

.footer-privacy-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

.expenses-top-dashboard {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  margin-bottom: 24px;
  align-items: stretch;
}

.metrics-and-banner-area {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.metrics-and-banner-area .metrics-grid {
  margin-bottom: 0;
}

.metrics-and-banner-area .debt-banner-alert {
  margin-bottom: 0;
}

.top-chart-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  width: 100%;
}

.top-chart-card .card-header {
  width: 100%;
}

.top-chart-card .chart-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  width: 100%;
}

.full-width-card {
  width: 100%;
}

@media (max-width: 1100px) {
  .expenses-top-dashboard {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .expenses-content-grid { grid-template-columns: 1fr; }
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.table-scroll-container {
  max-height: 480px;
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  background: #fff;
}

/* Personalización elegante de barra de desplazamiento horizontal y vertical */
.table-scroll-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.table-scroll-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
.table-scroll-container::-webkit-scrollbar-thumb {
  background: #c5d4cd;
  border-radius: 4px;
}
.table-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8faf9;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.sortable-th:hover {
  background: rgba(72, 130, 112, 0.12) !important;
  color: var(--primary);
}
.sortable-th.active-sort {
  color: var(--primary);
  font-weight: 700;
}
.sort-icon {
  display: inline-block;
  font-size: 0.75rem;
  margin-left: 4px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.sortable-th:hover .sort-icon,
.sortable-th.active-sort .sort-icon {
  opacity: 1;
}

.data-table th {
  text-align: left;
  padding: 12px 14px;
  background: rgba(0,0,0,0.02);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 2px solid var(--border-light);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.data-table tr:hover { background: rgba(72, 130, 112, 0.03); }

.badge-payer {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-payer.mom { background: rgba(126, 196, 178, 0.25); color: #124d3e; }
.badge-payer.dad { background: rgba(30, 92, 128, 0.18); color: var(--c-blumine); }

.child-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(30, 92, 128, 0.08);
  color: var(--c-blumine);
  border: 1px solid rgba(30, 92, 128, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.73rem;
  font-weight: 700;
}

.badge-recurring {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  background: rgba(79, 138, 156, 0.12);
  color: var(--c-wedgewood);
  border: 1px solid rgba(79, 138, 156, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 6px;
}

.badge-timeframe {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 4px;
}
.badge-timeframe.current {
  background: rgba(30, 92, 128, 0.08);
  color: var(--c-blumine);
  border: 1px solid rgba(30, 92, 128, 0.2);
}
.badge-timeframe.future {
  background: rgba(126, 196, 178, 0.22);
  color: #124d3e;
  border: 1px solid rgba(126, 196, 178, 0.4);
}

/* Badges de Estado: Pendiente vs Abonado/Liquidado */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
.badge-status:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.badge-status.pending {
  background: rgba(214, 138, 56, 0.14);
  color: #8c4c11;
  border: 1px solid rgba(214, 138, 56, 0.35);
}

.badge-status.settled {
  background: rgba(126, 196, 178, 0.28);
  color: #124d3e;
  border: 1px solid rgba(126, 196, 178, 0.5);
}

tr.is-settled {
  background: rgba(126, 196, 178, 0.04);
}
tr.is-settled td {
  opacity: 0.85;
}

.chart-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
}

.category-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  padding: 8px 12px;
  background: #f8faf9;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  width: 100%;
  box-sizing: border-box;
}

.cat-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-main);
}

.cat-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--primary);
}

.cat-item-pct {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   PESTAÑA 3: RUTINAS Y MALETA
   ========================================================================== */
.routines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.border-bottom {
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-bottom: 14px;
}

.header-with-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(72, 130, 112, 0.12);
  color: var(--primary);
}
.badge-accent {
  background: rgba(217, 119, 100, 0.15);
  color: var(--accent);
}

.highlight-border {
  border: 2px solid var(--accent);
}

.checklist-input-group {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.form-input {
  flex-grow: 1;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(72, 130, 112, 0.15);
}

.custom-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.checklist-item label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  width: 100%;
}

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checklist-item.checked span {
  text-decoration: line-through;
  color: var(--text-light);
}

.btn-edit-item {
  background: none;
  border: none;
  color: var(--c-wedgewood);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.btn-edit-item:hover {
  background: rgba(79, 138, 156, 0.15);
  color: var(--c-blumine);
}

.btn-delete-item {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
}
.btn-delete-item:hover { color: var(--accent); }

/* ==========================================================================
   PESTAÑA 4: RINCÓN SOS CALMA Y RESPIRACIÓN
   ========================================================================== */
.sos-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 850px) {
  .sos-layout { grid-template-columns: 1fr; }
}

.breathing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-center: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(230, 240, 236, 0.8) 100%);
}

.breathing-circle-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 36px 0;
  width: 240px;
  height: 240px;
}

.breathing-circle {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary) 0%, #5ca08b 100%);
  box-shadow: 0 0 35px rgba(72, 130, 112, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 16px;
  transition: transform 1s ease-in-out, background 0.5s ease;
}

.breathing-text {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.breathing-counter {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 6px;
}

/* Animaciones de Respiración 4-7-8 */
.breathing-circle.inhale {
  transform: scale(1.4);
  background: radial-gradient(circle, #5ca08b 0%, var(--primary) 100%);
  box-shadow: 0 0 50px rgba(72, 130, 112, 0.6);
  transition: transform 4s ease-in-out;
}

.breathing-circle.hold {
  transform: scale(1.4);
  background: radial-gradient(circle, var(--accent) 0%, #e06853 100%);
  box-shadow: 0 0 50px rgba(217, 119, 100, 0.6);
  transition: transform 0.5s ease;
}

.breathing-circle.exhale {
  transform: scale(1);
  background: radial-gradient(circle, var(--primary) 0%, #3b6d5d 100%);
  box-shadow: 0 0 25px rgba(72, 130, 112, 0.3);
  transition: transform 8s ease-in-out;
}

.mantra-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.mantra-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.92rem;
}
.mantra-icon {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.selfcare-ideas h4 {
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.ideas-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 6px 14px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.journal-input-group {
  margin-top: 14px;
}

.form-textarea {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  resize: vertical;
  background: #fff;
}

.journal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.status-text {
  font-size: 0.8rem;
  color: var(--text-light);
}

.journal-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.journal-entry-card {
  padding: 14px;
  background: #fff;
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}
.journal-entry-header {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

/* ==========================================================================
   MODALES
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal-backdrop.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 99999 !important;
}

.modal-card {
  width: 90%;
  max-width: 500px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalSlideUp 0.3s ease-out;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-light);
}
.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}
.form-select, .form-select-sm {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  background: #fff;
}

.modal-footer {
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-main);
}

/* Footer de la App */
.app-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 40px;
}

.version-badge-container {
  margin-top: 10px;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: rgba(72, 130, 112, 0.1);
  color: var(--primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: var(--shadow-sm);
}

/* Botón de Menú Móvil Hamburger */
.mobile-menu-toggle {
  display: none;
}
.header-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   SISTEMA RESPONSIVO MULTIDISPOSITIVO (BREAKPOINTS)
   ========================================================================== */

/* 1. Ordenadores Portátiles y Pantallas Medianas (992px - 1199px) */
@media (max-width: 1199px) {
  .app-sidebar {
    width: 260px;
  }
  .cal-day {
    min-height: 80px;
    padding: 6px;
  }
}

/* 2. Tablets en Modo Retrato y Pantallas Pequeñas (768px - 991px) */
@media (max-width: 991px) {
  .app-layout {
    flex-direction: column;
    padding: 16px 16px 40px;
    gap: 16px;
  }
}

@media (max-width: 992px) {
  .mobile-menu-toggle {
    display: inline-flex;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 285px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0 24px 24px 0;
    z-index: 99999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    background: linear-gradient(165deg, #e8f3ee 0%, #d2e6dc 100%);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .app-sidebar.mobile-open {
    display: flex;
    transform: translateX(0);
  }

  .app-nav {
    flex-direction: column;
    overflow-x: visible;
  }

  .nav-tab {
    width: 100%;
    white-space: normal;
  }

  .expenses-content-grid {
    grid-template-columns: 1fr;
  }

  .sos-layout {
    grid-template-columns: 1fr;
  }
}

/* 3. Teléfonos Móviles y Pantallas Estrechas (< 768px) */
@media (max-width: 767px) {
  .app-layout {
    padding: 12px 10px 40px;
  }

  .app-header {
    padding: 12px 14px;
  }

  .welcome-badge {
    font-size: 0.9rem;
  }

  .daily-quote-card {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .quote-icon {
    width: 36px;
    height: 36px;
  }

  .calendar-container {
    padding: 14px 10px;
  }

  .calendar-header-nav h3 {
    font-size: 1rem;
    min-width: 130px;
  }

  .calendar-grid-header div {
    font-size: 0.72rem;
  }

  .calendar-grid {
    gap: 2px;
  }

  .cal-day {
    min-height: 65px;
    padding: 4px;
    border-radius: 4px;
  }

  .cal-day-number {
    font-size: 0.75rem;
  }

  .custody-tag {
    font-size: 0.6rem;
    padding: 1px 4px;
  }

  .event-pill {
    font-size: 0.65rem;
    padding: 1px 4px;
  }

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

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

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table th, .data-table td {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  /* Ajuste de animación de respiración para pantallas de móvil */
  .breathing-circle-wrapper {
    width: 190px;
    height: 190px;
    margin: 20px 0;
  }

  .breathing-circle {
    width: 140px;
    height: 140px;
    padding: 10px;
  }

  .breathing-text {
    font-size: 0.95rem;
  }

  .breathing-counter {
    font-size: 1.6rem;
  }
}

/* 4. Pantallas ultra-pequeñas (< 400px) */
@media (max-width: 400px) {
  .cal-day {
    min-height: 55px;
  }
  .cal-day-number {
    font-size: 0.7rem;
  }
  .custody-tag {
    display: none; /* Ocultar texto de tag en pantallas ultra estrechas, mantener color de celda */
  }
}

/* ==========================================================================
   ESTILOS DE AUTENTICACIÓN Y PERFIL DE USUARIA (FIREBASE AUTH & SYNC)
   ========================================================================== */
.auth-status-container {
  display: inline-flex;
  align-items: center;
}

.btn-auth-open {
  gap: 6px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 6px 14px;
}

.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.user-avatar-icon {
  font-size: 0.9rem;
}

.user-email-text {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout-icon {
  background: transparent;
  border: none;
  color: #718096;
  cursor: pointer;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s ease, background 0.2s ease;
}

.btn-logout-icon:hover {
  color: #e53e3e;
  background: #fff5f5;
}

.modal-auth-card {
  max-width: 440px;
}

.auth-mode-tabs {
  display: flex;
  background: #edf2f7;
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 16px;
}

.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.form-auth {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: #a0aec0;
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.auth-divider span {
  padding: 0 10px;
}

.btn-google-login {
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.btn-google-login:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  border-color: #d2e3fc;
}

.auth-footer-privacy {
  margin-top: 16px;
  padding: 10px 12px;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.76rem;
  color: #718096;
  text-align: center;
  line-height: 1.4;
}

.auth-alert {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  margin-bottom: 14px;
  line-height: 1.4;
}

.auth-alert.error {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  color: #c53030;
}

.auth-alert.success {
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  color: #22543d;
}

/* Vista de Gestión de Cuenta & Solicitud de Baja */
.user-account-card {
  background: #ffffff;
}

.user-account-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
}

.user-account-avatar {
  font-size: 1.6rem;
}

.user-account-status-tag {
  font-size: 0.76rem;
  color: #276749;
  font-weight: 600;
}

.delete-account-zone {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed #e2e8f0;
}

.delete-account-help {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}

.btn-danger-outline {
  background: #fff5f5;
  color: #e53e3e;
  border: 1px solid #feb2b2;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-danger-outline:hover {
  background: #e53e3e;
  color: #ffffff;
  border-color: #c53030;
}

/* Subpestañas dentro del Modal de Perfil */
.account-subtabs {
  display: flex;
  gap: 4px;
  background: #edf2f7;
  border-radius: 8px;
  padding: 3px;
}

.account-subtab-btn {
  flex: 1;
  padding: 6px 8px;
  border: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.account-subtab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

/* Lista de Notificaciones con Toggles */
.notification-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.notification-toggle-item:hover {
  background: #edf2f7;
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-info strong {
  font-size: 0.85rem;
  color: var(--primary-dark);
}

.toggle-info small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.toggle-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Barra de Filtros del Calendario */
.calendar-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.calendar-filter-bar .filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.dot-override {
  background: #805ad5;
}

.cal-day.custody-override {
  border: 2px dashed #805ad5 !important;
}

.override-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #f3e8ff;
  color: #6b21a8;
  padding: 2px 5px;
  border-radius: 4px;
  margin-top: 2px;
  display: inline-block;
}

/* Event Badges por Categoría */
.event-badge {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-badge.cat-medico, .event-badge.cat-health {
  background: #e0f2fe;
  color: #0369a1;
}

.event-badge.cat-colegio, .event-badge.cat-school {
  background: #ffedd5;
  color: #c2410c;
}

.event-badge.cat-extraescolar, .event-badge.cat-sports {
  background: #dcfce7;
  color: #15803d;
}

.event-badge.cat-cumple, .event-badge.cat-party {
  background: #fce7f3;
  color: #be185d;
}

.event-badge.cat-intercambio, .event-badge.cat-handover {
  background: #f3e8ff;
  color: #6b21a8;
}

.event-badge.cat-otro, .event-badge.cat-other {
  background: #f1f5f9;
  color: #475569;
}

/* Patrón Semanal Personalizado */
.weekly-custom-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  background: #f8fafc;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.day-assign-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.day-assign-row span {
  width: 90px;
}

.alert-info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* ==========================================================================
   ESTILOS DE EDITOR ESTILO GOOGLE CALENDAR (v6.0.0)
   ========================================================================== */
.gcal-editor-card {
  width: 820px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  padding: 24px;
  font-family: 'Google Sans', 'Roboto', 'Inter', sans-serif;
  color: #3c4043;
}

.gcal-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.gcal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  color: #5f6368;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.gcal-close-btn:hover {
  background: #f1f3f4;
}

.gcal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gcal-btn-save {
  background: #1a73e8;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 24px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.gcal-btn-save:hover {
  background: #1557b0;
}

.gcal-btn-danger {
  background: #fff1f0;
  color: #d93025;
  border: 1px solid #fce8e6;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gcal-btn-danger:hover {
  background: #d93025;
  color: #ffffff;
}

.gcal-title-container {
  margin-bottom: 16px;
}

.gcal-title-input {
  width: 100%;
  border: none;
  border-bottom: 2px solid #1a73e8;
  font-size: 1.5rem;
  font-weight: 500;
  padding: 8px 0;
  outline: none;
  color: #202124;
}

.gcal-title-input::placeholder {
  color: #80868b;
}

.gcal-datetime-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f1f3f4;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.88rem;
}

.gcal-date-group, .gcal-options-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gcal-date-picker, .gcal-time-picker {
  border: 1px solid #dadce0;
  background: #ffffff;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.88rem;
  color: #3c4043;
}

.gcal-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 500;
}

.gcal-select {
  border: 1px solid #dadce0;
  background: #ffffff;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.88rem;
  color: #3c4043;
  cursor: pointer;
}

.gcal-select-full {
  width: 100%;
}

.gcal-main-layout {
  display: flex;
  gap: 24px;
}

.gcal-details-col {
  flex: 1;
}

.gcal-sidebar-col {
  width: 240px;
  border-left: 1px solid #e0e0e0;
  padding-left: 20px;
}

.gcal-subtabs {
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 16px;
}

.gcal-subtab {
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a73e8;
  border-bottom: 2px solid #1a73e8;
  cursor: pointer;
}

.gcal-form-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gcal-form-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gcal-form-row.align-start {
  align-items: flex-start;
}

.gcal-icon {
  width: 24px;
  font-size: 1.15rem;
  text-align: center;
  color: #5f6368;
}

.gcal-field-content {
  flex: 1;
}

.gcal-field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #5f6368;
  margin-bottom: 4px;
}

.gcal-input-clean {
  width: 100%;
  border: none;
  background: #f1f3f4;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.88rem;
  outline: none;
  transition: background 0.2s ease;
}

.gcal-input-clean:focus {
  background: #e8f0fe;
}

.gcal-flex-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gcal-input-small {
  width: 60px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 0.88rem;
}

.gcal-editor-toolbar {
  display: flex;
  gap: 4px;
  background: #f1f3f4;
  padding: 4px;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border: 1px solid #dadce0;
  border-bottom: none;
}

.toolbar-btn {
  border: none;
  background: transparent;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #5f6368;
}

.toolbar-btn:hover {
  background: #e0e0e0;
}

.gcal-textarea {
  width: 100%;
  border: 1px solid #dadce0;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  padding: 10px;
  font-size: 0.88rem;
  outline: none;
  resize: vertical;
  font-family: inherit;
}

.gcal-sidebar-section {
  margin-bottom: 20px;
}

.gcal-sidebar-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #3c4043;
  margin-bottom: 10px;
  border-bottom: 2px solid #1a73e8;
  display: inline-block;
  padding-bottom: 2px;
}

.gcal-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #5f6368;
  margin-bottom: 6px;
  cursor: pointer;
}

/* ==========================================================================
   ESTILOS AVATAR & EMOJI PICKER INCLUSIVO
   ========================================================================== */
.btn-avatar-picker-trigger {
  font-size: 1.5rem;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.btn-avatar-picker-trigger:hover {
  transform: scale(1.08);
  border-color: #38bdf8;
  background: #f0f9ff;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.15);
}

.avatar-emoji-btn {
  font-size: 1.6rem;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.avatar-emoji-btn:hover {
  transform: scale(1.2);
  background: #e0f2fe;
  border-color: #38bdf8;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-color-picker-trigger {
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.btn-color-picker-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.pastel-swatch-btn {
  height: 48px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.pastel-swatch-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
  border-color: #0284c7;
}

/* ==========================================================================
   ESTILOS VISTAS DEL CALENDARIO (DÍA, SEMANA, MES, AÑO)
   ========================================================================== */
.calendar-view-selector {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.btn-view-mode {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #475569;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-view-mode:hover {
  color: #0284c7;
  background: rgba(255, 255, 255, 0.6);
}

.btn-view-mode.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.calendar-view-panel {
  display: none;
}

.calendar-view-panel.active {
  display: block;
}

/* VISTA DÍA */
.day-view-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 10px 0;
}

.day-hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 30px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.day-hero-banner.custody-mom {
  background: var(--mom-bg, rgba(126, 196, 178, 0.18));
  border: 2px solid var(--mom-color);
  color: #0f172a;
}

.day-hero-banner.custody-dad {
  background: var(--dad-bg, rgba(30, 92, 128, 0.18));
  border: 2px solid var(--dad-color);
  color: #0f172a;
}

.day-hero-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.day-hero-avatar {
  font-size: 3rem;
  line-height: 1;
  background: #ffffff;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.day-hero-text h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.day-hero-text p {
  margin: 4px 0 0 0;
  font-size: 0.95rem;
  opacity: 0.85;
}

.day-events-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-event-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
}

.day-event-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
}

/* VISTA SEMANA */
.week-grid-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  padding: 10px 0;
}

@media (max-width: 900px) {
  .week-grid-container {
    grid-template-columns: 1fr;
  }
}

.week-day-col {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 320px;
  transition: all 0.2s ease;
}

.week-day-col:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.week-day-col.custody-mom {
  border-top: 5px solid var(--mom-color);
  background: linear-gradient(180deg, var(--mom-bg, rgba(126, 196, 178, 0.15)) 0%, #ffffff 40%);
}

.week-day-col.custody-dad {
  border-top: 5px solid var(--dad-color);
  background: linear-gradient(180deg, var(--dad-bg, rgba(30, 92, 128, 0.15)) 0%, #ffffff 40%);
}

.week-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}

.week-day-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
}

.week-day-custody-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.week-day-custody-tag.mom {
  background: rgba(126, 196, 178, 0.25);
  color: #144036;
}

.week-day-custody-tag.dad {
  background: rgba(30, 92, 128, 0.18);
  color: #1e5c80;
}

/* VISTA AÑO */
.year-grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 10px 0;
}

@media (max-width: 1024px) {
  .year-grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

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

.year-month-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
  cursor: pointer;
}

.year-month-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border-color: #38bdf8;
}

.year-month-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  margin-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 4px;
}

.year-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  font-size: 0.68rem;
  text-align: center;
}

.year-mini-header {
  font-weight: 600;
  color: #94a3b8;
  padding-bottom: 2px;
}

.year-mini-day {
  aspect-ratio: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  color: #334155;
}

.year-mini-day.custody-mom {
  background: var(--mom-color);
  color: #ffffff;
  font-weight: 700;
}

.year-mini-day.custody-dad {
  background: var(--dad-color);
  color: #ffffff;
  font-weight: 700;
}

.year-mini-day.other-month {
  opacity: 0;
}

/* ==========================================================================
   CRONOGRAMA DE HORAS (05:00 A 24:00) ESTILO GOOGLE CALENDAR
   ========================================================================== */
.day-timeline-container {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  padding: 20px;
  margin-top: 10px;
}

.timeline-hour-row {
  display: flex;
  min-height: 54px;
  border-bottom: 1px dashed #e2e8f0;
  align-items: stretch;
}

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

.timeline-hour-label {
  width: 72px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  padding: 10px 12px 10px 0;
  text-align: right;
  border-right: 2px solid #e2e8f0;
  user-select: none;
}

.timeline-hour-content {
  flex: 1;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  min-height: 54px;
}

.timeline-hour-content:hover {
  background: #f8fafc;
}

.timeline-event-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f0f9ff;
  border-left: 4px solid #0284c7;
  color: #0c4a6e;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: all 0.15s ease;
}

.timeline-event-card:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.timeline-event-time {
  font-size: 0.8rem;
  font-weight: 700;
  background: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

/* SELECTOR DE EMOJIS CATEGORÍA PERSONALIZADA */
.new-cat-emoji-grid .btn-emoji-pick {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 0;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.new-cat-emoji-grid .btn-emoji-pick:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  transform: scale(1.15);
}

.new-cat-emoji-grid .btn-emoji-pick.active {
  background: #0284c7;
  border-color: #0284c7;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
  transform: scale(1.1);
}

/* ==========================================================================
   POP-UP TOOLTIP FLOTANTE DE RESUMEN DE DÍA (HOVER)
   ========================================================================== */
.calendar-hover-tooltip {
  position: fixed;
  z-index: 999999;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  border: 1.5px solid rgba(126, 196, 178, 0.5);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
  min-width: 250px;
  max-width: 320px;
  font-family: var(--font-body);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: translateY(4px);
}

.calendar-hover-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tooltip-date-header {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 800;
  color: #1e5c80;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tooltip-custody-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.tooltip-custody-mom {
  background: #e0f2fe;
  color: #0369a1;
}

.tooltip-custody-dad {
  background: #f1f5f9;
  color: #1e293b;
}

.tooltip-event-item {
  padding: 6px 0;
  border-bottom: 1px dashed #f1f5f9;
}
.tooltip-event-item:last-child {
  border-bottom: none;
}

.tooltip-event-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tooltip-event-meta {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   ESTILOS DE IMPRESIÓN Y EXPORTACIÓN A PDF A 2 HOJAS (@media print)
   ========================================================================== */
/* Estilos globales obligatorios de Impresión y Exportación a PDF (Aplica tanto a html2pdf como a @media print) */
.print-document-container {
  display: none;
  background: #ffffff;
  color: #000000;
  padding: 10px;
}

.print-page-break {
  page-break-before: always !important;
  break-before: page !important;
  height: 0 !important;
}

.print-page {
  width: 100% !important;
  max-width: 1000px;
  margin: 0 auto;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  padding: 10px !important;
  background: #ffffff !important;
}

/* Header de Impresión */
.print-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 2px solid #1e5c80 !important;
  padding-bottom: 6px !important;
  margin-bottom: 8px !important;
}

.print-header-brand {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.print-logo {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

.print-brand-title {
  font-family: var(--font-heading, sans-serif) !important;
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #1e5c80 !important;
  margin: 0 !important;
  line-height: 1.1 !important;
}

.print-brand-subtitle {
  font-size: 0.72rem !important;
  color: #4f8a9c !important;
  margin: 0 !important;
}

.print-month-title {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 0 !important;
  text-align: right !important;
}

.print-date-badge {
  font-size: 0.7rem !important;
  color: #64748b !important;
  display: block !important;
  text-align: right !important;
}

/* Leyenda de Custodia en Impresión */
.print-legend-bar {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  color: #334155 !important;
  margin-bottom: 8px !important;
}

.print-legend-bar .legend-item {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.print-legend-bar .dot {
  width: 12px !important;
  height: 12px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.print-legend-bar .dot-mom { background: #7ec4b2 !important; border: 1px solid #5aa895 !important; }
.print-legend-bar .dot-dad { background: #1e5c80 !important; border: 1px solid #143d57 !important; }
.print-legend-bar .dot-override { background: #a855f7 !important; border: 1px solid #7e22ce !important; }
.print-legend-bar .dot-event { background: #0284c7 !important; border: 1px solid #0369a1 !important; }

/* Rejilla Mensual Compacta de Impresión */
.print-content-wrapper {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

.print-calendar-grid-wrapper {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

.print-grid-header {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  text-align: center !important;
  font-weight: 800 !important;
  font-size: 0.78rem !important;
  color: #1e293b !important;
  padding: 3px 0 !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.print-grid-body {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  grid-auto-rows: 1fr !important;
  gap: 3px !important;
  flex: 1 !important;
  margin-top: 3px !important;
}

.print-day-cell {
  border: 1px solid #cbd5e1 !important;
  border-radius: 5px !important;
  padding: 3px 4px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  font-size: 0.72rem !important;
  min-height: 48px !important;
  box-sizing: border-box !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.print-day-cell.other-month {
  background: #f8fafc !important;
  opacity: 0.4 !important;
}

.print-day-cell.custody-mom {
  background-color: rgba(126, 196, 178, 0.2) !important;
  border-left: 3.5px solid #7ec4b2 !important;
}

.print-day-cell.custody-dad {
  background-color: rgba(30, 92, 128, 0.16) !important;
  border-left: 3.5px solid #1e5c80 !important;
}

.print-day-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-weight: 800 !important;
}

.print-custody-tag {
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  color: #475569 !important;
}

.print-ev-badge {
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  padding: 1px 3px !important;
  margin-top: 2px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Hoja 2: Tabla de Listado de Eventos */
.print-events-table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-top: 8px !important;
  font-size: 0.8rem !important;
}

.print-events-table th {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  padding: 7px 8px !important;
  border: 1px solid #cbd5e1 !important;
  text-align: left !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.print-events-table td {
  padding: 6px 8px !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

.print-events-table tr:nth-child(even) td {
  background: #f8fafc !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* Footer de Impresión */
.print-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-top: 1px solid #cbd5e1 !important;
  padding-top: 5px !important;
  margin-top: 6px !important;
  font-size: 0.7rem !important;
  color: #64748b !important;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 6mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Ocultar elementos no imprimibles de la interfaz web y notificaciones */
  .app-layout,
  .bg-shape,
  .app-sidebar,
  .app-header,
  .app-hero-header,
  .app-footer,
  .modal-backdrop,
  .calendar-hover-tooltip,
  .toast-notification,
  .app-toast-notification,
  #app-toast-notification {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  /* FORZAR VISIBILIDAD DE IMPRESIÓN DEL DOCUMENTO EN IMPRESORA O PDF */
  #print-document-container,
  .print-document-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 99999999 !important;
  }
}
