/* Tri-State Job Profitability — colors and type from tri-stateoptical.com */
:root {
  --charcoal: #2F3337;
  --charcoal-2: #26292D;
  --teal: #63B8BD;
  --teal-ink: #2A7A80;
  --teal-deep: #1E5C61;
  --teal-wash: #E3F3F4;
  --teal-line: #A9D8DB;
  --orange: #F3950F;
  --ink: #2F3337;
  --ink-2: #4A5056;
  --muted: #6B7075;
  --ground: #F3F5F5;
  --card: #FFFFFF;
  --line: #DDE2E3;
  --line-2: #ECEFEF;
  --field: #C5CCCE;
  --input-edge: #8A9397;   /* 3:1 against white, so field edges are easy to see */
  --ok-bg: #E3F1E8;  --ok: #14532D;
  --warn-bg: #FEF3C7; --warn: #78350F; --warn-line: #D97706;
  --low-bg: #FFE4CC;  --low: #9A3412;
  --bad-bg: #FEE2E2;  --bad: #7F1D1D;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* hidden always wins over an element's own display style */
body { margin: 0; background: var(--ground); font-family: 'Lato', system-ui, sans-serif; color: var(--ink); font-size: 15px; }
a { color: var(--teal-ink); }
a:hover { color: var(--teal-deep); }
.num { font-variant-numeric: tabular-nums lining-nums; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* layout */
.layout { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 220px; max-width: 250px; background: var(--charcoal); color: #E8EEEE; padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; }
.brand { padding: 0 8px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.brand-name { font-family: 'Libre Baskerville', Georgia, serif; font-size: 19px; color: #fff; }
.brand-logo { display: block; width: 100%; max-width: 210px; height: auto; margin-bottom: 6px; }
.brand-sub { font-family: 'Libre Baskerville', Georgia, serif; font-style: italic; font-size: 12px; color: var(--teal); letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; border-radius: 8px; color: #D5DADD; text-decoration: none; font-size: 14px; }
.nav a:hover { background: #3A3F44; color: #fff; }
.nav a.on { background: var(--teal); color: #1F2326; font-weight: 700; }
.nav .count { background: var(--orange); color: var(--charcoal-2); font-weight: 700; font-size: 12px; border-radius: 99px; padding: 1px 8px; }
.side-foot {  font-size: 12px; color: #A9B0B5; padding: 0 8px; line-height: 1.5; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 700px) { .main { padding: 20px 16px 40px; } .side { max-width: none; } }

/* header */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 900; text-transform: uppercase; }
.eyebrow { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.badge { background: #E6E3D8; color: #3F3A2C; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--field); background: #fff; color: var(--ink); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--charcoal-2); }
.btn-primary:hover { background: #E08A0D; border-color: #E08A0D; }
.btn-danger { color: var(--bad); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-link { background: none; border: 0; color: var(--teal-ink); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; padding: 8px 6px; text-decoration: underline; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.card-pad { padding: 20px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card h2 { margin: 0; font-size: 17px; font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi strong { font-size: 28px; font-weight: 700; }

/* flashes */
.flashes { display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 700; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }

/* drop zone */
.drop { border: 2px dashed var(--teal-line); border-radius: 12px; background: #FBFCFC; padding: 18px 22px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.drop.over { background: var(--teal-wash); border-color: var(--teal); }
.drop-text { display: flex; align-items: center; gap: 14px; }
.drop-text strong { display: block; font-size: 15px; }
.drop-text small { color: var(--muted); font-size: 13px; }
.drop input[type=file] { display: none; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line-2); font-size: 14px; white-space: nowrap; }
td.wrap { white-space: normal; min-width: 160px; }
tbody tr:hover { background: #F8FAFA; }
tr:last-child td { border-bottom: 0; }
.table-foot { padding: 14px 20px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* pills & filters */
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.low { background: var(--low-bg); color: var(--low); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.is-low { color: var(--low); font-weight: 700; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 99px; font-size: 13px; font-weight: 700; text-decoration: none; background: #fff; color: var(--ink); border: 1px solid var(--field); }
.filters a.on { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.seg { display: flex; gap: 4px; background: #E6EBEC; padding: 4px; border-radius: 10px; }
.seg a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 7px; font-size: 13px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.seg a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* forms */
label, .label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
input[type=text], input:not([type]), input[type=password], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=search], select {
  min-height: 42px; border: 1px solid var(--input-edge); border-radius: 8px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--ink); background: #fff; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--teal-ink); outline-offset: 1px; border-color: var(--teal-ink); }
/* keyboard focus: a clear ring everywhere, teal on the dark sidebar */
:focus-visible { outline: 3px solid var(--teal-ink); outline-offset: 2px; }
.side :focus-visible { outline-color: var(--teal); }
::selection { background: var(--teal-line); color: var(--ink); }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--orange); color: var(--charcoal-2); font-weight: 700; padding: 10px 16px; border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.title-plain { text-transform: none !important; }
.check input, input.check { border: 2px solid var(--warn-line); background: #FFFBEB; }
.check-note { font-size: 12px; color: var(--warn); font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
@media (max-width: 900px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }

/* review */
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.viewer { flex: 1 1 400px; min-width: 0; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.viewer iframe, .viewer img { width: 100%; height: min(760px, 65vh); min-height: 360px; border: 1px solid var(--line); border-radius: 6px; background: #FAFAF8; object-fit: contain; }
/* The invoice stays in view while you scroll the form, but only when the two sit side by side.
   Stacked (narrower windows), a pinned invoice would slide over the form. */
@media (min-width: 1240px) {
  .viewer { position: sticky; top: 16px; }
  .viewer iframe, .viewer img { height: calc(100vh - 150px); max-height: 1000px; min-height: 460px; }
}
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.viewer-head strong { font-size: 14px; }
.viewer-head span { display: flex; gap: 14px; align-items: center; font-size: 13px; }
.profit-cols { display: flex; flex-direction: column; gap: 22px; }
.viewer .placeholder { height: 420px; border: 1px dashed var(--field); border-radius: 6px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 24px; font-size: 14px; background: #FAFBFB; }
.editor { flex: 1.3 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.lines { display: flex; flex-direction: column; gap: 8px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; }
.line.sell { grid-template-columns: 150px minmax(0, 1fr) 110px; }
.lines.with-del .line { grid-template-columns: minmax(0, 1fr) 110px 32px; align-items: center; }
.line input.amt { text-align: right; }
.totals-row { display: flex; justify-content: space-between; font-weight: 700; border-top: 1px solid var(--line); padding-top: 10px; font-size: 14px; }
.profit-band { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; background: var(--teal-wash); border-radius: 10px; padding: 16px 18px; }
.profit-band.low { background: var(--low-bg); }
.profit-band .big { display: flex; flex-direction: column; gap: 2px; }
.profit-band .big span { font-size: 12px; color: var(--ink); }
.profit-band .big strong { font-size: 26px; font-weight: 700; color: var(--teal-deep); }
.profit-band.low .big strong { color: var(--low); }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 900px) { .cols2 { grid-template-columns: 1fr; } }
.section-label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.flagbox { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 12px 16px; font-size: 14px; font-weight: 700; }
.history { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
details summary { cursor: pointer; font-weight: 700; font-size: 14px; }

/* reports */
.bar { position: relative; height: 12px; background: var(--line-2); border-radius: 99px; min-width: 160px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--teal-ink); }
.bar i.low { background: #C2410C; }
.bar b { position: absolute; top: -4px; width: 2px; height: 20px; background: var(--ink); }
.callouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.callout { border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 6px; background: #FFF7ED; border: 1px solid #FED7AA; }
.callout.teal { background: var(--teal-wash); border-color: var(--teal-line); }
.callout .k { font-size: 12px; font-weight: 700; color: var(--low); letter-spacing: .04em; text-transform: uppercase; }
.callout.teal .k { color: var(--teal-deep); }
.callout strong { font-size: 16px; }
.callout small { font-size: 13px; color: var(--ink-2); }
.range { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.range .field { width: 160px; }
label.btn { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }
label.btn-primary { color: var(--charcoal-2); }

/* nav sections */
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #A3ABB0;
  padding: 16px 12px 4px; margin-top: 12px; border-top: 1px solid #4A5157; }
.nav-label:first-child { padding-top: 0; margin-top: 0; border-top: 0; }

/* pricing calculator */
.calc { display: flex; flex-wrap: wrap; gap: 28px; padding: 20px; }
.calc-pick { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.calc-out { flex: 1.3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--field); border-radius: 99px; font-size: 14px; font-weight: 400; color: var(--ink); text-transform: none; letter-spacing: 0; cursor: pointer; background: #fff; }
.chip.on { background: var(--teal-wash); border-color: var(--teal); font-weight: 700; }
.chip input { width: 16px; height: 16px; accent-color: var(--teal-ink); }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; color: var(--ink); text-transform: none; letter-spacing: 0; }
.toggle input { width: 18px; height: 18px; accent-color: var(--teal-ink); }
.calc-price { background: var(--charcoal); color: #fff; border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.calc-price span { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--teal); }
.calc-price strong { font-size: 36px; font-weight: 900; }
.calc-price small { color: #C9D0D4; font-size: 13px; }
table.compare td, table.compare th { padding: 10px 12px; }
tr.best-row td { background: var(--teal-wash); }
td.best { background: var(--teal-wash); font-weight: 700; }

/* quote */
.suggest { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #F3F5F5; border-radius: 10px; padding: 12px 16px; }
.suggest div { display: flex; flex-direction: column; gap: 2px; }
.suggest strong { font-size: 22px; font-weight: 700; }

/* permissions & accounts */
fieldset.contents { display: contents; border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled input, fieldset:disabled select { background: #F6F8F8; color: var(--ink-2); }
.side-user { margin-top: auto; border-top: 1px solid #41474C; padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.side-user a { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.side-user a:hover, .side-user a.on { background: #3A3F44; }
.side-user .who { color: #fff; font-weight: 700; font-size: 14px; }
.side-user .role { color: #A9B0B5; font-size: 12px; }
.side-user .signout { background: none; border: 0; color: var(--teal); font: inherit; font-size: 13px; font-weight: 700; padding: 6px 12px; cursor: pointer; text-align: left; }
.side-user .signout:hover { color: #fff; }
.side-user + .side-foot { margin-top: 0; }
.auth-body { background: var(--charcoal); min-height: 100vh; }
.auth { max-width: 420px; margin: 0 auto; padding: 64px 16px; display: flex; flex-direction: column; gap: 22px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.auth-brand img { width: 280px; max-width: 100%; height: auto; }
.auth-card { background: #fff; border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { margin: 0; font-size: 24px; font-weight: 900; text-transform: uppercase; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn { width: 100%; }
.auth-note { margin: 0; font-size: 13px; }
.secret-box { border: 2px solid var(--teal); background: var(--teal-wash); display: flex; flex-direction: column; gap: 8px; }
code.secret { font-family: ui-monospace, Menlo, monospace; font-size: 17px; font-weight: 700; background: #fff; border: 1px solid var(--teal-line); border-radius: 6px; padding: 3px 8px; user-select: all; }
.perm-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.role-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; font-size: 14px; }
table.matrix td.center { text-align: center; }
table.matrix th.role-col { text-align: center; vertical-align: bottom; min-width: 130px; }
.role-name { font-weight: 700; text-align: center; min-height: 36px !important; font-size: 13px !important; margin-bottom: 4px; }
.role-name[readonly] { background: #F3F5F5; }
.perm-box { width: 20px; height: 20px; accent-color: var(--teal-ink); cursor: pointer; }
.perm-box:disabled { cursor: not-allowed; }
.role-col .role-name { display: block; width: 100%; }
.role-col .muted { display: block; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* retail */
.period { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; }
.period .range .field { width: 160px; }
.sale-line { grid-template-columns: minmax(0, 1fr) 120px; }
.totals { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 15px; }
.totals > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.totals .grand { font-size: 22px; font-weight: 900; border-top: 1px solid var(--line); padding-top: 10px; }
.delta { font-size: 12px; font-weight: 700; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--low); }
tr.voided td { color: var(--muted); text-decoration: line-through; }
tr.voided td:last-child { text-decoration: none; }
tr.tfoot td { font-weight: 900; border-top: 2px solid var(--line); background: #F8FAFA; }
.receipt { display: flex; flex-direction: column; gap: 14px; }
.receipt-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 3px solid var(--teal); padding-bottom: 12px; }
.r-name { font-family: 'Libre Baskerville', Georgia, serif; font-size: 22px; }
@media print {
  .side, .no-print, .flashes { display: none !important; }
  .main { padding: 0; }
  body { background: #fff; }
  .card { border: 0; }
}

/* retail dashboard */
.dash-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 1360px) { .dash-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 700px) { .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-tiles .kpi small { font-size: 13px; }
.dash-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.dash-row > .card { min-width: 0; }
.chart { position: relative; display: grid; grid-template-columns: 64px 1fr; grid-template-rows: 220px auto; padding: 20px 20px 8px 8px; }
.chart-grid { grid-column: 1 / 3; grid-row: 1; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.chart-grid .gl { border-top: 1px solid var(--line-2); height: 0; position: relative; }
.chart-grid .gl span { position: absolute; left: 0; top: -9px; width: 56px; text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-bars { grid-column: 2; grid-row: 1; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--field); position: relative; z-index: 1; }
.bar-col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; outline: none; }
.bar-col i { display: block; width: 100%; max-width: 22px; background: var(--teal-ink); border-radius: 4px 4px 0 0; min-height: 0; }
.bar-col.weekend i { background: var(--teal-line); }
.bar-col.today i { background: var(--orange); }
.bar-col:hover i, .bar-col:focus i { filter: brightness(.85); }
.bar-col .tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--charcoal); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; pointer-events: none; z-index: 3; line-height: 1.4; }
.bar-col { height: 100%; }
.bar-col:hover .tip, .bar-col:focus .tip { display: block; bottom: auto; top: 0; }
.avg-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--muted); z-index: 2; pointer-events: none; }
.avg-line span { position: absolute; right: 0; top: -16px; font-size: 11px; color: var(--muted); background: #fff; padding: 0 4px; }
.chart-x { grid-column: 2; grid-row: 2; display: flex; gap: 2px; padding-top: 6px; }
.chart-x span { flex: 1 1 0; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: visible; }
.table-view { padding: 0 20px 16px; }
.table-view summary { font-size: 13px; color: var(--teal-ink); }
.alerts { list-style: none; margin: 0; padding: 6px 0; }
.alerts a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; text-decoration: none; color: var(--ink); font-size: 14px; }
.alerts a:hover { background: #F8FAFA; }
.alerts li + li a { border-top: 1px solid var(--line-2); }
.alerts .chev { margin-left: auto; color: var(--muted); font-size: 20px; }
.dot { width: 10px; height: 10px; border-radius: 99px; flex: none; }
.dot.bad { background: #B91C1C; } .dot.warn { background: #D97706; } .dot.low { background: #C2410C; } .dot.ok { background: var(--ok); }
.mix-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.facts { margin: 0; padding: 8px 20px 16px; display: flex; flex-direction: column; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--ink-2); font-size: 14px; }
.facts dd { margin: 0; font-weight: 700; font-size: 16px; }

/* retail customers */
.cust-modes { flex-wrap: wrap; }
.cust-modes label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 7px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.cust-modes label.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.cust-modes input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cust-modes label:focus-within { outline: 2px solid var(--teal); outline-offset: 1px; }
.cust-card { border-color: var(--teal-line); }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li { padding: 12px 20px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; }
.history-list li:last-child { border-bottom: 0; }
.history-list .hl-top { display: flex; gap: 12px; align-items: baseline; font-size: 14px; }
.history-list .hl-top b { margin-left: auto; }
.history-list li.voided .hl-top b { text-decoration: line-through; color: var(--muted); }

/* automatic invoice reading */
.readbox { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-radius: 10px; background: #F4F6F6; border: 1px solid #E1E6E6; font-size: 14px; }
.readbox > div { display: flex; flex-direction: column; gap: 2px; }
.readbox small { font-size: 13px; color: var(--ink-2); }
.readbox.ok { background: var(--teal-wash); border-color: var(--teal-line); }
.readbox.bad { background: var(--bad-bg); border-color: #FCA5A5; color: var(--bad); }
.readbox.bad small { color: var(--bad); }
.readbox.reading { justify-content: flex-start; background: var(--teal-wash); border-color: var(--teal-line); }
.spinner { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 3px solid var(--teal-line); border-top-color: var(--teal-deep); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.readbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* home page */
.home-hello { text-transform: none !important; font-size: 32px; }
.home-alerts { display: flex; flex-direction: column; gap: 8px; }
.home-alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; text-decoration: none; color: var(--ink); background: var(--warn-bg); border: 1px solid #F6D58A; font-size: 14px; }
.home-alert.bad { background: var(--bad-bg); border-color: #FCA5A5; }
.home-alert .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn-line); flex: none; }
.home-alert.bad .dot { background: #B91C1C; }
.home-alert .go { margin-left: auto; color: var(--teal-deep); font-weight: 700; white-space: nowrap; }
.home-alert:hover .go { text-decoration: underline; }
.home-group { display: flex; flex-direction: column; gap: 12px; }
.home-group h2 { margin: 0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 4px; min-height: 132px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { border-color: var(--teal); box-shadow: 0 4px 14px rgba(47, 51, 55, .08); transform: translateY(-1px); color: var(--ink); }
.tile:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.tile-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.tile-icon { width: 34px; height: 34px; padding: 7px; border-radius: 9px; background: var(--teal-wash); color: var(--teal-deep); flex: none; }
.tile-title { font-weight: 700; font-size: 16px; }
.tile-stat { font-size: 28px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-stat.warn { color: var(--low); }
.tile-note { font-size: 13px; color: var(--ink-2); }
.tile-desc { font-size: 13px; color: var(--muted); margin-top: auto; padding-top: 6px; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }
.pill.plain { background: var(--line-2); color: var(--ink-2); }

/* pricing lookup */
.lookup-bar { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 0; }
.lookup-search { display: flex; gap: 10px; }
.lookup-search input { flex: 1; font-size: 18px; min-height: 50px; }
.lookup-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.lookup-filters select { width: auto; min-width: 170px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick button { border: 1px solid var(--teal-line); background: var(--teal-wash); color: var(--teal-deep); border-radius: 99px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.quick button:hover { border-color: var(--teal); }
.lookup-options { border-top: 1px solid var(--line); margin: 0 -20px; }
.lookup-options > summary { cursor: pointer; padding: 14px 20px; font-weight: 700; list-style-position: inside; }
.lookup-options > summary .muted { font-weight: 400; font-size: 13px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 8px 32px; padding: 0 20px 6px; }
.opt-col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 0 8px; }
.opt-col h3 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
#lcoat { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.units { display: flex; flex-direction: column; gap: 10px; }
.unit-row label { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }
.lookup-count { margin: 4px 2px -6px; font-size: 13px; color: var(--muted); }
.lookup-results { display: flex; flex-direction: column; gap: 16px; }
.lens-card { overflow: hidden; }
.lens-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px 12px; }
.lens-head h2 { margin: 0; font-size: 19px; }
.lens-sub { font-size: 13px; margin-top: 3px; }
.lens-note { font-size: 13px; margin-top: 6px; color: var(--warn); }
.labs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); border-top: 1px solid var(--line); }
.lab { padding: 14px 20px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lab + .lab { border-left: 1px solid var(--line); }
.lab.approved { background: #FBFDFD; }
.lab-head { display: flex; align-items: center; gap: 10px; }
.lab-price { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lab-price.muted { font-size: 17px; font-weight: 700; }
.lab-coat { font-size: 13px; }
.lab-lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.lab-lines th { font-size: 11px; color: var(--muted); font-weight: 700; text-align: left; padding: 2px 0; border-bottom: 1px solid var(--line-2); text-transform: uppercase; letter-spacing: .05em; }
.lab-lines th.right { text-align: right; padding-left: 10px; white-space: nowrap; }
.lab-lines td { padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.lab-lines td.right { padding-left: 10px; white-space: nowrap; }
.lab-lines td.unknown { color: var(--bad); font-weight: 700; }
.lab-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.lab-total strong { font-size: 16px; }
.lab-note { margin: 0; font-size: 13px; color: var(--ink-2); padding-left: 10px; border-left: 3px solid var(--line); }
.lab .mkquote { align-self: flex-start; margin-top: 4px; }
.postage-out { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; }
.postage-out strong { font-size: 22px; }
.margin-check > summary { cursor: pointer; list-style-position: inside; }
@media (max-width: 700px) { .lab + .lab { border-left: 0; border-top: 1px solid var(--line); } }

/* price list */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--ink-2); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--orange); }
.tabs a .muted { font-weight: 400; font-size: 13px; }
.price-in { width: 100px; text-align: right; margin-left: auto; display: block; }
tr.changed td { background: #FFFBEB; }
.save-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; bottom: 0; background: var(--card); }
.item-form { display: flex; flex-direction: column; gap: 16px; max-width: 900px; }
.radios { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.radios legend { font-weight: 700; margin-bottom: 4px; }
.radios label, .item-form .toggle { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); font-weight: 400; display: flex; gap: 8px; align-items: center; }
select.st-not_offered { color: var(--bad); }
select.st-call, select.st-hold { color: var(--warn); }
.remake-rule { margin: 0; font-size: 13px; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); }
.pill.remake { background: var(--warn-bg); color: var(--warn); }

/* delete controls */
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border: 1px solid #f1c9c4; }
.danger-zone .btn-danger { border-color: #e7b3ac; }
.danger-zone .btn-danger[disabled] { opacity: .5; cursor: not-allowed; }
.row-del { background: none; border: 0; padding: 6px; border-radius: 6px; color: var(--muted); cursor: pointer; line-height: 0; }
.row-del:hover, .row-del:focus-visible { color: var(--bad); background: #fbeceb; }

/* queue */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
tr.row-link { cursor: pointer; }
.day-step { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; border-radius: 8px; border: 1px solid var(--field); background: #fff; font-size: 18px; line-height: 1; text-decoration: none; }
.day-step:hover { border-color: var(--muted); }
@media (max-width: 1320px) { .wide-only { display: none; } }
.tax-zero { display: block; font-size: 13px; color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: 8px 10px; }

/* pricing lookup: what we make with each lab leads */
.lab.best { background: #F6FBFB; box-shadow: inset 0 3px 0 var(--teal); }
.pill.best { background: var(--teal-wash); color: var(--teal-deep); border: 1px solid var(--teal-line); }
.lab-profit { display: flex; flex-direction: column; gap: 1px; }
.lab-profit-k { font-size: 12px; color: var(--muted); font-weight: 700; }
.lab-profit strong { font-size: 26px; font-weight: 900; line-height: 1.15; color: var(--teal-deep); }
.lab-profit.low strong, .lab-profit.low .lab-margin { color: var(--low); }
.lab-profit.unknown strong { font-size: 17px; color: var(--muted); }
.lab-margin { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.lab-charge { font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.lab-charge b { color: var(--ink); }
.lens-tip { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--teal-deep); background: var(--teal-wash); border-radius: 8px; padding: 8px 10px; }

/* settings */
.page-index { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; font-weight: 700; margin-top: -8px; }
.settings-card { display: flex; flex-direction: column; gap: 16px; max-width: 760px; scroll-margin-top: 16px; }
.settings-card .note { margin: 0; font-size: 14px; line-height: 1.5; max-width: 68ch; }
.settings-card .note.small { font-size: 13px; }
.danger-card { border-color: #F1C9C4; }
.danger-card h2 { color: var(--bad); }
.danger-card .btn-danger { border-color: #E7B3AC; }
.kpi-sub { font-size: 13px; color: var(--ink-2); }

/* reports: margin compared with the average (centre line = average) */
.dev { display: flex; align-items: center; gap: 10px; }
.dbar { position: relative; flex: 1; min-width: 140px; height: 12px; background: var(--line-2); border-radius: 99px; }
.dbar::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.dbar i { position: absolute; top: 0; bottom: 0; background: var(--teal-ink); }
.dbar i.up { left: 50%; border-radius: 0 99px 99px 0; }
.dbar i.down { right: 50%; border-radius: 99px 0 0 99px; background: #A5ADB1; }
.dbar i.low { background: #C2410C; }
.dev-k { font-size: 13px; min-width: 70px; text-align: right; color: var(--ink-2); }

/* Pricing lookup: matches from the labs' price sheets */
.sheet-results { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.sheet-results-head h2 { margin: 0; font-size: 20px; }
.sheet-results-head p { margin: 4px 0 0; font-size: 13px; max-width: 80ch; }
.sheet-card .lens-head { align-items: center; }
.sheet-table th, .sheet-table td { padding: 8px 12px; }
.sheet-table td.wrap { white-space: normal; }

/* Job types: wholesale, retail, safety tier 1 and 2 */
.type-filters { padding: 10px 20px; border-bottom: 1px solid var(--line); }
.type-filters a { min-height: 32px; font-weight: 700; }
.pill.type-retail { background: var(--teal-wash); color: var(--teal-deep); }
.pill.type-safety1, .pill.type-safety2 { background: var(--warn-bg); color: var(--warn); }
.tier-prices { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 16px; margin: 0; }
.tier-prices legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
.tier-prices legend .muted { font-weight: 400; }
.type-filters .muted-n { font-weight: 400; margin-left: 3px; opacity: .8; }
.price-col { white-space: nowrap; }
.price-in::placeholder { color: var(--muted); opacity: .75; }
.price-in.is-call { color: var(--warn); font-weight: 700; }
.price-in { min-width: 84px; }
td:has(> .price-in) { white-space: nowrap; }

/* Sales price list: profit margin by sale type */
.margin-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .margin-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.margin-summary .kpi strong { font-size: 26px; }
.margin-summary .kpi strong.is-low { color: var(--low); }
.margin-note { font-size: 13px; margin: 4px 2px 0; max-width: 90ch; }
.mg { display: block; text-align: right; font-size: 11.5px; margin-top: 3px; color: var(--ink-2); white-space: nowrap; }
.mg.low { color: var(--low); font-weight: 700; }
.mg.loss { color: var(--bad); font-weight: 700; }
.cost-cell small { display: block; font-size: 11.5px; }
.tier-prices .mg { text-align: left; font-size: 12px; margin-top: 4px; }
.item-cost { font-size: 13px; margin: 10px 0 0; }
tr.row-link:hover { background: var(--teal-wash); }
tr.row-link:hover td:first-child { box-shadow: inset 3px 0 0 var(--teal); }
.mg.changed { font-weight: 700; }
.mg .was { font-weight: 400; color: var(--muted); }
#undo-prices { margin-top: 8px; }
.was-line { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.was-line .btn-link { font-size: 12px; padding: 0; min-height: 0; }
.price-history { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.price-history summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.price-history table { margin-top: 8px; }
.price-history td, .price-history th { padding: 6px 10px; font-size: 13px; }
.price-history .btn-link { font-size: 13px; padding: 0; min-height: 0; }

/* Mac practice copy: impossible to mistake for the live site */
.practice-banner { position: sticky; top: 0; z-index: 1000; padding: 7px 16px; text-align: center; font-size: 13.5px; color: #1F2326;
  background: repeating-linear-gradient(-45deg, #F3950F, #F3950F 14px, #F6AE45 14px, #F6AE45 28px); border-bottom: 2px solid #1F2326; }
.practice-banner strong { letter-spacing: .08em; }
.practice-banner a { color: #1F2326; font-weight: 700; }
body.is-practice .sidebar { box-shadow: inset 0 4px 0 #F3950F; }
.side-version { font-size: 11px; color: rgba(255,255,255,.45); padding: 6px 16px 12px; }
