/* ============================================
   🎨 Premium Dark Theme Design System
   Chat Bot Admin Dashboard
   ============================================ */

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

/* ── 1. CSS Variables & Global Reset ── */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(30, 41, 59, 0.6);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --bg-input: rgba(15, 23, 42, 0.8);
  --border-color: rgba(148, 163, 184, 0.1);
  --border-light: rgba(148, 163, 184, 0.2);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #8b5cf6;
  --accent-2: #6366f1;
  --accent-3: #3b82f6;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.15);
  --transition: all 0.3s ease;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-3);
}

/* ── 2. Pages ── */
.page {
  display: none;
}

.page.active {
  display: flex;
}

#page-login {
  width: 100vw;
  height: 100vh;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

#page-app {
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ── 3. Login Page ── */
.login-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  will-change: transform;
}

.login-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #8b5cf6 0%, rgba(139, 92, 246, 0) 70%);
  top: -10%;
  left: -5%;
  animation: float-1 20s ease-in-out infinite;
}

.login-orb-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #3b82f6 0%, rgba(59, 130, 246, 0) 70%);
  bottom: -10%;
  right: -5%;
  animation: float-2 25s ease-in-out infinite;
}

.login-orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 70%);
  top: 40%;
  left: 45%;
  transform: translate(-50%, -50%);
  animation: float-3 15s ease-in-out infinite;
}

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  position: relative;
}

.login-card {
  width: 420px;
  padding: 40px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 20px;
  box-shadow: var(--shadow), 0 0 60px rgba(139, 92, 246, 0.08);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  font-size: 56px;
  display: block;
  margin-bottom: 16px;
  line-height: 1;
}

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

/* Role Tabs */
.login-role-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}

.role-tab {
  flex: 1;
  padding: 10px 16px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.role-tab:hover {
  color: var(--text-primary);
}

.role-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}

/* Auth Sections */
.auth-section {
  display: none;
}

.auth-section.active {
  display: block;
}

.auth-subtabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: 6px;
  padding: 3px;
  margin-bottom: 24px;
}

.auth-subtab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.auth-subtab:hover {
  color: var(--text-primary);
}

.auth-subtab.active {
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent);
}

.auth-form {
  display: none;
}

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

/* API Key Display */
.api-key-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 8px;
}

.api-key-display code {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
  line-height: 1.4;
}

.api-key-display button {
  flex-shrink: 0;
}

/* ── 4. Form Elements ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
  width: 100%;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1), var(--shadow-glow);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ── 5. Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35), var(--shadow-glow);
}

.btn-primary:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.06);
}

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

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── 6. Sidebar ── */
#sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 0;
  flex-shrink: 0;
  z-index: 20;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  font-size: 28px;
  line-height: 1;
}

.sidebar-title {
  font-weight: 700;
  font-size: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-user {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.sidebar-nav {
  list-style: none;
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  margin: 2px 0;
  font-size: 14px;
  font-weight: 400;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent);
  font-weight: 500;
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

/* ── 7. Main Content ── */
#main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  max-height: 100vh;
  background: var(--bg-primary);
}

/* ── 8. Page Header ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── 9. Stats Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
  line-height: 1.2;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── 10. Cards ── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-light);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
}

/* ── 11. Tables ── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 14px 20px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  white-space: nowrap;
}

td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-primary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ── 12. Bot Cards Grid ── */
.bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.bot-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3)) 1;
  border-image-slice: 1;
  position: relative;
}

.bot-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0);
  transition: var(--transition);
  pointer-events: none;
}

.bot-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.bot-card:hover::after {
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.08);
}

.bot-card-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.bot-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.bot-model {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.bot-persona {
  padding: 0 20px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-height: 60px;
  overflow: hidden;
  position: relative;
}

.bot-persona::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 20px;
  background: linear-gradient(to bottom, transparent, rgba(30, 41, 59, 0.8));
}

.bot-stats {
  padding: 16px 20px;
  display: flex;
  gap: 20px;
  border-top: 1px solid var(--border-color);
}

.bot-stat {
  text-align: center;
  flex: 1;
}

.bot-stat-value {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
}

.bot-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bot-actions {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
}

/* ── 13. Knowledge Section ── */
.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.knowledge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.knowledge-item:hover {
  border-color: var(--border-light);
  background: rgba(15, 23, 42, 0.9);
}

.knowledge-info {
  flex: 1;
  min-width: 0;
}

.knowledge-title {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.knowledge-preview {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 14. Chat Interface ── */

/* Two-column layout: sessions panel + chat area */
.chat-layout {
  display: flex;
  gap: 0;
  height: calc(100vh - 130px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: var(--bg-card);
}

/* Sessions Panel (left sidebar) */
.sessions-panel {
  width: 300px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.sessions-panel-header {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sessions-panel-header .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.sessions-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.sessions-loading,
.sessions-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  color: var(--text-muted);
  font-size: 13px;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 4px;
  border: 1px solid transparent;
}

.session-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-color);
}

.session-item.active {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
}

.session-info {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.session-preview {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.session-item.active .session-preview {
  color: var(--accent);
}

.session-meta {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.session-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: var(--transition);
}

.session-item:hover .session-delete {
  opacity: 0.6;
}

.session-delete:hover {
  opacity: 1 !important;
  background: rgba(239, 68, 68, 0.15);
}

/* Chat header extras */
.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header-icon {
  font-size: 20px;
}

.chat-header-title {
  font-weight: 600;
  font-size: 15px;
}

.chat-session-id {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--bg-input);
  padding: 3px 8px;
  border-radius: 4px;
}

.chat-session-id:empty {
  display: none;
}

/* Chat container (right side) */
.chat-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.chat-bot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.chat-bot-info {
  display: flex;
  flex-direction: column;
}

.chat-bot-info .chat-bot-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.chat-bot-info .chat-bot-model {
  font-size: 12px;
  color: var(--text-muted);
}

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

.chat-message {
  display: flex;
  gap: 12px;
  max-width: 80%;
  animation: message-appear 0.3s ease;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message.bot {
  align-self: flex-start;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  font-weight: 600;
  color: #fff;
}

.chat-message.user .message-avatar {
  background: linear-gradient(135deg, var(--accent-3), #2563eb);
}

.chat-message.bot .message-avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.message-content {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}

.chat-message.user .message-content {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-message.bot .message-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  background: var(--bg-secondary);
  align-items: center;
  flex-shrink: 0;
}

.chat-input-area input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

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

.chat-input-area input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.chat-input-area button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.chat-input-area button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

/* Typing Indicator */
.typing-indicator .message-content {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 16px 20px;
}

.typing-indicator .dot,
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(2),
.typing-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-indicator .dot:nth-child(3),
.typing-dot:nth-child(3) {
  animation-delay: 0.32s;
}

/* Chat Welcome */
.chat-welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-muted);
  font-size: 15px;
}

/* Chat Error */
.chat-error {
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}

/* ── Markdown in Bot Responses ── */
.chat-message.bot .message-content p {
  margin: 0 0 8px 0;
  line-height: 1.65;
}

.chat-message.bot .message-content p:last-child {
  margin-bottom: 0;
}

.chat-message.bot .message-content strong {
  color: #fff;
  font-weight: 600;
}

.chat-message.bot .message-content em {
  color: var(--text-secondary);
  font-style: italic;
}

.chat-message.bot .message-content ol,
.chat-message.bot .message-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.chat-message.bot .message-content li {
  margin: 6px 0;
  line-height: 1.6;
  padding-left: 4px;
}

.chat-message.bot .message-content li::marker {
  color: var(--accent);
}

.chat-message.bot .message-content code {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
}

.chat-message.bot .message-content pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 8px 0;
  overflow-x: auto;
}

.chat-message.bot .message-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 13px;
}

/* ── 15. Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-3);
}

/* ── 16. Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow), 0 0 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 24px;
}

/* ── 17. Toast Notifications ── */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 440px;
  animation: toast-slide-in 0.3s ease;
  font-size: 14px;
  color: var(--text-primary);
  pointer-events: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.info {
  border-left: 3px solid var(--accent-3);
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast.fade-out {
  animation: toast-fade-out 0.3s ease forwards;
}

/* ── 18. Empty States ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  line-height: 1.2;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-text {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ── 19. Loading ── */
.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 26, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── 20. Utility Classes ── */
.text-muted {
  color: var(--text-muted);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-accent {
  color: var(--accent);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

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

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hidden {
  display: none !important;
}

/* ── 21. Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.5);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

/* ── 22. Keyframe Animations ── */
@keyframes float-1 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -20px) scale(1.05);
  }
  50% {
    transform: translate(-10px, -40px) scale(0.95);
  }
  75% {
    transform: translate(20px, -10px) scale(1.02);
  }
}

@keyframes float-2 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(-25px, 15px) scale(1.03);
  }
  50% {
    transform: translate(15px, 30px) scale(0.97);
  }
  75% {
    transform: translate(-10px, 20px) scale(1.01);
  }
}

@keyframes float-3 {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  33% {
    transform: translate(-50%, -50%) translate(20px, -15px) scale(1.04);
  }
  66% {
    transform: translate(-50%, -50%) translate(-15px, 10px) scale(0.96);
  }
}

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

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-8px);
  }
}

@keyframes toast-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-fade-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

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

@keyframes message-appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── 23. Responsive Adjustments ── */
@media (max-width: 768px) {
  #sidebar {
    width: 220px;
  }
  
  #main-content {
    padding: 20px;
  }
  
  .page-header h2 {
    font-size: 22px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }
  
  .bots-grid {
    grid-template-columns: 1fr;
  }
  
  .login-card {
    width: 90%;
    max-width: 420px;
    padding: 28px;
  }
  
  .chat-message {
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  #page-app {
    flex-direction: column;
  }
  
  #sidebar {
    width: 100%;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 8px;
  }
  
  .nav-item {
    white-space: nowrap;
  }
  
  #main-content {
    max-height: none;
    padding: 16px;
  }
  
  .chat-container {
    height: calc(100vh - 200px);
  }
}

/* ================================================================
   WHATSAPP STYLES
   ================================================================ */

.wa-sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.wa-session-card {
  border-left: 4px solid var(--border);
  transition: all 0.3s ease;
}
.wa-session-card.status-connected { border-left-color: #25D366; }
.wa-session-card.status-qr { border-left-color: #f59e0b; }
.wa-session-card:hover { transform: translateY(-2px); }

.wa-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.wa-card-header h3 { margin: 0; font-size: 16px; }

.wa-badge { font-size: 12px; padding: 4px 10px; border-radius: 12px; }
.wa-badge.status-connected { background: rgba(37, 211, 102, 0.15); color: #25D366; }
.wa-badge.status-qr { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.wa-badge.status-off { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

.wa-card-body { margin-bottom: 12px; }
.wa-card-body p { margin: 4px 0; font-size: 13px; color: var(--text-secondary); }
.wa-card-body strong { color: var(--text-primary); }

.wa-card-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding-top: 12px; border-top: 1px solid var(--border);
}

/* QR Code Display */
.wa-qr-container { text-align: center; padding: 20px; }
.wa-qr-image {
  max-width: 280px; width: 100%; border-radius: 12px;
  border: 3px solid #25D366; padding: 8px; background: #fff;
}
.wa-qr-hint { margin-top: 12px; font-size: 13px; color: var(--text-secondary); }

/* Messages Modal */
.wa-msg-layout { display: flex; gap: 16px; min-height: 300px; max-height: 60vh; }
.wa-contacts-list {
  flex: 0 0 200px; border-right: 1px solid var(--border);
  padding-right: 16px; overflow-y: auto;
}
.wa-contacts-list h4 { margin: 0 0 12px; font-size: 14px; }
.wa-contact-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.wa-msg-list { flex: 1; overflow-y: auto; }
.wa-msg-list h4 { margin: 0 0 12px; font-size: 14px; }
.wa-msg-item {
  padding: 8px 12px; margin-bottom: 6px;
  border-radius: 8px; font-size: 13px;
  border-left: 3px solid transparent;
}
.wa-msg-incoming { background: rgba(37, 211, 102, 0.05); border-left-color: #25D366; }
.wa-msg-outgoing { background: rgba(99, 102, 241, 0.05); border-left-color: var(--accent); }
.wa-msg-meta { margin-bottom: 4px; font-size: 12px; }
.wa-msg-body { color: var(--text-primary); }

/* ── Embed Code ────────────────────────────────────────── */

.embed-code-section p { margin: 8px 0; }
.embed-code-box {
  background: #0d1117; border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; margin-top: 8px;
  display: flex; align-items: flex-start; gap: 12px;
}
.embed-code-box pre {
  flex: 1; margin: 0; overflow-x: auto;
  font-size: 12px; line-height: 1.6; color: #7dd3fc;
}
.embed-code-box code { font-family: 'SF Mono', 'Fira Code', monospace; }

/* ── Billing & Invoice View ───────────────────────────── */

.billing-invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}
.billing-tenant-info h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.billing-tenant-info p {
  font-size: 13px;
}
.billing-total {
  text-align: right;
}
.billing-total-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.billing-total-amount {
  display: block;
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.billing-period-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}
.billing-period-picker label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.billing-period-picker .form-input {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  min-width: 180px;
}
.billing-period-picker .form-input option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px;
}
.billing-period-picker .form-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.billing-table {
  width: 100%;
}
.billing-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 10px 14px;
}
.billing-table td {
  padding: 12px 14px;
  font-size: 14px;
}
.billing-bot-id {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: rgba(139, 92, 246, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--accent);
}
.billing-cost {
  font-weight: 600;
  color: var(--success);
}
.billing-total-row {
  border-top: 2px solid var(--border-light);
}
.billing-total-row td {
  padding-top: 16px;
  font-size: 14px;
}
.text-right {
  text-align: right;
}

/* ── Delete Channel Modal ─────────────────────────────── */

.delete-channel-warning {
  text-align: center;
  padding: 12px 0;
}
.delete-channel-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.delete-channel-warning p {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* ── Admin Billing Dashboard ──────────────────────────── */

.admin-billing-header {
  padding: 28px 32px;
}
.billing-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  width: 100%;
}
.billing-summary-item {
  text-align: center;
}
.billing-summary-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.billing-summary-value {
  display: block;
  font-size: 26px;
  font-weight: 800;
}
.billing-summary-value.revenue {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.billing-summary-value.cost {
  color: var(--text-secondary);
}
.billing-summary-value.profit {
  color: var(--success);
}
.billing-summary-value.margin {
  color: var(--warning);
}
.text-profit {
  color: var(--success) !important;
  font-weight: 600;
}
.text-loss {
  color: var(--danger) !important;
  font-weight: 600;
}
.badge-markup {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  font-weight: 600;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── Tenant Billing Detail Modal ──────────────────────── */

.admin-tenant-billing-detail {
  max-height: 60vh;
  overflow-y: auto;
}
.billing-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.billing-detail-stat {
  text-align: center;
  padding: 14px 10px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.billing-detail-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.billing-detail-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .billing-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .billing-detail-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── WhatsApp Type Selector ──────────────────────────────── */

.wa-type-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.wa-type-tab {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.wa-type-tab:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.wa-type-tab.active {
  background: var(--primary);
  color: white;
}

/* ── WhatsApp Type Badges ──────────────────────────────── */

.wa-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.wa-type-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.wa-type-baileys {
  background: rgba(37, 211, 102, 0.15);
  color: #25d366;
}

.wa-type-official {
  background: rgba(0, 122, 255, 0.15);
  color: #007aff;
}

/* ── Webhook Info ──────────────────────────────────────── */

.wa-webhook-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wa-webhook-success {
  text-align: center;
  padding: 20px;
  background: rgba(52, 199, 89, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(52, 199, 89, 0.2);
}

.wa-webhook-success .wa-webhook-check {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

.wa-webhook-success h3 {
  margin: 0 0 4px;
  color: var(--text-primary);
  font-size: 16px;
}

.wa-webhook-success p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.wa-webhook-config {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.wa-webhook-config h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text-primary);
}

.wa-webhook-url-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 4px;
}

.wa-webhook-url-box code {
  flex: 1;
  font-size: 12px;
  word-break: break-all;
  color: var(--text-primary);
}

.form-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 4px 0 0;
  opacity: 0.8;
}
