:root {
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #D1FAE5;
  --secondary: #0F172A;
  --accent: #2563EB;
  --accent-light: #DBEAFE;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --border: #E2E8F0;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --wa-bg: #EFEAE2;
  --wa-bubble-in: #FFFFFF;
  --wa-bubble-out: #D9FDD3;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, h4, .brand-title {
  font-family: 'Outfit', sans-serif;
}

/* ================= COMMON UTILITIES ================= */

.view-container {
  display: none !important;
}

#viewLanding.active {
  display: block !important;
  min-height: 100vh;
}

#viewDashboard.active {
  display: flex !important;
  flex-direction: row !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
  background: #FFF !important;
  z-index: 20 !important;
}

.hidden {
  display: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
}

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

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: 10px;
}

.btn-block {
  width: 100%;
}

.btn-emerald {
  background: var(--primary);
  color: #fff;
}

.btn-emerald:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  color: var(--secondary);
  backdrop-filter: blur(8px);
}

.btn-glass:hover {
  background: #FFF;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: #F1F5F9;
  color: var(--text-main);
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}

.btn-icon:hover {
  background: #F1F5F9;
  color: var(--text-main);
}

/* ================= PUBLIC NAVBAR & HERO ================= */

.public-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background: #FEF3C7;
  color: #92400E;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #FDE68A;
  letter-spacing: 0.5px;
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.logo-sub {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
}

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

.nav-item {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-item:hover {
  color: var(--primary);
}

/* Hero */
.hero-section {
  padding: 80px 0 60px;
  background: radial-gradient(circle at 10% 20%, rgba(5, 150, 105, 0.05) 0%, rgba(248, 250, 252, 1) 90%);
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary-hover);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 48px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  font-family: 'Outfit', sans-serif;
}

.stat-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* WhatsApp Mockup */
.wa-mockup-card {
  background: #FFF;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: 420px;
  margin: 0 auto;
}

.wa-mockup-header {
  background: #005E54;
  color: #FFF;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wa-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #E8F5E9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.wa-user-info {
  flex: 1;
}

.wa-user-info strong {
  display: block;
  font-size: 0.95rem;
}

.wa-status {
  font-size: 0.75rem;
  color: #C8E6C9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot-mini {
  width: 6px;
  height: 6px;
  background: #4CAF50;
  border-radius: 50%;
}

.wa-verified-badge {
  color: #80CBC4;
}

.wa-mockup-body {
  background-color: var(--wa-bg);
  background-image: radial-gradient(#CBD5E1 0.75px, transparent 0.75px);
  background-size: 12px 12px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.chat-bubble.incoming {
  background: var(--wa-bubble-in);
  align-self: flex-start;
  border-top-left-radius: 2px;
}

.chat-bubble.outgoing {
  background: var(--wa-bubble-out);
  align-self: flex-end;
  border-top-right-radius: 2px;
}

.chat-bubble p {
  margin-bottom: 4px;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-bubble .time {
  font-size: 0.65rem;
  color: var(--text-muted);
  float: right;
  margin-left: 12px;
  margin-top: 4px;
}

.wa-mockup-footer {
  background: #F0F2F5;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-mockup-footer input {
  flex: 1;
  background: #FFF;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.85rem;
}

.wa-send-btn {
  background: #005E54;
  color: #FFF;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Features */
.section-features {
  padding: 80px 0;
  background: #FFF;
  border-top: 1px solid var(--border);
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.badge-sub {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.section-header h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.text-center {
  text-align: center;
}

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

.feature-box {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-box h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--secondary);
}

.feature-box p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ================= MODAL LOGIN ================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: #FFF;
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalScale 0.25s ease-out;
}

.modal-lg {
  max-width: 680px;
}

@keyframes modalScale {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-icon {
  width: 52px;
  height: 52px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.form-group {
  margin-bottom: 18px;
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 6px;
}

.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-with-icon input {
  padding-left: 42px !important;
}

input[type="text"], input[type="password"], input[type="date"], textarea, select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.hint-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.alert-error {
  background: var(--danger-light);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}

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

/* ================= DASHBOARD LAYOUT ================= */

.dash-sidebar {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  height: 100vh;
  border-right: 1px solid var(--border);
  background: #FFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 16px;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.brand-symbol {
  font-size: 1.6rem;
}

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

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.nav-tab-btn:hover {
  background: #F1F5F9;
  color: var(--text-main);
}

.nav-tab-btn.active {
  background: var(--primary-light);
  color: var(--primary-hover);
}

.badge-pill {
  margin-left: auto;
  background: var(--danger);
  color: #FFF;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}

.gw-badge-box {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.gw-status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot.live {
  width: 10px;
  height: 10px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.dash-main {
  flex: 1;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
}

.tab-pane {
  display: none !important;
  height: 100%;
  width: 100%;
}

.tab-pane.active {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* ================= WA WEB STYLE LIVE INBOX ================= */

.wa-web-container {
  display: flex;
  flex: 1;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #FFF;
}

/* Column 1 */
.wa-chat-list-panel {
  width: 360px;
  min-width: 320px;
  max-width: 380px;
  height: 100%;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: #FFF;
  flex-shrink: 0;
}

.chat-list-header {
  padding: 14px 16px;
  background: #F0F2F5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.my-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.chat-search-bar {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFF;
}

.chat-search-bar input {
  border: none;
  background: #F0F2F5;
  border-radius: 8px;
  padding: 8px 12px;
}

.chat-items-list {
  flex: 1;
  overflow-y: auto;
}

.chat-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  transition: background 0.15s;
}

.chat-item-row:hover {
  background: #F8FAFC;
}

.chat-item-row.active {
  background: #F0FDF4;
  border-left: 4px solid var(--primary);
}

.chat-item-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.chat-item-meta {
  flex: 1;
  min-width: 0;
}

.chat-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.chat-item-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-item-snippet {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.chat-item-badge {
  background: var(--warning-light);
  color: var(--warning);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* Column 2: Thread View */
.wa-chat-thread-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--wa-bg);
  background-image: radial-gradient(#CBD5E1 0.75px, transparent 0.75px);
  background-size: 12px 12px;
  position: relative;
}

.thread-placeholder {
  margin: auto;
  text-align: center;
  max-width: 420px;
  padding: 40px 20px;
}

.thread-placeholder .icon-large {
  font-size: 4rem;
  margin-bottom: 16px;
}

.thread-header {
  padding: 12px 20px;
  background: #F0F2F5;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.thread-user-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.thread-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.override-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #DCFCE7;
  color: #166534;
}

.bot-status-pill.paused {
  background: #FEF3C7;
  color: #92400E;
}

.dot-mode.live {
  width: 8px;
  height: 8px;
  background: #16A34A;
  border-radius: 50%;
}

.dot-mode.paused {
  width: 8px;
  height: 8px;
  background: #D97706;
  border-radius: 50%;
}

.flagged-banner {
  background: #FEF2F2;
  border-bottom: 1px solid #FCA5A5;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #991B1B;
}

.thread-messages-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.msg-row.incoming {
  align-self: flex-start;
}

.msg-row.outgoing {
  align-self: flex-end;
}

.msg-box {
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  font-size: 0.92rem;
  position: relative;
}

.msg-row.incoming .msg-box {
  background: #FFF;
  border-top-left-radius: 2px;
}

.msg-row.outgoing .msg-box {
  background: #DCF8C6;
  border-top-right-radius: 2px;
}

.msg-sender-tag {
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.msg-sender-tag.bot {
  color: var(--primary);
}

.msg-sender-tag.admin {
  color: var(--accent);
}

.msg-meta-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.thread-footer {
  padding: 14px 20px;
  background: #F0F2F5;
  border-top: 1px solid var(--border);
}

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

.thread-footer input {
  flex: 1;
  background: #FFF;
  border-radius: 24px;
  padding: 12px 20px;
}

/* ================= KNOWLEDGE & SIMULATOR PANES ================= */

.pane-content-container {
  padding: 32px;
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  overflow-y: auto;
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.knowledge-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.kb-card {
  background: #FFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kb-card-top {
  margin-bottom: 14px;
}

.kb-badge {
  display: inline-block;
  background: #F1F5F9;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.kb-card h4 {
  font-size: 1.1rem;
  color: var(--secondary);
  margin-bottom: 8px;
}

.kb-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.kb-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid #F1F5F9;
}

.sim-wrapper {
  background: #FFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
}

.sim-chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--wa-bg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sim-input-bar {
  padding: 14px 20px;
  background: #F0F2F5;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border);
}

.sim-input-bar input {
  flex: 1;
  border-radius: 24px;
}

.spin {
  animation: spin 1s linear infinite;
}

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

/* ================= WAWAR TAYANG & GATEWAY STYLES ================= */

.gw-info-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gw-label-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #059669;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.gw-subline {
  font-size: 0.75rem;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-switch-inst {
  width: 100%;
  margin-top: 8px;
  padding: 5px 8px;
  font-size: 0.75rem;
  color: #059669;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-switch-inst:hover {
  background: #D1FAE5;
  color: #047857;
}

.header-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tayang-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: #059669;
  font-weight: 600;
}

.tayang-dot {
  width: 7px;
  height: 7px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  display: inline-block;
}

/* ================= PERSONA & 5 SCENARIOS RICH STYLES ================= */

.persona-form-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 10px;
}

.settings-card {
  background: #FFF;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #F1F5F9;
  color: var(--secondary);
}

.card-title i {
  color: var(--primary);
}

.card-title h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

.scenarios-accordion-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.scenario-card-rich {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-left: 5px solid #3B82F6;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.scenario-card-rich:hover {
  border-color: #CBD5E1;
  box-shadow: var(--shadow-sm);
}

.scenario-card-rich.marah { border-left: 5px solid #DC2626; }
.scenario-card-rich.kesal { border-left: 5px solid #EA580C; }
.scenario-card-rich.tidak_beradab { border-left: 5px solid #9333EA; }
.scenario-card-rich.asal_asalan { border-left: 5px solid #CA8A04; }
.scenario-card-rich.ngetest { border-left: 5px solid #2563EB; }
.scenario-card-rich.tanya_anggaran { border-left: 5px solid #059669; }
.scenario-card-rich.komplain_pejabat { border-left: 5px solid #7C3AED; }

.scenario-rich-header {
  padding: 16px 20px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.scenario-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scenario-badge-pill {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #DBEAFE;
}

.scenario-badge-pill.marah { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.scenario-badge-pill.kesal { background: #FFEDD5; color: #9A3412; border: 1px solid #FED7AA; }
.scenario-badge-pill.tidak_beradab { background: #F3E8FF; color: #6B21A8; border: 1px solid #E9D5FF; }
.scenario-badge-pill.asal_asalan { background: #FEF9C3; color: #854D0E; border: 1px solid #FEF08A; }
.scenario-badge-pill.ngetest { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }
.scenario-badge-pill.tanya_anggaran { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.scenario-badge-pill.komplain_pejabat { background: #EDE9FE; color: #5B21B6; border: 1px solid #DDD6FE; }

.scenario-rich-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-banner-box {
  background: #F1F5F9;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.5;
}

.info-banner-box strong {
  color: #0F172A;
  display: block;
  margin-bottom: 4px;
}

.dos-donts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 768px) {
  .dos-donts-grid {
    grid-template-columns: 1fr;
  }
}

.box-dos {
  background: #F0FDF4;
  border: 1px solid #DCFCE7;
  border-radius: 8px;
  padding: 12px 14px;
}

.box-dos h5 {
  color: #166534;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.box-dos ul, .box-donts ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.box-dos li {
  font-size: 0.82rem;
  color: #15803D;
  position: relative;
  padding-left: 16px;
}

.box-dos li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-weight: 800;
  color: #16A34A;
}

.box-donts {
  background: #FEF2F2;
  border: 1px solid #FEE2E2;
  border-radius: 8px;
  padding: 12px 14px;
}

.box-donts h5 {
  color: #991B1B;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.box-donts li {
  font-size: 0.82rem;
  color: #B91C1C;
  position: relative;
  padding-left: 16px;
}

.box-donts li::before {
  content: "✕";
  position: absolute;
  left: 0;
  font-weight: 800;
  color: #DC2626;
}

.scenario-template-area label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1E293B;
  display: block;
  margin-bottom: 6px;
}

.scenario-template-area textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  border-radius: 8px;
}

.scenario-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ================= SIMULATOR QUICK TOOLBAR ================= */

.sim-quick-toolbar {
  padding: 10px 16px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
}

.sim-quick-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  flex-shrink: 0;
}

.sim-chip-btn {
  background: #FFF;
  border: 1px solid #CBD5E1;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.sim-chip-btn:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  transform: translateY(-1px);
}

.sim-chip-btn.chip-marah:hover { background: #FEE2E2; border-color: #F87171; color: #991B1B; }
.sim-chip-btn.chip-kesal:hover { background: #FFEDD5; border-color: #FB923C; color: #9A3412; }
.sim-chip-btn.chip-kasar:hover { background: #F3E8FF; border-color: #C084FC; color: #6B21A8; }
.sim-chip-btn.chip-iseng:hover { background: #FEF9C3; border-color: #FACC15; color: #854D0E; }
.sim-chip-btn.chip-ngetest:hover { background: #DBEAFE; border-color: #60A5FA; color: #1E40AF; }
.sim-chip-btn.chip-materi:hover { background: #DCFCE7; border-color: #4ADE80; color: #166534; }

/* ================= WAWAR INSTANCE MODAL ================= */

.instance-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
  max-height: 380px;
  overflow-y: auto;
}

.instance-item-card {
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
  background: #FFF;
}

.instance-item-card.active {
  border-color: #10B981;
  background: #F0FDF4;
}

.inst-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inst-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  overflow: hidden;
}

.inst-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inst-meta strong {
  display: block;
  font-size: 0.95rem;
  color: #0F172A;
}

.inst-meta span {
  font-size: 0.8rem;
  color: #64748B;
}

.inst-meta .inst-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.inst-badge.open {
  background: #DCFCE7;
  color: #166534;
}

.inst-badge.close {
  background: #FEE2E2;
  color: #991B1B;
}

/* ================= KPI 97% FIRST CONTACT RESOLUTION BANNER ================= */

.kpi-fcr-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-fcr-card {
  background: #FFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-fcr-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-fcr-card.highlight {
  border-color: #A7F3D0;
  background: linear-gradient(135deg, #F0FDF4 0%, #FFFFFF 100%);
}

.kpi-fcr-icon {
  font-size: 2.2rem;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-fcr-card.highlight .kpi-fcr-icon {
  background: #DCFCE7;
}

.kpi-fcr-info {
  display: flex;
  flex-direction: column;
}

.kpi-fcr-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.2;
}

.kpi-fcr-card.highlight .kpi-fcr-val {
  color: #059669;
}

.kpi-fcr-lbl {
  font-size: 0.78rem;
  color: #64748B;
  font-weight: 600;
  margin-top: 2px;
}

.kb-search-container {
  margin-bottom: 24px;
}

.kb-search-container input {
  padding: 12px 16px 12px 44px !important;
  font-size: 0.95rem;
  border-radius: 10px;
  background: #FFF;
}

/* ================= MODAL DIALOGS SYSTEM (CRUD) ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  display: flex !important;
  opacity: 1;
}

.modal-card {
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-lg {
  max-width: 820px;
}

.modal-card.modal-sm {
  max-width: 480px;
}

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

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #F1F5F9;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.modal-close-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
  transform: rotate(90deg);
}

.modal-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
  background: #FAFBFD;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-header p {
  color: #64748B;
  font-size: 0.88rem;
  margin-top: 4px;
  margin-bottom: 0;
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  max-height: calc(90vh - 160px);
}

.modal-actions {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  background: #FAFBFD;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* ================= ENHANCED KB CARD CRUD ACTIONS ================= */
.kb-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
}

.kb-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.kb-card-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kb-card-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kb-status-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kb-status-pill.active {
  background: #DCFCE7;
  color: #166534;
}

.kb-status-pill.draft {
  background: #F1F5F9;
  color: #64748B;
}

.kb-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1.35;
  margin: 0;
}

.kb-card p {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

.kb-card-bottom {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kb-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-xs {
  padding: 5px 9px !important;
  font-size: 0.78rem !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.btn-xs i {
  width: 14px;
  height: 14px;
}

/* ================= REALISTIC HUMAN TYPING BUBBLE ================= */
.typing-bubble {
  padding: 12px 18px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 16px 16px 16px 4px !important;
  max-width: 320px !important;
}

.typing-header-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #059669;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 16px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  display: inline-block;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

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

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1.15);
    opacity: 1;
  }
}

/* Detail modal styles */
.kb-detail-section {
  margin-bottom: 20px;
}
.kb-detail-section label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748B;
  margin-bottom: 6px;
}
.kb-detail-content-box {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #1E293B;
  white-space: pre-wrap;
  max-height: 350px;
  overflow-y: auto;
}
.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.keyword-tag {
  background: #EEF2F6;
  color: #334155;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* ================= AVATAR & PHONE ENHANCEMENTS ================= */
.chat-item-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #E2E8F0;
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.chat-item-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  z-index: 2;
}

.chat-item-avatar-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E2E8F0;
  color: #334155;
  font-weight: 700;
  font-size: 1.15rem;
  border-radius: 50%;
  z-index: 1;
}

.chat-item-phone {
  font-size: 0.78rem;
  color: #059669;
  font-weight: 600;
  margin-bottom: 2px;
  letter-spacing: 0.2px;
}

.thread-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #CBD5E1;
  display: block;
  flex-shrink: 0;
  overflow: hidden;
}

.active-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  z-index: 2;
}

.active-avatar-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #CBD5E1;
  color: #1E293B;
  font-weight: 700;
  font-size: 1.15rem;
  border-radius: 50%;
  z-index: 1;
}

/* ================= CONTEXT GRAPH & CITIZEN MEMORY ================= */
.graph-query-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.graph-query-results {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
}

.graph-query-results h4 {
  font-size: 0.95rem;
  color: #166534;
  margin-bottom: 10px;
}

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

.triplet-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  background: #FFF;
  border: 1px solid #BBF7D0;
  padding: 8px 12px;
  border-radius: 6px;
  color: #1E293B;
}

.triplet-sub, .triplet-obj {
  font-weight: 700;
  color: #065F46;
}

.triplet-pred {
  color: #2563EB;
  font-size: 0.82rem;
  background: #EFF6FF;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.graph-split-view {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  flex: 1;
  min-height: 520px;
}

.graph-canvas-container {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.graph-canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

#graphCanvas {
  width: 100%;
  height: 480px;
  border-radius: 8px;
  background: #FAFAFA;
  border: 1px dashed #E2E8F0;
  cursor: grab;
}

#graphCanvas:active {
  cursor: grabbing;
}

.graph-memory-container {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  max-height: 570px;
  overflow: hidden;
}

.graph-memory-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.memory-card-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.memory-card {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  transition: all 0.2s;
}

.memory-card:hover {
  border-color: #10B981;
  box-shadow: var(--shadow-sm);
}

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

.memory-user-name {
  font-weight: 700;
  color: var(--secondary);
  font-size: 0.92rem;
}

.memory-user-phone {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
}

.memory-interactions-badge {
  font-size: 0.72rem;
  background: #E0E7FF;
  color: #3730A3;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}

.memory-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0;
}

.memory-topic-tag {
  background: #D1FAE5;
  color: #065F46;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.memory-last-q {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px dashed #E2E8F0;
  padding-top: 6px;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= DRAG & DROP HUB & NEWS INGESTION ================= */
.kb-dropzone-card {
  background: #FFFFFF;
  border: 2px dashed #CBD5E1;
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 24px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.kb-dropzone-card.drag-active {
  border-color: #10B981;
  background: #ECFDF5;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.15);
  transform: translateY(-2px);
}

.dropzone-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.dropzone-icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #E6F4EA;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropzone-icon-badge svg {
  width: 32px;
  height: 32px;
}

.dropzone-text h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 4px;
}

.dropzone-text p {
  font-size: 0.88rem;
  color: #64748B;
  margin: 0 0 12px;
}

.dropzone-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: #94A3B8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.dropzone-divider::before,
.dropzone-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #E2E8F0;
}

.dropzone-divider span {
  padding: 0 14px;
}

.news-url-ingest-bar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dropzone-status {
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
}

.dropzone-status.loading {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.dropzone-status.success {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.dropzone-status.error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

@media (max-width: 768px) {
  .dropzone-inner {
    flex-direction: column;
    text-align: center;
  }
  .news-url-ingest-bar {
    flex-direction: column;
    align-items: stretch;
  }
}



