:root,
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #eef2f1;
    --surface: #ffffff;
    --surface-muted: #f6f8f7;
    --surface-strong: #e7eeec;
    --text: #17211f;
    --text-muted: #63706d;
    --border: #d9e2df;
    --brand: #1f5d53;
    --brand-strong: #17483f;
    --brand-soft: #dff1ec;
    --success: #237a57;
    --success-soft: #def4e7;
    --warning: #996515;
    --warning-soft: #fff2d5;
    --danger: #a53636;
    --danger-soft: #fde8e8;
    --info: #365d91;
    --info-soft: #e8f0fb;
    --shadow: 0 10px 28px rgb(20 45 39 / 8%);
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] {
        color-scheme: dark;
        --bg: #0d1110;
        --surface: #141918;
        --surface-muted: #1a201e;
        --surface-strong: #222a27;
        --text: #f0f4f2;
        --text-muted: #aeb9b5;
        --border: #303936;
        --brand: #69bca8;
        --brand-strong: #85d0be;
        --brand-soft: #182823;
        --success: #7bc8a2;
        --success-soft: #1a2c24;
        --warning: #dfbd73;
        --warning-soft: #30291c;
        --danger: #ed9696;
        --danger-soft: #342222;
        --info: #93b8e4;
        --info-soft: #202a38;
        --shadow: 0 10px 28px rgb(0 0 0 / 20%);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0d1110;
    --surface: #141918;
    --surface-muted: #1a201e;
    --surface-strong: #222a27;
    --text: #f0f4f2;
    --text-muted: #aeb9b5;
    --border: #303936;
    --brand: #69bca8;
    --brand-strong: #85d0be;
    --brand-soft: #182823;
    --success: #7bc8a2;
    --success-soft: #1a2c24;
    --warning: #dfbd73;
    --warning-soft: #30291c;
    --danger: #ed9696;
    --danger-soft: #342222;
    --info: #93b8e4;
    --info-soft: #202a38;
    --shadow: 0 10px 28px rgb(0 0 0 / 20%);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-padding-top: 92px; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }

/* Dark theme uses neutral surfaces. Green remains an accent instead of
   tinting every large panel and creating a patchwork dashboard. */
@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] .site-header {
        background: rgb(20 25 24 / 96%);
        backdrop-filter: blur(10px);
    }
    :root[data-theme="system"] .home-notification--unread,
    :root[data-theme="system"] .notification-item--unread {
        background: var(--surface-muted);
    }
}

:root[data-theme="dark"] .site-header {
    background: rgb(20 25 24 / 96%);
    backdrop-filter: blur(10px);
}
:root[data-theme="dark"] .home-notification--unread,
:root[data-theme="dark"] .notification-item--unread {
    background: var(--surface-muted);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(14px);
}
.site-header__content {
    width: min(100% - 24px, 1480px);
    min-height: 68px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
}
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    white-space: nowrap;
}
.site-brand__mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 11px;
    background: var(--brand);
    color: #fff;
    font-size: 13px;
}
.site-brand__text { font-size: 17px; }
.main-nav-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-width: 0;
    align-items: center;
    gap: 5px;
}
.main-nav {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.main-nav::-webkit-scrollbar { height: 5px; }
.main-nav::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--border); }
.main-nav-scroll {
    display: inline-grid;
    width: 32px;
    height: 36px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-muted);
    color: var(--text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.main-nav-scroll:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.main-nav-scroll:disabled { cursor: default; opacity: .35; }
.main-nav-scroll[hidden] { display: none; }
.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 11px;
    border-radius: 9px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--surface-muted); }
.nav-link--active { color: var(--brand-strong); background: var(--brand-soft); }
.header-tools { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.user-name { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-muted); }
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-muted);
    color: var(--text);
    cursor: pointer;
}
.theme-toggle__label { font-size: 12px; }

.page { width: min(100% - 24px, 1480px); min-width: 0; margin: 24px auto 48px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.page-header h1 { margin: 0 0 5px; font-size: clamp(25px, 3vw, 34px); }
.page-header p { margin: 0; color: var(--text-muted); }
.page-actions, .form-actions, .table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.card, .summary-card, .chart-card, .record-card, .period-card, .table-wrap {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.card { padding: 18px; }
.form-card { max-width: 720px; }
.card h1, .card h2 { margin-top: 0; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    font-weight: 750;
    cursor: pointer;
}
.button:hover { background: var(--brand-strong); }
.button--secondary { border-color: var(--border); background: var(--surface-muted); color: var(--text); }
.button--secondary:hover { background: var(--surface-strong); }
.button--danger { background: var(--danger); color: #fff; }
.button--danger:hover { filter: brightness(.9); }
.button--small { min-height: 32px; padding: 5px 9px; font-size: 13px; }

.message { margin-bottom: 12px; padding: 11px 14px; border-radius: 10px; background: var(--info-soft); color: var(--text); }
.message--success { background: var(--success-soft); }
.message--error { background: var(--danger-soft); }
.message--warning { background: var(--warning-soft); }
.errorlist { margin: 6px 0 0; padding-left: 20px; color: var(--danger); }

.form-field { min-width: 0; }
.form-field label, .form-label { display: block; margin-bottom: 5px; font-size: 12px; color: var(--text-muted); font-weight: 750; }
.form-field input, .form-field select, .form-field textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text);
}
.form-field textarea { min-height: 96px; resize: vertical; }
.checkbox-field { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.checkbox-field input { width: auto; }

.compact-filter { padding: 14px; box-shadow: none; }
.compact-filter__grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; }
.compact-filter .form-actions { margin-top: 11px; }
.quick-links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.quick-link { padding: 5px 9px; border-radius: 999px; background: var(--surface-muted); color: var(--text-muted); text-decoration: none; font-size: 12px; font-weight: 700; }
.quick-link:hover { color: var(--text); background: var(--surface-strong); }

.journal-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, .8fr); gap: 14px; margin-bottom: 14px; align-items: stretch; }
.journal-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.summary-card { padding: 14px; box-shadow: none; }
.summary-card span { display: block; color: var(--text-muted); font-size: 12px; }
.summary-card strong { display: block; margin-top: 5px; font-size: clamp(20px, 2vw, 28px); }
.summary-card small { color: var(--text-muted); }

.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.chart-card { min-width: 0; padding: 16px; box-shadow: none; }
.chart-card--wide { grid-column: 1 / -1; }
.chart-card h2 { margin: 0 0 4px; font-size: 17px; }
.chart-card__subtitle { margin: 0 0 14px; color: var(--text-muted); font-size: 12px; }
.bar-chart { display: flex; align-items: flex-end; gap: 7px; min-height: 190px; padding-top: 15px; overflow-x: auto; }
.bar-chart__item { display: flex; min-width: 34px; height: 170px; flex: 1 0 34px; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
.bar-chart__value { font-size: 10px; color: var(--text-muted); }
.bar-chart__bar { display: block; width: min(26px, 80%); min-height: 3px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--brand-strong), var(--brand)); }
.bar-chart__label { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.horizontal-chart { display: grid; gap: 10px; }
.horizontal-chart__row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, 2fr) auto; gap: 10px; align-items: center; }
.horizontal-chart__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.horizontal-chart__track { height: 11px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.horizontal-chart__bar { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-strong)); }
.horizontal-chart__value { font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-chart { display: flex; height: 24px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.status-chart__segment { display: block; width: 0; min-width: 0; }
.status-chart__segment--pending { background: var(--warning); }
.status-chart__segment--accepted { background: var(--success); }
.status-chart__segment--cancelled { background: var(--danger); }
.status-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.status-legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.status-legend__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.status-legend__dot--pending { background: var(--warning); }
.status-legend__dot--accepted { background: var(--success); }
.status-legend__dot--cancelled { background: var(--danger); }
.chart-empty { color: var(--text-muted); font-size: 13px; }

.period-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 10px; margin-bottom: 14px; }
.period-mini { padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.period-mini__head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.period-mini p { margin: 5px 0 0; color: var(--text-muted); font-size: 12px; }
.period-progress { height: 8px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.period-progress__bar { width: calc(var(--value) * 1%); height: 100%; background: var(--brand); border-radius: inherit; }
.period-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.period-card { padding: 16px; box-shadow: none; }
.period-card__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.period-card h2 { margin: 0; font-size: 18px; }
.period-card p { margin: 4px 0; color: var(--text-muted); }
.period-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 13px 0; }
.period-card__stat { padding: 9px; border-radius: 9px; background: var(--surface-muted); }
.period-card__stat span { display: block; font-size: 10px; color: var(--text-muted); }
.period-card__stat strong { font-size: 17px; }

.status-badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-badge--accepted { background: var(--success-soft); color: var(--success); }
.status-badge--cancelled, .status-badge--closed { background: var(--danger-soft); color: var(--danger); }
.status-badge--open { background: var(--warning-soft); color: var(--warning); }
.status-group { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }

.record-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.record-card { padding: 14px; box-shadow: none; }
.record-card__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.record-card__product { margin: 5px 0 12px; color: var(--text-muted); }
.record-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.record-meta div { min-width: 0; }
.record-meta dt { margin-bottom: 2px; color: var(--text-muted); font-size: 10px; }
.record-meta dd { margin: 0; font-weight: 750; overflow-wrap: anywhere; }
.record-card__reason { margin: 11px 0 0; padding: 9px; border-radius: 8px; background: var(--danger-soft); font-size: 12px; }
.record-card__actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--border); }

.table-wrap, .table-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}
.table-wrap { box-shadow: none; }
.data-table.session-table { min-width: 600px; }
.session-table td:first-child { min-width: 220px; overflow-wrap: anywhere; }
.comparison-columns > .card,
.comparison-periods > .card { min-width: 0; }
.data-table { width: 100%; min-width: 930px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; font-size: 13px; }
.data-table th { position: static; background: var(--surface-muted); color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.data-table tbody tr:hover { background: var(--surface-muted); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-sort { display: inline-flex; gap: 4px; color: inherit; text-decoration: none; white-space: nowrap; }
.table-summary { margin: 0 0 7px; color: var(--text-muted); font-size: 12px; }

.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 12px; }
.pagination__links { display: flex; gap: 6px; }
.pagination__links:last-child { justify-content: flex-end; }
.pagination__status { text-align: center; color: var(--text-muted); font-size: 12px; }

.audit-list { display: grid; gap: 9px; }
.audit-event { padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.audit-event__head { display: flex; justify-content: space-between; gap: 10px; }
.audit-event__meta { color: var(--text-muted); font-size: 12px; }
.audit-event__comment { margin: 9px 0 0; padding: 9px 11px; border-radius: 9px; background: var(--info-soft); font-size: 12px; }
.audit-change-list { display: grid; gap: 7px; margin-top: 10px; }
.audit-change { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(120px, 1fr) auto minmax(120px, 1fr); gap: 9px; align-items: center; padding: 9px 10px; border-radius: 9px; background: var(--surface-muted); }
.audit-change__label { color: var(--text-muted); font-size: 12px; font-weight: 750; }
.audit-change__value { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.audit-change__value--before { text-decoration: line-through; color: var(--text-muted); }
.audit-change__value--after { font-weight: 800; color: var(--text); }
.audit-change__arrow { color: var(--text-muted); }
.compact-filter + .audit-list, .compact-filter + .empty-state { margin-top: 14px; }
.empty-state { text-align: center; color: var(--text-muted); }

@media (max-width: 1380px) {
    .site-header__content {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 8px 0;
    }
    .site-brand { grid-column: 1; }
    .header-tools { grid-column: 2; }
    .main-nav-shell { grid-column: 1 / -1; grid-row: 2; width: 100%; }
    .journal-top { grid-template-columns: 1fr; }
    .compact-filter__grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
}

@media (max-width: 1040px) {
    .user-name, .theme-toggle__label, .onboarding-help__label { display: none; }
    .theme-toggle, .onboarding-help { width: 36px; justify-content: center; padding: 6px; }
}

@media (max-width: 760px) {
    .site-header__content { display: flex; flex-wrap: wrap; gap: 8px; }
    .site-brand { flex: 1; }
    .site-brand__text { font-size: 15px; }
    .main-nav-shell { order: 3; width: 100%; }
    .header-tools { margin-left: auto; }
    .user-name, .theme-toggle__label, .onboarding-help__label { display: none; }
    .page { margin-top: 16px; }
    .page-header { flex-direction: column; }
    .page-actions { width: 100%; }
    .summary-grid, .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .chart-card--wide { grid-column: auto; }
    .compact-filter__grid { grid-template-columns: 1fr 1fr; }
    .journal-summary { grid-template-columns: 1fr 1fr; }
    .record-meta { grid-template-columns: 1fr; }
    .pagination { grid-template-columns: 1fr; }
    .pagination__links, .pagination__links:last-child { justify-content: center; flex-wrap: wrap; }
    .audit-change { grid-template-columns: 1fr; gap: 4px; }
    .audit-change__arrow { display: none; }
}

@media (max-width: 480px) {
    .page { width: min(100% - 16px, 1480px); }
    .site-header__content { width: min(100% - 16px, 1480px); }
    .summary-grid, .dashboard-grid, .compact-filter__grid, .journal-summary { grid-template-columns: 1fr; }
    .horizontal-chart__row { grid-template-columns: minmax(95px, 1fr) minmax(80px, 1.3fr) auto; }
    .period-grid { grid-template-columns: 1fr; }
    .record-grid { grid-template-columns: 1fr; }
}

/* Notifications and role dashboards */
.notification-link { position: relative; display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; }
.notification-link:hover, .notification-link--active { border-color: var(--brand); background: var(--brand-soft); }
.notification-count { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border: 2px solid var(--surface); border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 900; line-height: 15px; text-align: center; }
.notification-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.notification-tab { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-muted); font-size: 13px; font-weight: 750; text-decoration: none; }
.notification-tab--active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.notification-list { display: grid; gap: 9px; }
.notification-item { display: grid; grid-template-columns: 5px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.notification-item--unread { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); background: var(--brand-soft); }
.notification-item__marker { align-self: stretch; border-radius: 999px; background: transparent; }
.notification-item--unread .notification-item__marker { background: var(--brand); }
.notification-item__head { display: flex; justify-content: space-between; gap: 12px; }
.notification-item__head a { color: var(--text); font-weight: 850; text-decoration: none; }
.notification-item__head time { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.notification-item p { margin: 5px 0; color: var(--text-muted); }
.notification-item__meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--text-muted); font-size: 11px; }
.notification-item__meta span + span::before { content: "·"; margin-right: 8px; }
.eyebrow { margin: 0 0 5px; color: var(--brand-strong); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-home__stats { margin-top: 0; }
.dashboard-home__columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.section-heading > a { color: var(--brand-strong); font-size: 12px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.home-period-list, .home-notification-list { display: grid; gap: 8px; }
.home-period { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; background: var(--surface-muted); }
.home-period > div:first-child { display: grid; gap: 2px; }
.home-period span { color: var(--text-muted); font-size: 11px; }
.home-period__values { display: flex; gap: 8px; align-items: center; }
.home-period__values > span:first-child { color: var(--text); font-size: 13px; font-weight: 850; }
.home-notification { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px; border-radius: 10px; background: var(--surface-muted); color: var(--text); text-decoration: none; }
.home-notification--unread { padding-left: 14px; background: var(--brand-soft); }
.home-notification--unread::before { position: absolute; top: 10px; bottom: 10px; left: 5px; width: 3px; border-radius: 999px; background: var(--brand); content: ""; }
.home-notification strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-notification span { grid-column: 1 / -1; color: var(--text-muted); font-size: 11px; }
.home-notification time { color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.dashboard-records-table { min-width: 760px; }
@media (max-width: 900px) { .dashboard-home__columns { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .notification-item { grid-template-columns: 4px minmax(0, 1fr); } .notification-item > form { grid-column: 2; } .notification-item__head { display: grid; gap: 3px; } }


/* User-managed external notification channels */
.channel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.channel-card { display: flex; flex-direction: column; gap: 12px; }
.channel-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.channel-card__head h2 { margin: 0 0 4px; }
.channel-card__head p { margin: 0; color: var(--text-muted); font-size: 12px; }
.channel-state { padding: 4px 8px; border-radius: 999px; background: var(--surface-strong); color: var(--text-muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.channel-state--ok { background: var(--success-soft); color: var(--success); }
.connected-account { margin: 0; padding: 9px 11px; border-radius: 9px; background: var(--success-soft); }
.event-settings { margin-bottom: 14px; }
.event-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.event-choice { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); }
.delivery-history { margin-top: 18px; }
.muted { color: var(--text-muted); }
@media (max-width: 900px) { .channel-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .event-choice-grid { grid-template-columns: 1fr; } .channel-card .button { width: 100%; } }


/* Unified calendar workspace */
.workspace-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}
.workspace-tab {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}
.workspace-tab:hover { border-color: var(--brand); background: var(--brand-soft); }
.workspace-tab--active { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 -3px 0 var(--brand); }
.workspace-tab__title { font-weight: 900; }
.workspace-tab__hint { overflow: hidden; color: var(--text-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-section { display: grid; gap: 14px; }
.workspace-section > .section-heading { margin: 0; }
.calendar-filter { margin: 0; }
.calendar-summary { margin: 0; }

.month-card { padding: 14px; }
.month-card__head {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    text-align: center;
}
.month-card__head h3 { margin: 0; font-size: 18px; text-transform: capitalize; }
.month-card__head p { margin: 2px 0 0; color: var(--text-muted); font-size: 11px; }
.month-arrow {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
    text-decoration: none;
}
.month-arrow:hover { border-color: var(--brand); background: var(--brand-soft); }
.month-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px 13px; margin: 0 0 12px; color: var(--text-muted); font-size: 11px; }
.month-legend--left { justify-content: flex-start; margin: 0; }
.month-legend span { display: inline-flex; gap: 5px; align-items: center; }
.state-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 999px; background: #868e96; }
.state-dot--filled { background: #2f9e44; }
.state-dot--missing, .state-dot--rejected { background: #e03131; }
.state-dot--approved { background: #228be6; }
.state-dot--pending { background: #fab005; }
.state-dot--nonworking, .state-dot--upcoming { background: #868e96; }

.month-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month-board__weekday { padding: 3px 2px; color: var(--text-muted); font-size: 10px; font-weight: 900; text-align: center; text-transform: uppercase; }
.month-day {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 2px 5px;
    min-width: 0;
    min-height: 64px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--text);
    text-decoration: none;
}
a.month-day:hover { border-color: var(--brand); transform: translateY(-1px); }
.month-day strong { font-size: 15px; line-height: 1; }
.month-day .state-dot { align-self: center; justify-self: end; }
.month-day small { grid-column: 1 / -1; overflow: hidden; color: var(--text-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.month-day--filled { border-color: rgba(47,158,68,.35); background: rgba(47,158,68,.10); }
.month-day--approved { border-color: rgba(34,139,230,.35); background: rgba(34,139,230,.10); }
.month-day--pending { border-color: rgba(250,176,5,.45); background: rgba(250,176,5,.13); }
.month-day--missing, .month-day--rejected { border-color: rgba(224,49,49,.42); background: rgba(224,49,49,.10); }
.month-day--nonworking, .month-day--upcoming { opacity: .7; }
.month-day--empty { border-color: transparent; background: transparent; }

.attention-card { padding: 14px; }
.attention-count { display: inline-flex; min-width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 999px; background: var(--danger-soft); color: var(--danger); }
.attention-list { display: grid; gap: 7px; }
.attention-row {
    display: grid;
    grid-template-columns: 82px minmax(150px, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
    scroll-margin-top: 90px;
}
.attention-row__date { display: grid; gap: 2px; }
.attention-row__date span, .attention-row__state small { color: var(--text-muted); font-size: 11px; }
.attention-row__state { display: grid; gap: 4px; }
.attention-row__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.status-badge--missing, .status-badge--rejected { background: var(--danger-soft); color: var(--danger); }
.status-badge--pending { background: rgba(250,176,5,.18); color: #9c6b00; }

.calendar-bulk-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.calendar-bulk-tools p { flex: 1 1 280px; margin: 0; color: var(--text-muted); font-size: 11px; }
.calendar-editor { padding: 0; overflow: hidden; }
.calendar-editor__head { margin: 0; padding: 14px; border-bottom: 1px solid var(--border); }
.calendar-editor__table-wrap { margin: 0; border: 0; border-radius: 0; }
.calendar-editor-table { width: 100%; min-width: 780px; }
.calendar-editor-table th, .calendar-editor-table td { padding: 7px 9px; vertical-align: middle; }
.calendar-editor-table tbody th { width: 64px; white-space: nowrap; }
.calendar-editor-table select, .calendar-editor-table input { width: 100%; min-height: 34px; box-sizing: border-box; }
.calendar-editor-table select { min-width: 190px; }
.calendar-editor-table input { min-width: 220px; }
.calendar-editor-table small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 9px; }
.calendar-effective { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: var(--surface-strong); font-size: 10px; font-weight: 800; }
.calendar-effective--working, .calendar-effective--shortened { background: rgba(47,158,68,.13); color: #237a35; }
.calendar-effective--weekend, .calendar-effective--holiday { color: var(--text-muted); }
.calendar-editor__footer {
    position: sticky;
    bottom: 0;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 -6px 18px rgba(0,0,0,.06);
}
.calendar-editor__footer > div { display: grid; gap: 2px; }
.calendar-editor__footer span { color: var(--text-muted); font-size: 10px; }

.completeness-wrap { max-height: 70vh; }
.completeness-table { font-size: 12px; }
.completeness-table th:first-child { position: sticky; left: 0; z-index: 3; min-width: 180px; background: var(--surface); }
.completeness-cell { min-width: 105px; padding: 7px !important; vertical-align: top; }
.completeness-cell strong, .completeness-cell small, .completeness-cell a { display: block; }
.completeness-cell strong { font-size: 10px; }
.completeness-cell small, .completeness-cell a { margin-top: 3px; font-size: 9px; }
.completeness-cell--filled { background: rgba(47,158,68,.14); }
.completeness-cell--approved { background: rgba(34,139,230,.14); }
.completeness-cell--pending { background: rgba(250,176,5,.2); }
.completeness-cell--missing, .completeness-cell--rejected { background: rgba(224,49,49,.14); }
.completeness-cell--nonworking, .completeness-cell--upcoming { opacity: .68; }
.form-card--wide { max-width: 1000px; }

@media (max-width: 760px) {
    .workspace-tabs { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; }
    .workspace-tab { min-width: 148px; padding: 9px 11px; }
    .workspace-tab__hint { display: none; }
    .month-card { padding: 10px; }
    .month-board { gap: 3px; }
    .month-day { min-height: 47px; padding: 5px; border-radius: 7px; }
    .month-day strong { font-size: 13px; }
    .month-day small { display: none; }
    .month-legend { justify-content: flex-start; }
    .attention-row { grid-template-columns: 62px minmax(0, 1fr); gap: 8px; }
    .attention-row__actions { grid-column: 1 / -1; justify-content: flex-start; }
    .attention-row__actions .button { flex: 1 1 auto; }
    .calendar-bulk-tools form, .calendar-bulk-tools .button { width: 100%; }
    .calendar-editor__footer { align-items: stretch; flex-direction: column; }
    .calendar-editor__footer .button { width: 100%; }
    .completeness-table { font-size: 10px; }
}

@media (max-width: 420px) {
    .month-board__weekday { font-size: 9px; }
    .month-day { min-height: 42px; }
    .month-day .state-dot { width: 6px; height: 6px; flex-basis: 6px; }
}


/* Импорт, справочники и сравнение */
.split-layout { display: grid; gap: 18px; margin-bottom: 18px; }
.split-layout--wide { grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); }
.import-card { max-width: none; }
.import-template-card { align-self: start; }
.stack-actions { display: grid; gap: 10px; }
.import-confirm { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; border-color: var(--success); }
.import-confirm h2, .import-confirm p { margin: 0; }
.import-confirm p { margin-top: 5px; color: var(--text-muted); }
.import-preview td:nth-child(2) { min-width: 360px; }
.import-preview td:nth-child(2) div { margin: 2px 0; }
.row-error { background: var(--danger-soft); }
.error-list { margin: 0; padding-left: 18px; color: var(--danger); }
.summary-card__status { font-size: 18px !important; }
.status-badge--ready { background: var(--info-soft); color: var(--info); }
.status-badge--invalid { background: var(--danger-soft); color: var(--danger); }
.status-badge--imported { background: var(--success-soft); color: var(--success); }
.comparison-picker { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 14px; }
.comparison-periods { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: center; margin: 18px 0; }
.comparison-periods .card { text-align: center; }
.comparison-periods h2 { margin: 5px 0; }
.comparison-periods p, .comparison-periods span { color: var(--text-muted); }
.comparison-arrow { font-size: 28px; color: var(--text-muted); }
.comparison-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.comparison-table th { min-width: 120px; }
.delta { font-weight: 800; }
.delta--up { color: var(--success); }
.delta--down { color: var(--danger); }
@media (max-width: 900px) {
    .split-layout--wide, .comparison-columns { grid-template-columns: 1fr; }
    .comparison-picker { grid-template-columns: 1fr; }
    .comparison-periods { grid-template-columns: 1fr; }
    .comparison-arrow { transform: rotate(90deg); justify-self: center; }
    .import-confirm { align-items: stretch; flex-direction: column; }
    .import-preview td:nth-child(2) { min-width: 260px; }
}


/* Login help dialogs */
.login-card { max-width: 520px; margin: 0 auto; }
.login-help-links { display:flex; flex-wrap:wrap; gap:12px; margin-top:18px; }
.link-button { border:0; padding:0; background:none; color:var(--link-color, #2563eb); text-decoration:underline; cursor:pointer; font:inherit; }
.app-dialog { width:min(520px, calc(100vw - 32px)); border:0; border-radius:18px; padding:0; box-shadow:0 24px 80px rgba(15,23,42,.28); }
.app-dialog::backdrop { background:rgba(15,23,42,.55); }
.app-dialog__body { position:relative; padding:24px; margin:0; }
.app-dialog__close { position:absolute; right:12px; top:8px; border:0; background:none; font-size:28px; cursor:pointer; }
.app-dialog h2 { padding-right:32px; }

/* First-login interactive onboarding */
.onboarding-help {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-muted);
    color: var(--text);
    cursor: pointer;
}
.onboarding-help:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
}
.onboarding-help > span:first-child {
    display: inline-grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}
.onboarding-help__label { font-size: 12px; }

body.onboarding-open { overflow: hidden; }
.site-header--onboarding {
    z-index: 1102;
    pointer-events: none;
}
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgb(4 13 11 / 66%);
    backdrop-filter: blur(2px);
}
.onboarding-target {
    position: relative;
    z-index: 1103;
    border-radius: 10px;
    outline: 3px solid #fff;
    outline-offset: 4px;
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--brand) 80%, transparent);
}
.onboarding-tooltip {
    position: fixed;
    z-index: 1104;
    width: min(390px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 22px 70px rgb(0 0 0 / 38%);
}
.onboarding-tooltip__progress {
    margin-bottom: 7px;
    color: var(--brand-strong);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.onboarding-tooltip h2 {
    margin: 0 0 8px;
    font-size: 20px;
}
.onboarding-tooltip > p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}
.onboarding-tooltip__error {
    margin-top: 12px !important;
    padding: 9px 10px;
    border-radius: 9px;
    background: var(--danger-soft);
    color: var(--danger) !important;
    font-size: 12px;
    font-weight: 700;
}
.onboarding-tooltip__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}
.onboarding-tooltip__spacer { flex: 1; }
.onboarding-tooltip button:disabled {
    cursor: wait;
    opacity: .65;
}

@media (max-width: 760px) {
    .onboarding-help__label { display: none; }
    .onboarding-help {
        width: 36px;
        justify-content: center;
        padding: 6px;
    }
    .onboarding-tooltip {
        width: calc(100vw - 16px);
        padding: 15px;
    }
    .onboarding-tooltip__actions {
        flex-wrap: wrap;
    }
    .onboarding-tooltip__spacer {
        display: none;
    }
    .onboarding-tooltip__actions .button {
        flex: 1;
    }
    .onboarding-tooltip__actions [data-onboarding-skip] {
        flex-basis: 100%;
        order: 3;
    }
}


/* Multi-page onboarding course and launcher */
.onboarding-launcher {
    width: min(560px, calc(100vw - 24px));
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 80px rgb(0 0 0 / 35%);
}
.onboarding-launcher::backdrop { background: rgb(4 13 11 / 62%); backdrop-filter: blur(2px); }
.onboarding-launcher__body { position: relative; margin: 0; padding: 24px; }
.onboarding-launcher__body h2 { margin: 0 0 8px; }
.onboarding-launcher__body > p:not(.eyebrow) { margin: 0; color: var(--text-muted); line-height: 1.5; }
.onboarding-launcher__close { position: absolute; top: 9px; right: 12px; border: 0; background: transparent; color: var(--text-muted); font-size: 28px; cursor: pointer; }
.onboarding-launcher__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.onboarding-launcher__actions .button { width: 100%; }
.onboarding-launcher__actions .button:disabled { cursor: not-allowed; opacity: .45; }
.onboarding-tooltip__module { margin-bottom: 4px; color: var(--text-muted); font-size: 11px; font-weight: 800; }

@media (max-width: 560px) {
    .onboarding-launcher__body { padding: 20px; }
    .onboarding-launcher__actions { grid-template-columns: 1fr; }
    .main-nav-scroll { width: 30px; flex-basis: 30px; }
}

/* Role-based onboarding demonstration data */
body.training-demo-active main.page > :not(.training-demo-stage) {
    display: none !important;
}
.training-demo-stage {
    min-height: calc(100vh - 140px);
}
.training-demo-stage__banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 14px;
    border: 1px solid color-mix(in srgb, var(--info) 42%, var(--border));
    border-radius: 12px;
    background: var(--info-soft);
}
.training-demo-stage__banner strong {
    color: var(--info);
}
.training-demo-stage__banner span {
    color: var(--text-muted);
    font-size: 13px;
}
.training-demo-stage__content {
    display: grid;
    gap: 14px;
    pointer-events: none;
}
.training-demo__hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    align-items: stretch;
    gap: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(135deg, var(--surface), var(--brand-soft));
    box-shadow: var(--shadow);
}
.training-demo__hero h1 {
    margin: 0 0 8px;
    font-size: clamp(27px, 4vw, 42px);
}
.training-demo__hero p:not(.eyebrow) {
    max-width: 760px;
    margin: 0;
    color: var(--text-muted);
    font-size: 17px;
    line-height: 1.55;
}
.training-demo__snapshot {
    display: flex;
    min-height: 150px;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.training-demo__snapshot span,
.training-demo__snapshot small {
    color: var(--text-muted);
}
.training-demo__snapshot strong {
    margin: 7px 0;
    color: var(--brand-strong);
    font-size: 34px;
}
.training-process {
    display: grid;
    grid-template-columns: repeat(9, auto);
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.training-process article {
    display: grid;
    min-width: 135px;
    min-height: 94px;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 12px;
    border-radius: 12px;
    background: var(--surface-muted);
    text-align: center;
}
.training-process article strong {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
}
.training-process article span {
    font-size: 13px;
    font-weight: 750;
}
.training-process > i {
    color: var(--brand);
    font-size: 22px;
    font-style: normal;
    font-weight: 900;
}
.training-demo__notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--info) 35%, var(--border));
    border-radius: 12px;
    background: var(--info-soft);
}
.training-demo__notice strong {
    flex: 0 0 auto;
}
.training-demo__notice span {
    color: var(--text-muted);
    line-height: 1.45;
}
.training-demo__grid {
    display: grid;
    gap: 14px;
}
.training-demo__grid--entry {
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, .75fr);
    align-items: start;
}
.training-demo__grid--period,
.training-demo__grid--report {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}
.training-demo__form,
.training-demo__result,
.training-period-ready,
.training-sheet {
    min-height: 100%;
}
.training-demo__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}
.training-demo__fields label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 750;
}
.training-demo__fields input {
    width: 100%;
    margin-top: 5px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-muted);
    color: var(--text);
}
.training-demo__result {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.training-demo__result h3 {
    margin: 14px 0 4px;
    font-size: 24px;
}
.training-demo__result p,
.training-demo__result small {
    color: var(--text-muted);
}
.training-records {
    display: grid;
    gap: 9px;
}
.training-records article {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-muted);
}
.training-records article > span:not(.status-badge) {
    display: grid;
    gap: 3px;
}
.training-records article small {
    color: var(--danger);
    line-height: 1.35;
}
.training-records--manager article {
    grid-template-columns: minmax(150px, .7fr) minmax(0, 1.2fr) auto;
}
.training-records--manager article small {
    grid-column: 1 / -1;
    color: var(--text-muted);
}
.training-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(100px, 1fr));
    gap: 8px;
    margin: 16px 0;
}
.training-calendar > div {
    display: grid;
    min-height: 120px;
    align-content: space-between;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-muted);
}
.training-calendar > div > span {
    color: var(--text-muted);
    font-size: 12px;
}
.training-calendar > div > strong {
    font-size: 27px;
}
.training-calendar__attention {
    border-color: var(--danger) !important;
    background: var(--danger-soft) !important;
}
.training-state {
    display: inline-flex;
    width: fit-content;
    padding: 4px 7px;
    border-radius: 999px;
    font-weight: 750;
}
.training-state--accepted { background: var(--success-soft); color: var(--success); }
.training-state--pending { background: var(--warning-soft); color: var(--warning); }
.training-state--missing { background: var(--danger-soft); color: var(--danger); }
.training-state--absence { background: var(--info-soft); color: var(--info); }
.training-state--off { background: var(--surface-strong); color: var(--text-muted); }
.training-attention {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border-radius: 11px;
    background: var(--danger-soft);
}
.training-attention span {
    color: var(--danger);
}
.training-notifications {
    display: grid;
    gap: 9px;
    margin-bottom: 14px;
}
.training-notification {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-muted);
}
.training-notification p {
    grid-column: 1;
    margin: 0;
    color: var(--text-muted);
}
.training-notification > span {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    color: var(--text-muted);
    font-size: 12px;
}
.training-notification--important {
    border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
    background: var(--danger-soft);
}
.training-demo__finish {
    padding: 15px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    text-align: center;
    font-weight: 850;
}
.training-demo__finish b {
    margin: 0 8px;
}
.training-table-wrap {
    overflow-x: auto;
    margin: 16px 0;
}
.training-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}
.training-table th,
.training-table td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}
.training-table th:first-child,
.training-table td:first-child {
    text-align: left;
}
.training-number {
    display: inline-grid;
    min-width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    background: var(--info-soft);
    color: var(--info);
}
.training-number--pending { background: var(--warning-soft); color: var(--warning); }
.training-number--missing { background: var(--danger-soft); color: var(--danger); }
.training-cases {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}
.training-cases article {
    display: grid;
    gap: 5px;
    padding: 12px;
    border-radius: 10px;
    background: var(--surface-muted);
}
.training-cases span {
    color: var(--text-muted);
    font-size: 13px;
}
.training-filter {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 14px;
}
.training-filter label {
    display: grid;
    gap: 5px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 12px;
}
.training-filter strong {
    color: var(--text);
    font-size: 14px;
}
.training-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(220px, 1.2fr);
    gap: 9px;
    margin-top: 14px;
}
.training-summary article {
    display: grid;
    gap: 6px;
    min-height: 92px;
    align-content: center;
    padding: 12px;
    border-radius: 10px;
    background: var(--surface-muted);
}
.training-summary span { color: var(--text-muted); font-size: 12px; }
.training-summary strong { font-size: 24px; }
.training-mini-chart {
    grid-template-columns: repeat(4, 1fr);
    align-items: end;
}
.training-mini-chart span { grid-column: 1 / -1; }
.training-mini-chart i {
    display: block;
    min-height: 12px;
    border-radius: 5px 5px 0 0;
    background: var(--brand);
}
.training-demo__grid--period dl {
    display: grid;
    gap: 7px;
    margin: 16px 0;
}
.training-demo__grid--period dl div {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}
.training-demo__grid--period dt { color: var(--text-muted); }
.training-demo__grid--period dd { margin: 0; font-weight: 850; }
.training-period-ready {
    border-color: color-mix(in srgb, var(--success) 40%, var(--border));
    background: linear-gradient(180deg, var(--surface), var(--success-soft));
}
.training-sheet__head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}
.training-sheet__head span { color: var(--text-muted); }
.training-sheet table {
    width: 100%;
    border-collapse: collapse;
}
.training-sheet th,
.training-sheet td {
    padding: 10px;
    border: 1px solid var(--border);
    text-align: left;
}
.training-sheet th { background: var(--surface-muted); }
.training-technical {
    display: grid;
    gap: 16px;
}

@media (max-width: 1050px) {
    .training-process {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    .training-process > i { display: none; }
    .training-process article { min-width: 0; }
    .training-calendar { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
    .training-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .training-demo-stage__banner,
    .training-demo__notice,
    .training-attention {
        align-items: flex-start;
        flex-direction: column;
    }
    .training-demo__hero,
    .training-demo__grid--entry,
    .training-demo__grid--period,
    .training-demo__grid--report {
        grid-template-columns: 1fr;
    }
    .training-process { grid-template-columns: 1fr; }
    .training-process article { min-height: 70px; }
    .training-demo__fields,
    .training-filter,
    .training-cases,
    .training-summary {
        grid-template-columns: 1fr;
    }
    .training-records article,
    .training-records--manager article {
        grid-template-columns: 1fr;
    }
    .training-calendar { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
    .training-notification { grid-template-columns: 1fr; }
    .training-notification p,
    .training-notification > span { grid-column: 1; grid-row: auto; }
}

.telegram-link-progress { display: grid; gap: 20px; max-width: 760px; margin: 0 auto; }
.telegram-link-progress__status { display: flex; align-items: flex-start; gap: 14px; }
.telegram-link-progress__status h2 { margin: 0 0 6px; }
.telegram-link-progress__status p { margin: 0; color: var(--text-muted); }
.telegram-link-progress__icon { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-strong); font-size: 24px; font-weight: 800; }
.telegram-link-progress--success .telegram-link-progress__icon { background: var(--success-soft); color: var(--success); }
.telegram-link-progress--error .telegram-link-progress__icon { background: var(--danger-soft); color: var(--danger); }
.telegram-link-progress__help { padding: 14px 16px; border-radius: 10px; background: var(--surface-strong); }
.telegram-link-progress__help ol { margin: 8px 0 0; padding-left: 22px; }
.telegram-link-progress__help li + li { margin-top: 6px; }
.telegram-link-progress form[data-link-test-form] { display: flex; gap: 10px; flex-wrap: wrap; }
.telegram-link-progress form[data-link-test-form][hidden] { display: none; }
@media (max-width: 520px) {
    .telegram-link-progress__status { align-items: center; }
    .telegram-link-progress .page-actions,
    .telegram-link-progress form[data-link-test-form] { flex-direction: column; }
    .telegram-link-progress .button { width: 100%; }
}
.channel-connect-steps { display: grid; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--surface-strong); color: var(--text-muted); font-size: 13px; }
.channel-connect-steps strong { color: var(--text); }
