/* Automir stock list.
 *
 * Hand-written, no build step. Palette sampled from the company logo:
 * #0086C6 is the brand blue, but at 4.0:1 on white it fails WCAG AA for body
 * text, so text and links use the darker #006699 and the bright blue is kept
 * for buttons and accents. The ground is a warm off-white rather than pure
 * white, because blue on #FFF reads clinical.
 *
 * The users are busy traders looking up a number. The table is the product.
 */

:root {
  --brand: #0086c6;
  --brand-dark: #006699;
  --brand-darker: #004f77;
  --neutral: #bdcbd6;
  --neutral-soft: #dfe6ec;
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #2a2a28;
  --text-soft: #6b6b66;
  --warn: #8a5a00;
  --warn-bg: #fdf4e3;
  --error: #a4232b;
  --error-bg: #fdeceb;
  --ok: #1c6b45;
  --ok-bg: #e9f5ee;
  --radius: 6px;
  --shadow: 0 1px 2px rgb(42 42 40 / 8%), 0 1px 8px rgb(42 42 40 / 4%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- masthead ---------- */

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--neutral-soft);
}
.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 14px; flex-wrap: wrap;
}
.wordmark {
  font-weight: 800; font-size: 20px; letter-spacing: .06em;
  color: var(--brand-dark); text-decoration: none; line-height: 1;
}
.wordmark span {
  display: block; font-size: 9px; letter-spacing: .34em;
  color: var(--text-soft); font-weight: 600; margin-top: 2px;
}
.masthead-nav {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 14px;
}
.masthead-nav a { color: var(--brand-dark); text-decoration: none; }
.masthead-nav a:hover { text-decoration: underline; }
/* Who you are, and whose prices you are looking at. The company matters
 * because prices attach to it, not to the person -- and a company can have
 * several people signed in. */
.who { display: flex; flex-direction: column; line-height: 1.25; text-align: right; }
.who-name { color: var(--text); font-weight: 600; font-size: 13px; }
.who-org { color: var(--text-soft); font-size: 12px; }
.inline { display: inline; margin: 0; }
.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--brand-dark); font: inherit; text-decoration: underline;
}

main.wrap { padding-block: 28px 48px; }

/* ---------- demo banner ---------- */

/* Deliberately loud. Mistaking a seeded price for a quote is the failure this
 * is here to prevent. */
.demo-banner {
  background: repeating-linear-gradient(
    135deg, #fdf4e3, #fdf4e3 14px, #f8ecd4 14px, #f8ecd4 28px
  );
  border-bottom: 2px solid #e0b95f;
  color: var(--warn);
  font-size: 13px;
  padding-block: 9px;
}
.demo-banner strong { letter-spacing: .04em; text-transform: uppercase; }

/* ---------- headings ---------- */

h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.01em; }
.lede { margin: 0; color: var(--text-soft); }
.note { color: var(--text-soft); font-size: 13px; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block; padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--neutral); background: var(--surface);
  color: var(--text); font: inherit; font-size: 14px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  font-weight: 600;
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark);
  color: #fff; }
.btn-quiet { background: transparent; border-color: transparent;
  color: var(--brand-dark); }
.btn-quiet.on { background: var(--surface); border-color: var(--neutral);
  color: var(--text); font-weight: 600; }

/* ---------- filters ---------- */

.filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 18px;
}
.filters input[type="search"] { min-width: 280px; flex: 1 1 280px; }

input[type="search"], input[type="email"], input[type="password"],
input[type="text"], select {
  padding: 8px 10px; border: 1px solid var(--neutral); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 1px;
}

/* ---------- table ---------- */

.table-scroll {
  overflow-x: auto; background: var(--surface);
  border: 1px solid var(--neutral-soft); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td {
  padding: 5px 10px; text-align: left; border-bottom: 1px solid var(--neutral-soft);
  vertical-align: middle; line-height: 1.35; white-space: nowrap;
}
/* Only the description may wrap, and only when it has to. */
table.data td.wrap { white-space: normal; min-width: 18em; }
table.data thead th {
  position: sticky; top: 0; z-index: 1;
  padding-block: 7px;
  background: var(--surface); border-bottom: 2px solid var(--neutral);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-soft); font-weight: 700; white-space: nowrap;
}
table.data thead th a { color: inherit; text-decoration: none; }
table.data thead th a:hover { color: var(--brand-dark); }
table.data thead th a.sorted { color: var(--brand-dark); }
/* Dense rows are hard to track across ten columns; a barely-there stripe
 * keeps the eye on the line without turning the table into a grid. */
table.data tbody tr:nth-child(even) { background: #fbfcfd; }
table.data tbody tr:hover { background: #eef5fa; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tfoot th {
  padding: 10px 12px; border-top: 2px solid var(--neutral);
  font-size: 13px; background: #f7fafc;
}

/* Numerals line up in columns; that is most of what makes a price table
 * scannable. */
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 13px; }
.sub { color: var(--text-soft); font-size: 12px; }
.unit { color: var(--text-soft); font-size: 12px; }
/* Inputs sitting in a table row must not set the row height. */
table.data input[type="text"] { padding: 3px 7px; font-size: 13px; }
.on-request { color: var(--warn); font-size: 13px; }
th.check, td.check { text-align: center; }
table.editable .qty { width: 8em; text-align: right;
  font-variant-numeric: tabular-nums; }
table.editable tr.is-stocked { background: #f7fbf9; }
table.editable tr.is-custom { background: #f2f8fc; }
table.data tr.stale td { color: var(--text-soft); }
table.editable .note-input { width: 12em; }
table.editable input::placeholder { color: var(--neutral); font-style: italic; }

.badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.badge-in { background: var(--ok-bg); color: var(--ok); }
.badge-yours { background: #e7f2f9; color: var(--brand-darker); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.warn-link { color: var(--warn); }

.sub-head { font-size: 15px; margin: 26px 0 8px; }
.sample {
  background: #f4f6f8; border: 1px solid var(--neutral-soft);
  border-radius: var(--radius); padding: 12px; overflow-x: auto;
  font-family: var(--mono); font-size: 12px; line-height: 1.6;
}
ul.plain { list-style: none; padding: 0; margin: 0; font-size: 14px; }
ul.plain li { padding: 4px 0; border-bottom: 1px solid var(--neutral-soft); }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
input[type="file"] { font: inherit; font-size: 14px; }
textarea {
  padding: 8px 10px; border: 1px solid var(--neutral); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
  width: 100%; resize: vertical;
}

/* ---------- enquiry ---------- */

.enquiry-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--neutral-soft);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.enquiry-label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.enquiry-message { flex: 1 1 260px; padding-block: 6px; }
table.data .qty-small { width: 5.5em; }

/* ---------- pagination ---------- */

.pagination {
  display: flex; gap: 16px; align-items: center; justify-content: center;
  margin-top: 18px; font-size: 14px;
}
.pagination a { color: var(--brand-dark); }
.pagination .disabled { color: var(--neutral); }
.page-of { color: var(--text-soft); }

/* ---------- cards, forms, messages ---------- */

.card {
  background: var(--surface); border: 1px solid var(--neutral-soft);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px;
}
.card-narrow { max-width: 380px; margin: 40px auto; }
.stack { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.stack label { font-size: 13px; font-weight: 600; margin-top: 8px; }
.stack button { margin-top: 18px; }

.actions {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px;
}
.empty {
  background: var(--surface); border: 1px dashed var(--neutral);
  border-radius: var(--radius); padding: 40px; text-align: center;
  color: var(--text-soft);
}

.messages { list-style: none; padding: 0; margin: 0 0 18px; }
.msg {
  padding: 10px 14px; border-radius: var(--radius); margin-bottom: 8px;
  border: 1px solid transparent; font-size: 14px;
}
.msg-success { background: var(--ok-bg); border-color: #bfe0cd; color: var(--ok); }
.msg-error { background: var(--error-bg); border-color: #f0c4c2; color: var(--error); }
.msg-info { background: #eef4f8; border-color: var(--neutral-soft); }
.msg-warning { background: var(--warn-bg); border-color: #ecd9ab; color: var(--warn); }

.foot {
  color: var(--text-soft); font-size: 13px; padding-block: 20px;
  border-top: 1px solid var(--neutral-soft);
}

@media (max-width: 640px) {
  .page-head { align-items: stretch; }
  .filters input[type="search"] { min-width: 0; }
  table.data th, table.data td { padding: 5px 8px; }
}
