@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@500;600;700&display=swap');

:root {
  --peach: #f97316;
  --rose: #fb7185;
  --cream: #fff3ec;
  --ink: #2f0f05;
  --muted: #87412d;
  --white: #ffffff;
  --border: rgba(249, 115, 22, 0.16);
  --shadow-soft: 0 24px 60px rgba(249, 115, 22, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at -10% -10%, rgba(251, 113, 133, 0.35), transparent 50%),
    radial-gradient(circle at 110% 0%, rgba(249, 115, 22, 0.28), transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(249, 115, 22, 0.15), transparent 60%),
    #fff7f3;
  animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 7vw 12px;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #f97316);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.28);
}

.brand-word {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}





.session-status {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 0.95rem;
  color: var(--muted);
}

.app-nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.16);
  box-shadow: 0 12px 30px rgba(249, 115, 22, 0.15);
}

.nav-link {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background: rgba(249, 115, 22, 0.12);
  color: var(--peach);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(251, 113, 133, 0.28));
  color: var(--ink);
}

.muted {
  color: rgba(135, 65, 45, 0.75);
}

.session-status strong {
  font-weight: 700;
  color: var(--ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(251, 113, 133, 0.16));
  color: var(--peach);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.15);
  transition: all 0.3s ease;
  animation: badgePop 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes badgePop {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.badge:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.app-main {
  padding: 10px 7vw 60px;
}

#setup-view {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  gap: 36px;
}

@media (max-width: 960px) {
  #setup-view {
    grid-template-columns: 1fr;
  }
}

.progress {
  position: sticky;
  top: 32px;
  display: grid;
  gap: 18px;
  align-self: start;
}

.progress-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.progress-step::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(251, 113, 133, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.progress-step:hover::before {
  opacity: 1;
}

.progress-step.active {
  transform: translateX(8px) scale(1.02);
  box-shadow: 0 32px 70px rgba(249, 115, 22, 0.35);
  border-color: rgba(249, 115, 22, 0.3);
  animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
  0%, 100% { box-shadow: 0 32px 70px rgba(249, 115, 22, 0.35); }
  50% { box-shadow: 0 32px 70px rgba(249, 115, 22, 0.45), 0 0 30px rgba(249, 115, 22, 0.2); }
}

.progress-step.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.progress-number {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(251, 113, 133, 0.18));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--peach);
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.progress-step.active .progress-number {
  background: linear-gradient(135deg, var(--peach), var(--rose));
  color: white;
  box-shadow: 0 8px 16px rgba(249, 115, 22, 0.3);
  transform: scale(1.1);
}

.progress-step:hover .progress-number {
  transform: scale(1.05);
}

.progress-step h3 {
  font-family: 'Manrope', sans-serif;
  margin: 0;
  font-size: 1rem;
}

.progress-step p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.stage {
  display: grid;
  gap: 24px;
}

.stage-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  padding: 32px;
  position: relative;
  overflow: hidden;
  animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stage-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--peach), var(--rose), var(--peach));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.stage-card header {
  display: grid;
  gap: 6px;
  margin-bottom: 24px;
}

.stage-card header h2 {
  font-family: 'Manrope', sans-serif;
  margin: 0;
  font-size: 1.6rem;
}

.stage-card header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

input,
textarea,
select {
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 16px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.92);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 16px;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--peach), var(--rose));
  color: var(--white);
  box-shadow: 0 24px 50px rgba(249, 115, 22, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 28px 60px rgba(249, 115, 22, 0.45);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background: transparent;
  color: var(--peach);
  border: 1px solid rgba(249, 115, 22, 0.5);
  position: relative;
  overflow: hidden;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(251, 113, 133, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  border-color: var(--peach);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.2);
}

.btn-secondary:hover::before {
  opacity: 1;
}

.btn-warning {
  position: relative;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(249, 115, 22, 0.95));
  color: #fff;
  border: none;
  overflow: hidden;
}

.btn-warning::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(252, 165, 165, 0.35), rgba(254, 202, 202, 0.2));
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(6px);
}

.btn-warning:hover::before {
  opacity: 1;
  transform: translateY(0);
}

.step-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.knowledge-card {
  padding: 18px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 247, 243, 0.95), rgba(255, 255, 255, 0.9));
  display: grid;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: cardSlideIn 0.5s ease-out;
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.knowledge-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.3);
}

.knowledge-card h4 {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
}

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

.knowledge-method {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.14);
  color: var(--peach);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.knowledge-preview {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(47, 15, 5, 0.78);
}

.knowledge-meta {
  margin: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.knowledge-meta div {
  display: grid;
  gap: 4px;
}

.knowledge-meta dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(47, 15, 5, 0.62);
}

.knowledge-meta dd {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
}

.knowledge-meta code {
  background: rgba(47, 15, 5, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.78rem;
}

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

.btn-tertiary {
  background: rgba(47, 15, 5, 0.08);
  color: var(--ink);
  border: none;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-tertiary:hover {
  background: rgba(47, 15, 5, 0.12);
}

.btn-tertiary.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.btn-tertiary.danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.ingest-options {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 18px;
}

.ingest-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(249, 115, 22, 0.12);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.ingest-card h4 {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
}

.btn-compact {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.status-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

.inbox-view {
  display: grid;
  gap: 24px;
  grid-template-rows: auto 1fr;
}

.inbox-view.hidden {
  display: none;
}

.inbox-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 247, 243, 0.95));
  border: 1px solid rgba(249, 115, 22, 0.2);
  box-shadow: var(--shadow-soft), 0 0 40px rgba(249, 115, 22, 0.1);
  gap: 24px;
  position: relative;
  overflow: hidden;
}

.inbox-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--peach), var(--rose), var(--peach));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

.inbox-header h2 {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1.5rem;
}

.inbox-filters {
  display: flex;
  align-items: center;
  gap: 18px;
}

.select-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.2);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 247, 243, 0.9));
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.1);
}

.select-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.3);
}

.select-pill select {
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  outline: none;
}

.inbox-counts {
  display: inline-flex;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.inbox-counts strong {
  color: var(--ink);
}

.inbox-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(220px, 280px);
  gap: 24px;
  min-height: 460px;
}

@media (max-width: 1080px) {
  .inbox-layout {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }
  .inbox-timeline {
    display: none;
  }
}

@media (max-width: 820px) {
  .inbox-layout {
    grid-template-columns: 1fr;
  }
  .inbox-sidebar {
    order: 2;
  }
  .inbox-content {
    order: 1;
  }
}

.inbox-sidebar {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 247, 243, 0.95));
  border-radius: 20px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12), 0 0 30px rgba(249, 115, 22, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
}

.inbox-sidebar:hover {
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15), 0 0 40px rgba(249, 115, 22, 0.12);
}

.inbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 640px;
  overflow-y: auto;
}

.inbox-item {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.inbox-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(135deg, var(--peach), var(--rose));
  transition: width 0.3s ease;
}

.inbox-item:hover {
  background: rgba(249, 115, 22, 0.08);
  transform: translateX(4px);
}

.inbox-item:hover::before {
  width: 3px;
}

.inbox-item.active {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.15), rgba(251, 113, 133, 0.08));
  border-left: 4px solid var(--peach);
  padding-left: 14px;
  transform: translateX(0);
  box-shadow: inset 0 0 20px rgba(249, 115, 22, 0.1);
}

.inbox-item.active::before {
  width: 4px;
}

.inbox-item.live-chat::before {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.45), rgba(14, 165, 233, 0.3));
}

.inbox-item.live-chat:hover {
  background: rgba(14, 165, 233, 0.1);
}

.inbox-item.live-chat .inbox-item-flags .badge-live {
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.25);
}

.inbox-item h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.inbox-item p {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(15, 23, 42, 0.65);
}

.inbox-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.55);
}

.inbox-content {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 243, 0.98));
  border-radius: 20px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.14), 0 0 40px rgba(249, 115, 22, 0.08);
  padding: 22px 24px 28px;
  display: grid;
  gap: 18px;
  min-height: 420px;
  position: relative;
  overflow: hidden;
}

.inbox-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--peach), var(--rose), transparent);
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
}

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

.conversation-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-family: 'Manrope', sans-serif;
}

.conversation-body {
  display: grid;
  gap: 16px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 8px;
}

.message-bubble {
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(251, 113, 133, 0.06));
  border: 1px solid rgba(249, 115, 22, 0.2);
  font-size: 0.9rem;
  line-height: 1.5;
  transition: all 0.3s ease;
  animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.15);
}

.message-bubble.agent {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(59, 130, 246, 0.08));
  border-color: rgba(37, 99, 235, 0.25);
}

.message-bubble.agent:hover {
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}

.message-meta {
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.55);
  margin-bottom: 6px;
}

.reply-form {
  display: grid;
  gap: 10px;
}

.reply-form textarea {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  padding: 12px 14px;
  font-family: 'Inter', sans-serif;
  resize: vertical;
  min-height: 100px;
}

.reply-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reply-status {
  font-size: 0.8rem;
}

.inbox-timeline {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 247, 243, 0.95));
  border-radius: 20px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12), 0 0 30px rgba(249, 115, 22, 0.08);
  padding: 20px;
  display: grid;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.inbox-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--peach), var(--rose), transparent);
  background-size: 100% 200%;
  animation: timelineFlow 4s linear infinite;
}

@keyframes timelineFlow {
  0% { background-position: 0 -200%; }
  100% { background-position: 0 200%; }
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  max-height: 520px;
  overflow-y: auto;
}

.timeline-item {
  border-left: 3px solid var(--peach);
  padding-left: 12px;
  display: grid;
  gap: 4px;
  position: relative;
  transition: all 0.3s ease;
  animation: timelineItemFade 0.5s ease-out;
}

@keyframes timelineItemFade {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--peach), var(--rose));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 10px rgba(249, 115, 22, 0.3);
  animation: timelineDot 2s ease-in-out infinite;
}

@keyframes timelineDot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 15px rgba(249, 115, 22, 0.5); }
}

.timeline-item:hover {
  transform: translateX(4px);
  border-left-color: var(--rose);
}

.timeline-item time {
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.55);
}

.blank-state {
  text-align: center;
  color: rgba(15, 23, 42, 0.6);
  margin: auto;
  display: grid;
  gap: 8px;
}

.setup-section {
  margin-top: 28px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 18px 20px;
  display: grid;
  gap: 18px;
}

.setup-section-header h3 {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1.05rem;
}

.setup-section-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

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

.guardrail-item {
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 14px;
  background: rgba(255, 247, 243, 0.65);
}

.guardrail-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.guardrail-header h4 {
  margin: 0;
  font-size: 1rem;
}

.guardrail-header small {
  color: var(--muted);
  font-size: 0.75rem;
}

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

.guardrail-grid label,
.guardrail-item label,
.guardrail-create label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.guardrail-item input,
.guardrail-item select,
.guardrail-create input {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: 'Inter', sans-serif;
}

.guardrail-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.guardrail-create {
  border: 1px dashed rgba(249, 115, 22, 0.3);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 14px;
  background: rgba(249, 115, 22, 0.05);
}

.guardrail-create h4 {
  margin: 0;
  font-size: 0.95rem;
  font-family: 'Manrope', sans-serif;
}

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

.guardrail-create-options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}

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

.connector-form fieldset {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.8);
}

.connector-form legend {
  font-weight: 600;
  font-size: 0.9rem;
}

.connector-toggle {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.connector-form input[type="text"],
.connector-form input[type="email"] {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: 'Inter', sans-serif;
}

.embed-snippet {
  background: #1f2937;
  color: #f8fafc;
  border-radius: 18px;
  padding: 20px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  word-break: break-all;
}

.embed-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.preview-frame {
  width: 100%;
  border: 1px solid rgba(249, 115, 22, 0.22);
  border-radius: 20px;
  min-height: 340px;
  box-shadow: var(--shadow-soft), 0 0 40px rgba(249, 115, 22, 0.1);
  background: #fff;
  transition: all 0.3s ease;
}

.preview-frame:hover {
  box-shadow: var(--shadow-soft), 0 0 60px rgba(249, 115, 22, 0.15);
  transform: scale(1.01);
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding: 0;
  list-style: none;
}

.suggestions li {
  background: rgba(249, 115, 22, 0.14);
  color: var(--peach);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.helper-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

.alert {
  background: rgba(251, 113, 133, 0.12);
  color: #c2410c;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.9rem;
}

.success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.1));
  color: #166534;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.9rem;
  border: 1px solid rgba(34, 197, 94, 0.2);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
  animation: successPop 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes successPop {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.knowledge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

.knowledge-helper {
  margin-top: 12px;
  font-size: 0.9rem;
}

.knowledge-success {
  margin-top: 12px;
}

.knowledge-guide {
  margin-top: 18px;
  padding: 18px;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 18px;
  display: grid;
  gap: 8px;
}

/* New Onboarding Styles */

.preview-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

@media (max-width: 960px) {
  .preview-container {
    grid-template-columns: 1fr;
  }
}

.preview-live {
  display: grid;
  gap: 12px;
}

.preview-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.preview-label strong {
  color: var(--ink);
  font-weight: 700;
}

.live-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.2), 0 0 15px rgba(16, 185, 129, 0.4);
  }
}

.customize-panel {
  padding: 24px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.06), rgba(251, 113, 133, 0.04));
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.customize-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(249, 115, 22, 0.08), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.customize-panel:hover::before {
  opacity: 1;
}

.customize-panel:hover {
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.15);
  transform: translateY(-2px);
}

.customize-panel h3 {
  margin: 0 0 16px 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1.1rem;
}

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

.form-row-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-compact label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-full {
  width: 100%;
}

.knowledge-status {
  margin-bottom: 20px;
}

.status-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(34, 197, 94, 0.2);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(16, 185, 129, 0.06));
  transition: all 0.3s ease;
  animation: statusSlideIn 0.5s ease-out;
}

@keyframes statusSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.status-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
}

.status-card svg {
  flex-shrink: 0;
  color: #10b981;
  margin-top: 2px;
}

.status-card strong {
  display: block;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.status-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.add-source-toggle {
  margin: 20px 0;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.add-source-toggle summary {
  font-weight: 600;
  color: var(--peach);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.add-source-toggle summary::-webkit-details-marker {
  display: none;
}

.add-source-toggle[open] {
  border-style: solid;
  background: rgba(249, 115, 22, 0.04);
}

.add-source-toggle[open] summary {
  margin-bottom: 16px;
}

.deploy-grid {
  display: grid;
  gap: 24px;
  margin-top: 20px;
}

.deploy-section {
  padding: 20px;
  background: rgba(249, 115, 22, 0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.deploy-section h3 {
  margin: 0 0 8px 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1.1rem;
}

.section-description {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: var(--muted);
}

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

.stats-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.stat-card {
  padding: 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--peach);
  font-family: 'Manrope', sans-serif;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.next-steps-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.next-step-card {
  display: flex;
  gap: 16px;
  padding: 18px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform 0.2s ease;
}

.next-step-card:hover {
  transform: translateY(-2px);
}

.step-icon {
  font-size: 2rem;
  line-height: 1;
}

.next-step-card strong {
  display: block;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.next-step-card p {
  margin: 0 0 10px 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

input[type="color"] {
  height: 48px;
  cursor: pointer;
}

.knowledge-guide strong {
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
}

.knowledge-guide ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.knowledge-footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.btn.pulse {
  animation: pulse 0.6s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}


.modal-open {
  overflow: hidden;
}

.auth-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-modal[hidden] {
  display: none;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
}

.auth-dialog {
  position: relative;
  width: min(420px, 92vw);
  background: #ffffff;
  border-radius: 24px;
  padding: 28px 28px 32px;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.22);
  display: grid;
  gap: 18px;
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #94a3b8;
}

.auth-tabs {
  display: inline-flex;
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 12px;
  overflow: hidden;
}

.auth-tabs button {
  border: none;
  background: transparent;
  padding: 10px 18px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--muted);
  cursor: pointer;
}

.auth-tabs button.active {
  background: rgba(249, 115, 22, 0.12);
  color: var(--peach);
}

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

.auth-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--ink);
}

.auth-form input,
.auth-form select {
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: rgba(255, 255, 255, 0.95);
}

.auth-feedback {
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.auth-feedback[data-tone="error"] {
  background: rgba(248, 113, 113, 0.12);
  color: #b91c1c;
}

.auth-feedback[data-tone="success"] {
  background: rgba(34, 197, 94, 0.18);
  color: #166534;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links .nav-cta {
  margin-left: auto;
}

.link-button {
  background: none;
  border: none;
  color: var(--peach);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.link-button:hover {
  opacity: 0.85;
}


.launch-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.launch-metrics, .launch-drafts, .launch-knowledge {
  display: grid;
  gap: 12px;
}

.launch-card {
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 247, 243, 0.92);
  box-shadow: 0 18px 36px rgba(249, 115, 22, 0.14);
}

.launch-card h4 {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
}

.launch-drafts article {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  display: grid;
  gap: 10px;
}

.launch-drafts small {
  color: #64748b;
  font-size: 0.8rem;
}

.launch-knowledge .knowledge-card {
  background: rgba(255, 247, 243, 0.9);
}

#launch-open-dashboard {
  min-width: 220px;
}

#launch-success {
  margin-top: 12px;
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.9rem;
}

#knowledge-continue {
  min-width: 220px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.08);
  color: var(--peach);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-channel {
  background: rgba(249, 115, 22, 0.12);
  color: var(--peach);
}

.badge-priority-high {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.badge-priority-low {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.badge-sla {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.badge-sla-breached {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.badge-connector {
  background: rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.7);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.badge-connector-connected {
  background: rgba(34, 197, 94, 0.16);
  color: #047857;
}

.badge-connector-pending {
  background: rgba(249, 115, 22, 0.16);
  color: var(--peach);
}

.badge-connector-error {
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.75);
}

.status-chip.status-open {
  background: rgba(34, 197, 94, 0.12);
  color: #047857;
}

.status-chip.status-pending {
  background: rgba(249, 115, 22, 0.12);
  color: var(--peach);
}

.status-chip.status-snoozed {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.status-chip.status-resolved {
  background: rgba(37, 99, 235, 0.1);
  color: #1e3a8a;
}

.inbox-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.inbox-item-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.inbox-item-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(15, 23, 42, 0.65);
}

.inbox-item-assignee {
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.65);
}

.inbox-item.sla-breached {
  border-left: 4px solid #dc2626;
}

.conversation-overview {
  display: grid;
  gap: 6px;
}

.conversation-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.conversation-customer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.65);
}

.conversation-customer span {
  padding-left: 12px;
  position: relative;
}

.conversation-customer span::before {
  content: '•';
  position: absolute;
  left: 0;
  color: rgba(15, 23, 42, 0.4);
}

.conversation-controls {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.conversation-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.6);
}

.conversation-field select {
  border-radius: 10px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  padding: 6px 10px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
}

.conversation-sla {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(249, 115, 22, 0.12);
  color: var(--peach);
  font-size: 0.8rem;
  font-weight: 600;
}

.conversation-sla.breached {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.reply-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.reply-mode {
  display: inline-flex;
  align-items: center;
  background: rgba(249, 115, 22, 0.12);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.reply-mode-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.55);
  cursor: pointer;
}

.reply-mode-btn.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.2);
}

.reply-context {
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.55);
}

.reply-form-note textarea {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.2);
}

.message-bubble.internal {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.18);
}

.message-label {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.12);
  color: rgba(15, 23, 42, 0.7);
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.message-delivery {
  margin-left: 8px;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.55);
}

.timeline-type {
  font-weight: 600;
  color: rgba(15, 23, 42, 0.65);
}

.timeline-title {
  font-weight: 600;
  color: var(--ink);
  margin-top: 4px;
}

.timeline-description {
  font-size: 0.8rem;
  color: rgba(15, 23, 42, 0.65);
  margin-top: 4px;
}

.team-section {
  margin-top: 32px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  display: grid;
  gap: 18px;
}

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

.team-invite-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.team-invite-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.65);
}

.team-invite-form input,
.team-invite-form select {
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  padding: 10px 12px;
  font-size: 0.9rem;
}

.team-invite-form button {
  align-self: end;
  min-width: 160px;
}

.team-invite-status {
  font-size: 0.85rem;
  color: #b91c1c;
}

.team-invite-status.success {
  color: #047857;
}

.team-table-wrapper {
  border-radius: 16px;
  border: 1px solid rgba(249, 115, 22, 0.16);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
}

.team-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
}

.team-table-wrapper th,
.team-table-wrapper td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(249, 115, 22, 0.12);
}

.team-table-wrapper tbody tr:hover {
  background: rgba(249, 115, 22, 0.08);
}

.actions-col {
  width: 120px;
}

.team-name {
  font-weight: 600;
  color: var(--ink);
}

.team-email {
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.6);
}

.badge-role-agent {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.badge-role-lead {
  background: rgba(249, 115, 22, 0.16);
  color: var(--peach);
}

.badge-role-admin {
  background: rgba(76, 29, 149, 0.12);
  color: #5b21b6;
}

.badge-role-super_admin {
  background: rgba(15, 23, 42, 0.18);
  color: #111827;
}

.badge-status-invited {
  background: rgba(249, 115, 22, 0.12);
  color: var(--peach);
}

.badge-status-active {
  background: rgba(34, 197, 94, 0.12);
  color: #047857;
}

.badge-status-suspended {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.team-table-wrapper button.link-button {
  padding: 0;
  font-size: 0.8rem;
}

.connector-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(15, 23, 42, 0.6);
  margin-top: 8px;
}

.connector-summary code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.06);
}

.connector-hint {
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.55);
  margin-top: 6px;
}

.admin-view {
  display: grid;
  gap: 24px;
}

.admin-view.hidden {
  display: none;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-summary {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.admin-summary-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  padding: 16px;
  display: grid;
  gap: 6px;
  box-shadow: 0 16px 36px rgba(249, 115, 22, 0.18);
}

.admin-summary-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(15, 23, 42, 0.65);
}

.admin-summary-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
}

.admin-panels {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.admin-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  box-shadow: var(--shadow-soft);
  padding: 20px;
  display: grid;
  gap: 16px;
}

.admin-card-header h3 {
  margin: 0;
  font-family: 'Manrope', sans-serif;
}

.admin-table-wrapper {
  border-radius: 16px;
  border: 1px solid rgba(249, 115, 22, 0.16);
  overflow: hidden;
}

.admin-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table-wrapper th,
.admin-table-wrapper td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(249, 115, 22, 0.12);
  font-size: 0.85rem;
}

.admin-table-wrapper tbody tr:hover {
  background: rgba(249, 115, 22, 0.08);
}

.admin-empty {
  padding: 16px;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.6);
}

.badge-muted {
  background: rgba(148, 163, 184, 0.14);
  color: rgba(15, 23, 42, 0.6);
  box-shadow: none;
}

.badge-live {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(14, 165, 233, 0.2));
  color: #0ea5e9;
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.2);
}

.badge-status-active {
  background: rgba(34, 197, 94, 0.15);
  color: #166534;
}

.badge-status-suspended {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.badge-implementation-implemented {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.badge-implementation-missing {
  background: rgba(234, 179, 8, 0.15);
  color: #92400e;
}

.badge-implementation-error,
.badge-implementation-no_url {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.badge-implementation-unknown {
  background: rgba(148, 163, 184, 0.18);
  color: rgba(15, 23, 42, 0.55);
}

.admin-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
}

.admin-modal-dialog {
  position: relative;
  width: min(680px, 92vw);
  max-height: min(90vh, 760px);
  overflow: hidden;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 40px 120px rgba(15, 23, 42, 0.35);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.admin-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px;
  gap: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

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

.admin-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: grid;
  gap: 24px;
}

.admin-modal-section {
  display: grid;
  gap: 14px;
}

.admin-modal-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-modal-footer {
  padding: 20px 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(248, 250, 252, 0.85);
}

.admin-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  color: rgba(15, 23, 42, 0.7);
  cursor: pointer;
  transition: background 0.2s ease;
}

.admin-modal-close:hover {
  background: rgba(148, 163, 184, 0.28);
}

.admin-detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.admin-detail-list div {
  display: grid;
  gap: 4px;
}

.admin-detail-list dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(15, 23, 42, 0.55);
}

.admin-detail-list dd {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.9);
}

.admin-connector-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.admin-connector-list li {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-modal-feedback {
  padding: 16px 24px;
  font-size: 0.9rem;
  color: #166534;
  background: rgba(34, 197, 94, 0.12);
  border-top: 1px solid rgba(34, 197, 94, 0.2);
}

.admin-modal-feedback[hidden] {
  display: none;
}

.admin-modal-button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-user-edit {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.admin-user-edit .input-label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.6);
}

.admin-user-edit select {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: 'Inter', sans-serif;
}

.admin-connector-list .badge {
  margin-left: auto;
}

.admin-modal-body::-webkit-scrollbar {
  width: 6px;
}

.admin-modal-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}
