/* =========================================
   1. GLOBAL & FLATPICKR
   ========================================= */
.flatpickr-calendar { border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border: 1px solid #e2e8f0; font-family: 'Inter', sans-serif; }
.flatpickr-day.selected { background: #3b82f6 !important; border-color: #3b82f6 !important; }

/* FIX ANCHO COMPLETO */
.is-layout-constrained > #core-app, .entry-content > #core-app { max-width: 100% !important; margin: 0 !important; width: 100% !important; }

/* =========================================
   2. HEADER (TUS AJUSTES)
   ========================================= */
.rl-header { 
    position: -webkit-sticky; position: sticky; top: 0; z-index: 90;
    background: #fff; border-bottom: 1px solid #e2e8f0; 
    width: 100% !important; box-sizing: border-box; margin: 0 !important;
    padding: 0 2rem; min-height: 52px; height: 52px; 
    display: flex; justify-content: space-between; align-items: center; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.03); border-radius: 0 !important; 
}

.rl-h-left, .rl-h-right { display: flex; align-items: center; gap: 10px; height: 100%; }
.rl-title { font-size: 1.1em; margin: 0; font-weight: 800; }

.rl-nav { background: #f8fafc; border-radius: 6px; padding: 2px; display: flex; align-items: center; height: 36px; box-sizing: border-box; border: 1px solid #e2e8f0; }
.icon-btn { background: none; border: none; padding: 0 8px; cursor: pointer; font-size: 1.1rem; color: #64748b; height: 100%; display: flex; align-items: center; }
.icon-btn:hover { color: #1e293b; }

.rl-date-label { 
    font-weight: 600; font-size: 0.9rem; color: #1e293b; 
    width: 140px; min-width: 140px; 
    display: flex; align-items: center; justify-content: center; text-align: center; 
    height: 100%; white-space: nowrap; padding: 0; 
}

.btn-today { 
    background: #0f172a; color: #fff; border: none; padding: 0 13px; height: 36px; 
    border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 0.85rem; 
    display: flex; align-items: center; justify-content: center; white-space: nowrap; flex-shrink: 0; 
}

/* =========================================
   3. CONTROLS
   ========================================= */
.rl-select { 
    font-family: 'Inter', system-ui, sans-serif; font-size: 0.85rem; font-weight: 600; color: #64748b;
    padding: 0 12px; border: 1px solid #e2e8f0; border-radius: 6px; height: 36px; 
    min-width: 178px; max-width: 300px; cursor: pointer; background-color: #fff; 
}

.btn-toggle { 
    background: #fff; border: 1px solid #e2e8f0; padding: 0 16px; height: 36px; border-radius: 6px; 
    font-size: 0.85rem; font-weight: 600; color: #64748b; cursor: pointer; 
    display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; flex-shrink: 0; 
}
.btn-toggle.active { background: #eff6ff; color: #3b82f6; border-color: #3b82f6; }

.view-switch { background: #f8fafc; padding: 2px; border-radius: 6px; display: flex; height: 36px; }
.view-switch button { border: none; background: none; padding: 0 12px; cursor: pointer; color: #94a3b8; font-size: 1rem; }
.view-switch button.active { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.05); border-radius: 4px; color: #3b82f6; }

.btn-primary { 
    background: #0f172a; color: #fff; border: none; padding: 0 16px; height: 36px; border-radius: 6px; 
    font-weight: 600; cursor: pointer; font-size: 0.85rem; 
    display: flex; align-items: center; justify-content: center; white-space: nowrap; flex-shrink: 0; 
}

/* =========================================
   4. TOOLBAR
   ========================================= */
.rl-toolbar-container { width: 100%; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.rl-toolbar-row { max-width: 1080px; margin: 0 auto; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; }
.rl-tz-bar-inline { display: flex; align-items: center; font-size: 0.85rem; color: #64748b; font-weight: 600; gap: 5px; }
.rl-sync-container { position: relative; }
.rl-sync-main-btn { background: #fff; border: 1px solid #cbd5e1; padding: 6px 15px; border-radius: 50px; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.rl-sync-dropdown { position: absolute; top: 110%; right: 0; width: 280px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); z-index: 100; padding: 10px; }
.rl-sync-header { padding: 10px; border-bottom: 1px solid #f1f5f9; margin-bottom: 5px; }
.rl-sync-option { display: flex; align-items: center; padding: 8px; color: #334; text-decoration: none; font-size: 0.85rem; border-radius: 6px; }
.rl-sync-option:hover { background: #f1f5f9; }
.rl-sync-icon { width: 24px; height: 24px; background: #e2e8f0; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 10px; font-weight: bold; font-size: 10px; }
.rl-sync-copy-area { background: #f8fafc; padding: 10px; margin-top: 5px; border-radius: 6px; }
.rl-input-group { display: flex; gap: 5px; margin-top: 5px; }
.rl-input-group input { flex: 1; font-size: 11px; padding: 4px; border: 1px solid #cbd5e1; border-radius: 4px; }
.rl-input-group button { background: #3b82f6; color: #fff; border: none; border-radius: 4px; font-size: 10px; padding: 0 8px; cursor: pointer; }
.click-outside-overlay { position: fixed; inset: 0; z-index: 90; }

/* =========================================
   5. CONTENT BODY
   ========================================= */
.rl-content, .sk-wrapper { max-width: 1080px !important; margin: 0 auto !important; padding: 2rem !important; width: 100%; box-sizing: border-box; }
.sk-wrapper { margin-top: 2rem !important; border: 1px solid #e2e8f0; }

/* =========================================
   6. MONTH VIEW (CALENDARIO)
   ========================================= */
.cal-grid { width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #fff; }

.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; padding: 10px 0; background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-weight: 700; font-size: 0.8rem; color: #64748b; text-transform: uppercase; }


.cal-body { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #e2e8f0; gap: 1px; }

.cal-cell { min-height: 120px; padding: 5px; background: #fff; position: relative; }
.cal-cell.off { background: #fcfcfc; opacity: 0.6; }
.day-num { font-size: 13px; font-weight: 600; margin-bottom: 5px; display: block; color: #64748b; }
.cal-cell.today .day-num { background: #ef4444; color: #fff; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* === TARJETAS DE EVENTOS (MES) - FIXED === */
/* =========================================
   TARJETAS DE EVENTOS (MES) + TOOLTIP
   ========================================= */

.ev-chip { 
    font-size: 11px; 
    padding: 3px 6px; 
    border-radius: 4px; 
    margin-bottom: 3px; 
    
    background: #fff; 
    border: 1px solid #e2e8f0; 
    color: #334155;
    
    display: flex; 
    align-items: center; 
    gap: 5px; 
    
    /* CRÍTICO: El puntero de mano */
    cursor: pointer; 
    
    width: 100%; 
    max-width: 100%; 
    box-sizing: border-box; 
    
    /* Visible para que el tooltip pueda salirse */
    overflow: visible; 
    position: relative; 
    
    min-width: 0;
    transition: all 0.1s ease;
}

/* =========================================
   ESTILO: MIS RESERVAS (Highlight)
   ========================================= */

/* Cuando el evento está reservado */
.ev-chip.is-reserved {
    background-color: #f0fdf4; /* Fondo menta muy suave */
    border-color: #86efac;     /* Borde verde pastel */
    position: relative;
}

/* El ícono del Check (✓) */
.ev-reserved-icon {
    font-size: 11px;
    font-weight: 800;
    color: #16a34a; /* Verde fuerte */
    margin-left: 4px; /* Separación del título */
    flex-shrink: 0;
}

/* Ajuste para que se vea bien con el estado LIVE */
/* Si está en vivo Y reservado, gana el Rojo (Live) porque es más urgente */
.ev-chip.is-live.is-reserved {
    background-color: #fef2f2 !important;
    border-color: #fecaca !important;
}
.ev-chip.is-live.is-reserved .ev-reserved-icon {
    color: #b91c1c; /* El check se vuelve rojo */
}

/* Ajuste para eventos pasados reservados */
.ev-chip.ev-past.is-reserved {
    opacity: 0.7;
    background-color: #f0fdf4; /* Mantiene el tono verde suave pero opaco */
    border-color: #dcfce7;
}

/* El texto se corta con puntos ... */
.ev-trunc { 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    flex-grow: 1; 
    min-width: 0; 
    font-weight: 500;
}

/* La hora fija */
.ev-time-text {
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}

/* El punto de color */
.ev-dot { 
    width: 6px; 
    height: 6px; 
    border-radius: 50%; 
    display: block; 
    flex-shrink: 0; 
}

/* === TOOLTIP ESTILIZADO === */
.ev-tooltip {
    visibility: hidden;
    opacity: 0;
    
    /* Diseño */
    background-color: #1e293b; 
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 6px 10px;
    
    /* Posición */
    position: absolute;
    bottom: 115%; 
    left: 50%;
    transform: translateX(-50%);
    
    /* Propiedades */
    z-index: 100;
    width: max-content;
    max-width: 220px; 
    white-space: normal; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    pointer-events: none; /* Importante para que el clic pase a la tarjeta */
    transition: opacity 0.2s, bottom 0.2s;
}

/* Flechita del tooltip */
.ev-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

/* Hover Effects */
.ev-chip:hover {
    border-color: #cbd5e1;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ev-chip:hover .ev-tooltip {
    visibility: visible;
    opacity: 1;
    bottom: 125%; 
}

/* ESTADO LIVE */
.ev-chip.is-live { 
    background-color: #fef2f2 !important; 
    border-color: #fecaca !important; 
    color: #b91c1c !important; 
}
.ev-chip.is-live .ev-time-text { color: #b91c1c !important; }
.ev-chip.is-live .ev-dot { 
    background-color: #ef4444 !important; 
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2); 
}

/* ESTADO PASADO */
.ev-chip.ev-past { 
    opacity: 0.6; 
    background-color: #f8fafc; 
    border-color: #f1f5f9; 
    color: #94a3b8; 
}
.ev-chip.ev-past .ev-dot { 
    filter: grayscale(100%); 
    opacity: 0.5; 
}

/* =========================================
   7. WEEK VIEW (GRID FINAL + TOOLTIPS)
   ========================================= */

.week-matrix { 
    --col-min: 0px; /* Variable Desktop: Se adapta al contenedor sin scroll */
    overflow-x: auto; 
    background: #fff; 
    border: 1px solid #e2e8f0; 
    border-radius: 8px; 
    margin-bottom: 0px; 
}

@media (max-width: 1024px) {
    .week-matrix {
        --col-min: 160px; /* Variable Móvil: Fuerza el scroll horizontal */
    }
}

/* Fila del Grid: Crece en móvil, se contiene en desktop */
.week-head-row, .matrix-row { 
    display: grid; 
    width: max-content !important; 
    min-width: 100%; 
    box-sizing: border-box;
    border-bottom: 1px solid #f1f5f9;
}

@media (min-width: 1025px) {
    .week-head-row, .matrix-row {
        width: 100% !important; /* En escritorio forzamos que no se pase de la pantalla */
    }
}

/* LA MAGIA STICKY: Columna de hora fija a la izquierda */
.matrix-label-col, .matrix-time-col {
    position: sticky;
    left: 0;
    z-index: 10;
    background: #f8fafc;
    border-right: 2px solid #e2e8f0 !important; /* Borde un poco más fuerte para separar */
}

/* Asegurar que la esquina superior izquierda (HORA) quede por encima de todo */
.matrix-label-col { 
    padding: 12px; text-align: right; font-size: 0.75rem; font-weight: 700; color: #64748b; 
    display: flex; align-items: center; justify-content: flex-end; 
    z-index: 12;
}

/* Cabecera del día */
.matrix-day-col { 
    padding: 12px; text-align: center; font-size: 0.85rem; font-weight: 600; 
    border-right: 1px solid #e2e8f0; white-space: nowrap; 
}
.matrix-day-col.today { color: #3b82f6; background: #eff6ff; }

.matrix-time-col { 
    padding: 10px; text-align: center; font-size: 0.9rem; color: #1e293b; font-weight: 800;
    border-right: 1px solid #e2e8f0; background: #f8fafc; display: flex; align-items: center; justify-content: center;
}

/* CELDA: Visible para que salga el Tooltip */
.matrix-cell { 
    border-right: 1px solid #f1f5f9; padding: 10px 8px; 
    display: flex; flex-direction: column; align-items: center; gap: 8px; 
    overflow: visible;
}
.matrix-cell.is-today-cell { background-color: rgba(239, 246, 255, 0.3); }

/* === TARJETA SEMANAL — ESTILO CHIP/PILL === */
.matrix-card { 
    border: none; border-radius: 50px; padding: 6px 12px; cursor: pointer; 
    display: inline-flex; align-items: center; justify-content: center; 
    width: max-content; 
    max-width: 100%; /* Evita que la pastilla sea más grande que su propia columna de 180px */
    box-sizing: border-box; 
    position: relative; overflow: visible; min-height: 28px; 
    font-size: 0.72rem; font-weight: 700; white-space: nowrap; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.matrix-card:hover {
    filter: brightness(0.9); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); z-index: 20;
}

/* LA MAGIA PARA QUE NO SE SALGA: Corta el texto largo con "..." */
.mc-cat-name {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Si en un futuro agregas un texto GIGANTE, se cortará con ... antes de romper la caja */
    text-align: center;
}
/* Ya no necesitamos mc-header, mc-title ni mc-cat-pill, puedes borrar esas clases del CSS si quieres limpiar código */

/* Tooltip al Hover — incluye hora */
.matrix-card:hover .ev-tooltip {
    visibility: visible;
    opacity: 1;
    bottom: 110%;
}

/* Header: solo título, sin wrapping */
.mc-header { 
    display: flex; align-items: center; gap: 5px;
    width: 100%; min-width: 0; 
}

.mc-title { 
    font-size: 0.78rem; 
    font-weight: 700;
    /* color viene desde :style (getContrastColor) */
    display: block; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    flex: 1; 
    max-width: 100%;
    line-height: 1;
    letter-spacing: -0.01em;
}

.mc-live-dot {
    width: 6px; height: 6px;
    background: currentColor;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.85;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

.mc-check { 
    font-size: 10px;
    font-weight: 900;
    flex-shrink: 0; 
    opacity: 0.85;
}

/* Ocultar hora y pill — eliminados del template */
.mc-time, .mc-cat-pill { display: none; }

/* === ESTADOS === */
.matrix-card.is-live { 
    background: #ef4444 !important;
    color: #fff !important;
    animation: live-pulse 2s infinite;
}
@keyframes live-pulse {
    0%, 100% { box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
    50% { box-shadow: 0 0 0 3px rgba(239,68,68,0.25); }
}

.matrix-card.is-reserved { 
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.15); /* Borde sutil oscuro interno */
}

.mc-check { 
    font-size: 11px;
    font-weight: 900;
    margin-right: 4px;
    flex-shrink: 0; 
}

.matrix-card.ev-past { opacity: 0.4; filter: grayscale(50%); }
.ev-past, .matrix-card.ev-past { opacity: 0.4; filter: grayscale(50%); }

/* Empty State (Aquí está) */
.empty-state { 
    padding: 40px; text-align: center; color: #64748b; 
    background: #f8fafc; border: 1px dashed #cbd5e1; 
    border-radius: 8px; font-style: italic; margin: 20px 0; 
}

/* =========================================
   PUNTO LIVE (VISTA SEMANA)
   ========================================= */

.mc-live-dot {
    width: 6px;
    height: 6px;
    background-color: #ef4444; /* Rojo vibrante */
    border-radius: 50%;
    margin-right: 6px; /* Separación con el título */
    flex-shrink: 0;    /* Evita que se aplaste */
    display: inline-block;
    
    /* Animación de pulso */
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); /* El anillo se desvanece */
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* =========================================
   8. LIST & GRID
   ========================================= */
.list-wrap.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.list-wrap.list { display: flex; flex-direction: column; gap: 15px; }
.list-card { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; background: #fff; display: flex; cursor: pointer; transition: transform 0.1s; }
.list-card:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.grid .list-card { flex-direction: column; }
.lc-img { width: 150px; background-size: cover; background-position: center; background-color: #f1f5f9; flex-shrink: 0; }
.grid .lc-img { width: 100%; height: 160px; }
.lc-body { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.lc-cat { display: inline-block; padding: 2px 6px; border-radius: 4px; color: #fff; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; margin-bottom: 5px; }
.lc-meta { font-size: 0.8rem; color: #64748b; font-weight: 600; margin: 5px 0 0 0; }

/* =========================================
   9. POPUP
   ========================================= */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.6); z-index: 9999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-card { background: #fff; width: 95%; max-width: 500px; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; max-height: 85vh; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.cover-img { width: 100%; height: 0; background-size: cover; background-color: #e2e8f0; position: relative; flex-shrink: 0; }
.edit-fab { position: absolute; bottom: 10px; right: 10px; background: #fff; border: none; padding: 6px; border-radius: 6px; cursor: pointer; z-index: 5; }
.modal-content { padding: 20px; overflow-y: auto; flex-grow: 1; }
.popup-badges { display: flex; gap: 10px; margin-bottom: 10px; }
.status-pill.reserved { background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 50px; font-size: 0.7rem; font-weight: 700; }
.popup-title { font-size: 1.4rem; margin: 0 0 10px 0; }
.popup-meta { margin-bottom: 15px; color: #64748b; font-size: 0.9rem; }
.modal-foot-sticky { padding: 15px; border-top: 1px solid #e2e8f0; background: #fff; flex-shrink: 0; }
.btn-live { background: #ef4444; color: #fff; display: block; width: 100%; text-align: center; padding: 10px; border-radius: 6px; text-decoration: none; font-weight: 700; }
.block-btn { width: 100%; padding: 10px; border-radius: 6px; font-size: 1rem; }
.reserved-actions { display: flex; gap: 10px; width: 100%; }
.btn-secondary { background: #f1f5f9; flex: 1; border: 1px solid #e2e8f0; border-radius: 6px; font-weight: 600; color: #475569; cursor: pointer; }
.btn-text-del { background: none; border: none; color: #ef4444; font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0 10px; }

/* =========================================
   MEJORA VISUAL POPUP (DESCRIPCIÓN Y BOTÓN)
   ========================================= */

/* 1. CONTENEDOR DE LA DESCRIPCIÓN (Rich Text Fix) */
.popup-desc {
    font-size: 0.95rem;     /* Letra un poco más grande y legible */
    line-height: 1.6;       /* Más espacio entre líneas */
    color: #334155;         /* Gris oscuro suave */
    padding-top: 20px;
    
}

/* Reactivar estilos para el contenido HTML (párrafos, listas, negritas) */
.popup-desc p {
    margin-bottom: 1em; /* Espacio entre párrafos */
}

.popup-desc ul, .popup-desc ol {
    margin-bottom: 1em;
    padding-left: 20px; /* Sangría para listas */
}

.popup-desc li {
    margin-bottom: 5px;
    list-style-type: disc; /* Asegura que salgan los puntitos */
}

.popup-desc strong, .popup-desc b {
    font-weight: 700;
    color: #0f172a; /* Negritas más oscuras */
}

.popup-desc a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 500;
}

/* 2. FOOTER PEGAJOSO (Sombra hacia arriba) */
.modal-foot-sticky {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
    /* Sombra suave hacia arriba para separar del contenido */
    box-shadow: 0 -4px 12px rgba(0,0,0,0.03); 
    display: flex;
    gap: 10px;
}

/* 3. BOTÓN DE ACCIÓN PRINCIPAL (Join / Reservar) */
.btn-primary.block-btn {
    width: 100%;
    padding: 12px 20px;
    background: #0f172a; /* Negro azulado elegante (o usa #3b82f6 para azul) */
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    
    /* Sombra y elevación */
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 
                0 2px 4px -1px rgba(15, 23, 42, 0.06);
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary.block-btn:hover {
    background: #1e293b; /* Un poco más claro al pasar el mouse */
    transform: translateY(-2px); /* Efecto de elevación */
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 
                0 4px 6px -2px rgba(15, 23, 42, 0.05);
}

.btn-primary.block-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* 4. BOTÓN "LIVE" (Rojo) */
.btn-live {
    background: #dc2626; /* Rojo fuerte */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: background 0.2s;
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.2);
}

.btn-live:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

/* 5. BOTÓN DESHABILITADO (Evento Pasado) */
.btn-disabled {
    background: #f1f5f9;
    color: #94a3b8;
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-weight: 600;
    cursor: not-allowed;
}

/* =========================================
   10. MOBILE (SKOOL STYLE)
   ========================================= */
.rl-mobile-dots { display: none; } 
.mobile-agenda-view { display: none; }
.empty-state-mob { text-align: center; padding: 20px; color: #94a3b8; font-style: italic; }

@media (max-width: 768px) {
    .fcom_hide_mobile { display: none !important; }
    .ev-chip { display: none !important; }
    
    .rl-header { padding: 10px 15px; flex-direction: column; gap: 10px; height: auto !important; min-height: auto !important; }
    .rl-h-left, .rl-h-right { width: 100%; justify-content: space-between; }
    .rl-nav { width: 100%; justify-content: space-between; margin-top: 5px; }
    
    /* Calendario Header */
    .cal-head { display: grid !important; grid-template-columns: repeat(7, 1fr); text-align: center; padding: 10px 0; border-bottom: none; font-weight: 700; font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; }
    
    .cal-grid { border: none; }
    .cal-body { gap: 0; border: none; background: transparent; }
    .cal-cell { aspect-ratio: 1 / 1; min-height: auto !important; height: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 5px; cursor: pointer; border: none; position: relative; }
    
    .day-num { margin: 0; font-size: 14px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 600; color: #1e293b; transition: all 0.2s ease; z-index: 2; }
    .cal-cell.is-selected .day-num { background-color: #e2e8f0; color: #0f172a; font-weight: 800; }
    .cal-cell.today .day-num { background-color: #ef4444 !important; color: #fff !important; }
    
    /* Dots */
    .rl-mobile-dots { display: flex !important; gap: 3px; justify-content: center; width: 100%; margin-top: 2px; height: 6px; }
    .mob-dot { width: 5px; height: 5px; border-radius: 50%; display: block; }
    
    /* Agenda List */
    .mobile-agenda-view { display: block; padding: 0 20px 20px 20px; background: #fff; border-top: 1px solid #f1f5f9; min-height: 200px; }
    .mob-agenda-title { font-size: 0.85rem; font-weight: 700; color: #64748b; text-transform: uppercase; margin: 20px 0 15px 0; letter-spacing: 0.5px; }
    
    .mob-card { background: #fff; border: 1px solid #e2e8f0; border-left-width: 4px; border-left-style: solid; border-radius: 8px; padding: 15px; margin-bottom: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: transform 0.1s; }
    .mob-card:active { transform: scale(0.98); }
    .mob-card h3 { margin: 0 0 5px 0; font-size: 15px; color: #1e293b; font-weight: 700; }
    .mob-card-time { font-size: 12px; color: #64748b; font-weight: 600; margin-bottom: 6px; display: block; }
    .mob-tag { display: inline-block; font-size: 10px; font-weight: 700; color: #fff; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; }
    
    .rl-toolbar-row { flex-direction: column; gap: 15px; align-items: flex-start; }
    .rl-sync-container, .rl-sync-main-btn { width: 100%; justify-content: center; }
    .rl-sync-dropdown { left: 0; right: auto; width: 100%; }
    .list-wrap.grid { grid-template-columns: 1fr; }
    .lc-img { width: 100%; height: 140px; }
}

/* =========================================
   FORM MODAL (Nuevo / Editar Evento)
   ========================================= */

/* Tamaño específico para el formulario */
.modal-card.form-ui {
    width: 100%;
    max-width: 600px; /* Un poco más ancho para que quepa bien el editor */
    max-height: 90vh; /* Altura máxima */
    display: flex;
    flex-direction: column;
}

/* Header del Modal */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.close-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
}

/* Pestañas (Detalles / Recurrencia) */
.modal-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 20px;
}

.modal-tabs button {
    background: none;
    border: none;
    padding: 12px 15px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.modal-tabs button.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* Contenido Scrollable */
.modal-content.scroll {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1; /* Ocupa el espacio restante */
}

/* Inputs y Labels */
label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    margin-top: 10px;
}
label:first-child { margin-top: 0; }

.full-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box; /* Crucial para que no se salga */
    transition: border-color 0.2s;
}

.full-input:focus {
    border-color: #3b82f6;
    outline: none;
}

/* Layout de Columnas (Inicio/Fin, Cat/Link) */
.flex-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.col-half {
    flex: 1;
}

/* Área de Carga de Imagen */
.img-up {
    margin-top: 15px;
    height: 120px;
    background-color: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    font-weight: 600;
    background-size: cover;
    background-position: center;
    transition: all 0.2s;
}

.img-up:hover {
    background-color: #e2e8f0;
    border-color: #94a3b8;
}

/* Sección de Recurrencia */
.switch-row {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.rec-box {
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.days-grid {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.days-grid label {
    padding: 6px 10px;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    margin: 0;
}

.days-grid label.sel {
    background: #3b82f6;
    color: #fff;
    border-color: #2563eb;
}

/* Footer (Botones Guardar/Eliminar) */
.modal-foot {
    padding: 15px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end; /* Alinea a la derecha */
    gap: 10px;
    flex-shrink: 0;
}

.btn-save {
    background: #0f172a;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-del {
    background: #fff;
    color: #ef4444;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-right: auto; /* Empuja el botón eliminar a la izquierda */
}

/* =========================================
   MEJORAS FORMULARIO (UX)
   ========================================= */

/* 1. FIX: Input numérico de recurrencia (Que se vea bien) */
.rec-box input[type="number"] {
    width: 70px !important;     /* Ancho fijo suficiente */
    flex-shrink: 0;             /* Evita que se aplaste */
    padding: 5px 10px;
    text-align: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

/* 2. SELECTOR DE CATEGORÍA (Pills con Color) */
.cat-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.cat-pill-opt {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 50px; /* Redondo estilo chip */
    cursor: pointer;
    font-size: 0.85rem;
    color: #64748b;
    transition: all 0.2s;
    background: #fff;
}

.cat-pill-opt:hover { background: #f8fafc; border-color: #cbd5e1; }

/* Estado Seleccionado */
.cat-pill-opt.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e293b;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.cp-dot { width: 8px; height: 8px; border-radius: 50%; }

/* 3. INPUT DE IMAGEN (URL + PREVIEW) */
.img-input-row { display: flex; gap: 10px; align-items: flex-start; }
.img-preview-box {
    width: 60px; height: 60px;
    border-radius: 6px;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

/* =========================================
   FECHA Y HORA ESTILO GOOGLE
   ========================================= */

.date-time-group {
    display: flex;
    gap: 10px;
}

/* El input de Fecha (Calendario) */
.dt-input-date {
    flex: 3; /* Ocupa más espacio */
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%2364748b" viewBox="0 0 16 16"><path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/></svg>') no-repeat right 10px center;
    cursor: pointer;
}

/* El Select de Hora (Lista) */
.dt-select-time {
    flex: 2; /* Ocupa menos espacio */
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    background-color: #fff;
    cursor: pointer;
    appearance: none; /* Quita estilo nativo feo */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="%2364748b" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.dt-select-time:focus, .dt-input-date:focus {
    border-color: #3b82f6;
    outline: none;
}


/* =========================================
   ESTILOS GOOGLE CALENDAR (UX)
   ========================================= */

/* Fila contenedora de fecha y hora */
.google-datetime-row {
    display: flex;
    align-items: center;
    gap: 8px; /* Espacio entre elementos */
    flex-wrap: wrap; /* Permite bajar si no cabe en movil */
    margin-top: 10px;
}

/* El "Chip" gris (Input simulado) */
/* El "Chip" gris (Input simulado) */
.g-input {
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.g-input:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Ajustes para la Lista de Hora (Select) */
.g-time {
    flex: 1;
    min-width: 90px;
    appearance: none; /* Quitar estilo nativo */
    
    /* TRUCO: Forzar modo claro en el dropdown para que sea blanco */
    color-scheme: light; 
    
    /* Flechita personalizada pequeña */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="%2364748b" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 20px; /* Espacio para la flecha */
}

.g-input:focus {
    background: #fff;
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Ajustes específicos para Fecha */
.g-date {
    flex: 2; /* Un poco más ancho */
    min-width: 120px;
}



/* Separador (Guión) */
.g-sep {
    color: #64748b;
    font-weight: 600;
}
/* =========================================
   SKELETON (Pantalla de Carga)
   ========================================= */

.sk-layout {
    width: 100%;
    background: transparent;
}

/* Header falso (Misma altura que el real: 52px) */
.sk-header-sticky { 
    height: 52px; 
    background: #fff; 
    border-bottom: 1px solid #e2e8f0; 
    position: sticky; 
    top: 0; 
    width: 100%; 
    z-index: 900;
}

/* Contenedor Centrado (Igual a .rl-content) */
.sk-body-centered { 
    max-width: 1080px; 
    margin: 0 auto; 
    padding: 2rem; /* Espacio lateral importante */
    width: 100%; 
    box-sizing: border-box; 
}

/* Grilla falsa */
.sk-grid { 
    display: grid; 
    grid-template-columns: repeat(7, 1fr); 
    border: 1px solid #e2e8f0; 
    border-radius: 8px; 
    overflow: hidden; 
    background: #fff; 
}

.sk-head-col { 
    height: 40px; 
    background: #f8fafc; 
    border-right: 1px solid #e2e8f0; 
    border-bottom: 1px solid #e2e8f0; 
}

.sk-cell { 
    height: 120px; 
    border-right: 1px solid #f1f5f9; 
    border-bottom: 1px solid #f1f5f9; 
    padding: 10px;
    position: relative;
}

/* Animaciones */
.sk-animate {
    animation: sk-pulse 1.5s infinite ease-in-out;
    background-color: #f1f5f9;
    border-radius: 4px;
}

.sk-badge { width: 24px; height: 24px; border-radius: 50%; margin-bottom: 10px; }
.sk-line { width: 80%; height: 12px; margin-bottom: 6px; }

@keyframes sk-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* Mobile Skeleton */
@media(max-width:768px){ 
    .sk-body-centered { padding: 10px; } /* Menos margen en celular */
    .sk-grid { display: block; border: none; } 
    .sk-head-col { display: none; } 
    .sk-cell { height: auto; padding: 15px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; gap: 10px; }
    .sk-badge { margin: 0; }
    .sk-line { width: 100%; height: 20px; margin: 0; }
}


/* =========================================
   ESTILOS EDITOR QUILL
   ========================================= */
.quill-wrapper {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
}
/* Ajuste de la barra de herramientas */
.ql-toolbar {
    border: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: #f8fafc;
}
.ql-container {
    border: none !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
}

/* === REFORZAR ESTILOS EN EL POPUP (FRONTEND) === */
/* Ajuste "WYSIWYG": Que se vea igual al editor */

.popup-desc {
    font-family: 'Inter', sans-serif;
    color: #334155;
    line-height: 1.5; /* Interlineado estándar del editor */
}

/* Párrafos: Quitamos el margen gigante para evitar el "doble enter" */
.popup-desc p { 
    margin: 0 0 0px 0 !important; /* Solo un pequeño respiro de 6px, no un salto de línea entero */
    min-height: 1em; /* Para que las líneas vacías no desaparezcan */
}

/* Listas: Ajuste para que coincidan con Quill */
.popup-desc ul, .popup-desc ol { 
    margin: 0 0 0px 0 !important; 
    padding-left: 24px !important; 
}

.popup-desc ul li { list-style-type: disc !important; padding-left: 2px; }
.popup-desc ol li { list-style-type: decimal !important; padding-left: 2px; }

/* Otros elementos */
.popup-desc a { color: #2563eb; text-decoration: underline; cursor: pointer; }
.popup-desc strong { font-weight: 700; color: #0f172a; }
.popup-desc em { font-style: italic; }
.popup-desc h1, .popup-desc h2, .popup-desc h3 { margin: 10px 0 5px 0; font-weight: 700; }


/* Contenedor Nativo de la Agenda */
#fcom-native-agenda {
    width: 100%;
    /* Usamos variables de Fluent para el fondo */
    background-color: var(--fcom-secondary-bg, #f0f0f1); 
    min-height: calc(100vh - 60px);
}

/* Ajustes para tu App dentro del entorno Fluent */


/* Tarjetas de tu agenda con estilo Fluent */
#fcom-native-agenda .cal-grid, 
#fcom-native-agenda .week-matrix,
#fcom-native-agenda .list-card {
    background: var(--fcom-primary-bg, #fff);
    border: 1px solid var(--fcom-primary-border, #e3e8ee);
    color: var(--fcom-primary-text, #19283a);
}

/* Textos en Modo Oscuro (Usando vars de Fluent) */
#fcom-native-agenda .rl-title,
#fcom-native-agenda .rl-date-label {
    color: var(--fcom-primary-text, #19283a);
}

/* Ajuste Móvil: Ocultar sidebar si es necesario */
@media (max-width: 1024px) {
    /* En móvil Fluent oculta la sidebar automáticamente, 
       así que solo aseguramos que la agenda ocupe el ancho total */
    #fcom-native-agenda {
        padding-left: 0;
    }
    #fcom-native-agenda .rl-wrapper {
        padding: 0 10px !important;
    }
}

/* Estilos para el Hero y Lista */
    .hero-container { margin-bottom: 40px; }
    .remaining-container { margin-top: 20px; }
    
    .list-card, .hero-card {
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
        overflow: hidden;
        border: 1px solid var(--fcom-border-color, #e2e8f0);
        border-radius: 12px;
        background: #fff;
        margin-bottom: 20px; /* Margen entre tarjetas */
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        cursor: pointer;
    }

   

    .hero-body, .lc-body { padding: 20px !important; }

    

    .hero-title { font-size: 1.6rem; margin: 10px 0; color: #1e293b; font-weight: 700; line-height: 1.2; }
    .hero-desc { font-size: 0.95rem; margin-top: 10px; color: #64748b; line-height: 1.5; }
    .section-title { font-size: 1.2rem; margin-bottom: 15px; color: var(--fcom-primary-text); font-weight: 600; }
    .reserved-badge { color: #10b981; font-weight: 700; display: block; margin-top: 10px; }

    /* ============================================================
   1. CONTENEDORES Y LAYOUT GENERAL
   ============================================================ */


/* Limitar ancho solo en vista de lista para lectura cómoda */
.list-container-width {
    max-width: 900px !important;
    margin: 0 auto !important;
}

/* Grid de Calendario y otros contenedores */
.cal-grid, .week-matrix, .list-wrap {
    width: 100%;
    box-sizing: border-box;
}

/* ============================================================
   2. ESTILOS DE TARJETAS (CARDS)
   ============================================================ */

/* Base de todas las tarjetas */
.list-card, .hero-card {
    background: #fff;
    border: 1px solid #e2e8f0; /* Gris suave */
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    cursor: pointer;
    box-sizing: border-box;
    margin-bottom: 20px;
}

.list-card:hover, .hero-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

/* --- HERO CARD (Destacado Arriba) --- */
.hero-card {
    display: flex;
    flex-direction: column;
}

.hero-body {
    padding: 24px;
}

.hero-title {
    font-size: 1.8rem;
    margin: 12px 0;
    color: #1e293b; /* Slate 800 */
    font-weight: 700;
    line-height: 1.2;
}

.hero-desc {
    font-size: 1rem;
    color: #64748b; /* Slate 500 */
    line-height: 1.6;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

/* --- HORIZONTAL CARD (Lista Normal) --- */
.horizontal-card {
    display: flex !important;
    flex-direction: row !important; /* Imagen izq, Texto der */
    align-items: stretch !important;
    min-height: 160px;
}

.side-cover {
    width: 260px !important;
    min-width: 260px !important;
    background-size: cover;
    background-position: center;
    border-right: 1px solid #f1f5f9;
}

.side-body {
    padding: 20px 24px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- GRID CARD (Vertical estándar) --- */
.grid .list-card {
    display: flex;
    flex-direction: column;
}

.grid .lc-body {
    padding: 16px;
}

.grid .list-card h3 {
    font-size: 1.1rem;
    margin: 8px 0;
    color: #1e293b;
    font-weight: 600;
}

/* ============================================================
   3. IMÁGENES Y PROPORCIONES
   ============================================================ */

/* Proporción Cinemática (21:9) para el Hero */
.cinematic-cover {
    width: 100%;
    aspect-ratio: 2.35 / 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}



/* ============================================================
   4. ELEMENTOS UI (PILLS, TEXTOS, BADGES)
   ============================================================ */



/* Metadatos (Fecha/Hora) */
.lc-meta {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Badge de Reservado */
.reserved-badge {
    background: #10b981; /* Verde esmeralda */
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reserved-text {
    color: #10b981;
    font-weight: 700;
    font-size: 13px;
    display: block;
    margin-top: 8px;
}

/* Títulos de Sección (ej: "Más eventos en Febrero") */
.section-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    margin-top: 40px;
    color: #334155;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    display: inline-block;
}

/* ============================================================
   5. RESPONSIVE (MÓVIL)
   ============================================================ */
@media (max-width: 768px) {
    /* En móvil, la tarjeta horizontal se vuelve vertical */
    .horizontal-card {
        flex-direction: column !important;
        height: auto !important;
    }
    
    .side-cover {
        width: 100% !important;
        min-width: 100% !important;
        height: 180px !important; /* Altura fija para la imagen en móvil */
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .hero-title {
        font-size: 1.4rem;
    }
    
    .cinematic-cover {
        aspect-ratio: 16 / 9; /* En móvil usamos 16:9 para que no sea tan delgada */
    }
    
    .list-container-width {
        max-width: 100% !important;
        padding: 0 15px;
    }
}

/* ============================================================
   1. CONTENEDORES Y LAYOUT GENERAL
   ============================================================ */


/* ANCHO CONTROLADO: 750px + Imagen 21:9 = Tarjeta compacta y elegante */
.list-container-width {
    max-width: 750px !important; 
    margin: 0 auto !important;
}

.cal-grid, .week-matrix, .list-wrap {
    width: 100%;
    box-sizing: border-box;
}

/* ============================================================
   2. ESTILOS DE TARJETAS (CARDS)
   ============================================================ */
.list-card, .hero-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    cursor: pointer;
    box-sizing: border-box;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column; /* Siempre vertical */
}

.list-card:hover, .hero-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

.hero-body, .lc-body {
    padding: 20px 24px;
}

.hero-title {
    font-size: 1.6rem;
    margin: 10px 0;
    color: #1e293b;
    font-weight: 700;
    line-height: 1.2;
}

.hero-desc {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

/* Títulos de Grid/Lista pequeña */
.list-card h3 {
    font-size: 1.1rem;
    margin: 8px 0;
    color: #1e293b;
    font-weight: 600;
}

/* ============================================================
   3. IMÁGENES Y PROPORCIONES (TODO EN 21:9)
   ============================================================ */

/* =========================================
   FIX IMÁGENES (UNIFIED COVER)
   ========================================= */
.unified-cover {
    width: 100%;
    /* Proporción Cinemática 21:9 (o usa 16/9 si prefieres más alto) */
    aspect-ratio: 21 / 9 !important; 
    
    /* LA CLAVE: Esto hace que la imagen llene todo el cuadro */
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    
    position: relative !important; /* Para que los badges se posicionen bien */
    border-radius: 12px 12px 0 0;
    margin: 0;
    padding: 0;
    display: block;
}

/* En móvil, ajustamos a 16:9 para que no se vea tan delgada */
@media (max-width: 768px) {
    .unified-cover {
        aspect-ratio: 16 / 9 !important;
    }
}

/* Ajuste específico para el Popup */
.modal-card .cover-img.unified-cover {
    border-radius: 12px 12px 0 0;
}

/* ============================================================
   4. ELEMENTOS UI
   ============================================================ */


.lc-meta {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

.reserved-badge {
    background: #10b981;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
    margin-top: 10px;
}

.reserved-text {
    color: #10b981;
    font-weight: 700;
    font-size: 13px;
    display: block;
    margin-top: 8px;
}

/* Títulos de Sección */
.section-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    margin-top: 10px; 
    color: #334155;
    font-weight: 700;
}

/* ============================================================
   5. RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .list-container-width {
        max-width: 100% !important;
        padding: 0 15px;
    }
    
    .hero-title { font-size: 1.4rem; }

    /* En móvil regresamos a 16:9 porque 21:9 es muy delgado en pantallas verticales */
    .unified-cover {
        aspect-ratio: 16 / 9 !important;
    }
}

/* ============================================================
   1. LAYOUT Y CONTENEDORES
   ============================================================ */


/* Ancho limitado para mejor lectura en lista */
.list-container-width {
    max-width: 750px !important; 
    margin: 0 auto !important;
}

.cal-grid, .week-matrix, .list-wrap { width: 100%; box-sizing: border-box; }

/* ============================================================
   2. TARJETAS (CARDS)
   ============================================================ */
.list-card, .hero-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    cursor: pointer;
    box-sizing: border-box;
    margin-bottom: 20px;
    /* Por defecto Vertical (Grid y Hero) */
    display: flex;
    flex-direction: column; 
}

.list-card:hover, .hero-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

/* --- ESTILOS ESPECÍFICOS: LISTA HORIZONTAL --- */
.horizontal-card {
    flex-direction: row !important; /* Imagen Izquierda, Contenido Derecha */
    align-items: center !important; /* Centrar verticalmente */
}

/* Imagen Lateral (Izquierda) */
.side-cover {
    width: 240px !important;       /* Ancho fijo */
    min-width: 240px !important;
    aspect-ratio: 21 / 9 !important; /* MANTENER PROPORCIÓN CINE */
    background-size: cover !important;
    background-position: center !important;
    border-right: 1px solid #f1f5f9;
    height: auto !important; 
    align-self: stretch; /* Estirar para cubrir altura si es necesario, o usar center */
}

/* Cuerpo de la tarjeta horizontal */
.horizontal-card .lc-body {
    padding: 15px 20px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- ESTILOS ESPECÍFICOS: HERO Y GRID (Verticales) --- */
.hero-body, .grid .lc-body {
    padding: 20px 24px;
}

/* Títulos */
.hero-title { font-size: 1.6rem; margin: 10px 0; color: #1e293b; font-weight: 700; line-height: 1.2; }
.hero-desc { font-size: 0.95rem; color: #64748b; line-height: 1.5; margin-top: 15px; padding-top: 15px; border-top: 1px solid #f1f5f9; }
.list-card h3 { font-size: 1.1rem; margin: 8px 0; color: #1e293b; font-weight: 600; }

/* ============================================================
   3. IMÁGENES Y PROPORCIONES (TODO 21:9)
   ============================================================ */

/* CLASE MAESTRA: Proporción Cine (Ultrawide) */



/* FIX POPUP: Asegurar que el modal también use 21:9 */
.modal-card .cover-img {
    width: 100%;
    aspect-ratio: 21 / 9 !important; /* Forzamos proporción */
    background-size: cover !important;
    background-position: center !important;
    height: auto !important; /* Sobrescribir altura fija si existía */
    border-radius: 12px 12px 0 0;
}

/* ============================================================
   4. ELEMENTOS UI
   ============================================================ */

.lc-meta { font-size: 0.9rem; color: #64748b; margin: 0; }
.reserved-badge { background: #10b981; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; text-transform: uppercase; display: inline-block; margin-top: 10px; }
.reserved-text { color: #10b981; font-weight: 700; font-size: 13px; display: block; margin-top: 8px; }
.section-title { font-size: 1.2rem; margin-bottom: 15px; margin-top: 10px; color: #334155; font-weight: 700; }

/* ============================================================
   5. RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .list-container-width { max-width: 100% !important; padding: 0 15px; }
    
    /* En móvil, la tarjeta horizontal se vuelve vertical */
    .horizontal-card { flex-direction: column !important; }
    .side-cover { width: 100% !important; border-right: none; aspect-ratio: 21 / 9 !important; }
    
    .hero-title { font-size: 1.4rem; }
}

/* ============================================================
   1. CONTENEDORES Y LAYOUT GENERAL
   ============================================================ */


/* Ancho limitado para la lista (Lectura cómoda) */
.list-container-width {
    max-width: 750px !important; 
    margin: 0 auto !important;
}

.cal-grid, .week-matrix, .list-wrap { width: 100%; box-sizing: border-box; }

/* ============================================================
   2. TARJETAS (CARDS)
   ============================================================ */
.list-card, .hero-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    cursor: pointer;
    box-sizing: border-box;
    margin-bottom: 20px;
    /* Por defecto Vertical (Grid y Hero) */
    display: flex;
    flex-direction: column; 
}

.list-card:hover, .hero-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

/* --- ESTILOS ESPECÍFICOS: LISTA HORIZONTAL (IMAGEN IZQ) --- */
.horizontal-card {
    flex-direction: row !important; /* Horizontal */
    align-items: center !important; /* IMPORTANTE: No estirar la imagen verticalmente */
    min-height: 120px; /* Altura mínima */
}

/* Imagen Lateral (Izquierda) - FIX PROPORCIÓN */
.side-cover {
    width: 280px !important;       /* Ancho fijo un poco más grande */
    min-width: 280px !important;   /* Evitar que se encoja */
    aspect-ratio: 21 / 9 !important; /* MANTENER PROPORCIÓN CINE */
    height: auto !important;       /* La altura la define el aspect-ratio, no el contenedor */
    
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    
    /* Bordes redondos SOLO a la izquierda */
    border-radius: 12px 0 0 12px !important; 
    border-right: 1px solid #f1f5f9;
    
    flex-shrink: 0; /* Prohibido aplastar la imagen */
}

/* Cuerpo de la tarjeta horizontal */
.horizontal-card .lc-body {
    padding: 15px 24px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- ESTILOS ESPECÍFICOS: HERO Y GRID (Verticales) --- */
.hero-body, .grid .lc-body {
    padding: 20px 24px;
}

/* Títulos */
.hero-title { font-size: 1.6rem; margin: 10px 0; color: #1e293b; font-weight: 700; line-height: 1.2; }
.hero-desc { font-size: 0.95rem; color: #64748b; line-height: 1.5; margin-top: 15px; padding-top: 15px; border-top: 1px solid #f1f5f9; }
.list-card h3 { font-size: 1.1rem; margin: 8px 0; color: #1e293b; font-weight: 600; }

/* ============================================================
   3. IMÁGENES Y PROPORCIONES (UNIFIED COVER: HERO/GRID/POPUP)
   ============================================================ */



/* FIX POPUP: Asegurar que el modal también use 21:9 */
.modal-card .cover-img {
    width: 100%;
    aspect-ratio: 21 / 9 !important; 
    background-size: cover !important;
    background-position: center !important;
    height: auto !important; 
    border-radius: 12px 12px 0 0;
}

/* ============================================================
   4. ELEMENTOS UI
   ============================================================ */

.lc-meta { font-size: 0.9rem; color: #64748b; margin: 0; }
.reserved-badge { background: #10b981; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; text-transform: uppercase; display: inline-block; margin-top: 10px; }
.reserved-text { color: #10b981; font-weight: 700; font-size: 13px; display: block; margin-top: 8px; }
.section-title { font-size: 1.2rem; margin-bottom: 15px; margin-top: 10px; color: #334155; font-weight: 700; }

/* ============================================================
   5. RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .list-container-width { max-width: 100% !important; padding: 0 15px; }
    
    /* En móvil, la tarjeta horizontal se vuelve vertical */
    .horizontal-card { flex-direction: column !important; align-items: stretch !important; }
    
    /* La imagen lateral se vuelve imagen superior 16:9 en móvil */
    .side-cover { 
        width: 100% !important; 
        min-width: 100% !important;
        border-right: none; 
        border-radius: 12px 12px 0 0 !important;
        aspect-ratio: 16 / 9 !important; 
    }
    
    .hero-title { font-size: 1.4rem; }
    
    /* En móvil regresamos a 16:9 para Unified también */
    .unified-cover, .modal-card .cover-img {
        aspect-ratio: 16 / 9 !important;
    }
}

/* ============================================================
   1. CONTENEDORES Y LAYOUT GENERAL
   ============================================================ */
.rl-wrapper { font-family: 'Inter', sans-serif; color: #1e293b; width: 100%; max-width: 100% !important; margin: 0 auto; overflow: visible; background: #f0f2f5 !important; margin-top: 0 !important; }

/* Ancho limitado para la lista (750px) */
.list-container-width {
    max-width: 750px !important; 
    margin: 0 auto !important;
}

.cal-grid, .week-matrix, .list-wrap { width: 100%; box-sizing: border-box; }

/* ============================================================
   2. TARJETAS (CARDS) - BASE
   ============================================================ */
.list-card, .hero-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    cursor: pointer;
    box-sizing: border-box;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column; 
}

.list-card:hover, .hero-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

/* ============================================================
   3. CONFIGURACIÓN DE VISTAS
   ============================================================ */

/* --- A. HERO CARD (Vertical Grande - 21:9) --- */
.hero-body { padding: 20px 24px; }
.hero-title { font-size: 1.6rem; margin: 12px 0; color: #1e293b; font-weight: 700; line-height: 1.2; }
.hero-desc { font-size: 0.95rem; color: #64748b; line-height: 1.5; margin-top: 15px; padding-top: 15px; border-top: 1px solid #f1f5f9; }

/* --- B. HORIZONTAL CARD (Lista Compacta) - EL FIX --- */
.horizontal-card {
    flex-direction: row !important; /* Lado a lado */
    align-items: stretch !important; /* Estirar altura al máximo */
    height: 140px; /* Altura fija para uniformidad (ajustar si quieres más alto) */
    min-height: 140px;
}

/* Imagen Lateral (Izquierda) */
.side-cover {
    width: 323px !important;         /* Ancho fijo */
    min-width: 323px !important;
    height: 100% !important;         /* Ocupa todo el alto de la tarjeta */
    
    background-size: cover !important;     /* Recorta la imagen para llenar, NO DEFORMA */
    background-position: center center !important;
    background-repeat: no-repeat !important;
    
    border-right: 1px solid #f1f5f9;
    flex-shrink: 0; 
}

/* Cuerpo de la tarjeta horizontal */
.horizontal-card .lc-body {
    padding: 15px 20px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centrar contenido verticalmente */
    min-width: 0; /* Fix para text-overflow */
}

/* NUEVO: Fila de Cabecera (Categoría + Reservado) */
.lc-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    margin-top: 10px;
    width: 100%;
}

/* --- C. GRID CARD (Vertical Pequeña) --- */
.grid .list-card { flex-direction: column; height: auto; }
.grid .lc-body { padding: 16px; }
.grid .list-card h3 { font-size: 1.1rem; margin: 8px 0; color: #1e293b; font-weight: 600; }


/* ============================================================
   4. IMÁGENES (UNIFIED COVER)
   ============================================================ */

   

/* Popup Modal */
.modal-card .cover-img {
    width: 100%;
    aspect-ratio: 21 / 9 !important;
    background-size: cover !important;
    background-position: center !important;
    height: auto !important;
    border-radius: 12px 12px 0 0;
}

/* ============================================================
   5. ELEMENTOS UI
   ============================================================ */
/* Títulos */
.list-card h3 { 
    font-size: 1.1rem; margin: 0 0 5px 0; color: #1e293b; font-weight: 700; 
    white-space: nowrap; overflow: clip; text-overflow: ellipsis; /* Cortar título largo */
}

/* Categoría Pill (Ancho automático) */
.lc-cat.pill {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 10px; /* Un poco más pequeño para compactar */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    width: fit-content; /* IMPORTANTE: No ocupar todo el ancho */
}

/* Texto Reservado Inline (Lado derecho) */
.reserved-inline {
    font-size: 11px;
    color: #16a34a; /* Verde */
    font-weight: 700;
    background: #f0fdf4;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Badges grandes (Hero) */
.reserved-badge { background: #10b981; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; text-transform: uppercase; display: inline-block; margin-top: 10px; }

.lc-meta { font-size: 0.85rem; color: #64748b; margin: 0; }
.section-title { font-size: 1.2rem; margin-bottom: 15px; margin-top: 10px; color: #334155; font-weight: 700; }
.empty-state { padding: 40px; text-align: center; color: #64748b; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px; margin: 20px 0; }


/* ============================================================
   6. RESPONSIVE (MÓVIL)
   ============================================================ */
@media (max-width: 768px) {
    .list-container-width { max-width: 100% !important; padding: 0 15px; }
    
    /* En móvil, la tarjeta horizontal vuelve a ser vertical */
    .horizontal-card { 
        flex-direction: column !important; 
        height: auto !important;
    }
    
    /* La imagen lateral pasa arriba */
    .side-cover { 
        width: 100% !important; 
        min-width: 100% !important;
        border-right: none; 
        border-bottom: 1px solid #f1f5f9;
        aspect-ratio: 16 / 9 !important; 
        height: auto !important;
    }
    
    .unified-cover, .modal-card .cover-img { aspect-ratio: 16 / 9 !important; }
    
    .hero-title { font-size: 1.4rem; }
    
    /* Ajustes generales */
    .fcom_hide_mobile { display: none !important; }
    .rl-header { flex-direction: column; height: auto; padding: 10px; gap: 10px; }
    .mobile-agenda-view { display: block; padding: 20px; }
    .cal-head { display: grid; grid-template-columns: repeat(7, 1fr); }
    .cal-cell { aspect-ratio: 1/1; min-height: auto; }
}

/* ============================================================
   7. EXTRAS (MODAL FORM, HEADER, ETC - Mantener de antes)
   ============================================================ */
/* (Puedes dejar el resto de estilos de Modal y Header que ya tenías, 
   o copiar los bloques 6, 7, 8, 9 de la respuesta anterior si los borraste) */
/* ... Inserta aquí el resto de tu CSS si falta algo ... */
/* Por brevedad, he enfocado los cambios en la sección de Tarjetas */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.6); z-index: 9999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-card { background: #fff; width: 95%; max-width: 600px; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; max-height: 90vh; }
.edit-fab { position: absolute; bottom: 10px; right: 10px; background: #fff; border: none; padding: 6px; border-radius: 6px; cursor: pointer; z-index: 5; }
.modal-content { padding: 20px; overflow-y: auto; flex-grow: 1; }
.popup-badges { display: flex; gap: 10px; margin-bottom: 10px; }
.popup-title { font-size: 1.4rem; margin: 0 0 10px 0; font-weight: 700; }
.modal-foot-sticky { padding: 15px; border-top: 1px solid #e2e8f0; background: #fff; flex-shrink: 0; display: flex; gap: 10px; }
.btn-primary.block-btn { width: 100%; padding: 12px 20px; background: #0f172a; color: #fff; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; }
.btn-live { background: #dc2626; color: #fff; width: 100%; padding: 12px; border-radius: 8px; font-weight: 700; text-align: center; text-decoration: none; }
.btn-disabled { background: #f1f5f9; color: #94a3b8; width: 100%; padding: 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-weight: 600; cursor: not-allowed; }
.btn-secondary { background: #f1f5f9; flex: 1; border: 1px solid #e2e8f0; border-radius: 6px; font-weight: 600; color: #475569; cursor: pointer; }
.btn-text-del { background: none; border: none; color: #ef4444; font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0 10px; }
.status-pill.reserved { background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 50px; font-size: 0.7rem; font-weight: 700; }
.popup-desc { font-size: 0.95rem; line-height: 1.6; color: #334155; padding-top: 10px; }
/* Fluent Integrations */
.is-layout-constrained > #core-app, .entry-content > #core-app { max-width: 100% !important; margin: 0 !important; width: 100% !important; }
#fcom-native-agenda { width: 100%; background-color: var(--fcom-secondary-bg, #f0f0f1); min-height: calc(100vh - 60px); }
/* Flatpickr */
.flatpickr-calendar { border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border: 1px solid #e2e8f0; font-family: 'Inter', sans-serif; }
.flatpickr-day.selected { background: #3b82f6 !important; border-color: #3b82f6 !important; }

/* ============================================================
   4. TOOLTIP (RESTAURADO)
   ============================================================ */
.ev-tooltip {
    visibility: hidden;
    opacity: 0;
    background-color: #1e293b;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 6px 10px;
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: max-content;
    max-width: 220px;
    font-size: 11px;
    font-weight: 500;
    pointer-events: none;
    transition: opacity 0.2s, bottom 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Flechita del Tooltip */
.ev-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

/* Mostrar al Hover */
.ev-chip:hover .ev-tooltip,
.matrix-card:hover .ev-tooltip {
    visibility: visible;
    opacity: 1;
    bottom: 125%;
}

/* ============================================================
   ESTILOS DE BLOQUEO (OVERLAY) Y BADGES
   ============================================================ */

.unified-cover, .side-cover {
    position: relative !important;
}

/* 1. BADGES (Esquina Superior Derecha) */
.cover-badges {
    position: absolute;
    top: 12px;   /* Más separado del borde (antes 8px) */
    right: 12px; /* Más separado del borde */
    display: flex;
    gap: 6px;
    z-index: 30; /* Encima del overlay */
}

.badge-icon {
    width: 28px; height: 28px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 2. OVERLAY DE BLOQUEO (Capa Oscura + Blur) */
.locked-overlay {
    position: absolute;
    inset: 0; /* Cubre todo el padre (top, right, bottom, left: 0) */
    background: rgba(15, 23, 42, 0.6); /* Color Slate oscuro semitransparente */
    backdrop-filter: blur(3px); /* Efecto vidrio esmerilado */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: inherit; /* Hereda las esquinas redondas de la imagen */
}

/* El Icono del Candado Central */
.lock-svg-center {
    width: 48px;
    height: 48px;
    stroke: #ffffff;
    stroke-width: 1.5;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); /* Sombra para resaltar */
    opacity: 0.9;
}

/* ============================================================
   FIX: BOTONES POPUP ENCIMA DEL OVERLAY
   ============================================================ */
.close-icon-w, 
.edit-fab {
    z-index: 50 !important; /* Mayor que el overlay (20) y badges (30) */
}

/* ============================================================
   ICONOS SVG VISTA (SWITCHER)
   ============================================================ */
.view-switch button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px; /* Ajuste de padding */
}

.view-switch button svg {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
    transition: stroke 0.2s ease;
}

/* Estado Inactivo (Gris) */
.view-switch button:not(.active) svg {
    stroke: #94a3b8; 
}

/* Estado Activo (Azul) */
.view-switch button.active svg {
    stroke: #3b82f6;
}

/* Ajuste móvil */
@media (max-width: 768px) {
    .view-switch button { padding: 4px 8px; }
    .view-switch button svg { width: 18px; height: 18px; }
}

/* ============================================================
   ESTILOS DE ASISTENTES (FACEPILE)
   ============================================================ */

.attendees-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 15px 0; /* Separación vertical */
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

/* Contenedor de las caritas */
.face-pile {
    display: flex;
    align-items: center;
    /* Truco para que no se vea espacio extra a la izquierda */
    padding-left: 5px; 
}

/* Cada círculo de foto */
.face-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff; /* Borde blanco para separar */
    margin-left: -10px; /* Superposición negativa */
    background: #e2e8f0; /* Color de fondo mientras carga */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    z-index: 1;
}

/* El primero no debe tener margen negativo */
.face-circle:first-child {
    margin-left: 0;
    z-index: 5;
}
.face-circle:nth-child(2) { z-index: 4; }
.face-circle:nth-child(3) { z-index: 3; }

/* Texto (+15 Asistentes) */
.attendees-text {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 600;
}

.attendees-text strong {
    color: #0f172a;
    font-weight: 700;
}

/* ============================================================
   UX: CURSOR DE CLIC (MANITO)
   ============================================================ */

/* 1. Tarjetas de Lista, Grid y Hero */
.list-card, 
.hero-card,
.horizontal-card, 
.standard-card {
    cursor: pointer !important;
}

/* 2. Chips del Calendario (Mes) */
.ev-chip {
    cursor: pointer !important;
}

/* 3. Tarjetas de la Semana (Matriz) */
.matrix-card {
    cursor: pointer !important;
}

/* 4. Tarjetas de la Agenda Móvil */
.mob-card {
    cursor: pointer !important;
}

/* ============================================================
   BOTONES UNIFICADOS Y COHERENTES (MODAL FOOTER)
   ============================================================ */

/* 1. Contenedor del Footer */
.modal-foot-sticky {
    display: flex;
    gap: 10px;
    padding-top: 15px;
}

/* 2. Estilo Base para TODOS los botones (<a> y <button>) */
.modal-foot-sticky button,
.modal-foot-sticky a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px; /* Altura generosa y consistente */
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700; /* Texto grueso para mejor lectura */
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Efecto de clic */
.modal-foot-sticky button:active,
.modal-foot-sticky a:active {
    transform: scale(0.98);
}

/* --- VARIANTES DE COLOR --- */

/* A. DISPONIBLE (Reservar) - Azul */
.btn-primary {
    background-color: #07183c;
    color: #ffffff;
}
.btn-primary:hover {
    background-color: #193062;
    color: #fff;
}

/* B. LIVE (En Vivo) - Rojo Intenso */
.btn-live {
    background-color: #dc2626 !important; /* Rojo fuerte */
    color: #ffffff !important; /* TEXTO BLANCO (Fix contraste) */
    animation: pulse-red 2s infinite;
}
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* C. RESERVADO (Éxito) - Verde Sólido */
.reserved-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.btn-success {
    background-color: #10b981; /* Verde Esmeralda */
    color: #ffffff;
    flex: 1; /* Ocupa la mayoría del espacio */
    cursor: default; /* No parece clickeable porque es estado */
}

/* Botón Cancelar (Secundario) */
.btn-cancel {
    background-color: #fee2e2; /* Rojo muy pálido */
    color: #991b1b; /* Texto rojo oscuro */
    width: auto !important; /* Solo el ancho necesario */
    padding: 0 20px;
}
.btn-cancel:hover { background-color: #fecaca; }

/* D. BLOQUEADO / PASADO - Gris */
.btn-disabled {
    background-color: #f1f5f9 !important;
    color: #94a3b8 !important;
    border: 1px solid #e2e8f0 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* =========================================
   BOTÓN SINCRONIZAR (Clean Pill Style - Sin Icono)
   ========================================= */

.rl-sync-main-btn {
    /* Reset total para evitar el verde del tema */
    background-color: #ffffff !important; 
    background-image: none !important;
    color: #475569 !important; /* Gris oscuro elegante */
    
    /* Estructura */
    border: 1px solid #e2e8f0 !important; 
    border-radius: 50px !important; /* Forma de píldora */
    padding: 8px 24px !important; /* Un poco más de padding lateral */
    
    /* Tipografía */
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    font-family: 'Inter', sans-serif !important;
    text-transform: none !important; 
    letter-spacing: normal !important;
    line-height: 1 !important;
    
    /* Posicionamiento */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    
    /* Animación y Sombra */
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

/* Aseguramos que NO haya icono */
.rl-sync-main-btn::before {
    content: none !important;
    display: none !important;
}

/* === ESTADO HOVER (AL PASAR EL MOUSE) === */
.rl-sync-main-btn:hover {
    background-color: #eff6ff !important; /* Azul muy suave */
    color: #2563eb !important; /* Azul fuerte */
    border-color: #bfdbfe !important; /* Borde azul suave */
    
    transform: translateY(-1px); /* Pequeña elevación */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

/* === ESTADO ACTIVE (AL HACER CLIC) === */
.rl-sync-main-btn:active {
    transform: translateY(0);
    background-color: #dbeafe !important;
    box-shadow: none !important;
}


/* =========================================
   SELECTOR DE ZONA HORARIA (DISEÑO SUTIL & SLIM)
   ========================================= */
.rl-tz-bar-inline {
    display: flex;
    align-items: center;
    gap: 6px; /* Menos espacio entre icono y texto */
    
    background: #fff !important; /* Forzamos blanco */
    border: 1px solid #e2e8f0;
    
    /* Hacemos la barra más bajita y sutil */
    padding: 2px 8px; 
    height: 32px; /* Altura fija controlada */
    
    border-radius: 6px; /* Bordes menos redondos (más técnico) */
    font-size: 0.8rem; /* Texto un poco más pequeño */
    color: #64748b;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

/* El Icono SVG */
.rl-tz-svg {
    width: 14px;
    height: 14px;
    color: #94a3b8; /* Gris suave */
    flex-shrink: 0;
}

.rl-tz-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Botón disparador (El texto que se ve) */
.rl-tz-trigger {
    /* Reset agresivo para matar el estilo del tema */
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 4px !important;
    margin: 0 !important;
    
    /* Tipografía */
    font-family: 'Inter', sans-serif !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #334155 !important; /* Gris oscuro */
    
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ESTADO HOVER (AL PASAR EL MOUSE) */
/* Aseguramos que NO se ponga verde, solo cambie el texto a azul */
.rl-tz-trigger:hover,
.rl-tz-trigger:focus,
.rl-tz-trigger:active {
    background: transparent !important;
    background-color: transparent !important;
    color: #2563eb !important; /* Azul profesional */
    box-shadow: none !important;
    transform: none !important;
}

/* El Menú Flotante (Dropdown) */
.rl-tz-dropdown-menu {
    position: absolute;
    top: 130%; /* Un poco más separado */
    left: -10px; /* Alineado */
    width: 280px;
    max-height: 300px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Resto del buscador y lista (igual que antes) */
.rl-tz-search { padding: 8px; border-bottom: 1px solid #f1f5f9; background: #f8fafc; }
.rl-tz-search input { width: 100%; padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 0.8rem; outline: none; }
.rl-tz-list { overflow-y: auto; flex: 1; padding: 4px 0; }
.rl-tz-item { padding: 6px 12px; font-size: 0.8rem; color: #334155; cursor: pointer; display: flex; justify-content: space-between; }
.rl-tz-item:hover { background: #eff6ff; color: #1e293b; }
.rl-tz-item.active { background: #dbeafe; color: #1e40af; font-weight: 600; }
.rl-tz-item span.offset { color: #94a3b8; font-size: 0.7rem; }

/* Reloj a la derecha */
.rl-tz-clock {
    padding-left: 8px;
    margin-left: 4px;
    border-left: 1px solid #e2e8f0;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.8rem;
    color: #3b82f6; 
}

/* =========================================
   FIX EMOJIS GIGANTES (WordPress + Quill)
   ========================================= */

/* Forzar que los emojis de WP sean del tamaño del texto */
img.emoji, 
.ql-editor img.emoji {
    display: inline !important;
    border: none !important;
    box-shadow: none !important;
    height: 1em !important;
    width: 1em !important;
    margin: 0 0.07em !important;
    vertical-align: -0.1em !important;
    background: none !important;
    padding: 0 !important;
    
    /* Evitar que otras reglas los estiren */
    max-width: 1em !important; 
    min-width: 1em !important; 
}

/* =========================================
   BOTÓN CERRAR MODAL (Estilo Flotante Moderno)
   ========================================= */

.close-icon-w {
    /* Posicionamiento */
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 60 !important; /* Encima de todo */
    
    /* Tamaño y Forma */
    width: 32px;
    height: 32px;
    border-radius: 50%;
    
    /* ESTILO VISUAL (Aquí está la magia) */
    background-color: rgba(255, 255, 255, 0.95) !important; /* Blanco casi puro */
    backdrop-filter: blur(4px); /* Efecto vidrio sutil */
    color: #1e293b !important; /* Icono gris oscuro (Slate 800) */
    border: 1px solid rgba(0,0,0,0.05) !important; /* Borde muy sutil */
    
    /* SOMBRA (Clave para fondos claros) */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    
    /* Centrado del Icono */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Efecto Hover (Al pasar el mouse) */
.close-icon-w:hover {
    transform: scale(1.1); /* Crece un poquito */
    background-color: #ffffff !important;
    color: #ef4444 !important; /* Se pone rojo al querer cerrar */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2) !important;
}

/* Ajuste del SVG interno */
.close-icon-w svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5px; /* Líneas un poco más gorditas */
    display: block;
}


/* =========================================
   FIX EMOJIS GIGANTES (ANTI-TEMA)
   ========================================= */

/* Apuntamos a cualquier imagen cuya fuente contenga la palabra "emoji" */
.ql-editor img[src*="emoji"],
.popup-desc img[src*="emoji"],
img[src*="s.w.org/images/core/emoji"] {
    width: 1.2em !important;      /* Tamaño de letra + un poquito */
    height: 1.2em !important;
    max-width: none !important;   /* Anular regla del tema */
    min-width: 0 !important;
    
    display: inline-block !important; /* Que no rompa la línea */
    vertical-align: middle !important; /* Centrado con el texto */
    
    border: none !important;
    box-shadow: none !important;  /* Quitar sombras del tema */
    margin: 0 0.1em !important;   /* Pequeño espacio lateral */
    padding: 0 !important;
    background: transparent !important;
}

/* BOTONES MINI DENTRO DEL UPLOADER */
.btn-mini-up {
    background: #fff;
    border: 1px solid #cbd5e1;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-mini-up:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #94a3b8;
}

/* =========================================
   NUEVO UPLOADER (ESTILO DASHBOARD)
   ========================================= */

/* Contenedor Principal (Caja Punteada) */
.img-up-container {
    position: relative;
    width: 100%;
    height: 140px;
    background-color: #e9ecef; /* Gris azulado suave */
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    margin-bottom: 10px;
    overflow: hidden;
}

/* Botones Oscuros */
.img-actions {
    display: flex;
    gap: 10px;
    z-index: 5;
}

.btn-dark {
    background: #0f172a; /* Azul muy oscuro / Negro */
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-dark:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

/* Botón cerrar imagen (X roja/blanca) */
.close-img-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 10;
}
.close-img-btn:hover { background: #ef4444; }

/* Overlay de carga */
.uploading-overlay {
    position: absolute;
    background: rgba(255,255,255,0.9);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    color: #3b82f6;
}

/* GALERÍA DESPLEGABLE */
.mini-gallery-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.mg-head {
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 10px; 
    font-size: 0.8rem; 
    font-weight: 700; 
    color: #64748b;
}
.mg-head button { border: none; background: none; cursor: pointer; color: #94a3b8; }
.mg-head button:hover { color: #ef4444; }

.mg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}
.mg-item {
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}
.mg-item:hover { transform: scale(1.02); }



/* =========================================
   FIX TOOLTIP CORTADO (SUPERPOSICIÓN)
   ========================================= */

/* 1. Al pasar el mouse sobre el evento, quitamos los límites */
.ev-chip:hover {
    overflow: visible !important; /* Permite que el tooltip salga */
    z-index: 100 !important;      /* Trae este evento al frente de los demás */
}

/* 2. Aseguramos que el tooltip flote encima de todo */
.ev-tooltip {
    /* Posición y Capas */
    position: absolute !important;
    z-index: 9999 !important; /* El número más alto posible */
    
    /* Ubicación (Arriba y Centrado) */
    bottom: calc(100% + 8px) !important; /* 8px arriba del evento */
    left: 50% !important;
    transform: translateX(-50%) !important;
    
    /* Dimensiones */
    width: max-content !important; /* Que se adapte al texto */
    max-width: 250px !important;   /* Pero que no sea infinito */
    white-space: normal !important; /* Permitir varias líneas de texto */
    
    /* Estética (Mejor lectura sobre otros elementos) */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

/* 3. La flechita del tooltip (opcional, para que se vea bien) */
.ev-tooltip::after {
    content: " ";
    position: absolute;
    top: 100%; /* Justo debajo del tooltip */
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent; /* Color oscuro (Slate 800) */
}


/* =========================================
   FIX TOOLTIP CORTADO (SOLUCIÓN DEFINITIVA)
   ========================================= */

/* 1. ROMPER LOS LÍMITES: Obligar a los padres a no cortar el contenido */
.rl-content, 
.cal-grid, 
.cal-body, 
.cal-cell {
    overflow: visible !important; /* Clave: permite que los hijos "se salgan" */
    transform: none !important;   /* Clave: 'transform' crea un contexto que atrapa elementos, lo quitamos */
    z-index: auto !important;     /* Evitar guerras de capas innecesarias */
}

/* 2. ELEVAR EL EVENTO AL CIELO: Al pasar el mouse, este evento debe estar encima de TODO */
.ev-chip:hover {
    position: relative !important; 
    z-index: 10000 !important; /* Un número exageradamente alto */
    overflow: visible !important;
}

/* 3. TOOLTIP FLOTANTE */
.ev-tooltip {
    /* Asegurar que flote libremente */
    position: absolute !important;
    z-index: 10001 !important; /* Uno más que el chip */
    
    /* Prevenir que se rompa el texto */
    width: max-content !important;
    max-width: 280px !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    
    /* Sombra fuerte para separarlo del fondo si pasa sobre otros textos */
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5) !important;
}

/* OPCIONAL: Si el tooltip choca con el borde SUPERIOR de la pantalla */
/* Esto detecta si está en la primera fila y lo manda para abajo */
.cal-cell:nth-child(-n+7) .ev-tooltip {
    bottom: auto !important;
    top: calc(100% + 5px) !important; /* Moverlo abajo del evento */
}
.cal-cell:nth-child(-n+7) .ev-tooltip::after {
    top: auto !important;
    bottom: 100% !important; /* Flecha arriba */
    border-color: transparent transparent #1e293b transparent !important;
}

/* =========================================
   1. FIX MODAL (CAPA SUPREMA)
   ========================================= */
/* El modal debe estar SIEMPRE encima de todo, incluso de los tooltips */
.modal-overlay {
    z-index: 99999 !important; /* Nivel Dios */
    /* Esto asegura que el mouse no active eventos debajo */
    pointer-events: auto; 
}

/* =========================================
   2. FIX TOOLTIP (CORTE Y POSICIÓN)
   ========================================= */

/* Contenedor del evento: Nivel alto, pero MENOR que el modal */
.ev-chip:hover {
    overflow: visible !important;
    z-index: 5000 !important; /* Alto, pero menos que el modal (99999) */
}

.ev-tooltip {
    position: absolute !important;
    z-index: 5001 !important;
    
    /* Ubicación Estándar */
    bottom: calc(100% + 10px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    
    /* FIX CORTE: Ancho más controlado */
    width: max-content !important;
    max-width: 180px !important; /* Antes era 250px, reducimos para evitar cortes */
    min-width: 150px !important;
    
    /* Estética */
    white-space: normal !important; /* Permite que el texto baje de línea */
    text-align: center;
    line-height: 1.3 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
    
    /* Evita que el propio tooltip interfiera con el mouse */
    pointer-events: none; 
}

/* =========================================
   3. FIX PANTALLAS PEQUEÑAS (MEDIA QUERIES)
   ========================================= */

/* Si la pantalla es pequeña (Tablet/Laptop pequeña) */
@media (max-width: 1024px) {
    .ev-tooltip {
        /* Movemos el tooltip un poco a la izquierda para que no se salga por la derecha */
        left: 0 !important;
        transform: none !important;
        
        /* O alineación derecha si prefieres */
        /* right: 0 !important; left: auto !important; */
        
        max-width: 180px !important; /* Más estrecho para que quepa */
    }
    
    /* Ajuste de la flechita para que siga al tooltip */
    .ev-tooltip::after {
        left: 20px !important; /* Ajustamos la flecha a la izquierda */
        margin-left: 0 !important;
    }
}

/* Si es la última columna (Sábado), forzar tooltip hacia la izquierda */
/* Esto evita que se corte en el borde derecho de la pantalla */
.cal-cell:nth-child(7n) .ev-tooltip {
    left: auto !important;
    right: 0 !important;
    transform: none !important;
}
.cal-cell:nth-child(7n) .ev-tooltip::after {
    left: auto !important;
    right: 20px !important; /* Flecha a la derecha */
}

/* =========================================
   FIX FONDO GRIS GLOBAL (Tema BuddyBoss)
   ========================================= */
#content.site-content,
#content {
    background-color: #f0f2f5 !important;
}

/* =========================================
   FIX SCROLL HORIZONTAL (Solo para Desktop)
   ========================================= */
@media (min-width: 1025px) {
    .week-matrix {
        overflow-x: hidden !important; /* Mata el scroll horizontal en PC */
        width: 100% !important;
    }
    .week-head-row, .matrix-row {
        width: 100% !important; /* Obliga a la cuadrícula a no pasarse de la pantalla */
        min-width: 0 !important; 
    }
}

/* =========================================
   FIX MENÚ CONTEXTUAL (DARK MODE)
   ========================================= */
.rl-context-menu {
    position: absolute;
    z-index: 9999999 !important; 
    background: #1e293b; /* Fondo oscuro elegante */
    border: 1px solid #334155; 
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    width: 190px;
    padding: 5px 0;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

.rcm-header {
    padding: 8px 15px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    background: #0f172a; /* Cabecera negra */
    border-bottom: 1px solid #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.rcm-item {
    padding: 8px 15px;
    font-size: 0.85rem;
    color: #f1f5f9; /* Texto claro */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.rcm-item:hover { background: #334155; color: #ffffff; }
.rcm-item.danger { color: #fca5a5; }
.rcm-item.danger:hover { background: #7f1d1d; color: #fecaca; }
.rcm-divider { height: 1px; background: #334155; margin: 4px 0; }

/* Tostadas de Notificación */
.rl-clipboard-toast, .rl-paste-success-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0f172a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 9999999;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}
.rcm-toast-close { background: none; border: none; color: #fff; cursor: pointer; font-size: 1rem; opacity: 0.7; }
.rcm-toast-close:hover { opacity: 1; }

/* =========================================
   UX: MODO PEGAR EVENTO (BOTÓN EXPLÍCITO)
   ========================================= */

/* Cuando copiamos algo, el calendario avisa que está en modo edición */
.cal-grid.can-paste {
    border: 2px dashed #818cf8 !important; /* Borde azul punteado */
}

.cal-grid.can-paste .cal-cell:not(.off) {
    background-color: #f8fafc; /* Fondo un poco más oscuro para resaltar */
}

/* El Botón explícito de Pegar (Zona de Aterrizaje) */
.paste-btn-inline {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 8px;
    padding: 6px;
    
    /* Diseño tipo "Dropzone" (Sutil) */
    background: #e0e7ff; 
    color: #4f46e5;      
    border: 1px dashed #818cf8;
    border-radius: 6px;
    
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

/* Efecto al pasar el mouse por el botón de pegar */
.paste-btn-inline:hover {
    background: #4f46e5;
    color: #ffffff;
    border: 1px solid #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}