/* ==========================================================================
   TomoTurnos — Calendar Grid (cl-grid directive)
   ========================================================================== */

/* ── Wrapper ─────────────────────────────────────────────── */
.turno-grid-wrap {
    background-color: white;
    padding-top: 10px;
}

/* En desktop, vistas de 1-2 columnas se centran con ancho acotado */
@media (min-width: 768px) {
    .turno-grid-wrap--narrow {
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ── Flex column container (replaces Bootstrap .row) ─────── */
.turno-cols-wrap {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
}

/* ── Individual column (replaces .col-xs-*) ──────────────── */
.turno-col {
    flex-shrink: 0;
    min-width: 0;
    overflow: hidden;
}

/* ── Time slot unit (replaces inner .row) ────────────────── */
.turno-slot {
    margin-bottom: 4px;
}

/* ── Navigation header ───────────────────────────────────── */
.turno-grid-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 4px 8px;
    gap: 6px;
}

.turno-nav-arrow {
    font-size: 18px;
    color: var(--color-text-body, #475569);
    padding: 4px 8px;
    flex-shrink: 0;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.turno-nav-arrow:hover {
    color: var(--color-primary, #3498db);
    text-decoration: none;
}

.turno-nav-arrow--disabled {
    opacity: 0.2;
    cursor: default;
    pointer-events: none;
}

.turno-grid-service {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.turno-service-badge {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: normal;
    white-space: normal;
    text-align: left;
    background: #e8f4f8;
    color: var(--color-text-main, #334155);
    padding: 4px 10px;
    border-radius: var(--radius-pill, 50px);
    max-width: 320px;
}

/* ── Admin service dropdown ──────────────────────────────── */
.turno-service-dropdown-wrap {
    display: block;
    width: 100%;
}

.turno-service-badge--block {
    display: flex;
    width: 100%;
    max-width: none;
    justify-content: center;
    box-sizing: border-box;
}

.turno-service-dropdown {
    min-width: 320px;
    white-space: normal;
}

/* ── View switcher ───────────────────────────────────────── */
.turno-view-switcher {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    align-items: center;
}

.turno-view-divider {
    width: 1px;
    background: rgba(0, 0, 0, 0.18);
    align-self: stretch;
    margin: 2px 3px;
}

.turno-view-btn {
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm, 4px);
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: white;
    color: var(--color-text-muted, #53647a);
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    min-width: 24px;
    text-align: center;
}

.turno-view-btn:hover {
    border-color: var(--color-primary, #3498db);
    color: var(--color-primary, #3498db);
    background: #f0f8ff;
}

.turno-view-btn.active {
    background: var(--color-primary, #3498db);
    color: white;
    border-color: var(--color-primary, #3498db);
}

/* ── Date headers row ────────────────────────────────────── */
.turno-date-headers {
    margin-top: 8px;
    margin-bottom: 4px;
}

.headerGrid {
    margin-top: 0;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
    font-weight: bold;
    font-size: 14px !important;
    text-align: center;
    color: var(--color-text-main, #334155);
    cursor: pointer;
    line-height: 1.25;
    word-break: break-word;
    white-space: pre-line;
}

/* ── Column panels ───────────────────────────────────────── */
.panelGrid {
    padding-left: 18px;
    padding-right: 18px;
}

@media (max-width: 767px) {
    .panelGrid {
        padding-left: 1px;
        padding-right: 1px;
    }
}

@media (max-width: 480px) {

    /* En pantallas pequeñas (iPhone SE) el switcher baja a su propia fila */
    .turno-grid-nav {
        flex-wrap: wrap;
        padding-bottom: 8px;
    }

    .turno-view-switcher {
        order: 10;
        width: 100%;
        justify-content: center;
        padding-top: 6px;
        border-top: 1px solid var(--color-border-card, #eaeaea);
        margin-top: 2px;
    }
}

/* ── Time label row ──────────────────────────────────────── */
.turno-time-label {
    text-align: center;
    height: 19px;
}

/* ── Progress bar tags ───────────────────────────────────── */
.tagCalendar {
    font-size: 80%;
    position: absolute;
    top: 0px;
    left: 1px;
    max-width: 90%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ── Corner triangles (fixed/variable slot indicator) ────── */
.green-triangle {
    width: 8px;
    height: 8px;
    background-color: green;
    display: inline-block;
    clip-path: polygon(0% 100%, 100% 100%, 100% 0%);
}

.red-triangle {
    width: 8px;
    height: 8px;
    background-color: red;
    display: inline-block;
    clip-path: polygon(0% 100%, 100% 100%, 100% 0%);
}

/* ── Icon container (webcam / link) ─────────────────────── */
.imageVert {
    display: inline-block;
}

.imageVert img {
    margin: 0px auto;
    display: block;
}

/* ── GROUPED BY TIME VIEW ────────────────────────────────── */
.turno-grouped-view {
    padding: 0;
}

/* panelGrid en vistas agrupadas: usar padding mínimo en todos los tamaños */
.turno-grouped-view .panelGrid {
    padding-left: 2px;
    padding-right: 2px;
}

@media (max-width: 767px) {
    .turno-grouped-view {
        padding: 0;
    }
    .turno-grouped-view .panelGrid {
        padding-left: 1px;
        padding-right: 1px;
    }
}

.turno-grouped-row {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    padding: 10px 4px;
    border-radius: var(--radius-sm, 4px);
}

/* Header row del panel (primera fila de cada bloque = cabecera de fechas) */
.turno-trans-block .turno-grouped-row:first-child {
    padding-bottom: 3px;
}

/* Rayas alternas en filas de datos de ambas vistas panel */
.turno-panel-row--alt {
    background: #c8c8c8;
}

.turno-grouped-time-cell {
    flex-shrink: 0;
    width: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-right: 2px;
}

.turno-grouped-hour {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-main, #334155);
    line-height: 1;
}

.turno-grouped-min {
    font-size: 9px;
    color: var(--color-text-muted, #53647a);
    line-height: 1;
}

.turno-grouped-day-head {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.turno-grouped-day-cell {
    flex: 1;
    min-width: 0;
}

.turno-grouped-bar {
    height: 28px !important;
    margin-bottom: 0 !important;
    position: relative;
    display: block;
}

.turno-grouped-placeholder {
    height: 28px;
    background: #64748b;
    border-radius: var(--radius-sm, 4px);
    overflow: hidden;
    opacity: 0.75;
}

/* ── Custom controls bar ─────────────────────────────────── */
.turno-custom-controls {
    display: flex;
    justify-content: center;
    padding: 0 8px 10px 8px;
}

/* ── TRANSPOSED VIEW — filas=días, columnas=horarios ─────── */
.turno-transposed-view {
    overflow-x: auto;
}

.turno-trans-header-row,
.turno-trans-day-row {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    padding: 10px 4px;
    flex-wrap: nowrap;
    border-radius: var(--radius-sm, 4px);
}

.turno-trans-corner,
.turno-trans-day-label {
    flex-shrink: 0;
    width: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-right: 2px;
}

/* Separador entre bloques cuando hay más horarios que viewCols */
.turno-trans-block {
    margin-bottom: 14px;
}

.turno-trans-time-head {
    flex: 1;
    min-width: 36px;
    text-align: center;
    padding: 0 2px;
}

.turno-trans-time-cell {
    flex: 1;
    min-width: 36px;
    padding: 0 2px;
}

.turno-trans-header-row,
.turno-trans-day-row {
    width: 100%;
}

@media (max-width: 767px) {
    .turno-trans-time-head,
    .turno-trans-time-cell {
        min-width: 28px;
    }
}

/* Pantallas normales (≥480px): más espacio entre slots en vistas panel */
@media (min-width: 480px) {
    .turno-grouped-row,
    .turno-trans-header-row,
    .turno-trans-day-row {
        padding-top: 9px;
        padding-bottom: 9px;
    }
    .turno-trans-block .turno-grouped-row:first-child {
        padding-bottom: 3px;
    }
    .turno-grouped-view .panelGrid {
        padding-left: 4px;
        padding-right: 4px;
    }
    .turno-trans-time-head,
    .turno-trans-time-cell {
        padding-left: 4px;
        padding-right: 4px;
    }
}

/* ── Tag filter ──────────────────────────────────────────── */
.turno-tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 8px 8px 8px;
    justify-content: center;
}

.turno-tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-pill, 50px);
    border: 1.5px solid;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    background: white;
    user-select: none;
}

.turno-tag-pill.active {
    color: white !important;
}

/* ── Selector de agenda (cliente, múltiples servicios) ───── */
.turno-servicio-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 12px 12px 12px;
}

.turno-servicio-item {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-md, 6px);
    border: 1.5px solid var(--color-border-card, #eaeaea);
    background: white;
    color: var(--color-text-main, #334155);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.turno-servicio-item:hover,
.turno-servicio-item:focus {
    background: #f0f8ff;
    border-color: var(--color-primary, #3498db);
    color: var(--color-primary, #3498db);
    text-decoration: none;
}

.turno-servicio-item.active {
    background: var(--color-primary, #3498db);
    border-color: var(--color-primary, #3498db);
    color: white;
    font-weight: 600;
}