
:root {
    --bg: #f2f1ec;
    --panel: #ffffff;
    --line: #c8cfc7;
    --header: #27593c;
    --header-accent: #2f6c47;
    --sidebar: #e5ebe1;
    --text: #1f2a1f;
    --muted: #55635a;
    --btn: #2f6c47;
    --btn-secondary: #5e6a61;
    --danger: #8a1d1d;
    --positive: #1f6b3f;
    --negative: #9a2020;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    height: 100%;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    overflow: hidden;
}

.app {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) 28px;
}

.topbar {
    background: linear-gradient(180deg, var(--header) 0%, var(--header-accent) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #1d3d2a;
    position: relative;
    z-index: 1;
}

.brand {
    font-weight: 600;
    letter-spacing: 0.2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 16px;
    flex-shrink: 0;
}

.topbar-actions .toolbar-btn {
    padding: 5px 8px;
}

.ui-mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.14);
}

.ui-mode-switch-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.ui-mode-switch-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
}

.ui-mode-switch-link:hover {
    background: rgba(255, 255, 255, 0.16);
}

.ui-mode-switch-link.is-active {
    background: rgba(255, 255, 255, 0.2);
}

.topbar-version {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.82);
    white-space: nowrap;
}

.icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

@media (max-width: 900px) {
    .topbar {
        height: auto;
        min-height: 52px;
        padding: 8px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .topbar-actions {
        order: 3;
        width: 100%;
        margin: 0;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1px;
    }

    .topbar-right {
        order: 2;
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}

.settings-panel {
    position: absolute;
    top: 44px;
    right: 16px;
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    padding: 10px 12px;
    min-width: 240px;
    z-index: 30;
}

.settings-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #31443a;
    font-weight: 600;
}

.settings-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e7e1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-warning {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #6b2a2a;
}

.settings-create-account {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e7e1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-create-title {
    font-size: 12px;
    font-weight: 700;
    color: #31443a;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.settings-create-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sidebar-create-account {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px;
    background: #f4f7f1;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.sidebar-create-title {
    font-size: 12px;
    font-weight: 700;
    color: #31443a;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sidebar-create-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-create-label {
    font-size: 11px;
    color: #5a6b58;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-create-account select,
.sidebar-create-account input {
    width: 100%;
    box-sizing: border-box;
}

.sidebar-create-account .settings-toggle {
    font-size: 12px;
}

.danger-action {
    width: 100%;
    justify-content: center;
}

.workspace {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 0;
    overflow: hidden;
}

.sidebar {
    background: var(--sidebar);
    border-right: 1px solid var(--line);
    padding: 14px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.side-title {
    margin: 0 0 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
}

.nav-list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    border: 1px solid var(--line);
    background: #f8faf7;
}

.nav-list li {
    padding: 8px 10px;
    border-bottom: 1px solid #d8ded6;
    font-size: 14px;
}

.nav-list li:last-child { border-bottom: 0; }
.nav-list .active { background: #d8e5d5; font-weight: 600; }

.panel-link {
    color: #174f8e;
    text-decoration: none;
    font-size: 13px;
    display: block;
    margin: 6px 0;
}

.panel-link:hover { text-decoration: underline; }

.content {
    padding: 16px;
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 14px;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }

.auth-error-banner {
    background: #fde8e8;
    border: 1px solid #e3b3b3;
    color: #8a1f1f;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 0 0 12px;
    font-size: 0.92rem;
    line-height: 1.4;
}

.row { display: flex; flex-wrap: wrap; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 220px; flex: 1; }
label { font-size: 13px; font-weight: 600; color: #31443a; }

input {
    border: 1px solid #acb7ad;
    border-radius: 4px;
    padding: 8px 9px;
    font-size: 14px;
    background: #fff;
}
select.qif-input,
input.qif-input {
    width: 100%;
    border: 1px solid #acb7ad;
    border-radius: 4px;
    padding: 8px 9px;
    font-size: 14px;
    background: #fff;
}

input.qif-input[type="file"] {
    padding: 7px 9px;
}

.qif-import-note {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--muted);
}

button {
    border: 0;
    border-radius: 4px;
    padding: 8px 12px;
    background: var(--btn);
    color: white;
    font-size: 13px;
    cursor: pointer;
    touch-action: manipulation;
}

button.secondary { background: var(--btn-secondary); }
button.danger { background: var(--danger); }
button:disabled { opacity: 0.65; cursor: not-allowed; }

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid #b9c5ba;
    border-radius: 4px;
    background: linear-gradient(#f8faf8, #e3e9e2);
    color: #2a382f;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.toolbar-btn:hover:not(:disabled) {
    background: linear-gradient(#ffffff, #e8eee8);
}
.toolbar-btn:active:not(:disabled) {
    background: linear-gradient(#dfe7de, #f3f7f2);
}
.toolbar-btn:disabled {
    background: linear-gradient(#f4f6f4, #ecefec);
    color: #728177;
    border-color: #c8d1c8;
}
.toolbar-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    aspect-ratio: 1 / 1;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}
.toolbar-icon-jump {
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1gMfBg0U7JC+CQAABK1JREFUSMe1VmtsVEUU/s7c2S3rdgstCJTdQMsaIkqIqVBbKigISgRfqAmQhldi5I8SFeIPTcSYKAEbjeHxwxBtiU8SRP1TqgVTWiEuBUupLS2VpZRt7fa12y1372Nm/LEPtog1MXCSk5t778z5zsz3nTNDSincSeMAsHHj/BedTv7M7Qxsmpbd1RXbygGAM7b60wOvPHU7ASoP1Yb3HaiZyHCHjY/3MzQYZkfPnnCG9euaxjTFpETeXW6xrmSlOdGdrf43wIh+nfZUf+VyTsrW+FSLbAzBgsIEzYNhwfn+hhpHgTvbWrtohUFE4wKQUgobyue9PXPW1OUAYCqLD8wYmD93SYEnJvoglIm4iEEXEQCAFZdYXFiGtlZdXm0KRX2R6U23AukJDThbWrufoEyZlm135M6de++JhQ8+NL/jUsefPeGrnRrXJuRNmlwwvTBn5pXoediGDp8nCwXehTjfGDGbmn/f9fO7sXfGXUHK1u/1f7tg3qKVNQ3fV4wM6R80fGiZSeApObnuQ8XFCx9nrqa0MApnFONMfeSvsxdOP1a/22oZF+C59wpdcwrvC13saTx4dEfv9qKioqn5+fkblFIEAIoEy17cuc0tevKXrnsUwVAAAOD3leLY5z9ZQ2eWvZUZWAgxUF1d/Vma5Ml3570xONJ35eiO3u0A4PP5NldVVe0wTTOe2uNAZ43zcO3WMRkqJcG5g1dWVm4DgNTY9vZ2va2t7Yc0gG1bm3r6uzdnrk4IEf/44id5hbmzmIKC5dQBNZZQBQUFSUd6jkwBAEYMfbGw8YhcMpqW6eqd3mnuSY74sZ2DJ29MlOyLk7s93c37Xd24wROjm2ozucUnv3stK+NrVnTa0zbPsTgHgJyJHo/Fo4fGkAMmVxdtGW1s3pczu2g57rk/kS0ASGlnrABYXr4sOYcQqA9j6HITygpeGP46espmABBhQWdswDh8swI8rjy5aE2F0dVUh8bTw1BKorP7FC4nCQaAYCiAzu5TkEogUN+HyJULWLDq/Viue5oNAAwAmAMj0ZFo7y1lBsKql/ZakWAz6n7phd9b8o8xs70lONswiEjXH3h+60FLYxwpdTIAcLgQAaCngxIxKSUzDINs00aZaxmvePUSsvp7cfp4FH5vaTq431eKxoZ+GKEg9r8ZQrGnjCeoyQAAYP5aYYOINCJyAnDatq3F43GYpolgtFO2D7fJDeu/kXKwA+fqhfJ7S+H3liJQH4YRCuLlLT/KjkibDI1ek1LKsc3uWkBYALRMt21bMwyDbMOmq+wySxG8tHwXjlW+jtovLUhpw+FwqZWbPsIlu5VAAIFIWhIpEA4Avx1I85F2IQSTMjFQtZxXyrYgpQIU1IoHynH8XBWBaXiyZJPSOpqhcQ2MEciVDQkXhBCU2a7VzU5EiohAIDz78BwGKGSUA9Ys3XWjNBKpp2XRei4GxphKAyilJBGpTDAiEpxz9I32G3vqbDNBGiVFkGgJRInATNNAjKBpTDGNQUnEGWNjDxyViGBRopkwznmLrutT1s9Yq8ao9t9NZZwLWcIpctxu93X6r2sLETEAEwA4AWQlPfUOAGbS48mnAUBXSkkA+Bt5VzLWzVKxVAAAAABJRU5ErkJggg==');
}
.toolbar-icon-splits {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'><rect x='2' y='2' width='14' height='14' rx='2' fill='%23f4f7f1' stroke='%235e765f' stroke-width='1.2'/><path d='M5 5.5h8M5 9h8M5 12.5h3.2M10.8 12.5H13' stroke='%233b5c3d' stroke-width='1.4' stroke-linecap='round'/><path d='M9 5.8v6.7M9 12.5l-2-2M9 12.5l2-2' fill='none' stroke='%23c78d2d' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.toolbar-icon-delete {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNzkyIDE3OTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZmlsbD0iI2RkNDY0NiIgZD0iTTE0OTAgMTMyMnEwIDQwLTI4IDY4bC0xMzYgMTM2cS0yOCAyOC02OCAyOHQtNjgtMjhsLTI5NC0yOTQtMjk0IDI5NHEtMjggMjgtNjggMjh0LTY4LTI4bC0xMzYtMTM2cS0yOC0yOC0yOC02OHQyOC02OGwyOTQtMjk0LTI5NC0yOTRxLTI4LTI4LTI4LTY4dDI4LTY4bDEzNi0xMzZxMjgtMjggNjgtMjh0NjggMjhsMjk0IDI5NCAyOTQtMjk0cTI4LTI4IDY4LTI4dDY4IDI4bDEzNiAxMzZxMjggMjggMjggNjh0LTI4IDY4bC0yOTQgMjk0IDI5NCAyOTRxMjggMjggMjggNjh6Ii8+Cjwvc3ZnPgo=');
}
.toolbar-icon-recycle-bin {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'><rect x='5' y='7' width='8' height='8' rx='1.2' fill='%23f4f7f1' stroke='%235e765f' stroke-width='1.2'/><path d='M7 7V5.5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1V7' stroke='%235e765f' stroke-width='1.2' fill='none'/><line x1='3.5' y1='7' x2='14.5' y2='7' stroke='%235e765f' stroke-width='1.2' stroke-linecap='round'/><line x1='7.5' y1='9.5' x2='7.5' y2='13' stroke='%235e765f' stroke-width='1.1' stroke-linecap='round'/><line x1='10.5' y1='9.5' x2='10.5' y2='13' stroke='%235e765f' stroke-width='1.1' stroke-linecap='round'/><path d='M7 10.5l1 1.5 3-3' stroke='%234a9e5c' stroke-width='1.3' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.toolbar-btn-label {
    line-height: 1;
    white-space: nowrap;
}
.toolbar-btn.active:not(:disabled) {
    background: linear-gradient(#dfe7de, #f1f5ef);
    border-color: #8fa48f;
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

#invoiceLinesOutput {
    overflow: auto;
}

.split-inline-row {
    background: #eef4ea !important;
}
.split-inline-cell {
    padding: 0 !important;
    border-bottom: 1px solid #d9e2d6;
}
.split-inline-panel {
    border-top: 1px solid #d4ddd3;
    background: linear-gradient(#fbfcfa, #f1f5ef);
    padding: 12px;
}
.split-label-row td {
    padding: 6px 10px 4px;
    border-bottom: 1px solid #d8e1d6;
    background: #edf4e8;
    color: #516356;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}
.split-detail-row td {
    background: #f7faf5;
    border-bottom: 1px solid #e2e9df;
}
.split-detail-row.selected td {
    background: #e5efe1;
}
.split-detail-row td:first-child {
    color: transparent;
}
.split-detail-role {
    color: #627666;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.split-account-readonly {
    color: #2f4235;
    font-weight: 600;
}
.split-row-description {
    margin-top: 3px;
    font-size: 11px;
    color: #5a6d5f;
    white-space: normal;
}
.transaction-description-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.transaction-payload-meta {
    font-size: 11px;
    color: #5a6d5f;
    white-space: normal;
    line-height: 1.35;
}
.split-account-select,
.split-description-input,
.split-amount-input {
    width: 100%;
    min-width: 0;
    padding: 6px 7px;
    border: 1px solid #c6d1c5;
    border-radius: 3px;
    background: #fff;
    color: #243329;
    font-size: 12px;
}
.split-amount-input {
    text-align: right;
}
.split-balance-value {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.split-note-row td {
    padding: 8px 10px 10px;
    background: #f1f6ee;
    border-bottom: 1px solid #d8e1d6;
}
.split-note-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.split-note-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}
.split-note-text {
    color: #55695a;
    font-size: 12px;
}
.split-inline-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.split-inline-title {
    font-size: 12px;
    font-weight: 700;
    color: #33453a;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.split-inline-caption {
    font-size: 12px;
    color: #5f7165;
}
.split-inline-body {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
    gap: 12px;
    align-items: start;
}
.split-inline-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: #fff;
    border: 1px solid #d2dbcf;
}
.split-inline-table thead th {
    background: #dfe8da;
    padding: 7px 8px;
    border-bottom: 1px solid #cad5c6;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4d6053;
}
.split-inline-table tbody td,
.split-inline-table tfoot td {
    padding: 7px 8px;
    border-bottom: 1px solid #edf1ec;
    vertical-align: middle;
}
.split-inline-table tbody tr:last-child td {
    border-bottom: 1px solid #dfe7dc;
}
.split-inline-table tfoot td {
    background: #f4f8f2;
    font-weight: 700;
    color: #304137;
}
.split-inline-table .split-role-cell {
    width: 120px;
    color: #627666;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.split-inline-table .split-account-cell {
    font-weight: 600;
    color: #2f4235;
}
.split-inline-table .numeric {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.split-card {
    border: 1px solid #ccd6cb;
    border-radius: 4px;
    background: #fff;
    padding: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.split-card h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #2e3f34;
}
.split-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.split-card th,
.split-card td {
    padding: 3px 0;
    border: 0;
    text-align: left;
    vertical-align: top;
}
.split-card th {
    width: 92px;
    color: #5b6d60;
    font-weight: 600;
}
.split-details-note {
    margin: 10px 0 0;
    color: #55695a;
    font-size: 12px;
}
.split-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.split-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.split-field label {
    font-size: 11px;
    font-weight: 700;
    color: #56695a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.split-field input,
.split-field select {
    width: 100%;
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid #c6d1c5;
    border-radius: 4px;
    background: #fff;
    color: #243329;
}
.split-field.readonly-value {
    justify-content: flex-end;
}
.split-readonly {
    min-height: 34px;
    padding: 7px 8px;
    border: 1px solid #d5ddd4;
    border-radius: 4px;
    background: #f7faf6;
    color: #33453a;
}
.split-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.split-action-row .toolbar-btn {
    min-width: 120px;
}
.split-inline-help {
    margin: 8px 0 0;
    font-size: 12px;
    color: #627666;
}

.register-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 12px;
}

.full-span {
    grid-column: 1 / -1;
}

.pane {
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    min-height: 360px;
    overflow: hidden;
}

.pane-head {
    padding: 8px 10px;
    background: #e7ece5;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 600;
    color: #33453a;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

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

.tree-item {
    padding: 9px 10px;
    border-bottom: 1px solid #eef1ee;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}

.tree-item:hover { background: #f5f8f4; }
.tree-item.active { background: #d8e5d5; font-weight: 600; }
.tree-item small { color: var(--muted); font-weight: 400; }
.tree-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.tree-collapse-btn,
.tree-caret-placeholder {
    display: inline-block;
    width: 10px;
    min-width: 10px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: #6f8278;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}
.tree-collapse-btn { cursor: pointer; }
.tree-collapse-btn:hover,
.tree-collapse-btn:focus-visible {
    background: #d8e5d5;
    color: #294b35;
    outline: 1px solid #9db59e;
}
.tree-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.register-wrap { padding: 0; }
.register-title { padding: 8px 10px; font-size: 13px; color: #405249; border-bottom: 1px solid #eef1ee; }
.register-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.register-toolbar-label {
    min-width: 0;
    flex: 1;
}
.register-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.editor-wrap {
    border-bottom: 1px solid #eef1ee;
    padding: 10px;
    background: #f7faf6;
}
.editor-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    text-align: left;
    padding: 9px 10px;
    background: #e7ece5;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}

tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #edf1ec;
}

tbody tr:nth-child(even) { background: #fafcf9; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: #eef4ec !important; }
.clickable-row.active { background: #d8e5d5 !important; font-weight: 600; }
.transaction-row {
    cursor: pointer;
}
.transaction-row.active {
    outline: 2px solid #2f6c47;
    outline-offset: -2px;
    background: #e3f0e1 !important;
}
.jump-target {
    outline: 2px solid #2f6c47;
    outline-offset: -2px;
    background: #e3f0e1 !important;
}
.amount-pos { color: var(--positive); font-weight: 600; }
.amount-neg { color: var(--negative); font-weight: 600; }

pre {
    margin: 0;
    background: #f8faf8;
    border: 1px solid #d6ddd6;
    border-radius: 4px;
    padding: 10px;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.statusbar {
    border-top: 1px solid #bfc7be;
    background: #e3e9e1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px;
    font-size: 12px;
    color: #355043;
}

.statusbar-version {
    color: #4c5f54;
    white-space: nowrap;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(14, 20, 16, 0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 60;
}

.modal-dialog {
    width: min(100%, 440px);
    background: #fffdfb;
    border: 1px solid #d7c6c6;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
    overflow: hidden;
    position: relative;
    z-index: 61;
    pointer-events: auto;
}

.modal-head {
    padding: 14px 16px;
    background: #f7e9e7;
    border-bottom: 1px solid #e4d0d0;
    color: #612121;
    font-size: 14px;
    font-weight: 700;
}

.modal-body {
    padding: 16px;
}

.modal-body p {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #3c302d;
}

.warning-copy {
    color: #7a2323;
    font-weight: 600;
}

.confirm-token {
    font-weight: 700;
    color: #612121;
    letter-spacing: 0.2px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.modal-help {
    min-height: 18px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

.modal-help.error {
    color: var(--negative);
    font-weight: 600;
}

.confirm-input.invalid {
    border-color: var(--negative);
    box-shadow: 0 0 0 1px rgba(154, 32, 32, 0.12);
}

@media (max-width: 980px) {
    .workspace {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(12rem, 35vh) minmax(0, 1fr);
    }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
    .register-grid { grid-template-columns: 1fr; }
    .split-inline-body { grid-template-columns: 1fr; }
    .split-note-content { align-items: flex-start; }
}
