.lavn-calendar {
    width: 100%;
    max-width: 680px;
    margin-inline: auto;
    box-sizing: border-box;
}

.lavn-calendar .lavn-grid {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.lavn-calendar table.lich-am {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    text-align: center;
    font-family: "Segoe UI", sans-serif;
    font-size: 14px;
    color: #111;
    background: #fff;
}

.lavn-calendar table.lich-am th {
    width: 14.2857%;
    color: #666;
    font-weight: 500;
    padding: 8px 0;
}

.lavn-calendar table.lich-am td {
    width: 14.2857%;
    height: 50px;
    padding: 2px 0;
    vertical-align: middle;
    text-align: center;
    position: relative;
}

.lavn-calendar .lavn-day {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    width: 44px;
    height: auto;
    aspect-ratio: 1 / 1;
    max-width: calc(100% - 2px);
    margin: 0 auto;
    padding: 4px 2px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #111;
    font: inherit;
    line-height: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
    touch-action: manipulation;
}

.lavn-calendar .lavn-day:hover,
.lavn-calendar .lavn-day:focus-visible {
    background: #f3f4f6;
    outline: none;
}

.lavn-calendar .lavn-day:focus-visible {
    box-shadow: 0 0 0 2px #2563eb inset;
}

.lavn-calendar .lavn-day.today {
    background: #3b82f6;
    color: #fff;
    font-weight: 700;
}

.lavn-calendar .lavn-day.today .ngay-am {
    color: #dbeafe;
}

.lavn-calendar .lavn-day.is-selected:not(.today) {
    background: #eff6ff;
    box-shadow: 0 0 0 2px #2563eb inset;
    color: #1d4ed8;
    font-weight: 700;
}

.lavn-calendar .lavn-day .ngay-duong {
    display: block;
    font-size: 16px;
    line-height: 18px;
}

.lavn-calendar .lavn-day .ngay-am {
    display: block;
    margin-top: 1px;
    font-size: 9px;
    line-height: 11px;
    color: #888;
    white-space: nowrap;
}

.lavn-calendar .lavn-day.dac-biet:not(.today):not(.is-selected) {
    color: #dc2626;
    font-weight: 700;
}

.lavn-calendar .lavn-day.hoang-dao::after,
.lavn-calendar .lavn-day.hac-dao::after {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    position: absolute;
    top: 4px;
    right: 5px;
}

.lavn-calendar .lavn-day.hoang-dao::after { background: #00a000; }
.lavn-calendar .lavn-day.hac-dao::after { background: #111; }
.lavn-calendar .lavn-day.today.hac-dao::after { background: #fff; }

.lavn-calendar .lich-chon-thang {
    margin-bottom: 8px;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.lavn-calendar .lich-chon-thang button,
.lavn-calendar .lich-chon-thang select {
    box-sizing: border-box;
    min-width: 0;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 14px;
    line-height: 1.35;
}

.lavn-calendar .lich-chon-thang button {
    flex: 0 0 auto;
    cursor: pointer;
}

.lavn-calendar .lich-chon-thang select {
    max-width: 120px;
}

.lavn-calendar .lavn-status {
    min-height: 1.2em;
    margin: 0 0 2px;
    font-size: 12px;
    text-align: center;
    color: #666;
}

.lavn-calendar .lavn-status.is-error { color: #b91c1c; }
.lavn-calendar.is-loading .lavn-grid { opacity: 0.55; }

.lavn-calendar .lavn-day-summary {
    min-height: 1.4em;
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.45;
}

.lavn-calendar .lavn-day-summary.is-hoang { color: #087c08; }
.lavn-calendar .lavn-day-summary.is-hac { color: #111; }

@media (max-width: 1023px) {
    .lavn-calendar {
        max-width: 620px;
        padding-inline: 6px;
    }
}

@media (max-width: 480px) {
    .lavn-calendar {
        padding-inline: 2px;
    }

    .lavn-calendar table.lich-am th {
        padding: 6px 0;
        font-size: 12px;
    }

    .lavn-calendar table.lich-am td {
        height: 46px;
        padding: 1px 0;
    }

    .lavn-calendar .lavn-day {
        width: 42px;
        height: auto;
    }

    .lavn-calendar .lavn-day .ngay-duong {
        font-size: 15px;
    }

    .lavn-calendar .lich-chon-thang {
        gap: 5px;
    }

    .lavn-calendar .lich-chon-thang button,
    .lavn-calendar .lich-chon-thang select {
        padding: 4px 6px;
        font-size: 13px;
    }

    .lavn-calendar .lavn-day-summary {
        font-size: 12px;
    }
}
