/* =====================================================
   personal-vacaciones.css
   Estilos para las secciones de vacaciones y horas
   extras en personaltrabajador.html
   ===================================================== */

/* ─── COLOR VACACIONES (violeta) ─── */
:root {
    --vac-color: #8b5cf6;
    --vac-light: #ede9fe;
    --vac-dark:  #7c3aed;
}

/* ─── QUICK ACTION — Vacaciones ─── */
.qa-vacaciones .qa-icon {
    background: var(--vac-light);
    color: var(--vac-color);
}

/* ─── BANNER VACACIONES ─── */
.vac-banner {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--vac-color);
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
    animation: fadeInDown 0.4s ease;
}

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

.vac-banner:active { transform: scale(0.985); }

.vac-banner-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--vac-light);
    color: var(--vac-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.vac-banner-content { flex: 1; min-width: 0; }

.vac-banner-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.35rem;
}

.vac-banner-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vac-banner-track {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}

.vac-banner-fill {
    height: 100%;
    background: var(--vac-color);
    border-radius: 99px;
    transition: width 0.6s ease;
}

.vac-banner-nums {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.vac-banner-stat { text-align: center; }

.vac-banner-stat-num {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
}

.vac-banner-stat-num.used { color: var(--vac-color); }
.vac-banner-stat-num.rest { color: var(--success-green); }

.vac-banner-stat-lbl {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.vac-banner-chevron {
    color: var(--text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Aviso "en vacaciones ahora" */
.vac-now-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--vac-light);
    color: var(--vac-color);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 50px;
    margin-top: 0.3rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.7; }
}

/* ─── MODAL CALENDARIO ─── */
.pv-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.pv-modal-card {
    background: var(--bg-white);
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.pv-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--vac-color), var(--vac-dark));
    color: white;
    flex-shrink: 0;
}

.pv-modal-head-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.3rem;
}

.pv-modal-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
}

.pv-modal-year {
    display: block;
    font-size: 0.78rem;
    opacity: 0.8;
}

.pv-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.pv-close-btn:active { background: rgba(255,255,255,0.4); }

/* Resumen bar */
.pv-resumen-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.25rem;
    background: var(--vac-light);
    flex-shrink: 0;
}

.pv-resumen-item {
    flex: 1;
    text-align: center;
}

.pv-resumen-num {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.pv-resumen-num.pv-used  { color: var(--vac-color); }
.pv-resumen-num.pv-rest  { color: var(--success-green); }
.pv-resumen-num.pv-total { color: var(--text-muted); }

.pv-resumen-lbl {
    font-size: 0.68rem;
    color: var(--vac-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.pv-resumen-divider {
    width: 1px;
    height: 36px;
    background: rgba(139,92,246,0.25);
}

/* Barra progreso */
.pv-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1.25rem 0.75rem;
    background: var(--vac-light);
    flex-shrink: 0;
}

.pv-progress-track {
    flex: 1;
    height: 8px;
    background: rgba(139,92,246,0.2);
    border-radius: 99px;
    overflow: hidden;
}

.pv-progress-fill {
    height: 100%;
    background: var(--vac-color);
    border-radius: 99px;
    transition: width 0.7s ease;
}

.pv-progress-pct {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--vac-color);
    min-width: 34px;
    text-align: right;
}

/* Selector año */
.pv-year-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-light);
    flex-shrink: 0;
}

.pv-year-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid var(--border-light);
    background: var(--bg-white);
    color: var(--text-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.pv-year-btn:active {
    background: var(--vac-color);
    color: white;
    border-color: var(--vac-color);
}

/* Scroll del calendario */
.pv-calendar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    -webkit-overflow-scrolling: touch;
}

.pv-cal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

/* Mes */
.pv-month {
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.pv-month-name {
    background: #f1f5f9;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-gray);
    text-align: center;
    padding: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--border-light);
}

/* Si hay vacaciones en este mes */
.pv-month.has-vac .pv-month-name {
    background: var(--vac-light);
    color: var(--vac-color);
}

.pv-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.pv-wd {
    text-align: center;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.pv-wd.weekend { color: #fca5a5; }

.pv-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    padding: 1px;
    background: var(--border-light);
}

.pv-day {
    background: white;
    text-align: center;
    font-size: 0.68rem;
    padding: 4px 1px;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    font-weight: 500;
    color: var(--text-gray);
}

.pv-day.empty     { background: transparent; }
.pv-day.weekend   { color: #d1d5db; }
.pv-day.today     { background: #dbeafe; color: var(--primary-blue); font-weight: 800; border-radius: 50%; }

/* Días de vacaciones */
.pv-day.vac {
    background: var(--vac-light);
    color: var(--vac-color);
    font-weight: 700;
}

.pv-day.vac.start  { border-radius: 50% 2px 2px 50%; }
.pv-day.vac.end    { border-radius: 2px 50% 50% 2px; }
.pv-day.vac.mid    { border-radius: 0; }
.pv-day.vac.single { border-radius: 50%; }

/* Estado pendiente — rayas */
.pv-day.vac.pendiente {
    background: repeating-linear-gradient(
        45deg,
        #fef3c7,
        #fef3c7 3px,
        #fde68a 3px,
        #fde68a 6px
    );
    color: #92400e;
}

/* ─── LISTA DE PERÍODOS ─── */
.pv-periodos-section {
    border-top: 1px solid var(--border-light);
    padding: 0.85rem 1rem 1.25rem;
    flex-shrink: 0;
    background: var(--bg-white);
}

.pv-periodos-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pv-periodos-title i { color: var(--vac-color); }

.pv-periodos-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 160px;
    overflow-y: auto;
}

.pv-periodo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    background: #f8fafc;
    border-radius: 9px;
    border-left: 3px solid var(--vac-color);
}

.pv-periodo.pendiente { border-left-color: var(--hrs-color); background: #fffbeb; }
.pv-periodo.rechazada { border-left-color: var(--error-red); background: #fff5f5; opacity: 0.75; }

.pv-periodo-dates {
    flex: 1;
    min-width: 0;
}

.pv-periodo-range {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
}

.pv-periodo-tipo {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.pv-periodo-dias {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--vac-color);
    text-align: right;
    flex-shrink: 0;
}

.pv-periodo-estado {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
}

.pv-estado-aprobada  { background: #d1fae5; color: #065f46; }
.pv-estado-pendiente { background: #fef3c7; color: #92400e; }
.pv-estado-rechazada { background: #fee2e2; color: #991b1b; }

.pv-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pv-empty i {
    font-size: 1.75rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.3;
}

/* ─── RESPONSIVE: tablet+ ─── */
@media (min-width: 600px) {
    .pv-modal-backdrop { align-items: center; }
    .pv-modal-card {
        max-width: 480px;
        border-radius: 16px;
        max-height: 85vh;
    }
    .pv-cal-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ─── BANNER GUARDIAS ─── */
.grd-banner {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    border-left: 4px solid #0ea5e9;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    animation: fadeInDown 0.4s ease;
}

.grd-banner-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #e0f2fe;
    color: #0ea5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.grd-banner-icon.grd-active {
    background: #fee2e2;
    color: #ef4444;
    animation: pulseRed 2s infinite;
}

.grd-banner-icon.grd-done {
    background: #f1f5f9;
    color: #94a3b8;
}

@keyframes pulseRed {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.35); }
    50%       { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

.grd-banner-content { flex: 1; min-width: 0; }

.grd-banner-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.2rem;
}

.grd-banner-dates {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.grd-now-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #fee2e2;
    color: #ef4444;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 50px;
}

.grd-now-pill i { font-size: 0.55rem; }

.grd-next-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 50px;
}

.grd-banner-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.grd-banner-count {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0ea5e9;
    line-height: 1;
}

.grd-banner-count-lbl {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* =====================================================
   ESTILOS GUARDIAS GLOBALES — personal-vacaciones.css
   ===================================================== */

/* ─── Botón "Ver todas" dentro del banner ─── */
.grd-ver-todas-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: #f0f9ff;
    border: 1.5px solid #bae6fd;
    color: #0369a1;
    border-radius: 10px;
    padding: 0.45rem 0.65rem;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.grd-ver-todas-btn i { font-size: 1rem; }
.grd-ver-todas-btn:active { background: #bae6fd; }

/* ─── Aviso personal "Tu siguiente guardia" ─── */
.mi-guardia-aviso {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
    border-radius: var(--radius, 12px);
    padding: 0.75rem 1rem;
    margin: 0 1rem 0.75rem;
    animation: fadeInDown 0.4s ease;
}
.mi-guardia-aviso.mi-guardia-activa {
    background: #fff1f2;
    border-color: #fecdd3;
    border-left-color: #ef4444;
}
.mga-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #dcfce7;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.mi-guardia-activa .mga-icon {
    background: #fee2e2;
    color: #ef4444;
}
.mga-texto {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.mga-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #15803d;
}
.mi-guardia-activa .mga-label { color: #b91c1c; }
.mga-fecha {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Modal todas las guardias ─── */
.mga-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.mga-modal-card {
    background: var(--bg-white, #fff);
    width: 100%;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}
.mga-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #0ea5e9, #0369a1);
    color: white;
    flex-shrink: 0;
    gap: 0.75rem;
}
.mga-modal-head-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.4rem;
}
.mga-modal-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
}
.mga-modal-sub {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
}
.mga-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem 1.5rem;
    -webkit-overflow-scrolling: touch;
}

/* ─── Etiqueta de año ─── */
.mga-anio-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 0 0.3rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 0.4rem;
}

/* ─── Fila de guardia ─── */
.mga-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.4rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.mga-row-activa {
    background: #fff1f2;
    border-color: #fecdd3;
}
.mga-row-mia {
    background: #f0f9ff;
    border-color: #bae6fd;
}
.mga-row-pasada {
    opacity: 0.55;
}
.mga-row-icon {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.mga-row-activa .mga-row-icon { background: #fee2e2; color: #ef4444; }
.mga-row-mia    .mga-row-icon { background: #e0f2fe; color: #0ea5e9; }

.mga-yo-dot {
    position: absolute;
    top: -3px; right: -3px;
    width: 9px; height: 9px;
    background: #0ea5e9;
    border-radius: 50%;
    border: 2px solid white;
}

.mga-row-info { flex: 1; min-width: 0; }
.mga-row-nombre {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.mga-yo-badge {
    background: #0ea5e9;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 50px;
}
.mga-row-fechas {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 1px;
}

.mga-row-right { flex-shrink: 0; }

/* ─── Badges de estado ─── */
.mga-estado {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
}
.mga-estado-activa  { background: #fee2e2; color: #991b1b; }
.mga-estado-futura  { background: #e0f2fe; color: #0369a1; }
.mga-estado-pasada  { background: #f1f5f9; color: #94a3b8; }

/* ─── Estado vacío ─── */
.mga-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #94a3b8;
}
.mga-empty i { font-size: 2rem; display: block; margin-bottom: 0.75rem; opacity: 0.3; }

/* ─── Tablet+ ─── */
@media (min-width: 600px) {
    .mga-modal-backdrop { align-items: center; }
    .mga-modal-card { max-width: 480px; border-radius: 16px; max-height: 85vh; }
}
