/* ============================================================================
   floor.css — the foreman's control screen
   ========================================================================== */
.fl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-4); }
.fl-kpi { padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); display: grid; gap: 2px; }
.fl-kpi b { font-size: 24px; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fl-kpi span { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.fl-kpi[data-tone="good"] b { color: var(--success); } .fl-kpi[data-tone="warn"] b { color: var(--warning); } .fl-kpi[data-tone="bad"] b { color: var(--danger); } .fl-kpi[data-tone="accent"] b { color: var(--accent); }
.fl-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; gap: var(--s-4); align-items: start; }
.fl-layout > * { min-width: 0; }
.fl-crew { display: flex; gap: var(--s-3); overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: var(--s-2); scroll-snap-type: x proximity; min-width: 0; }
.fl-crew > .fl-col { flex: 0 0 290px; }
.fl-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--s-3); display: grid; gap: var(--s-2); align-content: start; min-height: 240px; scroll-snap-align: start; transition: box-shadow .15s, border-color .15s; }
.fl-col.is-over { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.fl-col--pool { background: color-mix(in srgb, var(--warning) 6%, var(--surface-2)); }
.fl-col__head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 6px; border-bottom: 1px solid var(--border); }
.fl-col__who { flex: 1; min-width: 0; display: grid; gap: 1px; } .fl-col__who b { font-size: var(--fs-md); display: flex; align-items: center; gap: 6px; }
.fl-col__who span { font-size: var(--fs-xs); color: var(--muted); display: flex; align-items: center; gap: 6px; }
.fl-col__who span i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.fl-col[data-tone="job"] .fl-col__who span i { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 22%, transparent); }
.fl-col[data-tone="break"] .fl-col__who span i { background: var(--warning); } .fl-col[data-tone="idle"] .fl-col__who span i { background: var(--info, #60a5fa); } .fl-col[data-tone="off"] .fl-col__who span i { background: var(--border-strong, #94a3b8); }
.fl-col[data-tone="pool"] .fl-col__who span i { display: none; }
.fl-col__count { font-size: var(--fs-xs); font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.fl-col__queue { display: grid; gap: var(--s-2); min-height: 60px; }
.fl-task { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong, #cbd5e1); border-radius: var(--r-md); padding: 10px 12px; display: grid; gap: 4px; cursor: grab; }
.fl-task[draggable="false"] { cursor: default; } .fl-task.is-dragging { opacity: .5; }
.fl-task[data-priority="critical"] { border-left-color: var(--danger); } .fl-task[data-priority="high"] { border-left-color: var(--warning); }
.fl-task[data-current="true"] { border-color: var(--success); background: color-mix(in srgb, var(--success) 7%, var(--surface)); }
.fl-task__top { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: var(--fs-xs); }
.fl-task__wo, .fl-task__unit, .fl-task__bay { white-space: nowrap; }
.fl-task__pos { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 11px; }
.fl-task__wo { font-weight: 700; } .fl-task__unit { color: var(--ink-2); font-weight: 600; } .fl-task__bay { color: var(--muted); }
.fl-task__live { display: inline-flex; align-items: center; gap: 4px; color: var(--success); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 10.5px; }
.fl-task__title { font-weight: 600; line-height: 1.3; } .fl-task__meta { font-size: var(--fs-xs); color: var(--muted); }
.fl-task__act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fl-side { display: grid; gap: var(--s-3); }
.fl-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--s-3) var(--s-4); display: grid; gap: var(--s-2); }
.fl-panel h3 { margin: 0 0 4px; font-size: var(--fs-sm); display: flex; align-items: center; gap: 8px; } .fl-panel h3 b { margin-left: auto; font-size: var(--fs-xs); padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.fl-panel[data-tone="accent"] h3 b { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); } .fl-panel[data-tone="warn"] h3 b { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.fl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: var(--fs-sm); } .fl-row > div { min-width: 0; }
.fl-empty { margin: 0; padding: 14px 10px; text-align: center; color: var(--faint); font-size: var(--fs-sm); border: 1px dashed var(--border); border-radius: var(--r-md); }
/* 2.11: under ~1450 px (a 1280 laptop with the sidebar open) three fixed
   columns left one mechanic visible at a time. The side panels go under the
   crew, side by side; the pool keeps its column; the crew scrolls sideways
   with two or three mechanics in view. */
@media (max-width: 1450px) {
  .fl-layout { grid-template-columns: minmax(240px, 280px) minmax(0, 1fr); }
  .fl-side { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .fl-crew > .fl-col { flex: 0 0 272px; }
}
@media (max-width: 900px) {
  .fl-layout { grid-template-columns: minmax(0, 1fr); }
  .fl-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) { .fl-crew > .fl-col { flex: 0 0 85vw; } }

/* ---- The shop by bay: the foreman's second screen -------------------------- */
.bays .wall__main { padding: 1.2em 1.8em 2em; display: block; }
.bays .wall__stats { grid-template-columns: repeat(7, minmax(0, 1fr)); margin-bottom: 1.2em; }
@media (max-width: 1100px) { .bays .wall__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bays__grid { display: grid; grid-template-columns: repeat(var(--bays, 3), minmax(0, 1fr)); gap: 1em; margin: 1em 0 1.2em; }
.bay { position: relative; display: grid; gap: .6em; align-content: start; padding: 1em 1.1em 1.1em; border-radius: 1.3em; min-height: 15em; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); border-top: 6px solid #64748b; color: #e8edf8; cursor: default; transition: transform .15s, background .15s; }
.bay:hover { background: rgba(255, 255, 255, .08); }
.bay--free { border-top-color: #22c55e; background: rgba(34, 197, 94, .07); }
.bay[data-tone="live"] { border-top-color: #4ade80; background: rgba(74, 222, 128, .08); }
.bay[data-tone="idle"] { border-top-color: #60a5fa; }
.bay[data-tone="parts"] { border-top-color: #fbbf24; background: rgba(251, 191, 36, .07); }
.bay[data-tone="approval"] { border-top-color: #a78bfa; background: rgba(167, 139, 250, .08); }
.bay[data-tone="late"] { border-top-color: #f87171; background: rgba(248, 113, 113, .08); }
.bay[data-tone="down"] { border-top-color: #ef4444; background: rgba(239, 68, 68, .12); box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .35); animation: baypulse 2.4s ease-in-out infinite; }
@keyframes baypulse { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .35); } 50% { box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .35), 0 0 34px rgba(239, 68, 68, .35); } }
.bay__head { display: flex; align-items: center; justify-content: space-between; gap: .6em; }
.bay__name { font-size: 1.15em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; }
.bay__free { display: inline-flex; align-items: center; gap: .3em; color: #86efac; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .8em; }
.bay__pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35em; }
.bay__pill { display: inline-flex; align-items: center; gap: .3em; font-size: .68em; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: .3em .7em; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #dbe3f7; }
.bay__pill[data-tone="danger"] { background: rgba(239, 68, 68, .35); color: #fecaca; } .bay__pill[data-tone="warning"] { background: rgba(245, 158, 11, .3); color: #fde68a; } .bay__pill[data-tone="success"] { background: rgba(34, 197, 94, .3); color: #bbf7d0; } .bay__pill[data-tone="info"], .bay__pill[data-tone="accent"] { background: rgba(96, 165, 250, .28); color: #bfdbfe; } .bay__pill[data-tone="purple"] { background: rgba(167, 139, 250, .3); color: #ddd6fe; }
.bay__truck { display: grid; gap: .1em; } .bay__truck b { font-size: 2.2em; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: #fff; font-family: var(--font-mono); }
.bay__truck span { font-size: 1em; color: #dbe3f7; } .bay__truck em { font-style: normal; font-size: .85em; color: #93a3c7; }
.bay__task { display: flex; align-items: center; gap: .5em; font-size: .95em; color: #e8edf8; font-weight: 600; }
.bay__progress { position: relative; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: visible; margin-top: .2em; }
.bay__progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22c55e, #86efac); transition: width .4s; }
.bay__progress span { position: absolute; right: 0; top: 12px; font-size: .72em; color: #93a3c7; }
.bay__people { display: flex; flex-wrap: wrap; align-items: center; gap: .6em 1em; margin-top: 1.1em; }
.bay__person { display: inline-flex; align-items: center; gap: .5em; } .bay__person > span { display: grid; line-height: 1.1; font-weight: 600; } .bay__person small { color: #86efac; font-variant-numeric: tabular-nums; font-weight: 600; }
.bay__nobody { color: #b7c3df; font-size: .9em; }
.bay__promised { margin-left: auto; display: inline-flex; align-items: center; gap: .3em; font-size: .8em; color: #b7c3df; } .bay__promised.is-late { color: #fca5a5; font-weight: 700; }
.bay__more { font-size: .8em; color: #93a3c7; }
.bay__empty { display: grid; justify-items: center; gap: .4em; padding: 1.6em 0 .6em; color: #6b7a9c; } .bay__empty span { font-size: .9em; }
.bays__below { display: grid; grid-template-columns: repeat(auto-fit, minmax(22em, 1fr)); gap: 1em; }
.bays__row { display: flex; align-items: center; gap: .8em; padding: .55em .7em; border-radius: .7em; background: rgba(255, 255, 255, .04); border-left: 4px solid transparent; min-width: 0; }
.bays__row[data-priority="critical"] { border-left-color: #ef4444; } .bays__row[data-priority="high"] { border-left-color: #f59e0b; }
.bays__put { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .3em; font-size: .78em; font-weight: 700; padding: .35em .7em; border-radius: 999px; background: rgba(96, 165, 250, .25); color: #bfdbfe; } .bays__put:hover { background: rgba(96, 165, 250, .4); }
@media (max-width: 900px) { .bays__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bay__truck b { font-size: 1.6em; } }
@media (max-width: 560px) { .bays__grid { grid-template-columns: minmax(0, 1fr); } }

/* 2.11: one screen on the television — the bays on one row when it is wide enough, the lists below trimmed to what fits. */
@media (min-width: 1101px) {
  .bays .wall__main { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 0; padding: 1em 1.8em 1.2em; overflow: hidden; }
  .bays .wall__stats { margin-bottom: .9em; }
  .bays .wall__stat { padding: .7em .9em; } .bays .wall__stat b { font-size: 1.9em; }
  .bays__grid { grid-template-columns: repeat(var(--bays-wide, var(--bays, 3)), minmax(0, 1fr)); gap: .8em; margin: 0 0 .9em; }
  .bay { min-height: 0; padding: .8em .9em .9em; gap: .45em; }
  .bay__name { white-space: nowrap; }
  .bay__pills { flex: 1 1 auto; }
  .bay__truck b { font-size: 1.8em; }
  .bay__people { margin-top: .7em; }
  .bay__task { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bay__task svg { vertical-align: -.1em; margin-right: .35em; }
  .bay__truck span, .bay__truck em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bays__below { min-height: 0; overflow: hidden; align-items: stretch; }
  .bays__below > .wall__panel { overflow: hidden; min-height: 0; container-type: inline-size; }
  .bays__put { white-space: nowrap; flex: none; }
  /* A narrow list (a 1280 screen): the pin alone says « put in a bay ». */
  @container (max-width: 36em) {
    .bays__put span { display: none; } .bays__put { padding: .35em .5em; }
    /* …and the row wraps: number, unit and pills first, the title on its own line. */
    .bays__row { flex-wrap: wrap; gap: .3em .6em; }
    .bays__row .wall__wotitle { flex: 1 1 100%; order: 9; }
    .bays__row .wall__wotitle .wall__cust { display: inline; } .bays__row .wall__wotitle .wall__cust::after { content: ' · '; font-weight: 400; color: #7f8cab; }
    .bays__row .wall__pill { margin-left: auto; }
  }
}
@media (min-width: 1101px) and (max-width: 1500px) {
  .bays .wall__actions .wall__btn span { display: none; }
  .bays .wall__btn { padding: 8px 9px; }
}
@media (min-width: 1101px) and (max-width: 1500px) {
  .bay__truck b { font-size: 1.5em; }
  .bay__name { font-size: 1em; }
  .bay__pill { padding: .25em .55em; }
}
