:root {
    --nav-h: 72px;
    --brand: #2563eb;
    --brand-light: #dbeafe;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --touch: 48px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body.has-bottom-nav {
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

/* ===== BOTTOM NAV — always visible ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1020;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--card);
    border-top: 1px solid #cbd5e1;
    display: flex;
    align-items: stretch;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.bottom-nav a {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    padding: 6px 1px;
    position: relative;
    transition: color 0.15s;
}

.bottom-nav a > span:last-child {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bottom-nav a .nav-icon {
    font-size: 20px;
    line-height: 1;
}

.bottom-nav a.active {
    color: var(--brand);
}

.bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--brand);
    border-radius: 0 0 3px 3px;
}

.bottom-nav a:active {
    background: var(--brand-light);
}

/* ===== SCROLL NAV ===== */
.scroll-nav {
    position: fixed;
    right: 12px;
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 1015;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.scroll-nav__btn {
    pointer-events: auto;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--card);
    color: var(--brand);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.scroll-nav__btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-nav__btn:active {
    transform: scale(0.95);
}

.scroll-nav__btn.is-visible:active {
    transform: scale(0.95);
}

/* ===== TOP BAR ===== */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 50px;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
}

.app-topbar h1 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.books-period-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    flex-shrink: 0;
}

.books-period-btn {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 8px 10px;
    border-radius: 8px;
}

.books-period-btn.is-active {
    background: #fff;
    color: var(--brand);
}

.books-period-banner {
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 6px 10px;
}

.app-menu-btn {
    width: 40px;
    height: 40px;
    border: 0;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== MAIN ===== */
.app-main {
    padding: 12px;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== CARDS ===== */
.mobile-card {
    background: var(--card);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.stat-card {
    background: var(--card);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-card .stat-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.stat-card .stat-value { font-size: 20px; font-weight: 800; color: var(--brand); }

.page-title { font-size: 16px; font-weight: 700; margin: 0 0 10px; color: var(--muted); }

/* ===== PAGE ACTIONS ===== */
.page-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-sm-flex {
    flex: 1;
    min-height: 44px;
    font-size: 14px;
    font-weight: 700;
}

/* ===== INVESTORS PAGE ===== */
.investors-page__toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.investors-page .cp-tabs {
    display: flex;
    gap: 6px;
    overflow: visible;
}

.investors-page .cp-tab {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
    width: 100%;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
    padding: 10px 8px;
}

.investors-summary {
    margin-bottom: 12px;
}

.investors-summary .stat-value.text-success {
    color: #059669;
}

.investors-summary__locked {
    color: #b45309;
}

.investors-page__list {
    display: grid;
    gap: 8px;
}

.investors-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 12px;
    background: var(--card);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.investors-toolbar__search-icon {
    display: flex;
    color: #94a3b8;
    flex-shrink: 0;
}

.investors-toolbar__search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 6px 0;
    font-size: 15px;
    color: var(--text);
    outline: none;
}

.investors-toolbar__search-input::placeholder {
    color: #94a3b8;
}

.investors-toolbar__actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.investors-toolbar__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.investors-toolbar__icon-btn:hover,
.investors-toolbar__icon-btn:focus-visible {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--brand);
    outline: none;
}

.investors-toolbar__icon-btn--active {
    background: #eff6ff;
    border-color: #93c5fd;
    color: var(--brand);
}

.investors-toolbar__menu {
    min-width: 210px;
    padding-bottom: 6px;
}

.investors-toolbar__menu--sort {
    min-width: 240px;
}

.investors-toolbar__menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.investors-toolbar__menu-count {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 2px 7px;
    line-height: 1.3;
}

.dropdown-item.active .investors-toolbar__menu-count {
    color: #1d4ed8;
    background: #dbeafe;
}

.investor-list-card.mobile-card {
    padding: 0;
    margin-bottom: 0;
    overflow: hidden;
}

.investor-list-card__link {
    display: block;
    padding: 12px 12px 10px;
    color: inherit;
    text-decoration: none;
    transition: background 0.15s ease;
}

.investor-list-card__link:hover,
.investor-list-card__link:focus-visible {
    background: #f8fafc;
    color: inherit;
    outline: none;
}

.investor-list-card__main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.investor-list-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #047857;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    border: 1px solid #bbf7d0;
}

.investor-list-card__body {
    flex: 1;
    min-width: 0;
}

.investor-list-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 2px;
}

.investor-list-card__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.investor-list-card__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand);
    line-height: 1.3;
    word-break: break-word;
}

.investor-list-card__available {
    flex-shrink: 0;
    font-size: 15px;
    font-weight: 800;
    color: #059669;
    line-height: 1.3;
}

.investor-list-card__contact {
    display: block;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.investor-list-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.investor-list-card__tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.investor-list-card__tag--locked {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.investor-list-card__tag--success {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.investor-list-card__tag--warn {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

.investor-list-card__arrow {
    flex-shrink: 0;
    align-self: center;
    color: #cbd5e1;
    display: flex;
}

.investor-list-card__link:hover .investor-list-card__arrow,
.investor-list-card__link:focus-visible .investor-list-card__arrow {
    color: var(--brand);
}

.investor-list-card__actions {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 8px;
    padding: 0 12px 12px;
    border-top: 1px solid #f1f5f9;
}

.investor-list-card__action {
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.investor-list-card__action:hover,
.investor-list-card__action:focus-visible {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
    outline: none;
}

.investor-list-card__action--primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.investor-list-card__action--primary:hover,
.investor-list-card__action--primary:focus-visible {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.investors-empty {
    text-align: center;
    padding: 32px 20px;
}

.investors-empty--search {
    padding: 20px;
    color: #64748b;
    font-size: 14px;
}

.investors-empty__icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.investors-empty__title {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 6px;
    color: #0f172a;
}

.investors-empty__text {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 16px;
    line-height: 1.5;
}

.investor-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
}

.investor-toggle__icon {
    transition: transform 0.2s ease;
}

.investor-toggle:not(.collapsed) .investor-toggle__icon {
    transform: rotate(180deg);
}

.investor-bizcard {
    position: relative;
    overflow: hidden;
    padding: 0;
}

.investor-bizcard__accent {
    height: 3px;
    background: linear-gradient(90deg, #059669, var(--brand));
}

.investor-bizcard__body {
    padding: 10px 12px;
}

.investor-bizcard__top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.investor-bizcard__info {
    flex: 1;
    min-width: 0;
}

.investor-bizcard__avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #059669;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}

.investor-bizcard__name {
    font-size: 15px;
    font-weight: 800;
    margin: 0 0 1px;
    line-height: 1.25;
    word-break: break-word;
}

.investor-bizcard__deposit-tag {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 4px;
    font-size: 10px;
    font-weight: 600;
    transform: translateY(-1px);
}

.investor-bizcard .investor-list-card__tag {
    padding: 1px 6px;
    font-size: 10px;
    line-height: 1.3;
}

.investor-bizcard__role {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.investor-bizcard__contacts {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
}

.investor-bizcard__contact {
    font-size: 12px;
    color: #334155;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.35;
}

.investor-bizcard__icon {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    font-size: 12px;
}

.investor-bizcard__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.investor-bizcard__stat-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1px;
    letter-spacing: 0.02em;
}

.investor-bizcard__stat-value {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: var(--brand);
    line-height: 1.2;
}

.investor-bizcard__stat-hint {
    display: block;
    font-size: 9px;
    color: var(--muted);
    margin-top: 1px;
}

.investor-bizcard__stat--toggle {
    cursor: pointer;
    border-radius: 6px;
    padding: 4px 6px;
    margin: -4px -6px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.investor-bizcard__stat--toggle:hover,
.investor-bizcard__stat--toggle:focus-visible {
    background: #f1f5f9;
    outline: none;
}

.investor-bizcard__stat--toggle.is-active {
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22);
}

.investor-bizcard__top .investor-bizcard__action {
    flex-shrink: 0;
    width: auto;
    min-height: 26px;
    margin-top: 0;
    padding: 4px 8px;
    white-space: nowrap;
    font-size: 11px;
    border-radius: 8px;
}

.investor-bizcard__top-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    flex-shrink: 0;
    margin-top: 1px;
}

.investor-bizcard__action {
    min-height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.investor-bizcard__action:hover,
.investor-bizcard__action:focus-visible {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
    outline: none;
}

.investor-bizcard__action--primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.investor-bizcard__action--primary:hover,
.investor-bizcard__action--primary:focus-visible {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

@media (max-width: 575.98px) {
    .investor-bizcard__body {
        padding: 8px 10px;
    }

    .investor-bizcard__top {
        gap: 6px;
        margin-bottom: 6px;
    }

    .investor-bizcard__avatar {
        width: 36px;
        height: 36px;
        font-size: 13px;
        border-radius: 9px;
    }

    .investor-bizcard__name {
        font-size: 14px;
    }

    .investor-bizcard__stats {
        gap: 4px 6px;
        padding-top: 6px;
    }

    .investor-bizcard__stat-value {
        font-size: 13px;
    }

    .investor-bizcard__top .investor-bizcard__action {
        min-height: 24px;
        padding: 3px 7px;
        font-size: 10px;
    }
}

.investor-assigned-agents[hidden] {
    display: none !important;
}

.deposit-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.deposit-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.deposit-card--cancelled {
    opacity: 0.78;
}

.deposit-card--pre-first {
    border-left: 3px solid #94a3b8;
}

.deposit-card--totals {
    background: #f8fafc;
}

.deposit-invoices {
    margin-top: 0;
}

.acct-invoice--deposit.acct-invoice--cancelled {
    opacity: 0.82;
}

.deposit-fold-side {
    gap: 4px;
}

.deposit-fold-metric {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 100%;
    line-height: 1.25;
    white-space: nowrap;
}

.deposit-fold-metric__label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.deposit-fold-metric__value {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.deposit-fold-metric--invested .deposit-fold-metric__label {
    color: #64748b;
}

.deposit-fold-metric--commitment .deposit-fold-metric__label {
    color: #475569;
}

.deposit-fold-metric--commitment .deposit-fold-metric__value {
    color: #0f172a;
}

.deposit-fold-metric--available .deposit-fold-metric__label {
    color: #059669;
}

.deposit-fold-metric--available .deposit-fold-metric__value {
    color: #047857;
}

.deposit-fold-metric--profit .deposit-fold-metric__label {
    color: #7c3aed;
}

.deposit-fold-metric--profit .deposit-fold-metric__value {
    color: #6d28d9;
}

.deposit-fold-metric--cancelled .deposit-fold-metric__label,
.deposit-fold-metric--cancelled .deposit-fold-metric__value {
    color: #94a3b8;
    font-weight: 600;
}

.deposit-fold-meta {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    max-width: 100%;
}

.deposit-fold-meta__label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
}

.deposit-fold-meta__value {
    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;
}

.deposit-fold-meta--available .deposit-fold-meta__label {
    color: #0369a1;
}

.deposit-fold-meta--available .deposit-fold-meta__value {
    color: #0c4a6e;
}

.deposit-fold-meta--terms .deposit-fold-meta__label {
    color: #64748b;
    font-weight: 500;
}

.acct-invoice__panel .deposit-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.deposit-card__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.deposit-card__count-tag {
    flex-shrink: 0;
}

.deposit-card__meta {
    margin-top: 4px;
}

.deposit-card__agents {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.deposit-card__group-link {
    margin-top: 6px;
}

.deposit-group-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
    word-break: break-all;
}

.deposit-group-link:hover,
.deposit-group-link:focus-visible {
    text-decoration: underline;
}

.deposit-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
}

.deposit-stat {
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px;
    min-width: 0;
}

.deposit-stat--highlight {
    background: #ecfdf5;
}

.deposit-stat__label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}

.deposit-stat__value {
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

.deposit-card__toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.deposit-expand-accordion .deposit-card__toggles {
    margin-top: 0;
}

.deposit-expand-section.show,
.deposit-expand-section.collapsing {
    margin-top: 8px;
}

.deposit-details-panel .deposit-stat-grid {
    margin-top: 0;
}

.deposit-panel-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: var(--brand);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.deposit-panel-toggle::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -2px;
    transition: transform 0.15s ease, margin-top 0.15s ease;
}

.deposit-panel-toggle:not(.collapsed)::after {
    transform: rotate(225deg);
    margin-top: 2px;
}

.deposit-panel-toggle:hover,
.deposit-panel-toggle:focus-visible {
    background: #dbeafe;
    outline: none;
}

.deposit-panel-toggle:not(.collapsed) {
    background: #dbeafe;
    border-color: #93c5fd;
}

.deposit-card__actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.deposit-paid-by {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.deposit-paid-by__name {
    font-weight: 600;
    color: #0f766e;
}

.deposit-paid-by__badge {
    font-size: 9px;
    line-height: 1.2;
    padding: 2px 5px;
}

.deposit-history-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    margin-top: 8px;
}

.deposit-history-panel__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.deposit-ledger-panel {
    padding-top: 4px;
}

.deposit-ledger {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.deposit-ledger-entry {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.deposit-ledger-entry--highlight {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.deposit-ledger-entry__fold {
    border-radius: 0;
}

.deposit-ledger-entry__side {
    gap: 1px;
    max-width: 44%;
    padding-left: 8px;
}

.deposit-ledger-entry__sold {
    display: block;
    font-size: 10px;
    line-height: 1.2;
    color: #64748b;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

a.deposit-ledger-entry__order-link {
    text-decoration: none;
    cursor: pointer;
}

a.deposit-ledger-entry__order-link:hover,
a.deposit-ledger-entry__order-link:focus-visible {
    text-decoration: underline;
}

a.deposit-ledger-entry__sold.deposit-ledger-entry__order-link,
a.deposit-ledger-entry__customer.deposit-ledger-entry__order-link,
.acct-invoice__detail-value > a.deposit-ledger-entry__order-link {
    color: var(--brand);
}

a.deposit-ledger-entry__type.deposit-ledger-entry__order-link {
    color: inherit;
}

.deposit-ledger-entry__side-inline {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 2px 5px;
    max-width: 100%;
}

.deposit-ledger-entry__cost-metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    max-width: 100%;
}

.deposit-ledger-entry__cost-metrics .deposit-fold-metric__label {
    font-size: 9px;
}

.deposit-ledger-entry__cost-metrics .deposit-fold-metric__value {
    font-size: 12px;
}

.deposit-ledger-entry__side .acct-invoice__fold-amount {
    font-size: 12px;
    line-height: 1.2;
}

.deposit-ledger-entry__side .acct-invoice__fold-balance {
    font-size: 10px;
    line-height: 1.2;
}

.deposit-ledger-entry .acct-invoice__fold-top {
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
}

.deposit-ledger-entry__memo {
    flex-shrink: 0;
    min-width: 0;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
}

.deposit-ledger-entry__agent {
    font-weight: 800;
    color: #0f172a;
}

.deposit-ledger-entry__type {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.deposit-ledger-entry__type--customer-sold {
    background: #ecfdf5;
    color: #047857;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
    white-space: normal;
    max-width: 100%;
}

.deposit-ledger-entry__type--company-sold {
    background: #ecfdf5;
    color: #047857;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
    white-space: normal;
    max-width: 100%;
}

.deposit-ledger-entry__type--ready-sell {
    background: #fef3c7;
    color: #b45309;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
    white-space: normal;
}

.deposit-ledger-entry__type--distributed {
    background: #e0e7ff;
    color: #4338ca;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
    white-space: normal;
}

.deposit-ledger-entry__paid {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #15803d;
    text-align: right;
}

.deposit-ledger-entry__ready-note {
    display: block;
    font-size: 11px;
    color: #b45309;
    text-align: right;
}

.deposit-ledger-entry__sell-memo-label {
    color: #64748b;
    font-size: 11px;
    margin-right: 4px;
}

.deposit-ledger-entry__customer {
    color: #334155;
    font-weight: 600;
}

.deposit-inv-memo-highlight--customer {
    color: #4338ca;
}

.acct-invoice--exchange .deposit-ledger-entry__type {
    background: #eff6ff;
    color: #1d4ed8;
}

.deposit-ledger__amount--credit {
    color: #15803d;
}

.deposit-ledger__amount--neutral {
    color: #475569;
}

.deposit-ledger__amount--debit {
    color: #0f172a;
}

.acct-invoice__fold-balance--available {
    color: #15803d;
}

.deposit-ledger-entry__panel {
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.deposit-ledger-entry__details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deposit-ledger-entry__totals {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.acct-invoice__total-row--balance.acct-invoice__total-row--available span:last-child {
    color: #15803d;
}

.fund-balance-table--deposit-ledger {
    width: 100%;
    margin-bottom: 0;
}

.fund-balance-table--deposit-ledger th,
.fund-balance-table--deposit-ledger td {
    padding-left: 0;
    padding-right: 0;
}

.deposit-ledger__pm .fund-balance-pm {
    margin-left: 0;
    margin-right: 0;
}

.deposit-ledger__pm {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.deposit-ledger__pm-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.deposit-pm-line,
.deposit-transfer-line__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
}

.deposit-pm-line:last-child,
.deposit-transfer-line:last-child .deposit-transfer-line__meta {
    border-bottom: 0;
}

.deposit-transfer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deposit-transfer-line {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
}

.deposit-transfer-line__main {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.deposit-transfer-line__date {
    color: var(--muted);
    font-weight: 500;
}

.deposit-inv-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deposit-inv-list--compact {
    gap: 6px;
}

.deposit-inv-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
}

.deposit-inv-card--compact {
    padding: 8px 10px;
    border-radius: 8px;
}

.deposit-inv-compact__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.deposit-inv-compact__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.deposit-inv-compact__meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 11px;
    line-height: 1.35;
}

.deposit-inv-compact__line {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 8px;
    font-size: 12px;
    line-height: 1.4;
}

.deposit-inv-compact__side-inline {
    flex-shrink: 0;
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
    font-size: 11px;
    line-height: 1.35;
    flex-wrap: wrap;
    max-width: min(100%, 220px);
    text-align: right;
}

.deposit-inv-compact__side-to {
    color: #64748b;
    font-weight: 500;
}

.deposit-inv-compact__side-customer {
    font-weight: 600;
    color: #334155;
}

.deposit-inv-compact__side-label {
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}

.deposit-inv-compact__side-value {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.deposit-inv-compact__side-value--paid {
    color: #15803d;
}

.deposit-inv-compact__side-value--paid.deposit-inv-compact__side-value--zero {
    color: #94a3b8;
    font-weight: 600;
}

.deposit-inv-compact__side-value--link {
    color: var(--brand);
    text-decoration: none;
}

.deposit-inv-compact__side-value--link:hover,
.deposit-inv-compact__side-value--link:focus-visible {
    text-decoration: underline;
}

.deposit-inv-compact__date {
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}

.deposit-inv-compact__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.deposit-inv-compact__chip-label {
    color: #64748b;
    font-weight: 600;
}

.deposit-inv-compact__chip-value {
    font-weight: 700;
    color: #0f172a;
}

.deposit-inv-compact__chip--locked .deposit-inv-compact__chip-value {
    color: #b45309;
}

.deposit-inv-compact__chip--due .deposit-inv-compact__chip-value {
    color: #dc2626;
}

.deposit-inv-compact__chip--paid-by .deposit-paid-by__name {
    font-size: 11px;
}

.deposit-inv-compact__chip--paid-by .badge {
    font-size: 9px;
    line-height: 1.2;
    padding: 2px 5px;
}

.deposit-inv-compact__memo {
    font-weight: 700;
    color: #0f766e;
    flex-shrink: 0;
}

.deposit-inv-compact__product {
    font-weight: 600;
    color: #0f172a;
    min-width: 0;
}

.deposit-inv-compact__qty {
    color: #64748b;
    white-space: nowrap;
}

.deposit-inv-compact__amount {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.deposit-inv-card--highlight {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.deposit-inv-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.deposit-inv-card__product {
    margin-top: 6px;
    font-weight: 600;
}

.deposit-inv-card__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.deposit-inv-field--wide {
    grid-column: 1 / -1;
}

.deposit-inv-field__label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
}

.deposit-inv-field__value {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
    word-break: break-word;
}

.deposit-inv-memo-highlight {
    display: inline;
    padding: 1px 5px;
    border-radius: 4px;
    background: #fef3c7;
    color: #92400e;
    cursor: pointer;
}

.deposit-inv-memo-highlight:active {
    background: #fde68a;
}

.deposit-inv-sell-divider {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}

.deposit-inv-company-sell__label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 6px;
}

.deposit-inv-company-sell__order {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.deposit-inv-company-sell__order-number {
    font-size: 13px;
}

.deposit-inv-company-sell__order-link {
    font-size: 13px;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.deposit-inv-company-sell__order-link:hover,
.deposit-inv-company-sell__order-link:focus-visible {
    color: #1d4ed8;
}

.deposit-inv-company-sell__order-customer {
    font-size: 12px;
    font-weight: 600;
}

.deposit-inv-company-sell__date {
    margin-top: 2px;
}

.deposit-inv-company-sell__totals {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
}

.deposit-inv-company-sell__lines {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deposit-inv-company-sell__line {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
}

.deposit-inv-company-sell__line-title {
    font-size: 12px;
    font-weight: 700;
}

.deposit-inv-company-sell__line-meta {
    margin-top: 2px;
}

.deposit-inv-company-sell__inv {
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.deposit-inv-company-sell__inv--current {
    border-color: #f59e0b;
    background: #fffbeb;
    box-shadow: inset 0 0 0 1px #fde68a;
}

.deposit-inv-company-sell__inv-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.deposit-inv-company-sell__inv-number {
    font-size: 12px;
    font-weight: 700;
}

.deposit-inv-company-sell__inv-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #92400e;
    background: #fef3c7;
    border-radius: 999px;
    padding: 1px 6px;
}

.deposit-inv-company-sell__inv-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}

.deposit-inv-totals {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed #cbd5e1;
}

.deposit-inv-totals--compact {
    margin-top: 2px;
    padding-top: 6px;
    font-size: 12px;
}

.deposit-inv-totals__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 4px 0;
}

.deposit-cell-due {
    color: #b45309;
    font-weight: 600;
}

.deposit-reference-cell {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.deposit-edit-btn {
    line-height: 1;
    color: var(--muted);
}

.deposit-edit-btn:hover,
.deposit-edit-btn:focus-visible {
    color: var(--brand);
}

.deposit-action-btn {
    white-space: normal;
}

.payment-method-name-btn {
    border: 0;
    background: none;
    padding: 0;
    font-weight: 600;
    color: var(--brand);
    text-align: left;
}

.payment-method-name-btn:hover,
.payment-method-name-btn:focus-visible {
    color: #1d4ed8;
}

.exchange-field-readonly {
    color: #334155;
    cursor: default;
    min-height: calc(1.5em + 0.75rem + 2px);
}

.agent-pm-balance-card {
    padding: 10px 12px;
}

.agent-pm-balance-card__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.agent-pm-table__head,
.agent-pm-table__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.agent-pm-table__head {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}

.agent-pm-table__group + .agent-pm-table__group .agent-pm-table__row {
    border-top: 1px solid #f1f5f9;
}

.agent-pm-table__row {
    padding: 5px 0;
}

.agent-pm-table__method {
    min-width: 0;
    font-size: 13px;
}

.agent-pm-table__amount,
.agent-pm-balance-btn {
    font-weight: 800;
    font-size: 14px;
}

.agent-pm-balance-btn {
    text-decoration: none;
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.agent-pm-balance-btn__amount {
    font-weight: 800;
}

.agent-pm-balance-btn__chevron {
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.agent-pm-balance-btn:not(.collapsed) .agent-pm-balance-btn__chevron {
    transform: rotate(180deg);
}

.agent-pm-breakdown__title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.agent-pm-breakdown__exchange {
    font-size: 11px;
    line-height: 1.2;
    padding: 2px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}

.agent-pm-table__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 700;
}

.agent-pm-breakdown {
    margin: 0 0 4px;
    padding: 4px 8px 6px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 2px solid #cbd5e1;
}

.agent-pm-breakdown__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 3px 0;
    font-size: 12px;
}

.agent-pm-breakdown__row + .agent-pm-breakdown__row {
    border-top: 1px dashed #e2e8f0;
}

.agent-pm-breakdown__label {
    min-width: 0;
}

.agent-pm-breakdown__label--stacked {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.agent-pm-breakdown__line {
    line-height: 1.3;
}

.agent-pm-breakdown__line--top {
    font-weight: 600;
    color: var(--text, #0f172a);
}

.agent-pm-breakdown__line--sub {
    font-size: 11px;
    color: var(--muted, #64748b);
}

.agent-pm-breakdown__side {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: 12px;
}

.agent-deposit-pm__exchange {
    font-size: 11px;
    line-height: 1.2;
    padding: 2px 7px;
    white-space: nowrap;
}

.trace-block__head .trace-block__title {
    margin-bottom: 0;
}

.agent-pm-empty__title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.agent-pm-empty__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.agent-pm-empty__chip {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    color: var(--muted);
}

.agent-pm-empty__chip:hover,
.agent-pm-empty__chip:focus-visible {
    border-color: var(--brand);
    color: var(--brand);
}

.agent-pm-exchange-card {
    padding: 10px 12px;
}

.agent-pm-exchange-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    font-size: 12px;
    border-top: 1px solid #f1f5f9;
}

.agent-pm-exchange-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.agent-pm-exchange-row__main {
    min-width: 0;
}

.agent-pm-exchange-row__meta {
    flex-shrink: 0;
    font-size: 11px;
    line-height: 1.3;
}

.investor-deposits {
    padding: 14px;
}

.investor-deposits__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 10px;
}

.investor-deposits__hint {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    line-height: 1.5;
}

.investor-deposits__empty {
    padding: 12px 0;
    font-size: 13px;
    color: #64748b;
}

.deposit-row {
    background: var(--card);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
}

.deposit-row:last-child { margin-bottom: 0; }

.deposit-row__top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.deposit-row__num {
    font-weight: 800;
    color: var(--brand);
    font-size: 14px;
}

.deposit-row__ref { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.deposit-row__amount {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 2px;
}

.deposit-row__footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
}

.bg-success-subtle {
    background: #dcfce7 !important;
}

.form-text {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.modal-content .form-label {
    margin-bottom: 2px;
}

/* ===== APP MODAL CHROME ===== */
.modal-content {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.modal-header--app {
    position: relative;
    display: block;
    flex-shrink: 0;
    padding: 1.25rem 3.25rem 0.75rem 1.25rem;
    border-bottom: 0;
    background: #fff;
}

.modal-header--app.pb-0 {
    padding-bottom: 0.5rem;
}

.modal-header__body {
    min-width: 0;
}

.modal-header__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.modal-header__row:last-child {
    margin-bottom: 0;
}

.modal-header__body > .form-control,
.modal-header__body > input[type="search"] {
    margin-top: 0.5rem;
}

.modal-header__close.btn-close {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    margin: 0;
    padding: 0.625rem;
    opacity: 0.55;
    border-radius: 10px;
    background-color: transparent;
    transition: opacity 0.15s ease, background-color 0.15s ease;
    z-index: 2;
}

.modal-header__close.btn-close:hover,
.modal-header__close.btn-close:focus-visible {
    opacity: 1;
    background-color: #f1f5f9;
    box-shadow: none;
}

.order-detail-modal .modal-header--app {
    padding-bottom: 0.75rem;
}

/* ===== MODALS ON MOBILE ===== */
.fund-picker-modal {
    z-index: 1055 !important;
}

.fund-picker-modal.show {
    display: block;
    pointer-events: auto;
}

.offcanvas-backdrop { z-index: 1040 !important; }
.offcanvas { z-index: 1045 !important; }
.modal-backdrop { z-index: 1050 !important; }
.modal { z-index: 1055 !important; }
.modal.nested-picker-modal { z-index: 1065 !important; }
.modal.nested-picker-modal--deep { z-index: 1075 !important; }
.expense-type-add-modal { z-index: 1065 !important; }
/* Only when expense-type modal is open — + .modal-backdrop matched any backdrop after it on body. */
body:has(> .expense-type-add-modal.show) > .modal-backdrop.show { z-index: 1060 !important; }
/* Stacked backdrops only — nth-of-type(n) counts all body divs (offcanvas/modal), not backdrops. */
body > .modal-backdrop.show ~ .modal-backdrop.show { z-index: 1060 !important; }
body > .modal-backdrop.show ~ .modal-backdrop.show ~ .modal-backdrop.show { z-index: 1070 !important; }

body.modal-open .bottom-nav,
body.offcanvas-open .bottom-nav {
    display: none;
}

@media (max-width: 575.98px) {
    .modal-dialog-centered {
        min-height: auto;
        align-items: stretch;
    }

    .modal-dialog {
        margin: 0.5rem;
        max-height: calc(100dvh - 1rem);
        display: flex;
        align-items: stretch;
    }

    .modal-dialog.modal-fullscreen-sm-down {
        margin: 0;
        max-height: 100dvh;
        height: 100%;
        width: 100%;
        max-width: none;
    }

    .modal-content {
        max-height: calc(100dvh - 1rem);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .modal-dialog.modal-fullscreen-sm-down .modal-content {
        max-height: 100dvh;
        height: 100%;
        border-radius: 0;
    }

    .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-header,
    .modal-footer {
        flex-shrink: 0;
    }

    .modal-footer {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
        background: var(--card);
        border-top: 1px solid #e2e8f0;
    }
}

/* ===== AGENTS LIST ===== */
.agent-table-head {
    display: grid;
    grid-template-columns: 1.4fr 0.5fr 1fr;
    gap: 6px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
}

.agent-block { padding: 12px 14px; }

.agent-header {
    display: grid;
    grid-template-columns: 1.4fr 0.5fr 1fr;
    gap: 6px;
    align-items: center;
}

.agent-header__name {
    color: var(--brand);
    font-size: 15px;
}

.agent-header__count .btn-link {
    font-weight: 800;
    text-decoration: none;
    color: var(--brand);
}

.wallet-tag {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.agent-header__flags {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.flag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 13px;
}

.flag-yes { background: #dcfce7; color: #15803d; }
.flag-no { background: #fee2e2; color: #b91c1c; }

.agent-investors {
    border-top: 1px solid #e2e8f0;
    margin-top: 10px;
    padding-top: 10px;
    background: #f8fafc;
    margin-left: -14px;
    margin-right: -14px;
    margin-bottom: -12px;
    padding: 12px 14px 14px;
    border-radius: 0 0 14px 14px;
}

.agent-investors__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.agent-investor-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    background: var(--card);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
}

.agent-investor-row:last-child { margin-bottom: 0; }

.agent-balance-btn {
    font-weight: 800;
    text-decoration: none;
    color: var(--brand);
}

.agent-wallet-details {
    border-top: 1px solid #e2e8f0;
    margin: 0 -14px -12px;
    background: #f8fafc;
    border-radius: 0 0 14px 14px;
}

.agent-wallet-details__inner {
    padding: 12px 14px 14px;
}

.agent-wallet-details__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

/* ===== AGENT PROFILE ===== */
.agent-bizcard {
    position: relative;
    overflow: hidden;
    padding: 0;
}

.agent-bizcard__accent {
    height: 4px;
    background: linear-gradient(90deg, var(--brand), #22c55e);
}

.agent-bizcard__body {
    padding: 16px;
}

.agent-bizcard__top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.agent-bizcard__avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
}

.agent-bizcard__name {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 2px;
    line-height: 1.2;
}

.agent-bizcard__role {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
}

.agent-bizcard__contacts {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.agent-bizcard__contact {
    font-size: 13px;
    color: #334155;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.agent-bizcard__icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.agent-bizcard__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.agent-bizcard__stat {
    min-width: 0;
}

.agent-bizcard__stat-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}

.agent-bizcard__stat-value {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--brand);
}

.agent-bizcard__stat-hint {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
}

.agent-bizcard__stat--clickable {
    width: 100%;
    border: 0;
    background: #f8fafc;
    border-radius: 10px;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.agent-bizcard__stat--clickable:hover,
.agent-bizcard__stat--clickable:focus-visible,
.agent-bizcard__stat--clickable[aria-expanded="true"] {
    background: #eff6ff;
}

.agent-bizcard__investors {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.agent-bizcard__investors-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.agent-bizcard__investor-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
}

.agent-bizcard__investor-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.agent-bizcard__investor-main {
    min-width: 0;
}

.agent-bizcard__investor-name {
    color: var(--brand);
}

.agent-bizcard__investor-balance {
    flex-shrink: 0;
    font-size: 14px;
}

.agent-bizcard__transactions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.agent-bizcard__transactions-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.agent-bizcard__transaction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
}

.agent-bizcard__transaction-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.agent-bizcard__transaction-main {
    min-width: 0;
}

.agent-bizcard__transaction-amount {
    flex-shrink: 0;
    font-size: 14px;
}

.agent-deposit-group {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
}

.agent-deposit-group:last-child { margin-bottom: 0; }

.agent-deposit-group__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.agent-deposit-group__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.agent-deposit-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.agent-deposit-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 12px;
}

.agent-deposit-table th,
.agent-deposit-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.agent-deposit-table th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    background: #fff;
}

.agent-deposit-table__foot td {
    background: #f8fafc;
    border-bottom: 0;
}

.agent-deposit-pm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.agent-deposit-pm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.agent-deposit-pm-table th,
.agent-deposit-pm-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.agent-deposit-pm-table th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    background: #fff;
}

@media (max-width: 575.98px) {
    .agent-deposit-pm-table thead {
        display: none;
    }

    .agent-deposit-pm-table tr {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .agent-deposit-pm-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 0;
        padding: 4px 0;
    }

    .agent-deposit-pm-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        flex-shrink: 0;
    }

    .agent-deposit-pm-table td.text-end {
        justify-content: space-between;
    }
}

.agent-investors-table .agent-investor-row {
    margin-bottom: 8px;
}

.deposit-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 6px 0;
    color: var(--muted);
}

.trace-block {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}

.trace-block__title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.trace-line { padding: 2px 0; }

.profile-card { margin-bottom: 10px; }
.profile-stat { font-size: 22px; font-weight: 800; color: var(--brand); }
.profile-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }

.list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.list-row:last-child { border-bottom: 0; }

/* ===== FORMS ===== */
.form-control, .form-select {
    min-height: var(--touch);
    font-size: 16px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
}

.form-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }

.btn {
    min-height: var(--touch);
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
}

.btn-primary { background: var(--brand); border-color: var(--brand); }

.btn-lg-touch {
    width: 100%;
    min-height: 52px;
    font-size: 16px;
}

/* ===== OFFCANVAS MENU (More) ===== */
.offcanvas-menu .offcanvas-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.app-menu__section {
    margin-bottom: 16px;
}

.app-menu__section--footer {
    margin-bottom: 0;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.app-menu__heading {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
    padding-left: 2px;
}

.app-menu__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 400px) {
    .app-menu__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 600px) {
    .app-menu__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.menu-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 88px;
    padding: 12px 8px;
    text-decoration: none;
    text-align: center;
    background: var(--card);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    color: var(--text);
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.menu-tile:active {
    transform: scale(0.97);
    background: var(--brand-light);
}

.menu-tile--active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.menu-tile--active .menu-tile__label {
    color: #fff;
}

.menu-tile--logout {
    border-color: #fecaca;
    background: #fef2f2;
}

.menu-tile--logout .menu-tile__label {
    color: #b91c1c;
}

.menu-tile__icon {
    font-size: 26px;
    line-height: 1;
}

.menu-tile__label {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    word-break: break-word;
}

/* ===== ORDERS LIST ===== */
.cp-page { width: 100%; }

.cp-tabs {
    display: flex;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cp-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    color: var(--muted);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.cp-tab--active {
    color: var(--brand);
    background: #eff6ff;
    border-color: #bfdbfe;
}

.cp-tab__count {
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: 11px;
    text-align: center;
}

.cp-tab--active .cp-tab__count {
    background: #dbeafe;
}

.cp-groups { display: grid; gap: 10px; }

.cp-customer {
    padding: 0;
    overflow: hidden;
}

.cp-customer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.cp-customer__head-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
    color: inherit;
}

.cp-customer__profile-link {
    flex-shrink: 0;
    color: inherit;
}

.cp-customer__profile-link--name {
    display: block;
}

.cp-customer__profile-link--name:hover .cp-customer__name,
.cp-customer__profile-link--name:focus-visible .cp-customer__name {
    color: var(--brand);
}

.cp-customer__profile-link:hover .cp-customer__avatar,
.cp-customer__profile-link:focus-visible .cp-customer__avatar {
    filter: brightness(1.08);
}

.cp-customer__avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}

.cp-customer__info { min-width: 0; }

.cp-customer__name {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.cp-customer__chips,
.cp-order__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cp-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}

.cp-chip--due {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.cp-customer__head-actions,
.cp-order__head-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.cp-toggle {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
}

.cp-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.cp-toggle.collapsed .cp-toggle__icon {
    transform: rotate(-90deg);
}

.cp-customer__body {
    padding: 10px;
    background: #f8fafc;
    display: grid;
    gap: 10px;
}

.cp-order {
    background: var(--card);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.cp-order--clickable {
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.cp-order--clickable:hover,
.cp-order--clickable:focus-visible {
    border-color: #93c5fd;
    background: #f8fbff;
    outline: none;
}

.infinite-scroll__sentinel {
    height: 1px;
    width: 100%;
}

.infinite-scroll__footer {
    min-height: 28px;
}

.cp-customer__body .acct-invoices.cp-customer__orders {
    margin: 0;
    gap: 8px;
}
    margin: 0;
    gap: 8px;
}

.cp-order__product-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.cp-order__product-line .acct-invoice__fold-product-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cp-order__product-line .acct-invoice__fold-product-unit {
    font-weight: 600;
    color: #475569;
}

.acct-invoice__fold-product-line.cp-order__product-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 8px;
    white-space: normal;
}

.acct-invoice__fold-product-line.cp-order__product-line .acct-invoice__fold-product-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acct-invoice__fold-product-price {
    flex-shrink: 0;
    font-weight: 600;
    color: #334155;
}

.cp-order__open-hint {
    font-weight: 600;
}

.cp-order__open-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #eff6ff;
    color: var(--brand);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.order-detail-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-detail-line {
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.order-detail-line__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.order-detail-line__product {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
}

.order-detail-line__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 6px;
}

.order-detail-line__chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    line-height: 1.35;
}

.order-detail-line__chip--strong {
    color: #0f172a;
    border-color: #cbd5e1;
}

.order-detail-line__chip--sold {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.order-detail-line__discount {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 800;
    color: #b45309;
    line-height: 1.35;
}

.order-detail-line__delivery {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: 11px;
    line-height: 1.4;
}

.order-detail-line__delivery-label {
    flex-shrink: 0;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.order-detail-line__delivery-text {
    color: #334155;
    word-break: break-word;
}

.order-detail-line__footer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-detail-line__progress {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.order-detail-line__invest {
    flex-shrink: 0;
    min-height: 32px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.order-detail-line__investments {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
}

.order-detail-line__investment {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
}

.order-detail-line__investment + .order-detail-line__investment {
    border-top: 1px solid #eef2f7;
}

.order-detail-line__investment-body {
    flex: 1 1 auto;
    min-width: 0;
}

.order-detail-line__investment-line {
    line-height: 1.35;
}

.order-detail-line__investment-line--top {
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
}

.order-detail-line__investment-line--sub {
    margin-top: 1px;
    font-size: 11px;
    color: #64748b;
}

.order-detail-line__investment-qty {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
    padding-top: 1px;
}

.order-detail-totals {
    padding: 10px;
}

.order-detail-receipt__trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    cursor: zoom-in;
}

.order-detail-receipt__img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.92);
}

.image-lightbox[hidden] {
    display: none !important;
}

body.image-lightbox-open {
    overflow: hidden;
}

.image-lightbox__close {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.image-lightbox__close:hover,
.image-lightbox__close:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    outline: none;
}

.image-lightbox__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.image-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.cp-order__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.cp-order__head-main {
    flex: 1;
    min-width: 0;
    color: inherit;
}

.cp-order__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.cp-order__title { font-size: 14px; }

.cp-order__lines { padding: 10px 12px 12px; }

.cp-order__progress {
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-bottom: 10px;
}

.cp-order__progress--inline {
    height: 4px;
    margin: 4px 0 0;
}

.cp-order__progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), #22c55e);
}

.cp-lines-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cp-lines-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    font-size: 12px;
}

.cp-lines-table th,
.cp-lines-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.cp-lines-table th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
}

.cp-lines-table tfoot td {
    background: #f8fafc;
    border-bottom: 0;
}

.cp-line-product__name { font-size: 13px; }

.cp-empty { margin-top: 0; }

/* ===== CREATE ORDER FORM ===== */
.order-create {
    padding: 14px;
}

.order-create__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.order-create__title {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 4px;
}

.receipt-upload {
    position: relative;
    display: block;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.receipt-upload:hover,
.receipt-upload:focus-within {
    border-color: var(--brand);
    background: #eff6ff;
}

.receipt-upload--filled {
    cursor: default;
    border-style: solid;
    background: #f8fafc;
}

.receipt-upload--filled:hover {
    background: #f8fafc;
}

.receipt-upload__input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.receipt-upload__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 108px;
    padding: 16px 14px;
    text-align: center;
    cursor: pointer;
}

.receipt-upload__icon {
    font-size: 28px;
    line-height: 1;
}

.receipt-upload__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand);
}

.receipt-upload__hint {
    font-size: 12px;
    color: #64748b;
}

.receipt-upload__filled {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}

.receipt-upload__preview {
    display: block;
    width: 100%;
    max-height: 220px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    object-fit: contain;
    background: #fff;
}

.receipt-upload__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.receipt-upload__size {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    font-variant-numeric: tabular-nums;
}

.receipt-upload__status {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.receipt-upload__status--processing {
    color: var(--brand);
}

.receipt-upload__status--ok,
.receipt-upload__status--compressed {
    color: #15803d;
}

.receipt-upload__status--error {
    color: #b91c1c;
}

.receipt-upload--processing {
    border-color: #93c5fd;
    background: #f8fbff;
}

.receipt-upload--error {
    border-color: #fca5a5;
}

.receipt-upload__actions {
    display: flex;
    gap: 8px;
}

.receipt-upload__action {
    flex: 1;
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.receipt-upload__action:hover,
.receipt-upload__action:focus-visible {
    border-color: var(--brand);
    color: var(--brand);
    outline: none;
}

.receipt-upload__action--danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff5f5;
}

.receipt-upload__action--danger:hover,
.receipt-upload__action--danger:focus-visible {
    border-color: #f87171;
    color: #991b1b;
}

.order-type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.order-type-toggle__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}

.order-type-toggle__btn--active {
    border-color: var(--brand);
    background: #eff6ff;
    color: var(--brand);
}

.order-lines {
    padding-top: 4px;
}

.order-form-actions {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 12px;
}

.order-form-actions__add {
    flex: 0 0 auto;
    align-self: stretch;
    min-height: 52px;
    padding-left: 1rem;
    padding-right: 1rem;
    white-space: nowrap;
}

.order-form-actions__submit {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.order-line-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.order-line-remove__icon {
    display: block;
}

.order-line-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
}

.order-line-card:last-child {
    margin-bottom: 0;
}

.order-line-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-line-card__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
}

@media (max-width: 767px) {
    .cp-customer__head-actions,
    .cp-order__head-actions {
        flex-direction: row;
        align-items: center;
    }
}

/* ===== PRODUCTS ===== */
.product-table-head {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.5fr;
    gap: 6px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
}

.product-block { padding: 12px 14px; }

.product-header {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.5fr;
    gap: 6px;
    align-items: start;
}

.product-header__name {
    color: var(--brand);
    font-size: 15px;
}

.product-variants-list {
    border-top: 1px solid #e2e8f0;
    margin: 8px -14px -12px;
    padding: 10px 14px 12px;
    background: #f8fafc;
    border-radius: 0 0 14px 14px;
}

.product-variant-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    background: var(--card);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
}

.product-variant-row:last-child { margin-bottom: 0; }

.product-variant-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
}

.product-variant-card:last-child { margin-bottom: 0; }

.product-variant-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.product-variant-card__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
}

.unit-select-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.unit-select-row .form-select {
    flex: 1;
    min-width: 0;
}

.unit-add-btn,
.picker-plain-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    box-shadow: none;
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.unit-add-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    font-size: 22px;
}

.unit-add-btn:hover,
.unit-add-btn:focus-visible,
.picker-plain-btn:hover,
.picker-plain-btn:focus-visible {
    border: 0;
    background: #bfdbfe;
    color: #1d4ed8;
    box-shadow: none;
    text-decoration: none;
    outline: none;
}

.unit-add-btn:active,
.picker-plain-btn:active {
    transform: scale(0.94);
}

.picker-plain-btn--text {
    width: auto;
    min-width: 0;
    height: auto;
    padding: 5px 12px 5px 5px;
    gap: 7px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.picker-plain-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

.picker-plain-btn--text:hover .picker-plain-btn__icon,
.picker-plain-btn--text:focus-visible .picker-plain-btn__icon {
    background: #1d4ed8;
}

.picker-plain-btn--danger {
    width: 30px;
    min-width: 30px;
    height: 30px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 18px;
    font-weight: 600;
}

.picker-plain-btn--danger:hover,
.picker-plain-btn--danger:focus-visible {
    background: #fecaca;
    color: #b91c1c;
}

.product-variant-product__head .picker-plain-btn:not(.picker-plain-btn--text) {
    width: 28px;
    min-width: 28px;
    height: 28px;
    font-size: 18px;
}

#catalogAddProductVariantLine.picker-plain-btn {
    width: 30px;
    min-width: 30px;
    height: 30px;
    font-size: 18px;
}

.d-flex > .picker-plain-btn:not(.picker-plain-btn--text) {
    align-self: center;
}

.product-variant-product__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin: 12px 0 8px;
}

.product-variant-product:first-child .product-variant-product__head {
    margin-top: 0;
}

.product-variant-picker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-variant-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.product-variant-card__label {
    font-weight: 600;
}

#catalogProductVariantsWrap .catalog-variant-line {
    margin-bottom: 10px;
}

#catalogProductVariantsWrap .catalog-variant-line:last-child {
    margin-bottom: 0;
}

/* ===== FUND PICKER (investor / deposit) ===== */
.fund-picker-field {
    min-height: 44px;
}

.fund-picker-choose {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: var(--brand);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.fund-picker-choose:hover:not(:disabled),
.fund-picker-choose:focus:not(:disabled) {
    border-color: var(--brand);
    background: #eff6ff;
    outline: none;
}

.fund-picker-choose:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fund-picker-summary {
    position: relative;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    overflow: hidden;
}

.fund-picker-summary--filled {
    background: #f8fafc;
}

.fund-picker-clear {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 0 11px 0 10px;
    background: #e2e8f0;
    color: #475569;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.fund-picker-clear:hover,
.fund-picker-clear:focus {
    background: #fecaca;
    color: #b91c1c;
    outline: none;
}

.fund-picker-summary__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding-right: 28px;
}

.fund-picker-summary__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 15px;
    color: var(--brand);
}

.fund-picker-summary__meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.fund-picker-summary__available {
    font-size: 12px;
    font-weight: 700;
    color: #059669;
    white-space: nowrap;
}

.fund-balance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.fund-balance-table th,
.fund-balance-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
}

.fund-balance-table th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    background: #fff;
}

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

.fund-balance-holder--agent {
    font-weight: 600;
    color: #0f766e;
}

.fund-balance-available-btn {
    border: 0;
    background: none;
    padding: 0;
    color: #059669;
    font-weight: 700;
    text-decoration: underline dotted;
    cursor: pointer;
}

.fund-balance-available-btn:hover,
.fund-balance-available-btn:focus {
    color: #047857;
    outline: none;
}

.fund-balance-pm-row td {
    border-bottom: 0 !important;
}

.fund-balance-pm {
    margin: 0 0 8px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.fund-balance-pm__title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.fund-balance-pm__line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    padding: 4px 0;
}

.fund-balance-pm__line + .fund-balance-pm__line {
    border-top: 1px dashed #e2e8f0;
}

.fund-balance-pm__amounts {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.investment-agent-balance-table {
    margin-top: 4px;
}

.investment-product-line__title {
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    color: #0f172a;
}

.fund-picker-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fund-picker-card {
    display: block;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.fund-picker-card:hover,
.fund-picker-card:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
    outline: none;
}

.fund-picker-card--selected {
    border-color: var(--brand);
    background: #eff6ff;
}

.fund-picker-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.fund-picker-card__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 15px;
    color: var(--brand);
    min-width: 0;
}

.fund-picker-card__available {
    font-size: 12px;
    font-weight: 700;
    color: #059669;
    white-space: nowrap;
}

.fund-picker-card--expanded {
    cursor: default;
}

.fund-picker-deposits {
    margin-top: 10px;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
}

.fund-picker-deposits__list {
    display: flex;
    flex-direction: column;
}

.fund-picker-deposits__list > .fund-picker-card + .fund-picker-card {
    margin-top: 12px;
}

.fund-picker-card__meta {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

/* ===== CUSTOMER COMPACT CARD ===== */
.customer-picker-card--compact {
    padding: 10px;
}

.customer-list-card.mobile-card {
    padding: 10px 12px;
    margin-bottom: 8px;
}

.customer-picker-summary--compact.fund-picker-summary--filled {
    padding: 10px 40px 10px 12px;
}

.customer-picker-summary--compact .fund-picker-clear {
    width: 32px;
    height: 32px;
    font-size: 18px;
    border-radius: 0 10px 0 8px;
}

.customer-picker-summary .customer-compact__title-row {
    gap: 6px;
}

.customer-picker-summary .customer-compact__title {
    flex: 1;
    min-width: 0;
}

.customer-picker-summary .customer-compact__badge {
    flex-shrink: 0;
    max-width: calc(100% - 36px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-profile-compact.mobile-card {
    padding: 0;
    overflow: hidden;
}

.customer-profile-compact__body {
    padding: 10px 12px 0;
}

.customer-profile-compact__body .customer-compact {
    padding-bottom: 10px;
}

.customer-profile-compact__body .customer-compact__chips {
    margin-bottom: 0;
}

.customer-compact--profile .customer-compact__title-row {
    align-items: flex-start;
}

.customer-compact--profile .customer-compact__title-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}

.customer-compact--profile .customer-compact__title-group {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
}

.customer-compact--profile .customer-compact__title-group .customer-compact__title {
    display: inline;
    min-width: 0;
    word-break: break-word;
}

.customer-compact--profile .customer-compact__edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin: 0;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    text-decoration: none;
    vertical-align: middle;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.customer-compact--profile .customer-compact__edit:hover,
.customer-compact--profile .customer-compact__edit:focus-visible {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--brand);
    outline: none;
}

.customer-compact--profile .customer-compact__title-left .customer-compact__meta {
    margin-top: 0;
}

.customer-compact--profile .customer-compact__title-left .customer-compact__address {
    margin-top: 0;
}

.customer-profile-compact .customer-compact__balance-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
    text-align: right;
}

.customer-profile-compact .customer-compact__balance-due,
.customer-profile-compact .customer-compact__balance-pay {
    display: block;
    width: 100%;
    text-align: right;
}

.customer-profile-compact .customer-compact__balance-due .customer-compact__badge {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
}

.customer-profile-compact .customer-compact__balance-due .customer-compact__badge--due {
    color: #b91c1c;
}

.customer-profile-compact .customer-compact__balance-due .customer-compact__badge--advance {
    color: #047857;
}

.customer-profile-compact .customer-compact__balance-pay .customer-compact__pay {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    color: #059669;
    text-decoration: none;
    white-space: nowrap;
}

.customer-profile-compact .customer-compact__balance-pay .customer-compact__pay:hover,
.customer-profile-compact .customer-compact__balance-pay .customer-compact__pay:focus-visible {
    color: #047857;
    text-decoration: underline;
    outline: none;
}

.customer-compact--profile .customer-compact__balance-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    text-align: right;
}

.customer-compact--profile .customer-compact__balance-due,
.customer-compact--profile .customer-compact__balance-pay {
    display: block;
    width: 100%;
    text-align: right;
}

.customer-compact--profile .customer-compact__pay {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    color: #059669;
    text-decoration: none;
    white-space: nowrap;
}

.customer-compact--profile .customer-compact__pay:hover,
.customer-compact--profile .customer-compact__pay:focus-visible {
    color: #047857;
    text-decoration: underline;
    outline: none;
}

.customer-compact--profile .customer-compact__pay--solo {
    flex-shrink: 0;
    align-self: flex-start;
}

.customer-profile-compact__tabs {
    display: flex;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.customer-profile-compact__tabs .cp-tab {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 8px 6px;
    min-height: 0;
    border: 0;
    border-radius: 0;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.customer-profile-compact__tabs .cp-tab + .cp-tab {
    border-left: 1px solid #e2e8f0;
}

.customer-profile-compact__tabs .cp-tab--orders {
    color: #64748b;
    background: #f8fafc;
}

.customer-profile-compact__tabs .cp-tab--orders:hover,
.customer-profile-compact__tabs .cp-tab--orders:focus-visible {
    color: #1d4ed8;
    background: #eff6ff;
    outline: none;
}

.customer-profile-compact__tabs .cp-tab--orders.cp-tab--active {
    color: #1d4ed8;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: inset 0 -2px 0 #2563eb;
}

.customer-profile-compact__tabs .cp-tab--account {
    color: #64748b;
    background: #f8fafc;
}

.customer-profile-compact__tabs .cp-tab--account:hover,
.customer-profile-compact__tabs .cp-tab--account:focus-visible {
    color: #047857;
    background: #ecfdf5;
    outline: none;
}

.customer-profile-compact__tabs .cp-tab--account.cp-tab--active {
    color: #047857;
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
    box-shadow: inset 0 -2px 0 #059669;
}

.customer-profile-compact__tabs .cp-tab--orders .cp-tab__count {
    background: #e2e8f0;
    color: #475569;
}

.customer-profile-compact__tabs .cp-tab--orders.cp-tab--active .cp-tab__count {
    background: #bfdbfe;
    color: #1d4ed8;
}

.customer-profile-compact__tabs .cp-tab--account .cp-tab__count {
    background: #e2e8f0;
    color: #475569;
}

.customer-profile-compact__tabs .cp-tab--account.cp-tab--active .cp-tab__count {
    background: #bbf7d0;
    color: #047857;
}

.acct-ledger {
    padding-left: 0;
    padding-right: 0;
}

.acct-ledger__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
}

.acct-ledger__title-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.acct-ledger__title {
    flex-shrink: 0;
}

.acct-ledger__filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px 3px 10px;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    max-width: 100%;
}

.acct-ledger__filter-tag:hover,
.acct-ledger__filter-tag:focus-visible {
    background: #dbeafe;
    border-color: #60a5fa;
    outline: none;
}

.acct-ledger__filter-tag__clear {
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    opacity: 0.75;
}

.acct-ledger__filter-tag [data-acct-filter-tag-label] {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acct-ledger__actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.acct-ledger__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.acct-ledger__icon-btn:hover,
.acct-ledger__icon-btn:focus-visible {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--brand);
    outline: none;
}

.acct-ledger__icon-btn--active {
    background: #eff6ff;
    border-color: #93c5fd;
    color: var(--brand);
}

.acct-ledger__filter-menu {
    min-width: 220px;
    padding-bottom: 8px;
}

.acct-ledger__range {
    padding: 8px 12px 4px;
}

.acct-ledger__range-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 8px;
}

.acct-ledger__range-field {
    display: block;
    margin-bottom: 8px;
}

.acct-ledger__range-field span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

.acct-ledger__filter-empty {
    padding: 8px 16px 0;
}

.acct-ledger__print-head {
    display: none;
}

.acct-ledger__empty {
    padding: 0 16px;
}

.acct-ledger .page-title {
    margin-bottom: 0;
}

.acct-invoices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: none;
    margin: 10px 0 0;
}

.acct-invoice {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background: transparent;
    overflow: hidden;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.acct-invoice:has(.acct-invoice__expand.show) {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.acct-invoice--payment:has(.acct-invoice__expand.show) {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.acct-invoice--highlight {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18) !important;
}

.acct-invoice--opening_due:has(.acct-invoice__expand.show),
.acct-invoice--opening_advance:has(.acct-invoice__expand.show) {
    border-color: #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.12);
}

.acct-invoice:has(.acct-invoice__expand.show) .acct-invoice__fold-wrap {
    border-bottom: 1px solid #e2e8f0;
}

.acct-invoice__fold-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 12px 16px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #f8fafc;
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
    transition: background 0.15s ease;
    box-sizing: border-box;
}

.acct-invoice__fold-wrap:hover {
    background: #f1f5f9;
}

.acct-invoice__fold-wrap:focus {
    outline: none;
}

.acct-invoice__fold-wrap:focus-visible {
    outline: none;
    background: #f1f5f9;
}

.acct-invoice__fold-wrap--payment .acct-invoice__edit {
    flex-shrink: 0;
}

.acct-invoice__fold-wrap--order .acct-invoice__edit,
.acct-invoice__fold-wrap--order .acct-invoice__print {
    flex-shrink: 0;
    align-self: center;
}

.acct-invoice__fold-wrap--order {
    align-items: flex-start;
    padding-top: 10px;
    padding-bottom: 10px;
}

.acct-invoice__fold-wrap--order .acct-invoice__fold-side {
    align-self: center;
}

.acct-invoice__fold-line {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
}

.acct-invoice__fold-date {
    flex-shrink: 0;
    color: #64748b;
    font-weight: 500;
}

.acct-invoice__fold-memo {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    color: #0f172a;
}

.acct-invoice__fold-sep {
    margin: 0 1px;
}

.acct-invoice__fold-wrap--order .acct-invoice__fold-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    white-space: normal;
}

.acct-invoice__fold-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
}

.acct-invoice__fold-products {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

.acct-invoice__fold-product-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    min-width: 0;
}

.acct-invoice__fold-investment-line {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 8px;
    border-left: 2px solid #e2e8f0;
}

.acct-invoice__fold-investment-top {
    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;
    color: #334155;
}

.acct-invoice__fold-investment-sub {
    font-size: 10px;
    line-height: 1.3;
    color: #64748b;
}

.acct-invoice__fold-product-line {
    display: block;
    font-size: 10px;
    line-height: 1.3;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acct-invoice__fold-product-qty {
    font-weight: 600;
    color: #475569;
}

.acct-invoice__qty-btn {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: inherit;
    color: inherit;
    cursor: pointer;
}

.acct-invoice__qty-btn:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}

.acct-invoice__line-detail td {
    padding-top: 0;
    border-top: 0;
}

.acct-invoice__line-detail--active td {
    background: #f8fafc;
}

.acct-invoice__line-slices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0 8px;
}

.acct-invoice__slice {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 12px;
    line-height: 1.35;
    color: #334155;
}

.acct-invoice__slice-field {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
}

.acct-invoice__slice-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #94a3b8;
}

.acct-invoice__slice-value--strong {
    font-weight: 700;
    color: #0f172a;
}

.acct-invoice__investment-link {
    color: inherit;
    font-weight: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.acct-invoice__investment-link:hover,
.acct-invoice__investment-link:focus-visible {
    color: #1d4ed8;
}

.acct-invoice__fold-amount {
    flex-shrink: 0;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
    white-space: nowrap;
}

.acct-invoice__fold-side {
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
}

.acct-invoice__fold-balance {
    font-size: 10px;
    line-height: 1.2;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.acct-invoice__fold-balance--due {
    color: #b45309;
}

.acct-invoice__fold-balance--settled {
    color: #047857;
}

.acct-invoice__fold-balance--neutral {
    color: #64748b;
}

.acct-invoice__fold-balance--advance {
    color: #047857;
}

.cp-orders-ledger .acct-invoices {
    margin-top: 0;
}

.cp-orders-ledger:not(:has(.acct-ledger__head)) .acct-invoices {
    padding-top: 4px;
}

.order-detail-panel__footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.order-detail-panel__progress {
    margin-top: 0;
}

.acct-invoice__panel .order-detail-panel__receipt {
    margin: 0 0 12px;
}

.acct-invoice__panel .order-detail-panel__receipt .acct-invoice__details {
    padding: 0 0 10px;
    border: none;
    background: transparent;
}

.order-detail-panel__receipt .acct-invoice__details {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.acct-invoice__panel .order-detail-panel {
    padding: 12px 14px 14px;
}

.acct-invoice__panel .order-detail-lines {
    margin-top: 0;
}

.acct-invoice__panel .order-detail-totals {
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

.acct-invoice--payment .acct-invoice__fold-wrap {
    background: #f0fdf4;
}

.acct-invoice--payment .acct-invoice__fold-wrap:hover {
    background: #ecfdf5;
}

.acct-invoice--payment .acct-invoice__fold-wrap:focus-visible {
    background: #dcfce7;
}

.acct-invoice--payment .acct-invoice__fold-amount {
    color: #047857;
}

.acct-invoice__expand {
    width: 100%;
    box-sizing: border-box;
}

.acct-invoice__panel {
    width: 100%;
    border: none;
    border-radius: 0;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
}

.acct-invoice__panel--payment {
    border-color: #bbf7d0;
}

.acct-invoice__details--meta {
    border-bottom: 1px solid #e2e8f0;
}

.acct-invoice__edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.acct-invoice__print {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.acct-invoice__print:hover,
.acct-invoice__print:focus-visible {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--brand);
    outline: none;
}

.deposit-purchase-print,
.deposit-purchase-print-empty {
    display: none;
}

.deposit-purchase-print__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.deposit-purchase-print__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    min-width: 0;
}

.deposit-purchase-print__date {
    flex-shrink: 0;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.deposit-purchase-print__memo {
    font-size: 12px;
    font-weight: 800;
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #bfdbfe;
}

.deposit-purchase-print__paid {
    font-size: 11px;
    font-weight: 700;
    color: #0f766e;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ecfeff;
    box-shadow: inset 0 0 0 1px #a5f3fc;
}

.deposit-purchase-print__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
    min-width: 0;
    font-size: 12px;
    line-height: 1.35;
    color: #475569;
}

.deposit-purchase-print__seller {
    font-weight: 800;
    color: #0f172a;
}

.deposit-purchase-print__sep {
    color: #94a3b8;
}

.deposit-purchase-print__product {
    min-width: 0;
    font-weight: 600;
    color: #334155;
}

.deposit-purchase-print__qty {
    margin-left: 4px;
    font-weight: 700;
    color: #64748b;
}

.deposit-purchase-print__side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-end;
    gap: 6px;
    padding-left: 8px;
}

.deposit-purchase-print__side .deposit-fold-metric {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 5px 8px;
    border-radius: 8px;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e2e8f0;
    white-space: nowrap;
}

.deposit-purchase-print__side .deposit-fold-metric--invested {
    box-shadow: inset 0 0 0 1px #cbd5e1;
    background: #f8fafc;
}

.deposit-purchase-print__side .deposit-fold-metric--profit {
    box-shadow: inset 0 0 0 1px #bfdbfe;
    background: #eff6ff;
}

.deposit-purchase-print__side .deposit-fold-metric__label {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.deposit-purchase-print__side .deposit-fold-metric__value {
    font-size: 12px;
    font-weight: 800;
}

.deposit-invoice__print-head {
    display: none;
}

.deposit-print-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.deposit-print-identity__avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #1d4ed8;
    background: #dbeafe;
}

.deposit-print-identity__text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.deposit-print-identity__title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.deposit-print-identity__name {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.deposit-print-identity__nth {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    padding: 2px 8px;
}

.deposit-print-identity__sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
}

.deposit-print-identity__role {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.deposit-print-identity__dot {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1;
}

.deposit-print-identity__terms {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    line-height: 1.35;
}

.deposit-print-identity__stats {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
    margin-top: 8px;
}

.deposit-print-identity__stats .deposit-fold-metric {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    padding: 5px 7px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28);
    white-space: nowrap;
}

.deposit-print-identity__stats .deposit-fold-metric__label {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.deposit-print-identity__stats .deposit-fold-metric__value {
    font-size: 12px;
    font-weight: 800;
}

.acct-invoice__edit:hover,
.acct-invoice__edit:focus-visible {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--brand);
    outline: none;
}

.acct-invoice--payment .acct-invoice__edit:hover,
.acct-invoice--payment .acct-invoice__edit:focus-visible {
    color: #047857;
    border-color: #bbf7d0;
    background: #ecfdf5;
}

.acct-invoice__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.acct-invoice__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.acct-invoice__table thead th {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    text-align: left;
    white-space: nowrap;
}

.acct-invoice__table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    color: #334155;
}

.acct-invoice__table tbody tr:last-child td {
    border-bottom: 0;
}

.acct-invoice__product {
    font-weight: 600;
    color: #0f172a;
    min-width: 100px;
}

.acct-invoice__num {
    text-align: right;
    white-space: nowrap;
}

.acct-invoice__amount {
    font-weight: 700;
    color: #0f172a;
}

.acct-invoice__discount-row td {
    padding-top: 0;
    padding-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #b45309;
    border-bottom: 1px solid #f1f5f9;
}

.acct-invoice__discount-amount {
    color: #b45309;
}

.acct-invoice__details {
    padding: 10px 14px;
    display: grid;
    gap: 8px;
}

.acct-invoice__detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-size: 12px;
    line-height: 1.4;
}

.acct-invoice__detail-row--amount {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.acct-invoice__detail-label {
    flex-shrink: 0;
    font-weight: 700;
    color: #64748b;
}

.acct-invoice__detail-value {
    text-align: right;
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}

.acct-invoice__credit {
    font-size: 15px;
    font-weight: 800;
    color: #059669;
}

.acct-invoice__totals {
    padding: 10px 14px 12px;
    border-top: 1px solid #e2e8f0;
    background: #fafbfc;
    display: grid;
    gap: 6px;
}

.acct-invoice__summary {
    display: grid;
    gap: 4px;
    padding-bottom: 8px;
    margin-bottom: 2px;
    border-bottom: 1px dashed #cbd5e1;
}

.acct-invoice__total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.acct-invoice__total-row span:last-child {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.acct-invoice__total-row--strong {
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px dashed #cbd5e1;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.acct-invoice__total-row--strong span:last-child {
    font-size: 14px;
}

.acct-invoice__total-row--discount span:last-child {
    color: #b45309;
    font-weight: 800;
}

.acct-invoice__total-row--add span:last-child {
    color: #047857;
    font-weight: 800;
}

.acct-invoice__total-row--subtotal {
    padding-top: 2px;
    margin-top: 2px;
    border-top: 1px dotted #cbd5e1;
    font-weight: 700;
    color: #0f172a;
}

.acct-invoice__total-row--subtotal span:last-child {
    font-size: 13px;
}

.acct-invoice__total-row--due span:last-child {
    color: #b45309;
}

.acct-invoice__total-row--settled span:last-child {
    color: #047857;
}

.acct-invoice__total-row--balance {
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 700;
}

.acct-invoice__total-row--balance span:first-child {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10px;
    color: #64748b;
}

.acct-invoice__total-row--balance.acct-invoice__total-row--due {
    background: #fffbeb;
    border-color: #fde68a;
}

.acct-invoice__total-row--balance.acct-invoice__total-row--due span:last-child {
    color: #b45309;
}

.acct-invoice__total-row--balance.acct-invoice__total-row--advance {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.acct-invoice__total-row--balance.acct-invoice__total-row--advance span:last-child {
    color: #047857;
}

.customer-compact__main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.customer-compact__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}

.customer-compact__info {
    flex: 1;
    min-width: 0;
}

.customer-compact__title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.customer-compact__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand);
    line-height: 1.25;
    word-break: break-word;
}

.customer-compact__badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.3;
}

.customer-compact__badge--due {
    color: #dc2626;
}

.customer-compact__badge--advance {
    color: #16a34a;
}

.customer-compact__badge--neutral {
    color: #64748b;
}

.customer-compact__meta {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.35;
    color: #475569;
}

.customer-compact__address {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.35;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
}

.customer-compact__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.customer-compact__chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    background: #f1f5f9;
    color: #475569;
}

.customer-compact__chip--due {
    background: #fef2f2;
    color: #b91c1c;
}

.customer-compact__chip--advance {
    background: #f0fdf4;
    color: #15803d;
}

.customer-compact__chip--neutral {
    background: #f1f5f9;
    color: #64748b;
}

.customer-picker-order-date {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eef2f7;
    font-size: 12px;
}

.customer-add-panel {
    padding: 12px 14px 16px;
}

.modal-dialog-scrollable .customer-add-panel.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.customer-add-panel__wrap {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
}

.customer-add-panel__top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px 8px;
    margin: 0;
    background: transparent;
}

.customer-add-panel__back {
    border: 0;
    background: var(--brand-light);
    color: var(--brand);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.customer-add-panel__back:hover,
.customer-add-panel__back:focus-visible {
    background: #bfdbfe;
    outline: none;
    opacity: 0.95;
}

.customer-add-panel__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.customer-add-panel__desc {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
}

.customer-add-panel__form {
    padding: 16px;
}

.customer-add-panel__form > .alert {
    margin-bottom: 12px;
}

.customer-add-panel__card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.customer-add-panel__card:last-of-type {
    margin-bottom: 0;
}

.customer-add-panel__card .form-label {
    margin-bottom: 6px;
}

.customer-add-panel__card .form-label + .form-control,
.customer-add-panel__card .form-label + .form-control-lg {
    margin-bottom: 0;
}

.customer-add-panel__section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.customer-add-panel__address {
    min-height: 92px;
    resize: vertical;
}

.customer-add-panel__actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: linear-gradient(to top, #fff 78%, rgba(255, 255, 255, 0));
}

.customer-add-panel__actions .btn {
    flex: 1;
    min-height: 46px;
    border-radius: 10px;
}

.customer-picker-address {
    line-height: 1.35;
    white-space: pre-line;
}

.fund-picker-field-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fund-picker-field-actions .fund-picker-choose {
    flex: 1 1 auto;
    min-width: 0;
}

.opening-balance-toggle {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.opening-balance-fields .customer-add-panel__section-title {
    margin-bottom: 4px;
}

.customer-picker-order-date__text {
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
    font-weight: 600;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.customer-picker-order-date__text:hover {
    text-decoration: underline;
}

.customer-picker-order-date__mount {
    display: inline-flex;
    align-items: center;
}

.customer-picker-order-date__input {
    width: auto;
    min-width: 140px;
    padding: 2px 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.fund-picker-modal .modal-body {
    padding-top: 8px;
}

.fund-picker-modal .modal-dialog.modal-dialog-scrollable {
    max-height: calc(100% - 1rem);
}

.fund-picker-modal .modal-dialog-scrollable .modal-content {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 1rem);
    overflow: hidden;
}

.fund-picker-modal .modal-dialog-scrollable .modal-header,
.fund-picker-modal .modal-dialog-scrollable .seller-add-panel {
    flex: 0 0 auto;
}

.fund-picker-modal .modal-dialog-scrollable .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.fund-picker-modal .fund-picker-list .infinite-scroll {
    min-height: 0;
}

.order-extra-cost__split-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.order-extra-cost__split-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.order-extra-cost__split-body {
    flex: 1 1 auto;
    min-width: 0;
}

.order-extra-cost__split-line {
    line-height: 1.35;
}

.order-extra-cost__split-line--top {
    font-weight: 600;
    color: #0f172a;
}

.order-extra-cost__split-line--sub {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.92em;
}

.order-extra-cost__split-amt {
    flex-shrink: 0;
    white-space: nowrap;
    padding-top: 1px;
}

/* ===== ORDER LINE PICKER ===== */
.order-line-groups {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-line-customer {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
}

.order-line-customer__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.order-line-customer__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.order-line-customer__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand);
}

.order-line-order {
    padding: 10px 12px 12px;
    border-bottom: 1px solid #eef2f7;
}

.order-line-order:last-child {
    border-bottom: 0;
}

.order-line-order__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.order-line-order__number {
    font-weight: 700;
    font-size: 13px;
}

.order-line-picker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-line-card {
    text-align: left;
}

.order-line-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.order-line-card__product {
    font-weight: 700;
    font-size: 14px;
    color: var(--brand);
}

.order-line-card__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    font-size: 12px;
    margin-bottom: 8px;
}

.order-line-card__grid strong {
    display: block;
    font-size: 13px;
}

.order-line-card__address {
    margin-bottom: 8px;
}

.order-line-card__progress {
    height: 4px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.order-line-summary__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    font-size: 12px;
}

.order-line-summary__grid strong {
    display: block;
    font-size: 13px;
}

.order-line-summary--compact.fund-picker-summary--filled {
    padding: 10px 40px 10px 12px;
}

.order-line-summary--compact .fund-picker-clear {
    width: 32px;
    height: 32px;
    font-size: 18px;
    border-radius: 0 10px 0 8px;
}

.order-line-summary__head {
    align-items: flex-start;
}

.order-line-summary__title {
    font-size: 15px;
    line-height: 1.35;
    margin-bottom: 2px;
}

.order-line-summary__meta {
    font-size: 12px;
    line-height: 1.4;
}

.order-line-summary__remaining {
    flex-shrink: 0;
    font-size: 11px;
    max-width: 42%;
    text-align: right;
    line-height: 1.3;
}

.order-line-summary__address {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    line-height: 1.35;
}

.order-line-card__meta {
    line-height: 1.4;
}

.order-line-card__head {
    margin-bottom: 4px;
}

.order-line-card__product {
    line-height: 1.35;
}

.investment-create-form .order-line-picker {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.investment-create-form .fund-picker {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.investment-create-section {
    padding: 12px 14px;
}

.investment-paid-by .btn {
    padding-top: 10px;
    padding-bottom: 10px;
}

.investment-pay-hints {
    line-height: 1.45;
}

.investment-pay-hints .text-warning {
    color: #b45309 !important;
}

/* ===== LOGIN ===== */
.login-wrap {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--brand);
}

.login-card {
    width: 100%;
    max-width: 360px;
    border-radius: 16px;
    border: 0;
}

.due-customer-card {
    padding: 0;
    overflow: hidden;
}

.due-customer-card__link,
.due-customer-card__link:hover,
.due-customer-card__link:focus,
.due-customer-card__link:focus-visible,
.due-customer-card__link:active,
.due-customer-card__link:visited {
    display: block;
    padding: 12px 14px;
    color: inherit;
    text-decoration: none;
    background: #fff;
    transition: background 0.15s ease;
}

.due-customer-card__link:hover,
.due-customer-card__link:focus-visible {
    background: #f8fafc;
    outline: none;
}

.due-customer-card__link *,
.due-customer-card__link:hover *,
.due-customer-card__link:focus-visible * {
    text-decoration: none;
}

.due-customer-card__name {
    color: var(--brand);
}

.due-customer-card__amount {
    flex-shrink: 0;
}

@media print {
    @page {
        margin: 12mm 10mm;
    }

    body.has-bottom-nav {
        padding-bottom: 0;
    }

    .page-actions,
    .customer-profile-compact,
    .bottom-nav,
    .scroll-nav,
    .acct-ledger__actions,
    .acct-invoice__edit,
    .acct-invoice__print,
    .image-lightbox,
    .investor-bizcard,
    .investor-assigned-agents,
    .investor-agent-lock-panel,
    .alert,
    .app-topbar,
    .offcanvas-menu {
        display: none !important;
    }

    a[href]::after {
        content: none !important;
    }

    .app-main {
        max-width: none;
        padding: 0;
    }

    .acct-ledger {
        box-shadow: none;
        border-radius: 0;
        margin: 0;
    }

    .acct-ledger__head {
        display: none;
    }

    .acct-ledger__print-head,
    .deposit-invoice__print-head {
        display: none !important;
    }

    body:not(.deposit-print-single) #depositLedger > .acct-ledger__print-head,
    body.deposit-print-single .acct-invoice--deposit:not(.deposit-print-hidden) .deposit-invoice__print-head {
        display: block !important;
        position: relative;
        padding: 10px 12px 10px 14px;
        margin: 0 0 10px;
        border: 0 !important;
        border-radius: 10px;
        background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 55%, #ecfdf5 100%) !important;
        box-shadow: inset 0 0 0 1px #dbeafe;
        overflow: hidden;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body:not(.deposit-print-single) #depositLedger > .acct-ledger__print-head::before,
    body.deposit-print-single .acct-invoice--deposit:not(.deposit-print-hidden) .deposit-invoice__print-head::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 5px;
        background: linear-gradient(180deg, #2563eb 0%, #059669 100%);
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    #depositLedger .deposit-print-identity {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    #depositLedger .deposit-print-identity__avatar {
        width: 40px;
        height: 40px;
        border-radius: 11px;
        font-size: 13px;
        color: #1d4ed8 !important;
        background: #fff !important;
        box-shadow: 0 1px 2px rgba(37, 99, 235, 0.12), inset 0 0 0 1px #bfdbfe;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    #depositLedger .deposit-print-identity__name {
        font-size: 18px;
        font-weight: 800;
        letter-spacing: -0.02em;
        color: #0f172a;
        line-height: 1.15;
    }

    #depositLedger .deposit-print-identity__nth {
        font-size: 11px;
        font-weight: 700;
        padding: 2px 8px;
        border-radius: 999px;
        background: #ecfdf5 !important;
        color: #047857 !important;
        border: 1px solid #6ee7b7 !important;
        box-shadow: none;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    #depositLedger .deposit-print-identity__sub {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px 6px;
        margin-top: 1px;
    }

    #depositLedger .deposit-print-identity__role {
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #64748b;
    }

    #depositLedger .deposit-print-identity__dot {
        color: #94a3b8;
        font-size: 11px;
    }

    #depositLedger .deposit-print-identity__terms {
        font-size: 12px;
        font-weight: 600;
        color: #334155;
        line-height: 1.35;
    }

    #depositLedger .deposit-print-identity__stats {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        margin-top: 8px;
    }

    #depositLedger .deposit-print-identity__stats .deposit-fold-metric {
        flex: 1 1 0;
        min-width: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
        padding: 5px 7px;
        border-radius: 8px;
        background: #fff !important;
        box-shadow: inset 0 0 0 1px #e2e8f0;
        white-space: nowrap;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    #depositLedger .deposit-print-identity__stats .deposit-fold-metric__label {
        font-size: 8px;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    #depositLedger .deposit-print-identity__stats .deposit-fold-metric__value {
        font-size: 12px;
        font-weight: 800;
    }

    #depositLedger .deposit-print-identity__stats .deposit-fold-metric--available {
        box-shadow: inset 0 0 0 1px #a7f3d0;
        background: #ecfdf5 !important;
    }

    #depositLedger .deposit-print-identity__stats .deposit-fold-metric--profit {
        box-shadow: inset 0 0 0 1px #bfdbfe;
        background: #eff6ff !important;
    }

    #depositLedger .deposit-print-identity__stats .deposit-fold-metric--commitment {
        box-shadow: inset 0 0 0 1px #cbd5e1;
        background: #f8fafc !important;
    }

    .acct-invoice.d-none {
        display: none !important;
    }

    .acct-ledger--print-folded .acct-invoice:not(.d-none) .acct-invoice__expand,
    body.acct-ledger-print-folded .acct-invoice:not(.d-none) .acct-invoice__expand {
        display: none !important;
    }

    body.acct-ledger-print-expanded .acct-invoice:not(.d-none) .acct-invoice__expand,
    body.acct-ledger-print-expanded .acct-invoice:not(.d-none) .acct-invoice__expand--print-open,
    .acct-ledger--print-expanded .acct-invoice:not(.d-none) .acct-invoice__expand,
    .acct-ledger--print-expanded .acct-invoice:not(.d-none) .acct-invoice__expand--print-open {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
    }

    body.acct-ledger-print-expanded .acct-invoice:not(.d-none) .acct-invoice__panel,
    .acct-ledger--print-expanded .acct-invoice:not(.d-none) .acct-invoice__panel {
        display: block !important;
        visibility: visible !important;
        overflow: visible !important;
    }

    .acct-invoice:has(.acct-invoice__expand.show),
    .acct-invoice--print-expanded {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .acct-invoice:has(.acct-invoice__expand.show),
    .acct-invoice--print-expanded,
    .acct-invoice--highlight,
    .deposit-ledger-entry--highlight {
        border-color: transparent !important;
        box-shadow: none !important;
    }

    #depositLedger .infinite-scroll__footer,
    #depositLedger .deposit-card__actions,
    #depositLedger .infinite-scroll__load-more,
    #depositLedger > .small.text-muted {
        display: none !important;
    }

    body.acct-ledger-print-folded #depositLedger .acct-invoice--deposit:not(.d-none) > .acct-invoice__expand,
    body.acct-ledger-print-folded #depositLedger .acct-invoice--deposit:not(.d-none) > .acct-invoice__expand.acct-invoice__expand--print-open,
    #depositLedger.acct-ledger--print-folded .acct-invoice--deposit:not(.d-none) > .acct-invoice__expand,
    #depositLedger.acct-ledger--print-folded .acct-invoice--deposit:not(.d-none) > .acct-invoice__expand.acct-invoice__expand--print-open {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
    }

    body.acct-ledger-print-folded #depositLedger .deposit-ledger-entry .acct-invoice__expand,
    #depositLedger.acct-ledger--print-folded .deposit-ledger-entry .acct-invoice__expand {
        display: none !important;
    }

    body.acct-ledger-print-expanded #depositLedger .deposit-ledger-entry .acct-invoice__expand,
    body.acct-ledger-print-expanded #depositLedger .deposit-ledger-entry .acct-invoice__expand--print-open,
    #depositLedger.acct-ledger--print-expanded .deposit-ledger-entry .acct-invoice__expand,
    #depositLedger.acct-ledger--print-expanded .deposit-ledger-entry .acct-invoice__expand--print-open {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
    }

    body.acct-ledger-print-expanded #depositLedger .deposit-ledger-entry .deposit-ledger-entry__panel,
    #depositLedger.acct-ledger--print-expanded .deposit-ledger-entry .deposit-ledger-entry__panel {
        display: block !important;
        visibility: visible !important;
        overflow: visible !important;
    }

    body.acct-ledger-print-expanded #depositLedger .deposit-ledger__pm .collapse,
    #depositLedger.acct-ledger--print-expanded .deposit-ledger__pm .collapse {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
    }

    body.acct-ledger-print-expanded #depositLedger .fund-balance-available-btn,
    #depositLedger.acct-ledger--print-expanded .fund-balance-available-btn {
        border: 0;
        background: transparent;
        padding: 0;
        color: inherit;
        font-weight: inherit;
        pointer-events: none;
    }

    body.deposit-print-single #depositLedger > .acct-ledger__print-head {
        display: none !important;
    }

    .deposit-print-hidden {
        display: none !important;
    }

    body.acct-ledger-print-purchase #depositLedger .acct-invoice--deposit:not(.d-none) > .acct-invoice__expand,
    body.acct-ledger-print-purchase #depositLedger .acct-invoice--deposit:not(.d-none) > .acct-invoice__expand.acct-invoice__expand--print-open,
    #depositLedger.acct-ledger--print-purchase .acct-invoice--deposit:not(.d-none) > .acct-invoice__expand,
    #depositLedger.acct-ledger--print-purchase .acct-invoice--deposit:not(.d-none) > .acct-invoice__expand.acct-invoice__expand--print-open {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
    }

    body.acct-ledger-print-purchase #depositLedger .deposit-ledger-entry:not(.deposit-ledger-entry--investment),
    #depositLedger.acct-ledger--print-purchase .deposit-ledger-entry:not(.deposit-ledger-entry--investment),
    body.acct-ledger-print-purchase #depositLedger .deposit-ledger-entry--investment > .deposit-ledger-entry__fold,
    #depositLedger.acct-ledger--print-purchase .deposit-ledger-entry--investment > .deposit-ledger-entry__fold,
    body.acct-ledger-print-purchase #depositLedger .deposit-ledger-entry--investment > .acct-invoice__expand,
    #depositLedger.acct-ledger--print-purchase .deposit-ledger-entry--investment > .acct-invoice__expand,
    body.acct-ledger-print-purchase #depositLedger .deposit-ledger__pm,
    #depositLedger.acct-ledger--print-purchase .deposit-ledger__pm,
    body.acct-ledger-print-purchase #depositLedger .deposit-card__actions,
    #depositLedger.acct-ledger--print-purchase .deposit-card__actions,
    body.acct-ledger-print-purchase #depositLedger .deposit-ledger__empty,
    #depositLedger.acct-ledger--print-purchase .deposit-ledger__empty {
        display: none !important;
    }

    body.acct-ledger-print-purchase #depositLedger .deposit-purchase-print,
    #depositLedger.acct-ledger--print-purchase .deposit-purchase-print {
        display: flex !important;
        position: relative;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        padding: 10px 12px 10px 14px;
        margin: 0 0 8px;
        border: 0 !important;
        border-radius: 10px;
        background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 55%, #ecfdf5 100%) !important;
        box-shadow: inset 0 0 0 1px #dbeafe;
        overflow: hidden;
        cursor: default;
        pointer-events: none;
        break-inside: avoid;
        page-break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.acct-ledger-print-purchase #depositLedger .deposit-purchase-print::before,
    #depositLedger.acct-ledger--print-purchase .deposit-purchase-print::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 5px;
        background: linear-gradient(180deg, #2563eb 0%, #059669 100%);
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.acct-ledger-print-purchase #depositLedger .deposit-purchase-print__memo,
    #depositLedger.acct-ledger--print-purchase .deposit-purchase-print__memo {
        background: #fff !important;
        color: #1d4ed8 !important;
        box-shadow: inset 0 0 0 1px #bfdbfe;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.acct-ledger-print-purchase #depositLedger .deposit-purchase-print__paid,
    #depositLedger.acct-ledger--print-purchase .deposit-purchase-print__paid {
        background: #ecfeff !important;
        color: #0f766e !important;
        box-shadow: inset 0 0 0 1px #a5f3fc;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.acct-ledger-print-purchase #depositLedger .deposit-purchase-print__side .deposit-fold-metric,
    #depositLedger.acct-ledger--print-purchase .deposit-purchase-print__side .deposit-fold-metric {
        background: #fff !important;
        box-shadow: inset 0 0 0 1px #e2e8f0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.acct-ledger-print-purchase #depositLedger .deposit-purchase-print__side .deposit-fold-metric--invested,
    #depositLedger.acct-ledger--print-purchase .deposit-purchase-print__side .deposit-fold-metric--invested {
        background: #f8fafc !important;
        box-shadow: inset 0 0 0 1px #cbd5e1;
    }

    body.acct-ledger-print-purchase #depositLedger .deposit-purchase-print__side .deposit-fold-metric--profit,
    #depositLedger.acct-ledger--print-purchase .deposit-purchase-print__side .deposit-fold-metric--profit {
        background: #eff6ff !important;
        box-shadow: inset 0 0 0 1px #bfdbfe;
    }

    body.acct-ledger-print-purchase #depositLedger .deposit-ledger:not(:has(.deposit-ledger-entry--investment)) .deposit-purchase-print-empty,
    #depositLedger.acct-ledger--print-purchase .deposit-ledger:not(:has(.deposit-ledger-entry--investment)) .deposit-purchase-print-empty,
    body.acct-ledger-print-purchase #depositLedger .deposit-ledger-panel > .deposit-purchase-print-empty,
    #depositLedger.acct-ledger--print-purchase .deposit-ledger-panel > .deposit-purchase-print-empty {
        display: block !important;
        margin: 0.35rem 0 0;
        padding: 10px 12px;
        border-radius: 10px;
        font-size: 0.9rem;
        color: #64748b;
        background: #f8fafc !important;
        box-shadow: inset 0 0 0 1px #e2e8f0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.acct-ledger-print-purchase #depositLedger .acct-invoice--deposit,
    #depositLedger.acct-ledger--print-purchase .acct-invoice--deposit,
    body.acct-ledger-print-purchase #depositLedger .deposit-ledger-entry--investment,
    #depositLedger.acct-ledger--print-purchase .deposit-ledger-entry--investment,
    body.acct-ledger-print-purchase #depositLedger .acct-invoice__panel,
    #depositLedger.acct-ledger--print-purchase .acct-invoice__panel,
    body.acct-ledger-print-purchase #depositLedger .deposit-ledger,
    #depositLedger.acct-ledger--print-purchase .deposit-ledger,
    body.acct-ledger-print-purchase #depositLedger .deposit-ledger-panel,
    #depositLedger.acct-ledger--print-purchase .deposit-ledger-panel {
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }

    body.acct-ledger-print-purchase #depositLedger.acct-ledger,
    #depositLedger.acct-ledger--print-purchase.acct-ledger,
    body.acct-ledger-print-purchase #depositLedger.mobile-card,
    #depositLedger.acct-ledger--print-purchase.mobile-card {
        background: transparent !important;
        box-shadow: none !important;
        border: 0 !important;
        padding: 0 !important;
    }

    body.acct-ledger-print-purchase #depositLedger .acct-invoice--deposit > .acct-invoice__expand,
    #depositLedger.acct-ledger--print-purchase .acct-invoice--deposit > .acct-invoice__expand {
        margin: 0 !important;
        padding: 0 !important;
    }

    body.acct-ledger-print-purchase #depositLedger .acct-invoice--deposit > .acct-invoice__fold-wrap,
    #depositLedger.acct-ledger--print-purchase .acct-invoice--deposit > .acct-invoice__fold-wrap,
    body.acct-ledger-print-folded #depositLedger .acct-invoice--deposit > .acct-invoice__fold-wrap,
    #depositLedger.acct-ledger--print-folded .acct-invoice--deposit > .acct-invoice__fold-wrap,
    body.acct-ledger-print-expanded #depositLedger .acct-invoice--deposit > .acct-invoice__fold-wrap,
    #depositLedger.acct-ledger--print-expanded .acct-invoice--deposit > .acct-invoice__fold-wrap,
    body.deposit-print-single #depositLedger .acct-invoice--deposit > .acct-invoice__fold-wrap {
        display: none !important;
    }

    body.acct-ledger-print-purchase #depositLedger .deposit-ledger-entry--investment,
    #depositLedger.acct-ledger--print-purchase .deposit-ledger-entry--investment {
        break-inside: avoid;
        page-break-inside: avoid;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    body.acct-ledger-print-purchase #depositLedger .deposit-ledger,
    #depositLedger.acct-ledger--print-purchase .deposit-ledger {
        gap: 0;
        margin-top: 2px;
        flex-direction: column-reverse;
    }
}
