:root {
  --brand: #e23734; --brand-dark: #c0241f; --brand-soft: #fdeceb; --top: #ffffff;
  --ink: #1b2430; --muted: #5f6b7a; --line: #dde3ea; --bg: #f5f7fa; --card: #fff;
  --ok: #1e7a46; --ok-soft: #e5f4ec; --warn: #9a6200; --warn-soft: #fff4e0; --bad: #b42318; --bad-soft: #fdecea;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
a { color: var(--brand); text-decoration: none; }
h1, h2, .doc .co, .doc h1, .stat .n, .total-row { font-family: Oswald, 'Arial Narrow', Roboto, sans-serif; letter-spacing: .2px; }
h1 { font-size: 24px; font-weight: 600; margin: 0 0 4px; } h2 { font-size: 18px; font-weight: 500; margin: 0 0 12px; } h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; }

/* layout */
.topbar { height: 64px !important; position: sticky; top: 0; z-index: 20; background: var(--top); color: #111; border-bottom: 1px solid #e6e6e6; box-shadow: 0 1px 4px rgba(0,0,0,.05); display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 56px; }
.topbar .logo { font-weight: 600; font-size: 18px; color: #111; font-family: Oswald, Roboto, sans-serif; display: flex; align-items: center; gap: 8px; }
.topbar .logo img { height: 44px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { padding: 18px 12px; font-weight: 500; text-transform: uppercase; font-size: 14px; letter-spacing: .4px; }
.topbar nav a { color: #111; } .topbar nav a.active { color: var(--brand); background: transparent; box-shadow: inset 0 -3px 0 var(--brand); border-radius: 0; } .topbar nav a:hover { color: var(--brand); background: transparent; }
.topbar .btn { background: var(--brand); color: #fff; } .topbar .btn:hover { background: var(--brand-dark); }
main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 90px; }
.bottomnav { display: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.sticky { position: sticky; top: 80px; }

/* forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #c9d2dc; border-radius: 8px; padding: 9px 10px; min-height: 40px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input[type=checkbox] { width: auto; min-height: 0; }
textarea { min-height: 80px; }
.field { margin-bottom: 0; }
.hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); font-size: 14px; cursor: pointer; }
.btn { text-transform: uppercase; letter-spacing: .3px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 8px; padding: 9px 16px; min-height: 40px; cursor: pointer; background: var(--brand); color: #fff; }
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #fff; color: var(--brand); border-color: #b9c9de; } .btn.secondary:hover { background: var(--brand-soft); }
.btn.ghost { background: transparent; color: var(--brand); padding: 6px 8px; min-height: 0; }
.btn.danger { background: #fff; color: var(--bad); border-color: #f0c2bd; }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid #b9c9de; border-radius: 9px; overflow: hidden; }
.seg button { font: inherit; font-weight: 600; border: 0; background: #fff; color: var(--brand); padding: 8px 16px; cursor: pointer; }
.seg button.on { background: var(--brand); color: #fff; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* lists & badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef1f5; color: #3d4957; white-space: nowrap; }
.b-New-lead, .b-Intake { background: #eef1f5; } .b-Estimate-draft { background: #fff4e0; color: #8a5a00; } .b-Estimate-sent { background: #fdf0d9; color: #a36200; }
.b-Ready-to-book { background: #e8f0fa; color: var(--brand); } .b-Booked { background: #dbeafe; color: #1d4ed8; } .b-Done, .b-Closed { background: var(--ok-soft); color: var(--ok); }
.b-Postponed { background: #f1e9fb; color: #6b3fa0; } .b-Lost { background: var(--bad-soft); color: var(--bad); }
.list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.list a.item { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: center; padding: 13px 16px; border-top: 1px solid var(--line); color: var(--ink); }
.list a.item:first-child { border-top: 0; } .list a.item:hover { background: #fafbfd; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); }
.stat .n { font-size: 26px; font-weight: 700; } .stat .l { color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* estimate */
.day { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; background: #fcfdfe; }
.day-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.auto { font-size: 12px; color: var(--brand); font-weight: 600; }
.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines td { padding: 7px 0; border-bottom: 1px solid #eef1f4; vertical-align: top; }
.lines td.amt { text-align: right; white-space: nowrap; padding-left: 10px; }
.lines .desc { color: var(--muted); font-size: 12.5px; }
.total-row { display: flex; justify-content: space-between; font-size: 20px; font-weight: 700; padding: 12px 0 4px; }
.sub-row { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; }
.alert { border-radius: 8px; padding: 9px 12px; font-size: 13.5px; margin-bottom: 8px; }
.alert.bad { background: var(--bad-soft); color: var(--bad); } .alert.warn { background: var(--warn-soft); color: var(--warn); } .alert.ok { background: var(--ok-soft); color: var(--ok); } .alert.info { background: #eef3fa; color: #1f3b63; }
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th, .mini-table td { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.mini-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.mini-table input { min-height: 34px; padding: 6px 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: #1b2430; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 50; font-weight: 500; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.login { max-width: 360px; margin: 12vh auto; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* printable estimate */
.doc { background: #fff; max-width: 820px; margin: 0 auto; padding: 40px 44px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.doc .doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--brand); padding-bottom: 16px; margin-bottom: 18px; }
.doc .co { font-size: 20px; font-weight: 700; color: var(--brand); } .doc .doc-head img.doclogo { max-height: 110px; margin-bottom: 4px; }
.doc h1 { font-size: 24px; letter-spacing: .5px; }
.doc table.items { width: 100%; border-collapse: collapse; margin: 14px 0; }
.doc table.items th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--line); padding: 6px 4px; }
.doc table.items td { padding: 8px 4px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
.doc .totals { margin-left: auto; width: 400px; } .doc .totals .total-row span { white-space: nowrap; }
.doc .legal { font-size: 12.5px; color: #3d4957; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 12px; }
.no-print {}

@media print {
  body { background: #fff; } .topbar, .bottomnav, .no-print { display: none !important; }
  main { padding: 0; max-width: none; } .doc { border: 0; padding: 0; max-width: none; }
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; } .sticky { position: static; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .topbar nav, .topbar .btn, .topbar .logo span { display: none; }
  .topbar { padding: 0 14px; }
  main { padding: 14px 12px 96px; }
  .g2 { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .list a.item { grid-template-columns: 1fr auto; } .list a.item .jn { display: none; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { flex: 1; text-align: center; padding: 9px 0 10px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
  .bottomnav a .ic { display: block; font-size: 19px; line-height: 1.2; }
  .bottomnav a.active { color: var(--brand); }
  .doc { padding: 20px 16px; } .doc .doc-head { flex-direction: column; } .doc .totals { width: 100%; }
  h1 { font-size: 20px; }
}

.sigpad { width: 100%; height: 180px; border: 1px dashed #9aa6b2; border-radius: 8px; background: #fff; touch-action: none; display: block; }

/* ---------- crew app + bill of lading */
.crew-main { max-width: 720px; margin: 0 auto; padding: 14px 14px 96px; }
.bottomnav.crewtabs { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.crewtabs a { flex: 1; text-align: center; padding: 9px 0 10px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.crewtabs a .ic { display: block; font-size: 19px; line-height: 1.2; }
.crewtabs a.active { color: var(--brand); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid #eef1f4; }
.kv > span:first-child { color: var(--muted); font-size: 13px; }
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photogrid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.sigbox { height: 70px; border-bottom: 1px solid #333; display: flex; align-items: flex-end; }
.sigbox img { max-height: 66px; max-width: 100%; }
.bol h3.bolh { background: #f1f3f5; padding: 6px 10px; margin: 18px 0 8px; font-size: 15px; }
details summary { cursor: pointer; padding: 6px 0; }
details .legal { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-top: 6px; }
@media print { .crew-main { padding: 0; max-width: none; } .bol .legal { max-height: none; overflow: visible; border: 0; } }
@media (max-width: 640px) { .topbar.crewbar .btn { display: inline-flex; } }
.stop { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eef1f4; }
.stopnum { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
details.person { border-top: 1px solid #eef1f4; padding: 6px 0; }
details.person summary { display: flex; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; }
details.person summary::-webkit-details-marker { display: none; }

/* address suggestions dropdown */
.addrsug { position: absolute; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden; }
.addrsug button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #f0f0f0; padding: 10px 12px; font: inherit; font-size: 14px; cursor: pointer; color: inherit; }
.addrsug button:hover, .addrsug button.on { background: #fff1f0; }
.addrsug .powered { font-size: 11px; color: var(--muted); text-align: right; padding: 4px 10px; }

/* Google Voice texting helper */
.gvwrap { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.gvcard { background: #fff; border-radius: 12px; padding: 18px; width: 100%; max-width: 520px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }

/* Activity tab */
.actrow { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef1f4; }
.actrow:last-child { border-bottom: 0; }
.showphone { display: none; }
@media (max-width: 640px) { .showphone { display: inline-flex; } }

/* dashboard job calendar */
.calhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.caldow { font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbfc; }
.calday { min-height: 96px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.calday.other { background: #fafbfc; } .calday.other .caldate { color: #b5bcc6; }
.calday.today .caldate { background: var(--brand); color: #fff; border-radius: 999px; width: 22px; text-align: center; }
.caldate { font-size: 12px; font-weight: 600; margin-bottom: 3px; width: 22px; line-height: 22px; }
.calchip { display: block; font-size: 12px; line-height: 1.3; padding: 2px 6px; margin-bottom: 3px; border-radius: 5px; background: var(--c); color: #1f2933; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.calchip:hover { filter: brightness(.95); }
.calchip.tent { background: #fff; border: 1.5px dashed var(--c); }
.calmore summary { font-size: 11px; color: var(--muted); cursor: pointer; list-style: none; }
.calagenda { display: none; }
.callegend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.callegend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.callegend i.tent { border: 1.5px dashed #999; background: #fff; }
@media (max-width: 640px) {
  .calgrid { display: none; } .calagenda { display: block; }
  .agday { font-size: 13px; font-weight: 600; margin: 10px 0 4px; } .agday.today { color: var(--brand); }
  .calagenda .calchip { font-size: 14px; padding: 8px 10px; white-space: normal; }
}

.capbadge { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; border-radius: 999px; background: #eef1f5; color: #3d4957; margin-left: 4px; vertical-align: 1px; }
.capbadge.over { background: #fde2e1; color: #b42318; }
.calday .caldate { display: inline-block; }

/* Day view (teams) */
.dvseg { margin-bottom: 10px; }
.dvtop { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dvstats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dvstats > div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-width: 130px; }
.dvstats > div > span:not(.dvring) { display: block; font-size: 12px; color: var(--muted); }
.dvstats > div.bad { border-color: #f4b4b0; background: #fff4f3; color: #b42318; }
.dvring { display: inline-block; font-weight: 700; border: 2px solid #9aa5b1; border-radius: 999px; padding: 1px 10px; font-size: 15px; }
.dvring.short { border-color: #e23734; color: #b42318; }
.dvnotes { margin-bottom: 10px; } .dvnotes textarea { margin-top: 6px; }
.dvwrap { overflow-x: auto; }
.dvgrid { display: grid; position: relative; }
.dvcorner, .dvhead { position: sticky; top: 0; background: #fff; z-index: 2; border-bottom: 1px solid var(--line); padding: 6px 8px; min-height: 70px; }
.dvhead { text-align: center; border-left: 1px solid var(--line); }
.dvhead.un { background: #fafbfc; } .dvhead.add { display: flex; align-items: center; justify-content: center; }
.dvmembers { margin: 4px 0; min-height: 26px; }
.dvtimes { position: relative; font-size: 11px; color: var(--muted); }
.dvtimes div { position: absolute; right: 6px; transform: translateY(-6px); }
.dvcol { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(to bottom, #eef1f4 1px, transparent 1px); }
.dvcol.un { background-color: #fafbfc; }
.dvnow { position: absolute; left: 0; right: 0; height: 2px; background: #3b82f6; z-index: 1; }
.dvjob { position: absolute; left: 4px; right: 4px; background: var(--c); border-radius: 6px; padding: 6px 8px; font-size: 12px; line-height: 1.35; overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); color: #1f2933; }
.dvjob:hover, .dvjob:focus { outline: 2px solid #1f2933; outline-offset: -1px; }
.dvjob.tent { background: #fff; border: 2px dashed var(--c); }
.dvjob.conflict { box-shadow: 0 0 0 2px #e23734; }
.dvjob .dvt { font-size: 13px; }
.dvfoot { position: absolute; left: 8px; right: 8px; bottom: 5px; display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.dvtruck { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; } .dvtruck.need, .dvwarn { color: #b42318; font-weight: 600; }
.dvav { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 999px; background: #1f2933; color: #fff; font-size: 10px; font-weight: 700; margin-left: 3px; border: 2px solid #fff; }
.dvav i { position: absolute; top: -6px; right: -6px; font-style: normal; font-size: 9px; background: #3b82f6; color: #fff; border-radius: 999px; width: 14px; height: 14px; line-height: 14px; text-align: center; }
.dvav.need { background: #fff; color: #b42318; border: 2px dashed #e23734; }
.dvcard { max-width: 460px; max-height: 88vh; overflow-y: auto; }
.dvch { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin: -18px -18px 12px; padding: 14px 18px; background: var(--c, #eef1f5); border-radius: 12px 12px 0 0; }
.dvlist { display: none; }
@media (max-width: 640px) {
  .dvwrap { display: none; } .dvlist { display: block; }
  .dvlteam { margin-bottom: 14px; } .dvlhead { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
  .dvlist .dvjob { position: relative; left: 0; right: 0; min-height: 96px; padding-bottom: 36px; margin-bottom: 8px; }
  .dvstats > div { min-width: 0; flex: 1 1 40%; }
}

/* customer pay page */
.paymain { max-width: 520px; margin: 0 auto; padding: 24px 16px 60px; }
.payhead { display: flex; align-items: center; gap: 12px; } .paylogo { height: 48px; } .payhead .co { font-weight: 700; }
.payamt { font-size: 36px; font-weight: 700; margin: 10px 0 14px; }
.paytabs { margin: 6px 0 4px; }

.crewtime{font-weight:700;margin:2px 0}
