/* ==========================================================================
   Wholesale In Motion — VENDOR PORTAL bundle (css/vendor.css)
   The one stylesheet for every page in vendor/: login, register, dashboard, orders, invoices, invoice,
   stock, upload, account, password. Loads AFTER assets/bootstrap/bootstrap.min.css (Bootstrap 5.3.8).
   Public pages load css/site.css instead.
   Fonts: Big Shoulders (display) + Archivo (body) from Google Fonts, linked in each page <head>.
   Icons: inline SVG sprite at the top of each portal page (#i-home, #i-orders, #i-invoice ...), no icon library.

   How Bootstrap is used: the grid (.row, .col-*, row-cols-*), utilities, and the components .navbar,
   .offcanvas (responsive sidebar), .nav, .btn, .badge, .card, .table, .list-group, .progress, .collapse
   (order details), .form-control, .form-select, .form-check, .invalid-feedback. Re-themed through --bs-*
   variables; no Sass build.

   PART 1  Theme + base: tokens, Bootstrap variable mapping, reset, type, buttons, badges, wordmark.
           Identical to the top of css/site.css; if you change a token there, change it here too.
   PART 2  Form system: Bootstrap form controls re-themed + .field, .form-grid, .pw, .form__actions.
   PART 3  Portal shell and components: top bar, sidebar (offcanvas below lg), page head, cards, stats,
           tables, toolbar, save bar, orders, invoices, upload, login/register, print.

   Breakpoints are Bootstrap's: sm 576, md 768, lg 992, xl 1200.
   ========================================================================== */



/* ==========================================================================
   PART 1: Theme + base (shared with css/site.css)
   ========================================================================== */

:root {
  /* Color */
  --bg: #ffffff;            --bg: oklch(1 0 0);
  --surface: #eef5f3;       --surface: oklch(0.965 0.008 175);
  --ink: #0a1c19;           --ink: oklch(0.21 0.025 180);
  --muted: #49615b;         --muted: oklch(0.47 0.03 180);
  --line: #d0dad7;          --line: oklch(0.88 0.012 175);
  --teal: #005d47;          --teal: oklch(0.42 0.095 172);
  --teal-deep: #003c2d;     --teal-deep: oklch(0.31 0.075 174);
  --teal-ink: #00271e;      --teal-ink: oklch(0.24 0.055 176);
  --teal-bright: #37be95;   --teal-bright: oklch(0.72 0.13 168);
  --teal-mist: #d5efe5;     --teal-mist: oklch(0.93 0.03 172);
  --yellow: #ffd828;        --yellow: oklch(0.89 0.175 95);
  --yellow-deep: #efb300;   --yellow-deep: oklch(0.80 0.17 85);
  --on-teal-muted: #bbd5cb; --on-teal-muted: oklch(0.85 0.03 172);
  --danger: #b3261e;
  --danger-tint: #fdecec;
  --white-12: rgba(255, 255, 255, 0.12);
  --white-20: rgba(255, 255, 255, 0.2);
  --white-35: rgba(255, 255, 255, 0.35);

  /* Type */
  --font-display: "Big Shoulders", "Archivo Narrow", Impact, sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --text-body: 1.0625rem;
  --text-small: 0.875rem;
  --text-label: 0.8125rem;

  /* Layout */
  --wrap: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section: clamp(5rem, 9vw, 8rem);
  --radius-control: 4px;
  --radius-panel: 8px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-std: cubic-bezier(0.2, 0, 0, 1);
  --t-hover: 0.2s;

  /* ---- Bootstrap theme mapping (the --bs-* variables Bootstrap's components read) ---- */
  --bs-body-font-family: var(--font-body);
  --bs-body-font-size: var(--text-body);
  --bs-body-line-height: 1.6;
  --bs-body-color: var(--ink);
  --bs-body-color-rgb: 10, 28, 25;
  --bs-body-bg: #ffffff;
  --bs-body-bg-rgb: 255, 255, 255;
  --bs-emphasis-color: var(--ink);
  --bs-emphasis-color-rgb: 10, 28, 25;
  --bs-secondary-color: var(--muted);
  --bs-secondary-bg: var(--surface);
  --bs-tertiary-bg: var(--surface);
  --bs-heading-color: inherit;
  --bs-link-color: var(--teal);
  --bs-link-color-rgb: 0, 93, 71;
  --bs-link-hover-color: var(--teal-deep);
  --bs-link-hover-color-rgb: 0, 60, 45;
  --bs-primary: #005d47;
  --bs-primary-rgb: 0, 93, 71;
  --bs-warning: #ffd828;
  --bs-warning-rgb: 255, 216, 40;
  --bs-success: #37be95;
  --bs-success-rgb: 55, 190, 149;
  --bs-danger: #b3261e;
  --bs-danger-rgb: 179, 38, 30;
  --bs-border-width: 1px;
  --bs-border-color: var(--line);
  --bs-border-color-translucent: var(--line);
  --bs-border-radius: var(--radius-control);
  --bs-border-radius-sm: var(--radius-control);
  --bs-border-radius-lg: var(--radius-panel);
  --bs-border-radius-xl: var(--radius-panel);
  --bs-highlight-bg: var(--yellow);
  --bs-highlight-color: var(--teal-ink);
  --bs-form-invalid-color: var(--danger);
  --bs-form-invalid-border-color: var(--danger);
  --bs-focus-ring-color: var(--teal-mist);
}

/* ---------- Reset: restore the element defaults the design was drawn with (Bootstrap's Reboot changes them) ---------- */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; line-height: inherit; text-wrap: balance; }
h1 { font-size: 2em; } h2 { font-size: 1.5em; } h3 { font-size: 1.17em; } h4 { font-size: 1em; } h5 { font-size: 0.83em; } h6 { font-size: 0.67em; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd, address, figure { margin: 0; }
dt { font-weight: inherit; }
a { color: inherit; }
b, strong { font-weight: 600; }
small { font-size: smaller; }
legend { float: none; width: auto; margin: 0; font-size: inherit; }
::selection { background: var(--yellow); color: var(--teal-ink); }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 2px; }
.btn:focus-visible, .nav-link:focus-visible, .navbar-toggler:focus-visible, .accordion-button:focus-visible, .form-check-input:focus-visible {
  outline: 2px solid var(--teal); outline-offset: 3px; box-shadow: none;
}
.on-dark :focus-visible, .hero :focus-visible, .dash :focus-visible, .cta :focus-visible,
.site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--yellow); }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 1031;
  background: var(--yellow); color: var(--teal-ink); padding: 0.6rem 1rem;
  font-weight: 600; border-radius: var(--radius-control); text-decoration: none;
  transition: top 0.2s var(--ease-std);
}
.skip-link:focus { top: 1rem; }

/* Container: the design's 1240px measure with a fluid gutter, instead of Bootstrap's stepped max-widths */
.container { --bs-gutter-x: calc(2 * var(--gutter)); max-width: calc(var(--wrap) + 2 * var(--gutter)); }

/* ---------- Type system ---------- */
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 4.2vw, 3.5rem);
  line-height: 0.95;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  max-width: 16ch;
  color: var(--ink);
}
.section-title--light { color: #fff; }
.section-title--wide { max-width: 24ch; }
.section-lede {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 56ch;
}
.section-lede--light { color: var(--on-teal-muted); }

/* ---------- Buttons (Bootstrap .btn, re-themed) ----------
   btn-warning = yellow accent, btn-primary = teal, btn-outline-light = ghost on teal, btn-outline-primary = line on white */
.btn {
  --bs-btn-padding-x: 1.25rem; --bs-btn-padding-y: 0.8rem;
  --bs-btn-font-size: 0.9375rem; --bs-btn-font-weight: 600; --bs-btn-line-height: 1.2;
  --bs-btn-border-width: 1px; --bs-btn-border-radius: var(--radius-control);
  --bs-btn-box-shadow: none; --bs-btn-focus-box-shadow: none; --bs-btn-active-shadow: none; --bs-btn-disabled-opacity: 0.5;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  white-space: nowrap; border-radius: var(--bs-btn-border-radius);
  transition: background-color var(--t-hover) var(--ease-std), border-color var(--t-hover) var(--ease-std),
              color var(--t-hover) var(--ease-std), transform var(--t-hover) var(--ease-std);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { color: var(--bs-btn-color); background-color: var(--bs-btn-bg); border-color: var(--bs-btn-border-color); }
.btn:disabled, .btn.disabled { transform: none; }
.btn-warning {
  --bs-btn-color: var(--teal-ink); --bs-btn-bg: var(--yellow); --bs-btn-border-color: transparent;
  --bs-btn-hover-color: var(--teal-ink); --bs-btn-hover-bg: var(--yellow-deep); --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: var(--teal-ink); --bs-btn-active-bg: var(--yellow-deep); --bs-btn-active-border-color: transparent;
  --bs-btn-disabled-color: var(--teal-ink); --bs-btn-disabled-bg: var(--yellow); --bs-btn-disabled-border-color: transparent;
}
.btn-primary {
  --bs-btn-color: #fff; --bs-btn-bg: var(--teal); --bs-btn-border-color: transparent;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--teal-deep); --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--teal-deep); --bs-btn-active-border-color: transparent;
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--teal); --bs-btn-disabled-border-color: transparent;
}
.btn-outline-light {
  --bs-btn-color: #fff; --bs-btn-bg: transparent; --bs-btn-border-color: var(--white-35);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: rgba(255, 255, 255, 0.06); --bs-btn-hover-border-color: #fff;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: rgba(255, 255, 255, 0.06); --bs-btn-active-border-color: #fff;
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: transparent; --bs-btn-disabled-border-color: var(--white-35);
}
.btn-outline-primary {
  --bs-btn-color: var(--teal); --bs-btn-bg: #fff; --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--teal); --bs-btn-hover-bg: var(--teal-mist); --bs-btn-hover-border-color: var(--teal);
  --bs-btn-active-color: var(--teal); --bs-btn-active-bg: var(--teal-mist); --bs-btn-active-border-color: var(--teal);
  --bs-btn-disabled-color: var(--teal); --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: var(--line);
}
.btn-lg { --bs-btn-padding-y: 1rem; --bs-btn-padding-x: 1.5rem; --bs-btn-font-size: 1rem; --bs-btn-border-radius: var(--radius-control); }
.btn-sm { --bs-btn-padding-y: 0.5rem; --bs-btn-padding-x: 0.8rem; --bs-btn-font-size: 0.8125rem; --bs-btn-border-radius: var(--radius-control); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-weight: 600; text-decoration: none; color: var(--teal);
  padding-bottom: 2px;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0% 1.5px;
  transition: background-size 0.3s var(--ease-out);
}
.link-arrow::after { content: "\2192"; transition: transform 0.3s var(--ease-out); }
.link-arrow:hover { background-size: 100% 1.5px; }
.link-arrow:hover::after { transform: translateX(4px); }
.hero .link-arrow { color: #fff; }

/* ---------- Badges (Bootstrap .badge.rounded-pill + one status class) ---------- */
.badge {
  --bs-badge-padding-x: 0.6rem; --bs-badge-padding-y: 0.22rem;
  --bs-badge-font-size: 0.75rem; --bs-badge-font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.35rem;
  line-height: 1.2; letter-spacing: 0.01em; text-align: left; vertical-align: baseline;
}
.badge-new { background: var(--yellow); color: var(--teal-ink); }
.badge-fulfilling { background: transparent; color: #fff; border: 1px solid var(--white-35); }
.badge-paid { background: var(--teal-bright); color: var(--teal-ink); }
.badge-teal { background: var(--teal-mist); color: var(--teal); }
.mock .badge-fulfilling { color: var(--teal); border-color: var(--teal); }

.wordmark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: inherit;
}
.wordmark__mark {
  font-family: var(--font-display); font-weight: 800; font-size: 2.1rem; line-height: 1;
  letter-spacing: 0.01em;
}
.wordmark__name {
  font-family: var(--font-display); font-weight: 600; font-size: 0.8rem; line-height: 1.05;
  letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85;
}

@media (max-width: 575.98px) {
  .wordmark__name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .link-arrow, .link-arrow::after, .nav-link { transition: none !important; }
  .btn:hover { transform: none; }
}


/* ==========================================================================
   PART 2: Form system (Bootstrap form controls, re-themed)
   Markup: <div class="row form-grid"> <div class="col-md-6 field"> <label class="form-label"> <input class="form-control">
           <div class="invalid-feedback"> ... Validation lives in js/vendor.js (form[data-validate]).
   ========================================================================== */

.muted { color: var(--muted); }
.text-label { font-size: var(--text-label); }

.form { max-width: 760px; }
.form--narrow { max-width: 480px; }
.form__req { font-size: 0.8125rem; color: var(--muted); }
.form-grid { --bs-gutter-x: 1.5rem; --bs-gutter-y: 1.25rem; }
.field { display: grid; gap: 0.4rem; min-width: 0; align-content: start; }
fieldset.field { border: 0; min-width: 0; }
.form-label, .field__legend { margin-bottom: 0; font-size: var(--text-label); font-weight: 600; color: var(--ink); }
.field__legend { padding: 0; margin-bottom: 0.25rem; }
.req { color: var(--danger); font-weight: 700; }
.form-control, .form-select {
  padding: 0.7rem 0.85rem;
  font-size: 0.9375rem; line-height: 1.4; color: var(--ink);
  background-color: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-control);
  transition: border-color var(--t-hover) var(--ease-std), background-color var(--t-hover) var(--ease-std), box-shadow var(--t-hover) var(--ease-std);
}
.form-control::placeholder { color: var(--muted); opacity: 0.75; }
.form-control:hover, .form-select:hover { border-color: var(--muted); }
.form-control:focus, .form-select:focus { color: var(--ink); border-color: var(--teal); background-color: #fff; box-shadow: 0 0 0 3px var(--teal-mist); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); }
.form-control.is-invalid, textarea.form-control.is-invalid { padding-right: 0.85rem; background-image: none; }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-tint); }
.form-select {
  --bs-form-select-bg-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2349615b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  padding-right: 2.4rem; cursor: pointer;
  background-position: right 0.8rem center; background-size: 0.8rem;
}
.form-select.is-invalid:not([multiple]):not([size]) { --bs-form-select-bg-icon: none; padding-right: 2.4rem; background-position: right 0.8rem center; background-size: 0.8rem; }
textarea.form-control { min-height: 7rem; resize: vertical; }
.form-control-sm, .form-select-sm { padding: 0.4rem 0.75rem; font-size: var(--text-small); height: 2rem; min-height: unset; }
.form-select-sm { padding-right: 2.25rem; }
.form-text { margin-top: 0; font-size: 0.8125rem; color: var(--muted); }
.invalid-feedback { margin-top: 0; font-size: 0.8125rem; font-weight: 500; color: var(--danger); }
.field.is-invalid .invalid-feedback { display: block; }
.form__actions { gap: 0.75rem 1.25rem; margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.form__note { font-size: 0.8125rem; color: var(--muted); }
.form__msg { flex-basis: 100%; min-height: 1.4em; margin: 0; font-size: var(--text-small); font-weight: 500; color: var(--teal); }
.form__msg.is-error { color: var(--danger); }
.pw { position: relative; }
.pw .form-control { padding-right: 4.5rem; }
.pw__toggle {
  position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%);
  padding: 0.3rem 0.55rem; border: 0; border-radius: 3px; background: transparent;
  font-size: 0.75rem; font-weight: 600; color: var(--teal); cursor: pointer;
}
.pw__toggle:hover { background: var(--teal-mist); }

/* Checkboxes: Bootstrap .form-check markup, native (accent-coloured) boxes as in the approved design */
.form-check { display: flex; align-items: center; gap: 0.5rem; min-height: 0; padding-left: 0; margin-bottom: 0; font-size: 0.9rem; cursor: pointer; }
.form-check .form-check-input { float: none; flex: none; width: 1rem; height: 1rem; margin: 0; appearance: auto; -webkit-appearance: auto; accent-color: var(--teal); border: 0; background: none; }
.form-check-input:focus { box-shadow: none; }
.form-check-label { cursor: pointer; }
.form-check-input.is-invalid ~ .form-check-label { color: inherit; }
.form-check--wrap { align-items: flex-start; }
.form-check--wrap .form-check-input { margin-top: 0.25rem; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem 1rem; }

.form-control[type="file"] { padding: 0.55rem 0.85rem; cursor: pointer; }
.form-control::file-selector-button {
  margin: 0 0.75rem 0 0; padding: 0.35rem 0.7rem; border: 1px solid var(--line); border-radius: 3px;
  background-color: #fff; color: var(--teal); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; pointer-events: auto;
}
.form-control:hover:not(:disabled):not([readonly])::file-selector-button { background-color: #fff; }

@media (max-width: 767.98px) {
  .checks { grid-template-columns: 1fr; }
}


/* ==========================================================================
   PART 3: Portal shell and components
   ========================================================================== */

:root {
  --side-w: 15.5rem;
  --top-h: 3.75rem;
}

.portal-body { background: var(--surface); }
.portal-top :focus-visible, .portal-side :focus-visible, .savebar :focus-visible, .auth :focus-visible { outline-color: var(--yellow); }

/* ---------- Shell: .portal (flex column) > .portal-top (navbar.sticky-top) + .portal-shell (flex) > .portal-side + .portal-main ---------- */
.portal-top {
  --bs-navbar-padding-x: clamp(1rem, 2.5vw, 1.5rem); --bs-navbar-padding-y: 0;
  --bs-navbar-brand-padding-y: 0; --bs-navbar-brand-margin-end: 0; --bs-navbar-brand-font-size: inherit;
  --bs-navbar-brand-color: #fff; --bs-navbar-brand-hover-color: #fff;
  --bs-navbar-toggler-padding-x: 0; --bs-navbar-toggler-padding-y: 0; --bs-navbar-toggler-border-color: transparent;
  --bs-navbar-toggler-border-radius: var(--radius-control); --bs-navbar-toggler-focus-width: 0;
  flex-wrap: nowrap; justify-content: flex-start; gap: 1rem;
  height: var(--top-h);
  background: var(--teal-ink); color: #fff;
  border-bottom: 1px solid var(--white-12);
}
.portal-top .wordmark__mark { font-size: 1.8rem; }
.portal-top__company {
  display: grid; line-height: 1.15;
  margin-left: 0.25rem; padding-left: 1.25rem; border-left: 1px solid var(--white-20);
  font-weight: 600; font-size: 0.9375rem; white-space: nowrap;
}
.portal-top__company small { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--on-teal-muted); }
.portal-top__bell {
  position: relative; display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem; border-radius: var(--radius-control);
  color: var(--on-teal-muted); text-decoration: none;
  transition: color var(--t-hover) var(--ease-std), background-color var(--t-hover) var(--ease-std);
}
.portal-top__bell:hover { color: #fff; background: var(--white-12); }
.portal-top__bell svg { width: 1.25rem; height: 1.25rem; }
.portal-top__badge {
  position: absolute; top: 0.3rem; right: 0.3rem;
  min-width: 1.05rem; height: 1.05rem; padding: 0 0.3rem; border-radius: 999px;
  background: var(--yellow); color: var(--teal-ink);
  font-size: 0.68rem; font-weight: 700; line-height: 1.05rem; text-align: center;
}
.portal-toggle {
  flex: none; display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem; border: 0;
  color: #fff;
}
.portal-toggle svg { width: 1.4rem; height: 1.4rem; }
.portal-toggle:hover { background: var(--white-12); }

/* Sidebar: static column from lg, Bootstrap offcanvas drawer below lg (offcanvas-lg) */
.portal-side {
  --bs-offcanvas-width: min(18rem, 85vw);
  --bs-offcanvas-bg: var(--teal-deep); --bs-offcanvas-color: #fff;
  --bs-offcanvas-border-width: 0; --bs-offcanvas-padding-x: 0; --bs-offcanvas-padding-y: 0;
  --bs-offcanvas-transition: transform 0.3s var(--ease-out);
  background-color: var(--teal-deep) !important; /* offcanvas-lg forces transparent from lg */
  color: #fff;
  overflow-y: auto;
  padding: 1rem 0 1.25rem;
}
.portal-side.offcanvas-start { top: var(--top-h); bottom: auto; max-height: calc(100vh - var(--top-h)); } /* the drawer hugs its content, as designed */
.portal-side .offcanvas-body { display: flex; flex-direction: column; flex-grow: 1; padding: 0; overflow: visible; background-color: transparent !important; }
.portal-nav .nav-link {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.75rem 1.25rem 0.75rem calc(1.25rem - 3px);
  border-left: 3px solid transparent;
  color: var(--on-teal-muted); font-weight: 500; font-size: 0.9375rem;
  transition: color var(--t-hover) var(--ease-std), background-color var(--t-hover) var(--ease-std);
}
.portal-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.portal-nav .nav-link.active { color: #fff; background: rgba(255, 255, 255, 0.09); border-left-color: var(--yellow); font-weight: 600; }
.portal-nav svg { flex: none; width: 1.2rem; height: 1.2rem; }
.icon { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.portal-side__foot { margin-top: auto; padding: 1.5rem 1.25rem 0; font-size: 0.8125rem; color: var(--on-teal-muted); border-top: 1px solid var(--white-12); }
.portal-side__foot a { display: block; margin-top: 0.2rem; color: #fff; font-weight: 600; text-decoration: none; }
.portal-side__foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
.offcanvas-backdrop { top: var(--top-h); height: auto; bottom: 0; background-color: var(--teal-ink); }
.offcanvas-backdrop.show { opacity: 0.55; }

.portal { min-height: 100vh; }
.portal-main { min-width: 0; padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 4vw, 3rem) 5rem; }
.portal-main > * + * { margin-top: 1.25rem; }
.portal-main > * + .row { margin-top: calc(1.25rem - var(--bs-gutter-y)); } /* rows carry a negative gutter margin */
.portal-inner { max-width: 1100px; }

/* ---------- Page header ---------- */
.page-head { gap: 1rem 2rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.page-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 3.5vw, 2.75rem); line-height: 0.95; letter-spacing: 0.01em; text-transform: uppercase;
}
.page-lede { margin-top: 0.6rem; max-width: 66ch; font-size: 0.9375rem; color: var(--muted); }
.page-head__actions { gap: 0.5rem; }

/* ---------- Cards (Bootstrap .card / .card-header / .card-title / .card-body, re-themed) ---------- */
.card {
  --bs-card-bg: #fff; --bs-card-border-color: var(--line);
  --bs-card-border-radius: var(--radius-panel); --bs-card-inner-border-radius: calc(var(--radius-panel) - 1px);
  --bs-card-cap-bg: #fff; --bs-card-cap-padding-y: 1rem; --bs-card-cap-padding-x: 1.25rem;
  --bs-card-spacer-y: 1.25rem; --bs-card-spacer-x: 1.25rem; --bs-card-title-spacer-y: 0;
}
.card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; }
.card-title { margin-bottom: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1; letter-spacing: 0.03em; text-transform: uppercase; }
.card-body > * + * { margin-top: 1rem; }
.card-body > * + .row { margin-top: calc(1rem - var(--bs-gutter-y)); }
.grid-2 { --bs-gutter-x: 1.25rem; --bs-gutter-y: 1.25rem; }

.badge-danger { background: var(--danger-tint); color: var(--danger); }

/* ---------- Stats (row-cols-1 / sm-2 / xl-4, g-3, each tile a .card.stat) ---------- */
.stat { padding: 1rem 1.25rem; min-width: 0; }
.stat small { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.stat b { display: block; margin-top: 0.35rem; font-family: var(--font-display); font-weight: 800; font-size: 2.1rem; line-height: 1; color: var(--teal); font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 0.45rem; font-size: 0.8125rem; color: var(--muted); }
a.stat { text-decoration: none; color: inherit; transition: border-color var(--t-hover) var(--ease-std); }
a.stat:hover { border-color: var(--teal); }

/* ---------- Notifications (Bootstrap .list-group-flush) ---------- */
.notes-list { --bs-list-group-bg: transparent; --bs-list-group-color: inherit; --bs-list-group-border-color: var(--line); --bs-list-group-item-padding-x: 1.25rem; --bs-list-group-item-padding-y: 0.95rem; }
.notes-list .list-group-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.9rem; align-items: start; }
.notes-list .dot { width: 0.6rem; height: 0.6rem; margin-top: 0.45rem; border-radius: 50%; background: var(--yellow); border: 1px solid var(--yellow-deep); }
.notes-list .is-read .dot { background: transparent; border-color: var(--line); }
.notes-list b { font-weight: 600; }
.notes-list .is-read b { font-weight: 500; }
.notes-list p { margin-top: 0.15rem; font-size: 0.9rem; color: var(--muted); }
.notes-list time { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }

.empty { display: grid; justify-items: center; gap: 0.4rem; padding: 2.5rem 1.25rem; text-align: center; color: var(--muted); }
.empty__icon { display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: 0.5rem; border-radius: 50%; background: var(--teal-mist); color: var(--teal); }
.empty__icon svg { width: 1.4rem; height: 1.4rem; }
.empty b { color: var(--ink); font-weight: 600; font-size: 1rem; }
.empty p { max-width: 38ch; font-size: 0.9rem; }

/* ---------- Notice (info callout) ---------- */
.notice {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 1rem 1.25rem;
  background: var(--teal-mist); border: 1px solid var(--teal); border-radius: var(--radius-panel);
}
.notice .icon { flex: none; width: 1.25rem; height: 1.25rem; margin-top: 0.1rem; color: var(--teal); }
.notice p { color: var(--ink); }
.notice .notice__head { font-weight: 600; color: var(--teal); }

/* ---------- Users table: add row ---------- */
.users-add-row td { background: var(--surface); }

/* ---------- Definition list label (dt in key-value rows) ---------- */
.dl-label { width: 7rem; font-size: var(--text-small); flex-shrink: 0; }

/* ---------- Toolbar (search + filters) ---------- */
.toolbar { gap: 0.75rem 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.toolbar__search { position: relative; flex: 1 1 16rem; }
.toolbar__search .form-control { padding-left: 2.5rem; }
.toolbar__search svg { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--muted); pointer-events: none; }
.toolbar__filter { gap: 0.5rem; }
.toolbar__filter .form-label { white-space: nowrap; }
.toolbar__filter .form-select { width: auto; padding-block: 0.55rem; }
.toolbar__count { margin-left: auto; font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.toolbar__actions { gap: 0.5rem; }

/* ---------- Tables (Bootstrap .table, re-themed) ---------- */
.table {
  --bs-table-bg: transparent; --bs-table-border-color: var(--line); --bs-table-color: var(--ink);
  margin-bottom: 0; font-size: 0.9375rem; font-variant-numeric: tabular-nums; vertical-align: middle;
}
.table > :not(caption) > * > * { padding: 0.75rem 1rem; }
.table th {
  padding: 0.7rem 1rem; text-align: left; white-space: nowrap;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
  background-color: var(--surface);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table .sku { font-weight: 600; white-space: nowrap; }
.table a { color: var(--teal); font-weight: 500; }
.table__name { display: block; font-weight: 500; }
.table__meta { display: block; margin-top: 0.1rem; font-size: 0.8125rem; color: var(--muted); }
.thumb { width: 3.5rem; height: 3.5rem; object-fit: cover; border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--surface); }
img.thumb[data-zoom-src] { cursor: zoom-in; transition: opacity var(--t-hover) var(--ease-std); }
img.thumb[data-zoom-src]:hover { opacity: 0.85; }
.table .form-select { min-width: 10.5rem; padding-block: 0.5rem; }
.table .form-select[data-value="in"] { border-color: var(--teal-bright); background-color: var(--teal-mist); color: var(--teal); font-weight: 600; }
.table .form-select[data-value="out"] { border-color: var(--danger); background-color: var(--danger-tint); color: var(--danger); font-weight: 600; }
.cell-stock { min-width: 10rem; }
.cell-stock .form-select { min-width: 0; width: 100%; }
.cell-stock .item-note { margin-top: 0.35rem; font-size: 0.8125rem; }
.table tr.is-changed td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }

/* ---------- Save bar ---------- */
.savebar {
  position: sticky; bottom: 1rem; z-index: 5;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1.25rem;
  background: var(--teal-ink); color: #fff; border-radius: var(--radius-panel);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.6);
}
.savebar__count { font-weight: 600; font-variant-numeric: tabular-nums; }
.savebar__note { font-size: 0.875rem; color: var(--on-teal-muted); }
.savebar__actions { gap: 0.5rem; margin-left: auto; }
.savebar__msg { flex-basis: 100%; margin: 0; min-height: 0; font-size: var(--text-small); color: var(--teal-bright); }
.savebar__msg:empty { display: none; }
.savebar.has-changes .savebar__count { color: var(--yellow); }

/* ---------- Upload feed ---------- */
.method { display: grid; gap: 0.5rem; align-content: start; padding: 1.25rem; }
.method__tag { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1; letter-spacing: 0.02em; color: var(--teal); }
.method h3 { font-size: 1rem; font-weight: 600; }
.method p { font-size: 0.9rem; color: var(--muted); }
.method .link-arrow { margin-top: 0.25rem; font-size: 0.9rem; }
.methods__note { font-size: 0.9rem; color: var(--muted); }
.methods__note a { color: var(--teal); font-weight: 500; }
.dropzone {
  position: relative; display: grid; justify-items: center; gap: 0.35rem;
  padding: 2.5rem 1.25rem; text-align: center;
  border: 2px dashed var(--line); border-radius: var(--radius-panel); background: var(--surface);
  transition: border-color var(--t-hover) var(--ease-std), background-color var(--t-hover) var(--ease-std);
}
.dropzone.is-over, .dropzone:focus-within { border-color: var(--teal); background: var(--teal-mist); }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone__icon { width: 2.2rem; height: 2.2rem; margin-bottom: 0.5rem; color: var(--teal); }
.dropzone b { font-size: 1.05rem; }
.dropzone p { font-size: 0.875rem; color: var(--muted); }
.dropzone .btn { margin-top: 0.75rem; pointer-events: none; }
.file-pick { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-control); }
.file-pick__icon { flex: none; padding: 0.25rem 0.45rem; border-radius: 3px; background: var(--teal); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 0.75rem; line-height: 1; letter-spacing: 0.06em; }
.file-pick__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick__meta { margin-left: auto; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }
.file-pick__remove { flex: none; padding: 0.2rem 0.5rem; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.file-pick__remove:hover { background: var(--danger-tint); color: var(--danger); }
/* Bootstrap .progress / .progress-bar, re-themed */
.progress { --bs-progress-height: 0.5rem; --bs-progress-bg: var(--surface); --bs-progress-border-radius: 999px; --bs-progress-box-shadow: none; --bs-progress-bar-bg: var(--yellow); --bs-progress-bar-transition: width 0.25s linear; border: 1px solid var(--line); }

/* ---------- Login / register ---------- */
.auth-body { background: var(--teal-deep); }
.auth { position: relative; isolation: isolate; min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; color: #fff; overflow: hidden; }
.auth__photo { position: absolute; inset: 0; z-index: -1; }
.auth__photo img { width: 100%; height: 100%; object-fit: cover; opacity: 0.45; }
.auth__photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 60, 45, 0.55), rgba(0, 39, 30, 0.9)); }
.auth__inner { width: min(100%, 26rem); }
.auth__inner--wide { width: min(100%, 46rem); }
.auth__brand { margin-bottom: 1.5rem; }
.auth__card { padding: 2rem; color: var(--ink); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8); }
.auth__card > * + * { margin-top: 1.1rem; }
.auth__card > .form-grid { margin-top: calc(1.5rem - var(--bs-gutter-y)); }
.auth__title { font-family: var(--font-display); font-weight: 700; font-size: 2.1rem; line-height: 1; letter-spacing: 0.01em; text-transform: uppercase; }
.auth__lede { margin-top: 0.4rem !important; font-size: 0.9375rem; color: var(--muted); }
.auth__row { gap: 0.5rem 1rem; font-size: 0.9rem; }
.auth__row a { color: var(--teal); font-weight: 500; }
.auth__card .form__msg { margin-top: 0.5rem; min-height: 0; }
.auth__card .form__msg:empty { display: none; }
.auth__alt { font-size: 0.9rem; color: var(--muted); text-align: center; }
.auth__alt a { color: var(--teal); font-weight: 600; }
.auth__foot { margin-top: 1.5rem; text-align: center; font-size: 0.875rem; color: var(--on-teal-muted); }
.auth__foot a { color: #fff; text-decoration: none; font-weight: 500; }
.auth__foot a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Badges (portal extras) ---------- */
.badge-line { background: #fff; color: var(--teal); border: 1px solid var(--teal); }
.badge-muted { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }

/* ---------- Orders (one <tbody data-order> per purchase order: summary row + detail row with a Bootstrap .collapse) ---------- */
.table-orders tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.table-orders tbody:not(.is-open) .order__detail { display: none; } /* keeps the column widths of the closed table */
.table-orders .order__detail td { padding: 0; background-color: var(--surface); }
.table-orders .order__detail > td { border-bottom: 0; }
.table-orders tbody.is-open .order__detail > td { border-bottom: 1px solid var(--line); }
.table-orders tbody:last-child.is-open .order__detail > td { border-bottom: 0; }
.table-orders tbody:last-child:not(.is-open) tr:first-child td { border-bottom: 0; }
.table .cell-action { text-align: right; white-space: nowrap; }
.table .cell-action .btn { vertical-align: middle; }
.table time { white-space: nowrap; }
.order__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); gap: 1.25rem; align-items: start; padding: 1.25rem; }
.order__lines { overflow: hidden; }
.table-lines { font-size: 0.875rem; }
.table-lines th { background-color: #fff; }
.table-lines tfoot td { font-weight: 600; background-color: var(--surface); border-bottom: 0; }
.table-orders .order__detail .table-lines th,
.table-orders .order__detail .table-lines td { padding: 0.5rem 0.75rem; background-color: #fff; }
.table-orders .order__detail .table-lines tfoot td { background-color: var(--surface); }
.doc-tiles { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.doc-tile {
  display: inline-flex; flex-direction: row; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--line); border-radius: var(--radius-panel);
  text-decoration: none; color: var(--ink);
  font-size: var(--text-label); font-weight: 600; line-height: 1.2;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.doc-tile:hover, .doc-tile:focus-visible { border-color: var(--teal); color: var(--teal); background: var(--teal-mist); }
.doc-tile .icon { width: 1.75rem; height: 1.75rem; }
.order__side { display: grid; gap: 1rem; align-content: start; }
.order__facts { margin: 0; display: grid; gap: 0.7rem; font-size: 0.875rem; }
.order__facts div { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 0.5rem; }
.order__facts dt { padding-top: 0.15rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.order__facts dd { margin: 0; }
.order__facts a { color: var(--teal); font-weight: 500; }
.order__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.order__actions:empty { display: none; }
.order__ship { display: grid; gap: 0.6rem; width: 100%; }
.order__ship .field { gap: 0.3rem; }
.order__ship .btn { justify-self: start; }
.order__msg { margin: 0; min-height: 0; font-size: var(--text-small); font-weight: 500; color: var(--teal); }
.order__msg.is-error { color: var(--danger); }
.order__msg:empty { display: none; }

/* ---------- Upload zone ---------- */
.upload-zone {
  position: relative;
  border: 2px dashed var(--line);
  border-radius: var(--radius-panel);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.upload-zone:hover,
.upload-zone.is-over { border-color: var(--teal); background: var(--teal-mist); }
.upload-zone input[type=file] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.upload-zone .icon { width: 2.75rem; height: 2.75rem; color: var(--muted); margin-bottom: 0.75rem; display: block; margin-inline: auto; }
.upload-zone__label { font-weight: 600; color: var(--ink); }
.upload-zone__meta { font-size: var(--text-small); color: var(--muted); margin-top: 0.3rem; }
.upload-zone__file { margin-top: 1rem; font-size: var(--text-small); font-weight: 600; color: var(--teal); min-height: 1.2em; }

/* ---------- Invoices list ---------- */
.table-invoices .cell-status { white-space: nowrap; }

/* ---------- Invoice document (vendor/invoice.html) ---------- */
.invoice { padding: clamp(1.5rem, 4vw, 3rem); }
.invoice__head { gap: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.invoice__title { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1; letter-spacing: 0.01em; text-transform: uppercase; }
.invoice__title small { display: block; margin-top: 0.4rem; font-family: var(--font-body); font-weight: 500; font-size: 0.9375rem; letter-spacing: 0; text-transform: none; color: var(--muted); }
.invoice__meta { margin: 0; display: grid; grid-template-columns: auto auto; gap: 0.3rem 1.25rem; font-size: 0.9rem; text-align: right; }
.invoice__meta dt { color: var(--muted); }
.invoice__meta dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.invoice__parties { padding: 1.5rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; line-height: 1.5; }
.invoice__parties h2 { margin-bottom: 0.45rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.invoice__parties b { display: block; font-weight: 600; }
.invoice__parties a { color: var(--teal); text-decoration: none; }
.invoice__lines { margin-top: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-panel); overflow-x: auto; }
.invoice__totals { margin: 1.5rem 0 0 auto; width: min(100%, 24rem); display: grid; gap: 0.5rem; font-size: 0.9375rem; }
.invoice__totals div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.invoice__totals span:last-child { font-variant-numeric: tabular-nums; }
.invoice__totals .is-total { padding-top: 0.7rem; border-top: 1px solid var(--line); font-weight: 600; }
.invoice__totals .is-total span:last-child { font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; line-height: 1; color: var(--teal); }
.invoice__status { display: grid; gap: 0.35rem; margin-top: 1.5rem; padding: 1rem 1.25rem; background: var(--surface); border-radius: var(--radius-panel); font-size: 0.9rem; }
.invoice__status b { font-weight: 600; }
.invoice__charge { margin-top: 0.5rem; }
.invoice__status .form__msg { min-height: 0; }
.invoice__status .form__msg:empty { display: none; }
.invoice__foot { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--muted); }
.invoice__foot a { color: var(--teal); }

/* ---------- Responsive ---------- */
@media (min-width: 992px) {
  .portal-side {
    position: sticky; top: var(--top-h); bottom: auto; align-self: flex-start;
    flex: none; width: var(--side-w); height: calc(100vh - var(--top-h)); max-height: none;
    display: flex; flex-direction: column;
  }
}
@media (max-width: 991.98px) {
  .portal-side { box-shadow: 0 0 60px rgba(0, 0, 0, 0.4); }
}
@media (max-width: 767.98px) {
  .table-stock thead { display: none; }
  .table-stock, .table-stock tbody { display: block; }
  .table-stock tr {
    display: grid; grid-template-columns: 4.5rem minmax(0, 1fr);
    grid-template-areas: "img sku" "img name" "img pieces" "img stock";
    gap: 0.3rem 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line);
  }
  .table-stock tbody tr:last-child { border-bottom: 0; }
  .table-stock td { display: block; padding: 0; border: 0; }
  .table-stock .cell-img { grid-area: img; }
  .table-stock .cell-sku { grid-area: sku; font-size: 0.8125rem; color: var(--muted); }
  .table-stock .cell-name { grid-area: name; }
  .table-stock .cell-pieces { grid-area: pieces; text-align: left; font-size: 0.875rem; }
  .table-stock .cell-pieces::before { content: "Pieces: "; color: var(--muted); }
  .table-stock .cell-stock { grid-area: stock; margin-top: 0.35rem; }
  .table-stock .form-select { width: 100%; }
  .table-stock tr.is-changed { box-shadow: inset 3px 0 0 var(--yellow); }
  .table-stock tr.is-changed td:first-child { box-shadow: none; }
  .thumb { width: 4.5rem; height: 4.5rem; }
  /* Orders and invoices collapse to cards */
  .table-orders thead, .table-invoices thead { display: none; }
  .table-orders, .table-orders tbody, .table-invoices, .table-invoices tbody { display: block; }
  .table-orders tbody > tr:first-child, .table-invoices tr[data-row] {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.3rem 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line);
  }
  .table-orders tbody > tr:first-child { grid-template-areas: "po status" "buyer buyer" "items items" "date shipby" "total action"; }
  .table-invoices tr[data-row] { grid-template-areas: "inv status" "buyer buyer" "issued paid" "amount action"; }
  .table-orders tbody > tr:first-child td, .table-invoices tr[data-row] td { display: block; padding: 0; border: 0; }
  .table-orders .cell-po { grid-area: po; }
  .table-invoices .cell-inv { grid-area: inv; }
  .table .cell-status { grid-area: status; justify-self: end; }
  .table .cell-buyer { grid-area: buyer; }
  .table-orders .cell-items { grid-area: items; }
  .table-orders .cell-date, .table-invoices .cell-issued { grid-area: date; font-size: 0.8125rem; color: var(--muted); }
  .table-invoices .cell-issued { grid-area: issued; }
  .table-orders .cell-date::before { content: "Placed "; }
  .table-invoices .cell-issued::before { content: "Issued "; }
  .table-orders .cell-shipby, .table-invoices .cell-paid { grid-area: shipby; justify-self: end; font-size: 0.8125rem; color: var(--muted); }
  .table-invoices .cell-paid { grid-area: paid; }
  .table-orders .cell-shipby::before { content: "Ship by "; }
  .table-invoices .cell-paid::before { content: "Paid "; }
  .table-orders .cell-total, .table-invoices .cell-amount { grid-area: total; margin-top: 0.35rem; text-align: left; font-weight: 600; }
  .table-invoices .cell-amount { grid-area: amount; }
  .table .cell-action { grid-area: action; margin-top: 0.35rem; }
  .table-orders tbody.is-open .order__detail, .table-orders .order__detail td { display: block; }
  .order__grid { grid-template-columns: 1fr; }
  .table-orders tbody:last-child tr:first-child td { border-bottom: 0; }
  .invoice__meta { text-align: left; }
  .table-lines th, .table-lines td, .table-orders .order__detail .table-lines tfoot td { padding: 0.6rem 0.7rem; }
  .table-lines .table__name { white-space: nowrap; }
  .savebar__note { display: none; }
  .savebar__actions { margin-left: 0; width: 100%; }
  .savebar__actions .btn { flex: 1 1 auto; }
  .portal-top__company { display: none; }
  .auth__card { padding: 1.5rem; }
}
@media (max-width: 575.98px) {
  .toolbar__count { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-side, .progress-bar, .form-control, .form-select, .nav-link, .dropzone { transition: none !important; }
}

/* ---------- Print (invoice page: hide the shell, keep the document) ---------- */
@media print {
  .portal-body { background: #fff; }
  .portal, .portal-shell { display: block !important; min-height: 0; }
  .portal-top, .portal-side, .offcanvas-backdrop, .portal-toggle, .skip-link, .page-head__actions, .print-hide { display: none !important; }
  .portal-main { padding: 0; }
  .page-head { padding-bottom: 0.75rem; }
  .card, .invoice { border: 0; border-radius: 0; }
  .invoice { padding: 0.5rem 0; }
  .invoice__lines { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
