body {
    font-family: system-ui, Arial;
    background: #f7f7f7;
    margin: 0;
    padding: 20px;
    color: #222;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

h1 {
    margin: 0 0 12px;
    font-size: 22px;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}

.calendar {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    table-layout: fixed;
    /* 👈 ogni colonna si ridimensiona proporzionalmente */
}

.calendar th,
.calendar td {
    padding: 4px;
    text-align: center;
    border: 1px solid #f0f0f0;
    font-size: 14px;
    word-wrap: break-word;
}

.calendar td {
    height: 80px;
    /* altezza adattabile */
    vertical-align: top;
}

.day {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.date-num {
    font-weight: 700;
    font-size: 14px;
}

.booked {
    background: #ffe5e5;
    color: #d00;
    border-radius: 6px;
    padding: 2px 4px;
    font-size: 12px;
}

.available {
    color: #090;
    font-size: 12px;
}

.today {
    outline: 2px solid #2b7cff;
    border-radius: 4px;
}

.selected-range {
    background: #cce5ff !important;
    border-radius: 6px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    align-items: center;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.dot.red {
    background: #d00;
}

.dot.green {
    background: #090;
}

.dot.blue {
    background: #2b7cff;
}

/* 📱 Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 18px;
    }

    .calendar th,
    .calendar td {
        font-size: 12px;
        height: 60px;
        padding: 2px;
    }

    .date-num {
        font-size: 12px;
    }

    .booked,
    .available {
        font-size: 11px;
        padding: 1px 3px;
    }

    .btn {
        font-size: 13px;
        padding: 5px 8px;
    }
}

@media (max-width: 480px) {
    .top {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .calendar td {
        height: 50px;
        /* ancora più compatto */
    }
}

.occupied {
    background: #ffe5e5 !important;
}

/* Celle libere verdi */
.available {
    background: #e5ffe5 !important;
}

/* Celle scadute grigie */
.expired {
    background: #f0f0f0 !important;
    color: #999;
}