/* ============================================================
   CALENDARIO SEMANAL — Design v2.0
   ============================================================ */
.calendar-container {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background-color: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
}

.calendar-header .calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.calendar-header .calendar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-full-height {
    height: 95vh;
    display: flex;
    flex-direction: column;
}

.card-full-height .card-body {
    flex-grow: 1;
    overflow: hidden;
}

.calendar-grid-container {
    height: 100%;
    overflow-y: auto;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 55px repeat(7, 1fr);
    grid-template-rows: auto;
    min-width: 900px;
}

.calendar-day-header {
    text-align: center;
    padding: 0.75rem 0.25rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    border-left: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    background-color: var(--bg-card);
    z-index: 10;
    letter-spacing: 0.02em;
}

.calendar-day-header:first-child {
    border-left: none;
}

.calendar-day-header small {
    color: var(--text-muted);
    font-weight: 500;
}

/* Día actual resaltado */
.calendar-day-header.bg-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: white !important;
    border-bottom-color: var(--primary-dark) !important;
}

.calendar-day-header.bg-primary small {
    color: rgba(255, 255, 255, 0.8) !important;
}

.time-slot-header {
    position: sticky;
    top: 0;
    background-color: var(--bg-card);
    z-index: 10;
    border-bottom: 2px solid var(--border-color);
}

.time-slot-label {
    grid-column: 1 / 2;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
    top: -0.5em;
    border-right: 1px solid var(--border-light);
    padding-right: 0.25rem;
    letter-spacing: 0.02em;
}

.calendar-day-column {
    position: relative;
    border-left: 1px solid var(--border-light);
    height: 840px;
}

.calendar-day-column:first-child {
    border-left: none;
}

.hour-line-bg {
    position: absolute;
    width: 100%;
    border-top: 1px solid var(--border-light);
    z-index: 1;
}

.time-grid {
    grid-column: 2 / -1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.hour-row {
    grid-column: 1 / -1;
    height: 60px;
    border-top: 1px solid var(--border-light);
}

.hour-row:first-child {
    border-top: none;
}


/* ── Tarjetas de Turno ── */
.turno-card {
    position: absolute;
    left: 3px;
    right: 3px;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    z-index: 5;
    transition: all var(--transition-base);
    border: none;
    box-shadow: var(--shadow-xs);
    color: white;
}

.turno-card:hover {
    z-index: 6;
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
    filter: brightness(1.05);
}

.turno-card .turno-title {
    font-weight: 700;
    font-size: 0.78rem;
}

.turno-card .turno-details {
    font-size: 0.7rem;
    opacity: 0.85;
}

/* ── Colores de Estado ── */
.turno-card[data-estado="reservado"] {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.turno-card[data-estado="confirmado"] {
    background: linear-gradient(135deg, #10b981, #059669);
}

.turno-card[data-estado="cancelado"] {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.turno-card[data-estado="asistio"] {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.turno-card[data-estado="no_asistio"] {
    background: linear-gradient(135deg, #64748b, #475569);
}

.turno-card[data-estado="disponible"] {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1.5px dashed var(--border-color);
    box-shadow: none;
}

.turno-card[data-estado="disponible"]:hover {
    background: var(--primary-bg);
    border-color: var(--primary-light);
    color: var(--primary);
}

/* Botón de eliminación rápida en tarjetas disponibles */
.btn-delete-quick {
    position: absolute;
    top: 2px;
    right: 2px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--transition-fast);
    opacity: 0.4;
}

.btn-delete-quick:hover {
    color: var(--danger);
    transform: scale(1.2);
    opacity: 1;
}

.turno-card:hover .btn-delete-quick {
    opacity: 0.7;
}

.turno-card {
    position: relative;
    /* Asegurar que el botón se posicione relativo a la tarjeta */
}