/* Saamarth ERP — canonical shared shell + page structure.
 * One global contract for sidebar/header/page/list layouts. Module CSS may own
 * domain styling only; viewport, shell, header, spacing and table-container
 * geometry are normalized here so Ledger/PDC/Units/Clients/RERA/Loans/
 * Possession/Documents/Drive cannot drift page-by-page.
 */
:root {
    --erp-page-header-height: 80px;
    --app-chrome-bg: #f3f5f8 !important;
    --sidebar-bg: #f3f5f8 !important;
    --header-surface: #f3f5f8 !important;
    --app-background: #f3f5f8 !important;
    --erp-page-bg: #ffffff;
    --erp-page-x: 12px;
    --erp-page-top: 8px;
    --erp-page-bottom: 12px;
    --erp-page-gap: 8px;
    --erp-page-line: #e2e8f0;
    --erp-page-radius: 12px;
}

/* Canonical application chrome. */
html,
body,
.app-shell,
.app-main,
.app-page,
.app-page-body,
.app-page-scroll,
.app-sidebar,
.app-sidebar > div,
.sidebar-top,
.app-sidebar > div > .shrink-0,
.shared-ledger-header {
    background: #ffffff !important;
}

.app-sidebar,
.app-sidebar > div,
.sidebar-top,
.app-sidebar > div > .shrink-0 {
    --sidebar-bg: #ffffff !important;
    background-color: #ffffff !important;
}

/* Canonical page root. All ERP list/workdesk pages must fill appPageScroll
 * instead of calculating their own viewport or adding an outer card/margin. */
body .app-page-scroll .erp-index-page {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--erp-page-bg) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

body .app-page-scroll .erp-index-page {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* Canonical shell. Supports the correct nested form and legacy pages that put
 * erp-index-page + erp-index-shell on the same element. */
body .app-page-scroll .erp-index-page > .erp-index-shell,
body .app-page-scroll .erp-index-page.erp-index-shell {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
}

/* Single canonical ERP page header. No page partial may redefine it. */
.saamarth-page-header {
    display: flex;
    width: 100%;
    min-width: 0;
    height: var(--erp-page-header-height);
    min-height: var(--erp-page-header-height);
    max-height: var(--erp-page-header-height);
    flex: 0 0 var(--erp-page-header-height);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 0 0 8px;
    border: 0;
    border-bottom: 1px solid var(--erp-page-line, #e2e8f0);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
}
.saamarth-page-header.saamarth-page-header--contained {
    min-height: var(--erp-page-header-height);
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
}
.saamarth-page-header__heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}
.saamarth-page-header__icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #f1f1f1;
    color: #2f2f2f;
    box-shadow: none;
}
.saamarth-page-header__title {
    margin: 0;
    color: #2f2f2f;
    font-size: var(--erp-font-title);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -.02em;
}
.saamarth-page-header__subtitle {
    max-width: min(620px, 60vw);
    margin: 3px 0 0;
    overflow: hidden;
    color: #6b6b6b;
    font-size: var(--erp-font-xs);
    font-weight: 400;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.saamarth-page-header__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    margin-left: auto;
}
.saamarth-page-header__metric,
.saamarth-page-header__button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: var(--erp-font-md);
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.saamarth-page-header__metric strong {
    color: #1f2937;
    font-size: var(--erp-font-md);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.saamarth-page-header__button:hover,
.saamarth-page-header__button:focus {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #1f2937;
    outline: 0;
}
.saamarth-page-header__button--primary,
.saamarth-page-header__button--primary:hover,
.saamarth-page-header__button--primary:focus {
    border-color: #2f2f2f;
    background: #2f2f2f;
    color: #fff;
}
@media (max-width: 767px) {
    .saamarth-page-header {
        height: var(--erp-page-header-height);
        min-height: var(--erp-page-header-height);
        max-height: var(--erp-page-header-height);
        flex-basis: var(--erp-page-header-height);
        padding-bottom: 6px;
        align-items: flex-start;
        gap: 10px;
    }
    .saamarth-page-header.saamarth-page-header--contained { min-height: var(--erp-page-header-height); padding: 8px 10px; }
    .saamarth-page-header__subtitle { display: none; }
    .saamarth-page-header__button,
    .saamarth-page-header__metric { min-height: 34px; padding: 7px 9px; }
}

/* Canonical flexible content region. */
body .app-page-scroll .erp-index-page .erp-index-content,
body .app-page-scroll .pdc-content {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
}

/* One table/panel boundary and one bottom inset across all list pages. */
body .app-page-scroll .erp-index-page .erp-index-table-shell,
body .app-page-scroll .pdc-table-card,
body .app-page-scroll .rera-grid-card,
body .app-page-scroll .document-page .doc-card {
    min-width: 0 !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    margin: 0 var(--erp-page-x) var(--erp-page-bottom) !important;
    border: 1px solid var(--erp-page-line) !important;
    border-radius: var(--erp-page-radius) !important;
    background: #ffffff !important;
    box-shadow: none !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Pages whose card lives inside a content wrapper must not add a second inset. */
body .app-page-scroll .erp-index-content > .erp-index-table-shell,
body .app-page-scroll .pdc-content > .pdc-table-card {
    width: auto !important;
}

/* Clients PJAX root participates in the same full-height flex contract. */
html body .app-page-scroll #unit-allottee-pjax {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* Clients — canonical structural reset.
 * The client view still contains historical page-specific layout experiments
 * (18px/1.25rem padding, KPI 24px inset, 14px table margin, etc.).  Keep only
 * client-specific visual/table rules there and force all structural spacing to
 * the same ERP contract used by Ledger/PDC/Units. */


html body .app-page-scroll #unit-allottee-page.erp-index-page .saamarth-unit-kpi-strip {
    display: grid !important;
    min-height: 0 !important;
    flex: 0 0 auto !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    justify-content: stretch !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

html body .app-page-scroll #unit-allottee-page.erp-index-page .saamarth-unit-kpi {
    min-height: 54px !important;
    padding: 8px 11px !important;
    border: 1px solid var(--erp-page-line) !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

html body .app-page-scroll #unit-allottee-page.erp-index-page #unit-allottee-table-shell.erp-index-table-shell {
    width: auto !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    margin: 0 var(--erp-page-x) var(--erp-page-bottom) !important;
    border: 1px solid var(--erp-page-line) !important;
    border-radius: var(--erp-page-radius) !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

/* Drive/Documents uses its own domain markup but follows the same viewport and
 * outer spacing contract. */



/* Unit Docs keeps its functional two-column workspace, but the outer page is
 * now the same white, edge-to-edge application canvas. */
body .app-page-scroll .unit-docs-page,
body .app-page-scroll .unit-docs-shell,
body .app-page-scroll .unit-docs-main,
body .app-page-scroll .unit-docs-content {
    background: #ffffff !important;
}


/* Shared work-page canvas: a near-white tint separates the workspace from
 * white headers, toolbars and data cards without introducing page-specific
 * backgrounds. */
body .app-page-scroll,
body .app-page-scroll .erp-index-page,
body .app-page-scroll .erp-index-page > .erp-index-shell,
body .app-page-scroll .erp-index-page.erp-index-shell,
body .app-page-scroll .pdc-shell,
html body .app-page-scroll #unit-allottee-page.erp-index-page > .mx-auto.erp-index-shell,
body .app-page-scroll .document-page,
body .app-page-scroll .unit-docs-page {
    background: var(--erp-page-bg) !important;
}




/* Extend the near-white work tint through every data-work surface. The page
 * header remains the single white landmark at the top of each module. */
body .app-page-scroll .erp-index-page .erp-index-content,
body .app-page-scroll .erp-index-page .erp-index-table-shell,
body .app-page-scroll .erp-index-page .erp-index-table-toolbar,
body .app-page-scroll .erp-index-page .erp-index-summarybar,
body .app-page-scroll .erp-index-page .erp-index-table-scroll,
body .app-page-scroll .erp-index-page .erp-index-table,
body .app-page-scroll .erp-index-page .erp-index-table thead,
body .app-page-scroll .erp-index-page .erp-index-table tbody,
body .app-page-scroll .erp-index-page .erp-index-table tfoot,
body .app-page-scroll .erp-index-page .erp-index-table tr,
body .app-page-scroll .erp-index-page .erp-index-table th,
body .app-page-scroll .erp-index-page .erp-index-table td,
body .app-page-scroll .pdc-content,
body .app-page-scroll .pdc-table-card,
body .app-page-scroll .pdc-table-card table,
body .app-page-scroll .pdc-table-card th,
body .app-page-scroll .pdc-table-card td,
body .app-page-scroll .rera-grid-card,
body .app-page-scroll .rera-grid-card table,
body .app-page-scroll .rera-grid-card th,
body .app-page-scroll .rera-grid-card td,
body .app-page-scroll .document-page .document-body,
body .app-page-scroll .document-page .doc-card,
body .app-page-scroll .document-page .doc-toolbar,
body .app-page-scroll .document-page .doc-table-scroll,
body .app-page-scroll .document-page .doc-table,
body .app-page-scroll .document-page .doc-table th,
body .app-page-scroll .document-page .doc-table td,
body .app-page-scroll .unit-docs-main,
body .app-page-scroll .unit-docs-content {
    background: var(--erp-page-bg) !important;
}



/* Clients ships historical ID-scoped white backgrounds with !important.
 * This final, page-specific bridge removes that structural conflict while the
 * canonical theme remains the only owner of the work-surface colour. */
html body .app-page-scroll #unit-allottee-page.erp-index-page #unit-allottee-table-shell,
html body .app-page-scroll #unit-allottee-page.erp-index-page #unit-allottee-table-shell .erp-index-table-scroll,
html body .app-page-scroll #unit-allottee-page.erp-index-page #unit-allottee-table,
html body .app-page-scroll #unit-allottee-page.erp-index-page #unit-allottee-table thead,
html body .app-page-scroll #unit-allottee-page.erp-index-page #unit-allottee-table tbody,
html body .app-page-scroll #unit-allottee-page.erp-index-page #unit-allottee-table tfoot,
html body .app-page-scroll #unit-allottee-page.erp-index-page #unit-allottee-table tr,
html body .app-page-scroll #unit-allottee-page.erp-index-page #unit-allottee-table th,
html body .app-page-scroll #unit-allottee-page.erp-index-page #unit-allottee-table td {
    background: var(--erp-page-bg) !important;
}



/* Final surface contract: application chrome is lightly tinted; every page
 * canvas and working surface is white. */
html,
body,
.app-shell,
.app-main,
.app-page,
.app-page-body,
.app-sidebar,
.app-sidebar > div,
.sidebar-top,
.app-sidebar > div > .shrink-0,
.shared-ledger-header,
.app-header {
    background: var(--app-chrome-bg) !important;
}

body .app-page-scroll,
body .app-page-scroll .erp-index-page,
body .app-page-scroll .erp-index-page > .erp-index-shell,
body .app-page-scroll .erp-index-page.erp-index-shell,
body .app-page-scroll .saamarth-page-top,
body .app-page-scroll .erp-index-page .erp-index-content,
body .app-page-scroll .erp-index-page .erp-index-table-shell,
body .app-page-scroll .erp-index-page .erp-index-table-toolbar,
body .app-page-scroll .erp-index-page .erp-index-summarybar,
body .app-page-scroll .erp-index-page .erp-index-table-scroll,
body .app-page-scroll .erp-index-page table,
body .app-page-scroll .erp-index-page thead,
body .app-page-scroll .erp-index-page tbody,
body .app-page-scroll .erp-index-page tfoot,
body .app-page-scroll .erp-index-page tr,
body .app-page-scroll .erp-index-page th,
body .app-page-scroll .erp-index-page td,
body .app-page-scroll .document-page,
body .app-page-scroll .document-page .document-body,
body .app-page-scroll .document-page .doc-card,
body .app-page-scroll .unit-docs-page,
body .app-page-scroll .unit-docs-main,
body .app-page-scroll .unit-docs-content {
    background: #ffffff !important;
}


@media (max-width: 767px) {
    :root {
        --erp-page-x: 8px;
        --erp-page-top: 7px;
        --erp-page-bottom: 8px;
        --erp-page-gap: 6px;
        --erp-page-radius: 10px;
    }

    html body .app-page-scroll #unit-allottee-page.erp-index-page .saamarth-unit-kpi-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 6px !important;
        padding: 0 !important;
    }

}


/* ===== Canonical CRM typography system ===== */
:root {
    --crm-font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --crm-font-size-xs: 11px;
    --crm-font-size-sm: 12px;
    --crm-font-size-base: 13px;
    --crm-font-size-md: 14px;
    --crm-font-size-lg: 16px;
    --crm-font-size-xl: 20px;
    --crm-font-size-2xl: 24px;
    --crm-font-weight-regular: 400;
    --crm-font-weight-medium: 500;
    --crm-font-weight-semibold: 600;
    --crm-font-weight-bold: 700;
    --crm-line-height-compact: 1.25;
    --crm-line-height-base: 1.45;
    --crm-line-height-relaxed: 1.6;

    /* Compatibility aliases for existing modules during gradual cleanup. */
    --saamarth-font: var(--crm-font-family);
    --saamarth-ui-font: var(--crm-font-family);
    --saamarth-font-size: var(--crm-font-size-base);
    --saamarth-line-height: var(--crm-line-height-base);
    --erp-font-xs: var(--crm-font-size-xs);
    --erp-font-sm: var(--crm-font-size-sm);
    --erp-font-md: var(--crm-font-size-base);
    --erp-font-base: var(--crm-font-size-md);
    --erp-font-lg: var(--crm-font-size-lg);
    --erp-font-xl: var(--crm-font-size-lg);
    --erp-font-title: var(--crm-font-size-xl);
    --erp-font-page-header: var(--crm-font-size-lg);
    --erp-font-kpi: var(--crm-font-size-xl);
    --erp-weight-regular: var(--crm-font-weight-regular);
    --erp-weight-medium: var(--crm-font-weight-medium);
    --erp-weight-semibold: var(--crm-font-weight-semibold);
    --erp-weight-bold: var(--crm-font-weight-bold);
    --erp-line-compact: var(--crm-line-height-compact);
    --erp-line-normal: var(--crm-line-height-base);
}

/* Normal text nodes inherit the CRM family. Pseudo-elements are deliberately
 * excluded because Font Awesome and Glyphicons render through icon fonts. */
html,
body,
.app-shell,
.app-header,
.app-sidebar,
.app-main,
.app-page,
.app-page-body,
.app-page-scroll {
    font-family: var(--crm-font-family);
    font-size: var(--crm-font-size-base);
    font-weight: var(--crm-font-weight-regular);
    line-height: var(--crm-line-height-base);
}

button,
input,
select,
textarea,
optgroup,
option,
.form-control,
.btn,
.dropdown-menu,
.nav,
.nav-tabs,
.pagination,
.modal,
.popover,
.tooltip,
.select2-container,
.select2-selection,
.select2-results,
.grid-view,
.dataTable,
.table {
    font-family: inherit;
}

body,
p,
li,
dt,
dd,
.form-control,
.select2-selection__rendered,
.select2-results__option,
.modal-body,
.popover-content {
    font-size: var(--crm-font-size-base);
    line-height: var(--crm-line-height-base);
}

h1, .h1, .crm-page-title, .saamarth-page-header__title {
    font-size: var(--crm-font-size-xl);
    font-weight: var(--crm-font-weight-semibold);
    line-height: var(--crm-line-height-compact);
    letter-spacing: -.02em;
}
h2, .h2, .crm-section-title {
    font-size: var(--crm-font-size-lg);
    font-weight: var(--crm-font-weight-semibold);
    line-height: var(--crm-line-height-compact);
}
h3, .h3, .crm-card-title,
.panel-title,
.modal-title {
    font-size: var(--crm-font-size-md);
    font-weight: var(--crm-font-weight-semibold);
    line-height: var(--crm-line-height-compact);
}
h4, h5, h6, .h4, .h5, .h6 {
    font-size: var(--crm-font-size-base);
    font-weight: var(--crm-font-weight-semibold);
    line-height: var(--crm-line-height-compact);
}

.crm-body-text { font-size: var(--crm-font-size-base); line-height: var(--crm-line-height-base); }
.crm-meta-text,
.saamarth-page-header__subtitle,
.help-block,
.hint-block,
.form-text,
.empty,
.text-muted {
    font-size: var(--crm-font-size-sm);
    font-weight: var(--crm-font-weight-regular);
    line-height: var(--crm-line-height-base);
}
.crm-form-label,
label,
.control-label,
.form-label {
    font-size: var(--crm-font-size-sm);
    font-weight: var(--crm-font-weight-semibold);
    line-height: var(--crm-line-height-compact);
}

.btn,
button,
input,
select,
textarea,
.form-control,
.input-group-addon,
.dropdown-menu > li > a,
.nav > li > a,
.nav-tabs > li > a,
.select2-selection__rendered,
.select2-results__option,
.pagination > li > a,
.pagination > li > span {
    font-size: var(--crm-font-size-base);
    font-weight: var(--crm-font-weight-regular);
    line-height: var(--crm-line-height-base);
}
.toolbar .btn,
.erp-index-toolbar .btn,
.erp-index-table-toolbar .btn,
.saamarth-page-header__button,
.saamarth-page-header__metric {
    font-size: var(--crm-font-size-sm);
    font-weight: var(--crm-font-weight-medium);
    line-height: var(--crm-line-height-compact);
}

table,
.table,
.grid-view table,
.dataTable {
    font-size: var(--crm-font-size-sm);
    line-height: var(--crm-line-height-base);
}
table > thead > tr > th,
.table > thead > tr > th,
.grid-view th,
.dataTable thead th,
.crm-table-heading {
    font-size: var(--crm-font-size-xs);
    font-weight: var(--crm-font-weight-semibold);
    line-height: var(--crm-line-height-compact);
    letter-spacing: .02em;
}
table > tbody > tr > td,
.table > tbody > tr > td,
.grid-view td,
.dataTable tbody td {
    font-size: var(--crm-font-size-sm);
    font-weight: var(--crm-font-weight-regular);
    line-height: var(--crm-line-height-base);
}

.badge,
.label,
.chip,
.crm-badge-text,
.alert,
.validation-error,
.help-block,
.error-summary {
    font-size: var(--crm-font-size-xs);
    line-height: var(--crm-line-height-compact);
}
.badge,
.label,
.chip,
.crm-badge-text {
    font-weight: var(--crm-font-weight-semibold);
}
.alert,
.validation-error,
.help-block,
.error-summary {
    font-weight: var(--crm-font-weight-regular);
}
.tooltip,
.popover {
    font-size: var(--crm-font-size-sm);
    line-height: var(--crm-line-height-base);
}

/* Third-party widgets that ship their own font declarations need a narrow
 * override. Icon classes and their pseudo-elements are intentionally absent. */
.select2-container,
.select2-container .select2-selection,
.select2-container .select2-results__option,
.bootstrap-datetimepicker-widget,
.datepicker,
.daterangepicker,
.dataTables_wrapper {
    font-family: var(--crm-font-family) !important;
}

/* Preserve 16px controls on small touch screens to prevent iOS input zoom. */
@media (max-width: 640px) {
    input,
    select,
    textarea,
    .form-control,
    .select2-container .select2-selection__rendered {
        font-size: 16px;
    }
}


/* Dashboard canonical typography bridge.
 * dashboard.css contains legacy, highly-specific 8–10px declarations. These
 * narrow !important rules are required until that structural stylesheet is
 * split; typography remains owned here without changing KPI/grid geometry. */
body .app-page-scroll .erp-dashboard {
    background: #ffffff !important;
    color: #172033;
    font-family: var(--crm-font-family);
    font-size: var(--crm-font-size-base);
    font-weight: var(--crm-font-weight-regular);
    line-height: var(--crm-line-height-base);
}
body .app-page-scroll .erp-dashboard .erp-kpi-section__head h2,
body .app-page-scroll .erp-dashboard .pending-command__identity h2 {
    font-size: var(--crm-font-size-lg) !important;
    font-weight: var(--crm-font-weight-semibold) !important;
    line-height: var(--crm-line-height-compact) !important;
    letter-spacing: 0 !important;
}
body .app-page-scroll .erp-dashboard .erp-kpi-section__head p,
body .app-page-scroll .erp-dashboard .erp-kpi-section__head > span,
body .app-page-scroll .erp-dashboard .erp-kpi__status,
body .app-page-scroll .erp-dashboard .erp-kpi__body > small,
body .app-page-scroll .erp-dashboard .pending-command__identity > div > span,
body .app-page-scroll .erp-dashboard .pending-command__identity p,
body .app-page-scroll .erp-dashboard .pending-command__total span,
body .app-page-scroll .erp-dashboard .pending-task__copy small {
    font-size: var(--crm-font-size-xs) !important;
    font-weight: var(--crm-font-weight-regular) !important;
    line-height: var(--crm-line-height-base) !important;
    letter-spacing: 0 !important;
}
body .app-page-scroll .erp-dashboard .erp-kpi__body > span,
body .app-page-scroll .erp-dashboard .pending-command__identity > div > span {
    font-size: var(--crm-font-size-sm) !important;
    font-weight: var(--crm-font-weight-semibold) !important;
}
body .app-page-scroll .erp-dashboard .erp-kpi__body > strong,
body .app-page-scroll .erp-dashboard .pending-command__total strong {
    font-size: var(--crm-font-size-xl) !important;
    font-weight: var(--crm-font-weight-bold) !important;
    line-height: var(--crm-line-height-compact) !important;
    letter-spacing: -.02em !important;
}
body .app-page-scroll .erp-dashboard .pending-task__copy strong,
body .app-page-scroll .erp-dashboard .pending-task > b {
    font-size: var(--crm-font-size-sm) !important;
    font-weight: var(--crm-font-weight-semibold) !important;
    line-height: var(--crm-line-height-compact) !important;
    letter-spacing: 0 !important;
}


/* ===== Canonical ERP table contract =====
 * Legacy modules still contain highly-specific table declarations. These
 * narrowly scoped overrides make typography, rows, scrolling, headers and
 * footers consistent without owning column widths or responsive visibility. */
:root {
    --crm-table-head-height: 36px;
    --crm-table-row-height: 44px;
    --crm-table-footer-height: 40px;
    --crm-table-cell-x: 10px;
    --crm-table-head-bg: #f8fafc;
    --crm-table-row-bg: #ffffff;
    --crm-table-border: #e8edf3;
}

.erp-index-table,
.pdc-ledger-table,
.rera-table,
.handover-table,
.doc-table {
    width: 100%;
    margin: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--crm-table-row-bg);
    color: #334155;
    font-family: var(--crm-font-family) !important;
    font-size: var(--crm-font-size-sm) !important;
    line-height: var(--crm-line-height-base) !important;
}

.erp-index-table > tbody > tr > td,
.pdc-ledger-table > tbody > tr > td,
.rera-table > tbody > tr > td,
.handover-table > tbody > tr > td,
.doc-table > tbody > tr > td {
    height: var(--crm-table-row-height) !important;
    padding: 7px var(--crm-table-cell-x) !important;
    border-bottom: 1px solid var(--crm-table-border) !important;
    background: var(--crm-table-row-bg);
    color: #334155;
    font-family: var(--crm-font-family) !important;
    font-size: var(--crm-font-size-sm) !important;
    font-weight: var(--crm-font-weight-regular) !important;
    line-height: var(--crm-line-height-base) !important;
    letter-spacing: 0 !important;
    vertical-align: middle !important;
}

.erp-index-table > tfoot > tr > th,
.erp-index-table > tfoot > tr > td,
.pdc-ledger-table > tfoot > tr > th,
.pdc-ledger-table > tfoot > tr > td,
.rera-table > tfoot > tr > th,
.rera-table > tfoot > tr > td,
.handover-table > tfoot > tr > th,
.handover-table > tfoot > tr > td,
.doc-table > tfoot > tr > th,
.doc-table > tfoot > tr > td {
    min-height: var(--crm-table-footer-height) !important;
    padding: 7px var(--crm-table-cell-x) !important;
    border-top: 1px solid var(--crm-table-border) !important;
    background: #ffffff !important;
    font-size: var(--crm-font-size-sm) !important;
    font-weight: var(--crm-font-weight-semibold) !important;
    line-height: var(--crm-line-height-base) !important;
    vertical-align: middle !important;
}


.erp-index-table-footer,
.pdc-ledger-footerbar,
.rera-pager,
.handover-pager,
.doc-footer {
    min-height: var(--crm-table-footer-height) !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    border-top: 1px solid var(--crm-table-border) !important;
    background: #ffffff !important;
    color: #64748b;
    font-family: var(--crm-font-family) !important;
    font-size: var(--crm-font-size-xs) !important;
    font-weight: var(--crm-font-weight-regular) !important;
    line-height: var(--crm-line-height-base) !important;
}

.erp-index-table-footer .pagination,
.pdc-ledger-footerbar .pagination,
.rera-pager .pagination,
.handover-pager .pagination {
    margin: 0 !important;
}

@media (min-width: 768px) {
    .erp-index-table > tfoot > tr > th,
    .erp-index-table > tfoot > tr > td,
    .pdc-ledger-table > tfoot > tr > th,
    .pdc-ledger-table > tfoot > tr > td,
    .rera-table > tfoot > tr > th,
    .rera-table > tfoot > tr > td,
    .handover-table > tfoot > tr > th,
    .handover-table > tfoot > tr > td,
    .doc-table > tfoot > tr > th,
    .doc-table > tfoot > tr > td {
        position: sticky;
        bottom: 0;
        z-index: 2;
    }
}

@media (max-width: 767px) {
    :root {
        --crm-table-row-height: 42px;
        --crm-table-cell-x: 9px;
    }

    /* Modules that transform rows into cards keep their own display/layout. */
    .erp-index-table > tbody > tr > td,
    .pdc-ledger-table > tbody > tr > td,
    .rera-table > tbody > tr > td,
    .handover-table > tbody > tr > td,
    .doc-table > tbody > tr > td {
        height: auto !important;
        min-height: var(--crm-table-row-height);
    }
}


/* Dashboard pending drawer uses the same table rhythm as ERP register pages. */
.pending-list-modal__table {
    width: 100%;
    margin: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
    color: #334155;
    font-family: var(--crm-font-family) !important;
    font-size: var(--crm-font-size-sm) !important;
    line-height: var(--crm-line-height-base) !important;
}
.pending-list-modal__table > tbody > tr > td {
    height: var(--crm-table-row-height) !important;
    min-height: 0 !important;
    padding: 7px var(--crm-table-cell-x) !important;
    border-bottom: 1px solid var(--crm-table-border) !important;
    background: #ffffff;
    color: #334155;
    font-size: var(--crm-font-size-sm) !important;
    font-weight: var(--crm-font-weight-regular) !important;
    line-height: var(--crm-line-height-base) !important;
    letter-spacing: 0 !important;
    vertical-align: middle !important;
}
.pending-list-modal__table-wrap {
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

/* Functional mobile-card exceptions: table rows are intentionally transformed
 * into labelled cards, so fixed desktop row geometry must not leak here. */
@media (max-width: 767px) {
    .handover-table > tbody > tr > td,
    .doc-table > tbody > tr > td,
    .pending-list-modal__table > tbody > tr > td {
        height: auto !important;
    }
    .doc-table > tbody > tr > td {
        min-height: 58px;
    }
    .pending-list-modal__table > tbody > tr > td {
        min-height: 50px !important;
    }
}


/* ===== Canonical table support primitives ===== */
:root {
    --crm-table-toolbar-height: 40px;
    --crm-table-control-height: 34px;
    --crm-empty-min-height: 220px;
    --crm-badge-height: 22px;
}

/* One summary/action toolbar across every register and table drawer. */
.erp-index-table-toolbar,
.erp-index-summarybar,
.ledger-toolbar,
.pdc-ledger-summarybar,
.rera-toolbar,
.handover-list__toolbar,
.doc-toolbar,
.pending-list-modal__toolbar {
    display: flex !important;
    width: 100%;
    min-width: 0;
    min-height: var(--crm-table-toolbar-height) !important;
    flex: 0 0 auto;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 7px var(--crm-table-cell-x) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--crm-table-border) !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    color: #64748b;
    font-family: var(--crm-font-family) !important;
    font-size: var(--crm-font-size-sm) !important;
    font-weight: var(--crm-font-weight-regular) !important;
    line-height: var(--crm-line-height-base) !important;
}

.erp-index-table-toolbar .btn,
.erp-index-summarybar .btn,
.ledger-toolbar .btn,
.ledger-toolbar button,
.ledger-toolbar select,
.pdc-ledger-summarybar .btn,
.pdc-ledger-summarybar button,
.pdc-ledger-summarybar select,
.rera-toolbar .btn,
.rera-toolbar button,
.rera-toolbar select,
.handover-list__toolbar .btn,
.handover-list__toolbar button,
.handover-list__toolbar select,
.doc-toolbar .btn,
.doc-toolbar button,
.doc-toolbar select,
.pending-list-modal__toolbar .btn,
.pending-list-modal__toolbar button,
.pending-list-modal__toolbar select {
    min-height: var(--crm-table-control-height) !important;
    font-size: var(--crm-font-size-sm) !important;
    font-weight: var(--crm-font-weight-medium) !important;
    line-height: var(--crm-line-height-compact) !important;
}

/* One empty-state hierarchy. Action buttons remain optional module content. */
.erp-index-empty,
.ledger-empty-state,
.pdc-empty-state,
.rera-empty,
.handover-empty,
.unit-empty,
.pending-list-modal__empty {
    display: flex !important;
    width: 100%;
    min-height: var(--crm-empty-min-height) !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column;
    padding: 28px 18px !important;
    border: 0 !important;
    background: #ffffff !important;
    color: #64748b !important;
    text-align: center !important;
}

.erp-index-empty__icon,
.ledger-empty-state-icon,
.pdc-empty-state__icon,
.rera-empty__icon,
.unit-empty i,
.pending-list-modal__empty > i {
    display: inline-flex !important;
    width: 42px !important;
    height: 42px !important;
    flex: 0 0 42px;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 0 10px !important;
    border: 1px solid #e2e8f0;
    border-radius: 10px !important;
    background: #f8fafc !important;
    color: #64748b !important;
    font-size: var(--crm-font-size-lg) !important;
}

.erp-index-empty__title,
.ledger-empty-state-title,
.pdc-empty-state__title,
.rera-empty__title,
.unit-empty p:first-of-type,
.pending-list-modal__empty > strong {
    margin: 0 !important;
    color: #334155 !important;
    font-size: var(--crm-font-size-md) !important;
    font-weight: var(--crm-font-weight-semibold) !important;
    line-height: var(--crm-line-height-compact) !important;
}

.erp-index-empty__text,
.ledger-empty-state-text,
.pdc-empty-state__text,
.rera-empty__text,
.unit-empty p:last-of-type,
.pending-list-modal__empty > span {
    max-width: 480px;
    margin: 5px 0 0 !important;
    color: #64748b !important;
    font-size: var(--crm-font-size-xs) !important;
    font-weight: var(--crm-font-weight-regular) !important;
    line-height: var(--crm-line-height-base) !important;
}

.erp-index-table .erp-index-empty,
.erp-index-table .ledger-empty-state,
.pdc-ledger-table .pdc-empty-state,
.rera-table .rera-empty,
.erp-index-table .handover-empty,
#unit-allottee-table .unit-empty {
    height: auto !important;
}

/* One compact badge/chip primitive; semantic colour modifiers stay in modules. */
.crm-badge,
.crm-chip,
.erp-index-table .badge,
.erp-index-table .label,
.ledger-chip,
.pdc-date-pill,
.pdc-warning-pill,
.pdc-bank-pill,
.pdc-type-badge,
.loan-chip,
.stage-badge,
.status-pill,
.doc-badge,
.doc-unit-badge,
.pending-list-chip {
    display: inline-flex !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: var(--crm-badge-height) !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px;
    padding: 3px 7px !important;
    border-radius: 7px !important;
    font-family: var(--crm-font-family) !important;
    font-size: var(--crm-font-size-xs) !important;
    font-weight: var(--crm-font-weight-semibold) !important;
    line-height: var(--crm-line-height-compact) !important;
    letter-spacing: 0 !important;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .erp-index-table-toolbar,
    .erp-index-summarybar,
    .ledger-toolbar,
    .pdc-ledger-summarybar,
    .rera-toolbar,
    .handover-list__toolbar,
    .doc-toolbar,
    .pending-list-modal__toolbar {
        flex-wrap: wrap;
        gap: 6px !important;
        padding: 6px 8px !important;
    }

    .erp-index-empty,
    .ledger-empty-state,
    .pdc-empty-state,
    .rera-empty,
    .handover-empty,
    .unit-empty,
    .pending-list-modal__empty {
        min-height: 180px !important;
        padding: 24px 14px !important;
    }
}


/* Canonical Showing / page-size tools used by all ERP register tables. */
.erp-index-table-summary-control {
    position: relative;
    min-width: 0;
    flex: 0 0 auto;
}
.erp-index-table-summary-trigger {
    display: inline-flex;
    min-height: 28px !important;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 4px 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-family: var(--crm-font-family);
    font-size: var(--crm-font-size-sm) !important;
    font-weight: var(--crm-font-weight-regular) !important;
    line-height: var(--crm-line-height-compact) !important;
    white-space: nowrap;
    cursor: pointer;
}
.erp-index-table-summary-trigger:hover,
.erp-index-table-summary-trigger:focus,
.erp-index-table-summary-trigger[aria-expanded="true"] {
    background: #f1f5f9;
    color: #334155;
    outline: 0;
}
.erp-index-table-summary-trigger b,
.erp-index-table-total-badge__value {
    color: #334155;
    font-weight: var(--crm-font-weight-semibold);
    font-variant-numeric: tabular-nums;
}
.erp-index-table-summary-caret {
    color: #94a3b8;
    font-size: 11px;
    transition: transform .15s ease;
}
.erp-index-table-summary-trigger[aria-expanded="true"] .erp-index-table-summary-caret {
    transform: rotate(180deg);
}
.erp-index-table-summary-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 40;
    display: grid;
    min-width: 142px;
    padding: 5px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}
.erp-index-table-summary-menu[hidden] {
    display: none !important;
}
.erp-index-table-summary-option {
    display: flex;
    width: 100%;
    min-height: 30px !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 8px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #475569;
    font-family: var(--crm-font-family);
    font-size: var(--crm-font-size-sm) !important;
    font-weight: var(--crm-font-weight-regular) !important;
    line-height: var(--crm-line-height-compact) !important;
    text-align: left;
    white-space: nowrap;
}
.erp-index-table-summary-option:hover,
.erp-index-table-summary-option:focus {
    background: #f1f5f9;
    color: #1e293b;
    outline: 0;
}
.erp-index-table-summary-option.is-active {
    background: #eef2ff;
    color: #4338ca;
    font-weight: var(--crm-font-weight-semibold) !important;
}
.erp-index-table-total-badge {
    display: inline-flex !important;
    width: auto !important;
    min-width: 0;
    min-height: 28px !important;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    padding: 4px 8px !important;
    border: 1px solid #dbe3ef !important;
    border-radius: 8px !important;
    background: #f8fafc !important;
    color: #64748b !important;
    font-family: var(--crm-font-family) !important;
    font-size: var(--crm-font-size-xs) !important;
    font-weight: var(--crm-font-weight-regular) !important;
    line-height: var(--crm-line-height-compact) !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.erp-index-table-total-badge__value {
    color: #334155;
    font-weight: var(--crm-font-weight-semibold);
    font-variant-numeric: tabular-nums;
}
.erp-index-table-total-badge--warning {
    border-color: #fed7aa !important;
    background: #fff7ed !important;
    color: #9a3412 !important;
}
.erp-index-table-total-badge--warning .erp-index-table-total-badge__value {
    color: #c2410c;
}
.erp-index-table-toolbar__spacer {
    min-width: 8px;
    flex: 1 1 auto;
}


/* Canonical register-toolbar geometry.
 * Legacy module styles have higher specificity, so the scoped declarations
 * below intentionally use !important until those modules are fully retired. */
body .app-page-scroll .erp-index-table-shell > .erp-index-table-toolbar,
body .app-page-scroll .erp-index-table-shell > .erp-index-pjax > .erp-index-table-toolbar,
body .app-page-scroll .erp-index-table-shell > [data-pjax-container] > .erp-index-table-toolbar,
body .app-page-scroll .erp-index-table-shell .erp-index-table-toolbar {
    position: relative !important;
    z-index: 12 !important;
    display: flex !important;
    width: 100% !important;
    height: var(--crm-table-toolbar-height) !important;
    min-height: var(--crm-table-toolbar-height) !important;
    max-height: var(--crm-table-toolbar-height) !important;
    flex: 0 0 var(--crm-table-toolbar-height) !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 6px var(--crm-table-cell-x) !important;
    overflow: visible !important;
    border: 0 !important;
    border-bottom: 1px solid var(--crm-table-border) !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}
body .app-page-scroll .erp-index-table-toolbar > .erp-index-table-toolbar__spacer {
    display: block !important;
    min-width: 8px !important;
    flex: 1 1 auto !important;
}
body .app-page-scroll .erp-index-table-toolbar > button,
body .app-page-scroll .erp-index-table-toolbar > .btn,
body .app-page-scroll .erp-index-table-toolbar > select,
body .app-page-scroll .erp-index-table-toolbar > .erp-index-table-total-badge,
body .app-page-scroll .erp-index-table-toolbar .erp-index-table-summary-trigger {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    flex: 0 0 auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    box-sizing: border-box !important;
}
body .app-page-scroll .erp-index-table-toolbar .erp-index-table-summary-menu {
    max-height: min(320px, 60vh) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}
@media (max-width: 767px) {
    body .app-page-scroll .erp-index-table-shell .erp-index-table-toolbar {
        height: auto !important;
        min-height: var(--crm-table-toolbar-height) !important;
        max-height: none !important;
        flex: 0 0 auto !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        padding: 6px 8px !important;
    }
    body .app-page-scroll .erp-index-table-toolbar > .erp-index-table-toolbar__spacer {
        min-width: 0 !important;
    }
}


/* Canonical primary-toolbar action. Narrow scoping prevents Bootstrap button regressions. */
body .app-page-scroll .erp-index-toolbar > .erp-index-toolbar__action {
    display: inline-flex;
    height: 34px;
    min-height: 34px;
    max-height: 34px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font-family: var(--crm-font-family);
    font-size: var(--crm-font-size-sm);
    font-weight: var(--crm-font-weight-medium);
    line-height: var(--crm-line-height-compact);
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
}
body .app-page-scroll .erp-index-toolbar > .erp-index-toolbar__action--end { margin-left: auto; }
body .app-page-scroll .erp-index-toolbar > .erp-index-toolbar__action:hover,
body .app-page-scroll .erp-index-toolbar > .erp-index-toolbar__action:focus {
    border-color: #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
    outline: 0;
    text-decoration: none;
}
body .app-page-scroll .erp-index-toolbar > .erp-index-toolbar__action.is-disabled {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    pointer-events: none;
    cursor: not-allowed;
}
@media (max-width: 767px) {
    body .app-page-scroll .erp-index-toolbar > .erp-index-toolbar__action--end { margin-left: 0; }
}


/* Final canonical register table-header contract.
 * All register tables opt in with .erp-index-table. Legacy aliases remain
 * only for tables whose markup cannot yet use the shared class.
 * Module styles may define column width and alignment only. */
body .app-page-scroll .erp-index-table > thead > tr > th,
body .app-page-content .erp-index-table > thead > tr > th,
body .app-page-scroll .pdc-ledger-table > thead > tr > th,
body .app-page-scroll .doc-table > thead > tr > th,
body .app-page-scroll .pending-list-modal__table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 3;
    height: var(--crm-table-head-height);
    min-height: var(--crm-table-head-height);
    max-height: var(--crm-table-head-height);
    padding: 0 var(--crm-table-cell-x);
    border: 0;
    border-bottom: 1px solid var(--crm-table-border);
    background: var(--crm-table-head-bg);
    color: #64748b;
    font-family: var(--crm-font-family);
    font-size: var(--crm-font-size-xs);
    font-weight: var(--crm-font-weight-semibold);
    line-height: var(--crm-line-height-compact);
    letter-spacing: .02em;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    box-sizing: border-box;
}

body .app-page-scroll .erp-index-table > thead > tr > th > a,
body .app-page-content .erp-index-table > thead > tr > th > a,
body .app-page-scroll .erp-index-table > thead > tr > th > button,
body .app-page-content .erp-index-table > thead > tr > th > button,
body .app-page-scroll .pdc-ledger-table > thead > tr > th > a,
body .app-page-scroll .pdc-ledger-table > thead > tr > th > button,
body .app-page-scroll .doc-table > thead > tr > th > a,
body .app-page-scroll .doc-table > thead > tr > th > button {
    display: inline-flex;
    min-height: 0;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-transform: inherit;
    text-decoration: none;
    white-space: nowrap;
}

body .app-page-scroll .erp-index-table > thead > tr > th > a:hover,
body .app-page-content .erp-index-table > thead > tr > th > a:hover,
body .app-page-scroll .erp-index-table > thead > tr > th > a:focus,
body .app-page-content .erp-index-table > thead > tr > th > a:focus,
body .app-page-scroll .erp-index-table > thead > tr > th > button:hover,
body .app-page-content .erp-index-table > thead > tr > th > button:hover,
body .app-page-scroll .erp-index-table > thead > tr > th > button:focus,
body .app-page-content .erp-index-table > thead > tr > th > button:focus {
    color: #4338ca;
    outline: 0;
    text-decoration: none;
}

@media (max-width: 700px) {
    body .app-page-scroll .handover-table > thead {
        display: none !important;
    }
}


/* Canonical table-scroll contract: exactly one scroll owner per register. */
:root {
    --crm-scrollbar-size: 10px;
    --crm-scrollbar-track: #f1f5f9;
    --crm-scrollbar-thumb: #cbd5e1;
    --crm-scrollbar-thumb-hover: #94a3b8;
}

body .app-page-scroll .erp-index-table-scroll,
body .app-page-scroll .pdc-grid-scroll,
body .app-page-scroll .rera-grid-scroll,
body .app-page-scroll .handover-list__scroll,
body .app-page-scroll .doc-table-scroll,
body .app-page-scroll .pending-list-modal__table-wrap {
    min-width: 0 !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow-x: auto !important;
    overflow-y: scroll !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable !important;
    scrollbar-width: thin !important;
    scrollbar-color: var(--crm-scrollbar-thumb) var(--crm-scrollbar-track) !important;
    -webkit-overflow-scrolling: touch;
}

body .app-page-scroll .erp-index-table-scroll::-webkit-scrollbar,
body .app-page-scroll .pdc-grid-scroll::-webkit-scrollbar,
body .app-page-scroll .rera-grid-scroll::-webkit-scrollbar,
body .app-page-scroll .handover-list__scroll::-webkit-scrollbar,
body .app-page-scroll .doc-table-scroll::-webkit-scrollbar,
body .app-page-scroll .pending-list-modal__table-wrap::-webkit-scrollbar {
    width: var(--crm-scrollbar-size);
    height: var(--crm-scrollbar-size);
}

body .app-page-scroll .erp-index-table-scroll::-webkit-scrollbar-track,
body .app-page-scroll .pdc-grid-scroll::-webkit-scrollbar-track,
body .app-page-scroll .rera-grid-scroll::-webkit-scrollbar-track,
body .app-page-scroll .handover-list__scroll::-webkit-scrollbar-track,
body .app-page-scroll .doc-table-scroll::-webkit-scrollbar-track,
body .app-page-scroll .pending-list-modal__table-wrap::-webkit-scrollbar-track {
    background: var(--crm-scrollbar-track);
}

body .app-page-scroll .erp-index-table-scroll::-webkit-scrollbar-thumb,
body .app-page-scroll .pdc-grid-scroll::-webkit-scrollbar-thumb,
body .app-page-scroll .rera-grid-scroll::-webkit-scrollbar-thumb,
body .app-page-scroll .handover-list__scroll::-webkit-scrollbar-thumb,
body .app-page-scroll .doc-table-scroll::-webkit-scrollbar-thumb,
body .app-page-scroll .pending-list-modal__table-wrap::-webkit-scrollbar-thumb {
    min-height: 32px;
    border: 2px solid var(--crm-scrollbar-track);
    border-radius: 999px;
    background: var(--crm-scrollbar-thumb);
}

body .app-page-scroll .erp-index-table-scroll::-webkit-scrollbar-thumb:hover,
body .app-page-scroll .pdc-grid-scroll::-webkit-scrollbar-thumb:hover,
body .app-page-scroll .rera-grid-scroll::-webkit-scrollbar-thumb:hover,
body .app-page-scroll .handover-list__scroll::-webkit-scrollbar-thumb:hover,
body .app-page-scroll .doc-table-scroll::-webkit-scrollbar-thumb:hover,
body .app-page-scroll .pending-list-modal__table-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--crm-scrollbar-thumb-hover);
}

body .app-page-scroll .erp-index-table-scroll::-webkit-scrollbar-corner,
body .app-page-scroll .pdc-grid-scroll::-webkit-scrollbar-corner,
body .app-page-scroll .rera-grid-scroll::-webkit-scrollbar-corner,
body .app-page-scroll .handover-list__scroll::-webkit-scrollbar-corner,
body .app-page-scroll .doc-table-scroll::-webkit-scrollbar-corner,
body .app-page-scroll .pending-list-modal__table-wrap::-webkit-scrollbar-corner {
    background: var(--crm-scrollbar-track);
}

@media (max-width: 767px) {
    body .app-page-scroll .erp-index-table-scroll,
    body .app-page-scroll .pdc-grid-scroll,
    body .app-page-scroll .rera-grid-scroll,
    body .app-page-scroll .doc-table-scroll {
        overflow-y: auto !important;
        scrollbar-gutter: auto !important;
    }

    body .app-page-scroll .doc-table-scroll {
        overflow-x: hidden !important;
    }
}

@media (max-width: 700px) {
    body .app-page-scroll .handover-list__scroll {
        overflow: visible !important;
        scrollbar-gutter: auto !important;
    }
}

body .app-page-scroll .erp-index-table > thead,
body .app-page-content .erp-index-table > thead,
body .app-page-scroll .pdc-ledger-table > thead,
body .app-page-scroll .rera-table > thead,
body .app-page-scroll .handover-table > thead,
body .app-page-scroll .doc-table > thead,
body .app-page-scroll .pending-list-modal__table > thead {
    position: static !important;
}


/* Canonical page-top region: header only. Search/filter controls belong in
 * the adjacent list section so the divider remains the sole visual separator. */
body .app-page-scroll .saamarth-page-top {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: var(--erp-page-top) var(--erp-page-x) 0;
    overflow: visible;
    background: #ffffff;
    box-sizing: border-box;
}

/* Toolbar and table form one uninterrupted work section below the header.
 * The section adds no card gap; controls keep the canonical page inset. */
body .app-page-scroll .erp-index-list-section {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: var(--erp-page-gap) 0 0;
    overflow: hidden;
    background: #ffffff;
    box-sizing: border-box;
}
body .app-page-scroll .erp-index-list-section > .erp-index-toolbar,
body .app-page-scroll .saamarth-page-top + .erp-index-toolbar,
body .app-page-scroll .erp-index-top > .erp-index-toolbar {
    width: auto;
    min-height: 36px;
    margin: 0 var(--erp-page-x);
}

body .app-page-scroll .saamarth-page-top + .erp-index-toolbar {
    margin-top: var(--erp-page-gap);
}

body .app-page-scroll .saamarth-page-top + .erp-index-toolbar + .erp-index-table-shell,
body .app-page-scroll .saamarth-page-top + .erp-index-toolbar + .erp-index-list-section {
    margin-top: 0;
}
body .app-page-scroll .erp-index-list-section > .erp-index-table-shell {
    min-height: 0;
    flex: 1 1 auto;
}

/* Canonical toolbar; page-wise margins stay zero unless it is the direct
 * child of the shared list section above. */
.erp-index-toolbar {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 34px;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
}
.erp-index-toolbar__content {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}
.erp-index-toolbar .form-group {
    margin: 0;
}

@media (max-width: 767px) {
    body .app-page-scroll .saamarth-page-top {
        --erp-page-x: 8px;
        gap: 0;
        padding: 7px var(--erp-page-x) 0;
    }
    .erp-index-toolbar,
    .erp-index-toolbar__content {
        gap: 6px;
    }
}


/* Canonical page header + filter structure.
 * Module classes inside these regions are behavior hooks, not layout owners. */
body .app-page-scroll .saamarth-page-top > .saamarth-page-header {
    width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
}
body .app-page-scroll .saamarth-page-top > .saamarth-page-header {
    position: relative;
    border-bottom: 0;
}
body .app-page-scroll .saamarth-page-top > .saamarth-page-header::after {
    position: absolute;
    right: calc(-1 * var(--erp-page-x));
    bottom: 0;
    left: calc(-1 * var(--erp-page-x));
    height: 1px;
    background: var(--erp-page-line, #e2e8f0);
    content: "";
    pointer-events: none;
}
.erp-index-toolbar__form,
.erp-index-toolbar__content {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}
.erp-index-toolbar__group,
.erp-index-toolbar__actions {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.erp-index-toolbar__group--grow { flex: 1 1 auto; }
.erp-index-toolbar__group--end {
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-left: auto;
}
.erp-index-toolbar__actions {
    flex: 0 0 auto;
    flex-wrap: wrap;
}
.erp-index-toolbar__summary {
    color: #94a3b8;
    font-size: var(--crm-font-size-sm);
    font-weight: var(--crm-font-weight-medium);
}
.erp-index-search {
    position: relative;
    width: min(520px, 100%);
    min-width: 220px;
    margin: 0;
}

/* One search footprint across every canonical list toolbar. This selector owns
 * only toolbar spacing/width; table presentation remains module-owned. */
body .app-page-scroll .erp-index-list-section > .erp-index-toolbar .erp-index-search {
    width: min(520px, 100%);
    min-width: 220px;
    max-width: 520px;
    flex: 0 1 520px;
}
body .app-page-scroll .erp-index-list-section > .erp-index-toolbar > .erp-index-toolbar__content {
    min-height: 36px;
    column-gap: 8px;
}
.erp-index-search__icon {
    position: absolute;
    top: 50%;
    left: 11px;
    z-index: 2;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
body .app-page-scroll .erp-index-toolbar .erp-index-toolbar__action--end { margin-left: auto; }
@media (max-width: 767px) {
    body .app-page-scroll .erp-index-list-section > .erp-index-toolbar .erp-index-search {
        width: 100%;
        min-width: 0;
        max-width: none;
        flex-basis: 100%;
    }

    .erp-index-toolbar__form,
    .erp-index-toolbar__content,
    .erp-index-toolbar__group {
        flex-wrap: wrap;
        gap: 6px;
    }
    .erp-index-toolbar__group--grow,
    .erp-index-toolbar__group--end {
        width: 100%;
        flex: 1 1 100%;
    }
    .erp-index-toolbar__group--end {
        justify-content: flex-start;
        margin-left: 0;
    }
    .erp-index-search {
        width: 100%;
        min-width: 0;
    }
}

/* Project Settings: globally owned component styles.
 * The project view contains structure and behavior only; viewport, surface,
 * spacing and scroll ownership follow the canonical ERP shell. */
:root {
    --ps-primary: #4f46e5;
    --ps-primary-dark: #3730a3;
    --ps-primary-soft: #eef2ff;
    --ps-primary-border: #c7d2fe;
    --ps-text: #0f172a;
    --ps-muted: #64748b;
    --ps-border: #e2e8f0;
    --ps-surface: #ffffff;
    --ps-page: #f8fafc;
}

.project-settings-shell {
    height: calc(100vh - var(--app-header-height, 64px));
    min-height: 560px;
    background: linear-gradient(145deg, #f8fafc 0%, #f5f3ff 52%, #f8fafc 100%);
    color: var(--ps-text);
}

.project-settings-card {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--ps-border);
    border-radius: 22px;
    background: var(--ps-surface);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .08), 0 2px 8px rgba(79, 70, 229, .03);
}

.project-settings-sidebar {
    width: 276px;
    min-width: 276px;
    background: rgba(255, 255, 255, .96);
    border-right: 1px solid var(--ps-border);
    transition: width .25s ease, min-width .25s ease, transform .25s ease;
}

.project-settings-sidebar.is-collapsed {
    width: 82px;
    min-width: 82px;
}

.project-settings-sidebar.is-collapsed .sidebar-copy,
.project-settings-sidebar.is-collapsed .sidebar-project-meta,
.project-settings-sidebar.is-collapsed .sidebar-footer-copy,
.project-settings-sidebar.is-collapsed .sidebar-brand-copy {
    display: none;
}

.project-settings-sidebar.is-collapsed .sidebar-link {
    justify-content: center;
    padding-left: 12px;
    padding-right: 12px;
}

.project-settings-sidebar.is-collapsed .sidebar-link-icon {
    margin: 0;
}

.project-settings-sidebar .sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 14px;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    transition: .2s ease;
}

.project-settings-sidebar .sidebar-link:hover {
    color: var(--ps-primary-dark);
    background: #f8fafc;
    transform: translateX(2px);
}

.project-settings-sidebar .sidebar-link.active {
    color: var(--ps-primary-dark);
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    box-shadow: inset 0 0 0 1px var(--ps-primary-border);
}

.project-settings-sidebar .sidebar-link.active::before {
    content: "";
    position: absolute;
    left: -3px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 999px;
    background: var(--ps-primary);
}

.project-settings-sidebar .sidebar-link-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #f1f5f9;
    color: #64748b;
    transition: .2s ease;
}

.project-settings-sidebar .sidebar-link.active .sidebar-link-icon {
    background: #fff;
    color: var(--ps-primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, .14);
}

.project-settings-main {
    min-width: 0;
    min-height: 0;
}

.project-settings-header {
    box-shadow: 0 1px 0 rgba(148, 163, 184, .18);
}

.project-settings-scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.project-settings-scroll::-webkit-scrollbar {
    width: 8px;
}

.project-settings-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.page-section {
    width: 100%;
    height: 100%;
    animation: sectionFade .22s ease;
}

.project-settings-scroll > .page-section:not(.ps-hidden) {
    display: flex;
    flex-direction: column;
}

@keyframes sectionFade {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-settings-overlay {
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(3px);
}

@media (max-width: 767px) {
    .project-settings-shell {
        height: calc(100vh - 72px);
        min-height: 520px;
        padding: 0!important;
    }

    .project-settings-card {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }

    .project-settings-scroll {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }

    .project-settings-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 70;
        width: min(86vw, 312px);
        min-width: min(86vw, 312px);
        transform: translateX(-105%);
        box-shadow: 24px 0 60px rgba(15, 23, 42, .18);
    }

    .project-settings-sidebar.is-open {
        transform: translateX(0);
    }

    .project-settings-sidebar.is-collapsed {
        width: min(86vw, 312px);
        min-width: min(86vw, 312px);
    }

    .project-settings-sidebar.is-collapsed .sidebar-copy,
    .project-settings-sidebar.is-collapsed .sidebar-project-meta,
    .project-settings-sidebar.is-collapsed .sidebar-footer-copy,
    .project-settings-sidebar.is-collapsed .sidebar-brand-copy {
        display: block;
    }

    .project-settings-sidebar.is-collapsed .sidebar-link {
        justify-content: flex-start;
    }
}

.ps-shell-pad{width:100%;padding:12px}.ps-row{display:flex}.ps-col{display:flex;flex-direction:column}.ps-grow{flex:1 1 auto;min-width:0}.ps-center{display:flex;align-items:center}.ps-between{display:flex;align-items:center;justify-content:space-between}.ps-gap-1{gap:6px}.ps-gap-2{gap:8px}.ps-gap-3{gap:12px}.ps-pad-3{padding:12px}.ps-pad-x4{padding:0 16px}.ps-hidden{display:none!important}.ps-icon{display:grid;place-items:center;flex:0 0 auto}.ps-icon-lg{width:40px;height:40px;border-radius:13px;background:#eef2ff;color:#4f46e5}.ps-icon-sm{width:36px;height:36px;border:1px solid #e2e8f0;border-radius:11px;background:#fff;color:#64748b}.ps-title{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#0f172a;font-size:14px;font-weight:700}.ps-muted{margin:2px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#64748b;font-size:11px}.ps-subtle{color:#94a3b8}.ps-project-card{padding:14px;border:1px solid #dbeafe;border-radius:15px;background:linear-gradient(135deg,#eef2ff,#f5f3ff)}.ps-chip{display:inline-flex;align-items:center;border-radius:999px;background:#fff;color:#4f46e5;padding:3px 8px;font-size:11px;font-weight:600;box-shadow:0 1px 3px rgba(15,23,42,.08)}.ps-nav-caption{padding:8px 12px;color:#94a3b8;font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase}.ps-sidebar-nav{flex:1 1 auto;overflow-y:auto;padding:12px}.ps-sidebar-footer{border-top:1px solid #e2e8f0;background:#f8fafc;padding:12px}.ps-topbar{display:flex;min-height:64px;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #e2e8f0;background:rgba(255,255,255,.96);padding:0 16px}.ps-action{display:inline-flex;min-height:36px;align-items:center;justify-content:center;gap:8px;border:1px solid #dbe3ef;border-radius:10px;background:#fff;color:#475569;padding:0 12px;font-size:12px;font-weight:600;text-decoration:none;transition:.16s ease}.ps-action:hover{border-color:#bfc7ff;background:#f8f9ff;color:#4338ca;text-decoration:none}.ps-mobile-only{display:none}.ps-scroll{flex:1 1 auto;overflow:auto;padding:16px}.ps-empty{display:grid;min-height:420px;place-items:center}.ps-empty-card{width:min(100%,420px);border:1px solid #e2e8f0;border-radius:18px;background:#fff;padding:28px;text-align:center;box-shadow:0 4px 13px rgba(15,23,42,.04)}.ps-empty-icon{display:grid;place-items:center;width:54px;height:54px;margin:0 auto;border-radius:16px;background:#eef2ff;color:#4f46e5;font-size:20px}.ps-empty-icon.warning{background:#fffbeb;color:#d97706}.ps-empty-card h2{margin:14px 0 0;color:#0f172a;font-size:15px;font-weight:700}.ps-empty-card p{margin:8px 0 0;color:#64748b;font-size:13px;line-height:1.55}.ps-readonly{display:flex;align-items:center;gap:8px;margin-bottom:12px;border:1px solid #fde68a;border-radius:11px;background:#fffbeb;color:#92400e;padding:10px 12px;font-size:12px}.ps-overlay{position:fixed;inset:0;z-index:60;display:none;background:rgba(15,23,42,.35)}.ps-overlay.is-open{display:block}body.project-nav-open{overflow:hidden}
@media(max-width:767px){.ps-shell-pad{padding:0}.ps-mobile-only{display:inline-flex}.ps-desktop-only{display:none!important}.ps-scroll{padding:10px}.ps-topbar{padding:0 12px}.ps-topbar .ps-action span{display:none}.ps-sidebar-nav{padding:10px}}

/* Compact, low-height project settings navigation. */
.project-settings-sidebar{width:238px;min-width:238px;background:#fff}
.project-settings-sidebar.is-collapsed{width:58px;min-width:58px}
.project-settings-sidebar.is-collapsed .sidebar-link{padding-left:8px;padding-right:8px}
.project-settings-sidebar .sidebar-link{gap:9px;min-height:38px;padding:7px 8px;border-radius:6px;font-size:13px}
.project-settings-sidebar .sidebar-link:hover{background:#f1f5f9;transform:none}
.project-settings-sidebar .sidebar-link.active{background:#f4f6ff;box-shadow:none;font-weight:700}
.project-settings-sidebar .sidebar-link.active::before{left:0;top:7px;bottom:7px}
.project-settings-sidebar .sidebar-link-icon{width:22px;height:22px;flex-basis:22px;border-radius:0;background:transparent}
.project-settings-sidebar .sidebar-link.active .sidebar-link-icon{background:transparent;box-shadow:none}
.ps-sidebar-nav{padding:7px 8px}
.ps-nav-caption{padding:7px 8px 4px;font-size:9px;letter-spacing:.08em}
.ps-sidebar-footer{padding:8px;background:#fff}
.ps-project-card{padding:8px 10px;border:0;border-radius:0;background:#f8fafc}
.project-settings-sidebar{border-right-color:#cfd8e3}
.project-settings-header .ps-topbar,.ps-topbar{min-height:54px}
.project-settings-header .ps-icon-lg{width:32px;height:32px;border-radius:9px}
.sidebar-header-toggle{width:30px;min-width:30px;min-height:30px;padding:0;border-radius:7px}
.project-settings-scroll>.page-section:not(.ps-hidden)>*{width:100%}
/* Proper desktop icon rail when the settings sidebar is collapsed. */
@media(min-width:768px){
.project-settings-sidebar.is-collapsed{position:relative;z-index:12;width:56px;min-width:56px;overflow:visible}
.project-settings-sidebar.is-collapsed>div:first-child{justify-content:center;padding:0!important}
.project-settings-sidebar.is-collapsed>div:first-child>.ps-grow{display:none}
.project-settings-sidebar.is-collapsed .sidebar-brand-icon{display:none}
.project-settings-sidebar.is-collapsed .sidebar-header-toggle{width:32px;min-width:32px;height:32px}
.project-settings-sidebar.is-collapsed .ps-sidebar-nav{padding:8px 0;overflow:visible}
.project-settings-sidebar.is-collapsed .sidebar-link{width:38px;height:38px;min-height:38px;margin:3px auto;padding:0;justify-content:center;border-radius:9px}
.project-settings-sidebar.is-collapsed .sidebar-link::before{display:none}
.project-settings-sidebar.is-collapsed .sidebar-link::after{content:attr(data-label);position:absolute;left:calc(100% + 10px);top:50%;z-index:100;display:block;max-width:220px;transform:translateY(-50%) translateX(-4px);border:1px solid #dbe3ef;border-radius:7px;background:#fff;color:#334155;padding:6px 9px;box-shadow:0 6px 16px rgba(15,23,42,.14);font-size:11px;font-weight:700;line-height:1.2;white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .14s ease,transform .14s ease,visibility .14s ease}
.project-settings-sidebar.is-collapsed .sidebar-link:hover::after,.project-settings-sidebar.is-collapsed .sidebar-link:focus-visible::after{opacity:1;visibility:visible;transform:translateY(-50%) translateX(0)}
.project-settings-sidebar.is-collapsed .sidebar-link-icon{width:38px;height:38px;flex:0 0 38px;border-radius:9px}
.project-settings-sidebar.is-collapsed .sidebar-link:hover{background:#f1f5f9}
.project-settings-sidebar.is-collapsed .sidebar-link.active{background:#eef2ff;box-shadow:inset 0 0 0 1px #c7d2fe}
.project-settings-sidebar.is-collapsed .sidebar-link.active .sidebar-link-icon{color:#4f46e5}
}

body .app-page-scroll .project-settings-shell {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
}
body .app-page-scroll .project-settings-card {
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
}
body .app-page-scroll .project-settings-main {
    min-width: 0;
    min-height: 0;
    background: #ffffff;
}
body .app-page-scroll .project-settings-scroll {
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    background: #ffffff;
}
@media (max-width: 767px) {
    body .app-page-scroll .project-settings-shell,
    body .app-page-scroll .project-settings-card {
        height: 100%;
        min-height: 0;
    }
}
