html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8fafc;
    color: #111827;
}

.erp-shell {
    display: flex;
    min-height: 100vh;
    background: #f8fafc;
}

.erp-sidebar {
    width: 280px;
    min-width: 280px;
    background: #101828;
    color: #fff;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.erp-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 40px;
    color: #fff;
    text-decoration: none;
}

    .erp-logo:hover {
        color: #fff;
    }

.erp-logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .32);
}

.erp-logo-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.1;
}

.erp-logo-subtitle {
    font-size: 12px;
    opacity: .62;
    margin-top: 3px;
}

.erp-menu {
    flex: 1;
}

.erp-menu-section {
    margin-top: 24px;
    margin-bottom: 10px;
    font-size: 11px;
    letter-spacing: 2px;
    opacity: .55;
    font-weight: 800;
}

.erp-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: rgba(255,255,255,.86);
    text-decoration: none;
    margin-bottom: 4px;
    transition: background .15s ease, transform .15s ease, color .15s ease;
    cursor: pointer;
    position: relative;
}

    .erp-menu-item:hover {
        background: rgba(255,255,255,.07);
        color: #fff;
        transform: translateX(3px);
    }

    .erp-menu-item.active {
        background: #2563eb;
        color: #fff;
        box-shadow: 0 8px 18px rgba(37,99,235,.26);
    }

    .erp-menu-item.disabled {
        opacity: .65;
    }

    .erp-menu-item.disabled.erp-menu-item-unavailable {
        opacity: 1;
        color: #cbd5e1;
        cursor: default;
    }

    .erp-menu-item.erp-menu-item-unavailable:hover {
        background: transparent;
        color: #cbd5e1;
        transform: none;
    }

.erp-menu-badge.erp-menu-unavailable-label {
    background: rgba(255,230,91,.14);
    color: #ffe65b;
    white-space: nowrap;
    flex-shrink: 0;
}

.erp-menu-icon {
    width: 22px;
    display: inline-flex;
    justify-content: center;
    font-size: 17px;
}

.erp-menu-badge {
    margin-left: auto;
    background: rgba(255,255,255,.10);
    color: rgba(255,255,255,.75);
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.erp-sidebar-footer {
    margin-top: 24px;
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 16px;
}

.erp-sidebar-footer-title {
    font-size: 13px;
    font-weight: 700;
}

.erp-sidebar-footer-subtitle {
    font-size: 12px;
    opacity: .55;
    margin-top: 2px;
}

.erp-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.erp-topbar {
    height: 76px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    box-shadow: 0 1px 3px rgba(16,24,40,.04);
}

.erp-top-title {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 800;
    color: #64748b;
}

.erp-top-subtitle {
    font-size: 22px;
    font-weight: 800;
    margin-top: 2px;
    color: #111827;
}

.erp-top-right {
    display: flex;
    align-items: center;
    gap: 22px;
}

.erp-top-actions {
    display: flex;
    gap: 10px;
}

/* Keep the notification badge above adjacent buttons, including their hover transforms.
   Dropdown menus retain their higher Bootstrap stacking level. */
.erp-top-actions [data-business-bell] > .erp-icon-button {
    z-index: 1;
}

    /* Velikost 40 × 40 velja samo za gumbe z ikonami neposredno v zgornji vrstici.
   Gumbi znotraj dropdown menijev (npr. "Počisti vse") ohranijo Bootstrap mere. */
    .erp-top-actions > .dropdown > .erp-icon-button {
        width: 40px;
        height: 40px;
        border: 1px solid #e5e7eb;
        background: #fff;
        border-radius: 12px;
        cursor: pointer;
        color: #334155;
    }

        .erp-top-actions > .dropdown > .erp-icon-button:hover {
            background: #f8fafc;
            border-color: #cbd5e1;
        }

/* Gumb za čiščenje obvestil naj se ne krči in naj ostane v eni vrstici. */
[data-erp-clear-notifications] {
    width: auto;
    height: auto;
    min-height: 32px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.erp-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.erp-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #eef4ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.erp-user-name {
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}

.erp-user-role {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
}

.erp-content {
    flex: 1;
    padding: 28px;
}

.erp-page {
    max-width: 1600px;
    margin: 0 auto;
}

.snapshot-review-table td { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 10rem; }
@media (max-width: 767.98px) {
    .snapshot-review-table thead { display: none; }
    .snapshot-review-table tbody, .snapshot-review-table tr, .snapshot-review-table th, .snapshot-review-table td { display: block; width: 100%; min-width: 0; }
    .snapshot-review-table tr { margin-bottom: 12px; }
    .snapshot-review-table td::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 600; color: #64748b; margin-bottom: 4px; }
}

.erp-app-version {
    position: relative;
    font-size: 12px;
    color: #64748b;
}

.erp-app-version-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    cursor: pointer;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    border-radius: 4px;
    padding: 4px 0;
}

.erp-app-version-trigger:focus-visible { outline: 2px solid #806000; outline-offset: 4px; }
.erp-app-version-number { font-variant-numeric: tabular-nums; font-weight: 600; }

.erp-app-version-modal .modal-content {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 16px 48px rgb(15 23 42 / 16%);
}
.erp-app-version-modal .modal-header { background: #fff9db; border-radius: 18px 18px 0 0; }
.erp-app-version-modal .modal-title { font-weight: 700; }
.erp-app-version-modal dt { color: #64748b; font-size: .8rem; font-weight: 500; margin-bottom: 4px; }
.erp-app-version-modal dd { overflow-wrap: anywhere; }
.erp-app-version-modal .erp-app-version-release { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.erp-app-version-close { background: #ffe65a; color: #252525; border: 1px solid #e6cd45; padding-inline: 24px; }
.erp-app-version-close:hover, .erp-app-version-close:focus-visible { background: #f5da40; color: #252525; border-color: #806000; }

.identity-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 20px;
}

@media print {
    .erp-app-version { display: none; }
}

.erp-footer {
    height: 48px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.erp-card {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

    .erp-card + .erp-card {
        margin-top: 18px;
    }

.erp-card-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
}

.erp-card-subtitle {
    color: #64748b;
    font-size: 13px;
    margin-top: 4px;
}

.erp-table {
    margin-top: 16px;
}

    .erp-table th {
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: #667085;
        border-bottom: 1px solid #e5e7eb;
        white-space: nowrap;
    }

    .erp-table td {
        padding: 16px 12px;
        vertical-align: middle;
    }

    .erp-table tbody tr:hover {
        background: #f8fafc;
    }

.erp-badge-issued,
.erp-badge-success,
.erp-badge-info,
.erp-badge-correction,
.erp-badge-draft,
.erp-badge-cancelled {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.erp-badge-issued,
.erp-badge-success {
    background: #dcfce7;
    color: #15803d;
}

.erp-badge-correction {
    background: #fef3c7;
    color: #b45309;
}

.erp-badge-draft {
    background: #e0f2fe;
    color: #0369a1;
}

.erp-badge-cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

.erp-kpi {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
    height: 100%;
}

.erp-kpi-label {
    font-size: 12px;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.erp-kpi-value {
    font-size: 28px;
    font-weight: 800;
    margin-top: 8px;
}

.erp-kpi-change {
    font-size: 13px;
    color: #16a34a;
    margin-top: 6px;
}

.erp-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.erp-page-title {
    font-size: 28px;
    font-weight: 850;
    margin: 0;
}

.erp-page-subtitle {
    color: #64748b;
    font-size: 14px;
    margin-top: 4px;
}

.erp-page-actions {
    display: flex;
    gap: 10px;
}



.erp-kpi-note {
    font-size: 13px;
    color: #64748b;
    margin-top: 8px;
}

.erp-filter {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.035);
}

.erp-muted-small {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.erp-table-tools {
    white-space: nowrap;
}

.erp-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #eef4ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.erp-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 20px;
    margin-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.erp-pagination-info {
    color: #64748b;
    font-size: 13px;
}

.erp-pagination .pagination {
    gap: 4px;
}

.erp-pagination .page-link {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    color: #334155;
    font-weight: 600;
    min-width: 38px;
    text-align: center;
}

.erp-pagination .page-item.active .page-link {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.erp-pagination .page-item.disabled .page-link {
    color: #94a3b8;
    background: #f8fafc;
}

.erp-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.erp-active-filter {
    background: #eef4ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
}

.erp-empty-state {
    padding: 56px 24px;
    text-align: center;
}

.erp-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: #eef4ff;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 18px;
}

.erp-empty-title {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.erp-empty-text {
    color: #64748b;
    margin-top: 6px;
}

.erp-bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
}

.erp-bulk-counter {
    font-weight: 700;
    color: #334155;
}

.erp-sort-link {
    color: #667085;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .erp-sort-link:hover {
        color: #2563eb;
    }

.erp-view-toolbar {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

/* =========================================================
   ERP V2 - Document Header
   Shared by invoices, quotes, credit notes, orders, etc.
   ========================================================= */

.erp-document-header {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.erp-list-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.erp-list-heading-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.erp-list-heading-tools .erp-document-eyebrow { margin-bottom: 0; }
.erp-list-heading-tools > .quote-status-help-button {
    color: var(--bs-secondary-color);
    border-color: transparent;
    background: transparent;
    font-weight: 400;
}
.erp-list-heading-tools > .quote-status-help-button:hover,
.erp-list-heading-tools > .quote-status-help-button:focus-visible {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}
@media (max-width: 600px) {
    .erp-list-heading { align-items: flex-start; flex-direction: column; }
}

.erp-document-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: #64748b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

    .erp-document-back:hover {
        color: #2563eb;
    }

.erp-document-eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #64748b;
}

.erp-document-title {
    margin: 2px 0 0;
    font-size: 42px;
    font-weight: 850;
    line-height: 1.08;
    color: #111827;
}

.erp-document-subtitle {
    margin-top: 8px;
    color: #334155;
    font-size: 18px;
    font-weight: 700;
}

.erp-document-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.erp-document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    justify-content: flex-end;
}

@media (max-width: 1199.98px) {
    .erp-document-title {
        font-size: 34px;
    }

    .erp-document-actions {
        justify-content: flex-start;
    }
}

.erp-document-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 5px solid #f59e0b;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    overflow: hidden;
}

.erp-document-banner-content {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.erp-document-banner-success {
    border-left-color: #16a34a;
    background: #f0fdf4;
}

    .erp-document-banner-success .erp-document-banner-title {
        color: #166534;
    }

.erp-document-banner-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.erp-document-banner-danger {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.erp-document-banner-info {
    border-left-color: #2563eb;
    background: #eff6ff;
}

.erp-pagination[hidden] { display: none; }
.erp-pagination nav { max-width: 100%; min-width: 0; }
.erp-pagination .pagination { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }

.erp-badge-info { background: #dbeafe; color: #1e40af; }

.quote-status-help-button { white-space: nowrap; align-self: center; }
.erp-document-heading-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.erp-document-heading-tools .erp-document-eyebrow { margin-bottom: 0; }
.erp-page-heading-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.erp-page-heading-tools > .quote-status-help-button,
.erp-document-heading-tools > .quote-status-help-button {
    border-color: transparent;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    padding: 2px 6px;
}
.erp-page-heading-tools > .quote-status-help-button:hover,
.erp-page-heading-tools > .quote-status-help-button:focus-visible,
.erp-document-heading-tools > .quote-status-help-button:hover,
.erp-document-heading-tools > .quote-status-help-button:focus-visible {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}
.quote-status-help-offcanvas { --bs-offcanvas-width: 420px; max-width: 100vw; text-align: left; }
.quote-status-help-offcanvas .offcanvas-header { background: #eff6ff; }
.quote-status-help-content dt { color: #1e40af; font-weight: 700; }
.quote-status-help-content dd { margin: .25rem 0 1rem; padding-bottom: 1rem; border-bottom: 1px solid #e5e7eb; line-height: 1.55; }
body:has(.quote-status-help-offcanvas.show) .erp-document-sticky-actions { z-index: 1030; }

/* Document dialogs use the same palette as document notifications. */
.field-validation-error {
    display: block;
    margin-top: .25rem;
}
.field-validation-error,
.invalid-feedback,
.invalid-tooltip {
    color: #dc2626 !important;
}
.invalid-tooltip {
    background-color: #fef2f2;
}
.input-validation-error,
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc2626 !important;
}
.input-validation-error:focus,
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 .2rem rgba(220, 38, 38, .2) !important;
}
.modal[data-erp-tone="warning"] { --erp-dialog-accent: #f59e0b; --erp-dialog-bg: #fffbeb; --erp-dialog-text: #92400e; }
.modal[data-erp-tone="danger"] { --erp-dialog-accent: #dc2626; --erp-dialog-bg: #fef2f2; --erp-dialog-text: #991b1b; }
.modal[data-erp-tone="info"] { --erp-dialog-accent: #2563eb; --erp-dialog-bg: #eff6ff; --erp-dialog-text: #1e40af; }
.modal[data-erp-tone="success"] { --erp-dialog-accent: #16a34a; --erp-dialog-bg: #f0fdf4; --erp-dialog-text: #166534; }
.modal[data-erp-tone] .modal-content {
    border-top: 5px solid var(--erp-dialog-accent);
    border-radius: 16px;
}
.modal[data-erp-tone] .modal-header {
    background: var(--erp-dialog-bg) !important;
    color: var(--erp-dialog-text);
    border-radius: 11px 11px 0 0;
}
.modal[data-erp-tone] .modal-title { color: var(--erp-dialog-text); }
.modal[data-erp-tone] .modal-footer > .btn-primary[data-bs-dismiss="modal"] {
    background: var(--erp-dialog-bg);
    border-color: var(--erp-dialog-accent);
    color: var(--erp-dialog-text);
}
.modal[data-erp-tone] .modal-footer > .btn-primary[data-bs-dismiss="modal"]:hover {
    filter: brightness(.96);
}

.erp-document-banner-title {
    font-weight: 850;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: .8px;
    font-size: 13px;
}

.erp-document-banner button {
    flex-shrink: 0;
}

.erp-document-banner-text {
    margin-top: 4px;
    color: #475569;
    font-size: 14px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .erp-document-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================================
   ERP V2 - Document Summary Card
   ========================================================= */

.erp-document-summary-card {
    height: 100%;
}

.erp-document-summary-list {
    margin-top: 18px;
}

.erp-document-summary-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
}

    .erp-document-summary-item:last-child {
        border-bottom: 0;
    }

.erp-document-summary-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.erp-document-summary-value {
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    text-align: right;
}

.erp-document-summary-item.is-emphasized {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

    .erp-document-summary-item.is-emphasized .erp-document-summary-value {
        font-size: 22px;
        color: #15803d;
    }

/* =========================================================
   ERP V2 - Document Party Card
   ========================================================= */

.erp-document-party-card {
    height: 100%;
}

.erp-document-party-name {
    margin-top: 18px;
    font-size: 20px;
    font-weight: 850;
    color: #111827;
}

.erp-document-party-fields {
    margin-top: 16px;
}

.erp-document-party-field {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eef2f7;
}

    .erp-document-party-field:last-child {
        border-bottom: 0;
    }

.erp-document-party-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.erp-document-party-value {
    color: #111827;
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .erp-document-party-field {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* =========================================================
   ERP V2 - Lines Card
   ========================================================= */

.erp-section-title {
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #64748b;
    margin: 22px 0 10px;
}

.erp-lines-card {
    padding: 0;
    overflow: hidden;
}

.erp-lines-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.erp-line-order-toolbar {
    padding: 16px 24px;
}

.erp-lines-table {
    margin-top: 0;
}

.smarthome-catalog-readonly .btn-primary { display: none; }

/* Keep descriptions readable while the numeric columns scroll inside the card. */
@media (max-width: 991.98px) {
    body .erp-lines-table { min-width: 1000px; }
    .erp-lines-table th:first-child,
    .erp-lines-table td:first-child { min-width: 280px; }
}

/* Every help panel and dialog must cover the document action bar. */
body:has(.offcanvas.show, .offcanvas.showing, .modal.show) .erp-document-sticky-actions {
    visibility: hidden;
    pointer-events: none;
}

    .erp-lines-table th {
        background: #f8fafc;
        padding: 12px 14px;
    }

    .erp-lines-table td {
        padding: 12px 14px;
    }

    .erp-lines-table .form-control-sm {
        border-radius: 10px;
    }

@media (max-width: 767.98px) {
    .erp-lines-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.erp-history-card { container-type: inline-size; }
.erp-history-list { margin-top: 20px; }
.erp-history-item {
    display: grid;
    grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
    gap: 12px 24px;
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
}
.erp-history-item:first-child { padding-top: 0; }
.erp-history-item:last-child { border-bottom: 0; padding-bottom: 0; }
.erp-history-date { min-width: 0; color: #64748b; font-size: 13px; line-height: 1.6; }
.erp-history-time, .erp-history-user { display: flex; align-items: baseline; gap: 8px; }
.erp-history-time { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.erp-history-user { margin-top: 4px; font-weight: 400; overflow-wrap: anywhere; }
.erp-history-user > span { min-width: 0; }
.erp-history-date .bi { flex: 0 0 auto; color: #94a3b8; }
.erp-history-text { min-width: 0; font-size: 14px; line-height: 1.65; font-weight: 500; color: #1e293b; overflow-wrap: anywhere; }
.erp-history-text a { text-decoration: underline !important; text-underline-offset: 3px; }
@container (max-width: 480px) {
    .erp-history-item { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 575.98px) {
    .erp-history-item { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
.erp-history-table { font-size: 14px; }
.erp-history-table > :not(caption) > * > * { padding: 14px 16px; vertical-align: top; line-height: 1.6; }
.erp-history-table th { color: #64748b; font-size: 12px; letter-spacing: .04em; }
.erp-history-table td { overflow-wrap: anywhere; min-width: 9rem; max-width: 34rem; }
.erp-history-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; color: #64748b; font-size: 13px; }
.erp-history-delivery { padding: 18px 0; border-bottom: 1px solid #e2e8f0; line-height: 1.65; overflow-wrap: anywhere; }
.erp-history-delivery:last-child { border-bottom: 0; }
.erp-history-delivery > .small { margin: 4px 0; }

.erp-document-notes-card {
    height: 100%;
}

.erp-document-notes-text {
    margin-top: 18px;
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
}

/* =========================================================
   ERP V2 - Sticky Actions
   ========================================================= */

.erp-document-sticky-actions {
    position: sticky;
    bottom: 16px;
    z-index: 1050;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 14px 18px;
    background: rgba(255,255,255,.96);
    border: 1px solid #e5e7eb;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 24px rgba(15,23,42,.08);
    backdrop-filter: blur(8px);
}

.quote-edit-page .erp-document-sticky-buttons > .btn,
.quote-edit-page .erp-document-sticky-buttons > .btn-group > .btn {
    white-space: nowrap;
    font-size: .875rem;
    padding: .5rem .65rem;
}

/* Clear stale pointer highlighting after opening a tab, until the pointer moves.
   Ordinary hover and keyboard focus retain Bootstrap's highlight. */
.erp-document-sticky-buttons a.btn.erp-new-tab-opened[target="_blank"]:not(:focus-visible) {
    color: var(--bs-btn-color);
    background-color: var(--bs-btn-bg);
    border-color: var(--bs-btn-border-color);
    box-shadow: none;
    transition: none;
}

@media (min-width: 1200px) {
    .quote-edit-page .erp-document-sticky-buttons {
        flex-wrap: nowrap;
        flex-shrink: 0;
        gap: 6px;
    }

    .quote-edit-page .erp-document-sticky-info {
        min-width: 0;
        font-size: .875rem;
        overflow-wrap: anywhere;
    }
}

.erp-document-sticky-info {
    font-weight: 850;
    color: #111827;
}

.erp-document-sticky-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

@media (max-width: 767.98px) {
    .erp-document-sticky-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .erp-document-sticky-buttons {
        justify-content: stretch;
    }

        .erp-document-sticky-buttons .btn {
            flex: 1 1 auto;
        }
}

/* =========================================================
   ERP V2 - Document form cards
   ========================================================= */

.erp-document-form-card {
    padding: 22px;
}

.erp-document-notes-field {
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.erp-document-notes-field textarea {
    min-height: 72px;
    resize: vertical;
}

.erp-document-notes-value {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.erp-document-number-box {
    min-width: 220px;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
    align-self: flex-start;
}

.erp-document-number-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #64748b;
}

.erp-document-number-value {
    margin-top: 4px;
    font-size: 18px;
    font-weight: 850;
    color: #111827;
}

.erp-form-grid {
    display: grid;
    gap: 14px;
}

.erp-form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.erp-form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.erp-form-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.erp-form-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.erp-form-grid-12 {
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.erp-span-2 {
    grid-column: span 2;
}

.erp-span-4 {
    grid-column: span 4;
}

.erp-span-6 {
    grid-column: span 6;
}

.erp-field .form-label {
    font-size: 12px;
    font-weight: 800;
    color: #475467;
    margin-bottom: 6px;
}

.erp-field .form-control,
.erp-field .form-select {
    border-radius: 12px;
    border-color: #d0d5dd;
}

    .erp-field .form-control:focus,
    .erp-field .form-select:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12);
    }

.erp-field .input-group-text {
    border-radius: 0 12px 12px 0;
    font-size: 13px;
    color: #64748b;
    background: #f8fafc;
}

@media (max-width: 1199.98px) {
    .erp-form-grid-5,
    .erp-form-grid-4,
    .erp-form-grid-2,
    .erp-form-grid-12 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .erp-span-2,
    .erp-span-4,
    .erp-span-6 {
        grid-column: span 2;
    }
}

@media (max-width: 767.98px) {
    .erp-form-grid-5,
    .erp-form-grid-4,
    .erp-form-grid-3,
    .erp-form-grid-2,
    .erp-form-grid-12 {
        grid-template-columns: 1fr;
    }

    .erp-span-2,
    .erp-span-4,
    .erp-span-6 {
        grid-column: span 1;
    }

    .erp-document-number-box {
        min-width: 0;
    }
}

/* =========================================================
   ERP V2 - Add line card
   ========================================================= */

.erp-add-line-card {
    padding: 22px;
}

    .erp-add-line-card .erp-card-subtitle {
        margin-bottom: 20px;
    }

    .erp-add-line-card .form-label {
        font-size: 12px;
        font-weight: 800;
        color: #475467;
        margin-bottom: 6px;
    }

    .erp-add-line-card .form-control,
    .erp-add-line-card .form-select {
        border-radius: 12px;
        border-color: #d0d5dd;
    }

        .erp-add-line-card .form-control:focus,
        .erp-add-line-card .form-select:focus {
            border-color: #2563eb;
            box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12);
        }

.erp-add-line-submit {
    min-height: 42px;
    border-radius: 12px;
    font-weight: 750;
}

.erp-document-sticky-info .btn {
    white-space: nowrap;
}

.erp-add-line-offcanvas {
    width: min(760px, 100vw);
}


    .erp-add-line-offcanvas .erp-add-line-panel {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 18px;
        padding: 20px;
    }

/* =========================================================
   ERP V2.1 - Smart Lookup mode
   ========================================================= */

.bauimex-lookup-smart .bauimex-lookup-search {
    margin-bottom: 8px !important;
}

.bauimex-lookup-smart .bauimex-lookup-results-smart {
    min-height: 320px;
    max-height: 520px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #d0d5dd;
    border-radius: 14px;
    padding: 8px;
    font-size: 14px;
    background: #fff;
}

.bauimex-lookup-smart .bauimex-lookup-selected {
    border-radius: 14px !important;
    border-color: #bfdbfe !important;
    background: #eff6ff !important;
}

.bauimex-lookup-smart .bauimex-lookup-selected-text {
    font-size: 15px !important;
    line-height: 1.35;
}

.bauimex-lookup-smart .bauimex-lookup-count {
    margin-top: 8px;
}

body:has(.erp-add-line-offcanvas.show) .erp-document-sticky-actions {
    display: none;
}

.bauimex-lookup-result {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

    .bauimex-lookup-result:hover {
        background: #f8fbff;
        border-color: #dbeafe;
    }

    .bauimex-lookup-result.is-active {
        background: #eff6ff;
        border-color: #60a5fa;
        box-shadow: 0 0 0 2px rgba(37,99,235,.15);
    }

.bauimex-lookup-result-code {
    color: #2563eb;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .3px;
    white-space: nowrap;
    margin-right: .5rem;
}

.bauimex-lookup-result-title {
    font-weight: 700;
    color: #111827;
    font-size: 15px;
    line-height: 1.35;
    display: block;
    overflow: visible;
}

.bauimex-lookup-result-meta {
    color: #64748b;
    line-height: 1.35;
    font-size: .9rem;
    font-weight: 600;
    min-width: 0;
}

.bauimex-lookup-result-price {
    color: #15803d;
    font-weight: 800;
    font-size: 15px;
    white-space: nowrap;
    margin-left: auto;
}

.bauimex-lookup-result-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: .45rem;
}

.bauimex-lookup-selected-card {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.bauimex-lookup-selected-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
}

.bauimex-lookup-selected-code {
    color: #2563eb;
    font-size: 13px;
    font-weight: 800;
    margin-right: .5rem;
    white-space: nowrap;
}

.bauimex-lookup-selected-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.bauimex-lookup-selected-meta {
    color: #64748b;
    font-size: .9rem;
    font-weight: 600;
}

.bauimex-lookup-selected-price {
    color: #15803d;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

.erp-add-line-offcanvas .offcanvas-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 16px;
}

.erp-add-line-offcanvas .offcanvas-header {
    flex-shrink: 0;
}

/* The concrete picker has a separate form; pass the panel's available height
   through it so the result list can grow and scroll. */
#concreteItemPickerForm {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
}

.erp-add-line-offcanvas .bauimex-lookup-control {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
}

.erp-add-line-offcanvas .bauimex-lookup-search,
.erp-add-line-offcanvas .bauimex-lookup-count,
.erp-add-line-offcanvas .form-label {
    flex-shrink: 0;
}

.erp-add-line-offcanvas .bauimex-lookup-results-smart {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
}

.erp-add-line-offcanvas .bauimex-lookup-results-smart:empty {
    display: none;
}

/* While choosing, devote the available space to results rather than repeating
   the previous selection below them. After selection its full text is visible. */
.erp-add-line-offcanvas .bauimex-lookup-control[data-selected-id="0"] .bauimex-lookup-selected,
.erp-add-line-offcanvas .bauimex-lookup-control:has(.bauimex-lookup-results-smart:not(:empty)) .bauimex-lookup-selected {
    display: none;
}

.erp-add-line-offcanvas .bauimex-lookup-selected {
    min-height: 0;
    overflow-y: auto;
    overflow-wrap: anywhere;
}

.erp-add-line-offcanvas .erp-add-line-fields {
    flex-shrink: 0;
    --bs-gutter-y: .5rem;
}

/* Price entry includes a long price-list title and customer-code fields.
   Scroll the whole form instead of squeezing the results into leftover height. */
#addPricePanel .offcanvas-body {
    display: block;
    overflow-y: auto;
}

#addPricePanel #masterDataForm {
    display: block;
}

#addPricePanel .bauimex-lookup-control {
    flex: none;
}

#addPricePanel .bauimex-lookup-results-smart {
    flex: none;
    min-height: 12rem;
    max-height: clamp(12rem, 30dvh, 22rem);
}

#addPricePanel .bauimex-lookup-selected {
    overflow: visible;
}

#addPricePanel .price-list-context summary {
    font-size: .9rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#addPricePanel .bauimex-lookup-result-title,
#addPricePanel .bauimex-lookup-selected-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

#addPricePanel.price-descriptions-expanded .bauimex-lookup-result-title,
#addPricePanel.price-descriptions-expanded .bauimex-lookup-selected-title {
    display: block;
    overflow: visible;
}

#addPricePanel .bauimex-lookup-selected-card { padding: 10px; }
#addPricePanel .bauimex-lookup-result { padding: 10px; }
#addPricePanel .bauimex-lookup-selected-bottom,
#addPricePanel .bauimex-lookup-result-bottom { margin-top: 6px; font-size: .8rem; }
#addPricePanel .bauimex-lookup-count { font-size: .8rem; }
#addPricePanel .erp-add-line-fields { padding-top: 8px; border-top: 1px solid #dee2e6; }

/* Before selection, results can use the space reserved for the price fields.
   After selection the normal scrolling form keeps those fields reachable. */
@media (min-height: 441px) {
    #addPricePanel:has(.erp-add-line-fields.d-none):has(#priceItemResults:not(:empty)) .offcanvas-body {
        display: flex;
        overflow: hidden;
    }
    #addPricePanel:has(.erp-add-line-fields.d-none):has(#priceItemResults:not(:empty)) #masterDataForm {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0;
    }
    #addPricePanel:has(.erp-add-line-fields.d-none):has(#priceItemResults:not(:empty)) #masterDataForm > * {
        flex-shrink: 0;
    }
    #addPricePanel:has(.erp-add-line-fields.d-none):has(#priceItemResults:not(:empty)) .bauimex-lookup-control {
        flex: 1 1 0;
        min-height: 0;
    }
    #addPricePanel:has(.erp-add-line-fields.d-none):has(#priceItemResults:not(:empty)) .bauimex-lookup-results-smart {
        flex: 1 1 0;
        min-height: 0;
        max-height: none;
    }
    #addPricePanel .price-description-toggle { align-self: flex-start; }
}

@media (max-width: 575.98px) {
    .erp-add-line-offcanvas {
        --bs-offcanvas-width: 100vw;
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
    }
    .erp-add-line-offcanvas .offcanvas-header {
        padding: 12px;
    }
    .erp-add-line-offcanvas .offcanvas-body {
        padding: 8px 12px 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    .erp-add-line-offcanvas .bauimex-lookup-result {
        padding: 10px;
    }
    .erp-add-line-offcanvas .bauimex-lookup-result-title {
        overflow-wrap: anywhere;
    }
    .erp-add-line-offcanvas .bauimex-lookup-result-bottom,
    .erp-add-line-offcanvas .bauimex-lookup-selected-bottom {
        flex-wrap: wrap;
        gap: .35rem;
    }
    .erp-add-line-offcanvas .form-control,
    .erp-add-line-offcanvas .form-select {
        font-size: 16px;
        min-height: 44px;
    }
}

/* Keep all controls reachable with a very short viewport or strong zoom. */
@media (max-height: 440px) {
    #concreteItemPickerForm {
        flex: 1 0 auto;
    }
    #addPricePanel #masterDataForm {
        flex: 1 0 auto;
    }
    .erp-add-line-offcanvas .offcanvas-body {
        overflow-y: auto;
    }
    .erp-add-line-offcanvas .bauimex-lookup-control {
        flex: 1 0 auto;
    }
    .erp-add-line-offcanvas .bauimex-lookup-results-smart {
        flex-basis: auto;
        max-height: 35dvh;
    }
    #concreteItemOffcanvas .bauimex-lookup-results-smart {
        max-height: max(10rem, 50dvh);
    }
}

.erp-line-item-title {
    font-weight: 700;
    color: #111827;
    line-height: 1.45;
}

.erp-line-item-code {
    color: #2563eb;
    font-size: 13px;
    font-weight: 800;
    margin-right: .5rem;
    white-space: nowrap;
}

.erp-repeated-item-marker {
    color: #64748b;
    font-size: .8rem;
    font-weight: normal;
    margin-right: .4rem;
    vertical-align: baseline;
}

/* Quote billing detail: amounts, supporting documents and invoice actions. */
.quote-billing-details .billing-title {
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    overflow-wrap: anywhere;
}
.billing-navigation, .billing-section-heading, .billing-document-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
}
.billing-section-heading { margin-bottom: .75rem; }
.billing-count {
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    padding: .15rem .6rem;
    font-size: .85rem;
    font-weight: 600;
}
.billing-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}
.billing-metric {
    padding: 1rem 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    min-width: 0;
}
.billing-metric > span { display: block; color: #64748b; margin-bottom: .4rem; }
.billing-metric > strong {
    display: block;
    font-size: clamp(1.25rem, 2vw, 1.8rem);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.billing-metric-remaining { background: #eff6ff; border-color: #bfdbfe; }
.billing-document-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}
.billing-document-icon { color: #64748b; font-size: 1.4rem; flex-shrink: 0; }
.billing-document-content { flex: 1; min-width: 0; }
.billing-file-name { overflow-wrap: anywhere; }
.billing-document-content > .billing-file-name:first-child { font-weight: 600; }
.billing-document-meta { margin-top: .4rem; color: #64748b; font-size: .85rem; }
.billing-document-action, .billing-status { flex-shrink: 0; }
.billing-status { display: inline-block; white-space: nowrap; border-radius: 999px; font-size: .8rem; font-weight: 600; padding: .3rem .7rem; }
.billing-status-issued { background: #dcfce7; color: #166534; }
.billing-status-pending { background: #fef3c7; color: #92400e; }
.billing-status-muted { background: #f1f5f9; color: #475569; }
.billing-empty { display: flex; align-items: center; gap: .75rem; padding: 1.2rem; border: 1px dashed #cbd5e1; border-radius: 12px; color: #64748b; }
.billing-add-form { border-top: 1px solid #e2e8f0; padding-top: 1.25rem; }
.billing-link-controls { display: flex; gap: .75rem; }
.billing-link-controls .form-select { flex: 1; min-width: 0; }
.billing-link-controls button { flex-shrink: 0; }
.billing-form-action button { width: 100%; }
@media (min-width: 768px) and (max-width: 1199.98px) {
    .billing-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .billing-metrics { grid-template-columns: 1fr; gap: .5rem; }
    .billing-metric { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; }
    .billing-metric > small { flex-basis: 100%; }
    .billing-metric > span { margin: 0; }
    .billing-metric > strong { text-align: right; }
    .billing-document-row { flex-wrap: wrap; gap: .65rem; }
    .billing-document-content { flex-basis: calc(100% - 3rem); }
    .billing-document-action { margin-left: auto; }
    .billing-link-controls { flex-direction: column; }
    .quote-billing-details .btn { min-height: 44px; }
    .quote-billing-details .form-control, .quote-billing-details .form-select { font-size: 16px; }
}

.erp-line-move-buttons {
    display: inline-flex;
    gap: .35rem;
    margin: .5rem .75rem .25rem 0;
}
@media (pointer: coarse) {
    .erp-line-move-buttons button,
    [data-line-sort] {
        min-width: 44px;
        min-height: 44px;
    }
}
/* Shared document selectors */
.erp-document-lookup-button {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    background: #fff;
    padding: .65rem .8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    font-weight: 600;
}

    .erp-document-lookup-button:hover:not(:disabled) {
        border-color: #2563eb;
        background: #eff6ff;
    }

    .erp-document-lookup-button:disabled {
        background: var(--bs-secondary-bg);
        color: var(--bs-secondary-color);
        cursor: not-allowed;
    }

/* Customer and price-list selectors intentionally use the same dimensions and
   blue selection treatment as the item selector. */
.erp-document-lookup-offcanvas {
    width: min(760px, 100vw);
}

.erp-document-lookup-offcanvas[data-contact-panel] .offcanvas-body {
    display: block;
    overflow-y: auto;
    padding-bottom: 16px;
}

[data-contact-panel] > .border-top {
    flex-shrink: 0;
}

    .erp-document-lookup-offcanvas .offcanvas-body {
        padding-bottom: 96px;
    }

    .erp-document-lookup-offcanvas .bauimex-lookup-selected {
        border-color: #60a5fa !important;
        background: #eff6ff !important;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
    }

body:has(.erp-document-lookup-offcanvas.show) .erp-document-sticky-actions {
    display: none;
}


/* Unified Create/Edit shell for legacy Business modules.
   Keeps existing forms and controllers intact while matching the ERP document visual language. */
.erp-crud-page {
    max-width: 1600px;
    margin: 0 auto;
    padding-bottom: 6rem;
}

    .erp-crud-page .page-title-box {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1rem;
        padding: 0;
    }

        .erp-crud-page .page-title-box .page-title {
            margin: 0;
            font-size: 1.55rem;
            font-weight: 750;
            letter-spacing: -.02em;
            color: #101828;
        }

        .erp-crud-page .page-title-box .page-title-right,
        .erp-crud-page .page-title-box .breadcrumb {
            display: none;
        }

    .erp-crud-page > .row > .col-12 > .card,
    .erp-crud-page .card {
        border: 1px solid #e4e7ec;
        border-radius: 14px;
        box-shadow: 0 1px 2px rgba(16,24,40,.04);
        background: #fff;
    }

    .erp-crud-page .card-body {
        padding: 1.25rem;
    }

    .erp-crud-page .form-label {
        font-weight: 650;
        color: #344054;
    }

    .erp-crud-page .form-control,
    .erp-crud-page .form-select {
        min-height: 42px;
        border-color: #d0d5dd;
        border-radius: 9px;
    }

    .erp-crud-page textarea.form-control {
        min-height: 96px;
    }

    .erp-crud-page .btn-primary {
        background: #2563eb;
        border-color: #2563eb;
    }

    .erp-crud-page form > .mb-3:last-child,
    .erp-crud-page form > .d-flex:last-child {
        position: sticky;
        bottom: 0;
        z-index: 20;
        margin: 1.25rem -1.25rem -1.25rem !important;
        padding: .85rem 1.25rem;
        border-top: 1px solid #e4e7ec;
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(8px);
    }

.quote-edit-page,
.purchase-order-edit-page {
    padding-bottom: 6rem;
}
/* =========================================================
   ERP Document edit status - shared CREATE/EDIT header block
   ========================================================= */
.erp-document-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    min-width: 250px;
}

.erp-document-edit-status {
    min-width: 250px;
    padding: 12px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 14px;
    background: #f8fafc;
    text-align: left;
}

.erp-document-edit-status-label {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.erp-document-edit-status-value {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    color: #111827;
    font-size: 15px;
    font-weight: 800;
}

.erp-edit-status-allowed {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

    .erp-edit-status-allowed .erp-document-edit-status-value {
        color: #15803d;
    }

.erp-edit-status-correction {
    border-color: #fde68a;
    background: #fffbeb;
}

    .erp-edit-status-correction .erp-document-edit-status-value {
        color: #b45309;
    }

.erp-edit-status-locked {
    border-color: #fecaca;
    background: #fef2f2;
}

    .erp-edit-status-locked .erp-document-edit-status-value {
        color: #b91c1c;
    }

.erp-edit-status-cancelled {
    border-color: #d1d5db;
    background: #f3f4f6;
}

    .erp-edit-status-cancelled .erp-document-edit-status-value {
        color: #4b5563;
    }

@media (max-width: 1199.98px) {
    .erp-document-header-right {
        align-items: flex-start;
        min-width: 0;
        width: 100%;
    }

    .erp-document-edit-status {
        min-width: 0;
        width: 100%;
    }
}

/* =========================================================
   ERP Date Field - sl-SI (dd.MM.yyyy)
   ========================================================= */
.erp-date-field {
    position: relative;
    width: 100%;
}

.erp-date-display {
    padding-right: 2.75rem;
    font-variant-numeric: tabular-nums;
}

.erp-date-native {
    position: absolute;
    right: .75rem;
    top: 50%;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
}

.erp-date-button {
    position: absolute;
    top: 50%;
    right: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: .35rem;
    background: transparent;
    color: #667085;
    transform: translateY(-50%);
}

    .erp-date-button:hover:not(:disabled),
    .erp-date-button:focus-visible {
        color: #101828;
        background: #f2f4f7;
    }

    .erp-date-button:focus-visible {
        outline: 2px solid rgba(13, 110, 253, .25);
        outline-offset: 2px;
    }

    .erp-date-button:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

.erp-date-display.is-invalid {
    padding-right: 4.5rem;
}

/* Administration / Identity */
.permission-check {
    display: flex;
    gap: .75rem;
    padding: .85rem 1rem .85rem 2.65rem;
    min-height: 64px;
    border: 1px solid var(--bs-border-color);
    border-radius: .65rem;
    background: var(--bs-body-bg);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .permission-check:hover {
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 .15rem rgba(13,110,253,.08);
    }

    .permission-check .form-check-input {
        margin-left: -1.65rem;
        margin-top: .2rem;
    }

    .permission-check .form-check-label {
        display: flex;
        flex-direction: column;
        line-height: 1.25;
    }

    .permission-check small {
        color: var(--bs-secondary-color);
        margin-top: .25rem;
        font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
        font-size: .73rem;
    }

.permission-group:last-child {
    margin-bottom: 0 !important;
}

/* Topbar actions and account menus */
.erp-icon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #334155;
    transition: .16s ease;
}

    .erp-icon-button:hover, .erp-icon-button[aria-expanded="true"] {
        color: #1d4ed8;
        border-color: #bfdbfe;
        background: #eff6ff;
        transform: translateY(-1px);
    }

.erp-action-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #ef4444;
    box-sizing: content-box;
}

.erp-user-button {
    border: 0;
    background: transparent;
    padding: 6px 8px;
    border-radius: 14px;
    text-align: left;
    transition: .16s ease;
}

    .erp-user-button:hover, .erp-user-button[aria-expanded="true"] {
        background: #f8fafc;
    }

.erp-user-chevron {
    color: #94a3b8;
    font-size: .75rem;
    margin-left: 2px;
}

.erp-top-dropdown {
    width: 310px;
    padding: 8px;
    margin-top: 10px !important;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15,23,42,.14);
}

    .erp-top-dropdown .dropdown-item {
        border-radius: 10px;
        padding: .68rem .75rem;
        color: #334155;
    }

        .erp-top-dropdown .dropdown-item:hover {
            background: #f1f5f9;
            color: #0f172a;
        }

.erp-dropdown-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 10px 12px;
}

.erp-dropdown-title {
    font-weight: 800;
    color: #0f172a;
}

.erp-dropdown-subtitle {
    margin-top: 2px;
    font-size: .76rem;
    color: #64748b;
    line-height: 1.35;
}

.erp-notification-item {
    display: flex;
    gap: 11px;
    margin: 0 2px 6px;
    padding: 11px;
    border-radius: 12px;
    background: #f8fafc;
}

.erp-notification-icon {
    flex: 0 0 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #e0e7ff;
    color: #4338ca;
}

.erp-dropdown-footer {
    margin-top: 4px;
    border-top: 1px solid #eef2f7;
    padding-top: .8rem !important;
}

.erp-user-menu-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
}

.erp-user-menu {
    width: 280px;
}

/* Lighting module */
.lighting-grid .erp-card {
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

    .lighting-grid .erp-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 25px rgba(15,23,42,.08);
    }

.erp-light-card {
    min-width: 0;
    overflow-wrap: anywhere;
}

.erp-light-card-heading {
    flex: 1 1 12rem;
    min-width: 0;
}

.erp-light-card .badge {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
    line-height: 1.35;
}

.lighting-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem .7rem;
    border-radius: 999px;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .erp-topbar {
        padding: 0 16px;
    }

    .erp-top-title {
        display: none;
    }

    .erp-top-subtitle {
        font-size: 18px;
    }

    .erp-user-text, .erp-user-chevron {
        display: none;
    }

    .erp-top-right {
        gap: 8px;
    }

    .erp-top-actions {
        gap: 6px;
    }

    .erp-top-dropdown {
        width: min(310px, calc(100vw - 24px));
    }
}

/* Identity / uporabniški račun */
.erp-user-menu-section-label {
    padding: .35rem .75rem .25rem;
    color: #94a3b8;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .09em;
}

.erp-user-menu .dropdown-item i {
    width: 1.15rem;
    text-align: center;
    color: #64748b;
}

.erp-user-menu .dropdown-item:hover i {
    color: #1d4ed8;
}

.identity-manage-page {
    max-width: 1180px;
    margin: 0 auto;
}

.identity-manage-header {
    align-items: flex-start;
}

.identity-manage-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .55rem;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15,23,42,.04);
}

.identity-manage-nav__item {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-height: 42px;
    padding: .62rem .85rem;
    border-radius: 11px;
    color: #64748b;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    transition: .16s ease;
}

    .identity-manage-nav__item:hover {
        color: #0f172a;
        background: #f1f5f9;
    }

    .identity-manage-nav__item.active {
        color: #1d4ed8;
        background: #eff6ff;
        box-shadow: inset 0 0 0 1px #dbeafe;
    }

    .identity-manage-nav__item i {
        font-size: 1rem;
    }

.identity-profile-summary, .identity-security-aside {
    padding: 2rem;
    text-align: center;
}

.identity-profile-avatar {
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    margin: 0 auto 1rem;
    border-radius: 24px;
    color: #1d4ed8;
    background: linear-gradient(145deg,#eff6ff,#dbeafe);
    font-size: 2rem;
    font-weight: 850;
    box-shadow: inset 0 0 0 1px #bfdbfe;
}

.identity-profile-summary h2, .identity-security-aside h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
}

.identity-profile-username {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .45rem;
    margin-top: .4rem;
    color: #64748b;
    font-size: .88rem;
}

.identity-profile-state {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-top: 1.25rem;
    padding: .42rem .7rem;
    border-radius: 999px;
    color: #166534;
    background: #f0fdf4;
    font-size: .78rem;
    font-weight: 750;
}

    .identity-profile-state span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #22c55e;
    }

.identity-profile-note {
    display: flex;
    gap: .6rem;
    margin-top: 1.4rem;
    padding: 1rem;
    border-radius: 12px;
    color: #64748b;
    background: #f8fafc;
    text-align: left;
    font-size: .82rem;
    line-height: 1.5;
}

.identity-account-card {
    padding: 0;
    overflow: hidden;
}

.identity-account-card__header {
    display: flex;
    gap: .85rem;
    align-items: center;
    padding: 1.35rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fbfdff;
}

    .identity-account-card__header h2 {
        margin: 0;
        color: #0f172a;
        font-size: 1.05rem;
    }

    .identity-account-card__header p {
        margin: .2rem 0 0;
        color: #64748b;
        font-size: .84rem;
    }

.identity-account-card__icon, .identity-security-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: 1.05rem;
}

.identity-account-card form {
    padding: 1.5rem;
}

.identity-account-card .form-label {
    color: #334155;
    font-size: .84rem;
    font-weight: 750;
}

.identity-account-card .input-group-text {
    min-width: 43px;
    justify-content: center;
    color: #64748b;
    background: #f8fafc;
    border-color: #dbe2ea;
}

.identity-account-card .form-control {
    min-height: 44px;
    border-color: #dbe2ea;
}

    .identity-account-card .form-control:focus {
        border-color: #93c5fd;
        box-shadow: 0 0 0 .2rem rgba(59,130,246,.12);
    }

.identity-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid #edf2f7;
}

.identity-security-aside {
    text-align: left;
}

.identity-security-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.identity-security-aside p {
    margin: .6rem 0 0;
    color: #64748b;
    line-height: 1.6;
}

.identity-security-tip {
    display: flex;
    gap: .65rem;
    margin-top: 1.3rem;
    padding: 1rem;
    border-radius: 12px;
    color: #475569;
    background: #fffbeb;
    font-size: .84rem;
}

@media (max-width:767.98px) {
    .identity-manage-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .identity-manage-nav__item {
        padding: .6rem .7rem;
    }

    .identity-form-actions .btn {
        width: 100%;
    }
}

/* =========================================================
   Identity standalone pages (Login, Lockout, Confirm, etc.)
   Scoped to body.identity-page to avoid affecting ERP pages.
   ========================================================= */

body.identity-page {
    --id-bg: #f8f8f5;
    --id-panel: #ffffff;
    --id-text: #17202a;
    --id-muted: #667085;
    --id-border: #d8dee6;
    --id-primary: #ffe45c;
    --id-primary-hover: #f4d43c;
    --id-accent: #8a6800;
    --id-danger: #b42318;
    --id-focus: rgba(193, 145, 0, .24);
    --id-shadow: 0 24px 70px rgba(15, 23, 42, .12);
    margin: 0;
    min-height: 100vh;
    color: var(--id-text);
    background: var(--id-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

    body.identity-page *,
    body.identity-page *::before,
    body.identity-page *::after {
        box-sizing: border-box;
    }

    body.identity-page .identity-shell {
        min-height: 100vh;
        display: grid;
        grid-template-columns: minmax(320px, 42%) 1fr;
        background: linear-gradient(90deg, #fff17b 0%, #fff6b1 28%, #fffbed 55%, #ffffff 82%, #ffffff 100%);
    }

    body.identity-page .identity-brand {
        position: relative;
        display: flex;
        align-items: flex-end;
        overflow: hidden;
        padding: clamp(2rem, 5vw, 5rem);
        color: #242323;
        background: transparent;
    }

    body.identity-page .identity-brand__content {
        position: relative;
        z-index: 1;
        max-width: 540px;
    }

    body.identity-page .identity-mark {
        display: grid;
        place-items: center;
        width: 52px;
        height: 52px;
        margin-bottom: 2rem;
        border: 1px solid rgba(255,255,255,.45);
        border-radius: 14px;
        font-size: 1.45rem;
        font-weight: 800;
        background: rgba(255,255,255,.08);
    }

    body.identity-page .identity-eyebrow {
        margin: 0 0 .7rem;
        color: #514b31;
        font-size: .78rem;
        font-weight: 750;
        letter-spacing: .14em;
        text-transform: uppercase;
    }

    body.identity-page .identity-brand h1 {
        margin: 0;
        max-width: 500px;
        font-size: clamp(2rem, 4vw, 3.6rem);
        line-height: 1.07;
        letter-spacing: -.035em;
    }

    body.identity-page .identity-brand p:not(.identity-eyebrow) {
        max-width: 500px;
        margin: 1.25rem 0 0;
        color: #514b31;
        font-size: 1.05rem;
        line-height: 1.7;
    }

    body.identity-page .identity-security-note {
        display: inline-flex;
        gap: .6rem;
        align-items: center;
        margin-top: 2rem;
        color: #514b31;
        font-size: .86rem;
    }

        body.identity-page .identity-security-note span {
            color: var(--id-accent);
        }

    body.identity-page .identity-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2rem;
    }

    body.identity-page .identity-card {
        width: min(100%, 460px);
        padding: clamp(1.6rem, 4vw, 2.6rem);
        border: 1px solid rgba(216,222,230,.9);
        border-radius: 18px;
        background: var(--id-panel);
        box-shadow: var(--id-shadow);
    }

    body.identity-page .identity-header {
        margin-bottom: 1.8rem;
    }

        body.identity-page .identity-header h2,
        body.identity-page .identity-card > h1 {
            margin: 0;
            font-size: 1.75rem;
            line-height: 1.25;
            letter-spacing: -.025em;
        }

        body.identity-page .identity-header p,
        body.identity-page .identity-card > h4,
        body.identity-page .identity-card > p {
            margin: .65rem 0 0;
            color: var(--id-muted);
            font-size: .95rem;
            line-height: 1.6;
            font-weight: 400;
        }

    body.identity-page .identity-field,
    body.identity-page .form-group {
        margin-bottom: 1.15rem;
    }

        body.identity-page .identity-label,
        body.identity-page .form-group label {
            display: block;
            margin-bottom: .45rem;
            font-size: .88rem;
            font-weight: 700;
        }

    body.identity-page .identity-input,
    body.identity-page .form-control {
        width: 100%;
        min-height: 46px;
        padding: .72rem .85rem;
        color: var(--id-text);
        border: 1px solid var(--id-border);
        border-radius: 10px;
        background: #fff;
        font: inherit;
        transition: border-color .16s, box-shadow .16s;
    }

        body.identity-page .identity-input:focus,
        body.identity-page .form-control:focus {
            outline: 0;
            border-color: #8a6800;
            box-shadow: 0 0 0 4px var(--id-focus);
        }

    body.identity-page .identity-password {
        position: relative;
    }

        body.identity-page .identity-password .identity-input {
            padding-right: 5.5rem;
        }

        /* The adjacent Prikaži/Skrij button already provides password visibility. */
        body.identity-page .identity-password .identity-input::-ms-reveal,
        body.identity-page .identity-password .identity-input::-ms-clear {
            display: none;
        }

    body.identity-page .identity-password-toggle {
        position: absolute;
        top: 50%;
        right: .45rem;
        transform: translateY(-50%);
        min-width: 2.4rem;
        min-height: 2.4rem;
        border: 0;
        border-radius: 8px;
        color: var(--id-muted);
        background: transparent;
        cursor: pointer;
    }

        body.identity-page .identity-password-toggle:hover {
            background: #f1f4f7;
            color: var(--id-text);
        }

    body.identity-page .identity-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin: .25rem 0 1.4rem;
    }

    body.identity-page .identity-check {
        display: inline-flex;
        align-items: center;
        gap: .55rem;
        color: #475467;
        font-size: .88rem;
    }

        body.identity-page .identity-check input {
            width: 1rem;
            height: 1rem;
            accent-color: var(--id-primary);
        }

    body.identity-page .identity-link {
        color: var(--id-primary);
        font-size: .88rem;
        font-weight: 700;
        text-decoration: none;
    }

        body.identity-page .identity-link:hover {
            text-decoration: underline;
        }

    body.identity-page .identity-button,
    body.identity-page .btn-primary {
        display: inline-flex;
        width: 100%;
        min-height: 47px;
        align-items: center;
        justify-content: center;
        padding: .75rem 1rem;
        border: 1px solid var(--id-primary);
        border-radius: 10px;
        color: #242323;
        background: var(--id-primary);
        font: inherit;
        font-weight: 750;
        cursor: pointer;
        transition: background .16s, transform .08s;
    }

        body.identity-page .identity-button:hover,
        body.identity-page .btn-primary:hover {
            color: #242323;
            background: var(--id-primary-hover);
        }

        body.identity-page .identity-button:active,
        body.identity-page .btn-primary:active {
            transform: translateY(1px);
        }

    body.identity-page .identity-validation,
    body.identity-page .text-danger,
    body.identity-page .validation-summary-errors {
        color: var(--id-danger);
        font-size: .84rem;
    }

    body.identity-page .validation-summary-valid {
        display: none;
    }

    body.identity-page .validation-summary-errors ul {
        margin: 0 0 1rem;
        padding: .75rem 1rem .75rem 2rem;
        border-radius: 9px;
        background: #fff4f2;
    }

    body.identity-page .identity-meta {
        margin-top: 1.35rem;
        padding-top: 1.2rem;
        border-top: 1px solid #edf0f3;
        color: var(--id-muted);
        font-size: .82rem;
        line-height: 1.55;
    }

    body.identity-page .identity-footer {
        margin-top: 1.2rem;
        color: #7a8695;
        font-size: .8rem;
    }

    body.identity-page hr {
        border: 0;
        border-top: 1px solid #edf0f3;
    }

    body.identity-page .row {
        display: block;
    }

    body.identity-page .col-md-4,
    body.identity-page .col-md-6 {
        width: 100%;
    }

    /* Identity status pages */
    body.identity-page .identity-state {
        text-align: left;
    }

    body.identity-page .identity-state__icon {
        display: grid;
        place-items: center;
        width: 48px;
        height: 48px;
        margin-bottom: 1.25rem;
        border-radius: 14px;
        font-size: 1.35rem;
        font-weight: 800;
        color: #8a4b08;
        background: #fff4df;
        border: 1px solid #f2d19a;
    }

    body.identity-page .identity-eyebrow--dark {
        color: #667085;
    }

    body.identity-page .identity-alert {
        margin: 1.2rem 0;
        padding: .9rem 1rem;
        border-radius: 10px;
        font-size: .9rem;
        line-height: 1.55;
    }

    body.identity-page .identity-alert--info {
        color: #344054;
        background: #f8fafc;
        border: 1px solid #e4e7ec;
    }

    body.identity-page .identity-actions {
        margin-top: 1.25rem;
    }

@media (max-width: 850px) {
    body.identity-page .identity-shell {
        grid-template-columns: 1fr;
    }

    body.identity-page .identity-brand {
        min-height: 230px;
        align-items: center;
        padding: 2rem;
    }

        body.identity-page .identity-brand h1 {
            font-size: 2rem;
        }

        body.identity-page .identity-brand p:not(.identity-eyebrow),
        body.identity-page .identity-security-note {
            display: none;
        }

    body.identity-page .identity-mark {
        margin-bottom: 1rem;
    }

    body.identity-page .identity-content {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    body.identity-page .identity-brand {
        min-height: 180px;
    }

    body.identity-page .identity-card {
        padding: 1.35rem;
        border-radius: 14px;
    }

    body.identity-page .identity-row {
        align-items: flex-start;
        flex-direction: column;
        gap: .75rem;
    }
}

[data-quote-purchase-orders] {
    max-width: 16rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

.erp-quote-completed > td:first-child {
    position: relative;
}
.erp-quote-completed > td:first-child::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--bs-success, #198754);
    pointer-events: none;
}

.erp-contact-head,
.erp-contact-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr) 2.75rem;
    gap: .75rem;
    align-items: start;
}
.erp-contact-head {
    padding: .5rem .5rem .65rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}
.erp-contact-row {
    padding: .65rem .5rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}
.erp-contact-row:hover,
.erp-contact-row:focus-within {
    background: var(--bs-tertiary-bg, #f8f9fa);
}
.erp-contact-field { min-width: 0; }
.erp-contact-remove {
    width: 2.75rem;
    min-height: 2.375rem;
}
.erp-contact-remove:hover,
.erp-contact-remove:focus-visible {
    color: var(--bs-danger);
    border-color: var(--bs-danger);
    background: var(--bs-danger-bg-subtle, #f8d7da);
}
@media (min-width: 768px) {
    .erp-contact-row .form-label,
    .erp-contact-remove-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}
@media (max-width: 767.98px) {
    .erp-contact-head { display: none; }
    .erp-contact-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        padding: 1rem 0;
    }
    .erp-contact-email { grid-column: 1 / -1; }
    .erp-contact-actions { grid-column: 1 / -1; justify-self: end; }
    .erp-contact-remove { width: auto; }
    .erp-contact-remove-text { margin-left: .4rem; }
}

.erp-kpi-lines {
    margin-top: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.erp-kpi-line {
    display: grid;
    grid-template-columns: minmax(6rem, 1.4fr) auto auto;
    align-items: center;
    column-gap: 0.75rem;
    font-size: 0.84rem;
    line-height: 1.25;
}

.erp-kpi-line.erp-kpi-issuer-line {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 0.15rem;
}

.erp-kpi-issuer-line .erp-kpi-line-left {
    grid-column: 1 / -1;
    white-space: normal;
    overflow-wrap: anywhere;
}

.erp-kpi-issuer-line .erp-kpi-line-center {
    display: block;
    white-space: normal;
}

.erp-kpi-line-left {
    min-width: 0;
    font-weight: 600;
    white-space: nowrap;
}

.erp-kpi-line-center {
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.erp-kpi-line-right {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .erp-kpi-line {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .erp-kpi-line-center {
        display: none;
    }
}
/* SmartHome HVAC / Safety */
.smarthome-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(320px,1fr));
    gap: 1rem;
    margin-top: 1.25rem
}

.smarthome-module-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--erp-border,#dfe4ea);
    border-radius: 16px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: transform .15s ease,box-shadow .15s ease,border-color .15s ease
}

    .smarthome-module-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 28px rgba(15,23,42,.08);
        border-color: #b8c4d4;
        color: inherit
    }

.smarthome-module-icon {
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    height: 46px;
    border-radius: 13px;
    background: #eef4ff;
    font-size: 1.35rem;
    color: #2459a9
}

.smarthome-module-body {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column
}

.smarthome-module-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #172033
}

.smarthome-module-description {
    margin-top: .35rem;
    color: #667085;
    line-height: 1.45
}

.smarthome-module-meta {
    margin-top: .75rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #667085
}

.smarthome-module-arrow {
    align-self: center;
    color: #667085
}

.smarthome-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
    gap: .85rem
}

.smarthome-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff
}

.smarthome-status-name {
    font-weight: 600;
    color: #344054
}

.smarthome-status-location {
    display: block;
    margin-top: .2rem;
    font-size: .82rem;
    color: #667085
}

.smarthome-state {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
    border-radius: 999px;
    padding: .35rem .65rem;
    font-size: .78rem;
    font-weight: 700
}

    .smarthome-state.is-ok {
        background: #eaf8ef;
        color: #18794e
    }

    .smarthome-state.is-alert {
        background: #fff1f0;
        color: #b42318
    }

.smarthome-control-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    padding: 1.25rem
}

    .smarthome-control-card h2 {
        font-size: 1.05rem;
        margin: 0 0 1rem
    }

.smarthome-section-title {
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #667085;
    margin: 1.5rem 0 .75rem
}

/* Smart Home 2.0 - unified HVAC navigation */
.smarthome-location-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .625rem;
}

.smarthome-location-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.75rem;
    padding: .625rem .9rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .75rem;
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

    .smarthome-location-pill:hover {
        border-color: rgba(var(--bs-primary-rgb), .45);
        box-shadow: 0 .25rem .75rem rgba(15, 23, 42, .08);
        transform: translateY(-1px);
        color: var(--bs-primary);
    }

    .smarthome-location-pill.is-active {
        border-color: rgba(var(--bs-primary-rgb), .55);
        background: rgba(var(--bs-primary-rgb), .08);
        color: var(--bs-primary);
    }

.smarthome-selected-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: .9rem;
    background: rgba(var(--bs-primary-rgb), .1);
    color: var(--bs-primary);
    font-size: 1.45rem;
    flex: 0 0 auto;
}

.smarthome-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.smarthome-section-card {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .9rem;
    min-height: 7rem;
    padding: 1rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .9rem;
    background: var(--bs-body-bg, #fff);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

    .smarthome-section-card:hover {
        border-color: rgba(var(--bs-primary-rgb), .4);
        box-shadow: 0 .45rem 1.2rem rgba(15, 23, 42, .09);
        transform: translateY(-2px);
        color: inherit;
    }

.smarthome-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .75rem;
    background: rgba(var(--bs-primary-rgb), .09);
    color: var(--bs-primary);
    font-size: 1.2rem;
}

.smarthome-section-content {
    min-width: 0;
}

.smarthome-section-title,
.smarthome-section-description {
    display: block;
}

.smarthome-section-title {
    margin-bottom: .25rem;
    font-weight: 700;
}

.smarthome-section-description {
    color: var(--bs-secondary-color, #6c757d);
    font-size: .9rem;
    line-height: 1.4;
}

.smarthome-section-arrow {
    color: var(--bs-secondary-color, #6c757d);
}
/* =========================================================
   MOBILE ERP SHELL
   Sidebar becomes an off-canvas menu on phones/tablets.
   Desktop layout remains unchanged.
   ========================================================= */

.erp-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.erp-mobile-menu-toggle,
.erp-mobile-sidebar-close {
    display: none;
}

.erp-sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    body.erp-mobile-menu-open {
        overflow: hidden;
    }

    .erp-shell {
        display: block;
        min-width: 0;
    }

    .erp-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1055;
        width: min(86vw, 320px);
        min-width: 0;
        height: 100dvh;
        overflow-y: auto;
        padding: 20px;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 18px 0 45px rgba(15, 23, 42, .28);
    }

    body.erp-mobile-menu-open .erp-sidebar {
        transform: translateX(0);
    }

    .erp-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1050;
        background: rgba(15, 23, 42, .48);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
    }

    body.erp-mobile-menu-open .erp-sidebar-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .erp-mobile-sidebar-close {
        display: inline-flex;
        position: absolute;
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255,255,255,.14);
        border-radius: 10px;
        background: rgba(255,255,255,.07);
        color: #fff;
        font-size: 1.15rem;
    }

    .erp-logo {
        padding-right: 46px;
        margin-bottom: 28px;
    }

    .erp-main {
        width: 100%;
        min-width: 0;
    }

    .erp-topbar {
        height: 64px;
        padding: 0 14px;
        gap: 10px;
    }

    .erp-mobile-menu-toggle {
        display: inline-flex;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        background: #fff;
        color: #334155;
        font-size: 1.45rem;
    }

    .erp-topbar-left {
        flex: 1 1 auto;
        min-width: 0;
    }

        .erp-topbar-left > div {
            min-width: 0;
        }

    .erp-top-title {
        display: none;
    }

    .erp-top-subtitle {
        font-size: 17px;
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .erp-top-right {
        flex: 0 0 auto;
        gap: 6px;
    }

    .erp-top-actions {
        gap: 4px;
    }

        .erp-top-actions > .dropdown > .erp-icon-button {
            width: 38px;
            height: 38px;
            border-radius: 11px;
        }

    .erp-user-avatar {
        width: 38px;
        height: 38px;
    }

    .erp-user-text,
    .erp-user-chevron {
        display: none;
    }

    .erp-content {
        padding: 16px;
        overflow-x: hidden;
    }

    .erp-page {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .erp-page-header {
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }

    .erp-page-title {
        font-size: 26px;
        line-height: 1.12;
    }

    .erp-page-subtitle {
        font-size: 14px;
        line-height: 1.45;
        max-width: 100%;
    }

    .erp-page-actions {
        flex: 0 0 auto;
    }

        .erp-page-actions .btn {
            min-height: 42px;
        }

    .erp-card {
        padding: 16px;
        border-radius: 16px;
    }

    .erp-kpi {
        padding: 16px;
        min-width: 0;
    }

    .erp-kpi-value {
        font-size: 26px;
        line-height: 1.12;
        overflow-wrap: anywhere;
    }

    .erp-kpi-line {
        grid-template-columns: minmax(0, 1fr) auto auto;
        column-gap: .5rem;
    }

    .erp-filter {
        padding: 16px;
    }

    .erp-bulk-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

        .erp-bulk-toolbar > .ms-auto {
            width: 100%;
            margin-left: 0 !important;
            display: flex;
            flex-wrap: wrap;
            gap: 8px !important;
        }

            .erp-bulk-toolbar > .ms-auto .btn {
                flex: 1 1 auto;
                min-height: 40px;
            }

    .table-responsive {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .erp-table {
        min-width: 760px;
    }

    /* An empty document list has no rows to scroll; keep its message and action visible. */
    .erp-table:has(.erp-empty-state) {
        min-width: 0;
    }

    .erp-table:has(.erp-empty-state) thead {
        display: none;
    }

    .erp-footer {
        height: auto;
        min-height: 48px;
        padding: 12px 16px;
        gap: 8px;
        flex-wrap: wrap;
    }
}

@media (max-width: 575.98px) {
    .erp-content {
        padding: 12px;
    }

    .erp-page-header {
        flex-direction: column;
    }

    .erp-page-actions {
        width: 100%;
    }

        .erp-page-actions .btn {
            width: 100%;
            justify-content: center;
        }

    .erp-card,
    .erp-filter,
    .erp-kpi {
        border-radius: 14px;
    }

    .erp-kpi-line {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .erp-kpi-line-center {
        display: none;
    }

    .erp-top-actions > .dropdown:first-child {
        display: none;
    }

    .erp-top-dropdown {
        width: min(300px, calc(100vw - 20px));
    }
}

.erp-file-picker-control { position: relative; flex-shrink: 0; overflow: hidden; }
.erp-file-drop { border: 1px dashed var(--bs-border-color, #ced4da); border-radius: .5rem; padding: 1rem; }
.erp-file-drop:focus, .erp-file-drop.is-dragging { outline: 2px solid var(--bs-primary, #0d6efd); outline-offset: 2px; background: #f3f8ff; }
.erp-file-picker-control input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.erp-file-picker-control:focus-within { outline: 3px solid var(--bs-primary, #0d6efd); outline-offset: 2px; }

/* One help button and heading row across documents, catalogues and administration. */
.erp-help-heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: .5rem;
}
.erp-help-heading > .erp-document-eyebrow,
.erp-help-heading > .erp-eyebrow { margin-bottom: 0; min-width: 0; }
.btn.erp-help-button {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    white-space: nowrap;
    color: var(--bs-secondary-color);
    border: 1px solid transparent;
    border-radius: var(--bs-border-radius-sm, .25rem);
    background: transparent;
    padding: .25rem .5rem;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
}
.btn.erp-help-button:hover,
.btn.erp-help-button:focus-visible {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}
.btn.erp-help-button:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

input[data-live-search="true"]::-webkit-search-cancel-button { -webkit-appearance: none; }
[data-live-search-form] [data-search-submit-only] { display: none !important; }

.erp-catalog-filters[data-live-search-form] {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 140px auto auto;
    align-items: end;
    gap: 16px 20px;
    margin: 0;
}
.erp-catalog-filters[data-live-search-form].has-extra-select {
    grid-template-columns: minmax(240px, 1fr) minmax(180px, 1fr) 120px auto auto;
}
.erp-catalog-filters[data-live-search-form] > div { width: auto; padding: 0; margin: 0; min-width: 0; }
.erp-catalog-filters[data-live-search-form] > input[type="hidden"] { display: none; }
.erp-catalog-filters[data-live-search-form] .form-control,
.erp-catalog-filters[data-live-search-form] .form-select { min-height: 54px; }
.erp-catalog-filters[data-live-search-form] .form-switch { margin-top: 0 !important; margin-bottom: 0; min-height: 54px; display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.erp-catalog-filters[data-live-search-form] .form-switch .form-check-input { margin-top: 0; }
.erp-catalog-filters[data-live-search-form] > .d-flex { align-items: center; min-height: 54px; }
.erp-catalog-filters[data-live-search-form] .input-group > .btn { border-radius: 0 12px 12px 0; }
@media (max-width: 1199px) {
    .erp-catalog-filters[data-live-search-form], .erp-catalog-filters[data-live-search-form].has-extra-select { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .erp-catalog-filters[data-live-search-form] > div:first-of-type { grid-column: 1 / -1; }
}
@media (max-width: 575px) {
    .erp-catalog-filters[data-live-search-form] > .d-flex { grid-column: 1 / -1; justify-content: flex-end; min-height: 0; }
}

.billing-status-sent { background: #dbeafe; color: #1e40af; }
.billing-book-cell { min-width: 215px; }
.billing-invoices-cell { min-width: 150px; }
.billing-book-cell .billing-status { display: inline-block; white-space: normal; }
.billing-book-selection { padding: 1rem; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; }
.billing-book-selection legend { float: none; width: auto; padding: 0 .35rem; }
.billing-book-selection .form-check-label { cursor: pointer; }

/* Document list filters share one row on desktop, including delivery and page size. */
@media (min-width: 1200px) {
    .erp-document-filter-row { flex-wrap: nowrap; }
    .erp-document-filter-row > [class*="col-"] { flex: 1 1 0; width: auto; min-width: 0; }
    .erp-document-filter-row > .erp-filter-search { flex: 2 1 0; }
    .erp-document-filter-row > .erp-filter-page-size { flex: 0 0 6.5rem; }
    .erp-document-filter-row > [data-search-submit-only] { flex: 0 0 7rem; }
    .erp-document-filter-row .form-label { white-space: nowrap; }
    .erp-document-filter-row.erp-filter-separate-search { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .erp-document-filter-row.erp-filter-separate-search > [class*="col-"] { width: 100%; }
    .erp-document-filter-row.erp-filter-separate-search > .erp-filter-search { grid-column: 1 / -1; }
}
@media (min-width: 1600px) {
    .erp-document-filter-row.erp-filter-separate-search { grid-template-columns: 1fr 1fr 1.6fr 12rem 12rem 6.5rem; }
}
/* Measurement book: consistent action alignment and usable mobile controls. */
.erp-workbook-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.erp-workbook-page .btn { white-space: normal; }
.erp-workbook-page .erp-file-picker { flex-wrap: wrap; }
.erp-workbook-page .erp-card > summary { line-height: 1.5; }
.erp-workbook-history { --bs-offcanvas-width: 860px; max-width: 100vw; }
.erp-workbook-history .offcanvas-body { overflow-wrap: anywhere; }
.concrete-line-quantity { min-width: 7rem; max-width: 10rem; margin-left: auto; }
/* Five numbered lights share the workflow phase used by both document lists. */
.erp-workbook-phase-lamps { display: flex; align-items: center; gap: .5rem; padding: .35rem .2rem; margin: 0; list-style: none; }
.erp-workbook-phase-lamp { position: relative; display: grid; place-items: center; flex: 0 0 1.5rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; font-size: .75rem; font-weight: 600; line-height: 1; }
.erp-workbook-phase-done { background: var(--bs-success, #198754); color: #fff; }
.erp-workbook-phase-current { background: var(--bs-warning, #ffc107); color: #212529; outline: 2px solid var(--bs-warning, #ffc107); outline-offset: 2px; }
.erp-workbook-phase-future { background: var(--bs-secondary-bg, #e9ecef); color: var(--bs-secondary-color, #6c757d); }
.erp-workbook-phase-warning { background: var(--bs-danger, #dc3545); color: #fff; outline: 2px solid var(--bs-danger, #dc3545); outline-offset: 2px; }
@media (max-width: 575.98px) {
    .erp-workbook-actions > .btn { width: 100%; }
    .erp-workbook-page nav .btn { flex: 1 1 auto; }
}
.erp-workbook-next { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.25rem; border-left: 4px solid var(--bs-primary, #0d6efd); }
.erp-workbook-next > div { flex: 1 1 22rem; }
.erp-workbook-page [id^="workbook-"] { scroll-margin-top: 6rem; }
/* Let descriptions wrap so workbook dates and amounts stay together. */
.erp-workbook-description {
    width: 30%;
    white-space: normal;
    overflow-wrap: anywhere;
}
.erp-workbook-description > div {
    min-width: 12rem;
    max-width: 26rem;
}

.erp-business-notices { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 80px); overflow-y: auto; }
.erp-business-notice-items { max-height: min(60vh, 560px); overflow-y: auto; overflow-wrap: anywhere; }

/* The source wordmark is shared with invoice PDFs; retain its original proportions. */
body.identity-page .identity-brand-logo {
    display: block;
    width: min(100%, 330px);
    height: auto;
    margin-bottom: 2.5rem;
}
body.identity-page .identity-button:focus-visible,
body.identity-page .btn-primary:focus-visible {
    outline: 3px solid #594800;
    outline-offset: 3px;
}
body.identity-page .identity-check input { accent-color: #806000; }
body.identity-page .identity-link { color: #725700; }
@media (max-width: 850px) {
    body.identity-page .identity-brand-logo { width: min(100%, 240px); margin-bottom: 1.5rem; }
}
@media (max-width: 600px) {
    body.identity-page .identity-shell { grid-template-rows: auto 1fr; }
    body.identity-page .identity-brand { min-height: 0; padding: 1.25rem 1.5rem .5rem; }
    body.identity-page .identity-brand-logo { width: min(100%, 180px); margin-bottom: .65rem; }
    body.identity-page .identity-brand .identity-eyebrow { display: none; }
    body.identity-page .identity-brand h1 { margin: 0; font-size: 1.25rem; line-height: 1.3; }
    body.identity-page .identity-content { justify-content: flex-start; }
}


.erp-kpi-history { margin: 18px 0 0; }
.erp-kpi-history-legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; color: #52627a; margin-bottom: 8px; }
.erp-kpi-history-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; background: #294d75; }
.erp-kpi-history-legend .history-current::before { background: #c29114; }
.erp-kpi-history-scroll { overflow-x: auto; }
.erp-kpi-history-svg { width: 100%; min-width: 650px; height: auto; display: block; }
.history-grid { stroke: #e7edf3; stroke-width: 1; }
.history-baseline { stroke: #a8b6c6; stroke-width: 1; }
.history-axis { fill: #62728a; font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.history-area { fill: #294d75; fill-opacity: .06; }
.history-line { stroke: #294d75; stroke-width: 2.5; fill: none; stroke-linejoin: round; }
.history-mark-complete { fill: #294d75; }
.history-mark-current { fill: #c29114; }
.history-dot { stroke: white; stroke-width: 2; }
.history-count { fill: #253b55; font-size: 12px; font-weight: 600; font-family: inherit; }
.erp-kpi-history-data { margin-top: 10px; font-size: 13px; }
.erp-kpi-history-data summary { cursor: pointer; color: #52627a; }
.erp-kpi-history-data .table-responsive { margin-top: 12px; }
.erp-kpi-author-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0; font-size: 13px; }
.erp-kpi-author-legend > span { display: inline-flex; align-items: center; }
.erp-kpi-author-colour { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; flex: 0 0 auto; }
.erp-kpi-author-data { font-size: 13px; }
.erp-kpi-author-data th:first-child { position: sticky; left: 0; z-index: 1; background: var(--bs-body-bg, #fff); }
.history-author-segment { stroke: white; stroke-width: .5; }
.history-author-current { fill: none; stroke: #c29114; stroke-width: 3; pointer-events: none; }

/* Concrete control: readable columns without inheriting the generic nowrap/min-width. */
.concrete-control-table-wrap { width:100%; min-width:0; }
.concrete-control .concrete-control-table { width:100%; min-width:0; table-layout:fixed; }
.concrete-control-table th { white-space:normal; line-height:1.45; letter-spacing:.035em; padding:12px 8px; }
.concrete-control-table td { padding:16px 8px; overflow-wrap:anywhere; }
.concrete-control-table .concrete-volume { font-variant-numeric:tabular-nums; }
.concrete-control-table .concrete-volume-note { white-space:normal; line-height:1.5; font-size:.75rem; margin-top:5px; }
.concrete-control-year { display:block; font-weight:400; font-size:.85em; color:#64748b; }
.concrete-control-state { display:inline-block; font-weight:700; line-height:1.45; }
.concrete-control-table tfoot td,.concrete-control-table tfoot th { background:#f8fafc; font-weight:700; border-top:2px solid #e2e8f0; text-transform:none; letter-spacing:normal; }
.concrete-control-reference { padding:12px 14px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:10px; }
.concrete-control-reference summary { font-weight:600; cursor:pointer; }
.concrete-meter-values { display:flex; flex-wrap:wrap; gap:12px 32px; }
.concrete-meter-values dt { color:#64748b; font-weight:500; }
.concrete-meter-values dd { font-variant-numeric:tabular-nums; margin:3px 0 0; font-weight:600; }
.concrete-batch-table { width:100%; table-layout:fixed; }
.concrete-batch-table th { white-space:normal; }
.concrete-batch-table td { overflow-wrap:anywhere; }
.concrete-batch-table th:nth-child(1) { width:17%; }
.concrete-batch-table th:nth-child(2) { width:18%; }
.concrete-batch-table th:nth-child(3) { width:27%; }
.concrete-batch-table th:nth-child(4) { width:18%; }
.concrete-batch-table th:nth-child(5) { width:20%; }
.concrete-batch-page-size { max-width:110px; }
@media (max-width:767.98px) {
    .concrete-control .concrete-control-table,.concrete-control-table tbody,.concrete-control-table tfoot { display:block; width:100%; }
    .concrete-control-table colgroup,.concrete-control-table thead { display:none; }
    .concrete-control-table tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); border:1px solid #e2e8f0; border-radius:12px; margin-bottom:14px; padding:4px; overflow:hidden; }
    .concrete-control-table td,.concrete-control-table th { display:flex; flex-direction:column; align-items:flex-start; width:auto; padding:10px 12px; text-align:left!important; border:0; }
    .concrete-control-table td::before { content:attr(data-label); font-size:.72rem; line-height:1.45; color:#64748b; font-weight:600; margin-bottom:4px; }
    .concrete-control-table td:first-child,.concrete-control-table th:first-child,.concrete-control-table td:last-child { grid-column:1/-1; }
    .concrete-control-table td:first-child { border-bottom:1px solid #e2e8f0; }
    .concrete-control-table td:first-child::before { display:none; }
    .concrete-control-year { display:inline; margin-left:3px; }
    .concrete-control-table tfoot tr { background:#f8fafc; }
    .concrete-control-table tfoot th { border-bottom:1px solid #e2e8f0; }
}

/* Closed help panels must not enlarge the document on narrow screens. */
#concreteDeliveryHelpPanel:not(.show):not(.showing):not(.hiding),
#concreteControlHelpPanel:not(.show):not(.showing):not(.hiding) { display:none; }

/* Keep accessible action labels inside their scrollable document table. */
.concrete-delivery-list .table-responsive { position:relative; }

/* Rental tables keep readable columns and accessible labels inside the scroll area. */
.rent-table-scroll { position:relative; overflow-x:auto; max-width:100%; }
.rent-table-scroll table { min-width:760px; }
.rent-table-scroll td:nth-child(2) { min-width:220px; }
.rent-template-line { min-width:0; }
.rent-tenant-form .bauimex-lookup-results:empty { display:none; }
.rent-tenant-form .bauimex-lookup-results-smart { min-height:0; max-height:24rem; overflow-y:auto; }
