/* Modern clean UI — Inter, soft surfaces, subtle motion. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --en_route-t: #0E7490; --en_route-b: #DFF3F8;
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --ink: #0F172A;
  --muted: #64748B;
  --line: #E7EAF1;
  --accent: #003BBD;   /* Rise Orion brand blue */
  --accent-soft: #E8EEFB;

  --pending-t: #92600A;    --pending-b: #FDF3DC;
  --scheduled-t: #3F45C4;  --scheduled-b: #E9EAFD;
  --in_progress-t: #1259C9;--in_progress-b: #E3EEFE;
  --parts_ordered-t: #7431C9; --parts_ordered-b: #F1E8FE;
  --complete-t: #157347;   --complete-b: #DFF5EA;
  --cancelled-t: #C0303A;  --cancelled-b: #FDE7E9;

  --r: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.05);
  --shadow-lift: 0 10px 28px rgba(15,23,42,.10);
  --ease: cubic-bezier(.22,.7,.3,1);
}

* { box-sizing: border-box; margin: 0; }
html { font-size: 16.5px; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--ink); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }

/* ---------------- header ---------------- */
.hdr {
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; padding: 0 20px; height: 62px;
  position: sticky; top: 0; z-index: 60;
}
.hdr .brand { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; margin-right: 18px; display: flex; align-items: center; gap: 9px; }
.hdr .brand .dot { width: 11px; height: 11px; border-radius: 4px; background: var(--accent); display: inline-block; }
.nav { display: flex; gap: 2px; height: 100%; }
.nav button {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-size: .98rem; font-weight: 600; padding: 0 16px; height: 100%;
  border-bottom: 2.5px solid transparent; transition: color .18s var(--ease);
}
.nav button:hover { color: var(--ink); }
.nav button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* account menu */
.acct { margin-left: auto; position: relative; }
.acct .avatar {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .95rem;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.acct .avatar:hover { transform: scale(1.06); box-shadow: 0 4px 14px rgba(79,70,229,.35); }
.menu {
  position: absolute; right: 0; top: 52px; width: 250px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lift);
  padding: 8px; opacity: 0; transform: translateY(-6px) scale(.97); pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease); transform-origin: top right; z-index: 70;
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .who b { display: block; font-size: 1rem; }
.menu .who span { color: var(--muted); font-size: .85rem; text-transform: capitalize; }
.menu button {
  display: flex; width: 100%; background: none; border: 0; cursor: pointer;
  padding: 11px 12px; border-radius: 9px; font-size: .95rem; font-weight: 500; color: var(--ink);
  transition: background .15s;
  align-items: center; gap: 10px;
}
.menu button:hover { background: var(--bg); }
.menu button.danger { color: var(--cancelled-t); }

main { max-width: 1080px; margin: 0 auto; padding: 30px 18px 90px; }

/* ---------------- views + motion ---------------- */
.view { animation: viewIn .4s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: viewIn .45s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .10s; }
.stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(n+7) { animation-delay: .26s; }

h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; margin: 30px 0 14px; }
.sub { color: var(--muted); font-size: .98rem; margin-top: 5px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }

/* ---------------- cards / stats ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 14px;
  transition: box-shadow .22s var(--ease), transform .22s var(--ease);
}
.card.hover { cursor: pointer; }
.card.hover:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 6px 0 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.stat .lbl { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.stat .val { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .val.good { color: var(--complete-t); }
.stat .val.bad { color: var(--cancelled-t); }

/* ---------------- pills / status ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .8rem;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.st-pending { color: var(--pending-t); background: var(--pending-b); }
.pill.st-scheduled { color: var(--scheduled-t); background: var(--scheduled-b); }
.pill.st-in_progress { color: var(--in_progress-t); background: var(--in_progress-b); }
.pill.st-parts_ordered { color: var(--parts_ordered-t); background: var(--parts_ordered-b); }
.pill.st-complete { color: var(--complete-t); background: var(--complete-b); }
.pill.st-cancelled { color: var(--cancelled-t); background: var(--cancelled-b); }
.pill.plain::before { display: none; }
.pill.warn { color: var(--cancelled-t); background: var(--cancelled-b); }

/* ---------------- job rows ---------------- */
.job {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
}
.job .title { font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job .meta { color: var(--muted); font-size: .93rem; margin-top: 7px; line-height: 1.65; }
.job .meta b { color: var(--ink); font-weight: 600; }
.actions { display: flex; gap: 9px; margin-top: 15px; flex-wrap: wrap; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: .95rem; padding: 11px 20px; border: 0; border-radius: 10px;
  cursor: pointer; background: var(--accent); color: #fff;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(79,70,229,.30); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.full { width: 100%; padding: 13px; font-size: 1rem; margin-top: 20px; }
.btn.green { background: #16A34A; } .btn.green:hover { box-shadow: 0 6px 18px rgba(22,163,74,.30); }
.btn.red { background: #DC2626; } .btn.red:hover { box-shadow: 0 6px 18px rgba(220,38,38,.30); }
.btn.purple { background: #7C3AED; } .btn.purple:hover { box-shadow: 0 6px 18px rgba(124,58,237,.30); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { box-shadow: var(--shadow-lift); background: var(--surface); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.soft:hover { box-shadow: none; background: #E3E6FD; }

/* ---------------- forms ---------------- */
label { display: block; font-weight: 600; font-size: .9rem; margin: 16px 0 7px; color: var(--ink); }
input, select, textarea {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink);
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface);
  transition: border-color .16s, box-shadow .16s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3.5px rgba(79,70,229,.14); }
textarea { min-height: 92px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } html { font-size: 16px; } }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 86px; padding: 11px 8px; font-size: .93rem; font-weight: 600;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--muted);
  transition: all .16s var(--ease);
}
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg button:hover:not(.on) { border-color: #C7CBDA; color: var(--ink); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filters select, .filters input { width: auto; min-width: 140px; font-size: .92rem; padding: 9px 12px; }

/* ---------------- tables ---------------- */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin: 12px 0; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; padding: 12px 14px; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); border-bottom: 1px solid var(--line); font-weight: 700; background: #FAFBFD; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .14s; }
tbody tr:hover { background: #FAFBFE; }
td.r, th.r { text-align: right; }
.pos { color: var(--complete-t); font-weight: 600; }
.neg { color: var(--cancelled-t); font-weight: 600; }

/* ---------------- modal ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 30px 14px; overflow-y: auto; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .22s var(--ease);
}
.overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border-radius: 18px; padding: 26px; width: 100%; max-width: 600px;
  box-shadow: 0 24px 60px rgba(15,23,42,.25);
  transform: translateY(14px) scale(.98); transition: transform .25s var(--ease);
}
.overlay.open .modal { transform: none; }
.modal h2 { margin: 0 0 4px; font-size: 1.25rem; }
.modal .close { float: right; background: var(--bg); border: 0; width: 34px; height: 34px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; color: var(--muted); transition: all .15s; }
.modal .close:hover { background: var(--line); color: var(--ink); }

/* ---------------- misc ---------------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 12px;
  font-size: .95rem; font-weight: 600; z-index: 200; max-width: 92vw; text-align: center;
  box-shadow: var(--shadow-lift); opacity: 0; transition: all .3s var(--ease); pointer-events: none;
}
.toast.err { background: #DC2626; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { text-align: center; color: var(--muted); font-size: .98rem; padding: 46px 16px; background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--r); }
.note { background: #FFF9E8; border: 1px solid #F0DFA8; border-radius: 12px; padding: 12px 15px; font-size: .93rem; margin: 14px 0; line-height: 1.6; }

.parts-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr 40px; gap: 8px; margin-top: 8px; align-items: center; }
.parts-row input { padding: 10px; font-size: .92rem; }
.parts-row .del { background: var(--bg); border: 0; border-radius: 9px; font-size: 1rem; cursor: pointer; height: 42px; color: var(--muted); transition: all .15s; }
.parts-row .del:hover { background: var(--cancelled-b); color: var(--cancelled-t); }
@media (max-width: 640px) { .parts-row { grid-template-columns: 1fr 1fr; } }

.subtabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 4px; gap: 2px; margin-bottom: 20px; }
.subtabs button { background: none; border: 0; padding: 8px 18px; border-radius: 8px; font-size: .92rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .18s var(--ease); }
.subtabs button.on { background: var(--ink); color: #fff; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #F6F7FB 40%, #EDEFFB); }
.login-box { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 38px 32px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lift); animation: viewIn .5s var(--ease) both; }
.login-box .brand { font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.login-box .brand .dot { width: 13px; height: 13px; border-radius: 5px; background: var(--accent); }

.hdr .mobile-nav-toggle { display: none; }
@media (max-width: 760px) {
  .nav { position: fixed; left: 0; right: 0; top: 62px; background: var(--surface); border-bottom: 1px solid var(--line); height: auto; flex-direction: row; justify-content: space-around; box-shadow: var(--shadow); }
  .nav button { padding: 13px 8px; border-bottom-width: 2.5px; font-size: .9rem; flex: 1; }
  main { padding-top: 78px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---- operations dashboard ---- */
.pill.st-en_route { color: var(--en_route-t); background: var(--en_route-b); }
.ovlabel { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 26px 0 10px; }
.attn { background: #FFF6ED; border: 1px solid #F3D9B4; border-radius: var(--r); padding: 14px 16px; margin-top: 20px; }
.attn-head { font-weight: 700; font-size: .95rem; color: #92510A; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.attn-count { background: #E88C1F; color: #fff; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.attn-item { display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer; padding: 8px 6px; font-size: .93rem; font-weight: 600; color: #7A480E; border-radius: 8px; transition: background .15s; }
.attn-item:hover { background: #FBEBD6; }
.opsbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.op { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px; font-size: .82rem; font-weight: 600; color: var(--muted); box-shadow: var(--shadow); }
.op span { display: block; font-size: 1.45rem; font-weight: 800; color: var(--ink); margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.op.c-en span { color: var(--en_route-t); } .op.c-on span { color: var(--in_progress-t); }
.op.c-po span { color: var(--parts_ordered-t); } .op.c-done span { color: var(--complete-t); }
.schedrow { display: grid; grid-template-columns: 74px 110px 1fr auto; gap: 12px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .14s; font-size: .93rem; }
.schedrow:last-child { border-bottom: 0; }
.schedrow:hover { background: #FAFBFE; }
.schedrow .slot { font-weight: 700; font-variant-numeric: tabular-nums; }
.schedrow .tech { color: var(--muted); font-weight: 600; }
.schedrow .what b { font-weight: 600; }
@media (max-width: 640px) { .schedrow { grid-template-columns: 60px 1fr auto; } .schedrow .tech { display: none; } }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 820px) { .cols2, .cols3 { grid-template-columns: 1fr; } }
.klist > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.klist > div:last-child { border-bottom: 0; }
.klist span { color: var(--muted); font-weight: 500; }
.klist b { font-variant-numeric: tabular-nums; }
.rank { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); border-radius: 6px; font-size: .72rem; margin-right: 4px; }
.cbar { animation: barIn .5s var(--ease) both; transform-origin: bottom; }
@keyframes barIn { from { opacity: 0; transform: scaleY(.2); } to { opacity: 1; transform: none; } }
.cbar rect { transition: opacity .15s; }
.cbar:hover rect { opacity: .8; }
.chart-legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 10px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }
.lg.rev { background: #BFD0F2; } .lg.prof { background: var(--accent); }

/* ---- dispatch board pieces ---- */
.stat.hoverable { cursor: pointer; transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.stat.hoverable:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.btn.mini { padding: 7px 13px; font-size: .82rem; border-radius: 8px; }
.attn-row { display: flex; align-items: center; gap: 8px; }
.attn-row .attn-item { flex: 1; }
.datebar { display: inline-flex; gap: 6px; align-items: center; text-transform: none; letter-spacing: 0; }
.qacts { display: inline-flex; gap: 4px; }
.qa { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 8px; background: var(--bg); text-decoration: none; font-size: .85rem; transition: background .15s, transform .15s; }
.qa:hover { background: var(--accent-soft); transform: scale(1.08); }
.schedrow { grid-template-columns: 64px 100px 1fr auto auto; }
@media (max-width: 720px) { .schedrow { grid-template-columns: 56px 1fr auto; } .schedrow .tech, .schedrow .qacts { display: none; } }
.jobtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.jobtabs button { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 13px; font-size: .86rem; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: all .16s var(--ease); }
.jobtabs button:hover { color: var(--ink); }
.jobtabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.jobtabs .ct { background: var(--bg); color: var(--muted); border-radius: 999px; padding: 1px 8px; font-size: .74rem; font-weight: 700; }
.jobtabs button.on .ct { background: rgba(255,255,255,.18); color: #fff; }
.dsec { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; }
.dsec-t { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 8px; }
.dsec-t.bsec { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 22px; font-size: .8rem; color: var(--accent); }
.detail-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.tl-row { display: flex; gap: 10px; padding: 6px 0; font-size: .87rem; border-bottom: 1px dashed var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 110px; }
.note-row { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: .9rem; line-height: 1.55; }
.noteadd { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.noteadd input { flex: 1; }
.checkline { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: .92rem; cursor: pointer; }
.bfoot { display: flex; gap: 10px; margin-top: 22px; position: sticky; bottom: -26px; background: var(--surface); padding: 14px 0 4px; border-top: 1px solid var(--line); }
.techrow { padding: 14px 18px; }

/* ---- technician mobile-first ---- */
.upnext { border: 2px solid var(--accent); box-shadow: 0 6px 24px rgba(79,70,229,.12); }
.upnext .actions .btn { flex: 1; min-width: 130px; padding: 14px 12px; font-size: 1rem; }
.two-col-m { }
@media (max-width: 640px) {
  .two-col-m { grid-template-columns: 1fr 1fr !important; }
  .actions .btn { padding: 13px 14px; font-size: .98rem; }
}
.photostrip { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.photostrip img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.bell { position: relative; background: none; border: 0; font-size: 1.25rem; cursor: pointer; margin-left: auto; padding: 6px; }
.acct { margin-left: 6px; }
.bell + .acct { margin-left: 6px; }
.bellct { position: absolute; top: 0; right: 0; background: #DC2626; color: #fff; font-size: .62rem; font-weight: 700; border-radius: 999px; padding: 1px 5px; }
.bottomnav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line);
  display: flex; z-index: 80; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav button { flex: 1; background: none; border: 0; padding: 9px 4px 7px; font-size: 1.15rem; cursor: pointer; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bottomnav button span { font-size: .66rem; font-weight: 700; font-family: 'Inter'; }
.bottomnav button.on { color: var(--accent); }
@media (max-width: 760px) { main { padding-bottom: 130px; } .nav { display: none; } main { padding-top: 24px; } }

/* ---- financial summary hero ---- */
.finhero { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.fh { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 14px); padding: 18px 20px; }
.fh.accent { border: 1.5px solid var(--accent); box-shadow: 0 4px 18px rgba(79,70,229,.08); }
.fh-l { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.fh-v { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 2px; }
.fh-s { font-size: .8rem; color: var(--muted); }
.fh-s .neg { font-weight: 600; }
@media (max-width: 640px) { .finhero { grid-template-columns: 1fr 1fr; } .fh-v { font-size: 1.35rem; } }

/* ---- technician owe banner ---- */
.owebox { border-radius: var(--radius, 14px); padding: 22px 24px; margin-bottom: 16px; border: 2px solid var(--line); background: var(--surface); }
.owebox.red { border-color: #DC2626; background: #FEF2F2; }
.owebox.amber { border-color: #D97706; background: #FFFBEB; }
.owebox.green { border-color: #059669; background: #ECFDF5; }
.ob-l { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.owebox.red .ob-l { color: #B91C1C; } .owebox.amber .ob-l { color: #B45309; } .owebox.green .ob-l { color: #047857; }
.ob-v { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 6px; }
.owebox.red .ob-v { color: #B91C1C; } .owebox.green .ob-v { color: #047857; }
.ob-s { font-size: .9rem; color: var(--text, #14213D); opacity: .85; line-height: 1.5; }

/* ---- office job cards ---- */
.jc { padding: 16px 18px; }
.jc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.jc-title { font-weight: 700; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jc-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 0; }
.chip { font-size: .78rem; font-weight: 600; background: var(--bg, #F4F5FA); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px; color: var(--text, #14213D); white-space: nowrap; }
.chip-warn { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
.chip-good { background: #ECFDF5; border-color: #A7F3D0; color: #047857; }
.jc-prob { font-size: .86rem; color: var(--muted); margin-top: 9px; line-height: 1.5; }
.jc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

/* ---- bottom-left settings gear ---- */
.gearbtn { position: fixed; left: 18px; bottom: 18px; z-index: 70; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px;
  font-family: 'Inter'; font-weight: 700; font-size: .85rem; cursor: pointer; box-shadow: 0 4px 16px rgba(20,33,61,.1);
  transition: transform .15s, box-shadow .15s; }
.gearbtn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(20,33,61,.15); }
@media (max-width: 760px) { .gearbtn { bottom: 76px; } }

/* ---- svg icon polish ---- */
.ico { display: inline-flex; width: 13px; height: 13px; margin-right: 6px; color: var(--muted); vertical-align: -1px; }
.ico svg { width: 100%; height: 100%; }
.chip { display: inline-flex; align-items: center; }
.chip-warn .ico, .chip-good .ico { color: inherit; }
.qa svg { width: 15px; height: 15px; display: block; }
.qa { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; }

/* ---- recent completed jobs rows ---- */
.rjrow { display: flex; align-items: center; gap: 14px; padding: 13px 18px; cursor: pointer; transition: background .12s; }
.rjrow:hover { background: var(--bg, #F4F5FA); }
.rjrow + .rjrow { border-top: 1px solid var(--line); }
.rj-id { font-weight: 800; font-size: .82rem; color: var(--muted); min-width: 34px; }
.rj-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rj-name { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rj-name small { color: var(--muted); font-weight: 500; }
.rj-meta { font-size: .8rem; color: var(--muted); }
.rj-money { text-align: right; display: flex; flex-direction: column; line-height: 1.25; }
.rj-money b { font-size: 1rem; }
.rj-money small { font-size: .74rem; color: var(--muted); }

/* ---- pagination ---- */
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 18px 0 8px; flex-wrap: wrap; }
.pg { font-family: 'Inter'; font-weight: 700; font-size: .84rem; padding: 8px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: all .12s; }
.pg:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pg.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pg:disabled { opacity: .4; cursor: default; }
.pg-dots { color: var(--muted); padding: 0 2px; }

/* ---- brand mark ---- */
.brandmark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.brandmark svg { width: 22px; height: 22px; display: block; }
.login .brandmark { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 6px; }
.login .brandmark svg { width: 38px; height: 38px; }
.hdr .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; }

/* ---- branded split login ---- */
.loginpage { background: var(--bg, #F4F5FA); }
.login-split { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 44%) 1fr; }
.login-hero { background: linear-gradient(160deg, #0341D6 0%, #003BBD 45%, #002B8A 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 56px 60px; position: relative; overflow: hidden; }
.login-hero::after { content: ''; position: absolute; right: -140px; bottom: -140px; width: 420px; height: 420px;
  border-radius: 50%; background: rgba(255,255,255,.05); }
.login-hero::before { content: ''; position: absolute; right: -60px; top: -120px; width: 300px; height: 300px;
  border-radius: 50%; background: rgba(255,255,255,.05); }
.lh-mark { width: 64px; height: 64px; border-radius: 16px; background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; margin-bottom: 22px; }
.lh-mark svg { width: 44px; height: 44px; }
.lh-name { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.lh-tag { margin-top: 10px; font-size: 1.02rem; line-height: 1.55; opacity: .92; }
.lh-points { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.lh-points li { position: relative; padding-left: 26px; font-size: .92rem; opacity: .88; }
.lh-points li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 17px; height: 17px;
  border-radius: 50%; background: rgba(255,255,255,.18); font-size: .68rem; display: flex; align-items: center; justify-content: center; }
.lh-foot { position: absolute; bottom: 26px; left: 60px; font-size: .78rem; opacity: .55; letter-spacing: .06em; text-transform: uppercase; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-panel .login-box { width: 100%; max-width: 380px; }
.lp-h { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
@media (max-width: 820px) {
  .login-split { grid-template-columns: 1fr; }
  .login-hero { padding: 40px 28px 48px; min-height: auto; }
  .lh-points { display: none; } .lh-foot { display: none; }
}

/* ================= MOBILE POLISH ================= */
.bnic { display: block; width: 21px; height: 21px; }
.bnic svg { width: 100%; height: 100%; }
.bottomnav { padding-bottom: max(2px, env(safe-area-inset-bottom)); box-shadow: 0 -4px 18px rgba(20,33,61,.06); }
.bottomnav button { padding: 8px 4px 6px; gap: 3px; }

@media (max-width: 760px) {
  /* header: brand + bell + avatar only, comfy height */
  .hdr { padding: 10px 14px; }
  .hdr .brand { font-size: 1.02rem; }
  /* page paddings & headings */
  .view { padding: 0 2px; }
  .pagehead { flex-wrap: wrap; gap: 10px; }
  .pagehead h1 { font-size: 1.35rem; }
  .pagehead .btn { width: 100%; justify-content: center; }
  /* filter bars: clean stacked layout, full-width touch targets */
  .filters { gap: 8px; }
  .filters select, .filters input { flex: 1 1 calc(50% - 4px); min-width: 0; width: auto; font-size: 16px; padding: 11px 12px; }
  .filters input[id="fQ"], .filters input[id="tSearch"] { flex: 1 1 100%; }
  .filters .btn { flex: 1 1 100%; justify-content: center; }
  /* stat cards: 2-up, tighter */
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat .val { font-size: 1.25rem; }
  /* job cards */
  .jc { padding: 14px; }
  .jc-title { font-size: .96rem; }
  .chip { font-size: .74rem; padding: 4px 9px; }
  .jc .actions .btn { flex: 1 1 auto; justify-content: center; }
  /* modals: full-sheet feel, no iOS zoom on focus */
  /* full-sheet modal that GROWS with content — the overlay scrolls, nothing spills out */
  .overlay { padding: 0; align-items: stretch; }
  .modal { width: 100%; max-width: 100%; min-height: 100dvh; border-radius: 0; padding: 18px 16px 90px; }
  .bfoot { bottom: 0; margin-left: -16px; margin-right: -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 18px rgba(20,33,61,.08); }
  .modal input, .modal select, .modal textarea { font-size: 16px; }
  /* owe banner + finance hero */
  .owebox { padding: 16px 16px; } .ob-v { font-size: 1.6rem; }
  .fh { padding: 14px 16px; } 
  /* tables scroll with a visual hint */
  .tablewrap { -webkit-overflow-scrolling: touch; }
  .tablewrap table { min-width: 560px; }
  th, td { padding: 9px 10px; font-size: .84rem; }
  /* pager: bigger touch targets */
  .pg { padding: 10px 15px; }
  /* recent-jobs rows tighten */
  .rjrow { padding: 12px 14px; gap: 10px; }
  /* seg controls wrap instead of overflowing */
  .seg { flex-wrap: wrap; }
  .seg button { flex: 1 1 auto; min-width: 90px; }
  .datebar { flex-wrap: wrap; }
  /* subtabs (Financial) scroll horizontally in one row */
  .subtabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtabs button { white-space: nowrap; }
}
@media (max-width: 400px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .finhero { grid-template-columns: 1fr; }
}

@media (max-width: 760px) { .bottomnav { display: flex; } }

/* ================= MOBILE FINAL POLISH — every page ================= */
@media (max-width: 760px) {
  /* generic action rows: full-width tappable buttons everywhere (confirm cards, settings, modals) */
  .actions { gap: 8px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; text-align: center; min-height: 42px; }
  .detail-acts .btn, .detail-acts a.btn { flex: 1 1 auto; justify-content: center; }

  /* owner overview live-tech table: drop the two middle columns, keep name/status/balance */
  .resp-slim th:nth-child(3), .resp-slim td:nth-child(3),
  .resp-slim th:nth-child(4), .resp-slim td:nth-child(4) { display: none; }
  .resp-slim table { min-width: 0; }

  /* settings: account cards breathe, gear duplicate hidden (Settings lives in the dock) */
  .gearbtn { display: none; }

  /* ops bar + top lists compact */
  .opsbar { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .op { padding: 10px 6px; font-size: .72rem; }
  .op span { font-size: 1.15rem; }

  /* statement generation panel: stacked controls */
  .card .filters { flex-direction: row; }
  .card .filters label { flex: 0 0 auto; }

  /* klist rows: allow label wrap without squishing values */
  .klist > div { gap: 12px; }
  .klist > div span { flex: 1; min-width: 0; }
  .klist > div b { text-align: right; white-space: nowrap; }

  /* modal headings with pills wrap cleanly; close button never overlaps */
  .modal h2 { font-size: 1.12rem; line-height: 1.45; padding-right: 40px; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
  .modal .close { position: absolute; top: 12px; right: 12px; float: none; }
  .modal { position: relative; }

  /* estimate/parts editors: labeled 2-col grid stays usable */
  .parts-row input { font-size: 16px; }

  /* schedule date bar & chart-range buttons wrap as pills */
  .ovlabel { flex-wrap: wrap; row-gap: 8px; }

  /* notes / timeline text sizes */
  .tl-time { min-width: 88px; font-size: .78rem; }
  .note { font-size: .86rem; padding: 12px 14px; }

  /* empty states */
  .empty { padding: 28px 16px; font-size: .9rem; }

  /* photo strip scrolls horizontally */
  .photostrip { display: flex; overflow-x: auto; gap: 8px; -webkit-overflow-scrolling: touch; }
  .photostrip img { width: 96px; height: 96px; object-fit: cover; flex: none; border-radius: 10px; }
}
@media (max-width: 380px) {
  .hdr .brand { font-size: .95rem; }
  .stat .val { font-size: 1.12rem; }
  .opsbar { grid-template-columns: repeat(3, 1fr); }
}
