:root {
  --primary: #00D9FF;
  --primary-dark: #0A8EA0;
  --bg: #0f2830;
  --card: #1a3a44;
  --text: #ffffff;
  --text-secondary: #b0c4cc;
  --border: rgba(0, 217, 255, 0.2);
  --success: #00ff88;
  --error: #ff4444;
  --warning: #ffaa00;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== HEADER ========== */
header {
  background: var(--card);
  padding: 1rem 2rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

header h1 {
  font-size: 1.5rem;
  color: var(--text);
}

nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* User Profile Dropdown */
.user-profile {
  position: relative;
  margin-left: 1rem;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.user-profile-btn:hover {
  background: rgba(0, 217, 255, 0.2);
  border-color: var(--primary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
}

.user-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.2;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.user-dropdown-icon {
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.user-profile.open .user-dropdown-icon {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
}

.user-profile.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-size: 0.9rem;
}

.user-dropdown-item:hover {
  background: rgba(0, 217, 255, 0.1);
}

.user-dropdown-item.danger {
  color: var(--error);
}

.user-dropdown-item.danger:hover {
  background: rgba(255, 68, 68, 0.1);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

.nav-link {
  color: var(--primary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.nav-link:hover {
  background: rgba(0, 217, 255, 0.1);
  transform: translateY(-2px);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

/* ========== MAIN CONTENT ========== */
main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.page-header h2 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #00D9FF, #00ff88);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ========== STATS CARDS ========== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  border-color: var(--primary);
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 217, 255, 0.3);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.card h2 {
  font-size: 3.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

/* ========== TOOLTIPS ========== */
.tooltip-container {
  position: relative;
}

.tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(0, 0, 0, 0.95);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  white-space: normal;
  width: 250px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  border: 1px solid var(--primary);
  box-shadow: 0 4px 12px rgba(0, 217, 255, 0.4);
  pointer-events: none;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.95);
}

.tooltip-container:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.help-icon {
  color: var(--primary);
  cursor: help;
  font-size: 0.9rem;
  margin-left: 0.3rem;
}

/* ========== BUTTONS ========== */
.btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1rem 2rem;
  border-radius: 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 217, 255, 0.5);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-icon {
  font-size: 1.2rem;
}

.actions {
  text-align: center;
  margin: 3rem 0;
}

/* ========== INFO SECTION ========== */
.info-section {
  margin-top: 3rem;
}

.info-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.info-card h3 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.info-card li:last-child {
  border-bottom: none;
}

/* ========== FORMS ========== */
.form-container {
  max-width: 900px;
  margin: 0 auto;
}

form {
  background: var(--card);
  padding: 3rem;
  border-radius: 16px;
  border: 2px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.form-header {
  text-align: center;
  margin-bottom: 3rem;
}

.form-header h2 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.form-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

.form-group {
  margin-bottom: 2rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 1rem;
}

label.required::after {
  content: ' *';
  color: var(--error);
}

input, textarea, select {
  width: 100%;
  padding: 1rem;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

/* Melhorar visualização do select */
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300D9FF' 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 1rem center;
  background-size: 1.2rem;
  padding-right: 3rem;
  background-color: rgba(255, 255, 255, 0.05);
}

select:focus {
  background-color: rgba(0, 217, 255, 0.05);
}

/* Options do select - forçar fundo escuro */
select option {
  background-color: #1a3a44 !important;
  color: #ffffff !important;
  padding: 1rem;
  font-size: 1rem;
  border: none;
}

select option:disabled {
  background-color: #1a3a44 !important;
  color: #b0c4cc !important;
}

select option:hover,
select option:checked,
select option:focus {
  background-color: rgba(0, 217, 255, 0.3) !important;
  color: #00D9FF !important;
}

textarea {
  font-family: 'Fira Code', 'Courier New', monospace;
  resize: vertical;
  line-height: 1.5;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 217, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.field-rules {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  line-height: 1.6;
}

.field-rules code {
  background: rgba(0, 217, 255, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: var(--primary);
  font-family: 'Fira Code', monospace;
}

.field-rules ol, .field-rules ul {
  margin: 0.5rem 0 0 1.5rem;
}

.error-message {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  font-weight: 600;
}

.char-counter {
  text-align: right;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-weight: 600;
}

/* ========== INFO BOX ========== */
.info-box {
  background: rgba(0, 217, 255, 0.05);
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.info-box h4 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.info-box p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.info-box ul, .info-box ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

.info-box li {
  margin-bottom: 0.5rem;
}

/* ========== FORM DIVIDER ========== */
.form-divider {
  margin: 3rem 0 2rem;
  padding: 1.5rem;
  background: rgba(0, 217, 255, 0.05);
  border-radius: 12px;
  text-align: center;
}

.form-divider h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.form-divider p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ========== FORM ACTIONS ========== */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}

/* ========== WEBHOOK RESULT ========== */
.webhook-result {
  margin-top: 2rem;
  padding: 2rem;
  border-radius: 12px;
  border: 2px solid;
}

.webhook-result.success {
  background: rgba(0, 255, 136, 0.05);
  border-color: var(--success);
}

.webhook-result.error {
  background: rgba(255, 68, 68, 0.05);
  border-color: var(--error);
}

.webhook-result h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.webhook-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.webhook-box h4 {
  color: var(--primary);
  margin-bottom: 1rem;
}

.webhook-box code {
  display: block;
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem;
  border-radius: 6px;
  color: var(--primary);
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  word-break: break-all;
  margin-bottom: 1rem;
}

.next-steps {
  margin: 1.5rem 0;
}

.next-steps h4 {
  color: var(--primary);
  margin-bottom: 1rem;
}

.next-steps ol {
  margin-left: 1.5rem;
}

.next-steps li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* ========== NOTIFICATIONS ========== */
.notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: var(--card);
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

.notification.error {
  border-color: var(--error);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ========== LOADING SPINNER ========== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error {
  color: var(--error);
}

/* ========== FOOTER ========== */
footer {
  background: var(--card);
  border-top: 2px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: auto;
}

/* ========== SIDEBAR LAYOUT ========== */
.layout-sidebar {
  display: flex;
  min-height: calc(100vh - 70px);
}

.sidebar {
  width: 260px;
  background: var(--card);
  border-right: 2px solid var(--border);
  padding: 1.5rem 0;
  flex-shrink: 0;
}

.sidebar-section {
  padding: 0 1rem;
  margin-bottom: 2rem;
}

.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  padding: 0 0.5rem;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-item {
  margin-bottom: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background: rgba(0, 217, 255, 0.1);
  color: var(--primary);
}

.sidebar-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.sidebar-icon {
  font-size: 1.2rem;
}

.content-area {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* ========== TABLES ========== */
.table-container {
  overflow-x: auto;
  background: var(--card);
  border-radius: 12px;
  border: 2px solid var(--border);
}

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

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: rgba(0, 217, 255, 0.05);
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

tr:hover {
  background: rgba(0, 217, 255, 0.03);
}

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

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(0, 255, 136, 0.1);
  color: var(--success);
  border: 1px solid var(--success);
}

.badge-warning {
  background: rgba(255, 170, 0, 0.1);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.badge-error {
  background: rgba(255, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid var(--error);
}

.badge-info {
  background: rgba(0, 217, 255, 0.1);
  color: var(--primary);
  border: 1px solid var(--primary);
}

/* ========== MODALS ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 2rem;
  animation: fadeIn 0.2s ease;
}

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

.modal {
  background: var(--card);
  border-radius: 16px;
  border: 2px solid var(--border);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

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

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

.modal-header {
  padding: 1.5rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  color: var(--primary);
  font-size: 1.3rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--error);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-actions {
  padding: 1.5rem;
  border-top: 2px solid var(--border);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* ========== AGENT CARDS ========== */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.agent-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.agent-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 217, 255, 0.2);
}

.agent-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.agent-info h3 {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.agent-sector {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.agent-body {
  padding: 1.5rem;
}

.agent-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.agent-stat:last-child {
  border-bottom: none;
}

.agent-stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.agent-stat-value {
  color: var(--primary);
  font-weight: 600;
}

.agent-footer {
  padding: 1rem 1.5rem;
  background: rgba(0, 217, 255, 0.03);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ========== PROMPT EDITOR ========== */
.prompt-editor {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  height: calc(100vh - 200px);
}

.prompt-list {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.prompt-list-header {
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.prompt-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.prompt-item:hover {
  background: rgba(0, 217, 255, 0.05);
}

.prompt-item.active {
  background: rgba(0, 217, 255, 0.1);
  border-left: 4px solid var(--primary);
}

.prompt-item-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.prompt-item-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.prompt-content {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.prompt-content-header {
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prompt-textarea {
  flex: 1;
  resize: none;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: 'Fira Code', 'Monaco', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 1.5rem;
}

.prompt-textarea:focus {
  outline: none;
}

/* ========== CONVERSATION VIEWER ========== */
.conversation-container {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 1.5rem;
  height: calc(100vh - 200px);
}

.conversation-list {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.conversation-list-header {
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--border);
}

.conversation-search {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
}

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

.conversation-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.conversation-item:hover {
  background: rgba(0, 217, 255, 0.05);
}

.conversation-item.active {
  background: rgba(0, 217, 255, 0.1);
  border-left: 4px solid var(--primary);
}

.conversation-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.conversation-item-name {
  font-weight: 600;
  color: var(--text);
}

.conversation-item-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.conversation-item-preview {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-detail {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conversation-detail-header {
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.conversation-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  max-width: 80%;
  padding: 1rem;
  border-radius: 12px;
}

.message-customer {
  background: rgba(255, 255, 255, 0.1);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message-agent {
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid var(--primary);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 1rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-size: 1rem;
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ========== LOADING ========== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
  color: var(--text-secondary);
}

.loading .spinner {
  width: 40px;
  height: 40px;
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* ========== NOTIFICATION IMPROVEMENTS ========== */
.notification {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.notification-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
}

.notification-close:hover {
  color: var(--text);
}

/* ========== BTN VARIANTS ========== */
.btn-danger {
  background: linear-gradient(135deg, var(--error), #cc0000);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #cc8800);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #00cc66);
}

.btn-xs {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
  .prompt-editor,
  .conversation-container {
    grid-template-columns: 1fr;
    height: auto;
  }

  .prompt-list,
  .conversation-list {
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1rem;
  }

  .layout-sidebar {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 2px solid var(--border);
  }

  .agents-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  form {
    padding: 2rem 1.5rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .page-header h2 {
    font-size: 2rem;
  }

  .card h2 {
    font-size: 2.5rem;
  }

  .modal {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }
}
