/* Lakeshore Marine Group CRM — nautical navy / white / teal */
:root {
  --navy: #002C61;
  --navy-2: #0a3b78;
  --navy-dark: #001b3d;
  --teal: #0e8a8c;
  --teal-2: #13a8aa;
  --teal-light: #e3f4f4;
  --gold: #c9a24a;
  --bg: #f3f6fa;
  --card: #ffffff;
  --line: #dde5ee;
  --text: #13233a;
  --muted: #5f7186;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --warn: #b7791f;
  --warn-bg: #fff6e0;
  --ok: #1f8a4c;
  --ok-bg: #e6f6ed;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 28, 61, .06), 0 2px 8px rgba(0, 28, 61, .05);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.45; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { color: var(--teal); text-decoration: underline; }
h1, h2, h3 { color: var(--navy); margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.55rem; letter-spacing: .01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: .98rem; }
small, .muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 2px 6px 16px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 12px; }
.brand:hover { color: #fff; text-decoration: none; }
.brand img { width: 44px; height: 44px; }
.brand .bt { font-weight: 700; letter-spacing: .06em; font-size: .86rem; text-transform: uppercase; line-height: 1.15; }
.brand .bt span { display: block; color: var(--teal-2); font-size: .74rem; letter-spacing: .2em; margin-top: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; color: #cfdcec; padding: 9px 10px; border-radius: 8px;
  font-weight: 500; margin-bottom: 2px;
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav a.active { background: var(--teal); color: #fff; }
.nav .ico { width: 20px; text-align: center; font-size: 1rem; }
.nav .section-label { color: #7f98b6; font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; margin: 14px 10px 6px; }
.sidebar-foot { margin-top: 18px; font-size: .75rem; color: #7f98b6; padding: 0 10px; }
.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 26px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar form.search { flex: 1; max-width: 520px; }
.topbar input[type=search] { width: 100%; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: .85rem; }
.menu-btn { display: none; background: none; border: 0; font-size: 1.5rem; color: var(--navy); cursor: pointer; }
.content { padding: 22px 26px 60px; max-width: 1500px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- sample banner / flashes ---------- */
.sample-banner { background: var(--warn-bg); color: #7a5512; border-bottom: 1px solid #f1dfb0; padding: 7px 26px; font-size: .85rem; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid; }
.flash.success { background: var(--ok-bg); border-color: #b9e3c9; color: #155f35; }
.flash.error { background: var(--danger-bg); border-color: #f3c2bc; color: #8e2a1f; }

/* ---------- cards / grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.card + .card { margin-top: 16px; }
.card h2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h2 a, .card h2 .small-link { font-size: .8rem; font-weight: 500; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }
.grid.side-r { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); }
.stack > * + * { margin-top: 16px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--navy); }
.kpi.teal::before { background: var(--teal); }
.kpi.gold::before { background: var(--gold); }
.kpi.red::before { background: var(--danger); }
.kpi .label { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.kpi .value { font-size: 1.45rem; font-weight: 700; color: var(--navy); margin-top: 4px; }
.kpi .meta { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.kpi a { color: inherit; }
.kpi a:hover { text-decoration: none; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f7f9fc; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; white-space: nowrap; }
tbody tr:hover { background: #f8fbfd; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.card table th { background: transparent; }
.card table td, .card table th { padding: 7px 6px; }
.empty { color: var(--muted); padding: 18px; text-align: center; font-style: italic; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: #eef2f7; color: var(--navy); white-space: nowrap; }
.badge.lead { background: #e8f0fb; color: #1d4f91; }
.badge.customer { background: var(--teal-light); color: #0b6c6e; }
.badge.vendor { background: #f1ecf9; color: #5a3d8a; }
.badge.new-sale, .badge.new-inventory { background: #e6eefa; color: var(--navy); }
.badge.brokerage-sale, .badge.brokerage-listing { background: #fbf3e2; color: #8a6418; }
.badge.customer-boat { background: var(--teal-light); color: #0b6c6e; }
.badge.won-closed, .badge.sold, .badge.done, .badge.in-stock { background: var(--ok-bg); color: var(--ok); }
.badge.lost, .badge.withdrawn { background: var(--danger-bg); color: var(--danger); }
.badge.waiting-on-parts, .badge.under-contract, .badge.on-order { background: var(--warn-bg); color: var(--warn); }
.badge.in-progress, .badge.listed { background: #e3f4f4; color: #0b6c6e; }
.badge.invoiced { background: #eceff3; color: #45556a; }
.badge.trade { background: #fde9f1; color: #9a2a5a; }
.tag { display: inline-block; font-size: .72rem; background: #eef4f8; color: #33506f; padding: 1px 7px; border-radius: 4px; margin: 1px 2px 1px 0; }
.tag:hover { background: var(--teal-light); text-decoration: none; }
.due { font-size: .78rem; font-weight: 600; padding: 1px 7px; border-radius: 4px; white-space: nowrap; }
.due.overdue { background: var(--danger-bg); color: var(--danger); }
.due.today { background: var(--warn-bg); color: var(--warn); }
.due.upcoming { background: #eef2f7; color: var(--muted); }

/* ---------- forms ---------- */
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=datetime-local],
input[type=search], input[type=file], select, textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid #c9d4e0; border-radius: 7px; padding: 7px 10px; width: 100%;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(14,138,140,.35); border-color: var(--teal); }
label { display: block; font-weight: 600; color: #2b405a; font-size: .82rem; margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px 14px; }
.form-grid .f { grid-column: span 6; }
.form-grid .f.s3 { grid-column: span 3; }
.form-grid .f.s4 { grid-column: span 4; }
.form-grid .f.s5 { grid-column: span 5; }
.form-grid .f.s2 { grid-column: span 2; }
.form-grid .f.s8 { grid-column: span 8; }
.form-grid .f.s12 { grid-column: span 12; }
.form-grid .help { color: var(--muted); font-size: .76rem; margin-top: 3px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; margin: 14px 0 0; }
legend { color: var(--navy); font-weight: 700; padding: 0 6px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { width: 260px; }
.filters select { width: auto; min-width: 140px; }
.inline-form { display: inline; }
.check { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.check input { width: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; font-size: .86rem; cursor: pointer;
  border: 1px solid var(--navy); background: var(--navy); color: #fff; padding: 7px 14px; border-radius: 7px; white-space: nowrap;
}
.btn:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.btn.teal { background: var(--teal); border-color: var(--teal); }
.btn.teal:hover { background: var(--teal-2); }
.btn.ghost { background: #fff; color: var(--navy); border-color: #c9d4e0; }
.btn.ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn.danger { background: #fff; color: var(--danger); border-color: #efc0ba; }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.sm { padding: 3px 9px; font-size: .78rem; }
.btn.link { background: none; border: 0; color: var(--navy-2); padding: 0; font-weight: 500; }
.btn.link:hover { color: var(--teal); text-decoration: underline; background: none; }
.seg { display: inline-flex; border: 1px solid #c9d4e0; border-radius: 8px; overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg a { padding: 6px 12px; color: var(--navy); font-weight: 600; font-size: .84rem; border-right: 1px solid #e2e8ef; }
.seg a:last-child { border-right: 0; }
.seg a:hover { background: #f3f7fb; text-decoration: none; }
.seg a.on { background: var(--navy); color: #fff; }
.seg .count { opacity: .7; font-weight: 500; margin-left: 3px; }

/* ---------- detail ---------- */
dl.props { display: grid; grid-template-columns: 108px 1fr; gap: 6px 10px; margin: 0; }
dl.props dt { color: var(--muted); font-size: .82rem; }
dl.props dd { margin: 0; word-break: break-word; }
.pre { white-space: pre-wrap; }
.hero { display: flex; align-items: center; gap: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; flex: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .tico { width: 30px; height: 30px; border-radius: 50%; background: var(--teal-light); color: var(--teal); display: grid; place-items: center; font-size: .9rem; }
.timeline .head { display: flex; justify-content: space-between; gap: 10px; }
.timeline .when { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.list-plain li:last-child { border-bottom: 0; }
.task-done { text-decoration: line-through; color: var(--muted); }

/* ---------- pipeline bars ---------- */
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 90px; gap: 10px; align-items: center; font-size: .86rem; }
.bar-track { background: #eef2f7; height: 18px; border-radius: 4px; overflow: hidden; display: flex; }
.bar-track span { display: block; height: 100%; }
.bar-new { background: var(--navy); }
.bar-brk { background: var(--gold); }
.bar-oth { background: var(--teal); }
.legend { display: flex; gap: 14px; font-size: .78rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* ---------- kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: #e9eff6; border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col.drag-over { background: #d5ecec; outline: 2px dashed var(--teal); }
.col-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 8px; border-bottom: 3px solid var(--navy); margin-bottom: 10px; }
.col-head h3 { margin: 0; font-size: .86rem; text-transform: uppercase; letter-spacing: .05em; }
.col-head .sum { font-size: .78rem; color: var(--muted); font-weight: 600; }
.col.won .col-head { border-color: var(--ok); }
.col.lost .col-head { border-color: var(--danger); }
.col.waiting .col-head { border-color: var(--warn); }
.kcard { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 8px; padding: 9px 10px; margin-bottom: 9px; box-shadow: var(--shadow); cursor: grab; }
.kcard.brokerage { border-left-color: var(--gold); }
.kcard.other { border-left-color: var(--teal); }
.kcard.dragging { opacity: .5; }
.kcard .t { font-weight: 600; color: var(--navy); display: block; }
.kcard .m { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.kcard .row { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; }
.kcard .val { font-weight: 700; color: var(--text); }
.kcard form { flex: 1; }
.kcard select { font-size: .78rem; padding: 3px 6px; width: 100%; }
.kcard .row small { text-align: right; line-height: 1.15; }
.col .add { display: block; text-align: center; color: var(--muted); font-size: .82rem; padding: 6px; border: 1px dashed #b9c7d6; border-radius: 8px; }
.col .add:hover { color: var(--teal); border-color: var(--teal); text-decoration: none; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); opacity: 0; transition: opacity .2s; z-index: 50; }
.toast.show { opacity: 1; }

/* ---------- responsive ---------- */
td.boat-col { min-width: 210px; }
@media (max-width: 1400px) { .hide-md { display: none; } }
@media (max-width: 1100px) {
  .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .grid.side, .grid.side-r { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; z-index: 40; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .menu-btn { display: block; }
  .topbar { padding: 10px 14px; }
  .topbar .who { display: none; }
  .content { padding: 16px 14px 50px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .form-grid .f, .form-grid .f.s2, .form-grid .f.s3, .form-grid .f.s4, .form-grid .f.s5, .form-grid .f.s8 { grid-column: span 12; }
  .filters input[type=search] { width: 100%; }
  .bar-row { grid-template-columns: 100px 1fr 70px; }
  .hide-sm { display: none; }
}
@media print {
  .sidebar, .topbar, .sample-banner, .actions, .no-print, form.btns { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  body { background: #fff; }
}

/* ---------- build sheets ---------- */
.build-table { overflow-x: auto; }
.build-table table { font-size: .9rem; }
.build-table tr.sec-head td { background: var(--navy); color: #fff; font-weight: 700; letter-spacing: .04em; padding: 6px 8px; border-radius: 0; }
.build-table tr.sec-head small { color: #b9cbe2; font-weight: 500; margin-left: 6px; }
.build-table tbody.sec + tbody.sec tr.sec-head td { border-top: 10px solid #fff; }
.build-table tr.sec-sub td { background: #f4f7fb; font-weight: 700; color: var(--navy); font-size: .84rem; }
.build-table tfoot td, tr.total-row td { font-weight: 800; color: var(--navy); border-top: 2px solid var(--navy); font-size: .95rem; }
.serial-form { display: flex; gap: 4px; min-width: 190px; }
.serial-form input { padding: 4px 7px; font-size: .82rem; font-family: ui-monospace, Menlo, Consolas, monospace; }
.serial-form input.needs { border-color: #e6b54f; background: #fffaf0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86em; }
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #eef2f7; color: var(--navy); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.picker-opts { display: flex; gap: 14px; margin-top: 4px; }
.picker-opts .check { font-size: .78rem; color: var(--muted); margin: 0; }
.picked-note { color: var(--teal); }
.sug-h { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 0 2px; }
.sug li { padding: 6px 0; }
details > summary { cursor: pointer; color: var(--navy); }
details .card { box-shadow: none; border: 0; padding: 8px 0 0; }
@media print { .serial-form button { display: none; } .serial-form input { border: 0; padding: 0; background: none; } }
.build-table td:nth-child(2) { min-width: 260px; }
.build-table td:first-child a, .build-table td:first-child { font-size: .84rem; }
/* v1.2 build table: compact so serial + actions fit at laptop widths */
.build-table th, .build-table td { padding: 6px 6px; }
.build-table td.num, .build-table th.num { white-space: nowrap; }
.build-table td:nth-child(2) { min-width: 220px; }
.build-table th:nth-child(3), .build-table td:nth-child(3) { width: 40px; }
.serial-form { min-width: 0; }
.serial-form input { width: 118px; }
.serial-form .btn.sm { padding: 3px 7px; }
.build-table td:nth-child(2) { min-width: 200px; }
@media (max-width: 1280px) { .build-table .hide-md { display: none; } }
.build-table td.row-acts { width: 22px; text-align: center; padding-left: 2px; padding-right: 2px; line-height: 1.6; }
.build-table td.row-acts .inline-form { display: block; }
.build-table td.row-acts .btn.link { padding: 0; }
.grid > .card + .card { margin-top: 0; }
.build-table.compact .unit-col { display: none; }
.timeline li.muted { display: block; }

/* ---------------- Reports ---------------- */
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: 2px; }
.small { font-size: .82rem; }
.flash.warn { background: var(--warn-bg); border-color: #f1dfb0; color: #7a5512; }
.rep-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.rep-groups .card + .card { margin-top: 0; }
.rep-list { list-style: none; margin: 0; padding: 0; }
.rep-list li { padding: 7px 0; border-bottom: 1px solid #edf1f5; display: flex; flex-direction: column; gap: 1px; }
.rep-list li:last-child { border-bottom: 0; }
.rep-list .muted { font-size: .8rem; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { margin-left: 3px; }
.rep-filters { align-items: flex-end; padding: 10px 14px; }
.rep-filters label { display: flex; flex-direction: column; font-size: .74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; gap: 3px; }
.rep-filters .custom-dates { display: inline-flex; align-items: center; gap: 4px; }
.rep-filters .custom-dates[hidden] { display: none; }
.rep-range { margin: -6px 0 12px; }
.rep-note { background: #f2f7fc; border: 1px solid #d9e6f3; border-radius: 8px; padding: 7px 12px; margin-bottom: 10px; font-size: .86rem; color: #33506f; }
.rep-def { color: #33506f; font-size: .88rem; margin: 0 0 12px; }
.rep-table + .rep-table { margin-top: 16px; }
.table-wrap.flat { border: 0; box-shadow: none; border-radius: 0; }
table.report td.neg { color: var(--danger); }
table.report tfoot td { font-weight: 700; background: #f4f7fb; border-top: 2px solid var(--navy); color: var(--navy); white-space: nowrap; }
/* charts (pure CSS) */
.rchart { margin: 6px 0 14px; }
.rchart .legend { display: flex; gap: 14px; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.rchart .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.rchart .s0 { background: var(--navy); } .rchart .s1 { background: var(--gold); } .rchart .s2 { background: var(--teal); }
.rchart .s3 { background: #8aa4c4; } .rchart .s4 { background: #c96a5b; }
.rchart .bars { gap: 6px; }
.rchart .bar-row { grid-template-columns: minmax(90px, 200px) 1fr 80px; font-size: .82rem; }
.rchart .bar-row .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rchart .bar-row .bv { text-align: right; font-weight: 600; color: var(--navy); }
.rchart .cols { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.rchart .colw { flex: 1 0 34px; max-width: 70px; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.rchart .stack-v { width: 70%; height: 130px; display: flex; flex-direction: column-reverse; }
.rchart .stack-v span { display: block; width: 100%; }
.rchart .stack-v span:last-child { border-radius: 3px 3px 0 0; }
.rchart .cval { font-size: .68rem; color: var(--muted); white-space: nowrap; margin-bottom: 2px; }
.rchart .clab { font-size: .68rem; color: var(--muted); margin-top: 4px; white-space: nowrap; transform: translateY(2px); }
/* builder */
.rb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.rb-grid .card + .card, .rb .card + .card { margin-top: 0; }
.rb-save { margin: 16px 0; }
.rb-row { display: flex; gap: 6px; align-items: center; margin-bottom: 7px; flex-wrap: wrap; }
.rb-row select, .rb-row input { width: auto; min-width: 0; flex: 1 1 110px; }
.rb-row [hidden] { display: none; }
.rb-collist { max-height: 340px; overflow-y: auto; border: 1px solid #edf1f5; border-radius: 6px; padding: 4px 6px; }
.rb-col { display: flex; align-items: center; gap: 6px; padding: 3px 2px; font-size: .86rem; border-bottom: 1px solid #f3f5f8; }
.rb-col .mv { margin-left: auto; opacity: .35; }
.rb-col:hover .mv { opacity: 1; }
.rb-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.rb-def { margin-bottom: 10px; color: #33506f; font-size: .88rem; }
/* print view */
body.print-report { background: #fff; padding: 18px 24px; max-width: 1100px; margin: 0 auto; }
.print-bar { margin-bottom: 12px; display: flex; gap: 12px; align-items: center; }
.pr-head { display: flex; gap: 16px; align-items: flex-start; border-bottom: 3px solid var(--navy); padding-bottom: 10px; margin-bottom: 14px; }
.pr-head img { height: 44px; }
.pr-head h1 { margin: 0; }
.pr-head > div:nth-child(2) { flex: 1; }
.pr-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; margin-top: 4px; color: #33506f; }
.pr-co { font-weight: 700; color: var(--navy); white-space: nowrap; }
body.print-report .card { box-shadow: none; border: 0; padding: 0; }
body.print-report table.report td, body.print-report table.report th { padding: 4px 6px; font-size: .8rem; }
@media print {
  .no-print { display: none !important; }
  body.print-report { padding: 0; }
  body.print-report .rep-table { break-inside: auto; }
  body.print-report thead { display: table-header-group; }
  body.print-report .rchart, .rchart * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.rb-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.rb-grid .rb-filters { grid-column: 1 / -1; }
.rb-filter select[data-ffield] { flex: 2 1 180px; }
.rb-filter select[data-fop] { flex: 1.3 1 150px; }
.rb-filter input, .rb-filter select[data-fpreset] { flex: 2 1 160px; }

/* ---------------- sign in ---------------- */
body.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(160deg, #001a3a 0%, var(--navy) 55%, #0b4f73 100%); }
.auth-card { background: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.35); padding: 28px 30px 22px; width: 100%; max-width: 400px; }
.auth-brand { text-align: center; margin-bottom: 14px; }
.auth-brand img { max-width: 240px; height: auto; }
.auth-card h1 { font-size: 1.35rem; margin: 6px 0 14px; text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.auth-form label { font-weight: 600; font-size: .85rem; color: var(--navy); margin-top: 6px; }
.auth-form input { font-size: 1rem; padding: 10px 12px; }
.auth-form .btn { margin-top: 12px; padding: 11px; font-size: 1rem; justify-content: center; }
.auth-foot { color: #b9cbe2; font-size: .78rem; margin-top: 14px; }
.who-menu { display: inline-flex; align-items: center; gap: 8px; }
.who-menu .role { font-size: .72rem; color: var(--muted); }
.muted-row td { color: var(--muted); }
.temp-pw .pw { font-size: 1.25rem; background: #f4f7fb; padding: 4px 10px; border-radius: 6px; border: 1px dashed #b9cbe2; user-select: all; }
.role-help li { padding: 5px 0; }
.check-row { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-top: 4px; }
.time-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 4px 0; }
.time-row input, .time-row select { width: auto; flex: 1 1 140px; min-width: 0; padding: 4px 7px; font-size: .84rem; }
.time-row .hrs { min-width: 70px; text-align: right; font-weight: 600; }
.time-row.add { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.time-table td { vertical-align: middle; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 8px; }
.photo-grid figure { margin: 0; background: #f4f7fb; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.photo-grid img { width: 100%; height: 110px; object-fit: cover; display: block; }
.photo-grid figcaption { padding: 4px 7px; font-size: .78rem; display: flex; flex-direction: column; position: relative; }
.photo-grid figcaption form { position: absolute; right: 4px; top: 2px; }
ul.history { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; font-size: .84rem; }
ul.history li { padding: 5px 0; border-bottom: 1px solid #eef2f6; }
ul.history .when { color: var(--muted); font-size: .76rem; display: inline-block; min-width: 108px; }
ul.history .act { background: #eef3f9; color: var(--navy); border-radius: 4px; padding: 0 5px; font-size: .74rem; font-weight: 600; }

/* ---------------- technician portal (mobile-first) ---------------- */
body.tech { background: #eef2f7; margin: 0; padding-bottom: 40px; }
.tech-top { position: sticky; top: 0; z-index: 10; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); gap: 10px; }
.tech-brand { color: #fff; font-weight: 700; display: flex; align-items: center; gap: 8px; font-size: 1.02rem; }
.tech-brand:hover { color: #fff; text-decoration: none; }
.tech-brand img { height: 28px; }
.tech-who { font-size: .82rem; color: #cfe0f3; display: flex; gap: 10px; align-items: center; }
.tech-who a, .tech-who .btn.link { color: #9fd8d9; font-size: .82rem; }
.clock-bar { background: #e6f6ee; border-bottom: 1px solid #b9e3c9; padding: 8px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .88rem; }
.tech-main { max-width: 720px; margin: 0 auto; padding: 12px; }
.tech-sub { color: var(--muted); margin: 2px 2px 10px; font-size: .88rem; }
.tech-group h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 2px 8px; }
.tech-group .count, .tsec .count { background: #dde6f0; color: var(--navy); border-radius: 10px; padding: 0 7px; font-size: .75rem; margin-left: 4px; }
.tcard { display: block; background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,30,70,.1);
  border-left: 5px solid var(--navy); color: var(--text); }
.tcard:hover, .tcard:active { text-decoration: none; background: #f9fbfd; }
.tcard.st-in-progress { border-left-color: var(--teal); }
.tcard.st-waiting-on-parts { border-left-color: var(--warn); }
.tcard.st-done, .tcard.st-invoiced { border-left-color: #8aa4c4; opacity: .8; }
.tc-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; font-size: 1.02rem; color: var(--navy); }
.tc-boat { margin-top: 5px; font-size: .92rem; }
.tc-meta { margin-top: 3px; font-size: .82rem; color: var(--muted); }
.tech-empty { text-align: center; padding: 50px 20px; color: var(--muted); font-size: 1.05rem; }
.tech-head h1 { font-size: 1.3rem; margin: 4px 0; }
.tsec { background: #fff; border-radius: 12px; padding: 12px 14px; margin-top: 12px; box-shadow: 0 1px 3px rgba(0,30,70,.08); }
.tsec h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.bigbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; border-radius: 12px; padding: 16px; font-size: 1.15rem;
  font-weight: 700; color: #fff; cursor: pointer; margin-bottom: 6px; font-family: inherit; }
.bigbtn small { font-weight: 500; opacity: .85; font-size: .8rem; }
.bigbtn.go { background: var(--teal); }
.bigbtn.stop { background: var(--danger); }
.bigbtn.photo { background: var(--navy); position: relative; overflow: hidden; }
.bigbtn.photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.status-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sbtn { border: 2px solid #c9d4e0; background: #fff; border-radius: 10px; padding: 12px 4px; font-weight: 700; color: var(--navy); font-size: .9rem; cursor: pointer; font-family: inherit; }
.sbtn.on.st-in-progress { background: var(--teal); border-color: var(--teal); color: #fff; }
.sbtn.on.st-waiting-on-parts { background: var(--warn); border-color: var(--warn); color: #fff; }
.sbtn.on.st-done { background: var(--navy); border-color: var(--navy); color: #fff; }
.tprops { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; margin: 0; font-size: .92rem; }
.tprops dt { color: var(--muted); font-size: .8rem; padding-top: 2px; }
.tprops dd { margin: 0; }
.tlines { list-style: none; margin: 0; padding: 0; }
.tlines li { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eef2f6; font-size: .92rem; align-items: start; }
.tlines li:last-child { border-bottom: 0; }
.tlines .q { font-weight: 700; color: var(--navy); }
.tlines .k { color: var(--muted); font-size: .76rem; }
.tadd summary { cursor: pointer; color: var(--teal); font-weight: 600; padding: 8px 0; }
.tform { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.tform label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.tform input, .tform textarea { font-size: 1rem; padding: 10px; }
.tform .btn { padding: 11px; font-size: 1rem; justify-content: center; }
.part-results { display: flex; flex-direction: column; gap: 4px; }
.part-results .pick { text-align: left; background: #f4f7fb; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: .9rem; cursor: pointer; }
.tsec .photo-grid { grid-template-columns: repeat(3, 1fr); }
.tsec .photo-grid img { height: 96px; }
@media (min-width: 700px) { .tech-main { padding: 18px; } }

/* v1.3: work-order notes (author + time on one line, text below) and the role help list */
.timeline.note-list li { display: block; }
.timeline.est-events li { display: block; padding: 7px 0; font-size: .86rem; }
.timeline.note-list li .pre { margin-top: 4px; }
.role-help li { display: block; }
.bigbtn small { color: rgba(255,255,255,.9); font-weight: 500; font-size: .85rem; }

/* v1.3 invoices */
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.inv-parties h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 4px; }
.inv-lines td { vertical-align: middle; }
.inv-lines.edit input:not([type=checkbox]), .inv-lines.edit select { width: 100%; padding: 5px 7px; font-size: .88rem; }
.inv-lines.edit input.w-num { width: 78px; text-align: right; }
.inv-lines.edit input.w-part { width: 110px; }
.inv-lines.edit select { min-width: 96px; }
.inv-lines tr.new input::placeholder { color: #9aa9ba; }
.inv-totals { width: min(420px, 100%); margin: 12px 0 0 auto; }
.inv-totals td { padding: 5px 8px; }
.inv-totals tr.big td { font-weight: 700; font-size: 1.05rem; color: var(--navy); border-top: 2px solid var(--line); }
.inv-totals tr.due-row td { background: #eef4fb; font-size: 1.2rem; }
.inv-totals tr.disc td { color: #1f8a4c; }
.pay-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 10px; }
.pay-form label { display: flex; flex-direction: column; font-size: .76rem; color: var(--muted); gap: 2px; }
.pay-form input, .pay-form select { width: 130px; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.stack-form { display: flex; flex-direction: column; gap: 8px; }
.stack-form label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); }
.stack-form textarea { font-family: inherit; font-size: .85rem; }
.warn-note { background: #fff7e0; border: 1px solid #f0d58a; border-radius: 8px; padding: 6px 10px; }
.danger-text { color: var(--danger) !important; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 4px; }
.link-btn:hover { color: var(--danger); }
.inline-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.env-table td { padding: 4px 8px; font-size: .84rem; }
.env-table code { font-size: .8rem; }
.ok-dot { color: #1f8a4c; font-weight: 700; } .no-dot { color: var(--danger); font-weight: 700; }
.badge.draft { background: #eef1f5; color: #4a5a6e; } .badge.sent { background: #e5f0fb; color: #1d5fa6; }
.badge.partially-paid { background: #fff3d6; color: #8a6200; } .badge.paid { background: #e3f5ea; color: #1f7a43; }
.badge.void { background: #f3e5e5; color: #8e2a1f; text-decoration: line-through; }
.badge.held { background: #fff3d6; color: #8a6200; } .badge.failed, .badge.declined { background: #fdecea; color: #8e2a1f; }
.badge.queued, .badge.open { background: #e5f0fb; color: #1d5fa6; } .badge.expired { background: #eef1f5; color: #4a5a6e; }
@media (max-width: 760px) { .inv-parties { grid-template-columns: 1fr; } .inv-lines.edit { display: block; overflow-x: auto; } }
.badge.ready, .badge.connected { background: #e3f5ea; color: #1f7a43; } .badge.not-set-up { background: #eef1f5; color: #4a5a6e; }
.badge.ready-to-connect { background: #e5f0fb; color: #1d5fa6; }
.qbo-opts { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.qbo-opts label input[type=checkbox] { margin-right: 6px; }

/* ---------- card on file ---------- */
.saved-cards { list-style: none; margin: 0 0 8px; padding: 0; }
.saved-card { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.saved-card:last-child { border-bottom: 0; }
.saved-card .sc-brand { display: inline-block; min-width: 44px; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: #0b2e55; color: #fff; border-radius: 4px; padding: 2px 6px; text-align: center; }
.saved-card.expired .sc-brand { background: #9aa9ba; }
.saved-card .sc-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge.default { background: #e3f5ea; color: #1f7a43; } .badge.expired { background: #fde7e5; color: #b3261e; }
.badge.expiring { background: #fff3d6; color: #8a5b00; }
.badge.charged, .badge.saved { background: #e3f5ea; color: #1f7a43; } .badge.charge-failed, .badge.blocked, .badge.save-failed { background: #fde7e5; color: #b3261e; }
.badge.revoked { background: #eef1f5; color: #4a5a6e; }
.copy-input { width: 100%; font-size: .8rem; margin-top: 4px; }
.card-link-form summary { cursor: pointer; font-weight: 600; color: var(--teal); margin-top: 6px; }
.card-entry .ce-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.card-entry .ce-wide { grid-column: 1 / -1; }
.card-entry .cl-box { border: 1px solid #c9d4e0; border-radius: 7px; background: #fff; height: 44px; padding: 0 8px; overflow: hidden; }
.card-entry .cl-box iframe { width: 100% !important; height: 42px !important; border: 0; }
.card-entry .cl-err { color: #b3261e; min-height: 1em; display: block; font-size: .78rem; }
.card-entry .secure-note { font-size: .82rem; color: #2b5a3e; background: #ecf7f0; border-radius: 7px; padding: 8px 10px; }
.card-entry .agreement { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 12px 0; background: #f8fafc; }
.card-entry .agreement h3 { margin: 0 0 6px; font-size: .95rem; }
.card-entry .agreement-text { white-space: pre-wrap; font-size: .86rem; line-height: 1.5; max-height: 220px; overflow: auto; margin-bottom: 8px; }
.card-entry label.agree { font-weight: 600; display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.card-entry .btn.big { width: 100%; padding: 12px; font-size: 1rem; margin-top: 8px; }
.card-page { max-width: 560px; }
.charge-dialog { border: 0; border-radius: 12px; padding: 0; width: min(440px, 94vw); box-shadow: 0 18px 50px rgba(0,30,60,.35); }
.charge-dialog::backdrop { background: rgba(5,25,50,.45); }
.charge-dialog form { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.charge-dialog h2 { margin: 0 0 2px; }
.charge-dialog .charge-confirm { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.charge-dialog .btn-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@media (max-width: 600px) { .card-entry .ce-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Tabs (texts inbox, cards on file) ---------- */
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--line); }
.tabs > a { padding: 8px 12px; border-radius: 8px 8px 0 0; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs > a:hover { color: var(--navy); text-decoration: none; background: #eef2f7; }
.tabs > a.on { color: var(--navy); border-bottom-color: var(--teal); }
.tabs .count { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--teal-light); color: #0b6c6e; font-size: .72rem; text-align: center; }
.tabs-search input { min-width: 240px; }

/* ---------- Texts (Twilio) ---------- */
.nav-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--gold); color: var(--navy-dark); font-size: .72rem; font-weight: 700; text-align: center; line-height: 18px; }
.badge.sms-in { background: var(--ok-bg); color: var(--ok); }
.badge.sms-out { background: var(--danger-bg); color: var(--danger); }
.badge.sms-none { background: #eef2f7; color: var(--muted); }
.badge.new-lead { background: #fbf3e2; color: #8a6418; }
.sms-thread { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow-y: auto; padding: 8px 4px; }
.sms-day { align-self: center; font-size: .72rem; color: var(--muted); background: #eef2f7; border-radius: 999px; padding: 1px 10px; margin: 6px 0; }
.sms-msg { display: flex; flex-direction: column; max-width: 78%; }
.sms-msg.in { align-self: flex-start; }
.sms-msg.out { align-self: flex-end; align-items: flex-end; }
.sms-bubble { padding: 8px 12px; border-radius: 16px; line-height: 1.35; word-wrap: break-word; }
.sms-text { white-space: pre-wrap; }
.sms-msg.in .sms-bubble { background: #eef2f7; color: var(--text); border-bottom-left-radius: 4px; }
.sms-msg.out .sms-bubble { background: var(--teal); color: #fff; border-bottom-right-radius: 4px; }
.sms-msg.out.kw .sms-bubble { background: #6b7c90; }
.sms-msg.st-failed .sms-bubble, .sms-msg.st-undelivered .sms-bubble, .sms-msg.st-blocked .sms-bubble { background: var(--danger-bg); color: var(--danger); }
.sms-msg.st-scheduled .sms-bubble { background: var(--teal-light); color: #0b6c6e; border: 1px dashed var(--teal); }
.sms-bubble img { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; margin-bottom: 4px; }
.sms-file { display: block; font-size: .85rem; }
.sms-msg.out .sms-file { color: #fff; }
.sms-info { font-size: .72rem; color: var(--muted); margin: 2px 6px 0; }
.sms-compose { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.sms-to { font-size: .85rem; margin-bottom: 6px; }
.sms-tpl-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.sms-tpl-row label { font-size: .82rem; color: var(--muted); }
.sms-tpl-row select { flex: 1; min-width: 180px; }
.sms-mkt { white-space: nowrap; }
.sms-body { width: 100%; resize: vertical; font-size: 1rem; }
.sms-meta { display: flex; justify-content: space-between; gap: 8px; font-size: .75rem; color: var(--muted); margin-top: 2px; }
.sms-count.over { color: var(--warn); font-weight: 600; }
.sms-warn { color: var(--warn); text-align: right; }
.sms-actions { margin-top: 6px; display: flex; justify-content: flex-end; }
.sms-block { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 8px 10px; font-size: .88rem; }
.sms-consent { padding: 8px 10px; border-radius: 8px; margin-bottom: 8px; font-size: .9rem; background: #eef2f7; }
.sms-consent.opted_in { background: var(--ok-bg); }
.sms-consent.opted_out { background: var(--danger-bg); }
.sms-consent-edit { margin-top: 6px; }
.sms-consent-edit summary { cursor: pointer; color: var(--teal); font-size: .85rem; }
.sms-consent-form { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-top: 12px; }
.sms-consent-form legend { font-weight: 600; padding: 0 6px; }
.sms-inbox tr.unread td { font-weight: 600; }
.sms-inbox .count { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--teal); color: #fff; font-size: .72rem; text-align: center; }
.sms-preview { color: var(--muted); max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs-search { display: flex; gap: 6px; margin-left: auto; }
.sms-layout { align-items: start; }
.sms-context .sms-thread { max-height: 320px; }
.new-lead-box { background: #fbf3e2; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.optin-box { background: var(--teal-light); border-radius: 10px; padding: 10px 12px; margin: 12px 0; text-align: left; }
.optin-box input[type=tel] { width: 100%; margin-top: 4px; }
.optin-form { margin-top: 14px; }
@media (max-width: 860px) { .sms-msg { max-width: 92%; } .tabs-search { margin-left: 0; width: 100%; } }

/* ---------------- v1.5 estimates & approvals ---------------- */
.badge.viewed { background: #e3f4f4; color: #0b6c6e; }
.badge.approved { background: var(--ok-bg); color: var(--ok); }
.badge.partially-approved { background: #e9f6df; color: #3b6d12; }
.badge.superseded { background: #eef1f5; color: #6b7a8c; text-decoration: line-through; }
.badge.awaiting-approval { background: #fff3d6; color: #8a6200; }
.badge.optional { background: #eef3fa; color: #1d4f91; } .badge.recommended { background: #fff3d6; color: #8a6200; }
.badge.safety { background: var(--danger-bg); color: var(--danger); } .badge.can-wait { background: #eef1f5; color: #4a5a6e; }
.badge.card-requested { background: #e5f0fb; color: #1d5fa6; }
.est-lines tr.optional td { background: #fbfcfe; }
.est-lines .kind { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.est-lines details.line-edit { margin-top: 4px; } .est-lines details.line-edit summary { cursor: pointer; color: var(--teal); }
.est-lines details.line-edit form { margin-top: 6px; padding: 10px; background: #f6f8fb; border-radius: 8px; }
table.est-totals { margin: 12px 0 0 auto; border-collapse: collapse; min-width: 320px; }
table.est-totals td { padding: 4px 10px; border-bottom: 1px solid var(--line, #e3e8ef); }
table.est-totals td.num { text-align: right; } table.est-totals tr.total td { font-weight: 800; font-size: 15px; color: var(--navy); }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.sig-rec { border-bottom: 1px solid #eef1f5; padding: 8px 0; } .sig-rec:last-child { border-bottom: 0; }
.sig-thumb { display: block; max-width: 100%; max-height: 70px; background: #fff; border: 1px solid #e3e8ef; border-radius: 6px; margin: 6px 0; }
.photo-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 10px; }
.photo-pick label { border: 2px solid transparent; border-radius: 8px; padding: 4px; cursor: pointer; background: #f6f8fb; }
.photo-pick label.on, .photo-pick label:has(input:checked) { border-color: var(--teal); }
.photo-pick img { width: 100%; height: 90px; object-fit: cover; border-radius: 6px; display: block; }
.photo-pick input { margin: 0 4px 0 0; }
.hash-row td { padding-top: 0 !important; border-top: 0 !important; }
.est-events li { margin-bottom: 6px; }
.notif-list { list-style: none; margin: 0; padding: 0; } .notif-list li { padding: 10px 4px; border-bottom: 1px solid #eef1f5; display: flex; justify-content: space-between; gap: 12px; }
.notif-list li.unread { background: #f3f8fe; } .notif-list .link-btn { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.topbar .bell { position: relative; text-decoration: none; font-size: 18px; padding: 4px 6px; }
.topbar .bell .nav-count { position: absolute; top: -4px; right: -6px; font-size: 10px; }
.wo-estimates li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #eef1f5; }

/* customer approval page (mobile first) */
body.est-public { background: #eef3f8; margin: 0; color: #13233a; -webkit-text-size-adjust: 100%; }
.est-wrap { max-width: 640px; margin: 0 auto; padding: 14px 14px 96px; }
.est-brand { text-align: center; padding: 6px 0 12px; } .est-brand img { height: 40px; max-width: 80%; }
.est-banner { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.est-banner.preview { background: #fff3d6; color: #6b4b00; } .est-banner.inperson { background: #e3f4f4; color: #0b5c5e; }
.est-head { padding: 4px 4px 10px; }
.est-kicker { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--teal, #0e8a8c); font-weight: 700; }
.est-head h1 { font-size: 24px; line-height: 1.2; margin: 4px 0 6px; color: var(--navy, #002C61); }
.est-meta { color: #4f6178; font-size: 14px; line-height: 1.5; }
.est-intro { white-space: pre-line; background: #fff; border-radius: 12px; padding: 12px 14px; margin: 12px 0 0; font-size: 15px; line-height: 1.5; }
.est-card { background: #fff; border-radius: 14px; padding: 14px 16px; margin: 0 0 12px; box-shadow: 0 1px 3px rgba(10, 30, 60, .08); }
.est-card h2 { font-size: 16px; margin: 0 0 8px; color: var(--navy, #002C61); } .est-card h2 small { color: #6b7a8c; font-weight: 400; font-size: 13px; }
.est-lines { list-style: none; margin: 0; padding: 0; }
.est-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef1f5; font-size: 15px; }
.est-lines li:last-child { border-bottom: 0; }
.est-lines .d { flex: 1; min-width: 0; } .est-lines .d small { display: block; color: #6b7a8c; font-size: 13px; margin-top: 2px; }
.est-lines .k { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #6b7a8c; }
.est-lines .a { font-weight: 700; white-space: nowrap; }
.est-opts li { padding: 0; } .est-opts li.rec { background: linear-gradient(90deg, #fffaf0, #fff); }
.opt-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 2px; cursor: pointer; min-height: 52px; }
.opt-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt-toggle .sw { flex: 0 0 auto; width: 46px; height: 28px; border-radius: 14px; background: #cdd6e1; position: relative; transition: background .15s; }
.opt-toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.opt-toggle input:checked + .sw { background: var(--teal, #0e8a8c); } .opt-toggle input:checked + .sw::after { left: 21px; }
.opt-toggle input:focus-visible + .sw { outline: 3px solid #8fd0d1; outline-offset: 2px; }
.est-opts li:not(.on) .a { color: #9aa7b6; text-decoration: line-through; }
.rec-badge { display: inline-block; font-size: 11px; font-weight: 700; color: #8a6200; background: #fff3d6; border-radius: 6px; padding: 1px 6px; margin-bottom: 2px; }
.est-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.est-photos img { width: 100%; height: 96px; object-fit: cover; border-radius: 8px; display: block; }
.est-totals .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 15px; } .est-totals .row[hidden] { display: none; }
.est-totals .row.total { border-top: 2px solid var(--navy, #002C61); margin-top: 6px; padding-top: 8px; font-size: 20px; color: var(--navy, #002C61); }
.est-terms { white-space: pre-wrap; font-size: 13px; line-height: 1.5; max-height: 260px; overflow: auto; background: #f6f8fb; border-radius: 10px; padding: 10px 12px; color: #2c3d52; }
.est-sign label, .est-decline label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; } .est-sign label small { font-weight: 400; color: #6b7a8c; }
.est-sign input[type=text], .est-sign input:not([type]), .est-decline input:not([type]), .est-decline textarea, .est-decline select {
  width: 100%; font-size: 17px; padding: 12px; border: 1px solid #c4cfdc; border-radius: 10px; box-sizing: border-box; background: #fff; }
.sig-pad-wrap { position: relative; }
#sig-pad { width: 100%; height: 170px; border: 2px dashed #9fb0c4; border-radius: 12px; background: #fff; display: block; touch-action: none; cursor: crosshair; }
#sig-pad.signed { border-style: solid; border-color: var(--teal, #0e8a8c); }
.sig-x { position: absolute; left: 14px; bottom: 34px; color: #9fb0c4; font-size: 18px; pointer-events: none; }
.sig-pad-wrap::after { content: ""; position: absolute; left: 34px; right: 16px; bottom: 38px; border-bottom: 1px solid #c4cfdc; pointer-events: none; }
.sig-clear { position: absolute; top: 8px; right: 8px; }
label.check.agree { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; line-height: 1.45; margin: 14px 0; }
label.check.agree input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 1px; }
.btn.big { display: block; width: 100%; font-size: 17px; padding: 14px 16px; border-radius: 12px; text-align: center; margin-top: 8px; box-sizing: border-box; }
.est-error { background: #fdecea; color: #8e2a1f; border-radius: 10px; padding: 12px 14px; margin: 0 0 12px; font-weight: 600; }
.est-result.ok { border-left: 5px solid #1f8a4c; } .est-result.no { border-left: 5px solid #b3261e; }
.est-result h2 { font-size: 19px; }
.est-decline summary { cursor: pointer; color: #4f6178; font-size: 15px; padding: 4px 0; }
.est-foot { text-align: center; color: #6b7a8c; font-size: 13px; padding: 10px 0; }
.small { font-size: 13px; }
.est-sticky { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.97); box-shadow: 0 -2px 10px rgba(10,30,60,.12);
  display: flex; justify-content: space-between; align-items: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); font-size: 16px; transition: transform .2s; }
.est-sticky.away { transform: translateY(110%); } .est-sticky[hidden] { display: none; }
@media (min-width: 720px) { .est-wrap { padding-top: 28px; } .est-head h1 { font-size: 28px; } #sig-pad { height: 200px; } }
.tsec .prop { padding: 8px 10px; border-radius: 8px; background: #f6f8fb; margin-bottom: 8px; font-size: 14px; }
.tsec .prop.new { background: #fff7e6; } .tsec .prop.estimated { background: #e8f5f5; }

/* ---------- v1.6 service packages ---------- */
.form-grid .f.s1 { grid-column: span 1; }
.grid.pkg-grid { grid-template-columns: minmax(0, 430px) minmax(0, 1fr); }
@media (max-width: 1100px) { .grid.pkg-grid { grid-template-columns: 1fr; } }
.over { color: var(--danger); font-weight: 600; }
b.ok, .ok { color: #1f7a43; }
.merge-help code { background: #eef3fa; border-radius: 4px; padding: 1px 4px; font-size: .74rem; cursor: help; }
details.inline-edit { display: inline-block; }
details.inline-edit[open] { display: block; background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
details.inline-edit > summary { list-style: none; display: inline; cursor: pointer; }
details.inline-edit > summary::-webkit-details-marker { display: none; }
tr.edit-row td { padding-top: 0; border-top: 0; }
.pkg-lines tr.edit-row td { padding-bottom: 6px; }
.pkg-steps { margin: 0 0 10px; padding-left: 22px; }
.pkg-steps li { padding: 5px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.pkg-steps li:last-child { border-bottom: 0; }
.pkg-desc { background: #fbfcfe; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: .88rem; }
.pkg-check-preview { list-style: none; padding: 0; margin: 4px 0; font-size: .88rem; }
/* package groups on work orders / estimates */
tr.pkg-head td { background: #eef6f6; border-top: 2px solid var(--teal); }
tr.pkg-head .pkg-name { font-weight: 700; color: var(--navy); }
tr.pkg-head .pkg-text { white-space: pre-line; color: #2b405a; font-size: .84rem; margin-top: 3px; }
tr.pkg-line td:first-child { border-left: 3px solid #bfe3e3; }
tr.pkg-adjust td { color: #1f7a43; font-style: italic; }
tr.pkg-foot td { background: #f6fafa; font-size: .82rem; }
.pkg-picker { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcfe; margin-top: 14px; }
.pkg-picker > summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.pkg-options { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin: 8px 0; }
.pkg-opt { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: start; padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 400; margin: 0; }
.pkg-opt:last-child { border-bottom: 0; }
.pkg-opt:hover, .pkg-opt.on { background: #eef6f6; }
.pkg-opt .pname { font-weight: 600; color: var(--navy); }
.pkg-opt .pprice { text-align: right; white-space: nowrap; font-weight: 600; }
.pkg-opt.unfit .pname { color: var(--muted); }
.pkg-sep { padding: 4px 10px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); background: #f3f8f8; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line); }
.checklist li.done span.s { color: var(--muted); text-decoration: line-through; }
.progress { height: 6px; background: #e6edf3; border-radius: 6px; overflow: hidden; margin: 4px 0 8px; }
.progress > span { display: block; height: 100%; background: var(--teal); }
.split { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.pkg-check + .pkg-check { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.btn.danger { color: var(--danger); }
/* tech portal packages */
.tnote { background: #fff8e6; border: 1px solid #f1dfb0; border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: .88rem; }
.tcheck li { padding: 4px 0; align-items: center; }
.tcheck form { margin: 0; }
.tcheck .tick { font-size: 1.6rem; line-height: 1; background: none; border: 0; padding: 4px 6px; min-width: 44px; min-height: 44px; color: var(--teal); cursor: pointer; }
.tcheck li .s { font-size: .95rem; }
.tlines li.tgrp { display: block; font-weight: 700; color: var(--navy); background: #eef6f6; padding: 6px 8px; border-radius: 6px; margin-top: 6px; }
.tlines li.in-pkg { padding-left: 6px; border-left: 3px solid #bfe3e3; }
.clk-pkg { width: 100%; margin: 2px 0 8px; font-size: 1rem; padding: 10px; }
.est-lines li.pkg-h { background: #eef6f6; border-radius: 8px; padding: 8px 10px; margin-top: 6px; border-bottom: 0; }
.est-lines li.pkg-h small { display: block; white-space: pre-line; color: #33475f; font-size: 13px; margin-top: 3px; }
.est-lines li.in-pkg { padding-left: 10px; border-left: 3px solid #bfe3e3; }

/* Staging / test copy banner (LMG_CRM_INSTANCE_BANNER) */
.instance-banner { position: sticky; top: 0; z-index: 1000; background: #b3261e; color: #fff; text-align: center; font-weight: 700; letter-spacing: .04em; padding: 6px 12px; font-size: .9rem; }
@media print { .instance-banner { display: block !important; position: static; } }

/* ---------- v1.7 public service request form ---------- */
.sr-wrap { padding-bottom: 32px; } .sr-public .est-brand img { height: 52px; }
@media (min-width: 720px) { .sr-public .sr-wrap { max-width: 720px; } .sr-public .est-brand img { height: 64px; } }
.sr-form fieldset.est-card { border: 0; min-width: 0; }
.sr-form legend { padding: 0; float: left; width: 100%; } .sr-form legend + * { clear: both; }
.sr-form legend h2 { margin-bottom: 10px; }
.sr-f { margin: 0 0 12px; min-width: 0; }
.sr-f label, .sr-l { display: block; font-weight: 600; font-size: 14px; margin: 0 0 5px; color: #24364d; }
.sr-f label small, .sr-l small, .sr-form h2 small { font-weight: 400; color: #6b7a8c; }
.sr-f input, .sr-f select, .sr-f textarea { width: 100%; box-sizing: border-box; font-size: 16px; padding: 11px 12px; border: 1px solid #c4cfdc;
  border-radius: 10px; background: #fff; color: #13233a; font-family: inherit; }
.sr-f textarea { resize: vertical; min-height: 110px; }
.sr-f input:focus, .sr-f select:focus, .sr-f textarea:focus { outline: 3px solid #bfe5e5; border-color: var(--teal); }
.sr-f.bad input, .sr-f.bad select, .sr-f.bad textarea, fieldset.bad { border-color: #c0392b; } fieldset.est-card.bad { box-shadow: 0 0 0 2px #f2b8b1; }
.req { color: #c0392b; }
.sr-err { color: #a12a1e; font-size: 13px; font-weight: 600; margin: 5px 0 0; }
.sr-hint { color: #6b7a8c; font-size: 13px; margin: -6px 0 10px; } .sr-f .sr-hint { margin: 5px 0 0; }
.sr-sub { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); font-weight: 700; margin: 6px 0 8px; }
.sr-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 560px) { .sr-row { grid-template-columns: 1fr 1fr; } .sr-row.three { grid-template-columns: 1fr 1.4fr 1.4fr; } }
.sr-chips { display: flex; flex-wrap: wrap; gap: 8px; } .sr-chips.sr-stack { flex-direction: column; }
.sr-chip { position: relative; margin: 0 !important; font-weight: 400 !important; }
.sr-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sr-chip span { display: block; padding: 10px 14px; border: 1px solid #c4cfdc; border-radius: 999px; background: #fff; cursor: pointer; font-size: 15px; }
.sr-chips.sr-stack .sr-chip span { border-radius: 10px; }
.sr-chip input:checked + span { background: var(--teal-light); border-color: var(--teal); color: #0b5c5e; font-weight: 600; }
.sr-chip input:focus-visible + span, .sr-check input:focus-visible + span { outline: 3px solid #8fd0d1; outline-offset: 2px; }
.sr-checks { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
@media (min-width: 560px) { .sr-checks { grid-template-columns: 1fr 1fr; } }
.sr-check { position: relative; display: block; cursor: pointer; }
.sr-check input { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; margin: 0; accent-color: var(--teal); }
.sr-check span { display: block; padding: 10px 12px 10px 44px; border: 1px solid #c4cfdc; border-radius: 10px; background: #fff; font-size: 15px; min-height: 22px; }
.sr-check span small { display: block; color: #6b7a8c; font-size: 12px; }
.sr-check input:checked + span { background: var(--teal-light); border-color: var(--teal); }
.sr-other[hidden], [data-loc-address][hidden] { display: none; }
.sr-form input[type=file] { width: 100%; font-size: 15px; padding: 10px; border: 2px dashed #9fb0c4; border-radius: 10px; box-sizing: border-box; background: #f8fafc; }
.sr-photo-note { font-size: 13px; color: #0b5c5e; margin-top: 6px; }
.sr-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.sr-turnstile { margin: 4px 0 8px; display: flex; justify-content: center; }
.sr-thanks p { line-height: 1.5; }
body.sr-embed { background: transparent; } .sr-embed .est-wrap { padding: 4px 2px 12px; max-width: 760px; }
.sr-embed .est-card { box-shadow: 0 0 0 1px #dde5ee; }
/* staff: Service Requests inbox */
.sr-desc { white-space: pre-wrap; background: #f6f8fb; border-radius: 8px; padding: 10px 12px; margin: 6px 0 10px; font-size: 14px; line-height: 1.5; }
.sr-opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 0 0 6px; cursor: pointer; font-weight: 400; }
.sr-opt:has(input:checked) { border-color: var(--teal); background: var(--teal-light); }
.sr-opt input { margin-top: 3px; flex: 0 0 auto; }
.match-why { color: var(--ok); } .sr-nofit { color: var(--warn); }
.sr-pick { margin-bottom: 12px; } .sr-pick .sr-l, .card .sr-l { font-weight: 600; font-size: 13px; margin: 10px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sr-or { margin: 4px 0 8px; } .sr-num { width: 110px; padding: 5px 8px; }
.sr-pkgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 8px; }
.sr-photos .sr-heic { display: flex; align-items: center; justify-content: center; text-align: center; height: 96px; background: #f6f8fb; border-radius: 8px; font-size: 12px; }
.sr-decline { display: flex; gap: 8px; flex-wrap: wrap; } .sr-decline input { flex: 1; min-width: 200px; }
.sr-embed-help textarea, .card textarea[data-select-all] { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.badge.reviewed { background: #e7eefb; color: #1f4d99; } .badge.converted { background: var(--ok-bg); color: var(--ok); }
.badge.declined { background: #eef0f3; color: #5f6b7a; }
.badge.new { background: #fff3d6; color: #8a6200; }

/* v1.9 factory catalog picker */
.fp-cat { border-top: 1px solid var(--line, #e5e7eb); padding: 6px 0; }
.fp-cat > summary { cursor: pointer; padding: 2px 0; }
.fp-list { list-style: none; margin: 4px 0 0; padding: 0; }
.fp-opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 6px; }
.fp-opt:hover { background: rgba(0, 0, 0, .03); }
.fp-opt.picked { background: rgba(13, 148, 136, .10); }
.fp-opt.on-build { opacity: .65; }
.fp-opt .check { margin: 0; flex: 1; min-width: 0; }
.fp-code { font-weight: 600; white-space: nowrap; }
.fp-meta { display: flex; gap: 8px; align-items: center; white-space: nowrap; font-size: .92em; }
tr.group-row td { background: rgba(0, 0, 0, .03); }
@media (max-width: 700px) { .fp-opt { flex-direction: column; align-items: flex-start; } .fp-meta { flex-wrap: wrap; } }
table.compact th, table.compact td { padding: 5px 8px; }


/* ---- Public privacy / terms (Intuit QBO questionnaire) ---- */
.legal-wrap { max-width: 720px; }
.legal-prose h2 { font-size: 1.1rem; margin: 1.4em 0 0.45em; color: #0b3a5b; }
.legal-prose p, .legal-prose li { line-height: 1.55; }
.legal-prose ul { padding-left: 1.25em; margin: 0.4em 0 0.8em; }
.legal-prose li { margin: 0.25em 0; }
.legal-foot { text-align: center; margin-top: 28px; padding-top: 12px; color: #5a6b7d; font-size: 0.9rem; }
.legal-foot a { color: #0b5cab; }

/* Customer type-ahead picker */
.contact-picker-wrap { position: relative; }
.contact-picker-wrap input[type=search] { width: 100%; padding-right: 2rem; }
.contact-picker-clear {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; font-size: 1.2rem; line-height: 1;
  color: var(--muted, #667); cursor: pointer; padding: .2rem .35rem;
}
.contact-picker-results {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 2px);
  margin: 0; padding: .25rem 0; list-style: none;
  background: #fff; border: 1px solid var(--border, #c9d2dc); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 35, 55, .12); max-height: 280px; overflow: auto;
}
.contact-picker-results li {
  padding: .45rem .7rem; cursor: pointer; border-left: 3px solid transparent;
}
.contact-picker-results li[aria-selected="true"],
.contact-picker-results li:hover { background: #f0f7fb; border-left-color: var(--teal, #0b7a75); }
.contact-picker-results .cp-name { font-weight: 600; color: var(--navy, #0b1f33); }
.contact-picker-results .cp-meta { font-size: .85rem; color: var(--muted, #556); margin-top: .1rem; }
.contact-picker-results .cp-boats { font-size: .8rem; color: #0b7a75; margin-top: .15rem; }
.contact-picker-quickadd {
  margin-top: .5rem; padding: .6rem .7rem; background: #f7fafc;
  border: 1px dashed var(--border, #c9d2dc); border-radius: 6px;
}
.contact-picker-qa-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: .4rem; margin-top: .35rem;
}
@media (max-width: 720px) {
  .contact-picker-qa-grid { grid-template-columns: 1fr 1fr; }
  .contact-picker-qa-grid .qa-save { grid-column: 1 / -1; }
}
.contact-picker-qa-err { color: #b00020; margin-top: .35rem; }

/* Work-order boat quick-add + summary */
.boat-field-row { display: flex; gap: .5rem; align-items: stretch; }
.boat-field-row .boat-select-grow { flex: 1; min-width: 0; }
.boat-summary {
  margin-top: .45rem; padding: .45rem .6rem; background: #f4f8fb;
  border: 1px solid var(--border, #c9d2dc); border-radius: 6px;
  display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between;
  font-size: .88rem;
}
.boat-summary-body { color: var(--navy, #0b1f33); line-height: 1.35; }
.boat-summary-body .muted { color: var(--muted, #556); }
.boat-summary-edit { white-space: nowrap; font-size: .85rem; }
.boat-quick-panel {
  margin-top: .55rem; padding: .7rem .8rem 0.85rem;
  border: 1px dashed var(--teal, #0b7a75); border-radius: 8px; background: #f7fffe;
}
.boat-quick-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; }
.boat-quick-actions { display: flex; gap: .75rem; align-items: center; margin-top: .55rem; }
.boat-quick-err { color: #b00020; }
.boat-quick-grid .f label { font-size: .8rem; }

.boat-quick-grid input[name="bq_year"],
.boat-quick-grid input[name="bq_trailer_year"] { min-width: 4.75rem; }
.boat-quick-grid input[name="bq_length_ft"],
.boat-quick-grid input[name="bq_engine_hours"],
.boat-quick-grid input[name="bq_engine_count"] { min-width: 5.5rem; }
.boat-quick-grid select[name="bq_engine_type"] { min-width: 9rem; }



/* Users form: multi-role picker */
.role-picker { border: 1px solid var(--line, #dfe5ea); border-radius: 8px; padding: 10px 14px 12px; margin: 0; }
.role-picker legend { font-weight: 600; padding: 0 6px; font-size: .9rem; }
.role-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; margin-bottom: 10px; }
.role-check { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border: 1px solid var(--line, #dfe5ea); border-radius: 6px; background: #fff; }
.role-check input { margin-top: 3px; }
.role-check small { line-height: 1.3; }
.role-admin { border-style: dashed; background: #fafbfc; }
.role-check.is-disabled { opacity: .5; }
