:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --cyan: #06b6d4;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --transition: all 0.25s ease;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.brand-text h2 {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 12px;
  color: var(--cyan);
  font-weight: 500;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
}

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

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.05));
  color: #fff;
  border-left: 3px solid var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.bot-status-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

.bot-status-badge.disabled {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-anim 1.5s infinite;
}

.bot-status-badge.disabled .pulse {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

@keyframes pulse-anim {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.top-header {
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-title h1 {
  font-size: 22px;
  font-weight: 700;
}

.page-title p {
  font-size: 13px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.content-body {
  padding: 32px;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Glass Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.panel-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header h3 i {
  color: var(--primary);
}

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

.section-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

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

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.purple { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--cyan); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--green); }
.stat-icon.orange { background: rgba(245, 158, 11, 0.15); color: var(--orange); }

.stat-info h3 {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-number {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-top: 4px;
}

/* Instruction Steps */
.instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.step-content h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.step-content p {
  font-size: 13px;
  color: var(--text-muted);
}

.step-content code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--cyan);
  font-family: monospace;
}

/* Scenarios List */
.scenarios-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scenario-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition);
}

.scenario-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

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

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

.scen-title input {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.scen-title input:focus {
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.2);
  outline: none;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-group small {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-row {
  display: flex;
  gap: 20px;
}

.col-6 { flex: 1; }

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-success {
  background: linear-gradient(135deg, var(--green), #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

.btn-danger:hover {
  background: var(--red);
  color: white;
}

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

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .3s;
  border-radius: 24px;
}

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

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

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

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

.toggle-label {
  font-size: 14px;
  font-weight: 500;
}

/* Inbox & LiveChat */
.inbox-container {
  display: flex;
  height: calc(100vh - 160px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.inbox-sidebar {
  width: 320px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.4);
}

.inbox-search {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.inbox-search i {
  position: absolute;
  left: 28px;
  top: 28px;
  color: var(--text-muted);
}

.inbox-search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
}

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

.customer-item {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.customer-item.active {
  background: rgba(99, 102, 241, 0.15);
  border-left: 3px solid var(--primary);
}

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

.cust-info {
  flex: 1;
  overflow: hidden;
}

.cust-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.3);
}

.chat-user-info h4 {
  font-size: 16px;
  font-weight: 600;
}

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

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

.empty-chat {
  margin: auto;
  text-align: center;
  color: var(--text-dim);
}

.empty-chat i {
  font-size: 48px;
  margin-bottom: 12px;
}

.chat-bubble {
  max-width: 65%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.chat-bubble.user {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
  color: var(--text-main);
}

.chat-bubble.bot {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  border-bottom-right-radius: 4px;
  color: white;
}

.chat-bubble.agent {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--green), #059669);
  border-bottom-right-radius: 4px;
  color: white;
}

.chat-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  background: rgba(15, 23, 42, 0.3);
}

.chat-footer input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
}

/* Simulator Pane */
.flex-gap {
  display: flex;
  gap: 32px;
}

.simulator-info {
  flex: 1;
}

.simulator-info h4 {
  font-size: 18px;
  margin-bottom: 8px;
}

.mock-phone {
  width: 360px;
  height: 600px;
  background: #000;
  border: 4px solid #334155;
  border-radius: 36px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.phone-header {
  background: #1e293b;
  padding: 16px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.phone-header i {
  color: #0084ff;
  font-size: 18px;
}

.phone-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #0f172a;
}

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

.sim-msg.user {
  align-self: flex-end;
  background: #0084ff;
  color: white;
  border-bottom-right-radius: 4px;
}

.sim-msg.bot {
  align-self: flex-start;
  background: #334155;
  color: white;
  border-bottom-left-radius: 4px;
}

.phone-footer {
  padding: 12px;
  background: #1e293b;
  display: flex;
  gap: 8px;
}

.phone-footer input {
  flex: 1;
  padding: 8px 14px;
  border-radius: 20px;
  border: none;
  background: #0f172a;
  color: white;
  font-family: inherit;
  font-size: 13px;
}

.phone-footer button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #0084ff;
  color: white;
  cursor: pointer;
}

.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-color);
  color: white;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }

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