/* dispatch-board.css — the Calendar's Day timeline (assets/js/dispatch-board.js).
   Touch-first: 48px+ targets, big blocks, a bottom sheet for details. */

.db { --who: 168px; --row: 66px; display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.db--manager { grid-template-columns: 290px minmax(0, 1fr); }
.db-main { min-width: 0; }
.db-empty { padding: 24px; text-align: center; color: #8A8A8A; }

/* ── Search + chips ── */
.db-search { width: 100%; min-height: 48px; padding: 0 14px 0 40px; font: 16px 'Barlow', sans-serif; color: #F0F0F0; border: 1px solid #3D3D3D; outline: none; -webkit-appearance: none; appearance: none;
    background: #141414 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238A8A8A' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 12px center; }
.db-search:focus { border-color: #F5C209; }
.db-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.db-search--people { max-width: 260px; }
.db-chips { display: inline-flex; border: 1px solid #3D3D3D; flex: none; }
.db-chips button { min-height: 48px; padding: 0 18px; background: #1C1C1C; color: #A0A0A0; border: none; font: 700 15px 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .5px; cursor: pointer; }
.db-chips button.active { background: #F5C209; color: #111; }
.db-sidetoggle { display: none; min-height: 48px; padding: 0 16px; margin-left: auto; background: #1C1C1C; color: #F0F0F0; border: 1px solid #3D3D3D; font: 700 15px 'Barlow Condensed', sans-serif; text-transform: uppercase; cursor: pointer; }

/* ── Project tiles ── */
.db-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 24px); }
.db-tiles { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-right: 2px; -webkit-overflow-scrolling: touch; }
.db-tile { position: relative; display: grid; grid-template-columns: 1fr auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; min-height: 62px; padding: 10px 6px 10px 16px; background: #1C1C1C; border: 1px solid #333; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.db-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: hsl(var(--h) 70% 62%); }
.db-tile.is-selected { border-color: #F5C209; background: #2A2610; box-shadow: 0 0 0 1px #F5C209; }
.db-tile.is-idle { opacity: .65; }
.db-tile-name { grid-column: 1; font-weight: 700; font-size: 15px; color: #F0F0F0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-tile-sub { grid-column: 1; grid-row: 2; font-size: 12px; color: #8A8A8A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-tile-on { grid-column: 2; grid-row: 1 / 3; min-width: 30px; height: 30px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; font: 700 15px 'Barlow Condensed', sans-serif; background: #2E4A35; color: #4ADE80; }
.db-tile-on.is-zero { background: #3A3320; color: #F5C209; }
.db-grip { grid-column: 3; grid-row: 1 / 3; width: 40px; height: 48px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; color: #707070; cursor: grab; touch-action: none; }
.db-grip:hover { color: #F5C209; }
.db-ghost { position: fixed; z-index: 90; pointer-events: none; opacity: .92; box-shadow: 0 10px 30px rgba(0,0,0,.6); transform: rotate(-2deg); }

/* ── Picked-project bar ── */
.db-pickbar { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 8px 0 16px; margin-bottom: 10px; background: #2A2610; border: 1px solid #F5C209; color: #F0F0F0; }
.db-pickbar[hidden] { display: none; }
.db-pick-dot { width: 14px; height: 14px; border-radius: 50%; background: hsl(var(--h) 70% 62%); flex: none; }
.db-pick-hint { color: #F5C209; font-size: 14px; margin-left: auto; }
.db-pickbar button { width: 44px; height: 44px; background: none; border: none; color: #F0F0F0; font-size: 20px; cursor: pointer; }

/* ── Timeline grid ── */
.db-scroll { overflow-x: auto; border: 1px solid #333; background: #1C1C1C; -webkit-overflow-scrolling: touch; }
.db-grid { min-width: 860px; }
.db-axis, .db-row { display: grid; grid-template-columns: var(--who) 1fr; }
.db-axis { position: sticky; top: 0; z-index: 3; height: 34px; background: #181818; border-bottom: 1px solid #333; }
.db-hour { position: absolute; top: 9px; transform: translateX(-50%); font: 700 13px 'Barlow Condensed', sans-serif; color: #8A8A8A; white-space: nowrap; }
.db-row { min-height: var(--row); border-bottom: 1px solid #262626; }
.db-row.is-off .db-who { opacity: .6; }
.db-who { position: sticky; left: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: #1C1C1C; border-right: 1px solid #2E2E2E; cursor: pointer; user-select: none; }
.db-axis .db-who { background: #181818; cursor: default; }
.db-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #2C2C2C; color: #F0F0F0; font: 700 14px 'Barlow Condensed', sans-serif; letter-spacing: .5px; }
.db-name { min-width: 0; font-weight: 600; font-size: 15px; line-height: 1.15; color: #F0F0F0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-name small { display: block; font-weight: 400; font-size: 12px; color: #8A8A8A; }
.db-crewdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #F5C209; vertical-align: 2px; }
.db-lane { position: relative; min-height: var(--row); cursor: copy; }
.db--manager .db-lane { cursor: copy; }
.db:not(.db--manager) .db-lane { cursor: default; }
.db-lane--axis { cursor: default; }
.db-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: #262626; }
.db-now { position: absolute; top: 0; bottom: 0; width: 2px; background: #F87171; z-index: 1; }
.db-off { position: absolute; top: 8px; bottom: 8px; display: flex; align-items: center; padding: 0 10px; overflow: hidden; white-space: nowrap; font-size: 13px; color: #FCA5A5;
    background: repeating-linear-gradient(135deg, #2a1f1f 0 8px, #322424 8px 16px); border: 1px solid rgba(248,113,113,.35); }

/* ── Booking blocks ── */
.db-block { position: absolute; top: 8px; bottom: 8px; z-index: 2; display: flex; flex-direction: column; justify-content: center; padding: 0 12px; overflow: hidden;
    background: hsl(var(--h) 70% 64%); color: #111; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.db-block.is-editable { cursor: grab; }
.db-block-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-block-time { font-size: 12px; font-weight: 600; opacity: .75; white-space: nowrap; }
.db-block.is-dragging { z-index: 5; cursor: grabbing; box-shadow: 0 8px 22px rgba(0,0,0,.55), 0 0 0 2px #F0F0F0; }
.db-block.is-bad { background: repeating-linear-gradient(135deg, #F87171 0 8px, #EF5350 8px 16px); }
.db-preview { opacity: .75; pointer-events: none; outline: 2px dashed #F0F0F0; }
.db-handle { position: absolute; top: 0; bottom: 0; width: 18px; cursor: ew-resize; touch-action: none; }
.db-handle::after { content: ''; position: absolute; top: 30%; bottom: 30%; left: 7px; width: 4px; border-radius: 2px; background: rgba(0,0,0,.25); }
.db-handle--s { left: 0; }
.db-handle--e { right: 0; }
.db-block:focus-visible, .db-tile:focus-visible { outline: 3px solid #F5C209; outline-offset: 2px; }

/* ── Toast ── */
.db-toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; display: flex; align-items: center; gap: 16px; min-height: 52px; padding: 0 8px 0 20px; transform: translate(-50%, 140%); opacity: 0;
    background: #262626; color: #F0F0F0; border: 1px solid #3D3D3D; border-left: 4px solid #4ADE80; box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: transform .2s, opacity .2s; font-size: 15px; max-width: calc(100vw - 32px); }
.db-toast.show { transform: translate(-50%, 0); opacity: 1; }
.db-toast.is-error { border-left-color: #F87171; }
.db-toast button { min-height: 44px; padding: 0 16px; background: none; border: none; color: #F5C209; font: 700 16px 'Barlow Condensed', sans-serif; text-transform: uppercase; cursor: pointer; }

/* ── Bottom sheet ── */
.db-sheet-wrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .18s; }
.db-sheet-wrap.open { opacity: 1; pointer-events: auto; }
.db-sheet { width: 100%; max-width: 680px; max-height: 88vh; overflow-y: auto; padding: 18px 20px calc(20px + env(safe-area-inset-bottom)); background: #1B1B1B; border: 1px solid #333; border-bottom: none;
    transform: translateY(30px); transition: transform .2s; display: grid; gap: 16px; }
.db-sheet-wrap.open .db-sheet { transform: none; }
.db-sheet-head { display: flex; align-items: center; gap: 12px; }
.db-sheet-head h3 { margin: 0; font: 700 22px 'Barlow Condensed', sans-serif; text-transform: uppercase; color: #F0F0F0; }
.db-sheet-head > div { min-width: 0; flex: 1; }
.db-sub { font-size: 14px; color: #8A8A8A; }
.db-x { width: 48px; height: 48px; flex: none; background: #262626; border: none; color: #F0F0F0; font-size: 20px; cursor: pointer; }
.db-map { display: inline-block; margin-top: 4px; color: #93C5FD; font-size: 15px; text-decoration: none; }
.db-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.db-step { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; text-align: center; background: #141414; border: 1px solid #333; }
.db-step-l { grid-column: 1 / -1; padding-top: 8px; font: 700 12px 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .8px; color: #8A8A8A; }
.db-step b { font: 700 26px 'Barlow Condensed', sans-serif; color: #F0F0F0; }
.db-step button { height: 56px; background: none; border: none; color: #F5C209; font-size: 28px; cursor: pointer; }
.db-step button:active { background: #262626; }
.db-people { display: flex; flex-wrap: wrap; gap: 8px; }
.db-person { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 14px 6px 6px; background: #141414; border: 1px solid #333; color: #F0F0F0; font: 600 15px 'Barlow', sans-serif; text-align: left; cursor: pointer; }
.db-person small { display: block; font-weight: 400; font-size: 12px; color: #4ADE80; }
.db-person.is-busy small { color: #F87171; }
.db-person.is-selected { border-color: #F5C209; background: #2A2610; }
.db-person:disabled { opacity: .4; cursor: not-allowed; }
.db-note { width: 100%; min-height: 48px; padding: 0 14px; background: #141414; color: #F0F0F0; border: 1px solid #333; font: 16px 'Barlow', sans-serif; }
.db-note:focus { outline: none; border-color: #F5C209; }
.db-msg { padding: 12px 14px; background: rgba(248,113,113,.1); border-left: 3px solid #F87171; color: #FCA5A5; font-size: 15px; }
.db-msg[hidden] { display: none; }
.db-sheet-actions { display: flex; justify-content: space-between; gap: 12px; }
.db-sheet-actions:has(> :only-child) { justify-content: flex-end; }
.db-btn { min-height: 52px; padding: 0 24px; background: #262626; color: #F0F0F0; border: 1px solid #3D3D3D; font: 700 17px 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .5px; cursor: pointer; }
.db-btn--primary { background: #F5C209; border-color: #F5C209; color: #111; flex: 1; max-width: 260px; margin-left: auto; }
.db-btn--primary:disabled { opacity: .4; cursor: not-allowed; }
.db-btn--danger { color: #F87171; border-color: rgba(248,113,113,.5); background: none; }
.db-search--sheet { margin: 0; }
.db-projpick { display: grid; gap: 6px; max-height: 38vh; overflow-y: auto; }
.db-projbtn { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 56px; padding: 8px 14px 8px 20px; background: #141414; border: 1px solid #333; color: #F0F0F0; text-align: left; cursor: pointer; font: 15px 'Barlow', sans-serif; }
.db-projbtn::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: hsl(var(--h) 70% 62%); }
.db-projbtn small { color: #8A8A8A; font-size: 12px; }
.db-projbtn.is-selected { border-color: #F5C209; background: #2A2610; }
.db-facts { display: grid; gap: 10px; }
.db-facts div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; background: #141414; border: 1px solid #333; }
.db-facts span { color: #8A8A8A; }
.db-agenda { display: grid; gap: 6px; }
.db-agenda-row { position: relative; display: flex; gap: 14px; align-items: center; min-height: 52px; padding: 0 14px 0 20px; background: #141414; border: 1px solid #333; color: #F0F0F0; font: 15px 'Barlow', sans-serif; text-align: left; cursor: pointer; }
.db-agenda-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: hsl(var(--h, 0) 70% 62%); }
.db-agenda-row.is-off { cursor: default; color: #FCA5A5; }
.db-agenda-row.is-off::before { background: #F87171; }

/* ── Tablet portrait / phones: projects slide in from the left ── */
@media (max-width: 1100px) {
    .db--manager { grid-template-columns: 1fr; }
    .db-sidetoggle { display: inline-flex; align-items: center; }
    .db-side { position: fixed; z-index: 70; top: 0; bottom: 0; left: 0; width: min(340px, 86vw); max-height: none; padding: 14px; background: #161616; border-right: 1px solid #333; box-shadow: 10px 0 30px rgba(0,0,0,.5); transform: translateX(-105%); transition: transform .2s; }
    .db.side-open .db-side { transform: none; }
}
@media (max-width: 640px) {
    .db { --who: 120px; }
    .db-bar { flex-wrap: wrap; }
    .db-search--people { max-width: none; flex: 1; }
    .db-steps { grid-template-columns: 1fr; }
    .db-name small { display: none; }
}

/* First / last hour labels sit inside the edges instead of being cut off. */
.db-hour:first-child { transform: none; }
.db-hour:last-child { transform: translateX(-100%); }

/* The hour bar is its own short strip — it must not take a person-row's
   height (that made it cover the first row's name). */
.db-axis { align-items: stretch; }
.db-axis .db-who, .db-lane--axis { height: 34px; min-height: 0; }

/* ── Report types + project details ── */
.db-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.db-type { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; background: #141414; border: 1px solid #333; color: #C8C8C8; font: 14px 'Barlow', sans-serif; text-align: left; cursor: pointer; }
.db-type b { min-width: 40px; height: 32px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; background: #262626; color: #A0A0A0; font: 700 14px 'Barlow Condensed', sans-serif; }
.db-type.is-on { border-color: #F5C209; background: #2A2610; color: #F0F0F0; }
.db-type.is-on b { background: #F5C209; color: #111; }
.db-starts { display: grid; gap: 8px; }
.db-start { display: flex; align-items: center; justify-content: center; max-width: none; margin: 0; text-decoration: none; text-align: center; min-height: 56px; }
.db-info { font-size: 22px; }
.db-mapbtn { display: flex; align-items: center; gap: 8px; text-decoration: none; text-transform: none; font: 600 16px 'Barlow', sans-serif; color: #93C5FD; }
.db-block-sec { display: grid; gap: 8px; }
.db-block-sec > .db-step-l { padding: 0; }
.db-req { margin: 0; padding: 12px 14px; background: #141414; border: 1px solid #333; color: #E0E0E0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.db-files { display: grid; gap: 6px; }
.db-file { display: flex; align-items: center; min-height: 48px; padding: 0 14px; background: #141414; border: 1px solid #333; color: #93C5FD; text-decoration: none; font-size: 15px; }
.db-pickbar [data-info] { width: 44px; height: 44px; background: none; border: none; color: #F5C209; font-size: 22px; cursor: pointer; }

/* Panels open as a centered window with a quick fade — no sliding. */
.db-sheet-wrap { align-items: center; padding: 16px; transition: opacity .12s; }
.db-sheet { max-height: calc(100vh - 32px); border: 1px solid #3D3D3D; transform: none; transition: none; box-shadow: 0 20px 60px rgba(0,0,0,.6); padding-bottom: 20px; }
.db-sheet-wrap.open .db-sheet { transform: none; }

/* Project details: files up top, facts in two compact columns. */
.db-files { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.db-none { padding: 12px 14px; background: #141414; border: 1px dashed #333; color: #707070; font-size: 14px; }
.db-facts--grid { grid-template-columns: 1fr 1fr; gap: 8px; }
.db-facts--grid div { flex-direction: column; justify-content: flex-start; gap: 2px; padding: 10px 12px; }
.db-facts--grid span { font: 700 11px 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .6px; }
.db-facts--grid b { font-weight: 600; }
@media (max-width: 640px) { .db-facts--grid { grid-template-columns: 1fr; } }

/* Change booking: labelled sections, "was …" hints, Remove kept apart. */
.db-sec { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid #2A2A2A; }
.db-sheet-head + .db-sec, .db-starts + .db-sec { border-top: none; padding-top: 0; }
.db-sec-h { display: flex; align-items: baseline; gap: 10px; }
.db-sec-h span { font: 700 13px 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .8px; color: #A0A0A0; }
.db-sec-h em { font-style: normal; font-size: 13px; color: #F5C209; background: rgba(245,194,9,.1); padding: 1px 8px; }
.db-btn:disabled { opacity: .4; cursor: not-allowed; }
.db-sheet-actions .db-btn:not(.db-btn--primary) { flex: none; }
.db-remove-row { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 6px; border-top: 1px dashed #2A2A2A; color: #FCA5A5; font-size: 15px; }
.db-link-danger { min-height: 44px; background: none; border: none; color: #F87171; font: 600 15px 'Barlow', sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.db-btn--remove { background: #DC2626; border-color: #DC2626; color: #fff; }

/* Another team's job: availability only. */
.db-block.is-busy { background: repeating-linear-gradient(135deg, #3A3A3A 0 8px, #424242 8px 16px); color: #CFCFCF; cursor: default; }

/* PM / Team Manager workload on the Day view: projects running today (not bookings). */
.db-running { position: absolute; left: 0; right: 0; bottom: 3px; padding: 0 8px; font-size: 11px; line-height: 16px; color: rgba(245,194,9,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; border-top: 1px dashed rgba(245,194,9,.25); }

/* PM day under a PM / Team Manager row: their running projects with crew and gaps. */
.db-pmday { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 10px 10px calc(var(--who) + 10px); }
.db-pmproj { position: relative; min-width: 220px; max-width: 340px; flex: 1 1 220px; padding: 8px 10px 8px 16px; background: #222; border: 1px solid #333; cursor: pointer; }
.db-pmproj::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: hsl(var(--h) 70% 62%); }
.db-pmproj:hover { border-color: #555; }
.db-pmproj.is-selected { border-color: #F5C209; background: #2A2610; box-shadow: 0 0 0 1px #F5C209; }
.db-pmproj.is-bad { border-color: rgba(248,113,113,.55); }
.db-pmproj-top { display: flex; align-items: center; gap: 6px; }
.db-pmproj-top b { flex: 1; min-width: 0; font-size: 14px; color: #F0F0F0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-pmproj-info { width: 30px; height: 30px; flex: none; background: none; border: 1px solid #3D3D3D; color: #C8C8C8; cursor: pointer; font-size: 14px; }
.db-pmcrew { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 12.5px; color: #D0D0D0; }
.db-pmcrew span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.db-pmcrew i { width: 8px; height: 8px; border-radius: 2px; background: hsl(var(--h) 70% 64%); }
.db-pmissues { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 12.5px; }
.db-issue--ok { color: #4ADE80; }
.db-issue--warn { color: #F5C209; }
.db-issue--bad { color: #F87171; font-weight: 600; }
.db-row:has(.db-pmday) { grid-template-rows: auto auto; }

/* Field work section in the project sheet. */
.db-fw { gap: 10px; }
.db-fw-list { display: grid; gap: 6px; }
.db-fw-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #141414; border: 1px solid #333; }
.db-fw-row b { color: #F0F0F0; }
.db-fw-row span { flex: 1; color: #A0A0A0; font-size: 14px; }
.db-fw-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.db-fw-person { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 10px; background: #141414; border: 1px solid #333; border-left: 4px solid #4ADE80; color: #F0F0F0; text-align: left; font: 600 15px 'Barlow', sans-serif; cursor: pointer; }
.db-fw-person small { display: block; font-weight: 400; font-size: 12px; color: #8A8A8A; }
.db-fw-person.is-busy { border-left-color: #F5C209; }
.db-fw-person.is-off { border-left-color: #F87171; opacity: .6; }
.db-fw-person.is-on { border-color: #F5C209; background: #2A2610; box-shadow: 0 0 0 1px #F5C209; }
.db-fw .db-input { min-height: 48px; padding: 0 12px; background: #141414; border: 1px solid #3D3D3D; color: #F0F0F0; font: 16px 'Barlow', sans-serif; color-scheme: dark; }

.db-pmassigned { margin-top: 4px; font-size: 12px; color: #A0A0A0; }
.db-fw-st { font-style: normal; }
.db-fw-st.is-ok { color: #4ADE80; }
.db-fw-st.is-bad { color: #F87171; font-weight: 600; }
.db-fw-edit { min-height: 36px; padding: 0 12px; background: #1C1C1C; border: 1px solid #3D3D3D; color: #F0F0F0; font: 600 14px 'Barlow', sans-serif; cursor: pointer; }
.db-fw-edit:hover { border-color: #F5C209; color: #F5C209; }
.db-fw-tag { display: inline-block !important; margin-top: 2px; padding: 0 6px; border: 1px solid rgba(245,194,9,.5); color: #F5C209 !important; font-size: 11px !important; text-transform: uppercase; letter-spacing: .5px; }
.db-fw-form { display: grid; gap: 10px; padding: 12px; background: #1A1A1A; border: 1px solid #F5C209; }

.db-fw-step { display: flex; align-items: center; gap: 8px; }
.db-fw-step .db-step-l { padding: 0; }
.db-fw-n { width: 22px; height: 22px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #F5C209; color: #111; font: 700 13px 'Barlow Condensed', sans-serif; }

/* Project tiles: PM + team, status line, and filter chips. */
.db-tile { grid-template-rows: auto auto auto; }
.db-tile-on, .db-grip { grid-row: 1 / 4 !important; }
.db-tile-st { grid-column: 1; grid-row: 3; margin-top: 3px; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-tile-st.is-bad { color: #F87171; }
.db-tile-st.is-warn { color: #F5C209; }
.db-tile-st.is-ok { color: #4ADE80; font-weight: 500; }
.db-tile-st.is-mute { color: #8A8A8A; font-weight: 500; }
.db-tfilters { display: flex; flex-wrap: wrap; gap: 6px; }
.db-tfilters button { min-height: 40px; padding: 0 10px; background: #1C1C1C; border: 1px solid #3D3D3D; color: #A0A0A0; font: 700 13px 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .4px; cursor: pointer; }
.db-tfilters button b { margin-left: 3px; color: #F0F0F0; }
.db-tfilters button.is-bad b { color: #F87171; }
.db-tfilters button.active { background: #F5C209; border-color: #F5C209; color: #111; }
.db-tfilters button.active b { color: #111; }
.db-tile-st { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.db-tile.is-idle .db-tile-st.is-bad { opacity: 1; }

/* Project sheet: spec files, requirements and facts folded away by default. */
.db-more { border: 1px solid #333; background: #181818; }
.db-more > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; cursor: pointer; list-style: none; font: 700 14px 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .6px; color: #F0F0F0; }
.db-more > summary::-webkit-details-marker { display: none; }
.db-more > summary span { font: 400 13px 'Barlow', sans-serif; text-transform: none; letter-spacing: 0; color: #8A8A8A; }
.db-more > summary::after { content: '▾'; margin-left: auto; color: #8A8A8A; }
.db-more[open] > summary::after { content: '▴'; }
.db-more[open] { display: grid; gap: 12px; padding-bottom: 12px; }
.db-more > :not(summary) { margin: 0 12px; }

/* Field work by report (project sheet). */
.db-fw-who { font-size: 14px; color: #C8C8C8; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.db-fw-who b { color: #F0F0F0; }
.db-fw-reports { display: grid; gap: 6px; }
.db-fw-report { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; background: #141414; border: 1px solid #333; }
.db-fw-report.is-missing { border-color: rgba(248,113,113,.55); }
.db-fw-report.is-open { border-color: #F5C209; background: #2A2610; }
.db-fw-rt { min-width: 44px; height: 34px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; background: #262626; color: #F5C209; font: 700 15px 'Barlow Condensed', sans-serif; }
.db-fw-report.is-missing .db-fw-rt { color: #F87171; }
.db-fw-rinfo { display: grid; gap: 2px; min-width: 0; }
.db-fw-rinfo b { color: #F0F0F0; font-size: 14px; }
.db-fw-rinfo span { font-size: 13.5px; color: #C8C8C8; }
.db-fw-rinfo .db-link-danger { min-height: 0; font-size: 13px; margin-left: 6px; }
.db-fw-none { color: #F87171 !important; font-weight: 600; }
.db-fw-formhead { display: flex; align-items: center; gap: 8px; font-size: 15px; color: #C8C8C8; }
.db-fw-formhead b { color: #F5C209; }
.db-fw-formhead .db-x { margin-left: auto; }

/* Field Work due on this day with no visit time yet. */
.db-due { position: absolute; left: 6px; z-index: 3; max-width: calc(100% - 12px); height: 20px; padding: 0 10px; border: 1.5px dashed hsl(var(--h) 70% 62%); border-radius: 4px; background: rgba(20,20,20,.85); color: hsl(var(--h) 70% 72%); font: 600 12px 'Barlow', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.db-due:hover { background: #2A2610; }

.db-due.is-ro { cursor: default; }
.db-linkbtn { align-self: flex-start; min-height: 40px; padding: 0 2px; background: none; border: none; color: #A0A0A0; font: 600 14px 'Barlow', sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.db-linkbtn:hover { color: #F5C209; }

.db-fw-times { display: flex; align-items: center; gap: 10px; }
.db-fw-times .db-input { flex: 1; }
.db-fw-times span { color: #8A8A8A; }
.db-fw-person:disabled { cursor: not-allowed; opacity: .55; }

/* Field work: the day to assign on. */
.db-fw-day { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.db-fw-day label { font: 700 13px "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .6px; color: #F5C209; }
.db-fw-day .db-input { max-width: 200px; }
.db-fw-day span { font-size: 12.5px; color: #8A8A8A; }

/* Refused change: a box to acknowledge. */
.db-problem-wrap { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.6); }
.db-problem-wrap.open { display: flex; }
.db-problem { width: min(440px, 100%); padding: 22px 22px 18px; background: #1C1C1C; border: 1px solid #F87171; border-top: 4px solid #F87171; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.db-problem-icon { font-size: 30px; color: #F87171; line-height: 1; }
.db-problem h3 { margin: 8px 0 6px; font: 800 20px 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .5px; color: #F0F0F0; }
.db-problem p { margin: 0 0 16px; font-size: 15px; line-height: 1.5; color: #D0D0D0; }
.db-problem .db-btn { min-width: 160px; }

.db-problem.is-ask { border-color: #F5C209; border-top-color: #F5C209; }
.db-problem.is-ask .db-problem-icon { color: #F5C209; }



/* The project you drilled into: highlighted card / visits. */
@keyframes db-focus { 0%, 100% { box-shadow: 0 0 0 2px #F5C209; } 50% { box-shadow: 0 0 0 5px rgba(245,194,9,.35); } }
.db-pmproj.is-focus, .db-block.is-focus { animation: db-focus 1.2s ease-in-out 3; box-shadow: 0 0 0 2px #F5C209; }

.db-tkey { display: flex; gap: 12px; font-size: 12px; color: #8A8A8A; }
.db-tkey .is-bad::first-letter { color: #F87171; } .db-tkey .is-warn::first-letter { color: #F5C209; } .db-tkey .is-ok::first-letter { color: #4ADE80; }

/* Ended project: extend it before assigning more work. */
.db-ended { display: grid; gap: 8px; padding: 12px 14px; background: #2a1f1f; border: 1px solid rgba(248,113,113,.55); color: #FCA5A5; font-size: 14px; }
.db-ended b { color: #F87171; }
.db-ended span { color: #D0D0D0; }
.db-ended-row { display: flex; gap: 10px; }
.db-ended-row .db-input { flex: 1; min-height: 48px; padding: 0 12px; background: #141414; border: 1px solid #3D3D3D; color: #F0F0F0; font: 16px 'Barlow', sans-serif; color-scheme: dark; }

/* Dragging a project card onto another PM. */
.db-pmgrip { width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #8A8A8A; font-size: 18px; cursor: grab; touch-action: none; }
.db-pmgrip:hover { color: #F5C209; }
.db-pmproj.is-dragging { opacity: .35; }
.db-pmproj.db-ghost { position: fixed; z-index: 90; pointer-events: none; }
.db-row.is-droptarget { background: rgba(245,194,9,.08); box-shadow: inset 0 0 0 2px #F5C209; }
@media (pointer: fine) { .db-pmproj { cursor: grab; } }

/* A job held by a PM: waiting to be given to a field worker (the PM isn't going on site). */
.db-block.is-held { background: #222; color: #F0F0F0; border-radius: 0; box-shadow: inset 0 0 0 1px rgba(248,113,113,.55); border-left: 6px solid hsl(var(--h) 70% 62%); }
.db-block.is-held .db-block-time { opacity: 1; color: #C8C8C8; }
.db-block.is-held .db-block-time::after { content: ' · ⚠ needs a field worker'; color: #F87171; font-weight: 700; }

/* Precise timing while dragging: quarter-hour marks, a guide line, a time label. */
.db-tick--q { background: rgba(255,255,255,.035); }
.db-guide { position: fixed; z-index: 95; width: 2px; margin-left: -1px; background: #F5C209; box-shadow: 0 0 6px rgba(245,194,9,.6); pointer-events: none; }
.db-guide.is-bad { background: #F87171; box-shadow: 0 0 6px rgba(248,113,113,.6); }
.db-guide-tag { position: fixed; z-index: 96; transform: translateX(-50%); padding: 4px 10px; background: #F5C209; color: #111; font: 700 14px 'Barlow Condensed', sans-serif; letter-spacing: .3px; white-space: nowrap; border-radius: 3px; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.db-guide-tag.is-bad { background: #F87171; color: #fff; }

/* The tile / card you're dragging (the real one, lifted). */
.db-tile.is-lifted, .db-pmproj.is-lifted { box-shadow: 0 12px 30px rgba(0,0,0,.6), 0 0 0 2px #F5C209; cursor: grabbing; }



/* A PM's timed project card: inside the PM's line, at its start, as wide as its time. */
.db-row.has-timed .db-lane { min-height: 0; height: var(--held-h, 124px); }
.db-lane > .db-pmproj { position: absolute; top: 8px; z-index: 2; min-width: 0; max-width: none; flex: none; box-sizing: border-box; margin: 0; }
.db-pmproj { box-sizing: border-box; }
.db-pmproj.is-lifted { margin: 0; max-width: none; flex: none; z-index: 90; box-shadow: 0 14px 34px rgba(0,0,0,.6), 0 0 0 2px #F5C209; transition: none; }
.db-row.is-droptarget > .db-lane { background: rgba(245,194,9,.06); }
.db-row.is-droptarget { box-shadow: inset 0 0 0 2px rgba(245,194,9,.85); }
.db-lane > .db-pmproj, .db-pmproj.is-lifted { overflow: hidden; }
.db-lane > .db-pmproj .db-pmcrew span, .db-pmproj.is-lifted .db-pmcrew span { white-space: normal; align-items: flex-start; min-width: 0; }
.db-lane > .db-pmproj .db-pmcrew i, .db-pmproj.is-lifted .db-pmcrew i { flex: none; margin-top: 4px; }
.db-lane > .db-pmproj .db-pmproj-top b, .db-pmproj.is-lifted .db-pmproj-top b { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }

/* The PM's time on each field worker's row while handing a held job over. */
.db-slot { position: absolute; top: 4px; bottom: 4px; border: 2px dashed rgba(245,194,9,.8); background: rgba(245,194,9,.08); border-radius: 4px; pointer-events: none; z-index: 1; box-sizing: border-box; }
.db-slot span { position: absolute; right: 6px; bottom: 3px; font-size: 11px; font-weight: 700; color: #F5C209; }
.db-slot.is-bad { border-color: rgba(248,113,113,.8); background: rgba(248,113,113,.08); }
.db-slot.is-bad span { color: #F87171; }

/* Week view: a field worker's job on another PM's project. */
.cal-chip.is-busy { background: repeating-linear-gradient(135deg, #3A3A3A 0 6px, #444 6px 12px) !important; color: #E0E0E0 !important; white-space: normal; line-height: 1.25; cursor: default; }

/* A project that came in this week. */
.db-new { display: inline-block; margin-left: 4px; padding: 0 5px; font: 800 9.5px/16px 'Barlow', sans-serif; letter-spacing: .5px; text-transform: uppercase; font-style: normal; color: #0B1A2E; background: #60A5FA; border-radius: 3px; vertical-align: 1px; }

/* Project cards on the left: full height (never squeezed), roomier, clear lines. */
@media (min-width: 1101px) { .db--manager { grid-template-columns: 340px minmax(0, 1fr); } }
.db-tiles { gap: 10px; padding-right: 4px; }
.db-tile { flex: none; min-height: 0; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto auto auto; row-gap: 3px; column-gap: 10px; padding: 12px 8px 12px 18px; border-radius: 4px; transition: border-color .12s, background .12s; }
.db-tile:hover { border-color: #4A4A4A; background: #212121; }
.db-tile::before { width: 5px; border-radius: 4px 0 0 4px; }
.db-tile-name { font-size: 15px; line-height: 1.25; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.db-tile-sub { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; line-height: 18px; white-space: nowrap; }
.db-tile-sub .db-new { flex: none; margin: 0; }
.db-tile-st { margin-top: 2px; padding-top: 6px; border-top: 1px solid #2C2C2C; font-size: 12.5px; line-height: 1.35; }
.db-tile-on { align-self: center; }
.db-grip { align-self: center; height: 40px; width: 32px; }

/* No count bubble: the grip takes the right column. */
.db-tile { grid-template-columns: minmax(0, 1fr) auto; }
.db-tile .db-grip { grid-column: 2; grid-row: 1 / 4 !important; }
/* The project you've picked: unmistakable. */
.db-tile.is-selected { background: #2B2610; border-color: #F5C209; box-shadow: 0 0 0 1px #F5C209, 0 6px 18px rgba(245,194,9,.12); }
.db-tile.is-selected::before { width: 7px; background: #F5C209; }
.db-tile.is-selected .db-tile-name { color: #FFE27A; }
.db-tile.is-selected .db-grip { color: #F5C209; }
.db-tile-pick { position: absolute; top: 8px; right: 40px; margin: 0; padding: 2px 7px; font: 800 9.5px/14px 'Barlow', sans-serif; letter-spacing: .6px; text-transform: uppercase; color: #111; background: #F5C209; border-radius: 3px; }
.db-tile.is-selected .db-tile-name { padding-right: 70px; }
/* Reports needed (project menu) + Fill in. */
.db-rtypes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 4px; }
.db-rtypes > span { font-size: 12px; font-weight: 700; color: #9A9A9A; text-transform: uppercase; letter-spacing: .5px; margin-right: 4px; }
.db-rtype { padding: 5px 10px; font: 700 12.5px 'Barlow', sans-serif; color: #BDBDBD; background: #141414; border: 1px dashed #555; border-radius: 3px; cursor: pointer; }
.db-rtype:hover { border-color: #F5C209; color: #F5C209; }
.db-rtype.is-on { color: #111; background: #F5C209; border: 1px solid #F5C209; }
.db-fw-acts { display: flex; align-items: center; gap: 6px; }
.db-fw-file { padding: 7px 10px; font: 700 12.5px 'Barlow', sans-serif; color: #F5C209; border: 1px solid rgba(245,194,9,.45); text-decoration: none; white-space: nowrap; }
.db-fw-file:hover { background: rgba(245,194,9,.1); }

/* Role colours — team lead (purple) · PM (blue) · field worker (teal). */
.db-who { border-left: 4px solid transparent; }
.db-who.is-tm { border-left-color: #A78BFA; } .db-who.is-tm .db-avatar { background: #3B2F63; color: #DDD6FE; box-shadow: inset 0 0 0 2px #A78BFA; }
.db-who.is-pm { border-left-color: #38BDF8; } .db-who.is-pm .db-avatar { background: #12384D; color: #BAE6FD; box-shadow: inset 0 0 0 2px #38BDF8; }
.db-who.is-fw { border-left-color: #2DD4BF; } .db-who.is-fw .db-avatar { background: #0F3B37; color: #99F6E4; box-shadow: inset 0 0 0 2px #2DD4BF; }
.db-name-l { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.db-role { font: 800 9.5px/15px 'Barlow', sans-serif; font-style: normal; letter-spacing: .5px; text-transform: uppercase; padding: 0 5px; border-radius: 3px; }
.is-tm > .db-name .db-role { color: #1E1240; background: #A78BFA; }
.is-pm > .db-name .db-role { color: #062433; background: #38BDF8; }
.is-fw > .db-name .db-role { color: #04241F; background: #2DD4BF; }
.db-rolekey { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: 12px; color: #B0B0B0; }
.db-rolekey span::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 50%; vertical-align: -1px; }
.db-rolekey .is-tm::before { background: #A78BFA; } .db-rolekey .is-pm::before { background: #38BDF8; } .db-rolekey .is-fw::before { background: #2DD4BF; }
@media (max-width: 1100px) { .db-rolekey { display: none; } }

/* Resize a PM's timed card by its right edge. */
.db-pmresize { position: absolute; top: 0; right: -1px; bottom: 0; width: 10px; cursor: ew-resize; z-index: 3; touch-action: none; }
.db-pmresize::after { content: ''; position: absolute; top: 50%; right: 3px; width: 3px; height: 26px; margin-top: -13px; border-radius: 2px; background: rgba(255,255,255,.28); }
.db-pmproj:hover .db-pmresize::after, .db-pmproj.is-resizing .db-pmresize::after { background: #F5C209; }
.db-pmproj.is-resizing { box-shadow: 0 0 0 2px #F5C209; z-index: 5; }
/* Menu: a job's time, editable. */
.db-agenda-row--edit { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; cursor: default; }
.db-agenda-who { min-width: 0; }
.db-agenda-time { display: inline-flex; align-items: center; gap: 6px; }
.db-agenda-time .db-input { width: 112px; padding: 6px 8px; }
.db-agenda-time i { color: #777; font-style: normal; }
.db-agenda-time em { min-width: 34px; font-style: normal; font-weight: 700; color: #BDBDBD; font-size: 12.5px; }
.db-agenda-time .db-input { color-scheme: dark; background: #141414; color: #F0F0F0; border: 1px solid #3A3A3A; }

/* Overdue on a person's row: red edge, count under the name, a chip on the line. */
.db-row.is-late > .db-who { background: linear-gradient(90deg, rgba(248,113,113,.14), transparent 85%); box-shadow: inset 3px 0 0 #F87171; }
.db-late-n { color: #F87171; font-weight: 800; }
.db-late { position: absolute; left: 6px; z-index: 4; max-width: calc(100% - 12px); height: 20px; padding: 0 10px; border: 1.5px solid #F87171; border-radius: 4px; background: rgba(60,18,18,.92); color: #FCA5A5; font: 700 12px 'Barlow', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.db-late:hover { background: #5A1D1D; color: #fff; }

/* Overdue row: a clear red border around the whole row (no tint). */
.db-row.is-late > .db-who { background: none; box-shadow: none; }
.db-row.is-late { box-shadow: inset 0 0 0 3px #EF4444, 0 0 12px rgba(239,68,68,.25); border-radius: 3px; position: relative; z-index: 1; }

.db-agenda-rm { margin-left: 4px; }

/* Job menu (a no-time / overdue job on someone's line). */
.db-jobmenu { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.db-jobmenu .db-btn { width: 100%; justify-content: center; text-align: center; }
.db-dot { width: 14px; height: 14px; flex: none; border-radius: 50%; background: hsl(var(--h) 70% 62%); margin-top: 6px; }
.db-jobmenu .db-btn--primary { max-width: none; margin: 0; flex: none; }

/* ✕ Remove next to a no-time / overdue chip; the chip leaves room for it. */
.db-chipwrap { position: absolute; left: 6px; z-index: 4; display: flex; gap: 4px; max-width: calc(100% - 12px); }
.db-chipwrap > .db-due, .db-chipwrap > .db-late { position: static; min-width: 0; max-width: none; flex: 0 1 auto; }
.db-chiprm { flex: none; height: 20px; padding: 0 8px; font: 700 11.5px 'Barlow', sans-serif; color: #F87171; background: #1A1A1A; border: 1px solid rgba(248,113,113,.6); border-radius: 4px; cursor: pointer; white-space: nowrap; }
.db-chiprm:hover { background: #5A1D1D; color: #fff; }

/* Overdue strip under a person's row (outside the timeline). */
.db-latestrip { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 10px calc(var(--who) + 10px); }
.db-latestrip .db-late { position: static; max-width: 100%; height: auto; min-height: 24px; padding: 3px 10px; }
/* Project menu: Remove under each person on a report; the overdue one you tapped is highlighted. */
.db-fw-rm { display: inline-block; margin: 6px 0 2px; padding: 4px 10px; font: 700 12px 'Barlow', sans-serif; color: #F87171; background: none; border: 1px solid rgba(248,113,113,.6); border-radius: 3px; cursor: pointer; }
.db-fw-rm:hover { background: #5A1D1D; color: #fff; }
.db-fw-rinfo > span { display: block; }
.db-fw-report.is-hl { border-color: #EF4444; box-shadow: 0 0 0 2px #EF4444, 0 0 14px rgba(239,68,68,.25); }

/* Delete a report's job (project menu). */
.db-fw-del { padding: 7px 10px; font: 700 12.5px 'Barlow', sans-serif; color: #F87171; background: none; border: 1px solid rgba(248,113,113,.5); cursor: pointer; white-space: nowrap; }
.db-fw-del:hover { background: #5A1D1D; color: #fff; }
