.admin-logo {
    width: 100px;
}

.header #branding h1 {
    margin: 5px;
}

#site-name {
    text-align: center;
}

#header {
    height: 50px;
}

.orange, tr.orange td, tr.orange th {
    background-color: #FFD1B2 !important;
}

.violet, tr.violet td, tr.violet th {
    background-color: #ded0ff !important;
}

.form-horizontal .select2-container span.selection,
.form-horizontal .inline-related span.select2-selection {
    display: block;
}

.select2-search__field {
    height: auto !important;
}

.search-container .select2 {
    margin-top: 5px;
}

/*.change-related, .add-related {*/
/*    display: none !important;*/
/*}*/

#result_list thead th {
    position: sticky;
    top: 0;
}

@media only screen and (max-width: 767px) {
    body {
        min-width: auto;
    }

    #wrap {
        background: none;
    }

    .suit-columns {
        padding-left: 10px;
        padding-right: 10px;
    }

    #suit-center {
        padding-left: 0;
    }

    /* ---- Mobile chrome -------------------------------------------------------
       Suit5 lays #user-tools out as a full-width row inside the header below 768px
       (width:100%, its own border-top), so the header has to grow to hold it. The
       "#header { height: 50px }" near the top of this file is an ID rule written for the
       desktop bar; left in force it makes that row overlap the breadcrumb and page title. */
    #header,
    .header {
        height: auto;
        min-height: 50px;
    }

    .header #branding {
        min-width: unset;
    }

    .brand-name {
        display: none;
    }

    /* Date/time stays out on small screens. #user-tools is deliberately NOT hidden here:
       Suit5's own mobile nav lays it out as a full-width row beneath the header, which is
       what the removed custom drawer used to exist to work around. */
    .header-content-first {
        display: none;
    }

    .breadcrumb {
        font-size: 9pt;
    }

    /* Suit's separator
       border-right divided branding from the widgets that followed it; with those gone it
       reads as a stray line, and the centred #site-name leaves the text floating away from
       the button, so both are reset here. */
    .header #branding {
        border-right: 0;
        min-width: 0;
    }

    .header #branding h1#site-name {
        align-items: flex-start;
        padding-left: 4px;
        text-align: left;
    }

    /* ---- Modals --------------------------------------------------------------
       dry-ux places modals at top:10%, which on a phone leaves a short dialog stranded
       near the top with dead space beneath it. Centre them instead -- but via flex with a
       capped, scrollable dialog rather than a transform, because 10% exists to stop a tall
       modal from clipping off the top of the screen, and naive centring would reintroduce
       exactly that. Also drops dry-ux's inline width:420px, which is wider than a 375px
       phone. Mobile only; desktop modals are untouched. */

    .dry-ux-modal.in {
        align-items: center;
        bottom: 0;
        display: flex !important;
        justify-content: center;
        top: 0;
    }

    .dry-ux-modal.in .modal-dialog {
        margin: 0;
        max-height: 88vh;
        max-width: 94vw;
        overflow-y: auto;
        /* 94vw rather than auto: auto shrink-wraps to the content and leaves a cramped
           ~226px dialog, while dry-ux's inline 420px overflows a 375px phone. */
        width: 94vw !important;
    }

    #changelist-form .results,
    .inline-group {
        max-width: 100%;
        overflow-x: auto;
    }

    .inner-two-columns .inner-right-column {
        float: unset;
        width: unset;
    }

    .inner-two-columns .inner-right-column.fixed {
        position: static;
    }

    .inner-two-columns .inner-center-column {
        margin-right: unset;
    }

    .submit-row button {
        height: 50px;
    }

    .submit-row button[name="_addanother"] {
        display: none;
    }

    .form-horizontal .control-group .control-label {
        min-width: unset;
    }

    .dashboard #content #content-main {
        float: unset;
        display: table;
        margin-left: auto;
        margin-right: auto;
    }

    .admin-logo {
        width: 70px;
    }
}

line.volume-line {
    stroke: #000;
    stroke-dasharray: 2, 1;
    stroke-width: 1;
    stroke-opacity: 0.7;
}

polygon.volume-line {
    stroke: #fff;
    stroke-width: 1;
    fill-opacity: 0.85;
    stroke-opacity: 0.7;
}

.env-warnings {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 5000;
    text-align: right;
}

.env-warning {
    color: white;
    background-color: #d9534f;
    text-align: center;
    font-size: 10px;
    visibility: visible;
    border-radius: 10px;
    text-shadow: none;
    line-height: 2;
    font-weight: normal;
    font-family: Verdana, serif;
    padding: 2px 10px;
    display: inline-block;
}

#toggleAutoFillPromptBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px;
    cursor: pointer;
    z-index: 99;
}

#productQtyAutoFillContainer {
    position: fixed;
    bottom: 70px; /* Adjust based on button size */
    right: 20px;
    width: fit-content;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
    display: none; /* Hide by default */
    border: 1px solid #dbdbdb;
    text-align: end;
    z-index: 100;
}

.text-danger {
    color: red !important;
}

/* Hide delete icon for all FK dropdowns in admin */
.delete-related img {
    display: none !important;
}

.field-url {
    max-width: 400px;
    word-wrap: break-word;
}

#utilities-group .change-related,
#utilities-group .add-related {
    display: none;
}

ul li label {
    display: inline-block;
}

.modal-dialog {
    max-width: 95vw;
}

/* Footer.

   base_site.html blanks Suit5's footer blocks -- no copyright, no branding outside the
   tenant portal -- so the only things that ever land there are the env warnings, the
   django-su "Psuedo Login" banner and the portal's own branding, none of which are
   present on a normal page. Suit5's sticky footer reserves 60px regardless (plus a 5px
   border-top on .content), leaving a dead grey band under every page.

   Size it to what it actually holds, and only draw the separator when it holds something. */
#footer,
.footer {
    height: auto;
    min-height: 0;
}

#push {
    display: none;
}

#wrap {
    margin-bottom: 0;
}

/* Each of the three columns keeps its 15px padding while empty, so hide the ones with
   nothing in them rather than overriding padding -- Suit5's styling then still applies
   untouched whenever a column does have something to show. */
#footer .content > .tools:not(:has(.env-warnings > *)),
#footer .content > .copyright:not(:has(*)),
#footer .content > .branding:not(:has(*)) {
    display: none;
}

#footer .content {
    border-top: 0;
}

#footer:has(.env-warnings > *) .content,
#footer:has(.branding > *) .content {
    border-top: 5px solid var(--suit-border-color, #ccd);
}

/* Changelist multi-select filters (django_reusable's MultiSelectFilter), which
   changelist.ts turns into select2 controls.

   django_reusable renders its own "Type:" label beside the control and shrink-wraps the pair
   in two nested divs with inline styles. That fights the search bar on two fronts: the label
   duplicates the title suit5 already renders above every filter, and the shrink-wrapped
   wrapper leaves select2's `width: 100%` nothing to resolve against, collapsing the control
   to ~80px. (Bootstrap 2 masked this by giving every <select> a 220px default width; pinning
   that width back on simply overflowed the 160px cell and covered the next filter's label.)

   So: drop the duplicate label and let the control fill its cell, like every other filter.
   !important is needed because the inline styles come from the third-party template. */
#changelist-search .search-container .multi-select-filter {
    display: block !important;
    width: 100%;
    margin: 0 !important;
}

#changelist-search .search-container .multi-select-filter > div {
    display: block !important;
}

#changelist-search .search-container .multi-select-filter > div > label {
    display: none !important;
}

#changelist-search .search-container .multi-select-filter > div > div {
    width: 100%;
    min-width: 0;
}

/* The reminders bell that DateFieldReminders mounts next to date fields is Bootstrap 2-era
   markup: a bare `.btn` with no variant class. Bootstrap 2 made that a complete grey button;
   Bootstrap 5's `.btn` is a transparent base that expects a variant, so the bell lost its
   background and border and came out 5px shorter than the field. Match the date button it
   sits beside rather than picking a Bootstrap variant, so the pair reads as one control.

   Height is set rather than padding: the component writes `padding: 1px 6px` inline, and a
   stylesheet cannot outrank that. The inline `border` it sets when a reminder exists still
   wins over the border here, which is what colour-codes the bell. */
.suit-date a.btn {
    display: inline-flex;
    align-items: center;
    height: 28px;
    background-color: var(--suit-bg-light, #e6ebee);
    border: 1px solid var(--suit-input-border, #a4b3be);
    border-radius: 3px;
    box-shadow: none;
}

.suit-date a.btn:hover {
    background-color: var(--suit-table-header-bg, #d5dde2);
}

/* dry-ux renders react-bootstrap 0.33 (Bootstrap 3-era) markup, which suit 0.2.28's
   Bootstrap 2 used to style. Two of those defaults are gone in Bootstrap 5:

   - .modal-body had overflow-y: auto. RootWrapper.tsx caps it at max-height: 80vh and
     relied on that to scroll; without it the cap just clips the box and the content
     paints outside the modal.
   - headings were smaller. A bare h4 is ~22px in Bootstrap 5 against 15px before, which
     leaves the modal title and every section heading oversized.

   (The unstyled .close button is shimmed in django-suit5, since dry-ux emits it in every
   project.) */
.dry-ux-modal .modal-body {
    overflow-y: auto;
}

.dry-ux-modal h4 {
    font-size: 15px;
}

.dry-ux-overlay-content {
    padding: 15px!important;
}

.inline-group.file-dump tr.add-row {
    display: none;
}

#user-tools {
    display: flex;
}

.notyf-success {
    background-color: rgb(61, 199, 99);
}

.notyf-error {
    background-color: rgb(237, 61, 61);
}

