/* Clients: "By technician" board (cb-*) and the client record card (cc-*). Mobile first; colors only from app.css variables. */
.cb-wrap .spacer, .cc .spacer { flex: 1; }
.cb-tools { margin-bottom: 12px; align-items: start; }
.cb-views { flex-wrap: wrap; }
.chip-toggle.on, .chip-toggle[aria-pressed="true"], .chip-toggle[aria-checked="true"] { background: var(--brand-3); border-color: var(--brand-2); color: var(--ink); }
button.chip-toggle { color: var(--ink); font-family: inherit; white-space: nowrap; }

/* ---------- board ---------- */
.cb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.cb-bar > select { width: auto; flex: 1 1 200px; max-width: 320px; }
.cb-mpwrap, .cb-hintwrap { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 640px) { .cb-bar > select { max-width: none; flex-basis: 100%; } .cb-bar .spacer { display: none; } }
.cb-mp { min-height: 40px; white-space: normal; line-height: 1.2; }
.cb-hint { font-size: 13.5px; }
.cb-grip-demo { font-weight: 800; }
.cb-status { font-size: 13.5px; margin-bottom: 8px; }
.cb-selbar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 10px; border: 1px solid var(--brand-2); border-radius: var(--radius); background: var(--brand-3); box-shadow: var(--shadow); }
.cb-selbar select { min-height: 34px; max-width: 60vw; }
.cb-board { display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding-bottom: 10px; align-items: flex-start; }
.cb-col { flex: 0 0 calc(100vw - 72px); max-width: 340px; scroll-snap-align: start; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; transition: border-color .12s, box-shadow .12s; }
@media (min-width: 700px) { .cb-col { flex-basis: 290px; } }
.cb-col.over { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-3); }
.cb-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.cb-title { display: flex; align-items: center; gap: 8px; }
.cb-title b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; border: 1px solid rgba(0,0,0,.12); }
.cb-load { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 4px; }
.cb-diff.ok { color: var(--good); } .cb-diff.off { color: var(--warn); }
.cb-meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; }
.cb-meter span { display: block; height: 100%; border-radius: 3px; }
.cb-list { display: flex; flex-direction: column; gap: 8px; padding: 8px; min-height: 90px; }
@media (min-width: 700px) { .cb-list { max-height: 68vh; overflow-y: auto; } }
.cb-empty { text-align: center; padding: 18px 6px; font-size: 14px; border: 2px dashed var(--line); border-radius: var(--radius-s); margin: 0; }
.cb-more { align-self: center; }
.cb-card { display: flex; align-items: stretch; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 4px 6px 6px; box-shadow: var(--shadow); user-select: none; -webkit-user-select: none; }
@media (hover: hover) and (pointer: fine) { .cb-card { cursor: grab; } }
.cb-card.sel { border-color: var(--brand); background: var(--brand-3); }
.cb-card.dragging { opacity: .45; }
.cb-check { display: flex; align-items: flex-start; padding-top: 2px; }
.cb-check input { width: 20px; height: 20px; margin: 0; }
.cb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cb-name { font-weight: 700; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-name:hover { text-decoration: underline; }
.cb-body small { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-due.late { color: var(--warn); font-weight: 700; }
.cb-side { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2px; }
.cb-grip { display: inline-flex; align-items: center; justify-content: center; width: 40px; min-height: 36px; font-size: 20px; line-height: 1; color: var(--ink-3); border-radius: 8px; cursor: grab; touch-action: none; }
.cb-grip:hover { background: var(--surface-2); color: var(--ink); }
.cb-move { min-height: 30px; padding: 0 8px; font-size: 13px; }
.cb-ghost { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; max-width: 240px; padding: 8px 12px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.25); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.cb-dragging .cb-board { scroll-snap-type: none; }
body.cb-dragging, body.cb-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.cb-menu { display: grid; gap: 8px; }
.cb-menu-btn { justify-content: flex-start; gap: 10px; width: 100%; text-decoration: none; }
.cb-toast { display: flex; align-items: center; gap: 12px; }
.cb-toast > span { flex: 1; }
.cb-undo { flex: none; background: var(--bg); color: var(--ink); }

/* ---------- client record card ---------- */
.cc-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.cc-tabs::-webkit-scrollbar { display: none; }
.cc-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--ink-2); font: 700 14.5px var(--font); cursor: pointer; white-space: nowrap; }
.cc-tab:hover { color: var(--ink); }
.cc-tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.cc-count:not(:empty) { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; }
.cc-loading { padding: 12px 2px; }
.cc-tiles { margin-bottom: 12px; }
.cc-tiles .tile .v { font-size: 1.15rem; white-space: normal; }
.cc-tiles .tile .d { color: var(--ink-3); font-weight: 600; }
.cc-top { margin-bottom: 12px; align-items: start; }
.cc-top > .card + .card { margin-top: 0; }
.cc-addr { font-weight: 600; margin-bottom: 8px; }
.cc-actions { flex-wrap: wrap; margin-bottom: 10px; }
.cc-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 14px; }
.cc-kv { display: flex; flex-direction: column; min-width: 0; }
.cc-kv small { font-size: 12.5px; font-weight: 600; }
.cc-kv span { overflow-wrap: anywhere; }
.cc-kv.late span { color: var(--warn); font-weight: 700; }
.cc-technote { margin-top: 10px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--warn-bg); color: var(--ink); white-space: pre-wrap; }
.cc-technote small { display: block; color: var(--warn); font-weight: 700; }
.cc-assign { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cc-assign select { flex: 1; min-width: 0; }
.cc-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.cc-check input { width: 18px; height: 18px; }
.cc-svcs { display: grid; gap: 8px; }
.cc-svc { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--radius-s); }
.cc-svc-name { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
@media (min-width: 760px) { .cc-svc { grid-template-columns: 2fr repeat(4, 1fr); align-items: center; } .cc-svc-name { grid-column: auto; flex-direction: column; gap: 0; } }

/* notes */
.cc-composer textarea { width: 100%; margin-top: 10px; }
.cc-composer-foot { align-items: center; margin-top: 8px; flex-wrap: wrap; }
.cc-note-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.cc-note-tools .chips { flex: 1 1 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
.cc-note-tools input { flex: 1 1 100%; }
@media (min-width: 760px) { .cc-note-tools .chips { flex: 1 1 auto; flex-wrap: wrap; } .cc-note-tools input { flex: 0 1 260px; } }
.cc-notes { display: flex; flex-direction: column; }
.cc-note { padding: 10px 2px; border-bottom: 1px solid var(--line-2); }
.cc-note:last-child { border-bottom: 0; }
.cc-note.pinned { background: var(--brand-3); border-radius: var(--radius-s); padding: 10px; margin-bottom: 4px; }
.cc-note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.cc-stamp { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.cc-note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.cc-note-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* history */
.cc-hist-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.cc-hist-tools .chips { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
.cc-hist-tools select { width: auto; }
.cc-month { margin: 14px 0 4px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.cc-month:first-child { margin-top: 0; }
.cc-visit { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.cc-v-date { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cc-v-main { min-width: 0; }
.cc-v-main small { display: block; }
.cc-skip { color: var(--bad); font-weight: 600; font-size: 14px; }
.cc-v-notes { margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
.cc-v-notes li { overflow-wrap: anywhere; }
@media (max-width: 520px) { .cc-visit { grid-template-columns: 1fr auto; } .cc-v-date { flex-direction: row; align-items: center; grid-column: 1 / -1; } .cc-v-main { grid-column: 1; } }
.cc-photos { display: grid; gap: 10px; max-height: 70vh; overflow-y: auto; }
.cc-photo { width: 100%; height: auto; border-radius: var(--radius-s); background: var(--surface-2); }
.cc-edit-acts { margin-bottom: 12px; }

/* printed client record (forced ink on white) */
.cc-doc { color: #111; background: #fff; font-size: 12px; }
.cc-doc .doc-head { display: flex; align-items: flex-start; gap: 14px; padding-bottom: 10px; border-bottom: 2px solid #111; margin-bottom: 8px; }
.cc-doc .doc-logo { max-height: 64px; max-width: 160px; object-fit: contain; }
.cc-doc .doc-co { flex: 1; line-height: 1.35; color: #222; }
.cc-doc .doc-co-name { font-size: 16px; font-weight: 800; color: #111; }
.cc-doc .doc-title { text-align: right; }
.cc-doc .doc-title-main { font-size: 17px; font-weight: 800; color: #111; }
.cc-doc .doc-title-meta { color: #444; }
.cc-doc h3 { margin: 14px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.cc-doc p { margin: 4px 0; white-space: pre-wrap; }
.cc-doc-tbl { width: 100%; border-collapse: collapse; }
.cc-doc-tbl th, .cc-doc-tbl td { border: 1px solid #bbb; padding: 4px 6px; text-align: left; vertical-align: top; overflow-wrap: anywhere; white-space: pre-wrap; }
.cc-doc-tbl th { background: #eee; font-size: 11px; }
.cc-doc-tbl tr { break-inside: avoid; }
@media print {
  body.printing > :not(.print-holder) { display: none !important; }
  body.printing { background: #fff; }
  body.printing .print-holder { display: block !important; position: static; }
}
