:root {
    --bg: #eef2f5;
    --surface: #ffffff;
    --surface-2: #f3f6f8;
    --surface-3: #e8eef3;
    --text: #111827;
    --muted: #647084;
    --line: #d9e1e8;
    --line-strong: #bdcad7;
    --accent: #00876c;
    --accent-dark: #006a57;
    --gold: #b7791f;
    --ink: #0b1220;
    --nav: #0d1b2a;
    --nav-2: #12263a;
    --blue: #1d4ed8;
    --shadow: 0 18px 45px rgba(16, 24, 40, 0.08);
    --shadow-soft: 0 10px 28px rgba(16, 24, 40, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(180deg, #f7f9fb 0%, var(--bg) 280px),
        var(--bg);
    color: var(--text);
    font-family: Inter, Segoe UI, Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    min-height: 100vh;
    padding: 24px 18px;
    background:
        linear-gradient(180deg, #0b1624 0%, var(--nav) 54%, #0f2435 100%);
    color: #ffffff;
    z-index: 10;
}

body.sidebar-collapsed .sidebar {
    width: 76px;
    padding-inline: 12px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 36px;
    min-height: 44px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, #20d6b5 0%, #65e4c8 100%);
    color: #071622;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(32, 214, 181, 0.24);
}

.brand-title {
    font-weight: 800;
}

.brand-subtitle {
    margin-top: 2px;
    color: #95a7ba;
    font-size: 13px;
}

.brand-copy {
    min-width: 0;
}

.sidebar-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    padding: 0;
}

.toggle-icon {
    display: block;
    transform: translateY(-1px);
    transition: transform 0.12s ease;
    font-size: 22px;
    line-height: 1;
}

.nav {
    display: grid;
    gap: 6px;
}

.nav-section {
    display: grid;
    gap: 6px;
}

.nav-section + .nav-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-section-title {
    padding: 0 12px 4px;
    color: #7f94aa;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 8px;
    color: #cfdae6;
    min-height: 42px;
    border: 1px solid transparent;
}

.nav a:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav a.is-active {
    border-color: rgba(94, 234, 212, 0.34);
    background: rgba(255, 255, 255, 0.11);
    color: #ffffff;
    box-shadow: inset 3px 0 0 #5eead4;
}

.nav-logout-form {
    margin: 0;
}

body.sidebar-collapsed .nav a.is-active {
    box-shadow: inset 0 -3px 0 #5eead4;
}

.nav-icon {
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-section-title {
    display: none;
}

body.sidebar-collapsed .brand {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

body.sidebar-collapsed .brand-mark {
    width: 40px;
    height: 40px;
}

body.sidebar-collapsed .sidebar-toggle {
    width: 28px;
    height: 28px;
    margin-left: 0;
}

body.sidebar-collapsed .toggle-icon {
    transform: rotate(180deg) translateY(1px);
}

body.sidebar-collapsed .nav a {
    justify-content: center;
    width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0;
    margin-inline: auto;
}

body.sidebar-collapsed .nav-section + .nav-section {
    margin-top: 10px;
    padding-top: 10px;
}

.main {
    margin-left: 260px;
    padding: 24px 28px;
    min-width: 0;
}

body.sidebar-collapsed .main {
    margin-left: 76px;
}

body.deal-list-page .topbar {
    display: none;
}

body.deal-list-page .main {
    padding-top: 12px;
}

body.treasury-deals-page .main {
    padding: 0;
}

body.treasury-deals-page {
    background: #eef3f8;
    font-size: 13px;
    font-weight: 400;
}

.deals-shell {
    min-height: 100vh;
    padding-bottom: 20px;
}

.deals-toolbar {
    position: relative;
    z-index: 2;
    grid-template-columns: auto 1fr auto;
}

.deals-new-button {
    justify-self: end;
    border-color: #2f6df6;
    background: #2f6df6;
    color: #ffffff;
}

.treasury-deals-page .deals-new-button {
    margin-left: auto;
    border-color: #006a57;
    background: #00876c;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(0, 135, 108, 0.22);
}

.treasury-deals-page .deals-new-button:hover {
    background: #006f5b;
}

.deals-panel {
    margin: 0;
    padding: 10px 14px 14px;
    border: 0;
    border-radius: 0;
    background: #eef3f8;
    box-shadow: none;
}

.treasury-deals-page .deals-panel {
    background: #eef3f8;
}

.treasury-deals-page .filters {
    position: sticky;
    top: 0;
    z-index: 24;
    align-items: center;
    margin: -10px -14px 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #d7e2ed;
    border-radius: 0;
    background: #eef3f8;
    box-shadow: none;
    backdrop-filter: none;
}

.treasury-deals-page .filters input,
.treasury-deals-page .filters select {
    max-width: none;
    width: auto;
    min-width: 220px;
    height: 32px;
    padding: 0 11px;
    border: 1px solid #dbe5ef;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 520;
    box-shadow: 0 8px 18px rgba(32, 43, 60, 0.06);
}

.treasury-deals-page .filters select {
    min-width: 210px;
}

.treasury-deals-page .filters button,
.treasury-deals-page .filters .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 13px;
    border: 1px solid #dbe5ef;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(32, 43, 60, 0.06);
}

.treasury-deals-page .filters button[type="submit"] {
    border-color: #2f6df6;
    background: #2f6df6;
    color: #ffffff;
}

.treasury-deals-page .treasury-user-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 32px;
    margin-left: auto;
    padding: 0 13px;
    border: 1px solid #dbe5ef;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(32, 43, 60, 0.06);
}

.treasury-deals-page .table-wrap {
    max-height: calc(100vh - 148px);
    padding: 0;
    border: 0;
    border-color: transparent;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: #eef3f8;
    box-shadow: none;
}

.treasury-deals-page table {
    font-size: 11px;
    border-spacing: 0;
    background: transparent;
}

.treasury-deals-page tbody,
.treasury-deals-page tbody tr {
    background: transparent;
}

.treasury-deals-page thead th {
    border-color: #8fb0d1;
    background: #d7e8f8;
    color: #17365d;
    font-size: 8.5px;
    font-weight: 720;
    letter-spacing: 0.03em;
}

.treasury-deals-page thead tr:first-child th {
    height: 30px;
}

.treasury-deals-page thead tr:nth-child(2) th {
    top: 30px;
    height: 24px;
    background: #e9f3fc;
}

.treasury-deals-page td {
    height: 46px;
    padding: 8px 8px;
    border-top: 6px solid #eef3f8;
    border-bottom: 0;
    border-right: 0;
    color: #1e293b;
    background: #ffffff;
    background-clip: padding-box;
    box-shadow:
        inset 0 1px 0 #dfe8f1,
        inset 0 -1px 0 #dfe8f1;
    font-weight: 400;
}

.treasury-deals-page tbody tr.clickable-row:hover td {
    background: #fbfdff;
}

.treasury-deals-page tbody tr.clickable-row td:first-child {
    border-radius: 14px 0 0 14px;
    box-shadow:
        inset 1px 0 0 #dfe8f1,
        inset 0 1px 0 #dfe8f1,
        inset 0 -1px 0 #dfe8f1;
}

.treasury-deals-page tbody tr.clickable-row td:last-child {
    border-radius: 0 14px 14px 0;
    box-shadow:
        inset -1px 0 0 #dfe8f1,
        inset 0 1px 0 #dfe8f1,
        inset 0 -1px 0 #dfe8f1;
}

.treasury-deals-page tbody td:nth-child(1),
.treasury-deals-page tbody td:nth-child(2) {
    background: #ffffff;
}

.treasury-deals-page tbody tr.clickable-row:hover td:nth-child(1),
.treasury-deals-page tbody tr.clickable-row:hover td:nth-child(2) {
    background: #fbfdff;
}

.treasury-deals-page .status-dropdown-compact .status-dropdown-trigger {
    min-height: 24px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 650;
}

.treasury-deals-page .currency-badge,
.treasury-deals-page .days-badge {
    border-radius: 999px;
    font-weight: 760;
}

.treasury-deals-page .deal-amount-cell {
    text-align: right;
    white-space: nowrap;
    overflow-wrap: normal;
}

.treasury-deals-page .deal-amount-cell strong {
    display: inline-block;
    min-width: 88px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 760;
    font-variant-numeric: tabular-nums;
}

.treasury-deals-page .match-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 5px;
    border-radius: 50%;
    vertical-align: 1px;
}

.treasury-deals-page .match-dot.is-confirmed {
    background: #10b981;
    box-shadow: 0 0 0 2px #d1fae5;
}

.treasury-deals-page .match-dot.is-missing {
    background: #ffffff;
    border: 1px solid #f59e0b;
    box-shadow: 0 0 0 2px #fef3c7;
}

.treasury-deals-page .deal-date-pill,
.treasury-deals-page .deal-manager-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border: 1px solid #dbe5ef;
    border-radius: 999px;
    background: #f4f8fc;
    color: #223149;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.treasury-deals-page .deal-manager-pill {
    background: #f6f9fd;
}

.treasury-deals-page .status-dropdown-compact .status-dropdown-trigger {
    box-shadow: none;
}

.treasury-deals-page .filter-trigger {
    font-weight: 720;
}

.treasury-deals-page thead th {
    border-left: 0;
    border-right: 1px solid #a9c1dc;
    border-top: 0;
    border-bottom: 1px solid #9fb8d4;
    background: linear-gradient(180deg, #f2f8fe 0%, #d9eafa 100%);
    color: #1f4168;
    font-size: 8.5px;
    font-weight: 760;
    letter-spacing: 0.04em;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    box-shadow: none;
}

.treasury-deals-page thead tr:first-child th:first-child {
    border-top-left-radius: 14px;
}

.treasury-deals-page thead tr:first-child th:last-child {
    border-top-right-radius: 14px;
    border-right: 0;
}

.treasury-deals-page thead tr:first-child th {
    top: 0;
    z-index: 34;
    height: 34px;
    padding-top: 7px;
    padding-bottom: 6px;
    background: linear-gradient(180deg, #eef7ff 0%, #d3e7fa 100%);
}

.treasury-deals-page thead tr:nth-child(2) th {
    top: 34px;
    z-index: 33;
    height: 26px;
    padding-top: 5px;
    padding-bottom: 5px;
    background: #e8f3fd;
    color: #45698f;
    font-size: 8px;
    border-top: 1px solid #a9c1dc;
}

.treasury-deals-page thead th[rowspan="2"] {
    top: 0;
    z-index: 36;
    border-bottom: 1px solid #9fb8d4;
}

.treasury-deals-page thead th.sticky-col-1,
.treasury-deals-page thead th.sticky-col-2,
.treasury-deals-page thead th.sticky-col-3 {
    z-index: 42;
    background: linear-gradient(180deg, #eef7ff 0%, #d3e7fa 100%);
}

.treasury-deals-page tbody td:nth-child(1),
.treasury-deals-page tbody td:nth-child(2),
.treasury-deals-page tbody td:nth-child(3) {
    position: static;
    left: auto;
    z-index: 2;
    box-shadow:
        inset 0 1px 0 #dfe8f1,
        inset 0 -1px 0 #dfe8f1;
}

.treasury-deals-page tbody tr.clickable-row td:first-child {
    box-shadow:
        inset 1px 0 0 #dfe8f1,
        inset 0 1px 0 #dfe8f1,
        inset 0 -1px 0 #dfe8f1;
}

.treasury-deals-page th.group-head {
    border-inline: 1px solid #92afcf;
    border-top: 0;
    border-bottom: 1px solid #92afcf;
    background: linear-gradient(180deg, #e1f0fe 0%, #c8e0f6 100%);
    color: #173f6c;
}

.treasury-deals-page th.group-head + th.group-head {
    border-left: 0;
}

.treasury-deals-page .filter-trigger {
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
}

.treasury-deals-page .filter-trigger span {
    overflow-wrap: normal;
    word-break: keep-all;
    white-space: nowrap;
}

.treasury-deals-page .th-filter[data-sort="rub_received"] .filter-trigger {
    min-height: 30px;
    padding-inline: 5px;
    line-height: 1.05;
    white-space: normal;
}

.treasury-deals-page .th-filter[data-sort="rub_received"] .filter-trigger span {
    max-width: 66px;
    line-height: 1.05;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
}

.treasury-deals-page .filter-trigger::after {
    content: "";
    width: 5px;
    height: 5px;
    margin-left: 3px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    opacity: 0.72;
}

.treasury-deals-page .filter-trigger:hover {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.24);
}

.treasury-deals-page .filter-trigger.is-active {
    background: #dff7ef;
    color: #006a57;
    box-shadow: inset 0 0 0 1px #9ed9cb;
}

.treasury-deals-page .deal-status-section-row td {
    position: sticky;
    top: 54px;
    z-index: 5;
    height: auto;
    padding: 8px 10px;
    border: 0;
    background: #eef3f8;
    box-shadow: none;
}

.treasury-deals-page .deal-status-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #dce6ef;
    border-left: 4px solid #2f6df6;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(32, 43, 60, 0.09);
}

.treasury-deals-page .deal-status-section strong {
    color: #0f172a;
    font-size: 12px;
    font-weight: 760;
    text-transform: uppercase;
}

.treasury-deals-page .deal-status-section span {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: #f4f8fc;
    color: #64748b;
    font-size: 11px;
    font-weight: 650;
}

.treasury-deals-page .status-section-coverage_received .deal-status-section,
.treasury-deals-page .status-section-closed .deal-status-section {
    border-left-color: #00876c;
}

.treasury-deals-page .status-section-advance_to_pay .deal-status-section,
.treasury-deals-page .status-section-advance_to_reimburse .deal-status-section {
    border-left-color: #8670d8;
}

.treasury-deals-page .status-section-signed_order .deal-status-section {
    border-left-color: #2f6df6;
}

.treasury-deals-page .status-section-currency_return .deal-status-section {
    border-left-color: #d9ad2b;
}

body.payment-queue-page .main {
    padding-top: 16px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 74px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.eyebrow {
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: 31px;
    font-weight: 850;
}

h2 {
    font-size: 18px;
}

.user-pill,
.button,
button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 10px 14px;
    font: inherit;
}

.user-pill {
    min-width: 74px;
    text-align: center;
    color: #344054;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-soft);
}

.topbar-user {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #344054;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-soft);
}

.topbar-user strong {
    color: #475467;
    font-size: 14px;
}

.button,
button {
    cursor: pointer;
    font-weight: 700;
}

.nav .nav-logout-button {
    all: unset;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 8px;
    border-color: transparent;
    background: transparent;
    padding: 11px 12px;
    color: #cfdae6;
    font-weight: 500;
    text-align: left;
}

.nav .nav-logout-button:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

body.sidebar-collapsed .nav .nav-logout-button {
    justify-content: center;
    width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0;
    margin-inline: auto;
}

.primary,
button.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.primary:hover,
button.primary:hover {
    background: var(--accent-dark);
}

button.danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b42318;
}

button.danger:hover {
    border-color: #fda4af;
    background: #ffe4e6;
}

body.login-page {
    min-height: 100vh;
    padding: 0;
    background:
        radial-gradient(circle at 20% 12%, rgba(25, 118, 210, 0.16), transparent 28%),
        linear-gradient(135deg, #f7fafc 0%, #eef4f7 100%);
}

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

.login-panel {
    width: min(420px, 100%);
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.13);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.login-brand h1 {
    font-size: 28px;
}

.login-brand p {
    margin: 4px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.login-error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #f04438;
    border-radius: 8px;
    color: #b42318;
    background: #fff4f2;
    font-weight: 700;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-weight: 750;
}

.login-form input {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    background: #ffffff;
}

.login-form input:focus {
    outline: 2px solid rgba(40, 132, 199, 0.22);
    border-color: var(--accent);
}

.login-form button {
    min-height: 44px;
    border-color: var(--accent);
    color: #ffffff;
    background: var(--accent);
}

.login-form button:hover {
    background: var(--accent-dark);
}

.pdf-import-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #b9d8d0;
    border-radius: 8px;
    background: #f4fffb;
}

.pdf-import-panel strong,
.pdf-import-panel span {
    display: block;
}

.pdf-import-panel strong {
    color: #0f172a;
    font-size: 14px;
    font-weight: 850;
}

.pdf-import-panel span {
    margin-top: 2px;
    color: #667085;
    font-size: 12px;
    font-weight: 650;
}

.pdf-import-panel span[data-state="success"] {
    color: #006a57;
}

.pdf-import-panel span[data-state="error"] {
    color: #c92c4b;
}

.pdf-import-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent);
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(0, 135, 108, 0.18);
}

.pdf-import-button:hover {
    border-color: var(--accent-dark);
    background: var(--accent-dark);
    color: #ffffff !important;
}

.pdf-import-button span {
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.pdf-import-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.metric,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.metric {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border-color: #dce5ed;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 253, 0.96)),
        #ffffff;
}

.metric span {
    display: block;
    color: #667085;
    font-size: 13px;
    font-weight: 750;
}

.metric strong {
    display: block;
    margin-top: 10px;
    color: #0b1220;
    font-size: 29px;
    font-weight: 850;
    letter-spacing: 0;
}

.split {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 18px;
}

.panel {
    padding: 16px;
    border-color: #dce4ec;
    background: rgba(255, 255, 255, 0.96);
}

.panel-head,
.filters,
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.status-list,
.compact-table {
    display: grid;
    gap: 8px;
}

.status-row,
.compact-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    background: var(--surface-2);
}

.compact-row {
    grid-template-columns: 90px 1fr auto;
}

.empty,
.empty-cell {
    color: var(--muted);
    padding: 22px;
    text-align: center;
}

.filters {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.create-deal-button {
    margin-left: auto;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(16, 24, 40, 0.02);
}

input:focus,
select:focus,
textarea:focus {
    outline: 0;
    border-color: #59bca9;
    box-shadow: 0 0 0 3px rgba(0, 135, 108, 0.13);
}

.filters input {
    max-width: 320px;
}

.filters select {
    max-width: 340px;
}

.table-wrap {
    overflow-x: auto;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    border: 1px solid #cbd8e6;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

table {
    min-width: 1490px;
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.col-id { width: 86px; }
.col-client { width: 210px; }
.col-amount { width: 132px; }
.col-currency { width: 74px; }
.col-payer { width: 116px; }
.col-bank { width: 72px; }
.col-money { width: 114px; }
.col-rf-company { width: 100px; }
.col-date { width: 88px; }
.col-status { width: 150px; }
.col-days { width: 62px; }
.col-manager { width: 94px; }
.col-actions { width: 58px; }

.queue-metrics {
    grid-template-columns: 1fr 1fr 1.15fr 1fr;
}

.queue-panel {
    padding: 14px;
    border-color: #cfdbe6;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 253, 0.98)),
        #ffffff;
}

.queue-filters {
    align-items: stretch;
}

.queue-filters input {
    max-width: 300px;
}

.queue-filters select {
    max-width: 240px;
}

.queue-table-wrap {
    max-height: calc(100vh - 230px);
    overflow: auto;
    border: 1px solid #bfcedd;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.payment-queue-table {
    min-width: 1180px;
    font-size: 12px;
}

.payment-queue-table thead th {
    top: 0;
    height: 34px;
    padding-block: 8px;
    vertical-align: middle;
    background: #e2ebf3;
    color: #233449;
}

.payment-queue-table td {
    height: 33px;
    background: #ffffff;
}

.payment-queue-table tbody tr.clickable-row:hover td {
    background: #f5fbfa;
}

.queue-col-group { width: 150px; }
.queue-col-payer { width: 130px; }
.queue-col-id { width: 82px; }
.queue-col-client { width: 260px; }
.queue-col-amount { width: 120px; }
.queue-col-currency { width: 72px; }
.queue-col-date { width: 112px; }
.queue-col-days { width: 58px; }
.queue-col-status { width: 190px; }
.queue-col-manager { width: 90px; }

.queue-group-cell {
    position: sticky;
    left: 0;
    z-index: 4;
    min-height: 74px;
    border-right: 2px solid #89a8bd;
    background:
        linear-gradient(180deg, #f2f8fb 0%, #e9f1f6 100%) !important;
    vertical-align: top;
}

.queue-group-cell strong,
.queue-group-cell span,
.queue-group-cell em,
.queue-group-cell small {
    display: block;
}

.queue-group-cell strong {
    color: #0b1220;
    font-size: 12px;
    font-weight: 900;
}

.queue-group-cell span {
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.queue-group-cell em {
    margin-top: 8px;
    color: #006a57;
    font-size: 16px;
    font-style: normal;
    font-weight: 900;
}

.queue-group-cell small {
    margin-top: 4px;
    color: #9a3412;
    font-size: 10px;
    font-weight: 800;
}

.queue-code {
    color: #006a57;
    font-weight: 900;
}

.queue-status {
    display: grid;
    place-items: center;
    min-height: 25px;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 9px;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
}

.urgency-chip {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 18px;
    margin-left: 4px;
    padding: 0 5px;
    border-radius: 6px;
    border: 1px solid #f59e0b;
    background: #fed7aa;
    color: #9a3412;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.queue-gap-row td {
    height: 8px;
    padding: 0;
    border: 0;
    background: #eef2f5;
}

.payment-queue-page .metric:nth-child(3) {
    border-color: #b7d9cf;
    background:
        linear-gradient(180deg, #ffffff 0%, #edf8f4 100%),
        #ffffff;
}

.payment-queue-page .metric:nth-child(3) strong {
    color: #006a57;
}

th,
td {
    border-right: 1px solid #edf1f5;
    padding: 5px 6px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: normal;
    vertical-align: middle;
    overflow-wrap: anywhere;
    word-break: normal;
}

td {
    line-height: 1.18;
}

tbody tr.clickable-row {
    cursor: pointer;
}

tbody tr.clickable-row:hover td {
    background: #f7fbfb;
}

.row-link {
    color: inherit;
}

th {
    line-height: 1.15;
}

.th-filter {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
}

.filter-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    max-width: 100%;
    min-width: 0;
    margin: -3px 0;
    padding: 3px 5px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    line-height: 1.05;
}

.filter-trigger span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.filter-trigger::after {
    content: "⌄";
    display: inline-block;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #334155;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.filter-trigger:hover {
    background: rgba(255, 255, 255, 0.58);
}

.filter-trigger.is-active {
    background: #ccfbf1;
    color: #115e59;
}

.filter-trigger.is-active::after {
    color: #115e59;
}

.filter-menu {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    display: none;
    width: 220px;
    max-height: min(430px, calc(100vh - 290px));
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
    border: 1px solid #b8c8da;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.16);
    color: var(--text);
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
}

.filter-menu.wide-menu {
    width: 300px;
}

.treasury-deals-page .th-filter[data-sort="reimbursement"] .filter-menu,
.treasury-deals-page .th-filter[data-sort="commission"] .filter-menu,
.treasury-deals-page .th-filter[data-sort="amount"] .filter-menu,
.treasury-deals-page .th-filter[data-sort="currency"] .filter-menu,
.treasury-deals-page .th-filter[data-sort="rf_company"] .filter-menu,
.treasury-deals-page .th-filter[data-sort="rf_bank"] .filter-menu,
.treasury-deals-page .th-filter[data-sort="rub_received"] .filter-menu,
.treasury-deals-page .th-filter[data-sort="closed"] .filter-menu,
.treasury-deals-page .th-filter[data-sort="status"] .filter-menu,
.treasury-deals-page .th-filter[data-sort="days"] .filter-menu,
.treasury-deals-page .th-filter[data-sort="manager"] .filter-menu {
    right: 0;
    left: auto;
}

.th-filter.is-open {
    z-index: 120;
}

.th-filter.is-open .filter-menu {
    display: grid;
    gap: 0;
    grid-template-rows: auto 1fr auto;
}

.filter-tools {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    gap: 0;
    padding: 6px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.filter-sort {
    width: 100%;
    padding: 7px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #1f2937;
    font-size: 11px;
    font-weight: 600;
    text-align: left;
}

.filter-sort:hover {
    background: #f1f5f9;
}

.filter-search {
    position: relative;
    display: block;
    margin-top: 6px;
}

.filter-search::after {
    content: "⌕";
    position: absolute;
    right: 9px;
    top: 50%;
    color: #475569;
    font-size: 15px;
    line-height: 1;
    transform: translateY(-50%);
}

.filter-search input {
    box-sizing: border-box;
    width: 100%;
    height: 30px;
    padding: 5px 30px 5px 9px;
    border-color: #cbd5e1;
    border-radius: 7px;
    font-size: 11px;
}

.filter-menu label.filter-option {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 7px;
    align-items: start;
    width: 100%;
    min-width: 0;
    padding: 6px 10px;
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    cursor: pointer;
}

.filter-menu label.filter-option[hidden] {
    display: none;
}

.filter-menu label.filter-option:hover {
    background: #f1f5f9;
}

.filter-menu label.filter-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: -1px 0 0 0;
    padding: 0;
    accent-color: var(--accent);
}

.filter-menu button[type="submit"] {
    position: sticky;
    bottom: 0;
    z-index: 2;
    box-sizing: border-box;
    width: calc(100% - 12px);
    max-width: calc(100% - 12px);
    margin: 6px;
    padding: 7px 9px;
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
}

th.num,
td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

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

tbody td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line);
    text-align: center;
}

tbody td:nth-child(2) {
    position: sticky;
    left: 86px;
    z-index: 3;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line);
}

tbody td:nth-child(3) {
    position: sticky;
    left: 174px;
    z-index: 3;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line);
}

thead th.sticky-col-1 {
    left: 0;
}

thead th.sticky-col-2 {
    left: 86px;
}

thead th.sticky-col-3 {
    left: 174px;
}

thead th.sticky-col-1 {
    position: sticky;
    z-index: 7;
}

thead th.sticky-col-2 {
    position: sticky;
    z-index: 7;
}

thead th.sticky-col-3 {
    position: sticky;
    z-index: 7;
}

tbody tr.clickable-row:hover td:nth-child(1) {
    background: #f8fafc;
}

tbody tr.clickable-row:hover td:nth-child(2) {
    background: #f8fafc;
}

tbody tr.clickable-row:hover td:nth-child(3) {
    background: #f8fafc;
}

body.table-is-updating .table-wrap tbody {
    opacity: 0.72;
    transition: opacity 0.12s ease;
}

th {
    background: var(--surface);
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    box-shadow: none;
}

thead th {
    position: sticky;
    z-index: 6;
    background: #e8eff6;
    border-left: 1px solid #c3d0dd;
    border-right: 1px solid #c3d0dd;
    border-top: 1px solid #aebdca;
    border-bottom: 1px solid #aebdca;
    color: #25364a;
    text-align: center !important;
    vertical-align: top;
}

thead th.filter-cell-open {
    z-index: 30;
}

.treasury-deals-page thead th.filter-cell-open {
    z-index: 180;
}

.treasury-deals-page thead th.filter-cell-open .filter-menu {
    z-index: 1000;
}

thead tr:first-child th {
    top: 0;
    height: 28px;
    padding-top: 5px;
    padding-bottom: 4px;
    vertical-align: top;
}

thead tr:nth-child(2) th {
    top: 28px;
    height: 24px;
    padding-top: 4px;
    padding-bottom: 4px;
    z-index: 6;
    background: #f8fbff;
    border-top: 1px solid #c9d6e5;
    border-bottom: 2px solid #b8c8da;
    color: #475569;
    font-size: 8px;
}

thead th[rowspan="2"] {
    vertical-align: top;
    border-bottom: 2px solid #b8c8da;
}

th.group-head {
    background: #d9e8f6;
    border-top: 1px solid #9fb8d8;
    border-inline: 2px solid #9fb8d8;
    border-bottom: 1px solid #9fb8d8;
    color: #1e3a5f;
}

thead tr:nth-child(2) th:nth-child(1),
thead tr:nth-child(2) th:nth-child(3) {
    border-left: 2px solid #9fb8d8;
}

thead tr:nth-child(2) th:nth-child(2),
thead tr:nth-child(2) th:nth-child(4) {
    border-right: 2px solid #9fb8d8;
}

.badge {
    display: inline-block;
    max-width: 260px;
    padding: 4px 8px;
    border-radius: 8px;
    background: #e0f2fe;
    color: #075985;
    font-size: 11px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.currency-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 21px;
    padding: 0 6px;
    border-radius: 7px;
    border: 1px solid transparent;
    color: #334155;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    vertical-align: middle;
}

.currency-form-select {
    height: 46px;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.currency-usd {
    border-color: #a7d7c5;
    background: #dff4eb;
    color: #0f513c;
}

.currency-eur {
    border-color: #a8c7df;
    background: #dcecf8;
    color: #164d73;
}

.currency-aed {
    border-color: #e8cf8b;
    background: #fff0c2;
    color: #7a5200;
}

.currency-cny {
    border-color: #e3b4b4;
    background: #f4cccc;
    color: #7f1d1d;
}

.currency-hkd,
.currency-cad {
    border-color: #bfdbfe;
    background: #dbeafe;
    color: #1e40af;
}

.currency-try,
.currency-pln {
    border-color: #fed7aa;
    background: #ffedd5;
    color: #9a3412;
}

.currency-chf,
.currency-gbp {
    border-color: #ddd6fe;
    background: #ede9fe;
    color: #5b21b6;
}

.currency-krw,
.currency-yen {
    border-color: #bae6fd;
    background: #e0f2fe;
    color: #075985;
}

.days-badge {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 21px;
    padding: 0 6px;
    border-radius: 7px;
    border: 1px solid transparent;
    font-size: 10px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.days-zero {
    border-color: #a7d7c5;
    background: #dff4eb;
    color: #0f513c;
}

.days-medium {
    border-color: #e7d895;
    background: #fff2cc;
    color: #6f5200;
}

.days-orange {
    border-color: #dda15e;
    background: #f6b26b;
    color: #7c2d12;
}

.days-red {
    border-color: #f2b8b5;
    background: #fce8e6;
    color: #a50e0e;
}

.days-high {
    border-color: #e3b4b4;
    background: #f4cccc;
    color: #7f1d1d;
}

.days-very-high {
    border-color: #d98a8a;
    background: #ea9999;
    color: #681313;
}

.days-critical {
    border-color: #9f1239;
    background: #be123c;
    color: #ffffff;
}

.status-inline-form {
    margin: 0;
}

.status-inline-select {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 30px;
    padding: 4px 18px 4px 5px;
    font-size: 8.5px;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    white-space: normal;
    line-height: 1.05;
    transition: box-shadow 0.16s ease, opacity 0.16s ease;
}

.status-form-select {
    height: 46px;
    border-width: 1px;
    font-size: 14px;
    font-weight: 850;
    text-transform: uppercase;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.status-inline-select option,
.status-form-select option {
    font-weight: 800;
    color: #1f2937;
    background-color: #ffffff;
}

.status-inline-select option.status-signed_order,
.status-form-select option.status-signed_order {
    background-color: #e0f2fe;
    color: #075985;
}

.status-inline-select option.status-to_pay,
.status-form-select option.status-to_pay {
    background-color: #f8fafc;
    color: #475569;
}

.status-inline-select option.status-coverage_received,
.status-form-select option.status-coverage_received {
    background-color: #fff2cc;
    color: #6f5200;
}

.status-inline-select option.status-transit,
.status-form-select option.status-transit {
    background-color: #f6b26b;
    color: #7c2d12;
}

.status-inline-select option.status-accreditive,
.status-form-select option.status-accreditive {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.status-inline-select option.status-advance_to_pay,
.status-form-select option.status-advance_to_pay {
    background-color: #b4a7d6;
    color: #33215f;
}

.status-inline-select option.status-advance_to_reimburse,
.status-form-select option.status-advance_to_reimburse {
    background-color: #c27ba0;
    color: #4a1735;
}

.status-inline-select option.status-on_request,
.status-form-select option.status-on_request {
    background-color: #ede9fe;
    color: #5b21b6;
}

.status-inline-select option.status-closed,
.status-form-select option.status-closed {
    background-color: #d9ead3;
    color: #274e13;
}

.status-inline-select option.status-currency_return,
.status-form-select option.status-currency_return {
    background-color: #f1f5f9;
    color: #334155;
}

.status-inline-select.is-saving {
    opacity: 0.65;
}

.status-inline-select.is-saved {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.status-inline-select.is-error {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22);
}

.status-native-hidden.is-saving + .status-dropdown-trigger {
    opacity: 0.65;
}

.status-native-hidden.is-saved + .status-dropdown-trigger {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.status-native-hidden.is-error + .status-dropdown-trigger {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22);
}

.status-native-hidden {
    display: none;
}

.status-dropdown {
    position: relative;
    width: 100%;
}

.status-dropdown-trigger {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    min-width: 0;
    border-radius: 8px;
    border-width: 1px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    text-align: center;
    text-transform: uppercase;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.status-dropdown-trigger::after {
    content: "";
    position: absolute;
    right: 9px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-62%) rotate(45deg);
    opacity: 0.82;
}

.status-dropdown.is-open .status-dropdown-trigger {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.status-dropdown.is-open .status-dropdown-trigger::after {
    transform: translateY(-25%) rotate(225deg);
}

.status-dropdown-menu {
    position: absolute;
    top: calc(100% + 7px);
    left: 50%;
    z-index: 80;
    display: none;
    width: max(100%, 270px);
    max-height: 330px;
    overflow-y: auto;
    padding: 7px;
    border: 1px solid #b8c8da;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.2);
    transform: translateX(-50%);
}

.status-dropdown.is-open .status-dropdown-menu {
    display: grid;
    gap: 5px;
}

.status-dropdown-option {
    position: relative;
    width: 100%;
    min-height: 34px;
    padding: 8px 30px 8px 12px;
    border-radius: 8px;
    border-width: 1px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    text-transform: uppercase;
    white-space: normal;
}

.status-dropdown-option:hover,
.status-dropdown-option:focus-visible {
    outline: 0;
    filter: brightness(0.97) saturate(1.08);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.status-dropdown-option.is-selected::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 6px;
    height: 11px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-62%) rotate(45deg);
}

.status-dropdown-compact .status-dropdown-trigger {
    min-height: 28px;
    padding: 4px 20px 4px 6px;
    font-size: 8.5px;
    font-weight: 900;
    line-height: 1.05;
    white-space: normal;
}

.status-dropdown-compact .status-dropdown-menu {
    width: 245px;
}

.status-dropdown-form .status-dropdown-trigger {
    min-height: 46px;
    padding: 9px 34px 9px 12px;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.15;
}

.status-signed_order {
    border-color: #cfe8f8;
    background-color: #e0f2fe;
    color: #075985;
}

.status-to_pay {
    border-color: #e2e8f0;
    background-color: #f8fafc;
    color: #475569;
}

.status-coverage_received {
    border-color: #e7d895;
    background-color: #fff2cc;
    color: #6f5200;
}

.status-transit {
    border-color: #dda15e;
    background-color: #f6b26b;
    color: #7c2d12;
}

.status-accreditive {
    border-color: #bfdbfe;
    background-color: #dbeafe;
    color: #1d4ed8;
}

.status-advance_to_pay {
    border-color: #a998cf;
    background-color: #b4a7d6;
    color: #33215f;
}

.status-advance_to_reimburse {
    border-color: #b65f8f;
    background-color: #c27ba0;
    color: #4a1735;
}

.status-on_request {
    border-color: #c4b5fd;
    background-color: #ede9fe;
    color: #5b21b6;
}

.status-closed {
    border-color: #b7d4aa;
    background-color: #d9ead3;
    color: #274e13;
}

.status-currency_return {
    border-color: #cbd5e1;
    background-color: #f1f5f9;
    color: #334155;
}

.deal-card-head,
.deal-summary {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.deal-card-head > div,
.deal-summary > div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.deal-summary {
    align-items: stretch;
}

.deal-summary-main {
    border-color: #b7d4aa !important;
    background: linear-gradient(180deg, #ffffff 0%, #f1f8f4 100%) !important;
}

.deal-card-head span,
.deal-summary span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.deal-card-head strong,
.deal-summary strong {
    display: block;
    font-size: 16px;
}

.deal-summary small {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 7px;
    border-radius: 7px;
    background: #e6f4f1;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
}

.deal-form {
    display: grid;
    gap: 14px;
}

.deal-form-simple {
    max-width: 1360px;
}

.preserved-fields {
    display: none;
}

.deal-meta-strip {
    display: grid;
    grid-template-columns: 0.9fr 1fr 1fr 0.8fr minmax(260px, 1.15fr);
    gap: 12px;
    align-items: stretch;
    padding: 14px;
    border: 1px solid #cbd8e6;
    border-top: 4px solid var(--accent);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.meta-item {
    display: grid;
    align-content: center;
    gap: 6px;
    min-height: 64px;
    padding: 10px 12px;
    border: 1px solid #e1e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.meta-item.strong {
    background: #ecfdf5;
    border-color: #b7d4aa;
}

.waiting-days-card {
    border-width: 1px;
    justify-items: center;
    text-align: center;
}

.waiting-days-card strong {
    font-size: 22px;
}

.waiting-days-card.days-zero {
    border-color: #b7d4aa;
    background: #d9ead3;
    color: #274e13;
}

.waiting-days-card.days-orange {
    border-color: #dda15e;
    background: #f6b26b;
    color: #7c2d12;
}

.waiting-days-card.days-red {
    border-color: #f2b8b5;
    background: #fce8e6;
    color: #a50e0e;
}

.waiting-days-card.days-high {
    border-color: #e3b4b4;
    background: #f4cccc;
    color: #7f1d1d;
}

.waiting-days-card.days-very-high {
    border-color: #d98a8a;
    background: #ea9999;
    color: #681313;
}

.waiting-days-card.days-critical {
    border-color: #9f1239;
    background: #be123c;
    color: #ffffff;
}

.waiting-days-card.days-zero span,
.waiting-days-card.days-zero strong,
.waiting-days-card.days-orange span,
.waiting-days-card.days-orange strong,
.waiting-days-card.days-red span,
.waiting-days-card.days-red strong,
.waiting-days-card.days-high span,
.waiting-days-card.days-high strong,
.waiting-days-card.days-very-high span,
.waiting-days-card.days-very-high strong,
.waiting-days-card.days-critical span,
.waiting-days-card.days-critical strong {
    color: inherit;
}

.meta-item span,
.status-field > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.meta-item strong {
    color: #17202a;
    font-size: 17px;
    font-weight: 850;
}

.meta-item small {
    color: #b42318;
    font-weight: 700;
}

.status-field {
    padding: 10px 12px;
    border: 1px solid #dbe6f0;
    border-radius: 8px;
    background: #f8fbff;
}

.form-section {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 16px;
}

.form-section-primary {
    border-top: 4px solid var(--accent);
}

.section-head,
.linked-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding-bottom: 11px;
    border-bottom: 1px solid #edf1f5;
}

.section-head p,
.linked-card-head p {
    margin: 5px 0 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 7px;
    align-content: start;
}

.field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.field small {
    color: #b42318;
}

.wide,
.form-actions {
    grid-column: 1 / -1;
}

textarea {
    resize: vertical;
}

.field.compact input {
    background: #f8fafc;
    color: #475569;
}

.deal-payment-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.payment-block {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 16px;
    border: 1px solid #e1e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.payment-block h3 {
    margin: 0;
    color: #334155;
    font-size: 13px;
    font-weight: 850;
    text-transform: uppercase;
}

.client-payment-block {
    grid-column: 1 / -1;
    border-top: 4px solid #6366f1;
    background: #fbfbff;
}

.client-pick-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px 190px;
    gap: 12px;
    align-items: stretch;
}

.client-search-field > span {
    color: #334155;
    font-size: 14px;
    font-weight: 850;
}

.client-code-card {
    display: grid;
    align-content: center;
    gap: 6px;
    min-height: 73px;
    padding: 10px 12px;
    border: 1px solid #cbd8e6;
    border-radius: 8px;
    background: #f8fafc;
}

.client-code-card span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.client-code-card strong {
    color: #17202a;
    font-size: 18px;
    font-weight: 850;
}

.urgency-field {
    display: grid;
    align-content: center;
    min-height: 73px;
    padding: 10px 12px;
    border: 1px solid #e1e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.urgency-field > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.urgency-field select {
    height: 38px;
    padding: 7px 10px;
    font-weight: 850;
}

.urgency-field.is-active {
    border-color: #f59e0b;
    background: #fff7ed;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.urgency-field.is-active > span,
.urgency-field.is-active select {
    color: #9a3412;
}

.urgency-field.is-active select {
    border-color: #f59e0b;
    background: #fed7aa;
}

.client-chat-field,
.recipient-field {
    grid-column: 1 / -1;
}

.client-chat-control,
.recipient-control {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.recipient-control {
    grid-template-columns: minmax(0, 1fr);
}

.client-chat-control input,
.recipient-control input {
    height: 40px;
    font-weight: 750;
}

.client-chat-add {
    white-space: nowrap;
}

.client-chat-add:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.client-chat-menu,
.recipient-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 45;
    display: none;
    max-height: 210px;
    overflow-y: auto;
    border: 1px solid #b8c8da;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.16);
}

.client-chat-control.is-open .client-chat-menu,
.recipient-control.is-open .recipient-menu {
    display: block;
}

.client-chat-option,
.recipient-option {
    display: block;
    width: 100%;
    min-height: 34px;
    padding: 8px 12px;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    color: #1f2937;
    text-align: left;
    font-size: 13px;
    font-weight: 750;
}

.client-chat-option:hover,
.recipient-option:hover {
    background: #eef6ff;
}

.client-chat-empty,
.recipient-empty {
    padding: 10px 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.native-select-hidden {
    display: none;
}

.autocomplete {
    position: relative;
}

.client-autocomplete {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.autocomplete-input {
    height: 46px;
    padding-right: 38px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 750;
}

.autocomplete::after {
    content: "⌕";
    position: absolute;
    right: 12px;
    top: 50%;
    color: #64748b;
    font-size: 21px;
    line-height: 1;
    transform: translateY(-50%);
    pointer-events: none;
}

.client-autocomplete::after {
    right: 98px;
}

.client-add {
    min-height: 46px;
    white-space: nowrap;
}

.client-add:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.autocomplete-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    display: none;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #b8c8da;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.16);
}

.client-autocomplete .autocomplete-menu {
    grid-column: 1 / -1;
}

.autocomplete.is-open .autocomplete-menu {
    display: block;
}

.autocomplete-option {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    color: var(--text);
    text-align: left;
    font-weight: 700;
}

.autocomplete-option:hover,
.autocomplete-option.is-active {
    background: #eef6ff;
}

.autocomplete-code {
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 850;
}

.autocomplete-name {
    color: #1f2937;
    font-size: 13px;
}

.autocomplete-empty {
    padding: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.currency-payment-block {
    grid-column: 2;
    border-top: 4px solid #14b8a6;
}

.deal-rate-main {
    padding: 9px;
    border: 1px solid #b9d8d0;
    border-radius: 8px;
    background: #f4fffb;
}

.rate-check-card {
    display: grid;
    gap: 3px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #dbe6f0;
    border-radius: 8px;
    background: #f8fbff;
}

.rate-check-card strong {
    color: #0f172a;
    font-size: 12px;
    font-weight: 850;
}

.rate-check-card span {
    color: #647084;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

.rate-check-card.is-ok {
    border-color: #a8dacd;
    background: #ecfdf7;
}

.rate-check-card.is-ok strong,
.rate-check-card.is-ok span {
    color: #006a57;
}

.rate-check-card.is-warning {
    border-color: #f5c2c7;
    background: #fff5f5;
}

.rate-check-card.is-warning strong,
.rate-check-card.is-warning span {
    color: #b42318;
}

.deal-payment-layout > .payer-card {
    grid-column: 1;
}

.deal-payment-layout > .receiver-card {
    grid-column: 1;
}

.rub-block {
    grid-column: 2;
    border-top: 4px solid #60a5fa;
    background: #fbfdfc;
}

.rub-block .form-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rub-block .rub-flow {
    grid-template-columns: 1fr;
}

.commission-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.fixed-commission-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 12px;
}

.two-column-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.linked-card {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.compact-linked-card {
    box-shadow: none;
}

.linked-card-head.compact {
    margin-bottom: 0;
    padding-bottom: 10px;
}

.linked-card-head.compact h2 {
    font-size: 15px;
}

.linked-card-head.compact p {
    font-size: 12px;
}

.payer-card {
    border-top: 4px solid #14b8a6;
}

.receiver-card {
    border-top: 4px solid #60a5fa;
}

.client-payment-block .client-code-card {
    border-color: #c7d2fe;
    background: #eef2ff;
}

.payer-card,
.currency-payment-block {
    background: #fbfefd;
}

.receiver-card,
.rub-block {
    background: #fbfdff;
}

.linked-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 0.85fr);
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid #dbe6f0;
    border-radius: 8px;
    background: #f8fbff;
}

.linked-fields.vertical {
    grid-template-columns: 1fr;
    gap: 12px;
}

.link-mark {
    display: grid;
    place-items: center;
    width: 28px;
    height: 38px;
    margin-bottom: 1px;
    border-radius: 7px;
    background: #e2e8f0;
    color: #334155;
    font-weight: 900;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.07);
    backdrop-filter: blur(8px);
}

.form-alert {
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
    font-weight: 700;
}

.bank-transactions-shell {
    display: grid;
    gap: 14px;
}

.bank-account-panel {
    display: grid;
    gap: 12px;
}

.bank-account-toolbar {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: auto auto auto;
    justify-content: start;
}

.bank-account-select-form,
.bank-import-form.compact,
.bank-match-form.compact {
    align-items: end;
    display: grid;
    gap: 8px;
}

.bank-account-select-form {
    grid-template-columns: minmax(190px, auto) minmax(280px, 360px) auto;
}

.bank-account-select-form h2 {
    margin: 0;
    font-size: 18px;
}

.bank-account-select-form span {
    color: var(--muted);
    display: block;
    font-size: 12px;
}

.bank-account-select-form select {
    min-height: 34px;
    width: 100%;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    padding: 0 10px;
    font-size: 12px;
}

.bank-import-form.compact {
    grid-template-columns: minmax(180px, 1fr) auto;
}

.bank-import-form.compact input[type="file"] {
    min-height: 34px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
    padding: 5px 8px;
    font-size: 12px;
}

.bank-match-form.compact {
    margin: 0;
}

.foreign-bank-transactions-page .bank-account-toolbar {
    align-items: end;
    grid-template-columns: auto;
    justify-content: start;
    row-gap: 10px;
}

.foreign-bank-transactions-page .bank-account-select-form {
    grid-column: 1 / -1;
    grid-template-columns: 360px 260px 180px 96px 170px;
}

.foreign-bank-transactions-page .bank-import-form.compact {
    grid-template-columns: 220px minmax(250px, 290px) 190px;
}

.foreign-bank-transactions-page .bank-import-form.compact input[type="text"] {
    width: 100%;
    min-height: 34px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    padding: 0 10px;
    font-size: 12px;
    box-sizing: border-box;
}

.foreign-bank-transactions-page .bank-import-form.compact input[type="file"] {
    width: 100%;
    box-sizing: border-box;
}

.foreign-bank-transactions-page .bank-account-select-form .treasury-button,
.foreign-bank-transactions-page .bank-import-form.compact .treasury-button {
    min-height: 40px;
}

.treasury-button.secondary {
    background: #f8fafc;
    color: #1e293b;
}

.bank-account-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bank-balance-card {
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
    display: grid;
    gap: 3px;
    flex: 0 0 150px;
    min-width: 0;
    padding: 9px 12px;
}

.bank-balance-card.primary {
    flex-basis: 285px;
    padding-left: 22px;
    padding-right: 18px;
}

.bank-balance-card.account {
    flex-basis: 220px;
}

.bank-balance-card.primary {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.bank-balance-card.check-ok {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.bank-balance-card.check-ok strong {
    color: #166534;
}

.bank-balance-card.check-warn {
    border-color: #fecaca;
    background: #fef2f2;
}

.bank-balance-card.check-warn strong {
    color: #991b1b;
}

.bank-balance-card span,
.bank-balance-card em {
    color: var(--muted);
    font-size: 10px;
    font-style: normal;
    line-height: 1.2;
}

.bank-balance-card strong {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.bank-balance-card.primary strong {
    font-size: 17px;
}

.bank-balance-card.account strong {
    font-size: 12px;
}

.bank-opening-panel {
    padding: 12px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
}

.bank-opening-panel summary {
    display: flex;
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.bank-opening-panel summary::-webkit-details-marker {
    display: none;
}

.bank-opening-panel summary > span {
    display: grid;
    gap: 2px;
}

.bank-opening-panel summary strong {
    color: #0f172a;
    font-size: 13px;
}

.bank-opening-panel summary em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
}

.bank-opening-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.bank-opening-form {
    display: grid;
    align-items: end;
    gap: 8px;
    grid-template-columns: minmax(220px, 1fr) 150px 180px auto;
}

.bank-opening-account,
.bank-opening-form label {
    display: grid;
    gap: 3px;
}

.bank-opening-account strong {
    color: #0f172a;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.bank-opening-account span,
.bank-opening-form label span {
    color: var(--muted);
    font-size: 10px;
}

.bank-opening-form input {
    min-height: 34px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    padding: 0 10px;
    font-size: 12px;
}

.bank-report-panel {
    padding: 12px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #f8fafc;
}

.bank-report-summary-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    list-style: none;
}

.bank-report-summary-toggle::-webkit-details-marker {
    display: none;
}

.bank-report-summary-toggle::before {
    border: solid #475569;
    border-width: 0 2px 2px 0;
    content: "";
    height: 7px;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    width: 7px;
}

.bank-report-panel[open] .bank-report-summary-toggle::before {
    transform: rotate(45deg);
}

.bank-report-summary-toggle h2 {
    margin: 0;
    font-size: 18px;
}

.bank-report-summary-toggle span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.bank-report-content {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.bank-report-form {
    display: grid;
    grid-template-columns: 200px 200px minmax(320px, auto);
    gap: 10px;
    align-items: end;
    justify-content: start;
}

.bank-report-form label {
    display: grid;
    gap: 4px;
}

.bank-report-form label span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.bank-report-form input,
.bank-report-form select {
    min-height: 36px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    padding: 0 10px;
    font-size: 12px;
    box-sizing: border-box;
}

.bank-report-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bank-report-actions .treasury-button {
    min-width: 180px;
}

@media (max-width: 900px) {
    .bank-opening-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .bank-opening-form .treasury-button {
        width: 100%;
    }

    .bank-report-form {
        grid-template-columns: 1fr;
    }

    .bank-report-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .bank-report-actions .treasury-button {
        width: 100%;
    }
}

.bank-report-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bank-report-warning {
    padding: 9px 11px;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    font-weight: 800;
}

.bank-report-account-list {
    display: grid;
    gap: 6px;
}

.bank-report-account-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
}

.bank-report-details {
    display: grid;
    gap: 8px;
}

.bank-report-details details {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.bank-report-details summary {
    cursor: pointer;
    padding: 9px 11px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 850;
}

.bank-report-table-wrap {
    overflow-x: auto;
    border-top: 1px solid #e2e8f0;
}

.bank-report-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.bank-report-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #edf2f7;
    color: #334155;
    font-size: 12px;
    vertical-align: top;
}

.bank-report-table td:first-child {
    width: 92px;
    white-space: nowrap;
}

.bank-report-table td.num {
    width: 120px;
    color: #0f172a;
    font-weight: 850;
}

.financial-reports-shell {
    display: grid;
    gap: 14px;
}

.financial-reports-panel {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.financial-report-list {
    display: grid;
    gap: 8px;
}

.financial-report-item {
    display: grid;
    gap: 3px;
    padding: 12px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
}

.financial-report-item.is-active {
    border-color: #5eead4;
    background: #f0fdfa;
    box-shadow: inset 3px 0 0 #14b8a6;
}

.financial-report-item strong {
    color: #0f172a;
    font-size: 13px;
}

.financial-report-item span {
    color: var(--muted);
    font-size: 11px;
}

.financial-report-workspace,
.financial-report-section {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.financial-report-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.financial-report-head h2,
.financial-report-section h2 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
}

.financial-report-head span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.financial-report-form {
    display: grid;
    grid-template-columns: 145px 145px minmax(190px, 1fr) minmax(150px, 190px) 130px;
    gap: 10px;
    align-items: start;
}

.financial-report-form label,
.financial-report-filter-field {
    display: grid;
    gap: 4px;
}

.financial-report-form label > span,
.financial-report-filter-field > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.financial-report-form input,
.financial-report-form select {
    min-height: 36px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    padding: 0 10px;
    font-size: 12px;
}

.financial-multiselect {
    position: relative;
    min-width: 0;
}

.financial-multiselect summary {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 36px;
    width: 100%;
    min-width: 0;
    padding: 0 34px 0 10px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    font-size: 12px;
    list-style: none;
    cursor: pointer;
}

.financial-multiselect summary::-webkit-details-marker {
    display: none;
}

.financial-multiselect summary::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 7px;
    height: 7px;
    border: solid #475569;
    border-width: 0 2px 2px 0;
    transform: translateY(-60%) rotate(45deg);
    transition: transform 0.15s ease;
}

.financial-multiselect[open] summary {
    border-color: #59bca9;
    box-shadow: 0 0 0 3px rgba(0, 135, 108, 0.13);
}

.financial-multiselect[open] summary::after {
    transform: translateY(-35%) rotate(225deg);
}

.financial-multiselect summary span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.financial-multiselect-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    display: grid;
    width: min(360px, calc(100vw - 40px));
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #b8c8da;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.16);
}

.financial-report-bank-filter .financial-multiselect-menu {
    width: min(240px, calc(100vw - 40px));
}

.financial-report-client-filter .financial-multiselect-menu {
    width: min(420px, calc(100vw - 40px));
}

.financial-multiselect-menu label {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 7px;
    align-items: start;
    padding: 7px 8px;
    border-radius: 6px;
    color: #1e293b;
    font-size: 12px;
    cursor: pointer;
}

.financial-multiselect-menu label:hover {
    background: #f1f5f9;
}

.financial-multiselect-menu input {
    width: 15px;
    height: 15px;
    min-height: 0;
    margin: 1px 0 0;
    padding: 0;
    accent-color: var(--accent);
    box-shadow: none;
}

.financial-multiselect-menu span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.financial-combobox {
    position: relative;
    min-width: 0;
}

.financial-combobox input {
    width: 100%;
    padding-right: 38px;
}

.financial-combobox::after {
    content: "";
    position: absolute;
    right: 13px;
    top: 16px;
    width: 7px;
    height: 7px;
    border: solid #475569;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    pointer-events: none;
}

.financial-combobox-clear {
    position: absolute;
    top: 6px;
    right: 26px;
    z-index: 2;
    display: none;
    width: 24px;
    height: 24px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    font-size: 18px;
    font-weight: 850;
    line-height: 1;
    cursor: pointer;
}

.financial-combobox input:not(:placeholder-shown) + .financial-combobox-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.financial-combobox-clear:hover {
    background: #eef2f7;
    color: #0f172a;
}

.financial-combobox-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 45;
    display: none;
    max-height: 330px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #b8c8da;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.16);
}

.financial-combobox.is-open .financial-combobox-menu {
    display: grid;
    gap: 3px;
}

.financial-combobox.is-open input {
    border-color: #59bca9;
    box-shadow: 0 0 0 3px rgba(0, 135, 108, 0.13);
}

.financial-combobox.is-open::after {
    top: 18px;
    transform: rotate(225deg);
}

.financial-combobox-menu button {
    display: grid;
    gap: 3px;
    width: 100%;
    min-height: 42px;
    padding: 7px 9px;
    border: 0;
    border-radius: 6px;
    background: #ffffff;
    color: #1e293b;
    text-align: left;
    cursor: pointer;
}

.financial-combobox-menu button:hover,
.financial-combobox-menu button.is-active {
    background: #f1f5f9;
}

.financial-combobox-menu button strong {
    min-width: 0;
    overflow: hidden;
    color: #0f172a;
    font-size: 12px;
    font-weight: 820;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.financial-combobox-menu button span,
.financial-combobox-empty {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
}

.financial-combobox-empty {
    padding: 10px 9px;
}

.financial-report-actions {
    display: flex;
    grid-column: 1 / -1;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

.financial-report-actions .treasury-button {
    min-width: 120px;
}

.financial-report-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.client-report-summary-compact {
    display: grid;
    grid-template-columns: minmax(170px, auto) minmax(520px, 760px);
    gap: 10px;
    align-items: start;
}

.client-report-meta,
.client-report-total-grid {
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
}

.client-report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
}

.client-report-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f4f8fc;
    color: #475569;
    font-size: 11px;
    font-weight: 750;
}

.client-report-meta strong {
    margin-right: 4px;
    color: #0f172a;
    font-size: 13px;
}

.client-report-meta .client-report-selected {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-report-total-grid {
    overflow: hidden;
}

.client-report-total-row {
    display: grid;
    grid-template-columns: minmax(130px, 1.2fr) repeat(3, minmax(118px, 1fr));
    min-height: 28px;
    border-top: 1px solid #edf2f7;
}

.client-report-total-row:first-child {
    border-top: 0;
}

.client-report-total-row > span,
.client-report-total-row > strong {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 4px 8px;
    border-left: 1px solid #edf2f7;
    font-size: 11px;
}

.client-report-total-row > :first-child {
    border-left: 0;
}

.client-report-total-row > span:first-child {
    color: #334155;
    font-weight: 820;
}

.client-report-total-row > strong {
    justify-content: flex-end;
    color: #0f172a;
    font-weight: 780;
    font-variant-numeric: tabular-nums;
}

.client-report-total-row.is-head {
    min-height: 24px;
    background: #eaf1f8;
    color: #233449;
}

.client-report-total-row.is-head > span {
    color: #233449;
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
}

.financial-report-table-wrap {
    max-height: calc(100vh - 390px);
    min-height: 180px;
}

.financial-report-table-wrap.compact {
    max-height: 260px;
    min-height: auto;
}

.financial-report-table,
.financial-currency-totals-table {
    min-width: 1320px;
    font-size: 12px;
}

.financial-currency-totals-table {
    min-width: 980px;
}

.client-deals-report-table {
    min-width: 1360px;
}

.counterparty-rub-report-table {
    min-width: 1680px;
}

.financial-col-date {
    width: 118px;
}

.financial-col-rate {
    width: 96px;
}

.client-report-money-cell {
    vertical-align: top;
}

.client-report-date-cell {
    color: #475569;
    font-size: 11px;
    font-weight: 720;
    line-height: 1.35;
}

.client-report-date-cell span {
    display: block;
}

.client-report-rate-cell {
    color: #0f172a;
    font-weight: 780;
    font-variant-numeric: tabular-nums;
}

.counterparty-operation-purpose {
    min-width: 360px;
    color: #334155;
    font-size: 11px;
    line-height: 1.35;
    white-space: normal;
}

.counterparty-match-list,
.counterparty-match-type-list {
    display: grid;
    gap: 5px;
    align-content: start;
}

.report-match-type {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    min-height: 24px;
    padding: 2px 8px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    font-size: 11px;
    font-weight: 820;
    line-height: 1.1;
}

.report-return-type {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin: 0 6px 4px 0;
    padding: 2px 7px;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    text-transform: uppercase;
}

.counterparty-unmatched-cell {
    color: #b42318;
    font-weight: 850;
}

.report-money-value {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-height: 25px;
    min-width: 96px;
    padding: 2px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 820;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
}

.report-money-value::before {
    content: "";
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--status-color, #94a3b8);
}

.report-money-value.is-confirmed {
    --status-color: #15803d;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.report-money-value.is-warning {
    --status-color: #a16207;
    border-color: #fde68a;
    background: #fefce8;
}

.report-money-value.is-missing {
    --status-color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.financial-report-table th,
.financial-report-table td,
.financial-currency-totals-table th,
.financial-currency-totals-table td {
    height: 36px;
    padding: 7px 8px;
}

.financial-report-table thead th,
.financial-currency-totals-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #e2ebf3;
    color: #233449;
}

.financial-reports-page .financial-report-table tbody td:nth-child(1),
.financial-reports-page .financial-report-table tbody td:nth-child(2),
.financial-reports-page .financial-report-table tbody td:nth-child(3),
.financial-reports-page .financial-currency-totals-table tbody td:nth-child(1),
.financial-reports-page .financial-currency-totals-table tbody td:nth-child(2),
.financial-reports-page .financial-currency-totals-table tbody td:nth-child(3) {
    position: static;
    left: auto;
    z-index: auto;
    background: var(--surface);
    box-shadow: none;
}

.financial-reports-page .financial-report-table tbody td:nth-child(1),
.financial-reports-page .financial-currency-totals-table tbody td:nth-child(1) {
    text-align: left;
}

.financial-col-company { width: 210px; }
.financial-col-bank { width: 120px; }
.financial-col-account { width: 220px; }
.financial-col-currency { width: 82px; }
.financial-col-money { width: 140px; }
.financial-col-small { width: 92px; }
.financial-col-base { width: 180px; }
.financial-col-purpose { width: 430px; }
.financial-col-match { width: 190px; }

@media (max-width: 1150px) {
    .financial-reports-panel {
        grid-template-columns: 1fr;
    }

    .financial-report-list {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .financial-report-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .financial-report-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .financial-report-form {
        grid-template-columns: 1fr;
    }

    .financial-report-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

.bank-import-form {
    display: grid;
    grid-template-columns: 1fr minmax(240px, 340px) minmax(260px, 420px) auto;
    gap: 14px;
    align-items: center;
}

.bank-import-field {
    display: grid;
    gap: 4px;
}

.bank-import-field select {
    min-height: 34px;
    width: 100%;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    padding: 0 10px;
    font-size: 12px;
}

.bank-import-field small {
    color: #991b1b;
    font-size: 11px;
    font-weight: 700;
}

.bank-import-form h2,
.bank-section-head h2,
.bank-imports-panel h2 {
    margin: 0;
    font-size: 18px;
}

.bank-import-form span,
.bank-section-head span,
.bank-import-card span,
.bank-import-card em,
.bank-muted-line {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.bank-messages {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.bank-match-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.bank-match-form span {
    color: var(--muted);
    font-size: 12px;
}

.bank-message {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #cbd8e6;
    background: #f8fafc;
    font-weight: 700;
}

.bank-message-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.bank-message-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.bank-imports-compact {
    padding: 0;
    overflow: hidden;
}

.bank-imports-compact summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 10px;
    grid-template-columns: 12px minmax(0, 1fr);
    list-style: none;
    padding: 12px 14px;
}

.bank-imports-compact summary::-webkit-details-marker {
    display: none;
}

.bank-imports-compact summary::before {
    border: solid #475569;
    border-width: 0 2px 2px 0;
    content: "";
    height: 7px;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    width: 7px;
}

.bank-imports-compact[open] summary::before {
    transform: rotate(45deg);
}

.bank-imports-compact summary > span:first-of-type {
    display: flex;
    gap: 8px;
    align-items: baseline;
    grid-column: 2;
}

.bank-imports-latest {
    grid-column: 2;
}

.bank-imports-compact summary strong {
    color: #0f172a;
    font-size: 16px;
}

.bank-imports-compact summary em,
.bank-imports-latest,
.bank-import-row span,
.bank-import-row em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.bank-imports-latest {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bank-imports-list {
    border-top: 1px solid #e2e8f0;
    display: grid;
}

.bank-import-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 150px minmax(220px, 1fr) minmax(170px, auto) auto;
    padding: 8px 14px;
}

.bank-import-row + .bank-import-row {
    border-top: 1px solid #edf2f7;
}

.bank-import-row strong {
    color: #0f172a;
    font-size: 13px;
}

.bank-import-row form {
    margin: 0;
}

.bank-section-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: end;
    margin-bottom: 10px;
}

.bank-section-title {
    min-width: 0;
}

.bank-transaction-filter-form {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.bank-filter-dropdown {
    position: relative;
}

.bank-filter-dropdown summary {
    align-items: center;
    background: #ffffff;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    color: #1e293b;
    cursor: pointer;
    display: grid;
    gap: 2px;
    list-style: none;
    min-height: 36px;
    min-width: 210px;
    padding: 5px 32px 5px 10px;
    position: relative;
}

.bank-filter-dropdown summary::-webkit-details-marker {
    display: none;
}

.bank-filter-dropdown summary::after {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #64748b;
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.bank-filter-dropdown[open] summary::after {
    transform: translateY(-50%) rotate(180deg);
}

.bank-filter-dropdown summary span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.bank-filter-dropdown summary strong {
    color: #1e293b;
    display: block;
    font-size: 12px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bank-filter-dropdown-panel {
    background: #ffffff;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
    display: grid;
    gap: 2px;
    left: 0;
    max-height: 320px;
    min-width: 260px;
    overflow: auto;
    padding: 8px;
    position: absolute;
    top: calc(100% + 6px);
    z-index: 30;
}

.bank-filter-actions {
    display: flex;
    gap: 6px;
    padding: 0 0 6px;
}

.bank-filter-actions button {
    background: #f8fafc;
    border: 1px solid #dbe5ef;
    border-radius: 6px;
    color: #334155;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    min-height: 28px;
    padding: 0 8px;
}

.bank-filter-option {
    align-items: center;
    border-radius: 6px;
    color: #1e293b;
    cursor: pointer;
    display: grid;
    font-size: 12px;
    gap: 8px;
    grid-template-columns: auto minmax(0, 1fr);
    line-height: 1.25;
    min-height: 30px;
    padding: 5px 6px;
}

.bank-filter-option:hover {
    background: #f8fafc;
}

.bank-filter-option input {
    margin: 0;
}

.bank-filter-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bank-filter-empty {
    color: var(--muted);
    font-size: 12px;
    padding: 8px 6px;
}

.bank-transaction-filter-form .treasury-button {
    min-height: 36px;
}

@media (max-width: 900px) {
    .bank-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .bank-transaction-filter-form {
        justify-content: stretch;
    }

    .bank-filter-dropdown,
    .bank-filter-dropdown summary,
    .bank-filter-dropdown-panel,
    .bank-transaction-filter-form .treasury-button {
        width: 100%;
    }

    .bank-filter-dropdown-panel {
        min-width: 100%;
    }
}

.bank-transactions-table-wrap {
    max-height: calc(100vh - 250px);
}

.foreign-bank-match-form {
    width: 100%;
}

.foreign-bank-match-form .treasury-button {
    width: 100%;
}

.bank-transactions-table th.bank-match-options-head {
    padding: 7px;
}

.bank-match-options-head .foreign-bank-match-form {
    margin-bottom: 7px;
}

.bank-match-options-head span {
    display: block;
}

.bank-transactions-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1320px;
    table-layout: fixed;
}

.bank-transactions-table th,
.bank-transactions-table td {
    border-right: 1px solid #d5e0ec;
    border-bottom: 1px solid #d5e0ec;
    padding: 6px 7px;
    font-size: 11px;
    line-height: 1.2;
    vertical-align: top;
}

.bank-transactions-table th {
    background: #eaf1f8;
    border-top: 1px solid #c5d3e2;
    color: #0f2a44;
    font-size: 10px;
    letter-spacing: 0;
    position: sticky;
    top: 0;
    z-index: 5;
}

.bank-transactions-table th:first-child,
.bank-transactions-table td:first-child {
    border-left: 1px solid #d5e0ec;
}

.bank-transactions-table th:nth-child(3),
.bank-transactions-table td:nth-child(3) {
    border-left: 2px solid #b7c7d8;
}

.bank-transactions-table th:nth-child(2) {
    padding-right: 22px;
}

.bank-transactions-table td:nth-child(2) {
    left: auto;
    position: static;
    z-index: auto;
    padding-right: 22px;
    box-shadow: none;
}

.bank-transactions-table th:nth-child(3) {
    padding-right: 22px;
}

.bank-transactions-table td:nth-child(3) {
    left: auto;
    position: static;
    z-index: auto;
    padding-right: 22px;
    box-shadow: none;
}

.bank-transactions-table tbody tr:nth-child(even) td {
    background: #fbfdff;
}

.foreign-bank-transactions-page .bank-transactions-table th:nth-child(2),
.foreign-bank-transactions-page .bank-transactions-table td:nth-child(2) {
    padding-left: 4px !important;
    padding-right: 4px !important;
    text-align: center;
}

.foreign-bank-transactions-page .bank-transactions-table th:nth-child(3),
.foreign-bank-transactions-page .bank-transactions-table td:nth-child(3) {
    border-left: 1px solid #d5e0ec;
    padding-right: 7px;
}

.foreign-bank-transactions-page .bank-col-date {
    width: 92px;
}

.foreign-bank-transactions-page .bank-col-currency {
    width: 62px;
}

.foreign-bank-transactions-page .bank-transactions-table th:nth-child(2) {
    white-space: nowrap;
}

.foreign-bank-transactions-page .bank-date-cell {
    font-size: 11px;
    letter-spacing: 0;
    white-space: nowrap;
}

.cbr-rates-shell {
    display: block;
}

.cbr-rates-panel {
    padding: 14px;
}

.cbr-rates-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.cbr-rates-toolbar span,
.cbr-rate-summary span,
.cbr-rate-filters span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.cbr-rates-toolbar strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: 20px;
}

.cbr-rates-toolbar em {
    color: #334155;
    font-style: normal;
    font-weight: 700;
}

.cbr-rate-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.cbr-rate-summary > div {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 9px 10px;
}

.cbr-rate-summary strong {
    display: block;
    margin-top: 3px;
    color: #0f172a;
    font-size: 15px;
}

.cbr-latest-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.cbr-latest-strip span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #eff6ff;
    padding: 5px 8px;
}

.cbr-latest-strip strong {
    color: #1e3a8a;
    font-size: 13px;
}

.cbr-latest-strip .cbr-latest-date {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.cbr-latest-strip .cbr-latest-date strong {
    color: #334155;
    font-size: 12px;
}

.cbr-rate-filters,
.cbr-rate-import {
    display: grid;
    gap: 8px;
    align-items: end;
    justify-content: start;
    margin-bottom: 10px;
}

.cbr-rate-filters {
    grid-template-columns: 132px 132px 118px 118px;
}

.cbr-rate-import {
    grid-template-columns: 280px 150px;
}

.cbr-rate-filters label,
.cbr-rate-import label {
    display: grid;
    gap: 6px;
}

.cbr-rate-filters input,
.cbr-rate-filters select,
.cbr-rate-import input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 12px;
    min-height: 32px;
    padding: 5px 8px;
}

.cbr-rate-filters button,
.cbr-rate-filters .button,
.cbr-rate-import button {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    font-size: 12px;
    min-height: 32px;
    padding: 6px 10px;
    text-align: center;
    text-decoration: none;
}

.cbr-rate-filters button[type="submit"],
.cbr-rate-import button[type="submit"] {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.cbr-messages {
    margin: 0 0 10px;
}

.cbr-rates-table {
    border-collapse: collapse;
    border-spacing: 0;
    min-width: 0;
    table-layout: fixed;
    width: auto;
}

.cbr-rates-table .cbr-date-col {
    width: 78px;
}

.cbr-rates-table .cbr-rate-col {
    width: 84px;
}

.cbr-rates-table th,
.cbr-rates-table td {
    border-color: #d8e2ed;
    box-sizing: border-box;
    font-size: 11px;
    line-height: 1.15;
    padding: 3px 6px;
    vertical-align: middle;
}

.cbr-rates-table tbody td {
    left: auto !important;
    position: static !important;
    z-index: auto !important;
}

.cbr-rates-table th {
    border-bottom: 1px solid #b8c9da;
    font-size: 10px;
    height: 26px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.cbr-rates-table th:first-child,
.cbr-rates-table td:first-child {
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
    white-space: nowrap;
}

.cbr-rates-table th:first-child {
    background: #dbe7f0;
}

.cbr-rates-table th:not(:first-child),
.cbr-rates-table td:not(:first-child) {
    min-width: 0;
}

.cbr-rates-table tbody tr:nth-child(even) td {
    filter: saturate(0.96) brightness(0.99);
}

.cbr-rates-table tbody tr:hover td {
    box-shadow: inset 0 0 0 999px rgba(15, 23, 42, 0.035);
}

.cbr-rates-table td strong {
    font-size: 11px;
    font-weight: 600;
}

.cbr-col-usd {
    background: #ecfdf5;
    color: #065f46;
}

.cbr-col-eur {
    background: #eff6ff;
    color: #1d4ed8;
}

.cbr-col-aed {
    background: #fff7ed;
    color: #9a3412;
}

.cbr-col-cny {
    background: #fef2f2;
    color: #b91c1c;
}

.cbr-col-hkd {
    background: #f5f3ff;
    color: #6d28d9;
}

.cbr-rates-table th.cbr-col-usd {
    background: #bbf7d0;
}

.cbr-rates-table th.cbr-col-eur {
    background: #bfdbfe;
}

.cbr-rates-table th.cbr-col-aed {
    background: #fed7aa;
}

.cbr-rates-table th.cbr-col-cny {
    background: #fecaca;
}

.cbr-rates-table th.cbr-col-hkd {
    background: #ddd6fe;
}

.muted-rate {
    color: #64748b;
}

@media (max-width: 900px) {
    .cbr-rate-summary,
    .cbr-rate-filters {
        grid-template-columns: 1fr;
    }

    .cbr-rates-toolbar {
        display: grid;
    }
}

.bank-col-date {
    width: 78px;
}

.bank-col-currency {
    width: 54px;
}

.bank-col-money {
    width: 104px;
}

.bank-col-counterparty {
    width: 220px;
}

.bank-col-type {
    width: 124px;
}

.bank-col-match {
    width: 102px;
}

.bank-col-purpose {
    width: 430px;
}

.bank-col-suggestions {
    width: 265px;
}

.bank-col-actions {
    width: 32px;
}

.bank-date-cell {
    color: #0f172a;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.bank-currency-cell {
    text-align: center;
}

.bank-currency-badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 10px;
    font-weight: 900;
    justify-content: center;
    line-height: 1;
    min-width: 38px;
    padding: 5px 7px;
}

.bank-currency-usd {
    background: #dcfce7;
    color: #166534;
}

.bank-currency-eur {
    background: #dbeafe;
    color: #1d4ed8;
}

.bank-currency-aed {
    background: #fef3c7;
    color: #92400e;
}

.bank-currency-cny {
    background: #fee2e2;
    color: #b91c1c;
}

.bank-money-cell {
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.bank-counterparty-cell {
    overflow-wrap: anywhere;
}

.bank-counterparty-cell strong {
    display: block;
    color: #0f172a;
    font-size: 11px;
    line-height: 1.2;
    max-height: 40px;
    overflow: hidden;
}

.bank-purpose-cell {
    white-space: normal;
    overflow-wrap: anywhere;
    color: #334155;
}

.bank-chip-cell {
    text-align: center;
}

.bank-type-chip,
.bank-match-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 19px;
    max-width: 100%;
    padding: 2px 6px;
    border-radius: 999px;
    background: #eef3f8;
    color: #27364a;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
}

.bank-type-unknown {
    background: #e5e7eb;
    color: #475569;
}

.bank-type-client_coverage {
    background: #dbeafe;
    color: #1d4ed8;
}

.bank-type-agent_fee {
    background: #fef3c7;
    color: #92400e;
}

.bank-type-import {
    background: #dcfce7;
    color: #166534;
}

.bank-type-export {
    background: #dbeafe;
    color: #1d4ed8;
}

.bank-type-fx_conversion {
    background: #ccfbf1;
    color: #0f766e;
}

.bank-type-internal_transfer {
    background: #ede9fe;
    color: #6d28d9;
}

.bank-type-deposit_out {
    background: #cffafe;
    color: #0e7490;
}

.bank-type-deposit_in {
    background: #dcfce7;
    color: #166534;
}

.bank-type-interest {
    background: #fce7f3;
    color: #be185d;
}

.bank-type-bank_fee {
    background: #fee2e2;
    color: #b91c1c;
}

.bank-type-individual {
    background: #ffedd5;
    color: #c2410c;
}

.bank-type-form {
    position: relative;
    display: inline-block;
    width: 112px;
    margin: 0;
}

.bank-type-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 32px;
    padding: 4px 20px 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.05;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

.bank-type-label::after {
    content: "⌄";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-52%);
    font-size: 12px;
    font-weight: 900;
}

.bank-type-select {
    position: absolute;
    inset: 0;
    width: 100%;
    min-width: 0;
    height: 100%;
    max-width: none;
    border: 0;
    border-radius: 999px;
    padding: 5px 22px 5px 10px;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    opacity: 0;
    white-space: normal;
    text-wrap: wrap;
    overflow-wrap: anywhere;
}

.bank-type-select:focus {
    outline: 0;
}

.bank-type-form:focus-within .bank-type-label {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.bank-type-form.is-updating .bank-type-label,
.bank-type-form.is-updating .bank-type-select {
    opacity: 0.65;
    cursor: wait;
}

.bank-match-confirmed {
    background: #dcfce7;
    color: #166534;
}

.bank-match-not_deal {
    background: #e0f2fe;
    color: #075985;
}

.bank-match-not-required {
    background: #e5e7eb;
    color: #475569;
}

.bank-match-export {
    background: #ccfbf1;
    color: #0f766e;
}

.bank-match-unmatched {
    background: #fef3c7;
    color: #92400e;
}

.bank-match-suggested {
    background: #ede9fe;
    color: #5b21b6;
}

.bank-match-partial {
    background: #ffedd5;
    color: #c2410c;
}

.bank-suggestion {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: start;
    padding: 6px 7px;
    border: 1px solid #ddd6fe;
    border-radius: 6px;
    background: #f5f3ff;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}

.bank-suggestion + .bank-suggestion {
    margin-top: 5px;
}

.bank-suggestion > div:first-child,
.bank-suggestion-content,
.bank-suggestion-link {
    min-width: 0;
}

.bank-suggestion-content {
    position: relative;
    z-index: 2;
    display: block;
    pointer-events: none;
}

.bank-suggestion-hitbox {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.bank-suggestion-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.bank-suggestion-link:hover strong {
    text-decoration: underline;
}

.bank-suggestion span,
.bank-suggestion em {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-style: normal;
    line-height: 1.25;
}

.bank-suggestion .bank-suggestion-matched-amount {
    display: inline-block;
    margin-top: 2px;
    padding: 2px 5px;
    border-radius: 5px;
    background: #dcfce7;
    color: #166534;
    font-weight: 700;
}

.bank-suggestion .bank-suggestion-fx-amount {
    margin-top: 2px;
    color: #0f766e;
    font-weight: 700;
}

.bank-suggestion .bank-suggestion-warning {
    margin-top: 3px;
    color: #b45309;
    font-weight: 700;
}

.bank-suggestion strong {
    display: block;
    margin-bottom: 1px;
    color: #0f172a;
    font-size: 12px;
}

.bank-suggestion-actions {
    position: relative;
    z-index: 3;
    display: grid;
    flex: 0 0 auto;
    gap: 4px;
    align-items: center;
}

.bank-suggestion-actions form {
    margin: 0;
}

.bank-suggestion button {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    padding: 0;
    border: 1px solid #cbd8e6;
    border-radius: 999px;
    background: #ffffff;
    color: #27364a;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.bank-suggestion .bank-confirm-button {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.bank-suggestion .bank-reject-button {
    border-color: #fecaca;
    background: #fff7f7;
    color: #991b1b;
}

.bank-suggestion .bank-unconfirm-button {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #9a3412;
}

.bank-suggestion-confirmed {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.bank-row-actions {
    text-align: center;
    white-space: nowrap;
}

.bank-row-actions form {
    margin: 0;
}

.bank-delete-button {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    min-height: 22px;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fff7f7;
    color: #991b1b;
    padding: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.deal-row-actions {
    text-align: center;
    white-space: nowrap;
}

.deal-delete-form {
    margin: 0;
}

.deal-delete-button {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    min-height: 22px;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fff7f7;
    color: #991b1b;
    padding: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.bank-no-match {
    color: #94a3b8;
    font-size: 12px;
}

.bank-allocation-summary {
    display: grid;
    gap: 2px;
    margin-bottom: 6px;
    padding: 6px 8px;
    border: 1px solid #dbe7f3;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-size: 10px;
    line-height: 1.25;
}

.bank-allocation-summary strong {
    color: #0f766e;
}

.bank-allocation-summary .bank-allocation-over {
    color: #b45309;
}

.bank-manual-match-form {
    display: grid;
    grid-template-columns: minmax(82px, 1fr) minmax(78px, 0.85fr) auto;
    gap: 5px;
    margin-top: 6px;
}

.bank-manual-match-form input {
    width: 100%;
    min-width: 0;
    border: 1px solid #cbd8e6;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    font-size: 11px;
    line-height: 1.2;
    padding: 5px 6px;
}

.bank-manual-match-form button {
    border: 1px solid #93c5fd;
    border-radius: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    padding: 5px 7px;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .bank-import-form {
        grid-template-columns: 1fr;
    }
}

body.deal-form-page .main {
    padding: 10px 22px;
}

body.deal-form-page {
    font-size: 12px;
}

body.deal-form-page .topbar {
    min-height: 46px;
    margin-bottom: 9px;
    padding-bottom: 7px;
}

body.deal-form-page .eyebrow {
    font-size: 11px;
}

body.deal-form-page .topbar h1 {
    font-size: 22px;
}

body.deal-form-page .deal-form {
    gap: 7px;
}

body.deal-form-page .deal-form-simple {
    max-width: 1280px;
}

body.deal-form-page .deal-meta-strip {
    gap: 8px;
    padding: 8px;
    border-top-width: 3px;
}

body.deal-form-page .meta-item {
    min-height: 44px;
    gap: 3px;
    padding: 6px 8px;
}

body.deal-form-page .meta-item span,
body.deal-form-page .status-field > span,
body.deal-form-page .client-code-card span,
body.deal-form-page .urgency-field > span {
    font-size: 10px;
}

body.deal-form-page .meta-item strong {
    font-size: 14px;
}

body.deal-form-page .waiting-days-card strong {
    font-size: 16px;
}

body.deal-form-page .status-field,
body.deal-form-page .urgency-field {
    padding: 6px 8px;
}

body.deal-form-page input,
body.deal-form-page select,
body.deal-form-page textarea {
    min-height: 32px;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.25;
}

body.deal-form-page .form-section,
body.deal-form-page .payment-block,
body.deal-form-page .linked-card {
    padding: 9px;
}

body.deal-form-page .section-head,
body.deal-form-page .linked-card-head {
    gap: 8px;
    margin-bottom: 7px;
    padding-bottom: 6px;
}

body.deal-form-page .section-head p,
body.deal-form-page .linked-card-head p {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.25;
}

body.deal-form-page h2 {
    font-size: 14px;
}

body.deal-form-page .linked-card-head.compact h2 {
    font-size: 13px;
}

body.deal-form-page .linked-card-head.compact p,
body.deal-form-page .field span {
    font-size: 11px;
}

body.deal-form-page .form-grid,
body.deal-form-page .deal-payment-layout {
    gap: 8px;
}

body.deal-form-page .field {
    gap: 4px;
}

body.deal-form-page .field .field-match-note {
    align-items: center;
    color: #64748b;
    display: inline-flex;
    font-size: 10px;
    font-weight: 800;
    gap: 5px;
    line-height: 1.2;
}

body.deal-form-page .field .field-match-note::before {
    border-radius: 50%;
    content: "";
    flex: 0 0 7px;
    height: 7px;
    width: 7px;
}

body.deal-form-page .field .field-match-note.is-confirmed {
    color: #047857;
}

body.deal-form-page .field .field-match-note.is-confirmed::before {
    background: #10b981;
}

body.deal-form-page .field .field-match-note.is-confirmed.is-warning {
    color: #047857;
}

body.deal-form-page .field .field-match-note.is-missing {
    color: #b45309;
}

body.deal-form-page .field .field-match-note.is-missing::before {
    background: #ffffff;
    border: 1px solid #f59e0b;
}

.deal-russian-entity-warning {
    color: #b45309;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
}

body.deal-form-page .client-pick-layout,
body.deal-form-page .commission-pair,
body.deal-form-page .fixed-commission-pair,
body.deal-form-page .linked-fields.vertical {
    gap: 6px;
}

body.deal-form-page .client-search-field > span {
    font-size: 12px;
}

body.deal-form-page .client-code-card {
    min-height: 48px;
    gap: 3px;
    padding: 6px 8px;
}

body.deal-form-page .client-code-card strong {
    font-size: 14px;
}

body.deal-form-page .urgency-field {
    min-height: 48px;
}

body.deal-form-page .urgency-field select {
    height: 30px;
    padding: 5px 7px;
}

body.deal-form-page .client-chat-control input,
body.deal-form-page .recipient-control input {
    height: 32px;
    font-size: 13px;
}

body.deal-form-page .autocomplete-input {
    height: 32px;
    padding-right: 30px;
    font-size: 13px;
}

body.deal-form-page .autocomplete::after {
    right: 10px;
    font-size: 17px;
}

body.deal-form-page .linked-fields {
    gap: 6px;
    padding: 8px;
}

body.deal-form-page textarea {
    min-height: 58px;
}

body.deal-form-page .sticky-actions {
    padding: 8px;
}

body.deal-form-page .sticky-actions .button,
body.deal-form-page .sticky-actions button {
    padding: 7px 11px;
    font-size: 13px;
}

body.deal-form-page .status-dropdown-trigger,
body.deal-form-page .status-field .status-dropdown-trigger,
body.deal-form-page .urgency-field button,
body.deal-form-page .button,
body.deal-form-page button {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 12px;
}

body.deal-form-page .client-payment-block,
body.deal-form-page .payer-card,
body.deal-form-page .currency-payment-block,
body.deal-form-page .receiver-card,
body.deal-form-page .rub-block,
body.deal-form-page .form-section-primary {
    border-top-width: 3px;
}

body:has(.deal-form-simple) {
    font-size: 12px;
}

body:has(.deal-form-simple) .main {
    padding: 10px 22px;
}

body:has(.deal-form-simple) .topbar {
    min-height: 46px;
    margin-bottom: 9px;
    padding-bottom: 7px;
}

body:has(.deal-form-simple) .eyebrow {
    font-size: 11px;
}

body:has(.deal-form-simple) .topbar h1 {
    font-size: 22px;
}

.deal-form-simple {
    gap: 7px;
    max-width: 1280px;
}

.deal-form-simple .deal-meta-strip {
    gap: 8px;
    padding: 8px;
    border-top-width: 3px;
}

.deal-form-simple .meta-item {
    min-height: 44px;
    gap: 3px;
    padding: 6px 8px;
}

.deal-form-simple .meta-item span,
.deal-form-simple .status-field > span,
.deal-form-simple .client-code-card span,
.deal-form-simple .urgency-field > span {
    font-size: 10px;
}

.deal-form-simple .meta-item strong {
    font-size: 14px;
}

.deal-form-simple .waiting-days-card strong {
    font-size: 16px;
}

.deal-form-simple .status-field,
.deal-form-simple .urgency-field {
    padding: 6px 8px;
}

.deal-form-simple input,
.deal-form-simple select,
.deal-form-simple textarea {
    min-height: 32px;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.25;
}

.deal-form-simple .form-section,
.deal-form-simple .payment-block,
.deal-form-simple .linked-card {
    padding: 9px;
}

.deal-form-simple .section-head,
.deal-form-simple .linked-card-head {
    gap: 8px;
    margin-bottom: 7px;
    padding-bottom: 6px;
}

.deal-form-simple .section-head p,
.deal-form-simple .linked-card-head p {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.25;
}

.deal-form-simple h2 {
    font-size: 14px;
}

.deal-form-simple .linked-card-head.compact h2 {
    font-size: 13px;
}

.deal-form-simple .linked-card-head.compact p,
.deal-form-simple .field span {
    font-size: 11px;
}

.deal-form-simple .form-grid,
.deal-form-simple .deal-payment-layout {
    gap: 8px;
}

.deal-form-simple .field {
    gap: 4px;
}

.deal-form-simple .client-pick-layout,
.deal-form-simple .commission-pair,
.deal-form-simple .fixed-commission-pair,
.deal-form-simple .linked-fields.vertical {
    gap: 6px;
}

.deal-form-simple .client-search-field > span {
    font-size: 12px;
}

.deal-form-simple .client-code-card {
    min-height: 48px;
    gap: 3px;
    padding: 6px 8px;
}

.deal-form-simple .client-code-card strong {
    font-size: 14px;
}

.deal-form-simple .urgency-field {
    min-height: 48px;
}

.deal-form-simple .urgency-field select {
    height: 30px;
    padding: 5px 7px;
}

.deal-form-simple .client-chat-control input,
.deal-form-simple .recipient-control input {
    height: 32px;
    font-size: 13px;
}

.deal-form-simple .autocomplete-input {
    height: 32px;
    padding-right: 30px;
    font-size: 13px;
}

.deal-form-simple .autocomplete::after {
    right: 10px;
    font-size: 17px;
}

.deal-form-simple .client-autocomplete {
    grid-template-columns: minmax(0, 1fr) auto;
}

.deal-form-simple .client-autocomplete::after {
    right: 88px;
}

.deal-form-simple .client-add {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 12px;
}

.deal-form-simple .linked-fields {
    gap: 6px;
    padding: 8px;
}

.deal-form-simple .deal-bank-links-section {
    border-top: 3px solid #2563eb;
}

.deal-rub-balance-section {
    border-top: 3px solid #0f766e;
}

.deal-rub-balance-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.deal-rub-balance-grid article {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
}

.deal-rub-balance-grid span {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.deal-rub-balance-grid strong {
    color: #0f172a;
    font-size: 16px;
}

.deal-bank-links {
    display: grid;
    gap: 8px;
}

.deal-bank-links-subsection {
    display: grid;
    gap: 8px;
}

.deal-bank-links-subsection + .deal-bank-links-subsection {
    margin-top: 14px;
}

.deal-bank-links-subhead {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.deal-bank-links-subhead h3 {
    color: #0f172a;
    font-size: 14px;
    margin: 0;
}

.deal-bank-link-open {
    align-self: flex-start;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 9px;
    text-decoration: none;
    white-space: nowrap;
}

.deal-bank-link-card {
    align-items: start;
    background: #f8fafc;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    display: grid;
    gap: 8px 12px;
    grid-template-columns: minmax(0, 1.4fr) minmax(150px, 0.55fr) minmax(120px, auto);
    padding: 10px;
}

.deal-bank-link-confirmed {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.deal-bank-link-main,
.deal-bank-link-money,
.deal-bank-link-meta {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.deal-bank-link-main strong,
.deal-bank-link-money strong {
    color: #0f172a;
    font-size: 13px;
}

.deal-bank-link-main span,
.deal-bank-link-money span,
.deal-bank-link-meta span,
.deal-bank-link-main em,
.deal-bank-link-card p {
    color: #475569;
    font-size: 11px;
    line-height: 1.35;
}

.deal-bank-link-main em {
    font-style: normal;
}

.deal-bank-link-status {
    align-self: start;
    background: #e0e7ff;
    border-radius: 999px;
    color: #3730a3 !important;
    display: inline-flex;
    font-weight: 800;
    justify-self: start;
    padding: 3px 8px;
}

.deal-bank-link-confirmed .deal-bank-link-status {
    background: #dcfce7;
    color: #166534 !important;
}

.deal-bank-link-card p {
    grid-column: 1 / -1;
    margin: 0;
}

.deal-bank-link-card .deal-russian-entity-warning {
    color: #b45309;
}

.client-bank-history-section {
    border-top-color: #0f766e !important;
}

.client-bank-history {
    display: grid;
    gap: 7px;
}

.client-bank-history-row {
    align-items: start;
    background: #f8fafc;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    display: grid;
    gap: 8px 12px;
    grid-template-columns: minmax(0, 1fr) minmax(160px, 0.35fr);
    padding: 9px 10px;
}

.client-bank-history-row.is-current-deal {
    background: #f0fdfa;
    border-color: #99f6e4;
}

.client-bank-history-row div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.client-bank-history-row strong {
    color: #0f172a;
    font-size: 13px;
}

.client-bank-history-row span,
.client-bank-history-row em {
    color: #475569;
    font-size: 11px;
    font-style: normal;
    line-height: 1.35;
}

.clients-shell {
    display: grid;
    gap: 16px;
}

.clients-panel,
.client-section-panel {
    background: #ffffff;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    padding: 14px;
}

.clients-hero {
    align-items: center;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    color: #ffffff;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(260px, 0.8fr) minmax(520px, 1.2fr);
    min-height: auto;
    padding: 16px;
}

.clients-hero > div:first-child {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.clients-hero span,
.clients-hero em {
    color: #cbd5e1;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.clients-hero > div:first-child > strong {
    font-size: 26px;
    letter-spacing: 0;
}

.clients-hero-metrics {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.clients-hero-metrics article {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    display: grid;
    gap: 3px;
    min-height: 82px;
    padding: 10px;
}

.clients-hero-metrics article strong {
    font-size: 20px;
}

.client-filters {
    align-items: end;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(280px, 1fr) minmax(145px, 0.22fr) minmax(145px, 0.22fr) auto;
    margin-bottom: 14px;
    padding: 10px;
}

.client-detail-filters {
    grid-template-columns: minmax(145px, 0.2fr) minmax(145px, 0.2fr) auto;
    margin-bottom: 0;
}

.client-filters label {
    display: grid;
    gap: 5px;
}

.client-filters label span {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.client-filters input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    font-size: 13px;
    min-height: 38px;
    padding: 8px 10px;
}

.client-filter-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.client-filter-actions button,
.client-filter-actions .button {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
}

.clients-list {
    display: grid;
    gap: 8px;
}

.client-list-card {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: inherit;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(260px, 1.1fr) minmax(430px, 1.15fr) minmax(150px, 0.4fr) minmax(160px, 0.4fr);
    padding: 12px;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.client-list-card:hover,
.client-list-card:focus-visible {
    border-color: #93c5fd;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    outline: none;
    transform: translateY(-1px);
}

.client-list-main {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 38px minmax(0, 1fr);
    min-width: 0;
}

.client-avatar {
    align-items: center;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    color: #075985;
    display: inline-flex;
    font-size: 16px;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.client-list-main strong {
    color: #0f172a;
    display: block;
    font-size: 14px;
    line-height: 1.25;
}

.client-list-main em {
    color: #64748b;
    display: block;
    font-size: 12px;
    font-style: normal;
    margin-top: 3px;
}

.client-list-stats {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-list-stats span {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    display: grid;
    font-size: 11px;
    gap: 2px;
    min-height: 48px;
    padding: 7px 8px;
}

.client-list-stats strong {
    color: #0f172a;
    font-size: 15px;
}

.client-list-meta,
.client-list-team {
    display: grid;
    gap: 4px;
}

.client-list-meta span,
.client-list-team span {
    color: #64748b;
    font-size: 11px;
}

.client-list-meta strong {
    color: #0f172a;
    font-size: 13px;
}

.client-empty-state {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-size: 13px;
    padding: 24px;
    text-align: center;
}

.clients-table {
    min-width: 900px;
    width: 100%;
}

.clients-table th,
.clients-table td {
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-size: 12px;
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
}

.clients-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.clients-table td span {
    color: #64748b;
    display: block;
    font-size: 11px;
    margin-top: 2px;
}

.clients-table tbody tr.clickable-row:hover td {
    background: #eef6ff;
}

.row-main-link {
    color: #0f172a;
    font-weight: 800;
    text-decoration: none;
}

.row-main-link:hover {
    color: #1d4ed8;
}

.empty-cell {
    color: #64748b;
    font-size: 12px;
    margin: 0;
    padding: 12px;
    text-align: center;
}

.client-detail-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.client-detail-code {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    color: #075985;
    font-size: 12px;
    font-weight: 800;
    padding: 7px 10px;
}

.client-summary-grid,
.client-total-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.client-summary-grid article,
.client-total-grid article {
    background: #ffffff;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 12px;
}

.client-summary-grid article.balance-alert,
.deal-rub-balance-grid article.balance-alert {
    border-color: #fed7aa;
    background: #fff7ed;
}

.client-summary-grid article.balance-ok,
.deal-rub-balance-grid article.balance-ok {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.client-summary-grid span,
.client-total-grid span,
.client-total-grid em {
    color: #64748b;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    text-transform: uppercase;
}

.client-summary-grid strong,
.client-total-grid strong {
    color: #0f172a;
    font-size: 18px;
}

.client-section-panel .section-head.compact {
    margin-bottom: 10px;
}

.client-bank-history-row a {
    color: #1d4ed8;
    font-weight: 800;
    text-decoration: none;
}

.client-profiles-table,
.client-deals-table {
    min-width: 760px;
}

.counterparty-stack {
    display: grid;
    gap: 4px;
}

.counterparty-stack span,
.counterparty-stack a,
.muted-line {
    display: block;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.counterparty-stack a {
    color: #1d4ed8;
    font-weight: 800;
    text-decoration: none;
}

@media (max-width: 760px) {
    .clients-hero,
    .client-filters,
    .client-detail-filters,
    .client-list-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .clients-hero-metrics,
    .client-list-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-filter-actions {
        justify-content: stretch;
    }

    .client-filter-actions button,
    .client-filter-actions .button {
        flex: 1;
    }

    .bank-imports-compact summary {
        align-items: start;
        gap: 4px 10px;
    }

    .bank-imports-compact summary > span:first-of-type {
        display: grid;
        gap: 2px;
    }

    .bank-import-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .bank-import-row span,
    .bank-import-row em {
        grid-column: 1 / -1;
    }

    .deal-bank-link-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .deal-bank-link-open {
        justify-self: start;
    }
}

.deal-form-simple textarea {
    min-height: 58px;
}

.deal-form-simple .sticky-actions {
    padding: 8px;
}

.deal-form-simple .sticky-actions .button,
.deal-form-simple .sticky-actions button,
.deal-form-simple .status-dropdown-trigger,
.deal-form-simple .status-field .status-dropdown-trigger,
.deal-form-simple .button,
.deal-form-simple button {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 12px;
}

.deal-form-simple .sticky-actions {
    justify-content: flex-end;
}

.deal-form-simple .sticky-actions .deal-form-delete-button {
    width: auto;
    height: auto;
    min-height: 32px;
    margin-right: auto;
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 12px;
}

.deal-form-simple .client-payment-block,
.deal-form-simple .payer-card,
.deal-form-simple .currency-payment-block,
.deal-form-simple .receiver-card,
.deal-form-simple .rub-block,
.deal-form-simple .form-section-primary {
    border-top-width: 3px;
}

@media (max-width: 980px) {
    .sidebar {
        position: static;
        width: auto;
        min-height: auto;
    }

    body.sidebar-collapsed .sidebar {
        width: auto;
    }

    body.sidebar-collapsed .brand-copy,
    body.sidebar-collapsed .nav-text {
        display: block;
    }

    body.sidebar-collapsed .nav a,
    body.sidebar-collapsed .brand {
        justify-content: flex-start;
    }

    body.sidebar-collapsed .sidebar-toggle {
        position: static;
    }

    .main,
    body.sidebar-collapsed .main {
        margin-left: 0;
    }

    .metrics,
    .split,
    .form-grid,
    .form-grid.two,
    .form-grid.three,
    .deal-meta-strip,
    .deal-payment-layout,
    .client-pick-layout,
    .deal-summary,
    .two-column-section,
    .linked-fields {
        grid-template-columns: 1fr;
    }

    .link-mark {
        width: 100%;
        height: 26px;
    }

    .main {
        padding: 20px;
    }
}

/* Light premium FinTech skin */
body.payment-queue-page {
    background:
        linear-gradient(180deg, #f9fbfc 0%, #eef3f6 320px, #edf2f6 100%);
}

body.payment-queue-page .main {
    padding: 28px 32px;
}

body.payment-queue-page .topbar {
    min-height: 92px;
    margin: -28px -32px 24px;
    padding: 28px 32px 20px;
    border-bottom: 1px solid #d9e4ec;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 252, 0.96));
    color: #0b1220;
    box-shadow: 0 14px 38px rgba(16, 24, 40, 0.06);
}

body.payment-queue-page .topbar h1 {
    color: #0b1220;
    font-size: 34px;
    font-weight: 900;
}

body.payment-queue-page .eyebrow {
    color: #00876c;
}

body.payment-queue-page .user-pill {
    border-color: #d7e2eb;
    background: #ffffff;
    color: #344054;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06);
}

body.payment-queue-page .queue-metrics {
    margin-top: -8px;
    margin-bottom: 18px;
}

body.payment-queue-page .metric {
    min-height: 118px;
    padding: 22px 24px;
    border-color: #d4e0e9;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.96));
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.08);
}

body.payment-queue-page .metric::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #14b8a6, #e6b450);
}

body.payment-queue-page .metric span {
    color: #667085;
    font-size: 13px;
    font-weight: 850;
    text-transform: uppercase;
}

body.payment-queue-page .metric strong {
    margin-top: 13px;
    color: #07111e;
    font-size: 34px;
    font-weight: 950;
}

body.payment-queue-page .metric:nth-child(3) {
    border-color: #93d3c5;
    background:
        linear-gradient(135deg, #f8fffd 0%, #e5f7f2 100%);
}

body.payment-queue-page .metric:nth-child(3)::before {
    background: linear-gradient(90deg, #00876c, #5eead4);
}

body.payment-queue-page .metric:nth-child(4)::before {
    background: linear-gradient(90deg, #b7791f, #f5d38a);
}

body.payment-queue-page .queue-panel {
    padding: 18px;
    border: 1px solid rgba(185, 199, 212, 0.9);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 253, 0.97));
    box-shadow: 0 20px 54px rgba(16, 24, 40, 0.09);
}

body.payment-queue-page .queue-filters {
    padding: 0 0 16px;
    border-bottom: 1px solid #d7e1ea;
}

body.payment-queue-page .queue-filters input,
body.payment-queue-page .queue-filters select {
    height: 46px;
    border-color: #cbd8e6;
    background: #fbfdff;
    color: #0f172a;
    font-weight: 650;
}

body.payment-queue-page .queue-filters button,
body.payment-queue-page .queue-filters .button {
    height: 46px;
    border-color: #cbd8e6;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.06);
}

body.payment-queue-page .queue-filters button[type="submit"] {
    border-color: #00876c;
    background: #00876c;
    color: #ffffff;
}

body.payment-queue-page .queue-table-wrap {
    max-height: calc(100vh - 278px);
    border-color: #aebdca;
    box-shadow: inset 0 1px 0 #ffffff;
}

body.payment-queue-page .payment-queue-table {
    font-size: 12px;
}

body.payment-queue-page .payment-queue-table thead th {
    height: 38px;
    border-color: #b9c9d8;
    background: #e5eef6;
    color: #26384d;
    font-size: 9px;
    letter-spacing: 0.03em;
}

body.payment-queue-page .payment-queue-table td {
    height: 36px;
    border-bottom-color: #dfe7ee;
    color: #1e293b;
    background: #ffffff;
}

body.payment-queue-page .payment-queue-table tbody tr.clickable-row:hover td {
    background: #ecfdf7;
}

body.payment-queue-page .queue-group-cell {
    border-right-color: #9fb8d8;
    background:
        linear-gradient(180deg, #f8fcff 0%, #edf5fa 100%) !important;
    color: #0b1220;
}

body.payment-queue-page .queue-group-cell strong {
    color: #0b1220;
    font-size: 13px;
}

body.payment-queue-page .queue-group-cell span {
    color: #64748b;
}

body.payment-queue-page .queue-group-cell em {
    color: #006a57;
    font-size: 17px;
}

body.payment-queue-page .queue-group-cell small {
    color: #9a3412;
}

body.payment-queue-page .queue-status {
    min-height: 26px;
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.payment-queue-page .currency-badge,
body.payment-queue-page .days-badge {
    border-radius: 999px;
    font-weight: 950;
}

body.payment-queue-page .queue-gap-row td {
    height: 10px;
    background: #edf2f6;
}

/* Treasury Desk queue layout */
body.treasury-page {
    background: #eef3f8;
    font-weight: 400;
    font-size: 13px;
}

body.treasury-page .main {
    padding: 0;
}

body.treasury-page .topbar {
    display: none;
}

.treasury-shell {
    min-height: 100vh;
    padding-bottom: 28px;
    background: #eef3f8;
    color: #0f172a;
}

.treasury-toolbar {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: center;
    min-height: 62px;
    padding: 10px 14px;
    border-bottom: 1px solid #d9e4ef;
    border-radius: 0 0 20px 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 30px rgba(32, 43, 60, 0.11);
    backdrop-filter: blur(10px);
}

.treasury-toolbar h1 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
    font-weight: 720;
    letter-spacing: 0;
}

.treasury-brand {
    display: grid;
    gap: 2px;
}

.treasury-brand span {
    color: #2f6df6;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.treasury-brand strong {
    color: #0f172a;
    font-size: 14px;
    font-weight: 760;
}

.treasury-tabs {
    justify-self: center;
    display: inline-flex;
    gap: 5px;
    padding: 5px;
    border: 1px solid #d8e3ee;
    border-radius: 999px;
    background: #f6f9fc;
}

.treasury-tabs a {
    display: grid;
    place-items: center;
    min-width: 128px;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    color: #718096;
    font-size: 12px;
    font-weight: 700;
}

.treasury-tabs a.is-active {
    background: #ffffff;
    color: #2f6df6;
    box-shadow: 0 10px 26px rgba(47, 109, 246, 0.14);
}

.treasury-actions {
    display: flex;
    gap: 9px;
    justify-content: flex-end;
}

.treasury-button,
.treasury-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    border: 1px solid #dbe5ef;
    border-radius: 10px;
    background: #ffffff;
    color: #1e293b;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(31, 41, 55, 0.07);
}

.queue-control-row {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #d9e4ef;
    background: rgba(238, 243, 248, 0.94);
    box-shadow: 0 12px 26px rgba(32, 43, 60, 0.1);
    backdrop-filter: blur(10px);
}

.queue-collapse-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    grid-column: 3;
    grid-row: 1 / span 2;
}

.queue-day-legend {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    align-items: center;
}

.queue-day-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #ffffff;
    color: #718096;
    font-size: 12px;
    font-weight: 650;
    box-shadow: 0 8px 18px rgba(32, 43, 60, 0.07);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.days-dot-zero { background: #35b779; }
.days-dot-low { background: #e1b539; }
.days-dot-mid { background: #d66273; }
.days-dot-high { background: #8670d8; }
.days-dot-critical { background: #d95b5b; }

.queue-filterbar {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    align-items: center;
    min-width: 0;
}

.queue-filterbar input,
.queue-filterbar select {
    width: auto;
    min-width: 150px;
    height: 32px;
    padding: 0 11px;
    border: 1px solid #dbe5ef;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 520;
    box-shadow: 0 8px 18px rgba(32, 43, 60, 0.06);
}

.queue-filterbar input {
    min-width: 220px;
}

.queue-filterbar .queue-payment-plan-filter {
    min-width: 128px;
    border-color: #f3b85f;
    background: #fffaf1;
    color: #8a5a00;
    font-weight: 760;
}

.queue-filterbar button {
    height: 32px;
    border-radius: 10px;
    border-color: #2f6df6;
    background: #2f6df6;
    color: #ffffff;
    padding: 0 13px;
    font-size: 12px;
    font-weight: 700;
}

.queue-summary-line {
    padding: 0 14px 10px;
    color: #708096;
    font-size: 12px;
    font-weight: 520;
}

.treasury-company-list {
    display: grid;
    gap: 9px;
}

.company-family-label {
    position: sticky;
    top: 62px;
    z-index: 18;
    margin: 8px 14px -2px;
    padding: 3px 0;
    background: rgba(238, 243, 248, 0.86);
    backdrop-filter: blur(8px);
}

.company-family-label span {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border: 1px solid #d6e2ec;
    border-radius: 999px;
    background: #ffffff;
    color: #58708b;
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 8px 18px rgba(32, 43, 60, 0.06);
}

.treasury-company-card {
    margin: 0 14px;
    border: 1px solid #dce6ef;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 38px rgba(32, 43, 60, 0.12);
    overflow: hidden;
    border-left: 4px solid #d7e2eb;
}

.treasury-company-card[data-family="AVEN"],
.treasury-company-card[data-family="Avora"] {
    border-left-color: #2f6df6;
}

.treasury-company-card[data-family="GYFFT"],
.treasury-company-card[data-family="PACTUM"] {
    border-left-color: #00876c;
}

.treasury-company-card[data-family="PALADIN"],
.treasury-company-card[data-family="ZENTARA"] {
    border-left-color: #8670d8;
}

.treasury-company-card[data-family="SAHAB INNOV"],
.treasury-company-card[data-family="Eclipta"] {
    border-left-color: #d9ad2b;
}

.treasury-company-card summary {
    display: grid;
    gap: 8px;
    padding: 12px 14px 9px;
    cursor: pointer;
    list-style: none;
}

.treasury-company-card summary::-webkit-details-marker {
    display: none;
}

.company-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.company-title-row h2 {
    color: #0f172a;
    font-size: 16px;
    font-weight: 760;
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
    flex: 1 1 220px;
}

.company-title-row h2 > span {
    min-width: 0;
}

.company-title-row h2 > em {
    display: inline-grid;
    place-items: center;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid #dbe5ef;
    border-radius: 999px;
    background: #f7fbff;
    color: #64748b;
    font-size: 10px;
    font-style: normal;
    font-weight: 650;
}

.company-toggle {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid #dbe5ef;
    border-radius: 14px;
    background: #fbfdff;
    box-shadow: 0 8px 18px rgba(32, 43, 60, 0.07);
}

.company-toggle::before {
    content: "+";
    color: #0f172a;
    font-size: 17px;
    font-weight: 800;
}

.treasury-company-card[open] .company-toggle::before {
    content: "−";
}

.company-kpis {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.company-kpis span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 27px;
    padding: 0 10px;
    border: 1px solid #dce6ef;
    border-radius: 999px;
    background: #f7fbff;
    color: #708096;
    font-size: 12px;
    font-weight: 520;
}

.company-kpis em {
    font-style: normal;
}

.company-kpis strong {
    color: #0f172a;
    font-weight: 750;
}

.company-balance-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 24px;
    flex: 2 1 420px;
    justify-content: flex-end;
}

.company-balance-strip-label {
    color: #7c8aa1;
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.company-balance-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 2px 8px 2px 3px;
    border: 1px solid #dce6ef;
    border-radius: 999px;
    background: #ffffff;
    color: #223149;
    font-size: 11px;
    font-weight: 720;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.company-balance-chip .currency-badge {
    min-width: 35px;
    height: 18px;
    padding: 0 6px;
    font-size: 9px;
}

.company-balance-chip strong {
    color: #0f172a;
    font-weight: 780;
}

.company-balance-chip small {
    color: #708096;
    font-size: 11px;
    font-weight: 680;
}

.company-balance-chip.is-covered {
    border-color: #c9eadf;
    background: #f5fffb;
}

.company-balance-chip.is-short {
    border-color: #f3c6cc;
    background: #fff7f8;
}

.company-balance-chip.is-short strong {
    color: #b42335;
}

.company-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef6;
}

.company-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #35b779, #95de13);
}

.company-balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #708096;
    font-size: 12px;
    font-weight: 520;
}

.company-balance-row strong {
    color: #223149;
    font-size: 12px;
    font-weight: 760;
}

.treasury-request-table {
    display: grid;
    gap: 0;
    padding: 0 12px 14px;
}

.request-head,
.request-row {
    display: grid;
    grid-template-columns: 82px 70px 118px 64px minmax(170px, 1fr) 96px 140px 104px 70px 108px;
    gap: 8px;
    align-items: center;
}

.treasury-company-card.has-payer-col .request-head,
.treasury-company-card.has-payer-col .request-row {
    grid-template-columns: 78px 68px 112px 62px minmax(150px, 1fr) 126px 92px 132px 102px 68px 102px;
}

.request-head {
    height: 34px;
    padding: 0 12px;
    color: #7c8aa1;
    font-size: 9px;
    font-weight: 720;
    text-transform: uppercase;
}

.request-head > span {
    justify-self: center;
    text-align: center;
}

.request-row {
    min-height: 36px;
    margin-bottom: 5px;
    padding: 6px 12px;
    border: 1px solid #e4ebf2;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 17px rgba(32, 43, 60, 0.06);
}

.request-row.clickable-row {
    cursor: pointer;
}

.bank-suggestion.clickable-row {
    cursor: pointer;
}

.bank-suggestion.clickable-row:focus-visible {
    outline: 2px solid #2c7be5;
    outline-offset: 2px;
}

.request-row.clickable-row:focus-visible {
    outline: 2px solid #2c7be5;
    outline-offset: 2px;
}

.request-row:hover {
    border-color: #c9d8e6;
    background: #fbfdff;
}

.request-row.is-payment-planned {
    border-color: #facb86;
    background: #fffaf1;
    box-shadow: 0 9px 18px rgba(217, 173, 43, 0.14);
}

.request-row.has-urgency {
    border-left: 3px solid #ef7d1a;
}

.request-amount {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.request-amount strong {
    min-width: 76px;
    color: #0f172a;
    font-weight: 720;
    text-align: right;
}

.request-currency {
    display: flex;
    justify-content: center;
}

.request-client {
    display: grid;
    gap: 1px;
}

.request-client strong {
    color: #233149;
    font-weight: 520;
}

.request-date,
.request-manager,
.request-payer {
    justify-self: start;
    padding: 4px 9px;
    border-radius: 999px;
    background: #f4f8fc;
    color: #223149;
    font-size: 11px;
    font-weight: 650;
}

.request-date,
.request-wait {
    justify-self: center;
}

.request-row > span:nth-last-child(2) {
    display: flex;
    justify-content: center;
    justify-self: stretch;
    width: 100%;
}

.request-wait {
    display: flex;
    justify-content: center;
    justify-self: stretch;
    width: 100%;
}

.request-id-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 24px;
    padding: 0 9px;
    border: 1px solid #dbe5ef;
    border-radius: 999px;
    background: #f7fbff;
    color: #2f6df6;
    font-size: 11px;
    font-weight: 760;
    text-decoration: none;
    white-space: nowrap;
}

.request-id-pill.has-urgency {
    border-color: #ef7d1a;
    background: #fff7ed;
    color: #9a3412;
}

.request-id-cell {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.queue-urgency-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 24px;
    padding: 0 8px;
    border: 1px solid #ef7d1a;
    border-radius: 8px;
    background: #ffedd5;
    color: #9a3412;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.request-urgency-cell {
    display: flex;
    justify-content: center;
    min-height: 24px;
    width: 100%;
}

.request-payer {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-status-chip {
    display: inline-grid;
    place-items: center;
    min-height: 23px;
    max-width: 148px;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 8.5px;
    font-style: normal;
    font-weight: 650;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
}

.payment-plan-form {
    display: flex;
    justify-content: center;
}

.payment-plan-toggle {
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid #dbe5ef;
    border-radius: 999px;
    background: #ffffff;
    color: #708096;
    font-size: 8.5px;
    font-weight: 820;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
}

.payment-plan-toggle:hover {
    border-color: #facb86;
    color: #8a5a00;
}

.payment-plan-toggle.is-active {
    border-color: #f3b85f;
    background: #fff0cc;
    color: #8a5a00;
}

.payment-plan-toggle.is-saving {
    opacity: 0.65;
    cursor: wait;
}

.payment-plan-toggle.is-error {
    border-color: #d95b5b;
    background: #fff2f3;
    color: #b42335;
}

.queue-wait-badge {
    display: inline-grid;
    place-items: center;
    min-width: 21px;
    height: 21px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.wait-zero { background: #35b779; }
.wait-low { background: #d9ad2b; }
.wait-mid { background: #d66273; }
.wait-high { background: #8670d8; }
.wait-critical { background: #d95b5b; }

.treasury-deals-page thead tr:nth-child(2) th:nth-child(1),
.treasury-deals-page thead tr:nth-child(2) th:nth-child(3) {
    border-left: 1px solid #92afcf;
}

.treasury-deals-page thead tr:nth-child(2) th:nth-child(2),
.treasury-deals-page thead tr:nth-child(2) th:nth-child(4) {
    border-right: 1px solid #92afcf;
}

.treasury-deals-page thead tr:nth-child(2) th {
    border-top: 1px solid #a9c1dc;
    border-bottom: 1px solid #9fb8d4;
    box-shadow: none;
}

.treasury-deals-page th.group-head {
    border-inline: 1px solid #92afcf;
    border-bottom: 1px solid #92afcf;
    box-shadow: none;
}

.treasury-deals-page th.payer-group-head,
.treasury-deals-page th.rf-group-head {
    font-weight: 860;
}

.treasury-deals-page th.payer-group-head {
    border-color: #84a9d1;
    background: linear-gradient(180deg, #e9f5ff 0%, #cfe6fb 100%);
    color: #123f69;
}

.treasury-deals-page th.rf-group-head {
    border-color: #8bbda6;
    background: linear-gradient(180deg, #eefaf5 0%, #d5efe4 100%);
    color: #14513d;
}

.treasury-deals-page thead tr:nth-child(2) th.payer-subhead,
.treasury-deals-page thead tr:nth-child(2) th.rf-subhead {
    font-weight: 800;
}

.treasury-deals-page thead tr:nth-child(2) th.payer-subhead {
    border-top-color: #84a9d1;
    background: #edf7ff;
    color: #385f88;
}

.treasury-deals-page thead tr:nth-child(2) th.rf-subhead {
    border-top-color: #8bbda6;
    background: #effaf5;
    color: #3d705d;
}

.treasury-deals-page tbody td.party-cell {
    background-clip: padding-box;
}

.treasury-deals-page tbody td.payer-company-cell,
.treasury-deals-page tbody td.payer-bank-cell {
    background: #f7fbff;
}

.treasury-deals-page tbody td.rf-company-cell,
.treasury-deals-page tbody td.rf-bank-cell {
    background: #f7fcfa;
}

.treasury-deals-page tbody td.payer-company-cell {
    box-shadow:
        inset 1px 0 0 #b8d2eb,
        inset 0 1px 0 #dfe8f1,
        inset 0 -1px 0 #dfe8f1;
}

.treasury-deals-page tbody td.payer-bank-cell {
    box-shadow:
        inset -1px 0 0 #b8d2eb,
        inset 1px 0 0 #dfebf6,
        inset 0 1px 0 #dfe8f1,
        inset 0 -1px 0 #dfe8f1;
}

.treasury-deals-page tbody td.rf-company-cell {
    box-shadow:
        inset 1px 0 0 #b6d9ca,
        inset 0 1px 0 #dfe8f1,
        inset 0 -1px 0 #dfe8f1;
}

.treasury-deals-page tbody td.rf-bank-cell {
    box-shadow:
        inset -1px 0 0 #b6d9ca,
        inset 1px 0 0 #e0efe8,
        inset 0 1px 0 #dfe8f1,
        inset 0 -1px 0 #dfe8f1;
}

.treasury-deals-page tbody tr.clickable-row:hover td.payer-company-cell,
.treasury-deals-page tbody tr.clickable-row:hover td.payer-bank-cell {
    background: #eef7ff;
}

.treasury-deals-page tbody tr.clickable-row:hover td.rf-company-cell,
.treasury-deals-page tbody tr.clickable-row:hover td.rf-bank-cell {
    background: #effaf6;
}

.treasury-deals-page .bank-text {
    display: inline;
    color: #27435e;
    font-size: 10.5px;
    font-weight: 760;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.treasury-deals-page .rf-bank-cell .bank-text {
    color: #2d5948;
}

.treasury-deals-page thead th.sticky-col-1,
.treasury-deals-page thead th.sticky-col-2,
.treasury-deals-page thead th.sticky-col-3 {
    position: sticky;
    z-index: 90;
    background: linear-gradient(180deg, #eef7ff 0%, #d3e7fa 100%);
}

.treasury-deals-page thead th.sticky-col-1 {
    left: auto;
}

.treasury-deals-page thead th.sticky-col-2 {
    left: auto;
}

.treasury-deals-page thead th.sticky-col-3 {
    left: auto;
}

/* Company balances */
.balance-shell {
    min-height: 100vh;
    padding: 8px;
    background:
        linear-gradient(180deg, #f7fafc 0%, #edf3f8 210px),
        #eef3f8;
}

.balance-toolbar {
    grid-template-columns: auto 1fr auto;
}

.balance-layout {
    padding: 0;
}

.balance-editor,
.balance-card {
    border: 1px solid #d7e2eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(32, 43, 60, 0.08);
}

.balance-editor {
    position: sticky;
    top: 12px;
    align-self: start;
    padding: 14px;
}

.balance-editor-head {
    display: grid;
    gap: 3px;
    margin-bottom: 12px;
}

.balance-editor-head span,
.balance-card-head span {
    color: #667085;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.balance-editor-head strong {
    color: #0f172a;
    font-size: 18px;
    font-weight: 820;
}

.balance-message {
    margin-bottom: 10px;
    padding: 9px 10px;
    border: 1px solid #a8dacd;
    border-radius: 8px;
    background: #ecfdf7;
    color: #006a57;
    font-size: 12px;
    font-weight: 750;
}

.balance-form {
    display: grid;
    gap: 10px;
}

.balance-form label {
    display: grid;
    gap: 5px;
    color: #344054;
    font-size: 12px;
    font-weight: 720;
}

.balance-form input,
.balance-form select {
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
}

.balance-form button {
    height: 38px;
}

.balance-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 8px;
    min-width: 0;
    align-items: start;
}

.balance-card {
    min-width: 0;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.balance-card-wide {
    width: 100%;
    max-width: 100%;
    min-height: calc(100vh - 16px);
}

.balance-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 40px;
    padding: 6px 10px;
    border-bottom: 1px solid #dce6ef;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.balance-card-head h2 {
    color: #0f172a;
    font-size: 12px;
    font-weight: 820;
    text-transform: uppercase;
}

.balance-card-head strong {
    color: #00876c;
    font-size: 15px;
    font-weight: 850;
    white-space: nowrap;
}

.balance-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.balance-mode-toggle {
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid #cbd8e6;
    border-radius: 999px;
    background: #ffffff;
    color: #1f4168;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.balance-mode-toggle:hover,
.balance-mode-toggle.is-active {
    border-color: #2f6df6;
    background: #eaf3ff;
    color: #1d4ed8;
}

.balance-table-wrap {
    overflow: auto;
    height: calc(100vh - 64px);
    max-height: none;
    min-height: 520px;
    background:
        linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0)) 0 0 / 28px 100% no-repeat,
        linear-gradient(270deg, #ffffff 0%, rgba(255, 255, 255, 0)) 100% 0 / 28px 100% no-repeat;
}

.balance-table {
    width: 100%;
    min-width: 1260px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 10px;
}

body.balance-amounts-only .currency-balance-table {
    min-width: 780px;
}

body.balance-amounts-only .metric-requests,
body.balance-amounts-only .metric-liquidity,
body.balance-amounts-only .metric-requests-col,
body.balance-amounts-only .metric-liquidity-col {
    display: none;
}

.balance-table th {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 28px;
    padding: 0 6px;
    border-right: 1px solid #d6e1ec;
    border-bottom: 1px solid #c9d6e2;
    background: #edf5fb;
    color: #1c3c63;
    font-size: 8px;
    font-weight: 820;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.balance-table td {
    height: 25px;
    padding: 3px 6px;
    border-right: 1px solid #eef2f6;
    border-bottom: 1px solid #e7edf3;
    background: #ffffff;
    color: #1e293b;
}

.balance-company-col { width: 150px; }
.balance-total-col { width: 115px; }
.balance-data-col { width: auto; }

.balance-company-col,
.balance-total-col,
.balance-left-head,
.balance-total-head {
    position: sticky;
    z-index: 5;
}

.balance-company-col,
.balance-left-head {
    left: 0;
}

.balance-total-col,
.balance-total-head {
    left: 150px;
}

.balance-table thead .balance-company-col,
.balance-table thead .balance-total-col,
.balance-table thead .balance-left-head,
.balance-table thead .balance-total-head {
    z-index: 24;
}

.balance-left-head {
    width: 150px;
    text-align: left !important;
    box-shadow: 4px 0 12px rgba(15, 23, 42, 0.06);
}

.balance-total-head {
    width: 115px;
    border-left: 1px solid #d6e1ec;
    background: #edf5fb !important;
    color: #173247 !important;
    text-align: right !important;
    box-shadow: 4px 0 12px rgba(15, 23, 42, 0.05);
}

.currency-subhead {
    top: 28px !important;
    z-index: 21 !important;
}

.currency-balance-table thead th {
    text-align: center;
}

.currency-balance-table thead .balance-left-head {
    text-align: left !important;
}

.balance-jurisdiction-row td {
    height: 56px;
    padding: 10px 12px !important;
    border-top: 8px solid #f5fafc;
    border-bottom: 2px solid #8fb3c0;
    background: linear-gradient(180deg, #1f5c6d 0%, #194d5b 100%) !important;
    color: #ffffff;
    text-align: left !important;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.14);
}

.balance-jurisdiction-row span,
.balance-jurisdiction-row strong {
    display: inline-flex;
    align-items: center;
}

.balance-jurisdiction-row span {
    min-width: 54px;
    min-height: 25px;
    justify-content: center;
    margin-right: 10px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0;
}

.balance-jurisdiction-row strong {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.company-section-name i {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border: 2px solid #dbeafe;
    border-radius: 999px;
    background: #2f6df6;
    vertical-align: -1px;
}

.balance-company-section-row td {
    height: 31px;
    border-top: 2px solid #b8c9dc;
    border-bottom: 1px solid #d8e3ed;
    background: linear-gradient(180deg, #f8fcff 0%, #edf5fa 100%);
}

.company-section-cell {
    position: sticky;
    left: 0;
    z-index: 6;
    padding: 4px 8px !important;
    text-align: left !important;
    box-shadow:
        inset 4px 0 0 #2f6df6,
        4px 0 12px rgba(15, 23, 42, 0.06);
}

.company-section-name,
.company-section-total {
    display: inline-flex;
    align-items: center;
    font-weight: 850;
}

.company-section-name {
    min-width: 168px;
    color: #0b2f57;
    font-size: 10px;
    letter-spacing: 0.01em;
}

.company-section-total {
    margin-left: 8px;
    color: #00945f;
    font-variant-numeric: tabular-nums;
}

.balance-bank-cell {
    position: sticky;
    left: 0;
    z-index: 5;
    height: 25px;
    padding-left: 10px !important;
    padding-right: 8px !important;
    background: #ffffff !important;
    text-align: left !important;
    box-shadow: 4px 0 12px rgba(15, 23, 42, 0.06);
}

.balance-usd-cell,
.summary-usd {
    position: sticky;
    left: 150px;
    z-index: 5;
    background: #ffffff !important;
    color: #00875f !important;
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    box-shadow: 4px 0 12px rgba(15, 23, 42, 0.04);
}

.balance-group-fill {
    background: linear-gradient(180deg, #f8fcff 0%, #edf5fa 100%) !important;
}

.bank-chip {
    display: inline-flex;
    align-items: center;
    min-height: 17px;
    max-width: 100%;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid var(--bank-border, transparent);
    background: var(--bank-bg, #eef6fd);
    color: var(--bank-text, #1f4168);
    font-size: 9px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bank-color-0 { --bank-bg: #eaf3ff; --bank-text: #1d4ed8; --bank-border: #bfdbfe; }
.bank-color-1 { --bank-bg: #ecfdf7; --bank-text: #00876c; --bank-border: #bbf7df; }
.bank-color-2 { --bank-bg: #fff7e8; --bank-text: #a66b00; --bank-border: #fed7aa; }
.bank-color-3 { --bank-bg: #f2efff; --bank-text: #6d5bd0; --bank-border: #ddd6fe; }
.bank-color-4 { --bank-bg: #fff0f4; --bank-text: #d63d6b; --bank-border: #fecdd3; }
.bank-color-5 { --bank-bg: #eef6fd; --bank-text: #1f4168; --bank-border: #cfe3f5; }
.bank-color-6 { --bank-bg: #f0f9ff; --bank-text: #0369a1; --bank-border: #bae6fd; }
.bank-color-7 { --bank-bg: #fefce8; --bank-text: #854d0e; --bank-border: #fde68a; }
.bank-color-8 { --bank-bg: #f0fdf4; --bank-text: #15803d; --bank-border: #bbf7d0; }
.bank-color-9 { --bank-bg: #fdf2f8; --bank-text: #be185d; --bank-border: #fbcfe8; }
.bank-color-10 { --bank-bg: #f5f3ff; --bank-text: #5b21b6; --bank-border: #ddd6fe; }
.bank-color-11 { --bank-bg: #f8fafc; --bank-text: #334155; --bank-border: #cbd5e1; }

.balance-card-ruble .russian-bank-sber {
    --bank-bg: #ecfdf7;
    --bank-text: #00876c;
    --bank-border: #bbf7df;
}

.balance-card-ruble .russian-bank-vtb {
    --bank-bg: #eaf3ff;
    --bank-text: #1d4ed8;
    --bank-border: #bfdbfe;
}

.balance-card-ruble .russian-bank-other {
    --bank-bg: #f8fafc;
    --bank-text: #475569;
    --bank-border: #cbd5e1;
}

.balance-bank-row td {
    height: 25px;
}

.balance-bank-row:hover td {
    background: #edf7ff !important;
}

.balance-bank-row:hover .balance-bank-cell {
    box-shadow:
        inset 4px 0 0 #2f6df6,
        4px 0 12px rgba(15, 23, 42, 0.08);
}

.balance-bank-row:hover .bank-chip,
.ruble-company-row:hover .ruble-company-title span {
    filter: saturate(1.12);
}

.balance-company-section-row:hover td,
.balance-company-section-row:hover .balance-group-fill {
    background: #e8f2ff !important;
}

.money-cell {
    text-align: right;
    font-weight: 560;
    font-variant-numeric: tabular-nums;
}

.total-usd,
.positive-money {
    color: #00945f;
    font-weight: 680;
}

.negative-money {
    color: #e23d68;
    font-weight: 620;
}

.muted-money {
    color: #8293aa;
}

.currency-head-usd { background: #e8f8ef !important; color: #087443 !important; }
.currency-head-aed { background: #fff7dc !important; color: #9a6700 !important; }
.currency-head-eur { background: #eaf3ff !important; color: #1d4ed8 !important; }
.currency-head-cny { background: #fff0f2 !important; color: #c92c4b !important; }

.currency-col-usd { background: #fbfffc !important; }
.currency-col-aed { background: #fffdf5 !important; }
.currency-col-eur { background: #fbfdff !important; }
.currency-col-cny { background: #fffafa !important; }

.currency-col-usd:nth-child(3n),
.currency-col-aed:nth-child(3n),
.currency-col-eur:nth-child(3n),
.currency-col-cny:nth-child(3n) {
    border-left-color: #cad8e6;
}

.balance-table tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 6;
    height: 28px;
    border-top: 2px solid #b9c8d8;
    background: #f8fbfd;
    color: #0f172a;
    font-weight: 720;
}

.balance-table tfoot .summary-label {
    left: 0;
    z-index: 9;
    text-transform: uppercase;
    box-shadow: 4px 0 12px rgba(15, 23, 42, 0.06);
}

.balance-table tfoot .summary-usd {
    z-index: 9;
}

.balance-ruble-list {
    display: grid;
    max-height: none;
    overflow: auto;
}

.ruble-table-head {
    display: grid;
    grid-template-columns: minmax(132px, 1fr) 92px 92px;
    gap: 0;
    align-items: center;
    min-height: 26px;
    border-bottom: 1px solid #dce6ef;
    background: #f7fbff;
    color: #17365d;
    font-size: 8px;
    font-weight: 820;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
}

.ruble-company-row {
    display: grid;
    grid-template-columns: minmax(132px, 1fr) 92px 92px;
    gap: 0;
    align-items: center;
    min-height: 27px;
    padding: 0 6px;
    border-bottom: 1px solid #e7edf3;
    background: #ffffff;
}

.ruble-company-row:hover {
    background: #edf7ff;
}

.ruble-company-row:hover .ruble-balance {
    background: #e7fbf4;
}

.ruble-company-title {
    min-width: 0;
    padding-left: 22px;
}

.ruble-company-group {
    border-left: 4px solid #2f6df6;
    border-bottom: 2px solid #b8c9dc;
    background: #ffffff;
}

.ruble-company-name {
    display: flex;
    gap: 7px;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    border-bottom: 1px solid #d8e3ed;
    background: linear-gradient(180deg, #f8fcff 0%, #edf5fa 100%);
    color: #0b2f57;
    font-size: 10px;
    font-weight: 850;
}

.ruble-company-name i {
    width: 8px;
    height: 8px;
    border: 2px solid #dbeafe;
    border-radius: 999px;
    background: #2f6df6;
}

.ruble-company-title span {
    display: inline-flex;
    align-items: center;
    min-height: 17px;
    max-width: 100%;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid var(--bank-border, transparent);
    background: var(--bank-bg, #eef6fd);
    color: var(--bank-text, #1f4168);
    font-size: 9px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ruble-company-row span {
    color: #64748b;
    font-size: 9px;
    font-weight: 650;
}

.ruble-company-row .ruble-company-title span {
    background: var(--bank-bg, #eef6fd);
    color: var(--bank-text, #1f4168);
    font-weight: 800;
}

.ruble-balance {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    min-height: 21px;
    margin: 2px 3px;
    padding: 3px 6px;
    border: 1px solid #cbeee4;
    border-radius: 6px;
    background: #ecfdf7;
    color: #00945f;
    font-style: normal;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.ruble-balance small {
    color: #64748b;
    font-size: 8px;
    font-weight: 800;
}

.updated-pill {
    display: none;
}

.ruble-total-row {
    display: grid;
    grid-template-columns: minmax(132px, 1fr) 92px 92px;
    gap: 0;
    align-items: center;
    padding: 6px 8px;
    border-top: 1px solid #dce6ef;
    background: #f8fbfd;
    color: #0f172a;
    font-weight: 700;
}

.ruble-total-row span {
    text-align: right;
}

/* Balance input */
body.balance-input-page .main {
    padding: 0;
}

.balance-input-shell {
    min-height: 100vh;
    padding: 10px;
    background: #eef3f8;
}

.balance-input-form {
    display: grid;
    gap: 10px;
}

.balance-input-toolbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 54px;
    padding: 9px 12px;
    border: 1px solid #d7e2eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(32, 43, 60, 0.08);
}

.balance-input-toolbar h2 {
    color: #0f172a;
    font-size: 16px;
    font-weight: 850;
}

.balance-input-toolbar span {
    display: block;
    margin-top: 2px;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}

.balance-input-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.balance-save-message {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid #a8dacd;
    border-radius: 8px;
    background: #ecfdf7;
    color: #006a57;
    font-size: 12px;
    font-weight: 800;
}

.balance-input-stack {
    display: grid;
    gap: 8px;
    padding: 7px;
}

.balance-input-manager,
.balance-input-company-block {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #d7e2eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(32, 43, 60, 0.07);
}

.balance-input-currency-panel .balance-input-manager {
    box-shadow: none;
}

.balance-input-manager > summary,
.balance-input-company-block > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}

.balance-input-manager > summary::-webkit-details-marker,
.balance-input-company-block > summary::-webkit-details-marker {
    display: none;
}

.balance-input-manager > summary {
    min-height: 32px;
    padding: 6px 10px;
    border-left: 4px solid #2f6df6;
    background: linear-gradient(180deg, #ffffff 0%, #f3f8fd 100%);
    color: #0f172a;
}

.balance-input-manager > summary strong {
    font-size: 13px;
    font-weight: 900;
}

.balance-input-manager > summary span,
.balance-input-company-block > summary span {
    color: rgba(15, 23, 42, 0.68);
    font-size: 10px;
    font-weight: 780;
}

.balance-input-company-grid {
    display: grid;
    grid-template-columns: minmax(420px, 760px);
    justify-content: start;
    gap: 7px;
    padding: 7px;
}

.balance-input-company-block {
    margin: 0;
    box-shadow: none;
}

.balance-input-company-block > summary {
    min-height: 27px;
    padding: 4px 8px;
    border-left: 4px solid #2f6df6;
    border-bottom: 1px solid #dce6ef;
    background: linear-gradient(180deg, #f8fcff 0%, #edf5fa 100%);
}

.balance-input-company-block > summary strong {
    color: #0b2f57;
    font-size: 11px;
    font-weight: 900;
}

.balance-input-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #d7e2eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(32, 43, 60, 0.07);
}

.balance-input-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 38px;
    padding: 7px 10px;
    border-bottom: 1px solid #dce6ef;
    background: #b7acd7;
    color: #0f172a;
}

.balance-input-panel-head strong {
    font-size: 14px;
    font-weight: 850;
}

.balance-input-panel-head span {
    color: rgba(15, 23, 42, 0.72);
    font-size: 11px;
    font-weight: 760;
}

.balance-input-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
}

.balance-input-table {
    width: 100%;
    min-width: 420px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 10px;
}

.balance-input-table th {
    position: static;
    height: 22px;
    padding: 0 5px;
    border-right: 1px solid #c9d6e2;
    border-bottom: 1px solid #b9c8d8;
    background: #eef5fb;
    color: #1f4168;
    font-size: 8px;
    font-weight: 850;
    text-transform: uppercase;
    white-space: nowrap;
}

.balance-input-table td {
    height: 28px;
    padding: 3px 5px;
    border-right: 1px solid #e5edf4;
    border-bottom: 1px solid #e5edf4;
    background: #ffffff;
    vertical-align: middle;
}

.balance-input-table th:nth-child(2),
.balance-input-table td:nth-child(2) {
    border-right: 0;
    background: #f8fbfd;
    box-shadow: inset -3px 0 0 #a9bfd4;
}

.balance-input-table th:nth-child(3),
.balance-input-table td:nth-child(3) {
    border-left: 3px solid #a9bfd4 !important;
}

.balance-input-ruble-table th:nth-child(1),
.balance-input-ruble-table td:nth-child(1) {
    border-right: 0;
    background: #f8fbfd;
    box-shadow: inset -3px 0 0 #a9bfd4;
}

.balance-input-ruble-table th:nth-child(2),
.balance-input-ruble-table td:nth-child(2) {
    border-left: 3px solid #a9bfd4 !important;
}

.balance-input-index-col { width: 28px; }
.balance-input-company-col { width: 132px; }
.balance-input-bank-col { width: 86px; }
.balance-input-money-col { width: 74px; }

.balance-row-index {
    color: #0f172a;
    font-size: 10px;
    font-weight: 850;
    text-align: center;
}

.balance-input-company {
    display: grid;
    gap: 2px;
}

.balance-input-company strong {
    color: #0f172a;
    font-size: 10px;
    font-weight: 850;
    line-height: 1.15;
}

.balance-input-company small {
    color: #77869a;
    font-size: 8px;
    font-weight: 650;
    line-height: 1.15;
}

.balance-input-company small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.balance-edit-cell {
    text-align: right;
}

.balance-edit-cell input {
    height: 22px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #0f172a;
    font-size: 10px;
    font-weight: 650;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.balance-edit-cell input:hover,
.balance-edit-cell input:focus {
    border-color: #83c5b5;
    background: #ffffff;
}

.balance-calculated-value {
    display: block;
    height: 22px;
    padding: 3px 6px 0;
    border: 1px solid #dbe5ef;
    border-radius: 6px;
    background: #f7fafc;
    color: #475569;
    font-size: 10px;
    font-weight: 650;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.balance-input-table tbody tr:hover td {
    background: #edf7ff !important;
}

.balance-input-table tbody tr:hover input {
    background: rgba(255, 255, 255, 0.72);
}

.balance-input-page .russian-bank-sber {
    --bank-bg: #ecfdf7;
    --bank-text: #00876c;
    --bank-border: #bbf7df;
}

.balance-input-page .russian-bank-vtb {
    --bank-bg: #eaf3ff;
    --bank-text: #1d4ed8;
    --bank-border: #bfdbfe;
}

.balance-input-page .russian-bank-other {
    --bank-bg: #f8fafc;
    --bank-text: #475569;
    --bank-border: #cbd5e1;
}

.currency-head-rub {
    background: #e9edf2 !important;
    color: #334155 !important;
}

.currency-col-rub {
    background: #f3f5f7 !important;
}

.balance-input-ruble-panel {
    max-width: none;
}

.balance-input-ruble-grid {
    grid-template-columns: minmax(300px, 560px);
}

.balance-input-ruble-table {
    min-width: 300px;
}

.balance-input-company-row td {
    height: 27px;
    padding-left: 10px;
    border-top: 2px solid #b8c9dc;
    background: linear-gradient(180deg, #f8fcff 0%, #edf5fa 100%);
    color: #0b2f57;
    font-size: 10px;
    font-weight: 900;
}

/* User administration */
.admin-users-page .main {
    background: #eef3f8;
}

.admin-users-shell {
    display: grid;
    gap: 14px;
}

.admin-users-toolbar {
    display: grid;
    gap: 10px;
}

.admin-users-search {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid #d7e2eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(32, 43, 60, 0.07);
}

.admin-users-search input {
    flex: 1 1 320px;
    min-height: 38px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    padding: 8px 11px;
    font: inherit;
}

.admin-users-messages {
    margin-top: 0;
}

.admin-users-layout {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(360px, 520px);
    gap: 14px;
    align-items: start;
}

.admin-users-list-panel,
.admin-user-form {
    padding: 0;
    overflow: hidden;
}

.admin-users-list-head,
.admin-user-row {
    display: grid;
    grid-template-columns: minmax(160px, 1.1fr) minmax(150px, 1fr) 92px 96px;
    gap: 10px;
    align-items: center;
}

.admin-users-list-head {
    min-height: 34px;
    padding: 0 12px;
    border-bottom: 1px solid #d7e2eb;
    background: #edf5fb;
    color: #1f4168;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-users-list {
    display: grid;
}

.admin-user-row {
    min-height: 58px;
    padding: 9px 12px;
    border-bottom: 1px solid #e7edf3;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
}

.admin-user-row:hover,
.admin-user-row.is-active {
    background: #edf7ff;
}

.admin-user-row.is-active {
    box-shadow: inset 4px 0 0 #2f6df6;
}

.admin-user-row strong,
.admin-user-row em {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-row strong {
    color: #0f172a;
    font-size: 13px;
    font-weight: 850;
}

.admin-user-row em {
    margin-top: 2px;
    color: #64748b;
    font-style: normal;
}

.user-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 0 8px;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 10px;
    font-weight: 850;
}

.user-status-pill.is-active {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.admin-users-empty {
    padding: 18px;
    color: #64748b;
    font-weight: 700;
}

.admin-user-form {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.admin-user-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-user-form-head span,
.admin-user-role-block > span,
.admin-user-password-block > div span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-user-form-head strong {
    display: block;
    margin-top: 3px;
    color: #0f172a;
    font-size: 20px;
    font-weight: 900;
}

.admin-user-form-grid,
.admin-user-password-block {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-user-form input[type="text"],
.admin-user-form input[type="email"],
.admin-user-form input[type="password"] {
    min-height: 38px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
}

.admin-user-role-block {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #f8fbfd;
}

.admin-user-role-block > div {
    display: grid;
    gap: 7px;
}

.admin-user-role-block label,
.admin-user-active-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-weight: 750;
}

.admin-user-role-block input,
.admin-user-active-toggle input {
    width: 16px;
    height: 16px;
    accent-color: #00876c;
}

.admin-user-password-block {
    align-items: start;
    padding: 12px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
}

.admin-user-password-block > div {
    grid-column: 1 / -1;
}

.admin-user-password-block em {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.admin-user-active-toggle small,
.admin-user-role-block small {
    color: #b42318;
}

@media (max-width: 1280px) {
    .treasury-toolbar {
        grid-template-columns: 1fr;
    }

    .treasury-tabs,
    .treasury-actions {
        justify-self: start;
    }

    .queue-control-row,
    .request-head,
    .request-row {
        grid-template-columns: 1fr;
    }

    .queue-collapse-actions {
        flex-wrap: wrap;
    }

    .queue-filterbar {
        flex-wrap: wrap;
    }

    .balance-toolbar,
    .balance-layout {
        grid-template-columns: 1fr;
    }

    .balance-editor {
        position: static;
    }

    .balance-board {
        grid-template-columns: minmax(0, 1fr);
    }

    .balance-table {
        min-width: 1236px;
    }

    .admin-users-layout {
        grid-template-columns: 1fr;
    }

    .admin-users-list-head,
    .admin-user-row {
        grid-template-columns: minmax(150px, 1fr) minmax(140px, 1fr) 84px 90px;
    }

    .ruble-company-row,
    .ruble-total-row {
        grid-template-columns: 1fr;
    }
}
    font-size: 12px;
