:root {
  --ink: #16202e; --sub: #5d6b7e; --line: #e4e8ee; --bg: #f4f6f9; --card: #fff;
  --navy: #0f2a47; --accent: #1f6feb;
  --late: #c62828; --late-bg: #fbd3d3; --soon: #b05e00; --soon-bg: #ffe2bc; --held: #8e24aa; --held-bg: #f6e9f9;
  --ok: #2e7d32;
  --s-intake: #9aa9bb; --s-gate: #d9a441; --s-work: #3b82f6; --s-finalize: #7c5cd6; --s-waiting: #e0794a; --s-hold: #8d7b6c; --s-done: #2e9d5a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.35 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
h1 { margin: 0; font-size: 22px; }
h2 { margin: 26px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--sub); }
.sub { color: var(--sub); }
button { font: inherit; }

/* header */
.top { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--navy); color: #fff; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; letter-spacing: .14em; font-size: 13px; }
.brand b { font-weight: 700; }
@media (max-width: 1360px) and (min-width: 901px) { .top > .brand > span:not(.mark) { display: none; } }
.mark { width: 28px; height: 28px; border-radius: 6px; background: #fff; color: var(--navy); display: grid; place-items: center; font-weight: 800; letter-spacing: 0; }
nav { display: flex; gap: 4px; }
nav a { padding: 6px 12px; border-radius: 6px; color: #c9d6e6; }
nav a.on, nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.filters { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.filters input, .filters select { height: 32px; border: 0; border-radius: 6px; padding: 0 10px; font: inherit; color: var(--ink); background: #fff; }
.filters input[type=search] { width: clamp(140px, 12vw, 220px); }
.filters select { max-width: clamp(110px, 9vw, 170px); }
.clear { color: #c9d6e6; font-size: 13px; }

main { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }

/* page heads */
.pagehead { display: flex; align-items: center; gap: 20px; padding: 18px 20px 4px; flex-wrap: wrap; }
.whohead { display: flex; align-items: center; gap: 14px; padding: 14px 20px 0; flex-wrap: wrap; }
.whohead h1 { display: flex; align-items: center; gap: 10px; }
.crumb { color: var(--sub); font-size: 13px; }
.crumb a { color: var(--accent); }
.toggle { margin-left: auto; display: flex; background: #e3e8ef; border-radius: 8px; padding: 3px; }
.toggle a { padding: 5px 14px; border-radius: 6px; font-size: 13px; color: var(--sub); font-weight: 600; }
.toggle a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,32,52,.12); }
.av { flex: none; font-style: normal; width: 34px; height: 34px; border-radius: 50%; background: #dbe4ef; color: #33475f; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; }

/* kpis */
.kpis { display: flex; gap: 10px; padding: 12px 20px 4px; flex-wrap: wrap; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 16px; min-width: 120px; display: flex; flex-direction: column; }
a.kpi:hover { border-color: #b8c3d1; }
.kpi.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.kpi b { font-size: 22px; font-weight: 700; }
.kpi span { color: var(--sub); font-size: 12px; }
.kpi.late b { color: var(--late); } .kpi.soon b { color: var(--soon); } .kpi.held b { color: var(--held); } .kpi.done b { color: var(--ok); }

/* board: the four working columns share the width; side columns are slim drop zones */
.board { flex: 1; min-height: 360px; display: flex; gap: 10px; padding: 10px 20px 16px; overflow-x: auto; }
.col { flex: 1 1 0; min-width: 250px; display: flex; flex-direction: column; background: #e9edf2; border-radius: 12px; min-height: 0; border-top: 3px solid transparent; }
.col-intake { border-top-color: var(--s-intake); } .col-gate { border-top-color: var(--s-gate); } .col-work { border-top-color: var(--s-work); }
.col-finalize { border-top-color: var(--s-finalize); } .col-waiting { border-top-color: var(--s-waiting); } .col-hold { border-top-color: var(--s-hold); } .col-done { border-top-color: var(--s-done); }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 6px; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #344255; }
.count { font-style: normal; background: #fff; border-radius: 10px; padding: 1px 8px; font-size: 12px; color: var(--sub); }
.list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; min-height: 60px; display: flex; flex-direction: column; gap: 8px; }

.col.slim { flex: 0 0 52px; min-width: 52px; transition: flex-basis .15s; }
.col.slim .col-head { cursor: pointer; flex-direction: column-reverse; gap: 10px; padding: 10px 0; }
.col.slim .col-head .lbl { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.col.slim:not(.open) .list { padding: 0 4px 8px; }
.col.slim:not(.open) .list > .card { display: none; }
.col.slim:not(.open) .list .sortable-ghost { display: block; height: 30px; overflow: hidden; }
.col.slim:not(.open) .list .sortable-ghost > * { display: none; }
.col.slim:not(.open):hover { background: #dfe5ec; }
.col.slim.open { flex: 0 0 300px; min-width: 300px; }
.col.slim.open .col-head { flex-direction: row; padding: 10px 12px 6px; }
.col.slim.open .col-head .lbl { writing-mode: horizontal-tb; transform: none; }
.col.slim.open .col-head::after { content: '‹'; font-size: 18px; color: var(--sub); margin-left: 6px; }

/* cards: white when more than a week out, orange inside a week, red when late */
.card { position: relative; display: flex; gap: 10px; min-width: 0; background: var(--card); border-radius: 8px; padding: 8px; box-shadow: 0 1px 2px rgba(16,32,52,.1); border-left: 4px solid transparent; cursor: grab; }
.card:hover { box-shadow: 0 3px 10px rgba(16,32,52,.16); }
.card.due-late { background: var(--late-bg); border-left-color: var(--late); }
.card.due-soon { background: var(--soon-bg); border-left-color: #e08a00; }
.card.high .title::before { content: '▲ '; color: #e8833a; font-size: 11px; }
.thumb { flex: none; width: 76px; height: 57px; border-radius: 5px; object-fit: cover; background: #eef1f5; }
.cbody { flex: 1; min-width: 0; }
.title { font-weight: 650; font-size: 13.5px; overflow-wrap: anywhere; line-height: 1.25; }
.name { color: var(--sub); font-size: 12px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.scope { flex: none; font-size: 11px; font-weight: 600; color: var(--accent); background: #e8f0fe; border-radius: 4px; padding: 1px 6px; cursor: pointer; white-space: nowrap; }
.scope:hover { background: #d4e3fd; }
.scope.away { color: var(--sub); background: #eef1f5; font-weight: 500; }
.scope.away b { font-weight: 600; }
.scope.big { font-size: 13px; padding: 3px 9px; }
.client { display: block; font-size: 11.5px; color: var(--sub); margin-top: 4px; text-transform: uppercase; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client:hover { color: var(--accent); }
.row3 { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; gap: 6px; }
.who { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.who i { flex: none; font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: #dbe4ef; color: #33475f; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.due { flex: none; font-size: 11.5px; font-weight: 600; border-radius: 4px; padding: 2px 6px; color: var(--sub); background: rgba(16,32,52,.06); }
.card.due-late .due { color: #fff; background: var(--late); }
.card.due-soon .due { color: #fff; background: #d17a00; }
.hold { margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--held); background: var(--held-bg); border-radius: 4px; padding: 2px 6px; display: inline-block; }
.back { margin-top: 6px; font-size: 11.5px; font-weight: 600; color: #0b5cad; background: #dcebfb; border-radius: 4px; padding: 2px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.returned { box-shadow: 0 0 0 2px #5b9be6, 0 1px 2px rgba(16,32,52,.1); }
.sortable-ghost { opacity: .35; }
.sortable-drag { transform: rotate(2deg); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(31,111,235,0); } 30% { box-shadow: 0 0 0 5px rgba(31,111,235,.55); } 60% { box-shadow: 0 0 0 2px rgba(31,111,235,.3); } }
.flash { animation: pulse 1.3s ease-in-out 3; }

/* gallery (client / engineer projects view) */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; padding: 12px 20px 24px; }
.tile { background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(16,32,52,.1); border-top: 4px solid transparent; display: flex; flex-direction: column; }
.tile:hover { box-shadow: 0 4px 14px rgba(16,32,52,.16); }
.tile.due-late { border-top-color: var(--late); } .tile.due-soon { border-top-color: #e08a00; }
.tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eef1f5; display: block; }
.tbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.tile .sub { font-size: 12px; text-transform: uppercase; letter-spacing: .02em; }
.tile .stage { font-size: 12px; font-weight: 600; color: #344255; }
.tile.due-late .due { color: #fff; background: var(--late); } .tile.due-soon .due { color: #fff; background: #d17a00; }
.empty-note { color: var(--sub); padding: 20px; }

/* people */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--sub); }
.legend span { display: flex; align-items: center; gap: 5px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw-intake { background: var(--s-intake); } .sw-gate { background: var(--s-gate); } .sw-work { background: var(--s-work); }
.sw-finalize { background: var(--s-finalize); } .sw-waiting { background: var(--s-waiting); } .sw-hold { background: var(--s-hold); } .sw-done { background: var(--s-done); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; padding: 14px 20px 24px; }
.pcard { background: var(--card); border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(16,32,52,.1); display: flex; flex-direction: column; gap: 10px; border: 1px solid transparent; }
.pcard:hover { border-color: #b8c3d1; }
.pcard.warnc { background: #fff8ec; border-color: #f2d7a6; }
.phead { display: flex; align-items: center; gap: 10px; }
.pname { font-weight: 650; font-size: 15px; overflow-wrap: anywhere; }
.psub { color: var(--sub); font-size: 12px; }
.pbig { margin-left: auto; font-size: 26px; font-weight: 700; color: #344255; }
.pbar, .mbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #eef1f5; min-width: 24px; }
.pbar i, .mbar i { display: block; height: 100%; }
.mbar { width: 160px; }
.pstats { display: flex; gap: 6px; flex-wrap: wrap; }
.pstats span, .pill { font-size: 12px; font-weight: 600; border-radius: 10px; padding: 2px 9px; }
.pstats .late, .pill.late { background: #fde4e4; color: var(--late); }
.pstats .soon, .pill.soon { background: #fff0db; color: var(--soon); }
.pstats .held, .pill.held { background: var(--held-bg); color: var(--held); }
.pstats .okc { background: #e6f4ea; color: var(--ok); }
.pnext { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.pnext li { display: flex; justify-content: space-between; gap: 8px; }
.pnext li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pnext em, .due-late-t, .due-soon-t, .due-ok-t, .due-none-t { font-style: normal; font-weight: 600; white-space: nowrap; }
.pnext .due-late, .due-late-t { color: var(--late); } .pnext .due-soon, .due-soon-t { color: var(--soon); } .pnext .due-ok, .pnext .due-none, .due-ok-t, .due-none-t { color: var(--sub); }

/* clients table */
.tfilter { height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; font: inherit; width: 240px; }
.tablewrap { padding: 12px 20px 24px; overflow: auto; }
.ctable { border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; width: 100%; min-width: 860px; box-shadow: 0 1px 2px rgba(16,32,52,.08); }
.ctable th, .ctable td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.ctable th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--sub); background: #f8fafc; }
.ctable tbody tr { cursor: pointer; } .ctable tbody tr:hover { background: #f5f8fc; }
.ctable .n { text-align: right; } .strong { font-weight: 650; }
.ctable td.sub { font-size: 12.5px; }

/* project page */
.project { padding: 16px 24px 40px; max-width: 1200px; width: 100%; margin: 0 auto; }
.phero { display: flex; gap: 24px; margin-top: 8px; flex-wrap: wrap; }
.phero .cover { flex: 0 0 420px; max-width: 100%; }
.pinfo { flex: 1; min-width: 280px; }
.pinfo .sub { margin-top: 4px; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 16px 0 0; font-size: 13.5px; }
.kv dt { color: var(--sub); } .kv dd { margin: 0; } .kv a { color: var(--accent); }
.pnotes { margin-top: 14px; white-space: pre-line; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: #344255; }
.scopes { display: flex; flex-direction: column; gap: 10px; }
.srow { background: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(16,32,52,.08); }
.shead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.shead .who:hover { color: var(--accent); }
.shead .hold { margin: 0; }
.ghost { margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 12px; cursor: pointer; }
.steps { list-style: none; display: flex; margin: 12px 0 0; padding: 0; counter-reset: s; }
.steps li { flex: 1; position: relative; text-align: center; font-size: 12px; color: var(--sub); padding-top: 18px; }
.steps li::before { content: ''; position: absolute; top: 5px; left: 0; right: 0; height: 4px; background: #e3e8ef; }
.steps li::after { content: ''; position: absolute; top: 1px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff; border: 2px solid #c9d2dd; }
.steps li.done::before, .steps li.on::before { background: var(--s-work); }
.steps li.done::after { background: var(--s-work); border-color: var(--s-work); }
.steps li.on { color: var(--ink); font-weight: 700; }
.steps li.on::after { border-color: var(--s-work); box-shadow: 0 0 0 4px #d6e6fd; }
.side { margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--s-waiting); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

/* cover image (drop, paste, click) */
.cover { position: relative; border-radius: 10px; overflow: hidden; background: #eef1f5; }
.cover img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.cover.small { margin-top: 12px; } .cover.small img { aspect-ratio: 16 / 9; }
.cover-btn { position: absolute; right: 8px; bottom: 8px; background: rgba(15,42,71,.78); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.cover:hover .cover-btn { opacity: 1; }
.cover.over { outline: 3px dashed var(--accent); outline-offset: -3px; }
.cover.busy { opacity: .5; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(15,42,71,.25); z-index: 9; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: #fff; box-shadow: -8px 0 24px rgba(16,32,52,.18); overflow-y: auto; z-index: 10; }
.drawer-body { padding: 18px 22px 30px; }
.dhead { display: flex; justify-content: space-between; align-items: flex-start; }
.dcode { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.dsub { color: var(--sub); margin-top: 2px; font-size: 13px; }
.dsub a:hover { color: var(--accent); }
.x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--sub); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.tabs a { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 6px; background: #eef1f5; color: #344255; }
.tabs a em { font-style: normal; font-weight: 400; color: var(--sub); }
.tabs a.on { background: var(--accent); color: #fff; } .tabs a.on em { color: #dbe7ff; }
.tabs .plink { margin-left: auto; background: none; color: var(--accent); }
.dhold { margin: 12px 0 0; background: var(--held-bg); color: var(--held); border-radius: 6px; padding: 8px 10px; font-weight: 600; font-size: 13px; }
#jobform, #fixform, #askform { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
#jobform label, #fixform label, #askform label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sub); font-weight: 600; }
#jobform :is(input, select, textarea), #fixform :is(input, select, textarea), #askform textarea { font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: #fff; font-weight: 400; }
:is(#jobform, #fixform, #askform) :is(input, select, textarea):focus { outline: 2px solid #bcd3fb; border-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.err { background: #fdecec; color: var(--late); border-radius: 6px; padding: 8px 10px; font-weight: 600; font-size: 13px; }
.actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.actions button { border-radius: 6px; padding: 8px 16px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.actions .primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.facts { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.facts span { display: inline-block; width: 100px; color: var(--sub); }
h4 { margin: 18px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--sub); }
.mini { margin: 0; padding: 0; list-style: none; font-size: 12.5px; display: flex; flex-direction: column; gap: 5px; }
.mini em { color: var(--sub); font-style: normal; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(15,42,71,.35); display: grid; place-items: center; z-index: 30; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 12px; width: min(480px, 100%); padding: 18px 22px 20px; box-shadow: 0 16px 40px rgba(0,0,0,.25); }
.modal-box form { margin-top: 0 !important; }
.mhead { font-size: 17px; font-weight: 700; }
.mhead.warn { color: var(--late); }
.mproj { font-weight: 650; display: flex; gap: 8px; align-items: center; }
.mmsg { font-size: 14px; line-height: 1.45; background: #f5f7fa; border-radius: 8px; padding: 10px 12px; }
.mhint { margin: 0; font-size: 12.5px; color: var(--sub); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #2b1214; color: #fff; padding: 10px 16px; border-radius: 8px; max-width: 560px; font-size: 13.5px; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 40; }
.toast.good { background: #133a1c; }

@media (max-width: 900px) {
  .filters { margin-left: 0; width: 100%; } .filters input[type=search] { flex: 1; width: auto; }
  .col { min-width: 270px; }
  .top nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; } .top nav a { white-space: nowrap; flex: none; }
  .top .filters { order: 4; } .top .filters > * { min-width: 0; flex: 1; } .top .filters select { max-width: none; }
  .top > .me, .filters + .me { margin-left: auto; }
}

/* sign-in, account, user menu */
.loginpage { display: grid; place-items: center; background: linear-gradient(160deg, #0f2a47, #1d4a78); }
.loginbox { background: #fff; border-radius: 14px; padding: 28px 30px; width: min(380px, 92vw); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.loginbox h1 { font-size: 20px; margin: 6px 0 2px; }
.brand.dark { color: var(--navy); } .brand.dark .mark { background: var(--navy); color: #fff; }
.loginbox label, .stack label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sub); font-weight: 600; }
.loginbox input, .stack input, .stack select { font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-weight: 400; }
.loginbox .primary, .primary-btn { font: inherit; background: var(--accent); border: 0; color: #fff; font-weight: 600; border-radius: 6px; padding: 9px 16px; cursor: pointer; }
.primary-btn { margin-left: auto; padding: 7px 14px; }
.small { font-size: 12px; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack label.check { flex-direction: row; align-items: center; gap: 8px; }
.narrow { max-width: 420px; padding: 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.okmsg { background: #e6f4ea; color: var(--ok); border-radius: 6px; padding: 8px 10px; font-weight: 600; }
.me { position: relative; margin-left: auto; }
.filters + .me { margin-left: 4px; }
.me summary { list-style: none; cursor: pointer; } .me summary::-webkit-details-marker { display: none; }
.av.sm { width: 30px; height: 30px; font-size: 11px; background: #fff; color: var(--navy); }
.menu { position: absolute; right: 0; top: 40px; background: #fff; color: var(--ink); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); min-width: 200px; padding: 8px; z-index: 20; display: flex; flex-direction: column; }
.menu .mname { font-weight: 650; padding: 6px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu .mname span { font-weight: 400; font-size: 12px; color: var(--sub); }
.menu a, .menu button { text-align: left; padding: 7px 10px; border-radius: 6px; border: 0; background: none; cursor: pointer; font-size: 13.5px; width: 100%; }
.menu a:hover, .menu button:hover { background: #f1f4f8; }
.ghost.sm { padding: 3px 9px; font-size: 12.5px; margin: 0; }
.nowrap { white-space: nowrap; }
.ctable.staff tbody tr { cursor: default; }
.ctable tr.inactive td { opacity: .55; }
.pill.role-admin { background: #e8f0fe; color: var(--accent); } .pill.role-operations { background: #fff0db; color: var(--soon); }
.pill.role-engineer, .pill.role-drafter, .pill.role-contract_engineer { background: #eef1f5; color: #344255; }
.pwbox { font: 600 20px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .04em; background: #f5f7fa; border: 1px dashed #b8c3d1; border-radius: 8px; padding: 12px; text-align: center; user-select: all; }
.empty-board .list:empty::after { content: ''; }
.pad { padding: 0 20px; }
.portal-link { margin-left: auto; text-decoration: none; display: inline-block; font-size: 13px; }
.portal-link + .toggle { margin-left: 0; }
a.ghost { display: inline-block; color: var(--ink); }
.pill.okp { background: #e6f4ea; color: var(--ok); }
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.items label { display: inline-flex; gap: 6px; align-items: flex-start; cursor: pointer; }
.items em { display: block; margin-left: 22px; font-style: normal; color: var(--sub); font-size: 11.5px; }
.items li.res label { text-decoration: line-through; color: var(--sub); }
.itemform { display: flex; gap: 6px; margin-top: 8px; }
.itemform input { flex: 1; min-width: 0; font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.itemform select, .itemform button { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; cursor: pointer; }

/* new job */
nav a.newbtn { background: var(--accent); color: #fff; margin-left: 8px; }
nav a.newbtn.on { background: #fff; color: var(--navy); }
.newjob { max-width: 920px; padding: 8px 20px 40px; display: flex; flex-direction: column; gap: 14px; }
.newjob fieldset { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.newjob legend { font-weight: 700; padding: 0 6px; }
.newjob legend .sub { font-weight: 400; font-size: 12.5px; margin-left: 6px; }
.newjob label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--sub); }
.newjob input, .newjob select, .newjob textarea { font: inherit; font-size: 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font-weight: 400; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.scopepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.scopepick label.chk { flex-direction: row; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; cursor: pointer; font-weight: 400; color: var(--ink); }
.scopepick label.chk:has(input:checked) { border-color: var(--accent); background: #eef4ff; }
.scopepick label.chk b { min-width: 52px; }
.scopepick label.chk span { font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.newjob .prdonly { max-width: 300px; display: none; }
.newjob:has(input[value="PRD"]:checked) .prdonly { display: flex; }
.newjob .actions { display: flex; gap: 10px; align-items: center; }
.newjob .actions .primary { font: inherit; background: var(--accent); border: 0; color: #fff; font-weight: 600; border-radius: 6px; padding: 9px 18px; cursor: pointer; }
.newjob .actions .ghost { margin-left: 0; padding: 8px 14px; color: var(--ink); }
.newflash { margin: 12px 20px 0; background: #e6f4ea; color: #2e7d32; border-radius: 8px; padding: 9px 14px; font-weight: 600; }
@media (max-width: 700px) { .three { grid-template-columns: 1fr; } }

/* awaiting deposit: no clock yet */
.card.due-deposit .due, .tile.due-deposit .due { color: #5b3fa0; background: #efe9fb; }
.pnext .due-deposit, .due-deposit-t { color: #5b3fa0; font-style: normal; font-weight: 600; white-space: nowrap; }
/* sign-up */
.loginlinks { display: flex; justify-content: space-between; }
.loginbox input.code { font-size: 22px; letter-spacing: 6px; text-align: center; }
.loginbox select { font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-weight: 400; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; }
.narrow h2 { font-size: 16px; margin: 10px 0 0; }
.domains h2 { margin-bottom: 4px; }
.domlist { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.domlist .dom { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 8px 6px 12px; }
.domadd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.domadd input { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; min-width: 240px; }
.domadd .primary-btn { margin-left: 0; }
.staffdom { padding-top: 0; }
.staffdom input { min-width: 280px; }
.pill.joined { background: #eef2ff; color: #4338ca; font-weight: 600; }
.domadd.sugg { margin-top: 8px; }
/* billing / QuickBooks */
.navn { background: #f59e0b; color: #111; border-radius: 9px; padding: 0 6px; font-size: 11px; font-weight: 700; margin-left: 3px; }
.qbo-when { font-weight: 400; color: var(--sub); font-size: 11px; text-transform: none; letter-spacing: 0; margin-left: 6px; }
.paytbl { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0 8px; }
.paytbl td { padding: 5px 4px; border-bottom: 1px solid var(--line); }
.paytbl td.n { text-align: right; font-variant-numeric: tabular-nums; }
.pst { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; border-radius: 4px; background: #eef1f5; color: var(--sub); }
.ps-paid .pst { background: #e6f4ea; color: var(--ok); }
.ps-invoiced .pst { background: #fff4e0; color: #9a5b00; }
.qbo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.err-t { color: #b42318; font-size: 12px; }
.billtbl .lines { max-width: 300px; }
.linkform { display: flex; gap: 6px; }
.linkform input { font: inherit; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; width: 270px; }
.sugg { font-size: 11px; color: #4338ca; }
.rs-done { color: var(--ok); } .rs-failed { color: #b42318; } .rs-running, .rs-queued { color: #9a5b00; }
form.inline { display: inline; }
.pagehead form { margin-left: auto; }
.paysum { font-weight: 700; font-size: 14px; padding: 6px 10px; border-radius: 6px; margin: 4px 0 6px; }
.paysum.ps-full { background: #e6f4ea; color: var(--ok); }
.paysum.ps-part { background: #fff4e0; color: #9a5b00; }
.paysum.ps-none { background: #f3f4f6; color: var(--sub); }
/* tasks */
.taskadd { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0 14px; }
.taskadd input, .taskadd select { font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: #fff; }
.taskadd input[name=title] { flex: 1 1 320px; min-width: 200px; }
.taskadd input[name=job] { flex: 0 1 260px; }
.taskadd .hrs { width: 58px; }
.taskadd.mini { margin: 4px 0 12px; }
.taskadd.mini input[name=title] { flex: 1 1 100%; }
.taskadd.mini button { font: inherit; font-size: 12px; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.whosel { margin-left: auto; }
.whosel select { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; }
.tqueue { max-width: 980px; }
.tgroup h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--sub); margin: 16px 0 6px; }
.tg-late h2 { color: #b42318; } .tg-today h2 { color: #b45309; } .tg-tomorrow h2 { color: #9a5b00; }
.tlist { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dtasks { margin-bottom: 4px; }
.trow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.trow:first-child { border-top: 0; }
.trow input[type=checkbox] { width: 18px; height: 18px; flex: none; cursor: pointer; accent-color: var(--ok); }
.trow.p1 { box-shadow: inset 3px 0 0 #dc2626; }
.trow.done .ttitle { text-decoration: line-through; color: var(--sub); }
.tmain { flex: 1; min-width: 0; }
.ttitle { font-weight: 600; } .ttitle a { color: inherit; text-decoration: none; } .ttitle a:hover { text-decoration: underline; }
.tmeta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--sub); margin-top: 2px; }
.tmeta a { color: var(--accent); text-decoration: none; }
.tsrc { background: #eef2ff; color: #4338ca; border-radius: 4px; padding: 0 5px; }
.tnotes { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.thrs { font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }
.tdue { font-size: 12px; font-weight: 600; color: var(--sub); white-space: nowrap; min-width: 70px; text-align: right; }
.tdue-late { color: #b42318; } .tdue-today { color: #b45309; } .tdue-tomorrow { color: #9a5b00; }
.tkind { font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 2px 5px; border-radius: 4px; background: #0f2a47; color: #fff; flex: none; width: 30px; text-align: center; }
.k-qc .tkind { background: #7c3aed; }
.k-deliver, .k-qc { background: #fbfcfe; }
.tdone { margin-top: 18px; } .tdone summary { cursor: pointer; color: var(--sub); font-size: 13px; margin-bottom: 6px; }
.empty-q { padding: 30px 0; }
button.danger { color: #b42318; margin-left: auto; }
/* same / next-day deliveries */
.card.hot { box-shadow: 0 0 0 2px #f59e0b, 0 6px 16px rgba(245, 158, 11, .25); }
.card.hot .due { background: #f59e0b; color: #111; font-weight: 800; }
.ctasks { font-size: 11px; color: var(--sub); margin-top: 4px; }
.ctasks.late { color: #b42318; font-weight: 600; }
/* workload */
.pload { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--sub); margin: 8px 0 2px; }
.pload b { color: var(--ink); font-size: 14px; }
.pload .late b { color: #b42318; } .pload .soon b, .pload .hotc b { color: #b45309; }
.plink { color: var(--accent); cursor: pointer; text-decoration: underline; }
