[hidden] { display: none !important; }
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1d2329;
  --muted: #66707a;
  --line: #d9dde2;
  --brand: #1d315e;   /* logo navy */
  --brand-ink: #ffffff;
  --accent: #196fb6;  /* logo blue */
  --warn: #b3261e;
  --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
main { max-width: 1200px; margin: 0 auto; padding: 1.25rem 16px 4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.topbar { background: #fff; border-bottom: 4px solid var(--brand); display: flex; align-items: center;
  gap: 1.5rem; padding: .4rem 16px; flex-wrap: wrap; }
.brand { display: block; line-height: 0; }
.brand img { height: 56px; width: auto; }
.topbar .quote-btn { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.topbar .quote-btn:hover { background: #155d99; }
.topbar nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.topbar nav a { color: var(--brand); text-decoration: none; padding: .4rem .75rem; border-radius: 6px; font-weight: 600; }
.topbar nav a:hover { background: #e8eef7; }
.topbar nav a.active { background: var(--brand); color: var(--brand-ink); }
.topbar .who { margin-left: auto; display: flex; gap: .7rem; align-items: center; font-size: .9rem; white-space: nowrap; }
.topbar .who a { color: var(--brand); font-weight: 600; text-decoration: none; }
button.linkish { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font: inherit; text-decoration: underline; }

/* Admin dashboard */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
a.admin-card { display: block; color: inherit; text-decoration: none; }
a.admin-card:hover { border-color: var(--accent); }
a.admin-card h2 { margin: 0 0 .4rem; color: var(--brand); }
.btn.danger { color: #a12a2a; border-color: #e3b5b5; }

/* Sign-in page */
.login-box { max-width: 380px; margin: 8vh auto; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; }
.login-box img { height: 80px; display: block; margin: 0 auto 1rem; }
.login-box h1 { text-align: center; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.stack label { display: flex; flex-direction: column; gap: .25rem; }
.perms { border: 1px solid var(--line); border-radius: 6px; padding: .6rem 1rem; display: grid; gap: .4rem; }
.role-table td.center, .role-table th { text-align: center; }
.role-table td:first-child { text-align: left; }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.btn { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: .5rem .9rem; border-radius: 6px; font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #aab1b9; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.small { padding: .25rem .6rem; font-size: .85rem; }
.btn.big { width: 100%; padding: .75rem; font-size: 1.05rem; margin: .5rem 0; }
.btn:disabled { opacity: .6; cursor: wait; }
.icon { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: .2rem .4rem; }
.icon:hover { color: var(--warn); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.alert { background: #fdecea; border: 1px solid #f3b9b4; color: var(--warn); padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.warn-text { color: var(--warn); }
.notice { background: #e8f3ea; border: 1px solid #b6d9bd; padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; }

input, select, textarea { font: inherit; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc3e0; border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--ink); font-size: .95rem; }
label.check input { width: auto; }
.row { display: flex; gap: .5rem; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem 1rem; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .actions { justify-content: flex-end; }
.form-row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.form-row label { flex: 1 1 160px; }
form.inline { display: inline-flex; gap: .4rem; align-items: center; }
form.inline input { width: 7.5rem; }
form.inline select { width: auto; }
.search { display: flex; gap: .5rem; margin-bottom: 1rem; max-width: 520px; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs a.active { color: var(--ink); border-color: var(--brand); font-weight: 600; }

table { border-collapse: collapse; width: 100%; }
table.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); text-align: left; }
table.list th { background: #eef0f3; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.num { text-align: right !important; white-space: nowrap; }
.empty { text-align: center !important; color: var(--muted); padding: 1.5rem !important; }

.badge { font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; font-weight: 600; white-space: nowrap; background: #e6e9ed; color: #3b444d; }
.badge-quote { background: #eef1f5; color: #4b5763; }
.badge-confirmed { background: #e3eefb; color: #1f5f8b; }
.badge-in_production { background: #fff1d6; color: #8a5a00; }
.badge-ready { background: #e2f4e5; color: #1f6d33; }
.badge-completed { background: #d3eed9; color: #145826; }
.badge-invoiced { background: #e9e3f7; color: #4f3a8c; }
.badge-cancelled { background: #f6e1df; color: #8f2a20; }

dl.details { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; }

/* ---- cut sheet view ---- */
.sheet { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; border-bottom: 3px solid var(--brand); padding-bottom: .7rem; margin-bottom: 1rem; }
.sheet-no { text-align: right; }
.doc-title { font-size: 1.6rem; font-weight: 800; letter-spacing: .08em; color: var(--brand); }
label.inline-date { flex-direction: row; align-items: center; gap: .3rem; }
label.inline-date input { width: auto; }
.sheet-brand img { height: 72px; width: auto; display: block; margin-bottom: .3rem; }
/* Need by, customer and PO big on the cut sheet, to find a job in a stack (Tyler 2026-11-12). */
/* Three boxes that share the width; long names wrap between words, not mid-word (Tyler 2026-11-12). */
.sheet-key { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.5fr) minmax(0, 1.15fr); gap: .6rem; margin: 0 0 1rem; }
.sheet-key .key { border: 2px solid var(--ink, #1d2733); border-radius: 6px; padding: .35rem .7rem; min-width: 0; }
.sheet-key .key span { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sheet-key .key strong { display: block; font-size: 1.4rem; line-height: 1.2; overflow-wrap: break-word; }
.sheet-key .key a { color: inherit; text-decoration: none; }
.sheet-key .key .key-rep { text-transform: none; letter-spacing: 0; font-size: .95rem; color: inherit; margin-top: .2rem; }
.sheet-key .key .key-rep strong { display: inline; font-size: 1.05rem; }
.sheet-key .key-need { border-width: 4px; }
.sheet-key .key-need strong { font-size: 1.9rem; }
@media (max-width: 700px) { .sheet-key { grid-template-columns: 1fr; } }
@media print { .sheet-key .key { border-color: #000; } .sheet-key .key strong { font-size: 17pt; } .sheet-key .key .key-rep strong { font-size: 12pt; } .sheet-key .key-need strong { font-size: 20pt; } }
.sheet-fields { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.sheet-fields dt { color: var(--muted); font-size: .85rem; }
.sheet-fields dd { margin: 0; border-bottom: 1px solid var(--line); min-height: 1.3em; }
h3.area { margin: 1.2rem 0 .3rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; display: flex; justify-content: space-between; }
.area-total { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--accent); }
table.lines th, table.lines td { border: 1px solid var(--line); padding: .4rem .5rem; text-align: left; vertical-align: top; }
table.lines th { background: #eef0f3; font-size: .78rem; text-transform: uppercase; color: var(--muted); }
.sheet-foot { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; margin-top: 1.2rem; align-items: start; }
table.shop-use th, table.shop-use td { border: 1px solid var(--line); padding: .45rem .5rem; text-align: left; }
table.shop-use th { background: #eef0f3; font-size: .78rem; color: var(--muted); width: 7rem; }
table.totals th { text-align: left; font-weight: normal; color: var(--muted); padding: .3rem 0; }
table.totals td { text-align: right; padding: .3rem 0; white-space: nowrap; }
table.totals tr.grand th, table.totals tr.grand td { font-weight: 700; color: var(--ink); font-size: 1.1rem; border-top: 2px solid var(--ink); padding-top: .5rem; }

/* ---- order form ---- */
fieldset.section { min-width: 0; }
.section { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin: 0 0 1rem; padding: .8rem 1rem 1rem; }
.section-head { flex-wrap: wrap; display: flex; gap: .6rem; align-items: center; margin-bottom: .6rem; }
.section-head select { width: 8rem; font-weight: 700; text-transform: uppercase; }
.section-head input { max-width: 22rem; }
.section-total { margin-left: auto; font-weight: 600; color: var(--accent); white-space: nowrap; }
table.lines.edit td { padding: .3rem; vertical-align: middle; }
table.lines.edit input, table.lines.edit select { padding: .35rem .4rem; }
table.lines.edit .qty { width: 4.5rem; }
table.lines.edit td.len { white-space: nowrap; }
table.lines.edit .ft { width: 3.6rem; }
table.lines.edit .in { width: 4.6rem; }
table.lines.edit .product { min-width: 15rem; }
table.lines.edit .desc { margin-top: .25rem; font-size: .85rem; padding: .2rem .4rem; border-style: dashed; }
table.lines.edit .w-num { width: 4.6rem; }
table.lines.edit .price { width: 5.6rem; }
table.lines.edit td.price-cell, table.lines.edit td.width { white-space: nowrap; }
table.lines.edit .color { min-width: 9.5rem; }
table.lines.edit .ft.missing, table.lines.edit .price.missing { border-color: var(--warn); background: #fff6f5; }
table.lines.edit td.billed, table.lines.edit td.amount { min-width: 6rem; }
.unit { color: var(--muted); padding: 0 .15rem; }
.fixed-width { color: var(--muted); white-space: nowrap; }
.form-foot { display: grid; grid-template-columns: 1fr 320px; gap: 1rem; margin-top: 1rem; align-items: start; }

@media (max-width: 860px) {
  .form-grid, .form-foot, .sheet-foot { grid-template-columns: 1fr 1fr; }
  .form-foot, .sheet-foot { grid-template-columns: 1fr; }
  .sheet-fields { grid-template-columns: max-content 1fr; }
  .section, .sheet { overflow-x: auto; }
  table.list { display: block; overflow-x: auto; }
}

/* Drawings attached to an order */
.drawings { margin-top: 1.5rem; }
.drawing { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; margin-bottom: 1rem; }
.drawing-head { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin-bottom: .6rem; }
.drawing-head .actions { margin-left: auto; }
.drawing img { max-width: 100%; max-height: 80vh; display: block; margin: 0 auto; border: 1px solid var(--line); background: #fff; }
.drawing object { width: 100%; height: 75vh; border: 1px solid var(--line); }
.attach-form { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; }
.attach-form label { display: flex; flex-direction: column; gap: .2rem; }
.print-only { display: none; }

@media print {
  .print-only { display: block; }
  .drawings { break-before: page; }
  .drawing { border: 0; padding: 0; break-inside: avoid; }
  .drawing img { max-height: 9in; border: 0; }
  body { background: #fff; font-size: 12px; }
  .topbar, .no-print { display: none !important; }
  main { padding: 0; max-width: none; }
  .sheet { border: 0; padding: 0; }
  a { color: inherit; text-decoration: none; }
}
tr.inactive td { color: var(--muted); }
/* Automatic screws on the order form */
.section.screws .screws-head { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; }
.section.screws .screws-head label { display: flex; flex-direction: row; align-items: center; gap: .4rem; }
.section.screws .screws-head select { width: auto; text-transform: none; font-weight: 400; }
.missing-text { color: #a12a2a; font-weight: 600; }
.screw-opt { display: flex; flex-direction: row; align-items: center; gap: .35rem; font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.screw-opt select { width: auto; padding: .1rem .3rem; font-size: .8rem; }

/* Reports */
.report-range { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.report-range .presets { display: flex; flex-wrap: wrap; gap: .3rem; width: 100%; }
.report-range .presets a { padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--brand); font-size: .9rem; }
.report-range .presets a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.report-range label { display: flex; gap: .4rem; align-items: center; }
.report-nav { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .2rem 0 .5rem; font-size: .9rem; }
.rtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; }
.rtile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.rtiles.now .rtile { background: #f7f9fc; }
.rtile .n { font-size: 1.6rem; font-weight: 700; color: var(--brand); }
.rtile .label { font-weight: 600; }
.rtile .sub { color: var(--muted); font-size: .85rem; }
.rtiles.now { margin: .8rem 0 1rem; }
.delta { font-size: .85rem; font-weight: 600; }
.delta.up { color: #1f7a3a; }
.delta.down { color: var(--warn); }
.delta.flat { color: var(--muted); font-weight: 400; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 1rem; }
.report-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.report-head h3 { margin: 0 0 .5rem; font-size: 1rem; }
.report-table .table-wrap { overflow-x: auto; }
.report-table table { width: 100%; }
.report-table td.num, .report-table th.num { text-align: right; white-space: nowrap; }
table.sortable th { cursor: pointer; user-select: none; }
table.sortable th[data-dir="asc"]::after { content: " ▲"; font-size: .7em; }
table.sortable th[data-dir="desc"]::after { content: " ▼"; font-size: .7em; }
.chart { margin: 0; }
.chart figcaption { font-weight: 600; margin-bottom: .4rem; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.chart .legend { font-weight: 400; font-size: .85rem; display: flex; gap: .8rem; }
.chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .3rem; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.s-quoted { fill: #9db8d9; background: #9db8d9; }
.s-sold { fill: var(--brand); background: var(--brand); }
.s-run { fill: var(--accent); background: var(--accent); }
.report-table th:not(.num), .report-table td:not(.num) { text-align: left; }

/* Supplies and tools */
table.supplies tr.low td { background: #fff4f2; }
.low-tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; color: #fff;
  background: var(--warn); border-radius: 4px; padding: 0 .35rem; margin-left: .3rem; vertical-align: middle; }
.tool-out { font-weight: 600; }
.tool-out.late { color: var(--warn); }
.tool-repair { color: #8a5a00; font-weight: 600; }
.tool-retired { color: var(--muted); }
.rtile.warn .n { color: var(--warn); }
.rental-out { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-left: .5rem; }
.low-text { color: var(--warn); font-weight: 600; }

/* Scan box, labels, pack and check */
.scan-box input { width: 11rem; padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .9rem; }
.scan-big { display: flex; gap: .8rem; align-items: end; flex-wrap: wrap; }
.scan-big label { display: flex; flex-direction: column; gap: .3rem; flex: 1; min-width: 240px; font-weight: 600; }
.scan-big input { font-size: 1.3rem; padding: .6rem .8rem; }
.pack-flash { font-size: 1.15rem; font-weight: 600; }
.pack-flash.ok { background: #e7f6ec; border: 1px solid #9ad3ab; color: #1f5f33; padding: .7rem 1rem; border-radius: var(--radius); }
.pack-progress { height: 12px; background: #e3e7ec; border-radius: 6px; overflow: hidden; margin-top: 1rem; }
.pack-progress div { height: 100%; background: #2f8f4e; }
table.pack tr.packed td { background: #f0faf3; }
.pack-done { display: flex; gap: 1rem; align-items: center; background: #e7f6ec; border-color: #9ad3ab; }

.labels { display: flex; flex-wrap: wrap; gap: .5rem; }
.labels .label { display: flex; gap: .12in; background: #fff; color: #000; border: 1px dashed #bbb; overflow: hidden;
  width: 4in; height: 2in; padding: .12in; break-inside: avoid; page-break-inside: avoid; }
.labels .label .qr { flex: none; width: 1.7in; height: 1.7in; }
.labels .label .qr svg { width: 100%; height: 100%; display: block; }
.labels .label .text { min-width: 0; display: flex; flex-direction: column; gap: .02in; font-size: 9.5pt; line-height: 1.2; }
.labels .label .big { font-size: 15pt; font-weight: 800; }
.labels .label .title { font-size: 11pt; font-weight: 700; }
.labels .label .code { margin-top: auto; font-family: ui-monospace, monospace; font-size: 9pt; color: #333; }
.labels-small .label { width: 2.25in; height: 1.25in; padding: .06in; gap: .06in; }
.labels-small .label .qr { width: 1.1in; height: 1.1in; }
.labels-small .label .text { font-size: 6.5pt; }
.labels-small .label .big { font-size: 9pt; }
.labels-small .label .title { font-size: 7.5pt; }
.labels-small .label .line:nth-of-type(n+4) { display: none; }
@media print {
  .label-tools, .topbar { display: none !important; }
  main { padding: 0 !important; max-width: none !important; }
  body { background: #fff; }
  .labels { gap: 0; }
  .labels .label { border: none; }
  .labels-sheet { display: grid; grid-template-columns: 4in 4in; column-gap: .188in; row-gap: 0; }
  .labels-roll .label, .labels-small .label { page-break-after: always; break-after: page; }
}
table.pack tbody.pack-line { border-top: 2px solid var(--line); }
table.pack tr.bundle td:nth-child(2) { padding-left: 1.6rem; color: var(--muted); }
table.pack tr.bundle.packed td:nth-child(2) { color: var(--ink); }
.bundle-split { display: inline-flex; gap: .4rem; align-items: center; }
.bundle-split input { width: 8rem; }
.bundle-split label { display: inline-flex; gap: .4rem; align-items: center; flex-direction: row; font-size: .9rem; }

/* Reports dropdown in the menu */
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; cursor: pointer; color: var(--brand); padding: .4rem .75rem; border-radius: 6px; font-weight: 600; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: " ▾"; font-size: .8em; }
.nav-menu summary:hover, .nav-menu[open] summary { background: #e8eef7; }
.nav-menu summary.active { background: var(--brand); color: var(--brand-ink); }
.nav-drop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 50; min-width: 190px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: .3rem;
  display: flex; flex-direction: column; }
.topbar nav .nav-drop a { padding: .5rem .75rem; }
.handoff .big-name { font-size: 1.6rem; font-weight: 700; color: var(--brand); }
.btn.big-btn { font-size: 1.1rem; padding: .7rem 1.4rem; }
.check-list { display: flex; flex-direction: column; gap: .3rem; margin: .5rem 0 1rem; }
.legal { max-width: 45rem; }

/* Printing reports, inventory pages and count sheets */
.printed-line { font-size: .8rem; color: #555; margin: 0 0 .6rem; }
h2 .section-print { margin-left: .8rem; vertical-align: middle; font-weight: 400; }
@media print {
  .page-head .actions, form, details, button, .btn, .scan-box, .report-nav, .section-print, .print-hide { display: none !important; }
  table.list { font-size: 11px; }
  table.list tr { break-inside: avoid; }
  table.list thead { display: table-header-group; }
  h2 { break-after: avoid; }
  .rtiles { grid-template-columns: repeat(4, 1fr); }
  .rtile { padding: .4rem .6rem; }
  svg { max-width: 100%; }
}
/* Count sheets */
.count-sheet h1 { margin-bottom: .2rem; }
.count-sheet table.count { width: 100%; border-collapse: collapse; font-size: .95rem; }
.count-sheet table.count th, .count-sheet table.count td { border: 1px solid #999; padding: .35rem .45rem; text-align: left; vertical-align: top; }
.count-sheet table.count th { background: #eef1f6; }
.count-sheet table.count td.box { width: 7rem; min-width: 7rem; }
.count-sheet table.count td.wide { width: 16rem; min-width: 12rem; }
.count-sheet table.count td.num, .count-sheet table.count th.num { text-align: right; }
.count-sheet h2 { margin: 1rem 0 .3rem; font-size: 1.05rem; }
.count-sheet .signoff { display: flex; gap: 2rem; margin-top: 1.2rem; }
.count-sheet .signoff span { flex: 1; border-bottom: 1px solid #333; padding-bottom: .2rem; }
.count-opts { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
@media print {
  .count-sheet { font-size: 11px; }
  .count-sheet table.count th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .count-sheet table.count tr { break-inside: avoid; }
  /* Coil and flat sheet sheets: one-line rows, filled out to the end of a letter page. */
  .count-sheet { page: countsheet; }
  .count-sheet table.count.fill { table-layout: fixed; }
  .count-sheet table.count.fill td { height: .3in; padding-top: 0; padding-bottom: 0; vertical-align: middle;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: auto; min-width: 0; }
}
@page countsheet { size: letter; margin: .5in; }

/* ---- customer portal ---------------------------------------------------- */
.portal-bar { border-radius: var(--radius); margin-bottom: 1rem; }
.portal-bar .who span { color: var(--muted); }
.portal-foot { margin-top: 3rem; text-align: center; }
.portal-answer { display: grid; gap: .8rem; margin-top: 1rem; max-width: 760px; }
.portal-answer h2 { margin: 0; }
.portal-answer details summary { cursor: pointer; font-weight: 600; }
.portal-answer details form { margin-top: .8rem; }
ol.steps { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: 0 0 1rem; counter-reset: step; }
ol.steps li { counter-increment: step; padding: .35rem .7rem .35rem .5rem; border-radius: 999px; background: #eef1f5; color: var(--muted); font-size: .9rem; }
ol.steps li::before { content: counter(step); display: inline-block; width: 1.3rem; height: 1.3rem; line-height: 1.3rem; text-align: center;
  border-radius: 50%; background: #fff; margin-right: .35rem; font-size: .8rem; font-weight: 700; }
ol.steps li.done { background: #d3eed9; color: #145826; }
ol.steps li.done::before { content: '✓'; }
ol.steps li.current { background: var(--brand); color: #fff; font-weight: 600; }
ol.steps li.current::before { color: var(--brand); }
.portal-settings { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; margin-bottom: .8rem; }
.invite-link { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.invite-link input { flex: 1 1 18rem; min-width: 0; font-size: .85rem; }
tr.invite-row td { border-top: 0; padding-top: 0; }
@media print { .portal-bar, .portal-foot, ol.steps { display: none; } }
.portal-answer .form-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .portal .sheet { overflow-x: auto; } .portal .sheet table.lines { min-width: 560px; } }
/* Portal quote form for a customer who doesn't see line prices. */
.hide-prices .price-cell, .hide-prices .amount, .hide-prices .price-col, .hide-prices .amount-col { display: none; }
.order-form input.price[readonly] { border-color: transparent; background: transparent; }
/* Length check photos */
.photo-cell { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.photo-cell img { width: 96px; height: 72px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); display: block; }
.photos .photo-cell img { width: 160px; height: 120px; }
.photo-btn { cursor: pointer; }
tr.needs-photo td:first-child { box-shadow: inset 4px 0 0 #e0a100; }
.handoff-info { max-width: 760px; }

/* Quote form: "I've added any other accessories" reminder by the Save button */
label.accessories-check { align-items: flex-start; font-size: .9rem; margin: .5rem 0; }
label.accessories-check input { margin-top: .2rem; }
label.accessories-check.missing { color: var(--danger, #b42318); font-weight: 600; }

/* Type-to-search dropdowns (public/combo.js) */
.combo { position: relative; display: block; flex: 1; min-width: 0; }
.combo-hidden { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; left: 0; bottom: 0; }
.combo-list { position: absolute; z-index: 50; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: .2rem 0; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.15);
  max-height: 320px; overflow-y: auto; min-width: 16rem; text-align: left; }
.combo-option { padding: .35rem .6rem; cursor: pointer; }
.combo-option.active, .combo-option:hover { background: #e6f0f8; }
.combo-group { padding: .35rem .6rem .15rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--muted, #666); }
.combo-empty { padding: .35rem .6rem; color: var(--muted, #666); }
fieldset.gauge-picks { border: 1px solid var(--line, #ddd); border-radius: 6px; padding: .3rem .6rem; display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
fieldset.gauge-picks legend { font-size: .85em; color: var(--muted); padding: 0 .3rem; }
fieldset.gauge-picks label { flex: 0 0 auto; }
/* Done boxes on the cut list */
.done-col { white-space: nowrap; width: 1%; }
.done-label { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.done-label input { width: 1.3rem; height: 1.3rem; }
.done-mark { font-size: .85em; }
.done-box { font-size: 1.2em; }
tr.line-done td { background: #eef7ee; }
.prices-block { margin-top: 1.5rem; }
.prices-block .totals { margin: .8rem 0 0 auto; }
details#production { margin-top: 1.5rem; }
details#production > summary { cursor: pointer; }
h2.inline-h { display: inline; }
/* Roof pitch on trim lines (Tyler 2026-11-12) */
.order-form label.pitch-opt, label.pitch-opt { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .3rem; font-size: .85rem; margin-top: .3rem; }
.order-form .pitch-opt input.pitch-in, .pitch-opt input.pitch-in { width: 3.2rem; flex: none; }
.pitch-opt .unit { flex: none; }
.pitch-opt input.missing { border-color: var(--danger, #c0392b); }
.lines .pitch { white-space: nowrap; margin-left: .4rem; }

/* Upload a drawing on a quote line (Tyler 2026-11-12). */
.line-files { display: flex; flex-wrap: wrap; align-items: center; margin-top: .3rem; font-size: .85rem; }
.line-files > * { margin-right: .5rem; margin-bottom: .2rem; }
.order-form label.upload-btn { display: inline-block; cursor: pointer; margin: 0 .5rem .2rem 0; }
.line-files .file-name { overflow-wrap: anywhere; }
.drawing-reminder { margin: .5rem 0; }
/* Drawings shown inside their line on the quote page and the edit form (Tyler 2026-11-12). */
.line-drawings { display: flex; flex-wrap: wrap; align-items: flex-start; margin-top: .3rem; width: 100%; }
.line-drawings > * { margin: 0 .5rem .4rem 0; }
.line-thumb img { display: block; max-width: 100%; max-height: 520px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.line-drawing-row td { border-top: 0; padding-top: 0; }
.line-drawing { margin: 0 .6rem .5rem 0; max-width: 100%; }
.line-drawing > a.small { display: block; }
.pdf-pages canvas { display: block; max-width: 100%; max-height: 520px; width: auto; height: auto; border: 1px solid var(--line); background: #fff; margin: 0 0 .3rem; }
@media print {
  .line-drawings { display: block; }
  .line-thumb, .pdf-pages canvas { display: block; break-inside: avoid; page-break-inside: avoid; margin: 0 0 .1in; }
  .pdf-pages canvas { max-height: 4.5in; border-color: #999; }
  .line-thumb img { max-width: 100%; max-height: 4.5in; border-color: #999; }
}
/* Count of customer quotes waiting on the office, on the menu (Tyler 2026-11-12). */
.nav-badge { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 1em; background: #d93025; color: #fff;
  font-size: .75rem; font-weight: 700; line-height: 1.4; text-align: center; vertical-align: middle; }
.need-by-note { margin: -.3rem 0 0; color: var(--muted); }
.need-by-note.rush { color: #a4262c; font-weight: 600; }

/* Phones (Tyler 2026-11-16): the menu folds behind a button and pages fit the screen. */
.topbar .menu-btn { display: none; }
@media (max-width: 700px) {
  .topbar { gap: .5rem; padding: .4rem 12px; }
  .brand img { height: 40px; }
  .topbar .menu-btn { display: inline-block; margin-left: auto; background: #fff; border: 1px solid var(--line);
    border-radius: 6px; padding: .5rem .8rem; font: inherit; font-weight: 700; color: var(--brand); cursor: pointer; }
  .topbar nav, .topbar .scan-box, .topbar .who { display: none; }
  .topbar.open nav { display: flex; flex-direction: column; width: 100%; }
  .topbar.open .scan-box { display: block; width: 100%; }
  .topbar.open .scan-box input { width: 100%; }
  .topbar.open .who { display: flex; margin-left: 0; white-space: normal; flex-wrap: wrap; width: 100%; padding: .3rem .75rem .6rem; }
  .topbar nav a, .nav-menu summary { padding: .75rem; }
  .nav-drop { position: static; box-shadow: none; border: 0; min-width: 0; padding-left: 1rem; }
  main { padding: 1rem 12px 3rem; }
  h1 { font-size: 1.3rem; }
  .page-head .actions { flex-wrap: wrap; }
  .page-head .actions form.inline { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
  input, select, textarea { max-width: 100%; }
}

/* Shop photos page, made for a phone (Tyler 2026-11-16) */
.shop-search { display: flex; gap: .5rem; margin-bottom: 1rem; }
.shop-search input { flex: 1; min-width: 0; padding: .6rem; font-size: 1rem; }
.shop-jobs { display: flex; flex-direction: column; gap: .6rem; }
.shop-job { display: flex; flex-direction: column; gap: .25rem; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .8rem 1rem; color: var(--ink); text-decoration: none; }
.shop-job:active, .shop-job:hover { border-color: var(--accent); }
.shop-job-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: 1.1rem; }
.shop-need { margin-left: auto; font-size: .95rem; font-weight: 600; }
.shop-cust { font-size: 1rem; }
.shop-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .8rem; }
.shop-card h2 { margin-top: 0; }
.shop-card.has-photo { border-left: 5px solid #2e7d4f; }
.shop-line { display: flex; gap: .7rem; align-items: baseline; font-size: 1.05rem; }
.shop-line-no { color: var(--muted); min-width: 1.4rem; }
.shop-check { margin-left: auto; color: #2e7d4f; font-weight: 700; font-size: 1.3rem; }
.shop-thumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.shop-thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.shop-photo { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; align-items: center; }
.shop-photo .big-photo { flex: 1 1 9rem; text-align: center; padding: .85rem; font-size: 1.05rem; font-weight: 700; }
.shop-photo .photo-status { flex-basis: 100%; }

/* The test copy of the site says so on every page (Tyler 2026-11-17). */
.site-label { background: #b45309; color: #fff; text-align: center; font-weight: 700; padding: .35rem 12px; font-size: .9rem; }
.site-label a { color: #fff; }
@media print { .site-label { display: none; } }
