.cal-overlay {
    position: fixed;
    inset: 0;
    background: var(--popup-color-overlay);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-caja {
    background: var(--popup-color-superficie);
    color: var(--popup-color-texto);
    border-radius: var(--reset-border-radius);
    box-shadow: var(--popup-sombra-media);
    padding: 40px;
    width: 450px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    font-family: var(--fuente-texto);
}

.cal-cerrar {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    box-shadow: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--popup-color-texto);
    padding: 4px;
}

.cal-cerrar:hover {
    background: none;
    transform: none;
}

.cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cal-nav-btn {
    background: none;
    border: none;
    box-shadow: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--popup-color-texto);
    padding: 4px 10px;
}

.cal-nav-btn:hover {
    background: none;
    color: var(--COLOR-NARANJA);
    transform: none;
}

.cal-titulo {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: var(--letter-spacing);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
    text-align: center;
}

.cal-dia-nombre {
    font-size: 11px;
    color: color-mix(in srgb, var(--popup-color-texto) 50%, transparent);
    padding: 4px 0;
    font-weight: 600;
    border-bottom: 1px solid #ffffff1a;
}

.cal-dia {
    padding: 6px 2px;
    border-radius: var(--reset-border-radius);
    font-size: 13px;
    cursor: default;
    position: relative;
    line-height: 2.5;
}

.cal-dia.tiene-inst {
    cursor: pointer;
    background: color-mix(in srgb, var(--COLOR-NARANJA) 15%, transparent);
}

.cal-dia.tiene-inst:hover {
    background: color-mix(in srgb, var(--COLOR-NARANJA) 30%, transparent);
}

.cal-dia.es-hoy {
    background: var(--COLOR-NARANJA);
    color: #000;
    font-weight: 700;
}

.cal-dia.es-hoy.tiene-inst {
    background: var(--COLOR-NARANJA);
}

.cal-punto {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--COLOR-NARANJA);
    margin: 2px auto 0;
}

.cal-dia.es-hoy .cal-punto {
    background: #000;
}

.cal-divisor {
    border: none;
    border-top: 1px solid color-mix(in srgb, var(--popup-color-texto) 15%, transparent);
    margin: 16px 0;
}

.cal-lista {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cal-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--reset-border-radius);
    background: color-mix(in srgb, var(--COLOR-NARANJA) 8%, transparent);
    text-decoration: none;
    color: var(--popup-color-texto);
    font-size: 13px;
    transition: background 0.15s;
}

.cal-item:hover {
    background: color-mix(in srgb, var(--COLOR-NARANJA) 20%, transparent);
}

.cal-item-hora {
    color: var(--COLOR-NARANJA);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    min-width: 42px;
}

.cal-item-ref {
    font-weight: 500;
}

.cal-dia.seleccionado {
    outline: 2px solid var(--COLOR-NARANJA);
}

.cal-item-pendiente {
    background: color-mix(in srgb, var(--COLOR-AZUL) 20%, transparent);
}

.cal-item-pendiente:hover {
    background: color-mix(in srgb, var(--COLOR-AZUL) 35%, transparent);
}

.cal-dia.tiene-pendiente:not(.tiene-inst) {
    background: color-mix(in srgb, var(--COLOR-AZUL) 20%, transparent);
    cursor: pointer;
}

.cal-dia.tiene-pendiente:not(.tiene-inst):hover {
    background: color-mix(in srgb, var(--COLOR-AZUL) 40%, transparent);
}

.cal-punto-pendiente {
    background: var(--COLOR-AZUL-CLARO1);
}

.cal-dia.tiene-finalizada:not(.tiene-inst):not(.tiene-pendiente) {
    background: color-mix(in srgb, #3ecf5f 15%, transparent);
    cursor: pointer;
}

.cal-dia.tiene-finalizada:not(.tiene-inst):not(.tiene-pendiente):hover {
    background: color-mix(in srgb, #3ecf5f 30%, transparent);
}

.cal-punto-finalizada {
    background: #3ecf5f;
}

.cal-item-finalizada {
    background: color-mix(in srgb, #3ecf5f 10%, transparent);
}

.cal-item-finalizada:hover {
    background: color-mix(in srgb, #3ecf5f 25%, transparent);
}

.cal-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.cal-item-hora {
    font-size: 0.8rem;
}