/* CROSS PSA Office */
:root {
  --navy: #0e1e36; --navy-2: #16294a; --navy-3: #1f3a66; --paper: #f6f7f9; --bg: #eef1f5; --ink: #111a2b; --muted: #5d6879; --faint: #98a2b3;
  --line: #dde2e9; --line-2: #eef1f5; --caution: #f3c623; --done: #1fa97a; --blue: #2563eb; --red: #b42318; --amber: #b26b00;
  --display: 'Archivo', 'Segoe UI', Arial, sans-serif; --body: 'Public Sans', 'Segoe UI', Arial, sans-serif;
  --shadow: 0 14px 40px rgba(14,30,54,.14);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.5 var(--body); -webkit-font-smoothing: antialiased; overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
img { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 3px solid var(--caution); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .num { text-align: right; } .red { color: var(--red) !important; } .grow { flex: 1; }
.pre { white-space: pre-wrap; }
.opt { color: var(--muted); font-weight: 500; font-size: .8rem; }
kbd { font: 700 .72rem var(--body); background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--muted); }
::-webkit-scrollbar { width: 11px; height: 11px; } ::-webkit-scrollbar-thumb { background: #c6cdd8; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; } ::-webkit-scrollbar-thumb:hover { background-color: #9aa5b5; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; font: 700 .9rem/1 var(--body); padding: .78em 1.1em; border-radius: 9px; border: 2px solid transparent; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.sm { padding: .58em .85em; font-size: .84rem; }
.btn.big { width: 100%; padding: 1em; font-size: 1rem; }
.btn-navy { background: var(--navy); color: #fff; } .btn-navy:hover:not(:disabled) { background: var(--navy-3); }
.btn-caution { background: var(--caution); color: var(--navy); } .btn-caution:hover { background: #ffd43b; }
.btn-outline { border-color: var(--line); color: var(--navy); background: #fff; } .btn-outline:hover:not(:disabled) { border-color: var(--navy); }
.btn-green { background: var(--done); color: #fff; } .btn-green:hover { background: #179065; }
.btn-red { background: var(--red); color: #fff; } .btn-red:hover { background: #962015; }
.btn-red-ghost { background: #fff; color: var(--red); border-color: #f2c7c2; } .btn-red-ghost:hover { background: #fdf0ee; }
.ghost-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; font: 800 1rem var(--body); flex: none; }
.ghost-btn.xs { width: 28px; height: 28px; border-radius: 7px; } .ghost-btn.xs svg { width: 14px; height: 14px; }
.ghost-btn:hover:not(:disabled) { border-color: var(--navy); } .ghost-btn:disabled { opacity: .35; }
.ghost-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkish { background: none; border: 0; padding: 0; font: 600 .86rem var(--body); color: var(--blue); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.linkish:hover { text-decoration: underline; }

/* ---------- Sign-in ---------- */
.gate { height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--navy); overflow: auto; }
.gate.solo { grid-template-columns: 1fr; place-items: center; background: radial-gradient(1200px 600px at 20% 0%, #1d3560 0%, var(--navy) 60%); padding: 24px; }
.gate-art { position: relative; overflow: hidden; display: grid; align-items: center; padding: 60px; color: #fff;
  background: radial-gradient(70% 60% at 80% 10%, #24497d 0%, transparent 60%), radial-gradient(60% 50% at 0% 100%, #0f4a4a 0%, transparent 60%), var(--navy); }
.gate-art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 34px 34px; mask-image: radial-gradient(80% 70% at 40% 40%, #000, transparent); }
.art-copy { position: relative; max-width: 520px; }
.art-copy .kick { font: 800 .78rem var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--caution); }
.art-copy h2 { font: 800 clamp(2rem, 3.4vw, 3.1rem)/1.05 var(--display); margin: 14px 0 24px; letter-spacing: -.02em; }
.art-copy h2 em { font-style: normal; color: #22c39a; }
.art-copy ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: rgba(255,255,255,.82); font-weight: 600; }
.art-copy li::before { content: "✓"; color: #22c39a; font-weight: 800; margin-right: 10px; }
.gate > .gate-card { align-self: center; justify-self: center; margin: 24px; }
.gate-card { width: min(420px, 100%); background: #fff; border-radius: 16px; padding: 34px 32px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.gate-brand img { width: 46px; height: 46px; border-radius: 10px; }
.gate-brand b { display: block; font: 800 1.15rem var(--display); letter-spacing: .04em; }
.gate-brand span { color: var(--amber); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.gate h1 { font-size: 1.5rem; margin-bottom: 4px; }
.gate .sub { color: var(--muted); margin: 0 0 20px; }
.gate .foot { margin: 18px 0 0; color: var(--muted); font-size: .82rem; text-align: center; }
.fields { display: grid; gap: 14px; }
.loader { display: grid; place-items: center; gap: 16px; color: rgba(255,255,255,.8); font-weight: 600; }
.loader img { width: 64px; height: 64px; border-radius: 14px; background: #fff; padding: 6px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- Shell ---------- */
.shell { height: 100%; display: grid; grid-template-columns: 236px 1fr; }
.side { background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 20px 14px; overflow: auto; }
.side .brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 22px; min-width: 0; }
.side .brand img { width: 38px; height: 38px; border-radius: 9px; background: #fff; padding: 3px; object-fit: contain; flex: none; }
.side .brand b { display: block; font: 800 .98rem/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.side .brand span { font-size: .72rem; color: var(--caution); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav { display: grid; gap: 3px; }
.nav button { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: 0; color: rgba(255,255,255,.72); font: 600 .93rem var(--body); padding: 10px 12px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; }
.nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav button[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--caution); }
.nav kbd { margin-left: auto; background: transparent; border-color: rgba(255,255,255,.18); color: rgba(255,255,255,.4); font-size: .66rem; padding: 0 5px; }
.nav .badge + kbd { margin-left: 6px; }
.badge { margin-left: auto; background: #f04438; color: #fff; font: 800 .72rem var(--body); min-width: 20px; height: 20px; border-radius: 999px; display: inline-grid; place-items: center; padding: 0 6px; }
.side-plan { margin: 18px 8px 0; padding: 12px; border-radius: 10px; background: rgba(255,255,255,.06); font-size: .8rem; color: rgba(255,255,255,.65); }
.side-plan:empty { display: none; }
.side-plan b { display: block; color: #fff; font-size: .86rem; margin: 2px 0 8px; }
.side-plan .t { height: 5px; background: rgba(255,255,255,.12); border-radius: 99px; overflow: hidden; } .side-plan .t i { display: block; height: 100%; background: var(--caution); border-radius: 99px; }
.side .me { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 16px 8px 0; font-size: .82rem; color: rgba(255,255,255,.6); display: grid; gap: 10px; }
.side .me b { color: #fff; display: block; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; }
.side .me button { background: transparent; border: 1.5px solid rgba(255,255,255,.28); color: #fff; font: 600 .84rem var(--body); padding: .55em .8em; border-radius: 8px; cursor: pointer; }
.side .me button:hover { border-color: #fff; }

.content { overflow: auto; position: relative; }
.topbar { position: sticky; top: 0; z-index: 6; background: rgba(238,241,245,.92); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px 12px; }
.topbar h1 { font-size: 1.55rem; }
.crumb { margin: 2px 0 0; color: var(--muted); font-size: .86rem; min-height: 1.2em; }
.top-tools { display: flex; align-items: center; gap: 10px; }
.synced { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.gsearch { position: relative; }
.gsearch > svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.gsearch input { width: min(380px, 30vw); font: .9rem var(--body); padding: .62em .8em .62em 2.2em; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; }
.gsearch input:focus { outline: none; border-color: var(--navy); }
.gresults { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 340px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 20; max-height: 400px; overflow: auto; }
.gresults button { display: flex; width: 100%; justify-content: space-between; gap: 10px; align-items: center; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 8px; cursor: pointer; font: .9rem var(--body); color: var(--ink); }
.gresults button:hover, .gresults button.hi { background: var(--paper); }
.gresults small { color: var(--muted); display: block; }
.gresults em { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--line-2); border-radius: 6px; padding: 2px 7px; }
.gresults .none { padding: 10px; color: var(--muted); font-size: .88rem; }

.banner { margin: 0 28px 8px; padding: 11px 16px; border-radius: 10px; background: #fff7e0; border: 1px solid #f5dc8b; color: #6b4a00; font-weight: 600; font-size: .9rem; display: flex; gap: 10px; align-items: center; }
.banner.err { background: #fdeceb; border-color: #f2c7c2; color: var(--red); }
.banner.inline { margin: 0 0 12px; }
.page { padding: 6px 28px 48px; display: grid; gap: 18px; align-content: start; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* ---------- New menu / popovers ---------- */
.menu { position: fixed; z-index: 40; width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; animation: pop .12s ease; }
.menu button { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left; width: 100%; background: none; border: 0; border-radius: 10px; padding: 10px; cursor: pointer; font: 700 .93rem var(--body); color: var(--ink); align-items: center; }
.menu button svg { grid-row: span 2; width: 36px; height: 36px; padding: 8px; border-radius: 9px; background: var(--paper); color: var(--navy); }
.menu button small { font-weight: 500; color: var(--muted); font-size: .8rem; }
.menu button:hover { background: var(--paper); } .menu button:hover svg { background: var(--navy); color: #fff; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.pop { position: fixed; z-index: 70; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 5px; animation: pop .12s ease; }
.pop button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 9px 11px; border-radius: 8px; cursor: pointer; font: 600 .88rem var(--body); color: var(--ink); }
.pop button svg { width: 16px; height: 16px; color: var(--muted); }
.pop button:hover { background: var(--paper); }
.pop button.danger, .pop button.danger svg { color: var(--red); }
.pop hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; }

/* ---------- Drawer / modal / toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(14,30,54,.28); z-index: 30; opacity: 0; transition: opacity .2s; }
.scrim.open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 92vw); background: #fff; z-index: 31; box-shadow: -20px 0 60px rgba(14,30,54,.2); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.drawer.open { transform: none; }
.dr-h { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 22px 24px 18px; border-bottom: 1px solid var(--line-2); position: relative; }
.dr-h::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c, var(--navy)); }
.dr-h.person::before, .dr-h.inv-h::before { display: none; }
.dr-h.inv-h.paid { background: linear-gradient(180deg, #ecfaf3, #fff); } .dr-h.inv-h.late { background: linear-gradient(180deg, #fdf0ee, #fff); }
.dr-h > div { flex: 1; min-width: 0; }
.dr-h h2 { font-size: 1.35rem; margin: 6px 0 2px; }
.dr-h.person h2 { margin-top: 0; }
.dr-h p { margin: 0; color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.dr-h p a { color: var(--ink); display: inline-flex; gap: 5px; align-items: center; }
.dr-body { flex: 1; overflow: auto; padding: 18px 24px 30px; display: grid; gap: 16px; align-content: start; }
.dr-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.facts { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; margin: 0; font-size: .92rem; }
.facts dt { color: var(--muted); font-weight: 600; display: flex; gap: 7px; align-items: center; font-size: .86rem; }
.facts dt svg { width: 15px; height: 15px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts select { font: .9rem var(--body); padding: .4em .6em; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
.facts.compact { grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 10px 0 14px; }
.ticket { background: var(--paper); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; }
.ticket h4 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; } .ticket h4 small { color: var(--muted); font: 500 .8rem var(--body); }
.ticket.empty-t { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .9rem; }
.ticket p { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tags span { font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; }
.tags i { font-style: normal; font-size: .82rem; font-weight: 600; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }
.mini-tbl { width: 100%; border-collapse: collapse; font-size: .86rem; background: #fff; border-radius: 9px; overflow: hidden; }
.mini-tbl th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.mini-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.mini-tbl td small { display: block; color: var(--muted); font-size: .78rem; }
.mini-tbl tr:last-child td { border-bottom: 0; }
.mini-tbl .tot td { font-weight: 800; border-top: 2px solid var(--navy); }

.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(14,30,54,.42); display: grid; place-items: center; padding: 24px; opacity: 0; transition: opacity .15s; }
.modal-wrap.open { opacity: 1; }
.modal { width: min(500px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: 16px; padding: 24px 26px; box-shadow: 0 30px 80px rgba(0,0,0,.3); transform: translateY(8px) scale(.98); transition: transform .15s; }
.modal-wrap.open .modal { transform: none; }
.modal.wide { width: min(920px, 100%); }
.modal > h2 { font-size: 1.25rem; margin-bottom: 6px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; } .modal-h h2 { font-size: 1.25rem; }
.modal-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; align-items: center; }
.conflict { margin-right: auto; color: var(--amber); font-weight: 600; font-size: .85rem; display: flex; gap: 6px; align-items: center; }
.bigcode { font: 800 2.2rem var(--display); letter-spacing: .18em; text-align: center; background: var(--paper); border: 2px dashed var(--line); border-radius: 12px; padding: 18px; margin: 16px 0; color: var(--navy); user-select: all; }
.via { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }

.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 80; justify-items: center; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 11px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; animation: rise .2s ease; transition: opacity .3s, transform .3s; }
.toast.ok { border-left: 4px solid #22c39a; } .toast.err { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast button { background: rgba(255,255,255,.14); border: 0; color: #fff; font: 700 .84rem var(--body); padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.toast button:hover { background: rgba(255,255,255,.24); }

/* ---------- Cards / KPIs ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; align-content: start; min-width: 0; }
.hello { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.hello h2 { font-size: 1.35rem; } .hello p { margin: 2px 0 0; color: var(--muted); }
.hello-acts { display: flex; gap: 10px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; text-align: left; font: inherit; color: inherit; position: relative; overflow: hidden; }
button.kpi { cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
button.kpi:hover { border-color: var(--navy); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(14,30,54,.08); }
.kpi > span { color: var(--muted); font-size: .8rem; font-weight: 700; display: block; text-transform: uppercase; letter-spacing: .04em; }
.kpi b { display: block; font: 800 1.85rem/1.25 var(--display); color: var(--navy); margin-top: 2px; }
.kpi b em { font-style: normal; color: var(--faint); font-size: 1.2rem; }
.kpi small { color: var(--muted); font-size: .8rem; }
.kpi small i { font-style: normal; font-weight: 700; } .kpi small i.up { color: var(--done); } .kpi small i.down { color: var(--red); }
.kpi.hot { border-color: #f5c2bc; background: linear-gradient(180deg, #fff4f2, #fff); } .kpi.hot b { color: var(--red); }
.kpi .bar { height: 6px; background: var(--line-2); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.kpi .bar i { display: block; height: 100%; background: var(--done); border-radius: 99px; transition: width .6s ease; }
.empty { color: var(--muted); padding: 12px 0; font-size: .9rem; display: flex; gap: 8px; align-items: center; }
.empty.ok svg { color: var(--done); }
.empty.center { flex-direction: column; text-align: center; padding: 40px 10px; justify-content: center; }
.empty.center svg { color: var(--faint); }
.empty.center p { margin: 4px 0; }
.hint { color: var(--muted); font-size: .84rem; display: flex; gap: 8px; align-items: center; margin: 0; }
.hint svg { width: 15px; height: 15px; }

/* Dashboard */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.lanes { display: grid; gap: 14px; }
.lane-h { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.lane-h b { display: block; font-size: .93rem; } .lane-h small { color: var(--muted); font-size: .8rem; }
.lane-track { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.stop { flex: 0 0 168px; text-align: left; background: #fff; border: 1.5px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; padding: 9px 11px; cursor: pointer; position: relative; font: inherit; color: inherit; transition: transform .12s, box-shadow .12s; }
.stop:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(14,30,54,.1); }
.stop time { font-size: .76rem; font-weight: 800; color: var(--muted); }
.stop b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 16px; }
.stop small { color: var(--muted); font-size: .77rem; }
.stop .st { position: absolute; top: 8px; right: 8px; } .stop .st svg { width: 15px; height: 15px; }
.stop.completed { background: #f2fbf7; border-color: #bfe8d6; } .stop.completed .st { color: var(--done); }
.stop.in_progress { background: #fffbea; } .stop.in_progress .st { color: var(--amber); }
.stop.late { border-color: #f5c2bc; } .stop.late small { color: var(--red); font-weight: 600; }
.avatar { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font: 800 .8rem var(--display); color: #fff; flex: none; letter-spacing: .02em; }
.avatar.ghost { background: var(--line-2); color: var(--faint); border: 1.5px dashed var(--line); }
.legend { display: flex; gap: 6px; align-items: center; font-size: .78rem; color: var(--muted); font-weight: 600; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.legend .lb { background: #c9d6ee; } .legend .lc { background: var(--done); }
.chart svg { width: 100%; height: auto; display: block; }
.chart rect, .chart text, .chart line { stroke: none; }
.chart .b { fill: #c9d6ee; } .chart .b.cur { fill: #9db5e2; }
.chart .c { fill: #7fd6b5; } .chart .c.cur { fill: var(--done); }
.chart g:hover .b { fill: var(--blue); } .chart g:hover .c { fill: #0e7a55; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; } .chart .axis { stroke: var(--line); stroke-width: 1.5; }
.chart text { fill: var(--muted); font: 600 11px var(--body); }
.chart text.v { fill: var(--ink); font-weight: 800; }
.chart .clickable { cursor: pointer; }
.heat { display: grid; grid-template-columns: 90px repeat(7, 1fr); gap: 4px; align-items: center; font-size: .82rem; }
.heat .hd { text-align: center; font-weight: 700; color: var(--muted); font-size: .76rem; line-height: 1.1; } .heat .hd small { display: block; font-weight: 600; }
.heat .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat .cell { height: 30px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; background: rgba(37,99,235,var(--a)); color: var(--navy); border: 1px solid var(--line-2); }
.row-btn { display: flex; gap: 11px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 8px 8px; cursor: pointer; font: inherit; color: inherit; }
.row-btn:not(.static):hover { background: var(--paper); }
.row-btn > span:not(.dot):not(.inv-no):not(.avatar) { flex: 1; min-width: 0; }
.row-btn b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-btn small { display: block; color: var(--muted); font-size: .8rem; }
.row-btn em { font-style: normal; font-weight: 800; } .row-btn em.red { color: var(--red); }
.row-btn > svg { color: var(--faint); width: 16px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.hbar { display: grid; grid-template-columns: minmax(110px, 200px) 1fr 70px; gap: 12px; align-items: center; padding: 6px 0; font-size: .88rem; }
.hbar > span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hbar > span small { display: block; color: var(--muted); font-weight: 500; font-size: .76rem; }
.hbar .t { height: 12px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.hbar .t i { display: block; height: 100%; border-radius: 99px; background: var(--navy); transition: width .6s ease; }
.hbar b { text-align: right; } .hbar b small { color: var(--muted); font-weight: 500; }
.hbar.slim { grid-template-columns: 100px 1fr 70px; font-size: .8rem; color: var(--muted); } .hbar.slim .t { height: 7px; } .hbar.slim .t i { background: var(--done); }
.prod-bars .hbar { grid-template-columns: minmax(160px, 320px) 1fr 50px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.toolbar-l, .toolbar-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar h2.range { font-size: 1.15rem; margin: 0 6px; white-space: nowrap; }
.seg-tabs { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-tabs button { border: 0; background: none; font: 700 .86rem var(--body); color: var(--muted); padding: .5em .95em; border-radius: 7px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg-tabs button b { font-size: .72rem; background: var(--line-2); border-radius: 99px; padding: 1px 7px; }
.seg-tabs button:hover { color: var(--ink); }
.seg-tabs button.on { background: var(--navy); color: #fff; } .seg-tabs button.on b { background: rgba(255,255,255,.2); }
.seg-tabs.full { display: flex; } .seg-tabs.full button { flex: 1; justify-content: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chips button { font: 600 .84rem var(--body); padding: .45em .85em; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); display: inline-flex; gap: 6px; align-items: center; }
.chips button:hover { border-color: var(--navy); }
.chips button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chips .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.tech-chips button { padding: .3em .75em .3em .3em; }
.tech-chips button:not(.on) { opacity: .55; text-decoration: line-through; }
.tech-chips .avatar { border-radius: 99px; }
.check { display: flex; gap: 9px; align-items: center; font-weight: 600; font-size: .9rem; margin: 6px 0; cursor: pointer; }
.check.sm { font-size: .84rem; margin: 0 4px; }
.search { font: .9rem var(--body); padding: .55em .8em; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
input.search[type=search] { min-width: 230px; }
.search:focus { outline: none; border-color: var(--navy); }
.sel { padding-right: 1.6em; }
.date-jump { font: .86rem var(--body); padding: .45em .6em; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .72rem; color: var(--muted); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .05em; background: #fafbfc; white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl.dense td { padding: 8px 12px; font-size: .86rem; vertical-align: top; }
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr.static { cursor: default; }
.tbl tbody tr:hover td { background: #f7f9fc; }
.tbl tbody tr.sel td { background: #eef4ff; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td small { display: block; color: var(--muted); font-size: .79rem; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl .ck { width: 36px; padding-right: 0; } .tbl .ck input { width: 16px; height: 16px; cursor: pointer; }
.co { display: flex; align-items: center; gap: 11px; } .co b { white-space: nowrap; }
.plan-tag { color: var(--blue) !important; font-weight: 600; }
.more-row { padding: 14px; text-align: center; border-top: 1px solid var(--line-2); }
.meter { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.meter .t { flex: 1; height: 7px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.meter .t i { display: block; height: 100%; background: var(--navy); border-radius: 99px; }
.meter span { font-size: .84rem; font-weight: 700; min-width: 22px; text-align: right; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.pill.on { background: #e3f6ee; color: #0e7a55; } .pill.trial { background: #e6eefd; color: #1d4ed8; }
.pill.warn { background: #fff3dc; color: #9a5b00; } .pill.off { background: #fce9e7; color: var(--red); } .pill.gray { background: var(--line-2); color: var(--muted); }

/* ---------- Schedule ---------- */
.board-card { overflow: auto; max-height: calc(100vh - 230px); }
.week { display: grid; grid-template-columns: 190px repeat(7, minmax(150px, 1fr)); min-width: 1240px; }
.wk-corner, .wk-day { position: sticky; top: 0; z-index: 3; background: #fafbfc; border-bottom: 1px solid var(--line); }
.wk-corner { left: 0; z-index: 4; }
.wk-day { padding: 10px 12px; cursor: pointer; border-left: 1px solid var(--line-2); display: flex; gap: 6px; align-items: baseline; }
.wk-day span { font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.wk-day b { font: 800 1.15rem var(--display); }
.wk-day small { margin-left: auto; color: var(--muted); font-size: .74rem; }
.wk-day:hover { background: var(--paper); }
.wk-day.today { background: #fff8db; } .wk-day.today b { color: var(--navy); background: var(--caution); border-radius: 7px; padding: 0 6px; }
.wk-tech { position: sticky; left: 0; z-index: 2; background: #fff; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line); padding: 12px; display: flex; gap: 10px; align-items: flex-start; }
.wk-tech b { display: block; font-size: .9rem; line-height: 1.2; } .wk-tech small { color: var(--muted); font-size: .76rem; }
.wk-cell { border-left: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; min-height: 110px; display: flex; flex-direction: column; gap: 5px; transition: background .12s; }
.wk-cell.today { background: #fffdf2; } .wk-cell.past { background: #fbfbfc; }
.drop-hi { background: #e8f0ff !important; box-shadow: inset 0 0 0 2px var(--blue); }
.job { position: relative; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 8px; padding: 6px 8px; cursor: grab; font-size: .8rem; line-height: 1.3; transition: box-shadow .12s, transform .12s; user-select: none; }
.job:hover { box-shadow: 0 6px 16px rgba(14,30,54,.12); transform: translateY(-1px); z-index: 1; }
.job .jt { display: flex; gap: 6px; align-items: center; }
.job time { font-weight: 800; color: var(--muted); font-size: .74rem; }
.job .rec { color: var(--blue); font-weight: 800; font-size: .8rem; }
.job .ok { margin-left: auto; color: var(--done); } .job .ok svg { width: 14px; height: 14px; }
.job b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .84rem; }
.job small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .74rem; }
.job .chem { position: absolute; bottom: 5px; right: 6px; display: flex; gap: 2px; align-items: center; color: var(--done); font-size: .7rem; font-weight: 800; } .job .chem svg { width: 12px; height: 12px; }
.job.completed { background: #f4fbf8; cursor: pointer; opacity: .85; }
.job.in_progress { background: #fffbea; }
.job.cancelled { opacity: .5; text-decoration: line-through; background: var(--paper); }
.job.dragging { opacity: .35; }
.dayv { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(190px, 1fr)); min-width: calc(64px + var(--cols) * 190px); }
.dv-corner, .dv-head { position: sticky; top: 0; z-index: 3; background: #fafbfc; border-bottom: 1px solid var(--line); }
.dv-head { display: flex; gap: 9px; align-items: center; padding: 10px 12px; border-left: 1px solid var(--line-2); }
.dv-head > span:not(.avatar) { flex: 1; min-width: 0; } .dv-head b { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .dv-head small { color: var(--muted); font-size: .76rem; }
.dv-hours { grid-column: 1; }
.dv-h { height: var(--hh); border-bottom: 1px solid var(--line-2); position: relative; }
.dv-h span { position: absolute; top: -8px; right: 8px; font-size: .72rem; font-weight: 700; color: var(--faint); background: #fff; padding: 0 2px; }
.dv-h:first-child span { top: 4px; }
.dv-col { position: relative; border-left: 1px solid var(--line-2); }
.dv-slot { height: var(--hh); border-bottom: 1px solid var(--line-2); background: linear-gradient(180deg, transparent 49.5%, #f4f6f9 50%, transparent 51%); }
.dv-job { position: absolute; left: 4px; right: 4px; }
.dv-job .job { height: 100%; overflow: hidden; }
.now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.ghost-time { position: absolute; left: 4px; right: 4px; height: 26px; border: 2px dashed var(--blue); border-radius: 8px; background: rgba(37,99,235,.08); font: 800 .76rem var(--body); color: var(--blue); padding: 3px 8px; pointer-events: none; z-index: 3; }

/* ---------- Forms ---------- */
label.f, div.f { display: grid; gap: 6px; font-weight: 600; font-size: .85rem; color: var(--ink); align-content: start; }
.f > span { font-weight: 600; }
.f input, .f select, .f textarea { font: .93rem var(--body); padding: .66em .8em; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; width: 100%; color: var(--ink); }
.f textarea { resize: vertical; line-height: 1.5; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--navy); outline: none; }
.f.row { grid-template-columns: 1fr 1.2fr; align-items: center; font-weight: 600; }
.msg { font-weight: 600; min-height: 1.3em; margin: 8px 0 0; font-size: .88rem; }
.msg.err { color: var(--red); } .msg.ok { color: var(--done); }
.form { display: grid; gap: 12px; }
.form-cols { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr); gap: 22px; align-items: start; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fgrid .span2 { grid-column: 1 / -1; }
.form-sub { margin-top: 6px; }
.picker { border: 1.5px solid var(--line); border-radius: 11px; overflow: hidden; }
.pk-in { width: 100%; border: 0 !important; border-bottom: 1px solid var(--line-2) !important; border-radius: 0 !important; padding: .8em .9em !important; }
.pk-list { max-height: 300px; overflow: auto; padding: 4px; }
.pk-list button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer; font: inherit; color: inherit; }
.pk-list button span { min-width: 0; } .pk-list b { display: block; font-size: .9rem; } .pk-list small { display: block; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-list button:hover { background: var(--paper); }
.pk-list button.on { background: #e8f0ff; box-shadow: inset 0 0 0 2px var(--blue); }
.items { display: grid; gap: 6px; }
.item { display: grid; grid-template-columns: 1fr 64px 92px 86px 28px; gap: 6px; align-items: center; }
.item input { font: .9rem var(--body); padding: .55em .6em; border: 1.5px solid var(--line); border-radius: 8px; width: 100%; }
.item input:focus { outline: none; border-color: var(--navy); }
.item .amt { text-align: right; font-weight: 700; font-size: .9rem; }
.items-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.quick { display: flex; gap: 4px; flex-wrap: wrap; }
.tagbtn { font: 600 .74rem var(--body); border: 1px solid var(--line); background: var(--paper); border-radius: 99px; padding: 3px 8px; cursor: pointer; color: var(--muted); }
.tagbtn:hover { border-color: var(--navy); color: var(--navy); }
.items-total { text-align: right; font-weight: 600; color: var(--muted); margin: 8px 0 12px; } .items-total b { font: 800 1.3rem var(--display); color: var(--navy); margin-left: 8px; }

/* ---------- Customers / drawer content ---------- */
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-stats.four { grid-template-columns: repeat(4, 1fr); }
.mini { background: var(--paper); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.mini span { color: var(--muted); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.mini b { display: block; font: 800 1.2rem var(--display); color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini b.sm { font-size: .95rem; padding-top: 4px; } .mini b em { font-style: normal; color: var(--faint); font-size: .9rem; }
.sect { display: grid; gap: 6px; } .sect h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); } .sect p { margin: 0; }
.prop { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: var(--paper); border: 1px solid transparent; border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; color: inherit; }
.prop:hover { border-color: var(--line); background: #fff; }
.prop > span { flex: 1; min-width: 0; } .prop b { display: block; font-size: .9rem; } .prop small { color: var(--muted); font-size: .8rem; }
.prop > svg:first-child { color: var(--navy); } .prop > svg:last-child { color: var(--faint); width: 15px; }
.timeline { display: grid; gap: 2px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 10px; bottom: 10px; width: 2px; background: var(--line-2); }
.tl-item { display: flex; gap: 14px; align-items: flex-start; text-align: left; background: none; border: 0; border-radius: 10px; padding: 9px 8px; cursor: pointer; font: inherit; color: inherit; position: relative; }
.tl-item:hover { background: var(--paper); }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--c); margin-top: 4px; flex: none; z-index: 1; }
.tl-item.cancelled .tl-dot { background: #fff; }
.tl-main b { font-size: .92rem; } .tl-main small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.chem-line { color: #0e7a55 !important; display: flex !important; gap: 5px; align-items: center; }
.list { display: grid; gap: 2px; }
.inv-no { font: 800 .85rem var(--display); color: var(--muted); min-width: 52px; }

/* ---------- Invoices ---------- */
.inv-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: stretch; }
.inv-top .kpis { align-content: stretch; } .inv-top .kpi { display: flex; flex-direction: column; justify-content: center; }
.aging h3 { margin-bottom: 6px; } .aging .hbar { grid-template-columns: 80px 1fr 70px; padding: 3px 0; font-size: .84rem; } .aging .hbar .t { height: 9px; }
.bulk { display: flex; gap: 10px; align-items: center; background: var(--navy); color: #fff; border-radius: 11px; padding: 9px 14px; position: sticky; top: 76px; z-index: 4; animation: rise .15s ease; }
.bulk b { margin-right: auto; } .bulk .linkish { color: #fff; }
.inv-paper { border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 14px; background: linear-gradient(180deg, #fff, #fbfcfd); }
.ip-top { display: flex; justify-content: space-between; gap: 16px; font-size: .88rem; }
.ip-top div { display: grid; gap: 1px; } .ip-top .r { text-align: right; }
.ip-top small { color: var(--muted); font-size: .72rem; text-transform: uppercase; font-weight: 700; letter-spacing: .05em; margin-top: 4px; }
.ip-top span { color: var(--muted); }
.paid-stamp { margin: 0; color: var(--done); font: 800 1rem var(--display); display: flex; gap: 6px; align-items: center; }
.paylink { background: #f4f8ff; border: 1px solid #dbe6fb; border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.paylink > span { font-weight: 700; font-size: .88rem; display: flex; gap: 6px; align-items: center; }
.paylink code { font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; background: #fff; border-radius: 6px; padding: 6px 8px; border: 1px solid var(--line-2); }
.row-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Pesticide ---------- */
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 18px; }
.county-grid { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 18px; align-items: start; }
.county-grid .card > h3 + p { margin: 4px 0 12px; }
.city-map { display: grid; gap: 8px; margin-top: 12px; max-height: 420px; overflow: auto; padding-right: 4px; }
.city-map input { padding: .5em .7em; }
.cty { margin: 16px 0 8px; font-size: .95rem; color: var(--navy); }

/* ---------- Team ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.member { display: grid; gap: 12px; }
.m-top { display: flex; gap: 12px; align-items: center; } .m-top > div { flex: 1; } .m-top h3 { margin-bottom: 3px; }
.m-today { display: flex; gap: 7px; align-items: center; font-size: .86rem; color: var(--muted); font-weight: 600; }
.key-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.key-row code { font: 800 1rem var(--display); letter-spacing: .12em; background: var(--paper); border-radius: 8px; padding: 6px 10px; color: var(--navy); }
.key-row span { flex: 1; font-weight: 600; font-size: .9rem; } .key-row small { display: block; color: var(--muted); font-weight: 500; font-size: .78rem; }
.key-row.used code { color: var(--faint); text-decoration: line-through; }
details.used summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .86rem; margin-top: 12px; }
.seat-big { display: flex; align-items: baseline; gap: 8px; margin: 10px 0; } .seat-big b { font: 800 2.6rem var(--display); color: var(--navy); } .seat-big span { color: var(--muted); font-weight: 600; }
.bar.big { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; } .bar.big i { display: block; height: 100%; background: var(--navy); border-radius: 99px; }

/* ---------- Settings ---------- */
.settings .card > h3 + p { margin: 4px 0 14px; }
.keys { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 12px 0 0; font-size: .88rem; } .keys dd { margin: 0; color: var(--muted); }

@media (max-width: 1350px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .dash-grid, .inv-top { grid-template-columns: 1fr; }
}
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .county-grid, .form-cols { grid-template-columns: 1fr; }
  .gate { grid-template-columns: 1fr; } .gate-art { display: none; }
}
.dv-col ~ .dv-col .now::before { display: none; }
.lane-h > span:not(.avatar), .wk-tech > span:not(.avatar) { min-width: 0; }

/* Web version */
.desktop .web-only { display: none; }

/* ---------- Schedule list (agenda) ---------- */
.agenda { display: grid; gap: 14px; }
.ag-day { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ag-day > header { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); background: #fafbfc; }
.ag-day > header b { font: 800 1rem var(--display); } .ag-day > header span { color: var(--muted); font-weight: 600; font-size: .9rem; }
.ag-day > header small { margin-left: auto; color: var(--muted); font-size: .8rem; font-weight: 600; }
.ag-day > header .ghost-btn { align-self: center; }
.ag-day.today > header { background: #fff8db; } .ag-day.today > header b::after { content: "Today"; margin-left: 8px; font: 800 .66rem var(--body); text-transform: uppercase; letter-spacing: .08em; background: var(--caution); color: var(--navy); padding: 2px 7px; border-radius: 99px; vertical-align: 2px; }
.ag-day.past { opacity: .82; }
.ag-row { display: grid; grid-template-columns: 74px 1fr auto auto; gap: 12px; align-items: center; width: 100%; text-align: left; background: #fff; border: 0; border-top: 1px solid var(--line-2); padding: 11px 14px 11px 12px; cursor: pointer; font: inherit; color: inherit; border-left: 4px solid var(--c); }
.ag-row:first-of-type { border-top: 0; }
.ag-row:hover, .ag-row:active { background: var(--paper); }
.ag-row time { font-weight: 800; font-size: .88rem; } .ag-row time small { display: block; color: var(--muted); font-weight: 600; font-size: .74rem; }
.ag-main { min-width: 0; } .ag-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ag-main small { display: block; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-tech { display: flex; align-items: center; gap: 6px; } .ag-tech small { font-weight: 600; font-size: .8rem; color: var(--muted); }
.ag-tech .avatar { border-radius: 99px; font-size: .62rem; }
.ag-st { text-align: right; min-width: 64px; } .ag-st .pill svg { width: 12px; height: 12px; }
.ag-row.cancelled .ag-main b { text-decoration: line-through; color: var(--muted); }

/* ---------- Phones and tablets ---------- */
.menu-btn, .bnav, .side-scrim { display: none; }
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(280px, 84vw); transform: translateX(-102%); transition: transform .22s cubic-bezier(.2,.8,.2,1); box-shadow: 20px 0 60px rgba(0,0,0,.25); padding-top: max(20px, env(safe-area-inset-top)); }
  .nav-open .side { transform: none; }
  .side-scrim { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(14,30,54,.4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .nav-open .side-scrim { opacity: 1; pointer-events: auto; }
  .nav kbd { display: none; }
  .menu-btn { display: inline-grid; }
  .topbar { justify-content: flex-start; flex-wrap: wrap; padding: max(12px, env(safe-area-inset-top)) 16px 10px; gap: 10px; }
  .title-block { flex: 1; min-width: 0; }
  .topbar h1 { font-size: 1.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .8rem; }
  .top-tools { gap: 8px; }
  .synced { display: none; }
  .page { padding: 4px 16px calc(90px + env(safe-area-inset-bottom)); gap: 14px; }
  .banner { margin: 0 16px 8px; }
  .bnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bnav button { display: grid; justify-items: center; gap: 2px; background: none; border: 0; font: 700 .68rem var(--body); color: var(--muted); padding: 5px 0; cursor: pointer; position: relative; border-radius: 10px; }
  .bnav button svg { width: 22px; height: 22px; }
  .bnav button[aria-current="page"] { color: var(--navy); }
  .bnav button[aria-current="page"] svg { background: var(--caution); border-radius: 99px; padding: 2px 10px; width: 44px; box-sizing: content-box; height: 20px; }
  .bnav .badge { position: absolute; top: 0; left: 55%; min-width: 18px; height: 18px; font-size: .64rem; padding: 0 5px; }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); width: calc(100% - 32px); }
  .toast { width: 100%; justify-content: space-between; }
  .kpis, .kpis.three { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-2, .grid-3, .dash-grid, .inv-top, .county-grid, .form-cols { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .top-tools { display: contents; }
  .menu-btn { order: 0; } .title-block { order: 1; }
  #quick-new { order: 2; padding: .6em .8em; } #quick-new span { display: none; } #refresh { order: 3; }
  .gsearch { order: 5; flex: 1 0 100%; }
  .gsearch input { width: 100%; font-size: 16px; }
  .gresults { min-width: 0; }
  .topbar { row-gap: 8px; }
  .kpi { padding: 12px 14px; } .kpi b { font-size: 1.4rem; } .kpi > span { font-size: .7rem; } .kpi small { font-size: .74rem; line-height: 1.3; display: block; }
  .card { padding: 14px; border-radius: 12px; }
  .hello h2 { font-size: 1.15rem; } .hello p { font-size: .88rem; }
  .hello-acts { width: 100%; } .hello-acts .btn { flex: 1; }
  .stop { flex-basis: 150px; }
  .toolbar, .toolbar-l, .toolbar-r { width: 100%; }
  .chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; width: 100%; }
  .chips::-webkit-scrollbar { display: none; }
  .chips button { flex: none; }
  .search, .date-jump { font-size: 16px; }
  .toolbar h2.range { font-size: 1rem; margin: 0 2px; order: 9; flex: 1 0 100%; }
  .date-jump { display: none; }
  .sched-bar .toolbar-r { gap: 8px; }
  .sched-bar .toolbar-r .btn-outline, .check.sm { display: none; }
  .sched-bar .toolbar-r .btn-navy { margin-left: auto; }
  .tech-chips { order: 2; }
  .ag-row { grid-template-columns: 58px 1fr auto; gap: 10px; padding: 11px 12px 11px 10px; }
  .ag-tech { display: none; }
  .ag-st { min-width: 0; }
  .ag-day > header small { font-size: .74rem; }
  .board-card { max-height: calc(100vh - 300px); }
  /* Tables become cards */
  .tbl thead { display: none; }
  .tbl, .tbl tbody { display: block; }
  .tbl tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td { display: block; padding: 0; border: 0; background: none !important; }
  .tbl td small { display: inline; margin-left: 6px; }
  #c-table td:nth-child(1) { flex: 1; min-width: 0; order: 1; }
  #c-table td:nth-child(6) { order: 2; text-align: right; }
  #c-table td:nth-child(2) { order: 3; flex: 1 0 100%; padding-left: 45px; color: var(--muted); font-size: .86rem; }
  #c-table td:nth-child(2) small { display: none; }
  #c-table td:nth-child(5) { order: 4; flex: 1 0 100%; padding-left: 45px; font-size: .8rem; color: var(--muted); }
  #c-table td:nth-child(5):has(.muted) { display: none; }
  #c-table td:nth-child(5)::before { content: "Next visit "; font-weight: 700; }
  #c-table td:nth-child(3), #c-table td:nth-child(4), #c-table td:nth-child(7) { display: none; }
  #c-table td:nth-child(6) small { display: block; margin: 0; }
  #i-table td.ck { order: 0; } #i-table td.ck input { width: 20px; height: 20px; }
  #i-table td:nth-child(2) { order: 1; color: var(--muted); }
  #i-table td:nth-child(3) { order: 2; flex: 1; min-width: 0; }
  #i-table td:nth-child(3) .co b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #i-table td:nth-child(7) { order: 3; }
  #i-table td:nth-child(8) { order: 4; flex: 1 0 100%; padding-left: 30px; }
  #i-table td:nth-child(8) small { display: inline; }
  #i-table td:nth-child(4), #i-table td:nth-child(5), #i-table td:nth-child(6) { display: none; }
  #i-table .avatar { display: none; }
  .tbl.dense { display: table; } .tbl.dense thead { display: table-header-group; } .tbl.dense tbody { display: table-row-group; } .tbl.dense tbody tr { display: table-row; padding: 0; } .tbl.dense td { display: table-cell; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
  .tbl.dense td small { display: block; margin: 0; }
  .page-pesticide .tbl:not(.dense) { display: table; } .page-pesticide .tbl:not(.dense) thead { display: table-header-group; } .page-pesticide .tbl:not(.dense) tbody { display: table-row-group; } .page-pesticide .tbl:not(.dense) tbody tr { display: table-row; } .page-pesticide .tbl:not(.dense) td { display: table-cell; padding: 9px 10px; border-bottom: 1px solid var(--line-2); } .page-pesticide .tbl td small { display: block; margin: 0; }
  .bulk { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 26; flex-wrap: wrap; }
  .inv-top .kpis { grid-template-columns: 1fr 1fr; } .inv-top .kpi:last-child { grid-column: 1 / -1; }
  .aging .hbar { grid-template-columns: 70px 1fr 64px; }
  .hbar { grid-template-columns: minmax(90px, 130px) 1fr 54px; gap: 8px; }
  .prod-bars .hbar { grid-template-columns: minmax(110px, 150px) 1fr 34px; }
  .heat { grid-template-columns: 64px repeat(7, 1fr); gap: 3px; } .heat .cell { height: 26px; font-size: .74rem; }
  /* Panels and forms fill the screen */
  .drawer { width: 100vw; }
  .dr-h { padding: max(16px, env(safe-area-inset-top)) 16px 14px; }
  .dr-body { padding: 14px 16px calc(30px + env(safe-area-inset-bottom)); }
  .facts { grid-template-columns: 1fr; gap: 2px 0; } .facts dt { margin-top: 8px; }
  .mini-stats.four { grid-template-columns: 1fr 1fr; }
  .modal-wrap { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { width: 100%; max-height: 94dvh; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .modal-acts { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: #fff; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); margin-bottom: calc(-18px - env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); flex-wrap: wrap; }
  .modal-acts .conflict { flex: 1 0 100%; }
  .modal-acts .btn { flex: 1; }
  .f input, .f select, .f textarea, .item input { font-size: 16px; }
  .pk-list { max-height: 200px; }
  .item { grid-template-columns: 1fr 48px 70px 26px; } .item .amt { display: none; }
  .via { grid-template-columns: 1fr 1fr; }
  .menu { width: calc(100vw - 20px); }
  .gate-card { padding: 26px 20px 22px; }
  .member .row-acts .btn { flex: 1; }
  .key-row { flex-wrap: wrap; }
  .f.row { grid-template-columns: 1fr 1.3fr; }
}
@media (hover: none) {
  .job:hover, .stop:hover, button.kpi:hover { transform: none; box-shadow: none; }
}
/* Keep every screen inside the window width; wide pieces scroll sideways on their own. */
.page { grid-template-columns: minmax(0, 1fr); }
.page > *, .lanes, .lane, .stack, .dash-grid > *, .grid-3 > *, .grid-2 > * { min-width: 0; }
@media (max-width: 760px) {
  .seg-tabs:not(.full) { max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; flex-shrink: 0; min-height: max-content; }
  .toolbar-r input.search[type=search] { flex: 1 0 100%; order: -1; }
  .seg-tabs::-webkit-scrollbar { display: none; }
  .seg-tabs button { flex: none; }
  .pest-bar .toolbar-l { flex-wrap: wrap; }
  .pest-bar .toolbar-r .search.sel { flex: 1; }
  .sched-bar .toolbar-l { flex-wrap: wrap; }
}
