/* Copied 2026-10-19 (Phase 5 step 4) from verge-portal-dev assets/css/portal-theme.css (its lines 1-1386).
   Its aside-menu, online-ordering, wizard and cart sections (lines 1387-2278 there) are left out: this
   site has none of that markup. Change this copy here; it is not kept in step with the portal file. */

/* ===================================
   Portal Theme — Look-and-Feel Alignment with AdTrackCenter
   Added 2026-05-03. Body font, card styling, avatar.
   =================================== */

/* ===================================
   Body font: Inter (was Poppins).
   Override Metronic's bundled body font-family at the highest specificity.
   =================================== */
body,
body * {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif !important;
}

/* Preserve icon-font families — these MUST stay or icons break */
.ki-duotone,
.ki-outline,
.ki-solid,
.ki-filled,
.ki-duotone::before,
.ki-duotone::after,
.ki-outline::before,
.ki-solid::before,
.ki-filled::before,
[class^="ki-"]::before,
[class*=" ki-"]::before,
[class^="ki-"]::after,
[class*=" ki-"]::after {
    font-family: 'keenicons-duotone', 'keenicons-outline', 'keenicons-solid', 'keenicons-filled' !important;
}
.fa, .fas, .far, .fal, .fab, .fa-solid, .fa-regular, .fa-light, .fa-brands,
[class^="fa-"]::before, [class*=" fa-"]::before {
    font-family: "Font Awesome 7 Free", "Font Awesome 7 Brands", "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Brands" !important;
}

/* ===================================
   Card styling: rounded corners + subtle shadow (matches ATC)
   ATC values: border-radius 8px, 1px solid #e5e7eb, classic Tailwind shadow.
   =================================== */
.card {
    border-radius: 8px !important;
    border: 1px solid rgb(229, 231, 235) !important;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px !important;
    background-color: #ffffff !important;
}

/* Slightly stronger shadow on hover for stat cards */
.card:hover {
    box-shadow: rgba(0, 0, 0, 0.12) 0px 4px 8px 0px, rgba(0, 0, 0, 0.08) 0px 2px 4px 0px !important;
    transition: box-shadow 0.18s ease-out;
}

/* ===================================
   User avatar with initials (replaces "Welcome back, X" + 3-dot menu).
   Mirrors ATC's `.user-avatar-initials` pattern.
   =================================== */
.user-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #e4e6ef;
    background-color: #009ef7;
    color: #ffffff;
    font-family: Inter, sans-serif !important;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.18s ease;
    line-height: 1;
}

.user-avatar-initials:hover {
    background-color: #0095e8;
    transform: scale(1.05);
}

@media (max-width: 991px) {
    .user-avatar-initials {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

.user-avatar-initials.no-initials::before {
    content: "?";
    font-size: 18px;
}

/* Avatar / header flyout dropdown hover text fix.
   portal.css ships a legacy global `.menu-link:hover { color:white !important }`
   intended for the DARK sidebar. In the light flyout dropdowns (the avatar menu
   — Change Password / Manage Address Book / Account / Sign Out, etc.) that makes
   the hovered item white on its light-gray hover background — unreadable. Restore
   a readable hover color (primary blue, matching menu-state-primary intent).
   Scoped to .menu-sub-dropdown so the dark sidebar's white hover is untouched. */
.menu-sub-dropdown .menu-link:hover {
    color: #2563EB !important;
}

/* ===================================
   Cell Typography Tiers (Phase 4 foundation, 2026-05-03)
   3-tier scale for content inside table/widget cells. Apply mechanically
   so every list view has the same visual hierarchy: the eye lands on
   the primary identifier, then drops to secondary metadata, then hint.
   See standards-guide Section 21 for usage rules.
   =================================== */
.cell-primary {
    font-size: 14px;
    font-weight: 600;
    color: #181C32;
    line-height: 1.35;
}
.cell-secondary {
    font-size: 13px;
    font-weight: 400;
    color: #374151;
    line-height: 1.35;
}
.cell-tertiary {
    font-size: 12px;
    font-weight: 400;
    color: #6B7280;
    line-height: 1.35;
}

/* Anchor variants — preserve link affordance without losing tier color */
a.cell-primary:hover,
a.cell-secondary:hover,
a.cell-tertiary:hover {
    text-decoration: underline;
}

/* ===================================
   Count Pill (Phase 4 foundation, 2026-05-03)
   For clickable count indicators in card/widget headers — e.g. the "6"
   next to "Proofs to Review". Reads as a filter pill, not a heading,
   so the title can be the title. Use as <a class="count-pill">6</a>
   when the count drills into a fuller list, plain <span> when it doesn't.
   See standards-guide Section 22.
   =================================== */
.count-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 6px;
    background-color: #009ef7;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    line-height: 1.2;
    transition: background-color 0.18s ease;
    white-space: nowrap;
}
.count-pill:hover {
    background-color: #0095e8;
    color: #ffffff !important;
}

/* Light variant for non-clickable / neutral counts.
   Indigo-tinted to match the rest of the chrome (nav buttons,
   external-link icons) and to give enough contrast that the count
   reads clearly even at small font sizes. */
.count-pill-light {
    background-color: #EEF2FF;
    color: #4F46E5 !important;
    border: 1px solid #C7D2FE;
    font-weight: 600;
}
.count-pill-light:hover {
    background-color: #E0E7FF;
    color: #3730A3 !important;
}

/* Alert variant for a PROBLEM count - the staff Order Recovery badge in the topbar
   (cart-integrity Phase 4, 2026-09-18). Scoped as its own class rather than editing
   .count-pill, which is the neutral house standard used for ordinary counts like
   "Proofs to Review". Amber rather than red: a stuck order is "somebody must look at
   this", not "something has broken" - in most cases the order exists and is fine. */
.count-pill.count-pill-alert {
    background-color: #B45309;
    color: #ffffff !important;
}
.count-pill.count-pill-alert:hover {
    background-color: #92400E;
    color: #ffffff !important;
}

/* ===================================
   Badge Variant Overrides — enforce standards-guide Section 5 (2026-05-04)
   Metronic ships .badge-light-* with 0 border and mid-saturation text on a light
   background — produces invisible "green on green" / "yellow on yellow". Override
   with the spec's darker text + mandatory 1px border (border color = the darker
   text shade) so badges are legible against any background. Selector specificity
   `.badge.badge-light-*` (2 classes) wins over Metronic's single-class default.
   =================================== */
.badge.badge-light-success {
    background-color: #D1FAE5 !important;
    color: #065F46 !important;
    border: 1px solid #10B981 !important;
}
.badge.badge-light-primary {
    background-color: #DBEAFE !important;
    color: #1E40AF !important;
    border: 1px solid #3B82F6 !important;
}
.badge.badge-light-warning {
    background-color: #FEF3C7 !important;
    color: #92400E !important;
    border: 1px solid #F59E0B !important;
}
.badge.badge-light-danger {
    background-color: #FEE2E2 !important;
    color: #991B1B !important;
    border: 1px solid #EF4444 !important;
}
.badge.badge-light-info {
    background-color: #E0F2FE !important;
    color: #075985 !important;
    border: 1px solid #0EA5E9 !important;
}
.badge.badge-light {
    background-color: #F3F4F6 !important;
    color: #374151 !important;
    border: 1px solid #9CA3AF !important;
}
/* The statusBadge() helper emits class="badge badge-light-{variant}" for every
   variant including "light" itself, producing badge-light-light. Without this
   override Metronic's missing rule leaves it transparent + near-white text
   ("Inactive", "Not Yet Shipped", and unmapped fallback statuses go invisible). */
.badge.badge-light-light {
    background-color: #F3F4F6 !important;
    color: #374151 !important;
    border: 1px solid #9CA3AF !important;
}

/* ===================================
   Message Banner Color Alignment (2026-05-09)
   Align _messages.cfm banner colors to the Section 5 badge palette so warning
   means warning and info means info regardless of UI shape. The banners use
   Metronic's bg-light-* utility (different palette) + legacy cl-* text classes
   (pure-RGB primaries — circus-bright red/orange). Scoped to .alert.alert-dismissible
   so other uses of bg-light-* / cl-* elsewhere in the portal aren't affected.
   =================================== */
.alert.alert-dismissible.bg-light-danger  { background-color: #FEE2E2 !important; border: 1px solid #EF4444 !important; }
.alert.alert-dismissible.bg-light-success { background-color: #D1FAE5 !important; border: 1px solid #10B981 !important; }
.alert.alert-dismissible.bg-light-warning { background-color: #FEF3C7 !important; border: 1px solid #F59E0B !important; }
.alert.alert-dismissible.bg-light-info    { background-color: #E0F2FE !important; border: 1px solid #0EA5E9 !important; }
.alert.alert-dismissible .cl-red        { color: #991B1B !important; }
.alert.alert-dismissible .cl-green      { color: #065F46 !important; }
.alert.alert-dismissible .cl-orange     { color: #92400E !important; }
.alert.alert-dismissible .cl-light-blue { color: #075985 !important; }

/* ===================================
   Detail Page Foundations — Header Card Utilities (2026-05-09)
   Building blocks for the Read-Only Detail Page Pattern (standards Section 7).
   Used by the upcoming project-page-rebuild and joborder-page-rebuild projects.
   See standards-guide Sections 23, 24, 25 for usage rules.
   =================================== */

/* ---------- Metadata Strip (Section 23) ----------
   Horizontal key:value pairs in entity header card.
   Example:
     <div class="metadata-strip">
       <div><span class="meta-key">Created</span> <span class="meta-value">2025-08-04</span></div>
       <div><span class="meta-key">Customer</span> <span class="meta-value">BP Graphics</span></div>
     </div>
*/
.metadata-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    padding: 8px 0;
    font-family: Inter, sans-serif !important;
}
.metadata-strip > div {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.meta-key {
    font-size: 11px;
    font-weight: 500;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.meta-value {
    font-size: 13px;
    font-weight: 500;
    color: #181C32;
}

/* ---------- Action Cluster (Section 24) ----------
   Right-aligned flex row for 1-3 contextual action buttons on header cards.
   Max 3 visible; overflow into a kebab menu.
   Example:
     <div class="action-cluster">
       <button class="btn btn-primary">View Proof</button>
       <button class="btn btn-light-primary">View Tracking</button>
     </div>
*/
.action-cluster {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Stacked button (ported from AdTrackCenter 2026-05-13) ----------
   Icon-above-label compact row-action button. Renders ~28px tall when paired
   with .btn-sm. Inherits text-transform from .btn so the label still renders
   uppercase (matches ATC). Markup pattern:
     <button class="btn btn-sm btn-stacked btn-light-primary">
       <i class="fa-solid fa-eye fs-8"></i><span>View</span>
     </button>
*/
.btn-stacked {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 0 !important;
    padding: 6px 8px 5px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    gap: 4px !important;
}
.btn-stacked > i,
.btn-stacked > span {
    display: block !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

/* ---------- Detail Card Field Block (added 2026-05-10) ----------
   Stacked label-above-value pattern for fields inside data cards
   (vs the inline horizontal .metadata-strip pattern). Used by the
   project-page-rebuild 4-card layout — Card 1 (project state),
   Card 2 (reference numbers), Card 3 (distribution emails).
   Pair with bootstrap .row / .col-* for 1-up vs 2-up layouts.
   Example:
     <div class="meta-block">
       <div class="meta-key">Order Date</div>
       <div class="meta-value">03/11/2026</div>
     </div>
*/
.meta-block .meta-key {
    display: block;
    margin-bottom: 2px;
}
.meta-block .meta-value {
    display: block;
    min-height: 1.4em;
    line-height: 1.4;
}
/* Wrapping helper for multi-email or long URL values. */
.meta-value-wrap {
    word-break: break-word;
    overflow-wrap: anywhere;
}
/* Vertical stack of buttons inside an actions card. */
.action-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.action-stack > .btn {
    width: 100%;
    justify-content: center;
}

/* ---------- Download Options modal — descriptive option rows (2026-06-25) ----------
   Replaces the legacy "rainbow" buttons (orange .btn-pdf / green .btn-success /
   blue .btn-primary) in windows/download_all_artwork.cfm with a uniform stacked
   "menu of choices": a purple download-semantic icon chip (standards Section 4,
   Download = #7C3AED), a bold title, a muted one-line description, and a chevron.
   Rows are neutral white with a light border; hover lifts a soft purple tint.
   Differentiation comes from the icon glyph + label, not loud per-button color.
   Markup pattern (each row keeps its existing data-btn handler):
     <button class="download-option-row" data-btn="btnDownloadZipAllPDFs">
       <span class="download-option-icon"><i class="fa-solid fa-file-pdf"></i></span>
       <span class="download-option-body">
         <span class="download-option-title">Download All PDFs</span>
         <span class="download-option-desc">Print-ready PDF for every item, zipped</span>
       </span>
       <span class="download-option-chevron"><i class="fa-solid fa-chevron-right"></i></span>
     </button>
*/
.download-option-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.download-option-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    font-family: inherit;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.download-option-row:hover,
.download-option-row:focus {
    background: #FAF5FF;
    border-color: #7C3AED;
    box-shadow: 0 1px 3px rgba(124, 58, 237, .12);
    outline: none;
}
.download-option-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #F3E8FF;
    color: #7C3AED;
    font-size: 18px;
}
.download-option-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}
.download-option-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}
.download-option-desc {
    font-size: 12px;
    font-weight: 400;
    color: #6B7280;
    line-height: 1.3;
}
.download-option-chevron {
    flex-shrink: 0;
    color: #9CA3AF;
    font-size: 13px;
    transition: color .15s ease;
}
.download-option-row:hover .download-option-chevron,
.download-option-row:focus .download-option-chevron {
    color: #7C3AED;
}

/* ---------- Detail page top-of-page card grid (added 2026-05-10) ----------
   Card-per-data-type pattern for project/joborder detail pages. 3 equal-width
   data cards + 1 narrower actions card. The data cards each take ~28% and the
   actions card ~16% (≈ half the width of a data card) at lg+ breakpoints.
   Below lg, falls back to bootstrap's col-md-6 / col-12 stacking from the markup.

   Mark up the row + members like this:
     <div class="row detail-card-row g-4 mb-5">
       <div class="col-12 col-md-6 detail-card-col-data">data 1</div>
       <div class="col-12 col-md-6 detail-card-col-data">data 2</div>
       <div class="col-12 col-md-6 detail-card-col-data">data 3</div>
       <div class="col-12 col-md-6 detail-card-col-actions">actions</div>
     </div>
*/
@media (min-width: 992px) {
    .detail-card-row {
        flex-wrap: nowrap;
    }
    .detail-card-col-data {
        flex: 0 0 28%;
        max-width: 28%;
    }
    .detail-card-col-actions {
        flex: 0 0 16%;
        max-width: 16%;
    }
}

/* ---------- Btn-light-primary override (standards Section 4 alignment, 2026-05-10) ----------
   Metronic ships .btn-light-primary as light-blue bg + primary-blue text → poor contrast
   ("hard to read" — Curt 2026-05-10). Section 4 of the standards guide specifies
   .btn-light-primary as white bg + 1px blue border + blue text, used for secondary
   actions / navigation (e.g., "Back to List", "Return to parent"). This override
   aligns Metronic to spec.

   Selector specificity .btn.btn-light-primary (2 classes) wins over Metronic's single-class
   default. Hover lifts the bg to a soft tint of blue while keeping border + text consistent. */
.btn.btn-light-primary {
    background-color: #FFFFFF !important;
    color: #2563EB !important;
    border: 1px solid #2563EB !important;
}
.btn.btn-light-primary:hover,
.btn.btn-light-primary:focus,
.btn.btn-light-primary.active {
    background-color: #EFF4FF !important;
    color: #1E40AF !important;
    border-color: #1E40AF !important;
}

/* ---------- Btn-light-info override (standards Section 4 / action-colour table, 2026-08-20) ----------
   The standards guide's Action Button Color Coding Table specifies View / Details as
   .btn-light-info. Metronic ships it PURPLE (#7239EA) and sets border-color EQUAL to the background
   (#F8F5FF), so the button renders with no visible border while every neighbouring
   .btn-light-primary carries a 1px blue one. Same treatment, and same reason, as the
   .btn-light-primary override above: align Metronic to the guide once, here, rather than patch each
   call site with `border border-*` utilities that drift and vanish when the class changes.

   Colours are the guide's own: #E0F2FE fill, #0369A1 text/icon. The BORDER is the guide's Info hex
   #0EA5E9 rather than its #BAE6FD, which is only two steps off the fill and reads as no border at
   all beside btn-light-primary's solid #2563EB ("border still not well defined" — Manuel
   2026-08-20). Every value still comes from the guide's Info palette.

   🔴 SPECIFICITY, NOT COLOUR, IS WHY THE FIRST ATTEMPT'S HOVER STAYED PURPLE. Metronic's hover is
   `.btn.btn-light-info:hover:not(.btn-active)` = (0,4,0) with `background-color: ... !important`.
   A plain `.btn.btn-light-info:hover` is (0,3,0), and !important does NOT rescue a lower-specificity
   rule — the more specific selector wins first. The states below therefore mirror Metronic's
   selector shape exactly, including `:not(.btn-active)`, so they match at (0,4,0) and win on
   source order (portal-theme.css is loaded after style.bundle.css in index.cfm). The separate `i`
   rules are required because Metronic colours the icon in its own rule. */
.btn.btn-light-info {
    background-color: #E0F2FE !important;
    color: #0369A1 !important;
    border: 1px solid #0EA5E9 !important;
}
.btn.btn-light-info i,
.btn.btn-light-info .ki-outline,
.btn.btn-light-info .ki-duotone {
    color: #0369A1 !important;
}
.btn.btn-light-info:hover:not(.btn-active),
.btn.btn-light-info:focus:not(.btn-active),
.btn.btn-light-info:active:not(.btn-active),
.btn.btn-light-info.active,
.btn.btn-light-info.show {
    background-color: #BAE6FD !important;
    color: #075985 !important;
    border-color: #0369A1 !important;
}
.btn.btn-light-info:hover:not(.btn-active) i,
.btn.btn-light-info:focus:not(.btn-active) i,
.btn.btn-light-info:active:not(.btn-active) i,
.btn.btn-light-info.active i,
.btn.btn-light-info.show i {
    color: #075985 !important;
}

/* ---------- Back / Return navigation button ----------
   Solid indigo treatment for the navigation primitive
   "Back / Return to Parent / Prev / Next." Distinct from semantic red/
   green/blue/yellow buttons so users immediately read it as 'navigate
   to parent or sibling.' Originally outlined indigo (2026-05-10),
   switched to solid 2026-05-11 because the outlined variant was hard
   to find on the light page background. */
.btn.btn-light-back {
    background-color: #4F46E5 !important;
    color: #FFFFFF !important;
    border: 1px solid #4F46E5 !important;
}
.btn.btn-light-back i,
.btn.btn-light-back .ki-outline,
.btn.btn-light-back .ki-duotone {
    color: #FFFFFF !important;
}
.btn.btn-light-back:hover,
.btn.btn-light-back:focus,
.btn.btn-light-back.active {
    background-color: #3730A3 !important;
    color: #FFFFFF !important;
    border-color: #3730A3 !important;
}

/* ---------- Read-Only Value Display (Section 25) ----------
   Plain-text replacement for <input disabled> per Section 8.6.
   Use inside a .meta-row or header card metadata strip.
   Example:
     <div class="meta-row">
       <div class="meta-key">Customer</div>
       <div class="read-only-value">BP Graphics</div>
     </div>
*/
.read-only-value {
    display: inline-block;
    font-family: Inter, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #181C32;
    background: transparent;
    border: none;
    padding: 0;
    line-height: 1.4;
}

/* ---------- Refined Separator (was overridden incorrectly in salesorder/joborder)
   Replaces the royal-blue 2px solid override that was inline-styled at the end
   of those two views. Spec: 1px dashed light gray.
*/
.separator.separator-dashed {
    border-bottom: 1px dashed #E5E7EB !important;
}

/* ===================================
   Toggle Switches — Unified 3-Size System (2026-05-09)
   Mirrors verge-dev's bpgoffice.css 1283-1445 (last revised 2026-04-27).
   3 standard sizes used across all of CPG's CFML projects:
     - .switch / .switch-xs   = 44x22px  (default / "base")
     - .switch-sm             = 36x20px  (medium-small)
     - .switch-xxs            = 28x16px  (compact / dense list inline)
   Colors: OFF #ccc | ON #2196F3 | knob white circle | 0.4s slide
   =================================== */

/* ---------- Custom .switch family (verge-dev port) ---------- */

.switch,
.switch-xs {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}
.switch-sm {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}
.switch-xxs {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 16px;
}
.switch input,
.switch-sm input,
.switch-xs input,
.switch-xxs input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider,
.slider-sm,
.slider-xs,
.slider-xxs {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}
.slider:before,
.slider-xs:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    -webkit-transition: .4s;
    transition: .4s;
}
.slider-sm:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    -webkit-transition: .4s;
    transition: .4s;
}
.slider-xxs:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    -webkit-transition: .4s;
    transition: .4s;
}
input:checked + .slider,
input:checked + .slider-sm,
input:checked + .slider-xs,
input:checked + .slider-xxs {
    background-color: #2196F3;
}
input:checked + .slider-sm-success {
    background-color: #1dc9b7 !important;
}
input:focus + .slider,
input:focus + .slider-sm,
input:focus + .slider-xs,
input:focus + .slider-xxs {
    box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before,
input:checked + .slider-xs:before {
    -webkit-transform: translateX(22px);
    -ms-transform: translateX(22px);
    transform: translateX(22px);
}
input:checked + .slider-sm:before {
    -webkit-transform: translateX(16px);
    -ms-transform: translateX(16px);
    transform: translateX(16px);
}
input:checked + .slider-xxs:before {
    -webkit-transform: translateX(12px);
    -ms-transform: translateX(12px);
    transform: translateX(12px);
}
.slider.round,
.slider-xs.round {
    border-radius: 11px;
}
.slider-sm.round {
    border-radius: 10px;
}
.slider-xxs.round {
    border-radius: 8px;
}
.slider.round:before,
.slider-sm.round:before,
.slider-xs.round:before,
.slider-xxs.round:before {
    border-radius: 50%;
}

/* ---------- Bootstrap / Metronic .form-check.form-switch overrides ----------
   The portal's existing markup uses Metronic's pill-style toggle (`.form-check
   .form-switch`). Map those to the same 3 verge sizes so every toggle in the
   portal — including the avatar-dropdown "My orders only" / "Orders for All
   Accounts" — shrinks to spec without touching 30+ markup callsites.
   Size mapping:
     bare .form-switch         → 44x22 (verge .switch base)
     .form-switch.form-switch-md → 36x20 (verge .switch-sm)
     .form-switch.form-switch-sm → 28x16 (verge .switch-xxs)
*/
.form-check.form-switch .form-check-input {
    width: 44px !important;
    height: 22px !important;
    margin-top: 0 !important;
    border-radius: 11px !important;
    background-color: #ccc !important;
    border-color: #ccc !important;
    transition: background-color 0.4s, border-color 0.4s !important;
}
.form-check.form-switch .form-check-input:checked {
    background-color: #2196F3 !important;
    border-color: #2196F3 !important;
}
.form-check.form-switch .form-check-input:focus {
    box-shadow: 0 0 1px #2196F3 !important;
}

.form-check.form-switch.form-switch-md .form-check-input {
    width: 36px !important;
    height: 20px !important;
    border-radius: 10px !important;
}

.form-check.form-switch.form-switch-sm .form-check-input {
    width: 28px !important;
    height: 16px !important;
    border-radius: 8px !important;
}

/* ---------- Joborder page 4-card layout (added 2026-05-11) ----------
   Fixed-height cards so the row stays visually anchored regardless of
   per-card content volume. The action card (Card 4) is the height anchor;
   data cards equalize to .h-100. When inner content exceeds the card
   body, .card-scrollable enables overflow with a hover-reveal scrollbar.
   This pairs with the existing .detail-card-row + .detail-card-col-data
   widths (28/28/28/16) defined above. */
.joborder-card-row .joborder-card {
    min-height: 320px;
    max-height: 320px;
}

/* Scrollable inner card body with hover-reveal scrollbar.
   Track + thumb are transparent until cursor enters the card. */
.card-scrollable {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.2s ease-in-out;
}
.card-scrollable:hover {
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}
.card-scrollable::-webkit-scrollbar {
    width: 8px;
}
.card-scrollable::-webkit-scrollbar-track {
    background: transparent;
}
.card-scrollable::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
}
.card-scrollable:hover::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.25);
}
.card-scrollable:hover::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

/* Installation grouping inside Card 3 State B. Each install event renders
   as a meta block (date + status) followed by a lightbox-enabled thumbnail
   row. Whitespace separates groups; bottom margin only between groups. */
.install-group {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px dashed #E5E7EB;
}
.install-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.install-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.install-thumb {
    display: inline-block;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #E5E7EB;
    background-color: #F3F4F6;
    transition: transform 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
.install-thumb:hover {
    transform: scale(1.05);
    border-color: #4F46E5;
}
.install-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- Search-page patterns (added 2026-05-12) ----------
   Shared layout patterns for search-results pages (Search Job Orders,
   Proofs Not Approved, Search Projects). Goal: a single visual language
   so each page reads the same — Filter card on top, Results card with
   header strip (title + count + quick-filter + export) and a sticky
   bulk-action toolbar that appears on row selection.
*/

/* Filter card — compact form grid. Heading + actions strip at top,
   then auto-fitting grid of fields below. Each field's min-width is
   180px so labels read on one line; grid wraps as the viewport narrows. */
.search-filter-card .search-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}
.search-filter-card .search-filter-actions {
    display: flex;
    gap: 8px;
}
.search-filter-card .search-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
}
.search-filter-card .search-filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.search-filter-card .search-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 0;
}

/* Advanced filter expander — chevron rotates 180° when section is open,
   driven by Bootstrap's aria-expanded attribute on the toggle button. */
.search-filter-advanced-toggle .search-filter-chevron {
    transition: transform 0.2s ease;
    font-size: 11px;
}
.search-filter-advanced-toggle [aria-expanded="true"] .search-filter-chevron {
    transform: rotate(180deg);
}
.search-filter-advanced-toggle .search-filter-advanced-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #4F46E5;
}

/* Hide DataTables' default search box + export buttons when the v2
   search-results card provides its own custom controls. The proper
   fix is to configure DataTables `dom` / `buttons` via JS but that's
   shared with the v1 page; this targeted CSS suppression is safe to
   apply while the v2 path is in flight. */
.search-results-card .dataTables_filter,
.search-results-card .dataTables_length,
.search-results-card .dt-buttons {
    display: none !important;
}

/* Search results table — column proportions tuned 2026-05-13 PM.
   Cap PRODUCT/SIZE so surplus flows to ADVERTISER/DESIGN + DESCRIPTION.
   Numbering: 1=☐ 2=Order# 3=Thumb 4=Adv/Design 5=Description
   6=Product/Size 7=Qty 8=Shipping 9=Status 10=Actions. */
.search-results-table th:nth-child(4),
.search-results-table td:nth-child(4) {
    max-width: 320px;
}
.search-results-table th:nth-child(5),
.search-results-table td:nth-child(5) {
    max-width: 280px;
}
.search-results-table th:nth-child(6),
.search-results-table td:nth-child(6) {
    min-width: 130px;
    max-width: 160px;
}
.search-results-table th:nth-child(8),
.search-results-table td:nth-child(8) {
    max-width: 80px;
}
.search-results-table th:nth-child(9),
.search-results-table td:nth-child(9) {
    max-width: 140px;
}
.search-results-table thead th:last-child,
.search-results-table tbody td:last-child {
    padding-left: 16px !important;
    padding-right: 24px !important;
}

/* Search Projects table — tighten Description (col 3) + Ordered By (4th from
   right, stable whether the Adv ID column is present or not) so the Actions
   column (last) has room for the Invoice PDF icon + View Project button without
   wrapping. Scoped to data-tb="tableMyProjects" so the joborders sizing above
   isn't disturbed. */
.search-results-table[data-tb="tableMyProjects"] th:nth-child(3),
.search-results-table[data-tb="tableMyProjects"] td:nth-child(3) {
    max-width: 240px;
}
.search-results-table[data-tb="tableMyProjects"] th:nth-last-child(4),
.search-results-table[data-tb="tableMyProjects"] td:nth-last-child(4) {
    max-width: 180px;
}
.search-results-table[data-tb="tableMyProjects"] th:nth-last-child(1),
.search-results-table[data-tb="tableMyProjects"] td:nth-last-child(1) {
    min-width: 200px;
}

/* Results table — 50x50 thumbnail with the same hover-grow treatment
   as the dashboard widget proof thumbs. */
.search-results-thumb {
    display: block;
    margin: 0 auto;
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #E5E7EB;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.search-results-thumb:hover {
    transform: scale(1.1);
    border-color: #4F46E5;
}
.search-results-checkbox-col {
    width: 44px;
}

/* Sticky bulk-action toolbar — pinned to bottom of the results card.
   Hidden by default (the [hidden] attribute) and revealed via JS when
   any row checkbox is checked. Extends to the card-body edges via
   negative margin so the divider line reads as a full-width separator. */
.bulk-action-toolbar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 1rem -1.5rem -1.5rem;
    padding: 12px 24px;
    background: #FFFFFF;
    border-top: 1px solid #E5E7EB;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
}
.bulk-action-toolbar[hidden] {
    display: none;
}
.bulk-action-toolbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.bulk-selected-count {
    font-size: 14px;
    font-weight: 600;
    color: #181C32;
}
.bulk-action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Dashboard widget patterns (added 2026-05-11) ----------
   Shared helpers for the 4 home-dashboard widgets. Goal: visual cohesion
   with the new project / joborder pages.
*/

/* External-link icon — 22x22 indigo-bg square with FA7
   arrow-up-right-from-square inside. Same pattern as the Project items
   table's open-in-new-tab icon. */
.external-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background-color: #EEF2FF;
    color: #4F46E5;
    flex-shrink: 0;
    cursor: pointer;
    text-decoration: none;
}
.external-link-icon:hover {
    background-color: #E0E7FF;
    color: #3730A3;
}
.external-link-icon i {
    font-size: 11px;
    color: inherit;
}

/* Order-number-with-external-link inline-flex wrapper. Keeps the
   number and the 22x22 icon on the same line — was wrapping to a
   second row on longer numbers like "292553-12" inside narrow columns. */
.order-with-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* Widget hover-reveal scrollbar — replaces the always-visible internal
   scrollbar in dashboard widgets with a hover-reveal pattern. Less
   visual furniture on page load. */
.widget-scrollable {
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.2s ease;
}
.widget-scrollable:hover {
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}
.widget-scrollable::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.widget-scrollable::-webkit-scrollbar-track {
    background: transparent;
}
.widget-scrollable::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}
.widget-scrollable:hover::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
}
.widget-scrollable:hover::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.5);
}
/* DataTables renders its own .dataTables_scrollBody with overflow-x:auto; a 1px
   column-width rounding then triggers a spurious horizontal scrollbar on the
   widget tables (most visible on Recently Shipped, where it also ate ~15px of
   the data window). Widgets wrap/fit by design and never scroll horizontally,
   so hide it. The vertical scroll (scrollY) is unaffected. */
.widget-scrollable .dataTables_scrollBody {
    overflow-x: hidden !important;
}

/* ---------- Dashboard widget data-window flex-fill (2026-06-25) ----------
   The 4 widget cards are a fixed height (hz-345-px), but DataTables gives the
   data window a FIXED pixel height (scrollY) while its container (.card-p) is
   flex-grow-1 — so the leftover stretch becomes dead space below the last row,
   and the gap differs per widget (Recently Shipped's 2-line header, the old
   .table-responsive vs .widget-scrollable wrapper). Make the data window
   flex-grow to fill whatever space remains under the title + column header, so
   every widget hugs its card with no dead space regardless of header height or
   row count. scrollY stays in the JS only as the scroll-structure seed; these
   rules override its height. Scoped to #my_widgets_form so no other DataTable
   is affected.
   The height cascade must run unbroken from the fixed-height card down to the
   scroll body — every level is a flex column with min-height:0 so the child can
   shrink below its content and the leftover space lands on the scroll body.
   (2026-07-31: this comment was accidentally closed early by a stray terminator
   on the line above, which left the three lines above it as raw invalid CSS. Per
   CSS error recovery the parser then consumed to the end of the NEXT {} block,
   silently discarding the rule
   `#my_widgets_form .card { display:flex; flex-direction:column }` below - i.e.
   the very first link of the cascade this comment describes was dead. The stray
   delimiter is removed; the cascade now starts where it says it does.
   NOTE: CSS comments do NOT nest - never write a comment terminator inside one,
   which is how this was briefly reintroduced while being fixed.) */
#my_widgets_form .card {
    display: flex;
    flex-direction: column;
}
#my_widgets_form .card-body {
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 12px;
}
#my_widgets_form .card-p {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 0 !important;
}
#my_widgets_form .widget-scrollable,
#my_widgets_form .table-responsive {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#my_widgets_form .dataTables_wrapper,
#my_widgets_form .dataTables_scroll {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#my_widgets_form .dataTables_scrollBody {
    flex: 1 1 auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}
/* Only the data window may flex; the title row and the column-header row must
   keep their natural height (flex-shrink:0) or the cascade compresses and clips
   them. */
#my_widgets_form .card-p > .flex-stack,
#my_widgets_form .dataTables_scrollHead {
    flex: 0 0 auto;
}
/* Right-side breathing room so Review buttons (and other right-aligned
   action cells) don't kiss the hover-reveal scrollbar. !important
   defends against Metronic's .table > * > * cell-padding reset. */
.widget-scrollable table thead th:last-child,
.widget-scrollable table tbody td:last-child {
    padding-right: 20px !important;
}
/* Same right-edge breathing room for widgets still on the legacy
   .table-responsive wrapper (e.g. Proofs to Review) so the last-column action
   button — the "Review" button — doesn't kiss the data-window scrollbar.
   Scoped to the dashboard form so it covers every widget regardless of wrapper. */
#my_widgets_form table thead th:last-child,
#my_widgets_form table tbody td:last-child {
    padding-right: 20px !important;
}

/* Recently Shipped widget column proportions — Curt's call 2026-05-12:
   narrow the Advertiser/Design column, allow Product/Size a bit more
   room, and let Destination/Tracking take the surplus so each row's
   destination wraps less often. table-layout:fixed is required for
   the column widths to be respected. */
.widget-scrollable table[data-tb="tableMyRecentlyShipping"] {
    table-layout: fixed;
    width: 100%;
}
.widget-scrollable table[data-tb="tableMyRecentlyShipping"] th:nth-child(1),
.widget-scrollable table[data-tb="tableMyRecentlyShipping"] td:nth-child(1) {
    width: 90px;
}
.widget-scrollable table[data-tb="tableMyRecentlyShipping"] th:nth-child(2),
.widget-scrollable table[data-tb="tableMyRecentlyShipping"] td:nth-child(2) {
    width: 22%;
}
.widget-scrollable table[data-tb="tableMyRecentlyShipping"] th:nth-child(3),
.widget-scrollable table[data-tb="tableMyRecentlyShipping"] td:nth-child(3) {
    width: 16%;
}
.widget-scrollable table[data-tb="tableMyRecentlyShipping"] th:nth-child(4),
.widget-scrollable table[data-tb="tableMyRecentlyShipping"] td:nth-child(4) {
    width: 50px;
}

/* Allow long status badges to wrap within widget tables so rows like
   "Shipment information sent to FedEx" don't overflow their column. */
.widget-scrollable table .badge {
    white-space: normal;
    text-align: center;
    line-height: 1.3;
}

/* Consistent vertical rhythm across all 4 widgets — cells anchor at top
   regardless of content height; uniform 10px top/bottom padding so rows
   feel the same across widgets even when one widget has thumbs and
   others don't. !important overrides the inline `vertical-align:text-top`
   in the legacy widget markup. */
.widget-scrollable table tbody td {
    vertical-align: top !important;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Widget heading — bumped from fs-5 to fs-3 to match the Project page
   "Items in this project" heading. Clickable (acts as the "open this
   list in full view" link) but visually a confident h2. */
.widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bs-gray-900, #181C32);
    text-decoration: none;
    cursor: pointer;
    margin: 0;
}
.widget-title:hover {
    color: var(--bs-primary, #2563EB);
}

/* Proof thumbnail inside Proofs to Review widget — 40x40 lightbox-able.
   Block display so it sits at the top of the cell (instead of baseline-
   aligning to the text in adjacent cells). */
.widget-proof-thumb {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #E5E7EB;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.widget-proof-thumb:hover {
    transform: scale(1.1);
    border-color: #4F46E5;
}

/* Card 4 artwork thumbnail wrapper — the JS .data-link="thumbnail"
   handler injects an <img> into this container at page ready. Constrain
   height so the action stack below always fits inside the 320px card. */
.joborder-thumb-wrap {
    text-align: center;
    max-height: 110px;
    overflow: hidden;
}
.joborder-thumb-wrap img {
    max-width: 100%;
    max-height: 110px;
    width: auto;
    height: auto;
    border-radius: 4px;
    object-fit: contain;
}

/* ---------- Joborder sticky top + destination cards (added 2026-05-11) ----------
   The header + 4-card row is wrapped in .joborder-sticky-top so it pins
   to the top of the viewport while the destinations list below scrolls.
   Page-bg color + small bottom padding keep it visually grounded as
   content slides underneath. */
.joborder-sticky-top {
    position: sticky;
    /* top is set at page load via JS to match the element's natural Y,
       so the sticky engages immediately and there is no visible jump
       when scrolling starts. Fallback for no-JS: 65px (topbar height). */
    top: 65px;
    z-index: 9;
    background-color: #f5f8fa;
    padding-bottom: 12px;
}

/* Destination cards — one card per ship-to.
   Inside a `.destination-card-row` (joborder page, 2-up), cards have a
   fixed 280px height so they align in their row; the packages pane scrolls
   (hover-reveal) when more than ~2 packages exist.
   Outside that wrapper (e.g. inside the Shipping Details modal where each
   destination stacks full-width), cards grow naturally to fit all packages
   with no internal scroll. */
.destination-card-row .destination-card {
    min-height: 280px;
    max-height: 280px;
}
.destination-card .card-body.destination-card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.destination-card .destination-header {
    flex: 0 0 auto;
}
.destination-card-row .destination-card .destination-packages-pane {
    flex: 1 1 auto;
    min-height: 0;
}
.destination-card .destination-address {
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--bs-gray-800, #1F2937);
}
.destination-card .destination-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 13px;
    color: var(--bs-gray-700, #4B5563);
}
.destination-card .destination-meta .meta-key {
    font-size: 12px;
    color: var(--bs-gray-500, #6B7280);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-right: 2px;
}

/* Slim package table inside destination card — tighter padding so 6
   columns fit at the 2-up width. Header row in uppercase 11px. */
.destination-packages-table {
    font-size: 13px;
}
.destination-packages-table thead th {
    padding-bottom: 6px;
    border-bottom: 1px solid #E5E7EB;
    font-size: 11px;
    letter-spacing: 0.4px;
}
.destination-packages-table td {
    vertical-align: top;
    padding-top: 6px;
    padding-bottom: 6px;
}
