/* -||||-PROПАУЭРЛИФТИНГ-||||- — стили веб-приложения */
:root {
    --bg: #f0f7ff;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --border: #b8d4e8;
    --text: #1e3a5f;
    --text-muted: #5a7a9e;
    --accent: #1d6cb5;
    --accent-hover: #2b8ad4;
    --accent-light: #e3f2fd;
    --error: #b85450;
    --success: #2e7d5a;
    --radius: 8px;
    --font: 'Outfit', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #1d6cb5 0%, #4a9ad4 100%);
    box-shadow: 0 1px 3px rgba(29, 108, 181, 0.2);
}

.logo {
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.logo:link, .logo:visited, .logo:hover, .logo:active {
    color: inherit;
}

.header .logo-tricolor .c1 { color: #ffffff; }
.header .logo-tricolor .c2 { color: #e3f2fd; }
.header .logo-tricolor .c3 { color: #ffe5e3; }

.header nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
}

/* Сообщения flash */
.flash-messages {
    list-style: none;
    margin: 0 0 1rem 0;
    padding: 0;
}
.flash-messages .flash {
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}
.flash-messages .flash-error {
    background: rgba(184, 84, 80, 0.15);
    color: var(--error);
    border: 1px solid rgba(184, 84, 80, 0.4);
}

.header nav a:hover {
    color: #ffffff;
    transform: translateY(-2px);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Dropdown "Карточки" */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    cursor: pointer;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu::before {
    content: "";
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text) !important;
    transform: none;
    text-shadow: none;
    border-radius: 4px;
    margin: 0 0.25rem;
}

.nav-dropdown-menu a:hover {
    background: var(--accent-light);
    color: var(--accent) !important;
}

.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    margin-bottom: 2rem;
}

.cards-hero,
.planning-section .hero,
.training-section .hero {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 1rem;
}

.cards-hero .btn,
.planning-section .hero .btn,
.training-section .hero .btn {
    margin-left: auto;
}

.hero h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
}

.subtitle {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 1.5rem;
}

.athlete-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: border-color 0.2s;
}

.athlete-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(29, 108, 181, 0.12);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.card-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-input);
}

.card-photo-placeholder {
    width: 72px;
    height: 72px;
    background: var(--accent-light);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.card-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    transition: color 0.2s, background 0.2s;
}

.btn-edit:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.badge {
    flex-shrink: 0;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    background: var(--accent-light);
    color: var(--accent);
}
.badge-free {
    background: rgba(34, 197, 94, 0.2);
    color: #15803d;
    border-radius: 4px;
}
.badge-telegram {
    background: rgba(59, 130, 246, 0.25);
    color: #2563eb;
    border-radius: 4px;
    font-weight: 600;
}

.card-details {
    margin: 0;
}

.card-details > div {
    margin-bottom: 0.75rem;
}

.card-details > div:last-child {
    margin-bottom: 0;
}

.card-details dt {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.card-details dd {
    margin: 0;
    font-size: 0.9rem;
}

.achievements-multiline {
    white-space: pre-line;
}

.achievements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.achievements-list li {
    padding: 0.2rem 0;
    padding-left: 1rem;
    position: relative;
}

.achievements-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.achievement-row {
    margin-bottom: 1rem;
}

.achievement-row .field-wide {
    max-width: 100%;
}

.best-result-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: end;
}

@media (max-width: 600px) {
    .best-result-row {
        grid-template-columns: 1fr;
    }
}

.best-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.best-results-list li {
    padding: 0.25rem 0;
    padding-left: 1rem;
    position: relative;
}

.best-results-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.weight-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.weight-timeline li {
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.weight-timeline li:last-child {
    border-bottom: none;
}

.weight-timeline .dates {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.pm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.pm-table th,
.pm-table td {
    padding: 0.35rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.pm-table th {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pm-table tr:last-child td {
    border-bottom: none;
}

.comp-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comp-timeline li {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.comp-timeline li:last-child {
    border-bottom: none;
}

.comp-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 0.8fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: end;
}

@media (max-width: 900px) {
    .comp-row {
        grid-template-columns: 1fr 1fr;
    }
    .comp-row .field:first-child {
        grid-column: span 2;
    }
}

.field-photo .photo-preview {
    margin-bottom: 0.5rem;
}

.field-photo .current-photo {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.field-photo .photo-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.empty-state p {
    color: var(--text-muted);
    margin: 0 0 1rem 0;
}

/* Form */
.form-section {
    max-width: 640px;
}

/* Мезопланирование: используем ширину контейнера, а не узкую форму. */
.macro-plan-section {
    max-width: none;
}

/* Компактная колонка для блоков с короткими полями (не на всю ширину экрана) */
.macro-plan-sidebar-block,
.macro-plan-compact-stack {
    max-width: 38rem;
    width: 100%;
}

.macro-plan-section .macro-micro-list--top.macro-plan-sidebar-block {
    padding: 0.65rem 0.85rem 0.75rem;
    margin-bottom: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.macro-plan-section .macro-micro-list--top.macro-plan-sidebar-block h2 {
    font-size: 1.05rem;
    margin: 0 0 0.4rem 0;
}

.macro-plan-section .macro-micro-list--top.macro-plan-sidebar-block > p {
    margin: 0.35rem 0;
    font-size: 0.9rem;
}

.macro-plan-compact-stack {
    margin-bottom: 1rem;
}

.macro-plan-compact-stack > fieldset.form-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem 0.75rem;
    margin: 0 0 0.55rem 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.macro-plan-compact-stack > fieldset.form-group:last-child {
    margin-bottom: 0;
}

.macro-plan-compact-stack .form-group legend {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    padding: 0;
}

.macro-plan-compact-stack .field {
    margin-bottom: 0.45rem;
}

.macro-plan-compact-stack .field:last-child {
    margin-bottom: 0;
}

.macro-plan-compact-stack .hint {
    margin: -0.1rem 0 0.35rem 0;
    line-height: 1.3;
    font-size: 0.8rem;
}

.macro-plan-compact-stack .form-static {
    margin: 0 0 0.4rem 0;
    font-size: 0.9rem;
}

/* Длительность и дата в одну линию на широких экранах */
.macro-plan-fields-inline {
    display: grid;
    gap: 0 0.75rem;
}

@media (min-width: 480px) {
    .macro-plan-fields-inline {
        grid-template-columns: minmax(0, 11rem) minmax(0, 13rem);
        align-items: start;
    }
}

/* Плотнее инпуты только в компактном стеке мезоплана */
.macro-plan-compact-stack input[type="text"],
.macro-plan-compact-stack input[type="date"],
.macro-plan-compact-stack input[type="number"],
.macro-plan-compact-stack select,
.macro-plan-compact-stack textarea {
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
}

/* Короткие поля — без растягивания на всю ширину колонки */
.macro-plan-compact-stack fieldset .field input[type="text"],
.macro-plan-compact-stack fieldset .field select {
    width: 100%;
    max-width: min(100%, 22rem);
}

.macro-plan-compact-stack fieldset .field input[type="date"],
.macro-plan-compact-stack fieldset .field input[type="number"] {
    width: 100%;
    max-width: min(100%, 11rem);
}

.macro-plan-compact-stack .macro-current-goal-row .field input[type="number"] {
    width: 6.25rem;
    max-width: 6.25rem;
}

.macro-plan-compact-stack fieldset .field textarea {
    width: 100%;
    max-width: 100%;
    min-height: 3.25rem;
    line-height: 1.35;
}

/* ПК: два столбца «текущие | целевые», шире общая колонка — меньше скролла */
@media (min-width: 960px) {
    .macro-plan-sidebar-block,
    .macro-plan-compact-stack {
        max-width: 52rem;
    }

    .macro-plan-compact-stack {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem 0.75rem;
        align-items: start;
    }

    .macro-plan-compact-stack > fieldset.form-group {
        margin: 0;
    }

    .macro-plan-fs-full {
        grid-column: 1 / -1;
    }

    .macro-plan-fs-metrics .hint {
        margin-bottom: 0.3rem;
    }
}

.macro-plan-section.macro-plan-section > h1,
.macro-plan-section.form-section > h1 {
    font-size: 1.35rem;
    margin: 0 0 0.75rem 0;
}

.macro-plan-fieldset-wide {
    max-width: none;
}

/* Панель графиков мезоплана: селекты не на всю ширину строки */
.macro-plan-section .chart-dashboard-section .chart-controls {
    max-width: 56rem;
}

.macro-plan-section .chart-dashboard-section .chart-controls select {
    width: auto;
    max-width: 14rem;
    flex: 0 1 auto;
}

.macro-plan-section .chart-dashboard-section #macroExpressAnalysisResult {
    max-width: 48rem;
}

.macro-plan-section .chart-dashboard-section {
    margin-top: 1.25rem;
    padding: 0.75rem 0.9rem;
}

.macro-plan-section .chart-dashboard-section > h2 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
}

.macro-plan-compact-stack .macro-current-goal-row {
    gap: 0.4rem 0.55rem;
    margin-top: 0.15rem;
}

.macro-plan-compact-stack .macro-stats-categories {
    gap: 0.35rem 0.85rem;
    margin-top: 0.1rem;
}

.form-section h1 {
    font-size: 1.5rem;
    margin: 0 0 1.5rem 0;
}

.plan-macro-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.25rem 0;
    flex-wrap: wrap;
}
.plan-macro-link .hint {
    margin: 0;
}

.plan-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.plan-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.plan-tab:hover { color: var(--text); }
.plan-tab.active {
    color: var(--accent);
    font-weight: 600;
    border-bottom-color: var(--accent);
}
.plan-tab-pane[hidden] { display: none !important; }

.load-stats-block {
    margin-bottom: 2rem;
}
.plan-stats-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}
.plan-stats-heading {
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
    color: var(--text);
}

.plan-stats-global-section {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}
.plan-stats-global-section h2 {
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
}
.plan-stats-global-section .subtitle {
    margin: 0 0 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.plan-stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.plan-stats-card h3 {
    font-size: 1.05rem;
    margin: 0 0 0.35rem 0;
}
.plan-stats-links {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
}
.plan-stats-card .load-stats-block {
    margin-bottom: 1.25rem;
}
.plan-stats-card .load-stats-block:last-child {
    margin-bottom: 0;
}
.plan-stats-card h4 {
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-muted);
}

.load-stats-block h2,
.load-stats-block h3 {
    font-size: 1.1rem;
    margin: 0 0 0.75rem 0;
    color: var(--text);
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.stats-table th,
.stats-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.stats-table th {
    background: var(--accent-light);
    font-weight: 600;
    color: var(--text);
}
.stats-table tbody tr:last-child td { border-bottom: none; }
.stats-table td:nth-child(n+2) { text-align: right; }
.stats-table.movement-stats td:nth-child(2),
.stats-table.movement-stats td:nth-child(3),
.stats-table.movement-stats td:nth-child(4),
.stats-table.movement-stats td:nth-child(5) { text-align: right; }

/* Компактная таблица статистики по неделям (строка = неделя 1, 2, 3, 4…) */
.plan-stats-by-week { font-size: 0.875rem; table-layout: auto; }
.plan-stats-by-week th,
.plan-stats-by-week td { padding: 0.35rem 0.45rem; white-space: nowrap; }
.plan-stats-by-week .col-week { width: 1%; min-width: 2.25rem; text-align: center; }
.plan-stats-by-week .col-week-num { text-align: center; font-weight: 600; }
.plan-stats-by-week thead th:not(.col-week) { min-width: 2rem; }
.plan-stats-by-week .col-mg { min-width: 2.5rem; }

/* Единая таблица: все недели в строках, чекбоксы выбора */
.unified-stats-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.unified-stats-toolbar .unified-select-all { font-size: 0.9rem; cursor: pointer; }
.plan-stats-unified { font-size: 0.875rem; table-layout: auto; }
.plan-stats-unified .col-check { width: 1%; text-align: center; vertical-align: middle; }
.plan-stats-unified .col-athlete { white-space: nowrap; }
.plan-stats-unified .col-plan { white-space: nowrap; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }
.plan-stats-unified .col-week-num { text-align: center; font-weight: 600; }
.plan-stats-unified th.col-check,
.plan-stats-unified td.col-check { padding: 0.35rem 0.5rem; }
.plan-stats-unified th.col-mg,
.plan-stats-unified td.col-mg { min-width: 2.5rem; text-align: right; }

/* Блок графиков по выбранным неделям */
.chart-dashboard-section {
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--bg-subtle, #f8fafc);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.chart-dashboard-section h3 { margin: 0 0 1rem 0; font-size: 1.05rem; }
.chart-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.chart-controls label { font-size: 0.9rem; }
.chart-controls select { min-width: 180px; padding: 0.4rem 0.5rem; }
.chart-container { max-width: 100%; min-height: 280px; }
.chart-container canvas { max-width: 100%; cursor: pointer; }

/* Кнопка отправки графика не должна перекрывать пояснение */
.chart-hint-weigh,
.chart-weigh-send-hint {
    margin: 0.25rem 0 1rem 0 !important;
}

/* не даём кнопке/элементам визуально "налезать" на подписи */
.chart-weigh-send-form { margin-bottom: 0.25rem; }

/* Аналитика */
.analytics-section .hero .subtitle { max-width: 56rem; }
.analytics-list-table th,
.analytics-list-table td { text-align: left; }
.analytics-list-table td:last-child { text-align: right; white-space: nowrap; }

.analytics-athlete-section .hero-analytics { margin-bottom: 2rem; }
.analytics-athlete-section .back-link { display: inline-block; margin-bottom: 0.75rem; }

.analytics-dashboard {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}
.analytics-charts {
    margin-top: 0;
}
.analytics-charts h2,
.development-matrix-section h2,
.estimated-maxs-section h2 {
    font-size: 1.2rem;
    margin: 0 0 1rem 0;
}
.development-matrix-section .hint,
.estimated-maxs-section .hint {
    margin: 0 0 0.75rem 0;
}
.matrix-wrap { overflow-x: auto; }
.analytics-matrix { font-size: 0.9rem; }
.analytics-matrix th,
.analytics-matrix td {
    padding: 0.5rem 0.6rem;
    text-align: right;
    white-space: nowrap;
}
.analytics-matrix th:first-child,
.analytics-matrix td:first-child,
.analytics-matrix th:nth-child(2),
.analytics-matrix td:nth-child(2) { text-align: left; }
.estimated-maxs-section .table { max-width: 36rem; }

.exercise-switcher {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-subtle, #f8fafc);
    border-radius: 6px;
}

.exercise-switcher select {
    max-width: 100%;
    min-width: 280px;
}

.exercise-switcher optgroup {
    font-weight: 700;
}

.form-group {
    border: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.form-group legend {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent);
}

.hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -0.5rem 0 1rem 0;
}

.hint a {
    color: var(--accent);
    text-decoration: none;
}

.hint a:hover {
    text-decoration: underline;
}

.field-week-number-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.field-week-number-row input[type="number"] {
    max-width: 6.5rem;
}

.field-week-number .week-last-sent-hint {
    flex: 1 1 14rem;
    min-width: 11rem;
    margin: 0;
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
}

.required {
    color: var(--error);
}

input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.pm-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: end;
}

.pm-to-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pm-till-now-label {
    font-size: 0.85rem;
    font-weight: normal;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pm-till-now-label input {
    margin: 0;
}

@media (max-width: 640px) {
    .pm-row {
        grid-template-columns: 1fr;
    }
}

.weight-row {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: end;
}

.field-wide {
    grid-column: span 1;
}

@media (max-width: 600px) {
    .weight-row {
        grid-template-columns: 1fr 1fr;
    }
    .field-wide {
        grid-column: span 2;
    }
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background 0.2s, color 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.btn-danger.btn-outline {
    color: var(--error);
    border-color: var(--error);
}
.btn-danger.btn-outline:hover {
    color: #fff;
    background: var(--error);
    border-color: var(--error);
}

.error {
    color: var(--error);
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(184, 84, 80, 0.12);
    border-radius: var(--radius);
}

/* Training stats */
.training-section .hero {
    margin-bottom: 1.5rem;
}

.training-table-wrap {
    overflow-x: auto;
}

.training-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.training-table th,
.training-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.training-table th {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.training-table tbody tr:hover {
    background: var(--accent-light);
}

.col-athlete { font-weight: 500; }
.col-week { width: 4rem; }
.col-date { width: 7rem; }
.col-weigh { min-width: 120px; font-size: 0.9rem; }
.col-stats { min-width: 180px; font-size: 0.8rem; color: var(--text-muted); }

.training-head-row,
.stats-row,
.weigh-row {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: end;
}

.training-head-row { grid-template-columns: 2fr 1fr 1fr; }
.stats-row { grid-template-columns: 1fr 1fr 1fr 1.5fr; }
.weigh-row { grid-template-columns: 1fr 1fr; }

@media (max-width: 768px) {
    .training-head-row { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .weigh-row { grid-template-columns: 1fr; }
}

/* Planning */
.planning-section .hero {
    margin-bottom: 1.5rem;
}

.rankings-filter-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rankings-filter-block {
    background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
    box-shadow: 0 4px 14px rgba(29, 108, 181, 0.08);
}

.rankings-filter-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.rankings-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.rankings-week-picker-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.rankings-week-picker {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.35rem 0.55rem;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.rankings-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    background: #fff;
    transition: all 0.18s ease;
}

.rankings-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.rankings-chip.is-active {
    background: linear-gradient(135deg, #1d6cb5 0%, #3f8ccc 100%);
    border-color: #1d6cb5;
    color: #fff;
    box-shadow: 0 4px 10px rgba(29, 108, 181, 0.25);
}

.rankings-filter-range {
    margin-top: 0.45rem;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.rankings-filter-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.rankings-weekly h2 {
    letter-spacing: 0.01em;
}

.rankings-weekly .rankings-weekly-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 0.85rem;
}

.rankings-weekly .rankings-block-card {
    border: 1px solid rgba(29, 108, 181, 0.22);
    border-radius: 14px;
    padding: 0.8rem 0.9rem 0.45rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
    box-shadow: 0 6px 18px rgba(29, 108, 181, 0.08);
}

.rankings-weekly .rankings-block-card > h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.rankings-weekly .rankings-block-card .hint {
    margin: 0 0 0.55rem 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.rankings-weekly .table-responsive {
    border: 1px solid rgba(29, 108, 181, 0.14);
    border-radius: 12px;
    overflow: auto;
    background: #fff;
}

.rankings-weekly .rankings-table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
}

.rankings-weekly .rankings-table th,
.rankings-weekly .rankings-table td {
    border: none;
    border-bottom: 1px solid rgba(184, 212, 232, 0.7);
    padding: 0.56rem 0.62rem;
    vertical-align: middle;
}

.rankings-weekly .rankings-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #1d6cb5 0%, #2a7ec6 100%);
    color: #fff;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    white-space: nowrap;
}

.rankings-weekly .rankings-table tbody tr:nth-child(odd) td {
    background: #fbfdff;
}

.rankings-weekly .rankings-table tbody tr:hover td {
    background: #eaf5ff;
}

.rankings-weekly .rankings-table tbody tr:last-child td {
    border-bottom: none;
}

/* Визуально выделяем лидеров таблиц */
.rankings-weekly .rankings-table tbody tr:nth-child(1) td:first-child,
.rankings-weekly .rankings-table tbody tr:nth-child(2) td:first-child,
.rankings-weekly .rankings-table tbody tr:nth-child(3) td:first-child {
    font-weight: 700;
}

.rankings-weekly .rankings-table tbody tr:nth-child(1) td:first-child {
    color: #c28a00;
}

.rankings-weekly .rankings-table tbody tr:nth-child(2) td:first-child {
    color: #6b7280;
}

.rankings-weekly .rankings-table tbody tr:nth-child(3) td:first-child {
    color: #a4632d;
}

.rankings-weekly .rankings-table td strong {
    color: #114a80;
}

.planning-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.plan-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.plan-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.plan-athlete {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.plan-athlete-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-athlete-photo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

.plan-athlete-photo-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.plan-athlete-name {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text);
}

.plan-macro,
.plan-meta {
    margin: 0 0 0.35rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.plan-period {
    margin: 0 0 0.75rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.plan-preview {
    font-size: 0.9rem;
    color: var(--text);
    white-space: pre-wrap;
    margin-bottom: 1rem;
    max-height: 4em;
    overflow: hidden;
}

.plan-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}

.macro-express-preview-hint {
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
}

.inline-form {
    display: inline;
}

/* Таблица недель мезоплана: колонки не налезают друг на друга */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}
.table th,
.table td {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.table th {
    background: var(--bg-muted);
    font-weight: 600;
}
.table tbody tr:hover {
    background: var(--bg-muted);
}
/* Таблица финансов — выраженный блок, всё по центру */
.finances-summary {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.finances-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.finances-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.finances-summary-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.finances-summary-value {
    font-size: 1.25rem;
    font-weight: 600;
}
.finances-summary-hint {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.finances-period-block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.finances-period-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}
.finances-period-form label { margin: 0; }
.finances-period-form input[type="date"] { width: auto; }
.finances-period-result {
    margin-top: 0.5rem;
}
.finances-recent-payments {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.finances-recent-payments .btn {
    display: inline-flex;
    align-items: center;
}
.finances-add-payment {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.finances-add-payment-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}
.finances-add-payment-form label { margin: 0; }
.finances-add-payment-form select { min-width: 12rem; }
.finances-add-payment-form input[type="number"] { width: 6rem; }
.finances-add-payment-form input[type="date"] { width: auto; }
.finances-add-payment-form input[type="text"] { width: 10rem; }
.finances-sort {
    color: inherit;
    text-decoration: none;
    opacity: 0.9;
}
.finances-sort:hover {
    text-decoration: underline;
    opacity: 1;
}
.finances-sort-active {
    text-decoration: underline;
}

.finances-wrapper {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(29, 108, 181, 0.12);
    overflow: hidden;
}
.finances-wrapper .table-responsive {
    overflow-x: auto;
}
.finances-table {
    margin: 0;
}
.finances-table th,
.finances-table td {
    text-align: center;
    vertical-align: middle;
}
.finances-table th {
    background: linear-gradient(180deg, #1d6cb5 0%, #2568a8 100%);
    color: #fff;
    font-weight: 600;
    padding: 0.85rem 1rem;
    border-color: rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}
.finances-table tbody tr {
    border-bottom: 1px solid var(--border);
}
.finances-table tbody tr:last-child {
    border-bottom: none;
}
.finances-table tbody tr:hover {
    background: var(--accent-light);
}
.finances-table .finances-athlete-name {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.finances-table .finances-athlete-name:hover {
    text-decoration: underline;
}
.balance-negative {
    color: #dc2626;
}
/* Бейджи «осталось тренировок» */
.workouts-badge {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}
.workouts-done {
    background: rgba(46, 125, 90, 0.15);
    color: var(--success);
    border: 1px solid rgba(46, 125, 90, 0.4);
}
.workouts-one {
    background: rgba(217, 119, 6, 0.15);
    color: #b45305;
    border: 1px solid rgba(217, 119, 6, 0.45);
}
.workouts-many {
    background: rgba(29, 108, 181, 0.12);
    color: var(--accent);
    border: 1px solid rgba(29, 108, 181, 0.35);
}
/* Микропланы вверху страницы редактирования мезоплана */
.macro-micro-list--top {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-alt, rgba(0, 0, 0, 0.03));
}
.macro-micro-list--top h2 {
    margin-top: 0;
    font-size: 1.15rem;
}
.macro-micro-list--top .macro-micro-subtitle {
    margin: 0.35rem 0 0.6rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}
.macro-micro-list--top .macro-micro-plan-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.65rem;
}
.macro-micro-list--top .macro-micro-plan-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(29, 108, 181, 0.22);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(227, 242, 253, 0.52) 100%);
    box-shadow: 0 1px 8px rgba(29, 108, 181, 0.08);
}
.macro-micro-list--top .macro-micro-plan-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-decoration: none;
    min-width: 0;
}
.macro-micro-list--top .macro-micro-plan-title {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.macro-micro-list--top .macro-micro-plan-week {
    font-size: 0.78rem;
    color: var(--accent);
    background: rgba(29, 108, 181, 0.14);
    border: 1px solid rgba(29, 108, 181, 0.25);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    width: fit-content;
}
.macro-micro-list--top .macro-micro-plan-delete {
    flex: 0 0 auto;
}
.macro-micro-list--top .macro-create-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 0;
}
.macro-micro-list--top .macro-create-links li {
    margin: 0;
}

/* Нижняя панель действий в редактировании мезоплана */
#macro-plan-form-actions {
    margin-top: 1.75rem;
    padding: 1rem;
    border: 1px solid rgba(29, 108, 181, 0.2);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(227, 242, 253, 0.45) 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.65rem;
}
#macro-plan-form-actions .btn {
    width: 100%;
    min-height: 2.7rem;
    border-radius: 10px;
    text-align: center;
}
#macro-plan-form-actions .action-main {
    box-shadow: 0 6px 16px rgba(29, 108, 181, 0.18);
}
#macro-plan-form-actions .action-secondary {
    background: #eef6ff;
    border-color: #c6def2;
}
#macro-plan-form-actions .action-aux {
    color: var(--accent);
    border-color: rgba(29, 108, 181, 0.35);
}
#macro-plan-form-actions .action-cancel {
    color: var(--text-muted);
}

@media (min-width: 960px) {
    #macro-plan-form-actions {
        margin-top: 1rem;
        padding: 0.6rem 0.75rem;
        gap: 0.5rem;
    }
    #macro-plan-form-actions .btn {
        min-height: 2.35rem;
    }
}

/* Кнопки «Сохранить» у недели: не ломаем узкую ячейку */
.macro-weeks-table td.week-actions-cell-save {
    white-space: normal;
    vertical-align: top;
    min-width: 6.5rem;
}
.macro-weeks-table td.week-actions-cell-save .btn {
    display: block;
    width: 100%;
    margin-bottom: 0.35rem;
    box-sizing: border-box;
}
.macro-weeks-table td.week-actions-cell-save .btn:last-child {
    margin-bottom: 0;
}
.macro-weeks-table {
    border-collapse: collapse;
    table-layout: auto;
    min-width: max-content;
}
.macro-weeks-table th,
.macro-weeks-table td {
    padding: 0.35rem 0.4rem;
    border: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}
.macro-weeks-table .input-sm {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    display: block;
}
.macro-weeks-table td.weigh-cell {
    white-space: normal;
    min-width: 14rem;
}
.macro-weeks-table td.weigh-cell .weigh-compact-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.macro-weeks-table td.weigh-cell .weigh-compact-row {
    display: grid;
    grid-template-columns: 1.1rem 1fr 4.5rem;
    gap: 0.25rem;
    align-items: center;
}
.macro-weeks-table td.weigh-cell .weigh-slot-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
}
.macro-weeks-table td.weigh-cell .weigh-date-input {
    min-width: 0;
}
.macro-weeks-table td.weigh-cell .weigh {
    min-width: 0;
    width: 100%;
}
.macro-weeks-table td .base-val {
    width: 4.5rem;
    min-width: 4.5rem;
    max-width: 4.5rem;
}
.macro-weeks-table .week-sum {
    display: inline-block;
    min-width: 4rem;
    font-weight: 600;
}
/* Период С / По */
.macro-weeks-table th:nth-child(1),
.macro-weeks-table td:nth-child(1),
.macro-weeks-table th:nth-child(2),
.macro-weeks-table td:nth-child(2) {
    min-width: 7rem;
}
/* Назначение недельного цикла — шире, чтобы влезали подпись «тест» и др. */
.macro-weeks-table th:nth-child(3),
.macro-weeks-table td:nth-child(3) {
    min-width: 14rem;
    white-space: normal;
}
/* Примечание */
.macro-weeks-table th:nth-child(4),
.macro-weeks-table td:nth-child(4) {
    min-width: 10rem;
    white-space: normal;
}
/* Выполнено (5-я колонка) */
.macro-weeks-table th:nth-child(5),
.macro-weeks-table td:nth-child(5) {
    min-width: 6.5rem;
}
/* Отправка (6-я колонка) */
.macro-weeks-table th:nth-child(6),
.macro-weeks-table td:nth-child(6) {
    min-width: 8rem;
}
/* Начиная с колонки базовых движений */
.macro-weeks-table th:nth-child(n+8),
.macro-weeks-table td:nth-child(n+8) {
    min-width: 5rem;
}

/* Подсветка выполненной недели */
.macro-weeks-table tr.week-completed td {
    background-color: rgba(34, 197, 94, 0.28);
}
.macro-weeks-table tr.week-completed:hover td {
    background-color: rgba(34, 197, 94, 0.38);
}
.macro-weeks-table tr.week-not-completed td {
    background-color: rgba(239, 68, 68, 0.22);
}
.macro-weeks-table tr.week-not-completed:hover td {
    background-color: rgba(239, 68, 68, 0.32);
}

/* Текущие и целевые показатели мезоплана */
.macro-stats-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
}
.macro-stats-categories .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-weight: 500;
}
.macro-current-goal-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 1rem;
    margin-top: 0.35rem;
}
.macro-current-goal-row .field {
    flex: 0 0 auto;
    margin-bottom: 0;
}
.macro-current-goal-row .field label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.82rem;
    white-space: nowrap;
}
.macro-current-goal-row .field input {
    width: 6.75rem;
    max-width: 6.75rem;
    box-sizing: border-box;
}

/* Статус по цели в таблице недель */
.macro-weeks-table .base-cell,
.macro-weeks-table .sum-cell {
    vertical-align: top;
}
.macro-weeks-table .goal-status {
    display: block;
    font-size: 0.7rem;
    margin-top: 0.2rem;
    line-height: 1.2;
    color: var(--text-muted);
}
.macro-weeks-table .goal-status.goal-status-remaining { color: #b45309; }
.macro-weeks-table .goal-status.goal-status-reached { color: var(--success); font-weight: 500; }
.macro-weeks-table .goal-status.goal-status-exceeded { color: #1d6cb5; font-weight: 500; }

/* Вкладка «Статус» спортсменов */
.status-table .status-badge { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.9rem; }
.status-table .status-badge.status-active { background: var(--success); color: #fff; }
.status-table .status-badge.status-inactive { background: var(--text-muted); color: #fff; }
.status-table tr.status-inactive { opacity: 0.75; }
.status-table .status-toggle-form { display: inline; }
.status-table .status-user-id { font-size: 0.8rem; color: var(--text-muted); }

/* Группы: удобный выбор спортсменов по направлениям */
.groups-athletes-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin: 0.2rem 0 0.85rem 0;
}
.groups-athletes-toolbar input[type="text"] {
    max-width: 22rem;
}
.group-athletes-list.grouped {
    display: grid;
    gap: 0.8rem;
}
.group-athletes-direction {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    padding: 0.65rem 0.75rem;
}
.group-athletes-direction-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}
.group-athletes-direction-head h3 {
    margin: 0;
    font-size: 0.98rem;
}
.group-athletes-direction-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg-subtle, #f4f6fa);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
}
.group-athletes-direction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.4rem 0.6rem;
}
.group-athlete-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
}
.group-athlete-item:hover {
    border-color: var(--border);
    background: var(--bg-subtle, #f8fafc);
}
.group-athlete-name {
    line-height: 1.25;
}
.group-athlete-state {
    margin-left: auto;
    font-size: 0.72rem;
    color: #b45309;
    border: 1px solid rgba(180, 83, 9, 0.25);
    background: rgba(251, 191, 36, 0.18);
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
}

.group-sort-order-hint {
    margin-top: 0.35rem;
    margin-bottom: 0;
}

/* Строка статистики по неделе (одна строка под данными недели) */
.macro-weeks-table tr.macro-week-stats-row td {
    padding: 0.3rem 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    border-top: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: normal;
}
.macro-weeks-table tr.macro-week-stats-row.week-completed td {
    background-color: rgba(34, 197, 94, 0.2);
}
.macro-weeks-table tr.macro-week-stats-row.week-not-completed td {
    background-color: rgba(239, 68, 68, 0.15);
}
.macro-weeks-table tr.macro-week-stats-row.is-collapsed {
    display: none;
}
.macro-weeks-table .week-stats-line {
    padding-left: 0.5rem !important;
}
.macro-weeks-table .week-details-toggle {
    margin-bottom: 0.35rem;
}
.macro-weeks-table .week-stats-week-label {
    font-weight: 600;
    margin-right: 0.5rem;
}
.macro-weeks-table .week-stats-inline {
    white-space: normal;
}

.macro-weeks-table .week-training-comment-block {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
}
.macro-weeks-table .week-training-comment-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.macro-weeks-table .week-training-comment-input {
    width: 100%;
    max-width: 36rem;
    min-height: 3rem;
    padding: 0.4rem 0.5rem;
    font: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    resize: vertical;
}
/* Таблица по движениям: КПШ под КПШ, УО под УО и т.д. */
.base-stats-with-count-wrap {
    display: inline-flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}
.base-exercises-count-side {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.2rem 0 0 0;
}
.base-exercises-count-side .base-exercises-count-label {
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.base-exercises-count-side .base-exercises-count-list {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.base-exercises-count-side .base-exercise-count-line {
    display: block;
}
.macro-weeks-table .base-movement-stats-table {
    display: inline-table;
    border-collapse: collapse;
    font-size: inherit;
    margin: 0.2rem 0 0 0.5rem;
    vertical-align: top;
}
.macro-weeks-table .base-movement-stats-table th,
.macro-weeks-table .base-movement-stats-table td {
    padding: 0.1rem 0.5rem 0.1rem 0;
    border: none;
    text-align: left;
}
.macro-weeks-table .base-movement-stats-table th:not(:first-child),
.macro-weeks-table .base-movement-stats-table td:not(:first-child) {
    text-align: right;
    min-width: 2.5rem;
}
.macro-weeks-table .base-movement-stats-table thead th {
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.macro-weeks-table .base-movement-stats-table tbody td:first-child {
    padding-right: 0.75rem;
}
.macro-weeks-table .base-movement-stats-table .base-stat-max {
    font-weight: 700;
    color: #dc2626;
}
.macro-weeks-table .base-movement-stats-table .base-stat-min {
    font-weight: 700;
    color: #16a34a;
}
/* Макс/мин повторений по мышечным группам */
.macro-weeks-table .week-stats-inline .vol-reps-max {
    font-weight: 700;
    color: #dc2626;
}
.macro-weeks-table .week-stats-inline .vol-reps-min {
    font-weight: 700;
    color: #16a34a;
}

/* Личные кабинеты */
.cabinet-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.cabinet-card-link:hover .athlete-card {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(29, 108, 181, 0.12);
}

.cabinet-card .cabinet-hint {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    color: var(--accent);
}

.athlete-cabinet .cabinet-header {
    margin-bottom: 2rem;
}

.athlete-cabinet .back-link {
    display: inline-block;
    margin-bottom: 1rem;
}

.cabinet-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cabinet-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-input);
}

.cabinet-photo-placeholder {
    width: 96px;
    height: 96px;
    background: var(--accent-light);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border-radius: 50%;
}

.cabinet-hero h1 {
    margin: 0 0 0.35rem 0;
    font-size: 1.5rem;
}

.cabinet-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.cabinet-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.cabinet-block h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.cabinet-block p {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cabinet-block .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.cabinet-block-telegram {
    margin-bottom: 1.25rem;
}

.cabinet-telegram-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
}

.cabinet-telegram-form textarea {
    display: block;
    width: 100%;
    max-width: 40rem;
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    line-height: 1.45;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    resize: vertical;
    min-height: 6rem;
}

.cabinet-telegram-meta {
    margin-top: 1rem;
    margin-bottom: 0;
}

.cabinet-list {
    margin: 0 0 1rem 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
}

.cabinet-list li {
    margin-bottom: 0.35rem;
}

.cabinet-list a {
    color: var(--accent);
    text-decoration: none;
}

/* CAMP: те же блоки, что и cabinet */
.camp-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.camp-athletes-list,
.camp-weeks-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.camp-athletes-list li,
.camp-weeks-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.camp-athletes-list a,
.camp-weeks-list a {
    color: var(--accent);
    text-decoration: none;
}

.add-athlete-form,
.add-week-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.add-athlete-form select { min-width: 12rem; }

.weekly-winners-block {
    margin-bottom: 1.25rem;
}

.weekly-winners-block h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
}

.winners-list {
    margin: 0;
    padding-left: 1.25rem;
}

/* CAMP: «Победители по неделям» — полная ширина контейнера, таблица */
.camp-detail-section .camp-winners-fullwidth {
    width: 100%;
    margin-top: 1.75rem;
}

.camp-winners-panel {
    width: 100%;
    padding: 1.35rem 1.5rem 1.5rem;
}

.camp-winners-panel > h2 {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}

.camp-winners-hint {
    max-width: 72rem;
    margin-bottom: 1.25rem !important;
}

.camp-week-winners-card {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.camp-week-winners-card:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.camp-week-winners-header h3 {
    margin: 0 0 0.85rem 0;
    font-size: 1.05rem;
    color: var(--text);
    padding: 0.5rem 0.75rem;
    background: linear-gradient(90deg, var(--accent-light) 0%, transparent 100%);
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
}

.camp-winners-table-wrap {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: 0 1px 3px rgba(29, 108, 181, 0.08);
}

.camp-winners-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.camp-winners-table.table th,
.camp-winners-table.table td {
    border-left: none;
    border-right: none;
    border-top: none;
}

.camp-winners-table thead th {
    background: var(--accent-light);
    color: var(--text);
    font-weight: 600;
    padding: 0.65rem 0.55rem;
    text-align: center;
    border-bottom: 2px solid var(--border);
    vertical-align: middle;
}

.camp-winners-table th.camp-col-name,
.camp-winners-table td.camp-col-name {
    text-align: left;
}

.camp-winners-table th.camp-col-rank,
.camp-winners-table td.camp-col-rank {
    width: 3rem;
    text-align: center;
}

.camp-winners-table th.camp-col-sum,
.camp-winners-table td.camp-col-sum {
    width: 5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.camp-winners-table td {
    padding: 0.6rem 0.55rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.camp-winners-table tbody tr:last-child td {
    border-bottom: none;
}

.camp-winners-table tbody tr:hover td {
    background: rgba(29, 108, 181, 0.045);
}

.camp-col-name a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.camp-col-name a:hover {
    text-decoration: underline;
}

.camp-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--bg-input);
    font-weight: 700;
    font-size: 0.88rem;
}

.camp-row-top1 .camp-rank-badge {
    background: linear-gradient(135deg, #fff9e6 0%, #ffe082 100%);
    color: #5d4a00;
    box-shadow: 0 0 0 1px rgba(180, 140, 0, 0.35);
}

.camp-row-top2 .camp-rank-badge {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #424242;
    box-shadow: 0 0 0 1px rgba(120, 120, 120, 0.25);
}

.camp-row-top3 .camp-rank-badge {
    background: linear-gradient(135deg, #fff4e6 0%, #ffcc80 100%);
    color: #5d3a00;
    box-shadow: 0 0 0 1px rgba(180, 100, 0, 0.3);
}

.camp-row-top1 td {
    background: linear-gradient(90deg, rgba(255, 224, 130, 0.14) 0%, transparent 58%);
}

.camp-row-top2 td {
    background: linear-gradient(90deg, rgba(189, 189, 189, 0.12) 0%, transparent 58%);
}

.camp-row-top3 td {
    background: linear-gradient(90deg, rgba(255, 183, 77, 0.11) 0%, transparent 58%);
}

.camp-tables-n {
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 0.15rem;
}

@media (max-width: 720px) {
    .camp-winners-table th.camp-col-metric,
    .camp-winners-table td.camp-col-metric {
        font-size: 0.78rem;
        padding: 0.45rem 0.3rem;
    }

    .camp-winners-table th.camp-col-name,
    .camp-winners-table td.camp-col-name {
        padding-left: 0.45rem;
    }
}

.hero-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* CAMP: шапка страницы — ссылка «назад» сверху, заголовок и кнопки в одной строке */
.camp-detail-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.camp-detail-hero .back-link {
    display: inline-block;
    margin-bottom: 0;
}

.camp-detail-hero .hero-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.camp-detail-hero .hero-title-row h1 {
    margin: 0;
    flex: 1 1 auto;
}

.camp-detail-hero .hero-actions {
    flex-shrink: 0;
}

.camp-detail-hero .hero-inline-form {
    display: inline;
}

/* Списки участников/недель: форма в строке не ломает выравнивание */
.camp-athletes-list .inline-form,
.camp-weeks-list .inline-form {
    display: inline-flex;
    flex-shrink: 0;
}

.camp-weeks-list li span {
    flex: 1 1 auto;
    min-width: 0;
}

.camp-athletes-list li a {
    flex: 1 1 auto;
    min-width: 0;
}

/* Сетка карточек CAMP на главной — компактнее */
.cards-grid-camps {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.cards-grid-camps .athlete-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.cards-grid-camps .athlete-card h2 {
    margin: 0 0 0.35rem 0;
    font-size: 1.15rem;
}

.cards-grid-camps .athlete-card .muted {
    margin: 0;
    font-size: 0.85rem;
}

.cabinet-list a:hover {
    text-decoration: underline;
}

.cabinet-tariff-dl {
    margin: 0 0 1rem 0;
    display: grid;
    gap: 0.35rem;
}
.cabinet-tariff-dl dt {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.cabinet-tariff-dl dd {
    margin: 0;
    font-size: 1rem;
}
.cabinet-tariff-dl dd .hint {
    font-weight: normal;
    font-size: 0.9rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 600px) {
    .field-row { grid-template-columns: 1fr; }
}

/* Базовые движения */
.base-movements-add {
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.base-movements-add h2 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

.base-movement-form .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
}

.radio-label input {
    width: auto;
}

/* Подсказки мезоплан + прошлая неделя (составление микроплана) */
.macro-planning-hints {
    margin: 0 0 1.5rem 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(29, 108, 181, 0.06), rgba(22, 163, 74, 0.05));
    max-width: 56rem;
}
.macro-planning-hints__title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--accent);
}
.macro-planning-hints__meta {
    margin: 0 0 1rem 0;
}
.macro-planning-hints__block {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.macro-planning-hints__block--prev {
    border-top-width: 2px;
    border-top-color: rgba(29, 108, 181, 0.35);
}
.macro-planning-hints__block--empty {
    opacity: 0.95;
}
.macro-planning-hints__h {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.macro-planning-hints__label {
    font-weight: 600;
    color: var(--text-muted, #64748b);
}
.macro-planning-hints__table {
    font-size: 0.9rem;
    margin-top: 0.35rem;
}
.macro-planning-hints__table-hint {
    margin-bottom: 0.5rem;
}
.macro-planning-hints__strategy {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre-wrap;
}
.macro-planning-hints__bests {
    margin: 0.5rem 0 0.75rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}
.macro-planning-hints__week {
    margin-top: 0.75rem;
}
.macro-planning-hints__week-purpose {
    margin: 0 0 0.35rem 0;
    font-size: 0.9rem;
}
.macro-planning-hints__day {
    margin: 0.5rem 0 0 0.5rem;
    padding-left: 0.75rem;
    border-left: 3px solid rgba(29, 108, 181, 0.35);
    font-size: 0.88rem;
}
.macro-planning-hints__ex-list {
    margin: 0.35rem 0 0 1rem;
    padding: 0;
    line-height: 1.45;
}

/* Микроплан: подсветка заполненности (красный / зелёный) */
.plan-completeness-hint {
    max-width: 52rem;
    line-height: 1.45;
}
.plan-completeness-hint .plan-hint-bad {
    color: #dc2626;
    font-weight: 600;
}
.plan-completeness-hint .plan-hint-ok {
    color: #16a34a;
    font-weight: 600;
}
.plan-macro-fields .field {
    margin-bottom: 0.75rem;
}
.plan-macro-fields .field:last-child {
    margin-bottom: 0;
}
.planning-form .field.field-plan-valid > input:not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.planning-form .field.field-plan-valid > select,
.planning-form .field.field-plan-valid > textarea {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18);
}
.planning-form .field.field-plan-invalid > input:not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.planning-form .field.field-plan-invalid > select,
.planning-form .field.field-plan-invalid > textarea {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}
.planning-form .ex-item.ex-item-plan-valid .exercise-params input[type="number"] {
    border-color: #16a34a;
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.2);
}
.planning-form .ex-item.ex-item-plan-invalid .exercise-params input[type="number"] {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.25);
}
.planning-form .day-field.day-field-plan-invalid {
    outline: 2px solid rgba(220, 38, 38, 0.55);
    outline-offset: 4px;
    border-radius: 8px;
    padding: 0.35rem;
    margin: -0.35rem;
}

.week-block {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-subtle, #f8fafc);
    border-radius: 6px;
}

.week-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.week-row .field { min-width: 120px; }
.week-row .field-flex { flex: 1; min-width: 180px; }
.week-row .field-btn { flex-shrink: 0; }

.week-period-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--border);
}
.week-period-row .field { min-width: 120px; }
.week-period-row .field-flex { flex: 1; min-width: 200px; }

.week-days-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.day-field {
    margin-bottom: 0;
}

.day-field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--accent);
}

.day-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.day-head-row label { margin: 0; }
.day-date-weigh-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}
.day-date-weigh-row .field { min-width: 120px; }

.day-field textarea {
    width: 100%;
    min-height: 120px;
}

.day-ex-hint { margin-bottom: 0.5rem; font-size: 0.85rem; }

.day-exercise-add {
    margin-bottom: 0.75rem;
}

.day-exercise-picker-wrap {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    overflow: hidden;
}

.day-exercise-picker-summary {
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    list-style: none;
}
.day-exercise-picker-wrap[open] .day-exercise-picker-summary {
    border-bottom: 1px solid var(--border);
}
.day-exercise-picker-summary::-webkit-details-marker { display: none; }

.day-exercise-picker {
    max-height: min(50vh, 22rem);
    overflow-y: auto;
    padding: 0.5rem 0.65rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.65rem 1rem;
    align-content: start;
}

.day-ex-picker-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.day-ex-picker-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.day-ex-picker-list li {
    margin-bottom: 0.2rem;
}

.day-ex-picker-label {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.85rem;
    line-height: 1.35;
    cursor: pointer;
}

.day-ex-picker-label input.day-ex-cb {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.day-exercise-picker-actions {
    padding: 0.5rem 0.65rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.day-exercise-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.day-exercise-list li.ex-item {
    display: block;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.day-exercise-list .ex-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.day-exercise-list .ex-item-move {
    display: flex;
    gap: 0.2rem;
}
.day-exercise-list .ex-item-move .btn-icon {
    padding: 0.2rem 0.35rem;
    font-size: 0.85rem;
}
.day-exercise-list .ex-name { flex: 1; min-width: 0; }
.day-exercise-list .ex-replace-select {
    max-width: 10rem;
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
}

.day-exercise-list .exercise-params {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.day-exercise-list .isolation-params {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}
.day-exercise-list .isolation-params label { margin: 0; font-weight: 500; }
.day-exercise-list .isolation-params input { width: 5rem; }

.day-exercise-list .base-params .params-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    color: var(--text-muted);
}
.day-exercise-list .base-blocks-list { margin-bottom: 0.35rem; }
.day-exercise-list .base-block-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
}
.day-exercise-list .base-block-row input.base-p { width: 4.5rem; }
.day-exercise-list .base-block-row input.base-r,
.day-exercise-list .base-block-row input.base-s { width: 4rem; }
.day-exercise-list .base-block-row span { color: var(--text-muted); }
.day-exercise-list .base-weight-display {
    min-width: 4rem;
    font-weight: 600;
    color: var(--accent);
}
.day-exercise-list .btn-add-base-block { margin-top: 0.25rem; }
.day-exercise-list .base-movement-stats {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.day-exercise-list .base-movement-stats .base-stat-kpsh,
.day-exercise-list .base-movement-stats .base-stat-oi,
.day-exercise-list .base-movement-stats .base-stat-uo,
.day-exercise-list .base-movement-stats .base-stat-tonnage {
    font-weight: 600;
    color: var(--text);
}
.btn-small { font-size: 0.8rem; padding: 0.25rem 0.5rem; }

.day-exercise-list .ex-name {
    font-size: 0.9rem;
}

.day-exercise-list .btn-remove-exercise {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 0.3rem;
}

.day-exercise-list .btn-remove-exercise:hover {
    color: var(--error);
}

.base-movement-form .field-flex { flex: 1; min-width: 200px; }
.base-movement-form .field-btn { flex-shrink: 0; }

.add-more-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1.25rem 0 0.75rem 0;
}

.tab-btn {
    padding: 0.4rem 0.9rem;
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

.tab-content { margin-top: 0.75rem; }

.base-movements-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.movement-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.movement-group h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.exercise-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.exercise-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.exercise-list .exercise-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.exercise-list .exercise-name {
    font-weight: 500;
}

.exercise-list .exercise-muscle-work {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.exercise-list .exercise-muscle-work em {
    font-style: normal;
}

.exercise-list .exercise-actions {
    flex-shrink: 0;
}

.exercise-list li:last-child {
    border-bottom: none;
}

.exercise-list .btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.exercise-list .btn-icon:hover {
    color: var(--error);
    background: rgba(184, 84, 80, 0.1);
}

.exercise-list .btn-icon[href]:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.exercise-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.exercise-actions .btn-icon {
    text-decoration: none;
}

.empty-hint {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.isolation-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.isolation-block h2 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
}

.movement-group-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.movement-group-head h3 {
    margin: 0;
}
.btn-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
}
.btn-link:hover {
    text-decoration: underline;
}
.movement-group-edit-toolbar {
    margin: 0.5rem 0 0.75rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.bulk-delete-form {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.bulk-delete-form .btn-danger {
    background: var(--error);
    color: #fff;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
}
.bulk-delete-form .btn-danger:hover {
    filter: brightness(1.1);
}
.exercise-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    cursor: default;
}
.movement-group .ex-checkbox {
    display: none;
    flex-shrink: 0;
    cursor: pointer;
}
.movement-group.edit-mode .ex-checkbox {
    display: inline-block;
}
.movement-group.edit-mode .exercise-list-item .exercise-info {
    flex: 1;
    min-width: 0;
}

@media (max-width: 900px) {
    .isolation-sections { grid-template-columns: 1fr; }
}

.categories-add {
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.categories-add h2 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

.categories-add-list {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.categories-add-list h3 {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

.categories-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.categories-block h2 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.category-list li:last-child { border-bottom: none; }
.category-list li.empty-hint { color: var(--text-muted); }

@media (max-width: 768px) {
    .categories-lists { grid-template-columns: 1fr; }
}

/* Работа мышечных групп в упражнении */
.muscle-work-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.muscle-work-section h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

.bulk-exercises-list {
    margin: 0 0 1.5rem 0;
    padding: 0.75rem 0;
}
.bulk-exercises-list .badge {
    margin-right: 0.35rem;
    margin-bottom: 0.35rem;
}
.coefficient-row .field-coef input {
    width: 4rem;
}
.coefficient-row .btn-remove-row {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}
.coefficient-row .btn-remove-row:hover {
    color: var(--error);
}

.muscle-work-add {
    margin-bottom: 1rem;
}

.muscle-work-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.muscle-work-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.muscle-work-list li:last-child { border-bottom: none; }

.mw-name { flex: 1; font-weight: 500; }
.mw-coef-input {
    width: 4rem;
    padding: 0.35rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}

.mw-edit-form {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Перечень упражнений спортсмена */
.athlete-exercises-form .exercise-category-block {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.athlete-exercises-form .exercise-category-block h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text);
}
.athlete-exercises-form .exercise-checkbox-list {
    list-style: none;
    margin: 0.5rem 0 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.35rem;
}
.athlete-exercises-form .exercise-checkbox-list .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
}
.athlete-exercises-form .toggle-category {
    margin-bottom: 0.5rem;
}

.copy-exercises-block {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.copy-form.inline-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.copy-form.inline-form select { min-width: 12rem; }
