/* ============================================================
   FieldOps — one stylesheet for the office, the truck and the customer.
   Tokens first; a company can override --accent from Settings.
   ============================================================ */
:root {
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --line: #e6e9ef; --line-2: #eef1f5; --bg: #f3f5f9; --card: #ffffff; --card-2: #f8fafc;
  --navy: #1f2430; --navy-2: #2b3447; --navy-3: #3a4560;
  --accent: #2563eb; --accent-2: #1d4ed8; --accent-soft: #e8efff; --accent-ink: #1e40af;
  --spark: #facc15;
  --green: #16a34a; --green-soft: #e7f7ec; --green-ink: #166534;
  --amber: #d97706; --amber-soft: #fff4e0; --amber-ink: #92400e;
  --red: #dc2626; --red-soft: #fdecec; --red-ink: #991b1b;
  --purple: #7c3aed; --purple-soft: #f0e9ff; --purple-ink: #5b21b6;
  --sky: #0284c7; --sky-soft: #e0f2fe;
  --radius: 14px; --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.04);
  --shadow-2: 0 4px 14px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.05);
  --shadow-3: 0 18px 50px rgba(15,23,42,.18);
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Poppins', var(--font-body);
  --sidebar: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); color: var(--ink); background: var(--bg); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0 0 .35em; font-family: var(--font-head); font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
h1 { font-size: 24px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: 0 0 .75em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--line-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; } .bold { font-weight: 600; }
.hidden { display: none !important; }
.right { text-align: right; } .center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ===================== app shell (office) ===================== */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--navy) 0%, #171c26 100%); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 14px; }
.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.sidebar .brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--navy-2); display: grid; place-items: center; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.sidebar .brand .mark svg { width: 20px; height: 20px; }
.sidebar .brand small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 11px; opacity: .55; letter-spacing: .06em; text-transform: uppercase; margin-top: 1px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; color: rgba(255,255,255,.72); padding: 9px 11px; border-radius: 10px; font-size: 14px; font-weight: 500; transition: background .12s, color .12s; }
.sidebar nav a svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .85; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--spark); }
.sidebar nav a .badge { margin-left: auto; background: var(--spark); color: var(--navy); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.sidebar .spacer { flex: 1; }
.sidebar .who { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.sidebar .who > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sidebar .who .name { font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .who .role { font-size: 11px; opacity: .55; }
.sidebar .who .role.admin { opacity: 1; color: var(--yellow, #ffd029); font-weight: 600; }
.door-pill { display: inline-block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }
.door-pill.office { background: #e8efff; color: #2f62d8; }
.door-pill.admin { background: #fff4d6; color: #8a6400; }
.sidebar .who a { color: rgba(255,255,255,.55); font-size: 12px; margin-left: auto; }
.sidebar .who a:hover { color: #fff; }
.content { min-width: 0; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 26px 28px 70px; }
.wrap.narrow { max-width: 760px; }
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; height: auto; flex-direction: row; align-items: center; padding: 8px 12px; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .sidebar .brand { padding: 4px 6px; flex: 0 0 auto; } .sidebar .brand small { display: none; }
  .sidebar nav { flex-direction: row; gap: 2px; }
  .sidebar nav a { padding: 8px 10px; font-size: 13px; white-space: nowrap; } .sidebar nav a svg { display: none; }
  .sidebar nav a.active { box-shadow: inset 0 -2px 0 var(--spark); }
  .sidebar .who { border: 0; padding: 4px 6px; margin-left: auto; } .sidebar .who .name, .sidebar .who .role { display: none; }
  .wrap { padding: 18px 16px 60px; }
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ===================== cards ===================== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 18px; }
.card + .card { margin-top: 14px; }
.card.pad0 { padding: 0; overflow: hidden; }
.card.flat { box-shadow: none; }
.card h2 { margin-bottom: 10px; }
.section-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin: 4px 0 10px; }

/* ===================== buttons ===================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; background: var(--navy); color: #fff; padding: 9px 15px; border-radius: var(--radius-sm); font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; transition: transform .06s, background .15s, box-shadow .15s, border-color .15s; line-height: 1.2; }
.btn:hover { background: var(--navy-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); box-shadow: 0 1px 2px rgba(37,99,235,.3); } .btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-1); } .btn.ghost:hover { background: var(--card-2); border-color: #d7dce5; }
.btn.soft { background: var(--accent-soft); color: var(--accent-ink); } .btn.soft:hover { background: #dbe6ff; }
.btn.danger { background: var(--red-soft); color: var(--red-ink); } .btn.danger:hover { background: #fbd9d9; }
.btn.success { background: var(--green); box-shadow: 0 1px 2px rgba(22,163,74,.3); } .btn.success:hover { background: #15803d; }
.btn.warn { background: var(--amber); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 14px 20px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.icon { padding: 8px; width: 36px; height: 36px; }
.btnbar { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===================== forms ===================== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); line-height: 1.45; }
input, select, textarea { font: inherit; font-size: 14.5px; padding: 10px 12px; border: 1px solid #d5dae3; border-radius: var(--radius-sm); background: #fff; color: var(--ink); width: 100%; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: #bfc7d3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
input:disabled, select:disabled { background: var(--card-2); color: var(--muted); }
textarea { min-height: 88px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
input[type=color] { padding: 3px; height: 42px; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .inline-fields { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }

/* ===================== tables / lists ===================== */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--card-2); }
td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7f9fc; }
.list { display: flex; flex-direction: column; }
.list .item { display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .1s; }
.list .item:last-child { border-bottom: 0; }
.list .item:hover { background: #f7f9fc; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); font-size: 14px; }
.empty.small { padding: 18px; font-size: 13px; }
.empty::before { content: ''; display: block; width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 12px; background: var(--line-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M4 12h10M4 17h6'/%3E%3C/svg%3E") center/22px no-repeat; }
.empty.small::before { display: none; }

/* ===================== pills / status ===================== */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--line-2); color: var(--ink-2); white-space: nowrap; line-height: 1.5; }
.pill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.unscheduled { background: #f1f5f9; color: #475569; }
.pill.scheduled { background: var(--accent-soft); color: var(--accent-ink); }
.pill.en_route { background: var(--purple-soft); color: var(--purple-ink); }
.pill.on_site { background: var(--amber-soft); color: var(--amber-ink); }
.pill.done { background: var(--green-soft); color: var(--green-ink); }
.pill.invoiced { background: var(--sky-soft); color: #075985; }
.pill.paid { background: var(--green-soft); color: var(--green-ink); }
.pill.cancelled, .pill.void, .pill.declined { background: var(--red-soft); color: var(--red-ink); }
.pill.sent { background: var(--accent-soft); color: var(--accent-ink); }
.pill.draft { background: #f1f5f9; color: #475569; }
.pill.approved { background: var(--green-soft); color: var(--green-ink); }
.pill.partial { background: var(--amber-soft); color: var(--amber-ink); }
.pill.new { background: var(--amber-soft); color: var(--amber-ink); }
.pill.contacted { background: var(--sky-soft); color: #075985; }
.pill.converted { background: var(--green-soft); color: var(--green-ink); }
.pill.urgent { background: var(--red-soft); color: var(--red-ink); }
.pill.ok { background: var(--green-soft); color: var(--green-ink); }
.pill.warn { background: var(--amber-soft); color: var(--amber-ink); }
.pill.bad { background: var(--red-soft); color: var(--red-ink); }

/* ===================== stat tiles ===================== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 16px 18px; position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; background: var(--accent-soft); opacity: .6; }
.stat:nth-child(2)::after { background: var(--purple-soft); } .stat:nth-child(3)::after { background: var(--green-soft); } .stat:nth-child(4)::after { background: var(--amber-soft); }
.stat .n { font-family: var(--font-head); font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; position: relative; }
.stat .l { font-size: 12.5px; color: var(--muted); margin-top: 4px; position: relative; }

/* ===================== dispatch board ===================== */
.board { display: grid; grid-template-columns: 232px 1fr; gap: 14px; align-items: start; }
.board > * { min-width: 0; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
.lane { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.lane-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--card-2); font-size: 13.5px; }
.lane-body { min-height: 72px; padding: 10px; display: flex; flex-direction: column; gap: 8px; transition: background .12s; }
.lane-body.over { background: var(--accent-soft); }
.jobcard { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 9px 11px; background: #fff; cursor: grab; font-size: 13px; box-shadow: var(--shadow-1); transition: box-shadow .12s, transform .12s; }
.jobcard:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.jobcard:active { cursor: grabbing; }
.jobcard .t { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.jobcard .m { color: var(--muted); font-size: 12px; margin-top: 2px; }
.jobcard.dragging { opacity: .45; }
#timeline { overflow-x: auto; }
.timeline { --hours: 11; min-width: 720px; display: grid; grid-template-columns: 168px repeat(var(--hours), 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow-1); }
.timeline .hd { font-size: 11px; color: var(--faint); padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: center; background: var(--card-2); font-weight: 500; }
.timeline .techcol { padding: 12px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line); font-size: 13px; background: #fff; }
.timeline .slots { grid-column: 2 / -1; position: relative; border-bottom: 1px solid var(--line-2); min-height: 66px; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / var(--hours) - 1px), var(--line-2) calc(100% / var(--hours) - 1px), var(--line-2) calc(100% / var(--hours))); transition: background-color .12s; }
.timeline .slots.over { background-color: var(--accent-soft); }
.timeline .blk { --c: var(--accent); position: absolute; top: 9px; height: 48px; border-radius: 9px; padding: 6px 9px 6px 11px; font-size: 12px; line-height: 1.3; color: var(--ink); overflow: hidden; cursor: grab; background: color-mix(in srgb, var(--c) 16%, #fff); box-shadow: inset 4px 0 0 var(--c), var(--shadow-1); transition: box-shadow .12s; }
.timeline .blk:hover { box-shadow: inset 4px 0 0 var(--c), var(--shadow-2); z-index: 3; }
.timeline .blk .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline .blk .m { color: var(--ink-2); opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline .blk.en_route { outline: 2px solid var(--purple); outline-offset: -2px; }
.timeline .blk.on_site { outline: 2px solid var(--amber); outline-offset: -2px; }
.timeline .blk.done, .timeline .blk.invoiced, .timeline .blk.paid { opacity: .5; }
.timeline .blk.late { outline: 2px solid var(--red); outline-offset: -2px; box-shadow: inset 4px 0 0 var(--red), 0 0 0 3px var(--red-soft); }
.timeline .blk.incomplete { --c: var(--amber); }
.pill.incomplete { background: var(--amber-soft); color: var(--amber-ink); }
.pill.changes_requested, .pill.expired { background: var(--amber-soft); color: var(--amber-ink); }
.list .item.age-amber { box-shadow: inset 3px 0 0 var(--amber); }
.list .item.age-red { box-shadow: inset 3px 0 0 var(--red); }
.photos .ph .kind { position: absolute; left: 5px; bottom: 5px; background: rgba(15,23,42,.65); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 6px; text-transform: capitalize; }
.timeline .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.timeline .now::before { content: ''; position: absolute; top: -1px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

/* ===================== map ===================== */
#map, .map { height: 400px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-1); background: #e5e7eb; }
.leaflet-container { font-family: var(--font-body); }
.leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: var(--shadow-2); }
.techpin { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.techpin.stale { opacity: .5; filter: grayscale(.6); }
.jobpin { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35); }

/* ===================== drawer / modal ===================== */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); z-index: 40; display: flex; justify-content: flex-end; }
.drawer { width: min(760px, 100%); height: 100%; background: var(--bg); overflow-y: auto; box-shadow: var(--shadow-3); animation: slide .2s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 14px 18px; display: flex; align-items: center; gap: 12px; z-index: 2; }
.drawer-body { padding: 18px; }
.modal-center { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: min(540px, 100%); background: #fff; border-radius: 16px; padding: 22px; box-shadow: var(--shadow-3); max-height: 92vh; overflow-y: auto; animation: pop .18s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===================== toast ===================== */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; z-index: 100; box-shadow: var(--shadow-3); max-width: 92vw; animation: pop .18s; pointer-events: none; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }

/* ===================== activity feed ===================== */
.feed { display: flex; flex-direction: column; }
.feed .ev { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.feed .ev:last-child { border-bottom: 0; }
.feed .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--card-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.feed .when { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ===================== tabs ===================== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 13px; color: var(--muted); font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--accent-ink); border-bottom-color: var(--accent); }
@media (min-width: 900px) { .tabs { flex-wrap: wrap; overflow-x: visible; } }

/* ===================== sign in ===================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.auth-hero { background: radial-gradient(1200px 600px at 20% 10%, #33405a 0%, var(--navy) 55%, #14181f 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-hero::after { content: ''; position: absolute; right: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(250,204,21,.22), transparent 65%); }
.auth-hero .logo { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 600; font-size: 22px; margin-bottom: 34px; }
.auth-hero .logo .mark { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.08); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.auth-hero .logo .mark svg { width: 24px; height: 24px; }
.auth-hero h1 { font-size: 34px; color: #fff; max-width: 480px; line-height: 1.2; margin-bottom: 14px; }
.auth-hero p { color: rgba(255,255,255,.75); max-width: 460px; font-size: 15px; }
.auth-hero ul { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; max-width: 460px; }
.auth-hero li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: rgba(255,255,255,.88); }
.auth-hero li .ic { width: 28px; height: 28px; border-radius: 8px; background: rgba(250,204,21,.15); color: var(--spark); display: grid; place-items: center; font-size: 14px; flex: 0 0 auto; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.auth .card { width: min(420px, 100%); padding: 30px; box-shadow: var(--shadow-2); }
.auth .card h2 { font-size: 22px; margin-bottom: 4px; }
.auth .logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 600; font-size: 20px; margin-bottom: 4px; }
.auth .logo .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--spark); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-hero { display: none; } .auth-panel { min-height: 100vh; background: linear-gradient(160deg, var(--navy) 0%, #2f3a52 100%); } }

/* ===================== tech (phone) ===================== */
.tech body { background: var(--bg); }
.tech-top { background: linear-gradient(180deg, var(--navy) 0%, #232a38 100%); color: #fff; padding: 14px 16px; position: sticky; top: 0; z-index: 30; padding-top: calc(14px + env(safe-area-inset-top)); }
.tech-top .row { justify-content: space-between; flex-wrap: nowrap; }
.tech-top .co { font-family: var(--font-head); font-weight: 600; font-size: 15px; }
.tech-wrap { padding: 16px 14px 110px; max-width: 640px; margin: 0 auto; }
.tech-wrap h1 { font-size: 22px; }
.bignav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.bignav a { flex: 1; text-align: center; padding: 9px 4px 8px; font-size: 11px; font-weight: 500; color: var(--muted); position: relative; }
.bignav a:hover { text-decoration: none; }
.bignav a.active { color: var(--accent-ink); }
.bignav a.active::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.bignav a .i { display: block; font-size: 21px; line-height: 1.15; }
.hero-next { background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%); color: #fff; border: 0; box-shadow: 0 10px 30px rgba(37,99,235,.28); }
.hero-next .section-title { color: rgba(255,255,255,.7); }
.hero-next .btn.ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.2); box-shadow: none; }
.hero-next .btn.primary { background: #fff; color: var(--accent-ink); box-shadow: none; }
.jobrow { display: flex; gap: 14px; padding: 15px 14px; border-bottom: 1px solid var(--line-2); align-items: flex-start; cursor: pointer; }
.jobrow:active { background: var(--card-2); }
.jobrow .time { width: 66px; flex: 0 0 auto; font-family: var(--font-head); font-weight: 600; font-size: 14px; }
.jobrow .time small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: 12px; }
.jobrow .chev { color: var(--faint); font-size: 22px; line-height: 1; align-self: center; }
.statusbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.statusbar .btn { padding: 14px 6px; font-size: 13.5px; flex-direction: column; gap: 3px; border-radius: 12px; }
.statusbar .btn small { font-weight: 400; font-size: 11px; opacity: .8; }
.checklist .ck { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.checklist .ck input { width: 22px; height: 22px; margin-top: 1px; flex: 0 0 auto; }
.checklist .ck.done span { text-decoration: line-through; color: var(--muted); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photos .ph { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line-2); position: relative; display: block; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph .x { position: absolute; top: 5px; right: 5px; background: rgba(15,23,42,.65); color: #fff; border: 0; border-radius: 50%; width: 24px; height: 24px; font-size: 13px; cursor: pointer; }
.sigpad { width: 100%; height: 170px; border: 1.5px dashed #b6bfcc; border-radius: 12px; background: #fff; touch-action: none; }
.gps { font-size: 12px; display: inline-flex; align-items: center; gap: 6px; opacity: .9; }
.gps .d { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.gps.on .d { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.3); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,.3); } 50% { box-shadow: 0 0 0 6px rgba(34,197,94,.12); } }
.install-banner { display: flex; align-items: center; gap: 12px; background: var(--navy); color: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--shadow-2); }
.install-banner img { width: 40px; height: 40px; border-radius: 10px; }
.install-banner .btn { background: var(--spark); color: var(--navy); font-weight: 600; }

/* ===================== customer portal ===================== */
.portal-head { background: radial-gradient(900px 400px at 10% 0%, #33405a 0%, var(--navy) 60%, #171c26 100%); color: #fff; padding: 26px 16px 30px; }
.portal-head .inner { max-width: 780px; margin: 0 auto; }
.portal-head h1 { color: #fff; font-size: 22px; margin: 0; }
.portal-head .greet { font-size: 15px; color: rgba(255,255,255,.8); margin-top: 6px; }
.portal-head a { color: #fff; }
.portal-wrap { max-width: 780px; margin: -14px auto 0; padding: 0 16px 40px; }
.portal-wrap .section-title { margin-top: 20px; }
.stepper { display: flex; align-items: center; gap: 0; margin: 12px 0 4px; }
.stepper .st { flex: 1; text-align: center; font-size: 11px; color: var(--faint); position: relative; }
.stepper .st .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--line); margin: 0 auto 4px; display: grid; place-items: center; font-size: 11px; color: #fff; position: relative; z-index: 1; }
.stepper .st::before { content: ''; position: absolute; top: 11px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.stepper .st:first-child::before { display: none; }
.stepper .st.on .dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.stepper .st.on { color: var(--accent-ink); font-weight: 600; }
.stepper .st.past .dot { background: var(--green); }
.stepper .st.past::before, .stepper .st.on::before { background: var(--green); }
.lineitems td:last-child, .lineitems th:last-child { text-align: right; white-space: nowrap; }
.lineitems td { padding: 8px 6px; }
.totals { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; margin-top: 10px; font-size: 14px; }
.totals .big { font-family: var(--font-head); font-size: 19px; font-weight: 600; }

/* ===================== misc ===================== */
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff; background: var(--accent); flex: 0 0 auto; box-shadow: 0 0 0 2px #fff; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.print-only { display: none; }
@media print { .no-print, .sidebar, .bignav, .tech-top { display: none !important; } .print-only { display: block; } body { background: #fff; } .card { box-shadow: none; } .shell { display: block; } }
