:root {
    /* --- PALETA DE COLORES (Tema Claro: Profesional & Artístico) --- */
    --bg-color: #fafaf9;
    --card-bg: #ffffff;

    /* Textos */
    --text-main: #1c1917;
    --text-muted: #57534e;
    --text-light: #a8a29e;

    /* Acentos */
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #ec4899 100%);
    --accent-color: #4f46e5;
    --accent-subtle: #eef2ff;
    --success-color: #10b981;
    --error-color: #ef4444;

    /* Estructura Visual */
    --border-light: #e5e5e5;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 50px;

    /* Sombras Elevadas */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);

    /* Tipografía */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
}

/* --- 1. RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #d6d3d1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a29e;
}

::selection {
    background: var(--accent-subtle);
    color: var(--accent-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    font-size: 16px;
}

.hidden {
    display: none !important;
}

/* --- 2. HEADER & NAV --- */
header {
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 0 24px;
}

.logo {
    font-size: 24px;
    letter-spacing: -0.5px;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--accent-color);
    font-weight: 700;
}

.user-info-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-light);
}

.nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-btn:hover {
    color: var(--accent-color);
    background: var(--accent-subtle);
}

.nav-btn.primary {
    background: var(--text-main);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.nav-btn.primary:hover {
    background: #000;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* --- 3. CONTENEDORES & CARDS --- */
main {
    padding-top: 90px;
    padding-bottom: 40px;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    /* Importante para el badge de alerta */
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(79, 70, 229, 0.1);
}

/* --- 4. HERO SECTION --- */
.hero {
    text-align: center;
    padding: 60px 20px 80px;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--accent-subtle);
    color: var(--accent-color);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--text-main);
    letter-spacing: -1px;
}

.hero h1 span {
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--accent-color);
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
    font-weight: 300;
}

.cta {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 16px 48px;
    border-radius: var(--radius-pill);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px -5px rgba(236, 72, 153, 0.4);
}

/* --- 5. MOOD TRACKER & EMOJIS --- */
.mood-tracker.card {
    max-width: 850px;
    margin: 0 auto 40px;
}

.mood-tracker h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    text-align: center;
}

.mood-tracker p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.mood-options-primary {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(2, 1fr);
}

.mood-main-btn {
    aspect-ratio: 1;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.mood-main-btn .emoji {
    font-size: 2.5rem;
    transition: transform 0.2s;
}

.mood-main-btn .mood-label {
    font-size: 0.8rem;
    margin-top: 12px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.mood-main-btn:hover {
    border-color: var(--accent-color);
}

.mood-main-btn:hover .emoji {
    transform: scale(1.15);
}

.mood-main-btn.selected {
    background: var(--accent-subtle);
    border-color: var(--accent-color);
    box-shadow: inset 0 0 0 1px var(--accent-color);
}

.mood-main-btn.selected .mood-label {
    color: var(--accent-color);
}

/* --- 6. SUB-EMOCIONES --- */
#sub-mood-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

#sub-mood-options button {
    background: #fff;
    border: 1px solid var(--border-light);
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s ease;
}

#sub-mood-options button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: #fff;
    transform: translateY(-2px);
}

#sub-mood-options button.selected {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

/* --- 7. INPUTS & TEXTAREA --- */
textarea,
input,
select {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    color: var(--text-main) !important;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font-body);
    outline: none;
    transition: 0.3s;
    resize: vertical;
}

textarea:focus,
input:focus {
    background: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-subtle);
}

.char-count {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 5px;
}

.cta-small {
    margin-top: 20px;
    width: 100%;
    padding: 14px;
    background: var(--text-main);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
}

.cta-small:hover {
    opacity: 0.9;
}

/* --- 8. REPORT SECTION --- */
.report-section {
    text-align: center;
    padding: 30px 0;
}

.status-msg {
    margin-bottom: 20px;
    color: var(--success-color);
    font-weight: 500;
}

#btn-generate-report {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 20px 30px;
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#btn-generate-report:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px rgba(236, 72, 153, 0.5);
}

/* --- 9. MODAL --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
}

.modal-center {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2001;
}

.modal-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.modal-x {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.modal-x:hover {
    background: #f3f4f6;
    color: var(--text-main);
}

#auth-title {
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.input-group-modal {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

#btn-auth-action {
    width: 100%;
    padding: 14px;
    background: var(--text-main);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.2s;
}

#btn-auth-action:hover {
    background: black;
}

.auth-toggle {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--accent-color);
    cursor: pointer;
    font-weight: 500;
}

.auth-toggle:hover {
    text-decoration: underline;
}

/* --- 10. REPORT CONTENT & TIMELINE --- */
#report-content {
    background: linear-gradient(to bottom right, #f8fafc, #f1f5f9);
    padding: 30px;
    border-radius: var(--radius-md);
    border-left: 5px solid var(--accent-color);
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-top: 20px;
    text-align: left;
}

#mood-history-timeline {
    margin-top: 20px;
}

.timeline-item {
    display: flex;
    gap: 15px;
    padding-bottom: 25px;
    border-left: 2px solid var(--border-light);
    margin-left: 10px;
    padding-left: 25px;
    position: relative;
}

.timeline-item:last-child {
    border-left: 2px solid transparent;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: white;
    border: 3px solid var(--accent-color);
    border-radius: 50%;
}

.timeline-date {
    min-width: 50px;
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.timeline-date .day {
    font-size: 1.6rem;
    display: block;
}

.timeline-content h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}

.timeline-content p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

/* --- 11. PROFILE HEADER --- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-light);
}

.avatar-upload {
    position: relative;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

#profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: var(--shadow-md);
}

.edit-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: var(--text-main);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    cursor: pointer;
}

/* --- 12. LOADING --- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-aurora {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    animation: breathe 2s infinite ease-in-out;
    margin-bottom: 20px;
}

.soft-glow {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-main);
}

@keyframes breathe {

    0%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
    }
}

/* --- 13. FOOTER MEJORADO --- */
.footer {
    background: #fff;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
    padding: 50px 20px 20px;
    color: var(--text-muted);
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .logo {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.footer-brand p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-light);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-contact h4 {
    color: var(--text-main);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-link:hover {
    color: var(--accent-color);
}

/* Botón de WhatsApp */
.footer-wsp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    /* Verde oficial de WhatsApp */
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    width: fit-content;
    transition: transform 0.2s, box-shadow 0.2s;
}

.footer-wsp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    color: white;
}

/* Línea de Copyright */
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text-light);
    max-width: 1000px;
    margin: 0 auto;
}

/* Adaptación para pantallas de celular */
@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .footer-brand .logo {
        justify-content: center;
    }

    .footer-contact {
        align-items: center;
    }
}

/* --- ADMIN DASHBOARD & FEATURES --- */
/* Tabs Responsive: flex-wrap permite que caigan si no caben */
.admin-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    /* CLAVE RESPONSIVE */
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 15px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    /* Evita que el texto se parta raro */
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.tab-btn:hover {
    color: var(--text-main);
}

.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.employee-card {
    border: 1px solid var(--border-light);
    padding: 20px;
    border-radius: var(--radius-md);
    background: #f8fafc;
    transition: 0.2s;
}

.employee-card:hover {
    border-color: var(--accent-color);
    background: #fff;
}

.emp-role {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--text-main);
    color: #fff;
    border-radius: 4px;
    margin-bottom: 10px;
}

.emp-role.admin {
    background: var(--accent-color);
}

/* Buzón */
.inbox-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.msg-card {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.msg-date {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 8px;
    display: block;
}

/* Grid Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

/* --- ESTADÍSTICAS Y CALENDARIO (Admin) --- */
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    padding: 15px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid transparent;
}

.stat-box.success {
    background: #ecfdf5;
    border-color: #d1fae5;
    color: #065f46;
}

.stat-box.error {
    background: #fef2f2;
    border-color: #fee2e2;
    color: #991b1b;
}

.stat-box.neutral {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: var(--text-muted);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#attendance-calendar-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.calendar-month {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    background: #fff;
}

.calendar-month h4 {
    margin-bottom: 15px;
    color: var(--text-main);
    text-transform: capitalize;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.day-header {
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 5px;
}

.day-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    transition: transform 0.2s;
}

.day-cell:hover {
    transform: scale(1.1);
    z-index: 2;
}

/* Colores Semánticos */
.day-positive {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.day-negative {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.day-absent {
    background-color: #f3f4f6;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
}

.day-future {
    background-color: transparent;
    color: var(--border-light);
    border: 1px dashed var(--border-light);
    opacity: 0.4;
}

.day-empty {
    background: transparent;
}

.is-weekend {
    font-weight: 700;
}

/* Badge de Alerta (Risk) */
.risk-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
    animation: pulseRed 2s infinite;
    z-index: 10;
}

@keyframes pulseRed {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Botón Urgencias */
.risk-alert-btn {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    font-weight: 700;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Modal Urgencias - Lista */
.urgency-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.urgency-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    transition: 0.3s;
}

.urgency-item.attended {
    background: #f0f9ff;
    border-color: #bae6fd;
    opacity: 0.8;
}

.urgency-info h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
}

.urgency-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--error-color);
    font-weight: 600;
}

.urgency-check {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #2563eb;
    transform: scale(1.2);
}

/* --- MEDIA QUERIES (RESPONSIVIDAD TOTAL) --- */

@media (min-width: 600px) {
    .mood-options-primary {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero h1 {
        font-size: 3.5rem;
    }
}

@media (min-width: 900px) {
    .mood-options-primary {
        grid-template-columns: repeat(6, 1fr);
    }

    .hero h1 {
        font-size: 4.5rem;
    }
}

/* Móvil General (< 768px) */
@media (max-width: 768px) {
    main {
        padding-top: 80px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .container {
        padding: 0;
    }

    .card {
        padding: 25px 20px;
        border-radius: var(--radius-md);
    }

    .hero {
        padding-top: 40px;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    header {
        height: 60px;
    }

    nav {
        padding: 0 15px;
    }

    .logo {
        font-size: 20px;
    }

    .nav-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    /* Perfil y Admin Header */
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .admin-controls {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .admin-controls button {
        width: 100%;
    }

    /* Urgencias Responsive */
    .urgency-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .urgency-check {
        align-self: center;
    }

    .risk-badge {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 20px;
        display: inline-block;
    }
}

/* Móvil Pequeño (< 380px) */
@media (max-width: 380px) {
    .logo span {
        display: none;
    }

    .logo::after {
        content: 'MB';
        font-weight: bold;
        color: var(--accent-color);
    }

    .nav-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .mood-options-primary {
        gap: 10px;
    }

    .mood-main-btn {
        padding: 10px;
    }

    .mood-main-btn .emoji {
        font-size: 1.8rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .modal-card {
        padding: 30px 20px;
    }

    /* Calendario Mini */
    .day-cell {
        font-size: 0.75rem;
        border-radius: 4px;
    }

    .days-grid {
        gap: 3px;
    }
}

/* --- PAGINACIÓN Y CONTADORES ADMIN --- */

/* Cabecera Flexible: Título a la izquierda, contadores a la derecha */
.header-with-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* Importante para móvil: si no cabe, baja */
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
}

.header-with-meta h3 {
    margin: 0;
    font-size: 1.5rem;
}

/* Píldoras de conteo (Badges) */
.meta-counts {
    display: flex;
    gap: 10px;
}

.count-pill {
    font-size: 0.8rem;
    padding: 6px 12px;
    background: var(--bg-color);
    /* Gris suave */
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.count-pill.admin {
    background: #eff6ff;
    /* Azul muy suave */
    color: var(--accent-color);
    border-color: #dbeafe;
}

/* Botón "Cargar Más" */
.pagination-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px dashed var(--border-light);
    /* Separador visual sutil */
}

.load-more-btn {
    width: 100%;
    max-width: 350px;
    background: #fff;
    border: 1px dashed var(--text-light);
    /* Borde punteado estilo "hay más" */
    color: var(--text-muted);
    padding: 12px;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: var(--bg-color);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    border-style: solid;
    /* Al pasar el mouse se vuelve sólido */
}

/* Ajuste Móvil */
@media (max-width: 600px) {
    .header-with-meta {
        flex-direction: column;
        /* Uno debajo del otro */
        align-items: flex-start;
    }

    .meta-counts {
        width: 100%;
        justify-content: flex-start;
    }
}

/* --- BUSCADOR ADMIN --- */
.search-bar-container {
    position: relative;
    margin-bottom: 25px;
    max-width: 100%;
}

#admin-search-input {
    width: 100%;
    padding: 14px 45px 14px 20px;
    /* Espacio para el icono X */
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    /* Más redondeado */
    font-size: 1rem;
    background-color: #f8fafc;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

#admin-search-input:focus {
    background-color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-subtle);
}

#btn-clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

#btn-clear-search:hover {
    background-color: #f1f5f9;
    color: var(--error-color);
}

/* Estado cuando se está buscando activamente */
.searching-mode .employee-card {
    border-left: 4px solid var(--accent-color);
    /* Indicador visual */
}

/* Responsive */
@media (max-width: 600px) {
    #admin-search-input {
        font-size: 0.95rem;
        padding: 12px 40px 12px 15px;
    }
}

/* --- ESTADO DESHABILITADO (PREVIENE DOBLE CLICK) --- */
button:disabled,
.cta:disabled,
.nav-btn:disabled {
    background-color: var(--text-light) !important;
    /* Gris */
    color: #fff !important;
    cursor: not-allowed !important;
    transform: none !important;
    /* Evita el efecto de presionar */
    box-shadow: none !important;
    opacity: 0.7;
}


/* --- AJUSTE CABECERA PERFIL --- */
.header-info-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

/* En móvil, centramos todo */
@media (max-width: 768px) {
    .header-info-group {
        align-items: center;
        /* Centrar botón y texto */
        width: 100%;
    }

    #btn-back-to-dashboard {
        width: 100%;
        /* Botón ancho en móvil para fácil clic */
        justify-content: center;
    }
}

/* --- MENÚ DE TRES PUNTOS (KEBAB MENU) --- */

/* Aseguramos que la tarjeta sea el marco de referencia */
.employee-card {
    position: relative;
    /* El resto de tus estilos de card se mantienen... */
}

/* El botón de los 3 puntos */
.card-menu-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 10;
}

.card-menu-btn:hover {
    color: var(--text-main);
    background-color: #f1f5f9;
}

/* El menú desplegable (oculto por defecto) */
.card-menu-dropdown {
    position: absolute;
    top: 35px;
    right: 10px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 140px;
    display: none;
    /* Oculto */
    z-index: 20;
    overflow: hidden;
    animation: fadeInMenu 0.15s ease-out;
}

.card-menu-dropdown.active {
    display: block;
    /* Visible */
}

/* Opción de eliminar */
.menu-option-delete {
    width: 100%;
    text-align: left;
    padding: 10px 15px;
    background: white;
    border: none;
    color: var(--error-color);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.menu-option-delete:hover {
    background: #fef2f2;
}

@keyframes fadeInMenu {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.pricing-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.pricing-card {
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    padding: 40px 20px;
    text-align: center;
    border: 1px solid var(--border-light);
}

.pricing-card.highlight {
    border: 2px solid var(--accent-color);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 20px 0;
    font-family: var(--font-heading);
}

.features-list {
    list-style: none;
    text-align: left;
    margin-bottom: 30px;
    padding: 0 20px;
}

.features-list li {
    margin-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 5px;
}

/* --- BUZÓN DE CONFIANZA (Diseño Premium) --- */

.inbox-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.msg-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 25px;
    position: relative;
    transition: all 0.3s ease;
    border-left: 5px solid var(--accent-color);
    /* Indicador visual por defecto (No leído) */
}

/* Estado: NO LEÍDO (Resaltado) */
.msg-card:not(.read-msg) {
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.08);
    transform: translateX(5px);
}

.msg-card:not(.read-msg) .msg-content {
    color: var(--text-main);
    font-weight: 500;
}

/* Estado: LEÍDO (Sutil) */
.msg-card.read-msg {
    background: #fafaf9;
    /* Gris muy suave */
    border-left-color: #d6d3d1;
    /* Borde gris */
    opacity: 0.85;
}

.msg-card.read-msg .msg-content {
    color: var(--text-muted);
}

/* Cabecera del mensaje */
.msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.msg-date {
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Badge de "NUEVO" */
.new-badge {
    background: var(--accent-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Cuerpo del mensaje */
.msg-content {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    white-space: pre-wrap;
    /* Respeta saltos de línea */
}

/* Pie de tarjeta (Acciones) */
.msg-actions {
    display: flex;
    justify-content: flex-end;
    border-top: 1px dashed var(--border-light);
    padding-top: 15px;
}

.btn-toggle-read {
    background: transparent;
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-toggle-read:hover {
    background: #fff;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Iconos dinámicos */
.btn-toggle-read.is-read-btn {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

/* --- LISTA DE REPORTES ADMIN --- */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.report-card-admin {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.report-card-admin:hover {
    background: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.report-card-admin::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
    opacity: 0.5;
}

.report-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.report-preview {
    font-size: 0.9rem;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* Muestra solo 3 líneas */
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.view-btn-sm {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* --- BITÁCORA PRIVADA ADMIN --- */

.notes-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    margin-top: 20px;
}

/* Calendario Mini Interactivo */
.notes-sidebar {
    background: #f8fafc;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    height: fit-content;
}

.calendar-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-header-nav h4 {
    margin: 0;
    font-size: 1rem;
    text-transform: capitalize;
}

.nav-btn-mini {
    background: white;
    border: 1px solid var(--border-light);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.nav-btn-mini:hover {
    background: var(--accent-subtle);
    color: var(--accent-color);
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

/* Días del calendario */
.cal-day-btn {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid transparent;
    background: white;
    position: relative;
    transition: all 0.2s;
}

.cal-day-btn:hover {
    border-color: var(--accent-color);
}

.cal-day-btn.selected {
    background: var(--text-main);
    color: white;
    border-color: var(--text-main);
}

.cal-day-btn.empty {
    background: transparent;
    cursor: default;
}

/* Indicador de que hay nota (punto azul) */
.has-note-dot {
    width: 5px;
    height: 5px;
    background: var(--accent-color);
    border-radius: 50%;
    position: absolute;
    bottom: 4px;
}

.cal-day-btn.selected .has-note-dot {
    background: #fff;
    /* Punto blanco si está seleccionado */
}

.legend-box {
    margin-top: 15px;
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.dot-legend {
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    display: inline-block;
}

/* Área de Editor */
.notes-editor-area {
    display: flex;
    flex-direction: column;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

#selected-date-label {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.privacy-badge {
    font-size: 0.75rem;
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

#admin-note-input {
    flex: 1;
    min-height: 300px;
    padding: 20px;
    line-height: 1.6;
    border: 1px solid var(--border-light);
    background: #fff;
    resize: none;
    /* Evita redimensionar manual feo */
}

#admin-note-input:focus {
    background: #fff;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

#btn-save-note {
    margin-left: 10px;
}

/* Responsive Móvil */
@media (max-width: 768px) {
    .notes-layout {
        grid-template-columns: 1fr;
        /* Una sola columna */
    }

    .notes-sidebar {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    #admin-note-input {
        min-height: 200px;
    }
}

/* --- GRID RESPONSIVE DE 4 PLANES --- */
.pricing-grid-3 {
    display: grid;
    /* Crea 3 columnas exactas, y si la pantalla es chica, se bajan solas */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    align-items: stretch;
    max-width: 1000px;
    margin: 0 auto 40px auto;
    /* 40px de margen abajo para separar el corporativo */
}

.pricing-card {
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.pricing-card .features-list {
    flex-grow: 1;
    /* Empuja el botón siempre hacia abajo */
    margin-bottom: 25px;
}

.pricing-card .cta-small {
    margin-top: auto;
}

/* En tablets y móviles, el destacado no debe salirse del grid */
@media (max-width: 1024px) {
    .pricing-card.highlight {
        transform: scale(1);
        /* Quitamos el scale(1.05) para evitar desbordes */
        border-width: 2px;
    }

    .pricing-card.highlight:hover {
        transform: translateY(-5px);
    }
}


/* --- TARJETA CORPORATIVA CENTRADA HORIZONTAL (Wide Card) --- */
.corporate-plan-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.corporate-card {
    background: #1c1917;
    color: white;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    /* Dividimos la tarjeta ancha en 3 secciones */
    align-items: center;
    gap: 20px;
    padding: 40px;
    text-align: center;
}

/* Ajustes internos para la tarjeta corporativa ancha */
.corporate-card .features-list {
    margin-bottom: 0;
}

.corporate-card .cta {
    margin-top: 0;
}

/* En tablets y móviles, el Corporativo vuelve a ser vertical como los demás */
@media (max-width: 900px) {
    .corporate-card {
        max-width: 400px;
        /* Para que no se vea desproporcionadamente ancha en móviles */
    }
}


/* --- MEJORAS VISUALES: PESTAÑA FACTURACIÓN --- */

/* Contenedor de los botones para que no se aprieten en móviles */
.billing-actions-wrapper {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-light);
}

/* El botón de Upgrade debe resaltar más que los demás */
#btn-show-upgrade {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
}

#btn-show-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

/* El botón de Actualizar Tarjeta debe ser neutro (secundario) */
#btn-open-card-modal {
    background: #f8fafc;
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

#btn-open-card-modal:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* El botón de Cancelar debe dar un poco de "miedo" (Ghost Button Rojo) */
#btn-cancel-sub {
    background: transparent;
    color: var(--error-color);
    border: 1px solid transparent;
    /* Sin borde inicial para que parezca un link */
}

#btn-cancel-sub:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

/* Hacer que los botones ocupen el 100% del ancho en celulares */
@media (max-width: 600px) {
    .billing-actions-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .billing-actions-wrapper button {
        width: 100%;
        text-align: center;
    }
}

/* --- ESTILOS PARA EMPLEADOS INACTIVOS --- */

/* Badge superior */
.emp-status-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

/* Tarjeta inactiva (Grises, opacidad baja) */
.employee-card.inactive {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    opacity: 0.65;
    order: 2;
    /* TRUCO: Manda las tarjetas inactivas al fondo del Grid automáticamente */
}

/* Al pasar el mouse recupera el color para poder interactuar */
.employee-card.inactive:hover {
    opacity: 0.95;
    border-color: #cbd5e1;
}

.employee-card.inactive h4,
.employee-card.inactive p {
    color: #64748b;
}

/* Las tarjetas activas van primero */
.employee-card.active {
    order: 1;
}

/* Opciones de Menú Kebab */
.menu-option-reactivate {
    width: 100%;
    text-align: left;
    padding: 10px 15px;
    background: white;
    border: none;
    color: var(--success-color);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.menu-option-reactivate:hover {
    background: #ecfdf5;
}

/* --- REPORTES Y TABLAS --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
    border: 1px solid var(--border-light);
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background-color: #f8fafc;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background-color: var(--accent-subtle);
}

.chart-wrapper {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    min-height: 250px;
    position: relative;
}

/* =========================================
   REPORTES Y TABLAS RESPONSIVAS
========================================= */

/* Contenedor padre de la tabla para permitir scroll horizontal en móviles sin romper la página */
#emp-report-table-container,
#report-table-container {
    width: 100%;
    overflow-x: auto;
    /* La magia: crea una barra de scroll solo en la tabla */
    -webkit-overflow-scrolling: touch;
    /* Deslizamiento suave en iPhone */
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
}

/* La tabla base */
.data-table {
    width: 100%;
    min-width: 600px;
    /* Evita que las columnas se aplasten en pantallas pequeñas */
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

/* Cabecera de la tabla */
.data-table th {
    background-color: #f8fafc;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background-color: var(--accent-subtle);
}

/* --- GRÁFICAS --- */
.chart-wrapper {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    min-height: 300px;
    /* Altura suficiente para que Chart.js respire */
    position: relative;
    width: 100%;
}

/* --- ADAPTACIÓN A TELÉFONOS MÓVILES (< 600px) --- */
@media (max-width: 600px) {

    /* Los botones de PDF, Word, Excel pasan a estar uno debajo del otro */
    #emp-report-export,
    #report-export-controls {
        flex-direction: column;
        width: 100%;
    }

    #emp-report-export button,
    #report-export-controls button {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    /* El selector y el botón "Generar" ocupan el 100% */
    #emp-report-type,
    #report-type-selector,
    #btn-run-emp-report,
    #btn-run-report {
        width: 100%;
        max-width: 100%;
    }

    /* Las gráficas se apilan en vez de estar lado a lado */
    #emp-report-charts,
    #report-charts-container {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   ESTILOS PARA REPORTES DE NOTAS ADMIN
========================================= */

/* Caja del texto de la observación */
.note-content-box {
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--text-main);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

/* Contenedor de la firma del autor */
.note-signature {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-light);
    font-size: 0.8rem;
}

/* Nombre del autor destacado */
.note-author {
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Email más sutil */
.note-email {
    color: var(--text-light);
    font-style: italic;
}

/* Asegurar que las celdas de las tablas se alineen arriba (para textos largos) */
.data-table td {
    vertical-align: top;
}

/* =========================================
   SWITCH MENSUAL / ANUAL
========================================= */
.pricing-toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}

.toggle-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    transition: color 0.3s;
    position: relative;
}

.toggle-label.active {
    color: var(--text-main);
}

.discount-badge {
    position: absolute;
    top: -25px;
    right: -30px;
    background: #ecfdf5;
    color: #059669;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid #a7f3d0;
    white-space: nowrap;
}

/* El Switch en sí */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--accent-color);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--text-main);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* --- BANNER DE EXPIRACIÓN --- */
.expired-banner {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 25px;
    border-radius: var(--radius-md);
    margin-bottom: 40px;
    text-align: left;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1);
    animation: fadeInMenu 0.4s ease-out;
}

.expired-banner h3 {
    margin-bottom: 10px;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
}

.expired-banner p {
    margin-bottom: 0;
    color: #7f1d1d;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* --- BOTÓN FLOTANTE WHATSAPP --- */
.floating-wsp {
    position: fixed;
    bottom: 60px;
    right: 30px;
    background-color: #25D366;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    /* Asegura que siempre esté por encima de todo */
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse-wsp 2.5s infinite;
}

/* Efecto al pasar el mouse (se agranda un poquito y frena la animación) */
.floating-wsp:hover {
    transform: scale(1.1);
    animation: none;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

/* Animación sutil de "respiración" o pulso */
@keyframes pulse-wsp {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Adaptación para pantallas de celular */
@media (max-width: 600px) {
    .floating-wsp {
        bottom: 30px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .floating-wsp svg {
        width: 26px;
        height: 26px;
    }
}

/* Opción de Editar en el Kebab Menu */
.menu-option-edit {
    width: 100%;
    text-align: left;
    padding: 10px 15px;
    background: white;
    border: none;
    color: #3b82f6;
    /* Color azul */
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.menu-option-edit:hover {
    background: #eff6ff;
}

/* =========================================
   ESTILOS LEGALES Y CONSENTIMIENTOS
========================================= */

.legal-block {
    text-align: left;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.legal-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1.4;
}

.legal-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--accent-color);
    cursor: pointer;
    flex-shrink: 0;
}

.legal-label a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.legal-label a:hover {
    text-decoration: underline;
}

/* Advertencia Legal B2B (Empresas) */
.b2b-warning {
    background: #fef2f2;
    border-left: 4px solid #ffd0d0;
    color: grey;
    padding: 12px;
    font-size: 0.8rem;
    margin-bottom: 15px;
    border-radius: 0 4px 4px 0;
    line-height: 1.5;
}

/* Descargo Médico Footer */
.medical-disclaimer {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.medical-disclaimer strong {
    color: var(--text-main);
}