/* Shared Trello-style board + job modal for the author page (index.html) and the team page (admin.html). Loaded after the
   page stylesheet and before mira-ui.css; id selectors in the toolbar block outrank mira-ui's width:100% on inputs. */
/* ---- Trello-style board (Sebastian 2026-10-10): columns are boxes that scroll inside themselves, cards never overflow the
   screen, a toolbar searches / filters / sorts, and a card opens the job as a modal with the storyboard first, the history and
   the commands inside. ---- */
.board-page { display: flex; flex-direction: column; min-height: 0; }
.board-heading { margin-bottom: 4px; }
.board-panel { display: flex; flex-direction: column; min-height: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.board-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 10px; }
.board-toolbar input[type="search"] { flex: 1 1 220px; min-width: 180px; }
.board-toolbar select { flex: 0 1 auto; }
.board-toolbar input, .board-toolbar select { background: var(--color-surface, #141414); color: inherit; border: 1px solid var(--color-border, #2a2a2a); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; }
.board-count { margin-left: auto; font-size: 12px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 12px; margin: 0 0 16px; align-items: stretch; height: calc(100vh - 290px); min-height: 360px; }
.board-column { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.board-column h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--color-border, #2a2a2a); background: var(--color-surface-2, rgba(255,255,255,.03)); position: sticky; top: 0; }
.board-column-count { font: 600 11px/1 var(--font-mono, inherit); color: var(--color-text-dim, #8a8a8a); background: var(--color-surface, #141414); border: 1px solid var(--color-border, #2a2a2a); border-radius: 999px; padding: 3px 7px; }
.board-column-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px; scrollbar-width: thin; }
.board-column-body:empty::after { content: 'Nothing here'; display: block; color: var(--color-text-dim, #8a8a8a); font-size: 12px; text-align: center; padding: 18px 0; }
.board-card.current { outline: none; border-color: var(--color-accent, #f5a623); cursor: pointer; }
.board-card:focus-visible { outline: 2px solid var(--color-accent, #f5a623); outline-offset: 1px; }
.board-card .board-author { display: block; margin-top: 2px; font-size: 12px; color: var(--color-text-dim, #8a8a8a); }
@media (max-width: 1200px) { .board { grid-template-columns: repeat(3, minmax(170px, 1fr)); height: auto; } .board-column { max-height: 60vh; } }
@media (max-width: 959px) { .board { grid-template-columns: repeat(2, minmax(150px, 1fr)); } }

/* The job modal */
.job-dialog { width: min(1480px, 96vw); max-width: none; height: 94vh; max-height: none; margin: 3vh auto; padding: 0; border: 1px solid var(--color-border, #2a2a2a); border-radius: 14px; background: var(--bg, #121212); color: var(--text, #f5f5f5); overflow: hidden; display: none; flex-direction: column; }
.job-dialog[open] { display: flex; }
.job-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(2px); }
.job-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 20px 12px; border-bottom: 1px solid var(--color-border, #2a2a2a); flex: 0 0 auto; }
.job-dialog-title h2 { margin: 2px 0 4px; font-size: 20px; line-height: 1.25; }
.job-dialog-title .muted { margin: 0; }
.job-dialog-head-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.job-close { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--color-border, #2a2a2a); background: var(--color-surface, #141414); color: inherit; font-size: 16px; cursor: pointer; }
.job-close:hover { border-color: var(--color-accent, #f5a623); }
.job-empty { margin: 20px; }
.job-dialog-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0; }
.job-main, .job-commands { min-height: 0; overflow-y: auto; padding: 16px 20px 32px; scrollbar-width: thin; }
.job-commands { border-left: 1px solid var(--color-border, #2a2a2a); background: var(--color-surface-2, rgba(255,255,255,.02)); }
.job-commands .panel { padding: 12px 14px; }
.job-commands h2 { font-size: 15px; margin: 0 0 8px; }
.job-commands textarea, .job-commands input[type="text"], .job-commands input[type="number"], .job-commands input[type="datetime-local"] { width: 100%; }
.commands-eyebrow { margin: 0 0 10px; }
.job-main .panel + .panel { margin-top: 12px; }
#team-storyboard { padding: 12px 14px 16px; }
@media (max-width: 1100px) { .job-dialog-body { grid-template-columns: 1fr; } .job-commands { border-left: 0; border-top: 1px solid var(--color-border, #2a2a2a); } .job-main { max-height: none; overflow: visible; } .job-dialog-body { overflow-y: auto; display: block; } }

/* History list inside the modal */
.timeline.history { list-style: none; padding: 0; margin: 0; }
.history-item { display: grid; grid-template-columns: 150px 80px 1fr; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--color-border, #2a2a2a); font-size: 13px; }
.history-item time { color: var(--color-text-dim, #8a8a8a); font: 500 12px/1.4 var(--font-mono, inherit); }
.history-who { font: 600 11px/1.4 var(--font-mono, inherit); letter-spacing: .06em; text-transform: uppercase; color: var(--color-accent, #f5a623); }
.history-detail { grid-column: 3; margin: 2px 0 0; color: var(--muted, #b5b5b5); white-space: pre-wrap; }

/* Toolbar fields must stay inline (mira-ui.css forces width:100% on inputs/selects at 0,3,1 specificity). */
.board-toolbar input#board-search:not([type="checkbox"]), .board-toolbar input#author-board-search:not([type="checkbox"]) { width: auto; flex: 1 1 260px; min-width: 200px; max-width: 520px; margin: 0; }
.board-toolbar select#board-owner, .board-toolbar select#board-client, .board-toolbar select#board-sort, .board-toolbar select#author-board-owner, .board-toolbar select#author-board-sort { width: auto; min-width: 150px; margin: 0; }

/* Author page: the job dialog hosts the existing #saved section; its grid becomes the dialog body. */
#job-dialog #saved.onboarding { display: block; max-width: none; min-height: 0; overflow-y: auto; padding: 0 20px 28px; scrollbar-width: thin; }
#job-dialog .job-workspace { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
/* Stacked (narrow): the storyboard/film column comes first, status + history after — the top of the modal is always the work. */
@media (max-width: 1100px) { #job-dialog .job-workspace { grid-template-columns: 1fr; } #job-dialog .job-workspace .job-main { order: -1; } }
#job-dialog #saved[hidden] { display: none; }
#job-dialog .job-workspace { margin-top: 12px; }
#job-dialog .action-strip { position: sticky; top: 0; z-index: 2; margin: 0 -20px 8px; }
.brief-dashboard .board { height: calc(100vh - 330px); min-height: 320px; }
.brief-dashboard .board-toolbar { margin: 4px 0 10px; }

/* History in a narrow column (author side): time + who on one line, the event under it. */
.job-side .history-item { grid-template-columns: auto 1fr; grid-template-areas: 'time who' 'what what' 'detail detail'; gap: 2px 10px; }
.job-side .history-item time { grid-area: time; } .job-side .history-item .history-who { grid-area: who; } .job-side .history-item strong { grid-area: what; } .job-side .history-item .history-detail { grid-area: detail; grid-column: auto; }

/* Draft cards carry a small delete control (sibling of the card button: a button cannot nest a button). */
.board-card-wrap { position: relative; }
.board-card-wrap .board-card { margin-bottom: 8px; }
.board-card-delete { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--color-text-dim, #8a8a8a); font-size: 12px; line-height: 1; cursor: pointer; opacity: .55; }
.board-card-wrap:hover .board-card-delete, .board-card-delete:focus-visible { opacity: 1; }
.board-card-delete:hover { border-color: var(--color-border, #2a2a2a); background: var(--color-surface, #141414); color: #ff7b7b; }
.brief-delete { margin-left: 10px; }

/* The action strip's button sits on the strip's centre line (style.css gives every .actions a 24px top margin). */
.action-strip .actions { margin-top: 0; }
/* The questions panel inside the job modal is a plain panel: no sticky, no sidebar grid placement, full width. */
#job-dialog .revision-feedback { position: static; max-height: none; overflow: visible; grid-column: auto; grid-row: auto; margin: 8px 0 12px; scroll-margin-top: 76px; }
#job-dialog .revision-feedback ol { margin: 12px 0; }
#job-dialog .revision-feedback ol { max-height: none; }
#job-dialog .revision-feedback form button { width: auto; }
