/* SourceHub - application stylesheet, on top of Bootstrap 5.
 *
 * Two applications, not two sections of one: the staff world is navy and blue,
 * the supplier world is dark green and teal, and the difference is visible
 * before anything is read. The realm class on <body> (sh-staff / sh-supplier)
 * swaps the accent; every component below only ever refers to --sh-accent*.
 *
 * Numbers are what people come here to read. Every figure is tabular, amounts
 * are right-aligned, and colour is spent only where it means something: the
 * active page, the primary action, a deadline getting close, a best price.
 *
 * Rules that hold for every page, enforced by tools/GuiLint.java:
 * no FORM element, no placeholder next to a label, no long dash, no emoji,
 * cursor:pointer on what can be clicked, cursor:not-allowed on what cannot,
 * and a reason written next to anything disabled.
 */

:root
{
    --sh-ink:        #0e1a26;
    --sh-ink-2:      #31465a;
    --sh-ink-3:      #6a8199;
    --sh-ink-4:      #93a8bb;
    --sh-line:       #dde4ec;
    --sh-line-2:     #eef2f7;
    --sh-canvas:     #f4f7fa;
    --sh-card:       #ffffff;

    --sh-blue:       #1d6fb8;
    --sh-blue-d:     #12507f;
    --sh-blue-l:     #e7f1fa;
    --sh-blue-line:  #c9e0f3;
    --sh-teal:       #0e7c66;
    --sh-teal-d:     #0b5e4d;
    --sh-teal-l:     #e3f4f0;
    --sh-teal-line:  #c5e5dd;
    --sh-amber:      #a86a08;
    --sh-amber-l:    #fcf2e2;
    --sh-amber-line: #f0dcbb;
    --sh-red:        #a32424;
    --sh-red-l:      #fbeceb;
    --sh-red-line:   #f2d3d1;

    --sh-navy:       #0d1f30;
    --sh-forest:     #0c4a3e;

    --sh-shadow:     0 1px 2px rgba(16, 32, 48, .06), 0 3px 10px rgba(16, 32, 48, .05);
    --sh-radius:     10px;
    --sh-radius-sm:  7px;
    --sh-header-h:   54px;
    --sh-side-w:     228px;

    /* staff world by default */
    --sh-header-bg:    var(--sh-navy);
    --sh-header-mark:  #5aa3dd;
    --sh-header-soft:  #a9c2d8;
    --sh-avatar-bg:    #2b4c6b;
    --sh-avatar-ink:   #cfe3f4;
    --sh-accent:       var(--sh-blue);
    --sh-accent-d:     var(--sh-blue-d);
    --sh-accent-l:     var(--sh-blue-l);
    --sh-accent-line:  var(--sh-blue-line);
    --sh-accent-rgb:   29, 111, 184;
}

body.sh-supplier
{
    --sh-header-bg:    var(--sh-forest);
    --sh-header-mark:  #6fcfb4;
    --sh-header-soft:  #a8d8cb;
    --sh-avatar-bg:    #155d4e;
    --sh-avatar-ink:   #c8ece1;
    --sh-accent:       var(--sh-teal);
    --sh-accent-d:     var(--sh-teal-d);
    --sh-accent-l:     var(--sh-teal-l);
    --sh-accent-line:  var(--sh-teal-line);
    --sh-accent-rgb:   14, 124, 102;
}

/* --- Bootstrap, retuned ---------------------------------------------------- */

body
{
    --bs-body-color:        var(--sh-ink);
    --bs-body-bg:           var(--sh-canvas);
    --bs-body-font-family:  "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    --bs-body-font-size:    .875rem;
    --bs-body-line-height:  1.45;
    --bs-border-color:      var(--sh-line);
    --bs-link-color:        var(--sh-accent);
    --bs-link-color-rgb:    var(--sh-accent-rgb);
    --bs-link-hover-color:  var(--sh-accent-d);
    --bs-primary:           var(--sh-accent);
    --bs-primary-rgb:       var(--sh-accent-rgb);
    --bs-border-radius:     var(--sh-radius-sm);
    --bs-secondary-color:   var(--sh-ink-3);
    min-height: 100vh;
}

a, button, summary, label[for], select, .sh-click,
input[type=checkbox], input[type=radio], input[type=file]
{
    cursor: pointer;
}

:disabled, .disabled, [aria-disabled=true]
{
    cursor: not-allowed !important;
}

h1, h2, h3, h4 { letter-spacing: -.01em; }

.btn
{
    --bs-btn-font-size: .84375rem;
    --bs-btn-padding-x: .875rem;
    --bs-btn-padding-y: .45rem;
    --bs-btn-border-radius: var(--sh-radius-sm);
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.btn-sm { --bs-btn-font-size: .78rem; --bs-btn-padding-x: .625rem; --bs-btn-padding-y: .28rem; }

.btn-primary
{
    --bs-btn-bg: var(--sh-accent);
    --bs-btn-border-color: var(--sh-accent);
    --bs-btn-hover-bg: var(--sh-accent-d);
    --bs-btn-hover-border-color: var(--sh-accent-d);
    --bs-btn-active-bg: var(--sh-accent-d);
    --bs-btn-active-border-color: var(--sh-accent-d);
    --bs-btn-disabled-bg: var(--sh-accent);
    --bs-btn-disabled-border-color: var(--sh-accent);
}

/* The quiet default button: most actions on a page are this one. */
.btn-light
{
    --bs-btn-bg: var(--sh-card);
    --bs-btn-border-color: var(--sh-line);
    --bs-btn-color: var(--sh-ink);
    --bs-btn-hover-bg: var(--sh-canvas);
    --bs-btn-hover-border-color: var(--sh-line);
    --bs-btn-active-bg: var(--sh-line-2);
    --bs-btn-active-border-color: var(--sh-line);
}

.btn-success
{
    --bs-btn-bg: var(--sh-teal);
    --bs-btn-border-color: var(--sh-teal);
    --bs-btn-hover-bg: var(--sh-teal-d);
    --bs-btn-hover-border-color: var(--sh-teal-d);
}

.btn-danger
{
    --bs-btn-bg: var(--sh-red);
    --bs-btn-border-color: var(--sh-red);
    --bs-btn-hover-bg: #861c1c;
    --bs-btn-hover-border-color: #861c1c;
}

.btn-link { --bs-btn-color: var(--sh-accent); --bs-btn-hover-color: var(--sh-accent-d); text-decoration: none; padding-left: .25rem; padding-right: .25rem; }

.form-label { font-size: .78rem; font-weight: 600; color: var(--sh-ink-2); margin-bottom: .3rem; }
.form-text  { font-size: .75rem; color: var(--sh-ink-3); line-height: 1.4; }

.form-control, .form-select
{
    font-size: .875rem;
    border-color: var(--sh-line);
    border-radius: var(--sh-radius-sm);
    color: var(--sh-ink);
    /* Bootstrap paints a control with the body background, which here is the grey canvas. */
    background-color: #fff;
}

.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: #f1f4f8; color: var(--sh-ink-2); }

.form-control:focus, .form-select:focus, .form-check-input:focus
{
    border-color: var(--sh-accent);
    box-shadow: 0 0 0 .2rem rgba(var(--sh-accent-rgb), .16);
}

.form-check-input:checked { background-color: var(--sh-accent); border-color: var(--sh-accent); }
.invalid-feedback { font-size: .75rem; }

.card
{
    --bs-card-border-color: var(--sh-line);
    --bs-card-border-radius: var(--sh-radius);
    --bs-card-inner-border-radius: calc(var(--sh-radius) - 1px);
    --bs-card-cap-bg: var(--sh-card);
    --bs-card-cap-padding-y: .8rem;
    --bs-card-cap-padding-x: 1.125rem;
    --bs-card-spacer-x: 1.125rem;
    --bs-card-spacer-y: 1.125rem;
    box-shadow: var(--sh-shadow);
}

.card-header
{
    display: flex;
    align-items: center;
    gap: .625rem;
    border-bottom-color: var(--sh-line-2);
}

.card-header h2 { margin: 0; font-size: .97rem; font-weight: 600; }
.card-header .fa-duotone { color: var(--sh-ink-4); }
.card-body.p-0 > .table-responsive:last-child .table { margin-bottom: 0; }

.modal-content { border: 0; border-radius: 12px; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.modal-header  { border-bottom-color: var(--sh-line-2); padding: 1rem 1.25rem; gap: .625rem; }
.modal-title   { font-size: 1rem; font-weight: 600; }
.modal-footer  { border-top-color: var(--sh-line-2); background: #fbfcfd; padding: .8rem 1.25rem; border-radius: 0 0 12px 12px; }
.modal-backdrop { --bs-backdrop-bg: #0a1420; --bs-backdrop-opacity: .55; }

.dropdown-menu { font-size: .84375rem; border-color: var(--sh-line); box-shadow: 0 10px 24px rgba(16, 32, 48, .14); border-radius: 9px; }
.dropdown-item { cursor: pointer; }
.dropdown-item:active { background: var(--sh-accent); }

/* --- Shell ---------------------------------------------------------------- */

.sh-header
{
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--sh-header-h);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.125rem;
    background: var(--sh-header-bg);
    color: #fff;
}

.sh-header .sh-brand
{
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 700;
    font-size: 1.06rem;
    letter-spacing: -.01em;
    color: #fff;
    text-decoration: none;
}

.sh-header .sh-brand .fa-duotone { color: var(--sh-header-mark); font-size: 1.125rem; }

.sh-realm-tag
{
    display: flex;
    align-items: center;
    gap: .55rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, .18);
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sh-header-soft);
    white-space: nowrap;
}

.sh-realm-tag svg { height: 15px; width: auto; display: block; }

.sh-header .sh-icon-btn
{
    position: relative;
    background: transparent;
    border: 0;
    color: var(--sh-header-soft);
    font-size: 1rem;
    padding: .375rem;
    border-radius: 6px;
}

.sh-header .sh-icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.sh-header .sh-dot
{
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 8px;
    height: 8px;
    background: #e05c5c;
    border-radius: 50%;
}

.sh-who
{
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .81rem;
    color: var(--sh-header-soft);
    background: transparent;
    border: 0;
    padding: .25rem .375rem;
    border-radius: 6px;
}

.sh-who:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.sh-avatar
{
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--sh-avatar-bg);
    color: var(--sh-avatar-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .69rem;
    font-weight: 700;
    flex: none;
}

.sh-lang { display: flex; background: rgba(255, 255, 255, .08); border-radius: 7px; padding: 2px; }
.sh-lang button { border: 0; background: transparent; color: var(--sh-header-soft); font-size: .72rem; font-weight: 700; letter-spacing: .06em; padding: .25rem .55rem; border-radius: 5px; }
.sh-lang button.active { background: #fff; color: var(--sh-forest); }

.sh-body { display: flex; min-height: calc(100vh - var(--sh-header-h)); }

.sh-side
{
    width: var(--sh-side-w);
    flex: none;
    display: flex;
    flex-direction: column;
    background: var(--sh-card);
    border-right: 1px solid var(--sh-line);
    padding: .875rem .625rem 1.5rem;
}

/* The demo-only "Campionario" entry (Part 5.2/5.3): kept, but visually separated at the
   bottom of the few real entries instead of mixed in among them. */
.sh-nav-kit { margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--sh-line-2); }

@media (min-width: 992px)
{
    .sh-side
    {
        position: sticky;
        top: var(--sh-header-h);
        height: calc(100vh - var(--sh-header-h));
        overflow-y: auto;
    }
}

.sh-side .sh-group
{
    font-size: .69rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sh-ink-4);
    font-weight: 700;
    padding: .75rem .625rem .375rem;
}

.sh-side a
{
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .55rem .625rem;
    border-radius: var(--sh-radius-sm);
    font-size: .84375rem;
    color: var(--sh-ink-2);
    text-decoration: none;
}

.sh-side a:hover { background: var(--sh-canvas); }
.sh-side a .fa-duotone { width: 1.1em; text-align: center; color: var(--sh-ink-4); }
.sh-side a.active { background: var(--sh-accent-l); color: var(--sh-accent-d); font-weight: 600; }
.sh-side a.active .fa-duotone { color: var(--sh-accent); }
.sh-side a .sh-count { margin-left: auto; font-size: .69rem; font-weight: 700; background: var(--sh-accent-l); color: var(--sh-accent-d); border-radius: 99px; padding: .05rem .45rem; font-variant-numeric: tabular-nums; }
.sh-side a .sh-count.sh-hot { background: var(--sh-amber-l); color: var(--sh-amber); }

.sh-main { flex: 1; min-width: 0; padding: 1.375rem 1.625rem 2.75rem; }
.sh-main.sh-narrow { max-width: 980px; }

.sh-foot
{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .625rem;
    padding: 1.5rem 1rem .25rem;
    font-size: .72rem;
    color: var(--sh-ink-4);
}

.sh-foot svg { height: 15px; width: auto; display: block; }
.sh-foot .sh-dps { height: 26px; color: var(--sh-ink-2); --dps-sq: #16324c; }

/* Demo data strip: a page fed by even one fixture says so. */
.sh-demo-strip
{
    display: none;
    align-items: center;
    gap: .625rem;
    background: #231a08;
    color: #f2d9a4;
    font-size: .78rem;
    padding: .4rem 1.125rem;
}

.sh-demo-strip.sh-on { display: flex; }
.sh-demo-strip b { color: #ffd88a; }

/* "La palestra" (design spec 2026-10-19-sourcehub-training-design.md): rendered by head.jspf
   only while config.isTraining() is true, so - unlike .sh-demo-strip - no .sh-on toggle is
   needed, the markup itself is absent outside the training tier. A different colour from the
   demo strip on purpose: the two must never be mistaken for each other on screen. */
.sh-training-strip
{
    display: flex;
    align-items: center;
    gap: .625rem;
    background: #1f2d12;
    color: #d7e8a8;
    font-size: .78rem;
    padding: .4rem 1.125rem;
}
.sh-training-strip b { color: #c8e876; }

/* --- Page header ---------------------------------------------------------- */

.sh-crumb { font-size: .78rem; color: var(--sh-ink-4); margin-bottom: .25rem; }
.sh-crumb a { color: var(--sh-ink-3); text-decoration: none; }
.sh-crumb a:hover { color: var(--sh-accent); }

.sh-page-h { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.125rem; flex-wrap: wrap; }
.sh-page-h h1 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.sh-page-h .sh-sub { color: var(--sh-ink-3); font-size: .84375rem; margin-top: .2rem; }
/* justify-content: flex-end, not just margin-left: auto on the item itself: when the
 * combined unwrapped width of every action's icon+label+disabledWhy sentence is wider than
 * the space left on this wrapped line, flex-shrink has nothing else to take space FROM (this
 * item is alone on its line) and shrinks .sh-actions down to exactly that available width,
 * leaving its own auto margin nothing left to absorb - the block then fills the row but packs
 * its children to ITS OWN left edge (justify-content's default), reading as flush left despite
 * the auto margin. Confirmed live (GARA-2026-0058, two disabled actions with long reasons):
 * .sh-actions computed marginLeft was 0px and its width matched the row exactly.
 * justify-content: flex-end fixes the actual symptom (children hugging the wrong edge of
 * their own box) regardless of whether that box ends up content-sized or row-wide, so the
 * short-content case (one short reason, .sh-actions narrower than the row) keeps working
 * exactly as before - GUI_SUPPLIER_TENDERS_tender_jsp, 2026-09-20. */
.sh-page-h .sh-actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sh-page-h .sh-code { font-family: Consolas, "SF Mono", monospace; font-size: .8rem; color: var(--sh-ink-3); }

/* --- Record header (GUI/APP/components/record.js) --------------------------- */

.sh-record-h h1 { display: flex; align-items: center; gap: .625rem; flex-wrap: wrap; }
/* Code + badge as ONE flex item of h1 (record.js#recordHeader's own note): they wrap down
 * together when the title leaves no room, never the badge alone on an orphan line - reviewer
 * finding, 1024px, GUI_STAFF_TENDERS_tender_jsp ("In corso" stranded under the title). */
.sh-record-tags { display: inline-flex; align-items: center; gap: .625rem; flex-wrap: nowrap; }
.sh-record-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .8125rem; color: var(--sh-ink-3); margin-top: .3rem; }
.sh-record-dot { color: var(--sh-ink-4); }

/* --- Tabs (GUI/APP/components/record.js#mountTabs) --------------------------- */

/* Tighter horizontal rhythm than a generic strip: LAYOUT invariant 10 names an exact width, "the
 * ten tabs of the staff tender record must fit on ONE line at 1440px" - measured against the
 * widest real case (an AWARDED PRICE_AND_TECHNICAL tender, all ten tabs, GARA-2026-0040:
 * scrollWidth 1175px against a 1145px content column, 30px short) rather than left to whatever a
 * generic tab strip's own default padding happened to allow (2026-09-21 audit finding: at 1440px
 * the strip silently switched on the SAME scroll+edge-fade behaviour the design reserves for
 * 1024px, with no visible scrollbar to hint more tabs existed).
 *
 * Round 2, 2026-09-21: that first tightening pass (this rule's own gap/padding) was not enough
 * ON ITS OWN, and the icon-hiding media query below still only fired at 1300px - a full 140px
 * BELOW the 1440px this invariant actually names, so a real 1440px viewport still showed every
 * icon and was still the 30px this comment already measured. Padding/gap tightened a second
 * notch here, AND the media query below now fires at 1440px itself (see its own note) - between
 * the two, ten tabs with their icons fit at every width down to where the query switches them
 * off, and ten tabs WITHOUT icons (well under the 1145px column) leave headroom for an eleventh
 * before this needs revisiting again. */
.sh-tabs { position: relative; display: flex; gap: .1rem; border-bottom: 1px solid var(--sh-line); margin-bottom: 1.125rem; overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; }
/* The only clue, at a narrow width, that the strip has more tabs than fit: an edge fade,
 * toggled by GUI/APP/ui.js#markScrollable (GUI/APP/components/record.js#mountTabs) rather than
 * left to a bare, silent overflow-x: auto - tools/gui-sweep.mjs 1024px finding on
 * GUI_STAFF_TENDERS_tender_jsp, 2026-09-20. A pseudo-element of the scroll container itself,
 * not of its scrolled content, so it stays pinned to the edge as the strip scrolls. */
.sh-tabs::before, .sh-tabs::after
{
    content: ''; position: absolute; top: 0; bottom: 1px; width: 28px; pointer-events: none;
    opacity: 0; transition: opacity .15s;
}
.sh-tabs::before { left: 0; background: linear-gradient(to left, transparent, rgba(16, 32, 48, .1)); }
.sh-tabs::after { right: 0; background: linear-gradient(to right, transparent, rgba(16, 32, 48, .1)); }
.sh-tabs.sh-scroll-l::before, .sh-tabs.sh-scroll-r::after { opacity: 1; }
.sh-tabs button { flex: none; display: inline-flex; align-items: center; gap: .3rem; padding: .5rem .5rem; font-size: .84375rem; color: var(--sh-ink-3); border: 0; border-bottom: 2px solid transparent; background: none; white-space: nowrap; }
.sh-tabs button:hover { color: var(--sh-ink-2); }
.sh-tabs button.sh-on { color: var(--sh-accent-d); border-bottom-color: var(--sh-accent); font-weight: 600; }
.sh-tabs button .sh-count { background: var(--sh-line-2); color: var(--sh-ink-3); border-radius: 99px; font-size: .69rem; font-weight: 700; padding: .05rem .45rem; font-variant-numeric: tabular-nums; }
.sh-tabs button.sh-on .sh-count { background: var(--sh-accent-l); color: var(--sh-accent-d); }
/* Icons cost real width across ten tabs for no information a reader loses without them (the
 * label alone still says what the tab is) - dropped first, below the width where even the
 * tightened padding/gap above is not enough on its own (a narrower real column than the 1440px
 * case, or a future eleventh tab). Never touches the vertical variant (.sh-tabs-v), a page's own
 * one-per-line list of sections, where width was never the constraint.
 *
 * Round 2, 2026-09-21: this used to fire at max-width 1300px - BELOW the 1440px LAYOUT invariant
 * 10 actually names, so a literal 1440px viewport (per this file's own GARA-2026-0040 measurement,
 * a 1145px content column against a 1175px strip) still showed every icon and was still 30px
 * short. Raised to 1440px itself so the query is the width the invariant names, not a narrower
 * width that happened to be tried first. */
@media (max-width: 1440px) { .sh-tabs:not(.sh-tabs-v) button i { display: none; } }

/* Vertical variant (record.js#mountTabs' own `vertical: true` option): a page's own column of
 * section entries (GUI/STAFF/SETTINGS/settings.jsp) rather than a record's horizontal tab strip.
 * Sync/lazy-render/arrow-key behaviour is unchanged; a page still owns its own width/spacing
 * around this (e.g. settings.css' flex-basis on the strip), this only sets the direction. */
.sh-tabs-v { flex-direction: column; align-items: stretch; gap: .125rem; border-bottom: none; overflow: visible; }
.sh-tabs-v::before, .sh-tabs-v::after { display: none; }
.sh-tabs-v button { justify-content: flex-start; width: 100%; border-bottom: none; border-left: 2px solid transparent; border-radius: var(--sh-radius-sm); padding: .6rem .75rem; }
.sh-tabs-v button:hover { background: var(--sh-canvas); }
.sh-tabs-v button.sh-on { border-left-color: var(--sh-accent); border-bottom-color: transparent; background: var(--sh-accent-l); }

/* --- Badges: every state is written, never inferred ------------------------ */

.sh-badge
{
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    white-space: nowrap;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
    padding: .18rem .55rem;
    border-radius: 99px;
    background: var(--sh-canvas);
    color: var(--sh-ink-2);
    border: 1px solid var(--sh-line);
}

.sh-badge.sh-b { background: var(--sh-blue-l);  color: var(--sh-blue-d); border-color: var(--sh-blue-line); }
.sh-badge.sh-t { background: var(--sh-teal-l);  color: var(--sh-teal);   border-color: var(--sh-teal-line); }
.sh-badge.sh-a { background: var(--sh-amber-l); color: var(--sh-amber);  border-color: var(--sh-amber-line); }
.sh-badge.sh-r { background: var(--sh-red-l);   color: var(--sh-red);    border-color: var(--sh-red-line); }

/* --- Tables ---------------------------------------------------------------- */

/* Same edge-fade affordance as .sh-tabs above, for the table's own horizontal scroll
 * container: at 1024px a list's last column (e.g. CHIUSURA, GUI_STAFF_TENDERS_list_jsp) was
 * simply cut off at the card's edge with no hint that .table-responsive still scrolls -
 * tools/gui-sweep.mjs 1024px finding, 2026-09-20. GUI/APP/components/table.js#mountTable
 * toggles the classes through GUI/APP/ui.js#markScrollable.
 *
 * min-width: 0 is the actual fix, not the edge fade above it: .table-responsive is a flex
 * ITEM of .card (Bootstrap's .card is display:flex; flex-direction:column), and a flex
 * item's default min-width is auto - its own content's min-content size, not 0 - so
 * without this the div never shrank to the card's width at all: it grew to fit the whole
 * unscrolled table, and with it .card, .sh-main and the whole .sh-body grew past the
 * viewport, so the PAGE scrolled sideways instead of this container scrolling locally and
 * the edge fade never had anything to trigger on (GUI_STAFF_ORDERS_list_jsp,
 * GUI_STAFF_USERS_list_jsp, GUI_STAFF_SUPPLIERS_list_jsp, GUI_SUPPLIER_ORDERS_list_jsp
 * reviewer findings, 2026-09-20 - same defect on GUI_STAFF_TENDERS_list_jsp itself, the
 * "accepted model", it had simply not been reviewed at 1024px before). Same trap as
 * .sh-auth-main further down this file. */
.table-responsive { position: relative; min-width: 0; }
.table-responsive::before, .table-responsive::after
{
    content: ''; position: absolute; top: 0; bottom: 0; width: 28px; pointer-events: none;
    opacity: 0; transition: opacity .15s;
}
.table-responsive::before { left: 0; background: linear-gradient(to left, transparent, rgba(16, 32, 48, .1)); }
.table-responsive::after { right: 0; background: linear-gradient(to right, transparent, rgba(16, 32, 48, .1)); }
.table-responsive.sh-scroll-l::before, .table-responsive.sh-scroll-r::after { opacity: 1; }

/* A visible loading state for GUI/APP/components/table.js - the
   previous rows dim in place (a reload keeps showing the last known page while the new one is
   on the way, instead of flashing to blank) and a small spinner appears over them; the very
   first load has no previous rows to dim, so it shows the grey skeleton rows below instead. */
.table-responsive[aria-busy="true"] { position: relative; }
.table-responsive[aria-busy="true"] > *:not(.sh-skeleton) { opacity: .4; pointer-events: none; }
.table-responsive[aria-busy="true"]::after
{
    content: ''; position: absolute; top: 1rem; right: 1rem; width: 18px; height: 18px;
    border-radius: 50%; border: 2px solid var(--sh-line); border-top-color: var(--sh-accent);
    animation: sh-spin .7s linear infinite; pointer-events: none;
}
@keyframes sh-spin { to { transform: rotate(360deg); } }

.sh-skeleton { padding: .5rem 1.125rem 1rem; display: flex; flex-direction: column; gap: .625rem; }
.sh-skeleton-row { height: 2.25rem; border-radius: 6px; background: linear-gradient(90deg, var(--sh-line-2) 25%, var(--sh-line) 37%, var(--sh-line-2) 63%); background-size: 400% 100%; animation: sh-skeleton-shine 1.4s ease infinite; }
@keyframes sh-skeleton-shine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.sh-table { width: 100%; border-collapse: collapse; font-size: .84375rem; margin: 0; }
.sh-table th, .sh-table td { text-align: left; padding: .625rem .875rem; border-bottom: 1px solid var(--sh-line-2); vertical-align: middle; }
.sh-table thead th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sh-ink-4); font-weight: 700; background: #fbfcfd; white-space: nowrap; }
.sh-table tbody tr:hover { background: #fbfcfe; }
.sh-table tbody tr:last-child td { border-bottom: 0; }
.sh-table tr.sh-click:hover { background: var(--sh-accent-l); }
.sh-table .sh-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sh-table .sh-main-cell { font-weight: 600; }
.sh-table .sh-main-cell small { display: block; font-weight: 400; color: var(--sh-ink-3); font-size: .75rem; }
.sh-table th.sh-sort { cursor: pointer; user-select: none; }
.sh-table th.sh-sort:hover { color: var(--sh-ink-2); }

.sh-num  { font-variant-numeric: tabular-nums; }
.sh-mono { font-family: Consolas, "SF Mono", monospace; }
.sh-muted { color: var(--sh-ink-3); }
.sh-tiny { font-size: .75rem; color: var(--sh-ink-3); line-height: 1.4; }

.sh-toolbar { display: flex; align-items: center; gap: .625rem; padding: .75rem 1.125rem; border-bottom: 1px solid var(--sh-line-2); flex-wrap: wrap; }
.sh-toolbar .form-control, .sh-toolbar .form-select { width: auto; font-size: .8125rem; padding-top: .3rem; padding-bottom: .3rem; }
.sh-toolbar .sh-search { position: relative; }
.sh-toolbar .sh-search .fa-duotone { position: absolute; left: .625rem; top: 50%; transform: translateY(-50%); color: var(--sh-ink-4); font-size: .8rem; }
.sh-toolbar .sh-search input { padding-left: 1.9rem; min-width: 260px; }

/* Phone (C12, GUI/APP/components/table.js): `display: contents` dissolves the wrapper on every
   width wider than the mobile media query below, so the filter <select>s inside it lay out
   exactly as direct children of .sh-toolbar, unchanged from before this wrapper existed. The
   toggle button and the mobile sort row stay hidden outside that same media query. */
.sh-toolbar-filters { display: contents; }
.sh-filters-toggle, .sh-toolbar-sort { display: none; }

.sh-pager { display: flex; align-items: center; gap: .625rem; padding: .625rem 1.125rem; border-top: 1px solid var(--sh-line-2); font-size: .78rem; color: var(--sh-ink-3); }
.sh-pager .sh-spacer { flex: 1; }

/* The row-click / right-click-for-new-tab hint under a list (GUI/APP/components/table.js). */
.sh-list-hint { display: flex; align-items: center; gap: .4rem; padding: .5rem 1.125rem .75rem; font-size: .72rem; color: var(--sh-ink-4); }

/* --- Notes, KPIs, empty states -------------------------------------------- */

.sh-note { border-left: 4px solid var(--sh-blue); background: var(--sh-blue-l); padding: .75rem .95rem; border-radius: 0 8px 8px 0; font-size: .8125rem; line-height: 1.5; color: var(--sh-ink-2); display: flex; gap: .625rem; }
.sh-note > .fa-duotone { margin-top: .2rem; color: var(--sh-blue); }
.sh-note b { color: var(--sh-ink); }
.sh-note.sh-warn { border-color: var(--sh-amber); background: var(--sh-amber-l); }
.sh-note.sh-warn > .fa-duotone { color: var(--sh-amber); }
.sh-note.sh-good { border-color: var(--sh-teal); background: var(--sh-teal-l); }
.sh-note.sh-good > .fa-duotone { color: var(--sh-teal); }
.sh-note.sh-bad  { border-color: var(--sh-red); background: var(--sh-red-l); }
.sh-note.sh-bad > .fa-duotone { color: var(--sh-red); }

.sh-kpi { background: var(--sh-card); border: 1px solid var(--sh-line); border-radius: var(--sh-radius); padding: .95rem 1.06rem; box-shadow: var(--sh-shadow); display: block; color: inherit; text-decoration: none; height: 100%; }
a.sh-kpi:hover { border-color: var(--sh-accent); }
.sh-kpi .sh-l { font-size: .75rem; color: var(--sh-ink-3); display: flex; align-items: center; gap: .45rem; }
.sh-kpi .sh-v { font-size: 1.625rem; font-weight: 700; margin-top: .375rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sh-kpi .sh-s { font-size: .75rem; color: var(--sh-ink-3); margin-top: .125rem; }
.sh-kpi.sh-hot .sh-v { color: var(--sh-amber); }
.sh-kpi.sh-bad .sh-v { color: var(--sh-red); }

.sh-empty { padding: 1.75rem 1.125rem; text-align: center; color: var(--sh-ink-3); font-size: .8125rem; display: flex; flex-direction: column; align-items: center; gap: .55rem; }
.sh-empty .fa-duotone { font-size: 1.4rem; color: var(--sh-ink-4); }
.sh-empty b { color: var(--sh-ink-2); font-size: .875rem; }

/* A disabled control always has its reason next to it. */
.sh-why { display: inline-flex; align-items: center; gap: .375rem; font-size: .75rem; color: var(--sh-ink-3); }
.sh-why .fa-duotone { color: var(--sh-ink-4); }

/* --- Deadline: countdown AND absolute time, always together ------------------ */

.sh-deadline { display: flex; align-items: center; gap: .875rem; background: var(--sh-card); border: 1px solid var(--sh-line); border-radius: var(--sh-radius); padding: .7rem 1rem; box-shadow: var(--sh-shadow); }
.sh-deadline .sh-left { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.sh-deadline .sh-abs { font-size: .78rem; color: var(--sh-ink-3); }
.sh-deadline .sh-abs b { color: var(--sh-ink-2); }
.sh-deadline .sh-track { flex: 1; height: 6px; background: var(--sh-line-2); border-radius: 99px; overflow: hidden; min-width: 80px; }
.sh-deadline .sh-track i { display: block; height: 100%; background: var(--sh-teal); border-radius: 99px; transition: width 1s linear; }
.sh-deadline.sh-soon { border-color: var(--sh-amber-line); background: var(--sh-amber-l); }
.sh-deadline.sh-soon .sh-left { color: var(--sh-amber); }
.sh-deadline.sh-soon .sh-track i { background: var(--sh-amber); }
.sh-deadline.sh-now { border-color: var(--sh-red-line); background: var(--sh-red-l); }
.sh-deadline.sh-now .sh-left { color: var(--sh-red); }
.sh-deadline.sh-now .sh-track i { background: var(--sh-red); }
.sh-deadline.sh-over { background: var(--sh-canvas); }
.sh-deadline.sh-over .sh-left { color: var(--sh-ink-3); }
.sh-deadline.sh-over .sh-track i { background: var(--sh-ink-4); }
.sh-deadline.sh-sticky { position: sticky; top: calc(var(--sh-header-h) + .5rem); z-index: 1020; }
.sh-drift { font-size: .75rem; color: var(--sh-amber); display: none; }
.sh-drift.sh-on { display: block; }

/* Compact deadline: one line for a list cell, no box, no gauge (GUI/APP/components/deadline.js). */
.sh-deadline.sh-compact { display: block; gap: 0; padding: 0; }
.sh-deadline.sh-compact .sh-left { font-size: .84375rem; }
.sh-deadline.sh-compact .sh-abs { font-size: .72rem; margin-top: .1rem; white-space: nowrap; }
.sh-deadline.sh-compact .sh-abs b { color: var(--sh-ink-3); font-weight: 500; }
.sh-deadline.sh-compact,
.sh-deadline.sh-compact.sh-soon,
.sh-deadline.sh-compact.sh-now,
.sh-deadline.sh-compact.sh-over { background: none; border: 0; box-shadow: none; }

/* --- Money field with the echo of the calculation ---------------------------- */

.sh-money { display: flex; flex-direction: column; align-items: stretch; min-width: 150px; }
.sh-money .input-group-text { font-size: .72rem; color: var(--sh-ink-3); background: #fbfcfd; border-color: var(--sh-line); padding-left: .5rem; padding-right: .5rem; }
.sh-money input { text-align: right; font-variant-numeric: tabular-nums; }
.sh-echo { font-size: .72rem; color: var(--sh-teal); margin-top: .25rem; text-align: right; font-variant-numeric: tabular-nums; min-height: 1.05rem; }
.sh-echo.sh-warn { color: var(--sh-amber); text-align: left; }
.sh-echo.sh-bad  { color: var(--sh-red); text-align: left; }
.sh-unusual { display: none; margin-top: .3rem; font-size: .75rem; background: var(--sh-amber-l); border: 1px solid var(--sh-amber-line); border-radius: 6px; padding: .4rem .55rem; color: var(--sh-ink-2); text-align: left; }
.sh-unusual.sh-on { display: block; }
.sh-unusual .btn { margin-top: .3rem; }

/* --- Named attachment slot ---------------------------------------------------- */

.sh-slot { border: 1px dashed var(--sh-line); border-radius: 9px; padding: .8rem .95rem; background: #fff; margin-bottom: .625rem; }
.sh-slot.sh-over { border-color: var(--sh-accent); background: var(--sh-accent-l); }
.sh-slot .sh-slot-h { display: flex; align-items: center; gap: .55rem; }
.sh-slot .sh-slot-h b { font-size: .84375rem; }
.sh-slot .sh-slot-req { font-size: .69rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sh-amber); }
.sh-slot .sh-slot-free { font-size: .69rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sh-ink-4); }
.sh-slot .sh-slot-h .btn { margin-left: auto; }
.sh-slot .sh-file { display: flex; align-items: center; gap: .625rem; margin-top: .625rem; padding: .5rem .625rem; background: var(--sh-canvas); border-radius: 7px; font-size: .8rem; }
.sh-slot .sh-file .fa-duotone { color: var(--sh-red); font-size: 1.1rem; }
.sh-slot .sh-file .sh-meta { color: var(--sh-ink-3); font-size: .75rem; }
.sh-slot .sh-file .btn { margin-left: auto; }
.sh-slot .sh-refused { margin-top: .5rem; font-size: .78rem; color: var(--sh-red); display: flex; gap: .4rem; }

/* --- Picker: entities are found by what people know about them ----------------- */

.sh-picker { position: relative; }
.sh-picker .sh-hits { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--sh-line); border-radius: 9px; box-shadow: 0 10px 24px rgba(16, 32, 48, .14); z-index: 1040; overflow: hidden; display: none; max-height: 320px; overflow-y: auto; }
.sh-picker.sh-open .sh-hits { display: block; }
.sh-picker .sh-hit { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: .55rem .875rem; font-size: .8125rem; border-bottom: 1px solid var(--sh-line-2); }
.sh-picker .sh-hit:last-child { border-bottom: 0; }
.sh-picker .sh-hit:hover, .sh-picker .sh-hit.sh-cursor { background: var(--sh-accent-l); }
.sh-picker .sh-hit small { display: block; color: var(--sh-ink-3); font-size: .75rem; }
.sh-picker .sh-hit:disabled { opacity: .6; background: #fff; }
.sh-picker .sh-none { padding: .625rem .875rem; font-size: .78rem; color: var(--sh-ink-3); }
.sh-chosen { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .55rem; }
.sh-chosen .sh-chip { display: inline-flex; align-items: center; gap: .45rem; background: var(--sh-accent-l); border: 1px solid var(--sh-accent-line); color: var(--sh-accent-d); border-radius: 99px; padding: .2rem .3rem .2rem .7rem; font-size: .78rem; font-weight: 600; }
.sh-chosen .sh-chip button { border: 0; background: transparent; color: inherit; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; }
.sh-chosen .sh-chip button:hover { background: rgba(var(--sh-accent-rgb), .18); }

/* --- Wizard steps ------------------------------------------------------------- */

.sh-steps { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1.125rem; align-items: center; }
.sh-steps button { font-size: .75rem; padding: .35rem .75rem; border-radius: 99px; background: var(--sh-card); border: 1px solid var(--sh-line); color: var(--sh-ink-3); display: inline-flex; align-items: center; gap: .4rem; }
.sh-steps button .sh-n { font-weight: 700; font-variant-numeric: tabular-nums; }
.sh-steps button.sh-on { background: var(--sh-accent); border-color: var(--sh-accent); color: #fff; font-weight: 600; }
.sh-steps button.sh-done { background: var(--sh-teal-l); border-color: var(--sh-teal-line); color: var(--sh-teal); }
.sh-steps button.sh-issue { background: var(--sh-amber-l); border-color: var(--sh-amber-line); color: var(--sh-amber); }
.sh-saved { margin-left: auto; font-size: .75rem; color: var(--sh-ink-3); display: inline-flex; align-items: center; gap: .375rem; }
.sh-saved .fa-duotone { color: var(--sh-teal); }

/* Option card: a choice with its consequences written under it. */
.sh-opt { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--sh-line); border-radius: 8px; margin-bottom: .55rem; background: #fff; cursor: pointer; }
.sh-opt:hover { border-color: var(--sh-accent); }
.sh-opt.sh-on { border-color: var(--sh-accent); background: var(--sh-accent-l); box-shadow: inset 0 0 0 1px var(--sh-accent); }
.sh-opt input { margin-top: .2rem; }
.sh-opt .sh-t { font-size: .84375rem; font-weight: 600; }
.sh-opt .sh-d { font-size: .78rem; color: var(--sh-ink-3); margin-top: .1rem; line-height: 1.4; }

/* --- Modal / guided creation (GUI/APP/components/modal.js) ------------------- */

.sh-modal-sub { font-size: .78125rem; color: var(--sh-ink-3); margin: -.25rem 0 1rem; }
.sh-wizard-panel { min-height: 220px; }
.sh-wizard-error { color: var(--sh-red); font-size: .8125rem; margin-top: .75rem; min-height: 1.1rem; }

/* --- Export dialog (GUI/APP/components/exportdialog.js) ---------------------- */

.sh-export-formats { display: grid; gap: .55rem; }

/* --- Comparison grid ------------------------------------------------------------ */

.sh-cmp-wrap { overflow: auto; max-height: 70vh; border-top: 1px solid var(--sh-line-2); }
.sh-cmp { border-collapse: separate; border-spacing: 0; font-size: .8125rem; width: max-content; min-width: 100%; }
.sh-cmp th, .sh-cmp td { padding: .55rem .8rem; border-bottom: 1px solid var(--sh-line-2); border-right: 1px solid var(--sh-line-2); background: #fff; vertical-align: top; }
.sh-cmp thead th { position: sticky; top: 0; z-index: 3; background: #fbfcfd; text-align: right; min-width: 148px; }
.sh-cmp thead th.sh-fix { z-index: 5; text-align: left; }
.sh-cmp .sh-fix { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 270px; max-width: 270px; }
.sh-cmp .sh-fix2 { position: sticky; left: 270px; z-index: 2; background: #fff; min-width: 96px; text-align: right; box-shadow: 2px 0 0 var(--sh-line); }
.sh-cmp thead .sh-fix2 { z-index: 5; background: #fbfcfd; }
.sh-cmp tfoot td { position: sticky; bottom: 0; z-index: 3; background: #f7fafc; font-weight: 700; border-top: 2px solid var(--sh-line); text-align: right; font-variant-numeric: tabular-nums; }
.sh-cmp tfoot td.sh-fix { z-index: 5; text-align: left; }
.sh-cmp tfoot td.sh-fix2 { z-index: 5; }
.sh-cmp .sh-sup { font-weight: 700; color: var(--sh-ink); display: block; }
.sh-cmp .sh-sup small { display: block; font-weight: 400; color: var(--sh-ink-3); font-size: .72rem; }
.sh-cmp .sh-cell { text-align: right; }
.sh-cmp .sh-cell .sh-u { font-weight: 600; font-variant-numeric: tabular-nums; }
.sh-cmp .sh-cell .sh-tt { font-size: .72rem; color: var(--sh-ink-3); font-variant-numeric: tabular-nums; }
.sh-cmp .sh-cell .sh-dl { font-size: .72rem; color: var(--sh-amber); font-variant-numeric: tabular-nums; }
.sh-cmp .sh-cell.sh-best { background: var(--sh-teal-l); box-shadow: inset 3px 0 0 var(--sh-teal); }
.sh-cmp .sh-cell.sh-best .sh-dl { color: var(--sh-teal); }
.sh-cmp .sh-cell.sh-assigned { background: var(--sh-blue-l); box-shadow: inset 3px 0 0 var(--sh-blue); }
.sh-cmp .sh-cell.sh-na { color: var(--sh-ink-4); background: #fbfcfd; }
.sh-cmp .sh-cell.sh-anomaly .sh-u::after { content: " !"; color: var(--sh-red); }
.sh-cmp.sh-assignable .sh-cell:not(.sh-na) { cursor: pointer; }
.sh-cmp.sh-assignable .sh-cell:not(.sh-na):hover { outline: 2px solid var(--sh-blue); outline-offset: -2px; }
.sh-cmp th.sh-winner, .sh-cmp td.sh-winner { border-left: 2px solid var(--sh-teal); border-right: 2px solid var(--sh-teal); }
.sh-cmp thead th.sh-winner { background: var(--sh-teal-l); border-top: 2px solid var(--sh-teal); }
.sh-cmp.sh-hide-delta .sh-dl, .sh-cmp.sh-hide-total .sh-tt { display: none; }

/* --- Funnel, timeline, job progress ---------------------------------------------- */

.sh-funnel .sh-fr { display: grid; grid-template-columns: 210px 1fr 62px; gap: .75rem; align-items: center; margin-bottom: .55rem; }
.sh-funnel .sh-bar { height: 26px; background: var(--sh-canvas); border-radius: 5px; overflow: hidden; }
.sh-funnel .sh-bar i { display: block; height: 100%; background: var(--sh-accent); opacity: .85; }
.sh-funnel .sh-vv { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.sh-timeline { list-style: none; margin: 0; padding: 0; }
.sh-timeline li { display: grid; grid-template-columns: 148px 22px 1fr; gap: .5rem; padding: .45rem 0; font-size: .8125rem; position: relative; }
.sh-timeline .sh-when { color: var(--sh-ink-3); font-size: .75rem; font-variant-numeric: tabular-nums; text-align: right; padding-top: .1rem; }
.sh-timeline .sh-pin { display: flex; justify-content: center; color: var(--sh-ink-4); padding-top: .15rem; }
.sh-timeline li:not(:last-child) .sh-pin::after { content: ""; position: absolute; left: calc(148px + .5rem + 10px); top: 1.7rem; bottom: -.3rem; width: 1px; background: var(--sh-line); }
.sh-timeline .sh-what small { display: block; color: var(--sh-ink-3); font-size: .75rem; }
.sh-timeline li.sh-good .sh-pin { color: var(--sh-teal); }
.sh-timeline li.sh-warn .sh-pin { color: var(--sh-amber); }
.sh-timeline li.sh-bad .sh-pin { color: var(--sh-red); }

.sh-job { border: 1px solid var(--sh-line); border-radius: 9px; padding: .8rem .95rem; background: #fff; }
.sh-job .sh-job-h { display: flex; align-items: center; gap: .55rem; font-size: .84375rem; font-weight: 600; }
.sh-job .sh-job-h .sh-count { margin-left: auto; font-weight: 400; color: var(--sh-ink-3); font-variant-numeric: tabular-nums; }
.sh-job .progress { height: 8px; margin-top: .55rem; background: var(--sh-line-2); }
.sh-job .progress-bar { background: var(--sh-accent); }
.sh-job.sh-done .progress-bar { background: var(--sh-teal); }
.sh-job.sh-failed .progress-bar { background: var(--sh-red); }
.sh-job .sh-outcome { margin-top: .55rem; font-size: .78rem; color: var(--sh-ink-2); display: flex; gap: 1rem; flex-wrap: wrap; }
.sh-job .sh-outcome .sh-ok { color: var(--sh-teal); }
.sh-job .sh-outcome .sh-ko { color: var(--sh-red); }

/* A checklist whose items carry their own check/cross icon: the icon is the marker, so no bullet. */
.sh-checklist { list-style: none; padding-left: 0; margin: 0; }
.sh-checklist li { display: flex; align-items: flex-start; gap: .5rem; padding: .2rem 0; }
.sh-checklist li > i { margin-top: .2rem; flex: 0 0 auto; }
.sh-checklist li.sh-ok > i { color: var(--sh-teal); }
.sh-checklist li.sh-ko > i { color: var(--sh-red); }

/* --- One-time code ----------------------------------------------------------------- */

.sh-otp { display: flex; gap: .5rem; justify-content: center; margin: .875rem 0; }
.sh-otp input { width: 42px; height: 52px; border: 1px solid var(--sh-line); border-radius: 8px; text-align: center; font-size: 1.375rem; font-weight: 700; background: #fbfcfd; font-variant-numeric: tabular-nums; }
.sh-otp input:focus { outline: 0; border-color: var(--sh-accent); box-shadow: 0 0 0 .2rem rgba(var(--sh-accent-rgb), .16); background: #fff; }
.sh-otp.sh-bad input { border-color: var(--sh-red); background: var(--sh-red-l); }

.sh-irreversible { border: 1px solid var(--sh-red-line); background: var(--sh-red-l); border-radius: 8px; padding: .7rem .875rem; font-size: .8125rem; color: var(--sh-ink-2); display: flex; gap: .625rem; }
.sh-irreversible .fa-duotone { color: var(--sh-red); margin-top: .15rem; }

/* --- Live connection state: real time is declared, even when it is not there --------- */

.sh-live { display: inline-flex; align-items: center; gap: .45rem; font-size: .75rem; font-weight: 600; padding: .22rem .625rem; border-radius: 99px; border: 1px solid var(--sh-teal-line); background: var(--sh-teal-l); color: var(--sh-teal); }
.sh-live i.sh-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--sh-teal); animation: sh-pulse 1.6s ease-in-out infinite; }
.sh-live.sh-polling { border-color: var(--sh-amber-line); background: var(--sh-amber-l); color: var(--sh-amber); }
.sh-live.sh-polling i.sh-pulse { background: var(--sh-amber); animation: none; }
.sh-live.sh-lost { border-color: var(--sh-red-line); background: var(--sh-red-l); color: var(--sh-red); }
.sh-live.sh-lost i.sh-pulse { background: var(--sh-red); animation: none; }
@keyframes sh-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) { .sh-live i.sh-pulse { animation: none; } }

/* --- Origin of a value: typed by hand, imported from a file, aligned from SAP --------- */

.sh-origin { display: inline-flex; align-items: center; gap: .3rem; font-size: .69rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sh-ink-4); margin-left: .45rem; }
.sh-origin.sh-ext { color: var(--sh-blue-d); }
.sh-origin.sh-forced { color: var(--sh-amber); }
.sh-locked .form-control { background: #fbfcfd; color: var(--sh-ink-2); }

/* --- Toasts ------------------------------------------------------------------------------ */

#shToasts { position: fixed; right: 1.125rem; bottom: 1.125rem; display: flex; flex-direction: column; gap: .55rem; z-index: 1090; }
.sh-toast { background: var(--sh-navy); color: #e6f0f8; padding: .75rem 1rem; border-radius: 9px; font-size: .8125rem; max-width: 340px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); display: flex; gap: .625rem; align-items: flex-start; transition: opacity .4s; }
.sh-toast .fa-duotone { color: #6fc3a7; font-size: .95rem; margin-top: .1rem; }
.sh-toast.sh-bad .fa-duotone { color: #f0908c; }
.sh-toast.sh-warn .fa-duotone { color: #f2c46a; }

/* --- Sign-in pages: no shell, the realm colour carries the identity ---------------------- */

/* minmax(0, 1fr), not a bare 1fr: an implicit grid track's automatic minimum is its
 * content's min-content width, exactly like a flex item's default min-width:auto. The
 * invitation and registration-recap cards (.onb-card dl) carry an email address and a VAT
 * number that do not break, so without the explicit 0 floor their min-content pushed this
 * column (and the whole page) 33-48px past a 1024px window - found by tools/gui-sweep.mjs
 * on GUI/AUTH/invitation.jsp, 2026-09-20. */
.sh-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 44%) minmax(0, 1fr); }
.sh-auth .sh-auth-side { background: var(--sh-header-bg); color: #fff; padding: 2.5rem 2.75rem; display: flex; flex-direction: column; }
.sh-auth .sh-auth-side .sh-brand { display: flex; align-items: center; gap: .6rem; font-size: 1.35rem; font-weight: 700; }
.sh-auth .sh-auth-side .sh-brand .fa-duotone { color: var(--sh-header-mark); }
.sh-auth .sh-auth-side h1 { font-size: 1.75rem; font-weight: 700; margin: auto 0 .75rem; line-height: 1.2; }
.sh-auth .sh-auth-side p { color: var(--sh-header-soft); font-size: .9rem; line-height: 1.55; max-width: 34ch; margin-bottom: auto; }
.sh-auth .sh-auth-side .sh-for { display: flex; align-items: center; gap: .7rem; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sh-header-soft); }
.sh-auth .sh-auth-side .sh-for svg { height: 22px; width: auto; }
/* width: 100%; min-width: 0: without them this grid item sizes to its own content instead of
 * its column track (confirmed with devtools: the track resolves to the correct 56%, the box
 * painted in it does not), so a page whose content is wider than the box that content itself
 * produced - impossible to see until the auto/1fr fix above already narrowed one down to it -
 * still overflows a 1024px window from here. min-width: 0 is what then lets it shrink past
 * its own children's content size instead of re-introducing the same overflow one level in. */
.sh-auth .sh-auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--sh-canvas); width: 100%; min-width: 0; }
.sh-auth .sh-auth-box { width: 100%; max-width: 400px; }
.sh-auth .sh-auth-box h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: .3rem; }
.sh-auth .sh-auth-box .sh-sub { color: var(--sh-ink-3); font-size: .84375rem; margin-bottom: 1.25rem; }
@media (max-width: 860px) { .sh-auth { grid-template-columns: 1fr; } .sh-auth .sh-auth-side { padding: 1.5rem; } .sh-auth .sh-auth-side h1 { margin-top: 1.5rem; font-size: 1.35rem; } }

/* --- Component kit page -------------------------------------------------------------------- */

.sh-kit-section { margin-bottom: 2rem; scroll-margin-top: calc(var(--sh-header-h) + 1rem); }
.sh-kit-section > h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: .2rem; }
.sh-kit-section > p { color: var(--sh-ink-3); font-size: .8125rem; max-width: 80ch; margin-bottom: .875rem; }
.sh-kit-toc { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: 1.5rem; }
.sh-kit-toc a { font-size: .75rem; padding: .25rem .625rem; border-radius: 99px; background: var(--sh-card); border: 1px solid var(--sh-line); color: var(--sh-ink-2); text-decoration: none; }
.sh-kit-toc a:hover { border-color: var(--sh-accent); color: var(--sh-accent-d); }
.sh-kit-row { display: flex; flex-wrap: wrap; gap: .625rem; align-items: center; }

/* --- Small screens ---------------------------------------------------------------------------- */

@media (max-width: 991.98px)
{
    .sh-side { position: fixed; top: var(--sh-header-h); bottom: 0; left: 0; z-index: 1025; transform: translateX(-100%); transition: transform .2s ease; overflow-y: auto; box-shadow: 8px 0 24px rgba(16, 32, 48, .16); }
    body.sh-side-open .sh-side { transform: none; }
    .sh-main { padding: 1rem .875rem 2.5rem; }
    .sh-realm-tag { display: none; }
    /* Only the name (#shWhoName) hides here, never #shAvatar: both GUI/STAFF/shell.jspf and
       GUI/SUPPLIER/shell.jspf render the avatar as its own <span class="sh-avatar" id="shAvatar">,
       so the old bare ".sh-who span" rule (found 2026-11-17 reviewing "La mia offerta" at 390px)
       hid the avatar circle along with the name - ".sh-who span" (one class + one type selector)
       outranks ".sh-avatar"'s own display:flex (one class alone) and wins by source order too, so
       the user-menu button was an unlabelled, nearly invisible rectangle on every phone and
       tablet screen of both realms, not "the circle alone" the comment just below always assumed. */
    .sh-who #shWhoName { display: none; }
    .sh-funnel .sh-fr { grid-template-columns: 130px 1fr 44px; }
    .sh-timeline li { grid-template-columns: 96px 22px 1fr; }
    .sh-timeline li:not(:last-child) .sh-pin::after { left: calc(96px + .5rem + 10px); }

    /* C12: 44px touch targets below the tablet breakpoint - the burger,
       the notification bell and every other header icon button, the avatar/user button (its name
       is hidden here, so the circle alone was the whole target), the IT/EN language buttons and
       the toast close button were all smaller than that on a phone or tablet. */
    .sh-icon-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .sh-who { min-height: 44px; }
    .sh-lang button { min-width: 44px; min-height: 44px; }
    .sh-toast .btn-close { min-width: 44px; min-height: 44px; background-position: center; }

    /* C12, found 2026-11-17 reviewing "La mia offerta" at 390/820px: the record tab strip
       (GUI/APP/components/record.js#mountTabs, every record screen of both realms) was never
       covered by the pass above - measured 38px tall at phone and tablet width, 6px under the
       44px minimum. Padding only, no layout change at >=992px (outside this media query). */
    .sh-tabs button { min-height: 44px; }

    /* C12, same 2026-11-17 review: every Bootstrap button (.btn and .btn-sm: "Compila l'offerta",
       "Salva bozza", "Deposita l'offerta", the row actions) measured 31-38px on phone and tablet,
       and so did the text fields and the file chooser beside them. One floor for all of them here
       instead of one rule per screen (.btn is already an inline flex box, so the label stays
       centred). Above 992px nothing changes. */
    .btn { min-height: 44px; min-width: 44px; justify-content: center; }
    .form-control, .form-select { min-height: 44px; }
    .list-group-item-action { min-height: 44px; }
    /* Found on the palestra with real data: every close cross (the training strip, modals) at
       30px, and the step chips of the opening session at 31px. */
    .btn-close { min-width: 44px; min-height: 44px; background-position: center; }
    .sh-steps button { min-height: 44px; }
    .sh-who { min-width: 44px; justify-content: center; }
    /* A checkbox or switch with its label (the "Solo le mie" toggle): the whole row is the target. */
    .form-check { min-height: 44px; display: flex; align-items: center; gap: .5rem; }
    .form-check .form-check-input { margin-top: 0; flex: 0 0 auto; }

    /* C12, same 2026-11-17 pass: giving #shAvatar back its real width (the fix just above the
       realm-tag rule) pushed the header 14px past 390px (burger + brand + language group + bell +
       avatar, all already at their own 44px floor, no longer fit the row with the desktop gap and
       padding). Tightened here, mobile/tablet only - the burger, SourceHub wordmark and every
       icon button keep their own already-floored 44px target, only the breathing room between
       them shrinks. */
    .sh-header { gap: .5rem; padding: 0 .75rem; }
}

@media (min-width: 992px) { .sh-burger { display: none; } }

@media print
{
    .sh-header, .sh-side, .sh-foot, .sh-demo-strip, .sh-training-strip, #shToasts, .sh-actions { display: none !important; }
    .sh-main { padding: 0; }
    body { background: #fff; }
}

/* Record header: the full-width block under it, and a tab strip that scrolls without a bar
   (the edge fade already says there is more). */
.sh-record-below { margin: -.25rem 0 1rem; }
.sh-tabs { scrollbar-width: none; }
.sh-tabs::-webkit-scrollbar { display: none; }

/* List toolbar: the reset button, present only while something is filtered. */
.sh-toolbar .sh-reset { padding: .3rem .25rem; font-size: .8125rem; text-decoration: none; white-space: nowrap; cursor: pointer; }
.sh-toolbar .sh-reset:hover { text-decoration: underline; }

/* Guided creation of a tender: the groups of starting models. */
.sh-tpl-group { margin-bottom: 1.125rem; }
.sh-tpl-group-h { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; font-size: .84375rem; }
.sh-tpl-group-h i { color: var(--sh-accent); }
.sh-tpl-group-h span { color: var(--sh-ink-3); font-size: .78125rem; }

/* Phone (C12): a table marked .sh-stack turns each row into a card, every cell carrying its
   column name (data-label, set by app.js from the table's own header). Opt-in, so a table whose
   meaning is the grid itself (the comparison, the auction ledger, the technical scoring matrix)
   keeps scrolling instead - see the sticky-first-column rules for those three, further down this
   same media query. */
@media (max-width: 575.98px)
{
    .sh-table.sh-stack thead { display: none; }
    .sh-table.sh-stack, .sh-table.sh-stack tbody, .sh-table.sh-stack tr { display: block; width: 100%; }
    .sh-table.sh-stack tr { border-bottom: 1px solid var(--sh-line-2); padding: .5rem 0; }
    .sh-table.sh-stack tbody tr:last-child { border-bottom: 0; }
    .sh-table.sh-stack td { display: flex; gap: .75rem; justify-content: space-between; align-items: flex-start; border: 0; padding: .3rem .875rem; text-align: right; min-height: 44px; }
    .sh-table.sh-stack td::before { content: attr(data-label); flex: 0 0 38%; text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--sh-ink-4); font-weight: 700; padding-top: .15rem; }
    .sh-table.sh-stack td[data-label=""] { justify-content: flex-end; }
    .sh-table.sh-stack td[data-label=""]::before { content: none; }
    /* A small button inside a stacked row is still a finger's target. */
    .sh-table.sh-stack td .btn-sm { min-width: 44px; min-height: 44px; }

    /* GUI/APP/components/table.js: the <select> filters collapse behind "Filtri", the search box
       stays always visible, and the reset button (outside this panel) stays reachable either way. */
    .sh-filters-toggle { display: inline-flex; align-items: center; gap: .375rem; margin-left: auto; min-height: 44px; }
    .sh-toolbar-filters { display: none; flex-basis: 100%; }
    .sh-toolbar-filters.sh-open { display: flex; flex-wrap: wrap; gap: .625rem; margin-top: .625rem; }
    .sh-toolbar-filters .form-select { min-height: 44px; }

    /* Same component: with the header (and its click-to-sort cells) hidden, sorting moves to a
       <select> plus a direction button, full width of their own row. */
    .sh-toolbar-sort { display: flex; align-items: center; gap: .5rem; flex-basis: 100%; margin-top: .5rem; color: var(--sh-ink-4); }
    .sh-toolbar-sort select { flex: 1 1 auto; min-height: 44px; }
    .sh-toolbar-sort button { min-height: 44px; min-width: 44px; }

    /* Grids left deliberately scrollable instead of .sh-stack (task note, 2026-10-10): the live
       auction standing (.sh-room-rank, GUI/STAFF/TENDERS/room.js) and the technical evaluation's
       criteria x supplier scoring matrix (.sh-tech-grid, GUI/STAFF/TENDERS/tabs/evaluation/
       technical.js) - cards would hide exactly the comparison these two exist to show. Both keep
       horizontal scrolling inside their card, with the first column pinned so a reader always
       knows which row (fornitore / criterio) they are scrolling against. */
    .sh-room-rank, .sh-tech-grid { width: max-content; min-width: 100%; }
    .sh-room-rank th:first-child, .sh-room-rank td:first-child,
    .sh-tech-grid th:first-child, .sh-tech-grid td:first-child
    {
        position: sticky; left: 0; z-index: 2; background: #fff; box-shadow: 2px 0 0 var(--sh-line-2);
    }
    .sh-room-rank thead th:first-child, .sh-tech-grid thead th:first-child { background: #fbfcfd; z-index: 3; }
}

/* Phone (C12): the comparison grid keeps scrolling sideways, but its sticky line column must leave
   room for at least one supplier column at 390 px (it took the whole width, 2026-10-10). */
@media (max-width: 575.98px)
{
    .sh-cmp .sh-fix { min-width: 140px; max-width: 140px; }
    .sh-cmp .sh-fix2 { position: static; box-shadow: none; }
    .sh-cmp thead th { min-width: 120px; }
}

/* A checkbox or radio that selects a row: the whole 44px square around it is the target (C12). */
label.sh-check-hit { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: 0; cursor: pointer; }
label.sh-check-hit .form-check-input { margin: 0; cursor: pointer; }
.form-check.sh-check-hit { min-height: 44px; display: flex; align-items: center; gap: .5rem; }
.form-check.sh-check-hit .form-check-input { float: none; margin: 0; cursor: pointer; }
.form-check.sh-check-hit .form-check-label { cursor: pointer; }
