/* =====================================================================
   G-SMaRT Distribution System - the cold-chain theme (loads after app.css)

   Built from the place the system is used in: a cold storage of a chicken and frozen food distributor.
     Freezer navy  #0f2a3d  the menu rail, the ink of the text (insulated cold-room panels)
     Frost         #edf2f5  the page
     Cold blue     #0d5b8c  actions and links
     Crate yellow  #f2b705  the one accent: the plastic crate, the dock line; the current menu, the crate tags
     Scale amber   #ffb627  the digits of the weighing scale (crate windows, pick-ups, the log-in)
   Type: Barlow (the sign-painter's grotesque of highways and warehouses) for everything, Barlow Semi
   Condensed for titles, Share Tech Mono only where a figure is read off an instrument or a crate tag.
   Depth comes from surfaces that sit on the page (panels), lips under keys (buttons) and recessed
   displays (the scale). Motion answers what the user does: the menu opens, a window rises, a weight ticks.
   ===================================================================== */

@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Share Tech Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/share-tech-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  --font: "Barlow", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-title: "Barlow Semi Condensed", "Barlow", "Segoe UI", system-ui, sans-serif;
  --font-gauge: "Share Tech Mono", ui-monospace, "Consolas", monospace;

  --ink: #102a3b;
  --ink-2: #2d4556;
  --steel: #5c7183;
  --steel-2: #8396a5;
  --frost: #edf2f5;
  --panel: #ffffff;
  --panel-2: #f5f8fa;
  --line: #d4dde4;
  --line-soft: #e5ebef;
  --line-strong: #bccad4;

  --cold: #0d5b8c;
  --cold-deep: #094469;
  --cold-lip: #062f49;
  --cold-tint: #e2eef6;
  --crate: #f2b705;
  --crate-deep: #c69300;
  --crate-tint: #fff5d1;
  --rail: #0f2a3d;
  --rail-2: #133550;
  --rail-text: #b4c6d4;
  --rail-dim: #7891a5;
  --ok: #16774c;
  --warn: #9a6400;
  --bad: #bf3628;
  --scale-face: #14181b;
  --scale-digit: #ffb627;

  --rail-w: 272px;
  --bar-h: 58px;
  --radius: 10px;
  --radius-sm: 7px;
  --lift-1: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 1px 2px rgba(16, 42, 59, .06), 0 10px 22px -16px rgba(16, 42, 59, .28);
  --lift-2: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 2px 4px rgba(16, 42, 59, .07), 0 22px 40px -24px rgba(16, 42, 59, .42);
  --sunk: inset 0 1px 2px rgba(16, 42, 59, .08);
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* app.css and Bootstrap read these */
  --page: var(--frost);
  --surface: var(--panel);
  --surface-2: var(--panel-2);
  --ink-soft: var(--ink-2);
  --muted: var(--steel);
  --blue: var(--cold);
  --blue-deep: var(--cold-deep);
  --blue-tint: var(--cold-tint);
  --raise-1: var(--lift-1);
  --raise-2: var(--lift-2);
  --inset: var(--sunk);
  --bs-body-font-family: var(--font);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--frost);
  --bs-border-color: var(--line);
  --bs-primary: #0d5b8c;
  --bs-primary-rgb: 13, 91, 140;
  --bs-success: #16774c;
  --bs-success-rgb: 22, 119, 76;
  --bs-danger: #bf3628;
  --bs-danger-rgb: 191, 54, 40;
  --bs-warning: #f2b705;
  --bs-warning-rgb: 242, 183, 5;
  --bs-info: #2a7d95;
  --bs-info-rgb: 42, 125, 149;
  --bs-secondary-color: #5c7183;
  --bs-link-color: #0d5b8c;
  --bs-link-color-rgb: 13, 91, 140;
  --bs-link-hover-color: #094469;
  --bs-link-hover-color-rgb: 9, 68, 105;
  --bs-primary-text-emphasis: #094469;
  --bs-primary-bg-subtle: #e2eef6;
  --bs-focus-ring-color: rgba(13, 91, 140, .25);
}

html { scroll-padding-top: calc(var(--bar-h) + 14px); }
body.gs {
  font-family: var(--font); font-size: .935rem; line-height: 1.5; color: var(--ink); background: var(--frost);
  font-feature-settings: "tnum" 1, "lnum" 1;
}
::selection { background: #cfe3f1; }
:focus-visible { outline: 2px solid var(--cold); outline-offset: 2px; }
a { color: var(--cold); }
a:hover { color: var(--cold-deep); }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { font-family: var(--font-title); letter-spacing: -.005em; color: var(--ink); }
.text-muted { color: var(--steel) !important; }
.text-primary { color: var(--cold) !important; }
.text-success { color: var(--ok) !important; }
.text-danger { color: var(--bad) !important; }
.text-warning { color: var(--warn) !important; }
.fw-semibold { font-weight: 600 !important; }
kbd { font-family: var(--font-gauge); }

/* ------------------------------------------------------------------ the frame: the rail and the work area */
.app-frame { display: flex; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.rail {
  --bs-offcanvas-width: 296px; --bs-offcanvas-bg: var(--rail); --bs-offcanvas-color: var(--rail-text);
  width: var(--rail-w); min-width: var(--rail-w); color: var(--rail-text); display: flex; flex-direction: column;
  /* insulated cold-room panels: a faint seam every 22 px */
  background-color: var(--rail);
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .022) 0 1px, transparent 1px 22px), linear-gradient(180deg, #123248 0%, var(--rail) 40%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .05), 6px 0 20px -14px rgba(5, 18, 28, .6);
}
@media (min-width: 992px) {
  /* Bootstrap leaves an offcanvas-lg see-through and unscrollable at this width: the rail keeps its colour and scrolls its own menu */
  .rail.offcanvas-lg { position: sticky; top: 0; height: 100vh; z-index: 1030; background-color: var(--rail) !important; }
  .rail.offcanvas-lg .rail-scroll { flex: 1 1 auto !important; min-height: 0; overflow-y: auto !important; display: block !important; }
}
.rail-brand { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1rem 1rem .9rem; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.rail-logo { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none !important; }
.rail-logo:hover { color: #fff; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 36px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); }
.brand-mark .bm-body { fill: var(--crate); }
.brand-mark .bm-slat { fill: rgba(15, 42, 61, .78); }
.brand-mark .bm-handle { fill: var(--crate-deep); }
.rail-name { display: flex; flex-direction: column; line-height: 1.05; }
.rail-name strong { font-family: var(--font-title); font-weight: 700; font-size: 1.22rem; letter-spacing: .01em; }
.rail-name span { font-size: .76rem; color: var(--rail-text); font-weight: 500; margin-top: .15rem; }
.rail-scroll { flex: 1 1 auto; overflow-y: auto; padding: .5rem 0 1rem; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
.rail-scroll::-webkit-scrollbar { width: 8px; }
.rail-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 8px; }
.rail-foot { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-top: 1px solid rgba(255, 255, 255, .07); font-size: .78rem; color: var(--rail-dim); }
.rail-foot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rail-menu { --bs-accordion-bg: transparent; --bs-accordion-border-width: 0; --bs-accordion-btn-focus-box-shadow: none;
  --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%237891a5'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23f2b705'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  --bs-accordion-btn-icon-width: .8rem; }
.rail-module { background: transparent; border: 0; }
.rail .accordion-button {
  gap: .7rem; padding: .5rem .85rem .5rem .8rem; margin: 1px .5rem; width: calc(100% - 1rem); border-radius: 8px;
  background: transparent; color: var(--rail-text); font-weight: 600; font-size: .92rem; box-shadow: none;
  transition: background-color .15s ease, color .15s ease;
}
.rail .accordion-button:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.rail .accordion-button:not(.collapsed) { color: #fff; background: rgba(255, 255, 255, .04); }
.rail .accordion-button:focus-visible { outline: 2px solid var(--crate); outline-offset: -2px; }
.rail .menu-ico {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; display: inline-grid; place-items: center; font-size: .95rem;
  color: #9fb6c8; background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25); transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.rail .accordion-button:not(.collapsed) .menu-ico { color: var(--rail); background: var(--crate); border-color: var(--crate-deep); box-shadow: 0 2px 0 #8a6700; }
.rail .menu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail .accordion-body { padding: .15rem 0 .55rem; }
.rail .menu-link {
  position: relative; display: block; margin: 1px .5rem 1px 1.55rem; padding: .3rem .6rem .3rem 1.25rem; border: 0; border-radius: 6px;
  color: #a7bac9; font-size: .875rem; line-height: 1.3; transition: background-color .12s ease, color .12s ease;
}
.rail .menu-link::before { content: ""; position: absolute; left: .45rem; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 1px; background: rgba(255, 255, 255, .14); transition: background-color .12s ease, transform .12s ease; }
.rail .menu-link:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.rail .menu-link.active { color: #fff; font-weight: 600; background: rgba(242, 183, 5, .13); box-shadow: inset 3px 0 0 var(--crate); }
.rail .menu-link.active::before { background: var(--crate); transform: scale(1.25); }
.rail .menu-group { padding: .55rem 1rem .15rem 2.95rem; font-size: .75rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--rail-dim); }
.rail .menu-sub { padding: .45rem 1rem .1rem 2.95rem; font-size: .74rem; color: var(--rail-dim); font-style: italic; }
.rail .menu-reports summary { display: flex; align-items: center; gap: .4rem; padding-left: 2.7rem; }
.rail .menu-reports summary::before { border-left-color: var(--rail-dim); }
.rail .menu-reports summary:hover { color: #fff; }
.rail .menu-count { font-family: var(--font-gauge); font-size: .7rem; color: var(--rail-dim); }
@media (max-width: 991.98px) {
  .rail .offcanvas-body { overflow-y: auto; }
  .rail.offcanvas-lg { box-shadow: 0 0 60px rgba(0, 0, 0, .5); }
}

/* ------------------------------------------------------------------ the top bar */
.topbar {
  position: sticky; top: 0; z-index: 1020; height: var(--bar-h); display: flex; align-items: center; gap: .6rem; padding: 0 1.25rem;
  background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 6px 18px -14px rgba(16, 42, 59, .45);
}
.topbar-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); font-size: 1.25rem; box-shadow: 0 2px 0 var(--line);
}
.topbar-btn:active { transform: translateY(2px); box-shadow: none; }
.topbar-mark .brand-mark { width: 30px; height: 30px; filter: none; }
.topbar-mark .brand-mark .bm-slat { fill: rgba(15, 42, 61, .85); }
.topbar-where { align-items: baseline; gap: 0; min-width: 0; font-size: .9rem; }
.topbar-company { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
.topbar-module { color: var(--steel); white-space: nowrap; }
.topbar-module::before { content: "/"; margin: 0 .55rem; color: var(--line-strong); }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.topbar .app-search { position: relative; align-items: center; }
.topbar .app-search .bi { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--steel-2); font-size: .85rem; pointer-events: none; }
.topbar .app-search .form-control {
  width: 330px; height: 38px; padding-left: 2.05rem; padding-right: 2rem; border-radius: 8px; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line); box-shadow: var(--sunk); transition: width .25s var(--ease), background-color .15s ease;
}
.topbar .app-search .form-control::placeholder { color: var(--steel-2); }
.topbar .app-search .form-control:focus { width: 400px; background: #fff; border-color: var(--cold); box-shadow: 0 0 0 3px rgba(13, 91, 140, .16); }
.search-key { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); padding: .05rem .35rem; font-size: .7rem; color: var(--steel); background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 1px 0 var(--line); pointer-events: none; }
.app-search .form-control:focus + .search-key { display: none; }
.topbar .bell-btn {
  position: relative; height: 38px; min-width: 38px; padding: 0 .55rem; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: .98rem; box-shadow: 0 2px 0 var(--line);
  transition: background-color .12s ease, transform .06s ease, box-shadow .06s ease;
}
.topbar .bell-btn:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.topbar .bell-btn:active { transform: translateY(2px); box-shadow: none; }
.topbar .bell-btn.is-quiet { color: var(--steel); }
.topbar .find-btn-text { font-size: .86rem; font-weight: 600; }
.topbar .bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; display: grid; place-items: center;
  background: var(--bad); color: #fff; font: 700 .66rem/1 var(--font); box-shadow: 0 0 0 2px #fff;
}
.user-btn {
  display: inline-flex; align-items: center; gap: .5rem; height: 38px; padding: 0 .55rem 0 .3rem; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-weight: 600; font-size: .88rem; box-shadow: 0 2px 0 var(--line);
}
.user-btn:hover, .user-btn.show { background: var(--panel-2); }
.user-btn:active { transform: translateY(2px); box-shadow: none; }
.user-ini { width: 28px; height: 28px; border-radius: 6px; display: inline-grid; place-items: center; background: var(--rail); color: var(--crate); font: 700 .78rem/1 var(--font-title); letter-spacing: .03em; }
.user-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .company-switch-btn {
  display: inline-flex; align-items: center; gap: .45rem; height: 38px; max-width: 320px; padding: 0 .7rem; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 2px 0 var(--line);
}
.topbar .company-switch-btn:hover, .topbar .company-switch-btn.show { background: var(--panel-2); color: var(--ink); }
.company-switch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-strip, .platform-strip { top: var(--bar-h); }
@media (max-width: 767.98px) {
  .topbar { padding: 0 .75rem; gap: .45rem; }
  .user-name, .topbar .find-btn-text { display: none; }
  .user-btn { padding: 0 .3rem; }
  .topbar .company-switch-btn { max-width: 150px; }
}

/* a thin conveyor along the top while the next page loads (answers a click on a link or a save) */
.nav-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 2000; pointer-events: none; }
.nav-progress span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--crate) 0 18px, #ffd34d 18px 26px); background-size: 52px 100%; box-shadow: 0 0 8px rgba(242, 183, 5, .7); opacity: 0; }
html.is-leaving .nav-progress span { opacity: 1; animation: conveyor-go 8s cubic-bezier(.1, .7, .1, 1) forwards, conveyor-move .5s linear infinite; }
@keyframes conveyor-go { from { width: 0; } 12% { width: 38%; } to { width: 92%; } }
@keyframes conveyor-move { from { background-position: 0 0; } to { background-position: 52px 0; } }

/* ------------------------------------------------------------------ the work area */
.main-area { padding: 1.25rem 1.5rem 2.5rem; min-width: 0; }
.main-bare { padding: 1rem; }
@media (max-width: 575.98px) { .main-area { padding: .85rem .75rem 2rem; } }
/* the page settles in once, when it is opened */
.main-area > .page-bar, .main-area > .page-bar ~ * { animation: settle .38s var(--ease) both; }
.main-area > .page-bar ~ *:nth-child(3) { animation-delay: .04s; }
.main-area > .page-bar ~ *:nth-child(4) { animation-delay: .08s; }
.main-area > .page-bar ~ *:nth-child(5) { animation-delay: .12s; }
.main-area > .page-bar ~ *:nth-child(n+6) { animation-delay: .16s; }
@keyframes settle { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem;
  margin: 0 0 1.1rem; padding: 0 0 .75rem; min-height: 0; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none;
}
.page-bar h1 { font-family: var(--font-title); font-size: 1.6rem; font-weight: 650; line-height: 1.15; letter-spacing: -.01em; margin: 0; color: var(--ink); }
@media (max-width: 575.98px) { .page-bar h1 { font-size: 1.3rem; } }
.page-bar .page-actions { gap: .4rem; }
.page-lead { max-width: 80ch; }

.flash { animation: flash-in .35s var(--ease) both; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ panels */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--lift-1); }
.card > .card-header {
  background: var(--panel-2); border-bottom: 1px solid var(--line); padding: .65rem 1rem; color: var(--ink);
  font-family: var(--font-title); font-weight: 600; font-size: 1.02rem; letter-spacing: 0;
}
.card > .card-footer { background: var(--panel-2); border-top: 1px solid var(--line-soft); border-radius: 0 0 var(--radius) var(--radius); }
.filter-bar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .9rem; box-shadow: var(--lift-1); }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--steel); background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-state .bi { font-size: 2.4rem; color: var(--steel-2); display: block; margin-bottom: .4rem; }
.empty-state p { margin-bottom: .9rem; }
td.empty-row { text-align: center; color: var(--steel); padding: 1.6rem 1rem !important; }
.doc-state { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; font-size: .9rem; color: var(--ink-2); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1rem; }

/* dashboard figures: a strong figure, no decoration */
.kpi { border-left-width: 4px; box-shadow: var(--lift-1); transition: border-color .15s ease; }
.kpi:hover { transform: none; }
.kpi::after { display: none; }
.kpi .small.text-muted { font-size: .82rem; font-weight: 500; }
.kpi .value { font-family: var(--font-title); font-size: 1.85rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin: .15rem 0; color: var(--ink); }

/* ------------------------------------------------------------------ buttons: keys with a lip, pressed when clicked */
.btn { font-weight: 600; border-radius: var(--radius-sm); letter-spacing: .005em; }
.btn-sm { font-size: .84rem; padding: .32rem .7rem; }
.btn-primary {
  --bs-btn-bg: var(--cold); --bs-btn-border-color: var(--cold-deep); --bs-btn-hover-bg: #10679d; --bs-btn-hover-border-color: var(--cold-deep);
  --bs-btn-active-bg: var(--cold-deep); --bs-btn-active-border-color: var(--cold-lip); --bs-btn-disabled-bg: var(--cold); --bs-btn-disabled-border-color: var(--cold-deep);
}
.btn-primary, .btn-success, .btn-danger, .btn-warning, .btn-secondary, .btn-info, .btn-dark {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 60%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 2px 0 rgba(6, 30, 46, .55), 0 6px 12px -8px rgba(6, 30, 46, .6);
}
.btn-success { --bs-btn-bg: var(--ok); --bs-btn-border-color: #0f5c3a; --bs-btn-hover-bg: #1a8657; --bs-btn-hover-border-color: #0f5c3a; --bs-btn-active-bg: #0f5c3a; }
.btn-danger { --bs-btn-bg: var(--bad); --bs-btn-border-color: #962a1f; --bs-btn-hover-bg: #cf4031; --bs-btn-hover-border-color: #962a1f; --bs-btn-active-bg: #962a1f; }
.btn-warning { --bs-btn-bg: var(--crate); --bs-btn-color: var(--ink); --bs-btn-border-color: var(--crate-deep); --bs-btn-hover-bg: #ffc41f; --bs-btn-hover-color: var(--ink); --bs-btn-active-bg: var(--crate-deep); }
.btn-primary:active, .btn-success:active, .btn-danger:active, .btn-warning:active, .btn-secondary:active, .btn-info:active, .btn-dark:active {
  transform: translateY(2px); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .25) !important;
}
[class*="btn-outline-"], .btn-light {
  background-color: #fff; background-image: none; border-color: var(--line-strong);
  box-shadow: 0 2px 0 var(--line), 0 4px 10px -8px rgba(16, 42, 59, .35);
}
[class*="btn-outline-"]:active, .btn-light:active { transform: translateY(2px); box-shadow: none !important; }
.btn-outline-primary { --bs-btn-color: var(--cold); --bs-btn-border-color: #9dbdd3; --bs-btn-hover-bg: var(--cold-tint); --bs-btn-hover-color: var(--cold-deep); --bs-btn-hover-border-color: #7aa6c4; --bs-btn-active-bg: var(--cold-tint); --bs-btn-active-color: var(--cold-deep); }
.btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: var(--panel-2); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #a6b6c2; --bs-btn-active-bg: #e8eef2; --bs-btn-active-color: var(--ink); }
.btn-outline-secondary:hover { background-color: var(--panel-2); }
.btn-outline-success { --bs-btn-color: var(--ok); --bs-btn-border-color: #9ccdb5; --bs-btn-hover-bg: #e3f3eb; --bs-btn-hover-color: #0f5c3a; --bs-btn-hover-border-color: #6db592; }
.btn-outline-danger { --bs-btn-color: var(--bad); --bs-btn-border-color: #e3aaa3; --bs-btn-hover-bg: #fbe9e7; --bs-btn-hover-color: #962a1f; --bs-btn-hover-border-color: #d98b82; }
.btn-outline-primary:hover, .btn-outline-success:hover, .btn-outline-danger:hover { background-image: none; }
.btn-outline-primary:focus-visible:not(:hover) { color: var(--cold-deep); }
.btn-link { color: var(--cold); font-weight: 500; }
.btn:disabled, .btn.disabled { opacity: .5; box-shadow: none !important; }

/* ------------------------------------------------------------------ fields */
.form-label { font-size: .79rem; font-weight: 600; color: var(--ink-2); margin-bottom: .22rem; letter-spacing: 0; }
.form-control, .form-select { border-color: #c6d2db; border-radius: var(--radius-sm); color: var(--ink); box-shadow: var(--sunk); font-feature-settings: "tnum" 1; }
.form-control-sm, .form-select-sm { font-size: .875rem; border-radius: 6px; }
.form-control:hover, .form-select:hover { border-color: #a9bac6; }
.form-control:focus, .form-select:focus { border-color: var(--cold); box-shadow: var(--sunk), 0 0 0 3px rgba(13, 91, 140, .16); }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: #eef3f6; color: var(--ink-2); }
.form-check-input { border-color: #a3b4c1; }
.form-check-input:checked { background-color: var(--cold); border-color: var(--cold-deep); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(13, 91, 140, .18); border-color: var(--cold); }
.form-switch .form-check-input:checked { background-color: var(--cold); }
.input-group-text { background: var(--panel-2); border-color: #c6d2db; color: var(--ink-2); }

/* ------------------------------------------------------------------ tables */
.table { --bs-table-border-color: var(--line-soft); --bs-table-hover-bg: #eef5fa; --bs-table-active-bg: #e3eef6; color: var(--ink); }
.table thead th {
  background: #f1f5f8; color: var(--steel); font-size: .78rem; font-weight: 600; letter-spacing: 0; text-transform: none;
  border-bottom: 1px solid var(--line); box-shadow: none;
}
.table tfoot td, .table tfoot th { background: var(--panel-2); border-top: 2px solid var(--line); font-weight: 600; }
.line-grid > tbody > tr:hover > td { background: #f3f8fb; }
tr.row-new > td { animation: rowNew 1.2s ease-out; }
@keyframes rowNew { from { background: var(--crate-tint); } to { background: transparent; } }
.report-table tr.group-row td { background: #eaf0f4; }
.report-head .title { font-family: var(--font-title); font-size: 1.5rem; }
.bar { background: linear-gradient(180deg, #1b74ad, var(--cold)); }

/* ------------------------------------------------------------------ alerts, tabs, menus, windows */
.alert { background: #fff; color: var(--ink); border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; box-shadow: var(--lift-1); }
.alert-success { border-left-color: var(--ok); }
.alert-danger { border-left-color: var(--bad); }
.alert-warning { border-left-color: var(--crate); background: #fffcf0; }
.alert-info { border-left-color: var(--cold); }
.alert-secondary { border-left-color: var(--steel-2); }
.alert > .bi:first-child { color: inherit; }
.alert-success > .bi:first-child { color: var(--ok); }
.alert-danger > .bi:first-child { color: var(--bad); }
.alert-warning > .bi:first-child { color: var(--warn); }
.nav-tabs .nav-link { color: var(--ink-2); font-weight: 600; }
.nav-tabs .nav-link.active { color: var(--cold-deep); border-bottom-color: var(--crate); }
.dropdown-menu { border-color: var(--line); border-radius: 10px; box-shadow: 0 2px 4px rgba(16, 42, 59, .08), 0 24px 40px -18px rgba(16, 42, 59, .45); animation: drop-in .16s var(--ease); }
@keyframes drop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown-item:hover, .dropdown-item:focus { background: var(--cold-tint); color: var(--ink); }
.modal-content { border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 40px 80px -30px rgba(6, 20, 30, .65), 0 6px 14px rgba(16, 42, 59, .14); }
.modal-header { background: #fff; border-bottom: 1px solid var(--line-soft); }
.modal-title { font-family: var(--font-title); font-size: 1.15rem; font-weight: 650; }
.modal-footer { background: var(--panel-2); border-top: 1px solid var(--line-soft); }
.modal.fade .modal-dialog { transform: translateY(18px) scale(.985); transition: transform .24s var(--ease); }
.modal.show .modal-dialog { transform: none; }
.modal-backdrop.show { opacity: .55; background: #06141e; }

/* status words: plain coloured text with a small square, never a capsule */
.state-text { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .86rem; color: var(--steel); white-space: nowrap; }
.state-text::before { content: ""; width: 7px; height: 7px; border-radius: 1.5px; background: currentColor; }
.state-open { color: var(--cold); }
.state-picking { color: var(--warn); }
.state-received, .state-sold { color: var(--ok); }
.state-sold { color: var(--steel); }
.state-cancelled { color: var(--bad); }
.state-converted { color: #6d4fb3; }

/* the older status labels (badge()) read the same way as the status words: coloured text, a small square, no capsule */
.gs .badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: 0; margin: 0 .15rem; border-radius: 0;
  background: none !important; color: var(--steel) !important; font-size: .8rem; font-weight: 600; line-height: 1.2;
  letter-spacing: 0; vertical-align: baseline; white-space: nowrap;
}
.gs .badge::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 1.5px; background: currentColor; }
.gs .badge.text-bg-success { color: var(--ok) !important; }
.gs .badge.text-bg-danger { color: var(--bad) !important; }
.gs .badge.text-bg-warning { color: var(--warn) !important; }
.gs .badge.text-bg-info, .gs .badge.text-bg-primary { color: var(--cold) !important; }
.gs .badge.text-bg-dark { color: var(--ink) !important; }

/* ------------------------------------------------------------------ the weighing scale: what a crate window or a pick-up adds up to */
.scale-readout {
  display: inline-flex; align-items: baseline; gap: .55rem; padding: .4rem .85rem .35rem; border-radius: 8px;
  background: linear-gradient(180deg, #1e2428, var(--scale-face)); border: 1px solid #070909;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, .75), 0 1px 0 rgba(255, 255, 255, .7);
}
.scale-digits {
  position: relative; font-family: var(--font-gauge); font-size: 1.7rem; line-height: 1; color: var(--scale-digit); letter-spacing: .04em;
  text-shadow: 0 0 8px rgba(255, 182, 39, .45);
}
.scale-unit { color: #b8913f; font-size: .78rem; font-weight: 600; }
.scale-count { color: #8d98a3; font-size: .8rem; font-weight: 500; }
.scale-digits.tick { animation: scale-tick .4s ease-out; }
@keyframes scale-tick { from { color: #fff5d6; text-shadow: 0 0 16px rgba(255, 205, 90, .95); } to { color: var(--scale-digit); } }
.scale-sm .scale-digits { font-size: 1.25rem; }

/* ------------------------------------------------------------------ crates on the transaction lines */
.line-grid .col-crate { width: 1%; white-space: nowrap; }
.crate-btn {
  display: inline-flex; align-items: center; gap: .35rem; height: 31px; padding: 0 .6rem; border-radius: 6px; font-weight: 600; font-size: .82rem;
  color: var(--ink-2); background: #fff; border: 1px solid var(--line-strong); box-shadow: 0 2px 0 var(--line);
}
.crate-btn:hover:not(:disabled) { background: var(--crate-tint); border-color: var(--crate-deep); color: var(--ink); }
.crate-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.crate-btn:disabled { opacity: .35; box-shadow: none; }
.crate-btn .bi { margin: 0; }
.crate-btn.has-crates { background: var(--crate); border-color: var(--crate-deep); color: var(--rail); box-shadow: 0 2px 0 #8a6700; }
.crate-btn.needs-crates { border-color: var(--crate-deep); animation: crate-ask 1.4s ease-in-out 2; }
@keyframes crate-ask { 50% { box-shadow: 0 0 0 4px rgba(242, 183, 5, .35), 0 2px 0 var(--line); } }
.form-control.qty-from-crates { background: var(--crate-tint); border-color: #e6cf7c; font-weight: 600; color: var(--ink); }
.crate-note { color: #7a5d00; margin-top: .15rem; }
.crate-note .bi { color: var(--crate-deep); }
.pos-crates { display: inline-flex; align-items: center; gap: .35rem; margin-top: .25rem; padding: .12rem .45rem; border-radius: 5px; border: 1px solid var(--crate-deep); background: var(--crate-tint); color: #6b5200; font-size: .8rem; font-weight: 600; }
.pos-crates.is-loose { border-color: var(--line-strong); background: #fff; color: var(--steel); font-weight: 500; }

/* the crate window */
.crate-modal .modal-header.crate-head { position: relative; padding-left: 1.35rem; }
.crate-modal .modal-header.crate-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; border-radius: 14px 0 0 0; background: repeating-linear-gradient(180deg, var(--crate) 0 10px, var(--crate-deep) 10px 13px); }
.crate-title { min-width: 0; }
.crate-sub { font-size: .85rem; color: var(--steel); margin-top: .1rem; }
.crate-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .75rem; }
.crate-add { display: inline-flex; gap: .35rem; align-items: center; }
.crate-add input { width: 74px; }
.crate-hint { font-size: .82rem; color: var(--steel); }
.crate-find { width: 200px; }
.crate-need { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin: 0; }
.crate-need input { width: 90px; }
.crate-table thead th { position: sticky; top: 0; z-index: 1; }
.crate-table td { vertical-align: middle; }
.crate-table .crate-seq { color: var(--steel); font-family: var(--font-gauge); width: 3rem; }
.crate-table input[data-c="no"] { width: 96px; font-family: var(--font-gauge); }
.crate-table input[data-c="pcs"] { width: 80px; }
.crate-table input.crate-kg { width: 110px; font-weight: 700; font-size: .95rem; }
.crate-table input[type=date] { width: 150px; }
.crate-table td.num > .form-control { margin-left: auto; }
.crate-pick tbody tr { cursor: pointer; transition: background-color .12s ease; }
.crate-pick tbody tr.is-picked > td { background: var(--crate-tint); }
.crate-pick .crate-take { width: 100px; margin-left: auto; font-weight: 700; }
.crate-pick td.crate-no, .crate-list td.crate-no, td.crate-no { font-family: var(--font-gauge); font-size: .95rem; }
.crate-exp small { display: block; font-size: .72rem; color: var(--steel); }
.crate-exp.is-near, .crate-exp.is-near small { color: var(--warn); }
.crate-exp.is-expired, .crate-exp.is-expired small { color: var(--bad); }
.crate-empty { padding: 2rem 1rem; text-align: center; color: var(--steel); border: 1px dashed var(--line-strong); border-radius: 8px; }
.crate-foot { justify-content: space-between; gap: .75rem; }
.crate-foot-btns { display: flex; gap: .5rem; margin-left: auto; }

/* ------------------------------------------------------------------ Crate Center */
.crate-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.crate-sumtable { max-height: 330px; overflow: auto; }
.crate-sumtable thead th { position: sticky; top: 0; z-index: 1; }
.crate-sumtable .n { font-family: var(--font-title); font-weight: 700; font-size: 1.05rem; }
.crate-sum {
  display: grid; grid-template-columns: 1fr auto; gap: .1rem .75rem; padding: .75rem .9rem; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--lift-1); color: var(--ink); text-decoration: none !important;
  border-top: 3px solid var(--crate); transition: border-color .15s ease, background-color .15s ease;
}
.crate-sum:hover { background: #fffdf4; border-color: var(--crate-deep); color: var(--ink); }
.crate-sum-name { grid-column: 1 / -1; font-size: .9rem; line-height: 1.3; }
.crate-sum-site { grid-column: 1 / -1; font-size: .78rem; color: var(--steel); margin-bottom: .35rem; }
.crate-sum-fig { font-size: .82rem; color: var(--steel); }
.crate-sum-fig .n { font-family: var(--font-title); font-size: 1.45rem; font-weight: 700; color: var(--ink); margin-right: .15rem; }
.crate-sum-exp { grid-column: 1 / -1; font-size: .76rem; color: var(--steel); margin-top: .2rem; }
.left-bar { display: inline-block; min-width: 4.5rem; padding: .05rem .35rem; border-radius: 4px; text-align: right;
  background: linear-gradient(90deg, rgba(242, 183, 5, .28) var(--pct), transparent var(--pct)); box-shadow: inset 0 0 0 1px var(--line-soft); }
td.exp-near { color: var(--warn); font-weight: 600; }
td.exp-past { color: var(--bad); font-weight: 600; }

/* one crate: its tag and its facts */
.crate-sheet { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 767.98px) { .crate-sheet { grid-template-columns: 1fr; } }
.crate-tag {
  position: relative; padding: 1.1rem 1rem 1rem; border-radius: 12px; color: var(--rail); overflow: hidden;
  background: repeating-linear-gradient(180deg, var(--crate) 0 22px, #e0a900 22px 26px);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12), 0 3px 0 #8a6700, 0 18px 30px -18px rgba(16, 42, 59, .6);
}
.crate-tag-no { font-family: var(--font-gauge); font-size: 3rem; line-height: 1; letter-spacing: .03em; background: rgba(255, 255, 255, .55); display: inline-block; padding: .2rem .55rem; border-radius: 6px; }
.crate-tag-item { margin-top: .7rem; font-size: .88rem; background: rgba(255, 255, 255, .7); padding: .35rem .5rem; border-radius: 6px; line-height: 1.3; }
.crate-fill { position: absolute; right: .8rem; top: .9rem; bottom: .9rem; width: 10px; border-radius: 5px; background: rgba(15, 42, 61, .25); display: flex; align-items: flex-end; overflow: hidden; }
.crate-fill span { display: block; width: 100%; background: var(--rail); border-radius: 5px; }
.crate-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem 1.25rem; margin: 0; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift-1); }
.crate-facts dt { font-size: .76rem; font-weight: 600; color: var(--steel); }
.crate-facts dd { margin: 0; font-size: .95rem; }
.crate-facts dd.fig { font-family: var(--font-title); font-size: 1.25rem; font-weight: 700; }
tr.move-receive td:nth-child(2) { color: var(--ok); }
tr.move-convert td:nth-child(2) { color: #6d4fb3; }

/* ------------------------------------------------------------------ Supplier Allocation and Pick-Up */
.alloc-grid tbody tr.is-used > td { background: #f2f8fc; }
.alloc-grid .al-desc { color: var(--ink-2); }
.alloc-list tr.status-cancelled td { color: var(--steel); }
.pickup-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.25rem; padding: .65rem .85rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift-1); }
.day-step { display: inline-flex; align-items: center; gap: .3rem; }
.day-step input[type=date] { width: 160px; font-weight: 600; }
.pickup-date-text { margin-left: auto; font-family: var(--font-title); font-weight: 600; font-size: 1.05rem; color: var(--ink-2); }
.pickup-list { display: flex; flex-direction: column; gap: .7rem; }
.pickup-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift-1); overflow: hidden; }
.pickup-card.is-open { border-color: #a9c3d6; box-shadow: var(--lift-2); }
.pickup-card.status-received { border-left: 4px solid var(--ok); }
.pickup-card.status-picking { border-left: 4px solid var(--crate); }
.pickup-card.status-open { border-left: 4px solid var(--cold); }
.pickup-toggle {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.6fr) minmax(170px, 1fr) auto auto; align-items: center; gap: .5rem 1rem;
  padding: .8rem 1rem; border: 0; background: none; text-align: left; color: var(--ink);
}
.pickup-toggle:hover { background: var(--panel-2); }
.pickup-supplier { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.pickup-supplier strong { font-family: var(--font-title); font-size: 1.12rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pickup-sid { font-family: var(--font-gauge); font-size: .8rem; color: var(--crate); background: var(--rail); padding: .15rem .4rem; border-radius: 4px; }
.pickup-meta { display: flex; flex-wrap: wrap; gap: .1rem .9rem; font-size: .85rem; color: var(--ink-2); }
.pickup-meta .bi { color: var(--steel-2); }
.pickup-progress { display: flex; flex-direction: column; gap: .25rem; font-size: .78rem; color: var(--steel); }
.pickup-meter { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; box-shadow: var(--sunk); }
.pickup-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--cold), #1b78b4); border-radius: 3px; transition: width .4s var(--ease); }
.status-received .pickup-meter span { background: var(--ok); }
.pickup-chev { color: var(--steel); transition: transform .2s var(--ease); }
.pickup-card.is-open .pickup-chev { transform: rotate(180deg); }
.pickup-body { border-top: 1px solid var(--line-soft); }
.pickup-body:not([hidden]) { animation: unfold .26s var(--ease); }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pickup-items tr.is-done > td { background: #f1f9f5; }
.pickup-items .pk-qty { display: inline-flex; gap: .35rem; }
.pickup-items .pk-qty input { width: 100px; }
.pickup-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .75rem 1rem; background: var(--panel-2); border-top: 1px solid var(--line-soft); }
.pickup-foot form { margin: 0; }
.pk-complete { display: inline-flex; gap: .35rem; align-items: center; }
.pk-complete input[type=date] { width: 150px; }
@media (max-width: 991.98px) {
  .pickup-toggle { grid-template-columns: 1fr auto; }
  .pickup-meta, .pickup-progress { grid-column: 1 / -1; }
  .pickup-chev { grid-row: 1; grid-column: 2; }
  .pickup-toggle > .state-text { grid-column: 1; }
}

/* a pick-up on a phone: each item is a small block (code and done mark, description, the figures, the button) */
@media (max-width: 767.98px) {
  .pickup-items, .pickup-items > tbody { display: block; }
  .pickup-items > thead { display: none; }
  .pickup-items > tbody > tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .15rem .5rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line-soft); }
  .pickup-items > tbody > tr > td { display: block; border: 0; padding: 0 !important; background: none !important; text-align: left !important; }
  .pickup-items > tbody > tr > td:nth-child(1) { grid-column: 1 / 4; font-size: 1rem; }
  .pickup-items > tbody > tr > td:nth-child(7) { grid-column: 4; grid-row: 1; text-align: right !important; font-size: 1.1rem; }
  .pickup-items > tbody > tr > td:nth-child(2) { grid-column: 1 / -1; color: var(--ink-2); margin-bottom: .3rem; }
  .pickup-items > tbody > tr > td[data-label] { font-size: .86rem; font-weight: 600; }
  .pickup-items > tbody > tr > td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 500; color: var(--steel); }
  .pickup-items > tbody > tr > td:nth-child(8) { grid-column: 1 / -1; margin-top: .45rem; }
  .pickup-items > tbody > tr > td:nth-child(8) .btn { width: 100%; }
  .pickup-items .pk-qty { display: flex; }
  .pickup-items .pk-qty input { flex: 1 1 auto; width: auto; }
  .pickup-items > tbody > tr.is-done { background: #f1f9f5; }
  .pickup-foot .scale-readout { width: 100%; justify-content: center; }
  .pk-complete { width: 100%; }
  .pk-complete input[type=date] { flex: 1 1 auto; }
}

/* U/M sets: the crate unit */
#umTable tr.um-variable > td { background: var(--crate-tint); }

/* ------------------------------------------------------------------ the dashboard's distribution panel */
.dist-today { display: grid; gap: .5rem; }
.dist-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .75rem; padding: .55rem .2rem; border-bottom: 1px solid var(--line-soft); }
.dist-row:last-child { border-bottom: 0; }
.dist-row .sub { grid-column: 1 / -1; font-size: .8rem; color: var(--steel); }

/* ------------------------------------------------------------------ log in, join and set password pages */
body.login-page { min-height: 100vh; background: var(--frost); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); }
.login-art {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 2.2rem 2.4rem; color: var(--rail-text);
  background-color: var(--rail);
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 28px), radial-gradient(900px 500px at 70% 110%, #1a4566 0%, transparent 60%);
}
.login-art .rail-logo .brand-mark { width: 44px; height: 44px; flex-basis: 44px; }
.login-art .rail-name strong { font-size: 1.5rem; }
.login-stage { position: relative; align-self: center; width: min(460px, 100%); margin: 1rem 0; }
.login-stage svg { width: 100%; height: auto; display: block; overflow: visible; }
.login-stage .crate-drop { animation: crate-drop .7s cubic-bezier(.3, 1.4, .5, 1) both; transform-box: fill-box; transform-origin: 50% 100%; }
.login-stage .d1 { animation-delay: .15s; }
.login-stage .d2 { animation-delay: .45s; }
.login-stage .d3 { animation-delay: .75s; }
.login-stage .d4 { animation-delay: 1.05s; }
@keyframes crate-drop { 0% { opacity: 0; transform: translateY(-120px); } 60% { opacity: 1; } 80% { transform: translateY(4px) scaleY(.97); } 100% { opacity: 1; transform: none; } }
.login-scale { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); }
.login-scale .scale-digits { font-size: 2rem; min-width: 7ch; text-align: right; display: inline-block; }
.login-company { font-size: .88rem; color: var(--rail-dim); }
.login-company strong { display: block; color: #fff; font-family: var(--font-title); font-weight: 600; font-size: 1.1rem; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; }
.login-form { width: min(380px, 100%); }
.login-form h1 { font-family: var(--font-title); font-weight: 700; font-size: 1.9rem; margin-bottom: .25rem; }
.login-form .lead-line { color: var(--steel); margin-bottom: 1.5rem; }
.login-form .form-control { height: 46px; font-size: 1rem; }
.login-form .btn-primary { height: 46px; font-size: 1rem; }
.login-form .pw-wrap { position: relative; }
.login-form .pw-eye { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--steel); padding: .35rem .5rem; border-radius: 6px; }
.login-form .pw-eye:hover { color: var(--ink); background: var(--panel-2); }
.login-foot { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--steel); display: flex; flex-wrap: wrap; gap: .4rem 1rem; justify-content: space-between; }
.login-mobile-brand { display: none; }
@media (max-width: 899.98px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-mobile-brand { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.6rem; }
  .login-mobile-brand .brand-mark { width: 40px; height: 40px; }
  .login-mobile-brand strong { font-family: var(--font-title); font-size: 1.3rem; font-weight: 700; color: var(--ink); display: block; line-height: 1.05; }
  .login-mobile-brand span { font-size: .8rem; color: var(--steel); }
  .login-side { align-items: flex-start; padding-top: 12vh; }
}
.register-card { width: min(620px, 100%); }

/* ------------------------------------------------------------------ the platform (Super Admin) pages use the same frame */
body.platform .rail .platform-link { display: flex; align-items: center; gap: .55rem; margin-left: .5rem; padding-left: .7rem; }
body.platform .rail .platform-link::before { display: none; }
body.platform .rail .platform-link .bi { color: var(--rail-dim); }
body.platform .rail .platform-link.active .bi { color: var(--crate); }
body.platform .rail .menu-group { padding-left: 1.2rem; }

/* ------------------------------------------------------------------ the POS on a phone on its side */
@media (max-height: 560px) and (orientation: landscape) {
  body.entry-focus .topbar { position: static; }
}

/* ------------------------------------------------------------------ printing: the page only */
@media print {
  .app-frame { display: block; }
  .rail, .topbar, .nav-progress { display: none !important; }
  .main-area { padding: 0; }
  .main-area > * { animation: none !important; }
  body.gs { background: #fff; }
}

/* ------------------------------------------------------------------ less motion when the device asks for it */
@media (prefers-reduced-motion: reduce) {
  .main-area > .page-bar, .main-area > .page-bar ~ *, .flash, .dropdown-menu, .pickup-body:not([hidden]), .login-stage .crate-drop, .scale-digits.tick, .crate-btn.needs-crates { animation: none !important; }
  .modal.fade .modal-dialog { transition: none; }
  html.is-leaving .nav-progress span { animation: none; width: 60%; }
}

/* ------------------------------------------------------------------ the User's Manual and the signing page keep their own bars, in the theme's colours */
.navbar.app-bar { background: var(--rail) !important; box-shadow: 0 6px 18px -12px rgba(5, 18, 28, .7); }
.navbar.app-bar .brand-mark { width: 30px; height: 30px; flex-basis: 30px; margin-right: .5rem; }
.brand-tile { background: var(--crate); color: var(--rail); box-shadow: 0 2px 0 #8a6700; }
body.login-page .join-side { min-height: 100vh; }

/* small group headings read as plain sentence-case labels, not tracked capitals */
.gs .menu-group, .gs .find-col-head, .gs .rd-sub, .gs .rc-group-name, .gs .cm-role, .gs .cm-side-head,
.gs .cm-info-head, .gs .cm-info-title, .gs .cm-set-title, .gs .iq-similar-head {
  text-transform: none; letter-spacing: 0;
}
.gs .menu-group, .gs .find-col-head, .gs .rd-sub, .gs .rc-group-name, .gs .cm-side-head, .gs .cm-info-head, .gs .cm-info-title, .gs .iq-similar-head { font-size: .8rem; }
