/* Field service additions on top of the Parts Inventory Windows 11 styles */
.bottomnav { grid-template-columns: repeat(var(--tabs, 5), 1fr); }
.badge.st-unscheduled { color: var(--muted); background: var(--subtle); }
.badge.st-scheduled { color: #003e92; background: #e0ecfa; }
.badge.st-en_route { color: #6b4500; background: #fff4ce; }
.badge.st-on_site { color: #5c2e91; background: #f1e8fb; }
.badge.st-complete, .badge.d-paid { color: #0e6b0e; background: #dff6dd; }
.badge.st-canceled, .badge.d-void, .badge.d-declined { color: var(--muted); background: var(--subtle); text-decoration: line-through; }
.badge.d-draft { color: var(--muted); background: var(--subtle); } .badge.d-sent { color: #8a5300; background: #fff4ce; } .badge.d-approved { color: #003e92; background: #e0ecfa; }
.badge.rental { color: #6b4500; background: #fff4ce; }
@media (prefers-color-scheme: dark) {
  .badge.st-scheduled, .badge.d-approved { color: #99d9ff; background: rgba(76,194,255,.16); }
  .badge.st-en_route, .badge.d-sent, .badge.rental { color: #fce100; background: rgba(252,225,0,.12); }
  .badge.st-on_site { color: #d7b8ff; background: rgba(180,120,255,.16); }
  .badge.st-complete, .badge.d-paid { color: #6ccb5f; background: rgba(108,203,95,.14); }
}
.joblist { display: flex; flex-direction: column; gap: 10px; }
.jobcard { display: block; color: var(--ink); background: var(--card); border: 1px solid var(--stroke); border-left: 4px solid var(--c, var(--accent)); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.jobcard:hover { text-decoration: none; background: var(--card2); }
.jobcard .t { font-weight: 600; font-size: 1.02rem; } .jobcard .when { font-weight: 600; color: var(--accent); }
.jobcard .addr { color: var(--muted); font-size: .9rem; }
.bigbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.bigbtns .btn { min-height: 48px; font-size: 1rem; }
.statusbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.statusbar .btn { min-height: 46px; flex-direction: column; gap: 0; font-size: .85rem; }
.statusbar .btn.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }

.statusbar.has-contact { grid-template-columns: repeat(3, 1fr); }
.statusbar.has-contact [data-edit-contact] { grid-column: 1 / -1; }
.statusbar > .btn:only-child { grid-column: 1 / -1; }
@media (min-width: 800px) {
  .statusbar.has-contact { grid-template-columns: repeat(4, 1fr); }
  .statusbar.has-contact [data-edit-contact] { grid-column: auto; }
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .92rem; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--stroke); background: var(--subtle); }
.items td.num, .items th.num { text-align: right; white-space: nowrap; }
.sigpad { width: 100%; height: 180px; background: #fff; border: 1px dashed var(--muted); border-radius: var(--radius-sm); touch-action: none; display: block; }
.sigimg { max-width: 280px; background: #fff; border-bottom: 1px solid #000; }
.note { border-bottom: 1px solid var(--line); padding: 8px 0; } .note:last-child { border: 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs .btn.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; border-color: transparent; }
.modal { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center; }
.modal > .card { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; margin: 0; border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow-lg); }
@media (min-width: 800px) { .modal { align-items: center; } .modal > .card { border-radius: var(--radius); } }
/* dispatch board */
.board { overflow-x: auto; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--card); }
.board .grid { display: grid; grid-template-columns: 150px repeat(var(--hours), minmax(64px, 1fr)); min-width: calc(150px + var(--hours) * 64px); }
.board .h { font-size: .75rem; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.board .tech { padding: 8px; font-weight: 600; font-size: .9rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; position: sticky; left: 0; background: var(--card); z-index: 2; }
.board .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.board .lane { grid-column: 2 / -1; position: relative; min-height: 58px; border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px calc(100% / var(--hours))); }
.board .lane.over { background-color: var(--accent-soft); }
.board .blk { position: absolute; top: 5px; bottom: 5px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--c) 18%, var(--card)); border-left: 4px solid var(--c);
  padding: 3px 6px; font-size: .75rem; line-height: 1.2; overflow: hidden; cursor: grab; color: var(--ink); box-shadow: var(--shadow); }
.board .blk.conf { outline: 2px solid var(--bad); }
.board .blk b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week { display: grid; grid-template-columns: 130px repeat(7, minmax(110px, 1fr)); min-width: 900px; }
.week > div { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; font-size: .8rem; min-height: 60px; }
.week .wh { font-weight: 600; min-height: 0; color: var(--muted); }
.week .wj { display: block; background: color-mix(in srgb, var(--c) 16%, var(--card)); border-left: 3px solid var(--c); border-radius: 3px; padding: 2px 5px; margin-bottom: 4px; color: var(--ink); cursor: grab; }
.week .over { background: var(--accent-soft); }
.unsched { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; padding: 8px; border: 1px dashed var(--line); border-radius: var(--radius); }
.unsched .blk { position: static; display: inline-block; max-width: 220px; }
/* printable invoice */
.inv .head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 14px; }
.inv .co { font-size: 20pt; font-weight: 800; } .inv .docno { font-size: 16pt; font-weight: 800; text-align: right; }
.inv .two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 14px; font-size: 10.5pt; }
.inv .lbl { font-size: 8.5pt; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: #444; }
.inv table { width: 100%; border-collapse: collapse; } .inv th, .inv td { padding: 6px 4px; border-bottom: 1px solid #aaa; text-align: left; font-size: 10.5pt; }
.inv th { border-bottom: 2px solid #000; font-size: 8.5pt; text-transform: uppercase; } .inv .num { text-align: right; white-space: nowrap; }
.inv .totals { display: flex; justify-content: flex-end; margin-top: 10px; } .inv .totals td { border: 0; padding: 3px 8px; } .inv .grand td { font-size: 13pt; font-weight: 800; border-top: 2px solid #000; }
.inv .paidstamp { display: inline-block; border: 3px solid #0e6b0e; color: #0e6b0e; font-weight: 900; font-size: 16pt; padding: 2px 12px; transform: rotate(-6deg); margin-top: 8px; }
.inv .foot { margin-top: 24px; font-size: 9pt; color: #333; }
input[type=time], input[type=datetime-local] { width: 100%; padding: 8px 11px; min-height: 40px; color: var(--ink); background: var(--ctl); border: 1px solid var(--ctl-line); border-bottom-color: var(--ctl-bottom); border-radius: var(--radius-sm); font: inherit; }
.picklist { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--card); max-height: 260px; overflow-y: auto; box-shadow: var(--shadow-lg); }
.picklist li { padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; } .picklist li:hover { background: var(--subtle); }
.stub { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px; color: var(--muted); }
.right { text-align: right; } .nowrap { white-space: nowrap; }
.datebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; } .datebar input[type=date] { width: auto; }
.unsched { display: flex; flex-wrap: wrap; gap: 8px; }
.unsched .blk { position: static; display: block; min-width: 180px; padding: 8px 10px; border-left: 4px solid var(--c); background: var(--card, #fff); border-radius: 6px; }
.unsched .blk b { display: block; }
/* v1.1 */
.hint { color: #005fb8; font-size: 12px; }
.kpis { display: flex; gap: 24px; flex-wrap: wrap; margin: 8px 0 14px; } .kpis b { font-size: 20px; } .kpis .lbl { font-size: 12px; color: #555; }
.tabs { flex-wrap: wrap; gap: 6px; }
.badge.d-converted { background: #e8e0f8; color: #4b2a9b; }
.inv .cohead .tag { font-size: 9.5pt; letter-spacing: .08em; text-transform: uppercase; color: #005fb8; margin-bottom: 4px; }
.inv .co { color: #0b3a6b; }
.inv .docmeta { text-align: right; } .inv .docno { color: #0b3a6b; letter-spacing: .05em; }
.inv .meta { width: auto; margin-left: auto; } .inv .meta td { border: 0; padding: 1px 0 1px 12px; font-size: 10pt; } .inv .meta td:first-child { color: #555; }
.inv .box { border: 1px solid #bbb; border-radius: 4px; padding: 8px 10px; }
.inv .lines th { background: #0b3a6b; color: #fff; border-bottom: 0; } .inv .lines tbody tr:nth-child(even) td { background: #f4f7fb; }
.inv .desc { font-size: 9pt; color: #444; } .inv .nt { font-size: 8pt; color: #666; } .inv .subject { margin: 0 0 8px; }
.inv .totals .sm td { font-size: 9pt; color: #555; }
.inv .terms { margin-top: 16px; font-size: 9pt; white-space: pre-wrap; border-top: 1px solid #ccc; padding-top: 8px; }
.inv .sigs { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; margin-top: 26px; } .inv .sigblank { border-bottom: 1px solid #000; height: 40px; }
.inv .sigimg { height: 60px; display: block; } .inv .sigline { border-top: 1px solid #000; font-size: 9pt; }
.inv .foot { text-align: center; }
@media print { .inv .lines th { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .inv .lines tbody tr:nth-child(even) td { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.srccell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .doclist th:nth-child(4), .doclist td:nth-child(4), .doclist th:nth-child(5), .doclist td:nth-child(5) { display: none; } .doclist td { font-size: 14px; } }
.cologo { display: block; height: 84px; width: auto; max-width: 320px; object-fit: contain; margin-bottom: 6px; }
.logoprev { height: 60px; width: auto; max-width: 320px; background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 6px; }
.loginlogo { display: block; width: 100%; max-width: 280px; margin: 0 auto 10px; }
.brand img.logo { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
/* v1.3 pickers + address autocomplete */
.pickrow { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; } .pickrow .grow { flex: 1; min-width: 0; } .pickrow > .btn { white-space: nowrap; }
.acwrap { position: relative; } .acwrap > input { width: 100%; }
.acdrop { position: absolute; left: 0; right: 0; top: 100%; z-index: 200; margin-top: 2px; }
.acdrop li.act { background: var(--subtle); } .acdrop li.acfoot { cursor: default; font-size: 11px; } .acdrop li.acfoot:hover { background: none; }
.acstat { margin: 2px 0 10px; min-height: 1em; } .okv { color: var(--ok, #1a7f37); font-weight: 600; } .notv { color: var(--warn, #9a6700); font-weight: 600; }
.modal.sheet > .card { max-width: 620px; }
@media (max-width: 560px) { .pickrow { flex-wrap: wrap; } .pickrow > .btn { flex: 1; } .modal > .card { max-height: 96vh; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
 #agr-sell .pickrow .acwrap, #agr-sell .pickrow select.grow, #agr-sell .pickrow #locsel { flex: 1 1 100%; width: 100%; }
 #agr-sell #locinfo { display: none; }
 .acdrop li { padding: 12px 10px; } }

/* v1.9: shared/internal notes, payment schedules, signature statement */
.badge.shared { background: #e3f4e8; color: #17672e; } .badge.intl { background: #eee; color: #555; }
.inv .internal { color: #888; } .inv .intl { font-size: 8pt; font-style: italic; color: #a05a00; }
.inv .dnote { margin-bottom: 6px; } .inv .sched table { width: 100%; margin-top: 4px; } .inv .signstmt { font-style: italic; }
.sched td.btnrow { white-space: normal; } .sched td.btnrow .btn { margin: 2px 2px 2px 0; } .warn-t { color: #a05a00; font-weight: 600; }
@media print { .inv .internal, .inv .intl { display: none !important; } }
/* v2.0 line cost: small recalculate link under the price */
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.costhint { margin: 2px 0 6px; }
.costhint:empty { display: none; }

/* v2.1 On hold */
.badge.onhold { color: #fff; background: #c2410c; }
.holdbanner { background: #fff1e6; border: 2px solid #c2410c; border-radius: var(--radius); padding: 10px 14px; margin: 8px 0 12px; color: #3b1d00; }
.holdbanner .holdreason { font-size: 1.05rem; white-space: pre-wrap; margin: 4px 0; }
.pill.hold { background: #c2410c; color: #fff; }
.holdcell { white-space: pre-wrap; max-width: 380px; }
@media (prefers-color-scheme: dark) { .holdbanner { background: #3a2312; color: #ffd9bf; } }

/* v2.3 PayPal QR on invoices */
.paypal-qr { margin: 18px auto 8px; text-align: center; max-width: 200px; page-break-inside: avoid; }
.paypal-qr img { display: inline-block; width: 140px; height: 140px; border: 1px solid #ddd; padding: 6px; background: #fff; }
.paypal-qr .lbl { font-weight: 600; margin-top: 6px; font-size: 10pt; }
.paypal-qr .small { font-size: 9.5pt; color: #333; }

/* v2.4: notification banner is available on every office page, not just Today. */
.customer-banner{position:fixed;top:60px;left:50%;transform:translateX(-50%);width:min(700px,calc(100% - 24px));z-index:1000;display:flex;align-items:center;gap:10px;padding:14px 16px;background:var(--card,#fff);color:var(--text,#171717);border:2px solid var(--accent,#0067c0);border-radius:10px;box-shadow:0 6px 28px #0004}
.customer-banner[hidden]{display:none!important}.customer-banner .grow{min-width:0;overflow-wrap:anywhere}#notifybell{white-space:nowrap}
@media(max-width:600px){.customer-banner{align-items:flex-start;top:55px}.customer-banner .btn{padding:6px 8px}}

/* v2.5.2: keep unpaid balance and hold badges visible on phones, not off-screen. */
.invoice-mobile-status, .invoice-mobile-date { display: none; }
@media (max-width: 640px) {
  .invoicelist th:nth-child(2), .invoicelist td:nth-child(2),
  .invoicelist th:nth-child(6), .invoicelist td:nth-child(6),
  .invoicelist th:nth-child(8), .invoicelist td:nth-child(8) { display: none; }
  .invoicelist td:nth-child(1) { width: 23%; }
  .invoicelist td:nth-child(7) { white-space: nowrap; }
  .invoice-mobile-status, .invoice-mobile-date { display: block; margin-top: 5px; }
  .invoice-mobile-status .btnbar { margin: 5px 0; }
  .invoice-mobile-status .btn { white-space: normal; font-size: 12px; max-width: 100%; }
}
/* Not scheduled: actionable phone cards instead of an off-screen Schedule column. */
@media (max-width: 640px) {
 .unscheduled-list thead { display: none; }
 .unscheduled-list tbody { display: block; }
 .unscheduled-list tr { display: grid; grid-template-columns: 1fr auto; gap: 7px 10px; padding: 12px; border-bottom: 1px solid var(--line); }
 .unscheduled-list td { display: block; border: 0; padding: 0; }
 .unscheduled-list td:nth-child(1) { grid-column: 1; grid-row: 1; }
 .unscheduled-list td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
 .unscheduled-list td:nth-child(3) { grid-column: 1; grid-row: 3; }
 .unscheduled-list td:nth-child(3)::before { content: 'Age: '; color: var(--muted); }
 .unscheduled-list td:nth-child(4) { grid-column: 2; grid-row: 3; }
 .unscheduled-list td:nth-child(4)::before { content: 'Balance: '; color: var(--muted); }
 .unscheduled-list td:nth-child(5) { grid-column: 2; grid-row: 1; }
 .unscheduled-list td[colspan] { grid-column: 1 / -1; }
}

/* v2.5.6: identical scope formatting in staff, portal/public view and browser PDF/print. */
.scope-text { white-space:normal; overflow-wrap:anywhere; word-break:normal; line-height:1.4; }
.scope-text .scope-line,.scope-text li { white-space:pre-wrap; }
.scope-text .scope-blank { min-height:1em; }
.scope-text .scope-heading { color:inherit; line-height:1.3; margin:.4em 0 .15em; font-weight:700; white-space:pre-wrap; }
.scope-text h1.scope-heading { font-size:1.2em; }.scope-text h2.scope-heading { font-size:1.12em; }
.scope-text h3.scope-heading,.scope-text h4.scope-heading,.scope-text h5.scope-heading,.scope-text h6.scope-heading { font-size:1.05em; }
.scope-text .scope-list { margin:0; padding-left:1.5em; list-style-position:outside; }
.scope-text .scope-list li { margin:0 0 .1em; }
.inv .desc { margin-top:4px; }.inv .subject { font-weight:600; }
@media print { .scope-text { overflow:visible; orphans:2; widows:2; }.scope-text .scope-heading { break-after:avoid; page-break-after:avoid; }.scope-text li { break-inside:avoid; page-break-inside:avoid; }.inv .lines tbody tr { break-inside:auto; page-break-inside:auto; } }

/* v2.6.0: every sidebar section remains reachable from the phone's More tab. */
.more-nav .btn { justify-content: flex-start; gap: 12px; min-height: 48px; text-align: left; white-space: normal; }
.more-nav .ic { flex-shrink: 0; }

/* v2.7 staff mobile/offline. Never hidden behind the installed-app bottom tabs. */
.sync-banner{position:fixed;z-index:90;top:52px;left:240px;right:10px;padding:10px;background:var(--card,#fff8dc);border:2px solid #b67700;border-radius:8px;color:var(--text,#202020);box-shadow:0 2px 8px #0003;font-size:13px}
.sync-banner[hidden]{display:none!important}.has-sync-banner #app{padding-top:72px}.offline-job{display:block;color:inherit;text-decoration:none;margin-bottom:10px}.wrap{overflow-wrap:anywhere}.photos img{max-width:200px}
@media(max-width:800px){.sync-banner{left:8px;right:8px}.has-sync-banner #app{padding-top:98px}}

/* Completion is a status color, not the technician color. Labels avoid color-only meaning. */
:root{--completed-bg:#f3e8ff;--completed-ink:#4c1d95;--completed-edge:#7e22ce}
@media(prefers-color-scheme:dark){:root{--completed-bg:#3b1b59;--completed-ink:#f3e8ff;--completed-edge:#c084fc}}
.board .blk.is-complete,.week .wj.is-complete,.jobcard.is-complete{background:var(--completed-bg);color:var(--completed-ink);border-left-color:var(--completed-edge)}
.is-complete .muted,.jobcard.is-complete .addr,.jobcard.is-complete .when{color:var(--completed-ink);opacity:1}
.jobcard.is-complete .badge.st-complete{background:var(--completed-edge);color:#fff}
@media(prefers-color-scheme:dark){.jobcard.is-complete .badge.st-complete{color:#240c3c}}
.schedule-state{font-weight:700}
.schedule-legend{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}
.completed-key{background:var(--completed-bg);color:var(--completed-ink);border:1px solid var(--completed-edge);border-radius:6px;padding:4px 8px;font-weight:700}
/* v2.9.0 record screens: customer first, why we're here, grouped sections, collapsed details */
.recordbar { gap: 8px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; }
.record-menu { position: relative; }
.record-menu > summary { list-style: none; cursor: pointer; }
.record-menu > summary::-webkit-details-marker { display: none; }
.record-menu[open] > .record-menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: flex; flex-direction: column; gap: 6px; min-width: 230px; padding: 10px; background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius); box-shadow: var(--shadow); }
.record-head { border-top: 4px solid var(--badge-navy, #00275b); }
.record-kicker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .85rem; color: var(--muted); font-weight: 600; }
.record-name { margin: .2rem 0 .15rem; font-size: 1.45rem; line-height: 1.2; }
.record-addr { font-size: 1rem; }
.contact-actions { grid-template-columns: repeat(3, 1fr); }
.contact-actions:has(> :nth-child(2):last-child) { grid-template-columns: 1fr 1fr; }
.record-why .why-title { font-weight: 650; font-size: 1.08rem; margin-bottom: 4px; }
.record-why .why-desc { margin: 4px 0 8px; }
.next-visit { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 4px; padding: 10px 12px; border-left: 4px solid var(--badge-red, #ac0617); background: var(--ctl); border-radius: var(--radius-sm, 6px); }
.next-visit b { font-size: 1.05rem; }
.hold-schedule { align-items: center; margin-top: 8px; }
.hold-schedule .btn.primary { min-height: 44px; min-width: 140px; font-size: 1rem; }
.record-group { margin: 22px 2px 8px; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--badge-red, #ac0617); padding-bottom: 4px; }
.record-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.record-fold > summary::-webkit-details-marker { display: none; }
.record-fold > summary h2 { margin: 0; font-size: 1.05rem; }
.record-fold > summary::after { content: '▸'; margin-left: auto; color: var(--muted); }
.record-fold[open] > summary::after { content: '▾'; }
.record-fold[open] > summary { margin-bottom: 8px; }
.record-fold-plain { margin: 6px 0 12px; }
.record-fold-plain > summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.record-actions h3 { margin: 12px 0 4px; font-size: .95rem; }
.schedule-state.onhold-state { color: #c2410c; font-weight: 700; }
@media (max-width: 560px) { .record-name { font-size: 1.3rem; } .contact-actions .btn { padding-left: 6px; padding-right: 6px; } .record-menu[open] > .record-menu-pop { right: -4px; min-width: 210px; } }
@media (prefers-color-scheme: dark) { .record-head { border-top-color: #6f9ce0; } .next-visit { border-left-color: #ff8a80; } .schedule-state.onhold-state { color: #ffb07a; } }
[data-visit-error]:empty { display: none; }
/* v2.9.1 plain-text line items & totals on record screens; full document behind View invoice / View estimate */
.doc-lines-text .lt-list{list-style:none;margin:0;padding:0}
.doc-lines-text .lt-item{padding:8px 0;border-bottom:1px solid var(--line,#d9dee7)}
.doc-lines-text .lt-row{display:flex;gap:12px;align-items:baseline}
.doc-lines-text .lt-name{flex:1;font-weight:600;overflow-wrap:anywhere}
.doc-lines-text .lt-amt{white-space:nowrap;font-variant-numeric:tabular-nums}
.doc-lines-text .lt-desc{white-space:pre-line;overflow-wrap:anywhere;opacity:.85;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.doc-lines-text .lt-totals{margin:10px 0 4px auto;max-width:22rem}
.doc-lines-text .lt-total{display:flex;justify-content:space-between;gap:12px;padding:2px 0;font-variant-numeric:tabular-nums}
.doc-lines-text .lt-total.grand{font-weight:700;border-top:1px solid var(--line,#d9dee7);padding-top:4px;margin-top:2px}
.doc-lines-text .btnbar{margin-top:10px;align-items:center}
.doc-view-card{padding:0}
/* v2.10.0 truck inventory + punch lists */
.truck-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0}.truck-tools input[type=search]{flex:1 1 180px;min-width:0}
.truck-list,.truck-lowlist,.punch-list,.punch-tpl-list,.punch-edit-items{list-style:none;margin:0;padding:0}
.truck-item{display:flex;gap:10px;align-items:center;padding:10px 4px;border-bottom:1px solid var(--line)}.truck-item:last-child{border-bottom:0}
.truck-main{flex:1;min-width:0}.truck-desc{font-weight:600;overflow-wrap:anywhere}.truck-loc{display:inline-block;font-size:.75rem;font-weight:700;padding:1px 6px;border-radius:4px;background:var(--accent-soft);color:var(--ink);margin-right:6px}
.truck-qty{display:flex;align-items:center;gap:4px}.truck-qty .qbtn{min-width:40px;min-height:40px;font-size:1.25rem;padding:0}.truck-qty .qnum{min-width:2.4em;text-align:center;font-size:1.1rem}
.truck-item.is-low{background:linear-gradient(90deg,rgba(194,65,12,.12),transparent 60%)}.truck-lowtag{color:#b45309;font-weight:650;font-size:.8rem}
.is-negative,.truck-item.is-negative .qnum,.truckfrom.is-negative{color:var(--bad)}
.truck-lowcard{border-left:4px solid #c2410c}.truck-lowcard h2{color:#c2410c;margin-top:0}.truck-lowlist li{padding:4px 0}
.truckfrom,.truckstock{color:var(--ok);font-weight:600}
.punch-progress{display:inline-block;font-size:.75rem;font-weight:700;padding:1px 7px;border-radius:99px;background:var(--accent-soft);color:var(--ink);margin-right:6px}
.punch-bar{height:8px;border-radius:99px;background:var(--subtle);overflow:hidden;margin:4px 0 8px}.punch-bar span{display:block;height:100%;background:var(--ok)}
.punch-list li{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;padding:8px 0;border-bottom:1px solid var(--line)}.punch-list li:last-child{border-bottom:0}
.punch-item{flex:1;min-width:0;margin:0}.punch-item input{width:22px;height:22px}.punch-list li.is-done .punch-item span{text-decoration:line-through;color:var(--muted)}
.punch-meta{flex-basis:100%;padding-left:30px}.punch-meta:empty{display:none}.punch-del{order:2}
.punch-form{border:1px solid var(--line);border-radius:var(--radius);padding:10px;margin:10px 0}.punch-form legend{font-weight:650;padding:0 4px}
.punch-tpls{display:grid;gap:6px;margin-bottom:8px}.punch-tpl{margin:0}.punch-pending li{display:flex;gap:6px;align-items:center;padding:4px 0}
.punch-tpl-list li{display:flex;gap:10px;align-items:flex-start;padding:10px 0;border-bottom:1px solid var(--line)}.punch-tpl-list li:last-child{border-bottom:0}
.punch-edit-items li{display:flex;gap:6px;align-items:center;margin:6px 0}.punch-edit-items li input{flex:1;min-width:0}
.punch-add,.punch-apply{margin-top:8px;gap:6px}.punch-add input{min-width:0}
@media (prefers-color-scheme: dark){.truck-lowtag{color:#ffb07a}.truck-lowcard h2{color:#ffb07a}.truck-lowcard{border-left-color:#ff8a4c}}
.photo-choice{display:inline-flex;flex-wrap:wrap;gap:8px}

/* v2.10.2: an Open Messages link that is not ready yet looks inactive (tapping it explains why). */
.btn[aria-disabled="true"]{opacity:.55}

.record-status { display: flex; flex-direction: column; gap: 6px; }
.record-status .statusbar { margin: 0; }
.record-status.card [data-edit-contact],
.record-status.card [data-record-schedule] { min-height: 46px; width: 100%; justify-content: center; }
.record-head .record-status { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.record-head.is-compact .record-name { margin: 0 0 2px; font-size: 1.15rem; }
.record-head.is-compact .record-addr,
.record-head.is-compact .record-place { font-size: .9rem; }
.record-head.is-compact .record-maps { margin: 0; font-size: .75rem; }
.record-head.is-compact .contact-actions.bigbtns { margin: 6px 0 4px; gap: 6px; }
.record-head.is-compact .contact-actions .btn { min-height: 36px; font-size: .9rem; }
.record-head .record-status .statusbar { gap: 4px; }
.record-head .record-status .statusbar .btn { min-height: 34px; font-size: .8rem; flex-direction: row; }
.record-status-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.record-status-actions .btn { min-height: 34px; font-size: .8rem; flex: 1 1 auto; justify-content: center; }
.record-status-actions .btn.primary { flex: 1 1 8rem; }
@media (max-width: 560px) { .record-head.is-compact .record-name { font-size: 1.15rem; } }
.kind-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.kind-tabs .kind-tab { min-height: 44px; }
.kind-tabs .kind-tab.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
@media (min-width: 600px) {
  .kind-tabs { grid-template-columns: repeat(4, 1fr); }
}
.badge.schedule-kind { font-weight: 600; }
.badge.schedule-kind.kind-call { background: #f3e8d3; color: #6a4a00; }
.badge.schedule-kind.kind-service { background: #e3eef8; color: #0b4a7a; }
.badge.schedule-kind.kind-repair { background: #f8e8e3; color: #7a2e0b; }
.badge.schedule-kind.kind-install { background: #e4f3ea; color: #14632a; }

/* v2.10.8 Trash + photo delete */
.photo-wrap{position:relative;display:inline-block;margin:0 8px 8px 0}
.photo-wrap img{display:block;max-width:100%;border-radius:8px}
.photo-wrap .photo-del{position:absolute;right:6px;bottom:6px;opacity:.95}
.trash-item{margin-bottom:10px}
.modal .btnbar{flex-wrap:wrap}
@media (max-width:430px){
  .photo-wrap{display:block}
  .photo-wrap .photo-del{position:static;margin-top:6px;width:100%}
  .trash-item .btnbar .btn{flex:1}
}

/* v2.10.9: pinned low-stock card at the top of Today */
.today-low{margin:0 0 14px;border-left:4px solid #c2410c}
.today-low h2{color:#c2410c;margin:0 0 4px}
.today-low-truck{margin:12px 0 4px;font-size:.95rem}
.today-low-list{list-style:none;margin:0;padding:0}
.today-low-row{display:flex;align-items:center;gap:8px;padding:8px 0;border-top:1px solid var(--line, rgba(0,0,0,.08))}
.today-low-row:first-child{border-top:0}
.today-low-open{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:2px;background:none;border:0;padding:0;text-align:left;font:inherit;color:inherit;cursor:pointer}
.today-low-qty{font-weight:650;color:#b45309}
.today-low-row .btn{flex-shrink:0}
@media (max-width:430px){.today-low-row{flex-wrap:wrap}.today-low-row .btn{min-height:44px;min-width:96px}}
@media (prefers-color-scheme: dark){.today-low h2{color:#ffb07a}.today-low{border-left-color:#ff8a4c}.today-low-qty{color:#ffb07a}}


/* v2.10.10: install groups, estimate/invoice compact approval+signature, history is laptop-only */
.install-group-row td, .install-group-row th { padding-top: 12px; border-top: 1px solid var(--stroke, #d9e2e9); font-weight: 700; color: var(--navy, #00275b); }
.lt-item.install-group-label { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--stroke, #d9e2e9); }
.install-saved { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.install-saved-row { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid var(--stroke, #d9e2e9); border-radius: var(--radius, 8px); background: var(--card, #fff); }
.install-saved-row .grow { min-width: 0; }
.install-line { margin-bottom: 8px; }
.job-doc-approval { margin: 8px 0; }
.job-doc-approval-status p { margin: 0 0 4px; }
.job-doc-sign { margin: 8px 0; }
.job-doc-sign .sigimg { max-height: 80px; }
.job-estimate-actions { flex-wrap: wrap; }
@media (max-width: 799px) {
  .desktop-only-history { display: none !important; }
  .install-saved-row { flex-wrap: wrap; }
  .install-saved-row .btn { min-height: 44px; }
  .job-estimate-actions .btn { min-height: 44px; }
}
@media (prefers-color-scheme: dark) {
  .install-group-row td, .install-group-row th { color: #d6e4f5; }
}

[data-install-error] { margin: 8px 0; }
[data-idesc] { min-height: 4.5em; }

.job-invoice-collect { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.job-invoice-actions.btnbar, .job-invoice-collect .btnbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
@media (max-width: 430px) {
  .job-invoice-actions.btnbar .btn, .job-invoice-actions.btnbar a.btn { min-height: 44px; }
}

.record-head .record-why.is-embedded { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.record-head .record-why.is-embedded .why-title { font-size: 1rem; margin: 0 0 2px; }
.record-head .record-why.is-embedded .why-desc { margin: 0 0 4px; font-size: .9rem; }
.record-head .next-visit.is-inline { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin: 4px 0 0; padding: 0; border-left: 0; background: transparent; }
.record-head .next-visit.is-inline b { font-size: .9rem; }
.record-head .record-why + .record-status { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }


/* v2.10.15 app-wide declutter: tighter type, wrapping actions, less empty filler */
#app h1 { font-size: 1.28rem; margin: 0 0 8px; }
#app .card { padding: 12px 14px; }
#app .btnbar, .doc-actions.btnbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#app .datebar { gap: 6px; margin: 0 0 8px; }
#app p.muted, #app p.small.muted, #app .date-meta { margin: 0 0 8px; }
.invoice-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: start; padding: 10px 12px; }
.invoice-overview a, .invoice-overview div { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
.invoice-overview strong { font-size: 1.05rem; }
.settings-jump { flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.settings-jump .btn { min-height: 36px; }
.schedule-legend { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.compact-card { padding: 10px 12px; }
.more-nav { gap: 8px; }
@media (max-width: 560px) {
  #app h1 { font-size: 1.18rem; }
  #app .card { padding: 10px 12px; }
  .invoice-overview { gap: 6px; }
  .invoice-overview strong { font-size: 1rem; }
  .doc-actions.btnbar .btn, .doc-actions.btnbar a.btn { min-height: 44px; }
  .settings-jump .btn { min-height: 40px; }
}

/* v2.10.16 invoiced job: no separate Estimate & invoice box; overflow + signature sit on the invoice card. */
.job-doc-overflow { margin-top: 8px; }
.job-invoice-collect .job-doc-sign { margin: 8px 0; }
.job-invoice-collect .job-doc-approval { margin: 0 0 8px; }

.job-approval-badge { display: inline-block; font-size: 11px; font-weight: 600; line-height: 1.3; padding: 2px 8px; border-radius: 999px; background: #e8edf2; color: #243041; vertical-align: middle; }
.job-approval-badge.is-approved { background: #e3f6ea; color: #136b34; }
.job-approval-badge.is-declined, .job-approval-badge.is-stale { background: #fdecea; color: #8a1f11; }
.job-approval-badge.is-waiting, .job-approval-badge.is-draft, .job-approval-badge.is-review_required { background: #eef3f8; color: #1a3650; }
#job-customer-approval:empty { display: none; margin: 0; }

/* v2.11.0 Yearly maintenance agreement */
.badge.member { color:#0e6b0e; background:#dff6dd; font-weight:600; }
.badge.agr-active { color:#0e6b0e; background:#dff6dd; }
.badge.agr-renewal { color:#8a5300; background:#fff4ce; }
.badge.agr-expired, .badge.agr-canceled { color:var(--muted); background:var(--subtle); }
.agr-list .agr-row { display:flex; text-decoration:none; color:inherit; padding:10px 0; border-bottom:1px solid var(--line,rgba(0,0,0,.08)); }
.agr-list .agr-row:last-child { border-bottom:0; }
.sigpad { display:block; max-width:100%; }
#yearly-maintenance h3 { font-size:1rem; }

/* v2.11.3: customer's other completed jobs at the bottom of the job screen */
#job-other-completed { padding: 10px 12px; }
#job-other-completed h2 { margin: 0 0 8px; font-size: 1rem; }
.job-other-list { display: flex; flex-direction: column; gap: 4px; }
a.job-other {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "num date total" "title title title";
  column-gap: 10px;
  row-gap: 2px;
  align-items: baseline;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 4px solid var(--completed-edge);
  background: var(--completed-bg);
  color: var(--completed-ink);
}
a.job-other .job-other-num { grid-area: num; font-weight: 700; }
a.job-other .job-other-date { grid-area: date; font-size: 12px; opacity: .9; min-width: 0; }
a.job-other .job-other-total { grid-area: total; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
a.job-other .job-other-title { grid-area: title; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
a.job-other.is-complete .job-other-date, a.job-other.is-complete .job-other-title { color: var(--completed-ink); }
#job-other-show-all { margin-top: 8px; width: 100%; }
@media (min-width: 800px) {
  a.job-other {
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas: "num date title total";
    align-items: center;
  }
  a.job-other .job-other-title { font-size: 14px; }
  #job-other-show-all { width: auto; }
}

#job-cost-card .job-cost-line, .job-cost-line { align-items: flex-end; gap: 8px; margin: 0 0 8px; }
#job-cost-card #job-cost-fields { margin-top: 8px; }
#job-cost-card #job-materials-cost, [data-nccost] { max-width: 16rem; }
.job-charge-tabs { margin: 0 0 12px; }
.job-charge-tabs .btn { min-height: 40px; }
.nc-job-cost { margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.nc-job-cost h3, [data-nc-builder] h3 { margin: 16px 0 8px; font-size: 1rem; color: var(--ink); }
.install-saved-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.install-saved-row:last-child { border-bottom: 0; }
