:root {
  --ink: #16202d;
  --muted: #6f7b8c;
  --line: #e6e9ee;
  --surface: #ffffff;
  --canvas: #f7f8fa;
  --sidebar: #162430;
  --sidebar-muted: #aeb8c0;
  --accent: #2a6a5e;
  --accent-dark: #1e5148;
  --accent-soft: #e5f2ee;
  --blue-soft: #eaf2ff;
  --blue: #356bc5;
  --amber: #a86416;
  --amber-soft: #fff5df;
  --red: #bc3e45;
  --red-soft: #fff0f1;
  --violet: #6855aa;
  --violet-soft: #f1effc;
  --shadow: 0 12px 38px rgba(23, 37, 53, 0.06);
  --radius: 18px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.66;
}

a {
  color: inherit;
}

.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;
}

.login-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, 0.88fr);
}

.login-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(36px, 7vw, 96px);
  color: #f8fcfb;
  background: #16322e;
}

.login-intro::before,
.login-intro::after {
  position: absolute;
  width: 40vw;
  height: 40vw;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}

.login-intro::before {
  top: -20vw;
  right: -12vw;
  background: rgba(95, 183, 157, 0.18);
}

.login-intro::after {
  bottom: -26vw;
  left: -15vw;
  background: rgba(137, 201, 179, 0.13);
}

.brand,
.brand-on-dark {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: inherit;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.13em;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 590px;
  margin: 82px 0;
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.on-dark {
  color: #bce1d6;
}

.login-copy h1 {
  max-width: 600px;
  margin: 0;
  font-size: clamp(39px, 5.1vw, 66px);
  font-weight: 680;
  letter-spacing: -0.058em;
  line-height: 1.06;
}

.login-copy p:last-child {
  max-width: 470px;
  margin: 28px 0 0;
  color: #d4e3df;
  font-size: 17px;
  line-height: 1.65;
}

.login-footnote {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 16px;
  color: #c4d6d1;
  font-size: 12px;
}

.login-panel {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 32px;
  background: #fbfcfd;
}

.login-card {
  width: min(100%, 408px);
}

.login-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: -0.045em;
}

.login-card > p {
  margin: 10px 0 32px;
  color: var(--muted);
}

.login-field-gap {
  margin-top: 15px;
}

.login-submit {
  width: 100%;
}

.login-actions {
  margin-top: 24px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 25px 14px 16px;
  color: #eff6f4;
  background: var(--sidebar);
}

.sidebar .brand-on-dark {
  padding: 0 10px;
}

.sidebar .brand-mark {
  color: #d0eee5;
}

.workspace-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 32px 5px 21px;
  padding: 9px 10px;
  color: #edf5f3;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  font-size: 12px;
}

.workspace-chip span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-glyph,
.user-avatar {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  color: #1e4e43;
  background: #c7e7dc;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.main-nav {
  display: grid;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  color: var(--sidebar-muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
  transition: 160ms ease;
}

.nav-item:hover {
  color: #eff6f4;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #effaf6;
  background: rgba(111, 188, 162, 0.18);
}

.nav-icon {
  display: inline-grid;
  width: 20px;
  place-items: center;
  color: #b9d4cb;
  font-size: 16px;
}

.nav-item.active .nav-icon {
  color: #a6e5d0;
}

.sidebar-bottom {
  margin-top: auto;
}

.help-card {
  margin: 0 5px 14px;
  padding: 14px;
  color: #cbd9d5;
  background: rgba(255, 255, 255, 0.055);
  border-radius: 13px;
  font-size: 11px;
  line-height: 1.55;
}

.help-card strong {
  display: block;
  margin-bottom: 3px;
  color: #f3f8f7;
  font-size: 12px;
}

.account-button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 8px;
  color: #dbe8e5;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  text-align: left;
}

.account-button .user-avatar {
  color: #254e43;
  background: #ddf0ea;
  border-radius: 50%;
}

.account-info {
  display: grid;
  min-width: 0;
}

.account-info strong,
.account-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-info strong {
  color: #ecf4f2;
  font-size: 11px;
}

.account-info span {
  color: #9db4ae;
  font-size: 10px;
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 44px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--line);
}

.page-crumb {
  color: #7c8797;
  font-size: 13px;
}

.page-crumb strong {
  color: #3f4c5b;
  font-weight: 650;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #758191;
  font-size: 12px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  background: #55b283;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #e5f6eb;
}

.page-content {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 38px 44px 56px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 29px;
}

.page-heading h1 {
  margin: 0;
  color: #182331;
  font-size: 30px;
  font-weight: 690;
  letter-spacing: -0.05em;
}

.page-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  color: #334151;
  background: #fff;
  border: 1px solid #dce2e9;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: 150ms ease;
}

.button:hover {
  border-color: #bec9d5;
  box-shadow: 0 5px 14px rgba(37, 53, 70, 0.07);
  transform: translateY(-1px);
}

.button.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.button.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button.ghost {
  color: #607083;
  background: transparent;
  border-color: transparent;
}

.button.danger {
  color: var(--red);
  border-color: #f1c9cd;
}

.button.small {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(285px, 0.34fr);
  gap: 24px;
}

.panel,
.metric-card,
.integration-card,
.automation-card,
.knowledge-card,
.settings-card,
.action-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-title-row h2,
.panel-title-row h3 {
  margin: 0;
  color: #202b39;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.panel-title-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.metric-card {
  min-width: 0;
  padding: 17px;
  box-shadow: none;
}

.metric-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  margin-bottom: 24px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 9px;
  font-size: 14px;
}

.metric-card:nth-child(2) .metric-icon {
  color: var(--violet);
  background: var(--violet-soft);
}

.metric-card:nth-child(3) .metric-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.metric-card:nth-child(4) .metric-icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.metric-value {
  color: #182432;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.metric-label {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.section-spacer {
  height: 24px;
}

.welcome-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  color: #f3faf7;
  background: linear-gradient(132deg, #22594f 0%, #153b35 100%);
  border: 0;
}

.welcome-card::after {
  position: absolute;
  right: -72px;
  bottom: -90px;
  width: 215px;
  height: 215px;
  content: "";
  border: 34px solid rgba(208, 241, 229, 0.12);
  border-radius: 50%;
}

.welcome-card h2 {
  position: relative;
  z-index: 1;
  max-width: 350px;
  margin: 0;
  font-size: 22px;
  font-weight: 640;
  letter-spacing: -0.045em;
  line-height: 1.2;
}

.welcome-card p {
  position: relative;
  z-index: 1;
  max-width: 315px;
  margin: 11px 0 21px;
  color: #c8e1da;
  font-size: 13px;
}

.welcome-card .button {
  position: relative;
  z-index: 1;
  color: #244d43;
  background: #f1fbf7;
  border-color: #f1fbf7;
}

.quick-actions {
  display: grid;
  gap: 9px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 0;
  color: #324252;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #eef0f3;
  text-align: left;
}

.quick-action:last-child {
  border-bottom: 0;
}

.quick-action:hover strong {
  color: var(--accent);
}

.quick-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 9px;
  font-size: 14px;
}

.quick-action strong {
  display: block;
  font-size: 12px;
  font-weight: 670;
}

.quick-action span:last-child {
  display: block;
  margin-top: 1px;
  color: #7e8997;
  font-size: 11px;
}

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

.activity-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #edf0f3;
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-bullet {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
  font-size: 11px;
}

.activity-main strong,
.activity-main span {
  display: block;
}

.activity-main strong {
  overflow: hidden;
  color: #344251;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-main span,
.activity-time {
  color: #8c96a3;
  font-size: 11px;
}

.empty-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: #3b4a58;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 4px 8px;
  color: #3d735e;
  background: #eaf7ef;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.status-pill::before {
  width: 5px;
  height: 5px;
  content: "";
  background: currentColor;
  border-radius: 50%;
}

.status-pill.pending,
.status-pill.approved {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-pill.failed,
.status-pill.rejected,
.status-pill.cancelled {
  color: var(--red);
  background: var(--red-soft);
}

.status-pill.running {
  color: var(--blue);
  background: var(--blue-soft);
}

.agent-layout {
  display: grid;
  min-height: calc(100vh - 178px);
  grid-template-columns: 255px minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 19px;
  box-shadow: var(--shadow);
}

.conversation-sidebar {
  display: flex;
  min-height: 610px;
  flex-direction: column;
  padding: 16px;
  background: #fbfcfd;
  border-right: 1px solid var(--line);
}

.conversation-sidebar .button {
  width: 100%;
  margin-bottom: 19px;
}

.conversation-list {
  display: grid;
  gap: 4px;
}

.conversation-item {
  display: flex;
  align-items: center;
  width: 100%;
  overflow: hidden;
  color: #627081;
  background: transparent;
  border-radius: 9px;
}

.conversation-item:hover,
.conversation-item.active {
  background: #eef5f3;
}

.conversation-item.active {
  color: #264e44;
}

.conversation-item-select {
  width: 100%;
  min-width: 0;
  padding: 10px;
  overflow: hidden;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.conversation-item-select strong,
.conversation-item-select span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item-select strong {
  font-size: 12px;
  font-weight: 650;
}

.conversation-item-select span {
  margin-top: 2px;
  color: #8b96a3;
  font-size: 10px;
}

.conversation-item-delete {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-right: 6px;
  color: #a1abb6;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  transition: background 0.12s ease, color 0.12s ease;
}

.conversation-item-delete:hover,
.conversation-item-delete:focus-visible {
  color: var(--red);
  background: #fbe4e6;
}

.conversation-canvas {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.agent-intro {
  padding: 31px 38px 12px;
}

.agent-intro h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.agent-intro p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.messages {
  display: flex;
  min-height: 370px;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  padding: 21px 38px;
  overflow-y: auto;
}

.message-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.message-row.user {
  justify-content: flex-end;
}

.assistant-avatar {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  color: #236452;
  background: #dff0ea;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
}

.message-bubble {
  max-width: min(700px, 84%);
  padding: 12px 14px;
  color: #334250;
  background: #f3f6f7;
  border-radius: 4px 14px 14px;
  font-size: 13px;
  line-height: 1.55;
}

.message-row.user .message-bubble {
  color: #fff;
  background: #2d6d60;
  border-radius: 14px 4px 14px 14px;
}

.message-meta {
  margin: 5px 3px 0;
  color: #99a2ad;
  font-size: 10px;
}

.message-row.user .message-meta {
  text-align: right;
}

.message-pending {
  align-items: center;
}

.thinking-bubble {
  display: flex;
  gap: 12px;
  align-items: center;
  width: fit-content;
  color: #526b63;
  background: #edf5f1;
}

.thinking-dots {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  align-items: center;
  height: 16px;
}

.thinking-dots span {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  animation: thinking-pulse 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.16s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes thinking-pulse {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.send-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgb(255 255 255 / 35%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .thinking-dots span,
  .send-spinner {
    animation: none;
  }
}

.message-row.error .message-bubble {
  color: #8f3640;
  background: var(--red-soft);
}

.message-row.approval .message-bubble {
  color: #735117;
  background: var(--amber-soft);
}

.message-row.blocked .message-bubble {
  color: #8e3540;
  background: var(--red-soft);
}

.inline-actions {
  display: grid;
  width: min(700px, calc(84% - 39px));
  gap: 9px;
  margin-left: 39px;
}

.action-card {
  padding: 16px;
  box-shadow: none;
}

.action-card.pending {
  border-color: #f0d7a6;
}

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

.action-kicker {
  margin: 0 0 3px;
  color: #8190a0;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.action-card h3 {
  margin: 0;
  color: #263543;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.action-card > p {
  margin: 6px 0 0;
  color: #6e7b8b;
  font-size: 12px;
}

.action-details {
  display: grid;
  gap: 6px;
  margin: 13px 0 0;
  padding: 11px 12px;
  background: #f8fafb;
  border-radius: 10px;
}

.action-detail {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  color: #435261;
  font-size: 11px;
}

.action-detail dt {
  color: #8994a1;
}

.action-detail dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.action-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-composer {
  padding: 14px 30px 20px;
  border-top: 1px solid #eef0f2;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 11px;
}

.suggestion {
  padding: 5px 9px;
  color: #54736b;
  background: #f1f8f5;
  border: 1px solid #dcece6;
  border-radius: 99px;
  font-size: 11px;
}

.suggestion:hover {
  color: #245648;
  border-color: #bcdacf;
}

.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px;
  background: #fff;
  border: 1px solid #dfe5ea;
  border-radius: 13px;
}

.composer-box:focus-within {
  border-color: #77aa9c;
  box-shadow: 0 0 0 3px #e5f2ee;
}

.composer-box textarea {
  width: 100%;
  min-height: 33px;
  max-height: 160px;
  padding: 7px 6px;
  resize: vertical;
  color: #2d3e4d;
  background: transparent;
  border: 0;
  outline: 0;
}

.send-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 9px;
  font-size: 15px;
}

.send-button:hover {
  background: var(--accent-dark);
}

.composer-help {
  margin: 7px 3px 0;
  color: #98a2ae;
  font-size: 10px;
}

.actions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.filter-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: #edf1f3;
  border-radius: 10px;
}

.filter-tab {
  padding: 6px 10px;
  color: #718091;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
}

.filter-tab.active {
  color: #344655;
  background: #fff;
  box-shadow: 0 1px 4px rgba(24, 38, 53, 0.1);
}

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

.actions-list .action-card {
  padding: 19px 20px;
}

.actions-list .action-card > p {
  max-width: 700px;
}

.action-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.action-summary {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 13px;
  color: #718091;
  font-size: 11px;
}

.action-summary span strong {
  color: #475665;
  font-weight: 650;
}

.integration-grid,
.automation-grid,
.knowledge-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.integration-card,
.automation-card,
.knowledge-card,
.settings-card {
  padding: 21px;
}

.integration-heading,
.automation-heading,
.knowledge-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.app-symbol {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  color: #2261ae;
  background: #e8f0fe;
  border-radius: 11px;
  font-size: 17px;
  font-weight: 800;
}

.app-symbol.calendar {
  color: #3c75ca;
  background: #eaf2ff;
}

.app-symbol.slack {
  color: #7954a8;
  background: #f3effa;
}

.app-heading-copy {
  flex: 1;
}

.app-heading-copy h2,
.automation-heading h2,
.knowledge-heading h2,
.settings-card h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.app-heading-copy p,
.automation-heading p,
.knowledge-heading p {
  margin: 2px 0 0;
  color: #8490a0;
  font-size: 11px;
}

.integration-account {
  margin: 18px 0 11px;
  color: #657486;
  font-size: 12px;
}

.permissions-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.permissions-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #536273;
  font-size: 12px;
}

.permissions-list li::before {
  width: 6px;
  height: 6px;
  content: "";
  background: #6fac99;
  border-radius: 50%;
}

.integration-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eef0f2;
}

.sync-label {
  color: #8994a0;
  font-size: 10px;
}

.policy-editor {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  padding: 13px;
  background: #f9fafb;
  border: 1px solid #eff1f3;
  border-radius: 11px;
}

.policy-editor h3 {
  margin: 0 0 2px;
  color: #657385;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.policy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 135px;
  align-items: center;
  gap: 9px;
}

.policy-row label {
  overflow: hidden;
  color: #586878;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.policy-row select {
  min-width: 0;
  padding: 5px 7px;
  color: #536273;
  background: #fff;
  border: 1px solid #dce2e7;
  border-radius: 7px;
  font-size: 10px;
}

.automation-card p {
  margin: 13px 0 15px;
  color: #6d7a89;
  font-size: 12px;
}

.automation-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #eef0f3;
  color: #85919e;
  font-size: 11px;
}

.switch-button {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  padding: 0;
  background: #d5dde2;
  border: 0;
  border-radius: 30px;
}

.switch-button::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  content: "";
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(24, 35, 48, 0.2);
  transition: 150ms ease;
}

.switch-button.active {
  background: #4c9e88;
}

.switch-button.active::after {
  transform: translateX(16px);
}

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(295px, 0.75fr) minmax(0, 1.25fr);
  gap: 20px;
}

.knowledge-form {
  display: grid;
  gap: 13px;
}

.knowledge-card h3 {
  margin: 0;
  color: #2b3948;
  font-size: 14px;
}

.knowledge-card .knowledge-type {
  display: inline-block;
  margin-top: 6px;
  color: #51756a;
  background: #edf7f3;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 650;
  padding: 2px 6px;
}

.knowledge-card p {
  margin: 12px 0 0;
  color: #697687;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.knowledge-date {
  display: block;
  margin-top: 14px;
  color: #9aa3ae;
  font-size: 10px;
}

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

.document-dropzone {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 28px 16px;
  color: #697687;
  text-align: center;
  background: #fbfcfd;
  border: 1.5px dashed #cdd6de;
  border-radius: 13px;
  cursor: pointer;
  transition: 150ms ease;
}

.document-dropzone:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.document-dropzone-icon {
  margin: 0 auto 6px;
  font-size: 18px;
  color: var(--accent);
}

.document-dropzone strong {
  color: #2b3948;
  font-size: 13px;
}

.document-dropzone span {
  font-size: 11px;
  color: #9aa3ae;
}

.document-dropzone input[type='file'] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.document-card .knowledge-heading {
  justify-content: space-between;
}

.document-status {
  color: #51756a;
  background: #edf7f3;
}

.document-status.processing {
  color: var(--blue);
  background: var(--blue-soft);
}

.document-status.failed {
  color: var(--red);
  background: var(--red-soft);
}

.document-status.empty {
  color: var(--amber);
  background: var(--amber-soft);
}

.settings-grid {
  align-items: start;
}

.settings-card.full-width {
  grid-column: 1 / -1;
}

.settings-card h2 {
  margin-bottom: 6px;
}

.settings-card > p {
  margin: 0 0 19px;
  color: #778494;
  font-size: 12px;
}

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

.form-field {
  display: grid;
  gap: 6px;
}

.form-field.wide {
  grid-column: 1 / -1;
}

.form-field label {
  color: #586676;
  font-size: 11px;
  font-weight: 680;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 10px 11px;
  color: #2f4050;
  background: #fff;
  border: 1px solid #dde3e9;
  border-radius: 9px;
  outline: 0;
}

.form-field textarea {
  min-height: 84px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: #77aa9c;
  box-shadow: 0 0 0 3px #e6f3ef;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

.instructions-editor {
  display: grid;
  gap: 9px;
}

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

.instruction-row textarea {
  min-height: 58px;
}

.text-button {
  align-self: center;
  padding: 4px;
  color: #9b4a50;
  background: transparent;
  border: 0;
  font-size: 11px;
}

.text-button:hover {
  color: var(--red);
  text-decoration: underline;
}

.security-note {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 13px;
  color: #5f706d;
  background: #f1f7f5;
  border-radius: 10px;
  font-size: 11px;
}

.security-note strong {
  color: #3e5e55;
}

.modal-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 26, 35, 0.44);
}

.modal-card {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(17, 26, 35, 0.24);
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.modal-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.toast-region {
  position: fixed;
  z-index: 20;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 9px;
  max-width: min(390px, calc(100vw - 40px));
}

.toast {
  padding: 13px 15px;
  color: #eaf4f1;
  background: #243b38;
  border-radius: 11px;
  box-shadow: 0 12px 30px rgba(18, 35, 33, 0.22);
  font-size: 12px;
}

.toast.error {
  color: #fff2f2;
  background: #8c3d46;
}

.loading-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: #52736b;
  font-size: 13px;
}

.loading-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
  place-items: center;
  border: 2px solid #d7ebe4;
  border-top-color: #478b78;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

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

  .overview-grid,
  .knowledge-layout {
    grid-template-columns: 1fr;
  }

  .welcome-card {
    min-height: 200px;
  }
}

@media (max-width: 830px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    min-height: auto;
    padding: 14px;
  }

  .sidebar .brand-on-dark,
  .workspace-chip,
  .help-card,
  .account-button {
    display: none;
  }

  .main-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
  }

  .nav-item {
    width: auto;
    min-width: max-content;
  }

  .topbar {
    min-height: 58px;
    padding: 0 20px;
  }

  .page-content {
    padding: 27px 20px 45px;
  }

  .agent-layout {
    grid-template-columns: 1fr;
  }

  .conversation-sidebar {
    min-height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .conversation-sidebar .button {
    width: fit-content;
    margin-bottom: 10px;
  }

  .conversation-list {
    display: flex;
    overflow-x: auto;
  }

  .conversation-item {
    min-width: 180px;
  }

  .messages,
  .agent-intro {
    padding-right: 20px;
    padding-left: 20px;
  }

  .agent-composer {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 620px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-intro {
    min-height: 330px;
    padding: 28px;
  }

  .login-copy {
    margin: 38px 0;
  }

  .login-copy h1 {
    font-size: 39px;
  }

  .login-panel {
    padding: 35px 24px;
  }

  .page-heading,
  .actions-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading h1 {
    font-size: 27px;
  }

  .metric-grid,
  .integration-grid,
  .automation-grid,
  .knowledge-grid,
  .settings-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .settings-card.full-width {
    grid-column: auto;
  }

  .metric-card {
    min-height: 124px;
  }

  .metric-icon {
    margin-bottom: 15px;
  }

  .topbar-right {
    display: none;
  }

  .action-card-grid {
    grid-template-columns: 1fr;
  }

  .action-card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-actions {
    width: calc(100% - 39px);
  }

  .policy-row {
    grid-template-columns: 1fr;
  }
}
.approval-command {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 18rem;
  overflow: auto;
  padding: 12px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
}
.catalog-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.catalog-entry {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border, #dce3e8);
  border-radius: 0.75rem;
}

.catalog-entry .status-pill {
  margin-left: auto;
}
