

.calendar {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px;
    background: #fff;
    border: 1px solid #e0e5eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.calendar-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    direction: ltr;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-right {
    justify-content: flex-end;
}

.calendar-title {
    margin: 0;
    color: #b48a4a;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    direction: rtl;
}

button {
    min-width: 48px;
    height: 38px;
    border: 0;
    border-radius: 5px;
    background: #2a9d8f;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: #23877b;
}

.nav-group,
.view-group {
    display: inline-flex;
    overflow: hidden;
    border-radius: 6px;
}

.nav-group button,
.view-group button {
    border-radius: 0;
}

.nav-group button + button,
.view-group button + button {
    border-left: 1px solid rgba(255, 255, 255, .28);
}

.view-group {
    direction: rtl;
}

.view-group button {
    min-width: 44px;
}

.view-group .active {
    background: #111827;
}

.calendar-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    direction: rtl;
}

.calendar-table th,
.calendar-table td {
    border: 1px solid #d9dde3;
}

.calendar-table th {
    height: 30px;
    color: #0d6efd;
    font-weight: 700;
    text-align: center;
    direction: rtl;
}

.calendar-table td {
    position: relative;
    height: 85px;
    padding: 8px;
    vertical-align: top;
    background: #fff;
    direction: rtl;
}

.calendar-table.week-view td {
    height: 220px;
}

.calendar-table.day-view td {
    height: 440px;
}

.calendar-table td.outside {
    background: #fafafa;
}

.day-number {
    display: block;
    color: #0d6efd;
    font-size: 15px;
    line-height: 1;
    text-align: right;
}

.day-label {
    display: block;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 13px;
}

.today {
    background: #fff8d7 !important;
}

.event {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-top: 10px;
    padding: 6px 8px;
    border-radius: 4px;
    background: #b89a63;
    color: #fff;
    font-size: 12px;
    line-height: 1.45;
    text-decoration: none;
    white-space: normal;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    height: 46px;

}

@media (max-width: 720px) {
    body {
        padding: 12px;
    }

    .calendar {
        padding: 12px;
    }

    .calendar-toolbar {
        grid-template-columns: 1fr;
        direction: rtl;
    }

    .toolbar-left,
    .toolbar-right {
        justify-content: center;
    }

    .calendar-table td {
        height: 86px;
        padding: 5px;
    }

    .calendar-table.week-view td {
        height: 160px;
    }

    .calendar-table.day-view td {
        height: 360px;
    }

    .calendar-title {
        font-size: 20px;
    }

    .calendar-table th {
        font-size: 0;
    }

    .calendar-table th::after {
        content: attr(data-short);
        font-size: 12px;
    }
}
