/* LEOTECH OnSite — orange & white design system */
:root {
  --brand: #f26b21;
  --brand-600: #dc5a12;
  --brand-700: #b8490d;
  --brand-50: #fff4ec;
  --brand-100: #ffe4d1;
  --sky: #bfe1f1;
  --sky-600: #3a8fb7;
  --ink: #1d1b1a;
  --text: #2b2826;
  --muted: #77716c;
  --faint: #a29c96;
  --line: #ece8e4;
  --line-2: #f4f1ee;
  --bg: #faf8f6;
  --card: #ffffff;
  --green: #14804a; --green-bg: #e7f6ee;
  --amber: #a35c00; --amber-bg: #fff3dc;
  --red: #c4320a; --red-bg: #fdece7;
  --blue: #1f6fa8; --blue-bg: #e6f3fa;
  --grey-bg: #f1eeeb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(29, 27, 26, .05);
  --shadow: 0 1px 3px rgba(29, 27, 26, .06), 0 1px 2px rgba(29, 27, 26, .04);
  --shadow-lg: 0 12px 32px rgba(29, 27, 26, .14), 0 2px 6px rgba(29, 27, 26, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --sidebar: 248px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14.5px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; color: var(--ink); letter-spacing: -.01em; }
h2 { font-size: 1.45rem; font-weight: 700; }
h2 .muted { font-weight: 500; font-size: 1rem; }
h3 { font-size: 1rem; font-weight: 650; margin-top: .25rem; }
h4 { font-size: .9rem; font-weight: 650; margin-top: 1rem; }
p { margin: .4rem 0; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .84rem; }
.center { text-align: center; }
.pre { white-space: pre-wrap; }
.err { color: var(--red); }
.warn { color: var(--amber); font-weight: 500; }
.note { background: var(--blue-bg); color: #164e75; border-radius: var(--radius-sm); padding: .65rem .85rem; }
.note.orange { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }
.note.red { background: var(--red-bg); color: var(--red); }
.note.green { background: var(--green-bg); color: var(--green); }
.mt { margin-top: .5rem; } .mb { margin-bottom: .9rem; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }

/* ---- Logo ---- */
.logo-mark { display: inline-block; flex-shrink: 0; }
.wordmark { font-family: "Oswald", "Arial Narrow", Impact, sans-serif; font-weight: 700; letter-spacing: .01em; line-height: 1; color: var(--ink); }
.wordmark b { color: var(--brand); font-weight: 700; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand .wordmark { font-size: 1.5rem; }
.brand small { display: block; font-family: var(--font); font-size: .7rem; font-weight: 500; color: var(--muted); letter-spacing: .02em; margin-top: 3px; }

/* ---- App shell ---- */
.layout { min-height: 100vh; }
.layout.pm { display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar { background: var(--card); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.logout-label { display: none; }
.sidebar .brand { padding: 1.1rem 1.2rem 1rem; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: .4rem .7rem; overflow: auto; flex: 1; }
.nav .sect { font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: .9rem .6rem .35rem; }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .52rem .65rem; border-radius: var(--radius-sm); color: var(--text); font-weight: 500; position: relative; }
.nav a:hover { background: var(--line-2); color: var(--ink); }
.nav a.active { background: var(--brand-50); color: var(--brand-700); }
.nav a.active svg.i { stroke: var(--brand); }
.nav a .count { margin-left: auto; background: var(--brand); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 99px; padding: 0 .45rem; min-width: 20px; text-align: center; }
.side-user { border-top: 1px solid var(--line); padding: .8rem 1rem; display: flex; align-items: center; gap: .6rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.side-user .who-name { font-weight: 600; font-size: .88rem; line-height: 1.2; color: var(--ink); }
.side-user .who-role { font-size: .74rem; color: var(--muted); }
.side-user .icon-btn { margin-left: auto; }
.mobile-top { display: none; }
main { padding: 1.6rem 2rem 2.5rem; max-width: 1240px; width: 100%; min-width: 0; }

/* Supervisor: phone-first app with bottom tabs */
.layout.supervisor { display: flex; flex-direction: column; }
.layout.supervisor .mobile-top { display: flex; }
.layout.supervisor main { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 6rem; }
.layout.supervisor .tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; font-weight: 600; color: var(--muted); padding: .55rem 0 .5rem; }
.tabbar a svg.i { width: 22px; height: 22px; }
.tabbar a.active { color: var(--brand); }
.mobile-top { position: sticky; top: 0; z-index: 25; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); align-items: center; justify-content: space-between; padding: .6rem 1rem; padding-top: max(.6rem, env(safe-area-inset-top)); }
.mobile-top .brand .wordmark { font-size: 1.3rem; }

@media (max-width: 900px) {
  .layout.pm { display: block; }
  .layout.pm .mobile-top { display: flex; }
  .layout.pm .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); padding-top: env(safe-area-inset-top); }
  /* Phones: account row and Log out sit under the logo, clear of the browser's bottom bar */
  .layout.pm .sidebar .brand { order: -2; }
  .layout.pm .sidebar .side-user { order: -1; border-top: 0; border-bottom: 1px solid var(--line); margin-bottom: .2rem; }
  .layout.pm .sidebar .side-user > div { min-width: 0; }
  .layout.pm .sidebar .who-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .layout.pm .sidebar .logout { flex: none; white-space: nowrap; width: auto; min-height: 34px; align-items: center; padding: 0 .65rem; gap: .35rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .82rem; font-weight: 600; color: var(--text); }
  .layout.pm .sidebar .logout-label { display: inline; }
  .layout.pm .sidebar .nav { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
  .layout.pm.nav-open .sidebar { transform: none; }
  .layout.pm.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(29,27,26,.35); z-index: 35; }
  main { padding: 1rem; }
  .hide-sm { display: none !important; }
}
@media (min-width: 901px) { .only-sm { display: none !important; } }

/* ---- Page header ---- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head h2 { margin: 0; }
.page-head p { margin: .2rem 0 0; color: var(--muted); }
.page-head .actions-r { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---- Components ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; }
.card.narrow { max-width: 480px; }
.card.link { display: block; color: inherit; transition: border-color .15s, box-shadow .15s, transform .1s; }
.card.link:hover { border-color: var(--brand-100); box-shadow: var(--shadow); }
.card.link:active { transform: scale(.99); }
.card .title { font-size: 1.02rem; font-weight: 650; margin: .25rem 0 .1rem; color: var(--ink); }
.code { color: var(--brand-600); font-weight: 700; letter-spacing: .02em; font-size: .85rem; }
.grid { display: grid; gap: 1rem; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 0 1rem; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; gap: .5rem; }
.row.wrap { flex-wrap: wrap; }
.row.gap { gap: .5rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 38px; padding: .45rem .95rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s; }
.btn:hover { border-color: #d9d3cd; background: #fdfcfb; color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(220, 90, 18, .3); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); border-color: #f3c9bc; }
.btn.danger:hover { background: var(--red-bg); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--line-2); }
.btn.small { min-height: 30px; padding: .2rem .65rem; font-size: .8rem; }
.btn.block { width: 100%; }
.btn.big { min-height: 50px; font-size: 1rem; margin-top: .6rem; border-radius: 10px; }
.btn svg.i { width: 16px; height: 16px; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: .4rem; border-radius: var(--radius-sm); color: var(--muted); display: inline-flex; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }

label { display: block; font-size: .83rem; font-weight: 600; color: #4a4542; margin: .7rem 0 .25rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; padding: .5rem .7rem; min-height: 40px; border: 1px solid #ddd7d1; border-radius: var(--radius-sm); font: inherit; font-size: 16px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
@media (min-width: 901px) { input, select, textarea { font-size: .9rem; } }
textarea { min-height: auto; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
input[type=checkbox], input[type=radio] { display: inline-block; width: 17px; height: 17px; min-height: 0; margin: 0; vertical-align: middle; accent-color: var(--brand); box-shadow: none; }
.need { border-color: #f0b27f; background: #fffaf5; }
label.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; margin: .3rem 0; cursor: pointer; color: var(--text); }
.small-input { max-width: 220px; min-height: 34px; padding: .3rem .6rem; margin: 0; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .14rem .55rem; border-radius: 99px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.orange { background: var(--brand-50); color: var(--brand-700); }
.badge.grey { background: var(--grey-bg); color: var(--muted); }
.badge.plain::before { display: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: .25rem 0 1.1rem; }
.stats > * { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: .85rem 1rem; color: inherit; display: flex; flex-direction: column; gap: .15rem; position: relative; }
.stats span { font-size: .76rem; color: var(--muted); font-weight: 500; order: -1; }
.stats b { font-size: 1.45rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.stats a:hover { border-color: var(--brand-100); }
.stats .alert { border-color: var(--brand-100); background: linear-gradient(180deg, var(--brand-50), #fff); }
.stats .alert b { color: var(--brand-600); }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, 1fr); } .stats b { font-size: 1.2rem; } }

.list .li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--line-2); }
.card.flush .list .li, .list.pad .li { padding: .8rem 1.2rem; }
.list .li:last-child { border-bottom: 0; }
.list .li.top { align-items: flex-start; }
.li.link { color: inherit; }
.li.link:hover { background: #fdfbfa; }

.tabs { display: inline-flex; gap: 2px; margin-bottom: 1rem; background: var(--line-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; overflow-x: auto; max-width: 100%; }
.tabs a { padding: .4rem .85rem; color: var(--muted); border-radius: 7px; white-space: nowrap; font-weight: 600; font-size: .85rem; display: inline-flex; align-items: center; gap: .4rem; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.tabs a .count { background: var(--brand); color: #fff; border-radius: 99px; font-size: .68rem; padding: 0 .4rem; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { background: #fcfbfa; font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--line); }
tbody tr:hover td { background: #fdfbf9; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { background: #fcfbfa; border-top: 1px solid var(--line); }
tr.click { cursor: pointer; }
td.wrap-text { min-width: 170px; max-width: 320px; }
td input.hrs { width: 80px; min-height: 32px; padding: .2rem .4rem; margin: 0; }
table.data td { white-space: nowrap; }
.cell-strong { font-weight: 600; color: var(--ink); }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 .9rem; align-items: end; }
.filters label { margin-top: .3rem; }
.filters .btn, .filters .row { margin-top: .6rem; }

/* ---- Supervisor day workflow ---- */
.day-head { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.day-head h2 { font-size: 1.25rem; margin: .1rem 0; }
.progress { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: .8rem; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--brand), #ff9a5c); border-radius: 99px; transition: width .3s; }
.step { padding: 0; overflow: hidden; }
.step > h3 { display: flex; align-items: center; gap: .7rem; margin: 0; padding: .9rem 1.1rem; font-size: .98rem; }
.step > .body { padding: 0 1.1rem 1.1rem; }
.step .num { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); border: 1.5px solid var(--brand-100); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.step.done .num { background: var(--green); border-color: var(--green); color: #fff; }
.step.active { border-color: var(--brand-100); box-shadow: 0 0 0 3px var(--brand-50); }
.step.active .num { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.dim { opacity: .55; }
.step .hint { margin-left: auto; font-size: .76rem; color: var(--muted); font-weight: 500; }
.photo-pick { display: block; border: 1.5px dashed #e6c3ab; border-radius: var(--radius); min-height: 150px; cursor: pointer; overflow: hidden; margin: .6rem 0; background: var(--brand-50); }
.photo-pick .ph-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; min-height: 150px; font-size: .95rem; color: var(--brand-700); font-weight: 600; }
.photo-pick .ph-empty svg.i { width: 30px; height: 30px; stroke: var(--brand); }
.photo-pick img { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.thumb { width: 116px; height: 86px; object-fit: cover; border-radius: var(--radius-sm); cursor: zoom-in; border: 1px solid var(--line); }
.big-num { font-size: 1.55rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.wlist .wrow { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.wlist .wrow:last-child { border-bottom: 0; }
.wlist .wrow.me { background: var(--brand-50); margin: 0 -1.1rem; padding: .7rem 1.1rem; border-bottom-color: var(--brand-100); }
.wname { display: flex; align-items: center; gap: .65rem; min-width: 170px; flex: 1; }
.wname > div { display: flex; flex-direction: column; line-height: 1.3; }
.wname b { color: var(--ink); font-weight: 600; }
.wact { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.wact.col { flex-direction: column; align-items: stretch; flex: 1; min-width: 210px; }
.wact.col select, .wact.col input { margin: 0; }
.segs { display: inline-flex; background: var(--line-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; }
.seg { border: 0; background: transparent; min-width: 46px; min-height: 36px; border-radius: 7px; font: inherit; font-weight: 700; font-size: .82rem; color: var(--muted); cursor: pointer; }
.seg:hover:not(:disabled) { color: var(--ink); }
.seg.on.present { background: var(--green); color: #fff; }
.seg.on.late { background: #e8950c; color: #fff; }
.seg.on.absent { background: var(--red); color: #fff; }
.seg:disabled { cursor: default; }
.bulk { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; background: var(--line-2); border-radius: var(--radius-sm); padding: .55rem; margin: .5rem 0 .7rem; }
.bulk select, .bulk input { flex: 1; min-width: 170px; margin: 0; }
.chips { flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: .32rem .85rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
.checks { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .25rem .7rem; max-height: 260px; overflow: auto; background: #fff; }
.checks.tall { max-height: 45vh; }
.busy { color: var(--amber); margin-left: auto; font-size: .78rem; font-weight: 500; }
.you { font-size: .66rem; font-weight: 700; color: #fff; background: var(--brand); border-radius: 4px; padding: 1px 5px; margin-left: .3rem; vertical-align: 1px; letter-spacing: .03em; }

/* ---- Daily planner ---- */
.plan-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.plan-bar input[type=date] { width: auto; margin: 0; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.site-card { padding: 0; }
.site-card .sc-head { padding: .9rem 1.1rem .7rem; border-bottom: 1px solid var(--line-2); }
.site-card .sc-body { padding: .8rem 1.1rem 1rem; }
.sup-pick { display: flex; align-items: center; gap: .6rem; background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 10px; padding: .5rem .6rem; }
.sup-pick select { margin: 0; border-color: transparent; background: transparent; font-weight: 600; min-height: 34px; padding-left: .2rem; }
.sup-pick select:focus { box-shadow: none; }
.sup-pick.empty { background: #fff7f4; border-color: #f6c7b5; }
.crew { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.crew .member { display: inline-flex; align-items: center; gap: .35rem; background: var(--line-2); border: 1px solid var(--line); border-radius: 99px; padding: .2rem .25rem .2rem .55rem; font-size: .8rem; font-weight: 500; }
.crew .member button { border: 0; background: none; cursor: pointer; color: var(--faint); padding: 0 .2rem; font-size: .95rem; line-height: 1; border-radius: 50%; }
.crew .member button:hover { color: var(--red); }
.crew .empty { color: var(--faint); font-size: .84rem; }

/* ---- Calendar ---- */
.cal-title { min-width: 150px; text-align: center; font-weight: 700; color: var(--ink); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-h { text-align: center; font-size: .72rem; color: var(--muted); font-weight: 600; padding: .5rem; background: #fcfbfa; text-transform: uppercase; letter-spacing: .05em; }
.cal-d { background: #fff; min-height: 104px; padding: .4rem; cursor: pointer; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-d:hover { background: #fffaf6; }
.cal-d.out { background: #fcfbfa; }
.cal-d.out .dn { color: var(--faint); }
.cal-d .dn { font-size: .78rem; font-weight: 600; color: var(--text); }
.cal-d.today .dn { background: var(--brand); color: #fff; border-radius: 99px; padding: 0 .45rem; align-self: flex-start; }
.pchip { font-size: .7rem; border-radius: 5px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.pchip.nosup { box-shadow: inset 2px 0 0 var(--red); }
.pchip.c0 { background: #ffe8d9; } .pchip.c1 { background: #dff0f8; } .pchip.c2 { background: #e5f5ea; } .pchip.c3 { background: #fbe7f1; }
.pchip.c4 { background: #ece8fb; } .pchip.c5 { background: #fff2cc; } .pchip.c6 { background: #e0f4f2; } .pchip.c7 { background: #eeeae6; }
@media (max-width: 600px) { .cal-d { min-height: 66px; padding: .25rem; } .pchip { font-size: .6rem; padding: 0 3px; } }

/* ---- Report ---- */
.report { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.4rem; }
.report .stats > * { box-shadow: none; background: #fcfbfa; }
.report-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.report h3 { margin-top: 1.3rem; }
.photos { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.ph { margin: 0; flex: 1; min-width: 220px; max-width: 440px; }
.ph img { width: 100%; height: 220px; object-fit: cover; border-radius: var(--radius-sm); cursor: zoom-in; border: 1px solid var(--line); }
.ph .nophoto { height: 120px; display: flex; align-items: center; justify-content: center; background: var(--line-2); border-radius: var(--radius-sm); color: var(--muted); }
.ph figcaption { font-size: .82rem; margin-top: .35rem; color: var(--muted); }
img.full { width: 100%; height: auto; border-radius: var(--radius-sm); }
.approve-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--brand-100); box-shadow: var(--shadow-lg); border-radius: var(--radius); padding: .8rem 1rem; margin-top: 1rem; }

/* ---- Modal, toast, login ---- */
.modal-wrap { position: fixed; inset: 0; background: rgba(29, 27, 26, .45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh .75rem; overflow: auto; animation: fade .15s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 540px; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal.wide { max-width: 840px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: .6rem 1.2rem 1.2rem; }
.actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.1rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (max-width: 600px) { .modal-wrap { padding: 0; align-items: flex-end; } .modal { border-radius: 16px 16px 0 0; max-height: 92vh; overflow: auto; } }
.toast { position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 16px); opacity: 0; background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 10px; z-index: 100; transition: .25s; max-width: min(92vw, 560px); white-space: pre-wrap; box-shadow: var(--shadow-lg); font-weight: 500; font-size: .9rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); }
.spin { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
.spin.dark { border-color: var(--brand-100); border-top-color: var(--brand); width: 28px; height: 28px; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { display: flex; justify-content: center; padding: 3rem; }
.empty-state { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty-state svg.i { width: 34px; height: 34px; stroke: var(--brand); margin-bottom: .4rem; }

.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.login-art { background: radial-gradient(1200px 500px at -10% -10%, #ff9a5c 0%, transparent 60%), linear-gradient(150deg, var(--brand) 0%, #e2550f 55%, #b8490d 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border: 60px solid rgba(255,255,255,.08); transform: rotate(45deg); border-radius: 30px; }
.login-art h1 { color: #fff; font-size: 2.3rem; line-height: 1.15; max-width: 460px; letter-spacing: -.02em; }
.login-art ul { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .7rem; max-width: 420px; }
.login-art li { display: flex; gap: .6rem; align-items: center; font-weight: 500; opacity: .95; }
.login-art li svg.i { stroke: #fff; }
.login-art .logo-chip { background: #fff; border-radius: 12px; padding: .6rem .9rem; display: inline-flex; align-self: flex-start; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.login-form form { width: 100%; max-width: 380px; }
.login-form h2 { font-size: 1.6rem; margin-top: 1.2rem; }
.login-form .btn { margin-top: 1.2rem; min-height: 46px; font-size: .95rem; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } .login-form { align-items: flex-start; padding-top: 12vh; } }

@media print {
  .sidebar, .mobile-top, .tabbar, .no-print, .approve-bar { display: none !important; }
  .layout.pm { display: block; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .report { box-shadow: none; border: 0; padding: 0; }
  .ph img { height: 180px; }
}

/* ---- Schedule: multi-date selection ---- */
.selbar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; position: sticky; top: 0; z-index: 6; padding: .75rem 1rem; }
@media (max-width: 900px) { .selbar { top: 57px; } }
.cal-d { position: relative; user-select: none; }
.cal-d.sel { background: var(--brand-50); box-shadow: inset 0 0 0 2px var(--brand); }
.cal-d.sel .dn::after { content: "✓"; margin-left: .3rem; color: var(--brand); font-weight: 800; }
.cal-d.past { background: #fbfaf9; cursor: not-allowed; }
.cal-d.past .dn { color: var(--faint); }
.cal-d.off:not(.sel) { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.025) 6px 12px); }
.edit-site + .edit-site { border-top: 1px solid var(--line-2); margin-top: .6rem; }
.crew .member .mvbtn { font-size: .8rem; }
a.chip.on, .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---- Assign manpower ---- */
.psearch-box { display: flex; align-items: center; gap: .5rem; border: 1px solid #ddd7d1; border-radius: 10px; padding: 0 .75rem; background: #fff; }
.psearch-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.psearch-box svg.i { stroke: var(--muted); }
.psearch-box input { border: 0; box-shadow: none !important; margin: 0; padding-left: 0; min-height: 44px; }
.psearch-list { margin-top: .5rem; max-height: 340px; overflow: auto; display: grid; gap: 4px; }
.psearch-item { display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: inherit; cursor: pointer; color: var(--text); }
.psearch-item:hover { border-color: var(--brand-100); background: var(--brand-50); }
.psearch-item svg.i { stroke: var(--faint); }
.seg-toggle { display: inline-flex; background: var(--line-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg-toggle button { border: 0; background: transparent; padding: .3rem .7rem; border-radius: 7px; font: inherit; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-toggle button.on { background: #fff; color: var(--brand-700); box-shadow: var(--shadow); }
.multi-dates { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.mini-cal { width: 280px; max-width: 100%; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: .4rem; }
.mc-h { text-align: center; font-size: .7rem; font-weight: 700; color: var(--faint); padding: .2rem 0; }
.mc-d { aspect-ratio: 1; border: 1px solid transparent; border-radius: 8px; background: #fff; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--text); }
.mc-d:hover:not(:disabled) { border-color: var(--brand-100); background: var(--brand-50); }
.mc-d.out { color: var(--faint); }
.mc-d.off { background: var(--line-2); }
.mc-d.today { border-color: var(--brand); }
.mc-d.sel { background: var(--brand); color: #fff; border-color: var(--brand); }
.mc-d:disabled { color: #d6d1cc; cursor: not-allowed; background: transparent; }
.assign-steps .step > h3 .hint { display: flex; }

/* ---- Live dashboard & charts ---- */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.dash-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 0 1rem; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .dash-2 { grid-template-columns: 1fr; } }
.feed { max-height: 360px; overflow: auto; }
.chart-card { padding-bottom: .6rem; }
svg.viz { width: 100%; height: auto; display: block; margin-top: .6rem; overflow: visible; }
.viz-grid { stroke: var(--line); stroke-width: 1; }
.viz-y { font-size: 11px; fill: var(--muted); text-anchor: end; }
.viz-x { font-size: 11px; fill: var(--muted); text-anchor: middle; }
.viz-label { font-size: 12px; fill: var(--text); text-anchor: end; }
.viz-val { font-size: 12px; fill: var(--muted); font-weight: 600; }
.viz-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .6rem; font-size: .8rem; color: var(--text); }
.viz-legend i, .viz-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.viz-tip { position: fixed; z-index: 80; pointer-events: none; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-radius: 8px; padding: .55rem .7rem; font-size: .8rem; line-height: 1.5; color: var(--text); max-width: 260px; }

/* ---- Driver trips ---- */
.trip .stop { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.trip.done .stop { background: var(--green); }
.trip.done { opacity: .9; }
.transport-line { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .84rem; }
.save-bar { position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--brand-100); box-shadow: var(--shadow-lg); border-radius: var(--radius); padding: .75rem 1rem; margin: .5rem 0 1rem; }
.step .num svg.i { width: 14px; height: 14px; stroke: #fff; }
.sel-search { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; width: 100%; }
.sel-search input { flex: 0 0 170px; margin: 0; min-height: 36px; }
.sel-search select { flex: 1; min-width: 160px; }
label > .sel-search { margin-top: .3rem; }
label > .sel-search select, label > .sel-search input { margin-top: 0; }
.big-toggle a { padding: .45rem .9rem; border-radius: 7px; font-weight: 600; font-size: .88rem; color: var(--muted); display: inline-flex; gap: .3rem; align-items: center; }
.big-toggle a.on { background: #fff; color: var(--brand-700); box-shadow: var(--shadow); }
.big-toggle a.on .muted { color: var(--brand-600); }
/* Lists that are themselves the card: keep the text off the edges */
.list.card { padding: 0; overflow: hidden; }
.list.card > .li { padding: .85rem 1.15rem; }
.list.card > .li.link:hover { background: #fdfbf9; }

/* ---------- Installable app ---------- */
.install-card { display: flex; align-items: center; gap: .8rem; padding: .75rem .9rem; border: 1px solid var(--brand-100); background: var(--brand-50); border-radius: var(--radius-sm); }
.install-card img { flex: none; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.install-card > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.install-card span { font-size: .85rem; color: var(--muted); }
.install-card .btn { flex: none; }
.offline-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: .5rem; max-width: calc(100% - 32px); padding: .55rem .9rem; border-radius: 12px; background: #1f1d1c; color: #fff; font-size: .85rem; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.offline-bar svg { width: 16px; height: 16px; flex: none; }
@media (display-mode: standalone) { body { overscroll-behavior-y: none; } }
