.board-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.board-header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
.board-header h1 { font-size: clamp(25px, 2vw, 34px); }
.demo-badge.is-live { border-color: color-mix(in srgb, var(--forest) 24%, var(--line)); background: var(--forest-soft); color: var(--forest); }
.demo-badge.is-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent); }
.demo-badge.is-error { background: var(--red-soft); color: var(--red); }
.identity-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-strong); }
.identity-chip > span:last-child { display: grid; }
.identity-chip strong { font-size: 11px; }
.identity-chip small { color: var(--muted); font-size: 9px; }

.view-tabs { min-height: 58px; display: flex; align-items: flex-end; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--panel); overflow-x: auto; }
.view-tab { min-height: 46px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); white-space: nowrap; }
.view-tab:hover, .view-tab:focus-visible { color: var(--ink); outline: none; }
.view-tab.is-active { border-bottom-color: var(--forest); color: var(--forest); font-weight: 750; }
.view-tab strong { min-width: 20px; display: inline-grid; place-items: center; margin-left: 5px; padding: 2px 5px; border-radius: 999px; background: var(--gray-soft); font-size: 10px; }
.tab-spacer { flex: 1; min-width: 20px; }
.view-tab.secondary { font-size: 12px; }

.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 24px; background: var(--panel); }
.toolbar-copy { display: grid; gap: 3px; }
.toolbar-copy strong { font-size: 14px; }
.toolbar-copy span { color: var(--muted); font-size: 10px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.search-field, .compact-select { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-strong); color: var(--muted); font-size: 10px; }
.search-field input, .compact-select select { border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-field input { width: 170px; }

.kanban-scroll { flex: 1; overflow: auto; padding: 16px; }
.kanban-board { min-width: 1500px; min-height: 610px; display: grid; grid-template-columns: repeat(7, minmax(190px, 1fr)); gap: 10px; }
.stage-column { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--stage-color) 7%, var(--panel)); overflow: hidden; }
.stage-column:nth-child(1) { --stage-color: #83918a; }
.stage-column:nth-child(2) { --stage-color: #68849b; }
.stage-column:nth-child(3) { --stage-color: #4d93a9; }
.stage-column:nth-child(4) { --stage-color: #2f9b87; }
.stage-column:nth-child(5) { --stage-color: #4a9558; }
.stage-column:nth-child(6) { --stage-color: #a17636; }
.stage-column:nth-child(7) { --stage-color: #7f6a95; }
.stage-head { min-height: 88px; position: relative; padding: 14px; border-bottom: 1px solid color-mix(in srgb, var(--stage-color) 23%, var(--line)); }
.stage-head::after { content: ""; position: absolute; top: 29px; left: 50px; right: -16px; height: 1px; background: color-mix(in srgb, var(--stage-color) 55%, var(--line)); z-index: 0; }
.stage-column:last-child .stage-head::after { display: none; }
.stage-sequence { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }
.stage-number { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--stage-color) 65%, var(--line)); border-radius: 50%; background: var(--panel); color: var(--stage-color); font-size: 11px; font-weight: 850; }
.stage-count { padding: 3px 7px; border-radius: 999px; background: color-mix(in srgb, var(--stage-color) 13%, var(--panel)); color: var(--stage-color); font-size: 9px; font-weight: 750; }
.stage-head h2 { margin-top: 9px; font-size: 15px; }
.stage-head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.stage-cards { flex: 1; display: grid; align-content: start; gap: 9px; padding: 10px; }
.empty-column { min-height: 120px; display: grid; place-items: center; padding: 18px; color: var(--muted); font-size: 10px; text-align: center; }

.workshop-card { width: 100%; min-height: 292px; display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-strong); box-shadow: var(--shadow-1); text-align: left; transition: transform 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease); }
.workshop-card:hover, .workshop-card:focus-visible { transform: translateY(-2px); border-color: var(--stage-color); box-shadow: 0 12px 28px rgba(24, 48, 39, 0.1); outline: none; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-step { padding: 3px 7px; border-radius: 6px; background: color-mix(in srgb, var(--stage-color) 14%, var(--panel)); color: var(--stage-color); font-size: 9px; font-weight: 800; }
.card-alert { color: var(--red); font-size: 9px; font-weight: 750; }
.card-alert.pending { color: var(--amber); }
.workshop-card h3 { margin: 14px 0 5px; font-size: 15px; line-height: 1.4; }
.card-context { display: grid; gap: 7px; color: var(--muted); font-size: 10px; }
.distance-badge { width: max-content; padding: 3px 7px; border-radius: 999px; background: var(--gray-soft); color: var(--muted); font-size: 8px; font-weight: 800; }
.distance-badge.soon { background: var(--amber-soft); color: var(--amber); }
.distance-badge.urgent, .distance-badge.overdue { background: var(--red-soft); color: var(--red); }
.card-owner { display: flex; align-items: center; gap: 7px; margin-top: 13px; color: var(--muted); font-size: 10px; }
.card-owner .avatar { width: 25px; height: 25px; }
.card-spacer { flex: 1; min-height: 15px; }
.next-todo { display: grid; gap: 4px; margin-bottom: 13px; padding: 9px 10px; border-left: 2px solid color-mix(in srgb, var(--stage-color) 72%, var(--line)); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--stage-color) 7%, var(--paper)); }
.next-todo small { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .04em; }
.next-todo strong { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.progress-copy { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; color: var(--muted); font-size: 9px; }
.progress-copy strong { color: var(--ink); font-size: 12px; }
.progress-track { height: 5px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--stage-color); }
.card-action { min-height: 36px; display: grid; place-items: center; margin-top: 13px; border-radius: 8px; background: var(--forest); color: white; font-size: 11px; font-weight: 750; }
.card-action.warning { background: var(--red); }
.card-action.approval { background: var(--amber); }
body.dark .card-action { color: #10231b; }

.approval-backdrop { position: fixed; inset: 0; z-index: 49; background: rgba(18, 27, 23, 0.26); backdrop-filter: blur(2px); }
.approval-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(500px, 94vw); display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow-2); transform: translateX(104%); transition: transform 230ms var(--ease); }
.approval-drawer.is-open { transform: translateX(0); }
.drawer-header { padding: 22px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.drawer-kicker { margin: 0 0 6px; color: var(--forest); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.drawer-header h2 { font-size: 21px; }
.drawer-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.drawer-close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 20px; }
.drawer-status-row { display: flex; gap: 7px; margin-top: 14px; flex-wrap: wrap; }
.drawer-tabs { display: flex; gap: 3px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.drawer-tab { min-height: 48px; padding: 0 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 11px; }
.drawer-tab.is-active { border-bottom-color: var(--forest); color: var(--forest); font-weight: 750; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 20px 110px; }
.drawer-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.drawer-section-title h3 { font-size: 14px; }
.drawer-section-title span { color: var(--muted); font-size: 9px; }
.detail-list { display: grid; gap: 7px; }
.detail-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 9px; align-items: center; min-height: 60px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-strong); }
.task-check { width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 6px; color: transparent; font-size: 11px; }
.task-check.done { border-color: var(--forest); background: var(--forest); color: white; }
.detail-item strong { display: block; font-size: 11px; }
.detail-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.deliverable-item { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-strong); }
.deliverable-item.has-file { border-color: color-mix(in srgb, var(--forest) 24%, var(--line)); }
.deliverable-head { display: flex; justify-content: space-between; gap: 12px; }
.deliverable-head > div { display: grid; gap: 5px; }
.deliverable-head strong { font-size: 11px; }
.material-type { width: max-content; color: var(--forest); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.deliverable-item p { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.preview-button { width: 100%; min-height: 36px; display: flex; align-items: center; justify-content: space-between; margin-top: 11px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--forest); font-size: 10px; font-weight: 800; }
.preview-button:hover { border-color: var(--forest); }
.empty-detail { min-height: 260px; display: grid; place-content: center; gap: 7px; padding: 28px; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; }
.empty-detail strong { font-size: 13px; }
.empty-detail span { color: var(--muted); font-size: 10px; }
.approval-timeline { display: grid; gap: 0; }
.approval-event { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 10px; min-height: 76px; }
.approval-event::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 1px; background: var(--line); }
.approval-event:last-child::before { display: none; }
.event-dot { width: 23px; height: 23px; display: grid; place-items: center; z-index: 1; border-radius: 50%; background: var(--gray-soft); color: var(--muted); font-size: 9px; }
.event-dot.done { background: var(--forest-soft); color: var(--forest); }
.event-copy strong { display: block; font-size: 11px; }
.event-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.drawer-actions { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; padding: 15px 20px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(16px); }
.drawer-button { min-height: 42px; padding: 0 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-strong); font-size: 11px; font-weight: 750; }
.drawer-button.primary { border-color: var(--forest); background: var(--forest); color: white; }
.drawer-button.danger { color: var(--red); }
body.dark .drawer-button.primary { color: #10231b; }

.empty-view { min-width: 600px; min-height: 430px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty-view strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 16px; }

.preview-backdrop { position: fixed; inset: 0; z-index: 79; background: rgba(10, 17, 14, .58); backdrop-filter: blur(8px); }
.preview-modal { position: fixed; inset: 5vh 5vw; z-index: 80; display: flex; flex-direction: column; border: 1px solid color-mix(in srgb, var(--line) 75%, white); border-radius: 20px; background: #111713; box-shadow: 0 30px 90px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transform: translateY(18px) scale(.985); transition: opacity 180ms var(--ease), transform 180ms var(--ease); overflow: hidden; }
.preview-modal.is-open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.preview-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 18px 14px 22px; border-bottom: 1px solid rgba(255,255,255,.12); color: white; }
.preview-header p { margin: 0 0 4px; color: #8ebca9; font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.preview-header h2 { max-width: 65vw; overflow: hidden; color: white; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.preview-actions { display: flex; align-items: center; gap: 9px; }
.preview-actions a { padding: 8px 11px; border: 1px solid rgba(255,255,255,.17); border-radius: 8px; color: rgba(255,255,255,.75); font-size: 9px; text-decoration: none; }
.preview-actions button { width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; background: transparent; color: white; font-size: 18px; }
.preview-content { flex: 1; min-height: 0; display: grid; place-items: center; padding: 20px; overflow: auto; background: radial-gradient(circle at 50% 20%, rgba(61, 91, 77, .34), transparent 50%), #111713; }
.preview-content img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 18px 55px rgba(0,0,0,.35); }
.preview-content iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; background: white; }
.preview-content video { max-width: 100%; max-height: 100%; }
.preview-content audio { width: min(560px, 90%); }
.preview-unsupported { display: grid; gap: 8px; color: white; text-align: center; }
.preview-unsupported span { color: rgba(255,255,255,.56); font-size: 11px; }

@media (max-width: 760px) {
  .board-header { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .identity-chip { display: none; }
  .view-tabs { padding: 0 12px; }
  .tab-spacer { display: none; }
  .board-toolbar { align-items: flex-start; flex-direction: column; padding: 13px 16px; }
  .toolbar-actions { width: 100%; }
  .search-field { flex: 1; }
  .search-field input { min-width: 0; width: 100%; }
  .compact-select { display: none; }
  .kanban-scroll { padding: 8px; }
  .kanban-board { min-width: 1380px; grid-template-columns: repeat(7, 188px); }
  .preview-modal { inset: 2vh 3vw; border-radius: 14px; }
  .preview-actions a { display: none; }
}
