/**
 * GULUEV ЛК — общая дизайн-система (lk-design-system.css).
 * Структура, скругления и тени — из «ЛК директора РОП guluev.html».
 * Цвета — фирменные (#283C86, #4A62A4, #E9ECEF, #D4EDDA), без градиентов.
 */

:root {
    /* Палитра: primary #283C86, accent #4A62A4, surface #E9ECEF, success #D4EDDA */
    --lk-color-primary: #283c86;
    --lk-color-primary-dark: #1f2f6b;
    --lk-color-primary-border: #4a62a4;
    --lk-color-primary-light: #eef0f6;
    --lk-color-accent-border: #4a62a4;
    --lk-color-page-bg: #eef1f7;
    --lk-color-surface: #ffffff;
    --lk-color-text: #141b2e;
    --lk-color-text-muted: #525c6e;
    --lk-color-text-subtle: #909bb0;
    --lk-color-text-heading: #283c86;
    --lk-color-border: #e9ecef;
    --lk-color-border-light: #e9ecef;
    --lk-color-hover-row: #eef0f6;
    --lk-color-hover-row-alt: #fafbfe;
    --lk-color-total-row: #d4edda;
    --lk-color-total-row-border: #79ae79;
    --lk-color-total-row-neutral: #e9ecef;

    /* Шапка приложения */
    --lk-header-top: var(--lk-color-primary);
    --lk-header-bottom: var(--lk-color-primary-dark);
    /* UI kit: шапки таблиц */
    --lk-table-header-primary-bg: var(--lk-color-primary);
    --lk-table-header-primary-text: #ffffff;
    --lk-table-header-secondary-bg: #e9ecef;
    --lk-table-header-secondary-text: #475569;
    --lk-table-header-secondary-border: #dde2e8;
    --lk-table-header-bg: var(--lk-table-header-primary-bg);

    /* Типографика */
    --lk-font-family: 'Golos Text', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --lk-font-display: 'Unbounded', 'Golos Text', sans-serif;
    --lk-font-size-xs: 12px;
    --lk-font-size-sm: 13px;
    --lk-font-size-base: 14px;
    --lk-font-size-md: 15px;
    --lk-font-size-lg: 16px;
    --lk-font-size-xl: 24px;
    --lk-font-size-page-title: 32px;
    --lk-font-weight-normal: 400;
    --lk-font-weight-medium: 500;
    --lk-font-weight-semibold: 600;
    --lk-font-weight-bold: 700;
    --lk-letter-spacing-caps: 0.04em;
    --lk-letter-spacing-caps-wide: 0.05em;
    --lk-letter-spacing-label: 0.08em;
    --lk-line-height-tight: 1.2;

    /* Отступы и радиусы */
    --lk-space-2xs: 4px;
    --lk-space-xs: 6px;
    --lk-space-sm: 10px;
    --lk-space-md: 12px;
    --lk-space-lg: 16px;
    --lk-space-xl: 20px;
    --lk-space-2xl: 24px;
    --lk-space-3xl: 28px;
    --lk-space-4xl: 32px;
    --lk-space-5xl: 40px;
    --lk-section-gap: var(--lk-space-3xl);
    --lk-section-header-gap: var(--lk-space-xl);
    --lk-page-padding-x: 20px;
    --lk-page-padding-bottom: var(--lk-space-5xl);
    --lk-page-max-width: 1400px;
    --lk-page-max-width-wide: 1600px;
    /* Скругления и тени — по документу «ЛК директора РОП guluev.html» */
    --lk-radius-sm: 11px;
    --lk-radius-md: 16px;
    --lk-radius-lg: 22px;
    --lk-radius-xl: 16px;
    --lk-shadow-elevated:
        0 1px 2px rgba(40, 60, 134, 0.04),
        0 6px 16px rgba(40, 60, 134, 0.06),
        0 18px 40px rgba(40, 60, 134, 0.05);
    --lk-shadow-card:
        0 1px 2px rgba(40, 60, 134, 0.05),
        0 4px 12px rgba(40, 60, 134, 0.06);
    --lk-shadow-summary: var(--lk-shadow-elevated);
    --lk-shadow-lg:
        0 10px 30px rgba(40, 60, 134, 0.10),
        0 30px 70px rgba(40, 60, 134, 0.14);
    --lk-ring: 0 0 0 3px rgba(40, 60, 134, 0.16);
    --lk-bento-bg: #eef1f7;
    --lk-bento-border: #dde2e8;
}

/* --- Базовая страница --- */

body.lk-app {
    margin: 0;
    font-family: var(--lk-font-family);
    font-size: var(--lk-font-size-base);
    color: var(--lk-color-text);
    background: var(--lk-color-page-bg);
}

.lk-page {
    max-width: var(--lk-page-max-width);
    margin: 0 auto;
    padding: 0 var(--lk-page-padding-x) var(--lk-page-padding-bottom);
}

.lk-page--wide {
    max-width: var(--lk-page-max-width-wide);
}

/* --- Оболочка main.html --- */

.lk-main > * {
    width: 100%;
    max-width: var(--lk-page-max-width-wide);
    margin-inline: auto;
}

.lk-main .lk-page {
    padding: 0;
}

.lk-main.lk-main--tabs .lk-section__title {
    display: none;
}

.lk-main.lk-main--tabs .lk-view .lk-section__title {
    display: block;
}

.guest-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

/* --- Гостевые страницы (логин, 404 без layout) --- */

.lk-login {
    width: 100%;
    max-width: 420px;
}

.lk-login__card {
    padding: var(--lk-space-4xl) var(--lk-space-3xl);
}

.lk-login__title {
    margin: 0 0 var(--lk-space-3xl);
    font-family: var(--lk-font-display);
    font-size: 22px;
    font-weight: var(--lk-font-weight-bold);
    color: var(--lk-color-text-heading);
    text-align: center;
}

.lk-login__form {
    display: grid;
    gap: var(--lk-space-lg);
}

.lk-login__messages {
    display: grid;
    gap: var(--lk-space-sm);
    margin-bottom: var(--lk-space-lg);
}

.lk-login__submit {
    width: 100%;
    margin-top: var(--lk-space-xs);
}

.lk-login__footer {
    margin-top: var(--lk-space-2xl);
    padding-top: var(--lk-space-xl);
    border-top: 1px solid var(--lk-color-border);
    text-align: center;
}

.lk-login__footer a {
    color: var(--lk-color-primary);
    font-size: var(--lk-font-size-sm);
    text-decoration: none;
}

.lk-login__footer a:hover {
    text-decoration: underline;
}

.lk-alert {
    padding: var(--lk-space-sm) var(--lk-space-md);
    border-radius: var(--lk-radius-sm);
    font-size: var(--lk-font-size-sm);
}

.lk-alert--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.lk-404 {
    width: 100%;
    max-width: 520px;
}

.lk-404__card {
    padding: var(--lk-space-5xl) var(--lk-space-3xl) var(--lk-space-3xl);
    text-align: center;
}

.lk-404__code {
    font-family: var(--lk-font-display);
    font-size: 72px;
    font-weight: var(--lk-font-weight-bold);
    line-height: 1;
    color: var(--lk-color-primary);
    letter-spacing: -0.04em;
    margin-bottom: var(--lk-space-md);
}

.lk-404__title {
    font-size: 22px;
    font-weight: var(--lk-font-weight-bold);
    color: var(--lk-color-text);
    margin: 0 0 var(--lk-space-md);
}

.lk-404__text {
    font-size: var(--lk-font-size-md);
    color: var(--lk-color-text-muted);
    line-height: 1.55;
    margin: 0 0 var(--lk-space-3xl);
}

.lk-404__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lk-space-md);
    justify-content: center;
}

.lk-404__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--lk-space-md) 22px;
    border-radius: var(--lk-radius-sm);
    font-size: var(--lk-font-size-md);
    font-weight: var(--lk-font-weight-semibold);
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.lk-404__btn--primary {
    background: var(--lk-color-primary);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(40, 60, 134, 0.26);
}

.lk-404__btn--primary:hover {
    background: var(--lk-color-primary-dark);
    color: #ffffff;
}

.lk-404__btn--ghost {
    background: var(--lk-color-surface);
    color: var(--lk-color-primary);
    border: 1px solid var(--lk-color-border);
    box-shadow: var(--lk-shadow-card);
}

.lk-404__btn--ghost:hover {
    background: var(--lk-color-primary-light);
    color: var(--lk-color-primary);
}

.lk-404__hint {
    margin-top: var(--lk-space-xl);
    font-size: var(--lk-font-size-sm);
    color: var(--lk-color-text-subtle);
}

.lk-404__card.lk-panel {
    padding: var(--lk-space-5xl) var(--lk-space-3xl) var(--lk-space-3xl);
}

/* --- Вкладки многостраничного отчёта (.lk-main--tabs) --- */

@keyframes lk-tab-fade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.lk-tabs,
.rop-tabs {
    display: flex;
    gap: 7px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.lk-tabs button,
.rop-tabs button {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    padding: 10px 17px;
    border-radius: var(--lk-radius-sm);
    font-family: var(--lk-font-family);
    font-weight: var(--lk-font-weight-bold);
    font-size: var(--lk-font-size-sm);
    line-height: var(--lk-line-height-tight);
    color: var(--lk-color-text-muted);
    background: var(--lk-color-surface);
    border: 1px solid var(--lk-color-border);
    transition: 0.16s;
    box-shadow: var(--lk-shadow-card);
}

.lk-tabs button:hover,
.rop-tabs button:hover {
    border-color: var(--lk-color-primary);
    color: var(--lk-color-primary);
    background: var(--lk-color-primary-light);
}

.lk-tabs button.on,
.rop-tabs button.on {
    background: var(--lk-color-primary);
    color: #fff;
    border-color: var(--lk-color-primary);
}

.lk-view,
.ropview {
    display: none;
    animation: lk-tab-fade 0.3s ease;
}

.lk-view.on,
.ropview.on {
    display: block;
}

@media (max-width: 560px) {
    .lk-tabs,
    .rop-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .lk-tabs button,
    .rop-tabs button {
        white-space: nowrap;
    }
}

/* --- Секция (блок дашборда / отчёта) --- */

.lk-section {
    margin-bottom: var(--lk-section-gap);
}

.lk-section__header {
    margin: 0 0 var(--lk-section-header-gap);
    padding: 0 var(--lk-space-2xs);
}

.lk-section__header h2,
.lk-section__title {
    margin: 0;
    font-family: var(--lk-font-family);
    font-size: var(--lk-font-size-xl);
    font-weight: var(--lk-font-weight-bold);
    color: var(--lk-color-primary);
    line-height: var(--lk-line-height-tight);
}

.lk-section__header p,
.lk-section__subtitle {
    margin: var(--lk-space-xs) 0 0;
    color: var(--lk-color-text-muted);
    font-size: var(--lk-font-size-base);
}

.lk-subsection-title {
    margin: var(--lk-space-2xl) 0 var(--lk-space-md);
    padding: 0 var(--lk-space-2xs);
    font-size: var(--lk-font-size-lg);
    font-weight: var(--lk-font-weight-semibold);
    color: var(--lk-color-text-heading);
}

.lk-hint {
    color: var(--lk-color-text-muted);
    font-size: var(--lk-font-size-sm);
    font-weight: var(--lk-font-weight-normal);
}

.lk-empty-message {
    padding: var(--lk-space-lg);
    color: var(--lk-color-text-subtle);
    font-size: var(--lk-font-size-base);
    text-align: center;
}

.lawyer-payouts-subtitle {
    margin: var(--lk-space-2xl) 0 var(--lk-space-md);
    padding: 0 var(--lk-space-2xs);
    font-size: var(--lk-font-size-lg);
    font-weight: var(--lk-font-weight-semibold);
    color: var(--lk-color-text-heading);
}

.income-hint {
    color: var(--lk-color-text-muted);
    font-size: var(--lk-font-size-sm);
    font-weight: var(--lk-font-weight-normal);
}

.lawyer-payouts-empty {
    padding: var(--lk-space-lg);
    color: var(--lk-color-text-subtle);
    font-size: var(--lk-font-size-base);
    text-align: center;
}

/* --- UI kit: таблицы --- */
/*
 * Primary  (.lk-table--primary) — синяя шапка, таблицы данных
 * Secondary (.lk-table--secondary) — серая шапка, любой блок «добавить …» (.lk-panel)
 */

/* Таблицы данных — как .tablewrap в прототипе: r-sm + shadow2 */
.lk-table-card,
.table-wrapper {
    background: var(--lk-color-surface);
    border-radius: var(--lk-radius-sm);
    border: 1px solid var(--lk-color-border);
    box-shadow: var(--lk-shadow-card);
    overflow-x: auto;
}

.lk-table-card:not(.lk-inline-action-form__card) > .lk-table--primary thead tr:first-child th:first-child,
.lk-table-card:not(.lk-inline-action-form__card) > .lk-table:not(.lk-table--secondary) thead tr:first-child th:first-child {
    border-top-left-radius: var(--lk-radius-sm);
}

.lk-table-card:not(.lk-inline-action-form__card) > .lk-table--primary thead tr:first-child th:last-child,
.lk-table-card:not(.lk-inline-action-form__card) > .lk-table:not(.lk-table--secondary) thead tr:first-child th:last-child {
    border-top-right-radius: var(--lk-radius-sm);
}

/* Внутри bento-панели таблица без «второй» тени — только белый вложенный блок */
.lk-inline-action-form .lk-table-card,
.lk-inline-action-form__card {
    box-shadow: none;
}

.lk-table-card + .lk-table-card,
.lk-table-card--spaced,
.table-wrapper--spaced {
    margin-top: var(--lk-space-xl);
    margin-bottom: var(--lk-space-xl);
}

.lk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--lk-font-size-base);
    color: var(--lk-color-text);
}

/* Primary — шапка данных (по умолчанию для .lk-table без --secondary) */
.lk-table--primary thead tr,
.lk-table:not(.lk-table--secondary) thead tr {
    background: var(--lk-table-header-primary-bg);
    color: var(--lk-table-header-primary-text);
}

.lk-table--primary thead th,
.lk-table:not(.lk-table--secondary) thead th {
    padding: var(--lk-space-md) var(--lk-space-lg);
    font-size: var(--lk-font-size-sm);
    font-weight: var(--lk-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--lk-letter-spacing-caps);
    text-align: center;
    color: var(--lk-table-header-primary-text);
    border-bottom: 1px solid var(--lk-color-border-light);
}

/* Secondary — шапка форм «добавить …» (серый стиль) */
.lk-table--secondary thead tr,
.lk-panel .lk-table thead tr,
.lk-panel__table-card .lk-table thead tr,
.lk-inline-action-form .lk-table thead tr,
.lk-inline-action-form__card .lk-table thead tr,
.lk-add-payment-form .lk-table thead tr,
.lk-bento-panel .lk-table thead tr {
    background: var(--lk-table-header-secondary-bg);
    color: var(--lk-table-header-secondary-text);
}

.lk-table--secondary thead th,
.lk-panel .lk-table thead th,
.lk-panel__table-card .lk-table thead th,
.lk-inline-action-form .lk-table thead th,
.lk-inline-action-form__card .lk-table thead th,
.lk-add-payment-form .lk-table thead th,
.lk-bento-panel .lk-table thead th {
    padding: var(--lk-space-sm) var(--lk-space-lg);
    font-size: var(--lk-font-size-xs);
    font-weight: var(--lk-font-weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--lk-letter-spacing-caps);
    text-align: center;
    color: var(--lk-table-header-secondary-text);
    border-bottom: 1px solid var(--lk-table-header-secondary-border);
    background: var(--lk-table-header-secondary-bg);
}

.lk-panel__table-card .lk-table thead tr:first-child th:first-child,
.lk-panel__table-card .lk-table--secondary thead tr:first-child th:first-child,
.lk-inline-action-form__card .lk-table thead tr:first-child th:first-child,
.lk-inline-action-form__card .lk-table--secondary thead tr:first-child th:first-child {
    border-top-left-radius: var(--lk-radius-sm);
}

.lk-panel__table-card .lk-table thead tr:first-child th:last-child,
.lk-panel__table-card .lk-table--secondary thead tr:first-child th:last-child,
.lk-inline-action-form__card .lk-table thead tr:first-child th:last-child,
.lk-inline-action-form__card .lk-table--secondary thead tr:first-child th:last-child {
    border-top-right-radius: var(--lk-radius-sm);
}

.lk-table thead tr:first-child th:first-child,
.lk-table--secondary thead tr:first-child th:first-child {
    text-align: left;
}

.lk-table thead th:not(:first-child) {
    text-align: center;
}

.lk-table td.text-end {
    text-align: right;
}

.lk-matrix-report-table thead th.sticky-col,
.lk-salary-matrix-table thead th.sticky-col,
.lawyer-task-matrix-table thead th.date-col,
.lawyer-task-matrix-table thead th.lawyer-col {
    text-align: left;
}

.lk-table td {
    padding: var(--lk-space-md) var(--lk-space-lg);
    border-bottom: 1px solid var(--lk-color-border-light);
}

.lk-table tbody td:first-child {
    text-align: left;
}

.lk-table tbody td:not(:first-child) {
    text-align: center;
}

.lk-table tbody tr:hover {
    background: var(--lk-color-hover-row);
}

.lk-table td.currency {
    font-weight: var(--lk-font-weight-semibold);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.lk-table td.comment-cell,
.lk-table td.description-cell {
    color: var(--lk-color-text-muted);
    font-size: var(--lk-font-size-sm);
    text-align: left;
}

.lk-table tr.subtotal-row td {
    background: var(--lk-color-hover-row-alt);
    font-weight: var(--lk-font-weight-medium);
    color: var(--lk-color-text-heading);
}

.lk-table tr.total-row td,
.lk-table .lk-table__row-total td,
.lk-table .income-row-total td {
    background: var(--lk-color-total-row-neutral);
    font-weight: var(--lk-font-weight-semibold);
}

.lk-table .income-row-total {
    background: var(--lk-color-total-row);
    border-top: 2px solid var(--lk-color-total-row-border);
    font-weight: var(--lk-font-weight-semibold);
}

.lk-table .income-row-total td {
    background: var(--lk-color-total-row);
    border-bottom: none;
}

.lk-section--personal-income .lk-personal-income-table thead th.text-end {
    text-align: right;
}

.lk-section--personal-income .lk-personal-income-table td.text-end {
    font-variant-numeric: tabular-nums;
}

.lk-section--personal-income .lk-personal-income-table td:first-child {
    font-weight: var(--lk-font-weight-medium);
}

.lk-section--personal-income .personal-income-empty {
    color: var(--lk-color-text-subtle);
    font-weight: var(--lk-font-weight-normal);
}

.lk-section--personal-income .lk-personal-income-table .income-row-total {
    border-top: 2px solid var(--lk-color-total-row-border);
}

.lk-section--personal-income .lk-personal-income-table .income-row-total td {
    background: #cfe6d8;
    font-weight: var(--lk-font-weight-bold);
    border-bottom: none;
}

.lk-section--personal-income .lk-personal-income-table .income-row-total:hover td {
    background: #cfe6d8;
}

.lk-section--personal-income .lk-personal-income-table .income-row-total td:first-child {
    color: var(--lk-color-primary);
}

.lk-table-empty-row td {
    text-align: center;
    color: var(--lk-color-text-muted);
    font-style: italic;
    padding: var(--lk-space-4xl) var(--lk-space-lg);
}

/* Минимальная ширина — модификатор на .lk-table-card (горизонтальная прокрутка) */
.lk-table-card--min-480 .lk-table { min-width: 480px; }
.lk-table-card--min-520 .lk-table { min-width: 520px; }
.lk-table-card--min-560 .lk-table { min-width: 560px; }
.lk-table-card--min-640 .lk-table { min-width: 640px; }
.lk-table-card--min-920 .lk-table { min-width: 920px; }
.lk-table-card--min-980 .lk-table { min-width: 980px; }

.lawyer-dashboard-page,
.lk-dashboard-page {
    max-width: var(--lk-page-max-width);
    margin: 0 auto;
    padding: 0 var(--lk-page-padding-x) var(--lk-page-padding-bottom);
}

.lk-section--task-matrix .matrix-wrap {
    background: var(--lk-color-surface);
    border-radius: var(--lk-radius-sm);
    border: 1px solid var(--lk-color-border);
    box-shadow: var(--lk-shadow-card);
    overflow-x: auto;
}

.page {
    max-width: var(--lk-page-max-width-wide);
    margin: 0 auto;
    padding: var(--lk-space-lg) var(--lk-page-padding-x) var(--lk-page-padding-bottom);
}

/* --- Формы внутри секций --- */

.lk-form-panel {
    background: var(--lk-color-surface);
    border-radius: var(--lk-radius-md);
    border: 1px solid var(--lk-color-border);
    box-shadow: var(--lk-shadow-elevated);
    padding: var(--lk-space-xl);
    margin-top: var(--lk-space-xl);
}

.lk-form-panel__title {
    margin: 0 0 var(--lk-space-lg);
    font-size: var(--lk-font-size-lg);
    font-weight: var(--lk-font-weight-semibold);
    color: var(--lk-color-primary);
}

.lk-form-grid {
    display: grid;
    gap: var(--lk-space-lg);
}

.lk-form-field label {
    display: block;
    margin-bottom: var(--lk-space-2xs);
    font-size: var(--lk-font-size-sm);
    font-weight: var(--lk-font-weight-semibold);
    color: var(--lk-color-text-heading);
}

.lk-form-field input,
.lk-form-field select,
.lk-form-field textarea {
    width: 100%;
    padding: var(--lk-space-sm) var(--lk-space-md);
    font-size: var(--lk-font-size-base);
    border: 1px solid var(--lk-color-border);
    border-radius: var(--lk-radius-sm);
    color: var(--lk-color-text);
    background: var(--lk-color-surface);
}

.lk-form-field input:focus,
.lk-form-field select:focus,
.lk-form-field textarea:focus {
    outline: 2px solid var(--lk-color-accent-border);
    outline-offset: 1px;
    border-color: var(--lk-color-primary);
}

.lk-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--lk-space-sm) var(--lk-space-xl);
    border: none;
    border-radius: var(--lk-radius-sm);
    background: var(--lk-color-primary);
    color: #ffffff;
    font-size: var(--lk-font-size-base);
    font-weight: var(--lk-font-weight-semibold);
    cursor: pointer;
}

.lk-btn-primary:hover:not(:disabled) {
    background: var(--lk-color-primary-border);
}

.lk-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.lk-btn-icon {
    background: transparent;
    border: none;
    color: var(--lk-color-text-muted);
    cursor: pointer;
    padding: var(--lk-space-2xs);
}

.lk-btn-icon:hover {
    color: #dc2626;
}

/* Алиасы форм юриста */
.lawyer-acts-form,
.lawyer-expenses-form,
.night-hearings-form {
    background: var(--lk-color-surface);
    border-radius: var(--lk-radius-lg);
    border: 1px solid var(--lk-color-border);
    padding: var(--lk-space-xl);
    margin-top: var(--lk-space-xl);
}

.lawyer-acts-form__title,
.lawyer-expenses-form__title,
.night-hearings-form__title {
    margin: 0 0 var(--lk-space-lg);
    font-size: var(--lk-font-size-lg);
    font-weight: var(--lk-font-weight-semibold);
    color: var(--lk-color-primary);
}

.lawyer-acts-form__grid,
.lawyer-expenses-form__grid,
.night-hearings-form__grid {
    display: grid;
    gap: var(--lk-space-lg);
}

.form-field label {
    display: block;
    margin-bottom: var(--lk-space-2xs);
    font-size: var(--lk-font-size-sm);
    font-weight: var(--lk-font-weight-semibold);
    color: var(--lk-color-text-heading);
}

.form-field input,
.form-field select {
    width: 100%;
    padding: var(--lk-space-sm) var(--lk-space-md);
    font-size: var(--lk-font-size-base);
    border: 1px solid var(--lk-color-border);
    border-radius: var(--lk-radius-sm);
}

.add-act-btn,
.add-expense-btn,
.add-night-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--lk-space-sm) var(--lk-space-xl);
    border: none;
    border-radius: var(--lk-radius-sm);
    background: var(--lk-color-primary);
    color: #ffffff;
    font-weight: var(--lk-font-weight-semibold);
    cursor: pointer;
}

.add-act-btn:hover:not(:disabled),
.add-expense-btn:hover:not(:disabled),
.add-night-btn:hover:not(:disabled) {
    background: var(--lk-color-primary-border);
}

.delete-act-btn,
.delete-expense-btn,
.delete-night-btn {
    background: transparent;
    border: none;
    color: var(--lk-color-text-muted);
    cursor: pointer;
}

.delete-act-btn:hover,
.delete-expense-btn:hover,
.delete-night-btn:hover {
    color: #dc2626;
}

/* --- Display: заголовок страницы и summary-блок --- */
.top h1,
.lk-summary-block .dashboard-header h1 {
    margin: 0;
    font-family: var(--lk-font-display);
    font-size: 27px;
    font-weight: var(--lk-font-weight-bold);
    letter-spacing: -0.4px;
    line-height: 1.1;
    color: var(--lk-color-text-heading);
}

/* --- Summary-блок (период + KPI) --- */
.lk-summary-block .dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 28px;
    padding: 28px 30px 32px;
    border-radius: var(--lk-radius-md);
    background: transparent;
    border: 2px solid var(--lk-color-primary-border);
    box-shadow: none;
}

.lk-summary-block .dashboard-header p {
    margin: 4px 0 0;
    color: var(--lk-color-text-muted);
}

.lk-summary-block__back-link {
    color: var(--lk-color-primary);
    font-weight: var(--lk-font-weight-semibold);
    text-decoration: none;
}

.lk-summary-block__back-link:hover {
    text-decoration: underline;
}

.lk-summary-block .summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--lk-space-lg);
}

.lk-summary-block .summary-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 88px;
    background: var(--lk-color-surface);
    border-radius: var(--lk-radius-md);
    padding: 18px 20px;
    border: 1px solid var(--lk-color-border);
    box-shadow: var(--lk-shadow-elevated);
}

.lk-summary-block .summary-card .label {
    font-size: var(--lk-font-size-xs);
    letter-spacing: var(--lk-letter-spacing-label);
    text-transform: uppercase;
    color: var(--lk-color-text-subtle);
    margin-bottom: 4px;
}

.lk-summary-block .summary-card .value {
    margin-top: auto;
    font-size: var(--lk-font-size-xl);
    font-weight: var(--lk-font-weight-bold);
    color: var(--lk-color-text);
}

.lk-summary-block .period-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: var(--lk-space-lg);
    position: relative;
}

.lk-summary-block .period-selector__label {
    font-weight: var(--lk-font-weight-semibold);
    color: var(--lk-color-primary);
    order: 1;
}

.lk-summary-block .period-select-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.lk-summary-block .period-flower {
    position: relative;
    min-width: 220px;
    order: 2;
}

.lk-summary-block .period-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
    border: 1px solid var(--lk-color-accent-border);
    border-radius: 12px;
    background: var(--lk-color-surface);
    color: var(--lk-color-primary);
    box-shadow: var(--lk-shadow-card);
    font-size: var(--lk-font-size-md);
    font-weight: var(--lk-font-weight-semibold);
    cursor: pointer;
    transition: all 0.25s ease;
}

.lk-summary-block .period-trigger:hover {
    background: var(--lk-color-primary-light);
    border-color: var(--lk-color-primary-border);
}

.lk-summary-block .period-trigger:focus-visible {
    outline: 2px solid var(--lk-color-primary-border);
    outline-offset: 2px;
}

.lk-summary-block .period-trigger__icon {
    font-size: var(--lk-font-size-lg);
}

.lk-summary-block .period-flower-menu {
    position: absolute;
    left: 50%;
    bottom: calc(100% - 8px);
    pointer-events: none;
    z-index: 20;
}

.lk-summary-block .period-petal {
    position: absolute;
    left: 0;
    bottom: 0;
    min-width: 132px;
    padding: 9px 12px;
    border-radius: 18px 18px 18px 8px;
    border: 1px solid var(--lk-color-border);
    background: var(--lk-color-primary-light);
    color: var(--lk-color-primary);
    font-size: var(--lk-font-size-sm);
    font-weight: var(--lk-font-weight-semibold);
    cursor: pointer;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, 0) scale(0.78);
    box-shadow: 0 8px 20px -12px rgba(30, 58, 138, 0.85);
    transition: transform 0.34s cubic-bezier(.2, .9, .2, 1), opacity 0.22s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lk-summary-block .period-petal:hover {
    background: #e2e8f4;
    border-color: var(--lk-color-primary-border);
}

.lk-summary-block .period-petal.active {
    background: var(--lk-color-primary);
    border-color: var(--lk-color-primary-dark);
    color: #ffffff;
}

.lk-summary-block .period-flower.is-open .period-petal {
    opacity: 1;
    pointer-events: auto;
    transform: translate(calc(-50% + var(--x)), var(--y)) scale(1);
}

.lk-summary-block .period-petal:nth-child(1) { --x: -212px; --y: -20px; transition-delay: 0ms; }
.lk-summary-block .period-petal:nth-child(2) { --x: -178px; --y: -62px; transition-delay: 18ms; }
.lk-summary-block .period-petal:nth-child(3) { --x: -138px; --y: -102px; transition-delay: 36ms; }
.lk-summary-block .period-petal:nth-child(4) { --x: -96px; --y: -136px; transition-delay: 54ms; }
.lk-summary-block .period-petal:nth-child(5) { --x: 66px; --y: -136px; transition-delay: 72ms; }
.lk-summary-block .period-petal:nth-child(6) { --x: 122px; --y: -102px; transition-delay: 90ms; }
.lk-summary-block .period-petal:nth-child(7) { --x: 170px; --y: -62px; transition-delay: 108ms; }
.lk-summary-block .period-petal:nth-child(8) { --x: 210px; --y: -20px; transition-delay: 126ms; }

.lk-summary-block .custom-date-range {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: none;
    background: transparent;
    white-space: nowrap;
    flex-basis: 100%;
    justify-content: center;
    margin-top: 4px;
    order: 4;
}

.lk-summary-block .custom-date-range label {
    font-weight: var(--lk-font-weight-semibold);
    color: var(--lk-color-primary);
}

.lk-summary-block .custom-date-range input[type="date"] {
    padding: 10px 12px;
    font-size: var(--lk-font-size-base);
    border: 1px solid var(--lk-color-border);
    border-radius: 10px;
    background: var(--lk-color-surface);
    color: var(--lk-color-text);
}

.lk-summary-block .period-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 2px 4px;
    border: none;
    background: transparent;
    color: var(--lk-color-primary);
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 26px;
    line-height: 1;
    font-weight: var(--lk-font-weight-bold);
    order: 3;
}

.lk-summary-block .period-refresh-btn:hover {
    color: var(--lk-color-primary-border);
    transform: rotate(12deg);
}

.lk-summary-block #refreshPeriodBtn.loading {
    opacity: 0.6;
    cursor: wait;
}

.lk-summary-block #refreshPeriodBtn .spin {
    display: inline-block;
    animation: lkSummarySpin 0.8s linear infinite;
}

@keyframes lkSummarySpin {
    from { transform: rotate(0); }
    to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
    .lk-summary-block .period-flower {
        min-width: 100%;
        width: 100%;
    }

    .lk-summary-block .period-flower-menu {
        position: static;
        display: none;
        margin-top: 10px;
        pointer-events: auto;
        transform: none;
    }

    .lk-summary-block .period-flower.is-open .period-flower-menu {
        display: grid;
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        gap: 8px;
    }

    .lk-summary-block .period-petal {
        position: static;
        transform: none;
        opacity: 1;
        min-width: auto;
    }

    .lk-summary-block .period-flower.is-open .period-petal {
        transform: none;
    }
}

/* Карточки-сводки (явки, KPI и т.п.) */
.lk-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--lk-space-lg);
    margin-bottom: var(--lk-space-2xl);
}

.lk-summary-cards .summary-item,
.lk-section--attendance .summary-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 88px;
    background: var(--lk-color-surface);
    border-radius: var(--lk-radius-md);
    padding: 18px var(--lk-space-xl);
    border: 1px solid var(--lk-color-border);
    box-shadow: var(--lk-shadow-summary);
    text-align: center;
}

.lk-summary-cards .summary-item .label,
.lk-section--attendance .summary-item .label {
    font-size: var(--lk-font-size-xs);
    text-transform: uppercase;
    letter-spacing: var(--lk-letter-spacing-label);
    color: var(--lk-color-text-subtle);
    margin-bottom: var(--lk-space-sm);
    font-weight: var(--lk-font-weight-semibold);
}

.lk-summary-cards .summary-item .value,
.lk-section--attendance .summary-item .value {
    margin-top: auto;
    font-size: var(--lk-font-size-xl);
    font-weight: var(--lk-font-weight-bold);
    color: var(--lk-color-text);
    font-variant-numeric: tabular-nums;
}

/* --- KPI: личный дашборд менеджера --- */

.lk-kpi-table-scroll {
    overflow-x: auto;
    width: 100%;
}

.lk-kpi-table {
    min-width: 600px;
}

.lk-kpi-table th,
.lk-kpi-table td {
    text-align: center;
}

.lk-kpi-table th:first-child,
.lk-kpi-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    text-align: left;
    font-weight: var(--lk-font-weight-semibold);
    background: var(--lk-color-surface);
    border-right: 2px solid var(--lk-color-accent-border);
}

.lk-kpi-table thead th:first-child {
    background: var(--lk-table-header-primary-bg);
    color: var(--lk-table-header-primary-text);
    z-index: 11;
}

.lk-kpi-table tbody tr:hover td:first-child {
    background: var(--lk-color-hover-row);
}

.lk-kpi-table .currency {
    font-weight: var(--lk-font-weight-semibold);
    font-variant-numeric: tabular-nums;
}

.lk-percentage {
    font-weight: var(--lk-font-weight-semibold);
    font-size: 18px;
}

.lk-percentage--good {
    color: #047857;
}

.lk-percentage--warning {
    color: #d97706;
}

.lk-percentage--danger {
    color: #dc2626;
}

/* Алиасы для дашборда менеджера */
.percentage {
    font-weight: var(--lk-font-weight-semibold);
    font-size: 18px;
}

.percentage.good {
    color: #047857;
}

.percentage.warning {
    color: #d97706;
}

.percentage.danger {
    color: #dc2626;
}

.currency {
    font-weight: var(--lk-font-weight-semibold);
    font-variant-numeric: tabular-nums;
}

/* --- Матричные отчёты РОП (KPI менеджеров, зарплаты) --- */

.lk-matrix-report-table:not(.lk-salary-matrix-table) {
    min-width: 864px;
}

@media (min-width: 1800px) {
    .lk-matrix-report-table:not(.lk-salary-matrix-table) {
        min-width: auto;
    }
}

@media (max-width: 1800px) {
    .lk-matrix-report-table:not(.lk-salary-matrix-table) {
        min-width: 1260px;
    }
}

@media (max-width: 1600px) {
    .lk-matrix-report-table:not(.lk-salary-matrix-table) {
        min-width: 1080px;
    }
}

@media (max-width: 1400px) {
    .lk-matrix-report-table:not(.lk-salary-matrix-table) {
        min-width: 900px;
    }
}

.lk-matrix-report-table thead tr:first-child {
    background: var(--lk-table-header-bg);
    color: #ffffff;
}

.lk-matrix-report-table thead tr:nth-child(2) {
    background: #eef2ff;
    color: var(--lk-color-text);
}

.lk-matrix-report-table thead tr:nth-child(2) th {
    color: var(--lk-color-text);
    background: #eef2ff;
}

.lk-matrix-report-table thead tr:nth-child(2) th:not(.sticky-col) {
    text-align: center;
}

.lk-matrix-report-table th,
.lk-matrix-report-table td {
    padding: var(--lk-space-md) var(--lk-space-lg);
    border-bottom: 1px solid var(--lk-color-border);
    font-size: var(--lk-font-size-base);
    text-align: center;
    vertical-align: middle;
}

.lk-matrix-report-table thead th {
    font-weight: var(--lk-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--lk-letter-spacing-caps-wide);
}

.lk-matrix-report-table thead th.sticky-col,
.lk-matrix-report-table tbody td.sticky-col,
.lk-matrix-report-table .indicator-name {
    text-align: left;
}

.lk-matrix-report-table tbody tr:hover {
    background: var(--lk-color-hover-row-alt);
}

.lk-matrix-report-table .sticky-col {
    position: sticky;
    left: 0;
    background: var(--lk-color-surface);
    z-index: 10;
    font-weight: var(--lk-font-weight-semibold);
    border-right: 2px solid var(--lk-color-border);
}

.lk-matrix-report-table thead tr:first-child .sticky-col {
    background: var(--lk-table-header-bg);
    color: #ffffff;
    border-right: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 12;
}

.lk-matrix-report-table thead tr:nth-child(2) .sticky-col {
    background: #eef2ff;
    color: var(--lk-color-text);
    border-right: 2px solid #c7d2fe;
    z-index: 11;
}

.lk-matrix-report-table tbody tr:hover .sticky-col {
    background: var(--lk-color-hover-row-alt);
}

.lk-matrix-report-table tbody tr.lk-matrix-row-highlight .sticky-col,
.lk-matrix-report-table tbody tr[style*="background: #E8F5E8"] .sticky-col {
    background: #e8f5e8;
}

.lk-matrix-report-table tbody tr.lk-matrix-row-highlight:hover .sticky-col,
.lk-matrix-report-table tbody tr[style*="background: #E8F5E8"]:hover .sticky-col {
    background: #e0f0e0;
}

.lk-matrix-report-table .indicator-name,
.lk-matrix-report-table .indicator-name strong {
    font-weight: var(--lk-font-weight-semibold);
}

.lk-matrix-report-table .indicator-name {
    padding-left: var(--lk-space-xl);
}

.lk-matrix-report-table .manager-header,
.lk-matrix-report-table .total-header {
    background: var(--lk-table-header-bg);
    color: #ffffff;
    text-align: center;
}

.lk-matrix-report-table .manager-header {
    border-right: 2px solid rgba(255, 255, 255, 0.3);
}

.lk-matrix-report-table .manager-header:last-of-type {
    border-right: none;
}

.lk-matrix-report-table .total-header {
    font-weight: var(--lk-font-weight-bold);
    border-left: 2px solid rgba(255, 255, 255, 0.3);
}

.lk-matrix-report-table tbody td.manager-col-last {
    border-right: 2px solid #c7d2fe;
}

.lk-matrix-report-table thead th.manager-col-last {
    border-right: 2px solid rgba(255, 255, 255, 0.3);
}

.lk-matrix-report-table tbody td.total-col {
    border-left: 2px solid #c7d2fe;
}

.lk-matrix-report-table .number {
    font-variant-numeric: tabular-nums;
}

.lk-matrix-report-table .number.positive {
    color: #047857;
    font-weight: var(--lk-font-weight-semibold);
}

.lk-matrix-report-table tbody td.plan-col,
.lk-matrix-report-table tbody td.fact-col {
    min-width: 81px;
    width: 81px;
    white-space: nowrap;
}

.lk-matrix-report-table tbody td.percent-col {
    min-width: 54px;
    width: 54px;
    white-space: nowrap;
}

.lk-matrix-report-table tbody td.total-col.number {
    min-width: 81px;
    white-space: nowrap;
}

.lk-matrix-report-table tfoot {
    background: var(--lk-color-page-bg);
}

.lk-matrix-report-table tfoot td {
    font-weight: var(--lk-font-weight-bold);
}

.lk-matrix-report-table tbody tr.lk-matrix-row-highlight {
    background: var(--lk-color-total-row);
    border-top: 2px solid var(--lk-color-total-row-border);
}

/* Зарплатная матрица — горизонтальная прокрутка при нехватке ширины */
.lk-table-card--salary-matrix {
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    box-shadow: 0 4px 10px rgba(40, 60, 134, 0.08);
}

.lk-salary-matrix-table {
    table-layout: fixed;
    width: max-content;
    min-width: 100%;
}

.lk-salary-matrix-table col.col-indicator {
    width: 240px;
}

.lk-salary-matrix-table col.col-manager,
.lk-salary-matrix-table col.col-total {
    width: 180px;
}

.lk-salary-matrix-table .manager-header,
.lk-salary-matrix-table .total-header,
.lk-salary-matrix-table td.number {
    min-width: 160px;
}

.lk-salary-matrix-table th,
.lk-salary-matrix-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--lk-color-border);
    border-right: 1px solid var(--lk-color-border);
    font-size: var(--lk-font-size-base);
    line-height: 1.35;
    vertical-align: middle;
}

.lk-salary-matrix-table thead th {
    padding: 13px 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.22);
    border-bottom: none;
}

.lk-salary-matrix-table thead th:last-child {
    border-right: none;
}

.lk-salary-matrix-table tbody td:last-child {
    border-right: none;
}

.lk-salary-matrix-table tbody tr:last-child td {
    border-bottom: none;
}

.lk-salary-matrix-table .sticky-col {
    border-right: 1px solid var(--lk-color-border);
}

.lk-salary-matrix-table thead tr:first-child .sticky-col {
    border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.lk-salary-matrix-table .sticky-col,
.lk-salary-matrix-table .indicator-name {
    text-align: left;
    padding-left: 20px;
}

.lk-salary-matrix-table .number {
    text-align: center;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lk-salary-matrix-table .total-col {
    font-weight: var(--lk-font-weight-bold);
}

.lk-salary-matrix-table .total-col strong {
    font-weight: inherit;
}

.lk-salary-matrix-table tbody td.manager-col-last {
    border-right: 1px solid var(--lk-color-border);
}

.lk-salary-matrix-table thead th.manager-col-last {
    border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.lk-salary-matrix-table tbody td.total-col {
    border-left: none;
}

.lk-salary-matrix-table thead th.total-header {
    border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.lk-salary-matrix-table tbody tr.lk-matrix-row-highlight td {
    background: var(--lk-color-total-row);
    border-top: 2px solid var(--lk-color-total-row-border);
    font-weight: var(--lk-font-weight-semibold);
    color: #1f5e34;
}

.lk-salary-matrix-table tbody tr.lk-matrix-row-highlight:hover td {
    background: #c8e6ce;
}

.lk-salary-matrix-table tbody tr.lk-matrix-row-balance td {
    font-weight: var(--lk-font-weight-semibold);
}

.lk-salary-matrix-table .manager-cell {
    padding: 2px 0;
}

.lk-salary-matrix-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 10;
    background: var(--lk-color-surface);
}

.lk-salary-matrix-table thead tr:first-child .sticky-col {
    background: var(--lk-table-header-primary-bg);
    z-index: 12;
}

.lk-salary-matrix-table tbody tr:hover .sticky-col {
    background: var(--lk-color-hover-row-alt);
}


.lk-salary-matrix-table .manager-name {
    font-size: var(--lk-font-size-sm);
    font-weight: var(--lk-font-weight-bold);
}

.lk-salary-matrix-table .manager-username {
    font-size: 11px;
    opacity: 0.9;
}

.manager-cell,
.lawyer-header-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    justify-content: center;
}

.manager-cell a,
.lawyer-header-cell a {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: opacity 0.2s ease;
}

.manager-cell a:hover,
.lawyer-header-cell a:hover {
    opacity: 0.85;
}

.manager-name,
.lawyer-header-name {
    font-weight: var(--lk-font-weight-semibold);
    color: #ffffff;
}

.manager-username,
.lawyer-header-username {
    font-size: var(--lk-font-size-xs);
    color: #ffffff;
}

.lk-legend {
    margin-top: var(--lk-space-lg);
    font-size: var(--lk-font-size-sm);
    color: var(--lk-color-text-subtle);
}

.lk-empty-state,
.empty-state {
    margin-top: var(--lk-space-2xl);
    background: var(--lk-color-surface);
    border-radius: var(--lk-radius-md);
    padding: 36px;
    border: 1px dashed var(--lk-color-border);
    text-align: center;
    color: var(--lk-color-text-muted);
}

.lawyer-salary-block .empty-state {
    margin-top: 0;
}

/* --- Секции оплат и зарплат в отчёте РОП --- */

.lk-payments-section,
.lk-salary-section,
.payments-table {
    margin-top: var(--lk-space-5xl);
}

.lk-payments-section > h2,
.lk-payments-section > .lk-section__title,
.lk-salary-section > h2,
.lk-salary-section > .lk-section__title,
.payments-table > h2 {
    margin: 0 0 var(--lk-section-header-gap);
    font-size: var(--lk-font-size-xl);
    font-weight: var(--lk-font-weight-bold);
    color: var(--lk-color-primary);
}

.lk-payments-section .lk-table-card table,
.payments-table .lk-table-card table {
    min-width: 980px;
}

.lk-payments-section tfoot,
.payments-table tfoot {
    background: var(--lk-color-page-bg);
}

.lk-payments-section tfoot td,
.payments-table tfoot td {
    font-weight: var(--lk-font-weight-bold);
    border-top: 2px solid var(--lk-table-header-bg);
}

/*
 * Белая панель «добавить …» (прототип .panel) + сетка из двух форм.
 * Внутри — .lk-panel__table-card с secondary-шапкой таблицы.
 */
.lk-panel {
    margin-top: var(--lk-space-2xl);
    padding: 24px 26px;
    background: var(--lk-color-surface);
    border: 1px solid var(--lk-color-border);
    border-radius: var(--lk-radius-md);
    box-shadow: var(--lk-shadow-card);
}

.lk-panel__header {
    margin: 0;
}

.lk-panel__title {
    margin: 0 0 5px;
    padding: 0;
    font-family: var(--lk-font-display);
    font-size: 18px;
    font-weight: var(--lk-font-weight-semibold);
    color: var(--lk-color-text-heading);
    line-height: var(--lk-line-height-tight);
    letter-spacing: -0.3px;
}

.lk-panel__subtitle {
    margin: 0 0 var(--lk-space-lg);
    font-size: var(--lk-font-size-xs);
    color: var(--lk-color-text-muted);
    line-height: 1.4;
}

.lk-panel__table-card {
    background: var(--lk-color-surface);
    border: 1px solid var(--lk-color-border);
    border-radius: var(--lk-radius-sm);
    box-shadow: none;
    overflow: hidden;
}

.lk-forms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-top: var(--lk-space-2xl);
}

.lk-forms-grid .lk-panel {
    margin-top: 0;
}

@media (max-width: 1100px) {
    .lk-forms-grid {
        grid-template-columns: 1fr;
    }
}

/* Legacy bento — оставлен для совместимости, предпочтительно .lk-panel */
.lk-inline-action-form,
.lk-add-payment-form,
.lk-bento-panel {
    margin-top: var(--lk-space-2xl);
    padding: var(--lk-space-xl);
    background: var(--lk-bento-bg);
    border: 1px solid var(--lk-bento-border);
    border-radius: var(--lk-radius-md);
    box-shadow: var(--lk-shadow-card);
}

.lk-inline-action-form + .lk-inline-action-form,
.lk-add-payment-form + .lk-add-payment-form,
.lk-inline-action-form + .lk-add-payment-form,
.lk-add-payment-form + .lk-inline-action-form,
.lk-bento-panel + .lk-bento-panel,
.lk-panel + .lk-panel:not(.lk-forms-grid .lk-panel) {
    margin-top: var(--lk-space-lg);
}

/* Форма создания сразу под заголовком секции */
.lk-section__header + .lk-inline-action-form,
.lk-section__title + .lk-inline-action-form,
.lk-section__title + .lk-panel,
.lk-section__header + .lk-panel,
.lk-section__header + .lk-inline-action-form,
.lk-section__header + .lk-panel,
.lk-section__header + .lk-inline-action-form,
.lk-section__header + .lk-panel,
.lk-section__header + .lk-inline-action-form,
.lk-section__header + .lk-panel {
    margin-top: var(--lk-space-lg);
}

/* Премия и выплата — под таблицей дохода */
.lawyer-salary-block .lk-table-card + .lk-inline-action-form,
.lawyer-salary-block .lk-empty-state + .lk-inline-action-form,
.lawyer-salary-block .lk-table-card + .lk-forms-grid,
.lawyer-salary-block .lk-empty-state + .lk-forms-grid,
.lk-payments-section .lk-table-card + .lk-inline-action-form,
.lk-payments-section .lk-empty-state + .lk-inline-action-form,
.lk-payments-section .lk-table-card + .lk-panel,
.lk-payments-section .lk-empty-state + .lk-panel,
.lk-payments-section .lk-table-card + .lk-forms-grid,
.lk-payments-section .lk-empty-state + .lk-forms-grid,
.lk-salary-section .lk-table-card + .lk-inline-action-form,
.lk-salary-section .lk-empty-state + .lk-inline-action-form,
.lk-salary-section .lk-table-card + .lk-panel,
.lk-salary-section .lk-empty-state + .lk-panel,
.lk-salary-section .lk-table-card + .lk-forms-grid,
.lk-salary-section .lk-empty-state + .lk-forms-grid {
    margin-top: var(--lk-space-2xl);
}

/* Добавление юриста — в самом низу дашборда */
.lawyer-salary-block + .lk-add-lawyer-form,
.lk-section--lawyer-report-task-matrix + .lawyer-salary-block + .lk-add-lawyer-form {
    margin-top: var(--lk-space-2xl);
}

/* Таблица данных под формой создания */
.lk-inline-action-form + .lk-table-card,
.lk-inline-action-form + .table-wrapper,
.lk-inline-action-form + .lk-empty-state,
.lk-panel + .lk-table-card,
.lk-panel + .table-wrapper,
.lk-panel + .lk-empty-state,
.lk-forms-grid + .lk-table-card,
.lk-forms-grid + .table-wrapper,
.lk-forms-grid + .lk-empty-state {
    margin-top: var(--lk-space-lg);
}

.lk-table-card--spaced {
    margin-top: var(--lk-space-lg);
}

/* Форма после таблицы данных — больший отступ */
.lk-table-card--spaced + .lk-inline-action-form,
.lk-table-card + .lk-inline-action-form,
.table-wrapper + .lk-inline-action-form,
.lk-empty-state + .lk-inline-action-form,
.lk-table-card--spaced + .lk-panel,
.lk-table-card + .lk-panel,
.table-wrapper + .lk-panel,
.lk-empty-state + .lk-panel,
.lk-table-card--spaced + .lk-forms-grid,
.lk-table-card + .lk-forms-grid,
.table-wrapper + .lk-forms-grid,
.lk-empty-state + .lk-forms-grid {
    margin-top: var(--lk-space-2xl);
}

.lk-inline-action-form__title,
.lk-inline-action-form h3,
.lk-add-payment-form h3,
.lk-bento-panel__title,
.lk-bento-panel h3 {
    margin: 0 0 var(--lk-space-lg);
    padding: 0;
    font-size: 18px;
    font-weight: var(--lk-font-weight-bold);
    color: var(--lk-color-text-heading);
    line-height: var(--lk-line-height-tight);
}

.lk-inline-action-form__card,
.lk-inline-action-form .lk-table-card,
.lk-add-payment-form .lk-table-card,
.lk-bento-panel__card,
.lk-bento-panel .lk-table-card,
.lk-panel__table-card {
    background: var(--lk-color-surface);
    border: 1px solid var(--lk-color-border);
    border-radius: var(--lk-radius-sm);
    box-shadow: none;
    overflow: hidden;
}

.payment-form-card {
    margin-top: var(--lk-space-2xl);
    padding: var(--lk-space-xl);
    background: var(--lk-bento-bg);
    border: 1px solid var(--lk-bento-border);
    border-radius: var(--lk-radius-md);
}

.payment-form-card h3 {
    margin: 0 0 var(--lk-space-lg);
    font-size: 18px;
    font-weight: var(--lk-font-weight-semibold);
    color: var(--lk-color-text-heading);
}

.payment-form-card .lk-table-card,
.payment-form-card .table-wrapper {
    background: var(--lk-color-surface);
    border: 1px solid var(--lk-color-border);
    border-radius: var(--lk-radius-sm);
    box-shadow: none;
    overflow: hidden;
}

.lk-inline-form-table {
    min-width: auto;
    margin: 0;
}

.lk-inline-form-table--wide {
    min-width: 900px;
}

.lk-form-panel--flat .lk-table-card {
    overflow: hidden;
}

.lk-inline-form-table th:last-child {
    width: 72px;
}

.lk-inline-form-table tbody td {
    padding: var(--lk-space-md) var(--lk-space-lg);
    vertical-align: middle;
    border-bottom: none;
    background: var(--lk-color-surface);
}

.lk-inline-form-table input,
.lk-inline-form-table select {
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid var(--lk-color-border);
    border-radius: 10px;
    font-size: var(--lk-font-size-base);
    color: var(--lk-color-text);
    background: var(--lk-color-surface);
    box-sizing: border-box;
}

.lk-inline-form-table input::placeholder {
    color: var(--lk-color-text-subtle);
}

.lk-inline-form-table input:focus,
.lk-inline-form-table select:focus {
    outline: none;
    border-color: var(--lk-color-primary);
    box-shadow: var(--lk-ring);
}

.lk-form-employee-name {
    display: block;
    min-height: 40px;
    padding: 10px 12px;
    font-size: var(--lk-font-size-base);
    font-weight: var(--lk-font-weight-semibold);
    color: var(--lk-color-text);
}

.lk-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.payment-action-cell {
    white-space: nowrap;
    text-align: center;
    width: 120px;
}

.payment-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    border: none;
    border-radius: 6px;
    background: transparent;
    padding: 0;
    cursor: pointer;
    margin-right: var(--lk-space-xs);
    line-height: 1;
    font-size: var(--lk-font-size-base);
    color: var(--lk-color-text-muted);
}

.payment-action-icon {
    display: block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.payment-action-btn--delete {
    min-width: 30px;
    min-height: 30px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: var(--lk-color-surface);
    padding: var(--lk-space-2xs) var(--lk-space-sm);
}

.payment-action-btn:last-child {
    margin-right: 0;
}

.payment-action-btn:hover {
    opacity: 0.82;
}

.payment-action-btn--delete:hover {
    opacity: 1;
    border-color: var(--lk-color-primary);
    color: var(--lk-color-primary);
}

.delete-confirm-inline {
    display: none;
    margin-top: var(--lk-space-sm);
    padding: var(--lk-space-xs) var(--lk-space-sm);
    border: 1px solid #fca5a5;
    border-radius: var(--lk-radius-sm);
    background: #fef2f2;
    font-size: var(--lk-font-size-xs);
    text-align: left;
}

.delete-confirm-inline.active {
    display: block;
}

.delete-confirm-inline button {
    margin-top: var(--lk-space-xs);
    margin-right: var(--lk-space-xs);
    padding: 3px var(--lk-space-sm);
    border-radius: var(--lk-space-2xs);
    border: 1px solid var(--lk-color-border);
    cursor: pointer;
    background: var(--lk-color-surface);
    font-size: var(--lk-font-size-xs);
}

.payment-edit-row {
    background: #f8fafc;
}

.payment-edit-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: var(--lk-space-sm);
}

.payment-edit-field {
    display: flex;
    flex-direction: column;
    gap: var(--lk-space-2xs);
}

.payment-edit-field label {
    font-size: 11px;
    line-height: 1.1;
    color: var(--lk-color-text-muted);
    font-weight: var(--lk-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.payment-edit-grid input,
.payment-edit-grid select {
    width: 100%;
    padding: var(--lk-space-sm) var(--lk-space-sm);
    border: 1px solid var(--lk-color-border);
    border-radius: 6px;
    font-size: var(--lk-font-size-sm);
    background: var(--lk-color-surface);
}

.payment-edit-actions {
    margin-top: var(--lk-space-sm);
    display: flex;
    gap: var(--lk-space-sm);
}

.payment-edit-actions .js-save-payment-edit {
    background: var(--lk-color-primary);
    color: #ffffff;
    border: none;
}

.payment-edit-actions .js-save-payment-edit:hover:not(:disabled) {
    background: var(--lk-color-primary);
    color: #ffffff;
}

.payment-edit-actions .js-cancel-payment-edit {
    padding: var(--lk-space-xs) var(--lk-space-md);
    border-radius: 6px;
    border: 1px solid #b8bfd0;
    cursor: pointer;
    font-size: var(--lk-font-size-sm);
    background: var(--lk-color-surface);
    color: var(--lk-color-text);
}

.add-plus-cell {
    padding: var(--lk-space-md) var(--lk-space-lg);
    text-align: center;
    vertical-align: middle;
    width: 72px;
}

.add-plus-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--lk-color-primary);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 22px;
    font-weight: var(--lk-font-weight-bold);
    cursor: pointer;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(40, 60, 134, 0.22);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.add-plus-btn:hover:not(:disabled) {
    background: var(--lk-color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(40, 60, 134, 0.28);
}

.add-plus-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* --- Секции ЛК: исключения поверх глобальных .lk-* --- */

.lk-section--lawyer-acts .lk-section__header + .lk-panel {
    margin-top: var(--lk-space-lg);
}

.lk-section--lawyer-acts .lk-panel + .lk-table-card {
    margin-top: var(--lk-space-lg);
}

.lk-act-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: var(--lk-font-weight-semibold);
    white-space: nowrap;
}

.lk-act-status--pending {
    color: #8a5b02;
    background: #fef3c7;
}

.lk-act-status--credited {
    color: #065f46;
    background: #d1fae5;
}

.lk-act-link {
    display: inline-block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lk-act-approve-btn {
    border: 1px solid var(--lk-color-primary);
    background: var(--lk-color-primary);
    color: #ffffff;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: var(--lk-font-weight-semibold);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.lk-act-approve-btn:hover {
    background: var(--lk-color-primary-dark);
    border-color: var(--lk-color-primary-dark);
}

.act-action-cell {
    white-space: nowrap;
    text-align: right;
    width: 140px;
    position: relative;
}

.act-confirm-inline {
    display: none;
    margin-top: var(--lk-space-sm);
    padding: var(--lk-space-xs) var(--lk-space-sm);
    border: 1px solid #93c5fd;
    border-radius: var(--lk-radius-sm);
    background: #eff6ff;
    font-size: var(--lk-font-size-xs);
    text-align: left;
    box-shadow: var(--lk-shadow-card);
}

.act-confirm-inline.active {
    display: block;
}

.act-confirm-inline button {
    margin-top: var(--lk-space-xs);
    margin-right: var(--lk-space-xs);
    padding: 3px var(--lk-space-sm);
    border-radius: var(--lk-space-2xs);
    border: 1px solid var(--lk-color-border);
    cursor: pointer;
    background: var(--lk-color-surface);
    font-size: var(--lk-font-size-xs);
}

.lk-section--lawyer-expenses .lk-table-card {
    margin-bottom: var(--lk-space-xl);
}

@media (min-width: 720px) {
    .lawyer-expenses-form__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .lawyer-expenses-form__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.lk-section--manager-payments .lk-table-card--spaced {
    margin-bottom: 0;
}

.lk-section--manager-payments .payment-incomplete {
    background: #fffbeb;
}

.lk-section--manager-payments .payments-new-row {
    background: #ecfdf5;
    animation: lkPaymentFadeIn 0.4s ease-in;
}

@keyframes lkPaymentFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lk-section--manager-payments .payment-type-select {
    width: 100%;
    padding: var(--lk-space-sm) var(--lk-space-md);
    border: 1px solid var(--lk-color-border);
    border-radius: var(--lk-radius-sm);
    font-size: var(--lk-font-size-base);
    background: var(--lk-color-surface);
    cursor: pointer;
    box-sizing: border-box;
}

.lk-section--manager-payments .payment-type-select:focus {
    outline: none;
    border-color: var(--lk-color-accent-border);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.lk-section--manager-payments .confirm-payment-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--lk-space-2xs) var(--lk-space-sm);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.lk-section--manager-payments .confirm-payment-btn:hover:not(:disabled) {
    background: #dcfce7;
}

.lk-section--manager-payments .confirm-payment-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.lk-section--manager-payments .lk-add-payment-form {
    margin-top: var(--lk-space-2xl);
}

.lk-section--attendance .attendance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--lk-space-lg);
    margin-bottom: var(--lk-space-2xl);
}

.lk-section--attendance .attendance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lk-space-md);
    align-items: center;
    margin-bottom: var(--lk-space-xl);
}

.lk-section--attendance .attendance-comment-input {
    flex: 1;
    min-width: 200px;
    padding: var(--lk-space-md) var(--lk-space-lg);
    border: 1px solid var(--lk-color-border);
    border-radius: var(--lk-radius-md);
    font-size: var(--lk-font-size-base);
    color: var(--lk-color-text);
    background: var(--lk-color-surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lk-section--attendance .attendance-comment-input:focus {
    outline: none;
    border-color: var(--lk-color-accent-border);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.lk-section--attendance .mark-attendance-btn {
    background: var(--lk-table-header-bg);
    color: #ffffff;
    border: none;
    border-radius: var(--lk-radius-md);
    padding: var(--lk-space-md) 22px;
    font-size: var(--lk-font-size-base);
    font-weight: var(--lk-font-weight-semibold);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
}

.lk-section--attendance .mark-attendance-btn:hover:not(:disabled) {
    background: var(--lk-header-bottom);
}

.lk-section--attendance .mark-attendance-btn:disabled {
    background: var(--lk-color-text-subtle);
    cursor: not-allowed;
}

.lk-section--attendance .lk-table th:first-child,
.lk-section--attendance .lk-table td:first-child {
    width: 56px;
    text-align: center;
}

.lk-section--attendance .lk-table tbody td:nth-child(2) {
    text-align: left;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lk-section--attendance .lk-table tbody td:nth-child(4) {
    text-align: center;
}

.lk-section--attendance .status-present {
    color: #047857;
    font-weight: var(--lk-font-weight-bold);
    font-size: 18px;
}

.lk-section--attendance .status-absent {
    color: #dc2626;
    font-weight: var(--lk-font-weight-bold);
    font-size: 18px;
}

.lk-section--attendance .no-data {
    text-align: center;
    color: var(--lk-color-text-muted);
    font-style: italic;
    padding: 48px var(--lk-space-2xl);
    font-size: var(--lk-font-size-lg);
    background: var(--lk-color-surface);
    border-radius: var(--lk-radius-lg);
    border: 1px solid var(--lk-color-border);
    box-shadow: var(--lk-shadow-card);
}

.lk-section--attendance .attendance-row.new {
    background: #ecfdf5;
    animation: lkAttendanceFadeIn 0.45s ease-in;
}

.lk-section--attendance .attendance-row.new td:first-child {
    box-shadow: inset 4px 0 0 #047857;
}

@keyframes lkAttendanceFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.lawyer-salary-block {
    margin-top: 40px;
}

.lawyer-salary-block__title {
    margin: 0 0 var(--lk-section-header-gap);
}

.lk-section--lawyer-report-task-matrix {
    margin-top: 0;
    margin-bottom: 28px;
}

.lk-section--lawyer-report-task-matrix .lawyer-task-matrix-table .lawyer-col {
    min-width: 220px;
    padding: 8px 12px;
    text-align: left;
    background: var(--lk-color-surface);
    font-weight: var(--lk-font-weight-normal);
}

.lk-section--lawyer-report-task-matrix .lawyer-task-matrix-table .lawyer-col-name-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.lk-section--lawyer-report-task-matrix .lawyer-task-matrix-table .lawyer-col-attendance {
    display: block;
    font-family: var(--lk-font-family);
    font-size: var(--lk-font-size-xs);
    font-weight: var(--lk-font-weight-normal);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

.lk-section--lawyer-report-task-matrix .lawyer-task-matrix-table .lawyer-col-attendance.is-marked {
    color: #16a34a;
}

.lk-section--lawyer-report-task-matrix .lawyer-task-matrix-table .lawyer-col-attendance.is-not-marked {
    color: var(--lk-color-text-subtle);
}

.lk-section--lawyer-report-task-matrix .lawyer-task-matrix-table .lawyer-col a {
    color: var(--lk-color-primary);
    text-decoration: none;
}

.lk-section--lawyer-report-task-matrix .lawyer-task-matrix-table .lawyer-col-name {
    display: block;
    font-family: var(--lk-font-family);
    font-size: var(--lk-font-size-base);
    font-weight: var(--lk-font-weight-semibold);
    line-height: var(--lk-line-height-tight);
    color: inherit;
}

.lk-section--lawyer-report-task-matrix .lawyer-task-matrix-table .lawyer-col a:hover {
    text-decoration: underline;
}

.lk-section--lawyer-report-task-matrix .lawyer-task-matrix-table .lawyer-col .lawyer-col-login {
    display: block;
    margin-top: 2px;
    color: var(--lk-color-text-subtle);
    font-size: 11px;
    font-weight: var(--lk-font-weight-normal);
}

.lk-section--lawyer-report-task-matrix .lawyer-task-matrix-table tbody td:not(.lawyer-col):not(.total-col),
.lk-section--lawyer-report-task-matrix .lawyer-task-matrix-table tfoot td:not(.lawyer-col):not(.total-col) {
    height: 34px;
    padding: 0;
}

.lk-section--lawyer-report-task-matrix tr.matrix-totals-row .lawyer-col,
.lk-section--lawyer-report-task-matrix tr.matrix-totals-row .total-col {
    background: #e9ecef;
    font-weight: var(--lk-font-weight-bold);
}

.lk-section--lawyer-report-task-matrix tr.matrix-totals-row .lawyer-task-matrix-value {
    background: #e9ecef;
    color: var(--lk-color-text);
}

.lk-section--lawyer-report-task-matrix tr.matrix-totals-row .lawyer-task-matrix-value:hover {
    background: #edf4fa;
    color: #1a3a52;
}

.lk-section--lawyer-report-task-matrix tr.matrix-totals-row .lawyer-task-matrix-value.empty {
    background: #e9ecef;
    color: var(--lk-color-text-subtle);
}

.lk-section--lawyer-report-task-matrix tr.matrix-totals-row .lawyer-task-matrix-value.empty:hover {
    background: #edf4fa;
    color: #3a5a73;
}

.lawyer-task-matrix-empty {
    text-align: center;
    color: var(--lk-color-text-muted);
    padding: 24px 16px;
}

/* Матрица задач юриста — отдельная сетка, не .lk-table */
.lawyer-task-matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1040px;
    font-size: var(--lk-font-size-xs);
}

.lawyer-task-matrix-table th,
.lawyer-task-matrix-table td {
    text-align: center;
    vertical-align: middle;
    border: 1px solid #dee2e6;
}

.lawyer-task-matrix-table th {
    padding: 6px 8px;
    font-weight: var(--lk-font-weight-semibold);
}

.lawyer-task-matrix-table td {
    padding: 0;
    color: var(--lk-color-text);
}

.lawyer-task-matrix-table tbody td:has(.lawyer-task-matrix-cell) {
    height: 34px;
    padding: 0;
}

.lawyer-task-matrix-table .date-col {
    min-width: 120px;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
    background: var(--lk-color-surface);
    font-weight: var(--lk-font-weight-semibold);
}

.lawyer-task-matrix-table .week-day {
    margin-left: 4px;
    color: var(--lk-color-text-subtle);
    font-size: 11px;
    font-weight: var(--lk-font-weight-normal);
}

.lawyer-task-matrix-table .cat-1 {
    background: #5f7d99;
    color: #ffffff;
    border-color: #4a6a87;
}

.lawyer-task-matrix-table .cat-2 {
    background: #8b6c8b;
    color: #ffffff;
    border-color: #75587a;
}

.lawyer-task-matrix-table .cat-3 {
    background: #b67c5e;
    color: #ffffff;
    border-color: #9c6a4f;
}

.lawyer-task-matrix-table .cat-4 {
    background: #5e9b8b;
    color: #ffffff;
    border-color: #4d8a7c;
}

.lawyer-task-matrix-table .subhead {
    min-width: 56px;
    background: #f4f6f8;
    color: #495057;
    font-size: 11px;
    font-weight: var(--lk-font-weight-medium);
}

.lawyer-task-matrix-table .total-col {
    min-width: 56px;
    background: #e9ecef;
    font-weight: var(--lk-font-weight-semibold);
}

.lawyer-task-matrix-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 56px;
    min-height: 34px;
    width: 100%;
    height: 100%;
    border: none;
    background: var(--lk-color-surface);
    color: var(--lk-color-text);
    font-weight: var(--lk-font-weight-semibold);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.lawyer-task-matrix-cell:hover {
    background: #edf4fa;
    color: #1a3a52;
}

.lawyer-task-matrix-cell.empty {
    background: var(--lk-color-surface);
    color: #d0d6dc;
    font-weight: var(--lk-font-weight-normal);
}

.lawyer-task-matrix-cell.empty::before {
    content: "·";
}

.lawyer-task-matrix-cell.empty:hover {
    background: #edf4fa;
    color: #3a5a73;
}

.lawyer-task-matrix-cell.empty:hover::before {
    content: "+";
    font-size: var(--lk-font-size-base);
    font-weight: var(--lk-font-weight-semibold);
}

.lawyer-task-matrix-value {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-width: 56px;
    min-height: 34px;
    background: var(--lk-color-surface);
    color: var(--lk-color-text);
    font-weight: var(--lk-font-weight-semibold);
    transition: background 0.15s ease, color 0.15s ease;
}

.lawyer-task-matrix-value:hover {
    background: #edf4fa;
    color: #1a3a52;
}

.lawyer-task-matrix-value.empty {
    background: var(--lk-color-surface);
    color: #d0d6dc;
    font-weight: var(--lk-font-weight-normal);
}

.lawyer-task-matrix-value.empty:hover {
    background: #edf4fa;
    color: #3a5a73;
}

.lawyer-task-matrix-value.empty::before {
    content: "·";
}

.lawyer-task-modal-record {
    border: 1px solid var(--lk-color-border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--lk-color-surface);
}

.lawyer-task-modal-record__title {
    font-weight: var(--lk-font-weight-semibold);
    color: var(--lk-color-text);
}

.lawyer-task-modal-record__meta,
.lawyer-task-modal-record__comment {
    margin-top: 4px;
    color: var(--lk-color-text-muted);
    font-size: var(--lk-font-size-sm);
}

.lawyer-task-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.delete-lawyer-task-btn {
    background: transparent;
    border: none;
    color: #dc2626;
    font-size: var(--lk-font-size-lg);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
}

.delete-lawyer-task-btn:hover {
    background: #fee2e2;
}

.lawyer-task-client-picker {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.lawyer-task-client-picker select {
    flex: 1;
}

.lawyer-task-client-add-btn {
    flex: 0 0 36px;
    border: 1px solid var(--lk-color-primary);
    background: var(--lk-color-primary);
    color: #ffffff;
    border-radius: 8px;
    font-size: 20px;
    font-weight: var(--lk-font-weight-semibold);
    line-height: 1;
    cursor: pointer;
}

.lawyer-task-client-add-btn:hover {
    background: var(--lk-color-primary-dark);
    border-color: var(--lk-color-primary-dark);
}

.lk-notification,
.lawyer-notification,
.notification {
    position: fixed;
    top: var(--lk-space-xl);
    right: var(--lk-space-xl);
    padding: 14px var(--lk-space-xl);
    border-radius: var(--lk-radius-md);
    color: #ffffff;
    font-weight: var(--lk-font-weight-semibold);
    z-index: 1000;
    max-width: 360px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.2);
}

.lk-notification.success,
.lawyer-notification.success,
.notification.success {
    background: #047857;
}

.lk-notification.error,
.lawyer-notification.error,
.notification.error {
    background: #dc2626;
}
