﻿@font-face {
    font-family: "Fira Sans Condensed";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/fira-sans-condensed-latin-400-normal.woff2?v=4") format("woff2"),
         url("/fonts/fira-sans-condensed-latin-400-normal.woff?v=4") format("woff");
}
@font-face {
    font-family: "Fira Sans Condensed";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/fonts/fira-sans-condensed-latin-500-normal.woff2?v=4") format("woff2"),
         url("/fonts/fira-sans-condensed-latin-500-normal.woff?v=4") format("woff");
}
@font-face {
    font-family: "Fira Sans Condensed";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/fonts/fira-sans-condensed-latin-600-normal.woff2?v=4") format("woff2"),
         url("/fonts/fira-sans-condensed-latin-600-normal.woff?v=4") format("woff");
}
@font-face {
    font-family: "Fira Sans Condensed";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/fonts/fira-sans-condensed-latin-700-normal.woff2?v=4") format("woff2"),
         url("/fonts/fira-sans-condensed-latin-700-normal.woff?v=4") format("woff");
}

:root,
:root[data-bs-theme=light],
:root[data-bs-theme=dark],
[data-bs-theme=light],
[data-bs-theme=dark] {
    --erp-font: "Fira Sans Condensed", sans-serif;
    --bs-font-sans-serif: "Fira Sans Condensed", sans-serif;
    --bs-body-font-family: "Fira Sans Condensed", sans-serif;
    --bs-btn-font-family: "Fira Sans Condensed", sans-serif;
    --erp-urdu: "Noto Naskh Arabic", "Noto Nastaliq Urdu", serif;
    --xc-ink: #0b2460;
    --xc-pine: #0c2f7a;
    --xc-forest: #1857d4;
    --xc-paper: #eef6ff;
    --xc-card: #ffffff;
    --xc-terra: #ffd23f;
    --xc-teal: #2eb6ff;
}

html, body {
    font-family: "Fira Sans Condensed", sans-serif !important;
    font-size: 16.5px;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--xc-ink);
    background: var(--xc-paper);
}

button, input, select, textarea, label, optgroup, option,
.btn, .form-control, .form-select, .form-check-label, .form-check-input,
.nav-link, .dropdown-menu, .input-group-text, .login-input, .login-submit,
#login-user, #login-pass,
input::placeholder, textarea::placeholder, .form-control::placeholder,
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
    font-family: "Fira Sans Condensed", sans-serif !important;
}

.bi, [class^="bi-"], [class*=" bi-"] {
    font-family: bootstrap-icons !important;
}

.table, .amt-cell, .kpi-value {
    font-variant-numeric: tabular-nums;
}

.page-title {
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.content {
    padding-top: 0.65rem;
}

.form-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #52606d;
}

.form-control, .form-select, .input-group-text {
    font-size: 0.8125rem;
}

.form-control, .form-select {
    min-height: 1.85rem;
    padding: 0.18rem 0.45rem;
    border-radius: var(--erp-input-radius) !important;
}

/* Hide number-input spinner (up/down) arrows */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* All text boxes / selects / numeric editors — consistent rounded border */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="image"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
select,
textarea,
.form-control,
.form-select,
.erp-num,
.pi-num,
.pi-pay-in,
.pi-oth-in,
.pi-disc-pct,
.pi-disc-rs,
.pi-tax-pct,
.pi-tax-rs,
.pi-bank-sel,
.pi-box,
.input-group-text {
    border-radius: var(--erp-input-radius) !important;
}

/* Input groups keep only outer corners rounded */
.input-group > :not(:first-child):not(.dropdown-menu):not(.dropdown-toggle):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.input-group > .btn {
    border-radius: var(--erp-input-radius);
}
.input-group > .btn:not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.input-group > .btn:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Date control = text + calendar button */
.erp-date .erp-date-text {
    border-radius: var(--erp-input-radius) 0 0 var(--erp-input-radius) !important;
}
.erp-date .erp-date-btn {
    border-radius: 0 var(--erp-input-radius) var(--erp-input-radius) 0 !important;
}

.btn {
    font-size: 0.8125rem;
    padding: 0.22rem 0.6rem;
}

.table {
    font-size: 0.78rem;
}

.table > :not(caption) > * > * {
    padding: 0.28rem 0.4rem;
}

.table > thead th,
.product-search-drop thead th {
    background: #1857d4 !important;
    color: #fff !important;
    border-color: #0c2f7a !important;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}
.table > thead th.text-end { color: #fff !important; }

.erp-num {
    font-variant-numeric: tabular-nums;
}

/* Delete/cancel row action column — hug the button */
.col-del,
th.col-del,
td.col-del {
    width: 1%;
    min-width: 0;
    max-width: 2.1rem;
    padding: 0.15rem !important;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
}
.btn-row-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0 !important;
    line-height: 1;
    font-size: 0.75rem;
    font-weight: 700;
}

.card {
    border-color: #e4e7eb;
    border-radius: 8px;
}

.badge {
    font-weight: 500;
}

a, .btn-link {
    color: #1857d4;
}

.btn-primary {
    color: #fff;
    background-color: #1857d4;
    border-color: #0c2f7a;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.12rem rgba(46, 182, 255, 0.35);
}

h1:focus { outline: none; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

.list-group-item {
    font-size: 0.8rem;
}

.stock-neg { color: #b71c1c !important; }
.stock-zero { color: #e57373 !important; }
.stock-ok { color: #2e7d32 !important; }

.product-search { position: relative; z-index: 5; }
.product-search-open { z-index: 80; }
.party-search { position: relative; z-index: 20; }
.party-search-open { z-index: 80; }
.party-search-compact { z-index: 25; }
.party-search-compact .input-group { flex-wrap: nowrap; }
table tbody tr:focus-within .party-search-compact,
table tbody tr:has(.party-search-open),
table tbody tr:has(.product-search-open),
table tbody tr:has(.spick-open) { z-index: 60; position: relative; }

.voucher-title-cash { color: #c62828; }
.voucher-cash-header {
    display: grid;
    grid-template-columns: auto minmax(12rem, 1fr) auto;
    gap: 0.5rem;
    align-items: end;
    width: 100%;
}
.voucher-cash-meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.35rem;
}
.voucher-field { min-width: 0; }
.voucher-cash-account {
    min-width: 0;
    width: 100%;
}
.voucher-cash-account .party-search,
.voucher-cash-account .input-group { width: 100%; }
.voucher-cash-sums {
    display: grid;
    grid-template-columns: repeat(3, 8rem);
    gap: 0.35rem;
    align-items: stretch;
}
.voucher-cash .voucher-sum-box {
    border: 1px solid #cfd8dc;
    border-radius: 4px;
    padding: 0.2rem 0.45rem;
    min-height: 2.75rem;
}
.voucher-sum-pre { background: #e8f5e9; }
.voucher-sum-this { background: #e3f2fd; }
.voucher-sum-total { background: #fff9c4; }
.voucher-words { color: #c62828; font-weight: 600; font-size: 0.95rem; }
.voucher-grid thead th { white-space: nowrap; background: #f5f7fa; }

.income-stmt .income-group td {
    font-weight: 700;
    font-size: calc(1em + 2px);
    text-align: center;
    background: #eef2f7;
    border-top: 2px solid #c5d0dc;
}
.balance-stmt .income-group td:not(:first-child) {
    font-size: calc(1em + 2px);
}
.income-stmt .income-subgroup td {
    font-weight: 650;
    background: #f5f7fa;
    color: #334155;
}
.income-stmt .income-type td {
    font-weight: 600;
    color: #0f4c5c;
    background: #dff3f6;
}
.income-stmt .income-subtotal td {
    font-weight: 700;
    border-top: 1px solid #90a4ae;
    border-bottom: 2px solid #607d8b;
    background: #fafafa;
}
.income-stmt .income-grandtotal td {
    font-weight: 800;
    font-size: 1.05em;
    border-top: 2px solid #263238;
    border-bottom: 3px double #263238;
    background: #fff8e1;
}
.balance-stmt .income-group td.amt-cell,
.balance-stmt tr.income-group td:not(:first-child) {
    text-align: center;
}

@media (max-width: 700px) {
    .voucher-cash-header {
        grid-template-columns: 1fr;
    }
    .voucher-cash-sums {
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
    }
}

.product-search-drop,
.lookup-drop {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    max-height: 380px;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
}
.lookup-scroll {
    flex: 1 1 auto;
    overflow: auto;
    max-height: 320px;
    min-height: 2rem;
}
.lookup-footer-bar {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: center;
    padding: 0.4rem 0.65rem;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-top: 1px solid #93c5fd;
    color: #1e3a8a;
    font-size: 0.72rem;
    font-weight: 600;
}
.lookup-footer-bar span { white-space: nowrap; }
.lookup-footer-bar strong { font-weight: 750; }
.product-search-row,
.lookup-row { cursor: pointer; }
.product-search-row:hover,
.lookup-row:hover > td {
    background-color: #eef2f6 !important;
}
/* Bootstrap paints <td>, so highlight must target cells (not only the <tr>). */
.lookup-row.lookup-active > td,
tr.lookup-active > td {
    background-color: #1565c0 !important;
    color: #fff !important;
    --bs-table-bg-state: #1565c0;
    --bs-table-color-state: #fff;
    --bs-table-bg-type: #1565c0;
    --bs-table-color-type: #fff;
}
.lookup-row.lookup-active > td .text-muted,
.lookup-row.lookup-active > td .badge {
    color: #e3f2fd !important;
    background: rgba(255,255,255,.18) !important;
}
.lookup-row.lookup-active > td .stock-neg,
.lookup-row.lookup-active > td .stock-zero,
.lookup-row.lookup-active > td .stock-ok {
    color: #fff !important;
}
.grid-subtotal td {
    background: #eff6ff !important;
    color: #1e3a8a !important;
}
.amt-cell {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.print-choice-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(15, 23, 42, 0.55);
    display: grid;
    place-items: center;
    padding: 1rem;
}
.print-choice-card {
    width: min(100%, 22rem);
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem 1.2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,.28);
}
.print-choice-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}
.print-choice-sub {
    margin: 0.25rem 0 1rem;
    color: #64748b;
    font-size: 0.82rem;
}

/* Keep product/party dropdowns visible inside cards / tables */
.card, .card-body, .table-responsive, tfoot td { overflow: visible !important; }

/* Print layouts */
@page {
    margin: 20mm 2mm;
}
@media print {
    .d-print-none { display: none !important; }
    .sidebar,
    .sidebar-backdrop,
    .app-header,
    .al-preview-bar { display: none !important; }
    .page { display: block !important; }
    .page > main { margin: 0 !important; width: 100% !important; max-width: none !important; }
    .content { padding: 0 !important; }
    .al-preview-panel {
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }
    .erp-printable,
    [data-erp-printable] {
        display: block !important;
    }
    .al-page-break { page-break-after: always; }
    .al-page-break-before { page-break-before: always; }
}
.print-a5 {
    max-width: 148mm;
    margin: 0 auto;
}
.print-thermal {
    max-width: 80mm;
    margin: 0 auto;
    font-size: 12px;
}
.print-thermal table { font-size: 11px; }
.print-thermal h3, .print-thermal h4 { font-size: 14px; margin: 0.2rem 0; }
@page a5 {
    size: A5;
    margin: 8mm;
}
@page thermal {
    size: 80mm auto;
    margin: 2mm;
}
body.print-format-a5 { }
body.print-format-thermal .print-sheet { max-width: 80mm; }

.print-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(248, 250, 252, 0.92);
    border-bottom: 1px solid #e2e8f0;
}
.print-topbar .me-auto { margin-right: auto; }
@media print {
    .print-topbar { display: none !important; }
}

/* Dashboard */
.dash-kpi {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.55rem;
    padding: 0.7rem 0.85rem;
    height: 100%;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    border-left: 3px solid #94a3b8;
}
.dash-kpi .kpi-label {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.dash-kpi .kpi-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0.15rem;
    font-variant-numeric: tabular-nums;
}
.dash-kpi.kpi-campus { border-left-color: #1857d4; }
.dash-kpi.kpi-buy { border-left-color: #0ea5e9; }
.dash-kpi.kpi-in { border-left-color: #10b981; }
.dash-kpi.kpi-out { border-left-color: #f59e0b; }
.dash-kpi.kpi-ar { border-left-color: #8b5cf6; }
.dash-kpi.kpi-ap { border-left-color: #ef4444; }
.dash-kpi.kpi-gp { border-left-color: #14b8a6; }
.dash-kpi.kpi-warn { border-left-color: #f97316; }

.dash-page { width: 100%; min-width: 0; }
.dash-panel {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    padding: 0.75rem 0.85rem 0.5rem;
    height: 100%;
    min-width: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.erp-chart-wrap {
    position: relative;
    height: 260px;
    width: 100%;
    min-width: 0;
}
@media (max-width: 800px) {
    .dash-page .kpi-value { font-size: 1.05rem; }
    .dash-page .erp-chart-wrap { height: 210px; }
}


/* Document history modal (inventory + vouchers + POS) */
.doc-history-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2800;
    background: rgba(15, 23, 42, 0.5);
    display: grid;
    place-items: center;
    padding: 1rem;
}
.doc-history-modal {
    width: min(100%, 52rem);
    max-height: min(88vh, 36rem);
    background: #fff;
    border-radius: 0.65rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.35);
}
.doc-history-head {
    background: #1857d4;
    color: #fff;
    flex: 0 0 auto;
}
.doc-history-head .badge { font-weight: 600; }
.doc-history-q { width: 12rem; max-width: 42vw; }
.doc-history-date { width: 8.2rem; }
.doc-history-scroll-modal {
    flex: 1 1 auto;
    overflow: hidden;
    min-height: 10rem;
    height: calc(100dvh - 12rem);
    display: flex;
    flex-direction: column;
}
.doc-history-scroll-modal .erp-fill-grid {
    flex: 1;
    height: 100%;
    max-height: none;
}
.doc-history-scroll-modal thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Chart of accounts / party edit popup — Data Entry Details layout */
.party-edit-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.25rem 1rem;
    overflow-y: auto;
}
.vc-entry-modal {
    width: min(980px, 100%);
    background: #eceff1;
    border: 1px solid #90a4ae;
    border-radius: 0.35rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.32);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}
.vc-top-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem;
    background: #cfd8dc;
    border-bottom: 1px solid #90a4ae;
    padding: 0.25rem 0.25rem 0;
}
.vc-top-tab {
    border: 1px solid transparent;
    border-bottom: 0;
    background: transparent;
    color: #37474f;
    padding: 0.4rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.3rem 0.3rem 0 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.vc-top-tab:hover { background: rgba(255,255,255,0.45); color: #0f172a; }
.vc-top-tab.active {
    background: #e3f2fd;
    border-color: #90a4ae;
    color: #0d47a1;
}
.vc-top-tab.disabled { opacity: 0.45; pointer-events: none; }
.vc-section {
    margin: 0.45rem 0.55rem;
    background: #fff;
    border: 1px solid #b0bec5;
}
.vc-section-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #90a4ae;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.28rem 0.55rem;
}
.vc-id-badge {
    margin-left: auto;
    color: #ffcdd2;
    font-weight: 800;
}
.vc-bar-checks {
    margin-left: auto;
    display: flex;
    gap: 0.85rem;
    font-weight: 500;
    font-size: 0.78rem;
}
.vc-bar-checks label { display: inline-flex; align-items: center; gap: 0.25rem; cursor: pointer; }
.vc-section-body { padding: 0.55rem 0.6rem 0.65rem; }
.vc-sub-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem;
    background: #eceff1;
    border-bottom: 1px solid #b0bec5;
    padding: 0.2rem 0.3rem 0;
}
.vc-sub-tab {
    border: 1px solid transparent;
    border-bottom: 0;
    background: transparent;
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #455a64;
    border-radius: 0.25rem 0.25rem 0 0;
}
.vc-sub-tab.active {
    background: #fff;
    border-color: #b0bec5;
    color: #1565c0;
}
.vc-row {
    display: grid;
    grid-template-columns: 5.4rem minmax(0, 1fr);
    gap: 0.35rem 0.45rem;
    align-items: center;
    margin-bottom: 0.4rem;
}
.vc-row:has(> :nth-child(4)) {
    grid-template-columns: 5.4rem minmax(4rem, 7rem) 3.4rem minmax(5rem, 1fr) 5.2rem minmax(8rem, 1.2fr);
}
.vc-row:has(> :nth-child(5)):not(:has(> :nth-child(6))) {
    grid-template-columns: 5.4rem minmax(0, 1fr) minmax(0, 1fr);
}
.vc-row.vc-row-top { align-items: start; }
.vc-row label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #263238;
    text-align: right;
}
.vc-lbl-link { color: #1565c0 !important; }
.vc-grow { grid-column: 2 / -1; }
.vc-id { max-width: 6rem; background: #f5f5f5; }
.vc-contact-grid {
    display: grid;
    grid-template-columns: 1fr 9.5rem;
    gap: 0.75rem;
}
.vc-contact-left .vc-row:has(> input:nth-child(3)),
.vc-contact-left .vc-row:has(> .form-control:nth-child(3)) {
    grid-template-columns: 5.4rem 1fr 1fr;
}
.vc-photo-box {
    border: 1px solid #ef9a9a;
    box-shadow: 3px 3px 0 rgba(198, 40, 40, 0.25);
    min-height: 9.5rem;
    display: grid;
    place-items: center;
    color: #c62828;
    font-size: 0.78rem;
    font-weight: 600;
    background: #fff;
    overflow: hidden;
}
.vc-photo-box img { width: 100%; height: 100%; object-fit: cover; }
.vc-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    border: 1px solid #90caf9;
    background: #e3f2fd;
    color: #0d47a1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
    border-radius: 0.25rem;
    white-space: nowrap;
}
.vc-chip.ok {
    border-color: #81c784;
    background: #e8f5e9;
    color: #1b5e20;
}
.form-check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-left: 5.4rem;
}
.party-edit-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-top: 1px solid #90a4ae;
    background: #cfd8dc;
    flex: 0 0 auto;
}
.party-list td { vertical-align: middle; }
@media (max-width: 700px) {
    .vc-contact-grid { grid-template-columns: 1fr; }
    .vc-row, .vc-row:has(> :nth-child(4)), .vc-row:has(> :nth-child(5)):not(:has(> :nth-child(6))),
    .vc-contact-left .vc-row:has(> input:nth-child(3)) {
        grid-template-columns: 5.2rem 1fr;
    }
    .vc-grow { grid-column: 2; }
}

/* —— Account Ledger (desktop-style selector) —— */
.al-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: calc(100vh - 5.5rem);
}
.al-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.al-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.al-top-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.al-search { width: 14rem; }
.al-check {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    user-select: none;
    white-space: nowrap;
}
.al-check input { margin: 0; }
.al-check.al-blue { color: #1d4ed8; }
.al-check.al-warn { color: #c2410c; }
.al-grid-panel {
    border: 1px solid #90a4ae;
    background: #fff;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 14rem;
    height: calc(100dvh - 22rem);
    max-height: none;
}
.al-grid-panel .erp-fill-grid,
.pl-grid-panel .erp-fill-grid {
    flex: 1;
    height: auto;
    max-height: none;
    min-height: 0;
}
.al-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}
.al-grid thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #eceff1 0%, #cfd8dc 100%) !important;
    color: #263238 !important;
    border: 1px solid #90a4ae !important;
    font-weight: 700;
    padding: 0.28rem 0.4rem;
    white-space: nowrap;
}
.al-grid td {
    border: 1px solid #cfd8dc;
    padding: 0.18rem 0.35rem;
    vertical-align: middle;
}
.al-grid tbody tr { cursor: pointer; }
.al-grid tbody tr:hover { background: #e3f2fd; }
.al-grid tbody tr.al-selected { background: #bbdefb; }
.al-grid tbody tr.al-focus { outline: 2px solid #1976d2; outline-offset: -2px; }
.al-col-idx { width: 2.2rem; text-align: right; color: #607d8b; }
.al-col-id { width: 3.2rem; text-align: right; }
.al-col-code { width: 5rem; }
.al-col-contact { width: 7rem; }
.al-col-atype { width: 11rem; }
.al-col-type { width: 7rem; }
.al-col-bal { width: 6rem; }
.al-grid-foot {
    background: #cfd8dc;
    border-top: 1px solid #90a4ae;
    padding: 0.22rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
}
.al-actions {
    border: 1px solid #90a4ae;
    background: #eceff1;
    margin: 0;
    padding: 0.35rem 0.55rem 0.55rem;
    min-width: 0;
}
.al-actions > legend {
    float: none;
    width: auto;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0 0.35rem;
    margin-bottom: 0.25rem;
}
.al-actions-top {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.25rem;
    margin-bottom: 0.4rem;
}
.al-actions-body {
    display: grid;
    grid-template-columns: minmax(11rem, 0.9fr) minmax(12rem, 1.1fr) minmax(14rem, 1.15fr);
    gap: 0.55rem;
}
.al-box-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #455a64;
    margin-bottom: 0.15rem;
}
.al-listbox {
    background: #fff;
    border: 1px solid #78909c;
    min-height: 9.5rem;
    max-height: 12rem;
    overflow: auto;
    font-size: 0.76rem;
}
.al-docs { padding: 0.15rem 0.25rem; }
.al-doc-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.08rem 0.15rem;
    margin: 0;
    cursor: pointer;
}
.al-doc-item:hover { background: #e3f2fd; }
.al-picked { padding: 0; }
.al-picked-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.22rem 0.4rem;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
}
.al-picked-item.al-focus,
.al-picked-item:hover { background: #bbdefb; }
.al-x {
    border: 0;
    background: transparent;
    color: #c62828;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.2rem;
    cursor: pointer;
}
.al-empty {
    color: #78909c;
    padding: 0.75rem;
    font-style: italic;
}
.al-picked-tools {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.3rem;
}
.al-mini-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
}
.al-mini-row .form-select { flex: 1; min-width: 0; }
.al-mini-row.al-disabled { opacity: 0.45; }
.al-col-opts {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.al-opts-checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem 0.55rem;
}
.al-dates {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 0.3rem;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
}
.al-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #455a64;
    margin-bottom: 0.1rem;
}
.al-btns {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.35rem;
}
.al-btn-preview,
.al-btn-close {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.4rem;
    border: 1px solid #607d8b;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}
.al-btn-preview {
    background: linear-gradient(180deg, #e3f2fd, #90caf9);
    color: #0d47a1;
}
.al-btn-preview:disabled { opacity: 0.45; cursor: not-allowed; }
.al-btn-close {
    background: linear-gradient(180deg, #ffebee, #ef9a9a);
    color: #b71c1c;
}
.al-preview-panel {
    margin-top: 0.35rem;
    background: #fff;
    border: 1px solid #90a4ae;
    padding: 0.65rem 0.75rem;
}
.al-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #cfd8dc;
}
.al-page-break { page-break-after: always; }

/* —— Product Ledger —— */
.pl-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.pl-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.pl-grid-panel {
    border: 1px solid #90a4ae;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 10rem;
    height: calc(100dvh - 22rem);
    max-height: none;
}
.pl-grid-scroll { overflow: auto; flex: 1 1 auto; }
.pl-filter-row th {
    background: #fffde7 !important;
    color: #263238 !important;
    padding: 0.15rem !important;
}
.pl-filter-name { background: #fff59d; }
.pl-col-uom { width: 5.5rem; }
.pl-col-grp { width: 7rem; }
.pl-col-co { width: 9rem; }
.pl-col-stk {
    width: 5rem;
    background: #ffe0b2 !important;
}
.pl-grid tbody td.pl-col-stk {
    background: #ffe0b2;
    font-weight: 600;
}
.pl-actions-body {
    display: grid;
    grid-template-columns: minmax(11rem, 0.9fr) minmax(11rem, 0.85fr) minmax(14rem, 1.1fr);
    gap: 0.55rem;
}
.pl-opts {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 0.35rem;
}
.pl-dates-col { display: flex; flex-direction: column; gap: 0.35rem; }
.pl-date-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}
@media (max-width: 1100px) {
    .pl-actions-body { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
    .pl-actions-body { grid-template-columns: 1fr; }
}

/* Product Ledger print / separate-window report */
.pl-report {
    padding: 0.75rem 1rem 1.25rem;
    background: #fff;
    color: #111;
    font-size: 0.78rem;
}
.pl-report-head {
    position: relative;
    text-align: center;
    margin-bottom: 0.65rem;
}
.pl-report-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.pl-report-dates {
    font-size: 0.82rem;
    margin-top: 0.15rem;
}
.pl-report-pname {
    position: absolute;
    right: 0;
    top: 0;
    font-weight: 600;
    font-size: 0.85rem;
}
.pl-meta {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.55rem;
    table-layout: fixed;
}
.pl-meta td {
    border: 1px solid #9e9e9e;
    padding: 0.2rem 0.4rem;
    vertical-align: middle;
}
.pl-meta-lbl {
    width: 7rem;
    background: #e0e0e0;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}
.pl-meta-val { background: #fff; }
.pl-tx {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.74rem;
}
.pl-tx th,
.pl-tx td {
    border: 1px solid #9e9e9e;
    padding: 0.18rem 0.28rem;
    vertical-align: middle;
}
.pl-tx thead th {
    background: #e0e0e0 !important;
    color: #111 !important;
    font-weight: 700;
    white-space: nowrap;
}
.pl-tx-idx { width: 1.8rem; text-align: right; color: #616161; }
.pl-tx-party { width: 22%; }
.pl-tx .pl-bal,
.pl-tx th.pl-bal {
    background: #fff59d !important;
}
.pl-tx tbody tr.pl-open td { background: #fafafa; }
.pl-tx tfoot tr.pl-total td {
    font-weight: 700;
    background: #eeeeee;
}
@media print {
    .print-topbar { display: none !important; }
    .pl-report { padding: 0; }
}

.al-ledger-table {
    table-layout: fixed;
    width: 100%;
}
.al-ledger-table col.al-col-date { width: 4.6rem; }
.al-ledger-table col.al-col-doc { width: 3.2rem; }
.al-ledger-table col.al-col-no { width: 3.4rem; }
.al-ledger-table col.al-col-book { width: 3.5rem; }
.al-ledger-table col.al-col-narr { width: auto; }
.al-ledger-table col.al-col-amt { width: 5.5rem; }
.al-ledger-table col.al-col-bal { width: 6.5rem; }
.al-ledger-table .al-td-date,
.al-ledger-table .al-td-doc,
.al-ledger-table .al-td-no,
.al-ledger-table .al-td-book {
    white-space: nowrap;
    width: 1%;
}
.al-ledger-table .al-td-narr {
    width: 100%;
    white-space: normal;
    word-break: break-word;
}
.al-ledger-table .al-td-amt,
.al-ledger-table .al-td-bal {
    white-space: nowrap;
}
.al-ledger-table tbody tr.al-row-dr td { background: #e8f5e9; }
.al-ledger-table tbody tr.al-row-cr td { background: #ffebee; }
.al-ledger-table tbody tr.al-row-both td { background: #fff8e1; }
.al-ledger-table tfoot tr.al-row-total td {
    background: #eceff1;
    border-top: 2px solid #607d8b;
}
@media (max-width: 1100px) {
    .al-actions-body { grid-template-columns: 1fr 1fr; }
    .al-col-opts { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .al-actions-body { grid-template-columns: 1fr; }
    .al-opts-checks { grid-template-columns: 1fr; }
    .al-dates {
        grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
    }
}

/* —— Stock Value Report —— */
.svr-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.82rem;
}
.svr-groupby {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.svr-groupby label { font-weight: 700; margin: 0; white-space: nowrap; }
.svr-groupby-sel { max-width: 16rem; }
.svr-plus {
    width: 1.85rem;
    height: 1.85rem;
    border: 1px solid #90a4ae;
    background: #eceff1;
    font-weight: 700;
    line-height: 1;
    border-radius: 0.2rem;
}
.svr-panels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.4rem;
    min-height: 0;
    width: 100%;
}
.svr-panel {
    border: 1px solid #90a4ae;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 9rem;
    max-height: 28vh;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}
.svr-panel-scroll {
    flex: 1 1 auto;
    overflow: auto;
    width: 100%;
    min-height: 0;
}
.svr-grid {
    width: 100%;
    table-layout: fixed;
}
.svr-chk { width: 1.6rem; text-align: center; }
.svr-panel .al-grid-foot { margin-top: auto; flex: 0 0 auto; }
.svr-mid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: end;
}
.svr-supplier label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.svr-mid-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding-bottom: 0.1rem;
}
.svr-btn-products {
    border: 1px solid #78909c;
    background: linear-gradient(180deg, #f5f5f5, #e0e0e0);
    border-radius: 1rem;
    padding: 0.28rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
}
.svr-a5 {
    color: #c2185b;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}
.svr-opts {
    display: grid;
    grid-template-columns: 1fr 1fr 1.15fr;
    gap: 0.65rem;
    border: 1px solid #90a4ae;
    background: #eceff1;
    padding: 0.45rem 0.55rem;
}
.svr-opts-col {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}
.svr-opts-right { justify-content: flex-start; }
.svr-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #455a64;
    margin-bottom: 0.1rem;
}
.svr-btn-crosstab {
    align-self: flex-start;
    margin-top: 0.15rem;
    border: 1px solid #78909c;
    background: linear-gradient(180deg, #fff, #e3f2fd);
    padding: 0.28rem 0.65rem;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.svr-btns {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.35rem;
    justify-content: flex-end;
}
@media (max-width: 1100px) {
    .svr-panels { grid-template-columns: 1fr 1fr; }
    .svr-opts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
    .svr-panels { grid-template-columns: 1fr; }
    .svr-mid { grid-template-columns: 1fr; }
    .svr-opts { grid-template-columns: 1fr; }
}

/* —— Stock Status preview —— */
.ss-report {
    padding: 0.35rem 0.5rem 0.75rem;
    background: #fff;
    color: #111;
    font-size: 0.78rem;
}
.ss-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0;
    line-height: 1.2;
}
.ss-sub {
    text-align: center;
    font-size: 0.85rem;
    margin: 0.1rem 0 0.25rem;
    line-height: 1.2;
}
.ss-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-weight: 600;
    margin: 0 0 0.15rem;
    line-height: 1.2;
}
.ss-tx {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.76rem;
    margin: 0;
}
.ss-tx th,
.ss-tx td {
    border: 1px solid #9e9e9e;
    padding: 0.16rem 0.3rem;
    vertical-align: middle;
}
.ss-tx thead th {
    background: #e0e0e0 !important;
    color: #111 !important;
    font-weight: 700;
    white-space: nowrap;
}
.ss-id { width: 3.2rem; text-align: right; }
.ss-code { width: 4.5rem; text-align: right; }
.ss-qty { width: 6.5rem; }
.ss-rate { width: 5.5rem; background: #fff59d !important; }
.ss-amt { width: 6.5rem; background: #fff59d !important; }
.ss-tx td.ss-neg { background: #ef5350 !important; color: #111; font-weight: 600; }
.ss-tx tfoot tr.ss-subtot td,
.ss-tx tfoot tr.ss-grand td {
    background: #e0e0e0;
    font-weight: 700;
}
.ss-tx tfoot td.ss-rate,
.ss-tx tfoot td.ss-amt { background: #fff59d !important; }
.ss-tx tfoot td.ss-neg { background: #ef5350 !important; }
.ss-grand-only { margin-top: 0.15rem; }
.ss-grand-only td { border: 1px solid #9e9e9e; padding: 0.16rem 0.3rem; }
.ss-meta { margin-top: 0.45rem; }
@media print {
    .ss-report { padding: 0; }
}

/* —— Purchase Invoice (desktop) —— */
.pi-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.82rem;
    background: #eceff1;
    border: 1px solid #90a4ae;
    padding: 0.35rem;
}
.pi-tabs {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: wrap;
    background: #cfd8dc;
    padding: 0.2rem;
}
.pi-tab {
    border: 1px solid #90a4ae;
    background: #eceff1;
    padding: 0.25rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
}
.pi-tab.active {
    background: #fff;
    border-bottom-color: #fff;
}
.pi-title {
    font-size: 1.15rem;
    font-weight: 800;
    padding: 0 0.5rem;
}
/* Purchase Return — amber header so it is distinct from Purchase (blue-gray) */
.pi-wrap.pi-return {
    background: #fff3e0;
    border-color: #ffb74d;
}
.pi-wrap.pi-return .pi-tabs {
    background: #ffcc80;
}
.pi-wrap.pi-return .pi-tab {
    background: #ffe0b2;
    border-color: #fb8c00;
}
.pi-wrap.pi-return .pi-tab.active {
    background: #fffaf0;
    border-bottom-color: #fffaf0;
}
.pi-wrap.pi-return .pi-title {
    color: #e65100;
}
.pi-wrap.pi-return .pi-head {
    background: #fffaf0;
    border-color: #ffb74d;
}
/* Sales — green header (distinct from Purchase blue-gray) */
.pi-wrap.pi-sale {
    background: #e8f5e9;
    border-color: #81c784;
}
.pi-wrap.pi-sale .pi-tabs {
    background: #a5d6a7;
}
.pi-wrap.pi-sale .pi-tab {
    background: #c8e6c9;
    border-color: #66bb6a;
}
.pi-wrap.pi-sale .pi-tab.active {
    background: #f1f8f4;
    border-bottom-color: #f1f8f4;
}
.pi-wrap.pi-sale .pi-title {
    color: #1b5e20;
}
.pi-wrap.pi-sale .pi-head {
    background: #f1f8f4;
    border-color: #81c784;
}
/* Sales Return — rose header (distinct from Sales green and Purchase Return amber) */
.pi-wrap.pi-sale-return {
    background: #fce4ec;
    border-color: #f48fb1;
}
.pi-wrap.pi-sale-return .pi-tabs {
    background: #f8bbd0;
}
.pi-wrap.pi-sale-return .pi-tab {
    background: #fce4ec;
    border-color: #ec407a;
}
.pi-wrap.pi-sale-return .pi-tab.active {
    background: #fff5f8;
    border-bottom-color: #fff5f8;
}
.pi-wrap.pi-sale-return .pi-title {
    color: #880e4f;
}
.pi-wrap.pi-sale-return .pi-head {
    background: #fff5f8;
    border-color: #f48fb1;
}
/* Stock Adjustment — slate/indigo header */
.pi-wrap.pi-adj {
    background: #e8eaf6;
    border-color: #7986cb;
}
.pi-wrap.pi-adj .pi-tabs {
    background: #9fa8da;
}
.pi-wrap.pi-adj .pi-tab {
    background: #c5cae9;
    border-color: #5c6bc0;
}
.pi-wrap.pi-adj .pi-tab.active {
    background: #f5f6ff;
    border-bottom-color: #f5f6ff;
}
.pi-wrap.pi-adj .pi-title {
    color: #c62828;
    font-weight: 800;
}
.pi-adj-options {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 0.5rem;
}
.pi-adj-box {
    border: 1px solid #9fa8da;
    background: #f5f6ff;
    border-radius: 2px;
}
.pi-adj-box-title {
    background: #c5cae9;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.2rem 0.45rem;
    border-bottom: 1px solid #9fa8da;
}
.pi-adj-box-body {
    padding: 0.4rem;
}
.pi-adj-amt label {
    font-weight: 600;
    font-size: 0.78rem;
    margin: 0;
}
.pi-adj-grid .pi-num-col {
    min-width: 4.2rem;
}
.pi-adj-rem {
    max-width: 8rem;
    width: 8rem;
}
.pi-adj-rem .form-control {
    max-width: 100%;
}
/* Payment / Receiving / Journal vouchers — bold UI text */
.pi-wrap.pi-pv,
.pi-wrap.pi-rv,
.pi-wrap.pi-jv,
.pi-wrap.pi-pv label,
.pi-wrap.pi-rv label,
.pi-wrap.pi-jv label,
.pi-wrap.pi-pv th,
.pi-wrap.pi-rv th,
.pi-wrap.pi-jv th,
.pi-wrap.pi-pv td,
.pi-wrap.pi-rv td,
.pi-wrap.pi-jv td,
.pi-wrap.pi-pv .pi-tab,
.pi-wrap.pi-rv .pi-tab,
.pi-wrap.pi-jv .pi-tab,
.pi-wrap.pi-pv .pi-title,
.pi-wrap.pi-rv .pi-title,
.pi-wrap.pi-jv .pi-title,
.pi-wrap.pi-pv .pi-btn,
.pi-wrap.pi-rv .pi-btn,
.pi-wrap.pi-jv .pi-btn,
.pi-wrap.pi-pv .pi-rec,
.pi-wrap.pi-rv .pi-rec,
.pi-wrap.pi-jv .pi-rec,
.pi-wrap.pi-pv .form-control,
.pi-wrap.pi-rv .form-control,
.pi-wrap.pi-jv .form-control,
.pi-wrap.pi-pv .pi-num,
.pi-wrap.pi-rv .pi-num,
.pi-wrap.pi-jv .pi-num,
.pi-wrap.pi-pv .amt-cell,
.pi-wrap.pi-rv .amt-cell,
.pi-wrap.pi-jv .amt-cell,
.pi-wrap.pi-pv .pi-bal-box span,
.pi-wrap.pi-rv .pi-bal-box span,
.pi-wrap.pi-jv .pi-bal-box span,
.pi-wrap.pi-pv .pi-bal-box strong,
.pi-wrap.pi-rv .pi-bal-box strong,
.pi-wrap.pi-jv .pi-bal-box strong,
.pi-wrap.pi-pv .pi-adj-box-title,
.pi-wrap.pi-rv .pi-adj-box-title,
.pi-wrap.pi-jv .pi-adj-box-title,
.pi-wrap.pi-pv .pi-vch-words,
.pi-wrap.pi-rv .pi-vch-words,
.pi-wrap.pi-jv .pi-vch-words {
    font-weight: 700;
}
/* Payment voucher — warm rose (money out) */
.pi-wrap.pi-pv {
    background: #fce4ec;
    border-color: #e57373;
}
.pi-wrap.pi-pv .pi-tabs { background: #ef9a9a; }
.pi-wrap.pi-pv .pi-tab {
    background: #ffcdd2;
    border-color: #e53935;
}
.pi-wrap.pi-pv .pi-tab.active {
    background: #fff5f5;
    border-bottom-color: #fff5f5;
}
.pi-wrap.pi-pv .pi-title { color: #b71c1c; }
.pi-wrap.pi-pv .pi-head,
.pi-wrap.pi-pv .pi-adj-box { background: #fff5f5; border-color: #ef9a9a; }
.pi-wrap.pi-pv .pi-adj-box-title { background: #ffcdd2; border-color: #ef9a9a; }
/* Receiving voucher — teal (money in) */
.pi-wrap.pi-rv {
    background: #e0f2f1;
    border-color: #4db6ac;
}
.pi-wrap.pi-rv .pi-tabs { background: #80cbc4; }
.pi-wrap.pi-rv .pi-tab {
    background: #b2dfdb;
    border-color: #00897b;
}
.pi-wrap.pi-rv .pi-tab.active {
    background: #f1fffe;
    border-bottom-color: #f1fffe;
}
.pi-wrap.pi-rv .pi-title { color: #004d40; }
.pi-wrap.pi-rv .pi-head,
.pi-wrap.pi-rv .pi-adj-box { background: #f1fffe; border-color: #80cbc4; }
.pi-wrap.pi-rv .pi-adj-box-title { background: #b2dfdb; border-color: #80cbc4; }
/* Journal voucher — steel blue */
.pi-wrap.pi-jv {
    background: #e3f2fd;
    border-color: #64b5f6;
}
.pi-wrap.pi-jv .pi-tabs { background: #90caf9; }
.pi-wrap.pi-jv .pi-tab {
    background: #bbdefb;
    border-color: #1e88e5;
}
.pi-wrap.pi-jv .pi-tab.active {
    background: #f5fbff;
    border-bottom-color: #f5fbff;
}
.pi-wrap.pi-jv .pi-title { color: #0d47a1; }
.pi-wrap.pi-jv .pi-head { background: #f5fbff; border-color: #90caf9; }
.pi-vch-narr {
    max-width: 20rem;
    width: 20rem;
}
.pi-vch-words {
    color: #c62828;
    font-weight: 600;
    font-size: 0.9rem;
}
/* Opening / Balance vs Closing — soft readable column tints */
.pi-wrap.pi-pv .pi-grid th.pi-vch-open,
.pi-wrap.pi-rv .pi-grid th.pi-vch-open,
.pi-wrap.pi-jv .pi-grid th.pi-vch-open,
.pi-wrap.pi-pv .pi-grid td.pi-vch-open,
.pi-wrap.pi-rv .pi-grid td.pi-vch-open,
.pi-wrap.pi-jv .pi-grid td.pi-vch-open,
.pi-wrap.pi-pv .pi-grid tfoot td.pi-vch-open,
.pi-wrap.pi-rv .pi-grid tfoot td.pi-vch-open,
.pi-wrap.pi-jv .pi-grid tfoot td.pi-vch-open {
    background: #c8e6c9 !important;
    color: #1b5e20 !important;
}
.pi-wrap.pi-pv .pi-grid th.pi-vch-close,
.pi-wrap.pi-rv .pi-grid th.pi-vch-close,
.pi-wrap.pi-jv .pi-grid th.pi-vch-close,
.pi-wrap.pi-pv .pi-grid td.pi-vch-close,
.pi-wrap.pi-rv .pi-grid td.pi-vch-close,
.pi-wrap.pi-jv .pi-grid td.pi-vch-close,
.pi-wrap.pi-pv .pi-grid tfoot td.pi-vch-close,
.pi-wrap.pi-rv .pi-grid tfoot td.pi-vch-close,
.pi-wrap.pi-jv .pi-grid tfoot td.pi-vch-close {
    background: #ffe082 !important;
    color: #e65100 !important;
}
.pi-head {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    background: #fff;
    border: 1px solid #b0bec5;
    padding: 0.4rem;
}
.pi-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}
.pi-body {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(20rem, 0.95fr);
    gap: 0.4rem 0.6rem;
    align-items: start;
}
.pi-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
    position: relative;
    z-index: 20;
}
.pi-meta:has(.lookup-drop),
.pi-meta:has(.party-search-open) { z-index: 80; }
.pi-totals {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}
.pi-checks {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.55rem;
    justify-content: flex-end;
    align-items: center;
    white-space: nowrap;
}
.pi-row {
    display: grid;
    grid-template-columns: 3.4rem 1fr;
    gap: 0.35rem;
    align-items: center;
}
.pi-row label { margin: 0; font-weight: 600; white-space: nowrap; }
.pi-row.pi-from { align-items: start; }
.pi-party-grow {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
/* Inv# input, VCID, and Previous share the same left edge (col 2). */
.pi-row.pi-inv-row {
    grid-template-columns: 3.4rem 4.5rem auto 5.2rem 9.2rem 5.5rem minmax(0, 1fr);
    gap: 0.3rem;
}
.pi-row.pi-inv-row .pi-lbl2 { text-align: right; margin: 0; font-weight: 600; white-space: nowrap; }
.pi-inv,
.party-search-compact .pi-vcid {
    width: 4.5rem !important;
    max-width: 4.5rem !important;
    flex: 0 0 4.5rem;
}
.pi-order { max-width: 5.2rem; }
.pi-bal-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
    width: 100%;
    position: relative;
    z-index: 1;
}
.pi-bal-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #78909c;
    border-radius: var(--erp-input-radius);
    padding: 0.28rem 0.45rem;
    font-weight: 700;
}
.pi-prev { background: #b2ebf2; }
.pi-bill { background: #69f0ae; }
.pi-tot {
    background: transparent;
    border-color: #90a4ae;
}
.pi-tot span,
.pi-tot strong { color: #c62828; font-weight: 700; }
.pi-num-col {
    width: 5.5rem;
}
.pi-num {
    width: 100% !important;
    max-width: none !important;
    text-align: end;
}
.pi-amt-col { background: #fff59d; }
.pi-col-item { min-width: 12rem; }
.pi-grid .product-search-compact { z-index: 1; }
.pi-grid tr:focus-within,
.pi-grid tr:has(.product-search-open) {
    position: relative;
    z-index: 40;
}
.pi-grid .product-search-compact .lookup-drop {
    min-width: 28rem;
}
.lookup-drop.lookup-fixed,
.lookup-drop:popover-open {
    position: fixed !important;
    inset: unset !important;
    left: auto;
    right: auto;
    top: auto;
    margin: 0 !important;
    z-index: 10000 !important;
    pointer-events: auto;
}
table.nlkp-host-open tbody td {
    z-index: 0 !important;
    isolation: auto !important;
}
table.nlkp-host-open tbody tr.nlkp-row-open td,
table.nlkp-host-open tbody tr:has(.nlkp-open) td {
    z-index: 10000 !important;
    isolation: auto !important;
    position: relative;
}
.pi-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-start;
    margin-top: 0;
}
.pi-row.pi-tools-row {
    align-items: center;
}
/* 4-col aligned: Label | Field | Label | Field — all value cells same width */
.pi-tot-grid {
    display: grid;
    grid-template-columns: 5.6rem minmax(0, 1fr) 5.6rem minmax(0, 1fr);
    gap: 0.28rem 0.35rem;
    align-items: center;
    width: 100%;
}
.pi-tot-lbl {
    margin: 0;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.78rem;
    text-align: right;
}
.pi-tot-grid > .pi-box,
.pi-tot-grid > .form-control,
.pi-tot-grid > .erp-num {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 1.85rem;
    box-sizing: border-box;
}
.pi-tot-grand {
    grid-column: 2 / -1;
}
.pi-pay-in,
.pi-bank-sel {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 1.85rem;
    box-sizing: border-box;
}
.pi-pay-bal {
    background: #fffde7;
    border: 1px solid #f9a825;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0.4rem;
}
.pi-disc-pct,
.pi-tax-pct,
.pi-disc-rs,
.pi-tax-rs,
.pi-oth-in,
.pi-freight-in {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    text-align: end;
}
.pi-freight-vc {
    min-width: 0;
    width: 100%;
}
.pi-freight-vc .party-search,
.pi-freight-vc .input-group {
    width: 100%;
}
.pi-freight-vc .form-control {
    height: 1.85rem;
}
.pi-freight-vc.is-invalid .form-control {
    border-color: #dc3545;
}
.pi-disc-rs {
    background: #ef9a9a !important;
    border: 1px solid #78909c;
    font-weight: 700;
}
.pi-tax-rs {
    background: #fff !important;
    border: 1px solid #78909c;
    font-weight: 700;
}
.pi-oth-in {
    background: #69f0ae !important;
    border: 1px solid #78909c;
    font-weight: 700;
}
.pi-req::after {
    content: " *";
    color: #c62828;
    font-weight: 700;
}
.erp-date.required .erp-date-text,
.party-search.required .pi-vcid {
    border-color: #e57373;
}

/* Date text + calendar picker */
.erp-date {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1.85rem;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    max-width: 9.2rem;
}
.erp-dates {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}
.erp-dates .erp-date { flex: 1 1 0; max-width: none; }
.erp-date.disabled {
    opacity: 0.65;
    pointer-events: none;
}
.erp-date.disabled .erp-date-btn {
    cursor: not-allowed;
}
.erp-date .erp-date-text {
    min-width: 0;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.erp-date .erp-date-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    min-width: 1.85rem;
    padding: 0;
    border: 1px solid var(--bs-border-color, #ced4da);
    border-left: 0;
    border-radius: 0 var(--erp-input-radius) var(--erp-input-radius) 0 !important;
    background: #eceff1;
    color: #37474f;
    cursor: pointer;
    line-height: 1;
    z-index: 1;
}
.erp-date .erp-date-btn:hover {
    background: #cfd8dc;
}
.erp-date .erp-date-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    border: 0;
    padding: 0;
    margin: 0;
}
.pi-inv-row .erp-date.pi-date,
.pi-inv-row .pi-date.erp-date {
    width: 100%;
    max-width: 9.2rem;
}
.pi-box {
    border: 1px solid #78909c;
    border-radius: var(--erp-input-radius);
    padding: 0.2rem 0.4rem;
    text-align: right;
    font-weight: 700;
    background: #fff;
}
.pi-amt { background: #81d4fa; }
.pi-disc { background: #ef9a9a; }
.pi-oth { background: #69f0ae; }
.pi-net { background: #fff59d; }
.pi-f1 {
    background: #c8e6c9;
    border: 1px solid #81c784;
    padding: 0.15rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.pi-search { background: #fff; border: 1px solid #b0bec5; padding: 0.25rem; }
.pi-grid-wrap {
    background: #fff;
    border: 1px solid #90a4ae;
    max-height: 42vh;
    overflow: auto;
    position: relative;
    z-index: 5;
}
.pi-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.78rem;
    table-layout: fixed;
}
.pi-grid th,
.pi-grid td {
    border: 1px solid #9e9e9e;
    padding: 0.18rem 0.3rem;
    vertical-align: middle;
    overflow: visible;
}
.pi-grid thead th {
    background: #cfd8dc !important;
    color: #111 !important;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 6;
}
.pi-grid tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 6;
    background: #e0e0e0 !important;
    font-weight: 700;
    box-shadow: 0 -1px 0 #9e9e9e;
}
.pi-amt-col { background: #fff59d; }
.pi-amt-rs { width: 6.5rem; }
.pi-stock { width: 5rem; }
.pi-p {
    width: 1.85rem;
    text-align: center;
    position: sticky;
    right: 2rem;
    background: #fff;
    z-index: 2;
}
.pi-grid thead th.pi-p,
.pi-grid thead th.col-del {
    position: sticky;
    z-index: 7;
    background: #cfd8dc !important;
}
.pi-grid td.col-del,
.pi-grid th.col-del,
.pi-grid tfoot td.col-del {
    position: sticky;
    right: 0;
    background: #fff;
    z-index: 2;
    width: 2rem;
    min-width: 2rem;
    max-width: 2rem;
}
.pi-grid tfoot td.col-del {
    background: #e0e0e0 !important;
    z-index: 7;
}
.pi-grid thead th.col-del {
    right: 0;
    top: 0;
    z-index: 8;
}
.pi-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    padding: 0;
    border: 1px solid #ef5350;
    border-radius: 0.15rem;
    background: #ffebee;
    color: #c62828;
    line-height: 1;
    font-size: 0.7rem;
}
.pi-del:hover {
    background: #ef5350;
    color: #fff;
}
.pi-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #cfd8dc;
    border: 1px solid #90a4ae;
    padding: 0.35rem 0.45rem;
}
.pi-rec { font-weight: 600; }
.pi-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.pi-btn {
    border: 1px solid #78909c;
    background: linear-gradient(180deg, #fafafa, #e0e0e0);
    padding: 0.35rem 0.65rem;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.pi-save { background: linear-gradient(180deg, #e3f2fd, #90caf9); }
.pi-saveprint { background: linear-gradient(180deg, #fff8e1, #ffe082); }
.pi-close { background: linear-gradient(180deg, #ffebee, #ef9a9a); color: #b71c1c; }
@media (max-width: 1100px) {
    .pi-head { grid-template-columns: 1fr; }
}

/* —— Product entry —— */
/* —— Product DevExpress-style grid —— */
.dxg {
    border: 1px solid #90a4ae;
    border-radius: 0.35rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 12rem);
    max-height: calc(100dvh - 12rem);
    min-height: 16rem;
    overflow: hidden;
}
.dxg-scroll { overflow: auto; flex: 1 1 auto; }
.dxg-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
}
.dxg-head th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: linear-gradient(180deg, #eceff1, #cfd8dc);
    border-bottom: 1px solid #90a4ae;
    padding: 0.35rem 0.4rem;
    font-weight: 700;
    white-space: nowrap;
    user-select: none;
}
.dxg-sortable { cursor: pointer; }
.dxg-sortable:hover { background: #b0bec5; }
.dxg-sort-idle { color: #90a4ae; font-size: 0.7rem; margin-left: 0.15rem; }
.dxg-sort-on { color: #1565c0; font-size: 0.7rem; margin-left: 0.15rem; }
.dxg-filter th {
    position: sticky;
    top: 1.85rem;
    z-index: 2;
    background: #fff8e1;
    border-bottom: 1px solid #ffe082;
    padding: 0.2rem 0.25rem;
    font-weight: 400;
}
.dxg-filter .form-control,
.dxg-filter .form-select {
    font-size: 0.72rem;
    padding: 0.15rem 0.3rem;
    min-height: 1.6rem;
    background: #fff;
}
.dxg-table tbody td {
    border-bottom: 1px solid #eceff1;
    padding: 0.22rem 0.4rem;
    vertical-align: middle;
}
.dxg-table tbody tr:hover { background: #e3f2fd; }
.dxg-foot {
    flex: 0 0 auto;
    padding: 0.35rem 0.65rem;
    background: #eceff1;
    border-top: 1px solid #b0bec5;
    font-size: 0.75rem;
}
.prod-form {
    position: relative;
    z-index: 1;
    border: 1px solid #90a4ae;
    border-radius: 0.5rem;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
    overflow: visible;
}
.prod-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    background: #1857d4;
    color: #fff;
    border-radius: 0.5rem 0.5rem 0 0;
}
.prod-form-title { font-size: 1.05rem; font-weight: 700; }
.prod-form-sub { font-size: 0.72rem; opacity: 0.85; margin-top: 0.1rem; }
.prod-form-body {
    background: #ffffff;
    padding: 0.75rem 1rem 1rem;
    overflow: visible;
    position: relative;
}
.prod-fields {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.35rem;
    background: #ffffff;
    position: relative;
    z-index: 2;
    overflow: visible;
}
.prod-form-body:has(.spick-open),
.prod-form-body:has(.party-search-open),
.prod-form-body:has(.lookup-drop) {
    z-index: 40;
}
.prod-form-body:has(.spick-open) .prod-fields,
.prod-form-body:has(.party-search-open) .prod-fields,
.prod-form-body:has(.lookup-drop) .prod-fields {
    z-index: 60;
}
.prod-bc,
.prod-actions {
    position: relative;
    z-index: 1;
}
.prod-fields tr {
    position: relative;
    z-index: 1;
}
.prod-fields tr:focus-within,
.prod-fields tr:has(.spick-open),
.prod-fields tr:has(.lookup-drop) {
    z-index: 200;
}
.prod-fields th {
    width: 7.5rem;
    text-align: right;
    padding: 0.2rem 0.55rem 0.2rem 0;
    font-weight: 700;
    font-size: 0.78rem;
    color: #0d47a1;
    white-space: nowrap;
    vertical-align: middle;
    background: transparent;
}
.prod-fields td {
    padding: 0.15rem 0.35rem;
    vertical-align: middle;
    background: transparent;
    position: relative;
    overflow: visible;
}
.prod-col-narrow { width: 8rem; max-width: 8rem; }
.prod-col-amt { width: 9rem; max-width: 9rem; }
.prod-amt {
    width: 100% !important;
    max-width: 9rem;
    text-align: end;
}
.prod-with-plus {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem;
    align-items: center;
    position: relative;
    overflow: visible;
}
.prod-desc {
    position: relative;
    z-index: 1;
    overflow: visible;
}
.prod-desc:focus-within,
.prod-desc:has(.lookup-drop) {
    z-index: 250;
}
.spick {
    width: 100%;
    position: relative;
    z-index: 1;
    max-width: 100%;
}
.spick-open {
    z-index: 50;
}
.spick .lookup-drop,
.prod-desc .lookup-drop,
.prod-supplier .lookup-drop {
    z-index: 4000;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.spick-drop-up .spick-drop {
    top: auto !important;
    bottom: calc(100% + 2px);
}
.spick-scroll {
    overflow-y: auto;
    overscroll-behavior: contain;
}
.spick-list { margin: 0; max-width: 100%; }
.spick-item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
    font-size: 0.8rem;
    max-width: 100%;
}
.spick-item:hover,
.spick-item.lookup-active {
    background: #1565c0 !important;
    color: #fff !important;
}
.spick-selected { background: #dbeafe; }
.spick-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spick-id { flex: 0 0 auto; font-size: 0.72rem; }
.prod-plus {
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.3rem;
    border: 1px solid #90caf9;
    background: #e3f2fd;
    color: #1565c0;
    font-weight: 800;
    text-decoration: none;
    line-height: 1;
}
.prod-plus:hover { background: #bbdefb; color: #0d47a1; }
.prod-supplier {
    position: relative;
    overflow: visible;
}
.prod-supplier .party-search {
    z-index: 1;
}
.prod-fields tr:has(.prod-supplier .lookup-drop) {
    z-index: 220;
}
.prod-stock { background: #f8fafc; font-variant-numeric: tabular-nums; }
.prod-bc {
    margin-top: 0.65rem;
    border: 1px solid #90a4ae;
    border-radius: 0.4rem;
    overflow: hidden;
    background: #fff;
}
.prod-bc-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.65rem;
    background: linear-gradient(180deg, #cfd8dc, #b0bec5);
    font-weight: 700;
    font-size: 0.85rem;
}
.prod-bc-grid th { background: #eceff1; }
.prod-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}
input.prod-stock.stock-neg,
input.prod-stock.stock-zero,
input.prod-stock.stock-ok {
    background: #f8fafc;
}

/* Toast notifications */
.erp-toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
}
.erp-toast {
    opacity: 0;
    transform: translateY(-0.4rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding: 0.65rem 0.9rem;
    border-radius: 0.4rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    pointer-events: auto;
}
.erp-toast.show {
    opacity: 1;
    transform: translateY(0);
}
.erp-toast-ok { background: #2e7d32; }
.erp-toast-error { background: #c62828; }
.erp-toast-warn { background: #ef6c00; }











/* Delete confirmation modal */
.del-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    animation: del-fade 0.18s ease;
}
.del-modal {
    position: relative;
    width: min(26rem, 100%);
    padding: 1.6rem 1.5rem 1.35rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(255,255,255,0.4) inset;
    overflow: hidden;
    animation: del-pop 0.22s cubic-bezier(.2,.9,.2,1);
}
.del-modal-glow {
    position: absolute;
    inset: -40% -20% auto -20%;
    height: 70%;
    background: radial-gradient(ellipse at top, rgba(239, 68, 68, 0.18), transparent 65%);
    pointer-events: none;
}
.del-modal-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    margin: 0 auto 0.85rem;
    background: linear-gradient(145deg, #fee2e2, #fecaca);
    color: #b91c1c;
    font-size: 1.45rem;
    box-shadow: 0 8px 18px rgba(185, 28, 28, 0.18);
}
.del-modal-title {
    margin: 0;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}
.del-modal-sub {
    margin: 0.55rem 0 1rem;
    text-align: center;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #475569;
}
.del-modal-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 auto 1rem;
    padding: 0.55rem 0.8rem;
    border-radius: 0.65rem;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.8rem;
}
.del-modal-chip span { opacity: 0.7; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.68rem; font-weight: 700; }
.del-modal-chip strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; color: #fca5a5; }
.del-modal-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
}
.del-modal-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.65rem;
    padding: 0.7rem 0.85rem;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    text-align: center;
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.del-modal-input:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}
.del-modal-input.is-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}
.del-modal-error {
    margin-top: 0.45rem;
    color: #b91c1c;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.del-modal-actions {
    display: flex;
    gap: 0.55rem;
    margin-top: 1.15rem;
}
.del-btn {
    flex: 1;
    border: 0;
    border-radius: 0.65rem;
    padding: 0.65rem 0.9rem;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.del-btn:active { transform: translateY(1px); }
.del-btn-ghost {
    background: #e2e8f0;
    color: #334155;
}
.del-btn-ghost:hover { background: #cbd5e1; }
.del-btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    box-shadow: 0 10px 20px rgba(185, 28, 28, 0.28);
}
.del-btn-danger:hover { filter: brightness(1.05); }
.del-btn-danger:disabled { opacity: 0.65; cursor: wait; }
@keyframes del-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes del-pop {
    from { opacity: 0; transform: translateY(0.6rem) scale(0.96); }
    to { opacity: 1; transform: none; }
}

/* Pending purchases tab */
.pi-pending {
    background: #fff;
    border: 1px solid #90a4ae;
    border-radius: 0.35rem;
    padding: 0.65rem 0.75rem 0.85rem;
    margin-bottom: 0.5rem;
}
.pi-pending-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
    flex-wrap: wrap;
}
.pi-pending-empty {
    padding: 1.25rem;
    text-align: center;
    color: #78909c;
    font-size: 0.9rem;
}
.pi-pending-table thead th {
    background: #eceff1;
    font-size: 0.78rem;
}
.pi-pending-row { cursor: pointer; }
.pi-pending-row:hover { background: #fff8e1; }

/* Product Wise tab */
.pi-pwise {
    background: #fff;
    border: 1px solid #90a4ae;
    border-radius: 0.35rem;
    padding: 0.55rem 0.65rem 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 18rem;
}
.pi-pwise-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
}
.pi-pwise-dates {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    flex: 1 1 18rem;
}
.pi-pwise-dates .erp-date { flex: 1 1 0; max-width: none; }
.pi-pwise-lbl {
    margin: 0;
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
}
.pi-pwise-scroll {
    overflow: auto;
    max-height: min(62vh, 36rem);
    border: 1px solid #b0bec5;
}
.pi-pwise-table {
    font-size: 0.8rem;
}
.pi-pwise-table thead th {
    background: #eceff1;
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
    font-size: 0.76rem;
}
.pi-pwise-table thead tr.pi-pwise-filters th {
    top: 1.7rem;
    background: #f5f7f8;
    padding: 0.2rem;
    font-weight: 400;
}
.pi-pwise-filters .form-control {
    min-width: 3.5rem;
    font-size: 0.75rem;
    padding: 0.15rem 0.3rem;
}
.pi-pwise-table tfoot td {
    background: #eceff1;
    position: sticky;
    bottom: 0;
}

/* Other Expenses tab */
.pi-oe {
    background: #fff;
    border: 1px solid #90a4ae;
    border-radius: 0.35rem;
    padding: 0.45rem 0.55rem 0.55rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 14rem;
}
.pi-oe-scroll {
    overflow: auto;
    max-height: min(55vh, 28rem);
    border: 1px solid #b0bec5;
}
.pi-oe-table {
    font-size: 0.8rem;
}
.pi-oe-table thead th {
    background: #eceff1;
    font-size: 0.76rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.pi-oe-table thead th.pi-oe-req::after {
    content: " *";
    color: #c62828;
    font-weight: 800;
}
.pi-oe-table tr:has(.party-search-open) {
    position: relative;
    z-index: 50;
}
.pi-oe-vc {
    position: relative;
    overflow: visible;
}
.pi-oe-vc .party-search-compact {
    min-width: 11rem;
}
.pi-oe-vc .lookup-drop.lookup-fixed {
    min-width: 28rem;
}
.pi-oe-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.pi-oe-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.pi-oe-total {
    min-width: 7rem;
    text-align: right;
    font-weight: 800;
    font-size: 0.95rem;
    border: 1px solid #90a4ae;
    background: #eceff1;
    padding: 0.28rem 0.55rem;
}
/* Attachment tab */
.pi-att {
    background: #fff;
    border: 1px solid #90a4ae;
    border-radius: 0.35rem;
    padding: 0.55rem 0.65rem 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 12rem;
}
.pi-att-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
}
.pi-att-scroll {
    overflow: auto;
    max-height: min(55vh, 28rem);
    border: 1px solid #b0bec5;
}
.pi-att-table { font-size: 0.8rem; }
.pi-att-table thead th {
    background: #eceff1;
    font-size: 0.76rem;
    white-space: nowrap;
}

.pi-att-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.35rem 0;
}
.pi-att-card {
    width: 300px;
    border: 1px solid #b0bec5;
    background: #fff;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.pi-att-pending {
    border-style: dashed;
    border-color: #f0ad4e;
    background: #fffdf6;
}
.pi-att-thumb {
    border: 0;
    padding: 0;
    background: #eceff1;
    cursor: pointer;
    width: 300px;
    height: 300px;
    overflow: hidden;
    display: block;
}
.pi-att-thumb img {
    width: 300px;
    height: 300px;
    object-fit: cover;
    display: block;
}
.pi-att-placeholder {
    width: 300px;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: #607d8b;
    font-size: 0.85rem;
}
.pi-att-placeholder i { font-size: 2rem; }
.pi-att-meta {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pi-att-actions { display: flex; gap: 0.35rem; }
.pi-att-preview-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.pi-att-preview {
    background: #fff;
    border-radius: 0.4rem;
    max-width: min(92vw, 960px);
    max-height: 92vh;
    overflow: auto;
    padding: 0.65rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
}
.pi-att-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.pi-att-preview-img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

/* Trial Balance selection + report */
.tb-page {
    max-width: 28rem;
    margin: 0.75rem auto 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.tb-opts {
    background: #eceff1;
    border: 1px solid #90a4ae;
    border-radius: 0.2rem;
    padding: 0.75rem 0.9rem 0.9rem;
    margin: 0;
}
.tb-opts legend {
    float: none;
    width: auto;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0 0.35rem;
    margin-bottom: 0.35rem;
}
.tb-field {
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    gap: 0.45rem;
    align-items: center;
    margin-bottom: 0.45rem;
}
.tb-field label {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 600;
}
.tb-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.86rem;
    margin: 0.2rem 0 0.45rem 0.15rem;
    font-weight: 600;
}
.tb-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}
.tb-major-btn {
    width: 100%;
    border: 1px solid #90a4ae;
    background: #fff;
    padding: 0.45rem 0.65rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.tb-major-btn:hover { background: #f5f7f8; }
.tb-major-btn:disabled { opacity: 0.5; }
.tb-report {
    background: #fff;
    padding: 1rem 1.25rem 1.5rem;
    max-width: 52rem;
    margin: 0 auto;
}
.tb-title {
    text-align: center;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}
.tb-sub {
    text-align: center;
    font-weight: 700;
    margin: 0.2rem 0 0.85rem;
    font-size: 0.95rem;
}
.tb-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.tb-grid th,
.tb-grid td {
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    padding: 0.35rem 0.45rem;
    vertical-align: top;
}
.tb-grid thead th {
    background: #eceff1;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.82rem;
}
.tb-desc-major { font-weight: 600; }
.tb-desc-minor { padding-left: 1.25rem; color: #333; }
.tb-group td { font-weight: 800; background: #f3f5f6; }
.tb-subgroup td { font-weight: 700; }
.tb-type td { font-weight: 600; }
.tb-subtotal td { font-weight: 700; background: #fafafa; }
.tb-grand td { font-weight: 800; border-top-width: 2px; border-bottom-width: 2px; }
.tb-footer-net {
    text-align: right;
    font-weight: 700;
    margin-top: 0.55rem;
    padding-right: 0.45rem;
    border-top: 1px solid #222;
    padding-top: 0.35rem;
}

/* —— Daily Profit / Loss —— */
.dpl-page {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.dpl-top {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) minmax(12rem, 1fr) minmax(16rem, 1.15fr);
    gap: 0.45rem;
    align-items: stretch;
}
.dpl-panel {
    border: 1px solid #90a4ae;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 18rem;
    max-height: 52vh;
}
.dpl-panel-scroll { overflow: auto; flex: 1 1 auto; }
.dpl-grid { width: 100%; }
.dpl-opts {
    border: 1px solid #90a4ae;
    background: #fafbfc;
    padding: 0.45rem 0.55rem 0.55rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.dpl-opts legend {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0 0.25rem;
    float: none;
    width: auto;
}
.dpl-opt-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}
.dpl-view-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.35rem;
    align-items: center;
}
.dpl-view-row > label { font-size: 0.75rem; font-weight: 600; margin: 0; }
.dpl-dates {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 0.3rem;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
}
.dpl-yellow { background: #fff59d !important; }
.dpl-btn-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}
.dpl-margin-cost { color: #0d47a1; }
.dpl-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.25rem;
}
.dpl-actions .al-btn-preview,
.dpl-actions .al-btn-close { flex: 1; }
.dpl-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #90a4ae;
    background: #fff;
    padding: 0.4rem 0.55rem;
}
.dpl-bottom-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
}
.dpl-bottom-fields select { min-width: 9rem; max-width: 14rem; }
.dpl-sel-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.dpl-sel-btn {
    border: 1px solid #90a4ae;
    background: linear-gradient(180deg, #fff, #eceff1);
    padding: 0.28rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.dpl-sel-btn:disabled { opacity: 0.55; }
.dpl-stmt {
    border-collapse: collapse !important;
}
.dpl-stmt > :not(caption) > * > * {
    border-color: #000 !important;
}
.dpl-stmt th,
.dpl-stmt td {
    border: 1px solid #000 !important;
    padding: 0.35rem 0.45rem;
    vertical-align: top;
}
.dpl-stmt thead th {
    background: #eceff1;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.82rem;
    border-bottom: 2px solid #000 !important;
}
.dpl-stmt .income-group td {
    border-top: 2px solid #000 !important;
    background: #eef2f7;
}
.dpl-stmt .income-grandtotal td {
    border-top: 2px solid #000 !important;
    border-bottom: 3px double #000 !important;
    background: #fff8e1;
}
.dpl-profit { color: #1b5e20; font-weight: 700; }
.dpl-loss { color: #b71c1c; font-weight: 700; }
@media (max-width: 1100px) {
    .dpl-top { grid-template-columns: 1fr 1fr; }
    .dpl-opts { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .dpl-top { grid-template-columns: 1fr; }
    .dpl-view-row { grid-template-columns: 1fr; }
}

/* —— Business By Group —— */
.bbg-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem);
    gap: 0.5rem;
    align-items: start;
}
.bbg-main { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.bbg-block {
    border: 1px solid #90a4ae;
    background: #fff;
    margin: 0;
    padding: 0.35rem 0.45rem 0.5rem;
}
.bbg-block legend {
    font-size: 0.82rem;
    font-weight: 700;
    float: none;
    width: auto;
    padding: 0 0.3rem;
}
.bbg-block-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: stretch;
}
.bbg-sel-area {
    min-height: 7.5rem;
    border: 1px solid #cfd8dc;
    background: #fafbfc;
    padding: 0.4rem;
    overflow: auto;
}
.bbg-empty { color: #78909c; font-size: 0.82rem; padding: 0.5rem; }
.bbg-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.bbg-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    padding: 0.15rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
}
.bbg-chip-sm { background: #fff8e1; border-color: #ffe082; }
.bbg-chip button {
    border: none;
    background: transparent;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    color: #c62828;
}
.bbg-side-btns {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 11.5rem;
}
.bbg-side-btn {
    border: 1px solid #90a4ae;
    background: linear-gradient(180deg, #fff, #eceff1);
    padding: 0.32rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: left;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
}
.bbg-side-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.bbg-side-btn:hover:not(:disabled) { background: #e3f2fd; }
.bbg-picker {
    border: 1px solid #1976d2;
    background: #fff;
    display: flex;
    flex-direction: column;
    max-height: 28vh;
}
.bbg-picker-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    background: #e3f2fd;
    border-bottom: 1px solid #90caf9;
}
.bbg-picker-scroll { overflow: auto; flex: 1; padding: 0.35rem; }
.bbg-picker-filter { margin-bottom: 0.35rem; }
.bbg-right {
    border: 1px solid #90a4ae;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem;
    position: sticky;
    top: 0.35rem;
}
.bbg-right-top { display: flex; flex-direction: column; gap: 0.28rem; }
.bbg-lbl {
    font-size: 0.72rem;
    font-weight: 700;
    margin: 0.15rem 0 0;
    color: #37474f;
}
.bbg-yellow { background: #fff59d !important; }
.bbg-for-list {
    border: 1px solid #90a4ae;
    background: #fff;
    max-height: 8.5rem;
    overflow: auto;
    padding: 0.2rem;
}
.bbg-for-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.15rem 0.3rem;
    margin: 0;
    cursor: pointer;
}
.bbg-for-item.on { background: #bbdefb; }
.bbg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem; }
.bbg-tab {
    border: 1px solid #90a4ae;
    background: #eceff1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.35rem 0.25rem;
    cursor: pointer;
}
.bbg-tab.active { background: #fff59d; border-color: #f9a825; }
.bbg-tab-body {
    border: 1px solid #90a4ae;
    background: #fff;
    padding: 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.bbg-dates,
.bbg-trans {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 0.25rem;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
}
.bbg-inline {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 0.25rem;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
}
.bbg-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.15rem;
}
.bbg-actions .al-btn-preview,
.bbg-actions .al-btn-close { flex: 1; }
@media (max-width: 1100px) {
    .bbg-page { grid-template-columns: 1fr; }
    .bbg-right { position: static; }
}

/* ===== Cash & Bank Book ===== */
.cb-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: calc(100vh - 4.5rem);
    background: #eceff1;
    border: 1px solid #90a4ae;
}
.cb-tabs {
    display: flex;
    align-items: stretch;
    gap: 0.15rem;
    background: #cfd8dc;
    padding: 0.25rem 0.35rem 0;
    border-bottom: 1px solid #78909c;
}
.cb-tab {
    border: 1px solid #78909c;
    border-bottom: none;
    background: #b0bec5;
    color: #263238;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.35rem 0.85rem;
    border-radius: 0.25rem 0.25rem 0 0;
    cursor: pointer;
}
.cb-tab.active {
    background: #fff;
    color: #0d47a1;
}
.cb-title {
    align-self: center;
    font-weight: 800;
    font-size: 1.05rem;
    color: #1565c0;
    padding-right: 0.5rem;
}
.cb-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: flex-end;
    background: #fff;
    border-bottom: 1px solid #b0bec5;
    padding: 0.45rem 0.55rem;
}
.cb-toolbar-left {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 16rem;
}
.cb-account {
    min-width: 16rem;
    max-width: 22rem;
    font-weight: 700;
    text-transform: uppercase;
}
.cb-closing-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
}
.cb-closing-id {
    width: 5.5rem;
}
.cb-ignore {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    font-weight: 600;
}
.cb-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    font-size: 0.82rem;
}
.cb-date { width: 8.5rem; }
.cb-grid-wrap {
    flex: 1;
    overflow: hidden;
    background: #fff;
    min-height: 18rem;
    height: calc(100dvh - 16rem);
    display: flex;
    flex-direction: column;
}
.cb-grid-wrap .erp-fill-grid {
    height: 100%;
    max-height: none;
    min-height: 14rem;
}
.cb-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    font-weight: 600;
}
.cb-grid th,
.cb-grid td {
    border: 1px solid #90a4ae;
    padding: 0.22rem 0.4rem;
    vertical-align: middle;
}
.cb-grid thead th {
    background: #cfd8dc;
    position: sticky;
    top: 0;
    z-index: 2;
    font-weight: 800;
}
.cb-col-id { width: 4.5rem; }
.cb-col-doc { width: 3.5rem; }
.cb-col-date { width: 5.2rem; }
.cb-col-amt { width: 7.5rem; }
.cb-col-desc { min-width: 18rem; }
.cb-desc { min-width: 22rem; }
.cb-row-open td {
    background: #90caf9 !important;
    color: #0d47a1 !important;
}
.cb-row-close td {
    background: #1565c0 !important;
    color: #fff !important;
}
.cb-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.4rem;
    background: #eceff1;
    border-top: 2px solid #546e7a;
    padding: 0.4rem 0.5rem;
}
.cb-sum-lbl {
    align-self: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: #37474f;
    margin-right: 0.35rem;
}
.cb-sum-box {
    display: flex;
    flex-direction: column;
    min-width: 7.5rem;
    border: 1px solid #78909c;
    padding: 0.2rem 0.45rem;
    font-weight: 700;
}
.cb-sum-box span {
    font-size: 0.7rem;
    line-height: 1.1;
}
.cb-sum-box strong {
    font-size: 0.92rem;
    text-align: end;
    font-variant-numeric: tabular-nums;
}
.cb-sum-open { background: #fff59d; }
.cb-sum-recv { background: #fffde7; }
.cb-sum-paid { background: #ffccbc; }
.cb-sum-bal { background: #b2ebf2; }
.cb-sum-close { background: #ce93d8; }
.cb-placeholder {
    background: #fff;
    padding: 2rem 1.25rem;
    text-align: center;
}
@media (max-width: 900px) {
    .cb-toolbar { flex-direction: column; align-items: stretch; }
    .cb-toolbar-right { justify-content: flex-start; }
}

/* ===== Cash / Credit Summary ===== */
.ccs-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #fff;
    border-bottom: 1px solid #b0bec5;
    padding: 0.35rem 0.55rem;
}
.ccs-head-title {
    font-weight: 800;
    font-size: 1rem;
    color: #1565c0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.ccs-head-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
}
.ccs-tiles {
    background: #eceff1;
    padding: 0.45rem 0.5rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}
.ccs-labels,
.ccs-values {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.28rem;
}
.ccs-lab,
.ccs-val {
    text-align: center;
    font-weight: 800;
    border: 1px solid rgba(0,0,0,.2);
    padding: 0.28rem 0.2rem;
    color: #fff;
    font-size: 0.78rem;
    min-height: 1.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ccs-val {
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    background: #fff;
    color: #111;
}
.ccs-sales { background: #0d47a1; }
.ccs-retail { background: #2e7d32; }
.ccs-sret { background: #c62828; }
.ccs-pur { background: #7cb342; }
.ccs-pret { background: #f9a825; color: #111 !important; }
.ccs-recov { background: linear-gradient(90deg, #1565c0, #42a5f5); }
.ccs-pay { background: #d32f2f; }
.ccs-recv { background: #1b5e20; }
.ccs-values .ccs-sales { background: #e3f2fd; color: #0d47a1; }
.ccs-values .ccs-retail { background: #e8f5e9; color: #1b5e20; }
.ccs-values .ccs-sret { background: #ffebee; color: #b71c1c; }
.ccs-values .ccs-pur { background: #f1f8e9; color: #33691e; }
.ccs-values .ccs-pret { background: #fffde7; color: #f57f17; }
.ccs-values .ccs-recov { background: #e3f2fd; color: #1565c0; }
.ccs-values .ccs-pay { background: #ffebee; color: #b71c1c; }
.ccs-values .ccs-recv { background: #e8f5e9; color: #1b5e20; }
.ccs-credit-bar {
    background: #81d4fa;
    color: #01579b;
    font-weight: 900;
    text-align: center;
    letter-spacing: 0.08em;
    padding: 0.28rem;
    border: 1px solid #0288d1;
}
.ccs-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    border-top: 1px solid #b0bec5;
    border-bottom: 1px solid #b0bec5;
    padding: 0.35rem 0.55rem;
    font-weight: 700;
    font-size: 0.82rem;
}
.ccs-filter-q { flex: 1; min-width: 12rem; }
.ccs-only {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
}
.ccs-only-sel { min-width: 12rem; max-width: 18rem; }
.ccs-pos-title {
    text-align: center;
    color: #e65100;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 0.45rem 0.5rem 0.25rem;
    background: #fff;
}
.ccs-pos-wrap {
    flex: 1;
    overflow: auto;
    background: #fff;
    padding: 0 0.5rem 0.75rem;
}
.ccs-pos {
    width: 100%;
    border-collapse: collapse;
    font-weight: 700;
    font-size: 0.85rem;
}
.ccs-pos th,
.ccs-pos td {
    border: 1px solid #90a4ae;
    padding: 0.3rem 0.45rem;
}
.ccs-pos thead th {
    background: #cfd8dc;
}
.ccs-pos tbody tr td {
    background: linear-gradient(90deg, #ff7043, #ffccbc);
    color: #fff;
    text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.ccs-pos tbody tr td:first-child {
    text-align: left;
}
@media (max-width: 1100px) {
    .ccs-labels, .ccs-values { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.xc-card {
    background: #fff;
    border: 1px solid #c5daf7;
    border-radius: 0.35rem;
    padding: 1rem 1.1rem;
    box-shadow: 0 8px 24px rgba(12, 47, 122, 0.06);
}

.hr-layout {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 1rem;
    min-height: 60vh;
}
.hr-side {
    background: #0c2f7a;
    color: #e8f4ff;
    border-radius: 0.35rem;
    padding: 0.65rem 0;
}
.hr-side-h {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ffd23f;
    padding: 0.7rem 0.9rem 0.2rem;
    font-weight: 700;
}
.hr-link {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: #d6e8ff;
    padding: 0.42rem 0.95rem;
    font-size: 0.88rem;
    font-family: inherit;
    text-decoration: none;
}
.hr-link:hover, .hr-link.active {
    background: #1857d4;
    color: #fff;
}
@media (max-width: 800px) {
    .hr-layout { grid-template-columns: 1fr; }
}

.erp-fill-grid {
    display: flex;
    flex-direction: column;
    border: 1px solid #c5d0de;
    border-radius: 0.2rem;
    background: #fff;
    min-height: 14rem;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(12, 47, 122, 0.04);
}
.erp-fill-h {
    height: calc(100dvh - 11.5rem);
    max-height: calc(100dvh - 11.5rem);
}
article.content:has(.da-page),
article.content:has(.dl-page),
article.content:has(.dn-page),
article.content:has(.td-page) {
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 100% !important;
}
.da-page,
.dl-page,
.dn-page {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    min-width: 0;
    max-height: 100%;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}
.da-page .da-card.on {
    outline: none !important;
    box-shadow: inset 0 0 0 2px #0c2f7a !important;
}
.da-page .erp-fill-h,
.dl-page .erp-fill-h,
.dn-page .erp-fill-h {
    flex: 1 1 0 !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
}
.erp-fill-scroll { overflow: auto; flex: 1 1 auto; min-height: 0; }
.erp-fill-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: #1a2744;
}
.erp-fill-table:not(.erp-fill-auto) {
    table-layout: fixed;
}
.erp-fill-table:not(.erp-fill-auto) th,
.erp-fill-table:not(.erp-fill-auto) td {
    overflow: hidden;
    max-width: 0;
    box-sizing: border-box;
    isolation: isolate;
}
.att-page table.att-table.erp-fill-table {
    table-layout: auto !important;
    width: 100% !important;
    min-width: 40rem;
}
.att-page table.att-table.erp-fill-table th,
.att-page table.att-table.erp-fill-table td {
    max-width: none !important;
    overflow: visible !important;
    isolation: auto !important;
    white-space: nowrap;
    vertical-align: middle;
}
.att-page table.att-table {
    border-collapse: separate;
    border-spacing: 0;
}
.att-page table.att-table thead { position: relative; z-index: 2; }
.att-page table.att-table tbody { position: relative; z-index: 1; }
.att-page table.att-table tbody tr { position: relative; z-index: 1; }
.att-page table.att-table tbody tr:has(.nlkp-open),
.att-page table.att-table tbody tr.nlkp-row-open { z-index: 10000; }
.att-page table.att-table td.att-sts {
    position: relative;
    z-index: 1;
    isolation: auto !important;
    overflow: visible !important;
}
.att-page table.att-table tbody tr:has(.nlkp-open) td,
.att-page table.att-table tbody tr.nlkp-row-open td {
    z-index: 10000;
    position: relative;
    isolation: auto !important;
    overflow: visible !important;
}
.att-page table.att-table .erp-fill-head th { z-index: 3; }
.att-page table.att-table .erp-fill-filter th { z-index: 2; }
.att-page .att-grid:has(.nlkp-open) .erp-fill-scroll,
.att-page .att-grid:has(.nlkp-host-open) .erp-fill-scroll {
    overflow: visible !important;
}
.att-page table.att-table .att-num {
    width: 5.5rem;
    min-width: 5.5rem;
    max-width: 7rem;
    text-align: center;
}
.att-page table.att-table .att-sts-col,
.att-page table.att-table td.att-sts {
    width: 18rem;
    min-width: 18rem;
    max-width: 22rem;
}
@media (max-width: 800px) {
    .att-page { font-size: 0.78rem; }
    .att-page .att-h { font-size: 0.95rem; }
    .att-page .att-eye { font-size: 0.62rem; }
    .att-page .att-lab { font-size: 0.68rem; }
    .att-page .att-count { font-size: 0.7rem; }
    .att-page table.att-table.erp-fill-table {
        min-width: 32rem !important;
        width: max-content !important;
        font-size: 0.68rem;
    }
    .att-page table.att-table.erp-fill-table th,
    .att-page table.att-table.erp-fill-table td {
        font-size: 0.68rem;
        padding: 0.22rem 0.35rem;
    }
    .att-page table.att-table .erp-fill-head th { font-size: 0.66rem; }
    .att-page table.att-table .att-num {
        width: 4.2rem;
        min-width: 4.2rem;
        max-width: 5.2rem;
    }
    .att-page table.att-table .att-sts-col,
    .att-page table.att-table td.att-sts {
        width: 12.5rem;
        min-width: 12.5rem;
        max-width: 15rem;
    }
    .att-page .erp-fill-filter input,
    .att-page .att-sts input,
    .att-page .att-bar .form-control {
        font-size: 0.66rem;
    }
    .att-page .att-grid.erp-fill-h,
    .att-page.erp-fill-h,
    .att-page .erp-fill-h {
        height: auto !important;
        max-height: none !important;
        flex: none !important;
    }
    .att-page .att-grid .erp-fill-scroll {
        overflow-x: auto !important;
        overflow-y: visible !important;
        height: auto !important;
        max-height: none !important;
        flex: none !important;
        min-height: 0;
    }
    .att-page table.att-table thead,
    .att-page table.att-table .erp-fill-head th,
    .att-page table.att-table .erp-fill-filter th {
        position: static !important;
        top: auto !important;
        z-index: auto !important;
    }
    article.content:has(.att-page),
    article.content:has(.td-page) {
        overflow: auto !important;
        height: auto !important;
        max-height: none !important;
        display: block !important;
    }
}
.erp-fill-table:not(.erp-fill-auto) tbody td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: top;
    padding: 0.32rem 0.5rem;
}
.erp-fill-table tbody td[data-col="TopicTitle"],
.erp-fill-table tbody td[data-col="Homework"],
.erp-fill-table tbody td[data-col="HomeworkDesc"] {
    white-space: normal;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.erp-fill-auto {
    width: max-content;
    min-width: 0;
    table-layout: auto;
}
.erp-fill-auto th,
.erp-fill-auto td {
    white-space: nowrap;
    vertical-align: middle;
    padding: 0.32rem 0.5rem;
}
.erp-fill-auto .erp-fill-filter input {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
.erp-fill-head th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: linear-gradient(180deg, #f8fafc 0%, #e8eef6 100%);
    color: #0c2f7a;
    padding: 0.38rem 0.55rem;
    white-space: nowrap;
    user-select: none;
    text-align: left;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #c5d0de;
    border-right: 1px solid #e2e8f0;
}
.erp-fill-head th:last-child { border-right: 0; }
.erp-fill-sort { cursor: pointer; position: relative; }
.erp-col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    z-index: 4;
}
.erp-col-resizer:hover,
.erp-col-resizer:active {
    background: #1857d4;
    opacity: 0.28;
}
.erp-fill-table.erp-fill-resize {
    table-layout: fixed;
}
.erp-fill-table.erp-fill-resize th,
.erp-fill-table.erp-fill-resize td {
    max-width: none !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.erp-fill-filter th {
    position: sticky;
    top: 2.05rem;
    z-index: 2;
    background: #f4f7fb;
    padding: 0.22rem 0.35rem;
    vertical-align: middle;
    border-bottom: 1px solid #d7e0ec;
    border-right: 1px solid #e8eef6;
}
.erp-fill-filter th:last-child { border-right: 0; }
.erp-fill-filter input.form-control {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    height: 1.5rem;
    padding: 0.12rem 0.35rem;
    border-radius: 0.15rem;
    border: 1px solid #c5d0de;
    background: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    color: #1a2744;
}
.erp-fill-actions {
    width: 13.4rem;
    min-width: 13.4rem;
    max-width: 13.4rem;
    overflow: visible;
    white-space: nowrap;
    vertical-align: middle;
}
.erp-fill-table:not(.erp-fill-auto) .erp-fill-actions {
    max-width: 13.4rem;
    overflow: visible;
}
/* Teacher to-do: Actions fits Cancel button; cells vertically centered */
.td-page .td-grid .erp-fill-table th,
.td-page .td-grid .erp-fill-table td {
    vertical-align: middle;
}
.td-page .td-grid .erp-fill-actions,
.td-page .td-grid th.erp-fill-actions,
.td-page .td-grid td.erp-fill-actions {
    width: 1% !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    text-align: center;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}
.da-acts {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.2rem;
    width: max-content;
}
.btn.btn-sm.da-act {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 1.5rem !important;
    padding: 0 0.38rem !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.16rem;
    border-radius: 0.28rem !important;
    box-sizing: border-box;
}
.btn.da-act-view { background: #fff !important; border: 1px solid #0c2f7a !important; color: #0c2f7a !important; }
.btn.da-act-ok { background: #16A34A !important; border: 1px solid #0c2f7a !important; color: #fff !important; }
.btn.da-act-no { background: #DC2626 !important; border: 1px solid #0c2f7a !important; color: #fff !important; }
.erp-fill-table tbody td[data-col="TopicTitle"],
.erp-fill-table tbody td[data-col="Homework"],
.erp-fill-table tbody td[data-col="HomeworkDesc"],
.dv-panel textarea,
.dv-panel .form-control {
    font-family: "Noto Naskh Arabic", "Noto Nastaliq Urdu", serif !important;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.8;
}
.form-control, textarea.form-control {
    line-height: 1.7;
    unicode-bidi: plaintext;
}
.edash-ana-grid .erp-fill-table {
    width: 100%;
    min-width: 100%;
}
.edash-ana-grid th,
.edash-ana-grid td {
    padding-left: 0.28rem;
    padding-right: 0.28rem;
}
.edash-ana-grid .erp-fill-filter input {
    min-width: 0;
    width: 100%;
    padding: 0.06rem 0.16rem;
    font-size: 0.62rem;
}
.edash-ana-grid [data-col="WorkDate"],
.edash-ana-grid [data-col="DayNo"],
.edash-ana-grid [data-col="ShiftStart"],
.edash-ana-grid [data-col="ShiftEnd"],
.edash-ana-grid [data-col="TimeIn"],
.edash-ana-grid [data-col="TimeOut"],
.edash-ana-grid [data-col="HoursWorked"],
.edash-ana-grid [data-col="AttendStatus"] {
    width: 1%;
    white-space: nowrap;
}
.edash-ana-grid [data-col="DayNo"],
.edash-ana-grid [data-col="ShiftStart"],
.edash-ana-grid [data-col="ShiftEnd"],
.edash-ana-grid [data-col="TimeIn"],
.edash-ana-grid [data-col="TimeOut"],
.edash-ana-grid [data-col="HoursWorked"] {
    text-align: center;
}
.edash-ana-grid [data-col="ShiftName"],
.edash-ana-grid [data-col="ViolationReason"] {
    width: auto;
}
.edash-ana-grid [data-col="ViolationReason"] {
    font-size: 0.64rem;
    font-weight: 600;
}
.edash-ana-grid thead [data-col="ViolationReason"] {
    font-size: 0.58rem;
    padding: 0.28rem 0.3rem;
}
.edash-ana-grid [data-col="LateComer"],
.edash-ana-grid [data-col="EarlyGoing"] {
    width: 2.7rem;
    min-width: 2.7rem;
    max-width: 2.9rem;
    text-align: center;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
}
.edash-ana-grid [data-col="LateComer"] input,
.edash-ana-grid [data-col="EarlyGoing"] input {
    width: 2.35rem;
    min-width: 0;
    padding: 0.08rem 0.12rem;
    font-size: 0.6rem;
    text-align: center;
}
.erp-fill-table tbody td {
    border-bottom: 1px solid #e6edf5;
    border-right: 1px solid #f0f4f8;
}
.erp-fill-table tbody td:last-child { border-right: 0; }
.erp-fill-table tbody tr:nth-child(odd) td { background: #ffffff; }
.erp-fill-table tbody tr:nth-child(even) td { background: #f7f9fc; }
.erp-fill-table tbody tr:hover td { background: #eef6ff; }
.erp-fill-table tbody tr:hover { background: #eef6ff; }
.erp-fill-table tbody tr.att-row-p { background: color-mix(in srgb, #16A34A 18%, #fff); box-shadow: inset 4px 0 0 #16A34A; }
.erp-fill-table tbody tr.att-row-a { background: color-mix(in srgb, #DC2626 16%, #fff); box-shadow: inset 4px 0 0 #DC2626; }
.erp-fill-table tbody tr.att-row-l { background: color-mix(in srgb, #D97706 18%, #fff); box-shadow: inset 4px 0 0 #D97706; }
.erp-fill-table tbody tr.att-row-h { background: color-mix(in srgb, #0891B2 16%, #fff); box-shadow: inset 4px 0 0 #0891B2; }
.erp-fill-table tbody tr.att-row-o { background: color-mix(in srgb, #94a3b8 22%, #fff); box-shadow: inset 4px 0 0 #94a3b8; }
.erp-fill-table tbody tr.att-row-on { background: color-mix(in srgb, #2eb6ff 22%, #fff); box-shadow: inset 4px 0 0 #2eb6ff; }
.erp-fill-table tbody tr.att-row-e { background: color-mix(in srgb, #ffd23f 28%, #fff); box-shadow: inset 4px 0 0 #e6b800; }
.erp-fill-table tbody tr.att-row-t { background: color-mix(in srgb, #1857d4 16%, #fff); box-shadow: inset 4px 0 0 #1857d4; }
.erp-fill-table tbody tr.att-row-p td:nth-child(n) { background: color-mix(in srgb, #16A34A 18%, #fff); }
.erp-fill-table tbody tr.att-row-a td:nth-child(n) { background: color-mix(in srgb, #DC2626 16%, #fff); }
.erp-fill-table tbody tr.att-row-l td:nth-child(n) { background: color-mix(in srgb, #D97706 18%, #fff); }
.erp-fill-table tbody tr.att-row-h td:nth-child(n) { background: color-mix(in srgb, #0891B2 16%, #fff); }
.erp-fill-table tbody tr.att-row-o td:nth-child(n) { background: color-mix(in srgb, #94a3b8 22%, #fff); }
.erp-fill-table tbody tr.att-row-on td:nth-child(n) { background: color-mix(in srgb, #2eb6ff 22%, #fff); }
.erp-fill-table tbody tr.att-row-e td:nth-child(n) { background: color-mix(in srgb, #ffd23f 28%, #fff); }
.erp-fill-table tbody tr.att-row-t td:nth-child(n) { background: color-mix(in srgb, #1857d4 16%, #fff); }
.erp-fill-table tbody tr.att-row-p:hover td:nth-child(n) { background: color-mix(in srgb, #16A34A 28%, #fff); }
.erp-fill-table tbody tr.att-row-a:hover td:nth-child(n) { background: color-mix(in srgb, #DC2626 26%, #fff); }
.erp-fill-table tbody tr.att-row-l:hover td:nth-child(n) { background: color-mix(in srgb, #D97706 28%, #fff); }
.erp-fill-table tbody tr.att-row-h:hover td:nth-child(n) { background: color-mix(in srgb, #0891B2 26%, #fff); }
.erp-fill-table tbody tr.att-row-o:hover td:nth-child(n) { background: color-mix(in srgb, #94a3b8 32%, #fff); }
.erp-fill-table tbody tr.att-row-on:hover td:nth-child(n) { background: color-mix(in srgb, #2eb6ff 32%, #fff); }
.erp-fill-table tbody tr.att-row-e:hover td:nth-child(n) { background: color-mix(in srgb, #ffd23f 40%, #fff); }
.erp-fill-table tbody tr.att-row-t:hover td:nth-child(n) { background: color-mix(in srgb, #1857d4 26%, #fff); }
.erp-fill-click { cursor: pointer; }
.erp-fill-foot {
    border-top: 1px solid #c5d0de;
    padding: 0.28rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a6494;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}
.erp-pop-back {
    position: fixed;
    inset: 0;
    background: rgba(12, 47, 122, 0.42);
    z-index: 50;
    display: flex;
    padding: 1rem;
}
.erp-pop {
    background: #eef6ff;
    border-radius: 0.5rem;
    width: min(96vw, 1180px);
    height: min(92dvh, 900px);
    margin: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(12, 47, 122, 0.25);
    overflow: hidden;
}
.erp-pop-wide {
    width: min(98vw, 1600px);
    height: min(94dvh, 980px);
}
.erp-pop.erp-pop-form { overflow: visible; }
.erp-pop-form .erp-pop-body { overflow: visible; }
.erp-pop.erp-pop-form.erp-pop-form-wide {
    overflow: hidden;
    height: min(92dvh, 920px);
}
.ptm-pop { min-height: 0; }
.ptm-pop-h { font-size: 1.15rem; font-weight: 800; color: #0c2f7a; }
.ptm-lab { font-size: 0.78rem; font-weight: 700; color: #0c2f7a; display: block; margin-bottom: 0.2rem; }
.ptm-list { flex: 1; min-height: 12rem; display: flex; flex-direction: column; }
.ptm-list .erp-fill-h { flex: 1; height: auto; max-height: none; }
.erp-pop-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0.65rem 0.75rem 0.75rem; }
.erp-pop .erp-fill-h { height: 100%; max-height: none; flex: 1; }
.emp-ana-sts { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.emp-ana-embed { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.emp-ana-embed .erp-fill-h { flex: 1; height: auto; max-height: none; }

@media (max-width: 800px) {
    article.content:has(.da-page),
    article.content:has(.dl-page),
    article.content:has(.dn-page),
    article.content:has(> .ng-page > .erp-fill-grid) {
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        height: 100% !important;
    }
    article.content > .ng-page:has(> .erp-fill-grid) {
        flex: 1 1 0;
        min-height: 0;
        min-width: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    article.content > .ng-page:has(> .erp-fill-grid) > .erp-fill-grid {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
    }
    .da-page,
    .dl-page,
    .dn-page {
        overflow: hidden !important;
        flex: 1 1 0 !important;
        min-height: 0 !important;
        max-height: 100%;
        height: 100%;
    }
    .erp-fill-h {
        display: flex !important;
        flex-direction: column !important;
        height: calc(100dvh - 13.5rem) !important;
        max-height: calc(100dvh - 13.5rem) !important;
        min-height: 0 !important;
    }
    .da-page .erp-fill-h,
    .dl-page .erp-fill-h,
    .dn-page .erp-fill-h {
        flex: 1 1 0 !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
    }
    .erp-fill-grid {
        overflow: hidden;
        min-width: 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        height: auto;
    }
    .erp-fill-scroll,
    .pi-grid-wrap,
    .pl-grid-scroll,
    .dxg-scroll,
    .al-grid-scroll,
    .ar-grid-wrap,
    .dpl-panel-scroll {
        overflow-x: scroll !important;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        min-width: 0;
    }
    .da-page .erp-fill-scroll,
    .dl-page .erp-fill-scroll,
    .dn-page .erp-fill-scroll {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        height: 0 !important;
    }
    .erp-fill-foot { flex: 0 0 auto; }
    .erp-fill-table,
    .erp-fill-table:not(.erp-fill-auto),
    .erp-fill-table.erp-fill-auto {
        table-layout: auto !important;
        width: max-content !important;
        min-width: 58rem !important;
    }
    .erp-fill-table:not(.erp-fill-auto) th,
    .erp-fill-table:not(.erp-fill-auto) td {
        max-width: none !important;
        overflow: visible;
        white-space: nowrap;
    }
    .table-responsive {
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

