.calendar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.days-header {
    display: grid;
    grid-template-columns: 80px repeat(6, 1fr);
    background-color: var(--primary-color);
    color: white;
}

.day-column {
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 80px repeat(6, 1fr);
    border: 1px solid var(--border-color);
}

.time-slot {
    padding: 0.15rem;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    min-height: 24px;
    background-color: var(--grid-color);
    position: relative;
    display: flex;
    gap: 2px;
    align-items: center;
}

.time-label {
    text-align: right;
    padding-right: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
    font-size: 0.85rem;
}

.appointment {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.15rem;
    border-radius: 3px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
}

.appointment:hover {
    transform: scale(1.02);
}

.appointment.active {
    background-color: var(--secondary-color);
    box-shadow: 0 0 0 2px var(--secondary-color);
    z-index: 2;
}

.available-slot {
    background-color: rgba(52, 152, 219, 0.3) !important;
    border: 2px solid rgba(52, 152, 219, 0.5);
}

.excluded-slot {
    background-color: rgba(231, 76, 60, 0.3) !important;
    border: 2px solid rgba(231, 76, 60, 0.5);
}

.employee-1 {
    background-color: #3498db;
}

.employee-2 {
    background-color: #e74c3c;
}

.employee-legend {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.legend-item:hover {
    background-color: #f0f0f0;
}

.legend-item.legend-active {
    background-color: #e8f4fd;
    font-weight: 600;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.tooltip {
    position: fixed;
    background: white;
    padding: 0.75rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 0.85rem;
    max-width: 250px;
    z-index: 1000;
    display: none;
    pointer-events: none;
}

.lock-btn {
    cursor: pointer;
    font-size: 0.7rem;
    margin-left: 2px;
    opacity: 0.6;
    flex-shrink: 0;
}

.lock-btn:hover {
    opacity: 1;
}

.lock-btn.locked {
    opacity: 1;
}

.appointment.locked {
    border: 2px solid #f39c12;
    box-shadow: inset 0 0 0 1px rgba(243, 156, 18, 0.3);
}

.drop-target {
    background-color: rgba(46, 213, 115, 0.2) !important;
    border: 1px dashed rgba(46, 213, 115, 0.6) !important;
}

.drop-hover {
    background-color: rgba(46, 213, 115, 0.4) !important;
    border: 1px solid rgba(46, 213, 115, 0.8) !important;
}

@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 60px repeat(6, 1fr);
    }

    .days-header {
        grid-template-columns: 60px repeat(6, 1fr);
    }

    .overlay-grid {
        grid-template-columns: 60px repeat(6, 1fr);
    }

    .time-label {
        font-size: 0.8rem;
        padding-right: 0.25rem;
    }

    .appointment {
        font-size: 0.75rem;
    }

    .day-column {
        font-size: 0.8rem;
        padding: 0.25rem;
    }
}