/* Личный кабинет: карточка ближайшей записи и лента «Мои визиты».
 *
 * Свой файл, а не patch.css: там карточки событий уже описаны в трёх местах и
 * перекрывают друг друга через [data-theme] (инцидент 26.08.2026 с фоном
 * уличных карточек). Здесь префикс pv-* и парные правила тем — светлая как
 * база, тёмная переопределением.
 */

:root {
    --pv-surface: #ffffff;
    --pv-surface-soft: #f6f2e8;
    --pv-border: #e4ddcc;
    --pv-text: #2c2a24;
    --pv-muted: #6f6a5c;
    --pv-accent: #2d493d;
    --pv-accent-soft: #eaf0ea;
}

[data-theme="dark"] {
    --pv-surface: #252c3f;
    --pv-surface-soft: #2b3247;
    --pv-border: #3d4558;
    --pv-text: #e8ecf5;
    --pv-muted: #a5adc0;
    --pv-accent: #7fb79b;
    --pv-accent-soft: #2f3a4e;
}

/* ─── Ближайшая запись ─── */

.pv-next {
    display: block;
    max-width: 420px;
    margin: 0 auto 24px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #2d493d, #3e6b57);
    color: #f6f1e6;
    text-align: left;
    text-decoration: none;
}

.pv-next:hover,
.pv-next:focus {
    color: #ffffff;
    text-decoration: none;
    filter: brightness(1.05);
}

.pv-next__label {
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .85;
    margin-bottom: 6px;
}

.pv-next__icon { margin-right: 6px; }

.pv-next__when {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.pv-next__what { font-size: 15px; opacity: .92; margin-top: 2px; }
.pv-next__note { font-size: 13px; opacity: .8; margin-top: 6px; }

/* ─── Лента визитов ─── */

.pv {
    max-width: 640px;
    margin: 0 auto 28px;
    padding: 0 4px;
    text-align: left;
    color: var(--pv-text);
}

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

.pv__title { margin: 0; font-size: 20px; }

.pv__scope {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--pv-surface-soft);
    border-radius: 12px;
}

.pv__scope-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--pv-muted);
    font-size: 14px;
    cursor: pointer;
}

.pv__scope-btn.is-active {
    background: var(--pv-accent);
    color: #f6f1e6;
    font-weight: 600;
}

.pv__badge {
    min-width: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .12);
    font-size: 12px;
    text-align: center;
}

.pv__scope-btn.is-active .pv__badge { background: rgba(255, 255, 255, .22); }

.pv__filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.pv__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--pv-border);
    border-radius: 999px;
    background: var(--pv-surface);
    color: var(--pv-muted);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.pv__chip.is-active {
    border-color: var(--pv-accent);
    background: var(--pv-accent-soft);
    color: var(--pv-accent);
    font-weight: 600;
}

.pv__chip[hidden] { display: none; }
.pv__chip-count { opacity: .7; font-size: 12px; }

.pv__day { margin-bottom: 14px; }

.pv__day-title {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 4px 2px;
    background: var(--pv-surface-soft);
    border-radius: 8px;
    font-size: 13px;
    color: var(--pv-muted);
}

.pv__day[hidden] { display: none; }

.pv__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    margin-top: 8px;
    border: 1px solid var(--pv-border);
    border-left: 4px solid var(--pv-border);
    border-radius: 14px;
    background: var(--pv-surface);
}

.pv__item[hidden] { display: none; }

/* Цветная левая грань — вид занятия узнаётся боковым зрением. */
.pv__item--game { border-left-color: #4d8ac9; }
.pv__item--training { border-left-color: #4f9d6f; }
.pv__item--individual { border-left-color: #c99a3d; }
.pv__item--competition { border-left-color: #b45f9b; }
.pv__item--trip { border-left-color: #4bab9c; }
.pv__item--rent { border-left-color: #8a8578; }
.pv__item--abonement { border-left-color: #7a86c9; }

.pv__time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
    line-height: 1.2;
}

.pv__time b { font-size: 16px; }
.pv__time span { font-size: 12px; color: var(--pv-muted); }

.pv__body { flex: 1; min-width: 0; }

.pv__name { font-size: 15px; font-weight: 600; }
.pv__name a { color: inherit; text-decoration: none; }
.pv__name a:hover { text-decoration: underline; }
.pv__icon { margin-right: 6px; }

.pv__meta {
    margin-top: 2px;
    font-size: 13px;
    color: var(--pv-muted);
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pv__kind { font-weight: 500; }

.pv__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    white-space: nowrap;
}

/* Отмена — действие редкое: кнопка не должна кричать краснее, чем сама запись. */
.pv__cancel {
    padding: 4px 10px;
    border: 1px solid var(--pv-border);
    border-radius: 999px;
    background: transparent;
    color: #b5511c;
    font-size: 12px;
    cursor: pointer;
}

.pv__cancel:hover { border-color: #b5511c; }

.pv__status {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--pv-surface-soft);
    font-size: 12px;
    color: var(--pv-muted);
}

.pv__empty {
    padding: 18px 12px;
    border: 1px dashed var(--pv-border);
    border-radius: 14px;
    color: var(--pv-muted);
    text-align: center;
}

.pv__note { margin-top: 10px; font-size: 12px; color: var(--pv-muted); }

@media (max-width: 480px) {
    .pv__item { padding: 10px; gap: 8px; }
    .pv__time { min-width: 44px; }
    .pv__side { align-items: flex-end; }
}

/* ─── Лидерборды: свёрнутый вид ───
 * Полный блок (чемпионы прошлого месяца + все рейтинги) занимал в кабинете
 * целый экран. По умолчанию виден только текущий месяц, остальное — по клику
 * (решение владельца 26.08.2026).
 */

.loyalty-boards__more { margin-top: 10px; }

.loyalty-boards__more > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--pv-border);
    border-radius: 999px;
    background: var(--pv-surface);
    color: var(--pv-accent);
    font-size: 13px;
    cursor: pointer;
    list-style: none;
}

.loyalty-boards__more > summary::-webkit-details-marker { display: none; }
.loyalty-boards__more[open] > summary { margin-bottom: 12px; }


/* Места детей внутри записи: строка на каждого со своей кнопкой (31.08.2026).
   Родитель ведёт двоих на одну тренировку и должен снять именно одного. */
.pv__seats {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pv__seat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 10px;
    background: rgba(52, 80, 62, .07);
}
.pv__seat-name {
    font-size: 14px;
    font-weight: 600;
}
.pv__seat-drop {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #b4521f;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 6px;
    min-height: 32px;
}
.pv__seat-drop[disabled] { opacity: .6; cursor: default; }

/* Сводка в шапке: остаток занятий и число будущих записей. */
.pv-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 14px;
}
.pv-summary__card {
    flex: 1 1 150px;
    min-width: 140px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
}
.pv-summary__lbl {
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-weight: 800;
    opacity: .6;
}
.pv-summary__val {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    margin-top: 3px;
}
.pv-summary__sub {
    font-size: 12px;
    opacity: .7;
    margin-top: 2px;
}
