:root {
    --primary: #e85d75;
    --primary-light: #fdf2f4;
    --primary-hover: #d2455f;
    --secondary: #8b5cf6;
    --secondary-light: #f5f3ff;
    --coral: #ff758c;
    --mint: #10b981;
    --mint-light: #ecfdf5;
    --blue: #0ea5e9;
    --blue-light: #e0f2fe;
    --amber: #f59e0b;
    --amber-light: #fffbeb;
    --dark: #18181b;
    --text-muted: #71717a;
    --border: #e4e4e7;
    --bg-main: #faf9fb;
    --card-bg: #ffffff;
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 12px -2px rgba(232, 93, 117, 0.04);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --transition: all 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--dark);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--coral), var(--secondary));
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(232, 93, 117, 0.25);
}

.logo-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.logo-subtitle {
    font-size: 0.725rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Nav Links Hub */
.nav-links-hub {
    display: flex;
    background: #f4f4f5;
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.nav-hub-link {
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.nav-hub-link:hover {
    color: var(--dark);
}

.nav-hub-link.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Menú de Usuario */
.user-menu-area {
    position: relative;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.35rem 0.85rem 0.35rem 0.45rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.user-badge:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-text-info {
    text-align: left;
    font-size: 0.825rem;
    line-height: 1.2;
}

.user-greeting {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.user-name {
    display: block;
    color: var(--dark);
    font-weight: 700;
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Dropdown */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    padding: 0.75rem;
    display: none;
    flex-direction: column;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

.user-dropdown-menu.show {
    display: flex;
}

.dropdown-header {
    padding: 0.5rem 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.d-user-email {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.d-user-id {
    display: block;
    font-size: 0.725rem;
    color: var(--text-muted);
}

.dropdown-switch-user {
    padding: 0.5rem;
}

.dropdown-switch-user label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.dropdown-switch-user select {
    width: 100%;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    background: #fafafa;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

.dropdown-item {
    background: transparent;
    border: none;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    font-weight: 600;
    color: #3f3f46;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: #f4f4f5;
    color: var(--dark);
}

.dropdown-item.text-danger {
    color: #dc2626;
}

.dropdown-item.text-danger:hover {
    background: #fee2e2;
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 1.5rem auto 3rem;
    padding: 0 1.5rem;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* ========================================================
   SECCIÓN 1: TARJETA DE VERSÍCULO BÍBLICO (RVR1960)
   ======================================================== */
.verse-card {
    background: linear-gradient(135deg, #ffffff 0%, #fffbfb 60%, #fdf8ff 100%);
    border: 1px solid rgba(232, 93, 117, 0.25);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 6px 20px rgba(232, 93, 117, 0.08);
    position: relative;
    overflow: hidden;
}

.verse-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.verse-decor-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.verse-content {
    flex: 1;
}

.verse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.verse-theme-badge {
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.65rem;
    background: var(--secondary-light);
    color: var(--secondary);
    border-radius: var(--radius-full);
}

.btn-refresh-verse {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.btn-refresh-verse:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--coral);
}

.verse-quote {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-style: italic;
    color: #27272a;
    line-height: 1.5;
    margin-bottom: 0.35rem;
}

.verse-ref {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

/* ========================================================
   SECCIÓN 2: HERO CYCLE GRID
   ======================================================== */
.hero-cycle-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Rueda de Ciclo */
.cycle-wheel-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(145deg, #ffffff 0%, #fff9fa 100%);
}

.wheel-container {
    padding: 1rem 0;
}

.cycle-progress-ring {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0% 28%, #f4f4f5 28% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(232, 93, 117, 0.2);
    padding: 12px;
}

.ring-inner {
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.phase-badge {
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.phase-badge.is-delayed {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}

.cycle-delay-info-card {
    margin-top: 1.15rem;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1.5px solid #fde68a;
    text-align: left;
}

.delay-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.delay-pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    padding: 3px 10px;
    border-radius: 999px;
    background: #d97706;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.delay-card-header h4 {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 800;
    color: #92400e;
}

.delay-card-intro {
    font-size: 0.82rem;
    color: #78350f;
    line-height: 1.45;
    margin: 0 0 0.6rem 0;
}

.delay-reasons-list {
    margin: 0;
    padding-left: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.79rem;
    color: #451a03;
    line-height: 1.4;
}

.delay-card-footer {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px dashed #fcd34d;
    font-size: 0.75rem;
    color: #92400e;
    line-height: 1.4;
}

.current-day-number {
    font-size: 2.35rem;
    font-weight: 800;
    color: #18181b;
    line-height: 1.1;
}

.cycle-status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.quick-info-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    width: 100%;
    margin: 1.25rem 0 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.info-pill {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-align: left;
}

.info-pill i {
    font-size: 1.25rem;
}

.pill-label {
    display: block;
    font-size: 0.725rem;
    color: var(--text-muted);
    font-weight: 500;
}

.info-pill strong {
    font-size: 0.9rem;
    color: #18181b;
}

.text-rose { color: var(--primary); }
.text-purple { color: var(--secondary); }
.text-coral { color: #f97316; }
.text-blue { color: var(--blue); }
.text-green { color: var(--mint); }

.card-buttons-row {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    justify-content: center;
}

/* Botones */
.btn {
    padding: 0.75rem 1.35rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(232, 93, 117, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--dark);
}

.btn-secondary:hover {
    background: #f4f4f5;
}

.btn-icon-only {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.btn-icon-only:hover {
    background: #f4f4f5;
    color: var(--primary);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* Wellness Panel */
.wellness-panel-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wellness-block {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
}

.block-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.65rem;
}

.water-cups-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.water-cup-item {
    width: 32px;
    height: 36px;
    border: 2px solid #bae6fd;
    background: #f0f9ff;
    border-radius: 4px 4px 10px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bae6fd;
    font-size: 0.75rem;
    transition: var(--transition);
}

.water-cup-item.filled {
    background: var(--blue);
    border-color: var(--blue);
    color: #ffffff;
}

.btn-check-pill {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.btn-check-pill.active {
    background: var(--mint-light);
    color: var(--mint);
    border-color: #a7f3d0;
}

.phase-advice-box {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    gap: 0.85rem;
}

.advice-icon {
    font-size: 1.4rem;
    color: #d97706;
}

.phase-advice-box h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 0.2rem;
}

.phase-advice-box p {
    font-size: 0.8rem;
    color: #78350f;
    line-height: 1.4;
}

/* ========================================================
   SECCIÓN 3: ESTADÍSTICAS & ANALÍTICA
   ======================================================== */
.statistics-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-grid-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: var(--shadow-card);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.bg-rose { background: var(--primary-light); color: var(--primary); }
.bg-purple { background: var(--secondary-light); color: var(--secondary); }
.bg-green { background: var(--mint-light); color: var(--mint); }
.bg-amber { background: var(--amber-light); color: var(--amber); }

.stat-card-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-card-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: #18181b;
    line-height: 1.1;
    margin: 0.2rem 0;
}

.stat-card-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.analytics-chart-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-card);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.chart-header h4 {
    font-size: 0.9rem;
    font-weight: 700;
}

.chart-legend-tag {
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #f4f4f5;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

.cycle-phases-bar {
    display: flex;
    height: 28px;
    border-radius: var(--radius-full);
    overflow: hidden;
    font-size: 0.725rem;
    font-weight: 700;
    color: white;
    text-align: center;
}

.phase-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

.phase-m { background: var(--primary); }
.phase-f { background: #60a5fa; }
.phase-o { background: var(--secondary); }
.phase-l { background: #f59e0b; }

/* ========================================================
   SECCIÓN 4: CALENDARIO & HISTORIAL
   ======================================================== */
.grid-two-cols {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
}

.calendar-card {
    display: flex;
    flex-direction: column;
}

.calendar-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-cal-nav {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-cal-nav:hover { background: #f4f4f5; }

.btn-today-shortcut {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
}

.calendar-legends-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.leg-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.leg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-period { background: var(--primary); }
.dot-fertile { background: #60a5fa; }
.dot-ovulation { background: var(--secondary); }
.dot-log { background: #27272a; }

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.cal-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding-top: 0.5rem;
}

.cal-cell {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.cal-cell:hover { background: #f4f4f5; }
.cal-cell.empty { cursor: default; background: transparent; }
.cal-cell.today { border: 2px solid var(--primary); font-weight: 700; }
.cal-cell.selected { box-shadow: 0 0 0 2px var(--dark); }
.cal-cell.period { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.cal-cell.fertile { background: #eff6ff; color: #2563eb; }
.cal-cell.ovulation { background: var(--secondary-light); color: var(--secondary); font-weight: 700; }

.has-log-marker {
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--dark);
}

/* Day Log Details */
.day-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.day-log-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.day-log-body {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    min-height: 150px;
}

.chip-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.2rem;
}

.chip-flow { background: var(--primary-light); color: var(--primary); }
.chip-mood { background: #fef3c7; color: #b45309; }
.chip-symp { background: #f3f4f6; color: #374151; border: 1px solid var(--border); }

.history-timeline-section h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.history-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 180px;
    overflow-y: auto;
}

.history-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.825rem;
}

/* Modals */
.modal-overlay {
    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: 100;
    padding: 1.5rem;
}

.modal-overlay.active { display: flex; }

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.25s ease;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: #27272a;
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.chip-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip-btn {
    padding: 0.45rem 0.85rem;
    background: #f4f4f5;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: #52525b;
    cursor: pointer;
    transition: var(--transition);
}

.chip-btn:hover { background: #e4e4e7; }

.chip-btn.selected {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--coral);
    font-weight: 700;
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    display: block;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Toast */
.toast-box {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #18181b;
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    pointer-events: none;
    z-index: 200;
}

.toast-box.show {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: #ffffff;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 960px) {
    .hero-cycle-grid, .grid-two-cols { grid-template-columns: 1fr; }
    .stats-grid-cards { grid-template-columns: 1fr 1fr; }
    .verse-card { flex-direction: column; text-align: center; }
    .verse-card::before { width: 100%; height: 6px; }
}

@media (max-width: 600px) {
    .stats-grid-cards { grid-template-columns: 1fr; }
    .quick-info-strip { grid-template-columns: 1fr; }
}


/* ==========================================================
   CABECERA UNIFICADA & NAVEGACIÓN RESPONSIVA SIN SCROLLBARS
   ========================================================== */
.main-header {
    background: #ffffff !important;
    border-bottom: 1px solid #f1e4e6 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.header-container {
    max-width: 1320px !important;
    margin: 0 auto !important;
    padding: 10px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    position: relative !important;
}

.brand-area {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
    color: inherit !important;
    flex-shrink: 0 !important;
}

.brand-logo-img {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    object-fit: contain !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.brand-text {
    display: flex !important;
    flex-direction: column !important;
    line-height: 1.15 !important;
}

.brand-name {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: 1.3rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    color: #be123c !important;
}

.brand-tagline {
    font-size: 0.68rem !important;
    color: #64748b !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
}

/* Botón Hamburguesa para Móviles (< 992px) */
.mobile-nav-toggle {
    display: none !important;
    background: transparent !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    width: 40px !important;
    height: 40px !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
    color: #475569 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.mobile-nav-toggle:hover {
    background: #f8fafc !important;
    color: #be123c !important;
}

/* Hub de Navegación de 5 Módulos */
.nav-hub,
.nav-links-hub {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    flex: 1 !important;
    margin: 0 10px !important;
    overflow: visible !important; /* Cero barras de desplazamiento */
    padding: 0 !important;
}

.nav-hub-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 7px 12px !important;
    border-radius: 9999px !important;
    text-decoration: none !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.nav-hub-link:hover {
    background: #ffe4e6 !important;
    color: #be123c !important;
}

.nav-hub-link.active {
    background: linear-gradient(135deg, #e11d48 0%, #f43f5e 50%, #fb7185 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25) !important;
}

.mobile-nav-divider,
.mobile-logout-btn {
    display: none !important;
}

/* Menú de Usuario */
.user-menu-area {
    position: relative !important;
    flex-shrink: 0 !important;
}

.user-badge {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 5px 12px !important;
    background: #fdf2f4 !important;
    border: 1px solid #fecdd3 !important;
    border-radius: 9999px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.user-badge:hover {
    background: #ffe4e6 !important;
    border-color: #fda4af !important;
}

.avatar-circle {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.88rem !important;
}

.user-text-info {
    display: flex !important;
    flex-direction: column !important;
    line-height: 1.15 !important;
}

.user-greeting {
    font-size: 0.65rem !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
}

.user-name {
    font-size: 0.82rem !important;
    color: #0f172a !important;
    max-width: 130px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.dropdown-arrow {
    font-size: 0.72rem !important;
    color: #64748b !important;
    margin-left: 2px !important;
}

/* Dropdown */
.user-dropdown-menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    width: 270px !important;
    background: #ffffff !important;
    border-radius: 14px !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid #f1e4e6 !important;
    padding: 12px !important;
    display: none !important;
    flex-direction: column !important;
    z-index: 1100 !important;
}

.user-dropdown-menu.show {
    display: flex !important;
    animation: fadeInDown 0.2s ease !important;
}

.dropdown-header {
    padding-bottom: 8px !important;
    border-bottom: 1px solid #f1e4e6 !important;
    margin-bottom: 8px !important;
}

.d-user-email {
    font-size: 0.8rem !important;
    color: #64748b !important;
    display: block !important;
    word-break: break-all !important;
}

.d-user-id {
    font-size: 0.72rem !important;
    color: #e11d48 !important;
    font-weight: 700 !important;
}

.dropdown-switch-user {
    padding: 6px 0 !important;
}

.dropdown-switch-user label {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    display: block !important;
    margin-bottom: 4px !important;
}

.dropdown-switch-user select {
    width: 100% !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    font-size: 0.82rem !important;
    background-color: #fff !important;
    font-family: inherit !important;
}

.dropdown-divider {
    height: 1px !important;
    background: #f1e4e6 !important;
    margin: 8px 0 !important;
}

.dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 9px 12px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    cursor: pointer !important;
    text-align: left !important;
    transition: background 0.15s ease !important;
    width: 100% !important;
    font-family: inherit !important;
}

.dropdown-item:hover {
    background: #fdf2f4 !important;
    color: #be123c !important;
}

.dropdown-item.text-danger {
    color: #ef4444 !important;
}

.dropdown-item.text-danger:hover {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

/* ==========================================================
   REGLAS RESPONSIVAS GLOBALES PARA MÓVILES (< 992px)
   ========================================================== */
@media (max-width: 992px) {
    .mobile-nav-toggle {
        display: flex !important;
    }

    .nav-hub,
    .nav-links-hub {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 16px !important;
        right: 16px !important;
        background: #ffffff !important;
        border-radius: 16px !important;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15) !important;
        border: 1px solid #f1e4e6 !important;
        padding: 12px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        margin: 8px 0 0 0 !important;
        z-index: 1050 !important;
    }

    .nav-hub.mobile-open,
    .nav-links-hub.mobile-open {
        display: flex !important;
        animation: fadeInDown 0.25s ease !important;
    }

    .nav-hub-link {
        padding: 12px 16px !important;
        border-radius: 10px !important;
        font-size: 0.92rem !important;
        justify-content: flex-start !important;
    }

    .brand-area {
        order: 1 !important;
    }

    .user-menu-area {
        order: 2 !important;
        margin-left: auto !important;
        margin-right: 10px !important;
    }

    .mobile-nav-toggle {
        order: 3 !important;
    }

    .mobile-nav-divider {
        display: block !important;
        height: 1px !important;
        background: #fee2e2 !important;
        margin: 6px 0 !important;
    }

    .mobile-logout-btn {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 12px 16px !important;
        border-radius: 10px !important;
        border: 1px solid #fecdd3 !important;
        background: #fff1f2 !important;
        color: #e11d48 !important;
        font-size: 0.92rem !important;
        font-weight: 700 !important;
        cursor: pointer !important;
        width: 100% !important;
        text-align: left !important;
        transition: all 0.2s ease !important;
    }

    .mobile-logout-btn:hover {
        background: #fee2e2 !important;
        color: #be123c !important;
    }

    .user-text-info {
        display: flex !important;
    }

    .user-badge {
        padding: 4px 8px !important;
    }

    .user-dropdown-menu {
        position: fixed !important;
        top: 65px !important;
        right: 12px !important;
        left: auto !important;
        width: 260px !important;
        max-width: calc(100vw - 24px) !important;
    }

    .brand-tagline {
        display: block !important;
    }

    /* Adaptabilidad de contenedores y cards */
    .main-container {
        padding: 16px 12px 40px 12px !important;
    }

    .hero-banner,
    .hero-checklist-banner {
        padding: 20px 16px !important;
    }

    .hero-title {
        font-size: 1.55rem !important;
    }

    /* Tracker contracciones móvil */
    .tracker-workspace-grid {
        grid-template-columns: 1fr !important;
    }

    .big-timer-btn {
        width: 180px !important;
        height: 180px !important;
    }

    .timer-digits {
        font-size: 2.7rem !important;
    }

    .guide-cards-grid {
        grid-template-columns: 1fr !important;
    }

    /* Adaptación de tablas */
    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .period-alert-banner {
        flex-direction: column !important;
        padding: 16px !important;
        gap: 12px !important;
    }

    .period-alert-actions {
        width: 100% !important;
        flex-direction: column !important;
    }

    .btn-alert-notif,
    .btn-alert-dismiss {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* ==========================================================================
   ALERTA DE CICLO MENSTRUAL & NOTIFICACIONES EN PANTALLA (TABLET & CELULAR)
   ========================================================================== */

.period-alert-banner {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 50%, #fecdd3 100%);
    border: 1.5px solid #fda4af;
    border-radius: var(--radius-md, 16px);
    padding: 20px 22px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px -5px rgba(225, 29, 72, 0.12);
    animation: slideDownAlert 0.4s ease-out forwards;
}

@keyframes slideDownAlert {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.period-alert-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: #ffffff;
    color: #e11d48;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.2);
    animation: ringBell 2.5s infinite ease-in-out;
}

@keyframes ringBell {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-14deg); }
    20%, 40% { transform: rotate(14deg); }
    50% { transform: rotate(0deg); }
}

.period-alert-body {
    flex: 1;
    min-width: 0;
}

.period-alert-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.period-alert-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9f1239;
    background: #ffe4e6;
    border: 1px solid #fecdd3;
    padding: 3px 10px;
    border-radius: 999px;
}

.period-alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #e11d48, #be123c);
    padding: 3px 12px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(225, 29, 72, 0.25);
}

.period-alert-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #881337;
    margin: 4px 0 6px 0;
}

.period-alert-text {
    font-size: 0.92rem;
    color: #4c0519;
    line-height: 1.5;
    margin-bottom: 14px;
}

.period-alert-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-alert-notif {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
    transition: all 0.2s ease;
}

.btn-alert-notif:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(225, 29, 72, 0.35);
    background: linear-gradient(135deg, #be123c, #9f1239);
}

.btn-alert-dismiss {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: #9f1239;
    border: 1px solid #fda4af;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-alert-dismiss:hover {
    background: #fff1f2;
    color: #881337;
    border-color: #f43f5e;
}

.period-alert-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: #9f1239;
    cursor: pointer;
    opacity: 0.7;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.period-alert-close:hover {
    opacity: 1;
    background: rgba(225, 29, 72, 0.1);
}

/* Bloque en Tarjeta de Bienestar */
.notif-wellness-block {
    background: #fffafb;
    border: 1px solid #ffe4e6;
    border-radius: 12px;
    padding: 14px;
}

.notif-state-chip {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.notif-state-chip.active {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.notif-state-chip.inactive {
    background: #f4f4f5;
    color: #71717a;
    border: 1px solid #e4e4e7;
}

.notif-state-chip.denied {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.notif-block-desc {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.4;
    margin: 8px 0 12px 0;
}

.notif-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-notif-action {
    flex: 1;
    min-width: 150px;
    background: linear-gradient(135deg, #e11d48, #f43f5e);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-notif-action:hover {
    background: linear-gradient(135deg, #be123c, #e11d48);
}

.btn-notif-action.is-active {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-notif-action.is-active:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-notif-test {
    background: #ffffff;
    color: #e11d48;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-notif-test:hover {
    background: #fff1f2;
    border-color: #fda4af;
}

