/* ============================================================
   Workspace: campaign switcher, board furniture, Today, grouped list,
   bulk edits, global search, Directory institutions, status badges.
   ============================================================ */

/* ---- Campaign switcher ---- */
.camp-bar { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 12px; margin-bottom: 6px; scrollbar-width: none; }
.camp-bar::-webkit-scrollbar { display: none; }
.camp-pill {
  flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  border: 1px solid var(--line); border-radius: var(--pill); background: var(--bg-elevated);
  color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s;
}
.camp-pill:hover { border-color: var(--primary); }
.camp-pill.active { background: var(--primary); border-color: var(--primary); color: var(--text-on-primary); }
.camp-n { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: var(--pill); background: var(--bg-sunken); color: var(--text-muted); }
.camp-pill.active .camp-n { background: rgba(248, 249, 240, .18); color: var(--text-on-primary); }
.camp-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: var(--pill); background: var(--primary-wash); color: var(--text); white-space: nowrap; vertical-align: middle; }
.card-opp.s-green .camp-chip { background: rgba(248, 249, 240, .16); color: #eafff0; }

/* ---- Status badges (one per stage) ---- */
.stage-badge[data-stage="fresh"]       { background: var(--bg-sunken); color: var(--text); }
.stage-badge[data-stage="their_turn"]  { background: var(--status-yellow); color: var(--qu-navy); }
.stage-badge[data-stage="chased"]      { background: var(--status-orange); color: var(--qu-navy); }
.stage-badge[data-stage="in_progress"] { background: var(--status-green); color: var(--qu-cream); }
.stage-badge[data-stage="booked"],
.stage-badge[data-stage="contract"]    { background: var(--primary); color: var(--text-on-primary); }
.stage-badge[data-stage="completed"]   { background: #DCEFE3; color: #1F6B45; }
.stage-badge[data-stage="later_date"], .stage-badge[data-stage="unlikely"],
.stage-badge[data-stage="ghost"], .stage-badge[data-stage="no"] { background: #E7E3E1; color: #6B5B57; }

/* Status icons: lit up to the current step; the current one is solid */
.st-btn.on { opacity: .9; }
.st-btn.current { opacity: 1; }
.st-btn.current svg { fill: currentColor; fill-opacity: .35; }
.st-green.current svg { fill-opacity: 1; }

/* ---- Board ---- */
.board { gap: 20px; padding: 4px 2px 16px; }
.board-shell { position: relative; }
.col-head { cursor: grab; border-radius: 8px; }
.col-head:active { cursor: grabbing; }
.col-head-right { display: inline-flex; align-items: center; gap: 6px; }
.col-fold { border: none; background: none; cursor: pointer; font-size: 16px; color: var(--text-muted); padding: 0 4px; line-height: 1; }
.col-fold:hover { color: var(--text); }
.col.col-collapsed {
  flex: 0 0 46px; padding: 10px 0; display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; align-self: stretch; min-height: 220px;
}
.col.col-collapsed:hover { border-color: var(--primary); }
.col.col-collapsed.drop-hover { background: var(--primary-wash); outline: 2px dashed var(--primary); outline-offset: -2px; }
.col-vert { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.board-nav {
  position: fixed; top: 55%; z-index: 15; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow-lg);
  font-size: 24px; line-height: 1; cursor: pointer; display: none; align-items: center; justify-content: center;
}
.board-nav.show { display: flex; }
.board-nav.prev { left: 10px; }
.board-nav.next { right: 10px; }
.board-nav:hover { border-color: var(--primary); }
@media (hover: none) { .board-nav { display: none !important; } }
.stack-pill.off { opacity: .75; }

/* ---- Toolbars ---- */
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- Grouped list + bulk edits ---- */
.list-table .sel-cell { width: 34px; padding-right: 0; }
.list-table .sel-cell input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--qu-navy); }
.list-table tr.group-row > td { background: var(--bg-sunken); cursor: pointer; border-top: 1px solid var(--line); }
.list-table tr.group-row:hover > td { background: #E7EADC; }
.group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.group-name { font-weight: 700; font-size: 15px; }
.group-bar { display: flex; width: 160px; height: 8px; border-radius: var(--pill); overflow: hidden; background: var(--bg-elevated); border: 1px solid var(--surface-border); }
.group-bar .seg { display: block; height: 100%; }
.seg.tone-none { background: #D9DDD0; } .seg.tone-yellow { background: var(--status-yellow); } .seg.tone-orange { background: var(--status-orange); }
.seg.tone-green { background: var(--status-green); } .seg.tone-navy { background: var(--primary); } .seg.tone-muted { background: #CFC6C2; }
.list-table tr.row-selected > td { background: var(--primary-wash) !important; }
.bulk-bar {
  position: sticky; bottom: 12px; z-index: 12; margin-top: 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px;
  background: var(--bg-elevated); border: 1.5px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.bulk-bar.hidden { display: none; }
.bulk-group { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bulk-bar .inp.sm { width: auto; }

/* ---- Today ---- */
.today { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.today .page-head { margin-bottom: 0; }
.today-sec { padding: 6px 0 6px; overflow: hidden; }
.today-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 18px 8px; }
.today-sec-head h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.today-n { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: var(--pill); background: var(--primary); color: var(--text-on-primary); }
.today-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--surface-border); cursor: pointer; }
.today-row:hover { background: var(--primary-wash); }
.today-status { display: flex; gap: 0; flex: none; }
.today-status .st-btn.tog { font-size: 16px; padding: 4px 5px; }
.today-main { flex: 1; min-width: 0; }
.today-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-main .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-side { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.today-empty { padding: 8px 18px 14px; }
.today-more { display: block; margin: 6px 18px 10px; }
.today-prompt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: #FFFBE6; border-color: rgba(30, 58, 95, .22); }
@media (max-width: 640px) {
  .today-row { flex-wrap: wrap; row-gap: 6px; }
  .today-main { flex-basis: 100%; }
  .today-status { order: 2; }
  .today-side { order: 3; flex: 1; justify-content: flex-end; }
}
.plan-preview { background: var(--bg-sunken); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; }
.plan-preview ul { margin: 6px 0 0; padding-left: 18px; columns: 2; }

/* ---- Global search ---- */
.gsearch { position: relative; display: flex; align-items: center; }
.gsearch-icon { position: absolute; left: 11px; font-size: 16px; color: var(--text-muted); pointer-events: none; }
.gsearch-input {
  width: 220px; padding: 8px 44px 8px 30px; border: 1px solid var(--line); border-radius: var(--pill);
  background: var(--bg-elevated); color: var(--text); font-size: 14px; transition: width .2s, border-color .15s;
}
.gsearch-input:focus { width: 300px; outline: none; border-color: var(--primary); }
.gsearch-kbd { position: absolute; right: 10px; font-family: inherit; font-size: 10.5px; color: var(--text-muted); border: 1px solid var(--surface-border); border-radius: 5px; padding: 0 5px; pointer-events: none; }
.gsearch-input:focus ~ .gsearch-kbd { display: none; }
.gsearch-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: min(440px, 92vw); max-height: 70vh; overflow-y: auto; z-index: 40;
  background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px 0;
}
.gsearch-panel.hidden { display: none; }
.gsearch-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: 10px 14px 4px; }
.gsearch-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; border: none; background: none; padding: 7px 14px; cursor: pointer; color: var(--text); font-family: inherit; }
.gsearch-item:hover, .gsearch-item.sel { background: var(--primary-wash); }
.gsearch-title { font-weight: 600; font-size: 14px; }
.gsearch-sub { font-size: 12.5px; color: var(--text-muted); }
.gsearch-empty, .gsearch-more { padding: 8px 14px; }
@media (max-width: 860px) { .gsearch { order: -1; flex: 1; } .gsearch-input, .gsearch-input:focus { width: 100%; } .gsearch-kbd { display: none; } }

/* ---- Directory: institutions ---- */
.dir-inst { background: var(--bg-elevated); border: 1px solid var(--surface-border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.dir-inst-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; padding: 14px 16px; border: none; background: none; cursor: pointer; color: var(--text); text-align: left; font-family: inherit; }
.dir-inst-head:hover { background: var(--primary-wash); }
.dir-inst-name { font-weight: 700; font-size: 17px; }
.dir-inst-body { padding: 4px 12px 12px; border-top: 1px solid var(--surface-border); background: var(--bg); }
.dir-inst-body .dir-card { margin-top: 8px; }
.dir-card-inst { border-style: dashed; }
.dir-rest-head { margin-top: 22px; }
