/* BYU Drainage – booking + Bobby's app. Brand: navy #0E2A47, yellow #FFC72C, sky #20AFFD, stone #F4F1EA */
:root{
  --navy:#0E2A47;--navy2:#163A5F;--yellow:#FFC72C;--yellow2:#FFE08A;--sky:#20AFFD;--skyBg:#DDF2FF;
  --bg:#F4F1EA;--surface:#FFFFFF;--surface2:#F7F8FA;--ink:#0E2A47;--muted:#5B6B7E;--line:#E4E7EC;
  --ok:#17803D;--okBg:#E3F5E8;--warn:#8A5A00;--warnBg:#FFF3D1;--bad:#B42318;--badBg:#FDE8E7;--info:#0B5F8F;--infoBg:#E3F4FF;
  --shadow:0 1px 2px rgba(14,42,71,.06),0 8px 24px rgba(14,42,71,.08);--shadow2:0 12px 40px rgba(14,42,71,.18);
  --display:'Archivo Black','Arial Black',Arial,sans-serif;--body:'Archivo',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;
  --r:20px;--r2:14px;--nav:70px;--safeB:env(safe-area-inset-bottom,0px);
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#07172A;--surface:#0F243D;--surface2:#13304F;--ink:#EEF3F8;--muted:#A3B3C6;--line:#21405F;--skyBg:#0E3552;
  --ok:#7FD69A;--okBg:#123826;--warn:#FFD98A;--warnBg:#3A2E10;--bad:#FF9A8F;--badBg:#3D1A1A;--info:#8FD6FF;--infoBg:#0F3350;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.25);color-scheme:dark}}
:root[data-theme="dark"]{--bg:#07172A;--surface:#0F243D;--surface2:#13304F;--ink:#EEF3F8;--muted:#A3B3C6;--line:#21405F;--skyBg:#0E3552;--ok:#7FD69A;--okBg:#123826;--warn:#FFD98A;--warnBg:#3A2E10;--bad:#FF9A8F;--badBg:#3D1A1A;--info:#8FD6FF;--infoBg:#0F3350;color-scheme:dark}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
html,body{margin:0;min-height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--body);font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased}
h1,h2,h3{margin:0;line-height:1.12;text-wrap:balance}
h1{font-family:var(--display);font-weight:400;font-size:clamp(1.55rem,6vw,2rem);letter-spacing:-.01em}
h2{font-family:var(--display);font-weight:400;font-size:1.2rem}
h3{font-weight:800;font-size:1.02rem}
p{margin:0}
a{color:inherit}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:3px solid var(--sky);outline-offset:2px}
.muted{color:var(--muted)}.small{font-size:13px}.num{font-variant-numeric:tabular-nums}.b{font-weight:800}
.ico{width:22px;height:22px;flex:none;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ico.s{width:18px;height:18px}.ico.l{width:28px;height:28px}
.testbar{background:var(--yellow);color:var(--navy);font-size:12px;font-weight:700;text-align:center;padding:4px 12px}

/* staff shell */
.shell{display:flex;min-height:100vh}
.side{display:none}
.mainwrap{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:10px;padding:10px 16px;background:color-mix(in srgb,var(--bg) 90%,transparent);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.topbar .t{flex:1;min-width:0;font-weight:800;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar img{width:34px;height:34px;border-radius:10px}
.iconbtn{position:relative;display:grid;place-items:center;width:42px;height:42px;border-radius:14px;border:0;background:var(--surface);color:var(--ink);box-shadow:var(--shadow);text-decoration:none;flex:none}
.dot{position:absolute;top:-4px;right:-4px;min-width:19px;height:19px;padding:0 5px;border-radius:999px;background:var(--yellow);color:var(--navy);font-size:11px;font-weight:800;display:grid;place-items:center;border:2px solid var(--bg)}
main.page{flex:1;width:100%;max-width:720px;margin:0 auto;padding:4px 16px calc(var(--nav) + 28px + var(--safeB));display:flex;flex-direction:column;gap:14px}
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:30;display:flex;background:var(--navy);padding:6px 6px calc(6px + var(--safeB));box-shadow:0 -6px 24px rgba(14,42,71,.18)}
.tabs a{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:7px 2px;border-radius:14px;color:#C9D6E4;text-decoration:none;font-size:11.5px;font-weight:700;position:relative}
.tabs a.on{color:var(--navy);background:var(--yellow)}
.tabs a .dot{top:0;right:calc(50% - 22px)}
@media (min-width:960px){
  .side{display:flex;flex-direction:column;gap:4px;width:236px;flex:none;background:var(--navy);color:#fff;padding:18px 12px;position:sticky;top:0;height:100vh}
  .side .brand{display:flex;align-items:center;gap:10px;padding:4px 8px 18px;font-weight:800;line-height:1.15}
  .side .brand img{width:40px;height:40px;border-radius:12px}
  .side a{display:flex;align-items:center;gap:12px;padding:11px 12px;border-radius:12px;color:#C9D6E4;text-decoration:none;font-weight:700;position:relative}
  .side a.on{background:var(--yellow);color:var(--navy)}
  .side a .dot{position:static;margin-left:auto;border:0}
  .side .who{margin-top:auto;font-size:13px;color:#A9BBD0;padding:8px}
  .tabs{display:none}
  main.page{padding-bottom:40px;max-width:980px}
  .topbar .logo{display:none}
}

/* surfaces */
.card{background:var(--surface);border-radius:var(--r);box-shadow:var(--shadow);padding:16px;display:flex;flex-direction:column;gap:10px}
.card.flat{box-shadow:none;border:1px solid var(--line)}
.card.hero{background:radial-gradient(900px 300px at 100% 0,#1d4a77 0,var(--navy) 60%);color:#fff}
.card.hero .muted{color:#BFD0E2}
.card.y{background:var(--yellow);color:var(--navy)}
.card.warn{background:var(--warnBg);color:var(--warn);box-shadow:none}
.card.info{background:var(--infoBg);color:var(--info);box-shadow:none}
.card.okc{background:var(--okBg);color:var(--ok);box-shadow:none}
.row{display:flex;align-items:center;gap:10px}
.row.top{align-items:flex-start}
.row.wrap{flex-wrap:wrap}
.grow{flex:1;min-width:0}
.between{justify-content:space-between}
.stack{display:flex;flex-direction:column;gap:10px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.cols{display:grid;gap:14px}
@media (min-width:960px){.cols{grid-template-columns:1.25fr 1fr;align-items:start}}
.sechead{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-top:6px}
.sechead a{font-size:13px;font-weight:700;color:var(--info);text-decoration:none}
hr.sep{border:0;border-top:1px solid var(--line);margin:2px 0}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 18px;border-radius:14px;border:0;background:var(--navy);color:#fff;font-weight:800;text-decoration:none;text-align:center;line-height:1.15}
.btn.y{background:var(--yellow);color:var(--navy)}
.btn.ghost{background:var(--surface2);color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--line)}
.btn.okb{background:var(--ok);color:#fff}
.btn.badb{background:var(--badBg);color:var(--bad)}
.btn.full{width:100%}
.btn.big{min-height:58px;font-size:17px;border-radius:16px}
.btn.sm{min-height:38px;padding:0 12px;font-size:14px;border-radius:11px}
.btn[disabled]{opacity:.5;pointer-events:none}
.btns{display:flex;gap:8px;flex-wrap:wrap}
.btns>.btn{flex:1 1 140px}
.link{background:none;border:0;padding:0;color:var(--info);font-weight:700;text-decoration:underline;text-underline-offset:2px}

/* chips */
.chip{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:800;background:var(--surface2);color:var(--muted);white-space:nowrap}
.chip.requested,.chip.quote_ok{background:var(--warnBg);color:var(--warn)}
.chip.quote_check{background:#F1E6FF;color:#5B2A9E}
.chip.quoted{background:var(--infoBg);color:var(--info)}
.chip.booked{background:var(--skyBg);color:var(--navy)}
.chip.on_way,.chip.onsite{background:var(--yellow);color:var(--navy)}
.chip.completed{background:var(--badBg);color:var(--bad)}
.chip.paid{background:var(--okBg);color:var(--ok)}
.chip.cancelled{background:var(--surface2);color:var(--muted);text-decoration:line-through}
.chip.em{background:var(--bad);color:#fff}
@media (prefers-color-scheme:dark){.chip.quote_check{background:#2E1D4A;color:#D7BFFF}}
.filters{display:flex;gap:8px;overflow-x:auto;padding:2px 0 4px;scrollbar-width:none}
.filters::-webkit-scrollbar{display:none}
.filters button{flex:none;border:0;padding:8px 14px;border-radius:999px;background:var(--surface);box-shadow:var(--shadow);font-weight:700;font-size:14px}
.filters button.on{background:var(--navy);color:#fff}

/* lists */
.list{display:flex;flex-direction:column;background:var(--surface);border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden}
.item{display:flex;align-items:center;gap:12px;padding:13px 14px;text-decoration:none;color:inherit;border-bottom:1px solid var(--line);background:none;border-left:0;border-right:0;border-top:0;text-align:left;width:100%}
.item:last-child{border-bottom:0}
.item .time{width:56px;flex:none;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.1}
.item .time small{display:block;font-weight:600;color:var(--muted);font-size:11.5px}
.item .t1{font-weight:800}
.item .t2{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item.unseen{background:var(--infoBg)}
.badge{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--skyBg);color:var(--navy);flex:none}
.empty{padding:22px;text-align:center;color:var(--muted)}

/* next-job hero */
.next .addr{font-size:19px;font-weight:800;line-height:1.2}
.next .btns .btn{flex:1 1 90px;min-height:54px;flex-direction:column;gap:2px;font-size:13px}
.next .btn.ghost{background:rgba(255,255,255,.12);color:#fff;box-shadow:none}

/* day strip */
.days{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.days button{border:0;border-radius:14px;background:var(--surface);box-shadow:var(--shadow);padding:8px 0;display:flex;flex-direction:column;align-items:center;gap:1px;font-size:11.5px;font-weight:700;color:var(--muted);position:relative}
.days button b{font-size:18px;color:var(--ink)}
.days button.on{background:var(--navy);color:#C9D6E4}.days button.on b{color:#fff}
.days button.today{box-shadow:inset 0 0 0 2px var(--yellow),var(--shadow)}
.days button i{position:absolute;bottom:4px;width:5px;height:5px;border-radius:50%;background:var(--sky)}
.week{display:none}
@media (min-width:960px){
  .week{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}
  .week .col{background:var(--surface);border-radius:16px;box-shadow:var(--shadow);padding:8px;min-height:180px;display:flex;flex-direction:column;gap:6px}
  .week .col.today{box-shadow:inset 0 0 0 2px var(--yellow),var(--shadow)}
  .week .col h4{margin:0 0 4px;font-size:13px}
  .week .ev{display:block;text-decoration:none;color:inherit;border-radius:10px;padding:6px 8px;background:var(--skyBg);font-size:12.5px;line-height:1.25}
  .week .ev.quote_check,.week .ev.quote_ok,.week .ev.quoted{background:var(--warnBg)}
  .week .ev.completed{background:var(--badBg)}.week .ev.paid{background:var(--okBg)}
  .daylist{display:none}
}

/* key-value */
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;font-size:14px}
.kv dt{color:var(--muted)}.kv dd{margin:0;font-weight:600;overflow-wrap:anywhere}

/* forms */
label.f{display:flex;flex-direction:column;gap:6px;font-weight:700;font-size:14px}
label.f small{font-weight:500;color:var(--muted)}
input.in,select.in,textarea.in{width:100%;padding:13px 14px;border-radius:13px;border:1.5px solid var(--line);background:var(--surface);font-size:16px}
textarea.in{min-height:96px;resize:vertical}
input.in:focus,select.in:focus,textarea.in:focus{border-color:var(--sky);outline:0;box-shadow:0 0 0 3px color-mix(in srgb,var(--sky) 25%,transparent)}
.check{display:flex;gap:10px;align-items:flex-start;font-size:14px}
.check input{width:22px;height:22px;flex:none;margin-top:1px;accent-color:var(--navy)}
.err{background:var(--badBg);color:var(--bad);border-radius:12px;padding:10px 12px;font-weight:700;font-size:14px}
.seg{display:flex;background:var(--surface2);border-radius:13px;padding:4px;gap:4px;box-shadow:inset 0 0 0 1.5px var(--line)}
.seg button{flex:1;border:0;background:none;border-radius:10px;padding:9px 6px;font-weight:700;font-size:14px;color:var(--muted)}
.seg button.on{background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}

/* tiles (customer) */
.tiles{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tile{border:0;background:var(--surface);box-shadow:var(--shadow);border-radius:18px;padding:14px;text-align:left;display:flex;flex-direction:column;gap:8px;min-height:118px;position:relative}
.tile .ic{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;background:var(--skyBg);color:var(--navy)}
.tile b{font-size:14.5px;line-height:1.2}
.tile span{font-size:12.5px;color:var(--muted);line-height:1.3}
.tile.on{box-shadow:inset 0 0 0 3px var(--navy),var(--shadow)}
.tile.on .ic{background:var(--yellow)}
.opt{display:flex;gap:12px;align-items:center;border:0;background:var(--surface);box-shadow:var(--shadow);border-radius:16px;padding:14px;text-align:left;width:100%}
.opt.on{box-shadow:inset 0 0 0 3px var(--navy),var(--shadow)}
.opt .rad{width:22px;height:22px;border-radius:50%;border:2px solid var(--line);flex:none}
.opt.on .rad{border:7px solid var(--navy)}

/* photos */
.gal{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:8px}
.gal .ph{position:relative;aspect-ratio:1;border-radius:12px;overflow:hidden;background:var(--surface2)}
.gal img{width:100%;height:100%;object-fit:cover;display:block}
.gal .ph span{position:absolute;left:4px;bottom:4px;background:rgba(14,42,71,.8);color:#fff;font-size:10.5px;font-weight:800;padding:2px 6px;border-radius:6px;text-transform:capitalize}
.gal .ph button{position:absolute;top:4px;right:4px;border:0;width:24px;height:24px;border-radius:50%;background:rgba(14,42,71,.8);color:#fff;font-weight:800;line-height:1}
.addph{aspect-ratio:1;border-radius:12px;border:2px dashed var(--line);display:grid;place-items:center;text-align:center;font-size:12px;font-weight:700;color:var(--muted);cursor:pointer;background:var(--surface)}
.addph input{display:none}

/* steps */
.steps{display:flex;flex-direction:column;gap:0}
.step{display:flex;gap:12px;align-items:flex-start;padding:6px 0;position:relative}
.step .d{width:26px;height:26px;border-radius:50%;flex:none;display:grid;place-items:center;background:var(--surface2);color:var(--muted);font-size:13px;font-weight:800;z-index:1;box-shadow:inset 0 0 0 2px var(--line)}
.step.done .d{background:var(--ok);color:#fff;box-shadow:none}
.step.now .d{background:var(--yellow);color:var(--navy);box-shadow:none}
.step:not(:last-child)::after{content:'';position:absolute;left:12px;top:30px;bottom:-6px;width:2px;background:var(--line)}
.step.done:not(:last-child)::after{background:var(--ok)}
.step p{font-weight:700;padding-top:3px}.step small{display:block;color:var(--muted);font-weight:500}

/* quote table */
.qt{width:100%;border-collapse:collapse;font-size:14px}
.qt td{padding:8px 4px;border-bottom:1px solid var(--line);vertical-align:top}
.qt td:last-child{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.qt tr.tot td{border:0;font-weight:800;font-size:17px;padding-top:10px}
.qline{display:grid;grid-template-columns:1fr 56px 86px 30px;gap:6px;align-items:center}
.qline input{padding:10px;font-size:15px}
.qline button{border:0;background:none;color:var(--bad);font-size:20px;font-weight:800}

/* timeline */
.tl{display:flex;flex-direction:column;gap:8px;font-size:13.5px}
.tl div{display:flex;gap:10px}.tl time{color:var(--muted);width:92px;flex:none;font-variant-numeric:tabular-nums}

/* signature */
.sigpad{width:100%;height:180px;border-radius:14px;background:#fff;border:1.5px dashed var(--line);touch-action:none;display:block}

/* sheet / modal */
.modal{position:fixed;inset:0;z-index:60;background:rgba(7,23,42,.55);display:flex;align-items:flex-end;justify-content:center}
.modal .sheet{background:var(--bg);width:100%;max-width:640px;max-height:92vh;overflow:auto;border-radius:24px 24px 0 0;padding:18px 16px calc(18px + var(--safeB));display:flex;flex-direction:column;gap:12px}
@media (min-width:700px){.modal{align-items:center}.modal .sheet{border-radius:24px}}
.toast{position:fixed;left:50%;bottom:calc(var(--nav) + 18px + var(--safeB));transform:translateX(-50%);z-index:80;background:var(--navy);color:#fff;padding:12px 18px;border-radius:14px;font-weight:700;box-shadow:var(--shadow2);max-width:calc(100% - 32px)}
@media (min-width:960px){.toast{bottom:24px}}
.pill{display:inline-flex;align-items:center;gap:6px;background:var(--warnBg);color:var(--warn);padding:6px 12px;border-radius:999px;font-weight:800;font-size:13px}

/* customer pages */
.cpage{max-width:620px;margin:0 auto;padding:0 16px 48px;display:flex;flex-direction:column;gap:16px}
.chead{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0 4px}
.chead img{height:44px;max-width:62%;object-fit:contain}
.chead a{font-weight:800;text-decoration:none;display:flex;align-items:center;gap:6px;background:var(--surface);padding:9px 12px;border-radius:12px;box-shadow:var(--shadow);font-size:14px}
.chero{background:radial-gradient(900px 300px at 100% 0,#1d4a77 0,var(--navy) 60%);color:#fff;border-radius:24px;padding:22px 20px;display:flex;flex-direction:column;gap:8px}
.chero p{color:#C9D6E4}
.ticks{display:flex;flex-direction:column;gap:6px;margin-top:4px;font-size:14px;font-weight:600}
.ticks span{display:flex;gap:8px;align-items:center}
.ticks .ico{color:var(--yellow)}
.qnum{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--yellow);color:var(--navy);font-weight:800;font-size:13px;flex:none}
.cfoot{text-align:center;font-size:12px;color:var(--muted);line-height:1.5}
@media (max-width:380px){.tiles{grid-template-columns:1fr}}
@media (max-width:520px){.qline{grid-template-columns:64px 1fr 30px;padding-bottom:8px;border-bottom:1px solid var(--line)}.qline input[data-k=d]{grid-column:1/-1}.qhead{display:none!important}}
