/* ===== disponibilidad.css v3 — grilla semanal ===== */

/* -----------------------------------------------------------------------
   ROOT: col principal + sidebar
------------------------------------------------------------------------ */
.disp-root {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 18px;
    align-items: start;
}

@media (max-width: 900px) {
    .disp-root { grid-template-columns: 1fr; }
    .disp-side { order: -1; }
}

/* -----------------------------------------------------------------------
   CABECERA — controles: switch + leyenda + botón
------------------------------------------------------------------------ */
.disp-grid-head.ui-module-head {
    flex-wrap: wrap;
    gap: 14px;
}

.disp-head-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.disp-modalidad-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.disp-control-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}

/* (leyenda eliminada — los colores del switch son suficientes)

.disp-save-wrap {
    display: flex;
    align-items: center;
}

/* Botón apagado cuando no hay cambios */
.js-disp-save:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* -----------------------------------------------------------------------
   CUERPO: scroll horizontal en pantallas pequeñas
------------------------------------------------------------------------ */
.disp-grid-body {
    padding: 0 20px 20px;
    overflow-x: auto;
}

/* -----------------------------------------------------------------------
   TABLA SEMANAL
------------------------------------------------------------------------ */
.disp-week-table {
    width: 100%;
    min-width: 560px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.disp-week-table .disp-th-hora {
    width: 64px;
    min-width: 64px;
}

.disp-th-dia {
    text-align: center;
    padding: 0 4px 14px;
    font-weight: 900;
    color: var(--text);
    vertical-align: bottom;
}

.disp-th-dia-label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}

.disp-th-dia-short { display: none; }

/* Checkbox "Todo el día" */
.disp-col-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}

.disp-col-toggle input {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    opacity: 0;
    pointer-events: none;
}

.disp-col-toggle span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--stroke-strong);
    background: rgba(255,255,255,.04);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: all var(--transition);
}

.disp-col-toggle:hover span {
    border-color: rgba(91,170,224,.35);
    background: rgba(91,170,224,.07);
    color: var(--text);
}

.disp-col-toggle input:checked + span {
    background: rgba(91,170,224,.15);
    border-color: rgba(91,170,224,.45);
    color: var(--text);
}

/* Fila de hora */
.disp-tr { height: 48px; }

.disp-tr:hover .disp-td {
    background: rgba(255,255,255,.018);
}

.disp-th-hora {
    text-align: right;
    padding-right: 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    vertical-align: middle;
    border-bottom: 1px solid var(--stroke);
}

thead .disp-th-hora { border-bottom: 0; }

/* Celda */
.disp-td {
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--stroke);
    border-left: 1px solid var(--stroke);
    transition: background var(--transition);
    position: relative;
}

.disp-td:last-child { border-right: 1px solid var(--stroke); }

/* -----------------------------------------------------------------------
   COLORES POR MODALIDAD
   Virtual    → naranja (#f97316)
   Telefónica → azul    (#19aadb)
------------------------------------------------------------------------ */
:root {
    --disp-virtual:    #f97316;
    --disp-telefonica: #19aadb;
}

.disp-td.is-active.is-virtual {
    background: color-mix(in srgb, var(--disp-virtual) 14%, transparent);
}

.disp-td.is-active.is-telefonica {
    background: color-mix(in srgb, var(--disp-telefonica) 14%, transparent);
}

.disp-tr:hover .disp-td.is-active.is-virtual {
    background: color-mix(in srgb, var(--disp-virtual) 20%, transparent);
}

.disp-tr:hover .disp-td.is-active.is-telefonica {
    background: color-mix(in srgb, var(--disp-telefonica) 20%, transparent);
}

/* -----------------------------------------------------------------------
   CHECKBOX DE SLOT — ocupa toda la celda
------------------------------------------------------------------------ */
.disp-slot-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 48px;
    cursor: pointer;
}

.disp-slot-label input[type="checkbox"] {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    opacity: 0;
    pointer-events: none;
}

/* Check visual */
.disp-slot-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1.5px solid var(--stroke-strong);
    background: rgba(255,255,255,.04);
    transition: all var(--transition);
    flex-shrink: 0;
}

.disp-slot-check::after {
    content: '';
    display: block;
    width: 10px;
    height: 6px;
    border-left: 2.5px solid transparent;
    border-bottom: 2.5px solid transparent;
    transform: rotate(-45deg) translate(1px, -1px);
    transition: border-color var(--transition);
}

.disp-slot-label:hover .disp-slot-check {
    border-color: rgba(91,170,224,.55);
    background: rgba(91,170,224,.08);
}

/* Check activo — color según modalidad de la celda */
.disp-td.is-virtual .disp-slot-label input:checked + .disp-slot-check {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--disp-virtual) 90%, #0b1730),
        color-mix(in srgb, var(--disp-virtual) 52%, transparent));
    border-color: color-mix(in srgb, var(--disp-virtual) 72%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--disp-virtual) 16%, transparent);
}

.disp-td.is-telefonica .disp-slot-label input:checked + .disp-slot-check {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--disp-telefonica) 90%, #0b1730),
        color-mix(in srgb, var(--disp-telefonica) 52%, transparent));
    border-color: color-mix(in srgb, var(--disp-telefonica) 72%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--disp-telefonica) 16%, transparent);
}

/* Tick blanco en ambos casos */
.disp-td.is-active .disp-slot-label input:checked + .disp-slot-check::after {
    border-color: #fff;
}

/* -----------------------------------------------------------------------
   SIDEBAR — RESUMEN
------------------------------------------------------------------------ */
.disp-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.disp-summary-card {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 16px 20px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg, 16px);
    background: rgba(255,255,255,.03);
}

.disp-summary-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.disp-summary-item strong {
    font-size: 28px;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
}

.disp-summary-item span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}

.disp-summary-divider {
    width: 1px;
    height: 40px;
    background: var(--stroke);
    flex-shrink: 0;
    margin: 0 4px;
}

/* -----------------------------------------------------------------------
   SIDEBAR — BLOQUEOS
------------------------------------------------------------------------ */
.disp-side-head.ui-module-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.disp-bloqueos-body {
    padding: 0 18px 18px;
}

.disp-bloqueos-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.disp-bloqueo-row {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    transition: background var(--transition);
}

.disp-bloqueo-row:hover { background: rgba(255,255,255,.06); }

.disp-fecha-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 9px;
    background: rgba(232,100,100,.10);
    border: 1px solid rgba(232,100,100,.20);
    flex-shrink: 0;
}

.disp-fecha-badge strong {
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    color: var(--text);
}

.disp-fecha-badge span {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
}

.disp-bl-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.disp-bl-dia {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.disp-bl-motivo {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -----------------------------------------------------------------------
   ESTADO VACÍO
------------------------------------------------------------------------ */
.disp-empty {
    padding: 18px;
    border: 1px dashed var(--stroke-strong);
    border-radius: 10px;
    color: var(--text-muted);
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255,255,255,.02);
}

/* -----------------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------------------ */
@media (max-width: 700px) {
    .disp-th-dia-label { display: none; }
    .disp-th-dia-short { display: block; font-size: 12px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
    .disp-th-hora { width: 50px; min-width: 50px; font-size: 11px; padding-right: 8px; }
    .disp-tr { height: 42px; }
    .disp-slot-label { min-height: 42px; }
    .disp-slot-check { width: 18px; height: 18px; border-radius: 5px; }
    .disp-slot-check::after { width: 8px; height: 5px; }
    .disp-head-controls { width: 100%; }
}

/* -----------------------------------------------------------------------
   LIGHT MODE
------------------------------------------------------------------------ */
body.light .disp-td { background: #fff; }
body.light .disp-td.is-active.is-virtual    { background: color-mix(in srgb, var(--disp-virtual)    10%, #fff); }
body.light .disp-td.is-active.is-telefonica { background: color-mix(in srgb, var(--disp-telefonica) 10%, #fff); }
body.light .disp-tr:hover .disp-td { background: rgba(20,30,60,.025); }
body.light .disp-summary-card,
body.light .disp-bloqueo-row { background: rgba(255,255,255,.72); border-color: rgba(20,30,60,.10); }
