:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #17171a;
  --ink-2: #55565c;
  --ink-3: #8a8b91;
  --line: #e3e3df;
  --side: #141416;
  --side-ink: #c9c9cd;
  --accent: #89cff0;
  --accent-ink: #0b0b0d;
  --blue: #2563eb;
  --green: #15803d;
  --red: #c2410c;
  --amber-bg: #e6f4fc;
  --red-bg: #fde8e1;
  --green-bg: #e2f4e8;
  --radius: 8px;
  font-family: -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.2px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 13px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-2); }

/* Layout */
.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; padding: 0 8px 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.brand small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 9px 10px; border-radius: 6px; margin-bottom: 2px; }
.nav a:hover { background: #222226; text-decoration: none; color: #fff; }
.nav a.on { background: #26262b; color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side .me { margin-top: auto; font-size: 12px; padding: 8px 10px; border-top: 1px solid #2a2a2e; }
.side .me a { color: var(--ink-3); }
.main { padding: 24px 28px 60px; min-width: 0; }
.shell > div { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar .spacer { flex: 1; }
.mobile-nav { display: none; }

/* Controls */
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 13px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
button:hover, .btn:hover { border-color: #c8c8c3; text-decoration: none; }
.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.primary:hover { background: #000; }
.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.danger { color: var(--red); }
.link { border: 0; background: none; color: var(--blue); padding: 0; }
.small { padding: 4px 9px; font-size: 12px; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: #fff; color: var(--ink); width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.search { max-width: 320px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters select { width: auto; }

/* Panels & tables */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel.flush { padding: 0; overflow: hidden; }
table.list { width: 100%; border-collapse: collapse; background: var(--panel); }
.list th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafaf8; }
.list td { padding: 10px 12px; border-bottom: 1px solid #efefeb; vertical-align: top; }
.list tr.clickable:hover td { background: #fbfaf5; cursor: pointer; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sub { color: var(--ink-2); font-size: 12px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 12px; }

/* Badges */
.badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 99px; background: #eeeeea; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.badge.Draft { background: #eeeeea; }
.badge.Sent { background: #e0e9fd; color: #1e40af; }
.badge.Approved, .badge.Ordered, .badge.Paid, .badge.Complete { background: var(--green-bg); color: var(--green); }
.badge.Expired, .badge.Void, .badge.Declined, .badge.inactive { background: #f0f0ee; color: var(--ink-3); }
.badge.Open { background: var(--amber-bg); color: #1d5d84; }
.badge.Partial { background: #ffe9cc; color: #9a4b00; }
.badge.Rush, .badge.late { background: var(--red-bg); color: var(--red); }
.badge.flag { background: var(--amber-bg); color: #1d5d84; font-weight: 500; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.stat span { font-size: 12px; color: var(--ink-2); }
.stat.warn b { color: var(--red); }

/* Job board */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { flex: 0 0 236px; background: #ebebe7; border-radius: var(--radius); padding: 8px; min-height: 200px; }
.col.over { background: #e2e0d2; outline: 2px dashed var(--accent); }
.col-head { display: flex; justify-content: space-between; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-2); padding: 4px 6px 10px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin-bottom: 8px; cursor: grab; box-shadow: 0 1px 0 rgba(0,0,0,.03); }
.card:hover { border-color: #c9c9c3; }
.card.dragging { opacity: .4; }
.card .t { font-weight: 600; margin: 2px 0; }
.card .row { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.card.rush { box-shadow: inset 3px 0 0 var(--red); }

/* Document editor */
.doc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.doc-head .spacer { flex: 1; }
.doc-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
table.lines { width: 100%; border-collapse: collapse; }
.lines th { font-size: 11px; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 6px; border-bottom: 1px solid var(--line); font-weight: 600; }
.lines td { padding: 6px; border-bottom: 1px solid #f0f0ec; vertical-align: top; }
.lines input, .lines select { padding: 6px 7px; }
.lines .w-num { width: 74px; }
.lines .w-money { width: 96px; }
.lines .hint { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.lines .hint.warn { color: var(--red); }
.lines .manual { background: var(--amber-bg); }
.totals-box div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals-box .grand { font-weight: 700; font-size: 18px; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; }
.activity { max-height: 300px; overflow: auto; font-size: 12px; }
.activity div { padding: 6px 0; border-bottom: 1px solid #f0f0ec; }

/* Grid editor */
.grid-editor table { border-collapse: collapse; }
.grid-editor td, .grid-editor th { border: 1px solid var(--line); padding: 0; }
.grid-editor input { border: 0; border-radius: 0; width: 100px; text-align: right; }
.grid-editor th input { font-weight: 600; text-align: center; background: #fafaf8; }

/* Picker dropdown */
.picker { position: relative; }
.picker-list { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 320px; overflow: auto; margin-top: 2px; min-width: 280px; }
.picker-list div { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid #f3f3ef; }
.picker-list div:hover, .picker-list div.hi { background: #fbf6e3; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--side); }
.login form { background: #fff; padding: 32px; border-radius: 12px; width: 340px; }
.login .brand { color: var(--ink); padding: 0 0 20px; }
.err { color: var(--red); font-size: 13px; margin: 8px 0; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.bad { background: var(--red); }
.empty { padding: 30px; text-align: center; color: var(--ink-3); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { border: 0; background: none; border-radius: 0; padding: 8px 12px; color: var(--ink-2); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-nav { display: flex; gap: 6px; overflow-x: auto; background: var(--side); padding: 10px 12px; position: sticky; top: 0; z-index: 10; }
  .mobile-nav a { color: var(--side-ink); padding: 6px 10px; border-radius: 6px; white-space: nowrap; font-size: 13px; }
  .mobile-nav a.on { background: var(--accent); color: var(--accent-ink); }
  .main { padding: 16px; }
  .doc-grid, .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hide-sm { display: none; }
  .lines-wrap { overflow-x: auto; }
}
a.stat { color: inherit; text-decoration: none; }
a.stat:hover { border-color: #c9c9c3; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(20,20,22,.5); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h2 { margin-bottom: 14px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.modal textarea { min-height: 170px; }

/* Proofs */
.proof { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; padding: 12px 0; border-bottom: 1px solid #f0f0ec; align-items: start; }
.proof:last-child { border-bottom: 0; }
.proof .thumb { width: 96px; height: 72px; border: 1px solid var(--line); border-radius: 6px; background: #fafaf8 center/contain no-repeat; display: grid; place-items: center; font-size: 11px; color: var(--ink-3); font-weight: 700; }
.proof .acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.track { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #eeeeea; color: var(--ink-2); white-space: nowrap; }
.chip.yes { background: var(--green-bg); color: var(--green); }
.chip.no { background: #f0f0ee; color: var(--ink-3); }
.chip.bad { background: var(--red-bg); color: var(--red); }
.badge.Approved-proof { background: var(--green-bg); color: var(--green); }
.badge.Changes { background: var(--red-bg); color: var(--red); }
.badge.Awaiting { background: #e0e9fd; color: #1e40af; }
.email-row { padding: 8px 0; border-bottom: 1px solid #f0f0ec; font-size: 13px; }
.email-row:last-child { border-bottom: 0; }
.upload { border: 2px dashed var(--line); border-radius: 8px; padding: 14px; margin-top: 10px; }
.upload.over { border-color: var(--accent); background: #fffbea; }
@media (max-width: 900px) { .proof { grid-template-columns: 70px 1fr; } .proof .thumb { width: 70px; height: 56px; } .proof .acts { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; } }

/* Home screen */
.home { max-width: 1180px; }
.home .topbar h1 { font-size: 26px; }
.dcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 8px 0 34px; }
.dcard { background: #fff; border-radius: 8px; padding: 22px 24px; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04); min-height: 170px; }
.dcard h3 { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); margin: 0 0 12px; }
.alert { display: flex; align-items: center; gap: 8px; color: #c62828; font-size: 14px; padding: 4px 0; }
.alert svg { flex: 0 0 auto; }
.alert:hover { text-decoration: none; color: #9f1d1d; }
.alert:hover span { text-decoration: underline; }
.alert.soft { color: var(--ink-2); padding-left: 23px; }
.allgood { color: var(--green); font-size: 14px; }
.dhead { font-size: 15px; margin: 0 0 12px; }
.dhead-row { display: flex; align-items: center; justify-content: space-between; margin-top: 34px; }
.dhead-row .dhead { margin: 0 0 12px; }
.dlist { background: #fff; border-radius: 8px; padding: 14px 24px; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04); }
.dlist.flat { box-shadow: none; padding: 0; }
.drow { display: grid; grid-template-columns: 160px 1fr auto 170px; gap: 14px; align-items: center; padding: 8px 0; font-size: 14px; }
.drow.clickable { cursor: pointer; }
.drow.clickable:hover .dtitle { color: var(--blue); }
.drow.task { grid-template-columns: 22px 160px 1fr auto 170px 20px; }
.dlist.flat .drow.task { grid-template-columns: 22px 1fr auto 20px; font-size: 13px; }
.dlist.flat .drow.task .ddesc, .dlist.flat .drow.task .ddue:empty { display: none; }
.dtitle { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddesc { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddue { text-align: right; color: var(--ink-2); white-space: nowrap; }
.ddue.late { color: #c62828; }
.drow.done .dtitle, .drow.done .ddesc { text-decoration: line-through; color: var(--ink-3); }
.tcheck { width: 18px; height: 18px; accent-color: #1e88e5; cursor: pointer; margin: 0; }
.doclink { display: inline-block; font-weight: 600; font-size: 13px; color: #1e88e5; border: 1px solid #b3d4f5; background: #eef6fd; border-radius: 6px; padding: 3px 8px; }
.doclink:hover { text-decoration: none; background: #e0effc; }
@media (max-width: 900px) {
  .dcards { grid-template-columns: 1fr; }
  .dcard { min-height: 0; }
  .dlist { padding: 8px 14px; }
  .drow { grid-template-columns: 1fr auto; }
  .drow .ddesc, .drow .dmeta { display: none; }
  .drow.task { grid-template-columns: 22px 1fr auto 20px; }
}
.dlist.flat .drow.task { grid-template-columns: 22px 1fr auto 18px; gap: 8px; }
.dlist.flat .dmeta { display: none; }
.dlist.flat .ddue { font-size: 12px; }
.shell { background: linear-gradient(to right, var(--side) 210px, transparent 210px); }
.side { align-self: start; }
@media (max-width: 900px) { .shell { background: none; } }

/* Messages */
.navbadge { display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 6px; border-radius: 99px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.inbox { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.convos { max-height: 72vh; overflow: auto; }
.convo { display: block; padding: 12px 14px; border-bottom: 1px solid #f0f0ec; color: var(--ink); }
.convo:hover { background: #fbfaf5; text-decoration: none; }
.convo.on { background: #e6f4fc; }
.convo .crow { display: flex; gap: 6px; align-items: center; }
.convo .crow .sub { margin-left: auto; }
.convo .ddesc { display: block; font-size: 13px; }
.thread { max-height: 60vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.thread.compact { max-height: 320px; }
.bubble { max-width: 78%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.bubble.in { align-self: flex-start; background: #eeeeea; border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: #1e88e5; color: #fff; border-bottom-right-radius: 4px; }
.bubble .bmeta { font-size: 11px; opacity: .75; margin-top: 4px; }
.bubble .bmeta .bad { color: #ffd0d0; font-weight: 700; }
.bubble.in .bmeta .bad { color: var(--red); }
.sendbox { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.sendbox textarea { min-height: 42px; }
.unreadbar { display: block; background: #fde8e1; color: #9f1d1d; padding: 10px 14px; border-radius: 8px; margin: 4px 0 16px; font-weight: 600; }
.unreadbar:hover { text-decoration: none; background: #fbd9cd; }
.pfile { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f0ec; }
.pfile:last-child { border-bottom: 0; }
.tpl { border-bottom: 1px solid #f0f0ec; padding: 10px 0; }
.tpl textarea { margin-top: 6px; min-height: 64px; font-size: 13px; }
@media (max-width: 900px) { .inbox { grid-template-columns: 1fr; } .pfile { flex-direction: column; align-items: flex-start; } }
.navbadge[hidden] { display: none; }
.cbadge { display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 99px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
details.tpl summary { cursor: pointer; padding: 4px 0; }
.brand-logo { background: #fff; border-radius: 8px; padding: 8px 10px; margin: 0 4px 18px; text-align: center; }
.brand-logo img { max-width: 100%; max-height: 54px; display: inline-block; }

/* ---------- Top menu bar ---------- */
.tshell { min-height: 100vh; }
.topnav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px; padding: 0 18px; height: 64px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.tlogo { display: flex; align-items: center; margin-right: 18px; height: 64px; }
.tlogo img { max-height: 42px; max-width: 180px; }
.tbrand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); margin-right: 18px; font-size: 16px; }
.tbrand:hover { text-decoration: none; }
.tnav { display: flex; align-items: stretch; height: 64px; gap: 2px; }
.tright { margin-left: auto; display: flex; align-items: stretch; height: 64px; gap: 2px; }
.titem { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 76px; padding: 0 10px; color: #2b2b30; font-size: 11.5px; font-weight: 500; border: 0; background: none; border-radius: 0; border-bottom: 3px solid transparent; cursor: pointer; }
.titem:hover { background: #f6f6f3; text-decoration: none; color: var(--ink); }
.titem.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.titem svg { flex: 0 0 auto; }
.tbadge { position: absolute; top: 8px; left: 50%; margin-left: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #e5484d; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; }
.tbadge[hidden] { display: none; }
.tmenu { position: relative; display: flex; }
.tdrop { position: absolute; right: 0; top: 60px; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 6px; z-index: 40; }
.tdrop a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--ink); }
.tdrop a:hover { background: #f6f6f3; text-decoration: none; }
.tdrop-who { padding: 9px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-weight: 600; }
.subtabs { display: flex; gap: 4px; margin: -6px 0 14px; border-bottom: 1px solid var(--line); }
.subtabs a { padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a:hover { color: var(--ink); text-decoration: none; }
.subtabs a.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.seg a { padding: 6px 12px; color: var(--ink-2); font-size: 13px; }
.seg a + a { border-left: 1px solid var(--line); }
.seg a:hover { text-decoration: none; background: #f6f6f3; }
.seg a.on { background: var(--ink); color: #fff; }
.chart { width: 100%; height: auto; margin-top: 10px; }
.chart .ax { font-size: 11px; fill: var(--ink-3); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.main { max-width: 1440px; margin: 0 auto; }
@media (max-width: 900px) {
  .topnav { padding: 0 8px; height: 58px; padding-top: env(safe-area-inset-top); height: calc(58px + env(safe-area-inset-top)); }
  .tlogo, .tbrand { margin-right: 6px; }
  .tlogo img { max-height: 32px; max-width: 110px; }
  .tbrand span:last-child { display: none; }
  .tright { height: 58px; margin-left: auto; }
  .titem { min-width: 46px; padding: 0 6px; }
  .tright .titem span { display: none; }
  .tbadge { top: 6px; }
  .tdrop { position: fixed; right: 8px; top: calc(58px + env(safe-area-inset-top)); max-height: calc(100vh - 140px); overflow-y: auto; }
  .plusdrop { left: 8px; right: auto; }
  /* Main sections move to a tab bar at the bottom, like a phone app */
  .tnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: auto; background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -2px 10px rgba(0,0,0,.05); padding: 0 2px env(safe-area-inset-bottom); justify-content: space-around; gap: 0; }
  .tnav .titem { flex: 1; min-width: 0; height: 58px; padding: 0 2px; border-bottom: 0; border-top: 3px solid transparent; font-size: 10.5px; }
  .tnav .titem.on { border-top-color: var(--accent); }
  .tnav .titem span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tnav .titem svg { width: 21px; height: 21px; }
  .tnav .tbadge { top: 4px; }
  .main { padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important; }
  .savebar { bottom: calc(66px + env(safe-area-inset-bottom)) !important; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
}
@media (max-width: 380px) { .tnav .titem span { font-size: 9.5px; } .tlogo img { max-width: 84px; } }
.steps { padding-left: 20px; line-height: 1.7; } .steps li { margin-bottom: 4px; }
@media (display-mode: standalone) { body { overscroll-behavior-y: none; } }

/* ---------- Document screen (shopVOX layout) ---------- */
.dv { max-width: 1180px; margin: 0 auto; padding-bottom: 80px; }
.dv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 4px 0 22px; flex-wrap: wrap; }
.dv-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.dv-sub { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dv-actions { display: flex; gap: 8px; align-items: center; }
.dv-actions > .btn, .dv-actions > button { height: 40px; padding: 0 16px; font-weight: 600; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.icon-btn { width: 40px; padding: 0 !important; justify-content: center; }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.blue { background: #29a8ec; border-color: #29a8ec; color: #fff; }
.icon-btn.blue:hover { background: #1b97da; }
.dv-more { position: relative; }
.dv-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 6px; z-index: 35; }
.dv-menu a, .dv-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 6px; color: var(--ink); font: inherit; cursor: pointer; }
.dv-menu a:hover, .dv-menu button:hover { background: #f4f6f8; text-decoration: none; }
.dv-menu .danger { color: var(--red); }
.dv-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04); padding: 22px 24px; position: relative; margin-bottom: 18px; }
.dv-card h4 { margin: 0 0 14px; font-size: 15px; }
.dv-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.kv { margin-bottom: 14px; }
.kv > span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.who { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 500; }
a.who:hover { text-decoration: none; color: var(--blue); }
.av { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 10px; font-weight: 700; color: #37373c; flex: 0 0 auto; }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 18px; width: 1px; background: #c8c8c8; }
.tl { position: relative; margin-bottom: 14px; }
.tl::before { content: ''; position: absolute; left: -20px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.tl > span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.dv-showall { position: absolute; right: 24px; bottom: -14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.dv-more-info { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 18px; padding-bottom: 6px; }
.dv-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 40px 0 26px; overflow-x: auto; }
.dv-tabs button { border: 0; background: none; border-radius: 0; padding: 10px 14px; font-size: 15px; color: var(--ink); border-bottom: 3px solid transparent; white-space: nowrap; }
.dv-tabs button.on { color: #1e9be0; border-bottom-color: #1e9be0; }
.dv-sechead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.dv-sechead h2 { font-size: 20px; margin: 0; }
.act-blue, .act-green { color: #fff; border: 0; height: 38px; padding: 0 16px; font-weight: 600; border-radius: 8px; gap: 8px; }
.act-blue { background: #29a8ec; } .act-blue:hover { background: #1b97da; color: #fff; text-decoration: none; }
.act-green { background: #22b45a; } .act-green:hover { background: #1c9f4f; }
a.act-blue { display: inline-flex; align-items: center; }
.items { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04); }
.item { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; padding: 18px 20px; border-bottom: 1px solid #eef0f2; }
.item:last-child { border-bottom: 0; }
.inum { font-weight: 700; padding-top: 6px; }
.imain .pname { border: 1px solid transparent; font-weight: 700; padding: 5px 6px; margin-left: -6px; background: transparent; }
.imain .pname:hover { border-color: var(--line); }
.imain .pname:focus { background: #fff; }
.icat { color: var(--ink-3); font-size: 13px; margin: 0 0 8px; }
.ilink { display: inline-block; color: #1e9be0; font-size: 14px; margin: 4px 16px 4px 0; }
.imain .desc { margin: 6px 0; min-height: 52px; }
.imore { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.inums { display: flex; gap: 8px; align-items: flex-start; }
.ibox { position: relative; border: 1px solid #dfe3e7; border-radius: 8px; padding: 6px 10px 6px; min-width: 112px; background: #fff; }
.ibox:focus-within { border-color: #29a8ec; box-shadow: 0 0 0 3px rgba(41,168,236,.15); }
.ibox label { font-size: 11.5px; color: var(--ink-3); margin: 0; }
.ibox.req label::before { content: '* '; color: #e5484d; }
.ibox input, .ibox select { border: 0; padding: 2px 0; font-size: 15px; outline: none; box-shadow: none; width: 100%; background: transparent; }
.ibox input:focus { outline: none; }
.ibox .unit { position: absolute; right: 10px; top: 24px; font-size: 12px; color: var(--ink-2); }
.ibox input.lq, .ibox input.ld { padding-right: 34px; }
.ibox .ltot { font-size: 15px; padding: 2px 0; font-weight: 500; }
.ibox input.manual { background: var(--amber-bg); }
.tbtn { width: 28px; height: 28px; margin-top: 12px; padding: 0; justify-content: center; border: 0; background: none; color: var(--ink-3); font-weight: 700; }
.tbtn.on { color: var(--ink); }
.tbtn:not(.on) { text-decoration: line-through; }
.imove { display: flex; flex-direction: column; margin-top: 4px; border: 1px solid #dfe3e7; border-radius: 8px; overflow: hidden; }
.imove button { border: 0; border-radius: 0; padding: 2px 8px; font-size: 9px; background: #fff; }
.imove button:disabled { color: #ccc; cursor: default; }
.item .dv-more { margin-top: 6px; }
.item .hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.item .hint.warn { color: var(--red); }
.dv-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.dv-foot .totals-box { width: 320px; background: #fff; border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.related a { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.related a:hover { text-decoration: none; border-color: #29a8ec; }
.relicon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #eef6fd; color: #1e88e5; font-size: 11px; font-weight: 800; }
.related .av { width: 32px; height: 32px; font-size: 12px; }
.savebar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 45; display: flex; gap: 10px; align-items: center; background: var(--ink); color: #fff; padding: 10px 12px 10px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.savebar[hidden] { display: none; }
.savebar button { height: 34px; }
.savebar #discard { background: transparent; color: #ddd; border-color: #555; }
.savebar .primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
@media (max-width: 1000px) {
  .dv-cols { grid-template-columns: 1fr 1fr; }
  .item { grid-template-columns: 22px 1fr; }
  .inums { grid-column: 1 / -1; flex-wrap: wrap; }
  .ibox { min-width: 96px; flex: 1; }
}
@media (max-width: 600px) { .dv-cols { grid-template-columns: 1fr; } .dv-actions { flex-wrap: wrap; } .dv-foot .totals-box { width: 100%; } }
[hidden] { display: none !important; }
.item { grid-template-columns: 28px minmax(220px, 1fr) auto; }
.inums .ibox { flex: 0 0 auto; width: 118px; min-width: 0; }
.inums .ibox.req { width: 128px; }
.imore .ibox { width: 120px; min-width: 0; }
.imore .ibox select { min-width: 150px; }
@media (max-width: 1000px) { .item { grid-template-columns: 22px 1fr; } .inums .ibox { flex: 1 1 100px; width: auto; } }

/* Green + quick-create */
.tplus { position: relative; display: flex; align-items: center; margin-right: 14px; }
#plusbtn { width: 42px; height: 42px; border-radius: 50%; background: #22b45a; border: 0; color: #fff; font-size: 28px; font-weight: 300; line-height: 1; justify-content: center; padding: 0 0 3px; box-shadow: 0 2px 6px rgba(34,180,90,.35); }
#plusbtn:hover { background: #1c9f4f; }
.plusdrop { left: 0; right: auto; top: 54px; min-width: 290px; padding: 6px 0; }
.plusdrop a { display: flex; justify-content: space-between; align-items: center; padding: 10px 22px; border-radius: 0; }
.plusdrop kbd { font: 600 11px/1 -apple-system, Segoe UI, sans-serif; border: 1px solid var(--line); border-radius: 5px; padding: 4px 7px; color: var(--ink); background: #fafafa; }
.plusdrop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
@media (max-width: 900px) { #plusbtn { width: 36px; height: 36px; font-size: 24px; } .tplus { margin-right: 4px; } .plusdrop { position: fixed; left: 8px; top: 58px; } }

/* Attachments */
.files { margin-bottom: 12px; }
.frow { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f0ec; }
.frow:last-child { border-bottom: 0; }
.ficon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: #f4f6f8; font-size: 20px; text-decoration: none; }
.ficon:hover { text-decoration: none; background: #e8eef4; }
.fmain { min-width: 0; }
.fmain a strong { color: var(--ink); word-break: break-all; }
.facts { display: flex; gap: 8px; align-items: center; }
#taxcertbadge .badge, #custtaxbadge .badge { margin-left: 4px; }
@media (max-width: 700px) { .frow { grid-template-columns: 36px 1fr; } .facts { grid-column: 2; } }

/* Production / job sheet */
.act-orange { background: #141416; color: #fff; border: 0; height: 38px; padding: 0 16px; font-weight: 600; border-radius: 8px; }
.act-orange:hover { background: #2a2a2e; }
.act-orange.small { height: 32px; padding: 0 12px; font-size: 13px; }
.jsbox { background: #fafaf8; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 4px; }
.checkline { display: flex; gap: 8px; align-items: center; color: var(--ink); margin-top: 8px; }
.checkline input { width: auto; }
.checkdrop { position: relative; }
.checkdrop summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 6px; padding: 9px 34px 9px 12px; background: #fff; position: relative; }
.checkdrop summary::-webkit-details-marker { display: none; }
.checkdrop summary::after { content: '▾'; position: absolute; right: 12px; top: 8px; color: #888; }
.checkdrop-menu { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; }
.checkdrop-menu label { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 6px; color: var(--ink); cursor: pointer; margin: 0; font-size: 14px; }
.checkdrop-menu label:hover { background: #f4f6f8; }
.checkdrop-menu input { width: auto; margin: 0; }
.jsheet .jsrow { display: flex; gap: 24px; padding: 10px 0; border-top: 1px solid #f0f0ec; flex-wrap: wrap; }
.jsheet .jsrow:first-child { border-top: 0; padding-top: 0; }
.jsheet .jsrow > div { flex: 1; min-width: 160px; }
.jsheet label, .jshead label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #888; margin-bottom: 3px; }
.jshead { display: flex; gap: 24px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 2px solid var(--ink); }
.jsheet .pre { white-space: pre-wrap; }
.toollist { list-style: none; margin: 0; padding: 0; columns: 2; }
.toollist li { padding: 2px 0; }
.fulfill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; background: #eef2f6; color: #445; }
.fulfill.Install { background: #fde8d0; color: #9a4d00; }
.fulfill.Delivery { background: #dbeefe; color: #0b5c9e; }
.fulfill.Pickup { background: #e2f5e7; color: #1c7a3a; }
.late-text { color: var(--red); font-weight: 600; }
.timeline .tl.pending span, .timeline .tl.pending div { color: #aaa; }
.notice-acts { display: flex; flex-direction: column; gap: 8px; }
.notice-acts button { justify-content: flex-start; width: 100%; }
.prodgrid { align-items: start; }
.plist { display: flex; flex-direction: column; gap: 8px; }
.pcard { display: flex; gap: 16px; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; color: var(--ink); }
.pcard:hover { text-decoration: none; border-color: #29a8ec; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.pc-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.pc-meta { text-align: right; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; white-space: nowrap; }
@media (max-width: 700px) { .pcard { flex-direction: column; align-items: flex-start; } .pc-meta { align-items: flex-start; text-align: left; } }
@media print {
  .topnav, .doc-head .spacer ~ *, #pprint, .doc-head a.muted, .pfdl { display: none !important; }
  .doc-grid { display: block; } .panel { border: 0; box-shadow: none; }
}

/* Global search */
.search-bg { position: fixed; inset: 0; z-index: 100; background: rgba(20,20,25,.35); display: flex; justify-content: center; align-items: flex-start; padding: 70px 16px 16px; }
.search-box { width: 100%; max-width: 640px; background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden; }
.search-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: #888; }
.search-in input { flex: 1; border: 0; outline: none; font-size: 17px; padding: 16px 0; background: transparent; box-shadow: none; }
.search-in kbd, .plusdrop kbd { font: 11px ui-monospace, monospace; border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; color: #888; background: #fafaf8; }
.search-res { max-height: min(60vh, 520px); overflow-y: auto; padding: 6px; }
.search-hint { padding: 18px 12px; color: #888; font-size: 14px; }
.search-group { padding: 10px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #999; font-weight: 600; }
.search-item { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.search-item:hover, .search-item.on { background: #eef6fd; text-decoration: none; }
.search-item .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 500px; }
.search-item strong { font-weight: 600; }

/* Year-over-year sales */
.yoy-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.yoy-pick { display: flex; gap: 12px; flex-wrap: wrap; }
.yoy-pick label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #666; margin: 0; }
.yoy-pick select { width: auto; min-width: 90px; }
.yoy-stats .stat { display: flex; flex-direction: column; gap: 4px; }
.yoy-stats .stat span { font-size: 13px; color: #666; }
.yoy-stats .key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.up { color: #1c7a3a; font-weight: 600; } .down { color: var(--red); font-weight: 600; }
.yoy-table { margin-top: 10px; } .yoy-table summary { cursor: pointer; color: #1e88e5; font-size: 14px; padding: 6px 0; }
.yoy-table tr.tot td { border-top: 2px solid var(--ink); }
.yoy-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
@media (max-width: 700px) {
  .yoy-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .yoy-stats .stat { min-width: 0; padding: 12px; }
  .yoy-stats .stat b { font-size: 18px; overflow-wrap: anywhere; }
  .yoy-pick select { min-width: 0; }
}
@media (max-width: 700px) { .stats .stat { min-width: 0; } .stats .stat b { font-size: 19px; overflow-wrap: anywhere; } }

/* Document ⋯ menu sections */
.dv-menu { min-width: 250px; max-height: calc(100vh - 140px); overflow-y: auto; }
.dv-menu .mhead { padding: 10px 12px 4px; font-size: 12px; font-weight: 700; color: #555; }
.dv-menu .mhead-blank { padding: 0; margin: 6px 0; border-top: 1px solid var(--line); }
.dv-menu .mhead:not(:first-child):not(.mhead-blank) { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
.dv-menu .mdiv { border-top: 1px solid var(--line); margin: 6px 0; }
.commrow { display: grid; grid-template-columns: 1fr 96px 90px 28px; gap: 8px; align-items: center; margin-bottom: 8px; }
.commrow .cpw { display: flex; align-items: center; gap: 4px; } .commrow .ca { text-align: right; }
.dctable input, .dctable select { padding: 6px 8px; }
.titem i { font-style: normal; } .titem .lshort { display: none; }
@media (max-width: 900px) { .titem .lfull { display: none; } .titem .lshort { display: inline; } }

/* Contact pickers */
.rcpts { display: flex; flex-direction: column; gap: 6px; }
.rcpt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 0; cursor: pointer; color: var(--ink); background: #fff; }
.rcpt:has(input:checked) { border-color: #1e88e5; background: #f3f9fe; }
.rcpt input { width: auto; margin-top: 3px; }
.cpick { position: relative; }
.cpick-btn { border: 0; background: none; padding: 2px 4px; margin-left: -4px; border-radius: 6px; cursor: pointer; font: inherit; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.cpick-btn:hover { background: #f4f6f8; }
.cpick-btn .caret { color: #999; font-size: 11px; }
.cpick-info { margin-top: 2px; word-break: break-word; }
.cpick-menu { position: absolute; left: 0; top: calc(100% + 4px); z-index: 40; width: min(360px, 86vw); max-height: 340px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 6px; }
.cpick-menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink); }
.cpick-menu button:hover, .cpick-menu button.on { background: #f3f9fe; }
.cpick-menu button > span { flex: 1; min-width: 0; } .cpick-menu button .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpick-menu .tick { color: #1e88e5; }
.cpick-add { display: block; padding: 9px 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.cpick-menu .av, .cpick-menu [class^="av"] { flex: 0 0 auto; }
.ostatus { width: auto; padding: 5px 8px; font-weight: 600; }
.ostatus.set { border-color: #1e88e5; background: #f3f9fe; color: #0b5c9e; }
.yoy-snap { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 14px; }
.yoy-snap .stat > span:first-child { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }

/* Reports */
.rep-h { margin: 18px 0 10px; font-size: 16px; }
.rep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 8px; }
.rep-card { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 10px; padding: 22px 22px; box-shadow: 0 1px 3px rgba(0,0,0,.06); color: var(--ink); font-weight: 600; }
.rep-card:hover { text-decoration: none; box-shadow: 0 3px 12px rgba(0,0,0,.1); }
.rep-card b { color: #1e88e5; font-size: 22px; line-height: 1; }
.rep-back { margin-bottom: 4px; } .rep-back a { color: #1e88e5; }
.rep-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.drange { position: relative; }
.drbtn { display: flex; flex-direction: column; align-items: flex-start; position: relative; min-width: 260px; text-align: left; border: 1px solid var(--line); border-radius: 6px; padding: 6px 40px 6px 10px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); height: auto; }
.drbtn .drlbl { font-size: 11px; color: #888; } .drbtn svg { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #555; }
.drpop { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; display: flex; background: #fff; border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.18); overflow: hidden; }
.drpresets { background: #f4f6f8; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 170px; }
.drpresets button { border: 0; background: none; color: #1e88e5; padding: 8px 12px; border-radius: 6px; cursor: pointer; font: inherit; text-align: center; }
.drpresets button:hover { background: #e6f1fb; } .drpresets button.on { background: #1e88e5; color: #fff; }
.drcustom { padding: 16px; width: 240px; }
.act-green { background: #2fb34a; color: #fff; border: 0; height: 40px; padding: 0 18px; font-weight: 600; border-radius: 6px; }
.act-green:hover { background: #28a043; }
.rep-table { background: #fff; border-radius: 10px; overflow: hidden; margin-top: 12px; }
.rep-table .dayrow td { background: #f7f7f5; font-weight: 600; border-top: 2px solid var(--line); }
.rep-table tr.tot td { border-top: 2px solid var(--ink); }
.rep-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; } .rep-chips .chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.sharebar { display: inline-block; width: 120px; height: 8px; background: #eef1f4; border-radius: 4px; overflow: hidden; vertical-align: middle; } .sharebar i { display: block; height: 100%; background: #1e88e5; }
@media (max-width: 700px) { .drpop { flex-direction: column; left: -8px; max-width: calc(100vw - 16px); } .drpresets { flex-direction: row; flex-wrap: wrap; } .drbtn { min-width: 0; width: 100%; } .rep-bar .spacer { display: none; } .rep-table { display: block; overflow-x: auto; } }
@media print { .rep-bar, .rep-back, #rcsv, #rprint { display: none !important; } }

/* Job ticket: job lines and mockups */
.joblines { margin: 6px 0 0; padding-left: 18px; }
.joblines li { margin: 3px 0; }
.mockups { display: flex; flex-wrap: wrap; gap: 10px; }
.mockups img, .mockimg { max-width: 100%; max-height: 360px; border: 1px solid var(--line); border-radius: 6px; display: block; background: #fff; }
.mockups a { display: block; max-width: 100%; }
@media print { .mockups img, .mockimg { max-height: 320px; } }

/* Details kept from shopVOX */
.svbox { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.svbox h4 { margin: 0 0 8px; }
.svraw { margin-top: 10px; }
.svraw summary { cursor: pointer; color: var(--muted, #666); font-size: 13px; }
.kvtable { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.kvtable th { text-align: left; font-weight: 500; color: var(--muted, #666); padding: 4px 10px 4px 0; vertical-align: top; width: 40%; }
.kvtable td { padding: 4px 0; word-break: break-word; }
.kvtable tr + tr { border-top: 1px solid var(--line); }

/* Apparel catalog picker */
.apgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 55vh; overflow: auto; }
.apcard { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; height: auto; font-weight: 400; }
.apcard:hover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.apcard img, .apnoimg { width: 100%; height: 120px; object-fit: contain; background: #fafafa; border-radius: 6px; }
.apnoimg { display: grid; place-items: center; font-size: 40px; }
.apnoimg.big { height: 200px; }
.apcard span { font-size: 12px; color: var(--ink-2); }
.apstyle { display: flex; gap: 16px; align-items: flex-start; }
.apimg { width: 200px; flex: none; }
.apimg img { width: 100%; max-height: 220px; object-fit: contain; background: #fafafa; border-radius: 8px; }
.apswatches { display: flex; flex-wrap: wrap; gap: 4px; max-height: 76px; overflow: auto; }
.apswatches img { width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--line); cursor: pointer; object-fit: cover; }
.apswatches img.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.aptable { margin-top: 12px; }
.aptable td, .aptable th { padding: 6px 8px; }
@media (max-width: 640px) { .apstyle { flex-direction: column; } .apimg { width: 100%; } }

/* Apparel styles inside a Screen Printing / Embroidery line */
.apblock { grid-column: 2 / -1; margin-top: 4px; display: flex; flex-direction: column; gap: 10px; background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.apst { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.apst-row { display: grid; grid-template-columns: 48px minmax(150px, 1fr) minmax(220px, 2fr) minmax(150px, 1fr); gap: 8px; align-items: stretch; }
.apst-img { width: 48px; height: 48px; border-radius: 8px; background: #f1f2f4; display: grid; place-items: center; overflow: hidden; color: var(--ink-3); }
.apst-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.apst .ibox { min-width: 0; }
.apst .ibox select, .apst .ibox input { width: 100%; }
.apst .ibox.off { background: #f1f2f4; }
.approd { position: relative; }
.approd .picker-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; max-height: 320px; overflow: auto; }
.approd .picker-list > div { display: flex; align-items: center; gap: 8px; }
.approd .picker-list img { width: 28px; height: 28px; object-fit: contain; flex: none; }
.apsizes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.apsz { width: 86px; }
.apsz input { text-align: right; }
.apcost { display: block; font-size: 11px; color: var(--ink-3); text-align: right; }
.apcustomcost { margin-top: 8px; font-size: 13px; }
.apcustomcost input { width: 90px; margin-left: 6px; }
.apdel { display: inline-block; margin-top: 8px; color: var(--red); font-size: 13px; float: right; }
.apst::after { content: ""; display: block; clear: both; }
.apfoot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.apadd { font-weight: 600; }
.apsum { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.apsum input { width: 70px; height: 30px; margin: 0 4px; text-align: right; }
.ibox.locked input { background: #f1f2f4; }
.apticket { margin-top: 4px; font-size: 13px; }
.apz { display: inline-block; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; margin: 3px 4px 0 0; }
@media (max-width: 760px) { .apst-row { grid-template-columns: 48px 1fr; } .apst-row .approd, .apst-row .ibox:last-child { grid-column: 1 / -1; } }

/* Screen print locations */
.aplocs { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.aplocs-h { display: flex; justify-content: space-between; align-items: baseline; }
.aplocn { font-weight: 600; font-size: 13px; }
.aploc .ibox select { width: 100%; }
.aplprice { font-size: 13px; color: var(--ink-2); text-align: right; }
.apldel { color: var(--red); text-align: center; }
.apladd { font-weight: 600; }
@media (max-width: 640px) { .aploc { grid-template-columns: 1fr 1fr; } .aplocn { grid-column: 1 / -1; } }

/* shopVOX-style size grid */
.apgridwrap { overflow-x: auto; margin-top: 10px; }
.apgrid2 { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.apgrid2 th, .apgrid2 td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; min-width: 70px; }
.apgrid2 tr > th:first-child { text-align: right; border: 0; color: var(--ink-2); font-weight: 500; min-width: 90px; background: transparent; }
.apgrid2 tr:first-child th:not(:first-child) { font-weight: 700; background: #fafbfc; }
.apgrid2 td input { width: 60px; height: 28px; text-align: center; border: 0; background: transparent; font-size: 13px; padding: 0; }
.apgrid2 td input:focus { outline: 2px solid var(--accent); border-radius: 4px; }
.apgrid2 .tot { background: #f1f2f4; font-weight: 600; }
.apgrid2 tr:nth-child(4) td:not(.tot) { background: #f7f8fa; }
/* Location rows */
.aploc { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.aploc:first-of-type { border-top: 0; }
.aplfields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.aplfields .ibox.locked input { background: #f1f2f4; }
.aplfields .apldel { grid-column: 3; text-align: right; font-size: 13px; }
.req-star { color: var(--red); }
@media (max-width: 640px) { .aploc { grid-template-columns: 1fr; } .aplfields { grid-template-columns: 1fr 1fr; } .aplfields .apldel { grid-column: 1 / -1; } }
.apblock-add { grid-column: 2 / -1; font-size: 13px; }
.mproof { border: 1px solid var(--line); background: var(--amber-bg, #e6f4fc); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
#updbar { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 200; background: var(--ink, #141416); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
#updbar a { color: var(--accent, #89cff0); font-weight: 700; margin-left: 6px; }
