﻿:root {
    --bg: #edf0f4;
    --card: #ffffff;
    --line: #d8dee6;
    --accent: #1f6feb;
    --ok: #1a7f37;
    --warn: #b08900;
    --danger: #c2333b;
    --text: #18212f;
    --muted: #5b6573;
    --nav-bg-start: #111922;
    --nav-bg-end: #1a2431;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(1200px 500px at 10% -20%, #d9e6ff 0%, #edf0f4 50%, #edf0f4 100%);
    color: var(--text);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    min-height: 100vh;
}

body.bk-create-shell {
    transform: translateY(-28px);
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    background: linear-gradient(90deg, var(--nav-bg-start), var(--nav-bg-end));
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
}

.container {
    width: min(1912px, calc(100% - 8px));
    max-width: none;
    margin: 0 auto;
}

.topbar__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    min-height: 78px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 30% 30%, #f7ba45, #f59f0a 58%, #9b5e00 100%);
    border: 2px solid #f59f0a;
    color: #0f1720;
    font-size: 28px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 4px 10px rgba(0, 0, 0, 0.45);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-wordmark {
    font-family: Impact, "Arial Black", "Segoe UI", sans-serif;
    font-size: 34px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 1.2px;
    color: #fff;
    text-transform: uppercase;
    transform: skewX(-8deg);
    text-shadow:
        -1px -1px 0 #12151d,
        1px -1px 0 #12151d,
        -1px 1px 0 #12151d,
        1px 1px 0 #12151d,
        0 2px 0 #f59f0a,
        2px 0 0 #f59f0a,
        -2px 0 0 #f59f0a;
}

.topnav {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #dbe4ef;
}

.topbar-user__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.topbar-user__name {
    font-size: 14px;
    line-height: 1.1;
}

.topbar-user__role {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9fb0c4;
}

.topbar-user__logout {
    border-color: rgba(255, 255, 255, 0.26);
    color: #fff;
    white-space: nowrap;
}

.topbar-user__logout:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.topnav__link {
    color: #c7d0dc;
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 18px;
    line-height: 1.05;
}

.topnav__link.active,
.topnav__link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.topnav__link.is-disabled {
    opacity: 0.7;
    cursor: default;
}

.page-shell {
    padding: 18px 0 28px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 10px;
}

.page-head h1 {
    margin: 0 0 4px;
    font-size: 28px;
}

.page-subtitle,
.page-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.block {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
    overflow: hidden;
}

.block-head {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.block-body {
    padding: 0;
}

.panel-body {
    padding: 16px;
}

.panel-body--compact {
    padding: 12px;
}

.registry-table {
    width: 100%;
    border-collapse: collapse;
}

.registry-table th,
.registry-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e6ebf2;
    text-align: left;
    vertical-align: middle;
}

.registry-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: #f8fafc;
    white-space: nowrap;
}

.registry-table tbody tr:hover {
    background: #f8fbff;
}

.registry-table--compact th,
.registry-table--compact td {
    padding: 5px 9px;
    font-size: 11px;
    line-height: 1.05;
}

.registry-table--compact th {
    font-size: 10px;
    letter-spacing: 0.05em;
}

.registry-inline-card .block-head {
    min-height: 46px;
}

.registry-inline-wrap {
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #fff;
}

.registry-inline-meta {
    margin: 8px 8px 0;
}

.registry-inline-table {
    width: 100%;
    min-width: 920px;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.registry-inline-table--wide {
    min-width: 1280px;
}

.registry-inline-table th {
    padding: 7px 5px;
    color: #506175;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
    background: #f8fafc;
    border-bottom: 1px solid #dde6f1;
}

.registry-inline-table td {
    padding: 5px;
    min-width: 0;
    border-bottom: 1px solid #ebf0f6;
    color: #18212f;
    font-size: 11px;
    line-height: 1.15;
    vertical-align: middle;
}

.registry-inline-table tbody tr:last-child td {
    border-bottom: 0;
}

.registry-inline-table tbody tr:hover {
    background: #fbfdff;
}

.registry-inline-row.is-inactive {
    opacity: 0.66;
}

.registry-inline-row--new td {
    background: #fbfdff;
}

.registry-inline-table input,
.registry-inline-table select {
    width: 100%;
    max-width: 100%;
    min-height: 28px;
    padding: 4px 7px;
    border: 1px solid #d5deea;
    border-radius: 9px;
    background: #fff;
    color: #18212f;
    font-size: 11px;
    line-height: 1.15;
    box-sizing: border-box;
}

.registry-inline-table input[type="date"] {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.registry-inline-table input[type="number"],
.registry-inline-table .table-id,
.registry-inline-table .table-profit {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.registry-inline-table select {
    text-align: center;
    text-align-last: center;
}

.registry-inline-table input::placeholder {
    color: #9aabc0;
}

.registry-cell-center {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.registry-inline-actions-cell {
    text-align: center;
}

.registry-inline-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: max-content;
    margin: 0 auto;
}

.registry-inline-table .icon-action {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border-radius: 8px;
    font-size: 11px;
}

.registry-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    min-width: 78px;
    padding: 4px 8px;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.registry-status.is-active {
    color: #15803d;
    border-color: #b7e4c7;
    background: #f0fdf4;
}

.registry-status.is-inactive {
    color: #64748b;
    border-color: #dbe3ee;
    background: #f8fafc;
}

.registry-status.is-paused {
    color: #9a6700;
    border-color: #f7d794;
    background: #fff8e6;
}

.account-link {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    font-weight: 700;
    color: var(--text);
}

.account-link--compact {
    display: inline-flex;
    max-width: 110px;
}

.account-link--disabled {
    color: #334155;
    cursor: default;
}

.account-link--disabled:hover {
    color: #334155;
}

.mono {
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
}

.table-id {
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.table-secret {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-profit {
    font-weight: 700;
    white-space: nowrap;
}

.table-profit.is-positive {
    color: var(--ok);
}

.table-profit.is-negative {
    color: var(--danger);
}

.status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 7px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: #475569;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    white-space: nowrap;
    line-height: 1;
}

.status-badge.ok {
    color: #fff;
    border-color: transparent;
    background: var(--ok);
}

.status-badge.warn {
    color: #fff;
    border-color: transparent;
    background: var(--warn);
}

.status-badge.err {
    color: #fff;
    border-color: transparent;
    background: var(--danger);
}

.status-badge.plain {
    color: #334155;
    background: #fff;
    border-color: #d3dae5;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.link-back {
    color: var(--accent);
    font-weight: 700;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    border: 0;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.action-btn--secondary {
    background: #e2e8f0;
    color: #0f172a;
}

.action-btn--ghost {
    background: #fff;
    color: #0f172a;
    border: 1px solid #dbe3ee;
}

.action-btn--compact {
    padding: 8px 12px;
    font-size: 13px;
}

.action-btn--danger {
    background: #c2333b;
    color: #fff;
}

.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid #dbe3ee;
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
}

.table-action--primary {
    background: #e8f1ff;
    color: #0f4fb3;
    border-color: #cfe0ff;
}

.table-action--danger {
    background: #fff1f2;
    color: #b42318;
    border-color: #fecdd3;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.row-actions form {
    margin: 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1.35fr 0.85fr;
    gap: 12px;
}

.detail-layout > * {
    min-width: 0;
}

.detail-layout--transaction {
    grid-template-columns: minmax(380px, 0.85fr) minmax(760px, 1.4fr);
    align-items: start;
}

.detail-layout--compact {
    align-items: start;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-grid--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.detail-grid--transaction-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.detail-grid--transaction-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.detail-grid--movement-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
    padding: 10px 12px;
    border-radius: 10px;
    background: #fbfcfe;
    border: 1px solid #e6ebf2;
}

.field__label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.field__input {
    width: 100%;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    padding: 9px 11px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.field__input:focus {
    outline: none;
    border-color: #7cb0ff;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

.field__value {
    font-size: 14px;
    font-weight: 600;
    word-break: break-word;
}

.field--checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.field--checkbox input {
    width: 16px;
    height: 16px;
}

.balance-stack {
    display: grid;
    gap: 12px;
}

.notes {
    white-space: pre-wrap;
    line-height: 1.5;
    color: #334155;
    font-size: 13px;
}

.info-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}

.movement-table {
    width: 100%;
    border-collapse: collapse;
}

.movement-table--allocations {
    min-width: 720px;
    table-layout: fixed;
}

.movement-table th,
.movement-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #e6ebf2;
    text-align: left;
    font-size: 12px;
    vertical-align: top;
}

.movement-table th {
    background: #f8fafc;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 10px;
}

.movement-table .movement-actions-col,
.movement-table .movement-actions-cell {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    text-align: center;
    white-space: nowrap;
}

.movement-table .movement-actions-cell form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.movement-table--allocations th:nth-child(1),
.movement-table--allocations td:nth-child(1),
.movement-table--allocations th:nth-child(2),
.movement-table--allocations td:nth-child(2),
.movement-table--allocations th:nth-child(3),
.movement-table--allocations td:nth-child(3),
.movement-table--allocations th:nth-child(4),
.movement-table--allocations td:nth-child(4),
.movement-table--allocations th:nth-child(5),
.movement-table--allocations td:nth-child(5),
.movement-table--allocations th:nth-child(6),
.movement-table--allocations td:nth-child(6),
.movement-table--allocations th:nth-child(8),
.movement-table--allocations td:nth-child(8) {
    white-space: normal;
    overflow-wrap: anywhere;
}

.movement-table--allocations th:nth-child(7),
.movement-table--allocations td:nth-child(7) {
    width: 104px;
    white-space: nowrap;
}

.finance-table-wrap--movement {
    overflow-x: auto;
    overflow-y: hidden;
}

.inline-entry-form {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}

.inline-entry-form__body {
    display: grid;
    gap: 10px;
}

.inline-entry-form__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-entry-form.is-hidden {
    display: none;
}

.form-shell {
    max-width: 1200px;
}

.movement-form-shell {
    max-width: 780px;
}

.form-block {
    overflow: visible;
}

.form-error {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 13px;
    font-weight: 700;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Выбор исполнителей задачи: чип-инпут с подсказкой через datalist */
.assignee-picker {
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    background: #fff;
    padding: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 44px;
}
.assignee-picker:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}
.assignee-picker__chips {
    display: contents;
}
.assignee-picker__input {
    flex: 1 1 200px;
    min-width: 160px;
    border: none;
    outline: none;
    padding: 4px 6px;
    font-size: 14px;
    background: transparent;
}
.assignee-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px 4px 10px;
    background: #e8f1ff;
    color: #0f4fb3;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}
.assignee-chip__remove {
    border: none;
    background: transparent;
    color: #0f4fb3;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.assignee-chip__remove:hover {
    background: rgba(15, 79, 179, 0.18);
}

/* Статический вывод значения вместо input — для полей, которые подставляются
   автоматически (например, постановщик задачи = текущий пользователь). */
.form-field__static {
    padding: 8px 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text);
    font-weight: 600;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
    color: var(--text);
}

.form-field--invalid input,
.form-field--invalid select,
.form-field--invalid textarea {
    border-color: #ff0000;
    background: #fff;
    box-shadow: 0 0 0 1px #ff0000;
}

.form-field textarea {
    resize: vertical;
    min-height: 120px;
}

.detail-grid--form {
    margin-bottom: 12px;
}

.movement-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.form-field--textarea,
.form-field--full {
    margin-bottom: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 1180px) {
    .topbar__inner,
    .detail-layout,
    .detail-grid--compact,
    .movement-edit-grid,
    .detail-grid--movement-form {
        grid-template-columns: 1fr;
    }

    .topnav {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .container {
        width: min(100%, calc(100% - 16px));
    }

    .page-head,
    .toolbar,
    .form-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .registry-table,
    .movement-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .brand-wordmark {
        font-size: 28px;
    }
}

.stack-column {
    display: grid;
    gap: 12px;
}

.detail-grid--summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.form-sections {
    display: grid;
    gap: 12px;
}

.form-section {
    border: 1px solid #e6ebf2;
    border-radius: 12px;
    background: #f8fafc;
    padding: 12px;
}

.form-section__title {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #334155;
}

.form-section-grid {
    margin-bottom: 0;
}

.movement-edit-grid--compact {
    margin-bottom: 0;
}

.field--soft {
    background: #ffffff;
}

.form-hint-card .field__value {
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
}

.form-field--no-margin {
    margin-bottom: 0;
}
@media (max-width: 1180px) {
    .detail-grid--summary {
        grid-template-columns: 1fr;
    }
}
.registry-copy-col,
.registry-copy-cell {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

.copy-row-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #dbe3ee;
    border-radius: 7px;
    background: #f8fafc;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.copy-row-btn:hover {
    background: #e8f1ff;
    color: #0f4fb3;
    border-color: #cfe0ff;
}

.copy-row-btn.is-copied {
    background: #e8fff1;
    color: #1a7f37;
    border-color: #b7ebc6;
}
.registry-table--compact th.registry-copy-col,
.registry-table--compact td.registry-copy-cell {
    padding-left: 3px;
    padding-right: 3px;
}

.registry-copy-col,
.registry-copy-cell {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    white-space: nowrap;
    text-align: center;
}

.copy-row-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #dbe3ee;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    flex: 0 0 auto;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.detail-edit-form {
    display: grid;
    gap: 12px;
}

.detail-edit-form--transaction {
    gap: 8px;
}

.form-actions--detail {
    margin-top: 0;
    justify-content: flex-start;
}
.detail-grid--two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid--summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.owner-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #dbe3ee;
    background: #f8fafc;
    color: #334155;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .detail-grid--two-up,
    .detail-grid--summary {
        grid-template-columns: 1fr;
    }
}
.form-field input,
.form-field select,
.form-field textarea,
.field__value,
.movement-table td,
.movement-table th {
    font-size: 12px;
}

.form-field input,
.form-field select,
.form-field textarea {
    padding: 8px 10px;
    line-height: 1.2;
}

.form-field textarea {
    min-height: 96px;
}

.form-field input[readonly],
.form-field textarea[readonly],
.form-field select[disabled] {
    background: #eef2f6;
    color: #475569;
    border-color: #d6dee8;
}

.is-profit-value.is-positive {
    color: var(--ok);
}

.is-profit-value.is-negative {
    color: var(--danger);
}

.owner-badge {
    min-width: 24px;
    padding: 2px 6px;
    font-size: 10px;
}

.row-actions--icons {
    gap: 4px;
    justify-content: center;
    flex-wrap: nowrap;
}

.icon-action {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #dbe3ee;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.icon-action:hover {
    background: #e8f1ff;
    color: #0f4fb3;
    border-color: #cfe0ff;
}

.icon-action--primary {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.icon-action--primary:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

.icon-action--danger {
    background: #fff1f2;
    color: #b42318;
    border-color: #fecdd3;
}

.icon-action--danger:hover {
    background: #ffe4e6;
    color: #991b1b;
    border-color: #fda4af;
}
.detail-layout--single {
    grid-template-columns: minmax(0, 1fr);
}
.block--plain .panel-body--compact {
    padding-top: 10px;
    padding-bottom: 10px;
}

.detail-edit-form--transaction .block--plain .panel-body--compact {
    padding: 10px;
}

.detail-edit-form--transaction .form-field {
    gap: 4px;
}

.detail-edit-form--transaction .field__label {
    margin-bottom: 3px;
    font-size: 10px;
}

.detail-edit-form--transaction .form-field input,
.detail-edit-form--transaction .form-field select,
.detail-edit-form--transaction .form-field textarea {
    padding: 7px 9px;
    font-size: 12px;
}

.block--plain .block-head {
    display: none;
}

.block--plain.block--titled .block-head {
    display: flex;
}

.block-head--split .status-badge {
    font-size: 10px;
    min-width: auto;
}

.stack-column,
.balance-stack,
.detail-edit-form {
    gap: 8px;
}

.detail-layout--single {
    grid-template-columns: 1.35fr 0.85fr;
}

.detail-layout--single > .detail-edit-form {
    grid-column: 1 / 2;
}

.bk-create-page {
    max-width: 960px;
    margin: 0 auto;
}

.bk-create-shell .page-head {
    width: min(100%, 960px);
    margin-right: auto;
    margin-left: auto;
    align-items: center;
    justify-content: flex-start;
}

.bk-create-head__title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bk-create-toolbar {
    margin-bottom: 8px;
}

.bk-create-layout {
    display: block;
}

.bk-create-layout > .detail-edit-form {
    width: 100%;
    margin: 0 auto;
}

.bk-create-layout .block {
    border-color: #d8e2f2;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.bk-create-layout .block-head {
    min-height: 38px;
    padding: 9px 12px;
    background: #f8fafc;
    font-size: 15px;
}

.bk-create-layout .panel-body--compact {
    padding: 10px 12px;
}

.bk-create-layout .detail-grid {
    gap: 8px;
}

.bk-create-layout .form-field {
    gap: 5px;
}

.bk-create-layout .field__label {
    color: #334155;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.bk-create-layout .form-field input,
.bk-create-layout .form-field select,
.bk-create-layout .form-field textarea {
    border-color: #d5deea;
    border-radius: 8px;
    background: #fff;
}

.bk-create-layout .form-field textarea {
    min-height: 86px;
    padding-top: 9px;
    line-height: 1.35;
}

.bk-create-layout .form-actions--detail {
    margin-top: 2px;
}
.seller-link,
.field__subaction {
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
}

.field__subaction {
    margin-top: 4px;
}

.detail-grid--seller-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.registry-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.registry-sidebar {
    overflow: hidden;
}

.registry-menu {
    display: grid;
    gap: 2px;
    padding: 10px;
}

.registry-menu__link {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.registry-menu__link:hover,
.registry-menu__link.active {
    background: #e8f1ff;
    color: #0f4fb3;
}

.registry-content {
    min-width: 0;
}

.finance-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.finance-filters-card {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 12px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background:
        linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%);
}

.finance-filters-panel {
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%);
    overflow: hidden;
}

.finance-filters-panel[open] {
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
}

.finance-filters-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
}

.finance-filters-summary::-webkit-details-marker {
    display: none;
}

.finance-filters-summary::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    font-size: 14px;
    color: var(--muted);
    transition: transform 0.15s ease;
}

.finance-filters-panel[open] .finance-filters-summary::after {
    transform: rotate(180deg);
}

.finance-filters-card--collapsible {
    margin-bottom: 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.finance-filters-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.finance-filters-title {
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

.finance-filters-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px 10px;
}

.finance-filters-grid--transactions {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.finance-filters-grid--allocations {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.finance-filters-grid--summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-filter-field {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.finance-filter-field span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-filter-field input,
.finance-filter-field select {
    width: 100%;
    min-width: 0;
    border: 1px solid #cfd8e3;
    border-radius: 9px;
    padding: 7px 9px;
    font-size: 12px;
    background: #fff;
    color: var(--text);
}

.finance-filter-field--wide {
    grid-column: span 1;
}

.finance-filters-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 2px;
}

.bk-detail-page {
    display: grid;
    gap: 10px;
}

.bk-detail-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-color: #d8e2f2;
    border-radius: 10px;
    overflow: visible;
}

.bk-detail-toolbar__meta,
.bk-detail-toolbar__actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.bk-detail-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid #dbe3ee;
    border-radius: 9px;
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.bk-detail-chip--edit {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.bk-detail-chip--edit.is-dirty {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.bk-danger-menu {
    position: relative;
}

.bk-danger-menu summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #d7e0ec;
    border-radius: 9px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    list-style: none;
}

.bk-danger-menu summary::-webkit-details-marker {
    display: none;
}

.bk-danger-menu[open] summary {
    border-color: #fecaca;
    color: #dc2626;
}

.bk-danger-menu__item {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 132px;
    padding: 8px 10px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
    color: #dc2626;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
}

.bk-danger-menu__item:hover {
    background: #fef2f2;
}

.bk-detail-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.bk-detail-form,
.bk-detail-side {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.bk-detail-card {
    border-color: #d8e2f2;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.bk-detail-card .block-head {
    min-height: 34px;
    padding: 7px 10px;
    border-bottom-color: #dde6f1;
    background: #f8fafc;
    color: #18212f;
    font-size: 13px;
    font-weight: 800;
}

.bk-detail-card .panel-body--compact {
    padding: 10px;
}

.bk-detail-card[data-bk-height-source="assignment"] .panel-body--compact {
    padding-top: 6px;
}

.bk-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.bk-detail-grid--conditions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 10px;
}

.bk-detail-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.bk-detail-notes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.bk-detail-page .form-field {
    gap: 4px;
    min-width: 0;
}

.bk-detail-page .field__label {
    margin: 0;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1.1;
    text-transform: uppercase;
}

.bk-detail-page .form-field input,
.bk-detail-page .form-field select,
.bk-detail-page .form-field textarea,
.bk-readonly-value {
    min-height: 28px;
    padding: 5px 7px;
    border: 1px solid #d5deea;
    border-radius: 9px;
    background: #fff;
    color: #18212f;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.15;
}

.bk-readonly-value {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-color: #edf2f7;
    color: #18212f;
    font-variant-numeric: tabular-nums;
}

.bk-detail-page .form-field input[readonly],
.bk-detail-page .form-field textarea[readonly],
.bk-detail-page .form-field select[disabled] {
    background: #f8fafc;
    border-color: #edf2f7;
    color: #18212f;
    opacity: 1;
}

.bk-summary-item {
    display: grid;
    gap: 5px;
    min-width: 0;
    min-height: 58px;
    padding: 8px 10px;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    background: #fff;
}

.bk-summary-item strong {
    color: #0f172a;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.15;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.bk-summary-item--office-result strong.is-positive {
    color: var(--ok);
}

.bk-summary-item--office-result strong.is-negative {
    color: var(--danger);
}

.bk-detail-ledger {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.bk-detail-ledger .block-head {
    min-height: 34px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.bk-detail-ledger .panel-body--compact {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 4px 10px 8px;
}

.bk-detail-ledger .bk-detail-table-wrap {
    flex: 0 0 auto;
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    background: #fff;
}

.bk-detail-ledger .movement-table {
    min-width: 0;
    background: #fff;
}

.bk-detail-ledger .movement-table th,
.bk-detail-ledger .movement-table td {
    padding-top: 5px;
    padding-bottom: 5px;
}

.bk-detail-ledger .movement-table th {
    border-top: 0;
    background: #f8fafc;
}

.bk-detail-page textarea {
    min-height: 92px;
    resize: vertical;
}

.bk-detail-page .field__subaction {
    width: max-content;
    margin-top: 2px;
    font-size: 10px;
    font-weight: 700;
}

.bk-detail-ledger .block-head .action-btn {
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 12px;
}

.bk-detail-inline-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.bk-detail-inline-grid .form-field--full {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.bk-detail-page .inline-entry-form {
    margin: 0 0 8px;
    padding: 8px;
    border-color: #d8e2f2;
    border-radius: 10px;
    background: #fbfdff;
}

.bk-detail-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    background: #fff;
}

.bk-detail-page .movement-table {
    width: 100%;
    min-width: 520px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    background: #fff;
}

.bk-detail-page .bk-detail-col--date {
    width: 110px;
}

.bk-detail-page .bk-detail-col--money {
    width: 110px;
}

.bk-detail-page .bk-detail-col--owner {
    width: 88px;
}

.bk-detail-page .bk-detail-col--actions {
    width: 96px;
}

.bk-detail-page .bk-detail-col--comment {
    width: auto;
}

.bk-detail-page .bk-detail-col--route {
    width: 45%;
}

.bk-detail-page .movement-table th,
.bk-detail-page .movement-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #ebf0f6;
    color: #18212f;
    font-size: 11px;
    line-height: 1.15;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.bk-detail-page .movement-table th {
    white-space: nowrap;
}

.bk-detail-page .movement-table th {
    background: #f8fafc;
    color: #506175;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: uppercase;
}

.bk-detail-page .movement-table tbody tr:last-child td {
    border-bottom: 0;
}

.bk-detail-page .bk-detail-date-cell,
.bk-detail-page .bk-detail-money-cell,
.bk-detail-page .bk-detail-actions-cell {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.bk-detail-page .owner-badge {
    min-width: 0;
    width: 28px;
    height: 22px;
    padding: 0;
}

.bk-detail-page .movement-table .row-actions {
    justify-content: center;
    gap: 5px;
}

.bk-detail-page .movement-table .icon-action {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 8px;
    font-size: 12px;
}

.bk-detail-empty-row {
    color: #64748b;
    text-align: center !important;
}

@media (max-width: 1120px) {
    .bk-detail-layout {
        grid-template-columns: 1fr;
    }

    .bk-detail-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bk-detail-side .bk-detail-ledger:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 980px) {
    .bk-detail-toolbar {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .bk-detail-toolbar__meta,
    .bk-detail-toolbar__actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .bk-detail-grid,
    .bk-detail-summary,
    .bk-detail-notes-grid,
    .bk-detail-side {
        grid-template-columns: 1fr;
    }

    .bk-detail-side .bk-detail-ledger:last-child {
        grid-column: auto;
    }
}

@media (max-width: 720px) {
    .bk-detail-inline-grid {
        grid-template-columns: 1fr;
    }
}

.bk-sheet {
    display: grid;
    gap: 8px;
    padding: 0 3px 3px;
}

.block--bk-sheet .block-body {
    padding: 0;
}

.bk-sheet-form {
    display: grid;
    gap: 8px;
}

.bk-sheet-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 8px 4px 0;
}

.bk-sheet-toolbar__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.bk-sheet-toolbar__actions .action-btn.is-active {
    border-color: #bfd0e6;
    background: #edf4ff;
}

.bk-sheet-toolbar__actions .action-btn.has-active-filters {
    position: relative;
}

.bk-sheet-toolbar__actions .action-btn.has-active-filters::after {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 0 1px rgba(194, 51, 59, 0.18);
}

.bk-sheet-wrap {
    overflow: hidden;
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
}

.bk-sheet-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
}

.bk-sheet-table {
    width: 100%;
    min-width: var(--bk-sheet-min-width, 1560px);
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

.bk-sheet-filter-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 2px;
    margin: 0 0 8px;
    background: transparent;
}

.bk-sheet-filter-scroll.is-hidden {
    display: none;
}

.bk-sheet-filter-table {
    width: 100%;
    min-width: var(--bk-sheet-min-width, 1560px);
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

.bk-sheet-filter-table {
    border: 0;
}

.bk-sheet-filter-table td {
    min-width: 0;
    padding: 0 5px;
    border: 0;
    background: transparent;
    vertical-align: middle;
    overflow: hidden;
}

.bk-sheet-filter-table input,
.bk-sheet-filter-table select {
    width: 100%;
    min-width: 0;
    min-height: 24px;
    padding: 3px 6px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    background: #fff;
    color: #18212f;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.1;
    box-sizing: border-box;
}

.bk-sheet-filter-table select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 20px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%235b6573'><path d='M6 8.5L1.5 4h9z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 8px;
    cursor: pointer;
}

.bk-sheet-filter-table input::placeholder {
    color: #9aabc0;
}

.bk-sheet-filter-actions {
    text-align: center;
}

.bk-sheet-filter-actions__inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: max-content;
    margin: 0 auto;
}

.bk-sheet-filter-actions .icon-action {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border-radius: 8px;
    font-size: 11px;
}

.bk-sheet-table th,
.bk-sheet-table td {
    min-width: 0;
    padding: 4px 5px;
    border-bottom: 1px solid #ebf0f6;
    color: #18212f;
    font-size: 11px;
    line-height: 1.15;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bk-sheet-table thead th {
    padding: 7px 5px;
    background: #f8fafc;
    color: #506175;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1.15;
    text-align: center;
    text-transform: uppercase;
}

.bk-sheet-table thead tr:first-child th:first-child {
    border-top-left-radius: 10px;
}

.bk-sheet-table thead tr:first-child th:last-child {
    border-top-right-radius: 10px;
}

.bk-sheet-table tbody tr:hover td {
    background: #fbfdff;
}

.bk-sheet-table .account-link {
    display: inline-flex;
    width: 100%;
    max-width: 100%;
    min-height: 24px;
    align-items: center;
    justify-content: flex-start;
    padding: 4px 7px;
    border: 1px solid #d5deea;
    border-radius: 9px;
    background: #fff;
    color: #18212f;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
}

.bk-sheet-table .account-link:hover {
    border-color: #cfe0ff;
    background: #eef5ff;
    color: #0f4fb3;
}

.bk-sheet-table .account-link--disabled,
.bk-sheet-table .account-link--disabled:hover {
    border-color: #edf2f7;
    background: #f8fafc;
    color: #334155;
}

.bk-sheet-table .account-link span,
.bk-sheet-table .seller-link,
.bk-sheet-table .table-secret,
.bk-sheet-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bk-sheet-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-height: 24px;
    padding: 4px 7px;
    border: 1px solid #edf2f7;
    border-radius: 9px;
    background: #f8fafc;
    color: #18212f;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.bk-sheet-inline-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 24px;
    padding: 4px 7px;
    border: 1px solid #edf2f7;
    border-radius: 9px;
    background: #f8fafc;
    color: #18212f;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
}

.bk-sheet-inline-input--center {
    text-align: center;
}

.bk-sheet-inline-input.is-dirty {
    border-color: #fed7aa;
    background: #fff7ed;
}

.bk-sheet-inline-input.is-saving {
    border-color: #bae6fd;
    background: #f0f9ff;
}

.bk-sheet-inline-input.is-saved {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.bk-sheet-inline-input.is-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b42318;
}

.bk-sheet-table .account-link span,
.bk-sheet-table .seller-link {
    display: inline-block;
    max-width: 100%;
}

.bk-sheet-table .table-id {
    color: #0f5bd7;
    font-weight: 500;
}

.bk-sheet-table .table-profit {
    font-weight: 500;
}

.bk-sheet-table .seller-link,
.bk-sheet-table .status-badge {
    font-weight: 500;
}

.bk-sheet-table .status-badge {
    min-width: 0;
    width: 100%;
    max-width: 92px;
    min-height: 24px;
    padding: 4px 7px;
    border-radius: 9px;
}

.bk-sheet-cell--center {
    text-align: center;
}

.bk-sheet-cell--numeric {
    text-align: center;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.bk-sheet-actions-head,
.bk-sheet-actions-cell {
    text-align: center;
}

.bk-sheet-actions-cell .row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: max-content;
    margin: 0 auto;
}

.bk-sheet-actions-cell .icon-action,
.bk-sheet-actions-cell .copy-row-btn {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border-radius: 8px;
    font-size: 11px;
}

.bk-sheet-empty {
    padding: 14px;
    text-align: center;
    color: #64748b;
}

.bk-sheet-col--id { width: 62px; }
.bk-sheet-col--nom { width: 62px; }
.bk-sheet-col--date { width: 94px; }
.bk-sheet-col--person,
.bk-sheet-col--owner { width: 96px; }
.bk-sheet-col--country { width: 86px; }
.bk-sheet-col--bookmaker { width: 122px; }
.bk-sheet-col--login,
.bk-sheet-col--password { width: 110px; }
.bk-sheet-col--currency { width: 64px; }
.bk-sheet-col--percent { width: 74px; }
.bk-sheet-col--condition { width: 92px; }
.bk-sheet-col--money { width: 92px; }
.bk-sheet-col--status { width: 102px; }
.bk-sheet-col--actions { width: 64px; }

@media (max-width: 1280px) {
    .bk-sheet-toolbar {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .bk-sheet-toolbar__actions {
        justify-content: flex-start;
    }

}

.finance-toolbar-form {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: wrap;
}

.finance-toolbar-field {
    display: grid;
    gap: 4px;
    min-width: 180px;
}

.finance-toolbar-field select {
    min-width: 180px;
}

.finance-toolbar-field--date {
    min-width: 120px;
}

.finance-toolbar-field--date select,
.finance-toolbar-field--date input {
    min-width: 120px;
}

.finance-toolbar-field--wallet {
    min-width: 240px;
}

.finance-toolbar-field--wallet select {
    min-width: 240px;
}

.finance-toolbar-form--wide .finance-toolbar-field {
    min-width: 160px;
}

.finance-toolbar-form--wide .finance-toolbar-field select,
.finance-toolbar-form--wide .finance-toolbar-field input {
    min-width: 160px;
}

.finance-toolbar-hint {
    margin-bottom: 10px;
}

.finance-menu-group + .finance-menu-group {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.finance-menu-title {
    padding: 4px 12px 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-section-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.finance-section-stats--grid {
    margin-bottom: 14px;
}

.finance-overview-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.motivation-overview-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.finance-alert-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.finance-alert-card {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #fde68a;
    border-radius: 12px;
    background: #fffbeb;
}

.finance-alert-card__label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #92400e;
}

.finance-alert-card__value {
    font-size: 18px;
    line-height: 1.1;
    color: #78350f;
}

.finance-overview-card,
.schedule-sheet-stat {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fbff;
}

.finance-overview-card__label,
.schedule-sheet-stat__label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.finance-overview-card__value,
.schedule-sheet-stat__value {
    font-size: 20px;
    line-height: 1.1;
    color: #0f172a;
}

.finance-overview-card__value.is-positive {
    color: var(--ok);
}

.finance-overview-card__value.is-negative {
    color: var(--danger);
}

.finance-summary-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.finance-summary-split--priority {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.finance-summary-split--priority .finance-summary-panel {
    height: auto;
}

.finance-summary-page .panel-body--compact > * + * {
    margin-top: 8px;
}

.finance-summary-toolbar {
    align-items: start;
}

.finance-summary-head-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.finance-summary-period,
.finance-summary-sync {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid #d8e2f2;
    border-radius: 999px;
    background: #f8fbff;
    line-height: 1.15;
}

.finance-summary-sync span {
    margin-left: 5px;
}

.finance-summary-sync.is-fresh {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.finance-summary-sync.is-warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #a16207;
}

.finance-summary-sync.is-stale {
    border-color: #fecaca;
    background: #fff1f2;
    color: #b42318;
}

.finance-summary-page .finance-sheet-toolbar__summary-cards {
    gap: 5px;
}

.finance-summary-stat {
    min-width: 106px;
    padding: 4px 8px;
    gap: 1px;
    text-decoration: none;
}

.finance-summary-stat small {
    font-size: 8.5px;
    line-height: 1.05;
}

.finance-summary-stat strong {
    font-size: 13px;
    line-height: 1;
}

.finance-summary-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    overflow: visible;
    padding: 8px;
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    background: #fbfdff;
}

.finance-summary-filters[hidden] {
    display: none;
}

.finance-summary-date-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    flex: 0 0 214px;
    min-width: 0;
}

.finance-summary-wallet-filter {
    flex: 0 0 240px;
    min-width: 180px;
}

.finance-summary-filters input,
.finance-summary-filters select {
    width: 100%;
    min-width: 0;
    height: 28px;
    padding: 5px 8px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 10px;
    line-height: 1.2;
}

.finance-summary-filter-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
    min-width: max-content;
}

.finance-summary-filter-presets {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 5px;
    flex: 0 0 auto;
    min-width: max-content;
}

.finance-summary-filter-presets {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid #d8e2f2;
    gap: 7px;
}

.finance-summary-filter-button,
.finance-summary-filter-preset {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 10px;
    white-space: nowrap;
}

.finance-summary-filter-button {
    min-width: 88px;
}

.finance-summary-filter-preset {
    min-width: 56px;
}

.finance-summary-page .block--inner {
    border-radius: 10px;
    box-shadow: none;
}

.finance-summary-page .block--inner .block-head {
    min-height: 31px;
    padding: 7px 10px;
    font-size: 14px;
}

.finance-summary-page .registry-table--compact th,
.finance-summary-page .registry-table--compact td {
    padding: 5px 8px;
    line-height: 1.15;
}

.finance-summary-page .finance-table-wrap .registry-table tbody tr:last-child td,
.finance-summary-page .finance-table-wrap .registry-table tbody tr:last-child th {
    border-bottom: 0;
}

.finance-summary-anomaly-issue {
    color: #334155;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

.finance-summary-subvalue {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
}

.finance-summary-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 8px;
    border: 1px solid #d8e2f2;
    border-radius: 8px;
    background: #f8fbff;
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
}

.finance-summary-action-link:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.motivation-settings-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.motivation-overview-grid--employee {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.motivation-payslip-meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.motivation-payslip-settings {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.motivation-payslip-section {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fdfefe;
}

.motivation-payslip-section__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.motivation-payslip-section__title {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    color: #0f172a;
}

.motivation-payslip-subtitle {
    margin: 18px 0 8px 0;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.motivation-status-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-left: 10px;
    vertical-align: middle;
}

.motivation-status-pill.is-draft {
    background: #fef3c7;
    color: #92400e;
}

.motivation-status-pill.is-frozen {
    background: #dbeafe;
    color: #1e3a8a;
}

.motivation-status-pill.is-closed {
    background: #d1fae5;
    color: #065f46;
}

.motivation-status-pill.is-unknown {
    background: #e5e7eb;
    color: #2a2f3a;
}

.motivation-drill-row__cell {
    padding: 0 !important;
    background: #f8fafc;
}

.motivation-drill {
    padding: 6px 10px 8px 14px;
    border-left: 3px solid #cbd5e1;
}

.motivation-drill > summary {
    font-size: 11px;
    color: #475569;
    cursor: pointer;
    padding: 2px 0;
    user-select: none;
}

.motivation-drill > summary:hover {
    color: #1e3a8a;
}

.motivation-drill-table {
    width: 100%;
    margin-top: 6px;
    font-size: 11px;
    border-collapse: collapse;
}

.motivation-drill-table thead th {
    text-align: left;
    padding: 4px 8px;
    background: #eef2f7;
    color: #506175;
    font-weight: 600;
}

.motivation-drill-table tbody td {
    padding: 4px 8px;
    border-bottom: 1px solid #e6ebf2;
}

.motivation-drill-table tbody tr:last-child td {
    border-bottom: none;
}

.motivation-action-confirm {
    position: relative;
    display: inline-block;
}

.motivation-action-confirm > summary {
    cursor: pointer;
    list-style: none;
}

.motivation-action-confirm > summary::-webkit-details-marker {
    display: none;
}

.motivation-action-confirm__form {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 30;
    min-width: 280px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.motivation-action-confirm__hint {
    margin: 0;
    font-size: 11px;
    color: #475569;
    line-height: 1.4;
}

.motivation-action-confirm__form input[type="password"],
.motivation-action-confirm__form textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
}

.motivation-action-confirm__form textarea {
    resize: vertical;
    min-height: 50px;
}

.motivation-action-confirm__form button[type="submit"] {
    align-self: flex-end;
}

.motivation-payslip-table th:nth-child(1),
.motivation-payslip-table td:nth-child(1) {
    width: 30%;
}

.motivation-payslip-table th:nth-child(2),
.motivation-payslip-table td:nth-child(2) {
    width: 16%;
    white-space: nowrap;
}

.motivation-payslip-table th:nth-child(3),
.motivation-payslip-table td:nth-child(3) {
    width: 54%;
}

.motivation-payslip-table__value {
    font-weight: 700;
    color: #0f172a;
}

.motivation-payslip-table__value.is-negative {
    color: var(--danger);
}

.motivation-payslip-table__total td {
    background: #f8fbff;
    font-weight: 700;
}

.motivation-shell,
.motivation-shell .registry-content,
.motivation-shell .block,
.motivation-shell .block-head,
.motivation-shell .panel-body {
    overflow: visible;
}

.motivation-shell .finance-table-wrap {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    z-index: 1;
}

.table-cell-note {
    margin-top: 2px;
    font-size: 11px;
    color: var(--muted);
}

.motivation-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    width: 14px;
    height: 14px;
    color: #64748b;
    cursor: help;
    vertical-align: middle;
    z-index: 40;
}

.motivation-help i {
    font-size: 12px;
    line-height: 1;
}

.motivation-help::after {
    content: attr(data-help);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    width: 260px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 50;
}

.motivation-help::before {
    content: "";
    position: absolute;
    left: 50%;
    top: calc(100% + 2px);
    transform: translateX(-50%) translateY(4px);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 6px solid rgba(15, 23, 42, 0.96);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 50;
}

.motivation-help:hover::after,
.motivation-help:hover::before,
.motivation-help:focus-visible::after,
.motivation-help:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.task-checklist {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.task-checklist__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    line-height: 1.2;
}

.task-checklist__item input {
    width: auto;
    margin: 0;
}

.task-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.task-chip--department {
    background: #e8f1ff;
    border-color: #cfe0ff;
    color: #0f4fb3;
}

.task-request-box {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid #fde68a;
    border-radius: 12px;
    background: #fffbeb;
    color: #78350f;
    font-size: 13px;
}

.task-approval-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.task-overdue-note {
    color: var(--danger);
    font-weight: 700;
}

.tasks-shell .bets-content {
    gap: 12px;
}

.tasks-shell .bets-menu {
    gap: 3px;
    padding: 8px 10px 10px;
}

.tasks-shell .bets-menu__link {
    padding: 8px 9px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.15;
}

.tasks-shell .bets-menu__link.active {
    background: #eaf2ff;
}

.tasks-shell .bets-menu__count {
    min-width: auto;
    height: auto;
    padding: 0 1px;
    border: 0;
    background: transparent;
    color: #8a98aa;
    font-size: 11px;
    font-weight: 800;
}

.tasks-shell .bets-menu__link:hover .bets-menu__count,
.tasks-shell .bets-menu__link.active .bets-menu__count {
    background: transparent;
    color: #3869b1;
}

.tasks-shell .bets-menu__count.is-zero {
    color: #a9b5c4;
    font-weight: 700;
}

.tasks-shell .bets-sidebar__create {
    padding: 10px 12px 6px;
}

.tasks-shell .bets-sidebar__create .action-btn {
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 13px;
}

.tasks-page-block > .panel-body--compact,
.tasks-form-card > .panel-body--compact {
    display: grid;
    gap: 12px;
}

.tasks-overview-grid {
    padding-left: 0;
}

.tasks-overview-grid .finance-overview-card {
    min-width: 118px;
}

/* Карточки обзора задач — с иконкой и цветовым акцентом, кликабельные */
.tasks-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.tasks-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.tasks-stat:hover {
    background: #f8fbff;
    border-color: #cfe0ff;
    transform: translateY(-1px);
}

.tasks-stat__icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #f1f5f9;
    color: #475569;
}

.tasks-stat__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tasks-stat__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 700;
}

.tasks-stat__value {
    font-size: 20px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--text);
}

.tasks-stat--info       .tasks-stat__icon { background: #e0f2fe; color: #075985; }
.tasks-stat--primary    .tasks-stat__icon { background: #e8f1ff; color: #0f4fb3; }
.tasks-stat--warn       .tasks-stat__icon { background: #fef3c7; color: #92400e; }
.tasks-stat--danger     .tasks-stat__icon { background: #fee2e2; color: #b91c1c; }
.tasks-stat--success    .tasks-stat__icon { background: #dcfce7; color: #166534; }
.tasks-stat--muted      .tasks-stat__icon { background: #f1f5f9; color: #64748b; }

.tasks-stat--danger  .tasks-stat__value { color: #b91c1c; }
.tasks-stat--success .tasks-stat__value { color: #166534; }

/* Сетка «срочное» — две колонки на больших экранах, одна на узких */
.tasks-urgent-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tasks-filters-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.tasks-board-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tasks-panel {
    overflow: hidden;
}

.tasks-table-shell {
    border: 1px solid #d8e2f2;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    /* Минимальный отступ от .block-head (полосы заголовка) сверху и от
       рамки блока по бокам/снизу. Если .tasks-table-shell вложен в
       .panel-body, внешний отступ обнуляется (см. правило ниже). */
    margin: 6px 3px 4px;
}

/* Если обводка таблицы лежит внутри panel-body — отступы даёт сам panel-body */
.panel-body .tasks-table-shell,
.block-body .tasks-table-shell {
    margin: 0;
}

.tasks-table-wrap {
    overflow: auto;
}

.tasks-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
}

.tasks-table th,
.tasks-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.tasks-table th {
    background: #f8fafc;
    color: #506175;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    text-align: center;
    border-bottom: 1px solid #dde6f1;
}

.tasks-table td {
    background: #fff;
    border-bottom: 1px solid #e7edf6;
    color: #18212f;
    font-size: 12px;
    line-height: 1.25;
}

.tasks-table tbody tr:last-child td {
    border-bottom: 0;
}

.tasks-table td.is-center,
.tasks-table td.is-actions {
    text-align: center;
    white-space: nowrap;
}

.tasks-table td.is-title {
    min-width: 220px;
}

.tasks-table__title {
    font-weight: 700;
    color: #0f172a;
}

.tasks-table__title-link {
    color: inherit;
    text-decoration: none;
}

.tasks-table__title-link:hover {
    color: #2563eb;
}

.tasks-history-panel .block-head {
    padding: 7px 12px;
}

.tasks-history-panel .block-head span {
    font-size: 14px;
}

.tasks-history-panel .panel-body--compact {
    padding: 10px;
}

.tasks-history-panel .tasks-history-compose {
    padding: 9px 10px;
    gap: 7px;
}

.tasks-history-list {
    display: grid;
    gap: 0;
    border: 1px solid #e3eaf5;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.tasks-history-item {
    display: grid;
    grid-template-columns: 120px 150px 80px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    min-height: 30px;
    padding: 5px 8px;
    border: 0;
    border-bottom: 1px solid #eef3fa;
    border-radius: 0;
    background: #fff;
}

.tasks-history-item:last-child {
    border-bottom: 0;
}

.tasks-history-item__meta {
    display: contents;
}

.tasks-history-item__event {
    min-width: 0;
}

.tasks-history-item__comment {
    min-width: 0;
}

.tasks-history-item__comment .tasks-history-comment {
    font-size: 11px;
}

.tasks-history-item__comment .tasks-history-comment:not(.tasks-history-comment--long) {
    max-height: 30px;
    overflow: hidden;
}

.tasks-history-item__compact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.tasks-history-item__date,
.tasks-history-item__author {
    color: #334155;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.tasks-history-item__author {
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tasks-history-comment {
    min-width: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

.tasks-history-comment-toggle {
    display: grid;
    gap: 6px;
}

.tasks-history-comment-toggle summary {
    display: grid;
    gap: 4px;
    cursor: pointer;
    list-style: none;
}

.tasks-history-comment-toggle summary::-webkit-details-marker {
    display: none;
}

.tasks-history-comment-preview {
    max-height: 30px;
    overflow: hidden;
    color: #18212f;
    white-space: pre-wrap;
}

.tasks-history-comment-full {
    padding-top: 4px;
    color: #18212f;
    white-space: pre-wrap;
}

.tasks-history-comment-more {
    justify-self: start;
    padding: 2px 6px;
    border: 1px solid #d8e2f2;
    border-radius: 999px;
    background: #f8fbff;
    color: #2563eb;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.tasks-history-comment-toggle[open] .tasks-history-comment-preview,
.tasks-history-comment-toggle[open] .tasks-history-comment-more {
    display: none;
}

.tasks-event-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 2px 7px;
    border: 1px solid #d8e2f2;
    border-radius: 999px;
    background: #f8fbff;
    color: #42526a;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.tasks-event-badge--comment {
    border-color: #e2e8f0;
    background: #fff;
    color: #64748b;
    font-weight: 700;
}

.tasks-event-badge--started,
.tasks-event-badge--completion-approved,
.tasks-event-badge--result-updated {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #1a7f37;
}

.tasks-event-badge--deadline-requested,
.tasks-event-badge--completion-requested {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.tasks-event-badge--deadline-rejected,
.tasks-event-badge--completion-rejected {
    border-color: #fecaca;
    background: #fef2f2;
    color: #c2333b;
}

.tasks-detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
}

.tasks-detail-toolbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.tasks-detail-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 9px;
    border-bottom: 1px solid #d8e2f2;
    background: #fff;
}

.tasks-detail-heading {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.tasks-detail-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tasks-detail-title-row h2 {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.2;
}

.tasks-detail-panel {
    display: grid;
    gap: 10px;
}

.tasks-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.92fr);
    gap: 12px;
    align-items: start;
}

.tasks-column {
    display: grid;
    gap: 12px;
}

.tasks-summary-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 12px;
    align-items: start;
}

.tasks-summary-main,
.tasks-summary-side {
    display: grid;
    gap: 12px;
}

.tasks-task-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tasks-task-meta--wide {
    grid-template-columns: minmax(76px, 0.55fr) repeat(3, minmax(0, 1fr));
}

.tasks-task-meta--primary,
.tasks-task-meta--secondary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.tasks-section-card {
    display: grid;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid #d8e2f2;
    border-radius: 12px;
    background: #fbfdff;
}

.tasks-section-card__title {
    margin: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #526277;
}

.tasks-workspace-card,
.tasks-history-compose {
    background: #fff;
}

.tasks-work-bar {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #d8e2f2;
    border-radius: 12px;
    background: #fff;
}

.tasks-work-bar--compact {
    grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
    align-items: center;
}

.tasks-work-bar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #526277;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tasks-work-bar__head small {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.tasks-work-bar__body {
    display: grid;
    gap: 8px;
}

.tasks-work-bar--compact .tasks-work-bar__body {
    justify-self: end;
    width: min(100%, 560px);
}

.tasks-action-panel {
    display: grid;
    gap: 10px;
}

.tasks-actions-line {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.tasks-workflow-stack {
    display: grid;
    gap: 10px;
}

.tasks-work-item {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e3e8f1;
    border-radius: 12px;
    background: #f8fbff;
}

.tasks-work-item__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.tasks-work-item__title {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
}

.tasks-work-item__meta {
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.tasks-task-meta .field__value {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 18px;
}

.tasks-summary-card .field {
    padding: 7px 9px;
    border-radius: 9px;
}

.tasks-summary-card .field__label {
    margin-bottom: 3px;
    font-size: 9px;
}

.tasks-summary-card .field__value {
    font-size: 12px;
}

.tasks-description-card .notes {
    min-height: 28px;
    padding-top: 2px;
}

.tasks-detail-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.tasks-summary-card {
    border-color: #e3eaf5;
    background: #fbfdff;
}

.tasks-summary-more {
    display: grid;
    gap: 8px;
}

.tasks-summary-more summary {
    width: max-content;
    cursor: pointer;
    padding: 3px 7px;
    border: 1px solid #d8e2f2;
    border-radius: 999px;
    background: #fff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    list-style: none;
}

.tasks-summary-more summary::-webkit-details-marker {
    display: none;
}

.tasks-field-important {
    background: #fff;
}

.tasks-field-important .field__value {
    color: #0f172a;
    font-weight: 800;
}

.tasks-field-muted .field__value {
    color: #64748b;
}

.tasks-section-card__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tasks-result-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.tasks-result-form {
    display: grid;
    gap: 8px;
}

.tasks-result-form textarea,
.tasks-comment-form textarea {
    width: 100%;
    height: auto;
    min-height: 32px;
    padding: 7px 9px;
    border: 1px solid #d5deea;
    border-radius: 10px;
    background: #fbfdff;
    color: #18212f;
    font-size: 12px;
    line-height: 1.35;
    outline: none;
    overflow: hidden;
    resize: none;
}

.tasks-result-form textarea {
    min-height: 44px;
}

.tasks-result-form textarea:focus,
.tasks-comment-form textarea:focus {
    border-color: #9fc0f5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.08);
}

.tasks-comment-form {
    display: grid;
    grid-template-columns: minmax(280px, 900px) auto;
    justify-content: start;
    gap: 8px;
    align-items: center;
}

.tasks-comment-form .action-btn {
    min-height: 32px;
}

.tasks-approval-form {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto;
    gap: 7px;
    align-items: center;
    justify-self: end;
    width: min(100%, 520px);
}

.tasks-approval-form textarea {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #d5deea;
    border-radius: 10px;
    background: #fbfdff;
    color: #18212f;
    font-size: 12px;
    line-height: 1.35;
    outline: none;
    overflow: hidden;
    resize: none;
}

.tasks-approval-form textarea:focus {
    border-color: #9fc0f5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.08);
}

.tasks-approval-actions,
.tasks-table-actions-form {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.tasks-approval-actions .action-btn {
    min-width: 108px;
}

.tasks-table-actions-form {
    margin: 0;
}

.tasks-deadline-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 10px;
}

.tasks-deadline-fields input[type="date"],
.tasks-deadline-fields select {
    height: 36px;
    border: 1px solid #d5deea;
    border-radius: 10px;
    background: #fbfdff;
    color: #18212f;
    font-size: 12px;
    font-weight: 700;
    outline: none;
}

.tasks-deadline-fields input[type="date"]:focus,
.tasks-deadline-fields select:focus {
    border-color: #9fc0f5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.08);
}

.tasks-deadline-fields select {
    cursor: pointer;
    text-align: center;
}

.tasks-modal-result-preview {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    background: #f8fbff;
}

.tasks-modal-result-preview span {
    color: #526277;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tasks-modal-result-preview strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.35;
    white-space: pre-wrap;
}

.tasks-status-stack {
    display: grid;
    gap: 8px;
}

.tasks-status-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.tasks-plain-note {
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}

.tasks-actions-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tasks-actions-layout--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
}

.tasks-actions-column {
    display: grid;
    gap: 12px;
}

.tasks-section-card--action {
    align-content: start;
}

.tasks-section-card--action .registry-message {
    margin: 0;
}

.tasks-form-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tasks-form-actions {
    justify-content: flex-end;
}

.tasks-action-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.tasks-action-buttons .action-btn {
    width: 100%;
}

.tasks-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 172px);
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: auto;
}

.tasks-quick-actions--three {
    grid-template-columns: repeat(3, 172px);
}

.tasks-quick-actions--two {
    grid-template-columns: repeat(2, 172px);
}

.tasks-quick-actions form {
    margin: 0;
}

.tasks-quick-actions .action-btn {
    width: 100%;
    min-height: 34px;
}

.tasks-action-secondary {
    min-height: 34px;
    padding-left: 12px;
    padding-right: 12px;
}

.tasks-action-error {
    padding: 7px 10px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #c2333b;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    transition: opacity 0.18s ease;
}

.tasks-action-error.is-hiding {
    opacity: 0;
}

.tasks-pending-card {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(340px, 520px);
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid #b9d4fb;
    border-radius: 12px;
    background: linear-gradient(135deg, #f4f8ff 0%, #fbfdff 100%);
    box-shadow: inset 3px 0 0 #1f6feb;
}

.tasks-pending-card__content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: #0f172a;
    font-size: 12px;
}

.tasks-pending-card__kicker,
.tasks-pending-card__author,
.tasks-pending-card__pair span {
    color: #526277;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tasks-pending-card__author {
    padding: 3px 7px;
    border-radius: 999px;
    background: #edf5ff;
    color: #315b96;
    letter-spacing: 0;
    text-transform: none;
}

.tasks-pending-card__pair {
    display: inline-flex;
    gap: 4px;
    align-items: baseline;
    min-width: 0;
}

.tasks-pending-card__pair strong {
    color: #0f172a;
    font-weight: 700;
    line-height: 1.35;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tasks-result-card .notes {
    min-height: 44px;
}

.tasks-modal {
    width: min(540px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
}

.tasks-modal::backdrop {
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(2px);
}

.tasks-modal__card {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid #d8e2f2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.tasks-modal__head,
.tasks-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: #f8fbff;
}

.tasks-modal__head {
    border-bottom: 1px solid #d8e2f2;
    color: #0f172a;
    font-size: 14px;
}

.tasks-modal__body {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.tasks-modal__footer {
    justify-content: flex-end;
    border-top: 1px solid #d8e2f2;
}

.tasks-modal__close {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.tasks-modal__close:hover {
    color: #0f172a;
}

.tasks-toast-error {
    position: fixed;
    z-index: 1200;
    right: 18px;
    top: 18px;
    max-width: min(420px, calc(100vw - 36px));
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
    color: #c2333b;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.tasks-toast-error.is-hiding {
    opacity: 0;
    transform: translateY(-6px);
}

.task-checklist__item {
    border-radius: 12px;
    background: #f8fbff;
}

.task-request-box {
    border-color: #dbe3ee;
    background: #f8fbff;
    color: #334155;
}

.panel-body--compact > * + * {
    margin-top: 14px;
}

.panel-body--compact .block--inner {
    margin-bottom: 0;
}

.finance-summary-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.finance-table-wrap--grow {
    flex: 1 1 auto;
}

.finance-summary-totalwrap {
    margin-top: auto;
    border-top: 1px solid var(--line);
    background: #f8fafc;
}

.finance-summary-totalwrap .registry-table th,
.finance-summary-totalwrap .registry-table td {
    border-bottom: 0;
}

.finance-summary-totalrow th,
.finance-summary-totalrow td {
    background: #f8fafc;
    color: #44546a;
    font-weight: 700;
}

.finance-stat-chip {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fbff;
    font-size: 12px;
    color: #334155;
}

.finance-sheet-block .panel-body--compact {
    padding: 10px 12px 12px;
}

.finance-sheet-block .panel-body--compact > * + * {
    margin-top: 8px;
}

.finance-sheet-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 0 0 2px;
}

.finance-sheet-toolbar__summary {
    min-width: 0;
}

.finance-sheet-toolbar__summary-group {
    display: grid;
    gap: 4px;
}

.finance-sheet-toolbar__summary-label {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.finance-sheet-toolbar__summary-cards {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.finance-sheet-stat {
    display: inline-grid;
    min-width: 88px;
    gap: 2px;
    padding: 5px 9px;
    border: 1px solid #d8e2f2;
    border-radius: 8px;
    background: #fbfdff;
    color: #334155;
    text-align: center;
}

.finance-sheet-stat small {
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-transform: uppercase;
}

.finance-sheet-stat strong {
    color: #18212f;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
}

.finance-sheet-stat.is-positive {
    border-color: #b7e4c7;
    background: #f0fdf4;
}

.finance-sheet-stat.is-positive strong {
    color: var(--ok);
}

.finance-sheet-stat.is-negative {
    border-color: #f3c4c7;
    background: #fff8f8;
}

.finance-sheet-stat.is-negative strong {
    color: var(--danger);
}

.finance-sheet-stat.is-warning {
    border-color: #ead28b;
    background: #fffdf4;
}

.finance-sheet-stat.is-warning strong {
    color: var(--warn);
}

.finance-sheet-toolbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.finance-sheet-toolbar__actions form {
    margin: 0;
}

.finance-sheet-toolbar__actions .action-btn:disabled {
    cursor: default;
    opacity: 0.55;
}

.finance-sheet-toolbar__actions .action-btn.has-active-filters {
    position: relative;
    background: #eff6ff;
    color: #1d4ed8;
}

.finance-sheet-toolbar__actions .action-btn.has-active-filters::after {
    content: "";
    position: absolute;
    right: 5px;
    top: 5px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--danger);
}

.finance-sheet-filters {
    display: grid;
    grid-template-columns: minmax(210px, 1.25fr) repeat(5, minmax(104px, 1fr)) minmax(130px, 1fr) minmax(130px, 1fr) auto;
    gap: 6px;
    align-items: center;
    padding: 8px;
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    background: #fbfdff;
}

.finance-sheet-filters[hidden] {
    display: none;
}

.finance-sheet-filters input,
.finance-sheet-filters select {
    width: 100%;
    min-width: 0;
    height: 28px;
    padding: 5px 8px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 10px;
    line-height: 1.2;
}

.finance-sheet-filter-field--pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
}

.finance-sheet-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    white-space: nowrap;
}

.finance-manual-form {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
    gap: 6px;
    align-items: end;
    padding: 8px;
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    background: #fbfdff;
}

.finance-manual-form[hidden] {
    display: none;
}

.finance-manual-form .form-field {
    gap: 3px;
    margin-bottom: 0;
    min-width: 0;
}

.finance-manual-form .field__label {
    margin: 0;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1.1;
    text-transform: uppercase;
}

.finance-manual-form input,
.finance-manual-form select {
    width: 100%;
    min-width: 0;
    height: 28px;
    padding: 5px 8px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 10px;
    line-height: 1.2;
}

.finance-manual-form__error {
    grid-column: 1 / -1;
    margin: 0;
}

.finance-manual-form__comment {
    grid-column: span 2;
}

.finance-manual-form__actions {
    display: flex;
    justify-content: flex-end;
    align-self: end;
}

.finance-table-wrap--sheet {
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    background: #fff;
    overflow: auto;
}

.finance-table--sheet {
    min-width: 950px;
}

.finance-table--sheet th,
.finance-table--sheet td {
    border-bottom-color: #ebf0f6;
}

.finance-reconciliation-page .panel-body--compact > * + * {
    margin-top: 8px;
}

.finance-reconciliation-toolbar {
    align-items: end;
}

.finance-reconciliation-page .finance-sheet-toolbar__summary-label {
    display: none;
}

.finance-reconciliation-stat {
    min-width: 86px;
    padding: 4px 8px;
    gap: 1px;
    text-decoration: none;
}

.finance-reconciliation-stat small {
    color: #536174;
    font-size: 8.5px;
    line-height: 1.05;
}

.finance-reconciliation-stat strong {
    color: #18212f;
    font-size: 13px;
    line-height: 1;
}

.finance-reconciliation-stat.is-active {
    border-color: #8db8f3;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px rgba(31, 111, 235, 0.12);
}

.finance-reconciliation-filters {
    grid-template-columns: minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(240px, 1.6fr) minmax(130px, 0.9fr) minmax(110px, 0.7fr) minmax(150px, 1fr) auto auto;
}

.finance-reconciliation-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 5px 8px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.finance-reconciliation-check input {
    width: 14px;
    height: 14px;
    margin: 0;
}

.finance-reconciliation-table {
    min-width: 1150px;
}

.finance-reconciliation-links-table {
    min-width: 980px;
}

.finance-reconciliation-row--pending,
.finance-reconciliation-row--partial {
    background: #fffdf7;
}

.finance-reconciliation-row--pending td,
.finance-reconciliation-row--partial td {
    background: #fffdf7;
}

.finance-reconciliation-row--overmatched,
.finance-reconciliation-row--disputed,
.finance-reconciliation-row--rate_missing {
    background: #fff8f8;
}

.finance-reconciliation-row--overmatched td,
.finance-reconciliation-row--disputed td,
.finance-reconciliation-row--rate_missing td {
    background: #fff8f8;
}

.finance-reconciliation-object {
    line-height: 1.15;
}

.finance-reconciliation-object a {
    color: #0f172a;
    text-decoration: none;
}

.finance-reconciliation-object a:hover {
    color: var(--accent);
}

.finance-money-cell {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.finance-money-cell.is-positive {
    color: var(--ok);
    font-weight: 700;
}

.finance-money-cell.is-negative {
    color: var(--danger);
    font-weight: 700;
}

.finance-money-cell--diff.is-positive,
.finance-money-cell--diff.is-negative {
    font-weight: 800;
}

.finance-money-cell--diff.is-positive {
    color: var(--ok);
}

.finance-money-cell--diff.is-negative {
    color: var(--danger);
}

.finance-reconciliation-type {
    white-space: nowrap;
}

.finance-reconciliation-actions-cell {
    text-align: center;
    white-space: nowrap;
}

.finance-reconciliation-status-cell {
    text-align: center;
}

.finance-reconciliation-status-cell .finance-status-badge {
    margin-inline: auto;
}

.finance-reconciliation-actions-cell .icon-action {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 7px;
    font-size: 11px;
}

.finance-reconciliation-action-menu {
    position: relative;
    display: inline-flex;
}

.finance-reconciliation-action-menu summary {
    list-style: none;
    cursor: pointer;
}

.finance-reconciliation-action-menu summary::-webkit-details-marker {
    display: none;
}

.finance-reconciliation-popover {
    position: absolute;
    z-index: 30;
    right: 0;
    top: calc(100% + 5px);
    display: grid;
    gap: 6px;
    min-width: 190px;
    padding: 8px;
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    color: #334155;
    font-size: 11px;
    text-align: left;
    white-space: normal;
}

.finance-reconciliation-popover input {
    width: 100%;
    height: 28px;
    padding: 5px 8px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 11px;
}

.finance-reconciliation-note {
    padding: 7px 9px;
    border: 1px solid #d8e2f2;
    border-radius: 8px;
    background: #fbfdff;
    color: #334155;
    font-size: 12px;
}

.finance-reconciliation-page .finance-inline-section__head {
    align-items: center;
}

.finance-inline-section__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    padding: 2px 7px;
    border: 1px solid #f3c4c7;
    border-radius: 999px;
    background: #fff1f2;
    color: var(--danger);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.finance-inline-section__total {
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.finance-reconciliation-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: #64748b;
    font-size: 11px;
}

.finance-reconciliation-pagination__actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.finance-reconciliation-pagination__page {
    min-width: 48px;
    color: #334155;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.finance-reconciliation-pagination .icon-action {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 7px;
}

.finance-reconciliation-pagination .icon-action.is-disabled {
    cursor: default;
    opacity: 0.45;
}

.finance-status-badge--ok {
    border-color: #b7e4c7;
    background: #f0fdf4;
    color: var(--ok);
}

.finance-status-badge--warn {
    border-color: #ead28b;
    background: #fff8db;
    color: var(--warn);
}

.finance-status-badge--variance {
    border-color: #a9d18e;
    background: #eef8df;
    color: #3f6212;
}

.finance-status-badge--danger {
    border-color: #f3c4c7;
    background: #fff1f2;
    color: var(--danger);
}

.finance-table--sheet tbody tr:last-child td {
    border-bottom: 0;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.inline-form--compact {
    gap: 8px;
}

.currency-refresh-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 8px;
    padding: 0 0 8px;
    font-size: 11px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

.finance-table {
    width: 100%;
    min-width: 0;
}

.finance-table--fixed {
    table-layout: fixed;
}

.finance-table .finance-cell-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.finance-table .finance-open-col {
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    text-align: center;
    white-space: nowrap;
}

.finance-table input,
.finance-table select,
.finance-table textarea {
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 12px;
    line-height: 1.25;
}

.finance-table textarea {
    min-height: 56px;
    resize: vertical;
}

.finance-inline-row > td {
    background: #f8fbff;
    padding: 8px 10px;
}

.finance-inline-grid {
    display: grid;
    gap: 8px;
}

.finance-unallocated-row--requires_allocation {
    background: #fff;
}

.finance-unallocated-row--partial {
    background: #fff;
}

.finance-unallocated-balance {
    color: var(--danger);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.finance-decision-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 20px;
    padding: 3px 8px;
    border: 1px solid #d7e0ef;
    border-radius: 999px;
    background: #f8fafc;
    color: #42506a;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
}

.finance-decision-badge--requires_allocation {
    border-color: #f3c4c7;
    background: #fff1f2;
    color: var(--danger);
}

.finance-decision-badge--partial {
    border-color: #ead28b;
    background: #fff8db;
    color: var(--warn);
}

.finance-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 20px;
    padding: 3px 8px;
    border: 1px solid #d7e0ef;
    border-radius: 999px;
    background: #f8fafc;
    color: #42506a;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
}

.finance-page-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid #d7e0ef;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
}

.finance-detail-page {
    display: grid;
    gap: 8px;
}

.finance-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    font-size: 12px;
}

.finance-page-head--detail {
    align-items: center;
    margin-bottom: 8px;
}

.finance-page-head__title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.finance-page-head__title h1 {
    margin-bottom: 0;
}

.finance-transaction-layout {
    display: grid;
    grid-template-columns: minmax(420px, 0.95fr) minmax(620px, 1.35fr);
    gap: 10px;
    align-items: start;
}

.finance-transaction-main,
.finance-transaction-side {
    min-width: 0;
}

.finance-detail-sheet {
    overflow: hidden;
}

.finance-detail-sheet__head {
    min-height: 40px;
}

.finance-detail-sheet__body {
    display: grid;
    gap: 8px;
}

.finance-detail-pane {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
    height: auto;
    padding: 0 8px 8px;
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

.finance-detail-pane--allocation {
    align-content: start;
}

.finance-detail-pane__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 30px;
    margin: 0 -8px;
    padding: 6px 8px;
    border-bottom: 1px solid #d8e2f2;
    background: #f8fafc;
}

.finance-detail-pane__head > span {
    color: #18212f;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.finance-transaction-tags {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: wrap;
}

.finance-transaction-delete-form {
    display: inline-flex;
    margin: 0;
}

.finance-transaction-delete-form .icon-action {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 7px;
    font-size: 11px;
}

.finance-detail-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 3px 8px;
    border: 1px solid #d7e0ef;
    border-radius: 999px;
    background: #f8fafc;
    color: #42506a;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.finance-detail-badge--income {
    border-color: #b7e4c7;
    background: #f0fdf4;
    color: var(--ok);
}

.finance-detail-badge--expense {
    border-color: #f3c4c7;
    background: #fff1f2;
    color: var(--danger);
}

.finance-detail-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid #d8e2f2;
    border-radius: 8px;
    background: #d8e2f2;
}

.finance-detail-kpi {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 7px 8px;
    border: 0;
    background: #ffffff;
}

.finance-detail-kpi:nth-child(3n) {
    border-right: 0;
}

.finance-detail-kpi span,
.finance-detail-field span {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1.1;
    text-transform: uppercase;
}

.finance-detail-kpi strong {
    display: block;
    min-width: 0;
    color: #18212f;
    font-size: 12px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finance-detail-kpi.is-positive strong {
    color: var(--ok);
    font-weight: 750;
}

.finance-detail-kpi.is-danger strong {
    color: var(--danger);
    font-weight: 750;
}

.finance-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid #d8e2f2;
    border-radius: 8px;
    background: #d8e2f2;
}

.finance-detail-field {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 7px 8px;
    border: 0;
    background: #ffffff;
}

.finance-detail-field:nth-child(3n) {
    border-right: 0;
}

.finance-detail-field--wide {
    grid-column: span 3;
    border-right: 0;
}

.finance-detail-field--span-2 {
    grid-column: span 2;
}

.finance-detail-field--copy {
    padding-right: 7px;
}

.finance-detail-field--form {
    padding: 6px 8px;
}

.finance-detail-field--form .form-field {
    margin-bottom: 0;
}

.finance-detail-field--form input,
.finance-detail-field--form textarea {
    width: 100%;
    padding: 5px 7px;
    border-color: #d5deea;
    border-radius: 7px;
    font-size: 12px;
}

.finance-detail-field--form textarea {
    min-height: 32px;
    resize: vertical;
}

.finance-detail-comment-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: end;
}

.finance-detail-save-btn {
    align-self: end;
    min-height: 28px;
    padding: 5px 9px;
}

.finance-detail-field strong {
    min-width: 0;
    color: #18212f;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.finance-detail-value--mono {
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    font-weight: 500;
}

.finance-copy-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: start;
}

.finance-copy-value {
    display: block;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.finance-detail-history-wrap {
    margin-top: 0;
}

.finance-detail-allocation-history th,
.finance-detail-allocation-history td {
    vertical-align: top;
}

.finance-allocation-state {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    color: #42506a;
    font-size: 11px;
}

.finance-allocation-state span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 5px 9px;
    border: 1px solid #d7e0ef;
    border-radius: 999px;
    background: #f8fbff;
    line-height: 1;
}

.finance-allocation-state strong {
    color: #18212f;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.finance-allocation-state .is-danger strong {
    color: var(--danger);
    font-weight: 750;
}

.finance-allocation-complete {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 6px;
    max-width: 100%;
    min-height: 26px;
    padding: 5px 9px;
    border: 1px solid #b7e4c7;
    border-radius: 8px;
    background: #f0fdf4;
    color: var(--ok);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.finance-allocation-note {
    margin: -4px 0 0;
    padding: 4px 7px;
    border: 1px solid #d8e2f2;
    border-radius: 7px;
    background: #fbfdff;
    color: #526277;
    font-size: 11px;
    line-height: 1.2;
}

.finance-detail-allocation-history {
    min-width: 720px;
}

.finance-detail-allocation-history th:nth-child(1),
.finance-detail-allocation-history td:nth-child(1) {
    width: 128px;
}

.finance-detail-allocation-history th:nth-child(2),
.finance-detail-allocation-history td:nth-child(2) {
    width: 180px;
}

.finance-detail-allocation-history th:nth-child(3),
.finance-detail-allocation-history td:nth-child(3) {
    width: 112px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.finance-detail-allocation-history th:nth-child(4),
.finance-detail-allocation-history td:nth-child(4) {
    width: 82px;
    white-space: nowrap;
}

.finance-detail-allocation-history th:nth-child(6),
.finance-detail-allocation-history td:nth-child(6) {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    text-align: center;
}

.finance-history-amount {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.finance-detail-allocation-history .finance-history-object__main {
    font-weight: 550;
}

.finance-inline-section {
    display: grid;
    gap: 6px;
}

.finance-inline-section__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.finance-inline-section__head span {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.finance-inline-section__head strong {
    color: var(--danger);
    font-variant-numeric: tabular-nums;
}

.finance-allocation-history {
    min-width: 620px;
}

.finance-allocation-history th:nth-child(1),
.finance-allocation-history td:nth-child(1) {
    width: 150px;
}

.finance-allocation-history th:nth-child(3),
.finance-allocation-history td:nth-child(3) {
    width: 110px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.finance-allocation-history th:nth-child(5),
.finance-allocation-history td:nth-child(5) {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    white-space: nowrap;
    text-align: center;
}

.finance-history-object {
    min-width: 280px;
}

.finance-history-object__main,
.finance-history-object__note {
    display: block;
}

.finance-history-object__main {
    color: #172033;
    font-weight: 600;
}

.finance-history-object__note {
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.25;
}

.finance-allocation-form {
    gap: 6px;
}

.finance-allocation-form--detail {
    gap: 4px;
}

.finance-allocation-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
}

.finance-allocation-form--detail .finance-allocation-toolbar {
    align-items: center;
}

.finance-allocation-metrics {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 11px;
    color: #42506a;
}

.finance-allocation-metrics span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #d7e0ef;
    border-radius: 999px;
    background: #f8fbff;
    line-height: 1;
}

.finance-allocation-form--detail .finance-allocation-metrics {
    gap: 5px;
    font-size: 10px;
}

.finance-allocation-form--detail .finance-allocation-metrics span {
    min-height: 22px;
    padding: 4px 8px;
}

.finance-allocation-rows {
    display: grid;
    gap: 6px;
}

.finance-allocation-form--detail .finance-allocation-rows {
    gap: 4px;
}

.finance-allocation-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    padding: 6px;
    border: 1px solid #d7e0ef;
    border-radius: 10px;
    background: #f8fbff;
}

.finance-allocation-form--detail .finance-allocation-row {
    padding: 5px;
}

.finance-allocation-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
}

.finance-allocation-form--detail .finance-allocation-grid {
    gap: 5px;
}

.finance-allocation-comment {
    grid-column: 1 / -1;
}

.finance-allocation-row-actions {
    display: flex;
    align-items: flex-start;
    padding-top: 18px;
}

.finance-allocation-field {
    min-width: 0;
}

.finance-allocation-field--type,
.finance-allocation-field--subtype,
.finance-allocation-field--amount,
.finance-allocation-field--percent,
.finance-allocation-field--placeholder-count {
    grid-column: span 1;
}

.finance-allocation-field--account,
.finance-allocation-field--linked-wallet,
.finance-allocation-field--department,
.finance-allocation-field--employee,
.finance-allocation-field--seller {
    grid-column: span 2;
}

.finance-allocation-row .field__label {
    font-size: 10px;
    margin-bottom: 3px;
}

.finance-allocation-row input,
.finance-allocation-row select {
    padding: 6px 8px;
    font-size: 12px;
}

.finance-allocation-form--detail .finance-allocation-row input,
.finance-allocation-form--detail .finance-allocation-row select {
    padding: 5px 7px;
}

.finance-allocation-form .form-actions {
    margin-top: 0;
}

.finance-allocation-form--detail .form-actions {
    margin-top: -4px;
}

.finance-allocation-form--detail .action-btn {
    min-height: 30px;
    padding: 6px 10px;
}

.finance-inline-form {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(140px, 0.8fr) minmax(220px, 2fr) auto;
    gap: 10px;
    align-items: end;
}

.finance-inline-form--allocation {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.finance-inline-form--allocation .form-field--full {
    grid-column: 1 / span 5;
    margin-bottom: 0;
}

.finance-inline-form--allocation .form-actions {
    align-self: end;
}

.finance-inline-form .form-actions {
    margin-top: 0;
}

@media (max-width: 1180px) {
    .finance-sheet-toolbar {
        grid-template-columns: 1fr auto;
    }

    .finance-sheet-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    }

    .finance-manual-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .finance-manual-form__actions {
        justify-content: flex-start;
    }

    .finance-sheet-filter-field--pair {
        grid-column: span 2;
    }

    .finance-inline-form {
        grid-template-columns: 1fr;
    }

    .detail-layout--transaction,
    .detail-grid--transaction-meta,
    .detail-grid--transaction-summary {
        grid-template-columns: 1fr;
    }

    .finance-transaction-layout {
        grid-template-columns: 1fr;
    }

    .finance-detail-kpis {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .finance-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-detail-field--wide {
        grid-column: span 2;
    }

    .finance-detail-field--span-2 {
        grid-column: auto;
    }

    .finance-inline-form--allocation .form-field--full {
        grid-column: auto;
    }

    .finance-allocation-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-allocation-comment {
        grid-column: auto;
    }

    .finance-allocation-row {
        grid-template-columns: 1fr;
    }

    .task-checklist,
    .task-approval-grid {
        grid-template-columns: 1fr;
    }

    .tasks-board-grid,
    .tasks-urgent-grid,
    .tasks-detail-layout,
    .tasks-detail-content-grid,
    .tasks-summary-layout,
    .tasks-actions-layout,
    .tasks-pending-card,
    .tasks-approval-form,
    .tasks-filters-grid,
    .tasks-form-meta,
    .tasks-task-meta,
    .tasks-task-meta--wide,
    .tasks-comment-form {
        grid-template-columns: 1fr;
    }

    .tasks-action-buttons,
    .tasks-quick-actions {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .tasks-quick-actions--two,
    .tasks-quick-actions--three {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .tasks-work-bar--compact {
        grid-template-columns: 1fr;
    }

    .tasks-work-bar--compact .tasks-work-bar__body,
    .tasks-quick-actions,
    .tasks-approval-form {
        justify-self: stretch;
        width: 100%;
    }

    .tasks-history-item {
        grid-template-columns: 112px minmax(120px, 1fr) minmax(70px, 100px);
    }

    .tasks-history-item__meta {
        display: contents;
    }

    .tasks-history-item__comment {
        grid-column: 1 / -1;
    }

    .finance-filters-grid,
    .finance-filters-grid--transactions,
    .finance-filters-grid--allocations,
    .finance-filters-grid--summary,
    .bk-list-filters__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .finance-filter-field--wide {
        grid-column: span 2;
    }

    .finance-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-alert-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-summary-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .finance-sheet-toolbar {
        grid-template-columns: 1fr;
    }

    .finance-sheet-toolbar__actions {
        justify-content: flex-start;
    }

    .finance-sheet-toolbar__summary-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-sheet-stat {
        min-width: 0;
    }

    .finance-sheet-filters {
        grid-template-columns: 1fr;
    }

    .finance-summary-filters {
        align-items: stretch;
    }

    .finance-summary-date-range {
        grid-template-columns: 1fr;
        flex-basis: 100%;
    }

    .finance-summary-wallet-filter,
    .finance-summary-filter-actions,
    .finance-summary-filter-presets {
        flex-basis: 100%;
        min-width: 0;
    }

    .finance-summary-filter-actions,
    .finance-summary-filter-presets {
        justify-content: flex-start;
    }

    .finance-summary-filter-presets {
        padding-left: 0;
        margin-left: 0;
        border-left: 0;
        flex-wrap: wrap;
    }

    .finance-manual-form {
        grid-template-columns: 1fr;
    }

    .finance-manual-form__comment {
        grid-column: auto;
    }

    .finance-sheet-filter-field--pair {
        grid-column: auto;
    }

    .finance-sheet-filter-actions {
        justify-content: flex-start;
    }

    .finance-transaction-tags {
        justify-content: flex-start;
    }

    .finance-detail-kpis,
    .finance-detail-grid {
        grid-template-columns: 1fr;
    }

    .finance-detail-kpi,
    .finance-detail-kpi:nth-child(3n),
    .finance-detail-field,
    .finance-detail-field:nth-child(2n),
    .finance-detail-field:nth-child(3n) {
        border-right: 0;
    }

    .finance-detail-field--wide {
        grid-column: auto;
    }

    .finance-detail-field--span-2 {
        grid-column: auto;
    }

    .finance-detail-comment-field {
        grid-template-columns: 1fr;
    }

    .finance-detail-pane__head {
        align-items: flex-start;
        flex-direction: column;
    }
}

.bets-shell {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.bets-sidebar {
    overflow: hidden;
}

.bets-menu {
    display: grid;
    gap: 2px;
    padding: 8px;
}

.bets-menu__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.bets-menu__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border: 1px solid #d7e2f1;
    border-radius: 999px;
    background: #f8fafc;
    color: #526277;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.bets-menu__link:hover,
.bets-menu__link.active {
    background: #e8f1ff;
    color: #0f4fb3;
}

.bets-menu__link:hover .bets-menu__count,
.bets-menu__link.active .bets-menu__count {
    border-color: #cfe0ff;
    background: #fff;
    color: #0f4fb3;
}

.bets-content {
    min-width: 0;
    display: grid;
    gap: 12px;
}

.bets-sheet-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 0;
    margin-bottom: 8px;
}

.bets-sheet-head__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    align-self: end;
    padding-right: 3px;
    padding-top: 4px;
}

.bets-overview-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    align-self: center;
    padding-left: 10px;
    width: auto;
}

.bets-overview-grid .finance-overview-card {
    display: grid;
    gap: 3px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fbff;
    min-width: 116px;
    width: fit-content;
    text-align: center;
    justify-items: center;
}

.bets-overview-grid .finance-overview-card__label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.bets-overview-grid .finance-overview-card__value {
    font-size: 15px;
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.bets-overview-value-suffix {
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.bets-sheet-wrap {
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.bets-sheet-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 6px 6px;
    box-sizing: border-box;
}

.bets-table--sheet {
    min-width: 1180px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.bets-table--sheet th,
.bets-table--sheet td {
    border: 0;
    padding: 0 4px;
    font-size: 12px;
    line-height: 1.25;
    background: transparent;
}

.bets-table--sheet thead th {
    background: #f8fafc;
    color: #506175;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 7px 5px;
    border-bottom: 1px solid #dde6f1;
}

.bets-table--sheet thead th:first-child {
    border-top-left-radius: 10px;
}

.bets-table--sheet thead th:last-child {
    border-top-right-radius: 10px;
}

.bets-table--sheet tbody tr:hover .bets-sheet-field {
    border-color: #d7e4f5;
    background: #fbfdff;
}

.bets-table--sheet .registry-empty {
    padding: 18px 14px;
    text-align: center;
    color: #64748b;
    font-size: 12px;
}

.bets-table--sheet .bets-inline-row td {
    background: transparent;
}

.bets-table--sheet td.bets-col--description,
.bets-table--sheet td.bets-col--account {
    text-align: left;
}

.bets-table--sheet td.bets-col--date,
.bets-table--sheet td.bets-col--employee,
.bets-table--sheet td.bets-col--sport,
.bets-table--sheet td.bets-col--country,
.bets-table--sheet td.bets-col--currency,
.bets-table--sheet td.bets-col--amount,
.bets-table--sheet td.bets-col--odds,
.bets-table--sheet td.bets-col--rent,
.bets-table--sheet td.bets-col--result,
.bets-table--sheet td.bets-col--profit,
.bets-table--sheet td.bets-col--source,
.bets-table--sheet td.bets-col--actions {
    text-align: center;
}

.bets-table--sheet .bets-inline-row input,
.bets-table--sheet .bets-inline-row select,
.bets-table--sheet .bets-inline-row textarea {
    font-size: 11px;
    min-height: 28px;
    padding: 4px 7px;
    border-radius: 9px;
    border: 1px solid #d5deea;
    background: #fff;
}

.bets-table--sheet .bets-inline-row textarea {
    min-height: 30px;
    resize: vertical;
}

.bets-table--sheet .bets-col--actions .bets-actions {
    justify-content: center;
}

.bets-sheet-field {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 28px;
    padding: 4px 7px;
    border: 1px solid #d5deea;
    border-radius: 9px;
    background: #fff;
    color: #18212f;
    font-size: 11px;
    line-height: 1.15;
    box-sizing: border-box;
}

.bets-sheet-field--center {
    justify-content: center;
    text-align: center;
}

.bets-sheet-field--text {
    justify-content: flex-start;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bets-sheet-field--profit {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.bets-sheet-field--profit.is-positive {
    color: var(--ok);
    background: #f0fdf4;
    border-color: #b7e4c7;
}

.bets-sheet-field--profit.is-negative {
    color: var(--danger);
    background: #fef2f2;
    border-color: #f3c4c4;
}

.bets-sheet-field--result.is-won {
    color: #15803d;
    background: #f0fdf4;
    border-color: #b7e4c7;
}

.bets-sheet-field--result.is-lost {
    color: #dc2626;
    background: #fef2f2;
    border-color: #f3c4c4;
}

.bets-sheet-field--result.is-void {
    color: #475569;
    background: #f8fafc;
    border-color: #dbe3ee;
}

.bets-table--sheet .bets-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: fit-content;
    margin: 0 auto;
}

.bets-table--sheet .icon-action {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border-radius: 8px;
    font-size: 11px;
}

.bets-entry-panel,
.bets-group {
    display: grid;
    gap: 8px;
}

.bets-entry-panel__title,
.bets-group__meta {
    font-size: 12px;
    font-weight: 700;
    color: #516684;
}

.bets-grid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid #d8e2f2;
    border-radius: 10px;
    background: #fff;
}

.bets-grid-toolbar__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    min-width: 0;
}

.bets-grid-toolbar__item {
    font-size: 12px;
    color: #475569;
    white-space: nowrap;
}

.bets-grid-toolbar__item strong {
    color: #10233f;
    font-weight: 900;
}

.bets-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border: 1px solid #d8e2f2;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: #f7f9fc;
}

.bets-group__title {
    font-size: 13px;
    font-weight: 800;
    color: #10233f;
}

.bets-group__main {
    display: contents;
}

.bets-group__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #10233f;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    min-width: 0;
}

.bets-group__toggle-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bets-group__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    min-width: 0;
}

.bets-group__meta span {
    white-space: nowrap;
}

.bets-group__add {
    border: 0;
    background: transparent;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.bets-group__body {
    display: block;
    border: 1px solid #d8e2f2;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    overflow: auto;
    background: #fff;
}

.bets-group__body.is-collapsed {
    display: none;
}

.bets-grid-empty {
    padding: 22px 16px;
    text-align: center;
}

.bets-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.bets-table th,
.bets-table td {
    padding: 4px 6px;
    font-size: 11px;
    line-height: 1.2;
    vertical-align: middle;
    text-align: center;
    border: 1px solid #e4ebf5;
}

.bets-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8fafc;
    padding-right: 6px;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    font-weight: 800;
    color: #475569;
}

.bets-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    background: #fff;
}

.bets-table td.bets-col--date,
.bets-table td.bets-col--employee,
.bets-table td.bets-col--sport,
.bets-table td.bets-col--country,
.bets-table td.bets-col--currency,
.bets-table td.bets-col--amount,
.bets-table td.bets-col--odds,
.bets-table td.bets-col--rent,
.bets-table td.bets-col--result,
.bets-table td.bets-col--profit,
.bets-table td.bets-col--source {
    white-space: nowrap;
}

.bets-col--date {
    width: 76px;
}

.bets-col--table {
    width: 118px;
}

.bets-col--employee {
    width: 110px;
}

.bets-col--sport {
    width: 96px;
}

.bets-col--country {
    width: 90px;
}

.bets-col--description {
    width: 260px;
}

.bets-col--event {
    width: 220px;
}

.bets-col--account {
    width: 280px;
}

.bets-col--currency {
    width: 54px;
}

.bets-col--amount {
    width: 72px;
}

.bets-col--odds,
.bets-col--rent,
.bets-col--result,
.bets-col--profit {
    width: 72px;
}

.bets-col--source {
    width: 76px;
}

.bets-col--comment {
    min-width: 180px;
}

.bets-col--actions {
    width: 72px;
    white-space: nowrap;
}

.bets-table--mpk .bets-col--actions {
    width: 94px;
}

.bets-inline-row input,
.bets-inline-row select,
.bets-inline-row textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 12px;
    background: #fff;
    color: var(--text);
}

.bets-inline-row textarea {
    min-height: 56px;
    resize: vertical;
}

.bets-inline-row input[readonly] {
    background: #eef2f6;
}

.bets-cell-input {
    width: 100%;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 11px;
    background: #fff;
    color: var(--text);
}

.bets-cell-input:focus {
    border-color: #93c5fd;
    outline: 0;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.16);
}

.bets-cell-input[readonly] {
    background: #f8fafc;
}

.bets-inline-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.bets-inline-status.is-draft {
    background: #eff6ff;
    color: #2563eb;
}

.bets-inline-status.is-dirty {
    background: #fff7ed;
    color: #c2410c;
}

.bets-inline-status.is-saving {
    background: #ecfeff;
    color: #0f766e;
}

.bets-inline-status.is-saved {
    background: #f1f5f9;
    color: #64748b;
}

.bets-inline-status.is-presence {
    background: #fff7ed;
    color: #b45309;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.28);
    cursor: help;
}

.bets-row--draft td {
    background: #f8fbff;
}

.bets-row--dirty td {
    background: #fffdf5;
}

.bets-row--saving td {
    background: #f5faff;
}

.bets-col--description,
.bets-col--account,
.bets-col--comment {
    text-align: left;
}

.bets-table--mpk .bets-col--account {
    width: 150px;
}

.bets-table--mpk .bets-col--source,
.bets-table--mpk .bets-col--sport {
    width: 110px;
}

.bets-table--mpk .bets-col--event,
.bets-table--mpk td.bets-col--event {
    text-align: left;
}

.bets-table--mpk .bets-col--event {
    width: 170px;
}

.bets-table--mpk .bets-col--actions {
    width: 92px;
}

.bets-table--mpk th:nth-child(1),
.bets-table--mpk td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 2;
    background: inherit;
}

.bets-table--mpk th:nth-child(2),
.bets-table--mpk td:nth-child(2) {
    position: sticky;
    left: 110px;
    z-index: 2;
    background: inherit;
}

.bets-table--mpk th:nth-child(1),
.bets-table--mpk th:nth-child(2) {
    z-index: 4;
    background: #f8fafc;
}

.bets-grid-toolbar--sheet {
    margin-bottom: 8px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.bets-group--mpk {
    background: #fff;
}

.bets-mpk-grid-wrap {
    border: 1px solid #d8e2f2;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.bets-mpk-grid-scroll {
    overflow-x: auto;
    overflow-y: hidden;
}

.bets-mpk-main-table {
    width: 100%;
    min-width: 1360px;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
}

.bets-mpk-main-table th,
.bets-mpk-main-table td {
    padding: 0;
    border-bottom: 1px solid #e7edf6;
    vertical-align: middle;
    background: #fff;
}

.bets-mpk-main-table thead th {
    padding: 8px 10px;
    background: #f8fafc;
    color: #526277;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
}

.bets-mpk-main-table thead th:nth-child(2) {
    width: 90px;
}

.bets-mpk-main-table thead th:nth-child(3) {
    width: 210px;
    text-align: left;
}

.bets-mpk-main-table thead th:nth-child(4),
.bets-mpk-main-table thead th:nth-child(5),
.bets-mpk-main-table thead th:nth-child(6),
.bets-mpk-main-table thead th:nth-child(7),
.bets-mpk-main-table thead th:nth-child(8),
.bets-mpk-main-table thead th:nth-child(9),
.bets-mpk-main-table thead th:nth-child(10),
.bets-mpk-main-table thead th:nth-child(11) {
    width: 96px;
}

.bets-mpk-main-table thead th:first-child {
    width: 42px;
}

.bets-mpk-main-table thead th:last-child {
    width: 72px;
}

.bets-mpk-group-row td {
    background: #fff;
}

.bets-mpk-group-row__toggle {
    text-align: center;
}

.bets-mpk-group-toggle {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #d8e2f2;
    border-radius: 8px;
    background: #f5f8fc;
    color: #284b80;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.bets-mpk-group-toggle:hover {
    background: #e8f1ff;
    border-color: #cfe0ff;
    color: #0f4fb3;
}

.bets-mpk-group-row td:not(.bets-mpk-group-row__toggle):not(.bets-mpk-group-row__actions) {
    padding: 6px 8px;
}

.bets-mpk-group-row__date {
    text-align: center;
}

.bets-mpk-group-row__actions {
    padding: 6px 8px;
}

.bets-mpk-group-input,
.bets-mpk-group-value {
    width: 100%;
    min-height: 28px;
    border-radius: 9px;
    font-size: 10px;
    line-height: 1.2;
}

.bets-mpk-group-input {
    border: 1px solid #d3ddea;
    background: #fff;
    padding: 5px 7px;
    color: #18212f;
}

.bets-mpk-group-input--event {
    text-align: left;
}

.bets-mpk-group-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 7px;
    background: #f8fafc;
    border: 1px solid #ebf0f6;
    color: #18212f;
    font-weight: 700;
}

.bets-mpk-group-value--event {
    justify-content: flex-start;
    font-weight: 800;
}

.bets-mpk-group-value--numeric {
    font-variant-numeric: tabular-nums;
}

.bets-mpk-group-actions {
    justify-content: center;
    gap: 5px;
}

.bets-mpk-group-detail-row td {
    padding: 0 8px 8px 36px;
    background: #fff;
    border-bottom: 1px solid #e7edf6;
}

.bets-group.is-collapsed .bets-mpk-group-detail-row {
    display: none;
}

.bets-mpk-subtable-wrap {
    border: 1px solid #e1e8f2;
    border-radius: 12px;
    background: #fbfdff;
    overflow: hidden;
}

.bets-mpk-subtable-scroll {
    overflow-x: auto;
    overflow-y: hidden;
}

.bets-mpk-subtable {
    width: 100%;
    min-width: 980px;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
}

.bets-mpk-subtable th,
.bets-mpk-subtable td {
    padding: 4px 6px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
    text-align: center;
    background: #fff;
}

.bets-mpk-subtable thead th {
    background: #f5f8fc;
    color: #5a6a80;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: normal;
    line-height: 1.15;
}

.bets-mpk-subtable tbody tr:last-child td {
    border-bottom: 0;
}

.bets-mpk-subtable .bets-row-static,
.bets-mpk-subtable .bets-cell-input {
    min-height: 24px;
    font-size: 11px;
}

.bets-mpk-subtable .bets-cell-input {
    padding: 3px 6px;
    border-radius: 7px;
}

.bets-mpk-subtable .bets-row-static {
    justify-content: center;
    padding: 3px 6px;
    border-radius: 7px;
}

.bets-mpk-subtable .bets-row-static--sub {
    margin-top: 2px;
    font-size: 9px;
}

.bets-mpk-subtable__employee {
    width: 104px;
}

.bets-mpk-subtable__account {
    width: 128px;
}

.bets-mpk-subtable__currency {
    width: 58px;
}

.bets-mpk-subtable__amount,
.bets-mpk-subtable__odds,
.bets-mpk-subtable__result,
.bets-mpk-subtable__profit,
.bets-mpk-subtable__source {
    width: 88px;
}

.bets-mpk-subtable__actions {
    width: 66px;
}

.bets-mpk-subtable .registry-empty {
    padding: 12px;
    text-align: center;
    color: #64748b;
    font-size: 11px;
}

.bets-pivot-wrap {
    overflow: auto;
    border: 1px solid #d9e2ef;
    border-radius: 10px;
    background: #fff;
}

.bets-group--mpk .bets-group__body {
    display: table-row-group;
}

.bets-table--mpk-pivot {
    width: 100%;
    table-layout: fixed;
}

.bets-table--mpk-pivot th:nth-child(1),
.bets-table--mpk-pivot td:nth-child(1) {
    width: 38px;
}

.bets-table--mpk-pivot th:nth-child(2),
.bets-table--mpk-pivot td:nth-child(2) {
    width: 240px;
}

.bets-table--mpk-pivot th:nth-child(3),
.bets-table--mpk-pivot td:nth-child(3) {
    width: 110px;
}

.bets-table--mpk-pivot th:nth-child(4),
.bets-table--mpk-pivot td:nth-child(4),
.bets-table--mpk-pivot th:nth-child(5),
.bets-table--mpk-pivot td:nth-child(5),
.bets-table--mpk-pivot th:nth-child(6),
.bets-table--mpk-pivot td:nth-child(6),
.bets-table--mpk-pivot th:nth-child(7),
.bets-table--mpk-pivot td:nth-child(7),
.bets-table--mpk-pivot th:nth-child(8),
.bets-table--mpk-pivot td:nth-child(8),
.bets-table--mpk-pivot th:nth-child(9),
.bets-table--mpk-pivot td:nth-child(9),
.bets-table--mpk-pivot th:nth-child(10),
.bets-table--mpk-pivot td:nth-child(10),
.bets-table--mpk-pivot th:nth-child(11),
.bets-table--mpk-pivot td:nth-child(11) {
    width: 120px;
}

.bets-table--mpk-pivot .bets-col--actions {
    width: 74px;
}

.bets-group-main-row td {
    padding: 6px 8px;
    background: #f8fafc;
    border-top: 1px solid #dbe3ee;
    vertical-align: middle;
}

.bets-table--mpk-pivot tbody:first-of-type .bets-group-main-row td {
    border-top: 0;
}

.bets-group-main-row__toggle {
    text-align: center;
}

.bets-group-main-row__event {
    text-align: left;
}

.bets-group-main-row__value {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
}

.bets-group-main-row .bets-cell-input {
    width: 100%;
    min-width: 0;
    padding: 4px 6px;
    font-size: 11px;
    border-radius: 7px;
}

.bets-group-main-row .bets-group__toggle {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #eef4ff;
    color: #2563eb;
    justify-content: center;
}

.bets-pivot-detail-row td {
    padding: 0 8px 8px 44px;
    background: #fff;
    border-top: 0;
}

.bets-subtable-wrap {
    margin-top: 2px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fbfdff;
}

.bets-table--mpk-subgroup {
    width: 100%;
    table-layout: fixed;
}

.bets-table--mpk-subgroup th,
.bets-table--mpk-subgroup td {
    padding: 4px 6px;
    font-size: 10px;
}

.bets-table--mpk-subgroup th:nth-child(1),
.bets-table--mpk-subgroup td:nth-child(1) {
    width: 120px;
}

.bets-table--mpk-subgroup th:nth-child(2),
.bets-table--mpk-subgroup td:nth-child(2) {
    width: 180px;
}

.bets-table--mpk-subgroup th:nth-child(3),
.bets-table--mpk-subgroup td:nth-child(3) {
    width: 70px;
}

.bets-table--mpk-subgroup th:nth-child(4),
.bets-table--mpk-subgroup td:nth-child(4),
.bets-table--mpk-subgroup th:nth-child(5),
.bets-table--mpk-subgroup td:nth-child(5),
.bets-table--mpk-subgroup th:nth-child(6),
.bets-table--mpk-subgroup td:nth-child(6),
.bets-table--mpk-subgroup th:nth-child(7),
.bets-table--mpk-subgroup td:nth-child(7),
.bets-table--mpk-subgroup th:nth-child(8),
.bets-table--mpk-subgroup td:nth-child(8) {
    width: 110px;
}

.bets-table--mpk-subgroup .bets-col--actions {
    width: 66px;
}

.bets-group.is-collapsed .bets-pivot-detail-row {
    display: none;
}

.bets-row-static {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    width: 100%;
    padding: 4px 6px;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
    line-height: 1.2;
    text-align: left;
}

.bets-row-static--event {
    font-weight: 700;
    color: #0f172a;
}

.bets-row-static--sub {
    margin-top: 4px;
    min-height: 0;
    padding: 0;
    background: transparent;
    color: #64748b;
    font-size: 10px;
}

.bets-row-static--mono {
    justify-content: center;
    font-family: Consolas, "Courier New", monospace;
}

.bets-resize-handle {
    position: absolute;
    top: 0;
    right: -2px;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
}

.bets-resize-handle::after {
    content: "";
    position: absolute;
    top: 20%;
    bottom: 20%;
    right: 3px;
    width: 2px;
    border-radius: 999px;
    background: #d5ddea;
}

.bets-table th:hover .bets-resize-handle::after {
    background: #9fb4d8;
}

.bets-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.bets-actions form {
    display: inline-flex;
    margin: 0;
}

.registry-head-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.registry-head-actions form {
    margin: 0;
}

.registry-message {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    color: #334155;
    font-size: 13px;
}

.registry-message--ok {
    background: #ecfdf3;
    color: #166534;
}

.finance-page-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.finance-page-head__meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.finance-page-head__meta a {
    color: var(--blue);
    text-decoration: none;
}

.finance-page-head__meta a:hover {
    text-decoration: underline;
}

.finance-cell--wrap {
    white-space: normal;
    line-height: 1.35;
 }

.block--schedule-sheet,
.block--schedule-sheet .block-body,
.block--schedule-sheet .schedule-sheet,
.block--schedule-sheet .schedule-sheet-toolbar,
.block--schedule-sheet .schedule-sheet-period-form,
.block--schedule-sheet .bets-period-picker {
    overflow: visible !important;
}

.block--schedule-sheet {
    overflow: visible;
}

.block--schedule-sheet .block-body {
    padding: 12px;
}

.schedule-sheet {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-manage-panel {
    display: grid;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #d8e2f2;
    border-radius: 12px;
    background: #fbfdff;
}

.schedule-manage-panel.is-hidden {
    display: none;
}

.schedule-manage-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0;
    border: 0;
    background: transparent;
}

.schedule-manage-bar__field {
    display: grid;
    gap: 4px;
}

.schedule-manage-bar__field--order {
    width: 110px;
}

.schedule-manage-bar__label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.schedule-manage-bar__control {
    min-width: 180px;
    height: 32px;
    padding: 6px 10px;
    border: 1px solid #d5deea;
    border-radius: 9px;
    background: #fff;
    color: #18212f;
    font-size: 12px;
    box-sizing: border-box;
}

.schedule-manage-bar__control:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.16);
}

.schedule-manage-section {
    display: grid;
    gap: 8px;
}

.schedule-manage-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.schedule-manage-section__head strong {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
}

.schedule-manage-table-wrap {
    margin-top: 0;
}

.schedule-manage-table {
    width: 100%;
    table-layout: fixed;
}

.schedule-manage-table th,
.schedule-manage-table td {
    vertical-align: middle;
}

.schedule-manage-table td {
    padding-top: 7px;
    padding-bottom: 7px;
}

.schedule-manage-table__order-col {
    width: 88px;
}

.schedule-manage-table__status-col {
    width: 110px;
}

.schedule-manage-table__action-col {
    width: 96px;
}

.schedule-manage-table__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.schedule-manage-table__actions form {
    margin: 0;
}

.schedule-manage-table__control {
    width: 100%;
    min-width: 0;
    height: 30px;
    padding: 5px 9px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    background: #fff;
    color: #18212f;
    font-size: 12px;
    box-sizing: border-box;
}

.schedule-manage-table__control:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.16);
}

.schedule-manage-table__control--order {
    text-align: center;
}

.schedule-manage-table .status-badge {
    justify-content: center;
    min-width: 84px;
}

.schedule-manage-table .status-badge--active {
    color: #0f766e;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.schedule-manage-table .status-badge--muted {
    color: #64748b;
    background: #f8fafc;
    border-color: #d8e2f2;
}

.schedule-manage-empty {
    padding: 12px !important;
    border: 1px dashed #d8e2f2;
    border-radius: 10px;
    background: #fff;
}

.schedule-sheet-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 10px;
}

.schedule-sheet-toolbar__summary {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.schedule-sheet-stat {
    min-width: 118px;
    box-sizing: border-box;
}

.schedule-sheet-stat__label {
    display: block;
}

.schedule-sheet-stat__value {
    display: block;
    text-align: center;
}

.schedule-sheet-period-form {
    justify-self: center;
}

.schedule-sheet-toolbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    justify-self: end;
}

.schedule-sheet-form {
    min-width: 0;
}

.schedule-table-shell {
    border: 1px solid #d8e2f2;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.schedule-table-wrap {
    overflow: hidden;
}

.schedule-table {
    --schedule-employee-col: 144px;
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.schedule-table th,
.schedule-table td {
    min-width: 0;
    padding: 4px 3px;
    border-bottom: 1px solid #ebf0f6;
    color: #18212f;
    font-size: 11px;
    line-height: 1.15;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

.schedule-table thead th {
    padding: 6px 3px;
    background: #f8fafc;
    color: #506175;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: uppercase;
}

.schedule-table thead tr:first-child th:first-child {
    border-top-left-radius: 10px;
}

.schedule-table thead tr:first-child th:last-child {
    border-top-right-radius: 10px;
}

.schedule-table__sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
}

.schedule-table thead .schedule-table__sticky-col {
    z-index: 3;
    background: #f8fafc;
}

.schedule-table__employee-col {
    width: var(--schedule-employee-col);
    min-width: var(--schedule-employee-col);
}

.schedule-table__employee-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    font-weight: 700;
    color: #0f172a;
}

.schedule-table__group-row td {
    padding: 8px 10px;
    background: #f8fbff;
    border-bottom: 1px solid #e2ebf6;
}

.schedule-table__group-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4a5d75;
}

.schedule-table__day-head,
.schedule-table__cell {
    width: calc((100% - var(--schedule-employee-col)) / var(--schedule-days));
    min-width: calc((100% - var(--schedule-employee-col)) / var(--schedule-days));
}

.schedule-table__day-head.is-weekend {
    background: #eaf2ff;
}

.schedule-table__day-content {
    display: flex;
    min-height: 32px;
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

.schedule-table__day-number {
    display: block;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.schedule-table__day-head.is-today .schedule-table__day-content::before,
.schedule-table__day-head.is-today .schedule-table__day-content::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 46px;
    height: 38px;
    border: 2px solid rgba(200, 40, 40, 0.9);
    border-radius: 52% 48% 55% 45% / 46% 54% 48% 52%;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-8deg);
}

.schedule-table__day-head.is-today .schedule-table__day-content::after {
    width: 49px;
    height: 35px;
    border-width: 1.5px;
    border-color: rgba(220, 38, 38, 0.72);
    transform: translate(-50%, -50%) rotate(9deg);
}

.schedule-table__day-weekday {
    display: block;
    font-size: 9px;
    line-height: 1;
    color: #94a3b8;
    text-transform: uppercase;
}

.schedule-table__cell {
    background: #fff;
    text-align: center;
}

.schedule-table__cell.is-weekend {
    background: #eef5ff;
}

.schedule-table tbody tr:hover td,
.schedule-table tbody tr:hover .schedule-table__sticky-col {
    background: #fbfdff;
}

.schedule-table tbody tr:hover .schedule-table__cell.is-weekend,
.schedule-table tbody tr:hover .schedule-table__sticky-col.is-weekend {
    background: #e7f0ff;
}

.schedule-table__cell-inner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-cell-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    min-width: 0;
    height: 28px;
    border: 1px solid #d5deea;
    border-radius: 9px;
    padding: 0 6px;
    background: #fff;
    color: #18212f;
    text-align: center;
    text-align-last: center;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
    box-sizing: border-box;
}

.schedule-cell-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

.schedule-cell-input:disabled {
    cursor: default;
    opacity: 0.88;
}

.schedule-cell-input.is-shift,
.schedule-cell-input.is-status--1-2 {
    background-color: #fff;
    border-color: #d5deea;
    color: #18212f;
}

.schedule-cell-input.is-status--вых {
    background-color: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.schedule-cell-input.is-status--бол {
    background-color: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

.schedule-cell-input.is-status--отп {
    background-color: #fef3c7;
    border-color: #fcd34d;
    color: #b45309;
}

.schedule-cell-input.is-status--other {
    background-color: #f5f3ff;
    border-color: #c4b5fd;
    color: #6d28d9;
}

.schedule-cell-input.is-invalid {
    background-color: #fff1f2;
    border-color: #fb7185;
    color: #be123c;
}

@media (max-width: 1500px) {
    .schedule-sheet-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "summary summary"
            "period actions";
    }

    .schedule-sheet-toolbar__summary {
        grid-area: summary;
    }

    .schedule-sheet-period-form {
        grid-area: period;
        justify-self: start;
    }

    .schedule-sheet-toolbar__actions {
        grid-area: actions;
    }

    .schedule-manage-bar {
        align-items: stretch;
    }

    .schedule-sheet-toolbar__summary {
        flex-wrap: wrap;
    }
}

@media (max-width: 1120px) {
    .schedule-sheet-toolbar {
        grid-template-columns: 1fr;
        grid-template-areas:
            "summary"
            "period"
            "actions";
    }

    .schedule-sheet-toolbar__summary,
    .schedule-sheet-period-form,
    .schedule-sheet-toolbar__actions {
        justify-self: start;
    }

    .schedule-manage-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .schedule-manage-bar__control {
        min-width: 0;
        width: 100%;
    }
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(420px, 100%);
    padding: 28px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(216, 222, 230, 0.9);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.16);
}

.auth-card__title {
    margin: 0 0 18px;
    font-size: 28px;
    line-height: 1.05;
}

.auth-alert {
    margin-bottom: 16px;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-form__submit {
    margin-top: 4px;
}

.access-shell {
    display: grid;
    gap: 14px;
}
/* ===== Колокольчик уведомлений в шапке ===== */

.topbar-bell {
    position: relative;
    margin-right: 8px;
}
.topbar-bell__btn {
    list-style: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: relative;
    user-select: none;
    transition: background 0.15s;
}
.topbar-bell__btn::-webkit-details-marker { display: none; }
.topbar-bell__btn:hover { background: rgba(255, 255, 255, 0.18); }
.topbar-bell[open] .topbar-bell__btn { background: rgba(255, 255, 255, 0.2); }

.topbar-bell__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.topbar-bell__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-width: 90vw;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
    z-index: 999;
    overflow: hidden;
    color: var(--text);
}
.topbar-bell__head {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    font-size: 13px;
}
.topbar-bell__list {
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.topbar-bell__empty {
    padding: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.topbar-bell__item {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.topbar-bell__item:last-child { border-bottom: none; }
.topbar-bell__item.is-unread { background: #fff7ed; }
.topbar-bell__item.is-important { border-left: 3px solid #f97316; padding-left: 11px; }
.topbar-bell__item.is-deleted { opacity: 0.55; }
.topbar-bell__item.is-clickable { cursor: pointer; }
.topbar-bell__item.is-clickable:hover { background: #eff6ff; }

.topbar-bell__item-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.topbar-bell__item-head small {
    color: var(--muted);
    font-size: 11px;
}
.topbar-bell__item-body {
    color: var(--text);
    white-space: pre-wrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.topbar-bell__item-state {
    color: var(--muted);
    font-size: 11px;
}
.topbar-bell__item.is-unread .topbar-bell__item-state {
    color: #c2410c;
    font-weight: 700;
}

/* ===== Модалка уведомлений (обязательное ознакомление) ===== */

.notif-modal__overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 24px;
    animation: notif-fade-in 0.18s ease-out;
}

@keyframes notif-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.notif-modal__card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    width: min(640px, 100%);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notif-modal__head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    color: #0f172a;
    font-size: 16px;
    background: #f8fafc;
}

.notif-modal__body {
    padding: 14px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notif-modal__footer {
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    background: #f8fafc;
}

.notif-modal__item {
    background: #f1f5f9;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notif-modal__item.is-important {
    background: #fff7ed;
    border-left: 3px solid #f97316;
    padding-left: 11px;
}

.notif-modal__item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.notif-modal__item-head strong {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #b45309;
}

.notif-modal__item.is-important .notif-modal__item-head strong {
    color: #c2410c;
}

.notif-modal__item-head small {
    color: var(--muted);
    font-size: 11.5px;
}

.notif-modal__item-body {
    white-space: pre-wrap;
    line-height: 1.45;
    color: var(--text);
}

/* ===== /tools/announcements — небольшие дополнения ===== */

.announcement-audience {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.announcement-audience__radios {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.announcement-audience__radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.announcement-audience__list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px;
    background: #fff;
}
.announcement-audience__user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
}
.announcement-audience__user:hover { background: #f1f5f9; }
.announcement-audience__user small { color: var(--muted); font-family: var(--font-mono, monospace); font-size: 11px; }

.announcement-body {
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.35;
}
.announcement-stat {
    cursor: pointer;
}
.announcement-stat > summary {
    list-style: none;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    cursor: pointer;
}
.announcement-stat > summary::-webkit-details-marker { display: none; }
.announcement-stat__value { font-size: 16px; font-weight: 700; }
.announcement-stat__value.is-negative { color: var(--danger); }
.announcement-stat > summary small { color: var(--muted); }
.announcement-stat__list {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 12px;
    max-height: 180px;
    overflow-y: auto;
}
.announcement-stat__list small { color: var(--muted); }

/* ===== /access — небольшие дополнения поверх общих стилей проекта ===== */

/* Чекбоксы внутри страниц /access — компактный фиксированный размер */
.access-shell input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    vertical-align: middle;
}

/* Dropdown «Роль» с чекбоксами в инлайн-таблице учётных записей */
.roles-dropdown {
    position: relative;
    display: block;
}
.roles-dropdown__summary {
    list-style: none;
    cursor: pointer;
    padding: 4px 24px 4px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    color: var(--text);
    min-height: 26px;
    line-height: 16px;
    position: relative;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.roles-dropdown__summary::-webkit-details-marker { display: none; }
.roles-dropdown__summary::after {
    content: "\F282"; /* bi-chevron-right */
    font-family: "bootstrap-icons";
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    color: var(--muted);
    font-size: 10px;
}
.roles-dropdown[open] .roles-dropdown__summary { border-color: var(--accent); }
/* Меню привязывается к summary через JS (top/left устанавливается из getBoundingClientRect),
   поэтому position: fixed — оно не обрезается overflow:hidden родительской таблицы. */
.roles-dropdown__menu {
    position: fixed;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
    padding: 4px;
    z-index: 200;
    white-space: nowrap;
}
.roles-dropdown__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 12.5px;
    cursor: pointer;
    color: var(--text);
}
.roles-dropdown__item:hover { background: #f1f5f9; }

/* Селектор пользователя и кнопка «Сохранить» в block-head на странице прав */
.access-perm-switcher__select {
    flex: 1 1 240px;
    max-width: 360px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: var(--text);
}
.access-perm-switcher__select:focus { outline: none; border-color: var(--accent); }

/* Кнопка-стрелка раскрытия подразделов в матрице прав */
.access-toggle {
    width: 22px;
    height: 22px;
    margin-right: 8px;
    vertical-align: middle;
}
.access-toggle--empty {
    display: inline-block;
    width: 22px;
    height: 22px;
    margin-right: 8px;
}

/* Подзаголовок подраздела внутри строки матрицы (отступ заменяет старый символ └) */
.access-sub {
    display: inline-block;
    padding-left: 36px;
    position: relative;
    color: var(--muted);
    font-size: 12px;
}
.access-sub::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: #e2e8f0;
    border-radius: 2px;
}
.access-sub em {
    font-style: normal;
    margin-left: 4px;
    padding: 1px 5px;
    background: #f1f5f9;
    border-radius: 3px;
    font-size: 10px;
    text-transform: uppercase;
    color: #6d28d9;
    letter-spacing: 0.04em;
}

/* Подсветка подстрок подразделов в общем фоне таблицы */
.access-subrow td { background: #fbfdff; }

/* Inline-индикатор статуса строки (рядом с кнопками действий) — переиспользуем .bets-inline-status */
.access-row-status {
    margin-right: 4px;
}
.access-row-status.is-saved {
    background: #dcfce7;
    color: #166534;
}

/* Toast в правом нижнем углу для редких событий (удаление) */
.access-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #0f172a;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.3);
    z-index: 9999;
    animation: access-toast-in 0.18s ease-out;
}
@keyframes access-toast-in {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


/* Сообщения об ошибках/успехе на страницах доступа */
.registry-message--error {
    color: var(--danger);
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}
.registry-message--ok {
    color: var(--ok);
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

@media (max-width: 980px) {
    .registry-shell {
        grid-template-columns: 1fr;
    }

    .bets-shell {
        grid-template-columns: 1fr;
    }

    .bets-grid-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .bets-form-grid {
        grid-template-columns: 1fr;
    }

    .finance-filters-grid,
    .finance-filters-grid--transactions,
    .finance-filters-grid--allocations,
    .finance-filters-grid--summary,
    .bk-list-filters__grid {
        grid-template-columns: 1fr;
    }

    .finance-filter-field--wide {
        grid-column: auto;
    }

    .finance-overview-grid {
        grid-template-columns: 1fr;
    }

    .motivation-overview-grid--employee,
    .motivation-payslip-meta,
    .motivation-payslip-settings {
        grid-template-columns: 1fr;
    }

    .finance-alert-grid {
        grid-template-columns: 1fr;
    }

    .topbar__inner {
        grid-template-columns: 1fr;
    }

    .topbar-user {
        justify-content: space-between;
    }
}

/* MPK grid: isolated rewrite */
#mpk-grid-root {
    display: grid;
    gap: 10px;
}

#mpk-grid-root .bets-grid-toolbar--sheet {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 !important;
    padding: 4px 0 2px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

#mpk-grid-root .bets-grid-toolbar__summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 18px;
}

#mpk-grid-root .bets-grid-toolbar__item {
    font-size: 12px;
    color: #526277;
}

#mpk-grid-root .bets-grid-toolbar__item strong {
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

#mpk-grid-root .bets-mpk-grid-wrap {
    overflow: visible !important;
    border: 1px solid #d8e2f2 !important;
    border-radius: 14px !important;
    background: #fff !important;
}

#mpk-grid-root .bets-mpk-grid-scroll,
#mpk-grid-root .bets-mpk-subtable-scroll {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

#mpk-grid-root .bets-mpk-main-table,
#mpk-grid-root .bets-mpk-subtable {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

#mpk-grid-root .bets-mpk-main-table thead th {
    padding: 7px 5px !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #dde6f1 !important;
    color: #506175 !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    line-height: 1.15 !important;
    text-align: center !important;
    white-space: normal !important;
    overflow: hidden !important;
}

#mpk-grid-root .bets-mpk-main-table thead th:nth-child(1) { width: 32px; }
#mpk-grid-root .bets-mpk-main-table thead th:nth-child(2) { width: 100px; }
#mpk-grid-root .bets-mpk-main-table thead th:nth-child(3) { width: 210px; text-align: center !important; }
#mpk-grid-root .bets-mpk-main-table thead th:nth-child(4) { width: 102px; }
#mpk-grid-root .bets-mpk-main-table thead th:nth-child(5) { width: 70px; }
#mpk-grid-root .bets-mpk-main-table thead th:nth-child(6) { width: 90px; }
#mpk-grid-root .bets-mpk-main-table thead th:nth-child(7) { width: 104px; }
#mpk-grid-root .bets-mpk-main-table thead th:nth-child(8) { width: 92px; }
#mpk-grid-root .bets-mpk-main-table thead th:nth-child(9) { width: 108px; }
#mpk-grid-root .bets-mpk-main-table thead th:nth-child(10) { width: 98px; }
#mpk-grid-root .bets-mpk-main-table thead th:nth-child(11) { width: 112px; }
#mpk-grid-root .bets-mpk-main-table thead th:nth-child(12) { width: 118px; }

#mpk-grid-root .bets-mpk-main-table td {
    padding: 5px !important;
    border-bottom: 1px solid #ebf0f6 !important;
    background: #fff !important;
    vertical-align: middle !important;
    overflow: hidden !important;
}

#mpk-grid-root .bets-mpk-group-row td {
    background: #fff !important;
}

#mpk-grid-root .bets-mpk-group-row__toggle {
    text-align: center !important;
}

#mpk-grid-root .bets-mpk-group-toggle {
    width: 22px !important;
    height: 22px !important;
    padding: 0 !important;
    border: 1px solid #d5e0ee !important;
    border-radius: 8px !important;
    background: #f6f9fc !important;
    color: #36547d !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
}

#mpk-grid-root .bets-mpk-group-toggle:hover {
    background: #eef5ff !important;
    border-color: #cfe0ff !important;
    color: #0f4fb3 !important;
}

#mpk-grid-root .bets-mpk-group-input,
#mpk-grid-root .bets-mpk-group-value {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 28px !important;
    padding: 4px 7px !important;
    border-radius: 9px !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

#mpk-grid-root .bets-mpk-group-input {
    border: 1px solid #d5deea !important;
    background: #fff !important;
    color: #18212f !important;
}

#mpk-grid-root .bets-mpk-group-value {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #edf2f7 !important;
    background: #f8fafc !important;
    color: #18212f !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums !important;
}

#mpk-grid-root .bets-mpk-group-value--event {
    justify-content: flex-start !important;
    font-weight: 800 !important;
}

#mpk-grid-root .bets-mpk-money-field {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

#mpk-grid-root .bets-mpk-money-field .bets-mpk-group-input,
#mpk-grid-root .bets-mpk-money-field .bets-mpk-group-value {
    width: 100% !important;
    min-width: 0 !important;
    padding-right: 22px !important;
}

#mpk-grid-root .bets-mpk-money-suffix {
    position: absolute !important;
    top: 50% !important;
    right: 8px !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
    color: #526277 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

#mpk-grid-root .bets-mpk-group-row > div:nth-child(7) .bets-mpk-group-input,
#mpk-grid-root .bets-mpk-group-row > div:nth-child(7) .bets-mpk-group-value,
#mpk-grid-root .bets-mpk-group-row > div:nth-child(11) .bets-mpk-group-input,
#mpk-grid-root .bets-mpk-group-row > div:nth-child(11) .bets-mpk-group-value {
    text-align: center !important;
}

#mpk-grid-root .bets-mpk-group-row > div:nth-child(2),
#mpk-grid-root .bets-mpk-group-row > div:nth-child(6),
#mpk-grid-root .bets-mpk-group-row > div:nth-child(8),
#mpk-grid-root .bets-mpk-group-row > div:nth-child(10) {
    text-align: center !important;
}

#mpk-grid-root .bets-mpk-group-row > div:nth-child(2) .bets-mpk-group-input,
#mpk-grid-root .bets-mpk-group-row > div:nth-child(2) .bets-mpk-group-value,
#mpk-grid-root .bets-mpk-group-row > div:nth-child(6) .bets-mpk-group-input,
#mpk-grid-root .bets-mpk-group-row > div:nth-child(6) .bets-mpk-group-value,
#mpk-grid-root .bets-mpk-group-row > div:nth-child(8) .bets-mpk-group-input,
#mpk-grid-root .bets-mpk-group-row > div:nth-child(8) .bets-mpk-group-value,
#mpk-grid-root .bets-mpk-group-row > div:nth-child(10) .bets-mpk-group-input,
#mpk-grid-root .bets-mpk-group-row > div:nth-child(10) .bets-mpk-group-value {
    text-align: center !important;
    justify-content: center !important;
}

#mpk-grid-root .bets-mpk-group-row__actions {
    padding: 6px 0 !important;
    display: block !important;
    text-align: center !important;
    width: max-content !important;
    justify-self: center !important;
}

#mpk-grid-root .bets-mpk-group-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    width: max-content !important;
    margin: 0 auto !important;
}

#mpk-grid-root .bets-inline-status {
    min-width: 28px !important;
    height: 20px !important;
    padding: 0 6px !important;
    font-size: 10px !important;
}

#mpk-grid-root .bets-mpk-group-detail-row td {
    padding: 0 8px 10px 36px !important;
    background: transparent !important;
    border-bottom: 1px solid #ebf0f6 !important;
}

#mpk-grid-root .bets-group.is-collapsed .bets-mpk-group-detail-row {
    display: none !important;
}

#mpk-grid-root .bets-mpk-subtable-wrap {
    overflow: visible !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: #fff !important;
}

#mpk-grid-root .bets-mpk-subtable-scroll {
    border-radius: 12px !important;
    overflow: hidden !important;
}

#mpk-grid-root .bets-mpk-subtable thead th {
    padding: 6px 5px !important;
    background: #f5f8fc !important;
    border-bottom: 1px solid #e4ebf5 !important;
    color: #5a6a80 !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    line-height: 1.1 !important;
    text-align: center !important;
    white-space: normal !important;
    overflow: hidden !important;
}

#mpk-grid-root .bets-mpk-subtable thead th:first-child {
    border-top-left-radius: 12px !important;
}

#mpk-grid-root .bets-mpk-subtable thead th:last-child {
    border-top-right-radius: 12px !important;
}

#mpk-grid-root .bets-mpk-subtable th:nth-child(1) { width: 110px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(2) { width: 104px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(3) { width: 64px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(4) { width: 108px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(5) { width: 70px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(6) { width: 96px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(7) { width: 126px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(8) { width: 100px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(9) { width: 66px; }

#mpk-grid-root .bets-mpk-subtable td {
    padding: 3px 5px !important;
    border-bottom: 1px solid #edf2f7 !important;
    background: #fff !important;
    vertical-align: middle !important;
    overflow: visible !important;
}

#mpk-grid-root .bets-mpk-subtable tbody tr:last-child td {
    border-bottom: 0 !important;
}

#mpk-grid-root .bets-mpk-subtable .bets-cell-input,
#mpk-grid-root .bets-mpk-subtable .bets-row-static {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 22px !important;
    padding: 2px 5px !important;
    border-radius: 7px !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
    box-sizing: border-box !important;
}

#mpk-grid-root .bets-mpk-subtable .bets-cell-input {
    border: 1px solid #d5deea !important;
    background: #fff !important;
    color: #18212f !important;
}

#mpk-grid-root .bets-mpk-subtable .bets-row-static {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #edf2f7 !important;
    background: #f8fafc !important;
    color: #334155 !important;
}

#mpk-grid-root .bets-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    flex-wrap: nowrap !important;
    width: fit-content !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

#mpk-grid-root .bets-mpk-subtable__actions {
    text-align: center !important;
}

#mpk-grid-root .bets-mpk-subtable th:nth-child(8),
#mpk-grid-root .bets-mpk-subtable td:nth-child(8) {
    width: 92px !important;
    min-width: 92px !important;
    text-align: center !important;
}

#mpk-grid-root .bets-mpk-subtable__employee,
#mpk-grid-root .bets-mpk-subtable__amount,
#mpk-grid-root .bets-mpk-subtable__odds,
#mpk-grid-root .bets-mpk-subtable__result,
#mpk-grid-root .bets-mpk-subtable__profit {
    text-align: center !important;
}

#mpk-grid-root .bets-mpk-subtable__employee .bets-cell-input,
#mpk-grid-root .bets-mpk-subtable__amount .bets-cell-input,
#mpk-grid-root .bets-mpk-subtable__odds .bets-cell-input,
#mpk-grid-root .bets-mpk-subtable__result .bets-cell-input,
#mpk-grid-root .bets-mpk-subtable__profit .bets-cell-input,
#mpk-grid-root .bets-mpk-subtable__employee .bets-row-static,
#mpk-grid-root .bets-mpk-subtable__amount .bets-row-static,
#mpk-grid-root .bets-mpk-subtable__odds .bets-row-static,
#mpk-grid-root .bets-mpk-subtable__result .bets-row-static,
#mpk-grid-root .bets-mpk-subtable__profit .bets-row-static {
    text-align: center !important;
    justify-content: center !important;
}

#mpk-grid-root .icon-action {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
}

#mpk-grid-root .icon-action--primary {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1d4ed8 !important;
}

#mpk-grid-root .icon-action:disabled,
#mpk-grid-root .icon-action--primary:disabled {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: default !important;
    opacity: 0.8 !important;
}

#mpk-grid-root .registry-empty {
    padding: 12px !important;
    text-align: center !important;
    color: #64748b !important;
    font-size: 11px !important;
}

@media (max-width: 1400px) {
    #mpk-grid-root .bets-mpk-grid-scroll,
    #mpk-grid-root .bets-mpk-subtable-scroll {
        overflow-x: auto !important;
    }
}

#mpk-grid-root .bets-mpk-main-head,
#mpk-grid-root .bets-mpk-group-row {
    width: 100%;
    min-width: 1040px;
    display: grid;
    grid-template-columns:
        28px
        minmax(84px, 0.78fr)
        minmax(150px, 1.85fr)
        minmax(76px, 0.72fr)
        minmax(58px, 0.54fr)
        minmax(76px, 0.7fr)
        minmax(82px, 0.78fr)
        minmax(76px, 0.72fr)
        minmax(104px, 1fr)
        minmax(70px, 0.64fr)
        minmax(76px, 0.7fr)
        minmax(84px, 0.78fr);
    align-items: center;
}

#mpk-grid-root .bets-mpk-main-body {
    min-width: 1040px;
}

#mpk-grid-root .bets-mpk-main-head {
    background: #f8fafc;
    border-bottom: 1px solid #dde6f1;
}

#mpk-grid-root .bets-mpk-main-head > div {
    padding: 7px 5px;
    color: #506175;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.15;
    text-align: center;
}

#mpk-grid-root .bets-mpk-main-head > div:nth-child(3) {
    text-align: center;
}

#mpk-grid-root .bets-mpk-main-body {
    min-width: 1040px;
}

#mpk-grid-root .bets-group--mpk {
    border-bottom: 1px solid #ebf0f6;
}

#mpk-grid-root .bets-group--mpk:last-child {
    border-bottom: 0;
}

#mpk-grid-root .bets-mpk-group-row {
    background: #fff;
}

#mpk-grid-root .bets-mpk-group-row > div {
    padding: 5px;
    min-width: 0;
    overflow: hidden;
}

#mpk-grid-root .bets-mpk-group-row__event,
#mpk-grid-root .bets-mpk-group-row__date {
    min-width: 0;
}

#mpk-grid-root .bets-mpk-group-row__event,
#mpk-grid-root .bets-mpk-group-row__account,
#mpk-grid-root .bets-mpk-subtable__account {
    overflow: hidden;
}

#mpk-grid-root .bets-mpk-group-row__event .bets-mpk-group-input,
#mpk-grid-root .bets-mpk-group-row__event .bets-mpk-group-value,
#mpk-grid-root .bets-mpk-group-row__account .bets-mpk-group-input,
#mpk-grid-root .bets-mpk-group-row__account .bets-mpk-group-value,
#mpk-grid-root .bets-mpk-subtable__account .bets-cell-input,
#mpk-grid-root .bets-mpk-subtable__account .bets-row-static {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#mpk-grid-root .bets-mpk-group-detail-row {
    padding: 0 8px 10px 36px;
    background: transparent;
    overflow: visible !important;
}

#mpk-grid-root .bets-mpk-group-detail-cell {
    min-width: 800px;
}

#mpk-grid-root .bets-mpk-group-row .is-positive,
#mpk-grid-root .bets-mpk-subtable .is-positive {
    color: #1a7f37 !important;
    border-color: #cce8d4 !important;
    background: #edf9f0 !important;
}

#mpk-grid-root .bets-mpk-group-row .is-negative,
#mpk-grid-root .bets-mpk-subtable .is-negative {
    color: #b42318 !important;
    border-color: #f7c9cc !important;
    background: #fff1f2 !important;
}

#mpk-grid-root .bets-mpk-group-row .is-muted,
#mpk-grid-root .bets-mpk-subtable .is-muted {
    color: #475569 !important;
    border-color: #dbe3ee !important;
    background: #f8fafc !important;
}

#mpk-grid-root .bets-mpk-subtable th:nth-child(1) { width: 88px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(2) { width: 92px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(3) { width: 54px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(4) { width: 82px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(5) { width: 60px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(6) { width: 74px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(7) { width: 96px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(8) { width: 78px; }
#mpk-grid-root .bets-mpk-subtable th:nth-child(9) { width: 58px; }

#mpk-grid-root .bets-account-picker {
    position: relative;
    z-index: 6;
}

#mpk-grid-root .bets-account-picker__menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 220px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #c8d8f1;
    border-radius: 12px;
    box-shadow: 0 14px 28px rgba(19, 38, 74, 0.14);
    padding: 4px;
}

/* Bets / MPK visual alignment */
.bets-sidebar {
    display: grid;
    align-content: start;
}

.bets-sidebar__create {
    padding: 12px 12px 8px;
    display: flex;
    justify-content: center;
}

.bets-sidebar__create .action-btn {
    width: 100%;
    justify-content: center;
}

.bets-sidebar__create + .bets-menu,
.bets-sidebar .bets-menu:first-child {
    padding-top: 8px;
}

.bets-content .block-head > span:empty {
    display: none;
}

.bets-content .block-head > span:empty + .registry-head-actions {
    margin-left: auto;
}

.bets-page-head--mpk {
    padding: 10px 14px 0;
    border-bottom: 0;
    min-height: 0;
}

.bets-page-head--mpk .registry-head-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.block--mpk-view,
.block--mpk-view .block-head,
.block--mpk-view .registry-head-actions,
.block--mpk-view .bets-period-form--picker,
.block--mpk-view .bets-period-picker {
    overflow: visible !important;
}

.bets-content .block-head > span:empty + .registry-head-actions .info-line {
    display: none;
}

.bets-content .block-head > span:empty + .registry-head-actions .inline-form,
.bets-period-form {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
}

.bets-content .block-head > span:empty + .registry-head-actions .inline-form input[type="month"],
.bets-period-form input[type="month"] {
    min-width: 170px;
    border: 1px solid #cfd8e3;
    border-radius: 9px;
    padding: 7px 10px;
    font-size: 12px;
    background: #fff;
    color: var(--text);
}

.bets-period-form .action-btn {
    flex: 0 0 auto;
}

.bets-period-picker {
    position: relative;
    flex: 0 0 auto;
}

.bets-period-picker__trigger {
    min-width: 172px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #cfd8e3;
    border-radius: 9px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.bets-period-picker__trigger:hover {
    border-color: #bfd0e6;
    background: #f8fbff;
}

.bets-period-picker__trigger:focus-visible {
    border-color: #93c5fd;
    outline: 0;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.16);
}

.bets-period-picker__label {
    pointer-events: none;
}

.bets-period-picker__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 5000;
    width: 248px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.bets-period-picker__header {
    display: grid;
    grid-template-columns: 24px 1fr 24px;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.bets-period-picker__year {
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    color: #0f172a;
}

.bets-period-picker__months {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.bets-period-picker__month {
    border: 1px solid #d9e3f0;
    border-radius: 10px;
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 600;
    background: #fff;
    color: #183153;
    cursor: pointer;
}

.bets-period-picker__month:hover {
    border-color: #bfd0e6;
    background: #f8fbff;
}

.bets-period-picker__month.is-active {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.bets-period-picker__month.is-current:not(.is-active) {
    border-color: #d6ddff;
    background: #f8faff;
    color: #334155;
}

.bets-period-form input[type="month"]:focus {
    border-color: #93c5fd;
    outline: 0;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.16);
}

.bets-period-form input[type="month"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.9;
    padding: 3px;
    border-radius: 6px;
    background: #eef5ff;
}

#mpk-grid-root .bets-grid-toolbar--sheet {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 0 !important;
    margin-bottom: 8px !important;
}

#mpk-grid-root .bets-grid-toolbar__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    align-self: center;
    padding-left: 10px;
}

#mpk-grid-root .bets-grid-toolbar__item--card {
    display: grid;
    gap: 3px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fbff;
    min-width: 0;
    width: fit-content;
    min-width: 116px;
    text-align: center;
    justify-items: center;
}

#mpk-grid-root .bets-grid-toolbar__label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

#mpk-grid-root .bets-grid-toolbar__item--card strong {
    font-size: 15px;
    line-height: 1.1;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

#mpk-grid-root .bets-grid-toolbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    align-self: end;
    padding-right: 3px;
    padding-top: 4px;
}

#mpk-grid-root .bets-mpk-grid-wrap {
    overflow: hidden !important;
    border: 1px solid #d8e2f2 !important;
    border-radius: 10px !important;
    background: #fff !important;
}

#mpk-grid-root .bets-mpk-grid-scroll {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 0 0 6px !important;
    box-sizing: border-box !important;
}

#mpk-grid-root .bets-mpk-main-stage {
    padding-left: 6px !important;
    padding-right: 6px !important;
    box-sizing: border-box !important;
}

#mpk-grid-root .bets-mpk-main-head {
    background: #f8fafc;
    border-bottom: 1px solid #dde6f1;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

#mpk-grid-root .bets-mpk-main-head > div {
    border-right: 0;
    background: #f8fafc;
}

#mpk-grid-root .bets-mpk-main-head > div:last-child {
    border-right: 0;
}

@media (max-width: 1400px) {
    #mpk-grid-root .bets-grid-toolbar--sheet {
        grid-template-columns: 1fr;
    }

    #mpk-grid-root .bets-grid-toolbar__summary {
        gap: 6px;
    }

}

.bets-account-picker__menu--portal {
    position: fixed !important;
}

#mpk-grid-root .bets-account-picker__option {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 7px 9px;
    border-radius: 8px;
    color: #183153;
    font: inherit;
    cursor: pointer;
}

#mpk-grid-root .bets-account-picker__option:hover,
#mpk-grid-root .bets-account-picker__option.is-active {
    background: #eaf2ff;
    color: #0f5bd7;
}

#mpk-grid-root .bets-cell-input--search {
    padding-right: 10px;
}

.bets-account-picker__menu--portal {
    position: fixed !important;
    z-index: 9999 !important;
    max-height: 180px !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    border: 1px solid #c8d8f1 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 20px rgba(19, 38, 74, 0.12) !important;
    padding: 4px !important;
}

.bets-account-picker__menu--portal[hidden] {
    display: none !important;
}

.bets-account-picker__menu--portal .bets-account-picker__option {
    display: block !important;
    width: 100% !important;
    border: 0 !important;
    background: transparent !important;
    text-align: left !important;
    padding: 5px 7px !important;
    border-radius: 7px !important;
    color: #183153 !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
}

.bets-account-picker__menu--portal .bets-account-picker__option:hover,
.bets-account-picker__menu--portal .bets-account-picker__option.is-active {
    background: #eaf2ff !important;
    color: #0f5bd7 !important;
}

/* MPK final layout overrides */
#mpk-grid-root {
    --bets-mpk-group-cols:
        28px
        minmax(84px, 0.78fr)
        minmax(150px, 1.85fr)
        minmax(76px, 0.72fr)
        minmax(58px, 0.54fr)
        minmax(76px, 0.7fr)
        minmax(82px, 0.78fr)
        minmax(76px, 0.72fr)
        minmax(104px, 1fr)
        minmax(70px, 0.64fr)
        minmax(76px, 0.7fr)
        minmax(84px, 0.78fr)
        minmax(78px, 0.72fr);
    padding: 0 3px 3px !important;
    box-sizing: border-box !important;
}

#mpk-grid-root .bets-grid-toolbar__summary {
    padding-left: 8px !important;
}

#mpk-grid-root .bets-mpk-grid-wrap {
    margin: 0 !important;
}

#mpk-grid-root .bets-mpk-main-stage {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#mpk-grid-root .bets-mpk-main-head {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

#mpk-grid-root .bets-mpk-main-body {
    min-width: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

#mpk-grid-root .bets-mpk-main-body .bets-group--mpk {
    min-width: 1040px !important;
}

#mpk-grid-root .bets-mpk-main-head,
#mpk-grid-root .bets-mpk-group-row {
    display: grid !important;
    grid-template-columns: var(--bets-mpk-group-cols) !important;
    min-width: 1040px !important;
}

#mpk-grid-root .bets-mpk-filter-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 0 8px;
    padding: 0;
}

#mpk-grid-root .bets-sheet-column-filters--grouped {
    display: grid !important;
    grid-template-columns: var(--bets-mpk-group-cols) !important;
    width: 100%;
    min-width: 1040px;
    align-items: center;
    border: 0;
    background: transparent;
}

#mpk-grid-root .bets-sheet-column-filters--grouped > div {
    min-width: 0;
    padding: 0 5px;
    box-sizing: border-box;
}

#mpk-grid-root .bets-sheet-column-filters--grouped .bets-sheet-filter-input {
    width: 100%;
    min-width: 0;
    min-height: 24px;
    padding: 3px 6px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    background: #fff;
    color: #18212f;
    font-size: 10px;
    line-height: 1.1;
    box-sizing: border-box;
}

#mpk-grid-root .bets-sheet-column-filters--grouped .bets-sheet-filter-input::placeholder {
    color: #9aabc0;
}

#mpk-grid-root .bets-mpk-main-body .bets-group--mpk {
    min-width: 1040px !important;
}

#mpk-grid-root .bets-mpk-group-row__date,
#mpk-grid-root .bets-mpk-group-row__result,
#mpk-grid-root .bets-mpk-group-row__sport,
#mpk-grid-root .bets-mpk-group-row__tip-share,
#mpk-grid-root .bets-mpk-group-row__tip-stake,
#mpk-grid-root .bets-mpk-group-row__tip-profit,
#mpk-grid-root .bets-mpk-group-row__actions {
    text-align: center !important;
}

#mpk-grid-root .bets-mpk-group-row__sport .bets-mpk-group-input,
#mpk-grid-root .bets-mpk-group-row__sport .bets-mpk-group-value,
#mpk-grid-root .bets-mpk-group-row__tip-share .bets-mpk-group-input,
#mpk-grid-root .bets-mpk-group-row__tip-share .bets-mpk-group-value {
    text-align: center !important;
    text-align-last: center !important;
    justify-content: center !important;
}

#mpk-grid-root .bets-mpk-group-row__tip-stake .bets-mpk-group-input::placeholder {
    color: #a8b5c7 !important;
    opacity: 1 !important;
}

/* Ordinary bets aligned to MPK render pattern */
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar--sheet {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 0 !important;
    margin-bottom: 8px !important;
}

#mpk-grid-root .bets-grid-toolbar__summary--dual {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, max-content));
    gap: 8px;
}

#mpk-grid-root .bets-grid-toolbar__summary-title {
    grid-column: 1 / -1;
    padding-left: 2px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6b7a90;
}

#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    align-self: center;
    padding-left: 8px !important;
}

#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary--dual {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, max-content));
    gap: 8px;
}

#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary-group {
    display: grid;
    gap: 6px;
}

#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary-title {
    grid-column: 1 / -1;
}

#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__item--card {
    display: grid;
    gap: 3px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fbff;
    min-width: 116px;
    width: fit-content;
    text-align: center;
    justify-items: center;
}

#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__item--card strong {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    font-size: 15px;
    line-height: 1.1;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__item--card strong.is-positive {
    color: var(--ok);
}

#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__item--card strong.is-negative {
    color: var(--danger);
}

#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    align-self: end;
    padding-right: 3px;
    padding-top: 4px;
}

#mpk-grid-root.bets-sheet-grid-root [data-plain-filter-toggle].is-active {
    border-color: #bfd0e6;
    background: #edf4ff;
}

#mpk-grid-root.bets-sheet-grid-root {
    padding: 0 3px 3px !important;
    box-sizing: border-box !important;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-grid-wrap {
    margin: 0 !important;
    overflow: hidden !important;
    border: 1px solid #d8e2f2 !important;
    border-radius: 10px !important;
    background: #fff !important;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-grid-scroll {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 0 0 6px !important;
    box-sizing: border-box !important;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-main-stage {
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-main-head {
    width: 100% !important;
    min-width: var(--bets-sheet-min-width, 100%) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    background: #f8fafc;
    border-bottom: 1px solid #dde6f1;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-main-body {
    min-width: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-main-head,
#mpk-grid-root.bets-sheet-grid-root .bets-mpk-group-row {
    display: grid !important;
    grid-template-columns: var(--bets-sheet-cols) !important;
    width: 100% !important;
    min-width: var(--bets-sheet-min-width, 100%) !important;
    align-items: center;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-main-head > div {
    padding: 7px 5px;
    color: #506175;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.15;
    text-align: center;
    background: #f8fafc;
    border-right: 0;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-main-head > div:last-child {
    border-right: 0;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-column-filters {
    display: grid;
    grid-template-columns: var(--bets-sheet-cols);
    width: 100%;
    min-width: var(--bets-sheet-min-width, 100%);
    border-bottom: 1px solid #e8eef6;
    background: #fbfdff;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-column-filters > div {
    padding: 4px 5px;
    min-width: 0;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-filter-input {
    width: 100%;
    min-width: 0;
    min-height: 24px;
    padding: 3px 6px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    background: #fff;
    color: #18212f;
    font-size: 10px;
    line-height: 1.1;
    box-sizing: border-box;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-filter-input::placeholder {
    color: #9aabc0;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-group-row {
    background: #fff;
    border-bottom: 1px solid #ebf0f6;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-group-row > div {
    padding: 5px;
    min-width: 0;
    overflow: hidden;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-row__marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-row__marker::before {
    content: "";
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 8px;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-group-input,
#mpk-grid-root.bets-sheet-grid-root .bets-mpk-group-value {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 28px;
    padding: 4px 7px;
    border-radius: 9px;
    font-size: 11px;
    line-height: 1.15;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-group-input {
    border: 1px solid #d5deea;
    background: #fff;
    color: #18212f;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-static-field--editable {
    position: relative;
    width: 100%;
    min-width: 0;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-static-field--editable .bets-mpk-group-input--date {
    width: 100%;
    min-width: 0;
    padding-right: 24px;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-static-field--editable .bets-mpk-group-input--date::-webkit-calendar-picker-indicator {
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-static-field--editable .bi-calendar3 {
    position: absolute;
    top: 50%;
    right: 9px;
    transform: translateY(-50%);
    font-size: 11px;
    color: #243b63;
    pointer-events: none;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-group-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #edf2f7;
    background: #f8fafc;
    color: #18212f;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-field {
    background: #fff;
    border-color: #d5deea;
    font-weight: 500;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-field--text {
    justify-content: flex-start;
    font-weight: 600;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-static-field {
    position: relative;
    width: 100%;
    min-width: 0;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-static-field .bets-sheet-field {
    padding-right: 24px;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-static-field > i {
    position: absolute;
    top: 50%;
    right: 9px;
    transform: translateY(-50%);
    font-size: 11px;
    color: #243b63;
    pointer-events: none;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-static-field--select .bets-sheet-field {
    text-align: center;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-display-control {
    background: #fff;
    border-color: #d5deea;
    color: #18212f;
    -webkit-text-fill-color: #18212f;
    opacity: 1;
    cursor: default;
    pointer-events: none;
    box-shadow: none;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-display-control[disabled] {
    background: #fff;
    border-color: #d5deea;
    color: #18212f;
    -webkit-text-fill-color: #18212f;
    opacity: 1;
    box-shadow: none;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-display-control--numeric {
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-display-control--date {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

#mpk-grid-root.bets-sheet-grid-root .bets-sheet-display-control--select {
    text-align: center;
    text-align-last: center;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-group-value--event {
    justify-content: flex-start;
    font-weight: 800;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-group-row__actions {
    text-align: center;
}

#mpk-grid-root.bets-sheet-grid-root .bets-mpk-group-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: max-content;
    margin: 0 auto;
}

#mpk-grid-root.bets-sheet-grid-root .icon-action {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border-radius: 8px;
    font-size: 11px;
}

#mpk-grid-root.bets-sheet-grid-root .bets-plain-value--profit.is-positive {
    color: #1a7f37;
    border-color: #cce8d4;
    background: #edf9f0;
}

#mpk-grid-root.bets-sheet-grid-root .bets-plain-value--profit.is-negative {
    color: #b42318;
    border-color: #f7c9cc;
    background: #fff1f2;
}

#mpk-grid-root.bets-sheet-grid-root .bets-plain-value--profit.is-muted {
    color: #475569;
    border-color: #dbe3ee;
    background: #f8fafc;
}

#mpk-grid-root.bets-sheet-grid-root .bets-plain-value--result.is-won {
    color: #15803d;
    border-color: #b7e4c7;
    background: #f0fdf4;
}

#mpk-grid-root.bets-sheet-grid-root .bets-plain-value--result.is-lost {
    color: #dc2626;
    border-color: #f3c4c4;
    background: #fef2f2;
}

#mpk-grid-root.bets-sheet-grid-root .bets-plain-value--result.is-void {
    color: #475569;
    border-color: #dbe3ee;
    background: #f8fafc;
}

#mpk-grid-root.bets-sheet-grid-root .registry-empty {
    padding: 12px;
    text-align: center;
    color: #64748b;
    font-size: 11px;
}

@media (max-width: 1400px) {
    #mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar--sheet {
        grid-template-columns: 1fr;
    }
}

/* Final shared toolbar layout for MPK and ordinary bets */
.block--mpk-view > .bets-page-head--mpk {
    display: none !important;
}

#mpk-grid-root .bets-grid-toolbar--sheet,
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar--sheet {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 12px;
    row-gap: 8px;
    padding: 8px 0 0 !important;
    margin-bottom: 8px !important;
}

#mpk-grid-root .bets-grid-toolbar__summary,
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary {
    display: flex;
    flex-wrap: nowrap;
    align-items: start;
    gap: 8px;
    align-self: start;
    padding-left: 8px !important;
    min-width: max-content;
}

#mpk-grid-root .bets-grid-toolbar__summary--dual,
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary--dual {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, max-content));
    gap: 6px 8px;
}

#mpk-grid-root .bets-grid-toolbar__summary-title,
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary-title {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

#mpk-grid-root .bets-grid-toolbar__item--card,
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__item--card {
    min-width: 104px;
    padding: 6px 8px;
}

#mpk-grid-root .bets-grid-toolbar__item--card strong,
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__item--card strong {
    font-size: 14px;
}

#mpk-grid-root .bets-grid-toolbar__period,
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__period {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    align-self: center;
    padding-right: 0;
    margin-left: 0;
    position: relative;
    z-index: 1;
}

#mpk-grid-root .bets-grid-toolbar__actions,
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    align-self: center;
    justify-self: end;
    padding-right: 4px;
}

.action-btn--icon-only {
    width: 38px;
    min-width: 38px;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.action-btn--icon-only i {
    margin: 0;
}

@media (max-width: 1400px) {
    #mpk-grid-root .bets-grid-toolbar--sheet,
    #mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar--sheet {
        grid-template-columns: 1fr;
    }

    #mpk-grid-root .bets-grid-toolbar__period,
    #mpk-grid-root .bets-grid-toolbar__actions,
    #mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__period,
    #mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__actions {
        justify-content: flex-start;
        padding-left: 8px;
        padding-right: 0;
    }
}

/* Final horizontal stats layout for shared bets toolbar */
#mpk-grid-root .bets-grid-toolbar__summary--dual,
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary--dual {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 12px;
}

#mpk-grid-root .bets-grid-toolbar__summary-group,
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary-group {
    display: grid;
    align-items: start;
    gap: 6px;
    flex-wrap: nowrap;
    padding: 8px 10px;
    border: 1px solid #d8e2f2;
    border-radius: 12px;
    background: transparent;
    box-sizing: border-box;
}

#mpk-grid-root .bets-grid-toolbar__summary-title,
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary-title {
    margin: 0;
    padding-left: 0;
    white-space: nowrap;
    align-self: start;
    justify-self: start;
    font-size: 9px;
    line-height: 1;
}

#mpk-grid-root .bets-grid-toolbar__summary-cards,
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary-cards {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
}

#mpk-grid-root .bets-grid-toolbar__item--card,
#mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__item--card {
    min-width: 96px;
}

@media (max-width: 1680px) {
    #mpk-grid-root .bets-grid-toolbar--sheet,
    #mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar--sheet {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "summary summary"
            "period actions";
    }

    #mpk-grid-root .bets-grid-toolbar__summary,
    #mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary {
        grid-area: summary;
        flex-wrap: wrap;
    }

    #mpk-grid-root .bets-grid-toolbar__summary--dual,
    #mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary--dual {
        flex-wrap: wrap !important;
    }

    #mpk-grid-root .bets-grid-toolbar__period,
    #mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__period {
        grid-area: period;
        justify-self: start;
        justify-content: flex-start;
        padding-left: 8px;
    }

    #mpk-grid-root .bets-grid-toolbar__actions,
    #mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__actions {
        grid-area: actions;
        justify-self: end;
    }
}

@media (max-width: 1280px) {
    #mpk-grid-root .bets-grid-toolbar--sheet,
    #mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar--sheet {
        grid-template-columns: 1fr;
        grid-template-areas:
            "summary"
            "period"
            "actions";
    }

    #mpk-grid-root .bets-grid-toolbar__summary,
    #mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__summary,
    #mpk-grid-root .bets-grid-toolbar__period,
    #mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__period,
    #mpk-grid-root .bets-grid-toolbar__actions,
    #mpk-grid-root.bets-sheet-grid-root .bets-grid-toolbar__actions {
        justify-self: start;
        justify-content: flex-start;
        padding-left: 8px;
        padding-right: 0;
    }
}

/* ===== Раздел «Устройства» (/access/devices) ============================ */

.access-menu-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
}

.block-head__actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.device-filter select {
    height: 28px;
    border: 1px solid #d5deea;
    border-radius: 7px;
    padding: 0 8px;
    background: #fff;
    font-size: 12px;
}

.device-table {
    width: 100%;
    font-size: 12px;
}

.device-table th,
.device-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #ebf0f6;
    text-align: left;
    vertical-align: middle;
}

.device-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.device-ua {
    max-width: 260px;
    color: #5b6573;
    font-size: 11px;
    line-height: 1.35;
}

.device-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.device-label-input {
    width: 160px;
    height: 24px;
    border: 1px solid #d5deea;
    border-radius: 7px;
    padding: 0 8px;
    background: #fff;
    font-size: 11px;
}

.action-btn--small {
    height: 24px;
    padding: 0 10px;
    font-size: 11px;
    border-radius: 6px;
}

.status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.status-pill--pending {
    background: #fef9c3;
    color: #854d0e;
}

.status-pill--approved {
    background: #f0fdf4;
    color: var(--ok);
}

.status-pill--revoked {
    background: #fef2f2;
    color: var(--danger);
}

/* ===== Раздел «Устройства» — переработка под фильтры/компактность ======== */

.device-filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.device-filters__field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #5b6573;
}

.device-filters__field select {
    height: 28px;
    border: 1px solid #d5deea;
    border-radius: 7px;
    padding: 0 8px;
    background: #fff;
    font-size: 12px;
    color: #18212f;
    min-width: 140px;
    max-width: 240px;
}

.device-table {
    width: 100%;
    table-layout: fixed;
}

.device-table th,
.device-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #ebf0f6;
    vertical-align: middle;
    font-size: 12px;
}

.device-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
}

.device-table__user      { width: 14%; }
.device-table__label     { width: auto; }
.device-table__status    { width: 12%; }
.device-table__date      { width: 11%; }
.device-table__actions   { width: 18%; }

.device-table tbody tr:last-child td {
    border-bottom: 0;
}

.device-table tbody td strong {
    color: #0f172a;
    font-weight: 600;
}

.device-user-sub {
    display: block;
    color: #94a3b8;
    font-size: 10px;
    margin-top: 2px;
}

.device-label {
    display: block;
    color: #18212f;
    font-size: 12px;
}

.device-ua {
    display: block;
    color: #5b6573;
    font-size: 10px;
    line-height: 1.3;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-date {
    color: #5b6573;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.device-row-form {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

.device-row-form .device-label-input {
    flex: 1;
    min-width: 80px;
    height: 26px;
    border: 1px solid #d5deea;
    border-radius: 7px;
    padding: 0 8px;
    background: #fff;
    font-size: 11px;
}

.block-body--compact {
    padding: 10px;
}
