/* CRM design system. Clean, high-contrast, Jobber-like palette (navy + green). */
:root {
  --navy: #10222f; --navy-2: #173244; --navy-3: #22465d;
  --green: #3d8b37; --green-600: #33772e; --green-50: #edf6ec;
  --bg: #f4f6f5; --card: #ffffff; --line: #e1e7e4; --line-2: #ccd5d1;
  --text: #13202b; --muted: #5f6d79; --faint: #8b97a2;
  --blue: #2f6fb3; --blue-50: #eaf2fb;
  --amber: #b7791f; --amber-50: #fdf5e6;
  --red: #c2413b; --red-50: #fcecea;
  --purple: #6f4fb3; --purple-50: #f1edfa;
  --radius: 10px; --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16,34,47,.06), 0 1px 1px rgba(16,34,47,.04);
  --shadow-lg: 0 10px 30px rgba(16,34,47,.18);
  --sidebar: 236px; --topbar: 58px; --bottombar: 64px;
  --brand: var(--green);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  color: var(--text); font-size: 15px; line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100vh; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: var(--navy); color: #d5e0e8; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 30; }
.sidebar .biz-switch { margin: 12px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: #c9d6df; font-weight: 500; margin-bottom: 2px; }
.nav-link:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--navy-3); color: #fff; }
.nav-link .ico { width: 20px; height: 20px; flex: none; opacity: .9; }
.nav-link .count { margin-left: auto; background: var(--green); color: #fff; border-radius: 20px; font-size: 12px; padding: 0 7px; font-weight: 700; }
.nav-sep { height: 1px; background: var(--navy-2); margin: 10px 4px; }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; }
.topbar { height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .search { flex: 1; max-width: 460px; position: relative; }
.topbar .search input { width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; }
.topbar .search .ico { position: absolute; left: 10px; top: 9px; width: 18px; color: var(--faint); }
.content { padding: 24px; max-width: 1240px; margin: 0 auto; }
.bottombar { display: none; }

/* Company switcher (Instagram-style) */
.biz-switch { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: var(--navy-2); cursor: pointer; border: 0; color: #fff; width: calc(100% - 24px); text-align: left; }
.biz-switch:hover { background: var(--navy-3); }
.biz-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; background: var(--brand); background-size: cover; background-position: center; font-size: 14px; }
.biz-avatar.lg { width: 44px; height: 44px; font-size: 17px; }
.biz-switch .name { font-weight: 600; font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-switch .sub { font-size: 12px; color: #9fb2c0; }
.biz-list { display: flex; flex-direction: column; gap: 4px; }
.biz-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; background: none; width: 100%; text-align: left; }
.biz-row:hover { background: var(--bg); }
.biz-row.current { border-color: var(--green); background: var(--green-50); }
.biz-row .check { margin-left: auto; color: var(--green); }

/* ---------- page layout ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.mt { margin-top: 16px; } .mt-sm { margin-top: 8px; } .mb { margin-bottom: 16px; } .mb-sm { margin-bottom: 8px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-body { padding: 18px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: #fafbfa; border-radius: 0 0 var(--radius) var(--radius); }
.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat .hint { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stat.green .value { color: var(--green); } .stat.red .value { color: var(--red); } .stat.blue .value { color: var(--blue); }
a.card:hover { text-decoration: none; border-color: var(--line-2); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 40px; text-decoration: none !important; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--bg); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-600); }
.btn-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-danger { color: var(--red); border-color: #e9c3c0; }
.btn-danger:hover { background: var(--red-50); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 5px 11px; min-height: 32px; font-size: 13px; }
.btn-lg { padding: 13px 22px; min-height: 50px; font-size: 16px; }
.btn-block { width: 100%; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn .ico { width: 20px; height: 20px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.input, .select, .textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; min-height: 42px; outline: none; transition: border-color .12s, box-shadow .12s; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(61,139,55,.15); }
.textarea { min-height: 90px; resize: vertical; }
.input-money { position: relative; }
.input-money::before { content: '$'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.input-money .input { padding-left: 22px; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--green); flex: none; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-section { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section > h3 { margin-bottom: 12px; }
.toggle { position: relative; width: 42px; height: 24px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--line-2); border-radius: 20px; transition: .15s; cursor: pointer; }
.toggle span::after { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(18px); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 8px 14px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--navy); color: #fff; }

/* Autocomplete dropdown */
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 50; max-height: 300px; overflow-y: auto; }
.ac-item { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.on { background: var(--green-50); }
.ac-item .sub { font-size: 12px; color: var(--muted); }

/* ---------- tables / lists ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfa; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: #f8faf9; }
.table .num { text-align: right; white-space: nowrap; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: #f8faf9; text-decoration: none; }
.list-item .title { font-weight: 600; }
.list-item .meta { font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs .on { color: var(--text); border-bottom-color: var(--green); }
.tabs .count { background: var(--bg); border-radius: 20px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ico { width: 40px; height: 40px; color: var(--line-2); margin-bottom: 8px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; background: var(--bg); color: var(--muted); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-50); color: var(--green-600); }
.badge.blue { background: var(--blue-50); color: var(--blue); }
.badge.amber { background: var(--amber-50); color: var(--amber); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.purple { background: var(--purple-50); color: var(--purple); }
.badge.gray { background: #eef1f0; color: var(--muted); }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg); color: var(--muted); font-weight: 600; }

/* ---------- line items ---------- */
.items-table { width: 100%; border-collapse: collapse; }
.items-table th { font-size: 12px; text-transform: uppercase; color: var(--muted); text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.items-table td { padding: 8px 6px; vertical-align: top; border-bottom: 1px solid var(--line); }
.items-table .qty { width: 90px; } .items-table .price { width: 130px; } .items-table .amt { width: 110px; text-align: right; font-weight: 600; padding-top: 18px; }
.totals { margin-left: auto; width: 100%; max-width: 340px; }
.totals .r { display: flex; justify-content: space-between; padding: 6px 0; }
.totals .r.total { border-top: 2px solid var(--text); margin-top: 6px; padding-top: 10px; font-size: 18px; font-weight: 700; }

/* ---------- photos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.photo { position: relative; border-radius: 8px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); aspect-ratio: 1; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo .file { display: grid; place-items: center; height: 100%; padding: 8px; text-align: center; font-size: 12px; color: var(--muted); }
.photo .vis { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 12px; background: rgba(16,34,47,.78); color: #fff; }
.photo .vis.on { background: var(--green); }
.photo .tools { position: absolute; right: 4px; top: 4px; display: flex; gap: 4px; }
.photo .tools button { width: 28px; height: 28px; border-radius: 6px; border: 0; background: rgba(255,255,255,.92); cursor: pointer; display: grid; place-items: center; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; aspect-ratio: 1; display: grid; place-items: center; }
.dropzone:hover, .dropzone.over { border-color: var(--green); background: var(--green-50); color: var(--green-600); }

/* ---------- notes / timeline ---------- */
.note { padding: 12px 14px; border-radius: 8px; background: #fbfcfb; border: 1px solid var(--line); }
.note.client { background: var(--green-50); border-color: #cfe5cc; }
.note .meta { font-size: 12px; color: var(--faint); margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.timeline { position: relative; padding-left: 18px; overflow-wrap: anywhere; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 12px; font-size: 14px; }
.tl-item::before { content: ''; position: absolute; left: -17px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--line-2); }
.tl-item.client::before { border-color: var(--green); background: var(--green); }
.tl-item .when { font-size: 12px; color: var(--faint); }

/* ---------- signature ---------- */
.sig-wrap { border: 1px solid var(--line-2); border-radius: 10px; background: #fff; position: relative; }
.sig-wrap canvas { width: 100%; height: 180px; display: block; border-radius: 10px; }
.sig-wrap .line { position: absolute; left: 20px; right: 20px; bottom: 40px; border-bottom: 1px solid var(--line-2); pointer-events: none; }
.sig-wrap .x { position: absolute; left: 20px; bottom: 44px; color: var(--faint); font-size: 18px; pointer-events: none; }
.sig-wrap .clear { position: absolute; right: 8px; top: 8px; }
.sig-img { max-height: 90px; background: #fff; border-bottom: 1px solid var(--line-2); }

/* ---------- modal / sheet ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(16,34,47,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .12s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); animation: pop .15s; }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fafbfa; border-radius: 0 0 14px 14px; flex-wrap: wrap; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--green); }
.choice { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; background: #fff; width: 100%; text-align: left; margin-bottom: 10px; }
.choice:hover { border-color: var(--green); background: var(--green-50); }
.choice.on { border-color: var(--green); box-shadow: 0 0 0 2px var(--green) inset; }
.choice .ico { width: 26px; height: 26px; color: var(--green); flex: none; }
.choice .t { font-weight: 700; }
.choice .d { font-size: 13px; color: var(--muted); }
.methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.methods button { padding: 12px 8px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-weight: 600; cursor: pointer; }
.methods button.on { border-color: var(--green); background: var(--green-50); color: var(--green-600); box-shadow: 0 0 0 1px var(--green) inset; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 200; display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-height: 92vh; max-width: 96vw; border-radius: 6px; }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 300; left: 50%; transform: translateX(-50%); bottom: 24px; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .15s; pointer-events: auto; max-width: 92vw; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green-600); }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.cal .dow { padding: 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; background: #fafbfa; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal .day { min-height: 110px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; }
.cal .day.other { background: #fafbfa; color: var(--faint); }
.cal .day.today .dnum { background: var(--green); color: #fff; }
.cal .dnum { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 700; }
.cal .ev { display: block; font-size: 12px; padding: 3px 6px; border-radius: 5px; margin-top: 3px; background: var(--blue-50); color: var(--blue); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.done { background: var(--green-50); color: var(--green-600); text-decoration: line-through; }
.cal .ev.takedown { background: var(--purple-50); color: var(--purple); }

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--navy) 0%, #1c3d52 100%); }
.auth .card { width: 100%; max-width: 410px; padding: 30px; }
.auth h1 { margin-bottom: 4px; }
.auth .logo { width: 48px; height: 48px; border-radius: 12px; background: var(--green); display: grid; place-items: center; color: #fff; margin-bottom: 16px; }

.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
.loading { display: grid; place-items: center; padding: 60px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { font-size: 16px; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--bottombar) + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 12px; padding-top: env(safe-area-inset-top); height: calc(var(--topbar) + env(safe-area-inset-top)); }
  .topbar .search { max-width: none; }
  .content { padding: 16px 14px; }
  .grid-2, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 21px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .card-head, .card-body, .form-section { padding-left: 14px; padding-right: 14px; }
  .dl { grid-template-columns: 110px 1fr; }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table.responsive td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 3px 0; }
  .table.responsive td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 13px; }
  .items-table thead { display: none; }
  .items-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .items-table td { border: 0; padding: 0; }
  .items-table td.name { grid-column: 1 / -1; }
  .items-table .qty, .items-table .price { width: auto; }
  .items-table .amt { padding-top: 0; text-align: left; }
  .modal-back { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 94vh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--bottombar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); z-index: 40; }
  .bottombar a, .bottombar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); border: 0; background: none; text-decoration: none; }
  .bottombar .on { color: var(--green); }
  .bottombar .ico { width: 23px; height: 23px; }
  .bottombar .plus { width: 46px; height: 46px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin-top: -14px; box-shadow: var(--shadow-lg); }
  .cal .day { min-height: 64px; padding: 3px; }
  .cal .ev { font-size: 10px; padding: 1px 3px; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 761px) { .show-mobile { display: none !important; } }
@media print {
  .sidebar, .topbar, .bottombar, .no-print { display: none !important; }
  .main { margin: 0; } body { background: #fff; }
  .card { box-shadow: none; }
}

/* ==================== ui-core (components.js + core pages) ==================== */
.ico { width: 20px; height: 20px; flex: none; } /* default icon size (specific rules override) */
.page-top { margin-bottom: 20px; }
.page-top .page-head { margin-bottom: 0; }
.page-top .back { text-decoration: none; }
.page-top .back .ico { width: 16px; height: 16px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; min-width: 0; }
.upper { text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.ico-inline { width: 14px; height: 14px; vertical-align: -2px; }
.ico.flip { transform: rotate(180deg); }
.link-btn { border: 0; background: none; padding: 2px 4px; color: var(--blue); font-weight: 600; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger, .icon-btn.danger:hover { color: var(--red); }
.empty-text { margin: 4px auto 0; max-width: 380px; }
.error-box { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-color: #ecc9c6; background: var(--red-50); flex-wrap: wrap; }
.error-box .err-ico { color: var(--red); } .error-box .err-ico .ico { width: 26px; height: 26px; }
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; }
.callout > .ico { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.callout.red { background: var(--red-50); border-color: #ecc9c6; } .callout.red > .ico { color: var(--red); }
.callout.green { background: var(--green-50); border-color: #cfe5cc; } .callout.green > .ico { color: var(--green); }
.callout.amber { background: var(--amber-50); border-color: #f1dfb9; } .callout.amber > .ico { color: var(--amber); }
.callout.blue { background: var(--blue-50); border-color: #cddff3; } .callout.blue > .ico { color: var(--blue); }
.callout p { margin: 4px 0 0; } .callout ol, .callout ul { margin: 6px 0 0; padding-left: 20px; } .callout li { margin: 3px 0; }
.toggle-row { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.toggle-text { display: flex; flex-direction: column; } .toggle-text .hint { font-weight: 400; font-size: 12px; color: var(--faint); }
.seg .ico { width: 16px; height: 16px; vertical-align: -3px; }
.seg-full { display: flex; width: 100%; } .seg-full button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-3); color: #fff; font-weight: 700; flex: none; }
.avatar.lg { width: 46px; height: 46px; font-size: 18px; }
/* search */
.topbar .search input { font-size: 16px; } /* 16px stops iOS zoom */
.search-results { min-width: 300px; }
.ac-group { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; background: #fafbfa; border-bottom: 1px solid var(--line); }
.search-input { position: relative; } .search-input .ico { position: absolute; left: 11px; top: 12px; width: 18px; color: var(--faint); }
.search-input .input { padding-left: 36px; }
.ac-item.new-client { color: var(--green-600); font-weight: 700; display: flex; align-items: center; gap: 6px; } .ac-item.new-client .ico { width: 18px; }
.picked-client { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fbfcfb; }
/* address */
.addr { display: flex; flex-direction: column; gap: 12px; }
.addr-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
/* line items */
.items-table .input { min-height: 40px; }
.items-table .desc { min-height: 54px; margin-top: 6px; font-size: 14px; }
.items-table .li-actions { width: 112px; white-space: nowrap; text-align: right; }
.items-table .li-actions .icon-btn { width: 34px; height: 34px; } .items-table .li-actions .icon-btn:disabled { opacity: .3; cursor: default; }
.items-table .m-label { display: none; }
.tpl-pick { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.tpl-item { display: flex; justify-content: space-between; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 4px; border-top: 1px solid var(--line); cursor: pointer; text-align: left; margin-top: 8px; }
.tpl-item:hover { background: var(--green-50); }
.totals .r.edit { align-items: center; }
.totals .w-money { width: 130px; } .totals .w-pct { width: 130px; display: flex; align-items: center; gap: 6px; }
.totals .r.balance { font-weight: 700; font-size: 16px; color: var(--green-600); }
/* attachments */
.att { min-width: 0; }
.att .photo .file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); text-decoration: none; word-break: break-all; }
.att .photo .file .ico { width: 30px; height: 30px; }
.att .photo .tools button .ico { width: 15px; height: 15px; }
.from-tag { position: absolute; left: 6px; top: 6px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; background: rgba(255,255,255,.92); color: var(--navy); }
.vis-toggle { margin-top: 6px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 6px 4px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--muted); cursor: pointer; }
.vis-toggle .ico { width: 15px; height: 15px; }
.vis-toggle.on { background: var(--green-50); border-color: #bcdcb8; color: var(--green-600); }
.vis-toggle:disabled { cursor: default; opacity: .8; }
.att .cap { font-size: 12px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone .ico { width: 26px; height: 26px; margin: 0 auto 4px; display: block; }
.dropzone { aspect-ratio: auto; min-height: 130px; }
/* notes / activity */
.note .meta { flex-wrap: wrap; }
.tl-label { font-weight: 600; color: var(--text); } a.tl-label:hover { color: var(--blue); }
.tl-badge { font-size: 10px; padding: 1px 6px; vertical-align: 1px; }
/* signature */
.sig-hint { position: absolute; left: 0; right: 0; top: 40%; text-align: center; color: var(--faint); font-size: 14px; pointer-events: none; }
/* client card */
.client-card .big-name { font-size: 17px; color: var(--text); display: block; }
.contact-lines { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; font-size: 14px; }
.contact-lines a { display: flex; align-items: flex-start; gap: 9px; color: var(--text); min-width: 0; }
.contact-lines .ico { width: 17px; height: 17px; color: var(--faint); flex: none; margin-top: 2px; }
.quick-contact { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.quick-contact a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 11px 4px; font-size: 12px; font-weight: 700; color: var(--green-600); text-decoration: none; }
.quick-contact a + a { border-left: 1px solid var(--line); }
.quick-contact a:hover { background: var(--green-50); }
.quick-contact a.off { color: var(--line-2); pointer-events: none; }
.quick-contact .ico { width: 20px; height: 20px; }

/* dashboard */
.greet h1 { font-size: 26px; }
.stat-card { display: block; color: inherit; transition: border-color .12s, transform .12s; }
.stat-card:hover { border-color: var(--line-2); text-decoration: none; }
.stat-card .label { display: flex; align-items: center; gap: 6px; }
.stat-card .label .ico { width: 16px; height: 16px; }
.stat.amber .value { color: var(--amber); }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.job-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.job-row:last-child { border-bottom: 0; }
.job-row .when { width: 70px; flex: none; font-weight: 700; font-size: 14px; }
.job-row .when .tiny { font-weight: 600; color: var(--muted); }
.job-row .info { flex: 1; min-width: 0; color: inherit; }
.job-row .info:hover { text-decoration: none; } .job-row .info:hover .title { color: var(--blue); }
.job-row .title { font-weight: 700; }
.job-row .acts { display: flex; gap: 4px; flex: none; }
.job-row .acts .icon-btn { border: 1px solid var(--line); color: var(--green-600); }
.type-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--blue); }
.type-dot.takedown { background: var(--purple); } .type-dot.service { background: var(--amber); } .type-dot.completed { background: var(--green); }
.attn-group { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.attn-group:last-child { border-bottom: 0; }
.attn-group h4 { margin: 0 0 6px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.attn-group h4 .n { background: var(--amber-50); color: var(--amber); border-radius: 20px; padding: 0 8px; font-size: 12px; }
.attn-link { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; color: var(--text); font-size: 14px; }
.attn-link:hover { color: var(--blue); text-decoration: none; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.big-num { font-size: 28px; font-weight: 800; line-height: 1.1; }

/* schedule */
.sched-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sched-bar h2 { min-width: 160px; }
.cal-card { overflow: hidden; }
.cal .day:hover { background: #f8faf9; }
.cal .day .add { float: right; opacity: 0; color: var(--faint); font-size: 18px; line-height: 1; }
.cal .day:hover .add { opacity: 1; }
.cal .ev { text-decoration: none; }
.cal .ev:hover { filter: brightness(.96); text-decoration: none; }
.cal .ev.service { background: var(--amber-50); color: var(--amber); }
.cal .ev.in_progress { box-shadow: inset 3px 0 0 var(--purple); }
.cal .ev.done.takedown { background: var(--green-50); color: var(--green-600); }
.cal .more { font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 3px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week .wday { background: #fff; border: 1px solid var(--line); border-radius: 10px; min-height: 220px; display: flex; flex-direction: column; }
.week .wday.today { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.week .wday-head { padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; cursor: pointer; }
.week .wday-body { padding: 6px; display: flex; flex-direction: column; gap: 6px; flex: 1; cursor: pointer; }
.wev { display: block; padding: 7px 8px; border-radius: 8px; background: var(--blue-50); color: var(--navy); font-size: 13px; border-left: 3px solid var(--blue); text-decoration: none !important; cursor: pointer; }
.wev .t { font-weight: 700; } .wev .s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wev.takedown { background: var(--purple-50); border-left-color: var(--purple); }
.wev.service { background: var(--amber-50); border-left-color: var(--amber); }
.wev.done { background: var(--green-50); border-left-color: var(--green); }
.wev.done .t { text-decoration: line-through; opacity: .75; }
.agenda-day { margin-bottom: 14px; }
.agenda-day .dh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px 6px; font-weight: 700; }
.agenda-day .dh.today { color: var(--green-600); }
.agenda-day .card .job-row { padding: 12px 14px; }
.unsched .list-item { padding: 11px 16px; }

/* lists & tables */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search-input { flex: 1; min-width: 200px; }
.toolbar .select { width: auto; min-width: 160px; }
.row-link { color: inherit; }
.row-link:hover { text-decoration: none; }
.list-item .right-col { margin-left: auto; text-align: right; flex: none; }
.list-item .grow { flex: 1; min-width: 0; }
.money-due { color: var(--amber); font-weight: 700; }
.req-card .card-body { display: flex; flex-direction: column; gap: 10px; }
.req-card .msg { background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: 14px; white-space: pre-wrap; }
.req-card .contact { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.req-card .contact a { display: inline-flex; align-items: center; gap: 6px; }
.req-card .contact .ico { width: 16px; height: 16px; }
.quick-new { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.quick-new .btn { flex-direction: column; gap: 4px; padding: 12px 6px; min-height: 64px; font-size: 13px; }
.quick-new .btn .ico { width: 20px; height: 20px; color: var(--green); }
.money-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.money-strip > div { padding: 14px 18px; } .money-strip > div + div { border-left: 1px solid var(--line); }
.cat-bar { height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; margin-top: 4px; }
.cat-bar span { display: block; height: 100%; background: var(--green); border-radius: 6px; }

/* settings */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--topbar) + 16px); }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); font-weight: 600; font-size: 14px; }
.settings-nav a .ico { width: 18px; height: 18px; color: var(--muted); }
.settings-nav a:hover { background: #fff; text-decoration: none; }
.settings-nav a.on { background: #fff; box-shadow: var(--shadow); color: var(--green-600); } .settings-nav a.on .ico { color: var(--green); }
.save-bar { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fafbfa; border-radius: 0 0 var(--radius) var(--radius); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 11px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--faint); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; padding: 0; }
.chip button:hover { background: var(--red-50); color: var(--red); } .chip .ico { width: 13px; height: 13px; }
.chip.ph { cursor: pointer; padding: 4px 10px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--blue-50); border-color: #cddff3; color: var(--blue); }
.color-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--navy); }
.logo-box { width: 84px; height: 84px; border-radius: 14px; border: 1px dashed var(--line-2); display: grid; place-items: center; background: #fff center/contain no-repeat; color: var(--faint); flex: none; }
.preset-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.preset { text-align: left; padding: 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; cursor: pointer; }
.preset:hover { border-color: var(--green); background: var(--green-50); }
.preset .t { font-weight: 800; display: flex; align-items: center; gap: 8px; } .preset .d { font-size: 13px; color: var(--muted); margin-top: 2px; }
.preset .rec { font-size: 11px; background: var(--green); color: #fff; border-radius: 10px; padding: 1px 7px; font-weight: 700; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.policy-text { font-size: 14px; line-height: 1.5; min-height: 260px; }

/* import */
.import-steps { counter-reset: st; display: flex; flex-direction: column; gap: 16px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.step-num.done { background: var(--green); }
.kind-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kind-grid .choice { flex-direction: column; align-items: flex-start; gap: 6px; margin: 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.preview-table { font-size: 13px; } .preview-table td, .preview-table th { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.map-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 10px; }
.map-row label { font-weight: 600; font-size: 14px; }
.result-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; text-align: center; }
.result-nums .big-num { color: var(--green-600); }

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 4px; margin: 0 -14px; padding: 0 14px 4px; }
  .settings-nav a { white-space: nowrap; padding: 8px 12px; background: #fff; border: 1px solid var(--line); }
  .settings-nav a.on { border-color: var(--green); }
  .kind-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week { grid-template-columns: minmax(0, 1fr); }
  .week .wday { min-height: 0; }
  .week .wday-body { min-height: 44px; }
}
@media (max-width: 760px) {
  .greet h1 { font-size: 22px; }
  .stat { padding: 13px 14px; } .stat .value { font-size: 21px; } .stat .label { font-size: 11px; }
  .job-row { padding: 12px 14px; gap: 10px; }
  .job-row .when { width: 56px; font-size: 13px; }
  .addr-grid { grid-template-columns: minmax(0, 1fr) 80px 96px; }
  .items-table tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .items-table .m-label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 3px; }
  .items-table td.amt { padding-top: 0; display: flex; flex-direction: column; justify-content: flex-end; font-size: 16px; }
  .items-table td.li-actions { width: auto; display: flex; justify-content: flex-end; align-items: flex-end; }
  .quick-new { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .quick-new .btn { font-size: 11px; padding: 10px 2px; }
  .preset-row, .map-grid { grid-template-columns: minmax(0, 1fr); }
  .map-row { grid-template-columns: 120px minmax(0, 1fr); }
  .toolbar .select { flex: 1; }
  .save-bar { position: sticky; bottom: calc(var(--bottombar) + env(safe-area-inset-bottom)); z-index: 5; padding: 10px 14px; }
  .save-bar .btn { flex: 1; }
  .search-results { min-width: 0; }
  .cal .day .add { display: none; }
}
/* ==================== end ui-core ==================== */
/* ui-core: settings presets (selected) */
.preset.on { border-color: var(--green); background: var(--green-50); box-shadow: 0 0 0 2px var(--green) inset; }

/* ==================== ui-sales (quotes, jobs, invoices, contracts) ==================== */
.items-ro td { vertical-align: top; }
.choice.danger .ico, .choice.danger .t { color: var(--red); }
.chip.ph-tpl { cursor: pointer; padding: 7px 12px; } .chip.ph-tpl.on { border-color: var(--green); background: var(--green-50); color: var(--green-600); }
.strip-btn { border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.strip-btn:hover { background: #f8faf9; }
.red-text { color: var(--red); } .green-text { color: var(--green-600); }
.sales-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 20px; }
.hero-num { font-size: 30px; font-weight: 800; margin: 6px 0 2px; line-height: 1.1; }
.btn-xl { min-height: 60px; font-size: 19px; font-weight: 800; padding: 14px 26px; border-radius: 12px; }
.btn-xl .ico { width: 24px; height: 24px; }
.job-hero .hero-when { font-size: 22px; font-weight: 800; margin: 10px 0 4px; }
.job-hero .hero-addr { display: inline-flex; gap: 6px; align-items: flex-start; color: var(--text); font-size: 15px; }
.job-hero .hero-addr .ico { width: 18px; height: 18px; color: var(--faint); flex: none; margin-top: 1px; }
.hero-contact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; max-width: 460px; }
.hero-contact .btn { color: var(--green-600); } .hero-contact .btn.off { color: var(--line-2); pointer-events: none; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.contract-stats .stat-card { text-align: left; cursor: pointer; font: inherit; width: 100%; }
.contract-stats .stat-card.on { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.contract-body h3 { margin: 18px 0 6px; } .contract-body p { margin: 0 0 10px; line-height: 1.55; font-size: 14px; }
.contract-preview { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; max-height: 520px; overflow-y: auto; background: #fbfcfb; }
/* payment + finish wizard: big, thumb-friendly */
.methods.big { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.methods.big button { min-height: 54px; font-size: 16px; }
.pay-amount .input { font-size: 24px; font-weight: 800; min-height: 56px; }
.pay-amount .input-money::before { font-size: 20px; }
.finish-wizard .choice.big { padding: 18px 16px; } .finish-wizard .choice.big .t { font-size: 17px; }
.finish-wizard .modal-foot { display: flex; gap: 10px; } .finish-wizard .grow-btn { flex: 1; }
.wiz-done { text-align: center; padding: 6px 0 18px; }
.wiz-done .done-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; display: inline-grid; place-items: center; margin-bottom: 10px; }
.wiz-done .done-ico .ico { width: 34px; height: 34px; }
.wiz-done.small-done { padding: 0 0 14px; } .wiz-done.small-done .done-ico { width: 48px; height: 48px; } .wiz-done.small-done .done-ico .ico { width: 26px; height: 26px; }
.done-list { list-style: none; padding: 0; margin: 14px auto 0; text-align: left; display: inline-flex; flex-direction: column; gap: 8px; }
.done-list li { display: flex; gap: 8px; align-items: center; } .done-list .ico { width: 18px; height: 18px; color: var(--green); flex: none; }
.done-list li.muted .ico { color: var(--faint); }
@media (max-width: 760px) {
  .sales-hero { flex-direction: column; align-items: stretch; } .sales-hero .hero-btn { width: 100%; }
  .hero-actions { align-items: stretch; } .hero-actions .btn-xl { width: 100%; } .hero-actions .row .btn { flex: 1; }
  .hero-contact { max-width: none; }
  .finish-wizard .modal-foot .btn { min-height: 54px; }
}
@media print { .page-head .actions, .modal-back { display: none !important; } }
/* ==================== end ui-sales ==================== */

/* integration */
/* On phones, toasts sit at the top so they never cover a modal's bottom buttons. */
@media (max-width: 760px) {
  .toasts { bottom: auto; top: calc(env(safe-area-inset-top) + 10px); }
}
/* On phones the modal scrolls as a whole: keep its action buttons pinned to the bottom so they're always reachable. */
@media (max-width: 760px) {
  .modal-foot { position: sticky; bottom: 0; z-index: 2; border-radius: 0; }
}
