/* ═══════════════════════════════════════════════════════════════════════════
   Workbench v1 - OrgFoundry daily landing tab.
   Layout: hero + 3-card row + recent feed + KPI strip + opt-out prompt.
   Scope: .wb-* classes only.

   Typography note: type sizes were lifted ~+1.5–2px across the board for
   readability (matching the org-chart card pass) - labels, sub-text and KPI
   captions in particular were too small to scan comfortably at 9.5–11px.
   ═══════════════════════════════════════════════════════════════════════════ */

#workbench-view {
  /* Workbench is a flex child of #workspace; take all available space
     so the inner wb-shell can extend up to its max-width cap rather
     than collapsing to its content width. */
  flex: 1 1 auto;
  min-width: 0;
  font-family: 'IBM Plex Sans', sans-serif;
  color: #111827;
  background: #FAFAFA;
  overflow-y: auto;
}
#workbench-view.hidden-view { display: none !important; }

.wb-shell {
  /* Wider cap for high-res displays - 1200px was leaving large dead zones
     on 1920+ widths. min(1600, 100vw - 80) keeps the cap fluid on narrow
     screens too. */
  max-width: min(1600px, calc(100vw - 80px));
  margin: 0 auto;
  padding: 24px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.wb-hero {
  background: linear-gradient(135deg, #FFFFFF 0%, #FFFBEB 100%);
  border: 1px solid #E5E7EB;
  border-left: 4px solid #FF5A00;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.wb-hero-left {
  flex: 0 0 auto;
}
.wb-hero-greeting {
  font-size: 24px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.wb-hero-date {
  font-size: 13px;
  color: #6B7280;
  margin-top: 4px;
  font-weight: 600;
}
.wb-hero-summary {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding-left: 24px;
  border-left: 1px solid #E5E7EB;
}
.wb-hero-tier {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 11px;
  background: #E5E7EB;
  color: #4B5563;
}
.wb-hero-tier-calm   { background: #D1FAE5; color: #065F46; }
.wb-hero-tier-active { background: #FEF3C7; color: #92400E; }
.wb-hero-tier-busy   { background: #FEE2E2; color: #991B1B; }
.wb-hero-stats {
  font-size: 15px;
  color: #4B5563;
  font-weight: 500;
  line-height: 1.5;
}
.wb-hero-stats strong {
  color: #111827;
  font-weight: 800;
}

/* ── 3-card row ─────────────────────────────────────────────────────────── */
.wb-row-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 980px) {
  .wb-row-cards { grid-template-columns: 1fr; }
}

.wb-card {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.wb-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.wb-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid #F3F4F6;
}
.wb-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 22px;
}
.wb-card-title {
  flex: 1;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #111827;
}
.wb-card-count {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 10px;
  background: #1F2937;
  color: #FFFFFF;
}
.wb-card-meta {
  font-size: 11.5px;
  color: var(--muted-text);
  font-weight: 600;
  margin-left: 4px;
}

.wb-card-body {
  flex: 1;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wb-card-body-list {
  padding: 4px 4px 8px;
}

.wb-card-foot {
  border-top: 1px solid #F3F4F6;
  padding: 8px 16px 10px;
}
.wb-card-foot-btn {
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: #1565C0;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.02em;
  transition: color 0.12s ease;
}
.wb-card-foot-btn:hover { color: #0D47A1; }

.wb-card-more {
  font-size: 11.5px;
  color: var(--muted-text);
  text-align: center;
  padding: 6px 0 0;
  font-style: italic;
}

/* ── Queue card row ─────────────────────────────────────────────────────── */
.wb-q-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.wb-q-row:hover {
  background: #F9FAFB;
  border-color: #E5E7EB;
}
.wb-q-row-count {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex: 0 0 28px;
  text-align: center;
}
.wb-q-row-label {
  flex: 1;
  font-size: 13.5px;
  color: #4B5563;
  font-weight: 600;
}
.wb-q-row-arrow {
  flex: 0 0 auto;
  color: #D1D5DB;
  font-size: 15px;
  transition: color 0.12s, transform 0.12s;
}
.wb-q-row:hover .wb-q-row-arrow {
  color: #4B5563;
  transform: translateX(2px);
}

/* ── Scenarios card row ─────────────────────────────────────────────────── */
.wb-s-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.wb-s-row:hover {
  background: #F9FAFB;
  border-color: #E5E7EB;
}
.wb-s-row-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
}
.wb-s-row-meta {
  font-size: 12px;
  color: #6B7280;
  font-weight: 600;
}

/* ── Watched card row ───────────────────────────────────────────────────── */
.wb-w-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.wb-w-row:hover {
  background: #FFFBEB;
  border-color: #FED7AA;
}
.wb-w-row-star {
  color: #F59E0B;
  font-size: 14px;
  flex: 0 0 auto;
}
.wb-w-row-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.wb-w-row-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wb-w-row-sub {
  font-size: 12px;
  color: #6B7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Empty card states ──────────────────────────────────────────────────── */
.wb-empty {
  padding: 18px 14px;
  text-align: center;
  color: #6B7280;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wb-empty-icon {
  font-size: 30px;
  margin-bottom: 4px;
}
.wb-empty-msg {
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
}
.wb-empty-sub {
  font-size: 12px;
  color: var(--muted-text);
  line-height: 1.5;
  max-width: 260px;
  margin: 0 auto;
}

/* ── Recent feed (full-width card) ──────────────────────────────────────── */
.wb-card-recent { min-height: auto; }
.wb-r-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid #F3F4F6;
  transition: background 0.12s ease;
}
.wb-r-row:last-child { border-bottom: 0; }
.wb-r-row-clickable { cursor: pointer; }
.wb-r-row-clickable:hover { background: #F9FAFB; }
.wb-r-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 800;
  flex: 0 0 22px;
}
.wb-r-row-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.wb-r-row-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wb-r-row-sub {
  font-size: 12px;
  color: #6B7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wb-r-row-age {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-text);
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 9px;
  background: #F3F4F6;
}

/* ── KPI strip ──────────────────────────────────────────────────────────── */
.wb-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 4px 2px;
}
@media (max-width: 760px) {
  .wb-kpis { grid-template-columns: repeat(2, 1fr); }
}
.wb-kpi {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 14px 16px;
  text-align: left;
}
.wb-kpi-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
  line-height: 1;
}
.wb-kpi-good { color: #059669; }
.wb-kpi-warn { color: #D97706; }
.wb-kpi-bad  { color: #DC2626; }
.wb-kpi-lbl {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6B7280;
  margin-top: 6px;
}

/* ── Foot prompt (opt-out from default landing) ─────────────────────────── */
.wb-foot-prompt {
  text-align: center;
  padding: 16px 0 0;
  margin-top: 4px;
  border-top: 1px dashed #E5E7EB;
}
.wb-foot-link {
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 12px;
  color: var(--muted-text);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #E5E7EB;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  transition: color 0.12s ease;
}
.wb-foot-link:hover {
  color: #4B5563;
  text-decoration-color: var(--muted-text);
}
