/*
 * ERP-specific overrides on top of Modernize theme (public/assets/css/).
 * Theme provides Bootstrap 5, sidebar, typography and base components.
 */

/* Kolossus brand (https://www.kolossus.tech) */
:root {
    --kolossus-blue-deep: #14264d;
    --kolossus-blue: #244895;
    --kolossus-teal: #1c9ab2;
    --erp-surface-muted: #f2f2f7;
    --erp-font-numeric: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --bs-font-monospace: var(--erp-font-numeric);
}

/* Numeric entry and display (forms, capture, tables, totals) */
.font-numeric,
input[type="number"],
input.form-control.text-end,
textarea.form-control.text-end,
.po-inline-input,
.po-subtotal-preview,
.po-line-editable,
[data-field="quantity"],
[data-field="price"],
[data-field="subtotal"],
table td.text-end.font-numeric,
table th.text-end.font-numeric,
table td.font-numeric,
table th.font-numeric {
    font-family: var(--erp-font-numeric) !important;
    font-variant-numeric: tabular-nums;
}

/* Compact form fields — ERP default (form theme adds form-control-sm) */
.form-control.form-control-sm,
textarea.form-control.form-control-sm {
    min-height: calc(1.5em + 0.5rem + calc(var(--bs-border-width) * 2));
    padding: 0.25rem 0.5rem;
    font-size: 0.765625rem;
}

.form-select.form-select-sm {
    min-height: calc(1.5em + 0.5rem + calc(var(--bs-border-width) * 2));
    padding: 0.25rem 2.25rem 0.25rem 0.5rem;
    font-size: 0.765625rem;
}

/* Auth pages — same muted surface as AI assistant (login, password reset) */
#main-wrapper.auth-customizer-none .radial-gradient {
    background: var(--erp-surface-muted) !important;
}

#main-wrapper.auth-customizer-none .radial-gradient::before {
    opacity: 0 !important;
    animation: none !important;
}

#main-wrapper.auth-customizer-none .logo-img .light-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Desktop content shell — flat, full-width, white background */
.erp-command-palette-layout .page-wrapper,
.erp-command-palette-layout .body-wrapper.erp-desktop-content {
    background: #fff;
}

.erp-command-palette-layout .body-wrapper.erp-desktop-content > .container-fluid {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

.erp-command-palette-layout .body-wrapper.erp-desktop-content .card {
    box-shadow: none;
    border: 0;
    border-radius: 0;
    --bs-card-box-shadow: none;
    background: transparent;
}

/* AJAX lists — flat full-width layout */
.ajax-list-page__toolbar {
    background: #fff;
}

.ajax-list-toolbar__filter-actions {
    padding-top: 0;
}

.btn.ajax-list-toolbar__new-btn {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d8dee9;
    background: #fff;
    color: #475569;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: none;
}

.btn.ajax-list-toolbar__new-btn:hover,
.btn.ajax-list-toolbar__new-btn:focus {
    background: #f8fafc;
    border-color: #c5ced9;
    color: #334155;
}

.btn.ajax-list-toolbar__new-btn:focus-visible {
    outline: 2px solid rgba(93, 135, 255, 0.45);
    outline-offset: 2px;
    box-shadow: none;
}

.ajax-list-page__body .ajax-list-paginator {
    margin-bottom: 0;
    padding: 0 0 0.75rem;
    border-bottom: 1px solid var(--bs-border-color, #ebf1f6);
}

.ajax-list-page__body .ajax-list-table {
    margin-bottom: 0;
    margin-top: 0.75rem;
}

#tbl_filters td {
    padding: 2px 5px;
    vertical-align: middle;
}

#tbl_filters .form-control-sm {
    min-width: 130px;
}

#tbl_filters .link {
    cursor: pointer;
    line-height: 0;
}

#tbl_filters .autocomplete-field {
    min-width: 180px;
}

#tbl_filters .po-autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 2px;
    display: none;
}

#tbl_filters .po-autocomplete-list.open.show {
    display: block;
}

.ajax-list-paginator {
    text-align: left;
    margin-bottom: 0.5rem;
}

.ajax-list-paginator__segment {
    display: inline-block;
    min-height: 15px;
    padding: 5px;
    white-space: nowrap;
    border-right: 1px solid #cdcdcd;
    vertical-align: middle;
}

.ajax-list-paginator__nav {
    border-right: 0;
}

.ajax-list-paginator__export {
    display: inline-block;
    min-height: 15px;
    padding: 0 0 5px 5px;
    vertical-align: middle;
}

.ajax-list-paginator__export-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    line-height: 1;
    cursor: pointer;
}

.ajax-list-paginator__export-link .ti {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 1;
}

.ajax-list-paginator select {
    border: 0;
    background: transparent;
}

.ajax-list-table thead th {
    font-weight: 600;
}

.ajax-list-table > tbody > tr:hover > * {
    --bs-table-color-state: var(--bs-table-hover-color);
    --bs-table-bg-state: var(--bs-table-hover-bg);
    color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));
    background-color: var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-bg)));
}

/* Row action icons (edit / view) — gray, never outline-primary blue */
.ajax-list-table .ajax-list-row-action {
    color: #8a97a8;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0.2rem 0.4rem;
    line-height: 1;
}

.ajax-list-table .ajax-list-row-action:hover,
.ajax-list-table .ajax-list-row-action:focus {
    color: #5a6a7e;
    background: var(--bs-light, #f6f9fc);
}

.ajax-list-table .ajax-list-row-action .ti {
    font-size: 1.05rem;
}

/* Tabbed entity forms (shared section layout) */
.entity-form-tabs .form-tab-header,
.card > .form-tab-header,
.form-tab-header {
    border-bottom: 1px solid var(--bs-border-color, #ebf1f6);
    min-height: 3.5rem;
}

.entity-form-tabs .form-tab-header .user-profile-tab,
.card > .form-tab-header .user-profile-tab,
.form-tab-header .user-profile-tab {
    border-bottom: 0;
    min-width: 0;
}

.entity-form-tabs .form-tab-back,
.card > .form-tab-header .form-tab-back,
.form-tab-header .form-tab-back {
    order: -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 1px solid #dfe5ef;
    border-radius: 8px;
    background: #fff;
    color: #5a6a85;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.entity-form-tabs .form-tab-back .ti,
.card > .form-tab-header .form-tab-back .ti,
.form-tab-header .form-tab-back .ti {
    font-size: 1rem;
    line-height: 1;
}

.entity-form-tabs .form-tab-back:hover,
.entity-form-tabs .form-tab-back:focus,
.card > .form-tab-header .form-tab-back:hover,
.card > .form-tab-header .form-tab-back:focus,
.form-tab-header .form-tab-back:hover,
.form-tab-header .form-tab-back:focus {
    background: #f8fafc;
    border-color: #c5ced9;
    color: #334155;
}

.entity-form-tabs .form-tab-back:focus-visible,
.card > .form-tab-header .form-tab-back:focus-visible,
.form-tab-header .form-tab-back:focus-visible {
    outline: 2px solid rgba(93, 135, 255, 0.45);
    outline-offset: 2px;
}

.entity-form-tabs .form-tab-header > .form-tab-back::after,
.card > .form-tab-header > .form-tab-back::after,
.form-tab-header > .form-tab-back::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 1.25rem;
    right: -1rem;
    width: 1px;
    background: #e5eaf2;
}

.entity-form-tabs .form-tab-header > .form-tab-back,
.card > .form-tab-header > .form-tab-back,
.form-tab-header > .form-tab-back {
    position: relative;
    margin: 0 1.25rem 0 1rem;
}

.form-tab-header__back,
.form-tab-header__back + .form-tab-header__divider {
    display: none !important;
}

.form-tab-header__back .form-tab-back {
    order: unset;
}

.form-tab-header__divider {
    width: 1px;
    align-self: center;
    height: 1.25rem;
    margin: 0;
    background: #e5eaf2;
    flex-shrink: 0;
    order: -1;
}

.form-tab-header__divider + .user-profile-tab {
    margin-left: 0.25rem;
}

.form-tab-header__bulk-warehouse,
.form-tab-header__bulk-apply {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.po-bulk-warehouse-panel {
    width: min(22rem, 92vw);
}

.form-tab-header__delete {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.form-tab-header__delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
    background: #fff5f5;
    color: #c45c5c;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.form-tab-header__delete-btn .ti {
    font-size: 1rem;
    line-height: 1;
}

.form-tab-header__delete-btn:hover,
.form-tab-header__delete-btn:focus {
    background: #fee2e2;
    border-color: #f0a8b0;
    color: #b91c1c;
}

.form-tab-header__delete-btn:focus-visible {
    outline: 2px solid rgba(250, 137, 107, 0.45);
    outline-offset: 2px;
}

.form-tab-header__doc-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.form-tab-header__doc-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #e5eaf2;
    border-radius: 8px;
    background: #fff;
    color: #5a6a7e;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.form-tab-header__doc-action-btn .ti {
    font-size: 1rem;
    line-height: 1;
}

.form-tab-header__doc-action-btn:hover,
.form-tab-header__doc-action-btn:focus {
    background: #f8fafc;
    border-color: #d5dde8;
    color: #3d4f66;
}

.form-tab-header__doc-action-btn:focus-visible {
    outline: 2px solid rgba(93, 106, 126, 0.35);
    outline-offset: 2px;
}

.form-tab-header__doc-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.form-tab-header__doc-action-btn--danger {
    border-color: #f5c2c7;
    background: #fff5f5;
    color: #c45c5c;
}

.form-tab-header__doc-action-btn--danger:hover,
.form-tab-header__doc-action-btn--danger:focus {
    background: #fee2e2;
    border-color: #f0a8b0;
    color: #b91c1c;
}

.document-actions-dropdown__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 32px;
    padding: 0 0.75rem;
    border: 1px solid #e5eaf2;
    border-radius: 8px;
    background: #fff;
    color: #3d4f66;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    box-shadow: none;
}

.document-actions-dropdown__toggle:hover,
.document-actions-dropdown__toggle:focus,
.document-actions-dropdown__toggle.show {
    background: #f0f6ff;
    border-color: #c7daf5;
    color: #2f5f9e;
}

.document-actions-dropdown__toggle:focus-visible {
    outline: 2px solid rgba(93, 106, 126, 0.35);
    outline-offset: 2px;
}

.document-actions-dropdown__menu {
    min-width: 15rem;
    padding: 0.35rem;
    border: 1px solid #e5eaf2;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    z-index: 1080;
}

.document-actions-dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.25;
}

.document-actions-dropdown__item .ti {
    font-size: 1rem;
    line-height: 1;
    color: #5a6a7e;
}

.document-actions-dropdown__item:hover,
.document-actions-dropdown__item:focus {
    background: #f4f8ff;
    color: #2f5f9e;
}

.document-actions-dropdown__item--danger,
.document-actions-dropdown__item--danger .ti {
    color: #c45c5c;
}

.document-actions-dropdown__item--danger:hover,
.document-actions-dropdown__item--danger:focus {
    background: #fff5f5;
    color: #b91c1c;
}

.document-actions-dropdown__post-item {
    width: 100%;
}

.form-tab-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
    padding-right: 0.75rem;
}

.form-tab-header__save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 32px;
    padding: 0.375rem 0.875rem;
    border: 1px solid #e5eaf2;
    border-radius: 8px;
    background: #fff;
    color: #3d4f66;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.form-tab-header__save-btn .ti {
    font-size: 1.375rem;
    line-height: 1;
}

.form-tab-header__save-label {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
}

.form-tab-header__save-btn:hover,
.form-tab-header__save-btn:focus {
    background: #f8fafc;
    border-color: #d0d9e6;
    color: #3d4f66;
}

.form-tab-header__save-btn:focus-visible {
    outline: 2px solid rgba(93, 135, 255, 0.35);
    outline-offset: 2px;
}

.form-tab-header > .user-profile-tab {
    flex: 1 1 auto;
}

.password-visibility-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.375rem;
}

.entity-form-tabs .user-profile-tab .nav-link.active,
.card > .form-tab-header .user-profile-tab .nav-link.active,
.form-tab-header .user-profile-tab .nav-link.active,
.partner-form-tabs .user-profile-tab .nav-link.active {
    color: var(--bs-primary);
    background: transparent;
    border-bottom: 3px solid var(--bs-primary) !important;
    margin-bottom: -1px;
}

.form-section.border-bottom {
    border-color: var(--bs-border-color, #ebf1f6) !important;
}

.form-section {
    margin-bottom: 0;
}

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.form-section-subtitle {
    font-size: 0.875rem;
}

/* Numbering series — compact inputs inside standard 2-column grid */
.numbering-series-form-tabs .numbering-series-field--xs .form-control,
.numbering-series-form-tabs .numbering-series-field--xs .form-select {
    max-width: 5rem;
}

.numbering-series-form-tabs .numbering-series-field--sm .form-control,
.numbering-series-form-tabs .numbering-series-field--sm .form-select {
    max-width: 8rem;
}

.numbering-series-form-tabs .numbering-series-field--md .form-control,
.numbering-series-form-tabs .numbering-series-field--md .form-select {
    max-width: 14rem;
}

.numbering-series-form-tabs .numbering-series-field--lg .form-control,
.numbering-series-form-tabs .numbering-series-field--lg .form-select {
    max-width: 28rem;
}

/* Legacy module-specific aliases (prefer entity-form-tabs on new forms) */
.partner-form-tabs .form-tab-header,
.contact-person-form-tabs .form-tab-header,
.partner-address-form-tabs .form-tab-header,
.item-form-tabs .form-tab-header,
.item-group-form-tabs .form-tab-header,
.uom-group-form-tabs .form-tab-header,
.company-settings-form-tabs .form-tab-header,
.distribution-rule-form-tabs .form-tab-header,
.approval-template-form-tabs .form-tab-header {
    border-bottom: 1px solid var(--bs-border-color, #ebf1f6);
}

.partner-form-tabs .form-tab-header .user-profile-tab,
.contact-person-form-tabs .form-tab-header .user-profile-tab,
.partner-address-form-tabs .form-tab-header .user-profile-tab,
.item-form-tabs .form-tab-header .user-profile-tab,
.item-group-form-tabs .form-tab-header .user-profile-tab,
.uom-group-form-tabs .form-tab-header .user-profile-tab,
.company-settings-form-tabs .form-tab-header .user-profile-tab,
.distribution-rule-form-tabs .form-tab-header .user-profile-tab,
.approval-template-form-tabs .form-tab-header .user-profile-tab {
    border-bottom: 0;
}

.partner-form-tabs .user-profile-tab .nav-link.active,
.contact-person-form-tabs .user-profile-tab .nav-link.active,
.partner-address-form-tabs .user-profile-tab .nav-link.active,
.item-form-tabs .user-profile-tab .nav-link.active,
.item-group-form-tabs .user-profile-tab .nav-link.active,
.uom-group-form-tabs .user-profile-tab .nav-link.active,
.company-settings-form-tabs .user-profile-tab .nav-link.active,
.distribution-rule-form-tabs .user-profile-tab .nav-link.active,
.approval-template-form-tabs .user-profile-tab .nav-link.active {
    color: var(--bs-primary);
    background: transparent;
}

.approval-scope-checklist__items {
    max-height: 22rem;
    overflow-y: auto;
    background: var(--bs-body-bg, #fff);
}

.approval-scope-checklist__items .form-check {
    margin-bottom: 0.35rem;
}

.approval-scope-checklist__items .form-check:last-child {
    margin-bottom: 0;
}

.approval-scope-checklist__items .form-check-label {
    cursor: pointer;
    user-select: none;
}

.partner-form-tabs .collection-item {
    border: 1px solid var(--bs-border-color, #ebf1f6);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    background: var(--bs-body-bg, #fff);
}

.partner-form-tabs .properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem 1rem;
}

.partner-form-tabs .properties-grid .mb-3 {
    margin-bottom: 0.5rem !important;
}

/* Permission tree (authorization profiles) */
.permission-tree,
.permission-tree-readonly {
    border: 1px solid var(--bs-border-color, #ebf1f6);
    border-radius: 0.5rem;
    padding: 1rem;
    background: var(--bs-body-bg, #fff);
}

.permission-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.05));
}

.permission-row:last-child {
    border-bottom: none;
}

.permission-label {
    flex: 1 1 200px;
    font-weight: 500;
}

.permission-desc {
    flex: 1 1 100%;
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    margin-left: 0;
}

.permission-select {
    flex: 0 0 auto;
    min-width: 140px;
}

.permission-level-none { color: var(--bs-danger); }
.permission-level-readonly { color: var(--bs-warning); }
.permission-level-full { color: var(--bs-success); }

/* Business partner mega-form */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem 1rem;
}

.collection-item {
    border: 1px solid var(--bs-border-color, #ebf1f6);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bs-light, #f8f9fa);
}

/* Detail pages */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.detail-list dt {
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.detail-list dd {
    margin-bottom: 0.75rem;
}

/* Legacy action bar helper (maps to theme buttons) */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.inline-form {
    display: inline;
}

.sidebar-search .form-control:focus {
    box-shadow: none;
}

.sidebar-search .input-group:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
    border-radius: var(--bs-border-radius-sm);
}

#sidebarnav.sidebar-nav--searching > .sidebar-item.selected > ul.first-level.in,
#sidebarnav.sidebar-nav--searching .sidebar-subgroup.selected > ul.second-level.in {
    max-height: none;
}

#sidebarnav .sidebar-item.sidebar-search-hidden {
    display: none !important;
}

/* Collapsible sidebar sections */
#sidebarnav > .sidebar-item > ul.collapse.first-level,
#sidebarnav ul.collapse.second-level {
    display: block !important;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    transition:
        max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.28s ease,
        visibility 0.42s,
        padding 0.35s ease;
}

#sidebarnav > .sidebar-item > ul.collapse.first-level.in {
    max-height: 720px;
    opacity: 1;
    visibility: visible;
    padding-top: 0.05rem;
    padding-bottom: 0.15rem;
}

#sidebarnav ul.collapse.second-level.in {
    max-height: 320px;
    opacity: 1;
    visibility: visible;
    padding-top: 0.05rem;
    padding-bottom: 0.1rem;
}

#sidebarnav.sidebar-nav--interactive > .sidebar-item > ul.collapse.first-level.in > .sidebar-item,
#sidebarnav.sidebar-nav--interactive ul.collapse.second-level.in > .sidebar-item {
    animation: sidebarMenuItemIn 0.34s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

#sidebarnav.sidebar-nav--interactive > .sidebar-item > ul.collapse.first-level.in > .sidebar-item:nth-child(1),
#sidebarnav.sidebar-nav--interactive ul.collapse.second-level.in > .sidebar-item:nth-child(1) { animation-delay: 0.04s; }
#sidebarnav.sidebar-nav--interactive > .sidebar-item > ul.collapse.first-level.in > .sidebar-item:nth-child(2),
#sidebarnav.sidebar-nav--interactive ul.collapse.second-level.in > .sidebar-item:nth-child(2) { animation-delay: 0.07s; }
#sidebarnav.sidebar-nav--interactive > .sidebar-item > ul.collapse.first-level.in > .sidebar-item:nth-child(3),
#sidebarnav.sidebar-nav--interactive ul.collapse.second-level.in > .sidebar-item:nth-child(3) { animation-delay: 0.10s; }
#sidebarnav.sidebar-nav--interactive > .sidebar-item > ul.collapse.first-level.in > .sidebar-item:nth-child(4),
#sidebarnav.sidebar-nav--interactive ul.collapse.second-level.in > .sidebar-item:nth-child(4) { animation-delay: 0.13s; }
#sidebarnav.sidebar-nav--interactive > .sidebar-item > ul.collapse.first-level.in > .sidebar-item:nth-child(5),
#sidebarnav.sidebar-nav--interactive ul.collapse.second-level.in > .sidebar-item:nth-child(5) { animation-delay: 0.16s; }

#sidebarnav .first-level,
#sidebarnav .second-level {
    padding: 4px 8px;
}

.sidebar-nav ul .sidebar-item .first-level .sidebar-item > .sidebar-link,
.sidebar-nav ul .sidebar-item .second-level .sidebar-item > .sidebar-link {
    padding: 4px 10px;
    line-height: 1.25;
    gap: 12px;
    font-size: 13px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.sidebar-nav ul .sidebar-item .first-level .sidebar-item,
.sidebar-nav ul .sidebar-item .second-level .sidebar-item {
    margin-bottom: 0;
}

.sidebar-nav ul .sidebar-item .first-level .sidebar-item:last-child,
.sidebar-nav ul .sidebar-item .second-level .sidebar-item:last-child {
    margin-bottom: 0.25rem;
}

.sidebar-nav ul .sidebar-subgroup > .sidebar-link--subgroup {
    padding: 5px 10px 5px 0.85rem;
    line-height: 1.25;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--bs-secondary-color);
}

.sidebar-nav ul .sidebar-subgroup > .sidebar-link--subgroup .ti {
    font-size: 15px;
    opacity: 0.9;
}

.sidebar-nav ul .sidebar-subgroup.selected > .sidebar-link--subgroup {
    color: var(--bs-primary);
}

.sidebar-nav ul .sidebar-item--nested > .sidebar-link {
    padding: 3px 10px 3px 1.65rem;
    line-height: 1.25;
    font-size: 12px;
}

.sidebar-nav ul .sidebar-item .first-level .sidebar-item > .sidebar-link .ti,
.sidebar-nav ul .sidebar-item .second-level .sidebar-item > .sidebar-link .ti {
    font-size: 16px;
    opacity: 0.85;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.sidebar-nav ul .sidebar-item--nested > .sidebar-link .ti {
    font-size: 14px;
}

#sidebarnav.sidebar-nav--interactive > .sidebar-item > ul.collapse.first-level.in > .sidebar-item > .sidebar-link .ti,
#sidebarnav.sidebar-nav--interactive ul.collapse.second-level.in > .sidebar-item > .sidebar-link .ti {
    transform: scale(1);
}

.sidebar-nav ul .sidebar-subgroup .has-arrow::after {
    top: 14px;
    right: 12px;
    width: 6px;
    height: 6px;
}

@keyframes sidebarMenuItemIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar-nav ul .sidebar-item > a.has-arrow {
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav .has-arrow::after {
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, top 0.32s ease;
}

@media (prefers-reduced-motion: reduce) {
    #sidebarnav > .sidebar-item > ul.collapse.first-level,
    #sidebarnav ul.collapse.second-level,
    #sidebarnav > .sidebar-item > ul.collapse.first-level.in > .sidebar-item,
    #sidebarnav ul.collapse.second-level.in > .sidebar-item,
    .sidebar-nav .has-arrow::after {
        transition: none !important;
        animation: none !important;
    }
}

/* Tab-style fieldsets in partner form */
.partner-form fieldset {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--bs-border-color, #ebf1f6);
    border-radius: 0.5rem;
}

.partner-form fieldset legend {
    font-size: 1rem;
    font-weight: 600;
    padding: 0 0.5rem;
    width: auto;
    float: none;
}

/* Purchase order capture — fit viewport; only lines table scrolls */
.body-wrapper:has(.po-capture-page:not(.gr-show-page):not(.ap-show-page)) {
    overflow: hidden;
}

.body-wrapper:has(.po-capture-page:not(.gr-show-page):not(.ap-show-page)) > .container-fluid {
    display: flex;
    flex-direction: column;
    height: calc(100svh - var(--erp-chrome-height) - 1rem);
    max-height: calc(100svh - var(--erp-chrome-height) - 1rem);
    min-height: 0;
    padding-bottom: 1rem;
    box-sizing: border-box;
}

.body-wrapper:has(.po-capture-page.gr-show-page) > .container-fluid,
.body-wrapper:has(.po-capture-page.ap-show-page) > .container-fluid {
    display: flex;
    flex-direction: column;
    height: calc(100svh - var(--erp-chrome-height) - 1rem);
    max-height: calc(100svh - var(--erp-chrome-height) - 1rem);
    min-height: 0;
    padding-bottom: 1rem;
    box-sizing: border-box;
}

.po-capture-page {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.po-capture-page > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.po-capture-page > .po-capture-card,
.po-capture-page > form > .po-capture-card {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0;
    overflow: hidden;
}

.po-capture-page .form-tab-header {
    flex: 0 0 auto;
    background: #fff;
}

.po-capture-page #po-header,
.po-capture-page #ovpm-header,
.po-capture-page #inv-reval-header,
.po-capture-page #gr-header,
.po-capture-page #landed-cost-header,
.po-capture-page #ap-header,
.po-capture-page #ap-from-po-header,
.po-capture-page #ap-cm-from-invoice-header,
.po-capture-page .po-capture-header,
.po-capture-page .document-show-header,
.po-capture-page [id^="po-tab-"][id$="-panel"] {
    flex: 0 0 auto;
}

.po-capture-page .po-capture-tab-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.po-capture-page .po-capture-tab-content > .tab-pane {
    display: none;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.po-capture-page .po-capture-tab-content > .tab-pane.active {
    display: flex;
    opacity: 1;
}

.po-capture-page .po-capture-main--scroll {
    overflow-y: auto;
}

.po-capture-page .po-capture-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.po-capture-page .po-capture-layout {
    display: flex;
    flex: 1 1 auto;
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
}

.po-capture-page .po-capture-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-self: stretch;
    min-width: 0;
    min-height: 0;
    border-right: 1px solid var(--bs-border-color);
}

.po-capture-page .po-capture-sidebar {
    display: flex;
    flex: 0 0 clamp(240px, 25%, 320px);
    flex-direction: column;
    align-self: stretch;
    min-height: 0;
}

.po-capture-page .po-capture-row {
    flex-shrink: 0;
    background-color: var(--bs-body-bg);
}

.po-capture-page .po-capture-row__toolbar {
    margin-bottom: 0;
}

.po-capture-line-form-hint {
    opacity: 0;
    transform: translateX(0.35rem);
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0.28s;
}

.po-capture-line-form-hint--visible {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition:
        opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1) 0.1s,
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1) 0.1s,
        visibility 0s;
}

.po-capture-line-form-panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transform: translateY(-0.4rem);
    pointer-events: none;
    transition:
        grid-template-rows 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.po-capture-line-form-panel--open {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.po-capture-line-form-panel__inner {
    overflow: hidden;
    min-height: 0;
}

.po-capture-line-form-panel__body {
    padding-top: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
    .po-capture-line-form-panel,
    .po-capture-line-form-hint {
        transition: none;
    }
}

.po-capture-line-grid {
    --po-capture-line-cols: minmax(0, 5fr) minmax(4.5rem, 1.35fr) minmax(4.5rem, 1.35fr) minmax(4.5rem, 1.35fr) 2.25rem;
    display: grid;
    grid-template-columns: var(--po-capture-line-cols);
    grid-template-rows: auto auto;
    column-gap: 0.75rem;
    row-gap: 0.35rem;
    align-items: start;
}

.po-capture-line-grid--text {
    --po-capture-line-cols: minmax(0, 1fr) 2.25rem;
}

.po-capture-line-grid__cell--1-1 { grid-column: 1; grid-row: 1; }
.po-capture-line-grid__cell--2-1 { grid-column: 2; grid-row: 1; }
.po-capture-line-grid__cell--3-1 { grid-column: 3; grid-row: 1; }
.po-capture-line-grid__cell--4-1 { grid-column: 4; grid-row: 1; }
.po-capture-line-grid__cell--5-1 { grid-column: 5; grid-row: 1; }
.po-capture-line-grid__cell--1-2 { grid-column: 1; grid-row: 2; }
.po-capture-line-grid__cell--2-2 { grid-column: 2; grid-row: 2; }
.po-capture-line-grid__cell--3-2 { grid-column: 3; grid-row: 2; }
.po-capture-line-grid__cell--4-2 { grid-column: 4; grid-row: 2; }
.po-capture-line-grid__cell--5-2 { grid-column: 5; grid-row: 2; }

.po-capture-line-grid__label {
    font-size: 0.875rem;
    line-height: 1.2;
    min-height: 1.05rem;
}

.po-capture-line-grid__label--action {
    visibility: hidden;
}

.po-capture-line-grid__field {
    min-width: 0;
}

.po-capture-line-grid__field--item .invalid-feedback:empty {
    display: none !important;
}

.po-capture-line-grid__field--item .invalid-feedback:not(:empty) {
    margin-top: 0.25rem;
}

.po-capture-line-grid__field--subtotal {
    display: flex;
    align-items: center;
    min-height: calc(1.5em + 0.5rem + 2px);
}

.po-capture-line-grid__subtotal {
    width: 100%;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.po-capture-line-grid__field--action {
    display: flex;
    align-items: flex-start;
}

.po-capture-line-grid__submit {
    width: 2.25rem;
    height: calc(1.5em + 0.5rem + 2px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

@media (max-width: 767.98px) {
    .po-capture-line-grid:not(.po-capture-line-grid--text) {
        --po-capture-line-cols: minmax(0, 1fr) minmax(0, 1fr);
    }

    .po-capture-line-grid:not(.po-capture-line-grid--text) .po-capture-line-grid__cell--1-1,
    .po-capture-line-grid:not(.po-capture-line-grid--text) .po-capture-line-grid__cell--1-2 {
        grid-column: 1 / -1;
    }

    .po-capture-line-grid:not(.po-capture-line-grid--text) .po-capture-line-grid__cell--2-1,
    .po-capture-line-grid:not(.po-capture-line-grid--text) .po-capture-line-grid__cell--2-2 {
        grid-column: 1;
    }

    .po-capture-line-grid:not(.po-capture-line-grid--text) .po-capture-line-grid__cell--3-1,
    .po-capture-line-grid:not(.po-capture-line-grid--text) .po-capture-line-grid__cell--3-2 {
        grid-column: 2;
    }

    .po-capture-line-grid:not(.po-capture-line-grid--text) .po-capture-line-grid__cell--4-1,
    .po-capture-line-grid:not(.po-capture-line-grid--text) .po-capture-line-grid__cell--4-2 {
        grid-column: 1;
        grid-row: auto;
    }

    .po-capture-line-grid:not(.po-capture-line-grid--text) .po-capture-line-grid__cell--5-1,
    .po-capture-line-grid:not(.po-capture-line-grid--text) .po-capture-line-grid__cell--5-2 {
        grid-column: 2;
        grid-row: auto;
    }
}

.po-capture-page .po-capture-lines {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.po-capture-page .po-totals-sidebar {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    padding: 1rem;
}

.po-capture-page .po-totals-sidebar__actions {
    margin-top: auto;
    padding-top: 1rem;
    flex-shrink: 0;
}

.po-capture-page .po-totals-discount__form {
    margin: 0;
    min-width: 0;
}

.po-capture-page .po-totals-discount__row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    min-width: 11.5rem;
}

.po-capture-page .po-totals-discount__row--readonly {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.po-capture-page .po-totals-discount__percent {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex: 0 0 auto;
}

.po-capture-page .po-totals-discount__percent-input {
    width: calc(3ch + 0.75rem);
    min-width: 0;
    padding-inline: 0.35rem;
}

.po-capture-page .po-totals-discount__amount-input {
    width: 7.5rem;
}

.po-capture-page .po-totals-discount__suffix {
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    line-height: 1;
}

.ovpm-workspace-page .ovpm-workspace-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.ovpm-workspace-page .ovpm-workspace-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0.375rem;
    background: #e4e9f3;
    color: #2a3547;
    font-weight: 600;
    box-shadow: none;
    white-space: nowrap;
}

.ovpm-workspace-page .ovpm-workspace-btn:hover,
.ovpm-workspace-page .ovpm-workspace-btn:focus {
    background: #dbe3ef;
    border-color: transparent;
    color: #1f2937;
}

.ovpm-workspace-page .ovpm-workspace-btn:focus-visible {
    outline: 2px solid rgba(93, 135, 255, 0.45);
    outline-offset: 2px;
    box-shadow: none;
}

.ovpm-workspace-page .ovpm-workspace-btn--outline {
    border: 1px solid #d8dee9;
    background: #fff;
    color: #5a6a85;
}

.ovpm-workspace-page .ovpm-workspace-btn--outline:hover,
.ovpm-workspace-page .ovpm-workspace-btn--outline:focus {
    background: #f8fafc;
    border-color: #c5ced9;
    color: #5a6a85;
}

.ovpm-workspace-page .ovpm-means-add .ovpm-workspace-btn--outline {
    color: #5a6a85;
    font-weight: 500;
}

.ovpm-workspace-page .ovpm-tab-badge {
    font-size: 0.7rem;
    font-weight: 600;
}

.ovpm-invoices-toolbar__search {
    min-width: 14rem;
    flex: 0 1 14rem;
}

.ovpm-invoices-toolbar__due-range {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex: 0 0 auto;
}

.ovpm-invoices-toolbar__due-label {
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.ovpm-invoices-toolbar__due-sep {
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
}

.ovpm-invoices-toolbar__due-range input[type="date"] {
    width: 8.75rem;
    flex: 0 0 auto;
}

.ovpm-invoices-table tbody td {
    white-space: nowrap;
}

.ovpm-invoices-table tbody td.ovpm-amount-cell {
    white-space: normal;
    min-width: 8.5rem;
}

.ovpm-invoices-table .ovpm-amount-exceeds {
    font-size: 0.7rem;
    text-align: start;
}

.ovpm-invoices-table .ovpm-amount-cell.is-invalid .ovpm-amount-exceeds {
    display: block;
}

.ovpm-due--overdue {
    color: var(--bs-danger);
    font-weight: 600;
}

.ovpm-due--soon {
    color: #d97706;
    font-weight: 600;
}

.ovpm-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
}

.ovpm-summary-row--credit {
    color: var(--bs-danger);
}

.ovpm-summary-net__value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.ovpm-summary-net__curr {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.ovpm-credit-badge--dpm {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.ovpm-credit-badge--cm {
    background: #dcfce7;
    color: #15803d;
    font-weight: 600;
}

.ovpm-mean-card {
    box-shadow: none;
}

.ovpm-mean-card__heading {
    min-width: 0;
    padding-bottom: 1.65rem;
}

.ovpm-mean-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: #eef2ff;
    color: #3f6bf5;
    flex-shrink: 0;
}

.ovpm-mean-card__icon .ti {
    font-size: 1.125rem;
    line-height: 1;
}

.ovpm-mean-card__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #2a3547;
    line-height: 1.3;
    white-space: nowrap;
}

.ovpm-mean-row {
    justify-content: flex-start;
}

.ovpm-mean-fields {
    justify-content: flex-start;
    min-width: 0;
}

.ovpm-mean-field--bank {
    flex: 0 1 18rem;
    min-width: 14rem;
    max-width: 22rem;
}

.ovpm-mean-field--reference {
    flex: 0 1 11rem;
    min-width: 9rem;
    max-width: 14rem;
}

.ovpm-mean-field--date {
    flex: 0 1 11rem;
    min-width: 9rem;
    max-width: 12rem;
}

.ovpm-mean-field--amount {
    flex: 0 1 9rem;
    min-width: 7rem;
    max-width: 11rem;
}

.ovpm-mean-row__remove {
    margin-left: auto;
    align-self: center;
}

.ovpm-workspace-page .ovpm-mean-row__remove.po-line-remove-btn {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
}

.ovpm-workspace-page .ovpm-mean-row__remove.po-line-remove-btn .ti {
    font-size: 0.75rem;
}

.ovpm-summary-means {
    border-top: 1px solid var(--bs-border-color);
    padding-top: 0.75rem;
}

.po-capture-page .ap-from-po-sidebar {
    flex: 0 0 auto;
    align-self: flex-start;
}

.po-capture-page .ap-from-po-sidebar__actions {
    margin-top: 1rem;
    padding-top: 0;
}

@media (max-width: 991.98px) {
    .po-capture-page .po-capture-layout {
        flex-direction: column;
    }

    .po-capture-page .po-capture-main {
        border-right: 0;
        border-bottom: 1px solid var(--bs-border-color);
    }

    .po-capture-page .po-capture-sidebar {
        flex: 0 0 auto;
        width: 100%;
        max-width: none;
    }
}

.po-capture-page kbd {
    font-size: 0.75em;
    padding: 0.15rem 0.35rem;
}

.task-board-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 9rem);
    padding-top: 2rem;
}

.task-board-page .scrumboard.task-board-scrumboard {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.task-board-page .task-board-columns {
    flex: 1 1 auto;
    display: flex;
    gap: 1rem;
    align-items: stretch;
    width: 100%;
    min-height: calc(100vh - 14rem);
}

.task-board-page .scrumboard .connect-sorting,
.task-board-page .scrumboard .task-list-container {
    background: transparent;
    box-shadow: none;
    border: 0;
}

.task-board-page .task-list-container {
    flex: 1 1 0;
    width: auto !important;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.task-board-page .task-board-column {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    border-radius: 14px;
    border: 0;
    border-top: 3px solid #e5eaef;
    padding: 0.85rem 0.85rem 1rem;
    background: #f6f8fb;
}

.task-board-page .task-board-column--todo {
    border-top-color: #94a3b8;
    background: #f6f8fb;
}

.task-board-page .task-board-column--in-progress {
    border-top-color: #5d87ff;
    background: #f0f5ff;
}

.task-board-page .task-board-column--done {
    border-top-color: #13deb9;
    background: #f0faf6;
}

.task-board-page .task-board-column__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0 0.15rem 0.75rem;
    border-bottom: 2px solid #dce3ec;
}

.task-board-page .task-board-column--todo .task-board-column__header {
    border-bottom-color: #c5ced9;
}

.task-board-page .task-board-column--in-progress .task-board-column__header {
    border-bottom-color: #a8c4ff;
}

.task-board-page .task-board-column--done .task-board-column__header {
    border-bottom-color: #9de8d2;
}

.task-board-page .task-board-column__heading {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.task-board-page .task-board-column__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.task-board-page .task-board-column--todo .task-board-column__dot {
    background: #94a3b8;
}

.task-board-page .task-board-column--in-progress .task-board-column__dot {
    background: #5d87ff;
}

.task-board-page .task-board-column--done .task-board-column__dot {
    background: #13deb9;
}

.task-board-page .task-board-column__title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2a3547;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.task-board-page .task-board-column__count {
    font-size: 0.8rem;
    font-weight: 500;
    color: #7c8fac;
}

.task-board-page .task-board-column__actions {
    flex-shrink: 0;
}

.task-board-page .task-board-column__filter-form {
    margin: 0;
}

.task-board-page .task-board-column__filter-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #7c8fac;
    font-size: 0.8rem;
}

.task-board-page .task-board-column__filter {
    width: auto;
    min-width: 6.75rem;
    font-size: 0.75rem;
    padding: 0.15rem 1.5rem 0.15rem 0;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
    color: #5a6a85;
}

.task-board-page .task-board-column__filter:focus {
    box-shadow: none;
}

.task-board-page .task-board-column__add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #7c8fac;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}

.task-board-page .task-board-column__add-btn:hover {
    color: #5d87ff;
    background: #eef4ff;
}

.task-board-page .task-board-dropzone {
    flex: 1 1 auto;
    min-height: calc(100vh - 22rem);
    height: auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.task-board-page .task-board-card {
    position: relative;
    z-index: 1;
    background-color: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    overflow: visible;
    box-shadow: none;
    margin-bottom: 0;
}

.task-board-page .task-board-card:has(.dropdown.show),
.task-board-page .task-board-card:has(.dropdown-menu.show) {
    z-index: 30;
}

.task-board-page .task-board-card__menu {
    position: relative;
}

.task-board-page .task-board-card__menu .dropdown-menu {
    z-index: 1050;
}

.task-board-page .task-board-card__body {
    padding: 0.8rem 0.85rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.task-board-page .task-board-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.task-board-page .task-board-card__title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 0;
}

.task-board-page .task-board-card__id {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
    color: #7c8fac;
    margin-top: 0.12rem;
}

.task-board-page .task-board-card__title {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.4;
    color: #2a3547;
}

.task-board-page .task-board-card__menu-btn {
    border: 0;
    background: transparent;
    color: #94a3b8;
    padding: 0;
    line-height: 1;
    font-size: 1rem;
    margin-top: -0.1rem;
}

.task-board-page .task-board-card__tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.task-board-page .task-board-card__tag {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.35;
}

.task-board-page .task-board-card__tag--primary {
    background: rgba(93, 135, 255, 0.12);
    color: #5d87ff;
}

.task-board-page .task-board-card__tag--success {
    background: rgba(19, 222, 185, 0.14);
    color: #0db894;
}

.task-board-page .task-board-card__tag--info {
    background: rgba(83, 155, 255, 0.14);
    color: #3d84f5;
}

.task-board-page .task-board-card__tag--warning {
    background: rgba(255, 174, 31, 0.16);
    color: #d98900;
}

.task-board-page .task-board-card__tag--danger {
    background: rgba(250, 137, 107, 0.16);
    color: #e86a4d;
}

.task-board-page .task-board-card__tag--secondary {
    background: rgba(90, 106, 133, 0.12);
    color: #5a6a85;
}

.task-board-page .task-board-card__footer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    margin-top: 0.1rem;
}

.task-board-page .task-board-card__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    color: #7c8fac;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-board-page .task-board-card__meta .ti {
    font-size: 0.82rem;
}

.task-board-page .task-board-dropzone .ui-sortable-placeholder {
    min-height: 4.5rem;
    border: 1px dashed #8eb4ff;
    border-radius: 10px;
    background: rgba(238, 244, 255, 0.45);
    visibility: visible !important;
    margin-bottom: 0;
}

.task-board-page .task-board-card__description {
    white-space: pre-line;
}

.po-capture-page .po-toast-container,
.erp-flash-toast-container {
    position: fixed;
    bottom: 1.25rem;
    top: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    max-width: min(440px, calc(100vw - 2rem));
    pointer-events: none;
    font-family: var(--bs-body-font-family);
}

.po-capture-page .po-toast-container {
    z-index: 1050;
}

.erp-flash-toast {
    background: #1a202c;
    color: #fff;
    border-radius: 14px;
    padding: 0.85rem 1.25rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
    border: none;
    pointer-events: auto;
    animation: erp-flash-toast-in 0.22s ease-out;
}

.erp-flash-toast__inner {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.erp-flash-toast__icon {
    flex-shrink: 0;
    width: 1.15rem;
    height: 1.15rem;
    font-size: 1.05rem;
    line-height: 1;
}

.erp-flash-toast__message {
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.35;
    color: #fff;
}

.erp-flash-toast--success .erp-flash-toast__icon {
    color: #48bb78;
}

.erp-flash-toast--error .erp-flash-toast__icon {
    color: #fa896b;
}

.erp-flash-toast--warning .erp-flash-toast__icon {
    color: #ffae1f;
}

.erp-flash-toast--info .erp-flash-toast__icon {
    color: #5d87ff;
}

.erp-flash-toast-container .erp-flash-toast--hiding {
    animation: erp-flash-toast-out 0.2s ease-in forwards;
}

@keyframes erp-flash-toast-in {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes erp-flash-toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(0.5rem);
    }
}

.po-capture-page .po-toast-container .po-toast {
    pointer-events: auto;
}

.po-autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 0.25rem;
    display: none;
}

.po-autocomplete-list.open.show {
    display: block;
}

.po-autocomplete-list--floating {
    display: none;
    background-color: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
    max-height: 240px;
    overflow-y: auto;
    margin-top: 0;
}

.po-autocomplete-list--floating.open.show {
    display: block;
    z-index: 9999;
}

.po-capture-page .po-line-details-row.show td {
    overflow: visible;
}

.po-capture-page .po-line-details-form {
    overflow: visible;
    position: relative;
    z-index: 1;
}

.po-capture-page .po-line-details-form:focus-within {
    z-index: 5;
}

.autocomplete-field--clearable:focus-within .autocomplete-input--has-clear {
    padding-right: 2rem;
}

.autocomplete-clear-btn {
    position: absolute;
    top: 50%;
    right: 0.15rem;
    transform: translateY(-50%);
    z-index: 4;
    display: none;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    color: var(--bs-secondary-color, #6c757d);
    text-decoration: none;
    line-height: 1;
}

.autocomplete-field--clearable:focus-within .autocomplete-clear-btn.is-visible {
    display: inline-flex;
}

.autocomplete-clear-btn:hover,
.autocomplete-clear-btn:focus {
    color: var(--bs-body-color, #212529);
}

.select-list-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.select-list-toggle {
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select-list-toggle--placeholder {
    color: var(--bs-secondary-color, #6c757d);
}

.po-capture-page .po-subtotal-preview {
    min-height: calc(1.5em + 0.5rem + 2px);
    line-height: calc(1.5em + 0.5rem + 2px);
}

.po-capture-page .po-line-editable {
    cursor: pointer;
}

.po-capture-page .po-line-editable:hover {
    background-color: var(--bs-primary-bg-subtle, rgba(13, 110, 253, 0.08));
}

.po-capture-page tr.editing td {
    background-color: var(--bs-primary-bg-subtle, rgba(13, 110, 253, 0.08));
}

.po-capture-page tr.po-line-new {
    animation: poLineFlash 1.2s ease-out;
}

.po-capture-page tr.po-line-text {
    background-color: var(--bs-light-bg-subtle, rgba(var(--bs-light-rgb), 0.5));
}

.po-capture-page tr.po-line-text .po-line-text-content {
    font-style: italic;
    color: var(--bs-secondary-color);
}

.po-capture-page .po-line-type-toggle .btn {
    min-width: 4.5rem;
}

.po-capture-page .po-line-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    padding: 0;
    border: none;
    border-radius: 0.2rem;
    background-color: var(--bs-danger-bg-subtle, #fde8e8);
    color: var(--bs-danger, #fa896b);
    font-size: 0.625rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.po-capture-page .po-line-remove-btn .ti {
    font-size: 0.625rem;
}

.po-capture-page .po-line-remove-btn:hover {
    background-color: var(--bs-danger, #fa896b);
    color: #fff;
}

.po-capture-page .po-line-remove-btn:focus-visible {
    outline: 2px solid var(--bs-danger, #fa896b);
    outline-offset: 2px;
}

@keyframes poLineFlash {
    from {
        background-color: var(--bs-success-bg-subtle, rgba(25, 135, 84, 0.15));
    }
    to {
        background-color: transparent;
    }
}

.po-capture-page .po-capture-header .form-label,
.document-show-header .form-label,
.po-capture-page .gr-show-header .form-label,
.po-capture-page .ap-show-header .form-label,
.document-show-header__label {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #2a3547 !important;
}

.landed-cost-receipt-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.po-capture-page .gr-capture-header__dates-row {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    min-height: 100%;
}

.po-capture-page .gr-capture-header__posting-date {
    flex: 0 0 11rem;
    max-width: 11rem;
}

.po-capture-page .gr-capture-header__divider {
    width: 1px;
    align-self: stretch;
    margin-bottom: 0.65rem;
    background: var(--gr-border, #e2e5ea);
    flex-shrink: 0;
}

.po-capture-page .gr-capture-header__vendor-doc {
    flex: 1 1 auto;
    min-width: 0;
}

.po-capture-page .gr-capture-header__vendor-doc-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gr-action, #3f6bf5);
    line-height: 1.2;
}

.po-capture-page .gr-capture-header__vendor-doc-title .ti {
    font-size: 0.875rem;
}

.po-capture-page .gr-capture-header__vendor-doc-fields {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.po-capture-page .gr-capture-header__vendor-doc-ref {
    flex: 0 0 10rem;
    max-width: 10rem;
}

.po-capture-page .gr-capture-header__field-control {
    position: relative;
}

.po-capture-page .gr-capture-header__inline-error,
.po-capture-page .gr-capture-header__field-control .invalid-feedback,
.po-capture-page .gr-capture-header__field-control .form-error-message {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.15rem;
    z-index: 2;
    font-size: 0.75rem;
    line-height: 1.2;
}

.po-capture-page .gr-capture-header__inline-error.d-none {
    display: none !important;
}

.po-capture-page .gr-capture-header__inline-error.d-block {
    display: block !important;
}

.po-capture-page .gr-capture-header__field-control ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0.15rem 0 0;
    padding: 0;
    list-style: none;
    z-index: 2;
    font-size: 0.75rem;
    line-height: 1.2;
    color: var(--bs-form-invalid-color);
}

.po-capture-page .gr-capture-header__vendor-doc-date {
    flex: 0 0 11rem;
    max-width: 11rem;
}

.po-capture-page .gr-capture-header__posting-date .mb-3,
.po-capture-page .gr-capture-header__vendor-doc-ref .mb-3,
.po-capture-page .gr-capture-header__vendor-doc-date .mb-3 {
    margin-bottom: 0 !important;
}

.po-capture-page .gr-capture-alert-banner,
.gr-journal-preview-modal .gr-capture-alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    background: #fdf3f3;
    border: 1px solid #f0d4d4;
    border-radius: 10px;
    color: #8b2e2e;
    font-size: 0.875rem;
    line-height: 1.45;
}

.po-capture-page .gr-capture-alert-banner.d-none,
.gr-journal-preview-modal .gr-capture-alert-banner.d-none {
    display: none !important;
}

.po-capture-page .gr-capture-alert-banner__icon,
.gr-journal-preview-modal .gr-capture-alert-banner__icon {
    flex-shrink: 0;
    font-size: 1.125rem;
    margin-top: 0.1rem;
    color: #c53f3f;
}

.po-capture-page .gr-capture-alert-banner__title,
.gr-journal-preview-modal .gr-capture-alert-banner__title {
    font-weight: 600;
    color: #7a2222;
}

.po-capture-page .gr-capture-alert-banner__detail,
.gr-journal-preview-modal .gr-capture-alert-banner__detail {
    margin-top: 0.15rem;
    color: #8b2e2e;
}

.po-capture-page .gr-capture-alert-banner__detail strong,
.gr-journal-preview-modal .gr-capture-alert-banner__detail strong {
    font-weight: 600;
    color: #7a2222;
}

.po-capture-page .letter-spacing-1 {
    letter-spacing: 0.06em;
}

.po-capture-page .po-lines-table thead th,
.gr-batch-modal .po-lines-table thead th {
    background-color: transparent;
    font-weight: 600;
    border-bottom-width: 1px;
}

.po-capture-page .po-lines-table .po-line-total-col {
    width: 12rem;
    min-width: 12rem;
    white-space: nowrap;
}

.po-capture-page .po-line-details-row {
    display: none;
}

.po-capture-page .po-line-details-row.show {
    display: table-row;
}

.po-capture-page .form-tab-header .nav-link[disabled],
.po-capture-page .form-tab-header .nav-link:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.po-capture-page--vendor-pending .po-capture-body--locked {
    position: relative;
}

.po-capture-page .po-capture-lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.72);
    pointer-events: none;
}

.po-capture-page .po-capture-body--locked .po-capture-main,
.po-capture-page .po-capture-body--locked .po-capture-sidebar {
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
}

.po-capture-page {
    --gr-action: #3f6bf5;
    --gr-text: #1d2432;
    --gr-secondary: #5b6478;
    --gr-muted: #8b94a5;
    --gr-border: #e2e5ea;
    --gr-border-strong: #d8dde6;
    --gr-warning: #c0662b;
    --gr-success: #2f8a5b;
}

.po-capture-page .gr-capture-card {
    min-width: 1080px;
    color: var(--gr-text);
}

.po-capture-page .gr-line-filter {
    display: inline-flex;
    border: 1px solid var(--gr-border);
    border-radius: 0.375rem;
    overflow: hidden;
    background: #fff;
}

.po-capture-page .gr-line-filter .nav-item + .nav-item {
    border-left: 1px solid var(--gr-border);
}

.po-capture-page .gr-line-filter .nav-link {
    padding: 0.35rem 0.85rem;
    font-size: 0.8125rem;
    border-radius: 0;
    color: var(--gr-secondary);
    background: transparent;
}

.po-capture-page .gr-line-filter .nav-link:hover {
    color: var(--gr-text);
    background-color: rgba(var(--bs-light-rgb), 0.8);
}

.po-capture-page .gr-line-filter .nav-link.active {
    background-color: var(--bs-light);
    color: var(--gr-text);
    font-weight: 500;
}

/* Document show (GR / AP invoice) — fill viewport; sidebar divider full height */
.po-capture-page.gr-show-page,
.po-capture-page.ap-show-page {
    flex: 1 1 auto;
    min-height: 0;
}

.po-capture-page.gr-show-page > .po-capture-card,
.po-capture-page.ap-show-page > .po-capture-card {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.po-capture-page.gr-show-page .po-capture-tab-content,
.po-capture-page.gr-show-page .po-capture-tab-content > .tab-pane.active,
.po-capture-page.ap-show-page .po-capture-tab-content,
.po-capture-page.ap-show-page .po-capture-tab-content > .tab-pane.active {
    flex: 1 1 auto;
    min-height: 0;
}

.po-capture-page.gr-show-page .gr-show-tab-lines,
.po-capture-page.ap-show-page .ap-show-tab-lines {
    flex: 1 1 auto;
    min-height: 0;
}

.po-capture-page.gr-show-page .gr-show-content,
.po-capture-page.ap-show-page .ap-show-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
    border-top: 1px solid var(--bs-border-color);
}

.po-capture-page.gr-show-page .gr-show-content .po-capture-main,
.po-capture-page.ap-show-page .ap-show-content .po-capture-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border-right: 1px solid var(--bs-border-color);
}

.po-capture-page.gr-show-page .gr-show-lines,
.po-capture-page.ap-show-page .ap-show-lines {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.po-capture-page.gr-show-page .gr-show-content .po-capture-sidebar,
.po-capture-page.ap-show-page .ap-show-content .po-capture-sidebar {
    display: flex;
    flex: 0 0 clamp(240px, 25%, 320px);
    flex-direction: column;
    width: clamp(240px, 25%, 320px);
    min-width: 240px;
    min-height: 0;
    align-self: stretch;
}

.po-capture-page .gr-lines-toolbar-divider {
    margin: 0.65rem 0;
    border-color: var(--gr-border);
    opacity: 1;
}

.po-capture-page .gr-keyboard-hint {
    color: var(--gr-muted);
    line-height: 1.6;
}

.po-capture-page .gr-silent-cell {
    position: relative;
    cursor: pointer;
    min-width: 4.5rem;
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.po-capture-page .gr-silent-cell:hover:not(.gr-silent-cell--readonly) {
    background-color: #fff;
    border-color: var(--gr-border-strong);
}

.po-capture-page .gr-silent-cell--editing {
    background-color: #fff;
    border-color: var(--gr-border-strong);
}

.po-capture-page .gr-silent-cell--readonly {
    cursor: default;
}

.po-capture-page .gr-silent-cell__display {
    display: block;
    min-height: 1.25rem;
    line-height: 1.25rem;
}

.po-capture-page .gr-silent-cell__editor {
    position: absolute;
    inset: 0.15rem;
}

.po-capture-page .gr-silent-cell__editor .form-control,
.po-capture-page .gr-silent-cell__editor .form-select {
    width: 100%;
    height: 100%;
    min-height: 1.75rem;
}

.po-capture-page .gr-silent-cell--qty .gr-silent-cell__display {
    background-color: rgba(63, 107, 245, 0.08);
    border-radius: 0.2rem;
    padding: 0 0.35rem;
    text-align: end;
}

.po-capture-page .gr-silent-cell--qty.gr-silent-cell--editing .gr-qty-input {
    box-shadow: 0 0 0 2px rgba(63, 107, 245, 0.25);
}

.po-capture-page .gr-silent-cell--bin.gr-silent-cell--editing,
.po-capture-page .gr-silent-cell--exp.gr-silent-cell--editing {
    overflow: visible;
    z-index: 31;
    min-width: 9.5rem;
}

.po-capture-page .gr-silent-cell--bin .gr-silent-cell__editor {
    overflow: visible;
    min-width: 9rem;
}

.po-capture-page .gr-silent-cell--exp .gr-silent-cell__editor {
    overflow: visible;
    min-width: 9rem;
}

.po-capture-page .gr-silent-cell--exp .gr-silent-cell__editor input[type="date"] {
    min-width: 9rem;
}

.po-capture-page .gr-qty-input {
    min-width: 4.5rem;
    background-color: rgba(63, 107, 245, 0.08);
}

.po-capture-page .gr-qty-input--readonly {
    background-color: var(--bs-light);
    cursor: default;
}

.po-capture-page .gr-batch-preview-accent {
    border-left: 3px solid var(--gr-action);
}

.po-capture-page .gr-progress-pct {
    font-size: 1.75rem;
    line-height: 1;
    color: var(--gr-action);
}

.po-capture-page .gr-origin-card {
    background: var(--bs-light);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gr-border);
}

.po-capture-page [data-gr-capture-target="batchSummary"],
.po-capture-page .gr-batch-edit-btn {
    color: var(--gr-action) !important;
    white-space: nowrap;
}

.po-capture-page .gr-batch-inline-actions {
    text-align: right;
    width: 110px;
    min-width: 110px;
}

.po-capture-page .gr-batch-inline-cell--hidden {
    visibility: hidden;
    pointer-events: none;
    user-select: none;
}

.po-capture-page .gr-batch-inline-cell--hidden * {
    visibility: hidden;
}

.po-capture-page .gr-batch-edit-btn:disabled,
.po-capture-page .gr-batch-edit-btn.disabled {
    color: var(--bs-secondary-color) !important;
    pointer-events: none;
}

.po-capture-page .gr-pending-warning {
    color: var(--gr-warning) !important;
}

.po-capture-page .gr-keyboard-hint kbd {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background-color: #5a6578;
    color: #fff;
    border: none;
    border-radius: 0.25rem;
    box-shadow: none;
}

.po-capture-page .gr-capture-layout .po-capture-sidebar {
    width: 320px;
    min-width: 320px;
    flex: 0 0 320px;
}

.po-capture-page .gr-lines-table {
    white-space: nowrap;
    border-collapse: separate;
    border-spacing: 0;
}

.po-capture-page .gr-lines-table tr.gr-silent-row--editing {
    position: relative;
    z-index: 30;
}

.po-capture-page .gr-lines-table tr.gr-silent-row--editing td {
    position: relative;
    z-index: 30;
    background-color: #fff;
}

.po-capture-page .gr-lines-scroll {
    overflow-x: auto;
}

.po-capture-page .gr-batch-preview-row td {
    background-color: rgba(var(--bs-light-rgb), 0.6);
    border-top: none;
    padding-top: 0.15rem;
    padding-bottom: 0.35rem;
}

.po-capture-page .gr-batch-preview-row + .gr-batch-preview-row td {
    padding-top: 0;
}

.po-capture-page .gr-attachment-btn {
    border-style: dashed !important;
}

.gr-batch-modal {
    z-index: 1065;
}

.gr-batch-modal .gr-batch-table thead th {
    border-bottom-width: 1px;
}

.gr-batch-modal .gr-batch-status-bar {
    background: var(--bs-light);
}

.gr-batch-modal .gr-batch-status-bar.text-success [data-gr-batch-modal-target="difference"] {
    color: var(--bs-success) !important;
}

.gr-batch-modal .gr-batch-status-bar.text-danger [data-gr-batch-modal-target="difference"] {
    color: var(--bs-danger) !important;
}

.po-capture-page .gr-notes-textarea {
    min-height: 12rem;
    resize: vertical;
}

.approval-workflow-stages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.approval-workflow-stage {
    border: 1px solid var(--bs-border-color, #ebf1f6);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bs-body-bg, #fff);
}

.approval-workflow-stage--active {
    border-color: var(--bs-primary, #5d87ff);
    box-shadow: 0 0 0 1px rgba(var(--bs-primary-rgb, 93, 135, 255), 0.15);
}

.approval-workflow-stage__header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.approval-workflow-stage__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--bs-light, #f6f9fc);
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.approval-workflow-stage--active .approval-workflow-stage__number {
    background: var(--bs-primary-bg-subtle, #ecf2ff);
    color: var(--bs-primary, #5d87ff);
}

.approval-workflow-stage__tasks {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 2.5rem;
}

.approval-workflow-task {
    padding: 0.625rem 0.75rem;
    border-radius: 0.375rem;
    background: var(--bs-light, #f6f9fc);
}

.approval-workflow-task__reject-reason {
    font-size: 0.875rem;
    padding-top: 0.375rem;
    border-top: 1px dashed var(--bs-border-color, #dee2e6);
}

.approval-workflow-task__reject-reason-text {
    margin-top: 0.25rem;
    white-space: pre-wrap;
}

/* ——— AI assistant (desktop fixed right sidebar, mirrors left-sidebar) ——— */

:root {
    --erp-ai-sidebar-width: 380px;
    --erp-topbar-height: 4.5rem;
    --erp-workspace-tabs-height: 0rem;
}

body {
    --erp-chrome-height: calc(var(--erp-topbar-height) + var(--erp-workspace-tabs-height));
}

body:has(.erp-desktop-workspace--has-tabs) {
    --erp-workspace-tabs-height: 2.75rem;
}

body.erp-with-ai-assistant .page-wrapper {
    margin-right: var(--erp-ai-sidebar-width);
    transition: margin-right 0.2s ease-in;
}

body.erp-with-ai-assistant.erp-ai-sidebar-hidden .page-wrapper {
    margin-right: 0;
}

.erp-ai-sidebar {
    width: var(--erp-ai-sidebar-width);
    position: fixed;
    right: 0;
    top: var(--erp-chrome-height);
    height: calc(100% - var(--erp-chrome-height));
    border-left: 1px solid var(--bs-border-color, #ebf1f6);
    background: var(--bs-body-bg, #fff);
    z-index: 1020;
    transition: transform 0.2s ease-in;
}

body.erp-ai-sidebar-hidden .erp-ai-sidebar {
    transform: translateX(100%);
    pointer-events: none;
}

.erp-ai-toggle-btn .nav-link {
    padding-inline: 0.5rem !important;
}

.erp-ai-toggle-btn__icon {
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bs-light, #f6f9fc);
    color: var(--bs-primary, #5d87ff);
    line-height: 1;
}

.erp-ai-toggle-btn__icon i {
    display: block;
    line-height: 1;
}

.erp-ai-toggle-btn--active .erp-ai-toggle-btn__icon {
    background: var(--bs-primary, #5d87ff);
    color: #fff;
}

.ai-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.ai-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color, #ebf1f6);
    background: var(--bs-light, #f6f9fc);
    flex-shrink: 0;
}

.ai-chat__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.ai-chat__header-actions {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.ai-chat__reset,
.ai-chat__hide {
    color: var(--bs-gray-500, #5a6a85) !important;
    text-decoration: none;
}

.ai-chat__reset:hover,
.ai-chat__reset:focus-visible,
.ai-chat__hide:hover,
.ai-chat__hide:focus-visible {
    color: var(--bs-gray-600, #2a3547) !important;
}

.ai-chat__messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    background: var(--erp-surface-muted);
}

.ai-chat__welcome {
    align-self: center;
    max-width: 92%;
    margin: auto 0;
    padding: 0.875rem 1rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    text-align: center;
    color: var(--bs-secondary);
    background: var(--bs-body-bg, #fff);
    border-radius: 0.875rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.ai-chat__bubble {
    max-width: 88%;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.ai-chat__bubble--user {
    align-self: flex-end;
}

.ai-chat__bubble--user .ai-chat__bubble-body {
    background: var(--bs-primary, #5d87ff);
    color: #fff;
    border-radius: 1.125rem 1.125rem 0.25rem 1.125rem;
    padding: 0.625rem 0.875rem;
}

.ai-chat__bubble--assistant,
.ai-chat__bubble--loading {
    align-self: flex-start;
}

.ai-chat__bubble--assistant .ai-chat__bubble-body,
.ai-chat__bubble--loading .ai-chat__bubble-body {
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color);
    border-radius: 1.125rem 1.125rem 1.125rem 0.25rem;
    padding: 0.625rem 0.875rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.ai-chat__bubble--assistant .ai-chat__bubble-body strong {
    font-weight: 600;
}

.ai-chat__bubble--assistant .ai-chat__bubble-body code {
    font-size: 0.85em;
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.06);
}

.ai-chat__download {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(60, 60, 67, 0.18);
    background: #fff;
    color: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}

.ai-chat__download:hover {
    background: rgba(60, 60, 67, 0.06);
    color: inherit;
}

.ai-chat__bubble--loading .ai-chat__bubble-body {
    color: var(--bs-secondary);
}

.ai-chat__bubble--error {
    align-self: stretch;
    max-width: none;
}

.ai-chat__bubble--error .ai-chat__bubble-body {
    color: var(--bs-danger);
    background: rgba(var(--bs-danger-rgb), 0.08);
    border: 1px solid rgba(var(--bs-danger-rgb), 0.2);
    border-radius: 0.75rem;
    padding: 0.625rem 0.875rem;
}

.ai-chat__pending {
    flex-shrink: 0;
    padding: 0 0.75rem;
}

.ai-chat__composer {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    padding: 0.5rem 0.75rem;
    border-top: 0.5px solid rgba(60, 60, 67, 0.12);
    background: rgba(242, 242, 247, 0.95);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    flex-shrink: 0;
}

.ai-chat__input {
    flex: 1 1 auto;
    display: block;
    width: 100%;
    min-height: 2.75rem;
    max-height: 7.5rem;
    margin: 0;
    padding: 0.6875rem 0.875rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--bs-body-bg, #fff);
    color: #1c1c1e;
    font-family: inherit;
    font-size: 0.8125rem;
    line-height: 1.35;
    resize: none;
    -webkit-appearance: none;
    appearance: none;
}

.ai-chat__input::placeholder {
    color: #6c757d;
    opacity: 1;
}

.ai-chat__input:focus {
    outline: 2px solid var(--bs-primary, #5d87ff);
    outline-offset: 0;
    box-shadow: none;
    color: #1c1c1e;
}

.ai-chat__send {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    margin-bottom: 0.125rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--bs-primary, #5d87ff);
    color: #fff;
    font-family: inherit;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ai-chat__send:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.ai-chat__send:disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: not-allowed;
}

.form-submit--pending {
    cursor: wait;
}

.form-submit--pending .gr-capture-card input:not([type="hidden"]),
.form-submit--pending .gr-capture-card select,
.form-submit--pending .gr-capture-card textarea,
.form-submit--pending .gr-capture-card button:not([type="submit"]) {
    pointer-events: none;
    opacity: 0.72;
}

.form-submit--pending .gr-batch-modal {
    pointer-events: none;
}

/* ── Command palette navigation (top bar menu) ── */

.erp-command-palette-layout .left-sidebar {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.erp-command-palette-layout .page-wrapper {
    margin-left: 0 !important;
}

.erp-command-palette-layout .topbar.erp-topbar {
    position: fixed !important;
    top: 0;
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--bs-body-bg, #fff);
}

@media (min-width: 1300px) {
    [data-layout='vertical'] body.erp-command-palette-layout[data-sidebartype='mini-sidebar'] .topbar.erp-topbar,
    [data-layout='vertical'] body.erp-command-palette-layout .topbar.erp-topbar {
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    [data-layout='vertical'] body.erp-command-palette-layout[data-sidebartype='mini-sidebar'] .page-wrapper,
    [data-layout='vertical'] body.erp-command-palette-layout .page-wrapper {
        margin-left: 0 !important;
    }
}

.erp-desktop-workspace--has-tabs .topbar.erp-topbar {
    border-bottom: 0;
}

.erp-command-palette-layout .body-wrapper {
    padding-top: var(--erp-chrome-height);
}

.erp-topbar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--bs-body-bg, #fff);
}

.erp-topbar,
.erp-topbar__inner,
.erp-topbar__palette,
.erp-command-palette {
    overflow: visible !important;
}

.erp-topbar__inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    min-height: 4.5rem;
    padding: 0.625rem 1.5rem;
}

.erp-topbar__title {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 28%;
}

.erp-topbar__title h4 {
    font-size: 1.125rem;
    font-weight: 600;
    white-space: normal;
    overflow: visible;
}

.erp-page-title {
    min-width: 0;
}

.erp-doc-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.erp-doc-status-pill--draft {
    background: #fef5e7;
    color: #a67233;
}

.erp-doc-status-pill--pending {
    background: #ebf3fe;
    color: #1d4ed8;
}

.erp-doc-status-pill--success {
    background: #dcfce7;
    color: #15803d;
}

.erp-doc-status-pill--danger {
    background: #fee2e2;
    color: #b91c1c;
}

.erp-doc-status-pill--open {
    background: #ebf3fe;
    color: #2563eb;
}

.erp-doc-status-pill--muted {
    background: #f3f4f6;
    color: #6b7280;
}

.erp-topbar__palette {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    min-width: 0;
    max-width: 640px;
    margin: 0 auto;
}

.erp-topbar__actions {
    flex: 0 0 auto;
    margin-left: auto;
    position: relative;
    z-index: 1040;
}

.erp-topbar__actions .nav-item.dropdown > .nav-link {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.erp-topbar__actions .dropdown-menu:not(.show) {
    pointer-events: none;
}

.erp-topbar__actions .dropdown-menu {
    z-index: 1050;
}

.erp-command-palette-layout .topbar.erp-topbar .erp-topbar__actions .dropdown-menu.content-dd.erp-user-profile-dropdown {
    width: min(26rem, calc(100vw - 1.5rem)) !important;
    min-width: 20rem;
    padding: 0;
}

.erp-user-profile-dropdown__identity h6 {
    font-size: 1rem;
    line-height: 1.3;
    color: var(--bs-heading-color, #2a3547);
}

.erp-user-profile-dropdown .profile-dropdown {
    width: 100%;
}

.erp-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    flex-shrink: 0;
    line-height: 1;
}

.erp-user-avatar--topbar {
    width: 2rem;
    height: 2rem;
    font-size: 0.65rem;
}

.erp-user-avatar--lg {
    width: 3rem;
    height: 3rem;
    font-size: 0.8rem;
}

.erp-user-avatar--sm {
    width: 1.65rem;
    height: 1.65rem;
    font-size: 0.58rem;
}

.erp-user-avatar--tone-0 { background: #5d87ff; }
.erp-user-avatar--tone-1 { background: #2a3547; }
.erp-user-avatar--tone-2 { background: #7c3aed; }
.erp-user-avatar--tone-3 { background: #13deb9; }
.erp-user-avatar--tone-4 { background: #fa896b; }
.erp-user-avatar--tone-5 { background: #49beff; }

.erp-command-palette {
    position: relative;
    width: 100%;
    max-width: 640px;
}

.erp-command-palette__trigger-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    width: 100%;
    min-height: 2.25rem;
    background: var(--bs-body-bg, #fff);
    border: 1px solid #d8dee9;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.erp-command-palette__menu-btn {
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.75rem;
    border: 0;
    border-right: 1px solid #e5eaf2;
    background: transparent;
    color: #1e293b;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.erp-command-palette__menu-btn .ti {
    font-size: 0.9375rem;
}

.erp-command-palette__menu-btn:hover,
.erp-command-palette--open .erp-command-palette__menu-btn {
    background: var(--bs-light-indigo, #ebf3fe);
}

.erp-command-palette__menu-chevron {
    font-size: 0.625rem;
    opacity: 0.5;
}

.erp-command-palette__search-wrap {
    position: relative;
    flex: 1 1 auto;
    display: flex !important;
    align-items: center;
    min-width: 0;
}

.erp-command-palette__search-icon {
    position: absolute;
    left: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.875rem;
    pointer-events: none;
    line-height: 1;
}

.erp-command-palette__search {
    display: block;
    width: 100%;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0.5rem 4.25rem 0.5rem 2.125rem;
    font-size: 0.75rem;
    background: transparent;
    color: #1e293b;
}

.erp-command-palette__search::placeholder {
    color: #94a3b8;
    font-size: 0.75rem;
}

.erp-command-palette__kbd {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.35rem;
    border-radius: 0.3125rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.625rem;
    font-family: inherit;
    line-height: 1.4;
    pointer-events: none;
}

.erp-command-palette__backdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(15, 23, 42, 0.2);
    display: none;
}

.erp-command-palette__backdrop.is-open {
    display: block;
}

.erp-command-palette__panel {
    position: fixed;
    z-index: 1100;
    background: var(--bs-body-bg, #fff);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.875rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    display: none;
}

.erp-command-palette__panel.is-open {
    display: block;
}

.erp-command-palette__body {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 340px;
}

.erp-command-palette__heading {
    padding: 0.875rem 1rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.erp-command-palette__modules {
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    background: #f8fafc;
    padding-bottom: 0.5rem;
}

.erp-command-palette__module-list {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0 0.5rem 0.75rem;
}

.erp-command-palette__module {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 0;
    border-radius: 0.625rem;
    background: transparent;
    color: #334155;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
}

.erp-command-palette__module .ti {
    font-size: 1rem;
    opacity: 0.85;
}

.erp-command-palette__module-chevron {
    margin-left: auto;
    font-size: 0.875rem;
}

.erp-command-palette__module.is-active,
.erp-command-palette__module.is-focused {
    background: var(--bs-primary, #5d87ff);
    color: #fff;
}

.erp-command-palette__module.is-active .ti,
.erp-command-palette__module.is-focused .ti {
    opacity: 1;
}

.erp-command-palette__items-pane {
    padding: 0.5rem 1rem 1rem;
    min-width: 0;
}

.erp-command-palette__items-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.25rem 0.75rem;
}

.erp-command-palette__items-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.erp-command-palette__items-count {
    font-size: 0.75rem;
    color: #94a3b8;
}

.erp-command-palette__item-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem 0.75rem;
    max-height: 450px;
    overflow: auto;
}

.erp-command-palette__subgroup-label {
    grid-column: 1 / -1;
    padding: 0.5rem 0.25rem 0.125rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.erp-command-palette__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
    color: #334155;
    text-decoration: none;
    font-size: 0.875rem;
}

.erp-command-palette__item:hover,
.erp-command-palette__item.is-focused {
    background: rgba(93, 135, 255, 0.1);
    color: var(--bs-primary, #5d87ff);
}

.erp-command-palette__item.is-current {
    background: rgba(93, 135, 255, 0.14);
    color: var(--bs-primary, #5d87ff);
    font-weight: 600;
}

.erp-command-palette__footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.75rem 1rem 0.875rem;
    background: #fafbfc;
}

.erp-command-palette__recents-wrap {
    margin-bottom: 0.625rem;
}

.erp-command-palette__recents {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 0.25rem;
}

.erp-command-palette__recent {
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    color: #334155;
    cursor: pointer;
}

.erp-command-palette__recent:hover {
    border-color: rgba(93, 135, 255, 0.35);
    color: var(--bs-primary, #5d87ff);
}

.erp-command-palette__hints {
    font-size: 0.75rem;
    text-align: right;
    color: #94a3b8 !important;
}

@media (max-width: 991.98px) {
    :root {
        --erp-topbar-height: 7.5rem;
    }

    .erp-command-palette-layout .body-wrapper {
        padding-top: var(--erp-chrome-height);
    }

    .erp-topbar__inner {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .erp-topbar__title {
        display: none;
    }

    .erp-topbar__palette {
        order: -1;
        flex: 1 1 100%;
        max-width: none;
    }

    .erp-topbar__actions {
        margin-left: 0;
    }

    .erp-command-palette__body {
        grid-template-columns: 1fr;
    }

    .erp-command-palette__modules {
        border-right: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .erp-command-palette__module-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .erp-command-palette__module {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .erp-command-palette__item-grid {
        grid-template-columns: 1fr;
    }

    .erp-command-palette__hints {
        text-align: left;
    }
}

/* Approval inbox (desktop) */
.approval-inbox-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-top: 2.5rem;
}

.approval-inbox-kpis {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    padding: 0 0 1.5rem;
    border-bottom: 1px solid #eef2f7;
}

.approval-inbox-kpi {
    flex: 1 1 auto;
    min-width: 9.5rem;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    min-height: auto;
}

.approval-inbox-kpi__label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    line-height: 1.3;
}

.approval-inbox-kpi__row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.approval-inbox-kpi__value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: #1e293b;
}

.approval-inbox-kpi__suffix {
    font-size: 0.875rem;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1.2;
}

.approval-inbox-kpi__text {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
}

.approval-inbox-kpi__link {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    line-height: 1.2;
}

.approval-inbox-kpi__link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.approval-inbox-kpi--alert .approval-inbox-kpi__label,
.approval-inbox-kpi--alert .approval-inbox-kpi__value,
.approval-inbox-kpi--alert .approval-inbox-kpi__suffix {
    color: #a67233;
}

/* Toolbar: tabs + filters */
.approval-inbox-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
}

.approval-inbox-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #f1f5f9;
    border-radius: 999px;
}

.approval-inbox-tabs__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.approval-inbox-tabs__item:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.6);
}

.approval-inbox-tabs__item.is-active {
    background: #4f6ef7;
    color: #fff;
    box-shadow: 0 1px 2px rgba(79, 110, 247, 0.35);
}

.approval-inbox-tabs__count {
    font-size: 0.75rem;
    font-weight: 700;
    color: inherit;
    opacity: 0.85;
}

.approval-inbox-tabs__count--urgent {
    color: #ea580c;
}

.approval-inbox-tabs__count--warn {
    color: #a67233;
}

.approval-inbox-tabs__item.is-active .approval-inbox-tabs__count,
.approval-inbox-tabs__count.is-active {
    color: inherit;
    opacity: 1;
}

.approval-inbox-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    flex: 1 1 auto;
    min-width: 0;
}

.approval-inbox-filters__field {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.approval-inbox-filters__field--search {
    flex: 1 1 12rem;
    min-width: 10rem;
}

.approval-inbox-filters__field--sort {
    margin-left: auto;
}

.approval-inbox-filters__label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}

.approval-inbox-filters__label i {
    font-size: 0.9rem;
    color: #94a3b8;
}

.approval-inbox-filters__select {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.35rem 1.75rem 0.35rem 0.6rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
    max-width: 11rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.45rem center;
}

.approval-inbox-filters__select:focus {
    outline: none;
    border-color: #4f6ef7;
    box-shadow: 0 0 0 2px rgba(79, 110, 247, 0.15);
}

.approval-inbox-filters__search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.35rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
}

.approval-inbox-filters__search i {
    color: #94a3b8;
    font-size: 1rem;
    flex-shrink: 0;
}

.approval-inbox-filters__search-input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.8125rem;
    color: #1e293b;
    background: transparent;
    min-width: 0;
}

.approval-inbox-filters__search-input::placeholder {
    color: #94a3b8;
}

/* Bulk action bar */
.approval-inbox-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.625rem;
    background: #f0f4ff;
}

.approval-inbox-bulk-bar__count {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.approval-inbox-bulk-bar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.approval-inbox-bulk-bar__clear {
    border: none;
    background: transparent;
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
}

.approval-inbox-bulk-bar__clear:hover {
    color: #64748b;
}

/* Table */
.approval-inbox-table__select-col {
    width: 2.5rem;
    vertical-align: middle;
}

.approval-inbox-card {
    border: 1px solid #e8edf4;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #fff;
}

.approval-inbox-table {
    --bs-table-hover-bg: #f8fafc;
}

.approval-inbox-table th {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    color: #1e293b;
    white-space: nowrap;
    border-bottom: 1px solid #eef2f7;
    padding: 0.75rem 1rem;
    background: #fff;
}

.approval-inbox-table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.approval-inbox-table tbody tr:last-child td {
    border-bottom: none;
}

.approval-inbox-cell-main {
    font-weight: 400;
    color: #1e293b;
    line-height: 1.35;
}

.approval-inbox-cell-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.35;
    margin-top: 0.1rem;
}

.approval-inbox-doc {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.approval-inbox-doc__dot {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    margin-top: 0.45rem;
    border-radius: 50%;
    background: #ea580c;
}

.approval-inbox-doc__num {
    font-weight: 400;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.875rem;
}

.approval-inbox-doc__num:hover {
    color: #4f6ef7;
    text-decoration: underline;
}

.approval-inbox-doc__type {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 400;
}

.approval-inbox-badge {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
}

.approval-inbox-concept__text {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.approval-inbox-budget {
    display: flex;
    align-items: center;
}

.approval-inbox-budget__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    line-height: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.approval-inbox-budget__trigger:hover,
.approval-inbox-budget__trigger:focus-visible {
    background: #f8fafc;
    border-color: #e5eaf2;
}

.approval-inbox-budget__trigger:focus-visible {
    outline: 2px solid rgba(93, 135, 255, 0.35);
    outline-offset: 2px;
}

.approval-inbox-budget__dot {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
}

.approval-inbox-budget__dot--success {
    background: #22c55e;
}

.approval-inbox-budget__dot--warning {
    background: #f59e0b;
}

.approval-inbox-budget__dot--danger {
    background: #ef4444;
}

.approval-inbox-budget__dot--muted {
    background: #cbd5e1;
}

.approval-inbox-budget-detail__meta {
    display: grid;
    gap: 0.15rem;
    line-height: 1.4;
}

.approval-inbox-budget-detail__meta-label {
    color: #64748b;
}

.approval-inbox-budget-detail__calc {
    display: grid;
    gap: 0.35rem;
}

.approval-inbox-budget-detail__row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: baseline;
    font-size: 0.875rem;
}

.approval-inbox-budget-detail__row dt {
    margin: 0;
    font-weight: 500;
    color: #64748b;
}

.approval-inbox-budget-detail__row dd {
    margin: 0;
    text-align: right;
    color: #1e293b;
}

.approval-inbox-budget-detail__row--minus dt::before {
    content: '− ';
    color: #94a3b8;
}

.approval-inbox-budget-detail__row--equals {
    border-top: 1px solid #eef2f7;
    padding-top: 0.35rem;
    margin-top: 0.15rem;
}

.approval-inbox-budget-detail__row--equals dt::before {
    content: '= ';
    color: #64748b;
    font-weight: 600;
}

.approval-inbox-budget-detail__row--result dt,
.approval-inbox-budget-detail__row--result dd {
    font-weight: 600;
    color: #1e293b;
}

.approval-inbox-budget-detail__row--result.is-exceeded dd {
    color: #dc2626;
}

.approval-inbox-waiting {
    font-weight: 400;
    color: #64748b;
    font-size: 0.875rem;
}

.approval-inbox-waiting--urgent {
    color: #ea580c;
}

.approval-inbox-empty {
    color: #94a3b8;
    padding: 3rem 1rem !important;
}

/* Row action buttons */
.approval-inbox-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}

.approval-inbox-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.approval-inbox-btn--lg {
    padding: 0.45rem 0.9rem;
    border-radius: 0.5rem;
}

.approval-inbox-btn--view {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-color: #e2e8f0;
    background: #fff;
    color: #64748b;
}

.approval-inbox-btn--view:hover {
    border-color: #cbd5e1;
    color: #334155;
    background: #f8fafc;
}

.approval-inbox-btn--approve {
    border-color: #22c55e;
    background: #22c55e;
    color: #fff;
}

.approval-inbox-btn--approve:hover {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.approval-inbox-btn--reject {
    border-color: #fecaca;
    background: #fff;
    color: #dc2626;
}

.approval-inbox-btn--reject:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #b91c1c;
}

@media (max-width: 1200px) {
    .approval-inbox-kpis {
        gap: 1rem 1.5rem;
    }

    .approval-inbox-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .approval-inbox-filters__field--sort {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .approval-inbox-page {
        padding-top: 1.5rem;
    }

    .approval-inbox-kpis {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .approval-inbox-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .approval-inbox-filters__field--search {
        flex: 1 1 auto;
    }

    .approval-inbox-actions {
        flex-direction: column;
        align-items: flex-end;
    }
}

/* Global page loader (Turbo navigation + ajax list first fetch) */
.erp-page-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(2px);
    pointer-events: none;
}

html.erp-page-loading-visible .erp-page-loader {
    display: flex;
    pointer-events: auto;
}

html.erp-page-loading-visible {
    overflow: hidden;
}

.erp-page-loader__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 8px 32px rgba(20, 38, 77, 0.12);
    border: 1px solid rgba(20, 38, 77, 0.08);
}

.erp-page-loader__spinner {
    width: 2rem;
    height: 2rem;
}

.erp-page-loader__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--kolossus-blue-deep, #14264d);
}

.po-capture-page.inventory-revaluation-form > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.po-capture-page.inventory-revaluation-form > form > .po-capture-card {
    flex: 1 1 auto;
    min-height: 0;
}

.po-capture-page.inventory-revaluation-form .inv-reval-capture-grid {
    display: grid;
    grid-template-columns: minmax(11rem, 1fr) minmax(0, 2.2fr) auto;
    gap: 1rem;
    align-items: end;
}

.po-capture-page.inventory-revaluation-form .inv-reval-capture-grid__action {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.po-capture-page.inventory-revaluation-form .inv-reval-lines-table thead th {
    color: var(--bs-body-color);
    font-weight: 600;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    white-space: nowrap;
}

.po-capture-page.inventory-revaluation-form .inv-reval-lines-table__new-cost-col {
    width: 9rem;
}

.po-capture-page.inventory-revaluation-form .inv-reval-line__item {
    min-width: 12rem;
}

.po-capture-page.inventory-revaluation-form .inv-reval-line__item .fw-semibold {
    font-size: 0.9375rem;
}

.po-capture-page.inventory-revaluation-form .inv-reval-line__warehouse {
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
}

.po-capture-page.inventory-revaluation-form .inv-reval-new-cost-input {
    max-width: 8.5rem;
    margin-left: auto;
    background: var(--bs-tertiary-bg);
    border-color: transparent;
    font-weight: 600;
}

.po-capture-page.inventory-revaluation-form .inv-reval-new-cost-input:focus {
    background: #fff;
    border-color: var(--bs-primary);
}

.po-capture-page.inventory-revaluation-form .inv-reval-new-cost-input::placeholder {
    color: var(--bs-secondary-color);
    font-weight: 400;
}

.po-capture-page.inventory-revaluation-form .inv-reval-sidebar__notice {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.po-capture-page.inventory-revaluation-form .inv-reval-sidebar__notice .ti {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.po-capture-page.inventory-revaluation-form .inv-reval-notes-textarea {
    min-height: 12rem;
}

@media (max-width: 991.98px) {
    .po-capture-page.inventory-revaluation-form .inv-reval-capture-grid {
        grid-template-columns: 1fr;
    }
}

.document-relationship-modal .modal-dialog.document-relationship-modal__dialog {
    width: auto;
    max-width: min(96vw, 1400px);
    height: auto;
    max-height: min(92vh, 900px);
    margin: 1.75rem auto;
}

.document-relationship-modal .modal-dialog.document-relationship-modal__dialog--compact {
    min-width: min(22rem, 96vw);
}

.document-relationship-modal .modal-dialog.document-relationship-modal__dialog--medium {
    min-width: min(36rem, 96vw);
}

.document-relationship-modal .modal-dialog.document-relationship-modal__dialog--wide {
    min-width: min(52rem, 96vw);
}

.document-relationship-modal .modal-dialog.document-relationship-modal__dialog--full {
    width: min(96vw, 1400px);
    max-width: min(96vw, 1400px);
}

.document-relationship-modal .modal-content.document-relationship-modal__content {
    height: auto;
    max-height: min(92vh, 900px);
    display: flex;
    flex-direction: column;
}

.document-relationship-modal .document-relationship-modal__body {
    flex: 0 1 auto;
    overflow: auto;
    background: #f8f9fb;
    max-height: calc(min(92vh, 900px) - 7.5rem);
}

.document-audit-modal .modal-dialog.document-audit-modal__dialog {
    width: auto;
    min-width: min(22rem, 96vw);
    max-width: min(28rem, 96vw);
    margin: 1.75rem auto;
}

.document-audit-modal .modal-content.document-audit-modal__content {
    display: flex;
    flex-direction: column;
}

.document-audit-modal .document-audit-modal__body {
    padding: 1.25rem;
    background: #f8f9fb;
}

.document-audit-panel__row {
    display: grid;
    grid-template-columns: minmax(6.5rem, 8.5rem) minmax(0, 1fr);
    gap: 0.35rem 1rem;
    padding: 0.4rem 0;
}

.document-audit-panel__row + .document-audit-panel__row {
    border-top: 1px solid #e9ecef;
}

.document-audit-panel__row dt {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6c757d;
}

.document-audit-panel__row dd {
    margin: 0;
    font-size: 0.875rem;
    color: #212529;
}

.document-audit-modal__tabs {
    border-bottom: 0;
    margin: 0 -0.25rem;
}

.document-audit-modal__tabs .nav-link {
    padding: 0.45rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6c757d;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}

.document-audit-modal__tabs .nav-link.active {
    color: #212529;
    background: transparent;
    border-bottom-color: var(--bs-primary, #0d6efd);
}

.document-audit-modal .modal-dialog.document-audit-modal__dialog--wide {
    min-width: min(42rem, 96vw);
    max-width: min(56rem, 96vw);
}

.document-change-log-panel__toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

.document-change-log-table__select {
    width: 2.5rem;
}

.document-change-log-table__checkbox {
    margin: 0;
}

.document-change-log-diff__title {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.document-change-log-diff-table__old {
    color: #842029;
    word-break: break-word;
}

.document-change-log-diff-table__new {
    color: #0f5132;
    word-break: break-word;
}

.document-relationship-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #e9ecef;
    background: #fff;
    flex-shrink: 0;
}

.document-relationship-footer__legend {
    flex: 1 1 auto;
    min-width: 0;
}

.document-relationship-footer__close {
    flex-shrink: 0;
}

.document-relationship-footer__close--text {
    width: auto;
    min-width: 32px;
    height: 32px;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.document-relationship-map {
    overflow-x: auto;
    max-width: 100%;
}

.document-relationship-map__canvas {
    position: relative;
    overflow: visible;
    width: fit-content;
    max-width: none;
    margin: 0 auto;
    padding: 1.35rem 1.5rem 1.5rem;
}

.document-relationship-map__grid {
    display: grid;
    grid-template-columns: repeat(var(--relationship-columns, 1), minmax(15.25rem, 16.5rem));
    grid-template-rows: auto repeat(var(--relationship-lanes, 1), minmax(8.5rem, auto));
    column-gap: 3.25rem;
    row-gap: 1.35rem;
    align-items: stretch;
    justify-content: center;
}

.document-relationship-map__links {
    position: absolute;
    top: 0;
    left: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 1;
}

.document-relationship-map__link {
    fill: none;
    stroke: #4b5563;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.document-relationship-map__link--active {
    stroke: #334155;
}

.document-relationship-map__arrowhead {
    fill: #4b5563;
}

.document-relationship-map__arrowhead--active {
    fill: #334155;
}

.document-relationship-map__heading,
.document-relationship-map__lane {
    position: relative;
    z-index: 2;
}

.document-relationship-map__heading {
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.document-relationship-map__lane {
    display: flex;
    align-items: stretch;
    min-height: 8.5rem;
}

.document-relationship-summary__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 11rem;
}

.document-relationship-summary__ring {
    --ring-color: #0d6efd;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    background: var(--ring-color);
}

.document-relationship-summary__ring--closed {
    --ring-color: #2d8a54;
}

.document-relationship-summary__ring--open {
    --ring-color: #c98a2e;
}

.document-relationship-summary__ring--due_soon {
    --ring-color: #d9872a;
}

.document-relationship-summary__ring--overdue {
    --ring-color: #b85c4a;
}

.document-relationship-summary__ring--cancelled {
    --ring-color: #2d8a54;
}

.document-relationship-summary__ring--partial {
    background: conic-gradient(
        #2d8a54 0deg calc(var(--ring-progress, 50) * 3.6deg),
        #d8d4e8 calc(var(--ring-progress, 50) * 3.6deg) 360deg
    );
}

.document-relationship-summary__ring-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
}

.document-relationship-summary__ring-inner .ti {
    font-size: 1.35rem;
    line-height: 1;
}

.document-relationship-summary__label {
    margin-top: 0.55rem;
    font-size: 0.8125rem;
    line-height: 1.25;
    color: #5a6a7e;
}

.document-relationship-summary__item--active .document-relationship-summary__label {
    font-weight: 700;
    color: #1f2937;
}

.document-relationship-summary__count {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: #8a96a8;
}

.document-relationship-map__connector {
    display: none;
}

.document-relationship-node {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    border: 1px solid #dbe1ea;
    border-radius: 0.6rem;
    background: #fff;
    padding: 0.85rem 0.95rem 0.9rem 1rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.document-relationship-node--anchor {
    border-left: 4px solid #0d6efd;
    padding-left: calc(1rem - 3px);
}

.document-relationship-node--restricted {
    opacity: 0.75;
}

.document-relationship-node__link {
    z-index: 1;
}

.document-relationship-node__type {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-bottom: 0.35rem;
}

.document-relationship-node__title {
    font-size: 0.95rem;
    font-weight: 600;
}

.document-relationship-node__subtitle,
.document-relationship-node__due {
    font-size: 0.8125rem;
}

.document-relationship-node__tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.document-status-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}

.document-status-tag--closed {
    background: #d1e7dd;
    color: #0f5132;
}

.document-status-tag--cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

.document-status-tag--open {
    background: #cfe2ff;
    color: #084298;
}

.document-status-tag--due_soon {
    background: #ffe5d0;
    color: #984c0c;
}

.document-status-tag--overdue {
    background: #f8d7da;
    color: #842029;
}

.document-status-tag--draft {
    background: #fef5e7;
    color: #a67233;
}

.document-status-tag--muted {
    background: #f3f4f6;
    color: #6b7280;
}

.document-relationship-node__badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.document-relationship-node__badge {
    background: #cff4fc;
    color: #055160;
}

.document-relationship-node__amount {
    margin-top: auto;
    padding-top: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.document-relationship-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    font-size: 0.8125rem;
}

.document-relationship-legend__title {
    font-weight: 600;
    margin-right: 0.25rem;
}

.document-relationship-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.document-relationship-legend__dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    display: inline-block;
}

.document-relationship-legend__item--closed .document-relationship-legend__dot {
    background: #198754;
}

.document-relationship-legend__item--open .document-relationship-legend__dot {
    background: #0d6efd;
}

.document-relationship-legend__item--due_soon .document-relationship-legend__dot {
    background: #fd7e14;
}

.document-relationship-legend__item--overdue .document-relationship-legend__dot {
    background: #dc3545;
}

.document-relationship-legend__bar {
    width: 0.2rem;
    height: 1rem;
    background: #0d6efd;
    display: inline-block;
    border-radius: 1px;
}

/* Classic ERP desktop — multi-view workspace */
.erp-command-palette-layout #main-wrapper {
    height: 100svh;
    max-height: 100svh;
    overflow: hidden;
}

.erp-command-palette-layout .page-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
}

.erp-desktop-workspace {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.erp-workspace-tabs {
    display: none;
    flex: 0 0 auto;
    align-items: stretch;
    gap: 0.35rem;
    width: 100%;
    padding: 0.5rem 0.75rem 0;
    margin: 0;
    overflow: visible;
    background-color: #eef1f7;
    background-image: linear-gradient(#d4dbe8, #d4dbe8);
    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: 100% 1px;
    border-bottom: 0;
    border-radius: 0;
}

.erp-desktop-workspace--has-tabs .erp-workspace-tabs {
    display: flex;
}

.erp-workspace-tabs__list {
    display: flex;
    align-items: flex-end;
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.2rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.erp-workspace-overflow {
    position: relative;
    flex: 0 0 auto;
    align-self: center;
    margin: 0 0.1rem 0.35rem 0;
    z-index: 8;
}

.erp-workspace-overflow__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 1.85rem;
    padding: 0.15rem 0.5rem 0.15rem 0.45rem;
    border: 1px solid #d8dee9;
    border-radius: 999px;
    background: #fff;
    color: #5c6578;
    box-shadow: 0 1px 3px rgba(24, 31, 48, 0.06);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.erp-workspace-overflow__toggle:hover,
.erp-workspace-overflow.is-open .erp-workspace-overflow__toggle {
    background: #f8fafc;
    border-color: #c5ced9;
    color: #334155;
}

.erp-workspace-overflow__count {
    min-width: 0.75rem;
    text-align: center;
}

.erp-workspace-overflow__toggle .ti {
    font-size: 0.95rem;
}

.erp-workspace-overflow__chevron {
    font-size: 0.8rem !important;
    color: #8b93a7;
}

.erp-workspace-overflow__menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: 16.5rem;
    max-width: 22rem;
    max-height: min(24rem, 70vh);
    overflow-y: auto;
    padding: 0.35rem 0;
    border: 1px solid #e6ebf3;
    border-radius: 0.85rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(24, 31, 48, 0.14);
}

.erp-workspace-overflow__item {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    border: 0;
    background: transparent;
    color: #4b5563;
    text-align: left;
    font-size: 0.875rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.erp-workspace-overflow__item:hover {
    background: #f7f8fb;
}

.erp-workspace-overflow__item.is-active {
    background: #f3f5fa;
    color: #1a1f2c;
    font-weight: 700;
}

.erp-workspace-overflow__item.is-active:first-child {
    border-radius: 0.75rem 0.75rem 0 0;
}

.erp-workspace-tab {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    max-width: 18rem;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 0.75rem 0.75rem 0 0;
    background: transparent;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.erp-workspace-tab:hover:not(.is-active) {
    background: #e4e9f3;
}

.erp-workspace-tab.is-active {
    position: relative;
    z-index: 1;
    background: #fff;
    border-color: #d4dbe8;
    border-bottom-color: #fff;
    box-shadow: 0 -3px 10px rgba(24, 31, 48, 0.05);
}

.erp-workspace-tab.is-active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: #fff;
}

.erp-workspace-tab__label {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 15rem;
    min-height: 2.25rem;
    padding: 0.55rem 0.35rem 0.6rem 0.85rem;
    border: 0;
    background: transparent;
    color: #7a8494;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.35;
    cursor: pointer;
    transition: color 0.12s ease;
}

.erp-workspace-tab:hover:not(.is-active) .erp-workspace-tab__label {
    color: #4b5563;
}

.erp-workspace-tab.is-active .erp-workspace-tab__label {
    color: #1a1f2c;
    font-weight: 700;
}

.erp-workspace-tab__text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
}

.erp-workspace-tab__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 1.65rem;
    min-height: 2.25rem;
    padding: 0 0.65rem 0 0.1rem;
    border: 0;
    background: transparent;
    color: #9aa3af;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.12s ease;
}

.erp-workspace-tab.is-active .erp-workspace-tab__close {
    color: #6b7280;
}

.erp-workspace-tab__close:hover {
    color: #374151;
}

.erp-workspace-panels {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    position: relative;
    background: #fff;
    overflow: hidden;
}

.erp-workspace-panel {
    display: none;
    min-height: 0;
}

.erp-workspace-panel.is-active {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.erp-workspace-panel.is-active:has(.data-list-page),
.erp-workspace-panel.is-active:has(.po-capture-page:not(.gr-show-page):not(.ap-show-page)) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.erp-workspace-panel.is-active:has(.po-capture-page:not(.gr-show-page):not(.ap-show-page)) > .container-fluid,
.erp-workspace-panel.is-active:has(.po-capture-page:not(.gr-show-page):not(.ap-show-page)) .erp-workspace-frame-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.erp-workspace-panel.is-active:has(.po-capture-page.gr-show-page),
.erp-workspace-panel.is-active:has(.po-capture-page.ap-show-page) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.erp-workspace-panel.is-active:has(.po-capture-page.gr-show-page) > .container-fluid,
.erp-workspace-panel.is-active:has(.po-capture-page.ap-show-page) > .container-fluid,
.erp-workspace-panel.is-active:has(.po-capture-page.gr-show-page) .erp-workspace-frame-body,
.erp-workspace-panel.is-active:has(.po-capture-page.ap-show-page) .erp-workspace-frame-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.erp-workspace-frame-body {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Data list — fill remaining workspace; scroll only the rows */
#main-wrapper:has(.erp-workspace-panel.is-active .data-list-page),
.page-wrapper:has(.erp-workspace-panel.is-active .data-list-page) {
    height: 100svh;
    max-height: 100svh;
    min-height: 0;
    overflow: hidden;
}

.page-wrapper:has(.erp-workspace-panel.is-active .data-list-page) {
    display: flex;
    flex-direction: column;
}

.body-wrapper:has(.erp-workspace-panel.is-active .data-list-page) {
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.body-wrapper:has(.erp-workspace-panel.is-active .data-list-page) > .container-fluid {
    display: flex;
    flex-direction: column;
    height: calc(100svh - var(--erp-chrome-height) - 1rem);
    max-height: calc(100svh - var(--erp-chrome-height) - 1rem);
    min-height: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}

.body-wrapper.erp-desktop-workspace:has(.erp-workspace-panel.is-active .data-list-page) {
    display: flex;
    flex-direction: column;
}

.body-wrapper.erp-desktop-workspace:has(.erp-workspace-panel.is-active .data-list-page) .erp-workspace-panels {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    width: 100%;
    overflow: hidden;
}

.body-wrapper.erp-desktop-workspace:has(.erp-workspace-panel.is-active .data-list-page) .erp-workspace-panel.is-active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    width: 100%;
    overflow: hidden;
}

.body-wrapper.erp-desktop-workspace:has(.erp-workspace-panel.is-active .data-list-page) turbo-frame.erp-workspace-panel.is-active,
.body-wrapper.erp-desktop-workspace:has(.erp-workspace-panel.is-active .data-list-page) .erp-workspace-panel.is-active > turbo-frame {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    width: 100%;
    overflow: hidden;
}

.body-wrapper.erp-desktop-workspace:has(.erp-workspace-panel.is-active .data-list-page) .erp-workspace-panel.is-active > .container-fluid,
.body-wrapper.erp-desktop-workspace:has(.erp-workspace-panel.is-active .data-list-page) .erp-workspace-frame-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 0;
}

.data-list-page {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    width: 100%;
    background: #fff;
    overflow: hidden;
}

.data-list-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem 0;
    flex-shrink: 0;
    border-bottom: 1px solid #e8edf3;
}

.data-list-tabs {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    min-width: 0;
    overflow-x: auto;
}

.data-list-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    padding: 0.65rem 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.data-list-tab.is-active {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
}

.data-list-tab__close {
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.data-list-tab__close:hover {
    color: #334155;
}

.data-list-page__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding-bottom: 0.5rem;
}

.data-list-dirty {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    color: #64748b;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.data-list-dirty[hidden] {
    display: none !important;
}

.data-list-table-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    min-width: 0;
    width: 100%;
    align-self: stretch;
}

.data-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    min-width: 0;
    width: 100%;
    align-self: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
}

.data-list-table {
    width: 100% !important;
    min-width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

.data-list-page-stack {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    width: 100%;
    overflow: hidden;
}

.data-list-page-stack .data-list-page {
    flex: 1 1 auto;
}

.data-list-col--docNum { width: 11%; }
.data-list-col--docDate { width: 10%; }
.data-list-col--businessPlace { width: 14%; }
.data-list-col--vendor { width: 22%; }
.data-list-col--docTotal { width: 12%; }
.data-list-col--status { width: 16%; }
.data-list-col--docStatus { width: 14%; }
.data-list-col--basePurchaseOrder,
.data-list-col--baseApInvoice,
.data-list-col--vendorDocType { width: 12%; }
.data-list-col--houseBank { width: 10%; }
.data-list-col--number { width: 12%; }
.data-list-col--refDate { width: 10%; }
.data-list-col--memo { width: 28%; }
.data-list-col--debitTotal { width: 12%; }
.data-list-col--revalType { width: 16%; }
.data-list-col--canceled { width: 14%; }
.data-list-col--requestedQty,
.data-list-col--openQty { width: 10%; }
.data-list-col--pendingAmount,
.data-list-col--netPayable,
.data-list-col--openBalance { width: 12%; }
.data-list-col--numAtCard { width: 12%; }
.data-list-col--taxDate,
.data-list-col--docDueDate { width: 10%; }
.data-list-col--cardCode,
.data-list-col--itemCode,
.data-list-col--acctCode,
.data-list-col--whsCode,
.data-list-col--trnspCode,
.data-list-col--groupCode,
.data-list-col--itmsGrpCod { width: 14%; }
.data-list-col--cardName,
.data-list-col--itemName,
.data-list-col--acctName,
.data-list-col--whsName,
.data-list-col--trnspName,
.data-list-col--name,
.data-list-col--prcName,
.data-list-col--dimName,
.data-list-col--slpName,
.data-list-col--currName,
.data-list-col--wtName,
.data-list-col--ugpName,
.data-list-col--uomName,
.data-list-col--ocrName,
.data-list-col--prjName,
.data-list-col--expnsName,
.data-list-col--listName,
.data-list-col--warehouseName,
.data-list-col--discName,
.data-list-col--templateName,
.data-list-col--displayName,
.data-list-col--pymntGroup,
.data-list-col--seriesName { width: 24%; }

.data-list-col--code,
.data-list-col--prcCode,
.data-list-col--dimCode,
.data-list-col--slpCode,
.data-list-col--currCode,
.data-list-col--wtCode,
.data-list-col--ugpCode,
.data-list-col--uomCode,
.data-list-col--ocrCode,
.data-list-col--prjCode,
.data-list-col--expnsCode,
.data-list-col--cntctCode,
.data-list-col--empId,
.data-list-col--listNum,
.data-list-col--binCode,
.data-list-col--bplId,
.data-list-col--groupNum,
.data-list-col--series,
.data-list-col--id { width: 14%; }

.data-list-col--rateDate,
.data-list-col--effecDate,
.data-list-col--expDate,
.data-list-col--validFrom,
.data-list-col--validTo,
.data-list-col--createdAt,
.data-list-col--fRefDate,
.data-list-col--tRefDate { width: 10%; }

.data-list-col--active,
.data-list-col--locked,
.data-list-col--valid,
.data-list-col--validFor,
.data-list-col--dimActive,
.data-list-col--isActive,
.data-list-col--inactive { width: 12%; }

.data-list-table th,
.data-list-table td {
    vertical-align: middle;
    box-sizing: border-box;
}

.data-list-table thead th {
    position: sticky;
    font-weight: 600;
    color: #334155;
    border-bottom: 0;
    padding: 0.35rem 0.5rem 0.25rem;
    background: #fff;
    white-space: nowrap;
    overflow: visible;
}

.data-list-table tbody td {
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-list-table th:first-child,
.data-list-table td:first-child {
    padding-left: 1rem;
}

.data-list-table th:last-child,
.data-list-table td:last-child {
    padding-right: 1rem;
}

.data-list-table thead tr:first-child th {
    top: 0;
    z-index: 3;
}

.data-list-table thead tr.data-list-filter-row th {
    top: var(--data-list-label-row-height, 2.75rem);
    z-index: 4;
    font-weight: 400;
    padding-top: 0;
    padding-bottom: 0.65rem;
    box-shadow: inset 0 -1px 0 #e8edf3;
}

.data-list-filter-row .form-control,
.data-list-filter-row .form-select,
.data-list-enum__toggle {
    min-width: 0;
    width: 100%;
}

.data-list-doc-link,
.data-list-doc-link:hover,
.data-list-doc-link:focus {
    color: var(--bs-primary);
    font-weight: 600;
    text-decoration: none;
}

.data-list-not-filterable {
    color: #94a3b8;
    font-size: 0.875rem;
}

.data-list-date-range {
    position: relative;
    display: block;
    min-width: 0;
    width: 100%;
}

.data-list-autocomplete {
    min-width: 0;
    width: 100%;
}

.data-list-autocomplete-multi__menu {
    min-width: 16rem;
}

.data-list-autocomplete-multi__options {
    margin-top: 0.35rem;
}

.data-list-autocomplete-multi__options[hidden] {
    display: none !important;
    margin-top: 0;
}

.data-list-date-range .form-control {
    min-width: 0;
    width: 100%;
    cursor: pointer;
    font-size: 0.75rem;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.data-list-date-range:focus-within .form-control {
    padding-right: 1.75rem;
}

.daterangepicker td.active,
.daterangepicker td.active:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.daterangepicker td.in-range {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
}

.data-list-enum {
    position: relative;
    display: block;
    width: 100%;
}

.data-list-enum__menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    max-height: 240px;
    overflow-y: auto;
    background-color: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
    padding: 0;
    margin-top: 0;
}

.data-list-enum__option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-weight: 400;
    color: var(--bs-body-color, #212529);
    cursor: pointer;
}

.data-list-enum__option:hover {
    background-color: var(--bs-tertiary-bg, #f8f9fa);
}

.data-list-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.65rem 1rem;
    border-top: 1px solid #e8edf3;
    color: #64748b;
    font-size: 0.875rem;
    flex-shrink: 0;
    background: #fff;
}

.data-list-footer__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.analytics-explorer-chart {
    min-height: 160px;
}

.analytics-explorer-row {
    cursor: pointer;
}

.analytics-explorer-cell {
    cursor: pointer;
}

.analytics-explorer-pivot th:first-child,
.analytics-explorer-pivot td:first-child {
    position: sticky;
    left: 0;
    background: var(--bs-body-bg, #fff);
    z-index: 1;
}

.analytics-explorer-pivot td[rowspan] {
    vertical-align: top;
}

.analytics-explorer-pivot thead tr:nth-child(2) th {
    font-weight: 500;
    font-size: 0.75rem;
}

/* Analytics explorer — full-width workspace layout */
#main-wrapper:has(.erp-workspace-panel.is-active .analytics-explorer-page),
.page-wrapper:has(.erp-workspace-panel.is-active .analytics-explorer-page) {
    height: 100svh;
    max-height: 100svh;
    min-height: 0;
    overflow: hidden;
}

.page-wrapper:has(.erp-workspace-panel.is-active .analytics-explorer-page) {
    display: flex;
    flex-direction: column;
}

.body-wrapper:has(.erp-workspace-panel.is-active .analytics-explorer-page) {
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.body-wrapper.erp-desktop-workspace:has(.erp-workspace-panel.is-active .analytics-explorer-page) {
    display: flex;
    flex-direction: column;
}

.body-wrapper.erp-desktop-workspace:has(.erp-workspace-panel.is-active .analytics-explorer-page) .erp-workspace-panels {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    width: 100%;
    overflow: hidden;
}

.body-wrapper.erp-desktop-workspace:has(.erp-workspace-panel.is-active .analytics-explorer-page) .erp-workspace-panel.is-active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    width: 100%;
    overflow: hidden;
}

.erp-workspace-panel.is-active:has(.analytics-explorer-page) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.erp-workspace-panel.is-active:has(.analytics-explorer-page) > .container-fluid {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 0;
}

.analytics-explorer-page {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    width: 100%;
    background: #fff;
    overflow: hidden;
}

.analytics-explorer {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    min-height: calc(100vh - 11rem);
    background: #fff;
    border: 1px solid #eceff5;
    border-radius: 0.75rem;
    overflow: hidden;
}

.analytics-explorer-page .analytics-explorer {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    width: 100%;
    border: 0;
    border-radius: 0;
}

.analytics-explorer-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 1rem 1.15rem;
    background: #fff;
    border-right: 1px solid #d5dbe6;
    min-width: 0;
}

.analytics-explorer-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    min-width: 0;
}

.analytics-explorer-dates > div {
    min-width: 0;
}

.analytics-explorer-dates input[type="date"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    font-size: 0.8125rem;
    padding-left: 0.5rem;
    padding-right: 0.4rem;
}

.analytics-explorer-dates input[type="date"]::-webkit-datetime-edit {
    min-width: 0;
    padding: 0;
}

.analytics-explorer-dates input[type="date"]::-webkit-calendar-picker-indicator {
    margin: 0;
    padding: 0;
    width: 1rem;
    cursor: pointer;
}

.analytics-explorer-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8b93a7;
}

.analytics-explorer-search {
    position: relative;
}

.analytics-explorer-search .ti {
    position: absolute;
    top: 50%;
    left: 0.65rem;
    transform: translateY(-50%);
    color: #8b93a7;
    pointer-events: none;
}

.analytics-explorer-search .form-control {
    padding-left: 1.85rem;
    border-radius: 999px;
    background: #fff;
}

.analytics-explorer-sidebar-measures {
    flex: 1;
    min-height: 0;
}

.analytics-explorer-sidebar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analytics-explorer-legend {
    font-size: 0.7rem;
    line-height: 1.35;
    color: #8b93a7;
}

.analytics-explorer-canvas {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.85rem 1.25rem 1.25rem;
}

.analytics-explorer-canvas-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.25rem;
}

.analytics-explorer-canvas-head .breadcrumb {
    font-size: 0.875rem;
}

.analytics-explorer-canvas-head .breadcrumb-item + .breadcrumb-item::before {
    content: '›';
}

.analytics-explorer-toolbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.analytics-explorer-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 0.55rem;
    background: #f4f6fb;
    color: #6c7385;
}

.analytics-explorer-tool.is-active,
.analytics-explorer-tool:hover {
    background: #e7eefc;
    color: #244895;
}

.analytics-explorer-table {
    --bs-table-bg: transparent;
}

.analytics-explorer-table thead th {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8b93a7;
    border-bottom-color: #eceff5;
}

.analytics-explorer-table tfoot td {
    border-top: 1px solid #eceff5;
    background: #fafbfe;
}

.analytics-pivot-well,
.analytics-pivot-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: flex-start;
    min-height: 44px;
}

.analytics-pivot-well {
    padding: 0.4rem;
    border: 1px solid #e4e8f1;
    border-radius: 0.7rem;
    background: #fff;
}

.analytics-pivot-palette {
    padding: 0.1rem 0;
    max-height: 160px;
    overflow-y: auto;
}

.analytics-pivot-well.is-over {
    border-color: #244895;
    background: rgba(36, 72, 149, 0.06);
}

.analytics-pivot-palette.is-over {
    background: rgba(36, 72, 149, 0.05);
    border-radius: 0.5rem;
}

.analytics-pivot-placeholder {
    color: #b0b6c4;
    font-size: 0.75rem;
    padding: 0.15rem 0.25rem;
}

.analytics-pivot-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border: 0;
    border-radius: 1rem;
    background: #244895;
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.3;
    cursor: grab;
    user-select: none;
}

.analytics-pivot-chip[data-kind="measure"] {
    background: #2bb38a;
}

.analytics-pivot-chip--palette[data-kind="dimension"] {
    background: #e7eefc;
    color: #3d5aa8;
}

.analytics-pivot-chip--palette[data-kind="measure"] {
    background: #e5f7f1;
    color: #2a9a7a;
}

.analytics-pivot-chip:active {
    cursor: grabbing;
}

.analytics-pivot-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    opacity: 0.8;
    line-height: 1;
}

.analytics-pivot-chip__remove:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.analytics-pivot-chip-placeholder {
    display: inline-block;
    min-width: 4.5rem;
    height: 1.55rem;
    border-radius: 1rem;
    border: 1px dashed #244895;
    background: rgba(36, 72, 149, 0.08);
}

@media (max-width: 991.98px) {
    .analytics-explorer {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .analytics-explorer-sidebar {
        border-right: 0;
        border-bottom: 1px solid #d5dbe6;
    }
}

.er-line-forms {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.expense-report-capture .er-dropzone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    margin-bottom: 1.25rem;
    border: 1px dashed #c5cde0;
    border-radius: 0.75rem;
    background: #f7f8fc;
    cursor: pointer;
}

.expense-report-capture .er-dropzone.is-dragover {
    border-color: #5d87ff;
    background: #eef3ff;
}

.expense-report-capture .er-dropzone__copy {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.expense-report-capture .er-dropzone__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: #e8eeff;
    color: #5d87ff;
    flex-shrink: 0;
}

.expense-report-capture .er-dropzone__title {
    font-weight: 600;
    color: #2a3547;
}

.expense-report-capture .er-dropzone__hint {
    font-size: 0.8125rem;
    color: #7c8ba1;
}

.expense-report-capture .er-receipts {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
}

.expense-report-capture .er-receipts__head {
    padding: 0.65rem 1rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #2a3547;
}

.expense-report-capture .er-receipts-table thead th {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7c8ba1;
    background: #fff;
    border-bottom-color: #edf0f5;
}

.expense-report-capture .er-receipts-table th:nth-child(2),
.expense-report-capture .er-receipts-table td:nth-child(2) {
    width: 7.5rem;
    white-space: nowrap;
}

.expense-report-capture .er-receipts-table th:nth-child(4),
.expense-report-capture .er-receipts-table td:nth-child(4) {
    width: 7rem;
}

.expense-report-capture .er-receipts-table th:nth-child(5),
.expense-report-capture .er-receipts-table td:nth-child(5) {
    width: 6.5rem;
}

.expense-report-capture .er-receipts-table th:nth-child(6),
.expense-report-capture .er-receipts-table td:nth-child(6) {
    width: 7.5rem;
    white-space: nowrap;
}

.expense-report-capture .er-receipts-table__icon {
    width: 2.25rem;
    color: #8b98ad;
}

.expense-report-capture .er-receipts-table__actions {
    width: 2rem;
}

.expense-report-capture .er-receipts-table__row {
    cursor: pointer;
}

.expense-report-capture .er-receipts-table__remove {
    border: 0;
    background: transparent;
    color: #fa896b;
    padding: 0.15rem;
    line-height: 1;
}

.expense-report-capture .er-receipts__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    border-top: 1px solid #edf0f5;
    font-weight: 600;
    color: #2a3547;
}

.expense-report-capture .er-capture-sidebar {
    background: #fff;
}

.expense-report-capture .er-sidebar__kicker {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7c8ba1;
    margin-bottom: 0.2rem;
}

.expense-report-capture .er-sidebar__name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2a3547;
}

.expense-report-capture .er-sidebar__meta {
    font-size: 0.8125rem;
    color: #7c8ba1;
    margin-bottom: 1.25rem;
}

.expense-report-capture .er-sidebar__stats {
    display: grid;
    gap: 0.55rem;
    margin: 0 0 1.25rem;
}

.expense-report-capture .er-sidebar__stats > div {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.expense-report-capture .er-sidebar__stats dt {
    margin: 0;
    font-weight: 400;
    color: #5a6a85;
}

.expense-report-capture .er-sidebar__stats dd {
    margin: 0;
    font-weight: 600;
    color: #2a3547;
}

.expense-report-capture .er-sidebar__footer {
    margin-top: auto;
    padding-top: 0.5rem;
}

.expense-report-capture .er-sidebar__reimburse {
    padding-top: 0.5rem;
}

.expense-report-capture .er-sidebar__amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2a3547;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.er-receipt-modal__dialog {
    max-width: 58rem;
}

.er-receipt-modal__content {
    overflow: hidden;
    border: 0;
    border-radius: 0.9rem;
}

.er-receipt-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid #edf0f5;
}

.er-receipt-modal__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.er-receipt-modal__filename {
    font-size: 0.8125rem;
    color: #7c8ba1;
}

.er-receipt-modal__body {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.2fr);
    min-height: 26rem;
}

.er-receipt-modal__preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f2633;
    padding: 1.25rem 1.25rem 3.5rem;
}

.er-receipt-modal__preview img {
    max-width: 100%;
    max-height: 22rem;
    border-radius: 0.35rem;
    background: #f4f1ea;
}

.er-receipt-modal__pdf {
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.er-receipt-modal__chip {
    position: absolute;
    right: 1.25rem;
    bottom: 3.6rem;
    padding: 0.15rem 0.5rem;
    border: 1px solid #5d87ff;
    border-radius: 0.35rem;
    background: #fff;
    color: #2a3547;
    font-size: 0.8125rem;
    font-weight: 600;
}

.er-receipt-modal__preview-actions {
    position: absolute;
    left: 50%;
    bottom: 0.85rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.er-receipt-modal__fields {
    padding: 1rem 1.25rem 0.5rem;
}

.er-receipt-modal__status {
    min-height: 1.25rem;
    margin-bottom: 0.85rem;
    font-size: 0.8125rem;
    color: #5a6a85;
}

.er-receipt-modal__status.is-ok {
    color: #13deb9;
}

.er-receipt-modal__status.is-ok::before {
    content: "✓ ";
}

.er-receipt-modal__net-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7c8ba1;
}

.er-receipt-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.15rem 1.1rem;
    border-top: 1px solid #edf0f5;
}

/* Controlled document rich body — Word-like tables when reading */
.cd-rich-body {
    font-family: Calibri, Arial, Helvetica, sans-serif;
    font-size: 11pt;
    line-height: 1.25;
    color: #000;
    background: #fff;
}

.cd-rich-body--page {
    max-width: 210mm;
    margin: 0 auto;
    padding: 16mm 18mm;
    border: 1px solid #d8dde6;
    background: #fff;
}

.cd-rich-body h1 {
    font-size: 14pt;
    text-align: center;
    margin: 0 0 14px;
}

.cd-rich-body h2 {
    font-size: 12pt;
    margin: 14px 0 8px;
}

.cd-rich-body h3 {
    font-size: 11pt;
    margin: 12px 0 6px;
}

.cd-rich-body p {
    margin: 0 0 6px;
}

.cd-rich-body ul,
.cd-rich-body ol {
    margin: 0 0 8px 22px;
    padding: 0;
}

.cd-rich-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0 12px;
}

.cd-rich-body td,
.cd-rich-body th {
    border: 1px solid #000;
    padding: 4px 6px;
    vertical-align: top;
}

.cd-rich-body img {
    max-width: 100%;
    height: auto;
}

.cd-rich-body .cd-word-header {
    text-align: center;
    margin: 0 0 12px;
}

.cd-rich-body .cd-word-header img {
    height: 56px;
    width: auto;
}

@media (max-width: 767.98px) {
    .er-receipt-modal__body {
        grid-template-columns: 1fr;
    }
}


