/* AdSafe Job Hub — steel and safety yellow, as on the design canvas. */
:root {
  --bg: #eef1f3; --surface: #ffffff; --sunk: #e3e8ec; --line: #cfd7dd;
  --fg: #17212b; --muted: #5b6977; --steel: #1f3346; --steel-fg: #f2f5f7;
  --accent: #f2b705; --accent-ink: #2a2100;
  --ok: #2e7d4f; --warn: #7a4800; --bad: #b3261e; --info: #2f6690;
  --ok-bg: #e2f2e8; --warn-bg: #fbefd9; --bad-bg: #f9e1df; --info-bg: #e0ecf5;
  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 14px; line-height: 1.45; }
a { color: var(--info); }
a:hover { color: var(--steel); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.push { margin-left: auto; }
.grow { flex: 1 1 200px; min-width: 0; }
.h1, .h2, .h3 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: .02em; }
.h1 { font-size: 28px; text-transform: uppercase; }
.h2 { font-size: 18px; text-transform: uppercase; letter-spacing: .04em; }
.h3 { font-size: 16px; text-transform: uppercase; letter-spacing: .04em; margin-top: 8px; }
ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }

/* top bar */
.top { background: var(--steel); color: var(--steel-fg); }
.top-in { max-width: 1600px; margin: 0 auto; padding: 10px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.brand { display: flex; align-items: baseline; gap: 8px; margin-right: auto; text-decoration: none; color: inherit; }
.brand:hover { color: inherit; }
.brand-name { font-family: var(--display); font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.brand-tag { background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-weight: 700; font-size: 13px; padding: 1px 6px; border-radius: 2px; letter-spacing: .06em; }
.brand-light { color: var(--fg); margin: 0 auto 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.tab { color: var(--steel-fg); opacity: .75; text-decoration: none; font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; padding: 8px 12px; border-radius: 4px; }
.tab:hover { opacity: 1; color: var(--steel-fg); }
.tab.on { opacity: 1; box-shadow: inset 0 -3px 0 var(--accent); }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.who-text { display: flex; flex-direction: column; line-height: 1.2; }
.who-text small { font-size: 11px; opacity: .8; }
.who form { margin: 0; }

/* buttons */
.btn { border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 5px; font-weight: 500; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--fg); }
.btn:hover { border-color: var(--muted); color: var(--fg); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { color: var(--accent-ink); border-color: #b28400; }
.btn-sm { min-height: 30px; padding: 3px 9px; font-size: 13px; }
.btn-danger { color: var(--bad); border-color: var(--bad); }
.btn-ghost-dark { background: transparent; color: var(--steel-fg); border-color: rgba(255, 255, 255, .3); min-height: 32px; }
.btn-ghost-dark:hover { color: var(--steel-fg); border-color: var(--steel-fg); }
.btn-outline-dark { background: transparent; border-color: var(--accent-ink); color: var(--accent-ink); }
.btn-ms { width: 100%; justify-content: center; background: var(--steel); color: var(--steel-fg); border-color: var(--steel); min-height: 44px; }
.btn:disabled { opacity: .55; cursor: default; }

/* layout */
.wrap { max-width: 1600px; margin: 0 auto; padding: 16px 20px 48px; display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.toolbar input[type=search] { flex: 1 1 260px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.split { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.split-main { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.split-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; }
.span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
input, select, textarea { padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); min-height: 36px; max-width: 100%; }
.field input, .field select, .field textarea { background: var(--bg); width: 100%; }
textarea { resize: vertical; }
.flash { padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--info-bg); }
.flash-error { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }

/* chips and tags */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11px; padding: 1px 6px; border-radius: 3px; background: var(--sunk); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.chip.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.chip.tag-conf { background: var(--ok-bg); color: var(--ok); }
.chip.tag-prov { background: var(--warn-bg); color: var(--warn); }
.chip.tag-night { background: var(--info-bg); color: var(--info); }

/* tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; }
td form { margin: 0; }

/* pipeline */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.kpi b { display: block; font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1.1; }
.kpi span { font-size: 12px; color: var(--muted); }
.pipe-scroll { overflow-x: auto; padding-bottom: 8px; }
.pipe { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 250px); gap: 10px; align-items: start; }
.col { background: var(--sunk); border-radius: 6px; padding: 8px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
.col.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col-h { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 8px; border-bottom: 3px solid var(--line); }
.stage-enquiry .col-h { border-color: #8a9aa8; } .stage-survey .col-h { border-color: #5b8db8; }
.stage-quoted .col-h { border-color: #2f6690; } .stage-won .col-h { border-color: #2e7d4f; }
.stage-scheduled .col-h { border-color: #d29b00; } .stage-onsite .col-h { border-color: #e07a10; }
.stage-complete .col-h { border-color: #6a4c93; } .stage-invoiced .col-h { border-color: #3c4a57; }
.stage-lost .col-h { border-color: #b3261e; }
.card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 9px 10px; text-decoration: none; color: var(--fg); cursor: grab; }
.card:hover { border-color: var(--muted); color: var(--fg); }
.card-ref, .card-foot { display: flex; justify-content: space-between; gap: 8px; }
.card-ref { font-size: 11px; color: var(--muted); }
.card-title { font-weight: 600; line-height: 1.25; }
.empty { padding: 8px 4px; margin: 0; }

/* job page */
.stages { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.stage-btn { border: 1px solid var(--line); background: var(--bg); padding: 6px 10px; border-radius: 4px; font-size: 13px; min-height: 34px; }
.stage-btn.on { background: var(--steel); color: var(--steel-fg); border-color: var(--steel); box-shadow: inset 0 -3px 0 var(--accent); }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.checks form { margin: 0; }
.check { width: 100%; display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--line); padding: 8px 10px; border-radius: 5px; min-height: 40px; text-align: left; }
.check.on { background: var(--ok-bg); }
.check .box { width: 18px; height: 18px; border: 1px solid var(--muted); border-radius: 3px; display: grid; place-items: center; font-size: 13px; background: var(--surface); flex: none; }
.doc { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 5px; padding: 7px 9px; background: var(--bg); flex-wrap: wrap; }
.doc a { flex: 1 1 180px; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.draft { border: 1px solid var(--line); border-radius: 5px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.draft-pending { background: #fffbea; }
.draft-body { white-space: pre-wrap; font-family: var(--body); font-size: 13px; background: var(--bg); padding: 8px; border-radius: 4px; margin: 6px 0 0; max-height: 300px; overflow: auto; }
.timeline { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.tl { display: grid; grid-template-columns: 92px 1fr; gap: 8px; font-size: 13px; }
.tl .mono { font-size: 11px; }

/* login */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.dev-login { display: flex; flex-direction: column; gap: 8px; border-top: 1px dashed var(--line); padding-top: 12px; margin: 0; }
.dev-login .btn { justify-content: flex-start; }

/* works programme board */
.board-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.week-nav { display: flex; align-items: center; gap: 6px; }
.week-label { min-width: 230px; text-align: center; font-weight: 500; }
.status-pill { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 5px; font-size: 13px; font-weight: 600; background: var(--sunk); }
.status-pill.ok { background: var(--ok-bg); color: var(--ok); }
.status-pill.bad { background: var(--bad-bg); color: var(--bad); }
.pickbar { background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-weight: 600; }
.pickbar[hidden] { display: none; }
.board-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.board-box { flex: 999 1 720px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; }
.board-grid { display: grid; gap: 6px; min-width: 700px; }
.board-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.van-h { background: var(--accent); color: var(--accent-ink); border-radius: 4px; text-align: center; font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 6px; }
.van-reg { display: block; font-family: var(--body); font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.day-h { padding: 6px 4px 0 0; }
.day-h b { display: block; font-family: var(--display); font-size: 20px; font-weight: 600; }
.cell { background: #f6f8f9; border: 1px solid var(--line); border-radius: 6px; padding: 6px; display: flex; flex-direction: column; gap: 6px; min-height: 118px; min-width: 0; }
.cell.target { border: 2px dashed var(--accent); background: #fffbea; }
.cell.over { border: 2px solid var(--accent); }
.crew { display: flex; flex-wrap: wrap; gap: 4px; min-height: 28px; align-items: center; }
.echip { border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-weight: 600; font-size: 13px; padding: 2px 6px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; cursor: grab; min-height: 28px; }
.echip.clash { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.echip.off { border-color: #b26a00; background: var(--warn-bg); color: var(--warn); }
.echip.picked, .jcard.picked { outline: 3px solid var(--accent); outline-offset: 1px; }
.x { border: 0; background: transparent; color: inherit; padding: 0 2px; font-weight: inherit; line-height: 1.2; min-height: 24px; }
.x.close { opacity: .7; font-size: 15px; }
.jcard { width: 100%; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 5px; padding: 7px 9px; display: flex; flex-direction: column; gap: 3px; cursor: grab; }
.jcard.tag-conf { border-left-color: var(--ok); }
.jcard.tag-prov { border-left-color: #b26a00; }
.jcard.tag-night { border-left-color: var(--info); }
.jcard-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; font-size: 11px; }
.jtag { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tag-conf .jtag { color: var(--ok); } .tag-prov .jtag { color: var(--warn); } .tag-night .jtag { color: var(--info); }
.jtitle { text-align: left; font-weight: 600; font-size: 13px; line-height: 1.25; }
.drop-hint { font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 4px; padding: 10px 6px; text-align: center; }
.place { border: 1px dashed #b28400; background: #fff6cc; color: var(--accent-ink); border-radius: 4px; padding: 4px 8px; font-size: 12px; font-weight: 600; min-height: 28px; }
.eng-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--sunk); }
.legend { display: flex; flex-direction: column; gap: 4px; }

@media (max-width: 640px) {
  .wrap, .top-in { padding-left: 16px; padding-right: 16px; }
  .week-label { min-width: 0; }
}
