/* Fantastech Inventory - red, white and black (the website's own colors: red #D2103E,
   deep red #A00B2E, ink #13161B). Sharp corners, thin lines, big readable type.
   The frame: a black side menu always showing on a desktop, a white top bar with the
   search and "+ New", then the page. Page bones and class names: docs/UI_GUIDE.md. */
:root {
  --red: #D2103E; --red-deep: #A00B2E; --red-tint: #FCE8ED;
  --black: #0B0D10; --ink: #13161B; --ink-2: #2B2F36; --muted: #63676F;
  --bg: #F4F4F5; --panel: #FFFFFF; --line: #E2E3E6; --line-strong: #C9CBD0;
  --good: #1D6B3A; --good-bg: #E6F4EB; --warn: #835400; --warn-bg: #FFF2D9;
  --bad: var(--red-deep); --bad-bg: var(--red-tint);
  --radius: 4px; --shadow: 0 1px 2px rgba(11, 13, 16, .06), 0 8px 24px -16px rgba(11, 13, 16, .35);
  --side-w: 248px; --top-h: 60px;
  --side-bg: #0B0D10; --side-hover: #181B21; --side-active: #1E2128; --side-text: #C9CBD0; --side-dim: #7D828B;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--red-deep); text-underline-offset: 2px; }
a:hover { color: var(--red); }
strong { font-weight: 700; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: #fff;
  padding: 8px 12px; border-radius: var(--radius); }
.skip:focus { top: 8px; color: #fff; }

/* ---------------------------------------------------------------- side menu */
.side { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: var(--side-w);
  display: flex; flex-direction: column; background: var(--side-bg); color: var(--side-text);
  border-right: 1px solid #000; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: var(--top-h); padding: 0 14px 0 18px; border-bottom: 3px solid var(--red); flex: none; }
.side-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 8px 0; }
.side-brand img { height: 38px; width: auto; display: block; }
.side-brand .appname { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: #fff; border-left: 1px solid #3A3F47; padding-left: 10px; }
.side-close { display: none; color: #fff; padding: 8px; border-radius: var(--radius); }
.side-nav { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0 16px;
  scrollbar-width: thin; scrollbar-color: #3A3F47 transparent; }
.side-group + .side-group { margin-top: 6px; }
.side-heading { padding: 10px 20px 4px; font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--side-dim); }
.side-nav ul { list-style: none; margin: 0; padding: 0; }

/* ---------------------------------------------------------------- side menu: folding groups
   A group heading is a <button data-fold> that folds its lines (static/js/app.js, and the inline script after
   the menu in base.html). The caret points down when open, right when folded. No new colors. */
.side-fold { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0 14px 0 0; background: none;
  border: 0; cursor: pointer; font: inherit; text-align: left; color: var(--side-dim); }
.side-fold .side-heading { flex: 1; min-width: 0; }
.side-fold:hover, .side-fold:hover .side-heading { color: var(--side-text); }
.side-fold .caret { width: 14px; height: 14px; margin-top: 6px; stroke-width: 2.2; transition: transform .15s ease-out; }
.side-group.is-folded > ul { display: none; }
.side-group.is-folded .side-fold .caret { transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) {
  .side-fold .caret { transition: none; }
}
/* ---------------------------------------------------------------- end of side menu: folding groups */

.side-link { display: flex; align-items: center; gap: 11px; min-height: 36px; padding: 6px 14px 6px 17px;
  border-left: 3px solid transparent; color: var(--side-text); text-decoration: none; font-size: 14.5px;
  font-weight: 600; line-height: 1.2; }
.side-link .ico { width: 19px; height: 19px; opacity: .85; }
.side-link .side-label { flex: 1; min-width: 0; }
.side-link:hover { background: var(--side-hover); color: #fff; }
.side-link.active, .side-link[aria-current="page"] { background: var(--side-active); color: #fff;
  border-left-color: var(--red); }
.side-link.active .ico { opacity: 1; color: #fff; }
.side-link.is-coming { color: #8D929B; font-weight: 500; }
.side-link.is-coming:hover { color: #C9CBD0; }
.side-link.is-coming.active { color: #fff; }
.side-link.is-test { color: #F0426B; }
.side-link.is-test:hover, .side-link.is-test.active { color: #fff; }
.side-link .soon { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #8D929B; border: 1px solid #3A3F47; border-radius: 2px; padding: 1px 5px; }
.side-link .count { min-width: 22px; text-align: center; font-size: 12px; font-weight: 800; color: #fff;
  background: var(--red); border-radius: 10px; padding: 1px 7px; }
.side-foot { display: none; flex: none; border-top: 1px solid #23272E; padding: 12px 18px 16px;
  font-size: 14px; color: var(--side-text); }
.side-foot a, .side-foot .linkbtn { color: #E8E9EB; display: block; margin-top: 6px; }
.side-who { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: #fff; font-weight: 600; }
.side-backdrop { display: none; }

/* ---------------------------------------------------------------- shell and top bar */
.shell { min-width: 0; }
body.has-side .shell { margin-left: var(--side-w); }
.test-banner { background: var(--red-deep); color: #fff; text-align: center; padding: 5px 12px;
  font-size: 13px; font-weight: 600; letter-spacing: .02em; }
/* The Claude switch (core/claude_switch.py): a yellow bar on every page while it is on, and the top bar's
   button. Off, the button hides on a phone (Claude works at a computer); on, it always shows. */
.claude-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px;
  background: #FFD54A; color: var(--black); border-bottom: 2px solid var(--warn); padding: 7px 12px;
  font-size: 14px; text-align: center; }
.claude-bar a { color: var(--black); font-weight: 700; }
.top-claude { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.top-claude.is-on { background: #FFD54A; color: var(--black); border-radius: var(--radius); padding: 3px 4px 3px 10px;
  font-size: 14px; font-weight: 700; }
.top-claude .btn.small { padding: 5px 10px; }
@media (max-width: 640px) {
  .top-claude:not(.is-on) { display: none; }
  .top-claude-words { display: none; }
}
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px 16px;
  min-height: var(--top-h); padding: 8px 24px; background: #fff; border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(11, 13, 16, .03); }
.topbar-plain { position: static; background: var(--black); border-bottom: 3px solid var(--red); }
.menu-btn { display: none; align-items: center; gap: 6px; color: var(--ink); text-decoration: none;
  font-weight: 700; padding: 8px 10px; margin-left: -10px; border-radius: var(--radius); }
.menu-btn:hover { background: var(--bg); color: var(--ink); }
.top-search { position: relative; flex: 1; max-width: 620px; display: flex; align-items: center; }
.top-search .ico { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.top-search input[type=search] { width: 100%; font-size: 16px; padding: 9px 40px 9px 40px;
  background: var(--bg); border: 1px solid var(--line); min-width: 0; }
.top-search input[type=search]:focus { background: #fff; }
.key-hint { position: absolute; right: 10px; font: 600 12px/1 system-ui, sans-serif; color: var(--muted);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 3px; padding: 3px 6px;
  background: #fff; pointer-events: none; }
.top-search input:focus ~ .key-hint, .top-search input:not(:placeholder-shown) ~ .key-hint { display: none; }
.top-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
/* The quick clock button beside the initials (hours, H39): the status in a few words, then one small button. */
.top-clock { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); white-space: nowrap; margin: 0; }
.top-clock-words { display: inline-flex; align-items: center; gap: 5px; }
.top-clock-words .ico { width: 16px; height: 16px; color: var(--muted); }
.top-clock-words.is-in { color: var(--good); font-weight: 700; }
.top-clock-words.is-in .ico { color: var(--good); }
.top-clock .btn.small { padding: 5px 10px; }
.who { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.who-link { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; border-radius: 18px; padding: 2px 8px 2px 2px; }
.who-link:hover { background: var(--bg); color: inherit; }
.who-name { font-weight: 700; color: var(--ink); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .02em; flex: none; }
.side-who .avatar { background: var(--red); }
.role { background: #2B2F36; color: #fff; padding: 2px 8px; border-radius: 2px; font-size: 11px;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.role-admin { background: var(--red); }
.inline { display: inline; }
.linkbtn { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* "+ New" and other drop-down menus (a <details> with class="dropdown") */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.new-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px 8px 12px; border-radius: 18px; }
.new-btn .ico { width: 18px; height: 18px; stroke-width: 2.4; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 240px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 6px 0;
  box-shadow: 0 12px 32px -12px rgba(11, 13, 16, .45); }
.dropdown-menu a, .dropdown-menu .is-disabled { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.dropdown-menu a:hover, .dropdown-menu a:focus-visible { background: var(--red-tint); color: var(--red-deep); }
.dropdown-menu .is-disabled { color: #9A9EA6; cursor: default; font-weight: 500; }
.dropdown-menu .soon { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: #ECEDEF; border-radius: 2px; padding: 2px 6px; }

/* ---------------------------------------------------------------- page bones */
.page { max-width: 1320px; margin: 0 auto; padding: 18px 28px 40px; }
.page:focus { outline: none; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; font-size: 14px; color: var(--muted);
  margin: 0 0 10px; min-height: 20px; }
.crumbs:empty { display: none; }
.crumbs > a { color: var(--muted); text-decoration: none; }
.crumbs > a:hover { color: var(--red-deep); text-decoration: underline; }
.crumbs > * + *::before { content: "\203A"; display: inline-block; margin: 0 8px; color: var(--line-strong);
  text-decoration: none; }
.crumbs > :last-child { color: var(--ink-2); font-weight: 600; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.pagehead .pagetitle { margin: 4px 0 14px; }
.pagetitle:empty, .pageactions:empty, .pagesub:empty { display: none; }
.pageactions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.pagesub { color: var(--muted); margin: -6px 0 16px; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -.01em; margin: 4px 0 16px;
  padding-left: 12px; border-left: 4px solid var(--red); line-height: 1.15; }
h2 { font-size: 19px; font-weight: 800; margin: 26px 0 10px; letter-spacing: -.005em; }
h3 { font-size: 16px; font-weight: 800; }
.sub { color: var(--muted); margin-top: -8px; }
.titlebar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.titlebar h1 { margin-bottom: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.note { background: var(--panel); border-left: 3px solid var(--ink); padding: 10px 14px; color: var(--ink-2); }

/* Panels and cards */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 14px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--ink);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card .num, .bignum { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--ink); }
.card .lbl { color: var(--muted); font-size: 14px; margin: 2px 0 8px; }
.card .when { font-weight: 700; }
.go { font-weight: 700; text-decoration: none; }
.go::after { content: " \2192"; }
.flags { margin: 8px 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); }

/* Tables. Headers stay at the top while the page scrolls (under the top bar). A table too wide
   for its box gets class "is-wide" (static/js/app.js) and slides sideways inside the box instead. */
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td { overflow-wrap: break-word; }
th { background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; position: sticky; top: var(--top-h); z-index: 2; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover td { background: #FAFAFB; }
tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.tablewrap { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tablewrap > table { border-radius: var(--radius); }
.tablewrap.is-wide { overflow-x: auto; }
.tablewrap.is-wide th { top: 0; }
.count-line { color: var(--muted); margin: 0 0 10px; }

/* Forms */
.searchbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
input[type=text], input[type=search], input[type=number], input[type=email], input[type=password],
input[type=url], input[type=tel], input[type=date], select, textarea {
  font: inherit; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: #fff; color: var(--ink); min-width: 0; max-width: 100%; box-sizing: border-box; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: var(--red); }
input[type=search] { flex: 1; min-width: min(240px, 100%); font-size: 18px; }
textarea { width: 100%; min-height: 80px; }
input[type=checkbox], input[type=radio] { accent-color: var(--red); width: 16px; height: 16px; vertical-align: -2px; }
form.stack p, form.stack .field { margin: 0 0 14px; }
form.stack label { display: block; font-weight: 700; margin-bottom: 4px; }
/* A group of radios or tick boxes under one label (the Percent off form). */
form.stack fieldset.field { border: 0; padding: 0; min-width: 0; }
form.stack fieldset.field > legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
form.stack .checklist label { display: flex; font-weight: 500; margin: 0; }
.helptext { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.errorlist { color: var(--red-deep); margin: 4px 0; padding-left: 18px; font-weight: 600; }
.formbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px;
  padding-top: 14px; border-top: 1px solid var(--line); }

/* Buttons */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit;
  font-weight: 700; padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--red); background: var(--red);
  color: #fff; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover, button.btn:hover { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn.secondary:hover { background: var(--ink); color: #fff; }
.btn.danger { background: var(--ink); border-color: var(--ink); }
.btn.danger:hover { background: var(--black); }
.btn.small { padding: 6px 12px; font-size: 14px; }
/* A step already done (Derek, 2026-10-26): dark, and clicking it again takes it back with a reason. */
.btn.done { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.btn.done:hover { background: var(--black); border-color: var(--black); }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* Pills and messages */
.pill { display: inline-block; padding: 2px 8px; border-radius: 2px; font-size: 12px; font-weight: 700; line-height: 1.4; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.muted { background: #ECEDEF; color: var(--muted); }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 6px; background: var(--panel);
  border: 1px solid var(--line); border-left: 4px solid var(--ink); }
.messages .msg-success { border-left-color: var(--good); }
.messages .msg-error { border-left-color: var(--red); background: var(--red-tint); color: var(--red-deep); }
.messages .msg-warning { border-left-color: #E3A13C; }

/* Pictures */
.thumb { width: 64px; height: 64px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.photo { max-width: 100%; max-height: 360px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.photos { display: flex; flex-wrap: wrap; gap: 10px; }
form.upload { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Detail lists */
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 7px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.pager { margin: 14px 0; display: flex; gap: 8px; align-items: center; }
.muted { color: var(--muted); }
.right { text-align: right; }

/* ---------------------------------------------------------------- home page */
.shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin: 4px 0 22px; }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; text-align: center; font-size: 14px; font-weight: 700; line-height: 1.25; }
.shortcut .ico { width: 26px; height: 26px; padding: 9px; box-sizing: content-box; border-radius: 50%;
  background: var(--red-tint); color: var(--red-deep); }
.shortcut:hover { border-color: var(--red); color: var(--red-deep); }
.home-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.home-grid > section > h2:first-child { margin-top: 0; }
.looklist { list-style: none; margin: 0; padding: 0; }
.looklist > li { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 4px 14px; align-items: start;
  padding: 12px 0; border-bottom: 1px solid var(--line); }
.looklist > li:last-child { border-bottom: 0; padding-bottom: 0; }
.looklist > li:first-child { padding-top: 0; }
.looklist .n { font-size: 26px; font-weight: 800; line-height: 1.1; text-align: right; font-variant-numeric: tabular-nums; }
.looklist .n.zero { color: var(--good); }
.looklist .what { font-weight: 700; }
.looklist .what .helptext { font-weight: 400; }
.looklist .flags { margin: 4px 0 0; }
.looklist .clear { color: var(--good); font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ---------------------------------------------------------------- search and coming-soon pages */
.results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.results h2 { margin-top: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.results h2 .muted { font-size: 14px; font-weight: 600; }
.reslist { list-style: none; margin: 0; padding: 0; }
.reslist li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.reslist li:last-child { border-bottom: 0; }
.reslist a.name { font-weight: 700; }
.reslist .meta { color: var(--muted); font-size: 14px; }
.coming { max-width: 760px; }
.coming .phase { display: inline-block; margin-bottom: 12px; }
.coming .what { font-size: 18px; line-height: 1.5; }
.coming ul { padding-left: 20px; }

/* ---------------------------------------------------------------- focus you can see */
a:focus-visible, button:focus-visible, summary:focus-visible, .btn:focus-visible, .linkbtn:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.side a:focus-visible, .side button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
th a { color: #fff; }

/* ---------------------------------------------------------------- old menu blocks
   A page whose address is not on the menu can still light its line the old way,
   with {% block nav_products %}active{% endblock %} (core/nav.py lights the rest). */
body[data-nav-test="active"] .side-link[data-key="test"],
body[data-nav-products="active"] .side-link[data-key="products"],
body[data-nav-customers="active"] .side-link[data-key="customers"],
body[data-nav-vendors="active"] .side-link[data-key="vendors"],
body[data-nav-pricing="active"] .side-link[data-key="prices"],
body[data-nav-pictures="active"] .side-link[data-key="pictures"],
body[data-nav-log="active"] .side-link[data-key="edit-log"],
body[data-nav-inflow="active"] .side-link[data-key="inflow"],
body[data-nav-users="active"] .side-link[data-key="users"] {
  background: var(--side-active); color: #fff; border-left-color: var(--red); }

/* ---------------------------------------------------------------- tablets and phones */
@media (max-width: 1180px) {
  .page { padding: 16px 20px 36px; }
  .who-name { display: none; }
}
@media (max-width: 959px) {
  :root { --top-h: 56px; }
  body.has-side .shell { margin-left: 0; }
  .side { width: min(300px, 86vw); transform: translateX(-102%); visibility: hidden;
    transition: transform .18s ease-out, visibility 0s linear .18s; box-shadow: 0 0 40px rgba(0, 0, 0, .5); }
  body.side-open .side, .side:target { transform: none; visibility: visible; transition: transform .18s ease-out; }
  body.side-open { overflow: hidden; }
  .side-close { display: inline-flex; }
  .side-foot { display: block; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(11, 13, 16, .5); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 6px 16px; gap: 10px; }
  .who .role, .signout { display: none; }
  /* Wide tables slide sideways inside their own box; the page itself never does. */
  .tablewrap { overflow-x: auto; }
  th { top: 0; }
  .home-grid, .results { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .page { padding: 12px 14px 32px; }
  .kv { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
  .topbar { padding: 6px 12px; gap: 8px; }
  .menu-btn span { display: none; }
  .menu-btn { margin-left: -4px; padding: 8px; }
  .top-search input[type=search] { padding-right: 10px; }
  .key-hint { display: none; }
  .new-btn { padding: 8px 10px; border-radius: 50%; }
  .new-btn span { display: none; }
  .who { display: none; }     /* name, role and Sign out sit at the foot of the menu on a phone */
  .top-clock-words { display: none; }   /* the clock button alone on a phone; its status is its title */
  .shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .shortcut { padding: 10px 4px; gap: 6px; font-size: 13px; }
  .shortcut .ico { width: 20px; height: 20px; padding: 7px; }
  .looklist > li { grid-template-columns: 56px minmax(0, 1fr); }
  .looklist > li > :last-child { grid-column: 2; }
  .looklist .n { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .side { transition: none; }
}
@media print {
  .side, .side-backdrop, .topbar, .test-banner, .actions, .pageactions, .searchbar, .crumbs, .skip { display: none !important; }
  body.has-side .shell { margin-left: 0; }
  body { background: #fff; }
  .panel, .card, .tablewrap { box-shadow: none; }
  th { position: static; }
}

/* ---------------------------------------------------------------- the Clock in box (templates/hours/_clock_box.html)
   A plain block at the top of the page; its script adds .is-open and it covers the page, 16px from the sides. */
.clock-box { margin: 0 0 16px; }
.clock-box-card { background: var(--panel); border: 1px solid var(--line-strong); border-top: 4px solid var(--red);
  border-radius: var(--radius); padding: 18px 20px 20px; box-shadow: var(--shadow); }
.clock-box-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 24px; line-height: 1.2; }
.clock-box-title .ico { width: 28px; height: 28px; color: var(--red); }
.clock-box p { margin: 0 0 6px; font-size: 17px; }
.clock-box .clock-box-also { color: var(--muted); font-size: 15px; }
.clock-box .clock-box-msg { padding: 8px 12px; border-left: 4px solid var(--red); background: var(--red-tint);
  color: var(--red-deep); font-size: 15px; }
.clock-box-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.clock-box-actions form { flex: 1 1 140px; margin: 0; }
.clock-box-btn, button.clock-box-btn { width: 100%; min-height: 56px; font-size: 20px; }
.clock-box.is-open { position: fixed; inset: 0; z-index: 90; margin: 0; padding: 16px; overflow-y: auto;
  display: flex; justify-content: center; background: rgba(11, 13, 16, .6); }
.clock-box.is-open .clock-box-card { width: 100%; max-width: 440px; margin: auto 0; }
html.clock-box-open, html.clock-box-open body { overflow: hidden; }
@media print { .clock-box { display: none !important; } }

/* A long list of tick boxes (price sheet categories): columns, scrolls inside its own box. */
.checklist, div.checklist { list-style: none; padding: 6px 8px; margin: 4px 0; max-height: 220px; overflow-y: auto;
  border: 1px solid var(--line, #d9dbe0); border-radius: 6px; columns: 2 220px; column-gap: 16px; }
.checklist li, .checklist div { break-inside: avoid; padding: 2px 0; }
.checklist label { font-weight: normal; display: flex; gap: 6px; align-items: flex-start; }
/* "Did you mean" box on the search pages. */
.didyoumean { border-left: 4px solid var(--red, #D2103E); }

/* ---- sales (phase 2) ---- quote and order pages (templates/sales/*). No new colors. */
.sales-title-name { font-size: .6em; font-weight: 600; margin-left: 6px; }
.sales-alert { border-left: 4px solid var(--red); }
.sales-alert-text { margin: 12px 0; }
.sales-list { margin: 6px 0; padding-left: 18px; }
.sales-list li { margin: 3px 0; }
.sales-lines-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sales-lines-head h2 .muted { font-size: 15px; font-weight: 600; }
.sales-lines td { vertical-align: top; }
.sales-lines .pill { margin-top: 3px; }
.sales-desc { max-width: 280px; font-size: 14px; color: var(--ink-2); }
/* A kit we build: its picks and parts under its quote line, and on the shop board card (kits app). */
.kit-on-line { margin-top: 6px; }
.kit-parts-short, .board-kit { margin: 4px 0 6px; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.kit-parts-short li + li, .board-kit li + li { margin-top: 2px; }
/* The line editor's "Kit choices" box on a new kit line (templates/sales/line_form.html): one short row of
   radios per choice, so the picks stay on one screen. */
form.stack fieldset.kit-choices { background: var(--bg); border-radius: var(--radius); padding: 8px 12px 10px; }
form.stack fieldset.kit-choices > legend { float: left; width: 100%; margin-bottom: 4px; }
form.stack fieldset.kit-choices > div { clear: both; }
.kit-choice-group + .kit-choice-group { margin-top: 6px; }
.kit-choice-title { margin: 0 0 2px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.kit-choice-row { display: flex; flex-wrap: wrap; gap: 0 18px; }
.kit-choice-row .sales-radio { margin: 2px 0; }
.kit-now { margin: 0; }
.sales-linkcell { white-space: nowrap; }
.sales-linkcell a + a { margin-left: 10px; }
.sales-under-lines { margin-top: 16px; }
.sales-totals .kv { grid-template-columns: 1fr auto; }
.sales-totals .kv dd { text-align: right; font-variant-numeric: tabular-nums; }
.sales-totals .sales-total { font-size: 20px; font-weight: 800; color: var(--ink); border-top: 1px solid var(--line); padding-top: 6px; }
.sales-actions { margin-top: 16px; }
.sales-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sales-buttons form { margin: 0; }
.sales-saved { min-height: 1.2em; }
.sales-bad { color: var(--red-deep); font-weight: 600; }
.sales-radio { display: block; font-weight: 500 !important; margin: 4px 0; }
.sales-row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 10px; }
.sales-find { position: relative; }
.sales-find input[type=text] { width: 100%; font-size: 18px; }
.sales-chosen { margin-top: 6px; }
.sales-results { list-style: none; margin: 6px 0 0; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: #fff; max-height: 340px; overflow-y: auto; box-shadow: var(--shadow); }
.sales-results li { border-bottom: 1px solid var(--line); padding: 0; }
.sales-results li:last-child { border-bottom: 0; }
.sales-results li.muted, .sales-results li.sales-fix, .sales-results li.sales-bad { padding: 8px 10px; }
.sales-results .sales-pick { display: block; width: 100%; text-align: left; font: inherit; background: none; border: 0;
  padding: 8px 10px; cursor: pointer; color: var(--ink); }
.sales-results .sales-pick:hover, .sales-results .sales-pick:focus { background: var(--red-tint); outline: none; }
.sales-choices li { padding: 6px 10px; }
.sales-live { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; margin: 4px 0 14px; }
.sales-eq { font-size: 20px; font-weight: 800; margin: 4px 0; font-variant-numeric: tabular-nums; }
.sales-offer { background: var(--warn-bg); border-radius: var(--radius); padding: 8px 10px; margin: 8px 0; }
.sales-offer p { margin: 0 0 6px; }
@media (max-width: 640px) {
  .sales-row3 { grid-template-columns: 1fr; }
  .sales-desc { max-width: none; }
}

/* ---- live suggestions under a search box (static/js/suggest.js, core/views_suggest.py). The list
   sits on the page body, placed under the box by the script, above the top bar and the side menu. */
.suggest { position: absolute; z-index: 60; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow-y: auto; overscroll-behavior: contain; font-size: 15px; line-height: 1.3; }
.suggest[hidden] { display: none; }
.suggest-group { padding: 7px 12px 3px; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); }
.suggest-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px;
  cursor: pointer; border-bottom: 1px solid var(--line); }
.suggest-row:last-child { border-bottom: 0; }
.suggest-row.is-active { background: var(--red-tint); }
.suggest-pic { width: 36px; height: 36px; flex: none; object-fit: contain; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); }
.suggest-words { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.suggest-words strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-note { flex: none; font-size: 11px; font-weight: 700; color: var(--good); background: var(--good-bg);
  border-radius: 2px; padding: 2px 6px; white-space: nowrap; }
.suggest-row.is-fix strong, .suggest-more .suggest-words { color: var(--red-deep); }
.suggest-more .suggest-words { font-weight: 700; }
.suggest-empty { padding: 10px 12px; color: var(--muted); }
/* "Add new ..." rows, always last (core/addnew.py, Derek 2026-10-26). */
.suggest-adds { position: sticky; bottom: 0; background: var(--bg); border-top: 2px solid var(--line-strong); }
.suggest-add { background: var(--bg); min-height: 38px; }
.suggest-add .suggest-words strong { color: var(--red-deep); }
.suggest-add-plus { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--red);
  color: #fff; font-weight: 700; line-height: 22px; text-align: center; }
.add-new-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
/* Phones and tablets: taller rows for a thumb, bigger pictures. */
body.phone .suggest { font-size: 17px; }
body.phone .suggest-row { min-height: 52px; }
body.phone .suggest-pic { width: 44px; height: 44px; }
body.phone .suggest-sub { font-size: 14px; white-space: normal; }
@media print { .suggest { display: none !important; } }

/* kit build time */
.board-lines li > .board-build { grid-column: 1 / -1; }
.board-lines .board-kit li { display: list-item; padding: 0; border-top: 0; }
.board-clock { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.board-clock-now, .board-clock-type { margin: 0; flex-basis: 100%; }

/* Hours payroll view: a red line on anyone with a missing punch, kept red on paper too. */
tr.payroll-fix td { background: var(--red-tint); color: var(--red-deep); }
@media print {
  tr.payroll-fix td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .messages .msg-error { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .noprint { display: none !important; }      /* the QuickBooks column and the send panel stay off the paper */
}

/* The open-quote bar (sales/open_quotes.py, static/js/quote_bar.js): fixed at the bottom, right of the side
   menu on a desktop, under the open menu on a phone. */
.quote-bar { position: fixed; z-index: 32; left: 0; right: 0; bottom: 0; max-height: 50vh; overflow-y: auto;
  background: var(--panel); color: var(--ink); border-top: 3px solid var(--red);
  box-shadow: 0 -8px 24px -16px rgba(11, 13, 16, .45); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.quote-bar[hidden] { display: none; }
body.has-side .quote-bar { left: var(--side-w); }
@media (max-width: 959px) { body.has-side .quote-bar { left: 0; } }
.quote-bar-head { display: flex; align-items: flex-start; gap: 12px; }
.quote-bar-title { margin: 0; flex: 1; font-weight: 700; }
.quote-bar-hide { flex: none; width: 40px; height: 40px; background: none; border: 1px solid var(--line-strong);
  border-radius: var(--radius); color: var(--ink); font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.quote-bar-hide:hover { background: var(--ink); color: #fff; }
.quote-bar-list { list-style: none; margin: 8px 0 0; padding: 0; }
.quote-bar-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 6px 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.quote-bar-note { margin: 6px 0 0; font-size: 14px; }
@media print { .quote-bar { display: none !important; } }
