/* Hard Six Ops — Hard Six Global brand: black ground, copper accent,
   bold Helvetica headings with a copper full stop, spaced mono labels. */

:root {
  --ground: #0a0a0a;
  --sidebar: #000000;
  --panel: #141414;
  --panel-raised: #1b1b1b;
  --line: #2b2b2b;
  --line-soft: #222222;
  --text: #f5f5f5;
  --text-2: #b3b3b3;
  --text-3: #8c8c8c;
  /* Exact values from the Hard Six Global documents and logo artwork. */
  --copper: #d06828;
  --copper-hover: #e07c3e;
  --ok: #8fd19e;
  --danger: #e57373;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--text); font-family: var(--sans); }
a { color: var(--copper); }
a:hover { color: var(--copper-hover); }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; }
.dot { color: var(--copper); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; color: var(--copper); text-transform: uppercase; }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--text-2); text-transform: uppercase; }
.muted { color: var(--text-2); }
.rule { width: 48px; height: 5px; background: var(--copper); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* App shell */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 220px; max-width: 100%; background: var(--sidebar); border-right: 1px solid var(--line-soft); padding: 28px 16px; display: flex; flex-direction: column; gap: 28px; }
.main { flex: 999 1 560px; min-width: 0; padding: 24px 40px 48px; display: flex; flex-direction: column; gap: 32px; }

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: var(--text); text-decoration: none; }
.brand-word { display: flex; flex-direction: column; line-height: 1; }
.brand-word strong { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.brand-word span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.4em; color: var(--text-2); margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav span { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-size: 15px; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a[aria-current="page"] { background: var(--panel-raised); color: #fff; font-weight: 700; }
.nav .num { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.nav a[aria-current="page"] .num { color: var(--copper); }
.nav .soon { color: var(--text-3); cursor: default; }
.nav .soon em { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.company-marks { display: flex; gap: 8px; }
.mark { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--text); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.mark-img { flex-shrink: 0; display: block; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--panel-raised); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

.page-head { display: flex; flex-direction: column; gap: 14px; }
.page-head h1 { font-size: 56px; line-height: 1; letter-spacing: -0.03em; }

/* Panels */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-size: 22px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.pill { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; padding: 4px 8px; border-radius: 4px; border: 1px solid #3a3a3a; color: var(--text-2); white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--ok); }
.status.off { color: var(--text-3); }

/* Buttons and forms */
.btn, button, input[type="submit"] { min-height: 44px; padding: 0 18px; border-radius: 6px; border: 1px solid #3a3a3a; background: transparent; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.btn:hover, button:hover { border-color: var(--text-2); color: var(--text); }
.btn-primary, button[type="submit"] { background: var(--copper); border-color: var(--copper); color: #000; font-weight: 700; }
.btn-primary:hover, button[type="submit"]:hover { background: var(--copper-hover); border-color: var(--copper-hover); color: #000; }
input[type="email"], input[type="text"], input[type="password"], input[type="search"], select, textarea { width: 100%; min-height: 44px; padding: 0 12px; background: var(--ground); border: 1px solid #3a3a3a; border-radius: 6px; color: var(--text); font: inherit; font-size: 15px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-2); }
form p { margin: 0 0 14px; }
.errorlist { color: var(--danger); padding-left: 18px; font-size: 14px; }
.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 12px 14px; border-radius: 6px; background: var(--panel-raised); border: 1px solid var(--line); font-size: 14px; }

/* Sign-in pages */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 22px; }
.auth-card h1 { font-size: 40px; line-height: 1.05; }
.auth-card hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 4px 0; }
.auth-actions { display: flex; flex-direction: column; gap: 10px; }
.auth-actions .btn { width: 100%; }

@media (max-width: 640px) {
  .main { padding: 20px 16px 40px; }
  .page-head h1 { font-size: 40px; }
}

/* Status variants and tables (Xero page and later modules) */
.status.warn { color: var(--copper); }
.status.bad { color: var(--danger); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); font-weight: 400; padding: 0 12px 10px 0; }
.table td { padding: 12px 12px 12px 0; border-top: 1px solid var(--line); vertical-align: top; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.notice { padding: 14px 16px; border-radius: 6px; border: 1px solid var(--copper); color: var(--text); font-size: 14px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }

/* Lists: search and filter bar, paging, row links, facts */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters label { margin: 0; }
.filters .grow { flex: 1 1 280px; }
.filters select { min-width: 160px; }
.pager { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 8px; }
.row-link { color: var(--text); font-weight: 700; text-decoration: none; }
.row-link:hover { color: var(--copper); }
.nowrap { white-space: nowrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 14px; }
.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); padding-top: 2px; }
.facts dd { margin: 0; }
.page-head .eyebrow a { color: inherit; text-decoration: none; }
/* Inventory and dispatch (apps/inventory) */
:root { --info: #7fb2e5; --warn: var(--copper); }
.mono { font-family: var(--mono); }
.small { font-size: 13px; }
.prewrap { white-space: pre-wrap; margin: 0; line-height: 1.5; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--copper); font-size: 13px; }
.h1-sm { font-size: 40px; line-height: 1.05; }
.crumbs { margin: 0; color: var(--text-2); font-size: 14px; }
.subnav { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -12px; }
.subnav a { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 6px; color: var(--text-2); text-decoration: none; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.subnav a:hover { background: var(--panel); color: var(--text); }
.subnav a[aria-current="page"] { background: var(--panel-raised); color: var(--copper); }
.grid-wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.list li.stack { flex-direction: column; align-items: flex-start; gap: 6px; }
.list .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.notice-bad { border-color: var(--danger); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-danger { border-color: var(--danger); color: var(--danger); background: transparent; font-weight: 400; }
.btn-danger:hover { background: var(--danger); color: #000; }
.link-btn { min-height: 36px; padding: 0 8px; border: 0; background: transparent; color: var(--text-2); font-size: 14px; text-decoration: underline; }
.link-btn:hover { color: var(--copper); }
.icon-btn { padding: 0 12px; }
.segmented { display: inline-flex; gap: 4px; }
.hide-sm { }
@media (max-width: 640px) { .hide-sm { display: none; } .h1-sm { font-size: 30px; } }

.badge { display: inline-flex; align-items: center; white-space: nowrap; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; border: 1px solid currentColor; }
.badge.ok, .stat.ok strong, .counts .ok strong { color: var(--ok); }
.badge.info, .counts .info strong { color: var(--info); }
.badge.warn, .stat.warn strong { color: var(--copper); }
.badge.bad, .stat.bad strong, .counts .bad strong { color: var(--danger); }
.badge.off { color: var(--text-3); }
.due-over { color: var(--danger); font-weight: 700; }
.due-soon { color: var(--copper); }

/* Forms */
input[type="date"], input[type="number"], input[type="tel"], input[type="url"] { width: 100%; min-height: 44px; padding: 0 12px; background: var(--ground); border: 1px solid #3a3a3a; border-radius: 6px; color: var(--text); font: inherit; font-size: 15px; color-scheme: dark; }
textarea { padding: 10px 12px; min-height: 80px; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--copper); vertical-align: middle; }
.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.field label { margin: 0; }
.field-check { justify-content: flex-end; }
.field-check label { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); font-size: 15px; }
.field .help { color: var(--text-3); }
.field .error, .has-error label { color: var(--danger); }
.check { display: inline-flex; align-items: center; gap: 8px; margin: 0; min-height: 44px; color: var(--text); font-size: 14px; white-space: nowrap; }
.kit-filters input[type="search"] { flex: 1 1 240px; width: auto; }
.kit-filters select { width: auto; flex: 0 1 200px; min-width: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; width: 100%; }
.inline-form input[type="text"] { flex: 1 1 200px; width: auto; }
.inline-form select { width: auto; }
.disclose summary { list-style: none; width: fit-content; }
.disclose summary::-webkit-details-marker { display: none; }
.disclose[open] summary { margin-bottom: 14px; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 16px; margin: 0; }
.fact-grid dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.fact-grid dd { margin: 4px 0 0; }

/* Dashboard figures */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; }
a.stat:hover { border-color: var(--text-3); color: var(--text); }
.stat strong { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); }

/* Scanner */
.scanner { display: flex; flex-direction: column; gap: 12px; }
.scanner form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.scan-modes { display: grid; grid-template-columns: repeat(var(--modes), minmax(0, 1fr)); gap: 8px; border: 0; margin: 0; padding: 0; }
.scan-modes label { margin: 0; }
.scan-modes input { position: absolute; opacity: 0; pointer-events: none; }
.scan-modes span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 8px; border: 2px solid #3a3a3a; border-radius: 6px; color: var(--text-2); font-weight: 700; font-size: 15px; text-align: center; cursor: pointer; }
.scan-modes input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: 2px; }
.scan-modes input:checked + span { color: #000; border-color: var(--copper); background: var(--copper); }
.scan-modes .mode-info input:checked + span { background: var(--info); border-color: var(--info); }
.scan-modes .mode-ok input:checked + span { background: var(--ok); border-color: var(--ok); }
.scan-modes .mode-bad input:checked + span { background: var(--danger); border-color: var(--danger); }
.scan-row { display: flex; gap: 8px; }
.scan-row .scan-input { flex: 1; min-width: 0; min-height: 52px; font-family: var(--mono); font-size: 18px; letter-spacing: 0.04em; }
.scan-row button { min-height: 52px; }
[data-sound][aria-pressed="true"] .icon-off, [data-sound][aria-pressed="false"] .icon-on { display: none; }
[data-sound][aria-pressed="false"] { color: var(--text-3); }
.scan-camera { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; }
.scan-camera[hidden] { display: none; }
.scan-camera video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.scan-camera .scan-line { position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.scan-camera [data-camera-close] { position: absolute; top: 8px; right: 8px; min-height: 36px; background: rgba(0, 0, 0, 0.7); }
.scan-camera-error { padding: 24px 16px; margin: 0; text-align: center; }
.scan-output:empty { display: none; }
.scan-result { border: 2px solid; border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 16px; }
.scan-result .scan-meta { font-size: 13px; color: var(--text-2); }
.tone-success { border-color: var(--ok); background: rgba(143, 209, 158, 0.08); }
.tone-warning { border-color: var(--copper); background: rgba(208, 104, 40, 0.1); }
.tone-error { border-color: var(--danger); background: rgba(229, 115, 115, 0.1); }
.scan-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: 13px; }
.scan-log li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); color: var(--text-2); }
.scan-log li::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.scan-log li.tone-warning::before { background: var(--copper); }
.scan-log li.tone-error::before { background: var(--danger); }
.scan-log li { border-left: 0; background: none; }
.picker { border: 2px solid var(--info); border-radius: var(--radius); overflow: hidden; }
.picker-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(127, 178, 229, 0.12); font-size: 14px; }
.picker ul { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.picker li + li { border-top: 1px solid var(--line); }
.pick { width: 100%; justify-content: flex-start; border: 0; border-radius: 0; min-height: 52px; padding: 8px 12px; text-align: left; gap: 12px; font-size: 15px; }
.pick.selected, .pick:hover { background: var(--panel-raised); }
.pick-tag { font-family: var(--mono); font-size: 13px; width: 90px; flex-shrink: 0; }
.pick-name { display: flex; flex-direction: column; min-width: 0; }
.pick-name small { color: var(--text-2); }
.flag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--info); }
.picker-foot { margin: 0; padding: 6px 12px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--line); }

/* Job page */
.job-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; align-items: start; }
.scan-panel { position: sticky; top: 16px; }
@media (max-width: 900px) { .job-layout { grid-template-columns: minmax(0, 1fr); } .scan-panel { position: static; } }
.kit { display: flex; flex-direction: column; gap: 12px; }
.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.counts div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.counts strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.counts span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.kit-list { list-style: none; margin: 0; padding: 0; }
.kit-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.kit-list li.nested { padding-left: 20px; background: rgba(255, 255, 255, 0.02); }
.kit-main { flex: 1 1 220px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.kit-main small { flex-basis: 100%; }
.kit-main small:empty { display: none; }
.kit-actions { display: flex; gap: 4px; margin: 0; }

/* Labels and pick lists print black on white */
.labels .lbl { box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; padding: 2mm 3mm; background: #fff; color: #000; border: 1px dashed #999; text-align: center; font-family: var(--sans); }
.lbl .barcode { width: 100%; height: 13mm; display: block; }
.lbl-owner { width: 100%; font-size: 7.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl-tag { font-family: var(--mono); font-size: 10pt; font-weight: 700; line-height: 1.1; }
.lbl-name { width: 100%; font-size: 7pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.labels { gap: 0; }
.print-sheet { background: #fff; color: #000; border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.print-sheet header p { margin: 4px 0; }
.print-sheet .label { color: #555; }
.print-sheet .table th { color: #555; }
.print-sheet .table td { border-color: #ddd; }
.pick-table .tick { width: 42px; text-align: center; font-size: 18px; }
.pick-table tr.case-row td { font-weight: 700; }
.pick-table tr.nested td:nth-child(3) { padding-left: 14px; }

@media print {
  body, html { background: #fff !important; color: #000 !important; }
  .sidebar, .topbar, .subnav, .no-print, .messages { display: none !important; }
  .shell { display: block; }
  .main { padding: 0 !important; gap: 0 !important; }
  .labels .lbl { border: 0; }
  .print-sheet { padding: 0; }
  a { color: #000; text-decoration: none; }
}

/* Phones: the sidebar becomes a compact strip so pages (and the scanner) start near the top */
@media (max-width: 640px) {
  .sidebar { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .brand-word span { display: none; }
  .nav { flex-direction: row; width: 100%; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .nav a { flex-shrink: 0; min-height: 40px; padding: 0 10px; font-size: 14px; }
  .nav .soon, .sidebar-foot { display: none; }
  .main { gap: 20px; }
  .topbar { padding-bottom: 12px; }
}
@media (max-width: 640px) {
  .panel { padding: 16px; }
  .scan-row { flex-wrap: wrap; }
  .scan-row .scan-input { flex: 1 1 100%; }
  .scan-row .scan-go { flex: 1; }
}
/* Secondary submit buttons (the site-wide submit style is the copper primary) */
button.btn-quiet, button.btn-quiet:hover { background: transparent; border-color: #3a3a3a; color: var(--text); font-weight: 400; }
button.btn-quiet:hover { border-color: var(--text-2); }
button.link-btn, button.link-btn:hover { background: transparent; border: 0; font-weight: 400; color: var(--text-2); }
button.link-btn:hover { color: var(--copper); }
button.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); font-weight: 400; }
button.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #000; }
/* The scanner sits in a narrow column on the dispatch page: give the box its own row */
.scan-panel .scan-row { flex-wrap: wrap; }
.scan-panel .scan-row .scan-input { flex: 1 1 100%; }
.scan-panel .scan-row .scan-go { flex: 1; }
