.finance-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: -8px -4px 0;
    padding: 0 0 34px;
    color: #102648;
}

.finance-page-header h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: 0;
    color: #102648;
}

.finance-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding-bottom: 0;
    border-bottom: 1px solid #cfdcf0;
}

.finance-tab {
    border: none;
    background: transparent;
    min-height: 38px;
    padding: 0 0 12px;
    color: #667a9e;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    border-radius: 0;
}

.finance-tab.active {
    color: #1f6eff;
    border-bottom-color: #2d72f7;
    background: transparent;
}

.finance-tab:hover {
    color: #1f6eff;
    background: transparent;
}

.finance-workspace {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.finance-cashboxes {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.finance-cashboxes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.finance-cashbox-item {
    position: relative;
}

.finance-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--finance-icon-color, #2d72f7), #2563eb);
    color: #fff;
    box-shadow: 0 10px 22px rgba(45, 114, 247, 0.18);
}

.finance-icon-badge svg {
    width: 20px;
    height: 20px;
}

.finance-cashbox-card,
.finance-add-cashbox-btn,
.finance-filter-btn,
.finance-green-btn,
.finance-red-btn,
.finance-ghost-btn {
    border-radius: 9px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.finance-cashbox-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 66px;
    padding: 14px 16px;
    border: 1px solid rgba(207, 220, 240, 0.95);
    background: rgba(255, 255, 255, 0.84);
    color: #102648;
    text-align: left;
    box-shadow: 0 12px 28px rgba(30, 64, 115, 0.07);
}

.finance-cashbox-visual {
    position: absolute;
    left: 18px;
    top: 50%;
    bottom: auto;
    width: 32px;
    height: 32px;
    transform: translateY(-50%);
    z-index: 2;
}

.finance-cashbox-visual svg {
    width: 17px;
    height: 17px;
}

.finance-cashbox-card.active {
    border-color: #2d72f7;
    box-shadow: 0 0 0 1px rgba(45, 114, 247, 0.42), 0 16px 34px rgba(30, 100, 230, 0.10);
}

.finance-cashbox-name {
    font-weight: 800;
    padding-left: 50px;
}

.finance-cashbox-balance {
    margin-left: auto;
    color: #102648;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.finance-cashbox-menu-trigger {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: #72839c;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, background 0.16s ease;
}

.finance-cashbox-item:hover .finance-cashbox-menu-trigger,
.finance-cashbox-menu-trigger.active {
    opacity: 1;
    pointer-events: auto;
}

.finance-cashbox-menu-trigger:hover {
    background: #eef5ff;
    color: #2d72f7;
}

.finance-cashbox-menu {
    position: absolute;
    top: 38px;
    right: 10px;
    display: none;
    min-width: 168px;
    padding: 8px 0;
    border: 1px solid #d7e0ed;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
    z-index: 5;
}

.finance-cashbox-menu.show {
    display: block;
}

.finance-cashbox-menu-item {
    display: block;
    width: 100%;
    padding: 9px 14px;
    border: none;
    background: transparent;
    color: #304155;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.finance-cashbox-menu-item:hover {
    background: #f5f8fd;
}

.finance-cashbox-menu-item-settings {
    border-top: 1px solid #edf1f7;
    margin-top: 4px;
    padding-top: 11px;
}

.finance-empty-card {
    padding: 20px 16px;
    border: 1px dashed #d7e0ed;
    border-radius: 10px;
    color: #60708a;
    background: #fff;
}

.finance-add-cashbox-btn {
    height: 54px;
    border: 1px solid rgba(207, 220, 240, 0.95);
    background: rgba(255, 255, 255, 0.84);
    color: #1f6eff;
    box-shadow: 0 12px 28px rgba(30, 64, 115, 0.07);
}

.finance-panel {
    min-height: 480px;
    padding: 24px 22px 20px;
    border: 1px solid rgba(207, 220, 240, 0.95);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 16px 42px rgba(30, 64, 115, 0.08);
}

.finance-panel-head h2 {
    margin: 0;
    font-size: 21px;
    line-height: 1.18;
    font-weight: 800;
    color: #102648;
}

.finance-panel-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
}

.finance-green-btn,
.finance-red-btn,
.finance-ghost-btn,
.finance-filter-btn {
    height: 48px;
    min-width: 100px;
    padding: 0 18px;
    border: 1px solid #cbd8ea;
    background: #fff;
    color: #102648;
    box-shadow: 0 8px 20px rgba(30, 64, 115, 0.06);
}

.finance-green-btn {
    background: linear-gradient(180deg, #22bd5e 0%, #159947 100%);
    border-color: #16a34a;
    color: #fff;
}

.finance-red-btn {
    background: linear-gradient(180deg, #ef4050 0%, #d92f3f 100%);
    border-color: #dc3545;
    color: #fff;
}

.finance-green-btn:hover {
    background: linear-gradient(180deg, #1fb356 0%, #128c40 100%);
}

.finance-red-btn:hover {
    background: linear-gradient(180deg, #e63b4a 0%, #c92837 100%);
}

.finance-ghost-btn:hover,
.finance-filter-btn:hover {
    background: #f8fbff;
    color: #1f6eff;
}

.finance-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 22px 0 24px;
}

.finance-period-filter {
    position: relative;
}

.finance-filter-btn.active {
    border-color: #2d72f7;
    box-shadow: 0 0 0 1px rgba(45, 114, 247, 0.12);
}

.finance-period-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    display: none;
    width: 276px;
    padding: 8px 0;
    border: 1px solid #dce4f2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.finance-period-dropdown.show {
    display: block;
}

.finance-period-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: #334155;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.finance-period-option:hover {
    background: #f5f8ff;
}

.finance-period-option.active {
    background: #edf3ff;
    color: #1f5fd6;
}

.finance-period-option-divider {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid #edf1f7;
}

.finance-status {
    min-height: 20px;
    margin-bottom: 10px;
    color: #60708a;
    font-size: 13px;
}

.finance-status.is-error {
    color: #c13e4d;
}

.finance-table-wrap {
    overflow: auto;
    min-height: 238px;
    border: 1px solid #d8e2f0;
    border-radius: 11px;
    background: #fff;
}

.finance-table {
    width: 100%;
    min-width: 760px;
}

.finance-table-grid {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) 182px 92px 92px 92px;
}

.finance-table-head {
    background: linear-gradient(180deg, #f6f8fc 0%, #eef3fa 100%);
    border-bottom: 1px solid #d8e2f0;
}

.finance-table-head .finance-table-cell {
    min-height: 40px;
    padding: 8px 16px;
    color: #667796;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
    text-align: left;
    display: flex;
    align-items: center;
}

.finance-table-head .finance-table-cell + .finance-table-cell {
    border-left: 1px solid #d8e2f0;
}

.finance-table-row {
    border-bottom: 1px solid #edf1f7;
    align-items: center;
}

.finance-table-cell {
    padding: 7px 10px;
    color: #1d2c42;
    font-size: 13px;
    line-height: 1;
    min-width: 0;
}

.finance-table-cell-money-head {
    justify-content: center;
    text-align: center;
}

.finance-table-cell-money {
    white-space: nowrap;
    text-align: right;
}

.finance-table-row-editable {
    cursor: pointer;
}

.finance-table-row-editable:hover {
    background: #f8fbff;
}

.finance-transaction-link {
    border: none;
    padding: 0;
    background: transparent;
    color: #2d72f7;
    font-size: 15px;
    line-height: 1;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
}

.finance-transaction-link:hover {
    text-decoration: underline;
}

.finance-transaction-comment-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    align-items: flex-start;
}

.finance-transaction-created {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.finance-transaction-author {
    color: #1d2c42;
    font-size: 15px;
    line-height: 1;
    font-weight: 400;
}

.finance-transaction-date {
    color: #8b98ad;
    font-size: 14px;
    line-height: 1;
}

.finance-transaction-note {
    color: #8b98ad;
    font-size: 14px;
    line-height: 1;
}

.finance-transaction-sync {
    margin-top: 3px;
    color: #8b98ad;
    font-size: 12px;
    line-height: 1;
}

.finance-mkt-tag {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 7px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
}

.finance-transaction-sync.error {
    color: #c13e4d;
}

.finance-payment-drawer {
    width: min(520px, 100vw);
}

.finance-payment-body {
    padding: 14px 16px 18px;
}

.finance-payment-receipt {
    border-top: 4px solid #26313f;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.finance-payment-receipt-head,
.finance-payment-receipt-row,
.finance-payment-total-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 14px;
    align-items: center;
}

.finance-payment-receipt-head {
    margin: 16px 18px 0;
    padding: 10px 8px;
    background: #f0f2f5;
    color: #3f4d63;
    font-size: 13px;
}

.finance-payment-receipt-row {
    margin: 0 18px;
    padding: 10px 8px;
    border-bottom: 1px solid #edf1f7;
    color: #1d2c42;
    font-size: 14px;
}

.finance-payment-receipt-row strong,
.finance-payment-receipt-head span:last-child {
    text-align: right;
}

.finance-payment-order-link,
.finance-payment-detail-link {
    border: none;
    padding: 0;
    background: transparent;
    color: #2563eb;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.finance-payment-order-link:hover,
.finance-payment-detail-link:hover {
    text-decoration: underline;
}

.finance-payment-note {
    margin-top: 3px;
    color: #60708a;
    font-size: 13px;
}

.finance-payment-total-row {
    margin: 0 18px;
    padding: 12px 8px 28px;
    color: #334155;
    font-size: 13px;
}

.finance-payment-total-row strong {
    justify-self: end;
    min-width: 110px;
    padding: 9px 10px;
    border: 1px solid #19a85a;
    border-radius: 4px;
    text-align: right;
}

.finance-payment-details {
    display: grid;
    gap: 12px;
    margin: 18px 0 0;
    color: #344054;
    font-size: 14px;
}

.finance-payment-details div {
    display: flex;
    gap: 8px;
    min-width: 0;
}

.finance-payment-details dt {
    color: #2f3b4d;
    font-weight: 600;
}

.finance-payment-details dd {
    margin: 0;
    min-width: 0;
}

.finance-payment-delete-btn {
    min-width: 104px;
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: 3px;
    background: #ef2f2f;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.finance-income-cell {
    color: #13824b;
}

.finance-expense-cell {
    color: #c13e4d;
}

.finance-empty-cell {
    text-align: center;
    color: #60708a;
    padding: 18px 14px;
}

.finance-transactions-empty {
    min-height: 196px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #667796;
    font-size: 16px;
}

.finance-empty-icon {
    width: 66px;
    height: 66px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #edf3fb;
    color: #7c91b3;
}

.finance-empty-icon svg {
    width: 35px;
    height: 35px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.finance-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 48px 24px;
    border: 1px solid #d7e0ed;
    border-radius: 16px;
    background: #fff;
    text-align: center;
}

.finance-placeholder h2 {
    margin: 0;
    font-size: 20px;
}

.finance-placeholder p {
    margin: 0;
    max-width: 560px;
    color: #60708a;
    line-height: 1.6;
}

.finance-placeholder-icon {
    font-size: 34px;
}

.finance-salary-section {
    padding: 20px 24px;
    flex: 1;
}

.finance-salary-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

/* Month picker */
.pmp-wrap {
    position: relative;
}

.pmp-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #1e293b;
    white-space: nowrap;
}

.pmp-trigger:hover {
    border-color: #2f80ed;
    color: #2f80ed;
}

.pmp-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 2000;
    display: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 12px;
    width: 216px;
}

.pmp-dropdown.show {
    display: block;
}

.pmp-year-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pmp-year-btn {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 4px;
}

.pmp-year-btn:hover { background: #f1f5f9; color: #1e293b; }

.pmp-year-label {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.pmp-months-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.pmp-month {
    padding: 7px 4px;
    border: none;
    border-radius: 6px;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    text-align: center;
}

.pmp-month:hover { background: #f1f5f9; }

.pmp-month--active {
    background: #2f80ed;
    color: #fff;
    font-weight: 600;
}

.pmp-month--active:hover { background: #1a6fd4; }

.finance-payroll {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.finance-payroll-subtabs {
    display: flex;
    gap: 28px;
    border-bottom: 0;
}

.finance-payroll-subtab {
    min-height: 42px;
    padding: 0 0 12px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #102648;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    border-radius: 0;
}

.finance-payroll-subtab.active {
    color: #1f6eff;
    border-bottom-color: #2d72f7;
    background: transparent;
}

.finance-payroll-subtab:hover {
    color: #1f6eff;
    background: transparent;
}

.finance-payroll-toolbar {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 18px;
    padding: 22px;
    border: 1px solid rgba(207, 220, 240, 0.95);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 34px rgba(30, 64, 115, 0.08);
}

.finance-payroll-period-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.finance-payroll-mode-switch {
    display: inline-flex;
    align-items: stretch;
}

.finance-payroll-mode-btn {
    height: 42px;
    min-width: 78px;
    padding: 0 16px;
    border: 1px solid #cfd7e4;
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
    color: #102648;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.finance-payroll-mode-btn + .finance-payroll-mode-btn {
    margin-left: -1px;
}

.finance-payroll-mode-btn:first-child {
    border-radius: 6px 0 0 6px;
}

.finance-payroll-mode-btn:last-child {
    border-radius: 0 6px 6px 0;
}

.finance-payroll-mode-btn.active {
    position: relative;
    z-index: 1;
    border-color: #2d72f7;
    background: #fff;
    color: #2d72f7;
}

.finance-payroll-period-control {
    display: flex;
    align-items: end;
    gap: 14px;
}

.finance-payroll-toolbar > .finance-payroll-period-group ~ .finance-payroll-field:not(.finance-payroll-employee-field) {
    display: none;
}

.finance-payroll-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #102648;
    font-size: 13px;
    font-weight: 800;
}

.finance-payroll-field input,
.finance-payroll-field select {
    height: 48px;
    min-width: 210px;
    padding: 0 16px;
    border: 1px solid #cfd7e4;
    border-radius: 8px;
    background: #fff;
    color: #102648;
    font: inherit;
    font-weight: 600;
}

.finance-payroll-employee-field select {
    min-width: 260px;
}

.finance-payroll-employee-filter {
    position: relative;
}

.finance-payroll-employee-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 260px;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #cfd7e4;
    border-radius: 8px;
    background: #fff;
    color: #1d2c42;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.finance-payroll-employee-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 2100;
    display: none;
    width: min(320px, calc(100vw - 32px));
    max-height: 300px;
    overflow: auto;
    padding: 8px;
    border: 1px solid #dce4f2;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.finance-payroll-employee-panel.show {
    display: grid;
    gap: 4px;
}

.finance-payroll-employee-clear,
.finance-payroll-employee-check {
    min-height: 34px;
    padding: 7px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #334155;
    font-size: 14px;
    text-align: left;
}

.finance-payroll-employee-clear {
    cursor: pointer;
}

.finance-payroll-employee-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.finance-payroll-employee-clear:hover,
.finance-payroll-employee-check:hover {
    background: #f5f8ff;
}

.finance-payroll-employee-check input {
    width: 15px;
    height: 15px;
    accent-color: #2d72f7;
}

.finance-payroll-status {
    display: none;
    min-height: 20px;
    color: #60708a;
    font-size: 13px;
}

.finance-payroll-status.is-error {
    display: block;
    color: #c13e4d;
}

.finance-payroll-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(118px, 1fr));
    gap: 14px;
}

.finance-payroll-summary-item {
    position: relative;
    display: grid;
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 6px 12px;
    min-height: 88px;
    padding: 18px 16px;
    border: 1px solid rgba(207, 220, 240, 0.95);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 28px rgba(30, 64, 115, 0.07);
}

.finance-payroll-summary-item span {
    color: #102648;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.finance-payroll-summary-item::before {
    content: "";
    grid-row: 1 / 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #eaf5ee;
    box-shadow: inset 0 0 0 12px #eaf5ee;
}

.finance-payroll-summary-item:nth-child(1)::before,
.finance-payroll-summary-item:nth-child(6)::before {
    background: #e8f8ef;
}

.finance-payroll-summary-item:nth-child(2)::before,
.finance-payroll-summary-item:nth-child(4)::before {
    background: #edf4ff;
}

.finance-payroll-summary-item:nth-child(3)::before {
    background: #fff3e2;
}

.finance-payroll-summary-item:nth-child(5)::before {
    background: #f3edff;
}

.finance-payroll-summary-item::after {
    content: "";
    position: absolute;
    left: 28px;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    background: #1f6eff;
    -webkit-mask: var(--payroll-summary-icon) center / contain no-repeat;
    mask: var(--payroll-summary-icon) center / contain no-repeat;
}

.finance-payroll-summary-item:nth-child(1) {
    --payroll-summary-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 8h14v11H5z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M8 8V5h8v3M8 13h8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.finance-payroll-summary-item:nth-child(2) {
    --payroll-summary-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='8' r='3' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M6 20a6 6 0 0 1 12 0' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.finance-payroll-summary-item:nth-child(3) {
    --payroll-summary-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='6' y='5' width='12' height='15' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M9 9h6M9 13h6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    --payroll-summary-color: #f08a0c;
}

.finance-payroll-summary-item:nth-child(4) {
    --payroll-summary-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m5 15 4-4 3 3 7-7M14 7h5v5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.finance-payroll-summary-item:nth-child(5) {
    --payroll-summary-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 3 8 4-8 4-8-4 8-4Z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M4 7v10l8 4 8-4V7' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
    --payroll-summary-color: #7c3aed;
}

.finance-payroll-summary-item:nth-child(6) {
    --payroll-summary-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 19V9M12 19V5M19 19v-7M3 19h18' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    --payroll-summary-color: #18a957;
}

.finance-payroll-summary-item::after {
    background: var(--payroll-summary-color, #1f6eff);
}

.finance-payroll-summary-item strong {
    color: #020817;
    font-size: 22px;
    line-height: 1.1;
    font-weight: 800;
}

.finance-payroll-recommendations {
    position: relative;
    display: grid;
    gap: 8px;
    padding: 18px 22px 18px 58px;
    border: 1px solid #bcd8ff;
    border-radius: 10px;
    background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
    color: #102648;
    font-size: 14px;
    line-height: 1.45;
}

.finance-payroll-recommendations::before {
    content: "i";
    position: absolute;
    left: 24px;
    top: 19px;
    width: 20px;
    height: 20px;
    border: 2px solid #1f6eff;
    border-radius: 50%;
    color: #1f6eff;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
}

.finance-payroll-table-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 310px;
    border: 1px solid rgba(207, 220, 240, 0.95);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.finance-payroll-table-wrap > .finance-empty-cell {
    min-height: 310px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #52698d;
    font-size: 17px;
    font-weight: 800;
}

.finance-payroll-table-wrap > .finance-empty-cell::before {
    content: "";
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background:
        linear-gradient(#7c91b3, #7c91b3) center 26px / 31px 3px no-repeat,
        linear-gradient(#7c91b3, #7c91b3) center 37px / 31px 3px no-repeat,
        linear-gradient(#7c91b3, #7c91b3) center 48px / 31px 3px no-repeat,
        #edf3fb;
    opacity: 0.95;
}

.finance-payroll-employee {
    border: 1px solid #dce4f0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.finance-payroll-employee-head {
    display: grid;
    grid-template-columns: 24px minmax(180px, 1fr) 120px 150px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    border: none;
    background: #fff;
    color: #1d2c42;
    text-align: left;
    cursor: pointer;
}

.finance-payroll-employee-head:hover {
    background: #f8fbff;
}

.finance-payroll-employee-head strong {
    text-align: right;
}

.finance-payroll-caret,
.finance-payroll-muted,
.finance-payroll-rule-lines,
.finance-payroll-employee-metrics {
    color: #60708a;
}

.finance-payroll-employee-name {
    font-weight: 700;
}

.finance-payroll-employee-body {
    border-top: 1px solid #edf1f7;
}

.finance-payroll-employee-body[hidden] {
    display: none !important;
}

.finance-payroll-employee-metrics {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 14px;
    background: #fbfcfe;
    font-size: 13px;
}

.finance-payroll-pay-btn {
    height: 32px;
    margin-left: auto;
    padding: 0 14px;
    border: 1px solid #17a34a;
    border-radius: 5px;
    background: #17a34a;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.finance-payroll-period-lines {
    display: grid;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid #edf1f7;
}

.finance-payroll-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px 130px;
    gap: 10px;
    align-items: center;
    color: #334155;
    font-size: 13px;
}

.finance-payroll-line strong {
    text-align: right;
}

.finance-payroll-orders {
    min-width: 840px;
}

.finance-payroll-orders-head,
.finance-payroll-order {
    display: grid;
    grid-template-columns: 170px minmax(180px, 1fr) 220px 170px;
    gap: 12px;
    align-items: start;
}

.finance-payroll-orders-head {
    padding: 8px 14px;
    background: #f2f4f8;
    color: #566781;
    font-size: 13px;
    font-weight: 600;
}

.finance-payroll-order {
    padding: 10px 14px;
    border-top: 1px solid #edf1f7;
    color: #1d2c42;
    font-size: 14px;
}

.finance-payroll-order strong {
    display: block;
    margin-bottom: 4px;
    text-align: right;
}

.finance-payroll-rule-lines {
    display: grid;
    gap: 3px;
    font-size: 12px;
    text-align: right;
}

.finance-payroll-muted {
    margin-top: 3px;
    font-size: 12px;
}

.finance-payroll-history-wrap {
    overflow: auto;
    border: 1px solid #dce4f0;
    border-radius: 8px;
    background: #fff;
}

.finance-payroll-history-table {
    min-width: 920px;
}

.finance-payroll-history-head,
.finance-payroll-history-row {
    display: grid;
    grid-template-columns: 130px 210px minmax(180px, 1fr) 170px 80px 140px 110px;
    gap: 12px;
    align-items: center;
}

.finance-payroll-history-head {
    padding: 9px 14px;
    background: #f2f4f8;
    color: #566781;
    font-size: 13px;
    font-weight: 600;
}

.finance-payroll-history-row {
    min-height: 48px;
    padding: 8px 14px;
    border-top: 1px solid #edf1f7;
    color: #1d2c42;
    font-size: 14px;
    cursor: pointer;
}

.finance-payroll-history-row:hover {
    background: #f8fbff;
}

.finance-payroll-history-row strong {
    text-align: right;
}

.finance-payroll-payment-form,
.finance-payroll-payment-details {
    display: grid;
    gap: 12px;
}

.finance-payroll-payment-details .finance-payroll-orders {
    max-width: 100%;
    overflow: auto;
}

.finance-account-drawer-root {
    position: fixed;
    inset: 0;
    z-index: 3000;
    pointer-events: none;
}

.finance-account-drawer-root.show {
    pointer-events: auto;
}

.finance-account-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
}

.finance-account-drawer {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    width: min(448px, 100vw);
    height: 100%;
    background: #fff;
    box-shadow: -18px 0 40px rgba(15, 23, 42, 0.18);
}

.finance-account-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    padding: 0 18px;
    border-bottom: 1px solid #e4e9f1;
}

.finance-account-head h2 {
    margin: 0;
    color: #3f4d63;
    font-size: 18px;
    font-weight: 500;
}

.finance-account-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #9aa5b5;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.finance-account-tabs {
    display: flex;
    gap: 18px;
    padding: 12px 18px 0;
    border-bottom: 1px solid #edf1f7;
}

.finance-account-tab {
    height: 36px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #51627a;
    font-size: 14px;
    cursor: pointer;
}

.finance-account-tab.active {
    color: #2d72f7;
    border-bottom-color: #2d72f7;
}

.finance-account-body {
    flex: 1;
    overflow: auto;
    padding: 18px;
}

.finance-account-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.finance-account-panel[hidden] {
    display: none !important;
}

.finance-account-access-note {
    color: #5d6c82;
    font-size: 13px;
}

.finance-account-icon-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.finance-account-icon {
    width: 52px;
    height: 52px;
}

.finance-account-icon svg {
    width: 28px;
    height: 28px;
}

.finance-account-icon-btn {
    height: 34px;
    padding: 0 14px;
    border: 1px solid #cfd7e4;
    border-radius: 4px;
    background: #fff;
    color: #3f4d63;
    font-size: 13px;
    cursor: pointer;
}

.finance-account-field,
.finance-account-fieldset {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.finance-account-field span,
.finance-account-label,
.finance-account-section-title,
.finance-account-actions-title {
    color: #3f4d63;
    font-size: 13px;
    font-weight: 600;
}

.finance-account-field b {
    color: #e23c46;
}

.finance-account-field input {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #cfd7e4;
    outline: none;
    font: inherit;
}

.finance-account-field input:focus {
    border-color: #2d72f7;
    box-shadow: 0 0 0 3px rgba(45, 114, 247, 0.12);
}

.finance-account-field .finance-transaction-select,
.finance-account-field .finance-transaction-textarea {
    border: 1px solid #cfd7e4;
    outline: none;
    font: inherit;
    color: #1d2c42;
    background: #fff;
}

.finance-account-field .finance-transaction-select {
    height: 36px;
    padding: 0 10px;
}

.finance-account-field .finance-transaction-textarea {
    min-height: 110px;
    padding: 10px;
    resize: vertical;
}

.finance-account-field .finance-transaction-select:focus,
.finance-account-field .finance-transaction-textarea:focus {
    border-color: #2d72f7;
    box-shadow: 0 0 0 3px rgba(45, 114, 247, 0.12);
}

.finance-account-segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.finance-account-segment {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid #cfd7e4;
    background: #fff;
    color: #3f4d63;
    font-size: 13px;
    cursor: pointer;
}

.finance-account-segment + .finance-account-segment {
    margin-left: -1px;
}

.finance-account-segment:first-child {
    border-radius: 4px 0 0 4px;
}

.finance-account-segment:last-child {
    border-radius: 0 4px 4px 0;
}

.finance-account-segment.active {
    position: relative;
    z-index: 1;
    border-color: #2d72f7;
    background: #eef5ff;
    color: #2d72f7;
}

.finance-account-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4b5b73;
    font-size: 14px;
}

.finance-account-check input {
    width: 16px;
    height: 16px;
    accent-color: #2d72f7;
}

.finance-fee-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: -6px;
    padding-left: 26px;
}

.finance-fee-settings[hidden] {
    display: none !important;
}

.finance-fee-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.finance-fee-segmented,
.finance-fee-unit-switch {
    display: inline-flex;
    align-items: stretch;
}

.finance-fee-segment,
.finance-fee-unit-btn {
    height: 34px;
    padding: 0 16px;
    border: 1px solid #cfd7e4;
    background: #fff;
    color: #33465f;
    font-size: 14px;
    cursor: pointer;
}

.finance-fee-segment + .finance-fee-segment,
.finance-fee-unit-btn + .finance-fee-unit-btn {
    margin-left: -1px;
}

.finance-fee-segment:first-child,
.finance-fee-unit-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.finance-fee-segment:last-child,
.finance-fee-unit-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.finance-fee-segment.active,
.finance-fee-unit-btn.active {
    position: relative;
    z-index: 1;
    border-color: #2d72f7;
    background: #eef5ff;
    color: #2d72f7;
}

.finance-fee-value-wrap {
    display: inline-flex;
    align-items: stretch;
}

.finance-fee-value-input {
    width: 110px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #cfd7e4;
    border-right: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    font: inherit;
}

.finance-fee-value-input:focus {
    border-color: #2d72f7;
    box-shadow: 0 0 0 3px rgba(45, 114, 247, 0.12);
    position: relative;
    z-index: 1;
}

.finance-fee-link {
    align-self: flex-start;
    border: none;
    background: transparent;
    padding: 0;
    color: #2563eb;
    font-size: 14px;
    cursor: pointer;
}

.finance-account-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.finance-account-actions-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.finance-account-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 16px;
    border-top: 1px solid #dfe7f3;
    background: #eef4fd;
}

.finance-account-footer-left,
.finance-account-footer-right {
    display: flex;
    align-items: center;
}

.finance-account-submit {
    height: 36px;
    padding: 0 18px;
    border: none;
    border-radius: 3px;
    background: #1f7ae0;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.finance-account-delete {
    height: 36px;
    padding: 0 16px;
    border: 1px solid #f0c9cf;
    border-radius: 3px;
    background: #fff;
    color: #c13e4d;
    font-size: 13px;
    cursor: pointer;
}

.finance-access-table {
    border-top: 1px solid #edf1f7;
    border-bottom: 1px solid #edf1f7;
}

.finance-access-table-head,
.finance-access-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) minmax(160px, 240px);
    align-items: center;
    gap: 0;
}

.finance-access-table-head {
    min-height: 36px;
    background: #f2f4f7;
    color: #4c5d75;
    font-size: 13px;
    font-weight: 600;
}

.finance-access-row {
    min-height: 42px;
    border-top: 1px solid #edf1f7;
    color: #33465f;
    font-size: 14px;
}

.finance-access-table-check,
.finance-access-table-employee,
.finance-access-table-permission {
    padding: 0 8px;
}

.finance-access-table-check input {
    width: 15px;
    height: 15px;
    accent-color: #2d72f7;
}

.finance-access-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #5b6b80;
    font-size: 13px;
}

.finance-access-badge.allowed {
    color: #15803d;
}

.finance-access-badge.blocked {
    color: #8a95a5;
}

.finance-access-empty {
    padding: 14px 8px;
    color: #6a7a91;
    font-size: 13px;
}

.finance-icon-picker-root {
    position: fixed;
    inset: 0;
    z-index: 3200;
}

.finance-icon-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.34);
}

.finance-icon-picker-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(420px, calc(100vw - 24px));
    transform: translate(-50%, -50%);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.22);
}

.finance-icon-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #edf1f7;
}

.finance-icon-picker-head h3 {
    margin: 0;
    color: #3f4d63;
    font-size: 18px;
    font-weight: 500;
}

.finance-icon-picker-close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #8a95a5;
    font-size: 26px;
    cursor: pointer;
}

.finance-icon-picker-body {
    padding: 16px 18px 8px;
}

.finance-icon-picker-colors {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.finance-icon-color-swatch {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--finance-icon-color, #2d72f7);
    cursor: pointer;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.92);
}

.finance-icon-color-swatch.active {
    box-shadow: 0 0 0 2px #2d72f7, inset 0 0 0 2px rgba(255,255,255,0.92);
}

.finance-icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.finance-icon-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.finance-icon-choice-badge {
    width: 48px;
    height: 48px;
}

.finance-icon-choice.active .finance-icon-choice-badge {
    box-shadow: 0 0 0 2px #d7e6ff, 0 0 0 4px #2d72f7;
}

.finance-icon-picker-footer {
    display: flex;
    align-items: center;
    min-height: 60px;
    padding: 0 18px 16px;
}

.finance-icon-picker-save {
    height: 36px;
    padding: 0 18px;
    border: none;
    border-radius: 3px;
    background: #1f7ae0;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

@media (max-width: 1040px) {
    .finance-workspace {
        grid-template-columns: 1fr;
    }

    .finance-payroll-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .finance-page {
        padding: 18px 14px 24px;
    }

    .finance-panel-actions-row,
    .finance-filters-row {
        flex-wrap: wrap;
    }

    .finance-account-actions-grid {
        grid-template-columns: 1fr;
    }

    .finance-payroll-summary {
        grid-template-columns: 1fr 1fr;
    }

    .finance-payroll-table-wrap {
        overflow-x: auto;
    }

    .finance-payroll-employee-head {
        grid-template-columns: 20px minmax(150px, 1fr) 90px 120px;
    }
}
