/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
/* 使用系统字体，避免 Next 16 Turbopack 对 next/font 与 Google Fonts 的解析错误 */

:root {
  --font-ibm-plex-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-cormorant-garamond: Georgia, "Times New Roman", serif;
  --bg: #f3f0ea;
  --bg-alt: #e9e4dc;
  --ink: #161616;
  --muted: #6b635c;
  --accent: #b34724;
  --accent-2: #1f4f5f;
  --panel: #ffffff;
  --line: #d2cbc2;
  --shadow: rgba(10, 10, 10, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ibm-plex-sans), system-ui, sans-serif;
  background: radial-gradient(circle at top left, #f7f4ee 0%, #efe9e1 50%, #e6dfd6 100%);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  min-height: 100vh;
}

body.setup-mode .app-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}

body.setup-mode .side {
  display: none;
}

body.setup-mode .main {
  padding: 32px 56px 56px;
}

body.communications-mode .app-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}

body.communications-mode .side {
  display: none;
}

body.communications-mode .main {
  padding: 20px 24px 24px;
}

/* Sidebar collapse toggle */
body.side-collapsed .app-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}

body.side-collapsed .side {
  display: none;
}

.main {
  position: relative;
  min-width: 0;
}

.sidebar-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 40px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  z-index: 10;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.sidebar-toggle:hover {
  background: var(--bg-alt);
  color: var(--ink);
}

body.side-collapsed .sidebar-toggle {
  border-right: 1px solid var(--line);
  border-radius: 0 6px 6px 0;
}

body.setup-mode .sidebar-toggle,
body.communications-mode .sidebar-toggle {
  display: none;
}

/* Sub-nav layout for merged sections (Agents, Communications) */
.sub-nav-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  grid-gap: 24px;
  gap: 24px;
}

.sub-nav-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sub-nav-sidebar-item {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.sub-nav-sidebar-item:hover {
  background: var(--panel);
  color: var(--ink);
}

.sub-nav-sidebar-item.active {
  background: var(--panel);
  color: var(--ink);
  font-weight: 500;
  border-color: var(--line);
  box-shadow: 0 4px 12px var(--shadow);
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.rail {
  background: linear-gradient(180deg, #f6f2ec 0%, #eae3da 100%);
  border-right: 1px solid var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 5000;
  height: 100vh;
  box-sizing: border-box;
  overflow: visible;
}

.brand {
  font-family: var(--font-cormorant-garamond), serif;
  font-size: 28px;
  letter-spacing: 2px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
}

.nav-item.active {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 6px 16px var(--shadow);
}

.rail-footer {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 10px 0;
  border-top: 1px solid rgba(210, 203, 194, 0.6);
}

.status-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.rail-footer-item {
  width: 100%;
}

.settings-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
  text-decoration: none;
}

.settings-link:hover,
.settings-link:focus-visible {
  color: var(--ink);
  border-color: rgba(179, 71, 36, 0.35);
  background: #fff9f2;
}

.connection-status {
  width: 100%;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-sizing: border-box;
}

.language-selector,
.language-selector-control,
.user-login-link,
.user-logout-action {
  width: 100%;
}

.connection-status {
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.connection-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}

.connection-status-connected {
  border-color: rgba(20, 128, 85, 0.35);
  color: #19634d;
}

.connection-status-dot-connecting,
.connection-status-dot-reconnecting {
  background: #f59e0b;
}

.connection-status-dot-disconnected {
  background: #ef4444;
}

.connection-status-dot-connected {
  background: #22c55e;
}

.connection-status-dot-polling {
  background: #8b5cf6;
}

.connection-status-connected .connection-status-dot,
.connection-status-connecting .connection-status-dot,
.connection-status-reconnecting .connection-status-dot,
.connection-status-disconnected .connection-status-dot,
.connection-status-polling .connection-status-dot {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.connection-status-connected {
  background: #f3fbf6;
}

.connection-status-reconnecting,
.connection-status-connecting {
  color: #7e4c11;
  background: #fffbeb;
}

.connection-status-disconnected {
  color: #832020;
  background: #fff5f5;
}

.connection-status-polling {
  color: #5d3995;
  background: #f6f3ff;
}

.language-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  margin: 0;
}

.language-selector-label {
  color: var(--muted);
}

.language-selector-control {
  width: 100%;
  min-width: 0;
  background: var(--panel);
  border-color: var(--line);
  border-radius: 10px;
  height: 34px;
}

.user-avatar-lg {
  display: none;
}

.user-menu-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, #b56d2b, #8f4927);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.user-menu-name {
  font-size: 15px;
}

.user-menu-section-title {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-menu-mini-label {
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0;
}

.user-menu-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(210, 203, 194, 0.45);
  border-radius: 10px;
  overflow: hidden;
}

.user-menu-actions .settings-link,
.user-menu-actions .user-logout-action,
.user-menu-actions .connection-status {
  border: 0;
  border-radius: 0;
  width: 100%;
  justify-content: flex-start;
  min-height: 34px;
}

.user-menu-actions .settings-link {
  border-bottom: 1px solid rgba(210, 203, 194, 0.4);
  background: #fff;
}

.user-menu-actions .connection-status {
  border-bottom: 1px solid rgba(210, 203, 194, 0.4);
}

.user-logout-action {
  padding: 8px 10px;
  font-size: 12px;
  color: #7a4b30;
  font-weight: 600;
  text-align: left;
}

.user-language-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-language-select {
  width: 100%;
  border: 1px solid rgba(210, 203, 194, 0.62);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--ink);
  cursor: pointer;
  box-sizing: border-box;
}

.user-language-select:hover,
.user-language-select:focus-visible {
  border-color: rgba(179, 71, 36, 0.42);
  background: rgba(255, 255, 255, 1);
}

.user-language-select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(179, 71, 36, 0.25);
}

.user-info {
  --user-menu-avatar-size: 38px;
  --user-menu-popover-width: min(276px, calc(100vw - 96px));
  --user-menu-offset: 10px;
  --user-menu-padding: 12px;
  --user-menu-viewport-padding: 24px;
  --user-menu-radius: 18px;
  --user-menu-layer: 5000;
  --user-menu-pointer-size: 14px;
  position: relative;
  display: inline-flex;
  align-items: center;
  width: auto;
  isolation: auto;
  z-index: var(--user-menu-layer);
}

.user-menu-trigger {
  width: var(--user-menu-avatar-size);
  height: var(--user-menu-avatar-size);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: linear-gradient(145deg, #6f4b35, #2f2924);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  position: relative;
  z-index: calc(var(--user-menu-layer) + 1);
}

.user-menu-trigger:hover,
.user-menu-trigger:focus-visible,
.user-info.open .user-menu-trigger {
  border-color: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.user-menu-trigger:focus-visible {
  outline: none;
}

.user-menu-popover {
  position: fixed;
  left: calc(var(--user-menu-viewport-padding) + var(--user-menu-avatar-size) + var(--user-menu-offset));
  right: auto;
  bottom: var(--user-menu-viewport-padding);
  top: auto;
  width: var(--user-menu-popover-width);
  min-width: var(--user-menu-popover-width);
  box-sizing: border-box;
  padding: var(--user-menu-padding);
  border-radius: var(--user-menu-radius);
  border: 1px solid rgba(210, 203, 194, 0.62);
  background: rgba(250, 247, 241, 0.98);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow:
    0 22px 54px rgba(58, 43, 31, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(calc(var(--user-menu-offset) * -1));
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    visibility 160ms ease;
  z-index: var(--user-menu-layer);
}

.user-menu-popover::before {
  content: "";
  position: absolute;
  left: calc(var(--user-menu-offset) * -1);
  bottom: calc((var(--user-menu-avatar-size) - var(--user-menu-pointer-size)) / 2);
  width: var(--user-menu-offset);
  height: var(--user-menu-pointer-size);
  background: rgba(250, 247, 241, 0.98);
  -webkit-clip-path: polygon(100% 0, 100% 100%, 0 50%);
          clip-path: polygon(100% 0, 100% 100%, 0 50%);
}

.user-info.open .user-menu-popover,
.user-info:hover .user-menu-popover,
.user-info:focus-within .user-menu-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.user-menu-popover-header {
  align-items: flex-start;
  min-height: 0;
}

.user-menu-identity {
  min-width: 0;
}

@media (max-width: 720px) {
  .user-menu-popover {
    left: 12px;
    right: 12px;
    bottom: calc(var(--user-menu-viewport-padding) + var(--user-menu-avatar-size) + var(--user-menu-offset));
    width: auto;
    min-width: 0;
    transform: translateY(var(--user-menu-offset));
  }

  .user-menu-popover::before {
    display: none;
  }

  .user-info.open .user-menu-popover,
  .user-info:hover .user-menu-popover,
  .user-info:focus-within .user-menu-popover {
    transform: translateY(0);
  }
}

.user-info-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info-card {
  display: none;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, #b56d2b, #8f4927);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.user-details {
  min-width: 0;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(179, 71, 36, 0.2);
  color: #7a4b30;
  background: #f6ede3;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 600;
}

.user-login-link {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 500;
}

.user-login-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.user-budget-label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.user-budget-bar-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(107, 99, 92, 0.18);
  overflow: hidden;
}

.user-budget-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 240ms ease;
  background: #4caf50;
}

.user-budget-bar-fill.yellow {
  background: #fbc02d;
}

.user-budget-bar-fill.red {
  background: #e53935;
}

.user-budget-bar-fill.green {
  background: #4caf50;
}

.user-session-warning {
  border: 1px dashed rgba(188, 84, 35, 0.6);
  color: #b85f2d;
  background: #fff3e7;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  text-align: center;
}

.user-logout-action {
  border: 1px solid rgba(179, 71, 36, 0.35);
  border-radius: 10px;
  padding: 8px 10px;
  width: 100%;
  background: #fff;
  color: #7a4b30;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
}

.user-logout-action:hover {
  background: #f8efe5;
}

.user-logout-action:focus-visible {
  outline: 2px solid rgba(179, 71, 36, 0.35);
  outline-offset: 1px;
}

.user-logout-action:hover,
.user-logout-action:focus-visible {
  transform: translateY(-1px);
}

.main {
  padding: 40px 48px 48px;
}

.side {
  border-left: 1px solid var(--line);
  padding: 32px 24px;
  background: #f6f1ea;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 24px var(--shadow);
}

.side-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.side-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}

.side-body {
  font-size: 13px;
  color: var(--muted);
}

.page {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
  max-width: 100%;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  min-width: 0;
}

.header > * {
  min-width: 0;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--muted);
}

h1 {
  font-family: var(--font-cormorant-garamond), serif;
  font-size: 40px;
  margin: 8px 0 12px;
}

.lede {
  color: var(--muted);
  max-width: 520px;
}

.header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.grid {
  display: grid;
  grid-gap: 16px;
  gap: 16px;
}

.grid.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 24px var(--shadow);
  min-width: 0;
  max-width: 100%;
}

.card.tall {
  min-height: 280px;
}

.card-title {
  font-weight: 600;
  margin-bottom: 12px;
}

.card-sub {
  color: var(--muted);
  font-size: 13px;
}

.metric {
  font-size: 32px;
  font-weight: 600;
}

.metric.blocker,
.severity.blocker {
  color: #b00020;
}

.severity {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

.severity.summary {
  color: var(--accent-2);
}

.workflow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-gap: 8px;
  gap: 8px;
}

.node {
  border: 1px dashed var(--line);
  padding: 8px;
  text-align: center;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
}

.node.active {
  border-style: solid;
  color: var(--ink);
  background: #f8efe6;
}

.thread {
  background: #f9f5f0;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.thread-body {
  font-size: 13px;
  color: var(--muted);
}

.thread-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  flex-wrap: wrap;
}

.task-hub-page .header {
  align-items: flex-start;
}

.task-hub-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 1.3fr);
  grid-gap: 16px;
  gap: 16px;
}

.task-hub-filters {
  display: grid;
  grid-template-columns: 1fr repeat(4, 150px);
  grid-gap: 10px;
  gap: 10px;
  margin-bottom: 12px;
}

.thread-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--muted);
}

.graph {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-gap: 8px;
  gap: 8px;
}

.graph-node {
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
}

.graph-node.active {
  background: #f8efe6;
}

.meeting-card {
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 13px;
}

.plugin {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.plugin-name {
  font-weight: 500;
}

.badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.config {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.config-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.tiny {
  font-size: 12px;
  color: var(--muted);
}

.setup-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.setup-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step {
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.step.active {
  background: #f8efe6;
  border-color: var(--ink);
}

.setup-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 24px var(--shadow);
}

.setup-grid {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.setup-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.setup-grid input,
.setup-grid select,
.input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}

.setup-draft {
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--font-ibm-plex-sans), system-ui, sans-serif;
  font-size: 12px;
}

.setup-actions,
.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.setup-errors,
.setup-error {
  margin-top: 12px;
  color: #b00020;
  font-size: 12px;
}

.setup-output {
  margin-top: 12px;
  background: #f8f5ef;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  overflow: auto;
}

.setup-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.setup-row {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  grid-template-columns: 2fr 1fr auto;
  align-items: center;
}

.setup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.setup-message {
  margin-top: 12px;
  color: var(--accent-2);
  font-size: 12px;
}

.setup-gate {
  padding: 12px 0;
  color: var(--muted);
  font-size: 12px;
}

.team-graph-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-graph-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.team-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.team-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.team-tool {
  border: 1px solid var(--line);
  background: #f8f2ea;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.team-tool.active {
  background: var(--accent-2);
  color: #fff;
  border-color: transparent;
}

.team-tool.ghost {
  background: transparent;
}

.team-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  height: 600px;
  overflow: hidden;
}

.team-board .react-flow {
  background: #fbf9f5;
}

.team-node {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 8px 18px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 180px;
  cursor: pointer;
}

.team-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.team-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}

.team-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.team-btn,
.team-handle {
  border: 1px solid var(--line);
  background: #f8f2ea;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  line-height: 1.1;
  cursor: pointer;
}

.team-btn.danger {
  background: #fbecec;
  border-color: #e0a3a3;
}

.rf-role-node {
  width: 230px;
}

.rf-note-node {
  background: #fff7df;
  border: 1px solid #e4d1a1;
  border-radius: 12px;
  padding: 10px;
  width: 180px;
}

.rf-note-input {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  font-family: inherit;
  font-size: 12px;
  min-height: 80px;
}

.rf-shape-node {
  width: 120px;
  height: 80px;
  border: 2px solid #d6c9b9;
  background: transparent;
  border-radius: 12px;
}

.rf-shape-node.ellipse {
  border-radius: 999px;
}

.rf-handle {
  width: 8px;
  height: 8px;
  background: var(--accent-2);
  border: 1px solid #fff;
}

.rf-draw-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.rf-draw-layer.active {
  pointer-events: auto;
  cursor: crosshair;
}

.rf-draw-svg {
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
}

.team-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff7ee;
}

.team-panel-actions {
  display: flex;
  gap: 8px;
}

.team-panel-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.team-message {
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef4f7;
  border: 1px solid var(--line);
  font-size: 12px;
}

.team-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fbecec;
  border: 1px solid #e0a3a3;
  font-size: 12px;
}

.settings-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-line {
  font-size: 12px;
  color: var(--muted);
}

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fdfbf7;
  font-size: 13px;
}

.notice.success {
  border-color: #b7d7c4;
  background: #f1fbf4;
}

.notice.error {
  border-color: #efb4b4;
  background: #fff5f5;
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 12px;
  gap: 12px;
}

.form-grid.inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  color: var(--ink);
}

.select.small {
  padding: 6px 10px;
  font-size: 12px;
}

.textarea {
  resize: vertical;
}

.pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  background: #f9f5f0;
}

.pill.enriching-shimmer {
  animation: skeleton-pulse 1.2s ease-in-out infinite;
  color: var(--muted);
  font-size: 11px;
}

.pill.blocker {
  color: #8e1b1b;
  border-color: #e3b2b2;
  background: #fff2f2;
}

.pill.summary {
  color: #1f4f5f;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.thread-list {
  display: grid;
  grid-gap: 10px;
  gap: 10px;
  margin-bottom: 12px;
}

.task-list {
  display: grid;
  grid-gap: 10px;
  gap: 10px;
}

.task-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f9f5f0;
  cursor: pointer;
  text-align: left;
  align-items: center;
}

.task-row.active {
  border-color: var(--accent);
  background: #fff7f1;
}

.task-title {
  font-weight: 600;
  color: var(--ink);
}

.task-select {
  display: flex;
  align-items: center;
}

.task-select input {
  width: 16px;
  height: 16px;
}

.task-main {
  flex: 1 1;
  background: transparent;
  border: none;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.bulk-actions {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fdf9f2;
  margin-bottom: 12px;
}

.bulk-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  grid-gap: 8px;
  gap: 8px;
  align-items: end;
}

.bulk-group .tiny {
  grid-column: 1 / -1;
}

.gate-list.compact {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.assignment-row {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  grid-gap: 10px;
  gap: 10px;
  align-items: end;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.divider {
  border-top: 1px solid var(--line);
}

.section-title {
  font-weight: 600;
  font-size: 13px;
  margin-top: 6px;
}

.gate-list {
  display: flex;
  gap: 12px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.gate-item {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.approval-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  grid-gap: 10px;
  gap: 10px;
}

.approval-actions {
  display: flex;
  gap: 6px;
}

.side-error {
  margin-top: 8px;
  font-size: 12px;
  color: #8e1b1b;
}

@media (max-width: 900px) {
  .app-shell,
  body.setup-mode .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    gap: 12px;
  }

  .main,
  body.setup-mode .main,
  body.communications-mode .main {
    padding: 14px 16px 18px;
  }

  .side {
    display: none;
  }

  body.communications-mode .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sub-nav-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .sub-nav-sidebar {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
  }

  .form-grid,
  .form-grid.inline {
    grid-template-columns: 1fr;
  }

  .setup-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .audit-page .card > .input + div {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .task-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Health Dashboard */
.health-dashboard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 24px var(--shadow);
  overflow: hidden;
}

.health-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.health-header-title {
  font-weight: 600;
  font-size: 14px;
}

.health-chevron {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
}

.health-badge-ok {
  background: #e6f6ec;
  color: #1a7a3a;
  border-color: #b7d7c4;
}

.health-badge-warn {
  background: #fff2f2;
  color: #8e1b1b;
  border-color: #e3b2b2;
}

.health-body {
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.health-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.health-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #f9f5f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.health-card.health-status-healthy {
  border-color: #b7d7c4;
}

.health-card.health-status-degraded {
  border-color: #e4c87a;
}

.health-card.health-status-down {
  border-color: #efb4b4;
  background: #fff5f5;
}

.health-card.health-status-unknown {
  border-color: var(--line);
}

.health-card.health-flash {
  animation: health-flash-anim 1s ease-in-out 3;
}

@keyframes health-flash-anim {
  0%, 100% { background: #fff5f5; }
  50% { background: #ffe0e0; }
}

.health-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.health-card-name {
  font-weight: 600;
  font-size: 13px;
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.health-dot.health-status-healthy {
  background: #22c55e;
}

.health-dot.health-status-degraded {
  background: #eab308;
}

.health-dot.health-status-down {
  background: #ef4444;
}

.health-dot.health-status-unknown {
  background: #9ca3af;
}

.health-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.health-card-status {
  text-transform: capitalize;
  font-weight: 500;
}

.health-card-time {
  color: var(--muted);
  font-size: 11px;
}

.health-card-footer {
  color: var(--muted);
}

.health-toast {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.health-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-manifest-page .lede code {
  background: #f2ece4;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

.agent-manifest-editor {
  min-height: 480px;
  font-family: var(--font-ibm-plex-sans), ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.agent-template-page .header {
  align-items: flex-start;
}

.agent-v2-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 14px;
  gap: 14px;
}

.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}

.agent-template-page .setup-output {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .agent-v2-grid {
    grid-template-columns: 1fr;
  }
}

.agent-registry-table {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
}

.agent-registry-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9f5f0;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-gap: 8px;
  gap: 8px;
  align-items: center;
  text-align: left;
  padding: 12px;
  cursor: pointer;
}

.agent-registry-row:hover {
  border-color: var(--accent);
  background: #fff7f1;
}

.agent-json-preview {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.35;
  max-height: 340px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.runtime-lane-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.runtime-lane {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9f5f0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.runtime-lane-title {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.runtime-actions {
  margin-top: 10px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .runtime-lane-grid {
    grid-template-columns: 1fr;
  }
}

.health-agent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.health-agent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9f5f0;
  font-size: 13px;
}

.health-agent-name {
  font-weight: 500;
}

.health-agent-status-idle {
  background: #e6f6ec;
  color: #1a7a3a;
  border-color: #b7d7c4;
}

.health-agent-status-busy {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.health-agent-status-error {
  background: #fff2f2;
  color: #8e1b1b;
  border-color: #e3b2b2;
}

.health-hb-ok {
  color: var(--muted);
}

.health-hb-warn {
  color: #b45309;
}

.health-hb-error {
  color: #8e1b1b;
}

.health-hb-unknown {
  color: var(--muted);
}

.health-queue {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 10px;
  gap: 10px;
}

.health-queue-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  background: #f9f5f0;
}

.health-queue-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.health-queue-value {
  display: block;
  font-size: 24px;
  font-weight: 600;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .health-queue {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .side {
    display: none;
  }

  .sidebar-toggle {
    display: none;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: visible;
    position: static;
    height: auto;
  }

  .main {
    padding: 24px;
  }

  .grid.metrics,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .workflow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bulk-group,
  .assignment-row {
    grid-template-columns: 1fr;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .task-row {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .team-node {
    width: 150px;
  }
}

@media (max-width: 480px) {
  .rail {
    padding: 8px 12px;
    gap: 8px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .rail .brand {
    display: none;
  }

  .rail-footer {
    display: none;
  }

  .nav-item {
    font-size: 12px;
    padding: 6px 8px;
    white-space: nowrap;
  }

  .main {
    padding: 12px;
  }

  .dashboard header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

@media (max-width: 1100px) {
  .task-hub-grid {
    grid-template-columns: 1fr;
  }

  .task-hub-filters {
    grid-template-columns: 1fr;
  }
}

/* Communication Center */
.comms-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comms-v2-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comms-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 12px;
  gap: 12px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px var(--shadow);
}

.comms-stats-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.comms-stats-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.comms-stats-value {
  font-size: 24px;
  font-weight: 600;
}

.comms-sub-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-alt);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.comms-sub-nav-item {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.comms-sub-nav-item:hover {
  background: var(--panel);
  color: var(--ink);
}

.comms-sub-nav-item.active {
  background: var(--panel);
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 2px 8px var(--shadow);
}

.comms-compose-bar {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px var(--shadow);
}

/* Chat bubbles */
.chat-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
  position: relative;
}

.chat-bubble-left {
  align-self: flex-start;
  background: #f9f5f0;
  border-bottom-left-radius: 4px;
}

.chat-bubble-right {
  align-self: flex-end;
  background: #e8f4f8;
  border-color: #b8d8e8;
  border-bottom-right-radius: 4px;
}

.chat-bubble-blocker {
  background: #fff2f2 !important;
  border-color: #efb4b4 !important;
}

.chat-bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.chat-bubble-sender {
  font-weight: 600;
  font-size: 12px;
}

.chat-bubble-time {
  font-size: 11px;
  color: var(--muted);
}

.chat-bubble-body {
  font-size: 13px;
  line-height: 1.5;
}

.chat-bubble-meta {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* System events (centered markers) */
.comms-system-event {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 0;
  font-size: 11px;
  color: var(--muted);
}

.comms-system-event-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comms-system-event-line::before,
.comms-system-event-line::after {
  content: "";
  flex: 1 1;
  height: 1px;
  background: var(--line);
  min-width: 40px;
}

/* Timeline view */
.timeline-event {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.timeline-dot-green {
  background: #22c55e;
  box-shadow: 0 0 0 1px #16a34a;
}

.timeline-dot-blue {
  background: #3b82f6;
  box-shadow: 0 0 0 1px #2563eb;
}

.timeline-dot-orange {
  background: #f59e0b;
  box-shadow: 0 0 0 1px #d97706;
}

.timeline-dot-red {
  background: #ef4444;
  box-shadow: 0 0 0 1px #dc2626;
}

.timeline-line {
  position: absolute;
  left: 5px;
  top: 20px;
  bottom: -8px;
  width: 2px;
  background: var(--line);
}

.timeline-content {
  flex: 1 1;
}

.timeline-header {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.timeline-body {
  font-size: 13px;
  margin-top: 4px;
}

/* View toggle */
.view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-alt);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.view-toggle-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
}

.view-toggle-btn.active {
  background: var(--panel);
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 4px var(--shadow);
}

/* Config sections */
.comms-config-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.comms-config-section:last-child {
  border-bottom: none;
}

.comms-config-section-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 12px;
}

.comms-config-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.comms-config-field label {
  font-size: 12px;
  color: var(--muted);
}

/* Thread cards */
.comms-thread-card {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9f5f0;
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}

.comms-thread-card:hover {
  border-color: var(--accent-2);
}

.comms-thread-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.comms-thread-card-title {
  font-weight: 500;
  font-size: 13px;
}

.comms-thread-card-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .comms-stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .comms-sub-nav {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .comms-sub-nav-item {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: calc(33.333% - 6px);
    min-width: 92px;
    text-align: center;
  }

  .chat-bubble {
    max-width: 90%;
  }
}

/* ============================================
   Task Hub - Jira-like components
   ============================================ */

/* Task Detail Drawer */
.task-detail-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 90;
}

.task-detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 32px var(--shadow);
  z-index: 91;
  display: flex;
  flex-direction: column;
  animation: task-drawer-slide-in 0.2s ease-out;
}

@keyframes task-drawer-slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.task-detail-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}

.task-detail-drawer-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
}

.task-detail-drawer-tab {
  padding: 6px 12px;
  border: none;
  background: transparent;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  white-space: nowrap;
  font-family: inherit;
}

.task-detail-drawer-tab:hover {
  background: var(--bg-alt);
  color: var(--ink);
}

.task-detail-drawer-tab.active {
  background: var(--bg-alt);
  color: var(--ink);
  font-weight: 500;
}

.task-detail-drawer-body {
  flex: 1 1;
  overflow-y: auto;
  padding: 18px;
}

/* Task Card */
.task-card {
  border: 1px solid #c5bdb3;
  border-radius: 10px;
  padding: 12px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(10, 10, 10, 0.12);
}

.task-card:hover {
  border-color: var(--accent-2);
  box-shadow: 0 4px 14px rgba(10, 10, 10, 0.16);
}

.task-card-selected {
  border-color: var(--accent);
  background: #fff7f1;
}

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.task-card-key {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.task-card-priority {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid;
  background: transparent;
}

.task-card-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--ink);
}

.task-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-card-assignee {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-2);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.task-card-points {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

/* Task Create Modal */
.task-create-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.task-create-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 101;
  padding: 24px;
}

.task-create-modal-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Board Column */
.task-hub-board-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
  max-width: 320px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.task-hub-board-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.task-hub-board-column-title {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.task-hub-board-column-count {
  font-size: 11px;
  color: var(--muted);
  background: var(--panel);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

/* Timeline Bar */
.task-hub-timeline-bar {
  display: flex;
  align-items: center;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-2);
  color: #fff;
  font-size: 11px;
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.task-hub-timeline-bar-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px 0 0 6px;
}

@media (max-width: 900px) {
  .task-detail-drawer {
    width: 100vw;
  }

  .task-hub-board-column {
    min-width: 220px;
  }
}

/* ============================================
   Kanban Board View
   ============================================ */

.board-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 400px;
  align-items: flex-start;
}

.board-column {
  display: flex;
  flex-direction: column;
  min-width: 280px;
  max-width: 320px;
  flex-shrink: 0;
  background: #e2dbd1;
  border: 1px solid #c9c0b5;
  border-radius: var(--radius);
  padding: 12px;
  transition: border-color 0.15s, background 0.15s;
  box-shadow: 0 1px 4px rgba(10, 10, 10, 0.06);
}

.board-column-over {
  border-color: var(--accent-2);
  background: #ddeef4;
}

.board-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 2px solid #b8afa4;
  margin-bottom: 8px;
}

.board-column-title {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink);
}

.board-column-count {
  font-size: 11px;
  color: var(--ink);
  background: var(--panel);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 600;
}

.board-column-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
  overflow-y: auto;
  min-height: 120px;
  max-height: 600px;
  flex: 1 1;
}

.board-card-wrapper {
  cursor: -webkit-grab;
  cursor: grab;
}

.board-card-wrapper:active {
  cursor: -webkit-grabbing;
  cursor: grabbing;
}

.board-card-wrapper.dragging {
  opacity: 0.5;
}

.board-add-card-btn {
  background: transparent;
  border: 1px dashed #c0b7ac;
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.board-add-card-btn:hover {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--accent-2);
}

.board-add-card-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.board-selector {
  display: flex;
  gap: 12px;
  align-items: center;
}

.board-selector .select {
  min-width: 200px;
}

.board-empty-state {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.board-empty-state .card {
  text-align: center;
  max-width: 400px;
  padding: 32px;
}

.board-empty-state .card-title {
  font-size: 18px;
  margin-bottom: 12px;
}

.board-empty-state .card-sub {
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .board-container {
    gap: 12px;
  }

  .board-column {
    min-width: 240px;
    max-width: 280px;
  }

  .board-selector {
    flex-wrap: wrap;
  }
}

/* ============================================
   Task Hub Search - JQL Editor & Saved Filters
   ============================================ */

/* Search page layout: sidebar + main content */
.search-page {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  grid-gap: 20px;
  gap: 20px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

/* Sidebar for saved filters */
.search-sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 24px var(--shadow);
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  position: -webkit-sticky;
  position: sticky;
  top: 20px;
  min-width: 0;
}

/* Main search area */
.search-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* JQL Editor wrapper */
.jql-editor-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jql-editor-container {
  position: relative;
}

/* JQL textarea */
.jql-editor {
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf8f4;
  color: var(--ink);
  font-family: var(--font-ibm-plex-sans), ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s;
}

.jql-editor::placeholder {
  color: var(--muted);
  font-style: italic;
}

.jql-editor:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(31, 79, 95, 0.1);
}

.jql-editor-valid {
  border-color: #22c55e;
}

.jql-editor-valid:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.jql-editor-invalid {
  border-color: #ef4444;
}

.jql-editor-invalid:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Validation message below editor */
.validation-message {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
}

.validation-message.valid {
  color: #16a34a;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.validation-message.invalid {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.validation-ok::before {
  content: "\2713 ";
}

.validation-error::before {
  content: "\2717 ";
}

.validation-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}

.validation-suggestion-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font-ibm-plex-sans), ui-monospace, monospace;
  color: var(--accent-2);
}

.validation-suggestion-btn:hover {
  background: var(--bg-alt);
  border-color: var(--accent-2);
}

/* Basic search fields grid */
.basic-search-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 12px;
  gap: 12px;
}

.basic-search-fields .full-width {
  grid-column: 1 / -1;
}

/* Mode toggle: Basic / Advanced */
.mode-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-alt);
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.mode-toggle-btn {
  padding: 6px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.mode-toggle-btn:hover {
  color: var(--ink);
}

.mode-toggle-btn.active {
  background: var(--panel);
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 4px var(--shadow);
}

/* Quick filter pills */
.quick-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-filter {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.quick-filter:hover {
  background: #f8efe6;
  color: var(--ink);
  border-color: var(--accent);
}

.quick-filter-active {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
}

.quick-filter-active:hover {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
  opacity: 0.9;
}

/* Search actions row */
.search-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* Search history dropdown */
.search-history {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px var(--shadow);
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.search-history-title {
  padding: 8px 12px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.search-history-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  background: transparent;
  border: none;
  font-family: var(--font-ibm-plex-sans), ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  border-bottom: 1px solid var(--bg-alt);
}

.search-history-item:hover {
  background: var(--bg-alt);
}

.search-history-item:last-child {
  border-bottom: none;
}

/* Saved filter list */
.saved-filter-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.saved-filter-title {
  font-weight: 600;
  font-size: 14px;
}

.saved-filter-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.saved-filter-form .input {
  font-size: 12px;
  padding: 8px 10px;
}

.saved-filter-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.saved-filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9f5f0;
  transition: border-color 0.15s, background 0.15s;
}

.saved-filter-item:hover {
  border-color: var(--accent-2);
  background: #f2ece4;
}

.saved-filter-item-main {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  min-width: 0;
}

.saved-filter-item-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-filter-item-desc {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-filter-item-jql {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-ibm-plex-sans), ui-monospace, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-filter-item-delete {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  margin-right: 6px;
  transition: color 0.15s, background 0.15s;
}

.saved-filter-item-delete:hover {
  color: #dc2626;
  background: #fef2f2;
}

/* Search results */
.search-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-results-loading {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-result-skeleton {
  height: 48px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

/* Search results table */
.search-results-table {
  width: 100%;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 12px var(--shadow);
}

.search-results-table thead {
  background: var(--bg-alt);
}

.search-results-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.search-results-table td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--bg-alt);
  vertical-align: middle;
}

.search-results-table tbody tr:last-child td {
  border-bottom: none;
}

.search-result-row {
  cursor: pointer;
  transition: background 0.15s;
}

.search-result-row:hover {
  background: #f8efe6;
}

.search-result-row:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: -2px;
}

.search-result-key {
  font-family: var(--font-ibm-plex-sans), ui-monospace, monospace;
  font-size: 12px;
  color: var(--accent-2);
  white-space: nowrap;
}

.search-result-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-title span:first-child {
  font-weight: 500;
}

.search-result-snippet {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.search-result-assignee {
  color: var(--muted);
}

.search-result-created {
  white-space: nowrap;
}

/* Search Mode Bar */
.search-mode-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.search-mode-pill {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.search-mode-pill:hover {
  background: var(--bg-alt);
  color: var(--ink);
}

.search-mode-pill.active {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
}

/* Text Search Input (non-JQL modes) */
.search-text-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--panel);
  color: var(--ink);
}

.search-text-input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(31, 79, 95, 0.12);
}

.search-text-input::placeholder {
  color: var(--muted);
}

/* Relevance Column */
.relevance-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.relevance-bar {
  width: 60px;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-alt);
  overflow: hidden;
}

.relevance-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.relevance-bar-fill.high {
  background: var(--accent-2);
}

.relevance-bar-fill.medium {
  background: #d4a017;
}

.relevance-bar-fill.low {
  background: var(--muted);
}

.relevance-pct {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-ibm-plex-sans), ui-monospace, monospace;
  min-width: 32px;
}

/* Score Breakdown */
.score-breakdown-row td {
  background: var(--bg-alt);
  padding: 6px 14px !important;
  border-bottom: 1px solid var(--line) !important;
}

.score-breakdown-toggle {
  font-size: 11px;
  color: var(--accent-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  font-family: inherit;
}

.score-breakdown-toggle:hover {
  text-decoration: underline;
}

.score-channel {
  display: inline-block;
  font-family: var(--font-ibm-plex-sans), ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
  margin-right: 12px;
}

/* Matched Fields */
.matched-field-pill {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  margin-right: 4px;
  margin-top: 2px;
}

.search-result-matched-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
}

/* Priority colors for result pills */
.priority-critical {
  color: #8e1b1b;
  border-color: #e3b2b2;
  background: #fff2f2;
}

.priority-high {
  color: #b45309;
  border-color: #e4c87a;
  background: #fffbeb;
}

.priority-medium {
  color: var(--accent-2);
  border-color: #93c5fd;
  background: #eff6ff;
}

.priority-low {
  color: var(--muted);
  border-color: var(--line);
  background: #f9f5f0;
}

/* Status pill variants for search results */
.status-done {
  color: #16a34a;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.status-active {
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #eff6ff;
}

/* Responsive: collapse sidebar on smaller screens */
@media (max-width: 900px) {
  .search-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .search-sidebar {
    position: static;
    max-height: none;
  }

  .basic-search-fields {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Gantt Timeline View
   ============================================ */

.timeline-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 0;
}

.timeline-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px var(--shadow);
}

.timeline-toolbar-section {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timeline-toolbar-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 2px;
}

.timeline-zoom-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.timeline-zoom-btn:hover {
  background: var(--bg-alt);
  color: var(--ink);
}

.timeline-zoom-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.timeline-zoom-active:hover {
  background: var(--ink);
  color: #fff;
}

.timeline-container {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 24px var(--shadow);
  overflow: hidden;
  min-height: 300px;
}

.timeline-labels {
  width: 250px;
  min-width: 250px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: #f6f2ec;
  overflow-y: auto;
  z-index: 2;
}

.timeline-label-header {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #f6f2ec;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 3;
}

.timeline-label-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 14px;
  border-bottom: 1px solid rgba(210, 203, 194, 0.3);
  overflow: hidden;
  gap: 1px;
}

.timeline-label-key {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-label-title {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: #eae3da;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.timeline-label-group:hover {
  background: #e3dbd0;
}

.timeline-label-group-toggle {
  font-size: 10px;
  color: var(--muted);
}

.timeline-label-group-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.timeline-canvas-wrapper {
  flex: 1 1;
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
}

.timeline-svg {
  display: block;
}

.timeline-bar {
  cursor: pointer;
}

.timeline-bar:hover rect:first-child {
  filter: brightness(1.1);
}

.timeline-today-line {
  pointer-events: none;
}

.timeline-dependency path {
  pointer-events: none;
}

.timeline-group-header {
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.timeline-group-header:hover {
  fill: var(--ink);
}

.timeline-tooltip rect {
  pointer-events: none;
}

.timeline-tooltip text {
  pointer-events: none;
}

@media (max-width: 900px) {
  .timeline-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .timeline-labels {
    width: 180px;
    min-width: 180px;
  }

  .timeline-container {
    min-height: 200px;
  }
}

/* ============================================
   Task Hub - Enhanced List View & Detail Drawer
   ============================================ */

/* Task Table */
.task-table-wrapper {
  overflow-x: auto;
  margin-bottom: 12px;
  min-width: 0;
  max-width: 100%;
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.task-table thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.task-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.task-table-wrapper.compact .task-table tbody td {
  padding: 4px 8px;
  font-size: 12px;
}

.task-table-wrapper.compact .task-table thead th {
  padding: 6px 8px;
}

.task-table-row {
  cursor: pointer;
  transition: background 0.12s;
}

.task-table-row:hover {
  background: #f9f5f0;
}

.task-table-row.selected {
  background: #fff7f1;
}

.task-table-check {
  width: 36px;
  text-align: center;
}

.task-table-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.task-table-key {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3px;
  font-family: var(--font-ibm-plex-sans), ui-monospace, monospace;
}

.task-table-title {
  font-weight: 500;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-table-empty {
  padding: 32px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Sortable Header */
.sortable-header {
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  transition: color 0.12s;
}

.sortable-header:hover {
  color: var(--ink);
}

/* Inline Edit Cell */
.inline-edit-cell {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: border-color 0.12s, background 0.12s;
  display: inline-block;
  min-width: 40px;
}

.inline-edit-cell:hover {
  border-color: var(--line);
  background: #f9f5f0;
}

.inline-edit-select,
.inline-edit-input {
  min-width: 100px;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 6px;
}

/* List Toolbar */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.list-toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Density Toggle */
.density-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-alt);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.density-toggle .btn.ghost.small.active,
.btn.ghost.small.active {
  background: var(--panel);
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 4px var(--shadow);
}

/* Column Visibility Toggle */
.column-toggle-wrapper {
  position: relative;
}

.column-toggle-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 8px 24px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.column-toggle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
}

.column-toggle-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

/* Export Button */
.export-btn {
  white-space: nowrap;
}

/* Bulk Action Bar */
.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: #eef4f7;
  border: 1px solid #b8d8e8;
  border-radius: 10px;
  flex-wrap: wrap;
}

/* Drawer Detail Content Styles */
.drawer-form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 10px;
  gap: 10px;
}

.drawer-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
}

.drawer-error {
  color: #8e1b1b;
}

.drawer-success {
  color: #1a7a3a;
}

/* Activity tab */
.drawer-activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-activity-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9f5f0;
}

.drawer-activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.drawer-activity-actor {
  font-weight: 600;
  font-size: 12px;
}

.drawer-activity-body {
  font-size: 13px;
  color: var(--ink);
}

.drawer-activity-action {
  font-weight: 500;
}

.drawer-activity-field strong {
  color: var(--accent-2);
}

.drawer-activity-change {
  color: var(--muted);
}

/* Comments tab */
.drawer-comment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.drawer-comment-item {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9f5f0;
}

.drawer-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.drawer-comment-author {
  font-weight: 600;
  font-size: 12px;
}

.drawer-comment-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

.drawer-comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

/* Worklogs tab */
.drawer-worklog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 16px;
}

.drawer-worklog-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--line);
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.drawer-worklog-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.drawer-worklog-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

/* Links tab */
.drawer-link-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9f5f0;
  font-size: 13px;
}

.drawer-link-type {
  font-weight: 500;
  color: var(--accent-2);
  white-space: nowrap;
}

.drawer-link-target {
  color: var(--muted);
  font-family: var(--font-ibm-plex-sans), ui-monospace, monospace;
  font-size: 12px;
}

/* Subtasks tab */
.drawer-subtask-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-subtask-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f9f5f0;
  cursor: pointer;
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  width: 100%;
  transition: border-color 0.12s;
}

.drawer-subtask-item:hover {
  border-color: var(--accent-2);
}

.drawer-subtask-key {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-ibm-plex-sans), ui-monospace, monospace;
  white-space: nowrap;
}

.drawer-subtask-title {
  flex: 1 1;
  font-weight: 500;
}

/* Wider drawer for enhanced detail */
.task-detail-drawer {
  width: 600px;
}

@media (max-width: 900px) {
  .drawer-form-grid {
    grid-template-columns: 1fr;
  }

  .task-table-title {
    max-width: 160px;
  }

  .task-detail-drawer {
    width: 100vw;
  }

  .list-toolbar {
    gap: 6px;
  }
}

/* ============================================
   Backlog & Sprint View
   ============================================ */

.backlog-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.backlog-section-title {
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 10px;
  margin-top: 4px;
}

.backlog-section {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px var(--shadow);
}

.backlog-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.backlog-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Sprint Section */
.sprint-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.sprint-section-active {
  border-color: #b7d7c4;
}

.sprint-section-planned {
  border-color: var(--line);
}

.sprint-section-completed {
  border-color: var(--line);
  opacity: 0.85;
}

/* Sprint Header */
.sprint-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #f6f2ec;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.sprint-collapse-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.sprint-header-info {
  flex: 1 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sprint-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sprint-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.sprint-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid;
}

.sprint-status-active {
  color: #1a7a3a;
  background: #e6f6ec;
  border-color: #b7d7c4;
}

.sprint-status-planned {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #93c5fd;
}

.sprint-status-completed {
  color: var(--muted);
  background: var(--bg-alt);
  border-color: var(--line);
}

.sprint-goal {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.sprint-dates {
  font-size: 11px;
  color: var(--muted);
}

.sprint-header-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.sprint-points-total {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.sprint-task-count {
  font-size: 11px;
  color: var(--muted);
}

/* Sprint Progress Bar */
.sprint-progress-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  flex-shrink: 0;
}

.sprint-progress-bar {
  flex: 1 1;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.sprint-progress-bar-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.sprint-progress-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  min-width: 32px;
  text-align: right;
}

.sprint-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Sprint Task List */
.sprint-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
}

.sprint-empty-message {
  padding: 16px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Sprint Dialog Content */
.sprint-dialog-content {
  max-width: 520px;
}

.sprint-duration-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .sprint-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .sprint-header-stats {
    align-items: flex-start;
  }

  .sprint-progress-bar-wrapper {
    width: 100%;
  }

  .sprint-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  max-width: 380px;
}
.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink);
  box-shadow: 0 4px 16px var(--shadow);
  animation: toast-in 0.25s ease-out;
}
.toast-info { background: var(--panel); border-left: 4px solid var(--accent-2); }
.toast-success { background: var(--panel); border-left: 4px solid #22c55e; }
.toast-warning { background: var(--panel); border-left: 4px solid #eab308; }
.toast-error { background: var(--panel); border-left: 4px solid #ef4444; }
.toast-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Shortcut Help Overlay --- */
.shortcut-overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shortcut-overlay {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}
.shortcut-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.shortcut-overlay-header h3 { margin: 0; font-size: 18px; }
.shortcut-list { display: flex; flex-direction: column; gap: 8px; }
.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg-alt);
}
.shortcut-row:last-child { border-bottom: none; }
.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-ibm-plex-sans), ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 1px 2px var(--shadow);
}
.shortcut-desc { font-size: 13px; color: var(--muted); }
.shortcut-category-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.shortcut-category-title:first-child { margin-top: 0; }

/* --- Loading Skeletons --- */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--line);
  animation: skeleton-pulse 1.2s ease-in-out infinite;
  margin-bottom: 8px;
}
.skeleton-line-short { width: 40%; }
.skeleton-line-medium { width: 70%; }
.skeleton-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-gap: 12px; gap: 12px; }
.skeleton-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.skeleton-cell {
  height: 14px;
  border-radius: 6px;
  background: var(--line);
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}
.skeleton-cell-sm { width: 60px; }
.skeleton-cell-md { width: 120px; }
.skeleton-cell-lg { flex: 1 1; }
.skeleton-table { display: flex; flex-direction: column; }
.skeleton-chart {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.skeleton-chart-area {
  height: 200px;
  border-radius: 8px;
  background: var(--line);
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}
.skeleton-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
}
.skeleton-board-column {
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 14px;
}

/* --- Reports Charts --- */
.chart-svg { font-family: inherit; }
.chart-title { fill: var(--ink); font-size: 14px; font-weight: 600; }
.chart-label { fill: var(--muted); font-size: 11px; }
.chart-donut-total { fill: var(--ink); font-size: 22px; font-weight: 700; }
.reports-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; max-width: 100%; min-width: 0; }
.reports-tab { flex: 0 0 auto; padding: 8px 16px; background: none; border: none; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; font-size: 14px; font-family: inherit; }
.reports-tab:hover { color: var(--ink); }
.reports-tab.active { color: var(--accent-2); border-bottom-color: var(--accent-2); }
.reports-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-gap: 16px; gap: 16px; min-width: 0; }
.reports-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; max-width: 100%; }
.reports-controls { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.reports-controls select { background: var(--bg-alt); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; }
@media (max-width: 800px) { .reports-grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Jira-like Visual System ─────────────────────────────────── */

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-badge.status-backlog { background: #dfe1e6; color: #42526e; }
.status-badge.status-planned { background: #deebff; color: #0747a6; }
.status-badge.status-in_progress { background: #0052cc; color: #fff; }
.status-badge.status-ci { background: #e3fcef; color: #006644; }
.status-badge.status-qa { background: #fff0b3; color: #172b4d; }
.status-badge.status-review { background: #eae6ff; color: #403294; }
.status-badge.status-devops { background: #c1e0ff; color: #0747a6; }
.status-badge.status-release { background: #e3fcef; color: #006644; }
.status-badge.status-done { background: #00875a; color: #fff; }
.status-badge.status-blocked { background: #ffebe6; color: #bf2600; }
.status-badge.status-rollback { background: #ff8b00; color: #fff; }

/* Priority icons */
.priority-icon { font-size: 14px; font-weight: 700; }
.priority-icon.priority-critical { color: #bf2600; }
.priority-icon.priority-highest { color: #de350b; }
.priority-icon.priority-high { color: #ff8b00; }
.priority-icon.priority-medium { color: #ffab00; }
.priority-icon.priority-low { color: #0065ff; }
.priority-icon.priority-lowest { color: #6b778c; }

/* Issue type icons */
.issue-type-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
}
.issue-type-icon .type-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}
.issue-type-icon.type-bug .type-dot { background: #de350b; border-radius: 50%; }
.issue-type-icon.type-story .type-dot { background: #36b37e; }
.issue-type-icon.type-task .type-dot { background: #0065ff; }
.issue-type-icon.type-epic .type-dot { background: #6554c0; }
.issue-type-icon.type-incident .type-dot { background: #de350b; -webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%); clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }
.issue-type-icon.type-subtask .type-dot { background: #0065ff; width: 10px; height: 10px; }

/* Agent avatar chips */
.agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #ebecf0;
  color: #172b4d;
}
.agent-chip .agent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.agent-chip .agent-dot.dot-active { background: #00875a; }
.agent-chip .agent-dot.dot-idle { background: #6b778c; }
.agent-chip .agent-dot.dot-inactive { background: #de350b; }
.agent-chip-unassigned {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  color: #6b778c;
  background: transparent;
  border: 1px dashed #c1c7d0;
}

/* Due date styling */
.due-date-overdue { color: #bf2600; font-weight: 600; }
.due-date-soon { color: #ff8b00; font-weight: 500; }
.due-date-normal { color: var(--muted); }

/* Quick filter bar */
.quick-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.quick-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  background: #f4f5f7;
  color: #42526e;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.quick-filter-pill:hover { background: #ebecf0; }
.quick-filter-pill.active {
  background: #deebff;
  color: #0052cc;
  border-color: #4c9aff;
}
.quick-filter-pill .filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #dfe1e6;
  font-size: 10px;
  font-weight: 700;
  color: #42526e;
}
.quick-filter-pill.active .filter-count {
  background: #4c9aff;
  color: #fff;
}

/* Agent filter chips (reuses quick-filter-pill) */
.agent-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.agent-filter-chip .agent-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.agent-filter-chip .agent-status-dot.dot-active { background: #00875a; }
.agent-filter-chip .agent-status-dot.dot-idle { background: #6b778c; }
.agent-filter-chip .agent-status-dot.dot-inactive { background: #de350b; }

/* Task table row hover enhancement */
.task-table-row:hover { background: #ebecf0; }
.task-table-row.selected { background: #deebff; }

/* Story points badge */
.story-points-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ebecf0;
  font-size: 11px;
  font-weight: 700;
  color: #42526e;
}

/* Heartbeat indicator */
.heartbeat-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.heartbeat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.heartbeat-dot-md {
  width: 10px;
  height: 10px;
}
.heartbeat-dot-ok { background: #22c55e; }
.heartbeat-dot-warn { background: #eab308; }
.heartbeat-dot-error { background: #ef4444; }
.heartbeat-dot-unknown { background: #6b7280; }
.heartbeat-label {
  font-size: 0.7rem;
  color: var(--muted);
}

/* Agent status bar */
.agent-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

/* ============================================
   Task Hub List Visual Polish (1A-1H)
   ============================================ */

/* 1A: Issue Type SVG icon */
.issue-type-svg {
  display: inline-flex;
  vertical-align: middle;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* 1B: Avatar Chip */
.avatar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.avatar-initials {
  color: #fff;
  font-weight: 600;
  line-height: 1;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.avatar-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  border-radius: 50%;
  border: 1.5px solid #fff;
}

/* 1C: Priority SVG icon */
.priority-svg {
  display: inline-flex;
  vertical-align: middle;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

/* 1D: Label Chips */
.label-chip {
  display: inline-block;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink);
  cursor: default;
  line-height: 1.3;
}

.label-chip-overflow {
  background: var(--bg-alt) !important;
  color: var(--muted);
  font-style: italic;
}

/* 1E: Progress bar mini (under title) */
.progress-bar-mini {
  width: 100%;
  margin-top: 4px;
}

.progress-bar-track {
  width: 100%;
  height: 3px;
  background: #e9e4dc;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #36b37e;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* 1F: Row left border by issue type */
.task-table-row.type-bug {
  border-left: 3px solid #e5391a;
}
.task-table-row.type-story {
  border-left: 3px solid #36b37e;
}
.task-table-row.type-task {
  border-left: 3px solid #4c9aff;
}
.task-table-row.type-epic {
  border-left: 3px solid #904ee2;
}
.task-table-row.type-incident {
  border-left: 3px solid #ff5630;
}
.task-table-row.type-subtask {
  border-left: 3px solid #79b8ff;
}

/* 1G: Better hover, selection, and focus states */
.task-table-row:hover {
  box-shadow: 0 2px 8px var(--shadow);
  background: #faf8f5;
}
.task-table-row:hover.type-bug { border-left-width: 4px; }
.task-table-row:hover.type-story { border-left-width: 4px; }
.task-table-row:hover.type-task { border-left-width: 4px; }
.task-table-row:hover.type-epic { border-left-width: 4px; }
.task-table-row:hover.type-incident { border-left-width: 4px; }
.task-table-row:hover.type-subtask { border-left-width: 4px; }

.task-table-row.selected {
  background: #f0f4ff;
}
.task-table-row.selected.type-bug,
.task-table-row.selected.type-story,
.task-table-row.selected.type-task,
.task-table-row.selected.type-epic,
.task-table-row.selected.type-incident,
.task-table-row.selected.type-subtask {
  border-left-width: 4px;
}

.task-row-focused {
  background: #f0f4ff !important;
  outline: 2px dotted var(--accent-2);
  outline-offset: -2px;
}

/* 1H: Relative timestamps */
.relative-time {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  cursor: default;
}

/* ============================================
   Detail Drawer - Split Layout (Jira-like)
   ============================================ */

/* 1. Drawer width override: 720px, max-width 90vw */
.task-detail-drawer {
  width: 720px;
  max-width: 90vw;
}

/* 2. Split grid: left 60% / right 40% */
.drawer-split {
  display: grid;
  grid-template-columns: 60% 40%;
  flex: 1 1;
  overflow: hidden;
}

/* 3. Left side: scrollable content */
.drawer-content {
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 4. Right side: metadata sidebar */
.drawer-sidebar {
  border-left: 1px solid var(--line);
  background: #faf8f4;
  overflow-y: auto;
  padding: 0;
}

/* 5. Metadata section: padding + bottom border divider */
.drawer-metadata-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

/* 6. Section title: uppercase, small, muted */
.drawer-metadata-section-title {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 600;
}

/* 7. Metadata field: flex row, label + value */
.drawer-metadata-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.drawer-metadata-field:last-child {
  margin-bottom: 0;
}

/* 8. Metadata label: fixed width, small, muted text */
.drawer-metadata-label {
  width: 80px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
}

/* 9. Metadata value: flex 1 */
.drawer-metadata-value {
  flex: 1 1;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.drawer-metadata-value .select,
.drawer-metadata-value .input {
  width: 100%;
}

.drawer-labels-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* 10. Workflow bar: horizontal flex, overflow-x auto */
.workflow-bar {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 6px 0;
}

.workflow-step-wrapper {
  display: flex;
  align-items: center;
}

/* 11. Workflow step: flex column, centered, clickable */
.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 6px;
  font-family: inherit;
}

.workflow-step:disabled {
  cursor: default;
}

/* 12. Workflow step circle: 12px circle with border */
.workflow-step-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}

/* 13. Active step circle: filled accent */
.workflow-step.active .workflow-step-circle {
  background: var(--accent);
  border-color: var(--accent);
}

/* 14. Past step circle: lighter fill */
.workflow-step.past .workflow-step-circle {
  background: var(--accent-2);
  border-color: var(--accent-2);
  opacity: 0.5;
}

/* 15. Future step circle: empty with border only */
.workflow-step.future .workflow-step-circle {
  background: transparent;
  border-color: var(--line);
}

/* 16. Connector line between steps */
.workflow-connector {
  display: inline-block;
  width: 12px;
  height: 2px;
  background: var(--line);
  flex-shrink: 0;
}

/* 17. Step label: tiny text below circle */
.workflow-step-label {
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  text-transform: capitalize;
}

.workflow-step.active .workflow-step-label {
  color: var(--accent);
  font-weight: 600;
}

.workflow-step.past .workflow-step-label {
  color: var(--accent-2);
}

/* 18. Drawer header title row: flex for icon + key + title + close */
.drawer-header-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* 19. Drawer header key: monospace, accent-2 color, link style */
.drawer-header-key {
  font-family: var(--font-ibm-plex-sans), ui-monospace, monospace;
  font-size: 13px;
  color: var(--accent-2);
  cursor: pointer;
  white-space: nowrap;
}

.drawer-header-key:hover {
  text-decoration: underline;
}

/* 20. Drawer header title: click-to-edit, larger font */

/* 21. Progress bar in metadata sidebar */
.drawer-progress-bar {
  flex: 1 1;
  height: 6px;
  background: var(--bg-alt);
  border-radius: 3px;
  overflow: hidden;
}

.drawer-progress-fill {
  height: 100%;
  background: var(--accent-2);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Description section — Jira-like click-to-edit */
.drawer-description-section {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.drawer-description-display {
  min-height: 60px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.drawer-description-display:hover {
  background: #f5f2ed;
  border-color: var(--line);
}

.drawer-description-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.drawer-description-placeholder {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
}

.drawer-description-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-description-editor .textarea {
  font-size: 14px;
  line-height: 1.6;
  min-height: 120px;
  resize: vertical;
}

.drawer-description-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Title inline editing */
.drawer-title-input {
  flex: 1 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--accent-2);
  border-radius: 4px;
  padding: 4px 8px;
  outline: none;
  font-family: inherit;
  min-width: 0;
}

.drawer-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 6px;
  transition: background 0.12s;
}

.drawer-header-title:hover {
  background: #f5f2ed;
}

.drawer-tab-content {
  flex: 1 1;
}

/* Enhanced header: stacked rows */
.task-detail-drawer-header {
  flex-direction: column;
  align-items: stretch;
  padding: 12px 18px;
  gap: 8px;
}

/* Input small variant for sidebar */
.input.small {
  padding: 6px 10px;
  font-size: 12px;
}

/* Responsive: stack drawer-split on narrow screens */
@media (max-width: 900px) {
  .task-detail-drawer {
    width: 100vw;
  }

  .drawer-split {
    grid-template-columns: 1fr;
  }

  .drawer-sidebar {
    border-left: none;
    border-top: 1px solid var(--line);
  }
}

/* Agent Gallery */
.agent-tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-alt);
  padding: 4px;
  border-radius: 12px;
  width: -moz-fit-content;
  width: fit-content;
}

.agent-tab-bar button {
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
}

.agent-tab-bar button.active {
  background: var(--panel);
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 2px 8px var(--shadow);
}

.template-card {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px var(--shadow);
}

.template-card .emoji {
  font-size: 32px;
  margin-bottom: 8px;
}

.agent-card .emoji {
  font-size: 28px;
}

.agent-live-banner {
  padding: 12px 16px;
  border-radius: 10px;
  background: #e6f6ec;
  border: 1px solid #b7d7c4;
  color: #1a7a3a;
  font-size: 13px;
  font-weight: 500;
}

.agent-manifests-progress {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px var(--shadow);
}

.agent-manifests-progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 13px;
}

.agent-manifests-progress__track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-alt);
  overflow: hidden;
}

.agent-manifests-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay > .card {
  max-width: 480px;
  width: 90%;
}

/* --- Provision Progress Stepper --- */

.provision-progress {
  margin: 8px 0;
}

.provision-bar-track {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-alt);
  overflow: hidden;
  margin-bottom: 16px;
}

.provision-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent-2);
  transition: width 0.4s ease;
}

.provision-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.provision-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.provision-step.done {
  color: var(--ink);
}

.provision-step.running {
  color: var(--accent-2);
  font-weight: 500;
}

.provision-step.failed {
  color: #c0392b;
}

.provision-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.provision-icon.done {
  background: #27ae60;
  color: #fff;
}

.provision-icon.failed {
  background: #c0392b;
  color: #fff;
}

.provision-icon.skipped {
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 14px;
}

.provision-icon.pending {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  background: transparent;
}

.provision-icon.running {
  width: 22px;
  height: 22px;
  border: 2px solid var(--accent-2);
  border-top-color: transparent;
  background: transparent;
  animation: provision-spin 0.8s linear infinite;
}

@keyframes provision-spin {
  to { transform: rotate(360deg); }
}

.provision-label {
  flex: 1 1;
}

.provision-error {
  font-size: 11px;
  color: #c0392b;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Agent Detail Page --- */

.agent-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.agent-detail-back {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.view-toggle button {
  padding: 6px 16px;
  font-size: 13px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.view-toggle button.active {
  background: var(--accent-2);
  color: #fff;
}

.identity-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 10px 24px var(--shadow);
}

.identity-card .identity-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.identity-card .identity-name {
  font-size: 20px;
  font-weight: 600;
}

.identity-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-gap: 12px;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.detail-field {
  font-size: 13px;
}

.detail-field .detail-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.skill-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 4px 12px var(--shadow);
}

.skill-bar {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0;
}

.skill-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.skill-bar-fill.proficiency {
  background: var(--accent);
}

.skill-bar-fill.confidence {
  background: var(--accent-2);
}

.work-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.work-tab-bar button {
  padding: 8px 16px;
  font-size: 13px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.work-tab-bar button.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 500;
}

.eval-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg-alt);
  font-size: 13px;
}

.kpi-metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: 0 4px 12px var(--shadow);
  text-align: center;
}

.kpi-metric .kpi-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--accent);
}

.kpi-metric .kpi-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.evidence-list {
  margin-top: 8px;
  padding: 8px;
  background: var(--bg-alt);
  border-radius: 8px;
  font-size: 12px;
}

.evidence-list .evidence-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

.evidence-list .evidence-item:last-child {
  border-bottom: none;
}

/* ── Task Picker Modal ── */

.task-picker-modal-content {
  max-width: 640px;
  width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.task-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-picker-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.task-picker-search-wrap {
  flex: 1 1 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-picker-search-hint {
  font-size: 11px;
  color: var(--muted);
}

.task-picker-filters .select {
  flex: 0 1 130px;
  min-width: 100px;
}

.task-picker-list {
  overflow-y: auto;
  max-height: 400px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.task-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
}

.task-picker-row:last-child {
  border-bottom: none;
}

.task-picker-row:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}

.task-picker-row:hover {
  background: var(--bg-alt);
}

.task-picker-row.selected {
  background: #fff7f1;
  border-left-color: var(--accent);
}

.task-picker-row.selected:hover {
  background: #ffede0;
}

.task-picker-row input[type="checkbox"] {
  flex-shrink: 0;
  accent-color: var(--accent);
}

.task-picker-row-key {
  font-family: monospace;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 64px;
}

.task-picker-row-title {
  font-size: 13px;
  font-weight: 500;
  flex: 1 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-picker-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.task-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.task-picker-selected-count {
  font-size: 13px;
  color: var(--muted);
}

.task-picker-empty {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
}

/* ── Board Column Add-Existing Button ── */

.board-column-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.board-column-add-existing-btn {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s;
}

.board-column-add-existing-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Task Picker JQL Search ── */

.task-picker-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-picker-search-row .input {
  flex: 1 1;
}

.task-picker-jql-toggle {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.task-picker-jql-toggle:hover {
  background: var(--bg-alt);
  color: var(--ink);
}

.task-picker-jql-toggle.active {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
}

.task-picker-jql-input {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.task-picker-jql-input.jql-valid {
  border-color: #3a9a5c;
}

.task-picker-jql-input.jql-invalid {
  border-color: #b00020;
}

.task-picker-jql-error {
  font-size: 11px;
  color: #b00020;
  margin-top: 2px;
}

.task-picker-jql-ok {
  font-size: 11px;
  color: #3a9a5c;
  margin-top: 2px;
}

/* --- Live indicator --- */
.live-dot {
  font-size: 9px;
  color: #22c55e;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-left: 6px;
}

/* --- Comms toolbar + pagination --- */
.comms-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.comms-toolbar .input {
  flex: 1 1 200px;
  min-width: 140px;
}

.comms-toolbar .select {
  flex: 0 1 130px;
}

.comms-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0;
}

.comms-pagination .btn {
  min-width: 70px;
}

.comms-page-info {
  font-size: 12px;
  color: var(--muted);
}

/* --- Agent File Browser + Editor --- */
.agent-files-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-gap: 0;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-height: 400px;
}

.agent-structure-layout {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-height: 260px;
}

.agent-file-tree {
  background: var(--bg-alt);
  padding: 12px;
  overflow-y: auto;
  max-height: 600px;
  border-right: 1px solid var(--line);
}

.file-tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
  transition: background 0.1s;
}

.file-tree-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.file-tree-item.selected {
  background: #fff7f1;
  color: var(--accent);
  font-weight: 500;
}

.file-tree-item.directory {
  font-weight: 600;
}

.file-tree-size {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.agent-file-editor-pane {
  display: flex;
  flex-direction: column;
}

.file-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.file-editor-path {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  flex: 1 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-editor-dirty {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

/* Plugin ZIP dropzone */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover {
  border-color: var(--accent-2);
  background: rgba(31, 79, 95, 0.04);
}

.dropzone.active {
  border-color: var(--accent-2);
  background: rgba(31, 79, 95, 0.08);
}

.dropzone-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.upload-progress {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.upload-progress-bar {
  height: 100%;
  background: var(--accent-2);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Meeting provider cards */
.provider-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.provider-card.active {
  border-color: var(--accent-2);
  box-shadow: 0 4px 12px rgba(31, 79, 95, 0.1);
}

.provider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.provider-name {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.provider-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.provider-status-dot.active {
  background: #2e7d32;
}

.provider-status-dot.inactive {
  background: #9e9e9e;
}

.provider-status-dot.error {
  background: #b00020;
}

/* ACC section */
.acc-traffic-light {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ccc;
  transition: background 0.3s;
}

.acc-traffic-light--green {
  background: #2e7d32;
}

.acc-traffic-light--yellow {
  background: #e6a817;
}

.acc-traffic-light--red {
  background: #b00020;
}

.acc-traffic-light--pulse {
  animation: acc-pulse 1.2s ease-in-out infinite;
}

@keyframes acc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.acc-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 12px;
  gap: 12px;
}

@media (max-width: 900px) {
  .acc-metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.acc-metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 4px 12px var(--shadow);
}

.acc-budget-bar {
  height: 6px;
  border-radius: 3px;
  background: #e5e0d8;
  overflow: hidden;
}

.acc-budget-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: #2e7d32;
  transition: width 0.3s;
}

.acc-budget-bar-fill.yellow {
  background: #e6a817;
}

.acc-budget-bar-fill.red {
  background: #b00020;
}

.acc-decision-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--line);
}

.acc-decision-badge--allow {
  color: #2e7d32;
  background: #e8f5e9;
}

.acc-decision-badge--deny {
  color: #b00020;
  background: #fff5f5;
}

.acc-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}

.acc-tab-button {
  padding: 8px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.acc-tab-button:hover {
  color: var(--ink);
}

.acc-tab-button.active {
  color: var(--ink);
  font-weight: 500;
  border-bottom-color: var(--ink);
}

.acc-timeline-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.acc-timeline-segment {
  height: 100%;
  transition: width 0.3s;
}

.acc-approval-action {
  display: flex;
  gap: 8px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.page-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 16px;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-gap: 16px;
  gap: 16px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.model-warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #6d4c00;
  font-size: 13px;
}

.model-warning-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.model-warning-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.model-warning-text strong {
  font-size: 13px;
  font-weight: 600;
}

.model-warning-text span {
  font-size: 12px;
  color: #8d6e00;
}

/* ============================================================
   CEO OVERVIEW DASHBOARD
   ============================================================ */

/* Main container */
.ceo-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Dashboard header with persona bar */
.ceo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
}

.ceo-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ceo-header-title {
  font-family: var(--font-cormorant-garamond), serif;
  font-size: 32px;
  font-weight: 600;
  margin: 0;
}

.ceo-header-sub {
  color: var(--muted);
  font-size: 13px;
}

.ceo-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Persona bar - horizontal pills */
.ceo-persona-bar {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--bg-alt);
  border-radius: 12px;
  border: 1px solid var(--line);
}

.ceo-persona-pill {
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.ceo-persona-pill:hover {
  color: var(--ink);
  background: var(--panel);
}

.ceo-persona-pill.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 2px 8px var(--shadow);
}

/* Widget grid */
.ceo-widget-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-gap: 16px;
  gap: 16px;
}

.ceo-widget-sm { grid-column: span 4; }
.ceo-widget-md { grid-column: span 4; }
.ceo-widget-lg { grid-column: span 8; }
.ceo-widget-full { grid-column: span 12; }

@media (max-width: 1200px) {
  .ceo-widget-grid {
    grid-template-columns: repeat(8, 1fr);
  }
  .ceo-widget-sm { grid-column: span 4; }
  .ceo-widget-md { grid-column: span 4; }
  .ceo-widget-lg { grid-column: span 8; }
  .ceo-widget-full { grid-column: span 8; }
}

@media (max-width: 768px) {
  .ceo-widget-grid {
    grid-template-columns: 1fr;
  }
  .ceo-widget-sm,
  .ceo-widget-md,
  .ceo-widget-lg,
  .ceo-widget-full {
    grid-column: span 1;
  }
  .ceo-header {
    flex-direction: column;
    align-items: stretch;
  }
  .ceo-header-actions {
    flex-wrap: wrap;
  }
  .ceo-persona-bar {
    flex-wrap: wrap;
  }
  .ceo-sidebar-panel {
    width: 85vw;
  }
  .ceo-catalog-drawer {
    width: 85vw;
  }
}

/* Widget shell */
.ceo-widget-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ceo-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.ceo-widget-title {
  font-weight: 600;
  font-size: 14px;
}

.ceo-widget-actions {
  display: flex;
  gap: 6px;
}

.ceo-widget-body {
  padding: 16px 18px;
  flex: 1 1;
  min-height: 0;
}

/* KPI row */
.ceo-kpi-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ceo-kpi-card {
  flex: 1 1;
  min-width: 120px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.ceo-kpi-card.green {
  background: #f1fbf4;
  border-color: #c2e8cf;
}

.ceo-kpi-card.yellow {
  background: #fdf7e8;
  border-color: #e8d9a8;
}

.ceo-kpi-card.red {
  background: #fff5f5;
  border-color: #f0c4c4;
}

/* BEM-style variants (used by KpiSummary widget) */
.ceo-kpi-card--green {
  background: #f1fbf4;
  border-color: #c2e8cf;
}

.ceo-kpi-card--yellow {
  background: #fdf7e8;
  border-color: #e8d9a8;
}

.ceo-kpi-card--red {
  background: #fff5f5;
  border-color: #f0c4c4;
}

/* BEM-style exception severity variants (used by ExceptionAlerts widget) */
.ceo-exception-item { }
.ceo-exception-item--high {
  border-left: 3px solid #b00020;
}

.ceo-exception-item--medium {
  border-left: 3px solid #c9952a;
}

.ceo-exception-item--low {
  border-left: 3px solid var(--line);
}

.ceo-kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}

.ceo-kpi-value {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
}

.ceo-kpi-detail {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Status dot */
.ceo-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.ceo-status-dot.green { background: #4a9d6e; }
.ceo-status-dot.yellow { background: #c9952a; }
.ceo-status-dot.red { background: #b00020; }
.ceo-status-dot.gray { background: #999; }

/* Exception rows */
.ceo-exception-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ceo-exception-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.ceo-exception-row.high {
  border-left: 3px solid #b00020;
}

.ceo-exception-row.medium {
  border-left: 3px solid #c9952a;
}

.ceo-exception-row.low {
  border-left: 3px solid var(--line);
}

.ceo-exception-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-size: 14px;
}

.ceo-exception-content {
  flex: 1 1;
}

.ceo-exception-title {
  font-weight: 500;
}

.ceo-exception-detail {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.ceo-exception-action {
  flex-shrink: 0;
}

/* Agent grid table */
.ceo-agent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ceo-agent-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.ceo-agent-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.ceo-agent-table tr:last-child td {
  border-bottom: none;
}

/* Meeting list */
.ceo-meeting-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ceo-meeting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.ceo-meeting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ceo-meeting-title {
  font-weight: 500;
}

.ceo-meeting-meta {
  font-size: 12px;
  color: var(--muted);
}

/* Approval queue */
.ceo-approval-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ceo-approval-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.ceo-approval-info {
  flex: 1 1;
}

.ceo-approval-actions {
  display: flex;
  gap: 6px;
}

/* Health grid */
.ceo-health-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-gap: 8px;
  gap: 8px;
}

@media (max-width: 1200px) {
  .ceo-health-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .ceo-health-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ceo-health-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.ceo-health-name {
  font-weight: 500;
  flex: 1 1;
}

.ceo-health-time {
  font-size: 11px;
  color: var(--muted);
}

/* Progress bars */
.ceo-progress-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ceo-progress-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ceo-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.ceo-progress-label {
  font-weight: 500;
}

.ceo-progress-pct {
  color: var(--muted);
}

.ceo-progress-track {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 4px;
  overflow: hidden;
}

.ceo-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent-2);
  transition: width 0.3s;
}

/* Quick action buttons */
.ceo-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 8px;
  gap: 8px;
}

.ceo-quick-action {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s;
  color: var(--ink);
  text-decoration: none;
  display: block;
}

.ceo-quick-action:hover {
  background: var(--bg-alt);
  border-color: var(--accent-2);
}

/* Catalog drawer */
.ceo-catalog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 100;
  animation: ceo-fade-in 0.15s;
}

.ceo-catalog-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  z-index: 101;
  display: flex;
  flex-direction: column;
  animation: ceo-slide-in-right 0.2s;
  box-shadow: -4px 0 24px var(--shadow);
}

.ceo-catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.ceo-catalog-title {
  font-weight: 600;
  font-size: 16px;
}

.ceo-catalog-body {
  flex: 1 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.ceo-catalog-close {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  font-family: inherit;
}

.ceo-catalog-close:hover {
  color: var(--ink);
}

.ceo-catalog-category,
.ceo-catalog-group {
  margin-bottom: 20px;
}

.ceo-catalog-category-title,
.ceo-catalog-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

.ceo-catalog-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.ceo-catalog-item:last-child {
  border-bottom: none;
}

.ceo-catalog-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ceo-catalog-item-label,
.ceo-catalog-item-name {
  font-weight: 500;
  font-size: 14px;
}

.ceo-catalog-item-desc {
  font-size: 12px;
  color: var(--muted);
}

.ceo-catalog-toggle {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-2);
}

/* Toggle switch */
.ceo-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--line);
  border-radius: 11px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}

.ceo-toggle.on {
  background: var(--accent-2);
}

.ceo-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.ceo-toggle.on::after {
  transform: translateX(18px);
}

/* Onboarding modal */
.ceo-onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ceo-fade-in 0.2s;
}

.ceo-onboarding-modal {
  background: var(--panel);
  border-radius: 20px;
  padding: 40px;
  max-width: 680px;
  width: 90%;
  box-shadow: 0 24px 48px rgba(0,0,0,0.15);
  animation: ceo-scale-in 0.2s;
}

.ceo-onboarding-title {
  font-family: var(--font-cormorant-garamond), serif;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
}

.ceo-onboarding-sub,
.ceo-onboarding-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.ceo-persona-cards,
.ceo-onboarding-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 12px;
  gap: 12px;
  margin-bottom: 28px;
}

@media (max-width: 600px) {
  .ceo-persona-cards {
    grid-template-columns: 1fr;
  }
}

.ceo-persona-card,
.ceo-onboarding-card {
  padding: 20px 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  background: none;
  font-family: inherit;
}

.ceo-persona-card:hover,
.ceo-onboarding-card:hover {
  border-color: var(--accent-2);
  background: #f8f6f3;
}

.ceo-persona-card.selected,
.ceo-onboarding-card.selected {
  border-color: var(--accent-2);
  background: #edf5f7;
}

.ceo-persona-card-name,
.ceo-onboarding-card-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 6px;
}

.ceo-persona-card-desc,
.ceo-onboarding-card-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.ceo-persona-card-widgets,
.ceo-onboarding-card-widgets {
  font-size: 12px;
  color: var(--muted);
  list-style: none;
  padding: 0;
  margin: 0;
}

.ceo-onboarding-card-icon {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.ceo-onboarding-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ceo-onboarding-skip {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.ceo-onboarding-skip:hover {
  color: var(--ink);
}

/* Collapsible sidebar */
.ceo-sidebar-trigger {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  color: var(--muted);
  transition: all 0.15s;
}

.ceo-sidebar-trigger:hover {
  color: var(--ink);
  border-color: var(--accent-2);
}

.ceo-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 100;
  animation: ceo-fade-in 0.15s;
}

.ceo-sidebar-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  background: #f6f1ea;
  border-left: 1px solid var(--line);
  z-index: 101;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: ceo-slide-in-right 0.2s;
  box-shadow: -4px 0 24px var(--shadow);
}

.ceo-sidebar-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.ceo-sidebar-panel-body {
  flex: 1 1;
  overflow-y: auto;
}

.ceo-sidebar-close {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  font-family: inherit;
}

.ceo-sidebar-close:hover {
  color: var(--ink);
}

/* Animations */
@keyframes ceo-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ceo-slide-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes ceo-scale-in {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Dashboard route: hide fixed sidebar */
body.ceo-dashboard-active .side {
  display: none;
}

body.ceo-dashboard-active .app-shell {
  grid-template-columns: 220px 1fr;
}

body.ceo-dashboard-active .rail {
  position: relative;
  z-index: 250;
}

body.ceo-dashboard-active .ceo-onboarding-overlay {
  left: 220px;
}

@media (max-width: 900px) {
  body.ceo-dashboard-active .app-shell {
    grid-template-columns: 1fr;
  }

  body.ceo-dashboard-active .ceo-onboarding-overlay {
    left: 0;
  }
}

body.ceo-dashboard-active .sidebar-toggle {
  display: none;
}

/* Recharts overrides for consistent styling */
.ceo-widget-body .recharts-cartesian-axis-tick-value {
  font-size: 11px;
  fill: var(--muted);
}

.ceo-widget-body .recharts-tooltip-wrapper {
  font-size: 12px;
}

/* Loading skeleton for widgets */
.ceo-skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--bg) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: ceo-shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes ceo-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ceo-skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.ceo-skeleton-metric {
  height: 32px;
  width: 60px;
  margin-bottom: 8px;
}

.ceo-skeleton-chart {
  height: 200px;
}

/* Empty state */
.ceo-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 13px;
}

.ceo-empty-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--ink);
}

/* Comms activity chart */
.ceo-comms-legend {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  justify-content: center;
}

.ceo-comms-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ceo-comms-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Widget utility classes */
.ceo-empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--muted);
  font-size: 13px;
}

.ceo-empty-state--ok {
  color: #4a9d6e;
}

.ceo-widget-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  color: var(--muted);
  font-size: 13px;
}

/* Buttons */
.ceo-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}

.ceo-btn:hover {
  border-color: var(--accent-2);
  background: var(--bg-alt);
}

.ceo-btn--sm {
  padding: 4px 10px;
  font-size: 12px;
}

.ceo-btn--approve {
  color: #4a9d6e;
  border-color: #c2e8cf;
}

.ceo-btn--reject {
  color: #b00020;
  border-color: #f0c4c4;
}

/* Badge */
.ceo-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-alt);
  border: 1px solid var(--line);
}

/* Flash message */
.ceo-flash {
  padding: 8px 12px;
  border-radius: 8px;
  background: #f1fbf4;
  border: 1px solid #c2e8cf;
  color: #4a9d6e;
  font-size: 12px;
  margin-bottom: 8px;
}

/* Table */
.ceo-table-wrap {
  overflow-x: auto;
}

.ceo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ceo-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.ceo-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.ceo-table tr:last-child td {
  border-bottom: none;
}

.ceo-cell-agent {
  font-weight: 500;
}

/* Health card */
.ceo-health-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.ceo-health-latency {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

/* Cost breakdown */
.ceo-cost-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ceo-cost-total {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}

/* Approval item */
.ceo-approval-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.ceo-approval-task {
  font-weight: 500;
}

.ceo-approval-meta {
  font-size: 12px;
  color: var(--muted);
}

/* Progress bar */
.ceo-progress-key {
  font-weight: 500;
}

.ceo-progress-detail {
  font-size: 12px;
  color: var(--muted);
}

.ceo-progress-bar-track {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 4px;
  overflow: hidden;
}

.ceo-progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent-2);
  transition: width 0.3s;
}

/* ── Agent Graph V2 ── */
.agent-graph {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 40px);
  min-height: 0;
  position: relative;
}

.agent-graph__topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.agent-graph__title {
  flex-shrink: 0;
}

.agent-graph__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1;
}

.agent-graph__h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

.agent-graph__tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 3px;
  flex-shrink: 0;
}

.agent-graph__tab {
  padding: 5px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.agent-graph__tab:hover {
  color: var(--ink);
}

.agent-graph__tab.is-active {
  background: var(--ink);
  color: #fff;
  font-weight: 500;
}

.agent-graph__search {
  flex: 1 1 180px;
  min-width: 120px;
  max-width: 360px;
}

.agent-graph__search-input {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--panel);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}

.agent-graph__search-input:focus {
  border-color: var(--accent-2);
}

.agent-graph__status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.agent-graph__roster-btn,
.agent-graph__refresh {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s;
}

.agent-graph__roster-btn:hover,
.agent-graph__refresh:hover {
  background: var(--bg-alt);
}

.agent-graph__refresh:disabled {
  opacity: 0.5;
  cursor: default;
}

.agent-graph__ws-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-graph__ws-dot.is-on {
  background: #22c55e;
}

.agent-graph__ws-dot.is-off {
  background: var(--muted);
}

.agent-graph__status-text {
  font-size: 12px;
  color: var(--muted);
}

/* Body: three-column layout */
.agent-graph__body {
  display: grid;
  grid-template-columns: 0px 1fr 280px;
  flex: 1 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.agent-graph[data-roster-open="true"] .agent-graph__body {
  grid-template-columns: 240px 1fr 280px;
}

.agent-graph__left {
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--panel);
  transition: width 0.2s;
}

.agent-graph__body > .agent-graph__left {
  min-width: 0;
}

.agent-graph__center {
  min-height: 0;
  min-width: 0;
  position: relative;
}

.agent-graph__right {
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.agent-graph__scrim {
  display: none;
}

.agent-graph__overlay {
  position: absolute;
  inset: 0;
  background: rgba(243, 240, 234, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.agent-graph__overlay-card {
  text-align: center;
  padding: 32px;
}

.agent-graph__overlay-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}

.agent-graph__overlay-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.agent-graph__toast {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--accent);
  box-shadow: 0 4px 16px var(--shadow);
  z-index: 20;
}

/* Canvas */
.agent-graph-canvas {
  width: 100%;
  height: 100%;
}

.agent-graph-canvas .react-flow__controls {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
  border: 1px solid var(--line);
}

.agent-graph-canvas .react-flow__controls button {
  background: var(--panel);
  border: none;
  border-bottom: 1px solid var(--line);
  width: 28px;
  height: 28px;
}

.agent-graph-canvas .react-flow__controls button:hover {
  background: var(--bg-alt);
}

.agent-graph-canvas .react-flow__minimap {
  border-radius: 10px;
  overflow: hidden;
}

.agent-graph-canvas__error {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--accent);
}

/* Empty state */
.agent-graph-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 48px 24px;
}

.agent-graph-empty__title {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.agent-graph-empty__subtitle {
  font-size: 13px;
  color: var(--muted);
  max-width: 280px;
}

/* Nodes */
.agent-graph-node {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  box-shadow: 0 2px 8px var(--shadow);
  min-width: 180px;
}

.agent-graph-node--agent {
  border-left: 3px solid var(--muted);
}

.agent-graph-node--agent.is-alive {
  border-left-color: #22c55e;
}

.agent-graph-node--agent.is-dead {
  border-left-color: #ef4444;
}

.agent-graph-node--task {
  border-left: 3px solid #3b82f6;
}

.agent-graph-node--task.is-blocked {
  border-left-color: #ef4444;
}

.agent-graph-node--meeting {
  border-left: 3px solid #a855f7;
}

.agent-graph-node--meeting.is-live {
  border-left-color: #22c55e;
}

.agent-graph-node__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.agent-graph-node__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}

.agent-graph-node__dot.is-alive {
  background: #22c55e;
}

.agent-graph-node__dot.is-dead {
  background: #ef4444;
}

.agent-graph-node__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-graph-node__badge {
  font-size: 11px;
  background: #ef4444;
  color: #fff;
  border-radius: 6px;
  padding: 1px 6px;
  font-weight: 600;
  flex-shrink: 0;
}

.agent-graph-node__sub {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.agent-graph-node__chip {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 4px;
  padding: 1px 7px;
  text-transform: capitalize;
}

.agent-graph-node__chip.is-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

/* Roster */
.agent-graph-roster {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.agent-graph-roster__header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.agent-graph-roster__title {
  font-size: 13px;
  font-weight: 600;
}

.agent-graph-roster__meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.agent-graph-roster__list {
  flex: 1 1;
  overflow-y: auto;
  padding: 6px 0;
}

.agent-graph-roster__row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.agent-graph-roster__row:hover {
  background: var(--bg);
}

.agent-graph-roster__row.is-selected {
  background: var(--bg-alt);
  font-weight: 500;
}

.agent-graph-roster__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}

.agent-graph-roster__dot.is-alive {
  background: #22c55e;
}

.agent-graph-roster__dot.is-dead {
  background: #ef4444;
}

.agent-graph-roster__name {
  font-weight: 500;
  flex-shrink: 0;
}

.agent-graph-roster__role {
  color: var(--muted);
  font-size: 12px;
  flex: 1 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: capitalize;
}

.agent-graph-roster__status {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.agent-graph-roster__status.is-muted {
  opacity: 0.5;
}

.agent-graph-roster__empty {
  padding: 24px 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.agent-graph-roster__footer {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}

.agent-graph-roster__clear {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s;
}

.agent-graph-roster__clear:hover {
  background: var(--bg);
}

.agent-graph-roster__clear:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Detail panel */
.agent-graph-detail {
  padding: 18px 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.agent-graph-detail__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.agent-graph-detail__empty-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.agent-graph-detail__empty-subtitle {
  font-size: 13px;
  color: var(--muted);
  max-width: 220px;
}

.agent-graph-detail__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s;
}

.agent-graph-detail__close:hover {
  background: var(--bg);
  color: var(--ink);
}

.agent-graph-detail__header {
  padding-right: 28px;
}

.agent-graph-detail__name {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 6px;
}

.agent-graph-detail__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.agent-graph-detail__pill {
  font-size: 11px;
  background: var(--bg);
  border-radius: 5px;
  padding: 2px 8px;
  text-transform: capitalize;
  color: var(--ink);
}

.agent-graph-detail__pill.is-alive {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.agent-graph-detail__pill.is-dead {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.agent-graph-detail__pill.is-unknown {
  background: var(--bg-alt);
  color: var(--muted);
}

.agent-graph-detail__submeta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.agent-graph-detail__submeta-sep {
  margin: 0 4px;
}

.agent-graph-detail__section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.agent-graph-detail__section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.agent-graph-detail__count {
  font-size: 11px;
  background: var(--bg-alt);
  border-radius: 5px;
  padding: 1px 7px;
  font-weight: 600;
}

.agent-graph-detail__count.is-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.agent-graph-detail__kv {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.agent-graph-detail__k {
  color: var(--muted);
}

.agent-graph-detail__v {
  font-weight: 500;
}

.agent-graph-detail__muted {
  font-size: 13px;
  color: var(--muted);
}

.agent-graph-detail__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agent-graph-detail__task {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: background 0.12s, border-color 0.12s;
}

.agent-graph-detail__task:hover {
  background: var(--bg);
  border-color: var(--muted);
}

.agent-graph-detail__task.is-blocked {
  border-left: 3px solid #ef4444;
}

.agent-graph-detail__task-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-graph-detail__task-meta {
  display: flex;
  gap: 6px;
}

.agent-graph-detail__task-pill {
  font-size: 10px;
  background: var(--bg);
  border-radius: 4px;
  padding: 1px 6px;
  text-transform: capitalize;
  color: var(--muted);
}

.agent-graph-detail__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agent-graph-detail__btn {
  display: block;
  text-align: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.agent-graph-detail__btn:hover {
  background: #333;
}

.agent-graph-detail__btn.ghost {
  background: transparent;
  color: var(--ink);
}

.agent-graph-detail__btn.ghost:hover {
  background: var(--bg);
}

/* Responsive: collapse roster on small screens */
@media (max-width: 900px) {
  .agent-graph__body {
    grid-template-columns: 0px 1fr 0px;
  }

  .agent-graph[data-roster-open="true"] .agent-graph__body {
    grid-template-columns: 240px 1fr 0px;
  }

  .agent-graph[data-roster-open="true"] .agent-graph__scrim {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 5;
    border: none;
    cursor: default;
  }

  .agent-graph[data-roster-open="true"] .agent-graph__left {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    z-index: 10;
  }

  .agent-graph__right {
    display: none;
  }
}

/* --- Batch Cleanup --- */

.batch-cleanup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}

.batch-cleanup-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.batch-cleanup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.batch-cleanup-toggle {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.batch-cleanup-toggle .btn.active {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
}

.batch-cleanup-summary {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
}

nextjs-portal {
  pointer-events: none !important;
}

