:root {
  --bg-dark: #090d16;
  --bg-card: #131c2e;
  --bg-card-hover: #1e293b;
  --bg-sidebar: #0a0f1d;
  --bg-glass: rgba(19, 28, 46, 0.75);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;
  --border-color: #243046;
  --border-subtle: #172236;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========================================================
   MODAL DE LOGIN
======================================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #131e36 0%, #060911 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  animation: fadeInDown 0.3s ease-out;
}

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

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

.login-header h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  letter-spacing: 1.5px;
  font-size: 24px;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-error-msg {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 12px;
}

.login-quick-roles {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.quick-title {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 12px;
}

.role-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-role-quick {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.btn-role-quick:hover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  transform: translateY(-2px);
}

.btn-role-quick strong {
  font-size: 13px;
  color: #38bdf8;
}

.btn-role-quick small {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========================================================
   LAYOUT & SIDEBAR
======================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: white;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.brand-info h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-info span {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
}

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

.nav-item.active {
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.2) 0%, rgba(2, 132, 199, 0.05) 100%);
  color: #38bdf8;
  border-left: 3px solid #38bdf8;
}

.badge-counter {
  margin-left: auto;
  background: var(--accent-primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.connection-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.status-indicator-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
}

.status-dot.connected {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.status-text {
  font-size: 13px;
  font-weight: 600;
}

/* ========================================================
   MAIN CONTENT & TOPBAR
======================================================== */
.main-content {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
  background: radial-gradient(circle at 90% 10%, rgba(2, 132, 199, 0.05) 0%, transparent 50%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.topbar h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
}

.subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

.topbar-user-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 30px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-primary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: white;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
}

.user-role-tag {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

/* ========================================================
   CARDS & STATS GRID
======================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

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

.card-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 600;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  display: block;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
  margin: 2px 0;
}

.stat-help {
  font-size: 11px;
  color: var(--text-muted);
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chart-card {
  min-height: 350px;
}

.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

/* ========================================================
   TAB 2: CENTRO DE CHATS (OMNICANAL 3 COLUMNAS)
======================================================== */
.chat-center-layout {
  display: grid;
  grid-template-columns: 320px 1fr 290px;
  gap: 18px;
  height: calc(100vh - 120px);
}

/* Columna 1: Lista de Chats */
.chat-list-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-list-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-sidebar);
}

.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.chip.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.chat-conversations-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.chat-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.chat-item.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.chat-avatar-wrapper {
  position: relative;
}

.chat-item-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #334155;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.ai-status-dot-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.ai-status-dot-indicator.active {
  background: var(--accent-emerald);
}

.ai-status-dot-indicator.inactive {
  background: #ef4444;
}

.chat-item-info {
  flex: 1;
  overflow: hidden;
}

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

.chat-item-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.chat-item-preview {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-tags {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

/* Columna 2: Ventana de Chat */
.chat-thread-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.empty-thread-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.thread-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.thread-customer-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.customer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #047857);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
}

.thread-sub-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.thread-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toggle-control-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

.toggle-label {
  font-size: 12px;
  font-weight: 600;
}

.toggle-status-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-emerald);
}

.thread-inactivity-banner {
  background: rgba(2, 132, 199, 0.1);
  border-bottom: 1px solid rgba(2, 132, 199, 0.2);
  padding: 8px 16px;
  font-size: 12px;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.thread-messages-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.5) 0%, rgba(9, 13, 22, 0.9) 100%);
}

.msg-bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
}

.msg-bubble.user {
  align-self: flex-start;
  background: #1e293b;
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.msg-bubble.model {
  align-self: flex-end;
  background: linear-gradient(135deg, #0369a1, #0284c7);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}

.msg-bubble.agent {
  align-self: flex-end;
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.msg-sender-tag {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.85;
}

.msg-time {
  display: block;
  font-size: 10px;
  text-align: right;
  margin-top: 4px;
  opacity: 0.7;
}

.thread-input-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-sidebar);
}

.thread-input-form {
  display: flex;
  gap: 12px;
}

.thread-input-form input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 12px 20px;
  color: white;
  font-size: 14px;
  outline: none;
}

.thread-input-form input:focus {
  border-color: var(--accent-cyan);
}

/* Columna 3: Ficha del Lead */
.chat-dossier-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  overflow-y: auto;
}

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

.dossier-header h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
}

.dossier-item {
  margin-bottom: 14px;
}

.dossier-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 3px;
}

.dossier-value {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* ========================================================
   KNOWLEDGE BASE (EXCEL IA)
======================================================== */
.knowledge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(0, 0, 0, 0.15);
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.05);
}

.dropzone-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.knowledge-files-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.knowledge-file-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}

.knowledge-file-meta strong {
  font-size: 13.5px;
  display: block;
  color: #38bdf8;
}

.knowledge-file-meta small {
  color: var(--text-muted);
  font-size: 11px;
}

.knowledge-preview-pre {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: monospace;
  font-size: 12px;
  color: #a5f3fc;
  max-height: 350px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ========================================================
   TABLAS Y FORMULARIOS
======================================================== */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

input[type="text"], input[type="password"], input[type="email"], input[type="number"], select {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

input:focus, select:focus {
  border-color: var(--accent-cyan);
}

/* Switch Toggles */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
}

input:checked + .slider {
  background-color: var(--accent-emerald);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* ========================================================
   BOTONES & BADGES
======================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  color: white;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: #475569;
}

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

.btn-icon {
  padding: 8px;
  border-radius: 50%;
}

.btn-block {
  width: 100%;
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid var(--accent-rose);
  color: var(--accent-rose);
}

.btn-outline-danger:hover {
  background: var(--accent-rose);
  color: white;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-dark);
  color: var(--text-secondary);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-outline {
  border: 1px solid var(--border-color);
}

/* ========================================================
   MODAL DIALOGS
======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 20px;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow);
}

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

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
}

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

/* ========================================================
   SIMULADOR PHONE FRAME
======================================================== */
.simulator-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  max-width: 950px;
  margin: 0 auto;
}

.simulator-phone-frame {
  background: #000;
  border-radius: 36px;
  border: 4px solid #334155;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  height: 560px;
  overflow: hidden;
}

.simulator-phone-header {
  background: #1e293b;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #334155;
}

.sim-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
}

.simulator-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #0b1120;
}

.sim-msg {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  max-width: 85%;
  line-height: 1.4;
}

.sim-msg-bot {
  background: #1e293b;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.sim-msg-user {
  background: var(--accent-primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.simulator-chat-input-bar {
  padding: 12px;
  background: #1e293b;
  display: flex;
  gap: 8px;
}

.quick-test-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-outline-sm {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline-sm:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

/* Tabs Display */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1080px) {
  .chat-center-layout {
    grid-template-columns: 280px 1fr;
  }
  .chat-dossier-panel {
    display: none !important;
  }
  .charts-row, .knowledge-grid {
    grid-template-columns: 1fr;
  }
}
