:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-strong: #f9fbfd;
  --ink: #17202e;
  --muted: #667286;
  --line: #dce4ef;
  --blue: #2563eb;
  --green: #0f9f6e;
  --amber: #d88418;
  --rose: #d8405d;
  --indigo: #6554c0;
  --slate: #526173;
  --shadow: 0 18px 50px rgba(23, 32, 46, 0.08);
}

html {
  font-size: 15px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

a {
  text-decoration: none;
}

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

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 84px;
  height: 100vh;
  padding: 18px 12px;
  overflow: hidden;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: width 180ms ease, box-shadow 180ms ease;
}

.app-sidebar:hover,
.app-sidebar:focus-within {
  width: 280px;
  box-shadow: 24px 0 60px rgba(23, 32, 46, 0.13);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 252px;
  color: var(--ink);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #2563eb, #0f9f6e);
}

.brand strong,
.brand small {
  display: block;
}

.brand-text,
.side-nav a span,
.sidebar-note div {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.app-sidebar:hover .brand-text,
.app-sidebar:focus-within .brand-text,
.app-sidebar:hover .side-nav a span,
.app-sidebar:focus-within .side-nav a span,
.app-sidebar:hover .sidebar-note div,
.app-sidebar:focus-within .sidebar-note div {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav a {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  width: 252px;
  min-height: 44px;
  color: #344154;
  padding: 0 10px 0 0;
  border-radius: 8px;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.side-nav a i {
  justify-self: center;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #526173;
  transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.side-nav a:hover {
  color: var(--blue);
  background: #eef4ff;
}

.side-nav a:hover i {
  color: var(--blue);
}

.side-nav a.active {
  color: #1e3a8a;
  background: transparent;
  box-shadow: none;
}

.side-nav a.active:before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: #93c5fd;
}

.side-nav a.active i {
  color: #2563eb;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  box-shadow: none;
}

.app-sidebar:hover .side-nav a.active,
.app-sidebar:focus-within .side-nav a.active {
  background: #f8fbff;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.sidebar-note {
  margin-top: auto;
  width: 252px;
  min-height: 54px;
  padding: 14px;
  border-radius: 8px;
  background: #f2f6fb;
  border: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
}

.sidebar-note strong,
.sidebar-note small {
  display: block;
}

.sidebar-note small {
  color: var(--muted);
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(15, 159, 110, 0.13);
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 72px;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
}

.topbar strong,
.eyebrow {
  display: block;
}

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

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.system-pill {
  border: 1px solid #bfe4d5;
  color: #08734f;
  background: #ebfbf4;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 700;
}

.system-pill.muted {
  border-color: var(--line);
  color: var(--muted);
  background: #f7f9fc;
}

.logout-form {
  margin: 0;
}

.logout-pill {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #334155;
  border-color: #d8e1ee;
  background: #fff;
  font-weight: 750;
}

.logout-pill:hover {
  color: var(--blue);
  border-color: #bfdbfe;
  background: #eff6ff;
}

.content-wrap {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 30px 32px 48px;
  overflow-x: hidden;
}

.app-footer {
  color: var(--muted);
  padding: 18px 32px;
  border-top: 1px solid var(--line);
}

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

.sam-header h1 {
  font-size: 34px;
  line-height: 1.15;
  font-weight: 780;
  margin: 0 0 8px;
}

.sam-header p {
  max-width: 760px;
  color: var(--muted);
  margin: 0;
}

.sam-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn.sam-btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-weight: 720;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.btn.sam-btn-light {
  background: #fff;
  border-color: var(--line);
  color: #273446;
  border-radius: 8px;
  font-weight: 720;
}

.sam-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon label value"
    "icon note value";
  column-gap: 10px;
  row-gap: 2px;
  align-content: center;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 62px;
  padding: 8px 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card:before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--blue);
}

.metric-card i {
  grid-area: icon;
  align-self: center;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: #eef4ff;
  font-size: 13px;
  margin: 0;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-card span {
  grid-area: label;
  font-weight: 750;
  font-size: 12px;
  line-height: 1.1;
}

.metric-card strong {
  grid-area: value;
  align-self: center;
  display: block;
  margin: 0 0 0 8px;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}

.metric-card small {
  grid-area: note;
  font-size: 11px;
  line-height: 1.15;
}

.accent-green i { color: var(--green); background: #ecfbf4; }
.accent-amber i { color: var(--amber); background: #fff5e6; }
.accent-rose i { color: var(--rose); background: #fff0f3; }
.accent-indigo i { color: var(--indigo); background: #f0eeff; }
.accent-slate i { color: var(--slate); background: #f1f4f7; }

.accent-blue:before { background: var(--blue); }
.accent-green:before { background: var(--green); }
.accent-amber:before { background: var(--amber); }
.accent-rose:before { background: var(--rose); }
.accent-indigo:before { background: var(--indigo); }
.accent-slate:before { background: var(--slate); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.hub-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.hub-work-grid .sam-panel {
  margin-bottom: 0;
}

.hub-inbox-panel,
.clickup-watch-panel {
  min-height: 0;
}

.hub-inbox-panel .panel-heading,
.clickup-watch-panel .panel-heading {
  margin-bottom: 12px;
}

.hub-inbox-panel .panel-heading h2,
.clickup-watch-panel .panel-heading h2 {
  font-size: 20px;
}

.hub-inbox-panel .panel-heading p,
.clickup-watch-panel .panel-heading p {
  font-size: 14px;
}

.clickup-watch-panel {
  margin-bottom: 18px;
  padding: 16px;
}

.clickup-watch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.clickup-watch-stat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label value"
    "note value";
  gap: 4px 10px;
  min-height: 64px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #f8fafc;
}

.clickup-watch-stat.urgent {
  border-color: #f0c4cc;
  background: #fff8fa;
}

.clickup-watch-stat span,
.clickup-watch-stat small {
  display: block;
  color: var(--muted);
}

.clickup-watch-stat span {
  grid-area: label;
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clickup-watch-stat span i {
  width: 18px;
  color: var(--blue);
}

.clickup-watch-stat.urgent span i {
  color: var(--rose);
}

.clickup-watch-stat strong {
  grid-area: value;
  font-size: 25px;
  line-height: 1;
}

.clickup-watch-stat small {
  grid-area: note;
  font-size: 12px;
  line-height: 1.35;
}

.clickup-delay-list {
  display: grid;
  gap: 7px;
}

.clickup-delay-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 96px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.clickup-delay-list strong,
.clickup-delay-list span,
.clickup-delay-age strong,
.clickup-delay-age span {
  display: block;
}

.clickup-delay-list article > div:first-child {
  min-width: 0;
}

.clickup-delay-list article > div:first-child strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.clickup-delay-list article > div:first-child span,
.clickup-delay-age span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clickup-delay-age {
  text-align: right;
}

.clickup-delay-age strong {
  color: #9f213c;
  font-size: 13px;
}

.clickup-watch-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #cce8dc;
  border-radius: 8px;
  padding: 12px;
  color: #08734f;
  background: #f0fbf6;
}

.clickup-watch-empty i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #dff8ec;
}

.clickup-watch-empty strong,
.clickup-watch-empty span {
  display: block;
}

.clickup-watch-empty span {
  color: #477763;
}

.hub-inbox-panel .inbox-list {
  gap: 8px;
}

.hub-inbox-panel .inbox-empty {
  min-height: 330px;
  padding: 28px 22px;
}

.hub-inbox-panel .inbox-empty .empty-icon {
  width: 48px;
  height: 48px;
}

.hub-inbox-panel .inbox-empty h3 {
  font-size: 20px;
  margin-top: 12px;
}

.hub-inbox-panel .inbox-empty p {
  max-width: 540px;
  font-size: 14px;
}

.focus-strip-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(260px, 1.2fr);
  gap: 10px;
  margin-top: 16px;
}

.focus-strip-panel > div {
  display: grid;
  grid-template-columns: 12px auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 32, 46, 0.04);
}

.focus-strip-panel strong {
  font-size: 20px;
  line-height: 1;
}

.focus-strip-panel small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-strip-panel .policy-note {
  grid-template-columns: auto minmax(0, 1fr);
  background: #eef4ff;
}

.focus-strip-panel .policy-note strong {
  font-size: 14px;
  color: #244077;
}

.sam-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panel-heading h2,
.side-panel h2 {
  font-size: 21px;
  margin: 0 0 4px;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
}

.table-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-tools span {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 720;
}

.table-shell {
  overflow-x: auto;
}

.inbox-list {
  display: grid;
  gap: 12px;
}

.conversation-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #dde6f1;
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.conversation-card:hover {
  border-color: #b9cdf0;
  box-shadow: 0 14px 32px rgba(23, 32, 46, 0.08);
  color: inherit;
  transform: translateY(-1px);
}

.conversation-avatar {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 850;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.conversation-main {
  min-width: 0;
}

.conversation-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.conversation-title-row h3 {
  font-size: 16px;
  margin: 0 0 3px;
}

.conversation-title-row p {
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 680px;
}

.time-chip {
  color: var(--muted);
  background: #f5f8fc;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.conversation-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.conversation-ai {
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.conversation-ai small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 7px;
}

.conversation-ai strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.confidence-meter.large {
  width: 100%;
}

.status-badge.review {
  background: #fff0f3;
  color: #a52743;
}

.conversation-review-header {
  align-items: flex-end;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 10px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--blue);
}

.conversation-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.conversation-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}

.conversation-thread-panel {
  min-height: 520px;
}

.conversation-confidence {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--muted);
  font-weight: 800;
}

.conversation-confidence strong {
  color: var(--ink);
  font-size: 22px;
}

.conversation-thread {
  display: grid;
  gap: 12px;
}

.message-bubble {
  border: 1px solid #dce6f2;
  border-radius: 8px;
  padding: 13px 14px;
  background: #f8fbff;
}

.message-bubble.outbound {
  background: #eef6ff;
  border-color: #c9ddff;
  margin-left: 56px;
}

.message-bubble > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}

.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.message-reactions span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #d8e4f3;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
}

.message-reactions strong {
  font-size: 15px;
}

.message-reactions small {
  color: #64748b;
  font-weight: 800;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-review-sidebar {
  display: grid;
  gap: 14px;
}

.ai-brain-status-panel {
  display: grid;
  gap: 10px;
  border-left: 4px solid var(--amber);
}

.ai-brain-status-panel.ready {
  border-left-color: var(--green);
}

.ai-brain-status-panel h2 {
  margin-bottom: 4px;
}

.ai-brain-status-panel p {
  color: var(--muted);
  margin: 0;
}

.ai-brain-status-panel .btn {
  width: 100%;
}

.ai-rerun-status,
.conversation-action-status {
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f3f7ff;
  color: #174ea6;
  font-size: 13px;
  font-weight: 750;
  padding: 10px 12px;
}

.conversation-action-status {
  margin-top: 10px;
}

.ai-rerun-status[data-state="ok"],
.conversation-action-status[data-state="ok"] {
  border-color: #bcebd8;
  background: #effdf7;
  color: #047857;
}

.ai-rerun-status[data-state="warning"],
.conversation-action-status[data-state="warning"],
.conversation-action-status[data-state="blocked"] {
  border-color: #f7d797;
  background: #fff8eb;
  color: #986500;
}

.ai-rerun-status[data-state="error"],
.conversation-action-status[data-state="error"] {
  border-color: #fac7d3;
  background: #fff3f6;
  color: #a52743;
}

.compact-heading {
  margin-bottom: 10px;
}

.draft-preview {
  display: grid;
  gap: 10px;
}

.draft-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}

.draft-meta strong {
  margin-left: auto;
}

.draft-preview p,
.ai-suggested-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.draft-preview small,
.muted-text {
  color: var(--muted);
}

.review-actions-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.review-actions-block .btn {
  width: 100%;
}

.ai-read-list {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.ai-read-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.ai-read-list dt {
  color: var(--muted);
  font-weight: 800;
}

.ai-read-list dd {
  margin: 0;
  text-align: right;
}

.attachment-list {
  display: grid;
  gap: 8px;
}

.attachment-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-decoration: none;
  color: var(--ink);
  background: #f8fbff;
}

.attachment-list a:hover {
  border-color: #b9cdf0;
  color: var(--blue);
}

.inbox-empty.compact {
  min-height: 180px;
}

.inbox-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 36px 24px;
  border: 1px solid #d9e4f2;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.96)),
    repeating-linear-gradient(135deg, #f4f8fd 0, #f4f8fd 12px, #eef4fb 12px, #eef4fb 24px);
}

.inbox-empty .empty-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 850;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.2);
}

.inbox-empty h3 {
  margin: 14px 0 6px;
  font-size: 22px;
}

.inbox-empty p {
  max-width: 680px;
  color: var(--muted);
  margin: 0;
}

.empty-steps {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.empty-steps span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #526173;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 760;
}

.sam-table {
  margin: 0;
}

.sam-table thead th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.sam-table tbody td {
  border-bottom: 1px solid #edf1f6;
  vertical-align: middle;
}

.customer-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
}

.customer-cell span {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e8f1ff;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #f3f6fa;
  color: #4a5668;
}

.status-badge.mood {
  background: #edf7f2;
  color: #08734f;
}

.status-badge.urgency {
  background: #fff3df;
  color: #98600e;
}

.status-badge.state {
  background: #eef4ff;
  color: #214fbd;
}

.confidence-meter {
  width: 86px;
  height: 8px;
  border-radius: 999px;
  background: #e8edf4;
  overflow: hidden;
  margin-bottom: 4px;
}

.confidence-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.empty-state {
  min-height: 130px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px dashed #cfd9e6;
  border-radius: 8px;
  padding: 24px;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
}

.side-panel {
  align-self: start;
}

.focus-list {
  display: grid;
  gap: 12px;
}

.focus-list div {
  display: grid;
  grid-template-columns: 12px 54px 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.focus-list strong {
  font-size: 24px;
}

.focus-list small {
  color: var(--muted);
}

.focus-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
}

.focus-dot.rose { background: var(--rose); }
.focus-dot.amber { background: var(--amber); }
.focus-dot.green { background: var(--green); }

.insight-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: #eef4ff;
  color: #244077;
}

.insight-box p {
  color: #47618e;
  margin: 6px 0 0;
}

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

.quality-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-strong);
}

.quality-grid strong,
.quality-grid span {
  display: block;
}

.quality-grid span {
  color: var(--muted);
  margin-top: 4px;
}

.worker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.worker-card {
  min-height: 126px;
  border: 1px solid #d9e3ee;
  border-radius: 8px;
  padding: 15px;
  background: #fff;
  display: grid;
  align-content: space-between;
  gap: 14px;
  box-shadow: 0 8px 22px rgba(23, 32, 46, 0.045);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.worker-card:hover {
  border-color: #bfcde0;
  box-shadow: 0 14px 28px rgba(23, 32, 46, 0.07);
  transform: translateY(-1px);
}

.worker-card strong,
.worker-card span,
.worker-card small {
  display: block;
}

.worker-card > div span,
.worker-card small {
  color: var(--muted);
}

.worker-display-name {
  color: #111827;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 820;
}

.worker-type {
  color: #5f6f84;
  font-size: 13px;
  line-height: 1.3;
  margin-top: 3px;
}

.worker-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafc;
}

.worker-card.has-issue {
  border-color: #e7b7c2;
  border-left: 4px solid #d8405d;
  background: #fff;
}

.worker-card.has-issue .worker-status-line {
  border-color: #f1d4dc;
  background: #fff8fa;
}

.worker-error-panel {
  border-top: 1px solid #eef2f7;
  padding-top: 9px;
}

.worker-error-panel[hidden] {
  display: none;
}

.worker-error-panel summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #9f213c;
  border: 1px solid #f3c9d2;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff7f9;
  font-size: 12px;
  font-weight: 800;
}

.worker-error-summary {
  margin: 7px 0 0;
  color: #7a3444;
  font-size: 12px;
  line-height: 1.45;
}

.worker-error {
  max-height: 130px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 8px;
  border-radius: 8px;
  color: #e5edf8;
  background: #111827;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.worker-state {
  justify-self: start;
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  background: var(--slate);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: capitalize;
  white-space: nowrap;
}

.worker-card .worker-status-line .worker-state {
  color: #fff;
}

.worker-state.running {
  background: #07895f;
}

.worker-state.stale {
  background: #ad640c;
}

.worker-state.error {
  background: #c32f4d;
}

.worker-heartbeat {
  color: #475569 !important;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
  text-align: right;
}

.worker-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.worker-overview article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.worker-overview span {
  color: var(--muted);
  font-weight: 740;
}

.worker-overview strong {
  font-size: 24px;
  line-height: 1;
}

.worker-health-panel {
  padding: 16px;
}

.worker-health-board {
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.worker-health-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.25fr) 110px minmax(120px, 0.7fr) minmax(190px, 0.9fr) minmax(170px, 0.8fr);
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
}

.worker-health-row:last-child {
  border-bottom: 0;
}

.worker-health-row-head {
  min-height: 38px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.worker-health-row.has-issue {
  background: #fffafb;
}

.worker-name-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.worker-name-cell > div {
  min-width: 0;
}

.worker-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px #f1f5f9;
}

.worker-dot.running {
  background: #059669;
  box-shadow: 0 0 0 4px #dff8ed;
}

.worker-dot.stale {
  background: #d97706;
  box-shadow: 0 0 0 4px #fff2d7;
}

.worker-dot.error {
  background: #e11d48;
  box-shadow: 0 0 0 4px #ffe4eb;
}

.worker-name {
  display: block;
  margin-top: 1px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-status-cell {
  display: flex;
  align-items: center;
}

.worker-health-row .worker-type {
  display: block;
  color: #475569;
  font-size: 12px;
  font-weight: 720;
  text-transform: capitalize;
}

.worker-health-row .worker-heartbeat {
  display: grid;
  gap: 1px;
  color: #334155 !important;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
  text-align: left;
}

.worker-health-row .worker-heartbeat strong {
  color: #172033;
  font-size: 12px;
  line-height: 1.2;
}

.worker-health-row .worker-heartbeat span,
.worker-health-row .worker-heartbeat.muted {
  color: #64748b !important;
  font-size: 11px;
  font-weight: 680;
}

.worker-issue-cell {
  min-width: 0;
}

.worker-ok {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ccefdc;
  border-radius: 999px;
  padding: 5px 9px;
  color: #08734f;
  background: #f0fdf4;
  font-size: 11px;
  font-weight: 850;
}

.worker-health-row .worker-error-panel {
  border-top: 0;
  padding-top: 0;
}

.worker-health-row .worker-error-panel summary {
  padding: 5px 9px;
  font-size: 11px;
}

.worker-health-row .worker-error-summary {
  max-width: 460px;
}

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

.settings-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.settings-list span,
.settings-list strong,
.settings-list small {
  display: block;
}

.settings-list span,
.settings-list small {
  color: var(--muted);
}

.settings-list span {
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0;
}

.settings-list strong {
  margin: 3px 0;
  overflow-wrap: anywhere;
}

.settings-list.compact {
  margin-top: 14px;
}

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

.setting-editor {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.setting-editor label {
  font-weight: 760;
  color: var(--ink);
}

.setting-editor div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.setting-editor input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
}

.setting-editor small {
  color: var(--muted);
  line-height: 1.35;
}

.connector-panel {
  overflow: hidden;
}

.connector-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.connector-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: #fff;
  color: #344154;
  font-weight: 760;
}

.connector-tabs button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.connector-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #bdd3f5;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  color: #214fbd;
  background: #eef4ff;
  font-weight: 720;
}

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

.connector-config.split {
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
}

.connector-main {
  display: grid;
  gap: 14px;
}

.connector-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
}

.connector-section-title span {
  border: 1px solid #c7d6ec;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--blue);
  background: #eef4ff;
  font-size: 12px;
  font-weight: 800;
}

.connector-section-title strong {
  font-size: 16px;
}

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

.connector-fields label {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.connector-fields span,
.connector-list-picker strong {
  font-weight: 780;
}

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

.connector-fields textarea {
  resize: vertical;
  min-height: 78px;
  line-height: 1.35;
}

.connector-fields small,
.connector-list-picker small {
  color: var(--muted);
  line-height: 1.35;
}

.connector-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.connector-switches label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  font-weight: 720;
}

.connector-list-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.connector-list-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px;
}

.connector-list-options.compact {
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.connector-list-options label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.connector-list-options span {
  overflow-wrap: anywhere;
}

.connector-list-options em {
  color: var(--green);
  font-style: normal;
  font-weight: 760;
  font-size: 12px;
}

.connector-summary {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 10px;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.connector-summary > strong {
  font-size: 16px;
}

.connector-summary label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #344154;
  font-weight: 720;
}

.mode-note {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-strong);
}

.mode-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.mode-note strong {
  color: var(--ink);
}

.connector-empty {
  border: 1px dashed #b9c8db;
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fff;
}

.connector-actions {
  display: flex;
  justify-content: flex-end;
}

.connector-test-actions {
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0 18px 18px;
  padding: 12px;
  border: 1px solid #d7e1ee;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
}

.connector-test-actions span {
  font-size: 13px;
}

.connector-test-actions button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.connector-inline-result {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: -6px 18px 18px;
  padding: 12px;
  border: 1px solid #d7e1ee;
  border-radius: 8px;
  background: #f8fafc;
  color: #344154;
}

.connector-inline-result[hidden] {
  display: none;
}

.connector-inline-result i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: #eef4ff;
}

.connector-inline-result strong,
.connector-inline-result span {
  display: block;
}

.connector-inline-result span {
  margin-top: 2px;
  color: #526173;
  font-size: 13px;
  line-height: 1.45;
}

.connector-inline-result.ok {
  border-color: #bfe8d5;
  background: #f1fbf6;
}

.connector-inline-result.ok i {
  color: #08734f;
  background: #dff8ec;
}

.connector-inline-result.warning {
  border-color: #f0d6a9;
  background: #fff8ec;
}

.connector-inline-result.warning i {
  color: #a5620d;
  background: #fff0d3;
}

.connector-inline-result.error {
  border-color: #f0c4cc;
  background: #fff7f9;
}

.connector-inline-result.error i {
  color: #b92343;
  background: #ffe4eb;
}

.whatsapp-registry-section {
  margin-top: 18px;
}

.whatsapp-registry-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}

.whatsapp-registry-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.whatsapp-registry-counts span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: #fff;
  color: #46556a;
  font-size: 12px;
  font-weight: 760;
}

.whatsapp-registry-form {
  display: grid;
  gap: 12px;
}

.whatsapp-chat-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.whatsapp-chat-head,
.whatsapp-chat-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(210px, 0.85fr) minmax(260px, 1.1fr) 150px 210px;
  gap: 12px;
  align-items: center;
}

.whatsapp-chat-head {
  padding: 10px 12px;
  color: var(--muted);
  background: #f6f9fd;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.whatsapp-chat-row {
  padding: 12px;
  border-bottom: 1px solid #edf1f6;
}

.whatsapp-chat-row:last-child {
  border-bottom: 0;
}

.whatsapp-chat-name {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.whatsapp-chat-name strong,
.whatsapp-chat-name span,
.whatsapp-chat-name small {
  overflow-wrap: anywhere;
}

.whatsapp-chat-name span,
.whatsapp-chat-name small {
  color: var(--muted);
}

.whatsapp-chat-name span {
  font-size: 13px;
}

.whatsapp-chat-name small {
  font-size: 12px;
}

.whatsapp-chat-description input,
.whatsapp-chat-ai textarea,
.whatsapp-chat-type select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
}

.whatsapp-chat-ai textarea {
  min-height: 54px;
  resize: vertical;
  line-height: 1.35;
  font-size: 13px;
}

.whatsapp-chat-flags {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.whatsapp-chat-flags label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #344154;
  font-size: 13px;
  font-weight: 760;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.connector-status-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.connector-run-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.connector-run-card strong,
.connector-run-card span {
  display: block;
}

.connector-run-card span {
  color: var(--muted);
  margin-top: 3px;
}

.connector-events {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.connector-events article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-strong);
}

.connector-events strong {
  overflow-wrap: anywhere;
}

.connector-events span,
.connector-events p {
  color: var(--muted);
}

.connector-events p {
  grid-column: 1 / -1;
  margin: 0;
}

.connector-events.relaxed {
  max-height: none;
}

.connector-directory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.connector-directory-card,
.connector-card-link {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.connector-directory-card {
  appearance: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.connector-directory-card span:first-child {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: #eef4ff;
}

.connector-directory-card.ready {
  border-color: #bdd3f5;
}

.connector-directory-card.active {
  border-color: #93c5fd;
  background: #f8fbff;
  box-shadow: inset 0 0 0 1px #bfdbfe, 0 18px 42px rgba(37, 99, 235, 0.1);
}

.connector-directory-card.active span:first-child {
  color: #1d4ed8;
  background: #dbeafe;
}

.connector-directory-card strong,
.connector-directory-card small,
.connector-card-link strong,
.connector-card-link span,
.connector-card-link small {
  display: block;
}

.connector-directory-card small,
.connector-card-link span,
.connector-card-link small {
  color: var(--muted);
}

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

.connector-setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.connector-mini-panel {
  padding: 18px;
}

.connector-mini-panel .connector-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.connector-actions.split-actions {
  align-items: center;
  justify-content: space-between;
}

.connector-actions.stacked {
  justify-content: flex-start;
  flex-wrap: wrap;
  padding: 0 18px 18px;
}

.connector-switch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.connector-mode-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.connector-mode-strip div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
}

.connector-mode-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.connector-mode-strip strong {
  overflow-wrap: anywhere;
}

.inline-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.inline-switch input {
  width: 16px;
  height: 16px;
}

.connector-card-link:hover,
.connector-directory-card.ready:hover {
  border-color: #b9cdf0;
  color: var(--ink);
}

.connector-directory-card:hover {
  transform: translateY(-1px);
}

.clickup-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.clickup-config-panel {
  position: sticky;
  top: 88px;
}

.connector-fields.single {
  grid-template-columns: 1fr;
}

.connector-summary.flat {
  position: static;
  margin: 12px 0;
  box-shadow: none;
}

.connector-page-panel {
  padding: 0;
  overflow: hidden;
}

.connector-tab-form,
.connector-page-panel .tab-pane {
  padding: 18px;
}

.connector-subsection {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.panel-heading.compact {
  align-items: center;
  margin-bottom: 12px;
}

.panel-heading.compact h3 {
  margin: 0 0 3px;
  font-size: 18px;
}

.panel-heading.compact p {
  font-size: 13px;
}

.connector-count-pill {
  align-self: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 6px 10px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.connector-activity-panel {
  margin-top: 18px;
}

.connector-clickup-tree {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.connector-tab-form .connector-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clickup-lists-panel {
  min-width: 0;
}

.clickup-search-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 12px;
  background: #fff;
}

.clickup-search-row i {
  color: var(--muted);
}

.clickup-search-row input {
  border: 0;
  outline: 0;
  min-width: 0;
}

.clickup-list-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.clickup-list-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  border-bottom: 1px solid #edf1f6;
}

.clickup-list-row:last-child {
  border-bottom: 0;
}

.clickup-list-row:hover {
  background: #f8fbff;
}

.clickup-list-row span {
  overflow-wrap: anywhere;
}

.clickup-list-row em {
  border-radius: 999px;
  padding: 3px 7px;
  color: #08734f;
  background: #ebfbf4;
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
}

.clickup-list-save {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.clickup-page-panel {
  padding: 16px;
}

.tabbar {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.tab-pane {
  padding-top: 14px;
}

.clickup-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: start;
}

.clickup-settings-main {
  min-width: 0;
}

.clickup-tree {
  display: grid;
  gap: 8px;
}

.clickup-tree-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.clickup-tree-group[hidden],
.clickup-tree-branch[hidden],
.clickup-list-row[hidden] {
  display: none;
}

.clickup-tree-group > summary {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 11px 12px;
  list-style: none;
  background: #f8fafc;
}

.clickup-tree-group > summary::-webkit-details-marker {
  display: none;
}

.clickup-tree-group > summary strong,
.clickup-tree-group > summary small {
  display: block;
}

.clickup-tree-group > summary small {
  color: var(--muted);
  margin-top: 2px;
}

.clickup-tree-group > summary i {
  color: var(--muted);
  transition: transform 160ms ease;
}

.clickup-tree-group[open] > summary i {
  transform: rotate(180deg);
}

.clickup-tree-branch {
  border-top: 1px solid var(--line);
}

.clickup-branch-heading {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  color: #344154;
  background: #fff;
  font-weight: 760;
}

.clickup-branch-heading small {
  color: var(--muted);
  font-weight: 650;
}

.clickup-tree-rows {
  display: grid;
  background: #fff;
}

.clickup-tree-rows .clickup-list-row {
  margin-left: 30px;
  border-left: 1px solid #edf1f6;
  border-bottom-color: #f0f3f7;
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.clickup-tree-rows .clickup-list-row span {
  color: #344154;
  font-size: 14px;
}

.clickup-tree input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

.worker-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.settings-panel {
  padding: 0;
  overflow: hidden;
}

.settings-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 16px 18px;
  list-style: none;
}

.settings-panel > summary::-webkit-details-marker {
  display: none;
}

.settings-panel > summary strong,
.settings-panel > summary small {
  display: block;
}

.settings-panel > summary small {
  margin-top: 3px;
  color: var(--muted);
}

.settings-panel[open] > summary {
  border-bottom: 1px solid var(--line);
}

.settings-panel .panel-heading,
.settings-panel .settings-list {
  margin: 16px 18px;
}

.settings-panel .settings-list {
  max-height: 460px;
  overflow: auto;
}

.shadow-metrics-strip {
  margin-bottom: 18px;
}

.shadow-tabs-panel {
  padding: 0;
  overflow: hidden;
}

.sam-tabs {
  gap: 6px;
  padding: 14px 16px 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.sam-tabs .nav-link {
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  color: #344154;
  font-weight: 760;
  padding: 9px 12px;
}

.sam-tabs .nav-link.active {
  color: var(--blue);
  background: #fff;
  border-color: var(--line) var(--line) #fff;
}

.sam-tabs .nav-link span {
  display: inline-flex;
  justify-content: center;
  min-width: 22px;
  margin-left: 6px;
  border-radius: 999px;
  padding: 2px 7px;
  color: #214fbd;
  background: #eef4ff;
  font-size: 12px;
}

.sam-tab-content {
  padding: 16px;
}

.sam-tab-content .tab-pane:focus {
  outline: 0;
}

.shadow-queue-heading {
  margin-bottom: 14px;
}

.shadow-queue-heading h2 {
  font-size: 22px;
  letter-spacing: 0;
}

.sam-metrics.no-margin {
  margin-bottom: 0;
}

.shadow-review-table-shell {
  overflow-x: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 32, 46, 0.04);
}

.shadow-review-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.shadow-review-table th {
  padding: 12px 14px;
  color: #526173;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.shadow-review-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf1f6;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.shadow-review-table th:nth-child(1),
.shadow-review-table td:nth-child(1) {
  width: 9%;
}

.shadow-review-table th:nth-child(2),
.shadow-review-table td:nth-child(2) {
  width: 20%;
}

.shadow-review-table th:nth-child(3),
.shadow-review-table td:nth-child(3) {
  width: 11%;
}

.shadow-review-table th:nth-child(4),
.shadow-review-table td:nth-child(4) {
  width: 8%;
}

.shadow-review-table th:nth-child(5),
.shadow-review-table td:nth-child(5) {
  width: 34%;
}

.shadow-review-table th:nth-child(6),
.shadow-review-table td:nth-child(6) {
  width: 9%;
}

.shadow-review-table th:nth-child(7),
.shadow-review-table td:nth-child(7) {
  width: 9%;
}

.shadow-review-table tr:last-child td {
  border-bottom: 0;
}

.shadow-review-table tbody tr:hover {
  background: #fbfdff;
}

.shadow-source-cell,
.shadow-decision-cell,
.shadow-message-cell,
.shadow-confidence {
  display: grid;
  gap: 5px;
}

.shadow-source-cell {
  min-width: 0;
}

.shadow-source-cell strong,
.shadow-message-cell strong {
  color: var(--ink);
  font-size: 13px;
}

.shadow-source-cell span,
.shadow-time-cell {
  color: #526173;
  font-size: 13px;
}

.shadow-action-pill {
  justify-self: start;
  border: 1px solid #d8cfff;
  border-radius: 999px;
  padding: 5px 9px;
  color: #5a42bd;
  background: #f4f1ff;
  font-size: 12px;
  font-weight: 820;
}

.shadow-decision-cell {
  min-width: 0;
}

.shadow-decision-cell p,
.shadow-message-cell p {
  margin: 0;
  color: #526173;
  line-height: 1.45;
}

.shadow-decision-cell p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.shadow-signal-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.shadow-signal-stack span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: #46556a;
  background: #fff;
  font-size: 12px;
  font-weight: 760;
}

.shadow-confidence {
  min-width: 0;
}

.shadow-confidence strong {
  font-size: 16px;
}

.shadow-message-cell {
  min-width: 0;
  max-width: none;
  font-size: 13px;
}

.shadow-message-cell p {
  white-space: pre-wrap;
  overflow: visible;
  color: #344154;
  font-size: 13px;
  line-height: 1.35;
}

.shadow-time-cell {
  min-width: 0;
  white-space: normal;
}

.shadow-time-cell strong,
.shadow-time-cell span,
.activity-time strong,
.activity-time small {
  display: block;
}

.shadow-time-cell strong,
.activity-time strong {
  color: #273446;
  font-size: 13px;
}

.shadow-time-cell span,
.activity-time small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.shadow-table-actions {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.shadow-table-actions .btn {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: none;
}

.shadow-reject-menu {
  display: grid;
  gap: 7px;
}

.shadow-reject-menu summary {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  color: #344154;
  background: #fff;
  font-size: 12px;
  font-weight: 760;
  text-align: center;
  list-style-position: inside;
}

.shadow-reject-menu div {
  display: grid;
  gap: 7px;
  margin-top: 7px;
}

.shadow-empty {
  margin-top: 4px;
}

.shadow-list {
  display: grid;
  gap: 14px;
}

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

.activity-list.compact-log {
  max-height: 680px;
  overflow: auto;
  padding-right: 4px;
}

.activity-row {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.activity-row > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-row strong {
  overflow-wrap: anywhere;
}

.activity-row span,
.activity-row p,
.activity-row summary {
  color: var(--muted);
}

.activity-row p {
  margin: 0;
}

.activity-row summary {
  cursor: pointer;
  font-weight: 720;
}

.activity-row pre {
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #e5edf8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.shadow-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 14px;
}

.shadow-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.shadow-card header strong,
.shadow-card header span {
  display: block;
}

.shadow-card header span {
  color: var(--muted);
  margin-top: 3px;
}

.shadow-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.shadow-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 750;
}

.shadow-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 12px;
}

.shadow-body div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.shadow-body small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 5px;
}

.shadow-body p {
  margin: 0;
  color: #334155;
  white-space: pre-wrap;
}

.shadow-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.worker-state.pending {
  background: var(--amber);
}

.worker-state.approved {
  background: var(--green);
}

.worker-state.rejected {
  background: var(--rose);
}

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

  .app-sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 18px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-sidebar:hover,
  .app-sidebar:focus-within {
    width: auto;
    box-shadow: none;
  }

  .brand,
  .side-nav a,
  .sidebar-note {
    width: auto;
  }

  .brand-text,
  .side-nav a span,
  .sidebar-note div {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

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

  .dashboard-grid,
  .hub-work-grid {
    grid-template-columns: 1fr;
  }

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

  .clickup-delay-list article {
    grid-template-columns: minmax(0, 1fr);
  }

  .clickup-delay-age {
    text-align: left;
  }

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

  .connector-config.split,
  .connector-status-grid,
  .connector-setup-grid,
  .connector-mode-strip,
  .clickup-shell,
  .clickup-settings-layout,
  .worker-admin-grid {
    grid-template-columns: 1fr;
  }

  .connector-summary {
    position: static;
  }

  .worker-health-row {
    grid-template-columns: minmax(190px, 1fr) 105px minmax(110px, 0.6fr) minmax(150px, 0.8fr) minmax(140px, 0.8fr);
    gap: 10px;
  }

  .clickup-config-panel {
    position: static;
  }

  .conversation-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

.conversation-ai {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 12px;
  }
}

.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(37, 99, 235, 0.14), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(15, 159, 110, 0.12), transparent 26%),
    linear-gradient(135deg, #f6f9fd, #eef3f9);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-panel {
  width: min(100%, 430px);
  padding: 30px;
  border: 1px solid #d9e4f2;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 80px rgba(23, 32, 46, 0.14);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.login-brand .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  font-size: 21px;
}

.login-brand h1 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.login-copy {
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-field {
  display: grid;
  gap: 8px;
  font-weight: 750;
}

.login-field input {
  width: 100%;
  height: 46px;
  border: 1px solid #cfdae8;
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #fbfdff;
  font-size: 15px;
  font-weight: 500;
  outline: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.login-field input:focus {
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.login-check {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #3f4c60;
  font-weight: 650;
}

.login-check input {
  width: 17px;
  height: 17px;
}

.login-button {
  height: 48px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: #2563eb;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.22);
}

.login-button:hover {
  background: #1d4ed8;
}

.login-validation,
.field-validation {
  color: #b42342;
  font-size: 13px;
  font-weight: 700;
}

.login-validation ul {
  margin: 0;
  padding-left: 18px;
}

.login-footnote {
  margin-top: 18px;
  padding: 13px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  color: var(--muted);
  background: #f7faff;
  line-height: 1.4;
}

.login-footnote i {
  color: var(--green);
  margin-top: 2px;
}

@media (max-width: 760px) {
  .content-wrap,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .sam-header,
  .topbar,
  .panel-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .focus-strip-panel,
  .clickup-watch-grid {
    grid-template-columns: 1fr;
  }

  .conversation-title-row {
    flex-direction: column;
  }

  .worker-overview,
  .connector-fields,
  .connector-mini-panel .connector-fields,
  .connector-tab-form .connector-fields,
  .worker-grid {
    grid-template-columns: 1fr;
  }

  .worker-health-row-head {
    display: none;
  }

  .worker-health-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    padding: 12px;
  }

  .worker-status-cell,
  .worker-health-row .worker-type,
  .worker-health-row .worker-heartbeat,
  .worker-issue-cell {
    padding-left: 20px;
  }

  .topbar-actions,
  .sam-actions {
    width: 100%;
  }

  .topbar-actions .system-pill,
  .sam-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}
