/* Kanban board. Uses the tokens in style.css: graphite surfaces, gold accent, no blue or purple. */

.kb-root { --kb-col: 210px; position: relative; }
/* The board uses the whole screen width instead of the usual page width. */
.content-inner:has(.kb-root) { max-width: 1760px; }
.kb-hint { margin: -4px 0 12px; }
.kb-updated { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; white-space: nowrap; }
.kb-updated .icon { width: 13px; height: 13px; }

/* The team rows scroll sideways inside their own box, so the page itself never does. */
.kb-scroll { overflow-x: auto; margin: 0 0 16px; padding-bottom: 4px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.kb-grid { display: grid; gap: 0; min-width: calc(5 * var(--kb-col)); }
.kb-col-head, .kb-row-head { background: var(--surface); }
.kb-col-head { display: flex; align-items: center; gap: 8px; padding: 13px 14px 11px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border-strong);
  font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kb-row-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-2);
  border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border); }
.kb-row-name { border-left: 3px solid var(--accent); padding-left: 10px; font-weight: 650; font-size: 14.5px; color: var(--text); }
.kb-cell { min-height: 110px; padding: 10px; display: flex; flex-direction: column; gap: 10px; border-left: 1px solid var(--border);
  transition: background-color .12s, box-shadow .12s; }
.kb-root.kb-dragging .kb-cell.kb-no { opacity: .45; }
.kb-cell.kb-ok { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.kb-cell.kb-over { background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: inset 0 0 0 2px var(--accent); }

.kb-lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kb-lane { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); min-height: 120px; }
.kb-lane-title { display: flex; align-items: center; gap: 8px; padding: 2px 2px 6px; font: 600 10.5px var(--mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.kb-lane-hold .kb-lane-title { color: var(--warning); }
.kb-lane-done .kb-lane-title { color: var(--success); }

.kb-card { display: grid; gap: 7px; padding: 12px 13px; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--faint); border-radius: var(--radius); cursor: pointer; text-align: left; user-select: none; }
.kb-card[draggable="true"] { cursor: grab; }
.kb-card:hover, .kb-card:focus-visible { border-color: var(--accent); outline: none; }
.kb-card.open { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.kb-card.dragging { opacity: .5; cursor: grabbing; }
.kb-card.prio-normal { border-left-color: var(--muted); }
.kb-card.prio-high { border-left-color: var(--warning); }
.kb-card.prio-urgent { border-left-color: var(--danger); }
.kb-card-head { display: flex; justify-content: space-between; gap: 8px; font: 500 11.5px var(--mono); letter-spacing: .04em; color: var(--muted); }
.kb-title { font-size: 15px; line-height: 1.35; overflow-wrap: break-word; }
.kb-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.kb-badges .badge { height: 22px; font-size: 11.5px; padding: 0 7px; text-transform: none; }
.kb-reason { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.kb-people { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.kb-person { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); opacity: .85; }
.kb-person .avatar.tiny { width: 18px; height: 18px; }

/* Quick view panel. */
.kb-drawer-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
.kb-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 41; overflow-y: auto; display: grid; align-content: start; gap: 14px;
  padding: 20px; background: var(--surface); border-left: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); animation: kb-slide .18s ease-out; }
@keyframes kb-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.kb-drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid var(--border-strong); }
.kb-drawer-head h2 { margin: 4px 0 0; font-size: 17px; line-height: 1.3; }
.kb-drawer-sub { margin: 4px 0 0; font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.kb-team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kb-team-list li { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.kb-team-list li.current { border-color: var(--accent); background: var(--accent-soft); }
.kb-moves { display: grid; gap: 6px; margin-top: 8px; }
.kb-moves button { justify-content: flex-start; }
.kb-open-project { justify-self: start; }

.kb-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; }
.kb-dialog-body { display: grid; gap: 4px; margin-top: 12px; }
.kb-dialog-error { margin: 10px 0 0; }

@media (prefers-reduced-motion: reduce) { .kb-drawer { animation: none; } }
@media (max-width: 900px) {
  .kb-lanes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .kb-root { --kb-col: 170px; }
  .kb-updated { margin-left: 0; }
  .kb-drawer { width: 100vw; border-left: 0; }
}
/* Long text (e.g. an on-hold reason) shortens with "…" instead of widening the lane. */
.kb-lane, .kb-card, .kb-badges { min-width: 0; }
.kb-badges > * { min-width: 0; max-width: 100%; }
/* Quick edits in the card panel. */
.kb-drawer .facts dd select, .kb-drawer .facts dd input[type=date] { width: 100%; }
.kb-target { display: grid; gap: 6px; justify-items: start; }

.kb-col-head:first-child, .kb-row-head + .kb-cell { border-left: 0; }

/* Team picker: the first screen of the Kanban page. */
.kb-picker-intro { text-align: center; margin: 4px 0 14px; }
.kb-change-team { display: inline-flex; align-items: center; gap: 4px; flex: none; white-space: nowrap; }
/* Tag for projects that belong to a big rework. */
.kb-rework { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font: 500 11px var(--mono); color: var(--accent);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kb-rework .icon { width: 12px; height: 12px; flex: none; }
