/* james.css - Estilos para a seção JAMES */

.james-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px;
  height: 100%;
  animation: fadeInUp 0.6s ease-out;
}

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

/* Header do JAMES */
.james-header {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #4a6cf7 0%, #5a7dfb 100%);
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(74, 108, 247, 0.15);
  position: relative;
  overflow: hidden;
}

.james-header::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  transform: translate(30%, -30%);
}

.james-avatar {
  width: 80px;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 2;
}

.james-avatar-icon {
  font-size: 42px !important;
  color: #4a6cf7;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.james-info {
  flex-grow: 1;
  position: relative;
  z-index: 2;
}

.james-info h3 {
  margin: 0 0 10px 0;
  font-size: 28px;
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.james-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
}

.james-status.online {
  color: #ffffff;
}

.james-status.offline {
  color: rgba(255, 255, 255, 0.8);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
}

.james-status.online .status-dot {
  background-color: #00e676;
  box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.3);
  animation: pulse 1.5s infinite;
}

.james-status.offline .status-dot {
  background-color: #ff5252;
  box-shadow: 0 0 0 2px rgba(255, 82, 82, 0.3);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.5);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(0, 230, 118, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
  }
}

/* Estatísticas compactas do JAMES */
.james-stats-container {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.james-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.james-kpi-card {
  background: var(--bg-primary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.james-kpi-card:hover {
  border-color: #4a6cf7;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 108, 247, 0.1);
}

.james-kpi-badge {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.james-kpi-badge .material-icons {
  font-size: 20px;
  color: white;
}

.james-kpi-badge.badge-blue   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.james-kpi-badge.badge-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.james-kpi-badge.badge-orange { background: linear-gradient(135deg, #f97316, #ea580c); }
.james-kpi-badge.badge-green  { background: linear-gradient(135deg, #10b981, #059669); }
.james-kpi-badge.badge-teal   { background: linear-gradient(135deg, #14b8a6, #0d9488); }

.james-kpi-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.james-kpi-label {
  font-size: 0.76rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.james-kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color, #1e293b);
  line-height: 1.2;
  margin-top: 2px;
}

.james-kpi-sub {
  font-size: 0.78rem;
  font-weight: 500;
  color: #8b5cf6;
}

[data-theme="dark"] .james-stats-container,
[data-theme="dark"] .james-kpi-card {
  background: var(--card-bg, #1e293b) !important;
  border-color: var(--border-color, #334155) !important;
}

[data-theme="dark"] .james-kpi-label {
  color: #94a3b8 !important;
}

[data-theme="dark"] .james-kpi-value {
  color: #f8fafc !important;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: 12px;
  background-color: #f9fafc;
  transition: all 0.3s ease;
  border: 1px solid rgba(230, 233, 244, 0.8);
  position: relative;
  overflow: hidden;
  animation: fadeInCard 0.8s ease backwards;
}

/* Cards com gradientes coloridos */
.stat-card.gradient-purple {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

.stat-card.gradient-pink {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border: none;
}

.stat-card.gradient-blue {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  border: none;
}

.stat-card.gradient-green {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  border: none;
}

/* Texto branco para cards com gradiente */
.stat-card.gradient-purple .stat-content h4,
.stat-card.gradient-pink .stat-content h4,
.stat-card.gradient-blue .stat-content h4,
.stat-card.gradient-green .stat-content h4 {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.stat-card.gradient-purple .stat-value,
.stat-card.gradient-pink .stat-value,
.stat-card.gradient-blue .stat-value,
.stat-card.gradient-green .stat-value {
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.stat-card.gradient-purple .stat-icon,
.stat-card.gradient-pink .stat-icon,
.stat-card.gradient-blue .stat-icon,
.stat-card.gradient-green .stat-icon {
  background: rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.stat-card.gradient-purple .stat-icon .material-icons,
.stat-card.gradient-pink .stat-icon .material-icons,
.stat-card.gradient-blue .stat-icon .material-icons,
.stat-card.gradient-green .stat-icon .material-icons {
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  filter: none;
}

.stats-grid > *:nth-child(1) { animation-delay: 0.1s; }
.stats-grid > *:nth-child(2) { animation-delay: 0.2s; }
.stats-grid > *:nth-child(3) { animation-delay: 0.3s; }
.stats-grid > *:nth-child(4) { animation-delay: 0.4s; }
.stats-grid > *:nth-child(5) { animation-delay: 0.5s; }

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

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(74, 108, 247, 0.05) 0%, rgba(74, 108, 247, 0) 70%);
  border-radius: 50%;
  transform: translate(30%, -30%);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(74, 108, 247, 0.1);
  border-color: rgba(74, 108, 247, 0.3);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(74, 108, 247, 0.1) 0%, rgba(74, 108, 247, 0.2) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(74, 108, 247, 0.1);
  position: relative;
  z-index: 2;
}

.stat-icon .material-icons {
  color: #4a6cf7;
  font-size: 24px;
  filter: drop-shadow(0 2px 3px rgba(74, 108, 247, 0.2));
}

.stat-content {
  flex-grow: 1;
  position: relative;
  z-index: 2;
}

.stat-content h4 {
  margin: 0;
  font-size: 14px;
  color: #777;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #222;
  margin-top: 6px;
  letter-spacing: 0.5px;
  position: relative;
  display: inline-block;
}

/* Tabs do JAMES */
.james-tabs {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.05);
  overflow: hidden;
  position: relative;
}

.tab-header {
  display: flex;
  background: linear-gradient(to right, #f8f9ff, #f0f4ff);
  border-bottom: 1px solid rgba(230, 233, 244, 0.6);
  padding: 4px;
  position: relative;
}

.tab-button {
  padding: 16px 28px;
  font-weight: 600;
  color: #777;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  border-radius: 10px;
  margin: 4px 6px;
  z-index: 2;
  letter-spacing: 0.3px;
}

.tab-button:hover {
  color: #4a6cf7;
  background-color: rgba(74, 108, 247, 0.05);
}

.tab-button.active {
  color: #4a6cf7;
  background-color: rgba(74, 108, 247, 0.08);
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background-color: #4a6cf7;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(74, 108, 247, 0.3);
}

.tab-content {
  flex-grow: 1;
  overflow: auto;
}

.tab-pane {
  display: none !important;
  padding: 20px;
  height: 100%;
}

.tab-pane.active {
  display: block !important;
}

/* Estilo para a seção de Prompts */
.prompts-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 24px;
  padding: 10px 5px;
}

.prompt-card {
  border: 1px solid rgba(230, 233, 244, 0.7);
  border-radius: 12px;
  padding: 24px;
  position: relative;
  transition: all 0.3s ease;
  background: #ffffff;
  box-shadow: 0 5px 15px rgba(0,0,0,0.02);
  overflow: hidden;
}

.prompt-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #4a6cf7, #5a7dfb);
  border-radius: 3px 0 0 3px;
  opacity: 0.7;
}

.prompt-card:hover {
  box-shadow: 0 10px 25px rgba(74, 108, 247, 0.08);
  transform: translateY(-3px);
  border-color: rgba(74, 108, 247, 0.3);
}

.prompt-card h4 {
  margin: 0 0 18px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #222;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.prompt-actions {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
}

.btn-edit {
  background: rgba(74, 108, 247, 0.1);
  border: none;
  color: #4a6cf7;
  cursor: pointer;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(74, 108, 247, 0.1);
}

.btn-edit:hover {
  background-color: rgba(74, 108, 247, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(74, 108, 247, 0.2);
}

.prompt-content {
  background-color: #f9fafc;
  border-radius: 8px;
  padding: 15px;
  overflow: auto;
  max-height: 300px;
}

.prompt-content pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  color: #555;
}

/* Estilos para edição de prompts */
.prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.prompt-header h4 {
  margin: 0;
  color: #222;
  font-size: 18px;
  font-weight: 600;
}

.prompt-header .btn-edit {
  background: rgba(74, 108, 247, 0.1);
  border: none;
  color: #4a6cf7;
  cursor: pointer;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
}

.prompt-header .btn-edit:hover {
  background: rgba(74, 108, 247, 0.2);
  transform: translateY(-2px);
}

.prompt-content textarea {
  width: 100%;
  min-height: 300px;
  padding: 15px;
  border: 2px solid #e6e9f4;
  border-radius: 8px;
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  color: #333;
  background: #fff;
  resize: vertical;
  transition: border-color 0.3s;
}

.prompt-content textarea:focus {
  outline: none;
  border-color: #4a6cf7;
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

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

.prompt-actions .btn-primary {
  background: linear-gradient(135deg, #4a6cf7 0%, #5a7dfb 100%);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.prompt-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(74, 108, 247, 0.3);
}

.prompt-actions .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.prompt-actions .btn-secondary {
  background: #f5f7ff;
  color: #4a6cf7;
  border: 2px solid #e6e9f4;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.prompt-actions .btn-secondary:hover {
  background: #e6e9f4;
  border-color: #4a6cf7;
}

/* Estilo para a seção de Mensagens */
.messages-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.filter-controls {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  flex-grow: 1;
  display: flex;
  align-items: center;
  background: #f5f7ff;
  border-radius: 6px;
  padding: 0 15px;
  min-width: 250px;
}

.search-box input {
  border: none;
  background: transparent;
  padding: 12px 10px;
  flex-grow: 1;
  outline: none;
  font-size: 14px;
}

.search-box .material-icons {
  color: #666;
}

.date-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-filter label {
  font-weight: 500;
  color: #666;
}

.date-filter input {
  padding: 10px;
  border: 1px solid #e6e9f4;
  border-radius: 6px;
  outline: none;
}

.messages-list {
  flex-grow: 1;
  background-color: #f9fafc;
  border-radius: 8px;
  padding: 20px;
  overflow: auto;
}

.message-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  text-align: center;
}

.message-empty .material-icons {
  font-size: 48px;
  opacity: 0.5;
  margin-bottom: 10px;
}

/* Estilo para a seção de Configurações */
.config-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.config-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.config-section h4 {
  margin: 0 0 10px 0;
  color: #333;
  border-bottom: 1px solid #e6e9f4;
  padding-bottom: 8px;
}

.config-option {
  display: flex;
  align-items: center;
  padding: 10px 0;
}

.config-label {
  flex: 1;
  font-weight: 500;
  color: #555;
}

.config-control {
  flex: 2;
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-save {
  background: linear-gradient(135deg, #4a6cf7 0%, #5a7dfb 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(74, 108, 247, 0.2);
  position: relative;
  overflow: hidden;
}

.btn-save:hover {
  background: linear-gradient(135deg, #3a5ce5 0%, #4a6cf7 100%);
  box-shadow: 0 6px 15px rgba(74, 108, 247, 0.3);
  transform: translateY(-2px);
}

.btn-save:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(74, 108, 247, 0.3);
}

.btn-action {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #f8f9ff;
  color: #4a6cf7;
  border: 1px solid rgba(74, 108, 247, 0.2);
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.03);
}

.btn-action:hover {
  background-color: rgba(74, 108, 247, 0.08);
  border-color: rgba(74, 108, 247, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.06);
}

.btn-action:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

select {
  padding: 10px 12px;
  border: 1px solid rgba(230, 233, 244, 0.8);
  border-radius: 8px;
  min-width: 150px;
  outline: none;
  background-color: #f9fafc;
  color: #333;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
  transition: all 0.2s;
}

select:focus {
  border-color: rgba(74, 108, 247, 0.4);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

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

.toggle-switch label {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  background-color: #e6e9f4;
  cursor: pointer;
  border-radius: 34px;
  transition: all 0.4s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-switch label:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: linear-gradient(135deg, #f5f5f5, #ffffff);
  transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + label {
  background: linear-gradient(135deg, #4a6cf7, #5a7dfb);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(74, 108, 247, 0.2);
}

.toggle-switch input:checked + label:before {
  transform: translateX(24px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.toggle-switch label:active:before {
  width: 28px;
}

#botStatusText {
  font-weight: 600;
  min-width: 50px;
  color: #333;
  font-size: 14px;
  letter-spacing: 0.3px;
}

/* Slider para temperatura */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 200px;
  height: 8px;
  border-radius: 8px;
  background: linear-gradient(to right, rgba(74, 108, 247, 0.2), rgba(74, 108, 247, 0.8));
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

input[type="range"]:hover {
  background: linear-gradient(to right, rgba(74, 108, 247, 0.3), rgba(74, 108, 247, 0.9));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a6cf7, #5a7dfb);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(74, 108, 247, 0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a6cf7, #5a7dfb);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
}

#tempValue {
  min-width: 40px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  color: #4a6cf7;
  background: rgba(74, 108, 247, 0.08);
  padding: 5px 10px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Modal de Edição de Prompt */
.prompt-edit-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(14, 20, 40, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

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

.prompt-edit-content {
  width: 80%;
  max-width: 1000px;
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(230, 233, 244, 0.8);
  overflow: hidden;
}

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

.prompt-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  background: linear-gradient(to right, #f8f9ff, #f0f4ff);
  border-bottom: 1px solid rgba(230, 233, 244, 0.6);
}

.prompt-edit-header h3 {
  margin: 0;
  color: #222;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.3px;
  position: relative;
}

.btn-close {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  cursor: pointer;
  color: #555;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-close:hover {
  background-color: rgba(244, 67, 54, 0.1);
  color: #f44336;
  transform: rotate(90deg);
}

.prompt-edit-body {
  padding: 25px;
  flex-grow: 1;
  overflow-y: auto;
  background-color: #f9fafc;
}

.prompt-edit-body textarea {
  width: 100%;
  height: 100%;
  min-height: 350px;
  padding: 16px;
  border: 1px solid rgba(230, 233, 244, 0.8);
  border-radius: 10px;
  font-family: 'Roboto Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
  background-color: #fff;
}

.prompt-edit-body textarea:focus {
  border-color: rgba(74, 108, 247, 0.4);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.05);
  outline: none;
}

.prompt-edit-footer {
  display: flex;
  justify-content: flex-end;
  padding: 18px 25px;
  background-color: #f9fafc;
  border-top: 1px solid rgba(230, 233, 244, 0.6);
  gap: 15px;
}

.btn-cancel {
  background-color: #f5f5f5;
  color: #666;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-cancel:hover {
  background-color: #e0e0e0;
}

/* Alertas */
.alert {
  padding: 16px 22px;
  margin-bottom: 18px;
  border-radius: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  animation: slideDown 0.4s ease;
}

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

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.alert-danger {
  background-color: rgba(244, 67, 54, 0.08);
  color: #d32f2f;
}

.alert-danger::before {
  background: linear-gradient(to bottom, #f44336, #e53935);
}

.alert-success {
  background-color: rgba(76, 175, 80, 0.08);
  color: #2e7d32;
}

.alert-success::before {
  background: linear-gradient(to bottom, #43a047, #388e3c);
}

/* Melhorias na formatação do prompt */
.prompt-content pre .section-title {
  display: block;
  margin-top: 10px;
  margin-bottom: 5px;
  color: #333;
  font-size: 15px;
}

/* Adaptações para dispositivos móveis */
@media (max-width: 768px) {
  .james-container {
    gap: 16px;
    padding: 10px;
  }
  
  .james-header {
    padding: 20px;
    flex-direction: column;
    text-align: center;
  }
  
  .james-info h3 {
    font-size: 24px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  
  .prompts-container {
    grid-template-columns: 1fr;
  }
  
  .config-option {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .config-control {
    width: 100%;
  }
  
  .prompt-edit-content {
    width: 95%;
  }
  
  .tab-button {
    padding: 14px 18px;
    font-size: 14px;
  }
  
  .tab-content {
    padding: 15px;
  }
}

@media (max-width: 576px) {
  .james-stats {
    padding: 20px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .tab-header {
    flex-wrap: wrap;
  }
  
  .tab-button {
    flex: 1 0 auto;
    text-align: center;
    padding: 12px 15px;
    margin: 3px;
    font-size: 13px;
  }
  
  .prompt-edit-footer {
    flex-direction: column;
  }
  
  .btn-cancel, .btn-save {
    width: 100%;
  }
  
  .prompt-edit-body textarea {
    min-height: 250px;
  }
  
  .prompt-edit-header h3 {
    font-size: 18px;
  }
  
  .prompt-card h4 {
    font-size: 16px;
  }
}

/* Snackbar para notificações */
.snackbar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #333;
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  font-size: 14px;
  text-align: center;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: 80%;
  opacity: 0;
  pointer-events: none;
}

.snackbar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.snackbar.hide {
  transform: translateX(-50%) translateY(100px);
  opacity: 0;
}

/* Previne duplicação visual de snackbars */
.snackbar-container {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

/* Toggle Button do JAMES */
.james-toggle-container {
  position: relative;
  z-index: 2;
  margin-left: auto;
}

.james-toggle-btn {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.james-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.james-toggle-btn:active {
  transform: translateY(0);
}

.james-toggle-btn.active {
  background: rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.5);
}

.james-toggle-btn.inactive {
  background: rgba(244, 67, 54, 0.2);
  border-color: rgba(244, 67, 54, 0.5);
}

.james-toggle-btn #james-toggle-icon {
  font-size: 24px !important;
  transition: transform 0.3s ease;
}

.james-toggle-btn:hover #james-toggle-icon {
  transform: rotate(90deg);
}

/* Anima��es para notifica��es */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* ================== ESTILOS PARA TAB DE MENSAGENS ================== */

/* Grid de Estatísticas */
.messages-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(74, 108, 247, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4a6cf7, #5a7dfb);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(74, 108, 247, 0.15);
}

.stat-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #4a6cf7, #5a7dfb);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
}

.stat-info h3 {
  margin: 0;
  font-size: 14px;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #2d3748;
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Container do Gráfico */
.messages-chart-container {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
  border: 1px solid rgba(74, 108, 247, 0.1);
}

.messages-chart-container h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #2d3748;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.messages-chart-container h3 .material-icons {
  color: #4a6cf7;
  font-size: 24px;
}

.chart-wrapper {
  position: relative;
  height: 300px;
}

/* Container de Categorias */
.messages-categories {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.messages-category {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(74, 108, 247, 0.1);
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f2ff;
}

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

.category-title h3 {
  margin: 0;
  font-size: 18px;
  color: #2d3748;
  font-weight: 600;
}

.category-title .material-icons {
  color: #4a6cf7;
  font-size: 28px;
}

.category-badge {
  background: linear-gradient(135deg, #4a6cf7, #5a7dfb);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(74, 108, 247, 0.3);
}

/* Theme variables awareness & Dark Mode Support for James section */
[data-theme="dark"] .james-stats,
[data-theme="dark"] .james-tabs,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .message-card,
[data-theme="dark"] .prompt-card {
  background: var(--card-bg, #1e293b) !important;
  border-color: var(--border-color, #334155) !important;
  color: var(--text-color, #f8fafc) !important;
}

[data-theme="dark"] .message-title,
[data-theme="dark"] .category-title,
[data-theme="dark"] .prompt-header h4 {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .message-description {
  color: #94a3b8 !important;
}

[data-theme="dark"] .message-view,
[data-theme="dark"] .prompt-content pre {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .message-edit {
  background: #1e1e2d !important;
  border-color: #f59e0b !important;
  color: #f8fafc !important;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color, #e2e8f0);
}

.category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-color, #1e293b);
}

.category-title .material-icons {
  color: #4a6cf7;
  font-size: 22px;
}

.category-badge {
  background: linear-gradient(135deg, #4a6cf7, #5a7dfb);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(74, 108, 247, 0.25);
}

/* Grid de Mensagens */
.messages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

/* Card de Mensagem */
.message-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 18px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.message-card:hover {
  border-color: #4a6cf7;
  box-shadow: 0 8px 24px rgba(74, 108, 247, 0.12);
  transform: translateY(-2px);
}

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

.message-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-color, #1e293b);
}

.message-actions {
  display: flex;
  gap: 6px;
}

.message-description {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 12px;
  font-style: normal;
  line-height: 1.4;
}

.message-content {
  position: relative;
  flex-grow: 1;
}

.message-view {
  background: var(--bg-primary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--text-color, #334155);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  max-height: 180px;
  overflow-y: auto;
}

.message-edit {
  background: #fffaf0;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.85rem;
  color: #1e293b;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  resize: vertical;
  width: 100%;
  min-height: 100px;
  transition: border-color 0.2s;
}

.message-edit:focus {
  outline: none;
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.message-save-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: flex-end;
}

/* Ações do Header */
.messages-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.messages-actions .btn-primary,
.messages-actions .btn-secondary {
  padding: 10px 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.messages-actions .material-icons {
  font-size: 20px;
}

/* Responsividade */
@media (max-width: 768px) {
  .messages-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .messages-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-wrapper {
    height: 250px;
  }
}

