/* Jobs Kanban board + forecast strip with Pull forward (2026-10-28). Desktop browser only (Ed: "There is no phone").
   The structure and states of the old jobs board (koruai-jobs-site): one column per stage, count pills, '?' stage help, collapsed empty columns that open into
   drop targets while dragging, white tiles with an accent edge when overdue, a Move to pill, and a dark strip with a Now tile, month cards and Pull forward pills. */

/* ---------- view toggle + board toolbar ---------- */
.viewtoggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-pill); overflow: hidden; background: var(--surface); }
.viewtoggle button { font: inherit; font-weight: 600; font-size: 13px; border: 0; background: transparent; color: var(--muted); padding: 8px 16px; cursor: pointer; min-height: 38px; transition: background var(--motion), color var(--motion); }
.viewtoggle button:hover { background: var(--surface-2); }
.viewtoggle button[aria-pressed="true"] { background: var(--brand-green); color: var(--white); }
.board-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.board-bar .spacer { flex: 1; }
.confirmtoggle { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: var(--radius-pill); padding: 5px 14px; cursor: pointer; min-height: 32px; }
.confirmtoggle[aria-pressed="true"] { background: var(--brand-green-light); color: var(--ok); border-color: var(--brand-green-mid); }

/* ---------- board and columns ---------- */
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding: 4px 2px 18px; min-height: 360px; }
.col { flex: 0 0 292px; max-width: 292px; background: var(--col-bg); border: 1px solid var(--border); border-radius: var(--radius-m); display: flex; flex-direction: column; max-height: calc(100vh - 230px); transition: flex-basis .18s ease, max-width .18s ease, background .18s ease; }
.col-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--border); border-radius: var(--radius-m) var(--radius-m) 0 0; flex: none; display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.col-head .nm { font-weight: 700; font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.col-tip { text-decoration: underline dashed var(--brand-green-mid); text-underline-offset: 4px; cursor: help; }
.colcnt { background: var(--brand-green-light); color: var(--ok); border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; padding: 1px 9px; }
.sop-btn { font: inherit; font-size: 12px; font-weight: 700; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--brand-blue); cursor: pointer; flex: none; padding: 0; line-height: 1; }
.sop-btn:hover { background: var(--brand-blue-light); }
.col-list { padding: 10px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; flex: 1; min-height: 64px; border-radius: 0 0 var(--radius-m) var(--radius-m); }
.col-empty { text-align: center; font-size: 13px; color: var(--muted); padding: 12px 0; }
.col.finish .col-head .nm::after { content: "finishes the job"; font-size: 11px; font-weight: 600; color: var(--muted); }
.col.blocked .col-head .nm::after { content: "move in XPM"; font-size: 11px; font-weight: 600; color: var(--warn); }
/* empty columns shrink to a slim vertical strip and open into drop targets while a tile is being dragged */
.col.collapsed { flex: 0 0 54px; max-width: 54px; min-width: 54px; background: var(--col-bg-collapsed); }
.col.collapsed .col-head { border-bottom: 0; flex-direction: column; align-items: center; padding: 12px 0; }
.col.collapsed .col-head .nm { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; white-space: nowrap; color: var(--muted); }
.col.collapsed .col-head .nm::after, .col.collapsed .col-head .sop-btn, .col.collapsed .col-empty { display: none; }
.col.collapsed .col-list { min-height: 120px; padding: 0; }
.board.dragging .col.collapsed { flex: 0 0 210px; max-width: 210px; background: var(--col-bg); }
.board.dragging .col.collapsed .col-head { flex-direction: row; align-items: flex-start; padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.board.dragging .col.collapsed .col-head .nm { writing-mode: horizontal-tb; transform: none; font-size: 13px; white-space: normal; color: var(--text); }
.board.dragging .col.collapsed .col-head .nm::after, .board.dragging .col.collapsed .col-head .sop-btn { display: inline; }
.board.dragging .col.collapsed .col-list { min-height: 150px; padding: 10px; outline: 2px dashed var(--drop); outline-offset: -8px; background: rgba(75, 198, 140, .10); }
.board.dragging .col:not(.collapsed) .col-list { transition: background .15s ease; }
.board.dragging .col.over .col-list { background: rgba(75, 198, 140, .14); }

/* ---------- tiles ---------- */
.jtile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; box-shadow: var(--shadow-card); cursor: grab; user-select: none; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.jtile:hover { box-shadow: 0 3px 10px rgba(0, 0, 0, .10); border-color: var(--brand-green-mid); }
.jtile.readonly { cursor: default; }
.jtile.overdue { border-left: 3px solid var(--danger); }
.jtile .nm { font-weight: 700; font-size: 15px; color: var(--text); }
.jtile .jb { font-size: 13px; color: var(--muted); margin-top: 1px; }
.jtile .due { font-size: 13px; font-weight: 600; color: var(--neutral); margin-top: 6px; }
.jtile .due.late { color: var(--danger); font-weight: 700; }
.jtile .staff { display: flex; flex-direction: column; gap: 4px; margin-top: 7px; }
.jtile .stf { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--neutral); font-weight: 600; }
.jav { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-green-light); color: var(--ok); font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.jtile-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.jtile-foot .openbtn { min-height: 32px; padding: 2px 10px; font-size: 12.5px; gap: 6px; }
.jtile-foot .openbtn .ico { width: 15px; height: 15px; }
.jtile.drag-ghost { opacity: .45; background: var(--brand-green-light); border-style: dashed; }
.jtile.drag-active, .jtile.sortable-drag { box-shadow: 0 10px 26px rgba(0, 0, 0, .22); transform: rotate(1.5deg); cursor: grabbing; }
.jtile.flash { animation: tileFlash 1.5s ease; }
@keyframes tileFlash { 0% { box-shadow: 0 0 0 4px var(--drop); } 100% { box-shadow: var(--shadow-card); } }
.jtile.landed { animation: tileLand .5s ease; }
@keyframes tileLand { 0% { transform: scale(.96); box-shadow: 0 0 0 3px var(--drop); } 100% { transform: scale(1); box-shadow: var(--shadow-card); } }

/* Move to pill (same idea as the old board's state dropdown: dark pill with a chevron) */
.movepill { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 700; font-size: 13px; background: var(--brand-green); color: var(--white); border: 1px solid var(--brand-green); border-radius: var(--radius-pill); padding: 4px 10px 4px 13px; min-height: 32px; cursor: pointer; transition: background var(--motion); }
.movepill:hover { background: var(--brand-green-hover); }
.movepill[aria-expanded="true"] { background: var(--brand-green-hover); }
.movepill .ico { width: 14px; height: 14px; }
.stagemenu { position: fixed; z-index: 45; width: 290px; max-height: min(70vh, 460px); overflow-y: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-float), 0 8px 24px rgba(0, 0, 0, .10); animation: menuIn .12s ease; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.stagemenu button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; text-align: left; font: inherit; font-size: 14px; font-weight: 600; background: none; border: 0; border-bottom: 1px solid var(--border-soft); color: var(--text); padding: 9px 14px; cursor: pointer; }
.stagemenu button:last-child { border-bottom: 0; }
.stagemenu button:hover:not([disabled]) { background: var(--brand-green-light); }
.stagemenu button[disabled] { cursor: default; }
.stagemenu button.current { background: var(--brand-green-light); font-weight: 800; }
.stagemenu .mark { font-size: 12px; color: var(--muted); font-weight: 600; flex: none; }
.stagemenu .more { color: var(--brand-blue); border-top: 1px solid var(--border); }

/* ---------- stage help panel (the old board's '?') ---------- */
.sop-back { position: fixed; inset: 0; background: var(--overlay); z-index: 55; animation: fadeIn .15s ease; }
.sop-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw); background: var(--surface); box-shadow: -8px 0 28px rgba(0, 0, 0, .18); padding: 24px; overflow-y: auto; animation: panelIn .2s ease; }
@keyframes panelIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.sop-head h2 { margin: 0; font-size: 18px; }
.sop-meta { color: var(--ok); font-weight: 600; margin: 0 0 14px; }
.sop-body { line-height: 1.6; white-space: pre-wrap; }

/* ---------- confirm dialogs (old board look: coloured head band, large body, Cancel and a strong confirm) ---------- */
.cbox { background: var(--surface); border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .28); width: min(440px, 100%); overflow: hidden; animation: dlgIn .16s ease; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.cbox .c-head { background: var(--band); color: var(--band-text); font-weight: 700; font-size: 16px; padding: 16px 22px; }
.cbox .c-body { padding: 18px 22px 6px; }
.cbox .c-body p { margin: 0 0 10px; color: var(--neutral); }
.cbox .c-body p.fire { font-weight: 700; color: var(--pf); }
.cbox .btns { display: flex; gap: 10px; justify-content: flex-end; padding: 10px 22px 20px; }
.btn.pf { background: var(--pf); border-color: var(--pf); }
.btn.pf:hover { background: var(--pf-hover); }
.pf-kind { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pf-dates { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: baseline; margin: 6px 0 4px; }
.pf-dates dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pf-dates dd { margin: 0; font-weight: 600; }
.pf-due-big { font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.pf-change { font: inherit; background: none; border: 0; padding: 4px 0; color: var(--brand-blue); text-decoration: underline; cursor: pointer; font-weight: 600; }
.pf-delta { color: var(--pf); font-weight: 600; }
.pf-input { font: inherit; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-s); }
.pf-warn { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-s); padding: 8px 12px; font-size: 13px; font-weight: 600; margin: 8px 0 10px; }

/* ---------- toast with Undo (fixed, bottom centre, like the old board's toast) ---------- */
.mv-status { position: fixed; z-index: 48; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: min(720px, calc(100vw - 48px)); margin: 0; padding: 12px 18px; border-radius: var(--radius-pill); background: var(--band); color: var(--band-text); box-shadow: 0 8px 28px rgba(0, 0, 0, .28); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-weight: 600; animation: toastIn .22s ease; }
.mv-status.err { background: var(--danger); color: var(--white); }
.mv-status .linkbtn { color: var(--drop); font-weight: 800; text-decoration: none; padding: 2px 8px; border-radius: var(--radius-pill); }
.mv-status.err .linkbtn { color: var(--white); text-decoration: underline; }
.mv-status .linkbtn:hover { background: rgba(255, 255, 255, .12); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- forecast strip with Pull forward ---------- */
.fc { margin: 14px 0 18px; }
.strip { background: linear-gradient(180deg, var(--band), #0b2116); border-radius: var(--radius-m); padding: 12px; box-shadow: var(--shadow-card); }
.strip-note { color: var(--band-muted); font-size: 12px; margin: 0 2px 10px; }
.strip-row { display: flex; gap: 10px; overflow-x: auto; align-items: flex-start; padding-bottom: 4px; }
.now-card, .month-card { flex: 0 0 auto; border-radius: 10px; padding: 10px 12px; }
.now-card { flex-basis: 96px; align-self: stretch; min-height: 92px; background: var(--band-2); color: var(--band-text); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1.5px dashed rgba(255, 255, 255, .38); transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }
.now-card .now-label { font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.now-card .now-sub { font-size: 12px; opacity: .75; margin-top: 2px; }
.now-card .now-hint { font-size: 11px; opacity: .6; margin-top: 8px; }
.strip.dragging-entry .now-card { border-color: var(--drop); background: rgba(75, 198, 140, .18); }
.strip .now-card.drop-hover, .strip.dragging-entry .now-card.drop-hover { background: var(--drop); color: var(--band); border-style: solid; border-color: var(--drop); transform: scale(1.04); box-shadow: 0 0 0 4px rgba(75, 198, 140, .35); }
.month-card { flex-basis: 232px; background: rgba(255, 255, 255, .07); border: 1px solid var(--band-line); color: var(--band-text); transition: border-color .15s ease, background .15s ease; }
.month-card:hover { background: rgba(255, 255, 255, .10); }
.month-card.current { border-color: var(--drop); }
.month-card.expanded { flex-basis: 330px; }
.mc-head { display: block; width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; padding: 0; cursor: pointer; }
.mc-label { font-weight: 800; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.mc-label .due-now { font-size: 11px; font-weight: 700; color: var(--drop); }
.mc-chev { opacity: .7; font-size: 11px; transition: transform .15s ease; }
.month-card.expanded .mc-chev { transform: rotate(180deg); }
.kind-row { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
.kind-chip { flex: none; border-radius: 6px; font-size: 11px; font-weight: 800; padding: 1px 7px; background: var(--k-bg); color: var(--k-ink); }
.split-bar { flex: 1; height: 7px; border-radius: 999px; overflow: hidden; display: flex; background: rgba(255, 255, 255, .10); min-width: 36px; }
.seg-real { background: var(--kd); }
.seg-proj { background-color: color-mix(in srgb, var(--kd) 28%, transparent); background-image: repeating-linear-gradient(45deg, var(--kd) 0, var(--kd) 3px, transparent 3px, transparent 6px); }
.kind-counts { flex: none; color: var(--band-muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.mc-empty { color: var(--band-muted); font-size: 13px; margin-top: 6px; }
.month-entries { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.entry-row { display: flex; align-items: center; gap: 7px; background: rgba(255, 255, 255, .06); border: 1px solid var(--band-line); border-radius: 8px; padding: 6px 8px; cursor: grab; transition: background .15s ease, opacity .15s ease, transform .15s ease; }
.entry-row:hover { background: rgba(255, 255, 255, .12); }
.entry-row.dragging-entry { opacity: .45; transform: scale(.98); }
.entry-row.nodrag { cursor: default; }
.entry-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--kd); }
.entry-row.projected .entry-dot { background: transparent; border: 1.5px dashed var(--kd); }
.entry-nm { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-kind-tag { flex: none; font-size: 10px; color: var(--band-muted); font-weight: 700; text-transform: uppercase; }
.entry-pf-btn { flex: none; font: inherit; background: var(--pf); color: var(--white); border: 0; border-radius: var(--radius-pill); font-size: 12px; font-weight: 800; padding: 4px 11px; min-height: 28px; cursor: pointer; transition: background var(--motion), transform var(--motion); }
.entry-pf-btn:hover { background: var(--pf-hover); transform: translateY(-1px); }
.entry-meta { flex-basis: 100%; font-size: 11px; color: var(--band-muted); margin-left: 16px; }
.entry-row { flex-wrap: wrap; }
.strip :focus-visible { outline: 2px solid var(--focus-ring-on-dark); outline-offset: 2px; }
.fc-toggle { transition: background var(--motion); }

/* ---------- timer (Jobs page; the shared timer) ---------- */
.timerbtn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 700; font-size: 13px; background: var(--surface); color: var(--ok); border: 1px solid var(--brand-green-mid); border-radius: var(--radius-pill); padding: 4px 12px; min-height: 32px; cursor: pointer; transition: background var(--motion), border-color var(--motion); }
.timerbtn:hover:not([disabled]) { background: var(--brand-green-light); border-color: var(--brand-green); }
.timerbtn[disabled] { opacity: .6; cursor: default; }
.timerbtn.on { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); font-variant-numeric: tabular-nums; }
.timerbtn.on:hover:not([disabled]) { background: #fbd2cd; }
.tm-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); flex: none; animation: tmPulse 1.4s ease-in-out infinite; }
@keyframes tmPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
.jt-bar { position: fixed; z-index: 47; top: 14px; right: 24px; max-width: min(560px, calc(100vw - 300px)); display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: var(--radius-pill); background: var(--surface); color: var(--text); border: 1px solid var(--danger); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); font-weight: 600; animation: jtIn .22s ease; }
@keyframes jtIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.jt-bar.hidden { display: none; }
.jt-bar .jt-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jt-bar .jt-time { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--danger); }
.jt-bar .btn.small { min-height: 30px; padding: 2px 14px; }
.jtile-foot .timerbtn { min-height: 32px; }
