/* Nav links */
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.15s;
}
.nav-link:hover { background: rgba(255,255,255,0.07); color: #f1f5f9; }
.nav-link.active { background: rgba(99,102,241,0.2); color: #a5b4fc; }

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.card-title { font-size: 14px; font-weight: 600; color: #1e293b; }

/* Stat cards */
.stat-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 16px;
  display: flex;
  align-items: center;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-label { font-size: 12px; color: #64748b; font-weight: 500; margin-bottom: 2px; }
.stat-value { font-size: 24px; font-weight: 700; color: #0f172a; line-height: 1.1; }
.stat-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead tr { border-bottom: 1px solid #f1f5f9; }
.data-table th {
  text-align: left; padding: 10px 16px;
  font-size: 11px; font-weight: 600; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.05em;
  white-space: nowrap;
}
.data-table td { padding: 11px 16px; border-bottom: 1px solid #f8fafc; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; cursor: pointer; }

.loading-row { text-align: center; color: #94a3b8; padding: 24px; font-size: 13px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}

/* Filter inputs */
.filter-input {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 7px 12px; font-size: 13px;
  color: #1e293b; outline: none;
  transition: border-color 0.15s;
}
.filter-input:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.15); }
.filter-select {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 7px 10px; font-size: 13px;
  color: #1e293b; outline: none; cursor: pointer;
}
.filter-select:focus { border-color: #6366f1; }

.btn-primary {
  background: #6366f1; color: white;
  padding: 7px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; transition: background 0.15s;
}
.btn-primary:hover { background: #4f46e5; }

.btn-sm {
  padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s;
}
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-view { background: #ede9fe; color: #7c3aed; }
.btn-view:hover { background: #ddd6fe; }

/* Pagination */
.pagination-bar {
  display: flex; align-items: center; justify-content: between;
  gap: 8px; padding: 10px 16px;
  border-top: 1px solid #f1f5f9; font-size: 12px; color: #64748b;
}
.page-btn {
  padding: 4px 10px; border-radius: 6px; border: 1px solid #e2e8f0;
  background: white; font-size: 12px; cursor: pointer; color: #374151;
  transition: all 0.15s;
}
.page-btn:hover { background: #f1f5f9; }
.page-btn.active { background: #6366f1; color: white; border-color: #6366f1; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Modal tabs */
.modal-tab {
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: #64748b; border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all 0.15s;
}
.modal-tab:hover { color: #1e293b; }
.modal-tab.active { color: #6366f1; border-bottom-color: #6366f1; }

/* Conversation bubbles */
.msg-user {
  display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 12px;
}
.msg-assistant {
  display: flex; flex-direction: column; align-items: flex-end; margin-bottom: 12px;
}
.msg-bubble {
  max-width: 75%; padding: 8px 14px; border-radius: 14px;
  font-size: 13px; line-height: 1.5; word-break: break-word;
}
.msg-user .msg-bubble { background: #f1f5f9; color: #0f172a; border-bottom-left-radius: 4px; }
.msg-assistant .msg-bubble { background: #6366f1; color: white; border-bottom-right-radius: 4px; }
.msg-meta { font-size: 10px; color: #94a3b8; margin-top: 3px; padding: 0 4px; }

/* Transcript */
.transcript-user { display: flex; gap: 8px; align-items: flex-start; }
.transcript-ai { display: flex; gap: 8px; align-items: flex-start; flex-direction: row-reverse; }
.transcript-bubble {
  flex: 1; min-width: 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  word-break: break-word; overflow-wrap: anywhere;
}
.transcript-user .transcript-bubble { background: #f1f5f9; }
.transcript-ai .transcript-bubble { background: #ede9fe; }
.transcript-label { font-size: 10px; font-weight: 700; margin-bottom: 4px; color: #64748b; text-transform: uppercase; }
.care-speech { display: block; color: #1e1b4b; font-size: 13px; line-height: 1.5; }
.care-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.care-chip { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 10px; font-weight: 600; }
.care-chip-cat  { background: #e0e7ff; color: #3730a3; }
.care-chip-ticket { background: #dcfce7; color: #166534; }
.care-chip-end  { background: #fee2e2; color: #991b1b; }
.care-chip-search { background: #fef3c7; color: #92400e; }

/* Coming soon screens */
.coming-soon-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 80px 20px; text-align: center;
}
.feature-pill {
  background: #f1f5f9; color: #475569;
  padding: 5px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 500;
}

/* Agent dropdown items */
.agent-option {
  display: flex; align-items: center; gap-10px; padding: 8px 12px;
  font-size: 13px; cursor: pointer; transition: background 0.1s;
  color: #cbd5e1;
}
.agent-option:hover { background: rgba(255,255,255,0.07); }
.agent-option.active { color: #a5b4fc; }

/* Toggle switch */
.toggle-wrap { display:flex; align-items:center; justify-content:space-between; padding:6px 0; }
.toggle-wrap .toggle-label { font-size:13px; color:#334155; flex:1; }
.toggle-wrap .toggle-sub { font-size:11px; color:#94a3b8; }
.toggle { position:relative; display:inline-flex; flex-shrink:0; }
.toggle input { position:absolute; opacity:0; width:0; height:0; }
.toggle-track {
  width:36px; height:20px; background:#cbd5e1; border-radius:99px;
  transition:background 0.2s; cursor:pointer; display:block;
}
.toggle input:checked + .toggle-track { background:#6366f1; }
.toggle-thumb {
  position:absolute; top:3px; left:3px;
  width:14px; height:14px; background:white; border-radius:50%;
  box-shadow:0 1px 3px rgba(0,0,0,0.2);
  transition:transform 0.2s; pointer-events:none;
}
.toggle input:checked ~ .toggle-thumb { transform:translateX(16px); }
.toggle-warn input:checked + .toggle-track { background:#f59e0b; }

/* Config section styles */
.config-section-label { font-size:11px; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:0.06em; margin-bottom:8px; padding-bottom:6px; border-bottom:1px solid #f1f5f9; }
.config-row { display:flex; flex-direction:column; gap:2px; margin-bottom:10px; }
.config-row label { font-size:12px; font-weight:500; color:#64748b; }
.toast { position:fixed; bottom:20px; right:20px; z-index:9999; background:#1e293b; color:white; padding:10px 18px; border-radius:10px; font-size:13px; font-weight:500; box-shadow:0 4px 20px rgba(0,0,0,0.2); transition:opacity 0.3s; }
.toast.success { background:#059669; }
.toast.error { background:#dc2626; }
.rule-tag { display:inline-flex; align-items:center; padding:1px 7px; border-radius:99px; font-size:11px; font-weight:600; background:#f1f5f9; color:#475569; margin:1px; }

/* Mobile menu button — hidden on desktop */
#mobile-menu-btn { display: none; }

/* Mobile sidebar slide-in */
@media (max-width: 768px) {
  #mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  #sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0,0,0,0.45);
  }
  #sidebar-overlay.open {
    display: block;
  }
}
