/* BSMS shell polish - SmartBSMS pages stay intact. */

:root {
    --bsms-nav-ink: #1f2937;
    --bsms-nav-muted: #6b7280;
    --bsms-nav-line: #eef0f3;
    --bsms-nav-surface: #f7f8fa;
    --bsms-nav-accent: #f26522;
    --bsms-nav-accent-soft: rgba(242, 101, 34, 0.12);
    --bsms-nav-accent-softer: rgba(242, 101, 34, 0.06);
    --bsms-page-bg: #f4f6f9;

    /* Premium documents: reports, ledgers, invoices */
    --bsms-doc-ink: #182033;
    --bsms-doc-ink-soft: #2a364d;
    --bsms-doc-muted: #64748b;
    --bsms-doc-line: #e6eaf0;
    --bsms-doc-paper: #ffffff;
    --bsms-doc-wash: #f7f8fb;
    --bsms-doc-accent: #f26522;
    --bsms-doc-accent-deep: #d4551a;
    --bsms-doc-credit: #0f7a4a;
    --bsms-doc-debit: #c0392b;
    --bsms-font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Segoe UI", Tahoma, sans-serif;
    --bsms-font-latin: "Segoe UI", Roboto, Tahoma, sans-serif;
}

#blazor-error-ui {
    background: #b32121;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
    color: #fff;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

#blazor-error-ui.show {
    display: block;
}

.sidebar-menu .disabled-link {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

/* ---------- Page canvas ---------- */
.page-wrapper {
    background: var(--bsms-page-bg) !important;
}

.page-wrapper .content {
    padding-top: 1.25rem !important;
}

.page-breadcrumb h2 {
    font-weight: 700 !important;
    letter-spacing: -0.02em;
    color: var(--bsms-nav-ink) !important;
}

.page-breadcrumb .breadcrumb {
    margin-top: 0.35rem;
}

.page-breadcrumb .breadcrumb-item,
.page-breadcrumb .breadcrumb-item a {
    font-size: 13px;
    color: var(--bsms-nav-muted);
}

.page-wrapper .card {
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04) !important;
    overflow: hidden;
}

/* Let SearchableSelect menus escape cards and sit above the next card/table */
.page-wrapper .card:has(.bsms-search-select) {
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

.page-wrapper .card:has(.bsms-search-select) .card-body,
.page-wrapper .card:has(.bsms-search-select) fieldset {
    overflow: visible !important;
}

/* Only the card with an open dropdown rises above siblings (fixes dealer under stock lines). */
.page-wrapper .card:has(.bsms-search-select:has(.bsms-search-select-menu)),
.page-wrapper .card:has(.bsms-name-suggest:has(.bsms-name-suggest-menu)) {
    z-index: 40;
}

.bsms-search-select {
    position: relative;
    z-index: 1;
}

.bsms-search-select:has(.bsms-search-select-menu) {
    z-index: 1060;
}

.bsms-name-suggest {
    position: relative;
    z-index: 1;
}

.bsms-name-suggest:has(.bsms-name-suggest-menu) {
    z-index: 1060;
}

.bsms-name-suggest-menu {
    max-height: 240px;
    overflow-y: auto;
    margin-top: 2px;
}

.bsms-name-suggest .dropdown-item.active {
    background: rgba(242, 101, 34, 0.12);
    color: inherit;
}

.page-wrapper .card-header {
    background: #fff !important;
    border-bottom: 1px solid var(--bsms-nav-line) !important;
    padding: 1rem 1.25rem !important;
}

.page-wrapper .btn-primary {
    border-radius: 10px !important;
    font-weight: 600 !important;
    box-shadow: 0 6px 14px rgba(242, 101, 34, 0.22);
}

.page-wrapper .btn-success,
.page-wrapper .btn-light {
    border-radius: 10px !important;
    font-weight: 600 !important;
}

/* ---------- Top bar ---------- */
.header.bsms-topbar {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bsms-nav-line) !important;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.header.bsms-topbar .bsms-topbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative !important;
    overflow: visible !important;
    background: var(--bsms-nav-surface) !important;
    border: 1px solid transparent !important;
    color: var(--bsms-nav-ink) !important;
}

.header.bsms-topbar .bsms-topbar-btn:hover {
    background: #fff !important;
    border-color: var(--bsms-nav-line) !important;
    color: var(--bsms-nav-accent) !important;
}

.header.bsms-topbar .bsms-topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-inline-start: 12px;
    padding: 4px;
    flex-shrink: 0;
}

.header.bsms-topbar .bsms-topbar-divider {
    width: 1px;
    height: 28px;
    background: var(--bsms-nav-line);
    opacity: 0.9;
}

.header.bsms-topbar .bsms-topbar-icon-btn {
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    border-radius: 14px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative !important;
    overflow: visible !important;
    background: #fff !important;
    border: 1px solid var(--bsms-nav-line) !important;
    color: var(--bsms-nav-ink) !important;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color .15s ease, box-shadow .15s ease, color .15s ease, background .15s ease;
}

.header.bsms-topbar .bsms-topbar-icon-btn:hover,
.header.bsms-topbar .bsms-topbar-icon-btn.show {
    background: #fff !important;
    border-color: rgba(242, 101, 34, 0.35) !important;
    color: var(--bsms-nav-accent) !important;
    box-shadow: 0 0 0 3px rgba(242, 101, 34, 0.1);
}

.header.bsms-topbar .bsms-topbar-icon-btn.dropdown-toggle::after {
    display: none !important;
}

.header.bsms-topbar .bsms-lang-btn {
    /* Wide enough for both EN and اردو so the header does not jump on switch */
    min-width: 88px;
    padding: 0 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.header.bsms-topbar .bsms-lang-code {
    display: inline-block;
    min-width: 2.75rem;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.header.bsms-topbar .bsms-lang-code.is-urdu,
.bsms-lang-menu .bsms-lang-code-inline.is-urdu {
    font-family: var(--bsms-font-urdu, "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Segoe UI", Tahoma, sans-serif);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
}

body:not(.locale-ur) .header.bsms-topbar .bsms-lang-code:not(.is-urdu) {
    font-family: inherit;
    font-size: 11px;
}

.bsms-lang-menu .bsms-lang-code-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    margin-right: 8px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--bsms-nav-surface);
    font-size: 11px;
    font-weight: 800;
}

.bsms-lang-menu .dropdown-item.active {
    background: rgba(242, 101, 34, 0.1);
    color: var(--bsms-nav-ink);
}

.header.bsms-topbar .bsms-notif-count {
    position: absolute;
    top: -5px;
    right: -5px;
    z-index: 5;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e11d48;
    color: #fff !important;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
    pointer-events: none;
}

.header.bsms-topbar .bsms-topbar-profile {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    max-width: 240px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--bsms-nav-line);
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.header.bsms-topbar .bsms-topbar-profile:hover,
.header.bsms-topbar .bsms-topbar-profile.show {
    border-color: rgba(242, 101, 34, 0.35);
    box-shadow: 0 0 0 3px rgba(242, 101, 34, 0.1);
}

.header.bsms-topbar .bsms-topbar-profile.dropdown-toggle::after {
    display: none !important;
}

.header.bsms-topbar .bsms-topbar-profile .avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.header.bsms-topbar .bsms-topbar-user {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.header.bsms-topbar .bsms-topbar-user .name {
    max-width: 140px;
    overflow: hidden;
    color: var(--bsms-nav-ink);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header.bsms-topbar .bsms-topbar-user .role {
    max-width: 140px;
    overflow: hidden;
    color: var(--bsms-nav-muted);
    font-size: 11px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header.bsms-topbar .bsms-topbar-chevron {
    margin-left: 2px;
    color: var(--bsms-nav-muted);
    font-size: 14px;
}

.bsms-account-dropdown {
    width: min(280px, 92vw);
    border: 1px solid var(--bsms-nav-line);
    border-radius: 14px;
    overflow: hidden;
}

.bsms-account-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(180deg, #fff8f3 0%, #fff 100%);
    border-bottom: 1px solid var(--bsms-nav-line);
}

.bsms-account-body,
.bsms-account-foot {
    padding: 8px;
}

.bsms-account-foot {
    border-top: 1px solid var(--bsms-nav-line);
}

.bsms-account-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--bsms-nav-ink);
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
}

.bsms-account-link i {
    color: var(--bsms-nav-muted);
    font-size: 16px;
}

.bsms-account-link:hover {
    background: var(--bsms-nav-surface);
    color: var(--bsms-nav-accent);
}

.bsms-account-link:hover i {
    color: var(--bsms-nav-accent);
}

.bsms-account-link.is-danger {
    color: #be123c;
}

.bsms-account-link.is-danger i {
    color: #be123c;
}

.bsms-account-link.is-danger:hover {
    background: #fff1f2;
}

@media (max-width: 991.98px) {
    .header.bsms-topbar .bsms-topbar-actions {
        gap: 10px;
    }

    .header.bsms-topbar .bsms-lang-btn {
        min-width: 72px;
        padding: 0 8px;
    }

    .header.bsms-topbar .bsms-lang-btn .bsms-lang-code {
        min-width: 0;
        font-size: 11px;
    }

    .header.bsms-topbar .bsms-lang-btn .bsms-lang-code.is-urdu {
        font-size: 12px;
    }
}

.bsms-notif-dropdown {
    width: min(360px, 92vw);
    border: 1px solid var(--bsms-nav-line);
    border-radius: 12px;
    overflow: hidden;
}

.bsms-notif-head,
.bsms-notif-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .65rem .85rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--bsms-nav-line);
}

.bsms-notif-foot {
    border-bottom: 0;
    border-top: 1px solid var(--bsms-nav-line);
}

.bsms-notif-body {
    max-height: 320px;
    overflow: auto;
}

.bsms-notif-item {
    padding: .65rem .85rem;
    border-bottom: 1px solid #f1f5f9;
}

.bsms-notif-item:last-child {
    border-bottom: 0;
}

.bsms-dashboard {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.bsms-dashboard > .row {
    --bs-gutter-y: 1.25rem;
}

.bsms-dashboard .bsms-dash-stat {
    border: 1px solid var(--bsms-nav-line, #e2e8f0);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    height: 100%;
}

.bsms-dashboard .bsms-dash-stat .card-body {
    padding: 1.1rem 1.15rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.bsms-dashboard .bsms-dash-stat-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 auto;
}

.bsms-dashboard .bsms-dash-stat-label {
    font-size: .75rem;
    font-weight: 650;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.2;
    margin-bottom: .2rem;
}

.bsms-dashboard .bsms-dash-stat-value {
    font-size: clamp(0.95rem, 3.6vw, 1.55rem);
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.15;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.bsms-dashboard .bsms-dash-stat-hint {
    margin-top: .35rem;
    font-size: .75rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.3;
    min-height: 1.3em;
}

.bsms-dashboard .bsms-dash-compact {
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.045);
    overflow: hidden;
}

.bsms-dashboard .bsms-dash-compact .bsms-dash-panel-top-sm {
    padding: .85rem 1.1rem;
    gap: .75rem;
    flex-wrap: wrap;
    row-gap: .65rem;
}

.bsms-dashboard .bsms-dash-compact h5 {
    font-size: 1rem;
    font-weight: 750;
    color: #0f172a;
}

.bsms-dashboard .bsms-dash-compact .bsms-dash-panel-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 1rem;
}

.bsms-dashboard .bsms-dash-inline-kpis {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.bsms-dashboard .bsms-dash-chip {
    display: inline-flex;
    align-items: baseline;
    gap: .4rem;
    padding: .35rem .65rem;
    border-radius: 9px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    line-height: 1.2;
}

.bsms-dashboard .bsms-dash-chip span {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #64748b;
}

.bsms-dashboard .bsms-dash-chip strong {
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.bsms-dashboard .bsms-dash-dense-table {
    font-size: .85rem;
}

.bsms-dashboard .bsms-dash-dense-table thead th {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    padding: .55rem .85rem !important;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.bsms-dashboard .bsms-dash-dense-table td {
    padding: .55rem .85rem !important;
    border-color: #f1f5f9;
    vertical-align: middle;
}

.bsms-dashboard .bsms-dash-name {
    font-weight: 650;
    color: #334155;
    max-width: 14rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bsms-dashboard .bsms-dash-compact .bsms-dash-panel-subhead {
    padding: .55rem .85rem;
    background: #f8fafc;
}

.bsms-dashboard .bsms-dash-compact .bsms-dash-panel-subhead span:first-child {
    font-size: .7rem;
}

.bsms-dashboard .bsms-dash-compact .bsms-dash-panel-subhead strong {
    font-size: .92rem;
}

.bsms-dashboard .bsms-dash-recovery-scroll {
    max-height: 360px;
    overflow: auto;
    border-top: 1px solid #e2e8f0;
}

.bsms-dashboard .bsms-bal-chip {
    min-width: 4rem;
    padding: .2rem .55rem;
    border-radius: 7px;
}

.bsms-dash-stat {
    border: 1px solid var(--bsms-nav-line, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.bsms-dash-stat .card-body {
    padding: .85rem 1rem;
}

.bsms-dash-stat-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.bsms-dash-stat-label {
    font-size: .72rem;
    font-weight: 650;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: 1.2;
}

.bsms-dash-stat-value {
    font-size: clamp(0.95rem, 3.6vw, 1.35rem);
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.bsms-dash-stat-action {
    flex-shrink: 0;
    white-space: nowrap;
}

.bsms-dash-panel-cash::before {
    background: linear-gradient(180deg, #0f766e, #14b8a6);
}

.bsms-dash-panel-cash .bsms-dash-panel-top {
    background: linear-gradient(90deg, #f0fdfa 0%, #fff 55%);
    border-bottom-color: rgba(15, 118, 110, 0.12);
}

.bsms-dash-panel-icon.cash {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.28);
}

.bsms-dash-compact {
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.bsms-dash-compact .bsms-dash-panel-top-sm {
    padding: .45rem .75rem .45rem .95rem;
    gap: .5rem;
    flex-wrap: wrap;
}

.bsms-dash-compact h5 {
    font-size: .95rem;
    font-weight: 750;
    color: #0f172a;
}

.bsms-dash-compact .bsms-dash-panel-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: .88rem;
}

.bsms-dash-inline-kpis {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
}

.bsms-dash-chip {
    display: inline-flex;
    align-items: baseline;
    gap: .35rem;
    padding: .2rem .5rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    line-height: 1.15;
}

.bsms-dash-chip span {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #64748b;
}

.bsms-dash-chip strong {
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.bsms-dash-chip.is-in {
    background: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.18);
}

.bsms-dash-chip.is-in strong { color: #15803d; }

.bsms-dash-chip.is-out {
    background: rgba(220, 38, 38, 0.07);
    border-color: rgba(220, 38, 38, 0.16);
}

.bsms-dash-chip.is-out strong { color: #b91c1c; }

.bsms-dash-cta {
    width: 30px;
    height: 30px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bsms-dash-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.bsms-dash-split-col {
    border-right: 1px solid #eef2f7;
    min-width: 0;
}

.bsms-dash-split-col:last-child {
    border-right: 0;
}

.bsms-dash-dense-table {
    font-size: .78rem;
}

.bsms-dash-dense-table thead th {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    padding: .28rem .55rem !important;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.bsms-dash-dense-table td {
    padding: .28rem .55rem !important;
    border-color: #f1f5f9;
    vertical-align: middle;
}

.bsms-dash-dense-table tbody tr:hover td {
    background: #f8fafc;
}

.bsms-dash-dense-table tbody tr.bsms-dash-total-row td {
    font-weight: 650;
    border-top: 1px solid #e5e7eb;
    background: #fafbfc;
}

.bsms-dash-name {
    font-weight: 650;
    color: #334155;
    max-width: 11rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bsms-amt-in { color: #15803d; font-weight: 700; }
.bsms-dash-num-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.bsms-dash-num-link:hover {
  color: var(--bs-primary, #0d6efd);
  border-bottom-style: solid;
}
.bsms-amt-out { color: #b91c1c; font-weight: 700; }
.bsms-amt-mute { color: #64748b; font-weight: 600; }

.bsms-amt-in em,
.bsms-amt-mute em {
    font-style: normal;
    font-weight: 600;
    color: #94a3b8;
    font-size: .78em;
}

.bsms-bal-chip {
    display: inline-block;
    min-width: 3.5rem;
    padding: .12rem .4rem;
    border-radius: 6px;
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
    font-weight: 800;
    text-align: end;
}

.bsms-dash-compact .bsms-dash-panel-subhead {
    padding: .32rem .55rem;
    background: #f8fafc;
}

.bsms-dash-compact .bsms-dash-panel-subhead span:first-child {
    font-size: .62rem;
}

.bsms-dash-compact .bsms-dash-panel-subhead strong {
    font-size: .82rem;
}

@media (max-width: 767.98px) {
    .bsms-dash-split {
        grid-template-columns: 1fr;
    }

    .bsms-dash-split-col {
        border-right: 0;
        border-bottom: 1px solid #eef2f7;
    }

    .bsms-dash-split-col:last-child {
        border-bottom: 0;
    }
}


.header.bsms-topbar .bsms-topbar-search {
    min-width: 280px;
    background: var(--bsms-nav-surface);
    border: 1px solid transparent;
    border-radius: 12px;
    overflow: hidden;
}

.header.bsms-topbar .bsms-topbar-search:focus-within {
    background: #fff;
    border-color: rgba(242, 101, 34, 0.35);
    box-shadow: 0 0 0 3px rgba(242, 101, 34, 0.1);
}

.header.bsms-topbar .bsms-topbar-search .form-control,
.header.bsms-topbar .bsms-topbar-search .input-group-text {
    background: transparent !important;
    box-shadow: none !important;
}

.header.bsms-topbar .bsms-topbar-search kbd {
    font-size: 10px;
    background: #fff;
    border: 1px solid var(--bsms-nav-line);
    border-radius: 6px;
    color: var(--bsms-nav-muted);
}

/* ---------- Modern sidenav ---------- */
.sidebar.bsms-sidenav {
    display: flex !important;
    flex-direction: column !important;
    background:
        radial-gradient(1200px 280px at 0% 0%, rgba(242, 101, 34, 0.07), transparent 55%),
        #ffffff;
    border-right: 1px solid var(--bsms-nav-line);
    box-shadow: 4px 0 28px rgba(15, 23, 42, 0.05);
}

/* Brand sits in normal flow (not fixed) so menu never slides underneath */
.sidebar.bsms-sidenav .bsms-sidenav-brand,
.sidebar.bsms-sidenav .sidebar-logo.bsms-sidenav-brand {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: center;
    width: 100% !important;
    height: auto !important;
    min-height: 64px !important;
    max-height: none !important;
    gap: 0;
    z-index: 3;
    overflow: hidden;
    border-bottom: 1px solid var(--bsms-nav-line);
    background:
        radial-gradient(120% 90% at 0% 0%, rgba(242, 101, 34, 0.10), transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #f7f8fb 100%);
    padding: 10px 14px !important;
}

/* Scrollable menu fills the rest — no margin-top offset needed */
.sidebar.bsms-sidenav .sidebar-inner,
.sidebar.bsms-sidenav [data-simplebar].sidebar-inner {
    position: relative !important;
    top: auto !important;
    margin-top: 0 !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}
.sidebar.bsms-sidenav .slimScrollDiv {
    position: relative !important;
    margin-top: 0 !important;
    top: auto !important;
    height: 100% !important;
    padding: 0 !important;
}
.sidebar.bsms-sidenav .simplebar-wrapper,
.sidebar.bsms-sidenav .simplebar-mask,
.sidebar.bsms-sidenav .simplebar-offset,
.sidebar.bsms-sidenav .simplebar-content-wrapper,
.sidebar.bsms-sidenav .simplebar-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
.sidebar.bsms-sidenav .simplebar-content-wrapper {
    height: 100% !important;
    max-height: 100% !important;
}
.sidebar.bsms-sidenav .sidebar-menu {
    padding: 8px 12px 20px !important;
    margin-top: 0 !important;
}
.sidebar.bsms-sidenav .sidebar-menu > ul {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.sidebar.bsms-sidenav .bsms-sidenav-logo-link {
    display: flex !important;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none !important;
}
.sidebar.bsms-sidenav .bsms-sidenav-brand .dark-logo,
.sidebar.bsms-sidenav .bsms-sidenav-brand .logo-small {
    display: none !important;
}
.sidebar.bsms-sidenav .bsms-sidenav-logo-plate {
    display: grid;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    place-items: center;
    padding: 2px;
    border: 1px solid #eee6d8;
    border-radius: 11px;
    background: linear-gradient(165deg, #ffffff 0%, #f7f3ea 100%);
    box-shadow: 0 6px 16px rgba(175, 95, 6, 0.10);
}
.sidebar.bsms-sidenav .bsms-sidenav-logo-plate.is-compact {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    padding: 3px;
}
.sidebar.bsms-sidenav .bsms-sidenav-brand .logo img,
.sidebar.bsms-sidenav .bsms-sidenav-brand .logo-small img,
.sidebar.bsms-sidenav .bsms-sidenav-brand .dark-logo img,
.bsms-topbar .header-left .logo img,
.bsms-topbar .header-left .dark-logo img {
    max-height: 34px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.sidebar.bsms-sidenav .bsms-sidenav-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}
.sidebar.bsms-sidenav .bsms-sidenav-business {
    color: #182033;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar.bsms-sidenav .bsms-sidenav-product {
    margin-top: 3px;
    color: #f26522;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.sidebar.bsms-sidenav .bsms-sidenav-tagline {
    display: none;
}

.mini-sidebar .sidebar.bsms-sidenav .bsms-sidenav-brand {
    align-items: center;
    padding-inline: 10px;
}
.mini-sidebar .sidebar.bsms-sidenav .bsms-sidenav-brand .logo-normal {
    display: none !important;
}
.mini-sidebar .sidebar.bsms-sidenav .bsms-sidenav-brand .logo-small {
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.mini-sidebar .sidebar.bsms-sidenav .bsms-sidenav-brand-text {
    display: none;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li {
    margin-bottom: 4px !important;
}

.sidebar.bsms-sidenav .menu-title {
    margin: 6px 6px 8px;
    padding: 0;
}

.sidebar.bsms-sidenav .menu-title span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li > a,
.sidebar.bsms-sidenav .sidebar-menu > ul > li > .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    color: var(--bsms-nav-ink) !important;
    background: #fff !important;
    border: 1px solid var(--bsms-nav-line) !important;
    box-shadow: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li > a:hover {
    background: var(--bsms-nav-accent-softer) !important;
    border-color: rgba(242, 101, 34, 0.22) !important;
    box-shadow: none;
    transform: none;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li > a i,
.sidebar.bsms-sidenav .sidebar-menu > ul > li > a .ti {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0 !important;
    border-radius: 8px;
    background: var(--bsms-nav-surface);
    color: var(--bsms-nav-muted) !important;
    font-size: 15px;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li > a span {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--bsms-nav-ink) !important;
    line-height: 1.25;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li > a:hover i,
.sidebar.bsms-sidenav .sidebar-menu > ul > li > a:hover .ti {
    background: #fff;
    color: var(--bsms-nav-accent) !important;
    box-shadow: none;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li > a.active,
.sidebar.bsms-sidenav .sidebar-menu > ul > li > a.subdrop,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.active > a,
.sidebar.bsms-sidenav .sidebar-menu a.active {
    background: linear-gradient(90deg, var(--bsms-nav-accent-soft), #fff8f3) !important;
    color: var(--bsms-nav-accent) !important;
    border-color: rgba(242, 101, 34, 0.28) !important;
    box-shadow: inset 3px 0 0 var(--bsms-nav-accent);
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li > a.active span,
.sidebar.bsms-sidenav .sidebar-menu > ul > li > a.subdrop span,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.active > a span,
.sidebar.bsms-sidenav .sidebar-menu a.active span {
    color: var(--bsms-nav-accent) !important;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li > a.active i,
.sidebar.bsms-sidenav .sidebar-menu > ul > li > a.subdrop i,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.active > a i,
.sidebar.bsms-sidenav .sidebar-menu a.active i,
.sidebar.bsms-sidenav .sidebar-menu > ul > li > a.active .ti,
.sidebar.bsms-sidenav .sidebar-menu > ul > li > a.subdrop .ti,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.active > a .ti,
.sidebar.bsms-sidenav .sidebar-menu a.active .ti {
    background: #fff !important;
    color: var(--bsms-nav-accent) !important;
    box-shadow: none;
}

.sidebar.bsms-sidenav .sidebar-menu .menu-arrow {
    width: 18px !important;
    height: 18px !important;
    border-radius: 999px !important;
    background: transparent !important;
    right: 8px !important;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li > a.active .menu-arrow,
.sidebar.bsms-sidenav .sidebar-menu > ul > li > a.subdrop .menu-arrow {
    background: #fff !important;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul.submenu-panel {
    margin: 6px 0 10px 6px !important;
    padding: 2px 0 2px 10px !important;
    border: 0 !important;
    border-left: 1px solid #e8eaed !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    animation: bsmsNavIn 0.16s ease;
}

/* Theme hides every nested ul under .submenu — keep panel + section items visible when open */
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu.active > ul.submenu-panel,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul.submenu-panel[style*="display:block"],
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul.submenu-panel[style*="display: block"] {
    display: block !important;
}

.sidebar.bsms-sidenav .nav-section {
    list-style: none;
    margin: 10px 0 4px !important;
    padding: 0;
}

.sidebar.bsms-sidenav .nav-section:first-child {
    margin-top: 4px !important;
}

.sidebar.bsms-sidenav .nav-section-label {
    padding: 4px 10px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    line-height: 1.2;
    user-select: none;
}

.sidebar.bsms-sidenav .nav-section-items {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

.sidebar.bsms-sidenav .nav-section-items > .nav-leaf {
    list-style: none;
    margin: 1px 0 !important;
    display: block;
}

.sidebar.bsms-sidenav .nav-section-items > .nav-leaf > a,
.sidebar.bsms-sidenav .nav-section-items > .nav-leaf > .nav-link {
    padding-inline-start: 10px !important;
}

.sidebar.bsms-sidenav .nav-leaf-nested > a,
.sidebar.bsms-sidenav .nav-leaf-nested > .nav-link {
    padding-inline-start: 12px !important;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul > li {
    margin: 1px 0 !important;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul a,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    color: #64748b !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    position: relative;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul a i,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul a .ti,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul .nav-link i,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul .nav-link .ti {
    width: auto;
    height: auto;
    margin: 0 !important;
    padding: 0;
    border-radius: 0;
    background: transparent !important;
    color: #94a3b8 !important;
    font-size: 14px;
    box-shadow: none !important;
    flex-shrink: 0;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul a span,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul .nav-link span {
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    margin-left: 0 !important;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul a:hover,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul .nav-link:hover {
    background: #f4f5f7 !important;
    border: 0 !important;
    color: #1e293b !important;
    box-shadow: none !important;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul a:hover i,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul .nav-link:hover i {
    color: #64748b !important;
    background: transparent !important;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul li.active > a,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul li.active > .nav-link,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul a.active,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul .nav-link.active {
    background: rgba(242, 101, 34, 0.08) !important;
    border: 0 !important;
    color: var(--bsms-nav-accent) !important;
    font-weight: 600 !important;
    box-shadow: inset 2px 0 0 var(--bsms-nav-accent) !important;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul li.active > a i,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul li.active > .nav-link i,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul a.active i,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul .nav-link.active i {
    color: var(--bsms-nav-accent) !important;
    background: transparent !important;
}

.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul a.active::before,
.sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul li.active > a::before {
    display: none;
}

body.locale-ur.layout-mode-rtl .sidebar.bsms-sidenav {
    border-right: 0;
    border-left: 1px solid var(--bsms-nav-line);
    box-shadow: -4px 0 28px rgba(15, 23, 42, 0.05);
}

body.locale-ur.layout-mode-rtl .sidebar.bsms-sidenav .sidebar-menu > ul > li > a:hover {
    transform: none;
}

body.locale-ur.layout-mode-rtl .sidebar.bsms-sidenav .sidebar-menu > ul > li > a.active,
body.locale-ur.layout-mode-rtl .sidebar.bsms-sidenav .sidebar-menu > ul > li > a.subdrop,
body.locale-ur.layout-mode-rtl .sidebar.bsms-sidenav .sidebar-menu > ul > li.active > a {
    box-shadow: inset -3px 0 0 var(--bsms-nav-accent);
}

body.locale-ur.layout-mode-rtl .sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul,
body.locale-ur.layout-mode-rtl .sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul.submenu-panel {
    margin: 6px 6px 10px 0 !important;
    padding: 2px 10px 2px 0 !important;
    border-left: 0 !important;
    border-right: 1px solid #e8eaed !important;
}

body.locale-ur.layout-mode-rtl .sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul li.active > a,
body.locale-ur.layout-mode-rtl .sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul li.active > .nav-link,
body.locale-ur.layout-mode-rtl .sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul a.active,
body.locale-ur.layout-mode-rtl .sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul .nav-link.active {
    box-shadow: inset -2px 0 0 var(--bsms-nav-accent) !important;
}

body.locale-ur.layout-mode-rtl .sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul a.active::before,
body.locale-ur.layout-mode-rtl .sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul li.active > a::before {
    display: none;
}

@keyframes bsmsNavIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.bsms-table thead th {
    white-space: nowrap;
}

.bsms-search {
    min-width: 240px;
}

.bsms-search-select-menu {
    max-height: 260px;
    overflow-y: auto;
    z-index: 1060;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.bsms-search-select .dropdown-item.active {
    background-color: var(--bs-primary);
    color: #fff;
}

.purchase-header-card {
    overflow: visible !important;
    position: relative;
    z-index: 2;
}

.purchase-header-card:has(.bsms-search-select-menu) {
    z-index: 50;
}

.purchase-stock-card {
    overflow: visible;
    position: relative;
    z-index: 1;
}

.purchase-stock-table {
    overflow-x: auto;
    overflow-y: visible;
    min-height: 280px;
    padding-bottom: 12rem;
    -webkit-overflow-scrolling: touch;
}

.purchase-return-bulk-card .card-header,
.purchase-return-id-card .card-header {
    padding: 1.25rem 1.5rem;
}

.purchase-return-bulk-card .card-body,
.purchase-return-id-card .card-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.purchase-return-bulk-table td,
.purchase-return-bulk-table th,
.purchase-return-id-table td,
.purchase-return-id-table th {
    padding: 0.9rem 1rem;
    vertical-align: middle;
}

.purchase-return-qty {
    min-height: 3rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.purchase-return-summary-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: none;
}

.purchase-return-summary-card .card-body {
    padding: 1.25rem 1.5rem;
}

/* Supplier statement */
.supplier-statement-filter .card-header,
.supplier-ledger-card .card-header {
    padding: 1.25rem 1.5rem;
}

.supplier-statement-filter .card-body {
    padding: 1.5rem;
}

.supplier-statement-filter .form-label {
    font-size: 0.95rem;
    font-weight: 600;
}

.supplier-statement-filter .bsms-search-select .form-control {
    min-height: 48px;
    font-size: 1rem;
}

.supplier-balance-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.05);
}

.supplier-balance-card-primary {
    border-color: rgba(var(--bs-primary-rgb), 0.28);
}

.supplier-balance-card .card-body {
    position: relative;
    min-height: 135px;
    padding: 1.35rem 1.5rem;
}

.supplier-balance-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    font-size: 1.3rem;
}

.supplier-balance-label {
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.supplier-balance-value {
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
}

.supplier-entry-count,
.supplier-voucher-badge {
    padding: 0.45rem 0.7rem;
    font-size: 0.82rem;
}

.supplier-ledger-table th {
    padding: 1rem 1.15rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.supplier-ledger-table td {
    padding: 1rem 1.15rem;
    font-size: 0.98rem;
}

/* Shared report UI */
.report-stat-card {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(24, 32, 51, 0.06);
    background:
        linear-gradient(180deg, #fff 0%, var(--bsms-doc-wash) 100%);
    position: relative;
}

.report-stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--bsms-doc-ink-soft);
}

.report-stat-card .card-body {
    padding: 0.85rem 1rem 0.9rem 1.05rem;
    min-height: 88px;
}

.report-stat-top {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.35rem;
}

.report-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex: 0 0 auto;
}

.report-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bsms-doc-muted);
    line-height: 1.2;
}

.report-stat-value {
    font-size: clamp(1.25rem, 1.9vw, 1.65rem);
    font-weight: 780;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--bsms-doc-ink);
    font-variant-numeric: tabular-nums;
}

.report-stat-hint {
    margin-top: 0.25rem;
    font-size: 0.7rem;
    color: #94a3b8;
}

.report-stat-card-neutral::before { background: var(--bsms-doc-ink-soft); }
.report-stat-card-neutral .report-stat-icon { background: #eef2f7; color: var(--bsms-doc-ink); }
.report-stat-card-debit::before { background: var(--bsms-doc-debit); }
.report-stat-card-debit .report-stat-icon { background: #fde8e6; color: var(--bsms-doc-debit); }
.report-stat-card-debit .report-stat-value { color: var(--bsms-doc-debit); }
.report-stat-card-credit::before { background: var(--bsms-doc-credit); }
.report-stat-card-credit .report-stat-icon { background: #e4f7ee; color: var(--bsms-doc-credit); }
.report-stat-card-credit .report-stat-value { color: var(--bsms-doc-credit); }
.report-stat-card-primary::before { background: var(--bsms-doc-accent); }
.report-stat-card-primary .report-stat-icon { background: var(--bsms-nav-accent-soft); color: var(--bsms-doc-accent); }
.report-stat-card-primary .report-stat-value { color: var(--bsms-doc-accent-deep); }
.report-stat-card-warning::before { background: #d97706; }
.report-stat-card-warning .report-stat-icon { background: #fff4e5; color: #c2410c; }
.report-stat-card-warning .report-stat-value { color: #c2410c; }

.report-export-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.report-export-bar .btn {
    font-weight: 650;
    border-radius: 10px;
}

/* Premium on-screen / print report surfaces */
.bsms-print-root .card {
    border: 1px solid var(--bsms-doc-line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(24, 32, 51, 0.05);
}

.bsms-print-root .card-header {
    background: linear-gradient(180deg, #fcfdff 0%, #f4f6fa 100%);
    border-bottom: 1px solid var(--bsms-doc-line);
    padding: 0.9rem 1.1rem;
}

.bsms-print-root .card-header h5 {
    color: var(--bsms-doc-ink);
    font-weight: 750;
    letter-spacing: -0.02em;
    font-size: 1.15rem;
    line-height: 1.3;
}

.page-breadcrumb h2 {
    color: var(--bsms-doc-ink);
    font-weight: 780;
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    letter-spacing: -0.03em;
    line-height: 1.25;
}

.bsms-print-root .table {
    --bs-table-hover-bg: rgba(242, 101, 34, 0.04);
    margin-bottom: 0;
    font-variant-numeric: tabular-nums;
}

.bsms-print-root .table thead th,
.bsms-print-root .thead-light th {
    background: var(--bsms-doc-ink) !important;
    color: #fff !important;
    border-bottom: 0 !important;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.8rem 0.95rem;
    white-space: nowrap;
}

.bsms-print-root .table tbody td {
    padding: 0.7rem 0.9rem;
    border-color: #edf0f5;
    color: #334155;
    vertical-align: middle;
}

.bsms-print-root .table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.bsms-print-root .table tbody tr:last-child td {
    border-bottom: 0;
}

.bsms-print-root .text-danger { color: var(--bsms-doc-debit) !important; }
.bsms-print-root .text-success { color: var(--bsms-doc-credit) !important; }
.bsms-print-root .text-primary { color: var(--bsms-doc-accent-deep) !important; }

.bsms-print-root .badge-soft-primary {
    background: var(--bsms-nav-accent-soft);
    color: var(--bsms-doc-accent-deep);
    font-weight: 700;
}

@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .bsms-print-root .report-stat-card {
        box-shadow: none;
        border: 1px solid var(--bsms-doc-line);
    }

    .bsms-print-root .table thead th,
    .bsms-print-root .thead-light th {
        background: #182033 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .bsms-print-root .text-primary,
    .bsms-print-root .text-danger {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

.report-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.purchase-form-actions {
    margin-top: 1.5rem;
    padding-bottom: 4rem;
}

.bsms-date-quick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.85rem;
}

.bsms-date-quick-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.15rem;
}

.bsms-date-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.bsms-date-quick-btns .btn {
    border-radius: 999px;
    padding: 0.28rem 0.75rem;
    font-weight: 600;
}

body.locale-ur {
    --bsms-font-ui: var(--bsms-font-urdu);
    font-family: var(--bsms-font-urdu);
    line-height: 1.85;
}

/* Beat theme Roboto rules (body / headings / controls) with higher specificity */
body.locale-ur,
body.locale-ur h1, body.locale-ur .h1,
body.locale-ur h2, body.locale-ur .h2,
body.locale-ur h3, body.locale-ur .h3,
body.locale-ur h4, body.locale-ur .h4,
body.locale-ur h5, body.locale-ur .h5,
body.locale-ur h6, body.locale-ur .h6,
body.locale-ur p,
body.locale-ur .header,
body.locale-ur .sidebar,
body.locale-ur .sidebar-menu,
body.locale-ur .sidebar-menu a,
body.locale-ur .sidebar-menu span,
body.locale-ur .menu-title,
body.locale-ur .page-breadcrumb h2,
body.locale-ur .card-header h5,
body.locale-ur .form-label,
body.locale-ur .btn,
body.locale-ur .dropdown-item,
body.locale-ur .breadcrumb,
body.locale-ur .badge,
body.locale-ur .content,
body.locale-ur .card,
body.locale-ur .form-control,
body.locale-ur .form-select,
body.locale-ur .table,
body.locale-ur .table th,
body.locale-ur .table td,
body.locale-ur .dropdown-menu,
body.locale-ur .page-header,
body.locale-ur .modal-content,
body.locale-ur .alert,
body.locale-ur .nav,
body.locale-ur .pagination,
body.locale-ur .bsms-topbar-user .name,
body.locale-ur .bsms-topbar-user .role,
body.locale-ur .bsms-dash-stat-label {
    font-family: var(--bsms-font-urdu);
}

/* Keep icons on their glyph fonts; keep amounts/codes Latin-friendly */
body.locale-ur .ti,
body.locale-ur .feather,
body.locale-ur [class^="ti-"],
body.locale-ur [class*=" ti-"],
body.locale-ur .fa,
body.locale-ur .fas,
body.locale-ur .far,
body.locale-ur .fal,
body.locale-ur .fab {
    font-family: inherit; /* icon stylesheet !important still wins for .ti */
}

body.locale-ur .text-end,
body.locale-ur td.text-end,
body.locale-ur th.text-end,
body.locale-ur .bsms-amt-in,
body.locale-ur .bsms-amt-out,
body.locale-ur .bsms-amt-mute,
body.locale-ur .bsms-bal-chip,
body.locale-ur .bsms-dash-stat-value,
body.locale-ur .bsms-closing-kpi-value,
body.locale-ur .bsms-dash-chip strong,
body.locale-ur input[type="number"],
body.locale-ur .bsms-notif-count,
body.locale-ur kbd {
    font-family: var(--bsms-font-latin);
}

body.locale-ur.layout-mode-rtl .sidebar .sidebar-menu ul > li > a i,
body.locale-ur.layout-mode-rtl .sidebar .sidebar-menu ul > li > a .ti {
    margin-left: 0;
    margin-right: 0;
}

body.locale-ur.layout-mode-rtl .sidebar .sidebar-menu .badge {
    margin-right: auto;
    margin-left: 0;
}

/* Supplier payment proof dropzone */
.bsms-proof {
    border-radius: 14px;
    border: 1.5px dashed #d5dae3;
    background:
        linear-gradient(180deg, #fbfcfe 0%, #f6f8fb 100%);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.bsms-proof:hover,
.bsms-proof:focus-within {
    border-color: rgba(242, 101, 34, 0.55);
    box-shadow: 0 0 0 4px rgba(242, 101, 34, 0.08);
}

.bsms-proof.has-file {
    border-style: solid;
    border-color: #e6e9ef;
    background: #fff;
    box-shadow: none;
}

.bsms-proof-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 148px;
    padding: 1.25rem 1rem;
    margin: 0;
    cursor: pointer;
    text-align: center;
}

.bsms-proof-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
    font-size: 16px; /* iOS: avoid zoom / keep tappable */
}

.bsms-proof-browse {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.bsms-proof-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    background: rgba(242, 101, 34, 0.1);
    color: #f26522;
    font-size: 1.35rem;
    margin-bottom: .35rem;
}

.bsms-proof-title {
    font-weight: 600;
    color: #1f2937;
    font-size: .95rem;
}

.bsms-proof-hint {
    color: #6b7280;
    font-size: .8125rem;
    max-width: 28rem;
}

.bsms-proof-file {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .85rem 1rem;
}

.bsms-proof-thumb {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 10px;
    background: #f3f5f8;
    border: 1px solid #e8ebf0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    color: #f26522;
    font-size: 1.4rem;
}

.bsms-proof-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bsms-proof-meta {
    min-width: 0;
    flex: 1;
}

.bsms-proof-name {
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bsms-proof-size {
    color: #6b7280;
    font-size: .8125rem;
}

.bsms-proof-remove {
    flex-shrink: 0;
}

.bsms-proof-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: #f26522;
    font-weight: 500;
    text-decoration: none;
}

.bsms-proof-link:hover {
    color: #d4551a;
    text-decoration: underline;
}

/* Allowed payment accounts picker */
.bsms-account-picker {
    border: 1px solid #e6e9ef;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.bsms-account-picker-toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem .9rem;
    border-bottom: 1px solid #eef0f3;
    background: #fbfcfe;
}

.bsms-account-picker-toolbar .input-icon {
    flex: 1;
    position: relative;
}

.bsms-account-picker-toolbar .input-icon-addon {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa3b2;
    pointer-events: none;
    z-index: 1;
}

.bsms-account-picker-toolbar .form-control {
    padding-left: 2.25rem;
    background: #fff;
}

.bsms-account-picker-count {
    flex-shrink: 0;
    font-size: .8125rem;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.bsms-account-picker-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .85rem;
    max-height: 220px;
    overflow-y: auto;
}

.bsms-account-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    padding: .45rem .7rem;
    border-radius: 999px;
    border: 1px solid #e4e7ec;
    background: #f7f8fa;
    color: #374151;
    font-size: .8125rem;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.bsms-account-chip input {
    margin: 0;
    accent-color: #f26522;
}

.bsms-account-chip:hover {
    border-color: rgba(242, 101, 34, 0.45);
}

.bsms-account-chip.is-selected {
    border-color: rgba(242, 101, 34, 0.55);
    background: rgba(242, 101, 34, 0.1);
    color: #9a3d10;
    font-weight: 600;
}

/* Accounting settings flow groups */
.bsms-flow-intro h5 {
    color: #1f2937;
    font-weight: 700;
}

.bsms-flow-card {
    background: #fff;
    border: 1px solid #e8ebf0;
    border-radius: 16px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.bsms-flow-head {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1rem 1.15rem;
    background: linear-gradient(180deg, #fbfcfe 0%, #f6f8fb 100%);
    border-bottom: 1px solid #eef0f3;
}

.bsms-flow-step {
    flex-shrink: 0;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(242, 101, 34, 0.12);
    color: #f26522;
    font-weight: 700;
    font-size: .875rem;
}

.bsms-flow-head h6 {
    color: #1f2937;
    font-weight: 700;
}

.bsms-flow-desc {
    margin-top: .2rem !important;
    color: #6b7280;
    font-size: .875rem;
}

.bsms-flow-body {
    padding: 1.1rem 1.15rem 1.15rem;
}

.bsms-flow-journal {
    margin-top: 1rem;
    padding: .65rem .85rem;
    border-radius: 10px;
    background: #f7f8fa;
    border: 1px dashed #e4e7ec;
    color: #4b5563;
    font-size: .8125rem;
}

.bsms-flow-note {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .85rem 1rem;
    border-radius: 12px;
    background: rgba(242, 101, 34, 0.06);
    border: 1px solid rgba(242, 101, 34, 0.15);
    color: #4b5563;
    font-size: .9rem;
}

.bsms-flow-note i {
    color: #f26522;
    margin-top: .15rem;
}

/* Customer form sections */
.bsms-section-card {
    background: #fff;
    border: 1px solid #e8ebf0;
    border-radius: 16px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.bsms-section-head {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1rem 1.15rem;
    background: linear-gradient(180deg, #fbfcfe 0%, #f6f8fb 100%);
    border-bottom: 1px solid #eef0f3;
}

.bsms-section-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(242, 101, 34, 0.1);
    color: #f26522;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.bsms-section-head h5 {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.bsms-section-desc {
    margin-top: .2rem !important;
    color: #6b7280;
    font-size: .8125rem;
}

.bsms-section-body {
    padding: 1.15rem;
}

.bsms-form-actions {
    display: flex;
    gap: .5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #eef0f3;
}

.bsms-status-switch {
    width: 100%;
    padding: .7rem .9rem;
    border-radius: 10px;
    background: #f7f8fa;
    border: 1px solid #e8ebf0;
}

.bsms-inline-panel {
    padding: 1rem;
    border-radius: 12px;
    background: #fbfcfe;
    border: 1px solid #eef0f3;
}

.bsms-empty-block {
    padding: 1.25rem;
    text-align: center;
    color: #6b7280;
    background: #fafbfc;
    border: 1px dashed #e4e7ec;
    border-radius: 12px;
    font-size: .9rem;
}

.bsms-clean-table thead th {
    background: #f7f8fa;
    color: #6b7280;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 600;
    border-bottom: 1px solid #eef0f3;
}

.bsms-item-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    overflow: hidden;
}

.bsms-item-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid #eef0f3;
    background: #fff;
}

.bsms-item-list li:last-child {
    border-bottom: 0;
}

.bsms-item-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    min-width: 0;
}

.bsms-item-main > i {
    color: #f26522;
}

.bsms-item-link {
    color: #f26522;
    font-weight: 500;
    text-decoration: none;
}

.bsms-item-link:hover {
    text-decoration: underline;
}

.bsms-file-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    width: 100%;
    min-height: 38px;
    margin: 0;
    padding: .45rem .75rem;
    border-radius: 8px;
    border: 1px dashed #d5dae3;
    background: #fff;
    color: #4b5563;
    cursor: pointer;
    overflow: hidden;
}

.bsms-file-btn:hover {
    border-color: rgba(242, 101, 34, 0.55);
    color: #f26522;
}

.bsms-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.bsms-photo-tile {
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #eef0f3;
    background: #fbfcfe;
}

.bsms-photo-tile.has-file {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.04);
}

.bsms-photo-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .65rem;
    font-weight: 600;
    color: #1f2937;
}

.bsms-photo-preview {
    height: 180px;
    border-radius: 10px;
    border: 1px dashed #d5dae3;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .75rem;
}

.bsms-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bsms-photo-empty,
.bsms-photo-saved {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    color: #9aa3b2;
    font-size: .875rem;
}

.bsms-photo-empty i,
.bsms-photo-saved i {
    font-size: 1.6rem;
}

.bsms-photo-saved {
    color: #16a34a;
}

.bsms-photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.bsms-photo-actions .btn {
    position: relative;
    overflow: hidden;
}

.bsms-camera-dialog {
    width: min(560px, 100%);
    background: #fff;
    border-radius: 16px;
    padding: 1rem 1.1rem 1.1rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
}

.bsms-camera-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.bsms-camera-stage {
    border-radius: 12px;
    overflow: hidden;
    background: #111;
    aspect-ratio: 4 / 3;
}

.bsms-camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bsms-camera-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin-top: .9rem;
}

/* Customer profile tabs */
.bsms-customer-shell {
    background: #fff;
    border: 1px solid #e8ebf0;
    border-radius: 16px;
    overflow: hidden;
}

.bsms-tabs {
    list-style: none;
    margin: 0;
    padding: .55rem .65rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    background: linear-gradient(180deg, #fbfcfe 0%, #f6f8fb 100%);
    border-bottom: 1px solid #eef0f3;
}

.bsms-tabs button {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-weight: 600;
    font-size: .875rem;
    padding: .7rem .9rem;
    border-radius: 10px 10px 0 0;
    position: relative;
}

.bsms-tabs button:hover:not(:disabled) {
    color: #f26522;
    background: rgba(242, 101, 34, 0.06);
}

.bsms-tabs button.is-active {
    color: #f26522;
    background: #fff;
    box-shadow: 0 -1px 0 #fff;
}

.bsms-tabs button.is-active::after {
    content: "";
    position: absolute;
    left: .75rem;
    right: .75rem;
    bottom: -1px;
    height: 2px;
    background: #f26522;
    border-radius: 2px 2px 0 0;
}

.bsms-tabs button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.bsms-tab-count {
    font-style: normal;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: rgba(242, 101, 34, 0.12);
    color: #f26522;
    font-size: .7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bsms-tab-lock {
    font-size: .85rem;
    opacity: .8;
}

.bsms-tab-panel {
    padding: 1.15rem 1.2rem 1.25rem;
}

.bsms-tab-panel-head {
    margin-bottom: 1rem;
}

.bsms-tab-panel-head h5 {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.bsms-tab-panel-head p {
    margin-top: .2rem;
    color: #6b7280;
    font-size: .8125rem;
}

@media (max-width: 767.98px) {
    .bsms-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bsms-tabs button span {
        white-space: nowrap;
    }
}

.bsms-kyc-locked {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1.15rem 1.25rem;
    border-radius: 16px;
    border: 1px dashed #d5dae3;
    background: #fff;
    color: #4b5563;
}

.bsms-kyc-locked > i {
    font-size: 1.35rem;
    color: #f26522;
    margin-top: .1rem;
}

.bsms-kyc-locked p {
    color: #6b7280;
    font-size: .9rem;
    margin-top: .2rem;
}

/* Confirm dialog */
.bsms-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

.bsms-confirm-dialog {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 16px;
    padding: 1.35rem 1.35rem 1.15rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
    text-align: center;
    animation: bsms-confirm-in .16s ease-out;
}

@keyframes bsms-confirm-in {
    from { transform: translateY(8px) scale(.98); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.bsms-confirm-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto .85rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.bsms-confirm-icon.is-primary {
    background: rgba(242, 101, 34, 0.12);
    color: #f26522;
}

.bsms-confirm-icon.is-danger {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.bsms-confirm-title {
    margin: 0 0 .4rem;
    font-weight: 700;
    color: #1f2937;
}

.bsms-confirm-message {
    margin: 0 0 1.15rem;
    color: #6b7280;
    font-size: .925rem;
    line-height: 1.45;
}

.bsms-confirm-reason {
    text-align: left;
    margin: 0 0 .35rem;
    resize: vertical;
}

.bsms-confirm-actions {
    display: flex;
    justify-content: center;
    gap: .5rem;
}

/* ---------- Sale POS cart ---------- */
.bsms-sale-pos-types {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .35rem;
}

.bsms-sale-type-btn {
    border: 1px solid #e4e7ec;
    background: #fff;
    color: #475569;
    font-weight: 600;
    font-size: .85rem;
    padding: .55rem .9rem;
    border-radius: 10px;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.bsms-sale-type-btn:hover {
    border-color: rgba(242, 101, 34, 0.45);
    color: #f26522;
}

.bsms-sale-type-btn.is-active {
    background: rgba(242, 101, 34, 0.1);
    border-color: rgba(242, 101, 34, 0.45);
    color: #f26522;
}

.bsms-sale-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 991.98px) {
    .bsms-sale-layout {
        grid-template-columns: 1fr;
    }
}

.bsms-sale-pos-card {
    border-radius: 14px !important;
    overflow: visible !important;
}

.bsms-sale-pos .form-label {
    display: block;
    margin-bottom: .35rem;
    line-height: 1.2;
    min-height: 1.2rem;
}

.bsms-sale-pos .form-control,
.bsms-sale-pos .input-group,
.bsms-sale-pos .input-group .form-control,
.bsms-sale-pos .input-group-text,
.bsms-sale-pos .bsms-search-select .btn {
    min-height: 40px;
}

.bsms-sale-pos .input-group-text,
.bsms-sale-pos .bsms-search-select .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bsms-sale-pos .bsms-search-select .input-group {
    flex-wrap: nowrap;
}

.bsms-sale-field {
    min-width: 0;
}

.bsms-sale-field-action .btn {
    width: 100%;
    height: 40px;
    white-space: nowrap;
}

.bsms-sale-grid-2 {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.bsms-sale-grid-quick {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 110px;
    gap: .75rem;
    align-items: start;
}

.bsms-sale-add-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px 110px;
    gap: .75rem;
    align-items: start;
    margin-bottom: .35rem;
}

.bsms-sale-scan-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: .65rem;
    align-items: center;
    padding: .75rem .9rem;
    border: 1px dashed #d8dee8;
    border-radius: 10px;
    background: #f8fafc;
}
.bsms-sale-scan-bar > i {
    color: #f26522;
    font-size: 1.35rem;
}

.bsms-sale-add-bar-qty {
    grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) 90px 130px 110px;
}

@media (max-width: 767.98px) {
    .bsms-sale-grid-2,
    .bsms-sale-grid-quick,
    .bsms-sale-add-bar,
    .bsms-sale-add-bar-qty,
    .bsms-sale-scan-bar {
        grid-template-columns: 1fr;
    }

    .bsms-sale-field-action .btn {
        width: 100%;
    }

    .bsms-sale-scan-bar > i {
        display: none;
    }
}

.bsms-sale-quick {
    padding: .85rem;
    border-radius: 10px;
    background: #f7f8fa;
    border: 1px solid #eef0f3;
}

.bsms-sale-cart-table th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6b7280;
}

.bsms-sale-pos-summary {
    position: sticky;
    top: 5.5rem;
}

.bsms-sale-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .55rem;
    color: #4b5563;
}

.bsms-sale-total-main {
    padding: .65rem .75rem;
    margin: .35rem 0 .35rem;
    border-radius: 10px;
    background: rgba(242, 101, 34, 0.08);
    color: #1f2937;
    font-size: 1.05rem;
}

.bsms-field-error {
    margin-top: .35rem;
    color: #dc2626;
    font-size: .8rem;
    font-weight: 600;
}

.bsms-sale-field.has-error .form-label {
    color: #dc2626;
}

.bsms-sale-pos .form-control.is-invalid,
.bsms-sale-pos .is-invalid-wrap .input-group,
.bsms-sale-pos .is-invalid-wrap .form-control {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.bsms-sale-pos .is-invalid-wrap .input-group-text {
    border-color: #dc2626 !important;
    color: #dc2626;
}

.bsms-empty-block.has-error {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #991b1b;
}

/* ---------- Sale invoice / receipts (premium document) ---------- */
.bsms-invoice-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 991.98px) {
    .bsms-invoice-screen {
        grid-template-columns: 1fr;
    }
}

@media screen {
    .bsms-invoice-a4 {
        min-height: 277mm; /* screen preview only — never for print/PDF */
    }

    .bsms-inv-body {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
    }

    .bsms-invoice-a4 > .bsms-inv-bottom,
    .bsms-inv-body > .bsms-inv-bottom {
        margin-top: auto;
    }
}

/* Print shell: thead repeats on every printed page in supporting browsers. */
.bsms-inv-print-shell {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    flex: 1 1 auto;
}
.bsms-inv-print-shell > thead,
.bsms-inv-print-shell > tbody,
.bsms-inv-print-shell > tfoot {
    border: 0;
}
.bsms-inv-print-shell > thead > tr > td,
.bsms-inv-print-shell > tbody > tr > td,
.bsms-inv-print-shell > tfoot > tr > td {
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    vertical-align: top;
}

/* Line-based print shell: product rows are real table rows so thead repeats per page. */
.bsms-inv-print-shell-lines > thead > tr.bsms-inv-shell-cols > th,
.bsms-inv-print-shell-lines > tbody > tr.bsms-inv-shell-cols > th {
    border: 0 !important;
    padding: 0.28rem 0.4rem !important;
    background: var(--bsms-doc-ink, #182033) !important;
    color: #fff !important;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.bsms-inv-print-shell-lines > tbody > tr.bsms-inv-shell-line > td {
    border: 0 !important;
    border-bottom: 1px solid var(--bsms-doc-line, #e2e8f0) !important;
    padding: 0.28rem 0.4rem !important;
    background: transparent !important;
    vertical-align: top;
    font-size: 0.78rem;
}

.bsms-inv-print-shell-lines > thead > tr.bsms-inv-shell-brand-row > td,
.bsms-inv-print-shell-lines > tbody > tr.bsms-inv-shell-brand-row > td {
    padding: 0 0 0.35rem !important;
}

.bsms-inv-print-shell-lines > thead > tr.bsms-inv-shell-party-row > td,
.bsms-inv-print-shell-lines > tbody > tr.bsms-inv-shell-party-row > td,
.bsms-inv-print-shell-lines > tbody > tr.bsms-inv-shell-block > td {
    padding: 0.35rem 0 0.55rem !important;
}

.bsms-inv-body {
    display: block;
}

.bsms-inv-bottom {
    padding-top: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.bsms-invoice-a4::before {
    content: "";
    display: block;
    height: 4px;
    margin: -1rem -1.25rem 0.85rem;
    width: calc(100% + 2.5rem);
    background: linear-gradient(90deg, var(--bsms-doc-ink) 0%, var(--bsms-doc-ink) 38%, var(--bsms-doc-accent) 38%, var(--bsms-doc-accent) 100%);
}

.bsms-inv-brand {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.85rem 1.25rem;
    align-items: start;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bsms-doc-line);
    margin-bottom: 0.85rem;
    position: relative;
}

.bsms-inv-brand::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 72px;
    height: 2.5px;
    background: var(--bsms-doc-accent);
    border-radius: 2px 2px 0 0;
}

.bsms-inv-brand-left {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    min-width: 0;
}

.bsms-inv-brand-copy {
    min-width: 0;
}

.bsms-inv-logo {
    height: 52px;
    width: auto;
    max-width: 148px;
    object-fit: contain;
    flex: 0 0 auto;
}

.bsms-inv-org {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--bsms-doc-ink);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.15rem;
}

.bsms-inv-meta {
    color: var(--bsms-doc-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.bsms-inv-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.65rem;
    margin-top: 0.12rem;
}

.bsms-inv-contact > span + span::before,
.bsms-inv-contact > .bsms-inv-whatsapp + span::before {
    content: "·";
    margin-right: 0.65rem;
    color: #cbd5e1;
}

.bsms-inv-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    color: #128c7e;
    text-decoration: none;
    font-weight: 650;
}

.bsms-inv-whatsapp:hover {
    color: #075e54;
    text-decoration: none;
}

.bsms-inv-whatsapp i {
    font-size: 1.05rem;
    line-height: 1;
    color: #25d366;
}

.bsms-inv-whatsapp-static {
    cursor: default;
}

@media print {
    .bsms-inv-whatsapp {
        color: #128c7e !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .bsms-inv-whatsapp i {
        color: #25d366 !important;
    }
}

.bsms-inv-brand-right {
    text-align: right;
    justify-self: end;
    max-width: 210px;
    width: 100%;
}

/* Legacy right stack (receipts) when folio card is not used */
.bsms-inv-brand-right:not(:has(.bsms-inv-folio)) {
    max-width: 176px;
}

.bsms-inv-brand-right:not(:has(.bsms-inv-folio)) > .bsms-inv-title {
    margin-bottom: 0.25rem;
}

.bsms-inv-brand-right:not(:has(.bsms-inv-folio)) > .bsms-inv-date-strip {
    display: inline-block;
    margin-top: 0.25rem;
    margin-bottom: 0.2rem;
    padding: 0.18rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 650;
    color: var(--bsms-doc-ink-soft);
    background: var(--bsms-doc-wash);
    border: 1px solid var(--bsms-doc-line);
    border-radius: 6px;
}

.bsms-inv-brand-right:not(:has(.bsms-inv-folio)) > .bsms-inv-barcode {
    margin-left: auto;
    margin-top: 0.25rem;
}

.bsms-inv-folio {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.55rem 0.7rem 0.5rem;
    border: 1px solid rgba(24, 32, 51, 0.1);
    border-radius: 12px;
    background:
        linear-gradient(165deg, #ffffff 0%, #fbfcfe 55%, #f7f8fb 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 8px 20px rgba(24, 32, 51, 0.045);
    overflow: hidden;
}

.bsms-inv-folio::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--bsms-doc-accent) 0%, var(--bsms-doc-accent-deep) 100%);
}

.bsms-inv-folio-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    flex-wrap: nowrap;
}

.bsms-inv-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, var(--bsms-doc-accent) 0%, var(--bsms-doc-accent-deep) 100%);
    padding: 0.26rem 0.55rem;
    border-radius: 999px;
    line-height: 1;
    box-shadow: 0 3px 8px rgba(242, 101, 34, 0.22);
    white-space: nowrap;
}

.bsms-inv-folio-id {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.28rem;
    min-width: 0;
}

.bsms-inv-folio-kicker {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bsms-doc-muted);
    line-height: 1;
}

.bsms-inv-no {
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--bsms-doc-ink);
    letter-spacing: -0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.bsms-inv-folio-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.28rem 0.45rem;
    border-radius: 8px;
    background: rgba(24, 32, 51, 0.03);
    border: 1px solid rgba(24, 32, 51, 0.06);
}

.bsms-inv-folio-label {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bsms-doc-muted);
}

.bsms-inv-date-strip {
    display: inline-block;
    margin: 0;
    padding: 0;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--bsms-doc-ink-soft);
    background: transparent;
    border: 0;
    border-radius: 0;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.bsms-inv-folio-code {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
    padding: 0.3rem 0.3rem 0.28rem;
    border-radius: 8px;
    background: #fff;
    border: 1px dashed rgba(24, 32, 51, 0.12);
}

.bsms-inv-folio-code-plain {
    border-style: solid;
    padding: 0.35rem 0.45rem;
}

.bsms-inv-barcode {
    display: block;
    margin: 0 auto;
    max-width: 168px;
    width: 100%;
    height: 44px;
}

.bsms-inv-barcode-host {
    overflow: hidden;
}

.bsms-inv-barcode-host svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* WhatsApp / image capture: one tight continuous document, no A4 min-height gaps */
.bsms-invoice-a4.bsms-inv-capturing {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    display: block !important;
    overflow: visible !important;
    box-shadow: none !important;
}

.bsms-invoice-a4.bsms-inv-capturing .bsms-inv-print-shell {
    flex: none !important;
    height: auto !important;
}

.bsms-inv-capturing {
    box-shadow: none !important;
}

.bsms-inv-barcode-text {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.68rem;
    font-weight: 650;
    color: var(--bsms-doc-ink-soft);
    letter-spacing: 0.06em;
    line-height: 1.2;
}

.bsms-inv-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    align-items: stretch;
}

.bsms-inv-grid > div,
.bsms-inv-party,
.bsms-inv-sale-meta {
    background: var(--bsms-doc-wash);
    border: 1px solid var(--bsms-doc-line);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    min-width: 0;
}

.bsms-inv-sale-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    height: 100%;
    align-content: center;
}

.bsms-inv-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--bsms-doc-muted);
    margin-bottom: 0.12rem;
}

.bsms-inv-table thead th {
    background: var(--bsms-doc-ink) !important;
    color: #fff !important;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 0 !important;
    padding: 0.32rem 0.4rem !important;
}

.bsms-inv-table {
    width: 100%;
    table-layout: fixed;
    margin-bottom: 0.45rem;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--bsms-doc-line);
    font-variant-numeric: tabular-nums;
}

.bsms-inv-table th,
.bsms-inv-table td {
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.bsms-inv-table tbody td {
    padding: 0.28rem 0.4rem !important;
    border-color: #edf0f5 !important;
    color: #334155;
    line-height: 1.25;
}

.bsms-inv-table tbody tr:nth-child(even) td {
    background: #fafbfc;
}

@media (max-width: 575.98px) {
    .bsms-inv-brand {
        grid-template-columns: 1fr;
    }

    .bsms-inv-brand-right {
        justify-self: stretch;
        text-align: left;
        max-width: none;
    }

    .bsms-inv-folio-top {
        align-items: center;
        justify-content: space-between;
    }

    .bsms-inv-folio-id {
        align-items: baseline;
    }

    .bsms-inv-barcode {
        margin-left: 0;
    }
}

.bsms-inv-table-receipt {
    font-size: .8125rem;
}

.bsms-inv-table-receipt .bsms-inv-col-num {
    width: 2.25rem;
}

.bsms-inv-table-receipt .bsms-inv-col-sale {
    width: 5.5rem;
}

.bsms-inv-table-receipt .bsms-inv-col-amt {
    width: 5.25rem;
}

.bsms-inv-table-sale {
    font-size: .72rem;
}

.bsms-inv-table-sale .bsms-inv-col-num {
    width: 1.75rem;
}

.bsms-inv-table-sale .bsms-inv-col-serial {
    width: 28%;
}

.bsms-inv-table-sale .bsms-inv-col-qty {
    width: 2.75rem;
}

.bsms-inv-table-sale .bsms-inv-col-amt {
    width: 5.75rem;
    white-space: nowrap;
    font-size: 0.64rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.bsms-inv-table-sale tbody td:nth-last-child(-n+2) {
    white-space: nowrap;
    font-size: 0.64rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.bsms-inv-table-quote {
    font-size: .78rem;
    table-layout: fixed;
    width: 100%;
}

.bsms-inv-table-quote .bsms-inv-col-num {
    width: 2rem;
}

.bsms-inv-table-quote .bsms-inv-col-qty {
    width: 3.25rem;
}

.bsms-inv-table-quote .bsms-inv-col-amt {
    width: 7.25rem;
    white-space: nowrap;
}

.bsms-inv-table-quote .bsms-inv-cell-main {
    font-size: .78rem;
}

.bsms-inv-table-quote th,
.bsms-inv-table-quote td {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}

.bsms-quote-total-box {
    width: min(340px, 100%);
    padding: 0.9rem 1.1rem;
}

.bsms-quote-total-amount {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--bsms-doc-ink, #0f172a);
    font-variant-numeric: tabular-nums;
    text-align: end;
    white-space: nowrap;
}

@media print {
    body.print-a4 .bsms-quote-total-amount {
        font-size: 1.05rem;
    }

    body.print-a4 .bsms-inv-table-sale .bsms-inv-col-amt {
        font-size: 0.62rem;
    }

    body.print-a4 .bsms-inv-totals-box .d-flex > span:last-child,
    body.print-a4 .bsms-inv-totals-box .d-flex > strong:last-child,
    body.print-a4 .bsms-inv-balance strong {
        font-size: 0.65rem;
    }
}

.bsms-inv-serial {
    font-family: Consolas, "Courier New", monospace;
    font-size: .68rem;
    line-height: 1.2;
    word-break: break-all;
}

.bsms-inv-serial-label {
    font-family: inherit;
    font-size: .58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #9ca3af;
    margin-right: .15rem;
}

.bsms-inv-cell-main {
    font-weight: 600;
    color: var(--bsms-doc-ink);
    line-height: 1.2;
    font-size: .72rem;
}

.bsms-inv-cell-sub {
    color: var(--bsms-doc-muted);
    font-size: .62rem;
    line-height: 1.2;
    margin-top: .05rem;
}

/* Long invoices: pack more lines onto one A4 page */
.bsms-inv-compact .bsms-inv-grid {
    margin-bottom: 0.45rem;
    gap: 0.4rem;
}

.bsms-inv-compact .bsms-inv-grid > div {
    padding: 0.4rem 0.55rem;
}

.bsms-inv-compact .bsms-inv-table-sale,
.bsms-inv-compact .bsms-inv-table {
    font-size: .66rem;
    margin-bottom: 0.35rem;
}

.bsms-inv-compact .bsms-inv-table thead th {
    font-size: 0.58rem;
    padding: 0.22rem 0.3rem !important;
}

.bsms-inv-compact .bsms-inv-table tbody td {
    padding: 0.16rem 0.3rem !important;
    line-height: 1.15;
}

.bsms-inv-compact .bsms-inv-cell-main {
    font-size: .66rem;
}

.bsms-inv-compact .bsms-inv-cell-sub,
.bsms-inv-compact .bsms-inv-serial {
    font-size: .58rem;
}

.bsms-inv-compact .bsms-inv-sign {
    margin-top: 0.85rem;
}

.bsms-inv-compact-xl .bsms-inv-brand {
    margin-bottom: 0.45rem;
    padding-bottom: 0.45rem;
}

.bsms-inv-compact-xl .bsms-inv-logo {
    height: 40px;
    max-width: 120px;
}

.bsms-inv-compact-xl .bsms-inv-org {
    font-size: 1rem;
}

.bsms-inv-compact-xl .bsms-inv-no {
    font-size: 1.2rem;
}

.bsms-inv-compact-xl .bsms-inv-folio {
    padding: 0.55rem 0.65rem 0.5rem;
    gap: 0.4rem;
}

.bsms-inv-compact-xl .bsms-inv-table-sale,
.bsms-inv-compact-xl .bsms-inv-table {
    font-size: .6rem;
}

.bsms-inv-compact-xl .bsms-inv-table thead th {
    font-size: 0.52rem;
    padding: 0.16rem 0.22rem !important;
}

.bsms-inv-compact-xl .bsms-inv-table tbody td {
    padding: 0.1rem 0.22rem !important;
    line-height: 1.1;
}

.bsms-inv-compact-xl .bsms-inv-cell-main {
    font-size: .6rem;
}

.bsms-inv-compact-xl .bsms-inv-cell-sub,
.bsms-inv-compact-xl .bsms-inv-serial {
    font-size: .52rem;
}

.bsms-inv-compact-xl .bsms-inv-totals-box {
    padding: 0.45rem 0.6rem;
    gap: 0.15rem;
    font-size: 0.78rem;
}

.bsms-inv-compact-xl .bsms-inv-totals-heading {
    font-size: 0.62rem;
}

@media (max-width: 640px) {
    .bsms-inv-totals-split {
        grid-template-columns: 1fr;
    }
}

.bsms-inv-compact-xl .bsms-inv-sign {
    margin-top: 0.55rem;
    gap: 1rem;
    font-size: 0.7rem;
}

.bsms-inv-amount-words {
    margin-top: 0.55rem;
    padding: 0.45rem 0.65rem;
    background: #f8fafc;
    border: 1px solid var(--bsms-doc-line);
    border-radius: 8px;
    font-size: 0.72rem;
    line-height: 1.4;
    color: #334155;
    font-style: italic;
}

.bsms-inv-amount-words strong {
    font-style: normal;
    color: var(--bsms-doc-ink);
    margin-right: 0.25rem;
}

.bsms-th-words {
    margin-top: 0.35rem;
    font-size: 0.62rem;
    line-height: 1.3;
    text-align: center;
    font-style: italic;
}

.bsms-agreement-deed {
    margin-top: 0.75rem;
    padding: 0.55rem 0.7rem 0.65rem;
    border: 1px solid var(--bsms-doc-line);
    border-radius: 10px;
    background: #fffefc;
    font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Segoe UI", Tahoma, sans-serif;
    color: #1f2937;
}

.bsms-agreement-deed-title {
    text-align: center;
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 0.45rem;
    color: var(--bsms-doc-ink);
}

.bsms-agreement-deed-body {
    margin: 0 0 0.65rem;
    font-size: 0.78rem;
    line-height: 1.7;
    text-align: justify;
}

.bsms-agreement-deed-foot {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0.75rem;
    align-items: end;
}

.bsms-agreement-sign {
    text-align: center;
}

.bsms-agreement-sign-name {
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
}

.bsms-agreement-sign-line {
    border-top: 1.5px solid #94a3b8;
    margin: 1.1rem 0 0.25rem;
}

.bsms-agreement-sign-label {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 650;
}

.bsms-agreement-fp {
    display: block;
    width: 88px;
    height: 110px;
    object-fit: contain;
    margin: 0 auto 0.35rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    padding: 2px;
}

.bsms-fp-panel {
    background: #fff;
    border: 1px solid var(--bsms-doc-line, #e2e8f0);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin: 0 0 1rem;
}

.bsms-fp-panel-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.bsms-fp-card {
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 0.75rem;
    background: #f8fafc;
    height: 100%;
}

.bsms-fp-card-label {
    font-weight: 650;
    font-size: 0.82rem;
    margin-bottom: 0.45rem;
}

.bsms-fp-preview {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.bsms-fp-preview img {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
}

.bsms-fp-wait {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.bsms-fp-wait-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: #0d6efd;
    flex: 0 0 auto;
    animation: bsms-fp-pulse 1.1s ease-in-out infinite;
}

@keyframes bsms-fp-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

.bsms-agreement-declare {
    text-align: right;
    font-size: 0.7rem;
    line-height: 1.45;
    color: #475569;
    padding-bottom: 0.15rem;
}

.bsms-agreement-cont-page {
    margin-top: 0.75rem;
}

.bsms-agreement-cont-page .bsms-inv-footer {
    margin-top: 0.55rem;
}

@media print {
    body.print-a4 .bsms-agreement-deed-foot {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

.bsms-inv-policy-stamp {
    margin-top: 0.65rem;
    padding: 0.45rem 0.7rem;
    border: 2px dashed #c2410c;
    border-radius: 8px;
    background: rgba(242, 101, 34, 0.06);
    color: #9a3412;
    max-width: 100%;
    text-align: right;
    font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Segoe UI", Tahoma, sans-serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.bsms-inv-warranty {
    margin-top: 0.55rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--bsms-doc-line);
    border-radius: 8px;
    background: #fafbfc;
    color: #334155;
    font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Segoe UI", Tahoma, sans-serif;
    font-size: 0.68rem;
    line-height: 1.55;
    text-align: right;
}

.bsms-inv-warranty-title {
    font-weight: 800;
    font-size: 0.72rem;
    color: var(--bsms-doc-ink);
    margin-bottom: 0.35rem;
}

.bsms-inv-warranty p {
    margin: 0 0 0.35rem;
}

.bsms-inv-warranty-list {
    margin: 0.2rem 1.1rem 0 0;
    padding: 0;
}

.bsms-inv-warranty-list li {
    margin-bottom: 0.12rem;
}

.bsms-inv-compact .bsms-inv-warranty,
.bsms-inv-compact-xl .bsms-inv-warranty {
    font-size: 0.58rem;
    line-height: 1.4;
    padding: 0.3rem 0.45rem;
}

@media print {
    .bsms-inv-warranty {
        break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

.bsms-inv-policy-stamp-title {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.15rem;
    color: #c2410c;
}

.bsms-inv-policy-stamp-text {
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.35;
}

.bsms-inv-compact .bsms-inv-policy-stamp {
    margin-top: 0.4rem;
    padding: 0.3rem 0.5rem;
}

.bsms-inv-compact .bsms-inv-policy-stamp-text {
    font-size: 0.64rem;
}

.bsms-inv-compact-xl .bsms-inv-policy-stamp-text {
    font-size: 0.58rem;
    line-height: 1.25;
}

.bsms-inv-totals {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.35rem;
}

.bsms-inv-totals-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    justify-content: stretch;
    width: 100%;
}

.bsms-inv-totals-split .bsms-inv-totals-box {
    width: 100%;
}

.bsms-inv-totals-heading {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bsms-doc-muted);
    margin-bottom: 0.15rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--bsms-doc-line);
}

.bsms-inv-totals-box {
    width: min(300px, 100%);
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff 0%, var(--bsms-doc-wash) 100%);
    border: 1px solid var(--bsms-doc-line);
    box-shadow: 0 6px 16px rgba(24, 32, 51, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.bsms-inv-totals-box .d-flex {
    gap: 0.75rem;
    align-items: baseline;
}

.bsms-inv-totals-box .d-flex > span:first-child,
.bsms-inv-totals-box .d-flex > strong:first-child {
    flex: 0 1 auto;
    min-width: 0;
}

.bsms-inv-totals-box .d-flex > span:last-child,
.bsms-inv-totals-box .d-flex > strong:last-child {
    flex: 1 1 auto;
    text-align: end;
    white-space: nowrap;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.bsms-inv-balance {
    margin-top: 0.3rem;
    padding-top: 0.4rem;
    border-top: 2px solid var(--bsms-doc-accent);
    color: var(--bsms-doc-accent-deep);
    font-size: 0.78rem;
}

.bsms-inv-balance strong {
    font-size: 0.72rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.bsms-inv-notes {
    margin-top: 0.75rem;
    color: var(--bsms-doc-muted);
    font-size: 0.8125rem;
    background: var(--bsms-doc-wash);
    border-left: 3px solid var(--bsms-doc-accent);
    border-radius: 0 8px 8px 0;
    padding: 0.5rem 0.7rem;
}

.bsms-inv-sign {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.75rem;
    text-align: center;
    color: var(--bsms-doc-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.bsms-inv-sign-line {
    border-top: 1.5px solid #cbd5e1;
    margin-bottom: 0.35rem;
}

.bsms-inv-footer {
    margin-top: 0.9rem;
    text-align: center;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: #94a3b8;
    border-top: 1px dashed var(--bsms-doc-line);
    padding-top: 0.65rem;
}

.bsms-invoice-thermal {
    width: 260px;
    margin: 0 auto;
    background: #fff;
    border: 1px dashed #d5dae3;
    border-radius: 8px;
    padding: .85rem .75rem;
    font-size: .8rem;
    color: #111;
    font-family: Consolas, "Courier New", monospace;
}

.bsms-th-brand {
    text-align: center;
    font-weight: 800;
    font-size: .95rem;
}

.bsms-th-title {
    text-align: center;
    font-weight: 700;
    margin: .35rem 0;
}

.bsms-th-meta {
    text-align: center;
    color: #555;
    font-size: .72rem;
}

.bsms-th-barcode {
    display: block;
    margin: .35rem auto 0;
}

.bsms-th-code {
    text-align: center;
    font-size: .65rem;
    margin-bottom: .25rem;
}

.bsms-th-hr {
    border-top: 1px dashed #bbb;
    margin: .45rem 0;
}

.bsms-th-line {
    margin-bottom: .35rem;
}

.bsms-th-total {
    display: flex;
    justify-content: space-between;
    margin: .15rem 0;
}

.bsms-th-thanks {
    text-align: center;
    margin-top: .35rem;
    font-weight: 700;
}

.bsms-th-policy {
    text-align: center;
    font-size: .62rem;
    line-height: 1.3;
    color: #7c2d12;
    font-weight: 650;
    border: 1px dashed #c2410c;
    padding: .28rem .2rem;
    margin: .15rem 0;
}

@media print {
    .no-print,
    .sidebar,
    .header,
    .footer,
    .main-header,
    .page-header .btn,
    .page-breadcrumb,
    .bsms-invoice-toolbar {
        display: none !important;
    }

    body.print-a4 .bsms-invoice-thermal-wrap,
    body.print-a4 .bsms-invoice-thermal {
        display: none !important;
    }

    body.print-thermal .bsms-invoice-a4 {
        display: none !important;
    }

    body.print-thermal .bsms-invoice-thermal-wrap {
        display: block !important;
    }

    body.print-thermal .no-print {
        display: none !important;
    }

    .bsms-invoice-screen {
        display: block;
        width: 100%;
    }

    .bsms-invoice-a4,
    .bsms-invoice-thermal {
        border: 0;
        box-shadow: none;
        border-radius: 0;
        max-width: none;
        overflow: visible;
    }

    body.print-a4 {
        background: #fff !important;
    }

    body.print-a4 .main-wrapper,
    body.print-a4 .page-wrapper,
    body.print-a4 .content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
        background: #fff !important;
        overflow: visible !important;
        transform: none !important;
        filter: none !important;
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
    }

    body.print-a4 .bsms-invoice-screen {
        display: block !important;
        width: 100% !important;
        overflow: visible !important;
        transform: none !important;
    }

    body.print-a4 .bsms-invoice-a4 {
        width: 100% !important;
        max-width: 190mm !important;
        margin: 0 auto !important;
        padding: 5mm 4mm 4mm !important;
        font-size: 9.5pt;
        overflow: visible !important;
        box-sizing: border-box !important;
        /* Block — flex on the parent prevents Chromium from repeating thead. */
        display: block !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        border: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    body.print-a4 .bsms-inv-print-shell {
        width: 100% !important;
        display: table !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        flex: none !important;
        min-height: 0 !important;
    }

    body.print-a4 .bsms-inv-print-shell > thead {
        display: table-header-group !important;
    }

    body.print-a4 .bsms-inv-print-shell > tbody {
        display: table-row-group !important;
    }

    body.print-a4 .bsms-inv-print-shell > tfoot {
        display: table-footer-group !important;
    }

    /* Branch / brand header repeats on every printed A4 page. */
    body.print-a4 .bsms-inv-print-shell > thead > tr.bsms-inv-shell-brand-row {
        display: table-row !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    body.print-a4 .bsms-inv-print-shell > thead > tr.bsms-inv-shell-brand-row > td {
        display: table-cell !important;
    }

    body.print-a4 .bsms-inv-print-shell > tbody > tr.bsms-inv-shell-line {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.print-a4 .bsms-inv-print-shell > thead .bsms-inv-brand {
        margin-bottom: 0.35rem !important;
        padding-bottom: 0.4rem !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: 0.45rem 0.85rem !important;
        align-items: start !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.print-a4 .bsms-inv-print-shell > thead .bsms-inv-logo {
        height: 40px !important;
        max-width: 120px !important;
    }

    body.print-a4 .bsms-inv-print-shell > thead .bsms-inv-org {
        font-size: 11pt !important;
    }

    body.print-a4 .bsms-inv-print-shell > thead .bsms-inv-meta {
        font-size: 7pt !important;
    }

    body.print-a4 .bsms-inv-print-shell > thead .bsms-inv-folio {
        min-width: 42mm !important;
    }

    body.print-a4 .bsms-inv-print-shell > thead .bsms-inv-barcode-host {
        width: 140px !important;
        height: 36px !important;
    }

    body.print-a4 .bsms-inv-body {
        display: block !important;
        flex: none !important;
        min-height: 0 !important;
        height: auto !important;
    }

    body.print-a4 .bsms-inv-bottom {
        margin-top: 0.35rem !important;
        padding-top: 0.45rem !important;
        min-height: 0 !important;
        height: auto !important;
        page-break-before: auto !important;
        break-before: auto !important;
        /* Allow flow if warranty is taller than one page; JS moves the start when needed. */
        break-inside: auto !important;
        page-break-inside: auto !important;
    }

    /* JS adds this when remaining page space is too short for the full policy block. */
    body.print-a4 .bsms-inv-bottom.bsms-inv-bottom-newpage {
        break-before: page !important;
        page-break-before: always !important;
    }

    /* Brand clone stamped at top of policy page (policy lives outside the table). */
    .bsms-inv-continued-brand {
        display: none !important;
    }

    body.print-a4 .bsms-inv-bottom-newpage > .bsms-inv-continued-brand {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: 0.45rem 0.85rem !important;
        align-items: start !important;
        margin: 0 0 0.55rem !important;
        padding-bottom: 0.4rem !important;
        border-bottom: 1px solid #e2e8f0 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.print-a4 .bsms-inv-bottom-newpage > .bsms-inv-continued-brand .bsms-inv-logo {
        height: 40px !important;
        max-width: 120px !important;
    }

    body.print-a4 .bsms-inv-bottom-newpage > .bsms-inv-continued-brand .bsms-inv-org {
        font-size: 11pt !important;
    }

    body.print-a4 .bsms-inv-bottom-newpage > .bsms-inv-continued-brand .bsms-inv-meta {
        font-size: 7pt !important;
    }

    body.print-a4 .bsms-inv-bottom-newpage > .bsms-inv-continued-brand .bsms-inv-barcode-host {
        width: 140px !important;
        height: 36px !important;
    }

    body.print-a4 .bsms-inv-print-pin-spacer {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }

    body.print-a4 .bsms-inv-bottom-spacer {
        display: none !important;
    }

    body.print-a4 .bsms-invoice-a4::before {
        margin: -6mm -5mm 6px;
        width: calc(100% + 10mm);
        height: 3px;
    }

    body.print-a4 .bsms-inv-table,
    body.print-a4 .bsms-inv-table-receipt,
    body.print-a4 .bsms-inv-table-sale,
    body.print-a4 .bsms-inv-table-quote {
        table-layout: fixed !important;
        width: 100% !important;
        font-size: 7.5pt;
    }

    body.print-a4 .bsms-inv-table th,
    body.print-a4 .bsms-inv-table td {
        padding: .12rem .22rem !important;
        overflow: hidden;
    }

    body.print-a4 .bsms-inv-print-shell-lines > thead > tr.bsms-inv-shell-cols > th,
    body.print-a4 .bsms-inv-print-shell-lines > tbody > tr.bsms-inv-shell-cols > th {
        background: #182033 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        font-size: 6.5pt !important;
        padding: 0.12rem 0.22rem !important;
    }

    body.print-a4 .bsms-inv-print-shell-lines > tbody > tr.bsms-inv-shell-line > td {
        padding: 0.12rem 0.22rem !important;
        font-size: 7.5pt !important;
    }

    body.print-a4 .bsms-inv-print-shell-lines > tbody > tr.bsms-inv-shell-line > td:nth-last-child(-n+2) {
        width: 18mm !important;
        max-width: 22mm !important;
        font-size: 6.8pt !important;
        white-space: nowrap !important;
    }

    body.print-a4 .bsms-inv-table-sale .bsms-inv-col-amt,
    body.print-a4 .bsms-inv-table-sale tbody td:nth-last-child(-n+2) {
        width: 18mm !important;
        max-width: 22mm !important;
        font-size: 6.8pt !important;
        white-space: nowrap !important;
        letter-spacing: -0.02em !important;
    }

    body.print-a4 .bsms-inv-totals-box {
        width: min(62mm, 100%) !important;
        max-width: 62mm !important;
        padding: 0.4rem 0.55rem !important;
        font-size: 7pt !important;
        background: linear-gradient(180deg, #fff 0%, #f8fafc 100%) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Side-by-side Sale Commitment + Payment Status (print was squashing to 62mm / stacking). */
    body.print-a4 .bsms-inv-totals-split {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.45rem !important;
        width: 100% !important;
        max-width: 100% !important;
        justify-content: stretch !important;
        align-items: stretch !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    body.print-a4 .bsms-inv-totals-split .bsms-inv-totals-box {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body.print-a4 .bsms-inv-totals-box .d-flex > span:last-child,
    body.print-a4 .bsms-inv-totals-box .d-flex > strong:last-child,
    body.print-a4 .bsms-inv-balance strong {
        font-size: 6.8pt !important;
        white-space: nowrap !important;
        letter-spacing: -0.03em !important;
    }

    body.print-a4 .bsms-quote-total-box {
        width: min(62mm, 100%) !important;
        max-width: 62mm !important;
    }

    body.print-a4 .bsms-quote-total-amount {
        font-size: 11pt !important;
        white-space: nowrap !important;
    }

    body.print-a4 .bsms-inv-folio {
        background: #fbfcfe !important;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.print-a4 .bsms-inv-folio::before {
        background: #f26522 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.print-a4 .bsms-inv-title {
        background: linear-gradient(135deg, #f26522 0%, #d4551a 100%) !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.print-a4 .bsms-inv-folio-meta,
    body.print-a4 .bsms-inv-folio-code {
        background: #f4f6f9 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.print-a4 .bsms-inv-date-strip {
        background: transparent !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.print-a4 .bsms-inv-balance {
        color: #d4551a !important;
        border-top-color: #f26522 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.print-a4 .bsms-inv-whatsapp,
    body.print-a4 .bsms-inv-whatsapp span,
    body.print-a4 .bsms-inv-whatsapp i {
        color: #25d366 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.print-a4 .bsms-inv-notes {
        background: #f4f6f9 !important;
        border-left-color: #f26522 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.print-a4 .bsms-invoice-a4::before {
        background: linear-gradient(90deg, #182033 0%, #182033 38%, #f26522 38%, #f26522 100%) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.print-a4 .bsms-inv-cell-main {
        font-size: 8pt;
    }

    body.print-a4 .bsms-inv-cell-sub,
    body.print-a4 .bsms-inv-serial {
        font-size: 7pt;
    }

    body.print-a4 .bsms-inv-compact .bsms-inv-table,
    body.print-a4 .bsms-inv-compact .bsms-inv-table-sale {
        font-size: 7pt;
    }

    body.print-a4 .bsms-inv-compact .bsms-inv-table th,
    body.print-a4 .bsms-inv-compact .bsms-inv-table td {
        padding: .1rem .2rem !important;
    }

    body.print-a4 .bsms-inv-compact-xl .bsms-inv-table,
    body.print-a4 .bsms-inv-compact-xl .bsms-inv-table-sale {
        font-size: 6.5pt;
    }

    body.print-a4 .bsms-inv-compact-xl .bsms-inv-table th,
    body.print-a4 .bsms-inv-compact-xl .bsms-inv-table td {
        padding: .06rem .16rem !important;
    }

    body.print-a4 .bsms-inv-policy-stamp,
    body.print-a4 .bsms-inv-warranty,
    body.print-a4 .bsms-agreement-deed-foot {
        break-inside: avoid;
        page-break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.print-a4 .bsms-inv-brand {
        break-inside: avoid;
    }

    body.print-a4 .bsms-inv-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.95fr) !important;
        gap: 0.4rem !important;
        margin-bottom: 0.5rem !important;
        align-items: stretch;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.print-a4 .bsms-inv-grid > div,
    body.print-a4 .bsms-inv-party,
    body.print-a4 .bsms-inv-sale-meta {
        padding: 0.35rem 0.5rem !important;
        border-radius: 6px !important;
        min-width: 0;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.print-a4 .bsms-inv-sale-meta-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.35rem !important;
        align-content: center;
    }

    body.print-a4 .bsms-inv-label {
        font-size: 6pt !important;
        margin-bottom: 0.05rem !important;
    }

    body.print-a4 .bsms-inv-sign,
    body.print-a4 .bsms-inv-totals {
        break-inside: avoid;
    }

    body.print-a4 .bsms-inv-totals-split {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }

    /* Do not force full-page empty space — let warranty/surety flow naturally. */
    body.print-a4 .bsms-inv-shell-tail {
        break-inside: auto !important;
        page-break-inside: auto !important;
        break-before: auto !important;
        page-break-before: auto !important;
    }

    body.print-a4 .bsms-agreement-a4 .bsms-inv-shell-tail {
        break-before: auto !important;
        page-break-before: auto !important;
    }

    body.print-a4 .bsms-agreement-cont-page {
        display: block !important;
        min-height: 0 !important;
        height: auto !important;
        justify-content: flex-start !important;
        margin-top: 0.55rem !important;
    }

    body.print-a4 .bsms-agreement-cont-page .bsms-agreement-deed {
        margin-top: 0 !important;
        break-inside: auto;
        page-break-inside: auto;
    }

    body.print-a4 .bsms-agreement-cont-page .bsms-inv-footer {
        margin-top: 0.35rem !important;
    }

    body.print-a4 .bsms-inv-bottom {
        break-inside: auto !important;
        page-break-inside: auto !important;
    }

    body.print-a4 .bsms-inv-warranty,
    body.print-a4 .bsms-inv-policy-stamp {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.print-a4 .bsms-inv-warranty-title,
    body.print-a4 .bsms-inv-policy-stamp-title {
        break-after: avoid;
        page-break-after: avoid;
    }

    body.print-a4 .bsms-inv-sign {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-top: 0.9rem;
    }

    body.print-a4 .bsms-inv-barcode-host svg {
        display: block !important;
        max-width: 100%;
        height: auto;
    }

    body.print-thermal .bsms-invoice-thermal {
        width: 80mm;
        margin: 0;
        padding: 0;
    }

    .page-wrapper,
    .content {
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
    }
}

@page {
    size: A4 portrait;
    margin: 8mm 9mm 12mm 9mm;
}

/* Page numbers on A4 invoice / agreement / receipt prints only. */
@page bsms-doc {
    size: A4 portrait;
    margin: 8mm 9mm 12mm 9mm;

    @bottom-center {
        content: counter(page) " / " counter(pages);
        font-family: "Segoe UI", system-ui, sans-serif;
        font-size: 8pt;
        color: #64748b;
    }
}

body.print-a4 {
    page: bsms-doc;
}

/* Screen-time measure layout used by print JS (before @media print applies). */
body.print-a4-measure .bsms-invoice-toolbar,
body.print-a4-measure .bsms-invoice-thermal-wrap,
body.print-a4-measure .sidebar,
body.print-a4-measure .header,
body.print-a4-measure .footer,
body.print-a4-measure .main-header,
body.print-a4-measure .page-breadcrumb {
    display: none !important;
}

body.print-a4-measure .bsms-invoice-screen {
    display: block !important;
    width: 100% !important;
}

body.print-a4-measure .bsms-invoice-a4 {
    width: 190mm !important;
    max-width: 190mm !important;
    margin: 0 auto !important;
    padding: 5mm 4mm 4mm !important;
    box-sizing: border-box !important;
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

body.print-a4-measure .bsms-inv-print-shell {
    display: table !important;
    width: 100% !important;
}

body.print-a4-measure .bsms-inv-body {
    display: block !important;
    min-height: 0 !important;
}

body.print-a4-measure .bsms-inv-bottom {
    margin-top: 0 !important;
}

/* ---------- Reports ---------- */
.bsms-report-card {
    display: block;
    height: 100%;
    transition: transform .15s ease, box-shadow .15s ease;
    color: inherit;
}

.bsms-report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
}

.bsms-report-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(242, 101, 34, 0.12);
    color: var(--bs-primary);
    font-size: 1.25rem;
    margin-bottom: .75rem;
}

.bsms-report-group-title {
    font-size: 1.05rem;
    font-weight: 650;
    margin-bottom: .25rem;
    color: var(--bs-body-color);
}

.permission-subgroup {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .35rem 0 .15rem;
}

.permission-subgroup .permission-module-pages {
    margin-inline-start: .75rem;
    padding-inline-start: .75rem;
    border-inline-start: 2px solid rgba(15, 23, 42, 0.08);
}

.bsms-collect-match {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    padding: .95rem 1.15rem;
    margin-bottom: .75rem;
    border: 1px solid #e8ecf2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    cursor: pointer;
}

.bsms-return-customer {
    border-color: rgba(37, 99, 235, 0.18);
    background: linear-gradient(180deg, #f8fbff 0%, #fff 70%);
}

.bsms-return-customer .bsms-collect-match-main {
    align-items: flex-start;
}

.bsms-return-customer .bsms-collect-match-avatar {
    width: 3rem;
    height: 3rem;
    font-size: 1.35rem;
}
.bsms-collect-match.is-dealer {
    border-color: #fdba74;
    background: linear-gradient(90deg, #fff7ed 0%, #ffffff 42%);
}
.bsms-collect-match.is-dealer:hover:not(:disabled) {
    border-color: #ea580c;
    box-shadow: 0 12px 28px rgba(234, 88, 12, .16);
}
.bsms-collect-match-avatar.is-dealer {
    background: #ea580c;
    color: #fff;
}
.bsms-collect-dealer-tag {
    display: inline-block;
    margin-left: .5rem;
    padding: .15rem .5rem;
    border-radius: .4rem;
    background: #ea580c;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    vertical-align: middle;
}
.bsms-collect-dealer-note {
    margin-top: .2rem;
    font-size: .92rem;
    font-weight: 800;
    color: #9a3412;
}
.bsms-collect-match-balance-status {
    margin-top: .25rem;
}
html[dir="rtl"] .bsms-collect-dealer-tag {
    margin-left: 0;
    margin-right: .5rem;
}
.bsms-collect-match:disabled {
    opacity: .7;
    cursor: not-allowed;
}
.bsms-collect-match-main {
    display: flex;
    align-items: center;
    gap: .9rem;
    min-width: 0;
    flex: 1;
}
.bsms-collect-match-avatar {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff7ed;
    color: #ea580c;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.bsms-collect-match-name {
    font-weight: 800;
    font-size: 1.05rem;
    color: #0f172a;
    letter-spacing: .01em;
    line-height: 1.2;
}
.bsms-collect-match-father {
    font-weight: 600;
    font-size: .88rem;
    color: #64748b;
    margin-inline-start: .4rem;
}
.bsms-collect-match-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem .9rem;
    margin-top: .35rem;
    color: #64748b;
    font-size: .86rem;
}
.bsms-collect-match-meta i {
    margin-right: .2rem;
}
.bsms-collect-match-balance {
    text-align: right;
    flex-shrink: 0;
}
.bsms-collect-match-balance-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #94a3b8;
}
.bsms-collect-match-balance-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ea580c;
    line-height: 1.15;
}
html[dir="rtl"] .bsms-collect-match,
html[dir="rtl"] .bsms-collect-match-balance {
    text-align: right;
}
html[dir="rtl"] .bsms-collect-match-meta i {
    margin-right: 0;
    margin-left: .2rem;
}
@media (max-width: 767.98px) {
    .bsms-collect-match {
        flex-direction: column;
        align-items: stretch;
    }
    .bsms-collect-match-balance {
        text-align: left;
        padding-top: .35rem;
        border-top: 1px solid #f1f5f9;
    }
}

.bsms-collect-row:hover {
    background: rgba(242, 101, 34, 0.04);
}

.bsms-pay-history-table {
    max-height: 420px;
    overflow: auto;
}

.bsms-pay-history-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.bsms-collect-profile .row {
    --bs-gutter-x: 1rem;
}

/* Stretch collect form + history across the full content width */
.bsms-collect-profile > .row.g-3:has(.bsms-collect-card) {
    margin-left: 0;
    margin-right: 0;
}

.bsms-collect-hero {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    align-items: flex-start;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #fff 0%, var(--bsms-nav-accent-softer) 100%);
    border: 1px solid var(--bsms-nav-line);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.bsms-collect-hero-main {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    min-width: 0;
}

.bsms-collect-avatar {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bsms-nav-accent-soft);
    color: var(--bsms-nav-accent);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.bsms-collect-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bsms-nav-ink);
    line-height: 1.3;
}

.bsms-collect-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    color: var(--bsms-nav-muted);
    font-size: .85rem;
    margin-top: .25rem;
}

.bsms-collect-meta i {
    margin-right: .2rem;
}

.bsms-collect-product {
    margin-top: .4rem;
    font-size: .92rem;
    color: #374151;
}

.bsms-collect-hero-side {
    text-align: right;
}

.bsms-collect-balance-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bsms-nav-muted);
    margin-top: .35rem;
}

.bsms-collect-balance {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--bsms-nav-accent);
    line-height: 1.1;
}

.bsms-stat-tile {
    background: #fff;
    border: 1px solid var(--bsms-nav-line);
    border-radius: 12px;
    padding: .9rem 1rem;
}

.bsms-stat-tile.is-warn {
    border-color: rgba(217, 119, 6, 0.35);
    background: rgba(251, 191, 36, 0.08);
}

.bsms-stat-tile.is-accent {
    border-color: rgba(242, 101, 34, 0.3);
    background: var(--bsms-nav-accent-softer);
}

.bsms-stat-tile.is-due {
    border-color: rgba(220, 38, 38, 0.5);
    background: rgba(254, 226, 226, 0.65);
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.12);
}

.bsms-stat-tile.is-due .bsms-stat-label {
    color: #b91c1c;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.bsms-stat-tile.is-due .bsms-stat-value {
    color: #dc2626;
    font-size: 1.35rem;
}

.bsms-stat-label {
    font-size: .75rem;
    color: var(--bsms-nav-muted);
    margin-bottom: .2rem;
}

.bsms-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--bsms-nav-ink);
}

.bsms-recovery-stat {
    padding: 1.15rem 1.25rem;
}

.bsms-recovery-stat .bsms-stat-label {
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: .35rem;
}

.bsms-recovery-stat .bsms-stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.15;
}

.bsms-recovery-officer-head {
    padding: .65rem 1rem;
    background: #f8fafc;
    border-top: 1px solid var(--bsms-nav-line);
    border-bottom: 1px solid var(--bsms-nav-line);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .75rem;
}

.bsms-recovery-total-row td {
    background: #f1f5f9 !important;
    border-top: 2px solid #cbd5e1 !important;
}

.bsms-recovery-bucket-total,
.bsms-recovery-grand-total {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding: .75rem 1rem;
    background: #fff7ed;
    border-top: 1px solid rgba(242, 101, 34, 0.25);
    font-size: .95rem;
}



.bsms-pill {
    display: inline-flex;
    align-items: center;
    padding: .18rem .6rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.3;
}

.bsms-pill-month {
    background: rgba(242, 101, 34, 0.12);
    color: #c2410c;
}

.bsms-pill-ok {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.bsms-pill-warn {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
}

.bsms-pill-teal {
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}

.bsms-dash-recovery-scroll {
    max-height: 260px;
    overflow: auto;
    border-top: 1px solid #e2e8f0;
}

.bsms-dash-recovery-table {
    border-collapse: separate;
    border-spacing: 0;
}

.bsms-dash-recovery-table thead th {
    border-bottom: 1px solid #cbd5e1 !important;
    border-right: 1px solid #e2e8f0;
}

.bsms-dash-recovery-table thead th:last-child {
    border-right: 0;
}

.bsms-dash-recovery-table td {
    border-bottom: 1px solid #e2e8f0 !important;
    border-right: 1px solid #f1f5f9;
}

.bsms-dash-recovery-table td:last-child {
    border-right: 0;
}

.bsms-dash-recovery-table tbody tr:last-child td {
    border-bottom: 0 !important;
}

.bsms-dash-branch-row td {
    background: linear-gradient(90deg, #0f766e 0, #0f766e 3px, #f0fdfa 3px) !important;
    border-top: 1px solid rgba(15, 118, 110, 0.22) !important;
    border-bottom: 1px solid rgba(15, 118, 110, 0.16) !important;
}

.bsms-dash-branch-name {
    font-weight: 700;
    color: #0f766e;
}

.bsms-dash-branch-meta {
    margin-left: .45rem;
    font-size: .72rem;
    font-weight: 600;
    color: #0f766e;
    opacity: .75;
}

.bsms-dash-officer-row td {
    border-bottom: 1px solid #eef2f7 !important;
}

.bsms-dash-officer-row:hover td {
    background: #f8fafc;
}

.bsms-dash-officer {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding-left: .85rem;
    font-weight: 600;
    color: #334155;
}

.bsms-dash-officer-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #14b8a6;
    opacity: .7;
    flex-shrink: 0;
}

.bsms-dash-pct-chip {
    display: inline-block;
    min-width: 2.6rem;
    padding: .12rem .4rem;
    border-radius: 6px;
    font-weight: 800;
    font-size: .78rem;
    background: rgba(15, 23, 42, 0.04);
    text-align: center;
}

.bsms-dash-panel {
    border: 1px solid var(--bsms-nav-line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    background: #fff;
    position: relative;
}

.bsms-dash-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.bsms-dash-panel-sales::before { background: linear-gradient(180deg, #0f766e, #14b8a6); }
.bsms-dash-panel-purchases::before { background: linear-gradient(180deg, #0e7490, #06b6d4); }
.bsms-dash-panel-products::before { background: linear-gradient(180deg, #f26522, #fb923c); }

.bsms-dash-panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1rem .65rem 1.15rem;
    border-bottom: 1px solid var(--bsms-nav-line);
    background: #fff;
}

.bsms-dash-panel-sales .bsms-dash-panel-top {
    background: linear-gradient(90deg, #f0fdfa 0%, #fff 55%);
    border-bottom-color: rgba(15, 118, 110, 0.12);
}

.bsms-dash-panel-purchases .bsms-dash-panel-top {
    background: linear-gradient(90deg, #ecfeff 0%, #fff 55%);
    border-bottom-color: rgba(14, 116, 144, 0.12);
}

.bsms-dash-panel-products .bsms-dash-panel-top {
    background: linear-gradient(90deg, #fff7ed 0%, #fff 55%);
    border-bottom-color: rgba(242, 101, 34, 0.14);
}

.bsms-dash-panel-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.bsms-dash-panel-icon.sales {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.28);
}

.bsms-dash-panel-icon.purchases {
    background: linear-gradient(135deg, #0e7490, #06b6d4);
    box-shadow: 0 4px 10px rgba(14, 116, 144, 0.28);
}

.bsms-dash-panel-icon.products {
    background: linear-gradient(135deg, #f26522, #fb923c);
    box-shadow: 0 4px 10px rgba(242, 101, 34, 0.28);
}

.bsms-dash-panel-col {
    border-right: 1px solid var(--bsms-nav-line);
}

.bsms-dash-panel-col:last-child {
    border-right: 0;
}

.bsms-dash-panel-subhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .45rem .85rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--bsms-nav-line);
    font-size: .82rem;
}

.bsms-dash-panel-subhead span:first-child {
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-size: .72rem;
}

.bsms-dash-mini-table {
    font-size: .82rem;
}

.bsms-dash-mini-table thead th {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #64748b;
    padding: .35rem .75rem !important;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.bsms-dash-mini-table td {
    padding: .35rem .75rem !important;
    border-color: #f1f5f9;
}

.bsms-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: rgba(242, 101, 34, 0.12);
    color: #c2410c;
    font-size: .68rem;
    font-weight: 800;
}

@media (max-width: 767.98px) {
    .bsms-dash-panel-col {
        border-right: 0;
        border-bottom: 1px solid var(--bsms-nav-line);
    }

    .bsms-dash-panel-col:last-child {
        border-bottom: 0;
    }
}


.bsms-mode-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.bsms-mode-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .75rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    font-size: .82rem;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.bsms-mode-chip i {
    font-size: 1rem;
    color: #0f766e;
}

.bsms-mode-chip:hover {
    border-color: rgba(15, 118, 110, 0.35);
    background: #f0fdfa;
}

.bsms-mode-chip.is-active {
    border-color: rgba(15, 118, 110, 0.45);
    background: linear-gradient(135deg, #f0fdfa, #ecfdf5);
    color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.bsms-mode-chip.is-active i {
    color: #0f766e;
}

.bsms-seg-toggle {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--bsms-nav-line);
    border-radius: 10px;
    background: #f3f4f6;
    gap: 2px;
}

.bsms-seg-btn {
    border: 0;
    background: transparent;
    color: var(--bsms-nav-muted);
    font-weight: 600;
    font-size: .9rem;
    padding: .45rem 1rem;
    border-radius: 8px;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.bsms-seg-btn:hover {
    color: var(--bsms-nav-ink);
}

.bsms-seg-btn.is-active {
    background: var(--bsms-nav-accent);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

.bsms-recovery-remarks {
    min-width: 7rem;
    min-height: 2.25rem;
    border-bottom: 1px dashed #cbd5e1;
}

/* Screen: keep call-list header hidden until print popup */
.bsms-recovery-print-head {
    display: none;
}

@media print {
    .sidebar,
    .header,
    .footer,
    .main-header,
    .page-breadcrumb,
    .no-print {
        display: none !important;
    }

    .bsms-recovery-print-head {
        display: block !important;
    }

    .bsms-recovery-group {
        break-inside: avoid;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }

    .bsms-recovery-group .card-header {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .bsms-recovery-table {
        font-size: 11px;
    }

    .bsms-recovery-table th,
    .bsms-recovery-table td {
        border-color: #999 !important;
        padding: .35rem .4rem !important;
    }

    .bsms-recovery-remarks {
        min-height: 1.6rem;
        border-bottom: 1px solid #999;
    }

    .text-danger {
        color: #b91c1c !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

.bsms-collect-card {
    border: 1px solid var(--bsms-nav-line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: none;
}

.bsms-collect-settled i {
    font-size: 2.5rem;
    color: #16a34a;
}

.bsms-pay-timeline {
    padding: .5rem 1rem 1rem;
}

.bsms-pay-item {
    display: flex;
    gap: .85rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--bsms-nav-line);
}

.bsms-pay-item:last-child {
    border-bottom: 0;
}

.bsms-pay-dot {
    width: .65rem;
    height: .65rem;
    border-radius: 50%;
    margin-top: .45rem;
    flex-shrink: 0;
}

.bsms-pay-dot.is-advance {
    background: #d97706;
}

.bsms-pay-dot.is-installment {
    background: #16a34a;
}

.bsms-pay-body {
    flex: 1;
    min-width: 0;
}

@media (max-width: 767.98px) {
    .bsms-collect-hero-side {
        text-align: left;
        width: 100%;
    }
}

/* ========== Urdu RTL (Arabic-style full layout) ========== */
html[dir="rtl"] body.locale-ur,
body.locale-ur.layout-mode-rtl {
    direction: rtl;
    text-align: right;
}

body.locale-ur,
body.locale-ur .content,
body.locale-ur .card,
body.locale-ur .form-control,
body.locale-ur .form-select,
body.locale-ur .form-label,
body.locale-ur .table,
body.locale-ur .btn,
body.locale-ur .dropdown-menu,
body.locale-ur .page-header,
body.locale-ur .breadcrumb,
body.locale-ur .modal-content,
body.locale-ur .alert,
body.locale-ur .nav,
body.locale-ur .pagination {
    font-family: var(--bsms-font-urdu);
}

body.locale-ur .content {
    text-align: right;
}

body.locale-ur .form-label,
body.locale-ur .card-header h5,
body.locale-ur .page-breadcrumb h2,
body.locale-ur .bsms-dash-stat-label,
body.locale-ur .bsms-dash-stat-value {
    text-align: right;
}

body.locale-ur .form-control,
body.locale-ur .form-select,
body.locale-ur textarea.form-control {
    text-align: right;
}

/* Keep amounts/numbers LTR for readability */
body.locale-ur .text-end,
body.locale-ur td.text-end,
body.locale-ur th.text-end,
body.locale-ur .bsms-amt-in,
body.locale-ur .bsms-amt-out,
body.locale-ur .bsms-amt-mute,
body.locale-ur .bsms-bal-chip,
body.locale-ur .bsms-dash-stat-value,
body.locale-ur .bsms-closing-kpi-value,
body.locale-ur .bsms-dash-chip strong,
body.locale-ur input[type="number"] {
    direction: ltr;
    unicode-bidi: plaintext;
}

body.locale-ur .table thead th {
    text-align: right;
}

body.locale-ur .table thead th.text-end,
body.locale-ur .table td.text-end {
    text-align: left !important; /* visual end in RTL = left */
}

body.locale-ur .input-group > .form-control {
    border-radius: 0;
}

body.locale-ur .me-1 { margin-right: 0 !important; margin-left: .25rem !important; }
body.locale-ur .me-2 { margin-right: 0 !important; margin-left: .5rem !important; }
body.locale-ur .ms-1 { margin-left: 0 !important; margin-right: .25rem !important; }
body.locale-ur .ms-2 { margin-left: 0 !important; margin-right: .5rem !important; }
body.locale-ur .ms-auto { margin-left: 0 !important; margin-right: auto !important; }

body.locale-ur .dropdown-menu-end {
    --bs-position: end;
    right: auto;
    left: 0;
}

body.locale-ur .page-header .d-flex,
body.locale-ur .card-header.d-flex,
body.locale-ur .bsms-dash-panel-top,
body.locale-ur .bsms-dash-inline-kpis {
    flex-direction: row-reverse;
}

body.locale-ur .bsms-dash-panel-top {
    flex-direction: row-reverse;
}

body.locale-ur .bsms-dash-panel-top > div:first-child {
    flex-direction: row-reverse;
}

body.locale-ur .footer.d-sm-flex {
    flex-direction: row-reverse;
}

body.locale-ur .breadcrumb {
    justify-content: flex-start;
}

body.locale-ur .sidebar.bsms-sidenav .sidebar-menu > ul > li > a,
body.locale-ur .sidebar.bsms-sidenav .sidebar-menu > ul > li.submenu > ul > li > a {
    text-align: right;
}

body.locale-ur .sidebar.bsms-sidenav .sidebar-menu > ul > li > a i,
body.locale-ur .sidebar.bsms-sidenav .sidebar-menu > ul > li > a .ti {
    margin-left: .65rem;
    margin-right: 0;
}

body.locale-ur .bsms-sidenav-tagline {
    text-align: right;
}

body.locale-ur .bsms-dash-officer {
    padding-left: 0;
    padding-right: .85rem;
}

body.locale-ur .bsms-dash-panel::before,
body.locale-ur .bsms-dash-panel-cash::before,
body.locale-ur .bsms-dash-panel-sales::before,
body.locale-ur .bsms-dash-panel-purchases::before,
body.locale-ur .bsms-dash-panel-products::before {
    left: auto;
    right: 0;
}

body.locale-ur .bsms-dash-branch-row td {
    background: linear-gradient(270deg, #0f766e 0, #0f766e 3px, #f0fdfa 3px) !important;
}

body.locale-ur .pagination {
    direction: ltr;
}

body.locale-ur .modal-header .btn-close {
    margin-left: 0;
    margin-right: auto;
}

/* Auth / login — premium SmartBSMS (Sultan navy / gold / orange) */
.bsms-auth-shell {
    --login-ink: #061433;
    --login-navy: #002a6b;
    --login-accent: #f26522;
    --login-gold: #ffb803;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.25rem;
    background:
        radial-gradient(ellipse 65% 50% at 8% 12%, rgba(242, 101, 34, .16), transparent 58%),
        radial-gradient(ellipse 50% 42% at 92% 88%, rgba(0, 42, 107, .12), transparent 52%),
        radial-gradient(circle at 70% 20%, rgba(255, 184, 3, .08), transparent 40%),
        linear-gradient(165deg, #f8f5ef 0%, #eef1f6 45%, #e6ebf3 100%);
}
.bsms-login-page {
    width: min(1140px, 100%);
    min-height: 700px;
    display: grid;
    grid-template-columns: 1.14fr .86fr;
    overflow: hidden;
    border: 1px solid rgba(6, 20, 51, .08);
    border-radius: 30px;
    background: #fff;
    box-shadow:
        0 40px 90px rgba(6, 20, 51, .16),
        0 1px 0 rgba(255, 255, 255, .7) inset;
    animation: bsms-login-rise .6s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes bsms-login-rise {
    from { opacity: 0; transform: translateY(18px) scale(.982); }
    to { opacity: 1; transform: none; }
}
.bsms-login-brand {
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    padding: 58px 54px 62px;
    color: #fff;
    background:
        radial-gradient(circle at 90% 6%, rgba(255, 184, 3, .26), transparent 36%),
        radial-gradient(circle at 8% 92%, rgba(242, 101, 34, .32), transparent 44%),
        linear-gradient(148deg, #040e24 0%, #002a6b 46%, #1a3f78 100%);
}
.bsms-login-brand-glow {
    position: absolute;
    inset: -18% -8% auto auto;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 184, 3, .32), transparent 70%);
    animation: bsms-login-pulse 8s ease-in-out infinite;
}
.bsms-login-brand-glow.is-warm {
    inset: auto auto -28% -18%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(242, 101, 34, .28), transparent 68%);
    animation-delay: -3s;
}
.bsms-login-brand-grid {
    position: absolute;
    inset: 0;
    opacity: .1;
    background-image:
        linear-gradient(rgba(255,255,255,.55) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom right, transparent 6%, #000 58%);
}
.bsms-login-brand-sheen {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.07) 48%, transparent 62%);
    transform: translateX(-40%);
    animation: bsms-login-sheen 9s ease-in-out infinite;
}
@keyframes bsms-login-pulse {
    0%, 100% { transform: scale(1); opacity: .8; }
    50% { transform: scale(1.1); opacity: 1; }
}
@keyframes bsms-login-sheen {
    0%, 55% { transform: translateX(-45%); opacity: 0; }
    70% { opacity: .9; }
    100% { transform: translateX(45%); opacity: 0; }
}
.bsms-login-brand-content { position: relative; z-index: 2; max-width: 470px; }
.bsms-login-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 184, 3, .38);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #ffe09a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    animation: bsms-login-fade-in .7s .18s ease-out both;
}
.bsms-login-business {
    margin: 0 0 10px;
    color: #fff;
    font-size: clamp(36px, 4.4vw, 52px);
    font-weight: 800;
    letter-spacing: .01em;
    line-height: 1.05;
    text-shadow: 0 10px 32px rgba(0, 0, 0, .28);
    animation: bsms-login-fade-in .7s .2s ease-out both;
}
.bsms-login-product {
    margin: 0;
    color: #ffb803;
    font-size: clamp(18px, 1.8vw, 22px);
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1.2;
    animation: bsms-login-fade-in .7s .26s ease-out both;
}
.bsms-login-product-rule {
    width: 56px;
    height: 3px;
    margin: 14px 0 18px;
    border-radius: 99px;
    background: linear-gradient(90deg, #ffb803, #f26522);
    animation: bsms-login-fade-in .7s .3s ease-out both;
}
.bsms-login-brand h1 {
    max-width: 440px;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, .92);
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .01em;
    animation: bsms-login-fade-in .7s .34s ease-out both;
}
.bsms-login-brand-copy {
    max-width: 420px;
    margin-bottom: 28px;
    color: rgba(255,255,255,.78);
    font-size: 15px;
    line-height: 1.72;
    animation: bsms-login-fade-in .7s .4s ease-out both;
}
.bsms-login-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    animation: bsms-login-fade-in .7s .46s ease-out both;
}
.bsms-login-features span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(6px);
    font-size: 12px;
    font-weight: 650;
    color: rgba(255,255,255,.94);
}
.bsms-login-brand-orb {
    position: absolute;
    width: 270px;
    height: 270px;
    top: -118px;
    right: -96px;
    border: 44px solid rgba(255, 184, 3, .09);
    border-radius: 50%;
}
.bsms-login-brand-orb.is-secondary {
    width: 190px;
    height: 190px;
    top: auto;
    right: auto;
    bottom: -76px;
    left: -54px;
    border-width: 30px;
    border-color: rgba(242, 101, 34, .13);
}
.bsms-login-form-panel {
    position: relative;
    display: flex;
    align-items: center;
    padding: 54px 50px;
    background:
        radial-gradient(circle at 100% 0%, rgba(242, 101, 34, .05), transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
}
.bsms-login-form-wrap {
    width: 100%;
    max-width: 392px;
    margin-inline: auto;
    animation: bsms-login-fade-in .65s .2s ease-out both;
}
.bsms-login-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
}
.bsms-login-logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #eee4d4;
    box-shadow: 0 10px 24px rgba(175, 95, 6, .14);
    padding: 5px;
}
.bsms-login-logo > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.bsms-login-logo strong {
    color: #182033;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: .015em;
}
.bsms-login-logo small {
    margin-top: 5px;
    color: #8a91a3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.bsms-login-form-intro { margin-bottom: 1.35rem; }
.bsms-login-form-intro h2 {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 750;
    color: #182033;
    letter-spacing: -.01em;
}
.bsms-login-form-intro p {
    margin: 0;
    color: #7b8499;
    font-size: 14px;
    line-height: 1.55;
}
.bsms-login-mode {
    display: flex;
    gap: 0.5rem;
}
.bsms-login-mode .btn {
    flex: 1;
    font-weight: 600;
}
.bsms-login-mode a.btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.letter-spacing-pin {
    letter-spacing: 0.35em;
}
.bsms-auth-input { position: relative; }
.bsms-auth-input > i {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: #8a91a3;
    font-size: 19px;
    transition: color .15s ease;
}
.bsms-auth-input:focus-within > i { color: #f26522; }
.bsms-auth-input .form-control {
    height: 54px;
    padding-inline-start: 48px;
    border-color: #e2e6ee;
    border-radius: 13px;
    font-size: 14px;
    background: #fafbfc;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.bsms-auth-input .form-control:focus {
    border-color: #f26522;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(242, 101, 34, .12);
}
.bsms-login-submit {
    min-height: 54px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #f26522 0%, #d4551a 100%);
    box-shadow: 0 14px 30px rgba(242, 101, 34, .3);
    font-weight: 700;
    letter-spacing: .03em;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.bsms-login-submit:hover {
    filter: brightness(1.05);
    box-shadow: 0 16px 34px rgba(242, 101, 34, .36);
    transform: translateY(-1px);
}
.bsms-login-submit:active { transform: translateY(0); }
.bsms-login-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 22px 0 0;
    color: #8b93a7;
    font-size: 12px;
}
.bsms-login-credit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid #eef0f4;
    text-align: center;
}
.bsms-login-credit-label {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.bsms-login-credit strong {
    color: #182033;
    font-size: 13px;
    font-weight: 700;
}
.bsms-login-credit a {
    color: #002a6b;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}
.bsms-login-credit a:hover { color: #f26522; text-decoration: underline; }
@keyframes bsms-login-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* Security module */
.bsms-security-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    min-height: 138px;
    padding: 28px 32px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(120deg, #172554, #3448bd);
    box-shadow: 0 12px 30px rgba(30, 49, 130, .14);
}
.bsms-security-hero.is-roles { background: linear-gradient(120deg, #312e81, #6d43c8); }
.bsms-security-hero::after {
    position: absolute;
    width: 220px;
    height: 220px;
    right: -60px;
    top: -85px;
    content: "";
    border: 38px solid rgba(255,255,255,.07);
    border-radius: 50%;
}
.bsms-security-hero h4 { margin: 7px 0 6px; color: #fff; font-size: 24px; }
.bsms-security-hero p { max-width: 620px; margin: 0; color: rgba(255,255,255,.72); }
.bsms-security-eyebrow { display: inline-flex; align-items: center; gap: 7px; color: #c7d2fe; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.bsms-security-hero-icon { position: relative; z-index: 1; display: grid; width: 72px; height: 72px; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 18px; background: rgba(255,255,255,.1); font-size: 34px; }
.bsms-filter-card, .bsms-security-table-card, .bsms-security-form-card, .bsms-status-card { border: 1px solid #e8eaf0; box-shadow: 0 5px 18px rgba(15,23,42,.035); }
.bsms-filter-card .form-label { color: #596176; font-size: 12px; font-weight: 650; }
.bsms-security-table-card .card-header { min-height: 64px; border-bottom-color: #edf0f5; background: #fff; }
.bsms-security-table thead th { padding: 13px 16px; color: #6b7280; font-size: 11px; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
.bsms-security-table tbody td { padding: 15px 16px; border-color: #f0f2f6; }
.bsms-user-avatar, .bsms-role-avatar {
    display: inline-grid;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    color: #3448bd;
    background: #eef1ff;
    font-size: 13px;
    font-weight: 750;
}
.bsms-user-avatar.is-large { width: 64px; height: 64px; border-radius: 18px; font-size: 27px; }
.bsms-role-avatar { color: #7047bf; background: #f3edff; font-size: 19px; }
.bsms-login-name, .bsms-role-pill, .bsms-count-pill { display: inline-flex; align-items: center; gap: 6px; }
.bsms-login-name { color: #596176; font-size: 13px; }
.bsms-role-pill { padding: 5px 9px; border-radius: 7px; color: #3f4781; background: #f1f3fb; font-size: 12px; font-weight: 600; }
.bsms-count-pill { min-width: 46px; justify-content: center; padding: 5px 9px; border-radius: 999px; color: #4b5563; background: #f3f4f6; font-size: 12px; font-weight: 650; }
.bsms-form-shell { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.bsms-security-form-card .card-header { display: flex; align-items: center; gap: 13px; padding: 18px 20px; background: #fff; }
.bsms-security-form-card .card-header p { color: #8a91a3; font-size: 12px; }
.bsms-access-panel {
    padding: 14px 16px;
    border: 1px solid #e8eaf0;
    border-radius: 12px;
    background: #fafbfc;
}
.bsms-access-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 12px;
}
.bsms-security-form-card:has(.bsms-search-select-menu) {
    overflow: visible !important;
    z-index: 50;
}
.bsms-access-panel:has(.bsms-search-select-menu) {
    position: relative;
    z-index: 20;
    overflow: visible;
}
.bsms-section-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; color: #3155c6; background: #edf3ff; font-size: 20px; }
.bsms-section-icon.is-purple { color: #7047bf; background: #f4edff; }
.bsms-status-card { position: sticky; top: 84px; }
.bsms-user-preview { display: flex; flex-direction: column; align-items: center; padding: 12px 0; text-align: center; }
.bsms-user-preview strong { margin-top: 12px; color: #1f2937; }
.bsms-user-preview > span:last-child { color: #8a91a3; font-size: 12px; }
.bsms-sticky-actions { position: sticky; z-index: 8; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding: 14px 18px; border: 1px solid #e7e9ef; border-radius: 12px; background: rgba(255,255,255,.94); box-shadow: 0 -5px 24px rgba(15,23,42,.06); backdrop-filter: blur(10px); }
.bsms-validation-summary:empty { display: none; }
.validation-message { display: block; margin-top: 5px; color: #dc3545; font-size: 12px; }

body.locale-ur .bsms-auth-input > i { right: 16px; left: auto; }
body.locale-ur .bsms-auth-input .form-control { padding-right: 48px; padding-left: 16px; }
body.locale-ur .bsms-security-hero::after { right: auto; left: -60px; }

@media (max-width: 991.98px) {
    .bsms-login-page { grid-template-columns: 1fr; max-width: 560px; min-height: auto; }
    .bsms-login-brand { display: none; }
    .bsms-login-form-panel { min-height: 660px; padding: 42px; }
    .bsms-form-shell { grid-template-columns: 1fr; }
    .bsms-status-card { position: static; }
}
@media (max-width: 575.98px) {
    .bsms-auth-shell { padding: 0; }
    .bsms-login-page { min-height: 100vh; border: 0; border-radius: 0; }
    .bsms-login-form-panel { padding: 30px 22px; }
    .bsms-login-logo-img { width: 52px; height: 52px; }
    .bsms-login-business { font-size: 34px; }
    .bsms-login-product { font-size: 16px; }
    .bsms-security-hero { min-height: 120px; padding: 22px; }
    .bsms-security-hero-icon { display: none; }
    .bsms-filter-card .card-body { padding: 16px; }
    .bsms-sticky-actions { margin-inline: -4px; border-radius: 10px 10px 0 0; }
}

/* ===== Role editor (page permissions) ===== */
.role-loading { display: grid; min-height: 360px; place-content: center; justify-items: center; gap: 12px; color: #7b8499; }
.role-editor { --role-primary: #f26522; display: grid; grid-template-columns: minmax(270px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.role-editor .role-profile-panel,
.role-editor .permission-workspace { overflow: hidden; border: 1px solid #e7eaf1; border-radius: 18px; background: #fff; box-shadow: 0 12px 35px rgba(23,32,51,.055); }
.role-editor .role-profile-panel { position: sticky; top: 82px; }
.role-editor .role-profile-cover { position: relative; min-height: 180px; padding: 22px; overflow: hidden; color: #fff; background: radial-gradient(circle at 92% 8%, rgba(255,255,255,.19) 0 4%, transparent 5%), linear-gradient(145deg, #202a44 0%, #2c3657 52%, #3a4165 100%); }
.role-editor .role-profile-cover::after { position: absolute; right: -32px; bottom: -52px; width: 170px; height: 170px; border: 1px solid rgba(255,255,255,.1); border-radius: 45px; content: ""; transform: rotate(24deg); }
.role-editor .role-profile-icon { display: grid; width: 50px; height: 50px; margin-bottom: 18px; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 14px; background: rgba(255,255,255,.12); font-size: 24px; }
.role-editor .role-profile-kicker,
.role-editor .permission-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.role-editor .role-profile-kicker { color: #ffbd98; }
.role-editor .role-profile-cover h4 { position: relative; z-index: 1; margin: 8px 0 6px; color: #fff; font-size: 22px; }
.role-editor .role-profile-cover p { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.67); font-size: 12px; line-height: 1.55; }
.role-editor .role-profile-body { padding: 20px; }
.role-editor .role-profile-body .form-label { color: #4d576c; font-size: 12px; font-weight: 700; }
.role-editor .role-input { position: relative; }
.role-editor .role-input > i { position: absolute; z-index: 2; top: 50%; left: 14px; color: #8992a5; font-size: 18px; transform: translateY(-50%); }
.role-editor .role-input .form-control { height: 48px; padding-left: 43px; }
.role-editor .role-description { min-height: 120px; resize: vertical; }
.role-editor .role-profile-body .form-control { border-color: #e2e6ed; border-radius: 10px; color: #172033; background: #fbfcfe; }
.role-editor .role-profile-body .form-control:focus,
.role-editor .permission-search .form-control:focus { border-color: rgba(242,101,34,.55); background: #fff; box-shadow: 0 0 0 3px rgba(242,101,34,.09); }
.role-editor .role-access-summary { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px; border: 1px solid #ffdfcf; border-radius: 12px; background: #fff8f4; }
.role-editor .summary-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 10px; color: var(--role-primary); background: #fff; box-shadow: 0 3px 10px rgba(242,101,34,.1); }
.role-editor .role-access-summary span,
.role-editor .role-access-summary strong { display: block; }
.role-editor .role-access-summary span { color: #8a5c47; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.role-editor .role-access-summary strong { margin-top: 2px; color: #653924; font-size: 12px; }
.role-editor .permission-workspace { min-width: 0; }
.role-editor .permission-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 14px; }
.role-editor .permission-eyebrow { color: var(--role-primary); }
.role-editor .permission-heading h4 { margin: 5px 0 4px; color: #172033; font-size: 20px; }
.role-editor .permission-heading p { margin: 0; color: #8992a5; font-size: 12px; }
.role-editor .permission-score { display: flex; align-items: baseline; gap: 3px; padding: 10px 14px; border: 1px solid #e8ebf1; border-radius: 12px; background: #fafbfc; white-space: nowrap; }
.role-editor .permission-score strong { color: var(--role-primary); font-size: 22px; }
.role-editor .permission-score span { color: #858da0; font-size: 11px; }
.role-editor .permission-progress { height: 3px; background: #f0f2f5; }
.role-editor .permission-progress span { display: block; height: 100%; border-radius: 0 99px 99px 0; background: linear-gradient(90deg, #f26522, #ff995f); transition: width .25s ease; }
.role-editor .permission-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #edf0f4; background: #fbfcfe; }
.role-editor .permission-search { position: relative; width: min(380px, 100%); }
.role-editor .permission-search > i { position: absolute; z-index: 2; top: 50%; left: 13px; color: #9199aa; font-size: 17px; transform: translateY(-50%); }
.role-editor .permission-search .form-control { height: 41px; padding: 0 38px; border-color: #e3e7ee; border-radius: 10px; background: #fff; font-size: 12px; }
.role-editor .permission-search button { position: absolute; top: 50%; right: 8px; display: grid; width: 27px; height: 27px; padding: 0; place-items: center; border: 0; border-radius: 7px; color: #8b93a4; background: #f2f4f7; transform: translateY(-50%); }
.role-editor .permission-actions { display: flex; gap: 8px; }
.role-editor .permission-actions .btn { min-height: 39px; border-radius: 9px; font-size: 11px; font-weight: 650; }
.role-editor .permission-content { min-height: 260px; max-height: calc(100vh - 325px); padding: 14px 20px 16px; overflow: auto; background: #f8f9fc; }
.role-editor .permission-grid { display: block; column-count: 2; column-gap: 12px; }
.role-editor .permission-module { display: inline-block; width: 100%; margin: 0 0 12px; overflow: hidden; break-inside: avoid; border: 1px solid #e6e9f0; border-radius: 14px; background: #fff; box-shadow: 0 3px 12px rgba(25,35,55,.025); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.role-editor .permission-module:hover { border-color: #d9dde7; box-shadow: 0 8px 24px rgba(25,35,55,.06); transform: translateY(-1px); }
.role-editor .permission-module.has-access { border-color: #f4cab6; }
.role-editor .permission-module-header { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; border-bottom: 1px solid #f0f2f5; background: linear-gradient(180deg, #fff, #fcfcfd); }
.role-editor .module-toggle { display: flex; min-width: 0; flex: 1; align-items: center; gap: 10px; margin: 0; cursor: pointer; }
.role-editor .module-toggle input,
.role-editor .permission-page input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.role-editor .module-check { display: grid; width: 18px; height: 18px; flex: 0 0 18px; place-items: center; border: 1.5px solid #cfd4df; border-radius: 5px; color: transparent; background: #fff; font-size: 12px; transition: .18s ease; }
.role-editor .module-toggle input:checked + .module-check { border-color: var(--role-primary); color: #fff; background: var(--role-primary); box-shadow: 0 3px 8px rgba(242,101,34,.22); }
.role-editor .module-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 9px; color: #69738a; background: #f2f4f8; font-size: 16px; }
.role-editor .has-access .module-icon { color: #d85a1d; background: #fff1e9; }
.role-editor .module-name { min-width: 0; }
.role-editor .module-name strong,
.role-editor .module-name small { display: block; }
.role-editor .module-name strong { overflow: hidden; color: #293246; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.role-editor .module-name small { margin-top: 2px; color: #929aab; font-size: 10px; }
.role-editor .access-badge { display: inline-flex; align-items: center; gap: 3px; padding: 4px 7px; border-radius: 999px; color: #16845b; background: #eaf9f2; font-size: 9px; font-weight: 700; white-space: nowrap; }
.role-editor .permission-module-pages { padding: 5px 7px; }
.role-editor .permission-page { display: flex; min-height: 42px; align-items: center; gap: 10px; justify-content: space-between; margin: 0; padding: 6px 8px 6px 10px; border-radius: 9px; cursor: pointer; transition: background .15s ease; }
.role-editor .permission-page:hover { background: #f7f8fa; }
.role-editor .permission-page.is-selected { background: #fff8f4; }
.role-editor .permission-page > span:first-child { min-width: 0; }
.role-editor .permission-page strong,
.role-editor .permission-page small { display: block; }
.role-editor .permission-page strong { overflow: hidden; color: #4c5569; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.role-editor .permission-page small { overflow: hidden; max-width: 230px; margin-top: 2px; color: #a0a7b5; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.role-editor .page-switch { display: grid; width: 32px; height: 20px; flex: 0 0 32px; place-items: center; border-radius: 999px; color: transparent; background: #e6e9ef; font-size: 11px; transition: .18s ease; }
.role-editor .permission-page input:checked + .page-switch { color: #fff; background: var(--role-primary); box-shadow: 0 3px 8px rgba(242,101,34,.2); }
.role-editor .permission-empty { display: grid; min-height: 270px; place-content: center; justify-items: center; color: #9299a9; text-align: center; }
.role-editor .permission-empty > i { margin-bottom: 12px; color: #c4c9d3; font-size: 42px; }
.role-editor .permission-empty h5 { color: #596176; font-size: 14px; }
.role-editor .permission-empty p { max-width: 300px; font-size: 11px; }
.role-editor .permission-footer { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 20px; border-top: 1px solid #e9ecf1; background: #fff; }
.role-editor .permission-footer .btn { min-height: 41px; border-radius: 9px; font-size: 12px; font-weight: 650; }
.role-editor .footer-status { display: flex; align-items: center; gap: 9px; color: #6f788b; font-size: 11px; }
.role-editor .footer-status > i { color: #20a16b; font-size: 20px; }
.role-editor .footer-status strong { color: #30394d; }
body.locale-ur .role-editor .role-input > i { right: 14px; left: auto; }
body.locale-ur .role-editor .role-input .form-control { padding-right: 43px; padding-left: 12px; }
body.locale-ur .role-editor .permission-search > i { right: 13px; left: auto; }
body.locale-ur .role-editor .permission-search .form-control { padding-right: 38px; }
body.locale-ur .role-editor .permission-search button { right: auto; left: 8px; }
@media (max-width: 1399.98px) {
    .role-editor .permission-grid { column-count: 2; }
}
@media (max-width: 991.98px) {
    .role-editor { grid-template-columns: 1fr; }
    .role-editor .role-profile-panel { position: static; }
    .role-editor .role-profile-cover { min-height: 180px; }
    .role-editor .permission-content { max-height: none; }
}
@media (max-width: 767.98px) {
    .role-editor .permission-grid { column-count: 1; }
}
@media (max-width: 575.98px) {
    .role-editor .permission-heading,
    .role-editor .permission-toolbar,
    .role-editor .permission-footer { align-items: stretch; flex-direction: column; }
    .role-editor .permission-heading,
    .role-editor .permission-toolbar,
    .role-editor .permission-content,
    .role-editor .permission-footer { padding-right: 16px; padding-left: 16px; }
    .role-editor .permission-actions,
    .role-editor .permission-actions .btn { flex: 1; }
    .role-editor .footer-status { justify-content: center; }
}

.bsms-notif-section {
    padding: 8px 14px 4px;
    color: #8a91a3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: #fafbfc;
}

/* Investor sale assign */
.investor-assign-filters .input-group-text {
    background: #fff;
    color: #8a91a3;
}
.investor-assign-list .bsms-table tbody td {
    padding-top: .55rem;
    padding-bottom: .55rem;
    vertical-align: middle;
}
.investor-assign-list .bsms-table tbody tr:hover {
    background: #f8fafc;
}

/* Branch home (daily tasks) — full content width */
.branch-home {
    width: 100%;
    max-width: none;
}
.branch-home-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 1.35rem 1.5rem;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 55%, #f8fafc 100%);
    border: 1px solid #ffe4c7;
}
.branch-home-hero-glow {
    position: absolute;
    inset: -40% auto auto -10%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249, 115, 22, .18), transparent 70%);
    pointer-events: none;
}
.branch-home-eyebrow {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #ea580c;
    margin-bottom: .35rem;
}
.branch-home-title {
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.02em;
}
.branch-home-subtitle {
    color: #64748b;
    max-width: none;
}
.branch-home-date {
    display: inline-flex;
    align-items: center;
    padding: .45rem .85rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: .85rem;
    font-weight: 600;
}

.branch-home-kpi {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    height: 100%;
    padding: 1.1rem 1.15rem;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #eef0f4;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
    color: inherit;
}
.branch-home-kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.branch-home-kpi.is-sales .branch-home-kpi-icon { background: #ffedd5; color: #ea580c; }
.branch-home-kpi.is-cash .branch-home-kpi-icon { background: #dcfce7; color: #15803d; }
.branch-home-kpi.is-stock .branch-home-kpi-icon { background: #e0e7ff; color: #4338ca; }
.branch-home-kpi.is-xfer .branch-home-kpi-icon { background: #fef3c7; color: #b45309; }
.branch-home-kpi-label {
    font-size: .78rem;
    color: #64748b;
    font-weight: 600;
}
.branch-home-kpi-value {
    font-size: clamp(1rem, 4.5vw, 1.55rem);
    font-weight: 800;
    line-height: 1.15;
    color: #0f172a;
    overflow-wrap: anywhere;
}
.branch-home-kpi-meta {
    font-size: .8rem;
    color: #475569;
    font-weight: 500;
    margin-top: .12rem;
}

.branch-home-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    min-height: 148px;
    padding: 1.15rem 1.1rem 1.2rem;
    border-radius: 18px;
    text-decoration: none !important;
    color: inherit !important;
    background: #fff;
    border: 1px solid #e8ecf2;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .035);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.branch-home-tile:hover {
    transform: translateY(-3px);
    border-color: #fdba74;
    box-shadow: 0 16px 36px rgba(249, 115, 22, .12);
}
.branch-home-tile.is-primary {
    background: linear-gradient(160deg, #fff7ed 0%, #ffffff 58%);
    border-color: #fdba74;
}
.branch-home-tile-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff7ed;
    color: #ea580c;
    font-size: 1.45rem;
    margin-bottom: .25rem;
}
.branch-home-tile.is-primary .branch-home-tile-icon {
    background: #ea580c;
    color: #fff;
}
.branch-home-tile-title {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
}
.branch-home-tile-hint {
    font-size: .8rem;
    color: #64748b;
    line-height: 1.35;
}
.branch-home-tile-go {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #ea580c;
    font-size: .95rem;
}
html[dir="rtl"] .branch-home-tile-go {
    right: auto;
    left: 1rem;
}

.branch-home-more {
    width: 100%;
}
.branch-home-more-label {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: .65rem;
}
.branch-home-more-row {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}
.branch-home-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem .9rem;
    border-radius: 999px;
    border: 1px solid #e8ecf2;
    background: #fff;
    color: #334155 !important;
    text-decoration: none !important;
    font-size: .88rem;
    font-weight: 600;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.branch-home-chip i {
    color: #ea580c;
    font-size: 1rem;
}
.branch-home-chip:hover {
    border-color: #fdba74;
    background: #fff7ed;
    color: #9a3412 !important;
}

.branch-home-record {
    border-radius: 18px !important;
    border: 1px solid #eef0f4 !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
    overflow: hidden;
}
.branch-home-record-table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    border-bottom-width: 1px;
    background: #f8fafc;
}

.branch-home-stat {
    border: 1px solid #eef0f4;
    border-radius: 14px;
    box-shadow: none;
}
.branch-home-action {
    border: 1px solid #eef0f4;
    border-radius: 14px;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
    color: inherit;
}
.branch-home-action:hover {
    border-color: #f97316;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    transform: translateY(-2px);
    color: inherit;
}
.branch-home-action.is-primary {
    border-color: #fed7aa;
    background: linear-gradient(180deg, #fff7ed 0%, #fff 70%);
}
.branch-home-action-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f8fafc;
    color: #ea580c;
    font-size: 1.35rem;
}
.branch-home-action.is-primary .branch-home-action-icon {
    background: #ffedd5;
}

/* ===== POS + price tags ===== */
.bsms-pos { max-width: 1280px; margin: 0 auto; }
.bsms-pos-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.bsms-pos-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .7fr);
    gap: 16px;
    align-items: start;
}
.bsms-pos-scan {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid #e8ecf2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 32, 51, .05);
}
.bsms-pos-scan > i { color: #f26522; font-size: 28px; }
.bsms-pos-cart { border: 1px solid #e8ecf2; box-shadow: 0 8px 24px rgba(24, 32, 51, .04); }
.bsms-pos-side .card { border: 1px solid #e8ecf2; box-shadow: 0 10px 28px rgba(24, 32, 51, .06); }
.bsms-pos-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 14px 0 4px;
    border-top: 1px dashed #e5e7eb;
    font-size: 15px;
}
.bsms-pos-total strong { color: #182033; font-size: 28px; letter-spacing: .01em; }
.bsms-pos-walkin {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid #e8ecf2;
    border-radius: 12px;
    background: #f8fafc;
}
.bsms-pos-walkin > i { color: #0f7a4a; font-size: 22px; margin-top: 2px; }
.bsms-pos-walkin strong { display: block; color: #182033; font-size: 14px; }
.bsms-pos-walkin span { display: block; color: #64748b; font-size: 12px; line-height: 1.4; }
.bsms-pos-totals { margin-top: 4px; }
.bsms-pos-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 0;
    font-size: 14px;
}
.bsms-pos-row strong { color: #182033; font-size: 26px; }
.bsms-pos-row.is-change {
    margin-top: 4px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #ecfdf5;
    color: #0f7a4a;
}
.bsms-pos-row.is-change strong { color: #0f7a4a; }
.bsms-pos-row.is-short {
    margin-top: 4px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff1f2;
    color: #be123c;
}
.bsms-pos-row.is-short strong { color: #be123c; }

.bsms-price-tags-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}
.bsms-price-tag-sheet {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.bsms-price-tag {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 12px 12px;
    border: 1px solid #dfe3ea;
    border-radius: 12px;
    background: #fff;
    text-align: center;
    break-inside: avoid;
    page-break-inside: avoid;
}
.bsms-price-tag-brand {
    color: #f26522;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.bsms-price-tag-name {
    color: #182033;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}
.bsms-price-tag-sku { color: #64748b; font-size: 11px; }
.bsms-price-tag-meta {
    margin: 2px 0 4px;
    color: #334155;
    font-size: 11px;
    font-weight: 650;
    word-break: break-all;
}
.bsms-price-tag-barcode { width: 100%; max-width: 180px; height: 42px; }
.bsms-price-tag-code {
    color: #334155;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .04em;
}

@media (max-width: 991.98px) {
    .bsms-pos-grid { grid-template-columns: 1fr; }
    .bsms-pos-scan { grid-template-columns: 1fr; }
    .bsms-pos-scan > i { display: none; }
}

@media print {
    .bsms-price-tags-toolbar,
    .no-print,
    .sidebar,
    .header,
    .footer { display: none !important; }
    .bsms-price-tag-sheet {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .bsms-price-tag {
        border-color: #111;
        border-radius: 0;
        box-shadow: none;
    }
}

/* Daily closing detail KPIs — tinted cards, left accent, large amounts */
.bsms-closing-kpi {
    position: relative;
    border: 1px solid var(--bsms-nav-line, #e2e8f0);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    background: #fff;
}
.bsms-closing-kpi::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #94a3b8;
    border-radius: 14px 0 0 14px;
}
.bsms-closing-kpi .card-body {
    padding: 1rem 1.1rem 1rem 1.15rem;
}
.bsms-closing-kpi-label {
    font-size: 0.72rem !important;
    font-weight: 650;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
    line-height: 1.2;
}
.bsms-closing-kpi-value {
    font-size: 1.55rem !important;
    font-weight: 800 !important;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.15 !important;
}
.bsms-closing-kpi-status {
    display: inline-block;
    margin-top: 0.15rem;
    font-size: 1.2rem !important;
    font-weight: 800 !important;
    padding: 0.5rem 1rem !important;
    border-radius: 10px !important;
    letter-spacing: 0.01em;
    line-height: 1.25 !important;
}
/* Status */
.bsms-closing-kpi--status-pending {
    background: linear-gradient(135deg, #fffbeb 0%, #fff 52%);
    border-color: rgba(217, 119, 6, 0.22);
}
.bsms-closing-kpi--status-pending::before { background: linear-gradient(180deg, #d97706, #f59e0b); }
.bsms-closing-kpi--status-pending .bsms-closing-kpi-label { color: #92400e; }
.bsms-closing-kpi--status-verified {
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 52%);
    border-color: rgba(21, 128, 61, 0.2);
}
.bsms-closing-kpi--status-verified::before { background: linear-gradient(180deg, #15803d, #22c55e); }
.bsms-closing-kpi--status-verified .bsms-closing-kpi-label { color: #166534; }
/* Summary row */
.bsms-closing-kpi--payments {
    background: linear-gradient(135deg, #f0f9ff 0%, #fff 55%);
    border-color: rgba(2, 132, 199, 0.18);
}
.bsms-closing-kpi--payments::before { background: linear-gradient(180deg, #0369a1, #0ea5e9); }
.bsms-closing-kpi--payments .bsms-closing-kpi-value { color: #0369a1; }
.bsms-closing-kpi--in {
    background: linear-gradient(135deg, #ecfdf5 0%, #fff 55%);
    border-color: rgba(5, 150, 105, 0.2);
}
.bsms-closing-kpi--in::before { background: linear-gradient(180deg, #059669, #34d399); }
.bsms-closing-kpi--in .bsms-closing-kpi-value { color: #047857; }
.bsms-closing-kpi--out {
    background: linear-gradient(135deg, #fef2f2 0%, #fff 55%);
    border-color: rgba(220, 38, 38, 0.18);
}
.bsms-closing-kpi--out::before { background: linear-gradient(180deg, #dc2626, #f87171); }
.bsms-closing-kpi--out .bsms-closing-kpi-value { color: #b91c1c; }
/* Breakdown row */
.bsms-closing-kpi--advance {
    background: linear-gradient(135deg, #f0fdfa 0%, #fff 55%);
    border-color: rgba(15, 118, 110, 0.18);
}
.bsms-closing-kpi--advance::before { background: linear-gradient(180deg, #0f766e, #14b8a6); }
.bsms-closing-kpi--advance .bsms-closing-kpi-value { color: #0f766e; }
.bsms-closing-kpi--installment {
    background: linear-gradient(135deg, #ecfeff 0%, #fff 55%);
    border-color: rgba(8, 145, 178, 0.18);
}
.bsms-closing-kpi--installment::before { background: linear-gradient(180deg, #0891b2, #22d3ee); }
.bsms-closing-kpi--installment .bsms-closing-kpi-value { color: #0e7490; }
.bsms-closing-kpi--lump {
    background: linear-gradient(135deg, #fffbeb 0%, #fff 55%);
    border-color: rgba(180, 83, 9, 0.18);
}
.bsms-closing-kpi--lump::before { background: linear-gradient(180deg, #b45309, #fbbf24); }
.bsms-closing-kpi--lump .bsms-closing-kpi-value { color: #b45309; }
.bsms-closing-kpi--branch {
    background: linear-gradient(135deg, #f8fafc 0%, #fff 55%);
    border-color: rgba(71, 85, 105, 0.2);
}
.bsms-closing-kpi--branch::before { background: linear-gradient(180deg, #475569, #94a3b8); }
.bsms-closing-kpi--branch .bsms-closing-kpi-value { color: #334155; }
.bsms-closing-kpi--expense {
    background: linear-gradient(135deg, #fff1f2 0%, #fff 55%);
    border-color: rgba(225, 29, 72, 0.16);
}
.bsms-closing-kpi--expense::before { background: linear-gradient(180deg, #e11d48, #fb7185); }
.bsms-closing-kpi--expense .bsms-closing-kpi-value { color: #be123c; }
.bsms-closing-kpi--supplier {
    background: linear-gradient(135deg, #fff7ed 0%, #fff 55%);
    border-color: rgba(194, 65, 12, 0.18);
}
.bsms-closing-kpi--supplier::before { background: linear-gradient(180deg, #c2410c, #fb923c); }
.bsms-closing-kpi--supplier .bsms-closing-kpi-value { color: #c2410c; }
.bsms-closing-kpi--dealer {
    background: linear-gradient(135deg, #ccfbf1 0%, #fff 55%);
    border-color: rgba(13, 148, 136, 0.2);
}
.bsms-closing-kpi--dealer::before { background: linear-gradient(180deg, #0d9488, #2dd4bf); }
.bsms-closing-kpi--dealer .bsms-closing-kpi-value { color: #0f766e; }
.bsms-closing-kpi--attachment {
    background: linear-gradient(135deg, #f1f5f9 0%, #fff 55%);
    border-color: rgba(100, 116, 139, 0.22);
}
.bsms-closing-kpi--attachment::before { background: linear-gradient(180deg, #64748b, #94a3b8); }
.bsms-closing-kpi--attachment .bsms-closing-kpi-value { color: #475569; }

/* Daily branch report KPIs */
.bsms-daily-kpi--sales {
    background: linear-gradient(135deg, #eef2ff 0%, #fff 55%);
    border-color: rgba(79, 70, 229, 0.18);
}
.bsms-daily-kpi--sales::before { background: linear-gradient(180deg, #4f46e5, #818cf8); }
.bsms-daily-kpi--sales .bsms-closing-kpi-value { color: #4338ca; }
.bsms-daily-kpi--sales .bsms-closing-kpi-label { color: #4338ca; }
.bsms-daily-kpi--cash {
    background: linear-gradient(135deg, #fff7ed 0%, #fff 55%);
    border-color: rgba(234, 88, 12, 0.2);
}
.bsms-daily-kpi--cash::before { background: linear-gradient(180deg, #ea580c, #fb923c); }
.bsms-daily-kpi--cash .bsms-closing-kpi-value { color: #c2410c; }
.bsms-daily-kpi--cash .bsms-closing-kpi-label { color: #c2410c; }
.bsms-daily-kpi-sub {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
}
.bsms-daily-kpi-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.bsms-daily-kpi-icon.sales { background: rgba(79, 70, 229, 0.12); color: #4338ca; }
.bsms-daily-kpi-icon.in { background: rgba(5, 150, 105, 0.12); color: #047857; }
.bsms-daily-kpi-icon.expense { background: rgba(225, 29, 72, 0.12); color: #be123c; }
.bsms-daily-kpi-icon.sent { background: rgba(2, 132, 199, 0.12); color: #0369a1; }
.bsms-daily-kpi-icon.cash { background: rgba(234, 88, 12, 0.12); color: #c2410c; }

.bsms-daily-branch-panel {
    border: 1px solid var(--bsms-nav-line, #e2e8f0);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.bsms-daily-branch-table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.bsms-daily-branch-table thead th.is-in,
.bsms-daily-branch-table td.is-in { color: #047857; }
.bsms-daily-branch-table thead th.is-out,
.bsms-daily-branch-table td.is-out { color: #be123c; }
.bsms-daily-branch-table thead th.is-sent,
.bsms-daily-branch-table td.is-sent { color: #0369a1; }
.bsms-daily-branch-table thead th.is-cash { color: #c2410c; }
.bsms-daily-branch-total {
    background: #f8fafc;
    font-weight: 700;
}
.bsms-daily-branch-total td { border-top: 2px solid #e2e8f0; }

/* Owner Growth dashboard */
.bsms-growth-signal {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
}
.bsms-growth-signal.growing { background: #ecfdf5; color: #047857; }
.bsms-growth-signal.declining { background: #fef2f2; color: #b91c1c; }
.bsms-growth-signal.flat { background: #f1f5f9; color: #475569; }

.bsms-growth-kpi .card-body { padding: 0.85rem 1rem; }
.bsms-growth-kpi-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}
.bsms-growth-kpi-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.bsms-growth-kpi-mom { font-size: 0.9rem; font-weight: 700; margin-top: 0.35rem; }
.bsms-growth-kpi-yoy { font-size: 0.75rem; margin-top: 0.15rem; }
.bsms-growth-kpi-mom.is-up, .bsms-growth .is-up { color: #047857; }
.bsms-growth-kpi-mom.is-down, .bsms-growth .is-down { color: #b91c1c; }
.bsms-growth-kpi-mom.is-flat, .bsms-growth .is-flat { color: #64748b; }

.bsms-growth-legend { display: flex; gap: 0.85rem; align-items: center; flex-wrap: wrap; }
.bsms-growth-legend .leg {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-inline-end: 0.25rem;
}
.bsms-growth-legend .leg.sales { background: #0f766e; }
.bsms-growth-legend .leg.coll { background: #0284c7; }
.bsms-growth-legend .leg.exp { background: #e11d48; }

.bsms-growth-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    min-height: 180px;
    padding-top: 0.5rem;
    overflow-x: auto;
}
.bsms-growth-col {
    flex: 1 0 48px;
    min-width: 44px;
    text-align: center;
}
.bsms-growth-col .bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 140px;
}
.bsms-growth-col .bar {
    width: 8px;
    min-height: 2px;
    border-radius: 3px 3px 0 0;
}
.bsms-growth-col .bar.sales { background: linear-gradient(180deg, #14b8a6, #0f766e); }
.bsms-growth-col .bar.coll { background: linear-gradient(180deg, #38bdf8, #0284c7); }
.bsms-growth-col .bar.exp { background: linear-gradient(180deg, #fb7185, #e11d48); }
.bsms-growth-col .lbl {
    margin-top: 0.4rem;
    font-size: 0.68rem;
    color: #64748b;
    white-space: nowrap;
}

/* Admin dashboard period switch */
.bsms-dash-period-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.bsms-period-switch {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.bsms-period-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.bsms-period-btn i {
    font-size: 1rem;
    line-height: 1;
}

.bsms-period-btn:hover:not(:disabled):not(.is-active) {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.7);
}

.bsms-period-btn.is-active {
    color: #fff;
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
}

.bsms-period-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.bsms-period-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.bsms-period-date {
    display: inline-flex;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
}

.bsms-dash-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.avatar.bg-teal {
    background-color: #0d9488 !important;
    color: #fff;
}

/* Mobile sidenav: keep above content when opened */
@media (max-width: 991.98px) {
    .slide-nav .sidebar.bsms-sidenav {
        margin-left: 0;
        z-index: 1050;
    }
    body.locale-ur.layout-mode-rtl .slide-nav .sidebar.bsms-sidenav {
        margin-left: 0;
        margin-right: 0;
    }
    .sidebar-overlay.opened {
        z-index: 1040;
    }
    .header .mobile_btn {
        z-index: 1060;
        cursor: pointer;
    }

    /* Theme CSS hides .user-menu on mobile — restore profile / logout / language */
    .header .header-user .user-menu {
        display: flex !important;
        align-items: center;
        height: auto;
        padding: 0 8px 0 0 !important;
        margin: 0;
        position: absolute;
        top: 0;
        right: 0;
        left: auto;
        max-width: calc(100% - 56px);
        justify-content: flex-end;
    }
    body.locale-ur.layout-mode-rtl .header .header-user .user-menu {
        right: auto;
        left: 0;
        padding: 0 0 0 8px !important;
    }
    .header .header-user .user-menu #toggle_btn,
    .header .header-user .user-menu #header-search {
        display: none !important;
    }
    .header.bsms-topbar .bsms-topbar-actions {
        gap: 6px;
        margin-inline-start: 0;
        padding: 0;
    }
    .header.bsms-topbar .bsms-topbar-profile {
        padding: 2px;
        max-width: none;
        border-radius: 999px;
    }
    .header.bsms-topbar .bsms-topbar-profile .avatar {
        width: 32px;
        height: 32px;
    }
    .header.bsms-topbar .bsms-account-dropdown {
        position: absolute;
        z-index: 1080;
    }

    .bsms-dash-stat-row {
        flex-wrap: wrap;
    }
    .bsms-dash-stat-row .avatar {
        width: 34px;
        height: 34px;
        font-size: .9rem;
    }
    .bsms-dash-stat-action {
        margin-inline-start: auto;
        padding: .2rem .55rem;
        font-size: .75rem;
    }
    .bsms-dash-stat-hint {
        font-size: .7rem;
    }
    .bsms-collect-match-balance-value {
        font-size: clamp(1.1rem, 5vw, 1.45rem);
        overflow-wrap: anywhere;
    }
    .branch-home-kpi-value {
        font-size: clamp(1rem, 4.5vw, 1.4rem);
        overflow-wrap: anywhere;
    }

    .bsms-period-btn span {
        display: none;
    }
    .bsms-period-btn {
        padding: 0.5rem 0.7rem;
    }

    .bsms-dashboard .bsms-dash-stat .card-body {
        padding: 0.9rem 1rem;
    }
    .bsms-dashboard .bsms-dash-stat-label {
        font-size: 0.7rem;
        letter-spacing: 0.02em;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .bsms-dash-period-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .bsms-period-meta {
        justify-content: flex-start;
    }
}

/* Branch staff in HO — simple home (full content width) */
.ho-simple-home {
    max-width: none;
    width: 100%;
}
.ho-simple-hero {
    padding: 1.25rem 1.35rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 55%, #f8fafc 100%);
    border: 1px solid #fed7aa;
}
.ho-simple-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c2410c;
    margin-bottom: 0.25rem;
}
.ho-simple-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
}
.ho-simple-subtitle {
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.45;
}
.ho-simple-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.05rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    color: inherit;
    min-height: 76px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.ho-simple-card:hover {
    border-color: #fdba74;
    box-shadow: 0 6px 18px rgba(234, 88, 12, 0.1);
    transform: translateY(-1px);
    color: inherit;
}
.ho-simple-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 1.15rem;
}
.ho-simple-card-icon.is-approve { background: #ea580c; }
.ho-simple-card-icon.is-xfer { background: #0284c7; }
.ho-simple-card-icon.is-purchase { background: #7c3aed; }
.ho-simple-card-icon.is-cash { background: #0d9488; }
.ho-simple-card-icon.is-report { background: #334155; }
.ho-simple-card-icon.is-log { background: #64748b; }
.ho-simple-card-title {
    font-weight: 750;
    color: #0f172a;
    font-size: 0.98rem;
}
.ho-simple-card-meta {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.3;
}
.ho-simple-card-chevron {
    margin-inline-start: auto;
    color: #94a3b8;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .bsms-dashboard .row.row-cols-sm-2 > .col {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .bsms-dashboard .bsms-dash-stat-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
    }
    .bsms-dashboard .bsms-dash-stat-row .avatar {
        width: 36px;
        height: 36px;
    }
    .bsms-dashboard .bsms-dash-stat-value {
        font-size: 1.35rem;
    }
    .bsms-dashboard .bsms-dash-stat-action {
        margin-inline-start: 0;
        align-self: flex-start;
    }
}

.bsms-sidenav-mobile-account {
    margin-top: 1rem;
    padding: .85rem .9rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.bsms-sidenav-mobile-user {
    margin-bottom: .65rem;
    padding: 0 .35rem;
}
.bsms-sidenav-mobile-user strong {
    color: #fff;
    font-size: .92rem;
}
.bsms-sidenav-mobile-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .7rem .75rem;
    margin-bottom: .35rem;
    border-radius: 10px;
    color: #e2e8f0 !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: .9rem;
    background: rgba(255, 255, 255, 0.04);
}
.bsms-sidenav-mobile-link i {
    font-size: 1.1rem;
}
.bsms-sidenav-mobile-link:hover,
.bsms-sidenav-mobile-link:active {
    background: rgba(242, 101, 34, 0.18);
    color: #fff !important;
}
.bsms-sidenav-mobile-link.is-danger {
    color: #fecaca !important;
}

.header.bsms-topbar .bsms-topbar-price-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .01em;
}

.price-list-sale {
    display: inline-block;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ea580c;
    letter-spacing: -0.02em;
}

.price-list-search .form-control-lg {
    min-height: 48px;
}

@media (max-width: 767.98px) {
    .price-list-table th:nth-child(2),
    .price-list-table td:nth-child(2),
    .price-list-table th:nth-child(3),
    .price-list-table td:nth-child(3) {
        display: none;
    }
    .price-list-row td:first-child .text-muted {
        display: block;
    }
}

/* ---------- Cross-app mobile / tablet polish ---------- */
@media (max-width: 991.98px) {
    .bsms-page-actions {
        width: 100%;
        gap: .5rem !important;
    }
    .bsms-page-actions > .btn,
    .bsms-page-actions > a.btn,
    .bsms-page-actions > .btn-group {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .bsms-page-actions > .btn,
    .bsms-page-actions > a.btn {
        min-height: 42px;
        flex: 1 1 calc(50% - .35rem);
    }

    /* List row action icons — larger tap targets */
    .table .btn-icon.btn-sm,
    .btn-icon.btn-sm {
        width: 2.5rem !important;
        height: 2.5rem !important;
        min-width: 2.5rem !important;
        padding: 0 !important;
    }

    /* Report filter Search buttons — full width on tablet/phone */
    .card .row.g-2 > [class*="col-"] > .btn.w-100,
    .card .row.g-3 > [class*="col-"] > .btn.w-100 {
        min-height: 42px;
    }

    /* POS: keep checkout reachable */
    .bsms-pos-side {
        position: sticky;
        bottom: 0;
        z-index: 30;
        margin-top: .75rem;
    }
    .bsms-pos-side > .card {
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.14);
        margin-bottom: 0;
    }
    .bsms-pos-side .btn-lg {
        min-height: 48px;
    }
}

@media screen and (max-width: 767.98px) {
    .bsms-collect-kind {
        flex-direction: column;
    }
    .bsms-collect-kind > .btn {
        border-radius: 10px !important;
        min-height: 44px;
        width: 100%;
    }
    .bsms-collect-kind > .btn + .btn {
        margin-left: 0 !important;
        margin-top: .4rem;
    }

    /* Keep invoice cards side-by-side on screen when possible; only stack very narrow phones */
    .bsms-inv-grid {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) !important;
    }

    .bsms-inv-sale-meta-row {
        grid-template-columns: 1fr 1fr !important;
    }

    .purchase-stock-table {
        padding-bottom: 5rem;
    }

    /* Dense action cells: allow wrap instead of sideways page scroll */
    .table td.text-nowrap {
        white-space: normal !important;
    }
    .table td .btn-icon {
        margin-bottom: .2rem;
    }

    .branch-home .bsms-dash-inline-kpis {
        flex-direction: column;
        align-items: stretch !important;
    }
}

@media screen and (max-width: 420px) {
    .bsms-inv-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Approvals, sale gate, activity log — narrow viewports */
@media (max-width: 767.98px) {
    .bsms-sale-gate-table th:nth-child(4),
    .bsms-sale-gate-table td:nth-child(4),
    .bsms-sale-gate-table th:nth-child(5),
    .bsms-sale-gate-table td:nth-child(5) {
        display: none;
    }

    .bsms-approvals-table th:nth-child(6),
    .bsms-approvals-table td:nth-child(6) {
        max-width: 8rem;
        white-space: normal;
        word-break: break-word;
    }

    .bsms-approvals-table td.text-end.text-nowrap {
        white-space: normal !important;
    }

    .bsms-approvals-table td.text-end.text-nowrap .btn {
        min-height: 40px;
        margin-bottom: 0.25rem;
    }

    .bsms-activity-log-table th:nth-child(5),
    .bsms-activity-log-table td:nth-child(5),
    .bsms-activity-log-table th:nth-child(6),
    .bsms-activity-log-table td:nth-child(6) {
        display: none;
    }

    .activity-log-filters .d-flex.gap-2 {
        flex-direction: column;
    }

    .activity-log-filters .d-flex.gap-2 .form-control {
        width: 100%;
    }
}

@media (max-width: 991.98px) {
    .page-wrapper .content {
        overflow-x: clip;
    }
}

/* Registration docs — unit identity history */
.bsms-unit-history {
    position: relative;
    padding-left: 0.25rem;
}

.bsms-unit-history-item {
    position: relative;
    display: flex;
    gap: 0.85rem;
    padding: 0.65rem 0 0.65rem 0.35rem;
}

.bsms-unit-history-item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 0.72rem;
    top: 1.35rem;
    bottom: -0.15rem;
    width: 2px;
    background: #e2e8f0;
}

.bsms-unit-history-dot {
    flex: 0 0 auto;
    width: 0.85rem;
    height: 0.85rem;
    margin-top: 0.25rem;
    border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 0 0 3px #f1f5f9;
    z-index: 1;
}

.bsms-unit-history-purchase .bsms-unit-history-dot { background: #0ea5e9; }
.bsms-unit-history-transfer .bsms-unit-history-dot { background: #f59e0b; }
.bsms-unit-history-sale .bsms-unit-history-dot { background: #22c55e; }
.bsms-unit-history-doc-received .bsms-unit-history-dot { background: #6366f1; }
.bsms-unit-history-doc-issued .bsms-unit-history-dot { background: #14b8a6; }

.bsms-unit-history-body {
    flex: 1 1 auto;
    min-width: 0;
}

.bsms-identity-dash-hit {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0.65rem;
    padding: 0.85rem 1rem;
    transition: border-color .15s ease, background .15s ease;
}

.bsms-identity-dash-hit:hover {
    border-color: #94a3b8;
    background: #fff;
}

.bsms-identity-dash-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

@media screen and (max-width: 575.98px) {
    .bsms-identity-dash .card-body {
        padding: 0.9rem 0.95rem;
    }

    .bsms-identity-dash-head {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
    }

    .bsms-identity-dash-head .btn {
        align-self: flex-start;
        min-height: 36px;
    }

    .bsms-identity-dash .input-group .form-control {
        min-height: 44px;
        font-size: 16px; /* avoid iOS zoom */
    }

    .branch-home-hero {
        padding: 1rem 1.05rem;
        border-radius: 16px;
    }

    .branch-home-title {
        font-size: 1.25rem;
    }

    .branch-home-subtitle {
        font-size: 0.9rem;
    }

    .branch-home-date {
        margin-top: 0.35rem;
    }

    .branch-home-kpi {
        flex-direction: column;
        gap: 0.55rem;
        padding: 0.85rem 0.8rem;
        border-radius: 14px;
        min-height: 100%;
    }

    .branch-home-kpi-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 1.05rem;
    }

    .branch-home-kpi-label {
        font-size: 0.72rem;
    }

    .branch-home-kpi-value {
        font-size: clamp(1.2rem, 6vw, 1.55rem);
    }

    .branch-home-kpi-meta {
        font-size: 0.72rem;
        color: #334155;
    }

    .branch-home-tile {
        min-height: 148px;
        padding: 0.95rem 0.85rem 2.4rem;
    }

    .branch-home-tile-hint {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.75rem;
    }

    .branch-home-more-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
    }

    .branch-home-chip {
        justify-content: flex-start;
        min-height: 46px;
        padding: 0.65rem 0.75rem;
        width: 100%;
        border-radius: 12px;
    }
}

