body {
    font-size: 0.95rem;
}

.app-brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
}

.app-brand-logo {
    width: 1.9rem;
    height: 1.9rem;
    display: block;
}

.app-content-header {
    padding: 1rem 0;
}

.page-header-shell {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.card-title {
    font-weight: 600;
}

.table td,
.table th {
    vertical-align: middle;
}

.login-page {
    min-height: 100vh;
}

.brand-text {
    font-weight: 600;
}

.nav-link p {
    margin: 0;
}

.app-header [data-account-menu] {
    position: relative;
}

.app-header [data-account-menu-items] {
    left: auto;
    right: 0;
    min-width: 11rem;
    max-width: min(18rem, calc(100vw - 1rem));
}

.app-sidebar-toggle {
    display: none;
}

.app-sidebar-toggle-bars,
.app-sidebar-toggle-bars::before,
.app-sidebar-toggle-bars::after {
    display: block;
    width: 1.25rem;
    height: 0.125rem;
    background: currentColor;
    border-radius: 0.125rem;
}

.app-sidebar-toggle-bars {
    position: relative;
}

.app-sidebar-toggle-bars::before,
.app-sidebar-toggle-bars::after {
    position: absolute;
    left: 0;
    content: "";
}

.app-sidebar-toggle-bars::before {
    top: -0.4rem;
}

.app-sidebar-toggle-bars::after {
    top: 0.4rem;
}

.app-sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.45);
}

.app-sidebar-scrim[hidden] {
    display: none !important;
}

.help-popover {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.help-popover-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
}

.help-popover-content {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1085;
    width: min(18rem, calc(100vw - 2rem));
    max-width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
    overflow-y: auto;
    padding: 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    color: var(--bs-body-color);
    background: var(--bs-body-bg);
    white-space: normal;
    overflow-wrap: anywhere;
}

.help-popover-content[hidden] {
    display: none !important;
}

.help-layout {
    align-items: flex-start;
}

.help-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.help-section {
    scroll-margin-top: 1rem;
}

.help-section-toggle {
    width: 100%;
    min-height: 3rem;
    padding: var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);
    border: 0;
    text-align: left;
    color: inherit;
    background: var(--bs-card-cap-bg);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.help-section-toggle:focus-visible {
    outline: 0.2rem solid rgba(var(--bs-primary-rgb), 0.35);
    outline-offset: -0.2rem;
}

.help-section-caret {
    flex: 0 0 auto;
    margin-left: auto;
    width: 0.55rem;
    height: 0.55rem;
    border-right: 0.125rem solid currentColor;
    border-bottom: 0.125rem solid currentColor;
    transform: rotate(45deg);
}

.help-section-toggle[aria-expanded="true"] .help-section-caret {
    transform: rotate(225deg);
}

.container-fluid {
    max-width: 1400px;
}

.form-label {
    font-weight: 600;
}

.text-danger {
    font-size: 0.875rem;
}

#productNameSuggestions,
#manufacturerNameSuggestions,
#manufacturerSuggestions {
    max-height: 260px;
    overflow-y: auto;
}

.manifest-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.manifest-table-responsive .table {
    min-width: 760px;
}

.scanner-video-shell {
    position: relative;
    min-height: 280px;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #111827;
}

.scanner-sdk-host,
.scanner-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.scanner-sdk-host {
    z-index: 1;
}

.scanner-sdk-host > * {
    width: 100%;
    height: 100%;
}

.scanner-video {
    display: block;
    object-fit: cover;
    z-index: 0;
}

.scanner-video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
    color: #d1d5db;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    z-index: 0;
}

.scanner-video-placeholder-text {
    display: block;
    width: min(72%, 26rem);
    max-width: calc(100% - 2rem);
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}

.scanner-guide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.scanner-guide-frame {
    width: min(78%, 420px);
    height: 36%;
    border: 3px solid rgba(255, 255, 255, 0.92);
    border-radius: 1rem;
    box-shadow: 0 0 0 9999px rgba(17, 24, 39, 0.28);
    position: relative;
}

.scanner-guide-frame::before,
.scanner-guide-frame::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    height: 2px;
    background: rgba(255, 255, 255, 0.7);
}

.scanner-guide-frame::before {
    top: 22%;
}

.scanner-guide-frame::after {
    bottom: 22%;
}

.scanner-input {
    font-variant-numeric: tabular-nums;
}

.scan-settings {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding-top: 0.9rem;
}

.scan-settings-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.scan-settings-summary::-webkit-details-marker {
    display: none;
}

.scan-settings-summary::after {
    content: "";
    width: 0.7rem;
    height: 0.7rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    flex: 0 0 auto;
    margin-right: 0.15rem;
    transition: transform 0.15s ease;
}

.scan-settings[open] .scan-settings-summary::after {
    transform: rotate(225deg);
}

.scan-settings-body {
    margin-top: 1rem;
}

@media (pointer: coarse) and (max-width: 1366px) {
    .scan-primary-column {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .scan-page .card-title {
        font-size: 1.1rem;
    }

    .scan-page .card-body,
    .scan-page .form-label,
    .scan-page .form-text,
    .scan-page .text-body-secondary,
    .scan-page .scan-hint-list {
        font-size: 1rem;
    }

    .scan-page .btn,
    .scan-page .form-select,
    .scan-page .form-control {
        font-size: 1rem;
    }

    .scan-page .scanner-input {
        font-size: 1.15rem;
    }

    .scan-page .scanner-video-shell {
        min-height: 420px;
    }
}

.decision-card {
    border: 1px solid rgba(13, 110, 253, 0.15);
    border-radius: 0.75rem;
    padding: 1rem;
    height: 100%;
    background: rgba(248, 250, 252, 0.9);
}

.catalogue-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 30rem;
}

.catalogue-table {
    min-width: 1120px;
}

.catalogue-table th {
    white-space: nowrap;
}

.catalogue-filter-menu {
    position: relative;
    flex: 1 1 auto;
}

.catalogue-header-shell {
    display: flex;
    align-items: flex-start;
    gap: 0.1rem;
}

.analytics-card .card-body {
    min-height: 22rem;
    min-width: 0;
    overflow-x: hidden;
}

.analytics-chart-shell {
    position: relative;
    min-height: 19rem;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.analytics-chart-canvas {
    display: block;
    width: 100% !important;
    max-width: 100%;
}

.analytics-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.analytics-table-responsive .table {
    width: 100%;
    min-width: 0;
}

@media (max-width: 768px) {
    .analytics-chart-shell {
        min-height: 16rem;
    }
}

.catalogue-sort-button {
    flex: 0 0 auto;
    width: 1.2rem;
    height: 1.2rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #334155;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
    margin-top: 0.02rem;
}

.catalogue-sort-button::before {
    content: "";
    width: 1.05rem;
    height: 1.05rem;
    background-color: currentColor;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
}

.catalogue-sort-button[data-sort-state="none"]::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M8 1l3 3H9v8h2l-3 3-3-3h2V4H5l3-3z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M8 1l3 3H9v8h2l-3 3-3-3h2V4H5l3-3z'/%3E%3C/svg%3E");
}

.catalogue-sort-button[data-sort-state="asc"]::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M8 2l4 4H9v8H7V6H4l4-4z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M8 2l4 4H9v8H7V6H4l4-4z'/%3E%3C/svg%3E");
}

.catalogue-sort-button[data-sort-state="desc"]::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M8 14l-4-4h3V2h2v8h3l-4 4z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M8 14l-4-4h3V2h2v8h3l-4 4z'/%3E%3C/svg%3E");
}

.catalogue-sort-button:hover {
    color: #0d6efd;
}

.catalogue-filter-summary {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    list-style: none;
    cursor: pointer;
    user-select: none;
    min-height: 1.4rem;
    padding: 0.05rem 0;
    line-height: 1.1;
}

.catalogue-filter-summary::-webkit-details-marker {
    display: none;
}

.catalogue-filter-heading {
    display: inline-flex;
    align-items: center;
    min-height: 1.2rem;
}

.catalogue-filter-title {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    line-height: 1;
}

.catalogue-filter-title::after {
    content: "";
    width: 0.82rem;
    height: 0.82rem;
    background-color: #64748b;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M3 6l5 5 5-5H3z'/%3E%3C/svg%3E");
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M3 6l5 5 5-5H3z'/%3E%3C/svg%3E");
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    flex: 0 0 auto;
}

.catalogue-filter-summary small {
    color: #0d6efd;
    font-weight: 500;
    white-space: nowrap;
}

.catalogue-filter-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 10;
    width: min(18rem, 70vw);
    padding: 0.9rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 1rem 2rem rgba(15, 23, 42, 0.12);
}

.catalogue-filter-end .catalogue-filter-panel {
    left: auto;
    right: 0;
}

.catalogue-filter-menu[open] .catalogue-filter-summary {
    color: #0d6efd;
}

.catalogue-filter-menu[open] .catalogue-filter-title::after {
    background-color: #0d6efd;
}

.catalogue-cell-truncate {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalogue-cell-product {
    max-width: 18rem;
}

.catalogue-cell-manufacturer {
    max-width: 13rem;
}

.catalogue-cell-category,
.catalogue-cell-dg {
    max-width: 14rem;
}

@media (max-width: 991.98px) {
    .app-wrapper {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "lte-app-header"
            "lte-app-main" !important;
    }

    .app-header,
    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .app-header {
        left: 0 !important;
        right: 0 !important;
    }

    .app-header .container-fluid {
        max-width: none;
    }

    .app-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 2.5rem;
        height: 2.5rem;
        margin-right: 0.75rem;
    }

    .app-sidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1050 !important;
        width: min(17rem, 86vw);
        min-width: min(17rem, 86vw) !important;
        max-width: 86vw;
        margin-left: 0 !important;
        margin-right: 0 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.2s ease;
    }

    body.app-sidebar-mobile-open {
        overflow: hidden;
    }

    body.app-sidebar-mobile-open .app-sidebar {
        transform: translateX(0) !important;
    }
}

@media (max-width: 767.98px) {
    .generic-choice-table {
        min-width: 0 !important;
    }

    .generic-choice-secondary {
        display: none;
    }

    .generic-choice-table th:last-child,
    .generic-choice-table td:last-child {
        width: 1%;
        white-space: nowrap;
    }

    .page-header-actions {
        width: 100%;
        align-items: stretch;
    }

    .page-header-actions .btn {
        width: 100%;
    }

    .catalogue-filter-panel {
        width: min(16rem, 84vw);
    }
}
