/* Be sure to update the version in the inclusion file to break the caching */
/*PICO Overrides*/
:root {
    /*--pico-font-family-sans-serif: "Roboto Mono", system-ui, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, Helvetica, Arial, "Helvetica Neue", sans-serif, var(--pico-font-family-emoji);*/
    /*--pico-font-family-monospace: "JetBrains Mono", monospace;*/
    --pico-font-family-sans-serif: Inter, system-ui, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, Helvetica, Arial, "Helvetica Neue", sans-serif, var(--pico-font-family-emoji);
    --pico-font-size: 87.5%;
    /* Original: 100% */
    --pico-line-height: 1.25;
    /* Original: 1.5 */
    --pico-form-element-spacing-vertical: 0.5rem;
    /* Original: 1rem */
    --pico-form-element-spacing-horizontal: 1.0rem;
    /* Original: 1.25rem */
    --pico-border-radius: 0.375rem;
    /* Original: 0.25rem */

    /*Custom Variables*/
    --pill-padding: 1px 4px;
    --inventory-good-background: var(--pico-color-azure-100);
    --inventory-good-color: var(--pico-color-azure-950);
    --inventory-location-background: var(--pico-color-violet-150);
    --inventory-location-color: var(--pico-color-violet-850);
    --inventory-container-background: var(--pico-color-jade-150);
    --inventory-container-color: var(--pico-color-jade-850);
}


@media (min-width: 576px) {
    :root {
        --pico-font-size: 87.5%;
        /* Original: 106.25% */
    }
}

@media (min-width: 768px) {
    :root {
        --pico-font-size: 87.5%;
        /* Original: 112.5% */
    }
}

@media (min-width: 1024px) {
    :root {
        --pico-font-size: 87.5%;
        /* Original: 118.75% */
    }
}

@media (min-width: 1280px) {
    :root {
        --pico-font-size: 87.5%;
        /* Original: 125% */
    }
}

@media (min-width: 1536px) {
    :root {
        --pico-font-size: 87.5%;
        /* Original: 131.25% */
    }
}

main.content {
    margin-left: var(--pico-spacing);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    --pico-font-weight: 600;
    /* Original: 700 */
}

article {
    border: 1px solid var(--pico-muted-border-color);
    /* Original doesn't have a border */
    border-radius: calc(var(--pico-border-radius) * 2);
    /* Original: var(--pico-border-radius) */
}

article > footer {
    border-radius: calc(var(--pico-border-radius) * 2);
    /* Original: var(--pico-border-radius) */
}

/* Site Layout */
.sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar > li {
    margin-left: 12px;
    padding: 4px;
    font-size: 12px;
}

/* Show elements only on small screens (width < 1080px) */
.small-screen-only {
    display: none;
}

@media (max-width: 1079px) {
    .small-screen-only {
        display: block;
    }

    .large-screen-only {
        display: none !important;
    }
}

/* Show elements only on large screens (width >= 1080px) */
@media (min-width: 1080px) {
    .site-layout {
        min-height: 100vh;
        display: grid;
        grid-template-columns: 200px 1fr;
    }

    .small-screen-only {
        display: none !important;
    }

    .large-screen-only {
        display: block;
    }
}

/* Text Colors - Semantic */
.text-primary {
    color: var(--pico-primary) !important;
}

.text-secondary {
    color: var(--pico-secondary) !important;
}

.text-success {
    color: var(--pico-ins-color) !important;
}

.text-danger,
.text-error {
    color: var(--pico-del-color) !important;
}

.text-warning {
    color: var(--pico-color-amber-500) !important;
}

.text-info {
    color: var(--pico-color-azure-500) !important;
}

.text-muted {
    color: var(--pico-muted-color) !important;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.font-mono, h1, h2, h3, h4, h5, h6 {
    font-family: var(--pico-font-family-monospace) !important;
    font-weight: 200 !important;
}

h1 {
    font-size: 1.2rem;
    text-decoration: underline color-mix(in srgb, var(--pico-color) 70%, transparent);
    text-underline-offset: 6px;
    padding-bottom: 6px;
}

/* Table Overflow control - ~doesn't work with container fluid~*/

.overflow-auto > table th:first-child,
.overflow-auto > table td:first-child {
    position: sticky;
    left: 0;
    background: var(--pico-background-color);
}

.overflow-auto > table {
    font-size: 0.875rem;
}

.overflow-auto > table td, figure table th {
    /*padding: 0.5rem;*/
}

/*General Styles*/
.menu {
    width: 250px;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

#close-menu-button {
    width: 0;
    height: 0;
    position: absolute;
    z-index: -1;
}

.divider {
    margin: 2px 12px;
    background: grey;
    height: 1px;
}

.nowrap {
    text-wrap: nowrap;
}

.pt-color {
    color: #0068b9;
}

.pd-color {
    color: #d00e00;
}

.rh-color {
    color: #006104;
}

.nav-button {
    position: relative;
    overflow: hidden;
}

.nav-icon {
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.nav-icon.logo {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.nav-icon.bars {
    opacity: 0;
    transform: scale(0.8) rotate(-90deg);
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -16px;
    margin-top: -16px;
}

.nav-button:hover .nav-icon.logo {
    opacity: 0;
    transform: scale(0.8) rotate(90deg);
}

.nav-button:hover .nav-icon.bars {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

@media (prefers-color-scheme: dark) {
    .pt-color {
        color: #6db0ff;
    }

    .pd-color {
        color: #ff8f90;
    }

    .rh-color {
        color: #1fffb5;
    }

    :root {
        --inventory-good-background: var(--pico-color-azure-100);
        --inventory-good-color: var(--pico-color-azure-950);
        --inventory-location-background: var(--pico-color-violet-150);
        --inventory-location-color: var(--pico-color-violet-850);
        --inventory-container-background: var(--pico-color-jade-150);
        --inventory-container-color: var(--pico-color-jade-850);
    }
}

form a {
    margin-bottom: auto;
}

@media print {
    /* Hide elements not needed for printing */
    .print:hidden {
        display: none !important;
    }
}

/* Tom-select dark mode */
@media (prefers-color-scheme: dark) {
    .ts-wrapper.multi .ts-control,
    .ts-wrapper .ts-control {
        background-color: var(--pico-form-element-background-color);
        color: var(--pico-color);
        border-color: var(--pico-form-element-border-color);
    }

    .ts-wrapper .ts-control input {
        color: var(--pico-color);
    }

    .ts-dropdown,
    .ts-dropdown-content {
        background-color: var(--pico-dropdown-background-color, var(--pico-card-background-color));
        border-color: var(--pico-form-element-border-color);
        color: var(--pico-color);
    }

    .ts-dropdown .option,
    .ts-dropdown .optgroup-header,
    .ts-dropdown .no-results,
    .ts-dropdown .create {
        background-color: transparent;
        color: var(--pico-color);
    }

    .ts-dropdown .active,
    .ts-dropdown [data-selectable].option:hover {
        background-color: var(--pico-primary);
        color: var(--pico-primary-inverse);
    }

    .ts-dropdown [data-selectable] .highlight {
        background-color: var(--pico-primary-focus);
        color: var(--pico-primary-inverse);
    }

    .ts-wrapper.multi .ts-control .item {
        background-color: var(--pico-primary);
        color: var(--pico-primary-inverse);
        border-color: var(--pico-primary);
    }
}

/* Used with active check boxes / widget */
.light-only {
    display: none;
}

.dark-only {
    display: block;
}

@media (prefers-color-scheme: light) {
    .light-only {
        display: block;
    }

    .dark-only {
        display: none;
    }
}

/*Pagination styles*/
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.pagination-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-go-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}


a[aria-current="page"] {
    font-weight: bold;
}

@media (max-width: 576px) {
    .pagination-pages {
        gap: 0.25rem;
    }

    .pagination-pages .page-number:not(.current-page):not(:first-child):not(:last-child) {
        display: none;
    }

    .pagination-pages .ellipsis {
        display: none;
    }

    .pagination-go-form {
        margin-left: 0.5rem;
        margin-top: 0;
    }

    .pagination-go-form label {
        display: none;
    }
}


/* Class to trigger the animation */
.fade-out {
    animation: fadeOut 2s ease-in forwards; /* 2s duration, stays hidden after */
}

/* Keyframes definition */
@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        /* Optional: can also set display: none at 100% to remove it from flow */
    }
}


/* Collapse borders for consistent rendering */
.alt-borders {
    border-collapse: collapse;
}

/* Apply bottom border on even rows only */
.alt-borders tbody tr:nth-child(even) td,
.alt-borders tbody tr:nth-child(even) th {
    border-bottom: var(--pico-border-width) solid var(--pico-table-border-color);
}

/* Ensure odd rows have no bottom border */
.alt-borders tbody tr:nth-child(odd) td,
.alt-borders tbody tr:nth-child(odd) th {
    border-bottom: none;
}


/* to enable light-dark() */

:root {
    color-scheme: light dark;
}

.yes-badge {
    color: light-dark(var(--pico-color-jade-750), var(--pico-color-jade-50));
    background-color: light-dark(var(--pico-color-jade-50), var(--pico-color-jade-700));
    border-radius: 0.3rem;
    display: inline-block;
    padding: 5px;
}

.no-badge {
    color: light-dark(var(--pico-color-red-750), var(--pico-color-red-50));
    background-color: light-dark(var(--pico-color-red-50), var(--pico-color-red-700));
    border-radius: 0.3rem;
    display: inline-block;
    padding: 5px;
}

.processing-time-badge {
    color: light-dark(var(--pico-color-jade-750), var(--pico-color-jade-50));
    background-color: light-dark(var(--pico-color-jade-50), var(--pico-color-jade-700));
    border-radius: 0.375rem;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-weight: bold;
}

.pause-time-badge {
    color: light-dark(var(--pico-color-slate-600), var(--pico-color-slate-300));
    background-color: light-dark(var(--pico-color-slate-100), var(--pico-color-slate-800));
    border-radius: 0.375rem;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-weight: normal;
}

/* Tabs (c-locationtabs) */
.tabs ul {
    display: inline-flex;
    list-style: none;
    margin: 0 0 1rem 0;
    padding: 0.25rem;
    gap: 0.25rem;
    background: var(--pico-code-background-color);
    border: var(--pico-border-width) solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
}

.tabs li {
    margin: 0;
}

.tabs li a,
.tabs li {
    display: inline-block;
    padding: 0.4rem 1rem;
    text-decoration: none;
    font-weight: var(--pico-font-weight, 500);
    color: var(--pico-muted-color);
    border-radius: calc(var(--pico-border-radius) - 0.15rem);
}

.tabs li a:hover {
    color: var(--pico-color);
    background: var(--pico-card-background-color);
}

.tabs li.active a {
    background: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
}

.tabs li.active a:hover {
    background: var(--pico-primary-hover-background);
}

.tabs li.disabled span {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toolbar (c-toolbar / c-toolbar.action) */
.toolbar {
    width: 100%;
    display: inline-block;
}

.toolbar-align-right > .toolbar-actions {
    justify-content: flex-end;
}

.toolbar-align-right > .toolbar-dropdown {
    display: flex;
    justify-content: flex-end;
}

.toolbar-actions {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toolbar-action {
    list-style: none;
    margin: 0;
}

a.toolbar-action-button,
button.toolbar-action-button {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    background-color: transparent;
    border: none;
    box-shadow: none;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    margin: 0;
    width: 100%;
    white-space: nowrap;
}

.toolbar-action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toolbar-action-icon {
    flex: 0 0 auto;
    width: 1.25em;
    text-align: center;
}

.toolbar-action-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Desktop (>=1080px): row of fixed-size icon-over-label buttons */
.toolbar > .toolbar-actions {
    display: flex;
    flex-direction: row;
    gap: 0.25rem;
}

.toolbar > .toolbar-actions .toolbar-action-button {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 5.5rem;
    height: 4.5rem;
    text-align: center;
    border-radius: var(--pico-border-radius);
    white-space: normal;
}

.toolbar > .toolbar-actions .toolbar-action-button:hover:not(:disabled) {
    background: var(--pico-secondary-background);
}

.toolbar > .toolbar-actions .toolbar-action-icon {
    flex: 0 0 auto;
    width: auto;
    height: 1.5rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar > .toolbar-actions .toolbar-action-label {
    flex: 0 0 auto;
    font-size: 0.65rem;
    line-height: 1.1;
    height: calc(0.75rem * 1.1 * 2);
    max-width: 100%;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    align-items: flex-start;
    overflow: hidden;
}

/* Mobile (<1080px): native <details>/<summary> dropdown, icon+label inline */
.toolbar-dropdown {
    position: relative;
}

.toolbar-summary {
    list-style: none;
    cursor: pointer;
    white-space: nowrap;
}

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

.toolbar-dropdown .toolbar-actions {
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 10;
    min-width: 180px;
    background: var(--pico-background-color);
    border: var(--pico-border-width) solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    box-shadow: var(--pico-box-shadow, 0 4px 12px rgba(0, 0, 0, 0.15));
    padding: 0.25rem;
}

.pill-badge {
    display: inline-block;
    padding: var(--pill-padding);
    margin: 0 2px;
    border-radius: 4px;
    text-align: center;
}

.pill-badge-location-border {
    border: 2px solid var(--inventory-location-background);
}

.pill-badge-container-border {
    border: 2px solid var(--inventory-container-background);
}

.pill-badge-good {
    background: var(--inventory-good-background);
    color: var(--inventory-good-color);
}

.pill-badge-location {
    background: var(--inventory-location-background);
    color: var(--inventory-location-color);
}

.pill-badge-container {
    background: var(--inventory-container-background);
    color: var(--inventory-container-color);
}

.widget-row {
    grid-template-columns: auto 1fr auto;
    align-items: stretch;
    margin-bottom: 1rem;
}


.widget-square {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    text-align: center;
    margin: 16px 4px;
}

.widget-good {
    border-radius: 4px;
    background: var(--inventory-good-background);
    color: var(--inventory-good-color);
}

.widget-container {
    border-radius: 4px;
    background: var(--inventory-container-background);
    color: var(--inventory-container-color);
}


.widget-square-value {
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1;
    padding: 8px;
}

.widget-rectangle {
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.widget-rectangle-footer {
    margin-top: auto;
    padding-top: 4px;
}

.widget-rectangle-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 1.5rem;
}

.widget-rectangle-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.title-background {
    display: inline-block;
    background-color: #f5f5f0;
    color: #000;
    padding: 1px 4px;
    border-radius: 4px;
}

.no-border-force {
    border: none !important;
}

.inventory-table a {
    font-weight: 600;
}

.inventory-table-decorate-first-row tr:first-child {
    border-bottom: 0.2rem solid grey;
}

.inventory-table-eager-first-row tr > th:first-child,
.inventory-table-eager-first-row tr > td:first-child {
    width: 100%;
}

.inventory-table-eager-first-row tr > th:not(:first-child),
.inventory-table-eager-first-row tr > td:not(:first-child) {
    text-wrap: nowrap;
}

.inventory-table-sectioned {
    border-collapse: separate;
    border-spacing: 0 0.6rem;
}

.inventory-table-section {
    border-top: 1px solid #d4d4d4;
    border-bottom: 1px solid #d4d4d4;
}

@media (prefers-color-scheme: dark) {
    .inventory-table-section {
        border-color: #3a3a3a;
    }
}

/* Inventory Location Type indicator pills (c-inventory.type_indicator) */
.type-pill {
    font-size: 0.7rem;
    padding: 0.08rem 0.3rem;
    border-radius: 4px;
    white-space: nowrap;
}

/*Hub*/
.hub-color {
    color: #365314;
    background: #ecfccb;
}

/*Satellite*/
.sat-color {
    color: #4c1d95;
    background: #ede9fe;
}

/*Transit, Vendor*/
.trn-color,
.ven-color{
    color: #0c4a6e;
    background: #e0f2fe;
}

/*Customer*/
.cus-color {
    color: #164e63;
    background: #cffafe;
}


/*.scr-color {*/
/*    color: #7c2d12;*/
/*    background: #ffedd5;*/
/*}*/

/*Scrap*/
.scr-color {
    color: #7f1d1d;
    background: #fee2e2;
}

@media (prefers-color-scheme: dark) {
    .stk-color {
        color: #d9f99d;
        background: #1a2e05;
    }

    .srd-color {
        color: #fdba74;
        background: #431407;
    }

    .tra-color {
        color: #7dd3fc;
        background: #082f49;
    }

    .sld-color {
        color: #c4b5fd;
        background: #2e1065;
    }

    .sup-color {
        color: #67e8f9;
        background: #083344;
    }

    .scr-color {
        color: #f99d9d;
        background: #1a2e05;
    }
}

.row-actions-cell {
    width: 8.5rem;
    text-align: right;
    white-space: nowrap;
}

.minor-opacity {
    opacity: 0.7;
}

/* Toast notifications (e.g. picklist move confirmations) */
.toast-notify {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 9999;
    max-width: 400px;
    border-left: 4px solid var(--pico-ins-color);
}