@import url("/css/base.css");

.page-content--agenda {
    max-width: none;
    padding: 38px 24px 48px;
}

.agenda-page {
    max-width: 1360px;
    margin: 0 auto;
    text-align: left;
}

.agenda-admin-panel {
    position: fixed;
    z-index: 30;
    width: min(320px, calc(100vw - 24px));
    padding: 12px 14px;
    background: rgba(248, 243, 232, 0.98);
    border: 1px solid #ccb898;
    box-shadow: 0 12px 24px rgba(31, 26, 23, 0.14);
    backdrop-filter: blur(6px);
}

.agenda-admin-panel__textarea {
    width: 100%;
    min-height: 86px;
    resize: vertical;
    padding: 9px 10px;
    border: 1px solid #ccb898;
    background: #fffdfa;
    color: #1f1a17;
    font: inherit;
}

.agenda-admin-panel__status {
    min-height: 16px;
    margin: 8px 0 0;
    font-size: 12px;
    color: #7a3c10;
}

.agenda-admin-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.agenda-calendar {
    display: flex;
    flex-direction: column;
    gap: 56px;
}

.agenda-year__title {
    margin: 0 0 22px;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #2f3448;
    padding-bottom: 8px;
    border-bottom: 2px solid #d5cbb6;
}

.agenda-year__months {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 52px 44px;
}

.agenda-month {
    min-width: 0;
}

.agenda-month__title {
    margin: 0 0 14px;
    font-size: 19px;
    font-weight: normal;
    color: #4a5068;
    text-transform: lowercase;
}

.agenda-month__weekdays,
.agenda-month__days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.agenda-month__weekdays {
    gap: 8px 6px;
    margin-bottom: 10px;
}

.agenda-month__weekday {
    text-align: center;
    font-size: 12px;
    color: #a3a8b8;
    text-transform: lowercase;
}

.agenda-month__days {
    gap: 8px 0;
}

.agenda-day {
    position: relative;
    border: 0;
    background: transparent;
    color: #4a5068;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    height: 34px;
    padding: 0 6px;
    text-align: center;
    cursor: default;
}

.agenda-day:not(.agenda-day--empty) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.agenda-day__number {
    position: relative;
    z-index: 2;
}

.agenda-day--today::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border: 2px solid #d18836;
    border-radius: 999px;
}

.agenda-day--today.agenda-day--range-start::after,
.agenda-day--today.agenda-day--pending-start::after {
    left: 6px;
    border-radius: 999px 0 0 999px;
}

.agenda-day--today.agenda-day--range-middle::after,
.agenda-day--today.agenda-day--pending-middle::after {
    left: -1px;
    right: -1px;
    border-radius: 0;
}

.agenda-day--today.agenda-day--range-end::after,
.agenda-day--today.agenda-day--pending-end::after {
    right: 6px;
    border-radius: 0 999px 999px 0;
}

.agenda-day--today.agenda-day--saved::after,
.agenda-day--today.agenda-day--pending::after {
    border-color: #fff5e8;
}

.agenda-day--empty {
    visibility: hidden;
}

.agenda-day--saved,
.agenda-day--pending {
    color: #f9fbff;
}

.agenda-day--saved::before,
.agenda-day--pending::before {
    content: "";
    position: absolute;
    inset: 2px 0;
    z-index: 1;
}

.agenda-day--saved::before {
    background: #1ca4b0;
}

.agenda-day--pending::before {
    background: #d18836;
}

.agenda-day--single::before,
.agenda-day--pending-single::before {
    border-radius: 999px;
}

.agenda-day--range-start::before,
.agenda-day--pending-start::before {
    border-radius: 999px 0 0 999px;
    left: 6px;
}

.agenda-day--range-middle::before,
.agenda-day--pending-middle::before {
    left: -1px;
    right: -1px;
}

.agenda-day--range-end::before,
.agenda-day--pending-end::before {
    border-radius: 0 999px 999px 0;
    right: 6px;
}

/* Range caps inset their pill by 6px on the rounded side, which pushes the
   day number 3px off the pill centre toward that edge. Nudge the number
   back so start/end days read as centred, like a single-day selection. */
.agenda-day--range-start .agenda-day__number,
.agenda-day--pending-start .agenda-day__number {
    transform: translateX(3px);
}

.agenda-day--range-end .agenda-day__number,
.agenda-day--pending-end .agenda-day__number {
    transform: translateX(-3px);
}

.agenda-page--admin .agenda-day[data-date] {
    cursor: pointer;
}

.agenda-tooltip {
    position: fixed;
    z-index: 28;
    min-width: 180px;
    max-width: 240px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(31, 26, 23, 0.92);
    color: #fffdfa;
    font-size: 12px;
    line-height: 1.35;
    white-space: pre-wrap;
    text-align: left;
    box-shadow: 0 12px 20px rgba(31, 26, 23, 0.18);
}

@media (max-width: 1180px) {
    .agenda-year__months {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 40px 28px;
    }
}

@media (max-width: 900px) {
    .page-content--agenda {
        padding: 30px 16px 40px;
    }

    .agenda-year__months {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .agenda-year__months {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .agenda-day {
        font-size: 17px;
    }
}
