html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #009688;
}

/* Off-screen until focused, then the first thing on the page. A keyboard user should not have to walk the
   navigation bar again on every navigation — and it grew a dropdown to tab past. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1080;
  padding: .5rem 1rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
}

.skip-link:focus {
  left: .5rem;
  top: .5rem;
}

/* The company a platform operator is currently acting for, in the companies grid.
   On the cells and not the row: DevExtreme paints its row striping on the <td>s, so a background set on
   the <tr> is covered by it on every alternate row. The specificity here is deliberately one class above
   the grid's own .dx-row-alt rule for the same reason. */
.dx-datagrid .dx-row.assumed-company > td {
  background-color: var(--bs-warning-bg-subtle);
}

/* ---- The sidebar and the top bar (_Layout), 2026-09-12 ----
 *
 * A dark column beside the page from lg up, collapsible to a rail of icons; below lg the same element is
 * Bootstrap's offcanvas drawer, opened from a slim top bar. A page with no sidebar — nobody signed in, or an
 * account attached to nothing — gets the top bar alone, with the brand and the account.
 *
 * ONLY THE LINKS SCROLL, not the whole column. A scrolling ancestor is a clipping context, and the account menu
 * at the foot opens upward out of it: the old top bar's collapsed menu clipped its own dropdowns exactly this
 * way, painted behind the header with `.show` set. */
:root {
  --sidebar-w: 15rem;
  --sidebar-rail: 4.5rem;
  --sidebar-bg: #0e282c;
}

.app-main {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  min-width: 0;
}

.sidebar {
  color: rgba(255, 255, 255, .8);
  background: linear-gradient(180deg, #0e2a2e 0%, #0a1f22 100%);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: .75rem .625rem;
}

.sidebar-nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .375rem .5rem .875rem;
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  text-decoration: none;
}

.brand:hover,
.brand:focus-visible {
  color: #fff;
}

.brand-tile {
  display: grid;
  flex: none;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: #fff;
  background: var(--av-teal-700);
  border-radius: var(--av-radius);
}

.brand-tile .brand-mark {
  width: 1.25rem;
  height: 1.25rem;
}

/* Small capitals over each group, 5.4:1 on the column — quieter than the links and still readable. */
.sidebar-heading {
  padding: .875rem .75rem .375rem;
  color: rgba(255, 255, 255, .6);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  overflow: hidden;
  color: rgba(255, 255, 255, .82);
  font-size: .9375rem;
  line-height: 1.3;
  white-space: nowrap;
  border-radius: var(--av-radius);
}

.sidebar .nav-link .dx-icon {
  flex: none;
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, .7);
  font-size: 18px;
  line-height: 18px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, .07);
}

/* The page's own section: a teal wash, white words and a light teal edge — marked by more than colour. */
.sidebar .nav-link.active {
  color: #fff;
  background: rgba(0, 150, 136, .28);
  box-shadow: inset 3px 0 0 var(--av-teal-200);
}

.sidebar .nav-link.active .dx-icon {
  color: var(--av-teal-200);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-foot .account-toggle {
  color: rgba(255, 255, 255, .85);
}

.sidebar-collapse,
.sidebar-toggle {
  display: grid;
  place-items: center;
  padding: .375rem;
  color: rgba(255, 255, 255, .75);
  background: none;
  border: 0;
  border-radius: var(--av-radius);
}

.sidebar-collapse:hover,
.sidebar-collapse:focus-visible,
.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, .07);
}

.sidebar-collapse .dx-icon,
.sidebar-toggle .dx-icon {
  font-size: 20px;
}

/* The top bar: the narrow screen's way in to the sidebar, and the whole chrome of a page without one. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  color: #fff;
  background: var(--sidebar-bg);
}

.topbar .brand {
  padding: 0;
  font-size: 1rem;
}

.topbar .nav-link {
  color: rgba(255, 255, 255, .85);
}

.topbar .nav-link:hover,
.topbar .nav-link:focus-visible {
  color: #fff;
}

@media (min-width: 992px) {
  body.has-sidebar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .has-sidebar .app-main {
    min-height: 100vh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    transition: width .15s ease;
  }

  .topbar-narrow {
    display: none;
  }

  /* THE RAIL: icons only, each word hidden by size so it stays the link's accessible name (and site.js puts it
     in a tooltip); the group headings become hairlines. */
  .sidebar-collapsed .sidebar {
    width: var(--sidebar-rail);
  }

  .sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    gap: 0;
    padding: .625rem;
    font-size: 0;
  }

  .sidebar-collapsed .sidebar-heading {
    margin: .5rem .5rem .25rem;
    padding: 0;
    font-size: 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
  }

  .sidebar-collapsed .sidebar .brand {
    justify-content: center;
    padding-inline: 0;
  }

  .sidebar-collapsed .sidebar .brand-name {
    display: none;
  }

  .sidebar-collapsed .sidebar-foot {
    flex-direction: column;
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    --bs-offcanvas-width: var(--sidebar-w);
    --bs-offcanvas-bg: var(--sidebar-bg);
  }

  .sidebar-collapse {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar {
    transition: none;
  }
}

/* The signed-in account, as an icon (_LoginPartial) — 2026-09-11. It was the address, bounded here to 15rem
 * with an ellipsis because nothing bounds an email address and that one item decided whether every page
 * scrolled sideways. An icon is the same width for everybody; the address is the first line of the menu it
 * opens, and the toggle's tooltip and accessible name. */
.account-toggle {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}

.account-icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* NO CARET on the account toggle: the icon already reads as a menu, and the arrow beside it made two symbols
 * for one control. The dropdown opens from data-bs-toggle, not from this class's arrow. */
.account-toggle.dropdown-toggle::after {
  display: none;
}

/* WIDE ENOUGH FOR AN ORDINARY ADDRESS ON ONE LINE. The menu hangs from an icon-wide item, so with no width of
 * its own it shrank to Bootstrap's 10rem and broke a 29-character address in two. A longer one still wraps
 * inside it (below) rather than running past the page's edge. */
.account-menu {
  min-width: 18rem;
  max-width: calc(100vw - 2rem);
}

.account-email {
  overflow-wrap: anywhere;
}

/* A language's flag (_Flag), at the height of the footer's text. The hairline keeps the white in each flag
 * from dissolving into the page. */
.flag {
  display: block;
  height: 1rem;
  width: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .2);
}

/* A row's action as an icon (site.js rowAction). Square, so a column of them lines up, with the glyph at the
 * size DevExtreme draws its own. */
.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .25rem .375rem;
  line-height: 1;
}

.row-action .dx-icon {
  width: 18px;
  height: 18px;
  font-size: 18px;
  line-height: 18px;
}

/* A ROW OF FIELDS THAT LINES UP ITS BOXES whatever its labels do (the ERP dialog's terms, 2026-09-12). Each
 * .field spans four rows of the grid and shares them through subgrid — label, box, help, error — so a label that
 * wraps makes the label row taller for every field instead of pushing one box down. Labels sit at the bottom
 * of their row, next to their box. As many columns as fit at 7.5rem, so a narrow screen wraps and still aligns
 * each line. */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  column-gap: 1rem;
}

.field-grid > .field {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  padding-bottom: .75rem;
}

.field-grid > .field > .form-label {
  align-self: end;
}

/* ---- Tokens (2026-09-12) ----
 *
 * One set of colours, radii and shadows for everything this file and dx-bridge.css draw. The teal scale is
 * Material's — the grids' own theme. Each status has a strong colour for text and a wash to sit behind it, and
 * every pair below is 5.7:1 or better, so a chip is readable before it is colourful. */
:root {
  --av-teal-50: #e0f2f1;
  --av-teal-100: #b2dfdb;
  --av-teal-200: #80cbc4;
  --av-teal-500: #009688;
  --av-teal-700: #00796b;
  --av-teal-800: #00695c;
  --av-teal-900: #004d40;

  --av-ok: #1b5e20;
  --av-ok-wash: #e8f5e9;
  --av-warn: #7a4f00;
  --av-warn-wash: #fff3d6;
  --av-err: #b71c1c;
  --av-err-wash: #fdecea;
  --av-info: #01579b;
  --av-info-wash: #e1f5fe;
  --av-neutral: #37474f;
  --av-neutral-wash: #eceff1;

  --av-radius-sm: .375rem;
  --av-radius: .5rem;
  --av-radius-lg: .75rem;
  --av-shadow-sm: 0 1px 2px rgba(16, 40, 44, .06);
  --av-shadow: 0 1px 2px rgba(16, 40, 44, .05), 0 4px 14px rgba(16, 40, 44, .07);
}

/* ---- Status chips ----
 *
 * Every badge a soft chip — the status's wash behind its strong colour — rather than white on a saturated fill.
 * Keyed on the Bootstrap classes Ui.StatusCss and supplier-bid.js already write, so no status moved and nothing
 * that keys on a class changed. Closed is a shade darker than Draft: both are neutral, and they are not the same
 * state. */
.badge {
  padding: .3em .7em;
  font-weight: 600;
  letter-spacing: .01em;
  border-radius: 999px;
}

.badge.text-bg-success { color: var(--av-ok) !important; background-color: var(--av-ok-wash) !important; }
.badge.text-bg-warning { color: var(--av-warn) !important; background-color: var(--av-warn-wash) !important; }
.badge.text-bg-danger { color: var(--av-err) !important; background-color: var(--av-err-wash) !important; }
.badge.text-bg-info { color: var(--av-info) !important; background-color: var(--av-info-wash) !important; }
.badge.text-bg-primary { color: var(--av-teal-900) !important; background-color: var(--av-teal-50) !important; }
.badge.text-bg-secondary,
.badge.text-bg-light { color: var(--av-neutral) !important; background-color: var(--av-neutral-wash) !important; }
.badge.text-bg-dark { color: #263238 !important; background-color: #dfe4e7 !important; }

/* Cards share the radius and the lightest shadow, so a card and a grid beside it read as one family. */
.card {
  border-radius: var(--av-radius-lg);
  box-shadow: var(--av-shadow-sm);
}

/* ---- The page header (2026-09-12) ----
 *
 * One shape for every screen's name: the title, a line saying what the screen is for when it has one, and the
 * screen's actions on the right — wrapping under the title on a narrow screen. A hairline below separates the
 * page's name from its content. It was eighteen hand-written `d-flex justify-content-between` rows and seven
 * bare headings, at three sizes of margin. */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.page-header:has(.page-lede) {
  align-items: flex-start;
}

.page-header > div:not(:first-child) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.page-title .badge {
  font-size: .8125rem;
}

.page-lede {
  max-width: 72ch;
  margin: .375rem 0 0;
  color: var(--bs-secondary-color);
}

/* ---- The empty state (_Empty) ----
 *
 * An icon, the sentence, and — where the reader may take it — the one step that fills the list. Dashed, so it
 * reads as a place where something will be rather than as a box that failed to load. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: 2rem 1.5rem;
  color: var(--bs-secondary-color);
  text-align: center;
  background: #fafbfb;
  border: 1px dashed var(--bs-border-color);
  border-radius: var(--av-radius-lg);
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  color: var(--av-teal-700);
  background: var(--av-teal-50);
  border-radius: 50%;
}

.empty-state__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.empty-state__text {
  max-width: 60ch;
  margin: 0;
}

/* ---- A button between its press and its answer (dx-controls.js) ----
 *
 * A spinner in its own colour, and no second press: a form that posts looked exactly as it did before the
 * press until the answer arrived, which is how a second one happens. */
.dx-button.face-busy {
  pointer-events: none;
}

.dx-button.face-busy .dx-button-content::before {
  content: "";
  width: 1em;
  height: 1em;
  margin-inline-end: .5em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: face-spin .7s linear infinite;
}

@keyframes face-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .dx-button.face-busy .dx-button-content::before {
    animation-duration: 2.5s;
  }
}

/* ---- The account pages (_AuthLayout), 2026-09-12 ----
 *
 * A card on a dark teal ground with two soft glows, and a teal strip across the card's top carrying the
 * product's name — borrowed in spirit from FuelControl's sign-in, which is the one sibling product with a real
 * one. Every text colour on the dark is chosen for contrast: the strip's white and teal-50 are 5.3:1 and 4.6:1
 * on #00796b, and the footer's links are teal 200 on a ground darker than #104040. */
.auth-body {
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 150, 136, .30) 0, transparent 26rem),
    radial-gradient(circle at 88% 92%, rgba(128, 203, 196, .14) 0, transparent 28rem),
    linear-gradient(150deg, #0a1d20 0%, #0e282c 55%, #0f3034 100%);
}

/* Centred in the height as well as the width: at the top of the page the card sat under a mostly empty dark
   screen. The container holding <main> takes the space between the top and the footer; a signed-in operator's
   assumed-company banner, the one other container the layout can render, keeps its own height. */
.auth-body .app-main > .container:has(> main) {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  justify-content: center;
}

.auth {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.auth-card {
  width: min(100%, 28rem);
  overflow: hidden;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 24px 48px -12px rgba(0, 0, 0, .5);
}

.auth-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  color: #fff;
  background: linear-gradient(135deg, #00796b 0%, #00564c 100%);
}

.auth-brand {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.auth-tagline {
  font-size: .875rem;
  color: #e0f2f1;
}

.auth-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .75rem;
  background: rgba(255, 255, 255, .15);
}

.auth-mark svg {
  width: 1.5rem;
  height: 1.5rem;
}

.auth-content {
  padding: 1.75rem;
}

/* The footer on the dark ground: Bootstrap's muted grey, link blue-teal and hairline would vanish into it. */
.auth-body .footer {
  --bs-secondary-color: rgba(255, 255, 255, .7);
  --bs-border-color: rgba(255, 255, 255, .12);
  --bs-link-color-rgb: 128, 203, 196;
}

/* A sticky footer without absolute positioning. The stock template pinned .footer to the bottom of a
   position:relative html and reserved exactly 60px for it with a body margin — which meant a footer that
   wrapped to two lines overlapped the page above it. A flex column pushes it down instead (see
   .footer { margin-top: auto } in _Layout.cshtml.css) and costs nothing when it wraps. */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* What the robots do, under each option in the rehearsal scenario picker — see scenario-picker.js.
 *
 * TWO LINES, because the list is for choosing and the panel under the picker is for reading. Unclamped, each
 * of eight options ran 94-134px and the list scrolled a long way for a choice between names; the full text
 * is one click away, in the panel the choice opens. */
.scenario-option-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Number tiles (_StatTile), 2026-09-12 ----
 *
 * A count on the dashboard that is also the way to what it counts: the whole tile is the link, and its number is
 * the first thing read. A tile counting nothing is not a link — there is nowhere to go — and is drawn quieter. */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
}

.stat-tile {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1rem 1.125rem;
  color: var(--bs-body-color);
  text-decoration: none;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--av-radius-lg);
  box-shadow: var(--av-shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.stat-tile[href]:hover,
.stat-tile[href]:focus-visible {
  color: var(--bs-body-color);
  border-color: var(--av-teal-200);
  box-shadow: var(--av-shadow);
}

.stat-tile__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--av-teal-700);
  background: var(--av-teal-50);
  border-radius: 50%;
}

.stat-tile__icon .dx-icon {
  width: 20px;
  height: 20px;
  font-size: 20px;
  line-height: 20px;
}

.stat-tile__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-tile__value {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stat-tile__label {
  color: var(--bs-secondary-color);
  font-size: .875rem;
}

.stat-tile__note {
  color: var(--av-warn);
  font-size: .8125rem;
  font-weight: 600;
}

.stat-tile:not([href]) {
  box-shadow: none;
}

.stat-tile:not([href]) .stat-tile__icon {
  color: var(--av-neutral);
  background: var(--av-neutral-wash);
}

@media (prefers-reduced-motion: reduce) {
  .stat-tile {
    transition: none;
  }
}

/* ---- Print (2026-09-12) ----
 *
 * An auction's result and its ledger check are things people print, or save as PDF, for the file. What prints is
 * the page's content and nothing that only works on a screen: no sidebar, no bar, no footer, no screen's actions
 * and no control — a button on paper is a promise nothing can keep. Buttons are hidden by their DevExtreme
 * face's class as well as their own, because dx-controls.js copies layout classes only: a `d-print-none` on a
 * button never reaches the face that is actually drawn. The stamp saying when the server drew the page
 * (_PrintStamp) prints and shows nowhere else. */
.print-stamp {
  display: none;
}

/* The time half of a day-and-time entry (wwwroot/js/time-entry.js), on every form that has one. Since 2026-10-16 it
 * is a list of times with a dropdown button, which takes room the bare text box did not: at 5.5rem "21:17" needed
 * 70px and got 56, and showed as "2…". Measured in a browser; 7rem leaves a margin over the 6.5rem that just fits. */
.time-entry-time {
  flex: 0 0 7rem;
}

/* What a buyer told the suppliers when they paused (2026-10-16): their line breaks are kept, as they typed them,
 * on the bid page and on the buyer's own Run screen. */
.pause-message {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

@media print {
  @page {
    margin: 14mm 12mm;
  }

  body,
  body.has-sidebar {
    display: block;
    min-height: 0;
    background: #fff;
  }

  .sidebar,
  .topbar,
  .footer,
  .skip-link,
  .page-header > :not(:first-child),
  .btn,
  .dx-button,
  .dx-popup,
  .dx-overlay-wrapper,
  .dx-toast-wrapper,
  main form {
    display: none !important;
  }

  .app-main {
    min-height: 0 !important;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .print-stamp {
    display: block;
    margin: -.5rem 0 1rem;
    color: #555;
    font-size: .8125rem;
  }

  .table-responsive {
    overflow: visible;
  }

  thead {
    display: table-header-group;
  }

  tr,
  .alert,
  .card {
    break-inside: avoid;
  }

  .card {
    box-shadow: none;
  }

  .alert,
  .badge {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}