:root {
    --erp-brand: #066fd1;
}

[data-live-notification-badge] {
    color: #ffffff !important;
}

.erp-brand {
    align-items: center;
    color: inherit;
    display: inline-flex;
    gap: 0.75rem;
    text-decoration: none;
}

.erp-brand:hover {
    color: inherit;
    text-decoration: none;
}

.erp-brand-mark {
    align-items: center;
    background: var(--erp-brand);
    border-radius: 8px;
    color: #ffffff;
    display: inline-flex;
    font-size: 0.8125rem;
    font-weight: 700;
    height: 2rem;
    justify-content: center;
    width: 2.75rem;
}

.erp-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.erp-brand-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.erp-brand-text {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0;
}

.erp-brand-subtitle {
    color: var(--tblr-secondary);
    font-size: 0.6875rem;
    font-weight: 500;
}

.dropdown-app {
    align-items: center;
    border: 1px solid var(--tblr-border-color);
    border-radius: 8px;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 4.75rem;
    justify-content: center;
    padding: 0.75rem;
    text-align: center;
    text-decoration: none;
}

.dropdown-app:hover {
    background: var(--tblr-bg-surface-secondary);
    color: inherit;
    text-decoration: none;
}

.erp-illustration {
    align-items: center;
    background: var(--tblr-primary-lt);
    border-radius: 50%;
    color: var(--tblr-primary);
    display: flex;
    height: 8rem;
    justify-content: center;
    margin-left: auto;
    width: 8rem;
}

.erp-illustration .icon {
    height: 4rem;
    width: 4rem;
}

.chart-lg {
    min-height: 300px;
}

.dropdown-item-icon {
    height: 1rem;
    margin-right: 0.5rem;
    width: 1rem;
}

.erp-table-toolbar {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.erp-table-search {
    flex: 1 1 18rem;
}

.erp-table-filter {
    flex: 0 1 14rem;
}

.erp-table-tools {
    align-items: end;
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: auto;
}

.erp-table-page-size {
    min-width: 7rem;
}

.erp-table-toolbar-sticky {
    background: var(--tblr-card-bg, var(--tblr-bg-surface));
    position: sticky;
    top: var(--erp-table-toolbar-top, 0);
    z-index: 21;
}

.card > .table-responsive {
    max-height: calc(100vh - 18rem);
    overflow: auto;
}

.erp-table-pagination-footer {
    align-items: center;
    background: var(--tblr-card-bg, var(--tblr-bg-surface));
    border-top: 1px solid var(--tblr-border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.erp-filter-menu {
    min-width: 15rem;
}

.erp-column-menu {
    max-height: 20rem;
    min-width: 16rem;
    overflow-y: auto;
}

.erp-sort-header {
    align-items: center;
    display: inline-flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

.erp-sort-button {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--tblr-secondary);
    display: inline-flex;
    height: 1.25rem;
    justify-content: center;
    padding: 0;
    width: 1.25rem;
}

.erp-sort-button:hover,
.erp-sort-button.is-sorted-asc,
.erp-sort-button.is-sorted-desc {
    color: var(--tblr-primary);
}

.erp-sort-button.is-sorted-desc .icon {
    transform: rotate(180deg);
}

.card-table th,
.card-table td {
    border-right: 1px solid var(--tblr-border-color);
}

.card-table {
    table-layout: auto;
}

.erp-action-column {
    min-width: 14rem;
}

.table:not(.card-table)[data-erp-columns-ready="true"] thead th {
    position: relative;
}

/* Keep inline table actions readable instead of allowing their fields to
   collapse when the action column is narrower than its contents. */
.table-responsive .table td form.d-flex {
    align-items: center;
    gap: 0.5rem;
}

.table-responsive .table td form.d-flex > .form-control,
.table-responsive .table td form.d-flex > .form-select {
    flex: 1 1 10rem;
    min-width: 10rem;
}

.table-responsive .table td form.d-flex > .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.table-responsive .table td .btn-list {
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.card-table thead th {
    background: var(--tblr-card-bg, var(--tblr-bg-surface));
    box-shadow: inset 0 -1px 0 var(--tblr-border-color);
    position: sticky;
    top: 0;
    z-index: 20;
}

.card-table th {
    user-select: none;
}

.card-table th.erp-column-hidden,
.card-table td.erp-column-hidden,
.card-table col.erp-column-hidden {
    display: none;
}

.card-table tr.erp-row-page-hidden {
    display: none;
}

.card-table th[draggable="true"] {
    cursor: grab;
}

.card-table th.erp-column-dragging {
    cursor: grabbing;
    opacity: 0.55;
}

.card-table th.erp-column-drop-target {
    box-shadow: inset 3px 0 0 var(--tblr-primary);
}

.erp-column-resizer {
    bottom: 0;
    cursor: col-resize;
    position: absolute;
    right: -3px;
    top: 0;
    width: 6px;
    z-index: 3;
}

.erp-column-resizer:hover,
.erp-column-resizer.is-resizing {
    background: color-mix(in srgb, var(--tblr-primary) 25%, transparent);
}

body.erp-column-resizing {
    cursor: col-resize;
    user-select: none;
}

.card-table th:last-child,
.card-table td:last-child {
    border-right: 0;
}

th.text-end .erp-sort-header {
    justify-content: flex-end;
}

.erp-modal-section-title {
    color: var(--tblr-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .erp-navigation-header {
        background: var(--tblr-body-bg);
        position: sticky;
        top: 0;
        z-index: 1020;
    }

    .erp-navigation-header .navbar-nav > .dropdown {
        position: relative;
    }

    .erp-navigation-header .navbar-nav > .dropdown > .dropdown-menu {
        left: 0;
        margin-top: 0;
        top: 100%;
    }

    .erp-navigation-header .erp-nav-dropdown,
    .erp-navigation-header .erp-nav-submenu {
        border-radius: 6px;
        box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.12);
        min-width: 14rem;
        padding: 0.35rem;
    }

    .erp-navigation-header .erp-nav-dropend {
        position: relative;
    }

    .erp-navigation-header .erp-nav-dropend > .erp-nav-submenu {
        left: calc(100% + 0.2rem);
        margin-left: 0;
        margin-top: -0.35rem;
        top: 0;
    }

    .erp-navigation-header .erp-nav-dropend::after {
        bottom: 0;
        content: "";
        position: absolute;
        right: -0.35rem;
        top: 0;
        width: 0.35rem;
    }

    .erp-navigation-header .dropdown-item {
        align-items: center;
        border-radius: 4px;
        display: flex;
        min-height: 2.25rem;
        white-space: nowrap;
    }

    .erp-navigation-header .dropdown-item.dropdown-toggle {
        justify-content: flex-start;
        padding-right: 1.75rem;
        position: relative;
    }

    .erp-navigation-header .dropdown-item.dropdown-toggle::after {
        margin-left: auto;
        position: absolute;
        right: 0.75rem;
    }

    .erp-navigation-header .navbar-nav > .dropdown:hover > .dropdown-menu,
    .erp-navigation-header .erp-nav-dropend:hover > .dropdown-menu {
        display: block;
    }

    .erp-navigation-header .erp-nav-dropend:hover > .dropdown-toggle::after {
        transform: rotate(-90deg);
    }
}

@media (max-width: 575.98px) {
    .erp-illustration {
        height: 5.5rem;
        width: 5.5rem;
    }

    .erp-illustration .icon {
        height: 2.75rem;
        width: 2.75rem;
    }
}

.erp-header-health {
    align-items: center;
    background: var(--tblr-bg-surface, #fff);
    border: 1px solid var(--tblr-border-color, #dce1e7);
    border-radius: 999px;
    display: flex;
    font-size: .75rem;
    font-weight: 600;
    gap: .5rem;
    max-width: min(18rem, 30vw);
    min-height: 2rem;
    padding: .35rem .65rem;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.erp-header-health[data-state="pending"] {
    background: var(--tblr-warning-lt, #fff3bf);
    border-color: var(--tblr-warning, #f59f00);
}

.erp-header-health[data-state="warning"],
.erp-header-health[data-state="offline"] {
    background: var(--tblr-danger-lt, #ffe3e3);
    border-color: var(--tblr-danger, #d63939);
    color: var(--tblr-danger, #d63939);
}

.erp-header-health-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-health-dropdown {
    width: min(30rem, calc(100vw - 2rem));
}

.erp-health-scroll {
    max-height: min(65vh, 32rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.erp-notification-dropdown {
    width: min(26rem, calc(100vw - 2rem));
}

.erp-notification-scroll {
    max-height: min(60vh, 26rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.erp-notification-unread {
    box-shadow: inset 3px 0 0 var(--tblr-primary);
}

.erp-notification-dropdown .erp-notification-unread {
    cursor: pointer;
}

.erp-notification-actions {
    border-top: 1px solid var(--tblr-border-color);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.erp-notification-actions .list-group-item {
    align-items: center;
    border: 0;
    display: flex;
    justify-content: center;
    min-height: 3rem;
}

.erp-notification-actions .list-group-item + .list-group-item {
    border-left: 1px solid var(--tblr-border-color);
}

.erp-workflow-output-card {
    border: 1px solid;
    border-radius: .75rem;
    padding: 1rem;
    transition: background-color .2s ease, border-color .2s ease;
}

.erp-workflow-output-card[data-state="missing"] {
    background: #fff1f2;
    border-color: #fecdd3;
}

.erp-workflow-output-card[data-state="uploaded"] {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.erp-workflow-output-icon {
    align-items: center;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(98, 105, 118, .18);
    border-radius: .5rem;
    display: inline-flex;
    height: 2.25rem;
    justify-content: center;
    width: 2.25rem;
}

.erp-workflow-output-card[data-state="missing"] .erp-workflow-output-icon {
    color: var(--tblr-danger);
}

.erp-workflow-output-card[data-state="uploaded"] .erp-workflow-output-icon {
    color: var(--tblr-success);
}

.erp-case-timeline-scroll {
    max-height: 27rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: .75rem;
    scrollbar-gutter: stable;
}

.erp-case-timeline-scroll .step-item {
    min-width: 0;
    overflow-wrap: anywhere;
}

.erp-case-state-card {
    border: 1px solid;
    border-radius: .625rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 10rem;
    padding: .75rem;
}

.erp-case-state-card[data-tone="secondary"] {
    background: var(--tblr-secondary-lt, #f1f3f5);
    border-color: var(--tblr-border-color, #dce1e7);
}

.erp-case-state-card[data-tone="yellow"] {
    background: var(--tblr-yellow-lt, #fff9db);
    border-color: #ffe066;
}

.erp-case-state-card[data-tone="green"] {
    background: var(--tblr-green-lt, #ebfbee);
    border-color: #8ce99a;
}

.erp-case-state-card[data-tone="red"] {
    background: var(--tblr-red-lt, #fff5f5);
    border-color: #ffa8a8;
}

.erp-case-state-card .badge {
    align-self: flex-start;
}

.erp-case-price-summary {
    min-width: 15rem;
    padding: .25rem 0;
}

.erp-case-price-amount {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    margin-top: .1rem;
}

.erp-case-history-item {
    border-left: 3px solid var(--tblr-primary);
    padding-left: 1rem;
}

@media (max-width: 575.98px) {
    .erp-header-health {
        border: 0;
        background: transparent;
        padding: .35rem;
    }

    .erp-header-health-text {
        display: none;
    }
}
