:root {
  --sidebar-width: 250px;
  --sidebar-bg: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --info-gradient: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
  --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --danger-gradient: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
  --bg-color: #f0f2f5;
  --card-shadow: 0 2px 15px rgba(0,0,0,0.06);
  --border-radius: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-color);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  transition: all 0.3s;
}

#main-content {
  margin-left: var(--sidebar-width);
  padding: 24px;
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
}

.sidebar-brand {
  padding: 24px 20px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand i {
  font-size: 28px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  list-style: none;
  padding: 16px 0;
  flex: 1;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.sidebar-nav li a.active {
  color: #fff;
  background: rgba(102,126,234,0.15);
  border-left-color: #667eea;
}

.sidebar-nav li a i { font-size: 18px; width: 20px; text-align: center; }

.sidebar-divider {
  height: 1px;
  margin: 8px 16px;
  background: rgba(255,255,255,0.08);
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
}

.sidebar-footer a { color: rgba(255,255,255,0.5); text-decoration: none; font-size: 18px; }
.sidebar-footer a:hover { color: #fff; }

/* Cards */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  background: #fff;
  margin-bottom: 20px;
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
  padding: 16px 20px;
  border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

.card-body { padding: 20px; }

/* Stat cards */
.stat-card {
  border-radius: var(--border-radius);
  padding: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.stat-card .icon {
  font-size: 2.5rem;
  opacity: 0.3;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.stat-card .number { font-size: 2rem; font-weight: 700; margin: 0; }
.stat-card .label { font-size: 0.85rem; opacity: 0.85; margin: 0; }

.bg-gradient-primary { background: var(--primary-gradient); }
.bg-gradient-success { background: var(--success-gradient); }
.bg-gradient-info { background: var(--info-gradient); }
.bg-gradient-warning { background: var(--warning-gradient); }
.bg-gradient-danger { background: var(--danger-gradient); }

/* Chat */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 500px;
  overflow-y: auto;
  padding: 16px;
}

.chat-message {
  max-width: 80%;
  animation: fadeIn 0.3s ease;
}

.chat-message.human { align-self: flex-end; }
.chat-message.ai { align-self: flex-start; }
.chat-message.system { align-self: center; max-width: 100%; }

.chat-message .bubble {
  padding: 12px 18px;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 14px;
  word-wrap: break-word;
}

.chat-message.human .bubble {
  background: var(--primary-gradient);
  color: white;
  border-bottom-right-radius: 5px;
}

.chat-message.ai .bubble {
  background: #f0f2f5;
  color: #1a1a2e;
  border-bottom-left-radius: 5px;
}

.chat-message.system .bubble {
  background: transparent;
  color: #6c757d;
  font-size: 13px;
  text-align: center;
  padding: 5px;
}

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

/* Tables */
.table th {
  border-top: none;
  font-weight: 600;
  color: #6c757d;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Buttons */
.btn { border-radius: 8px; font-weight: 500; padding: 8px 20px; }
.btn-lg { padding: 12px 24px; }
.btn-primary { background: var(--primary-gradient); border: none; }
.btn-success { background: var(--success-gradient); border: none; }
.btn-danger { background: var(--danger-gradient); border: none; }
.btn-outline-primary { border-color: #667eea; color: #667eea; }
.btn-outline-primary:hover { background: var(--primary-gradient); border-color: transparent; color: #fff; }

/* Forms */
.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  padding: 10px 14px;
  font-size: 14px;
}

.form-control:focus, .form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* Responsive */
@media (max-width: 768px) {
  #sidebar { width: 60px; }
  #sidebar .sidebar-brand span, .sidebar-nav li a span, .sidebar-footer span { display: none; }
  .sidebar-nav li a { justify-content: center; padding: 12px; }
  .sidebar-brand { justify-content: center; padding: 16px; }
  .sidebar-footer { justify-content: center; }
  .sidebar-footer a { margin-left: 0; }
  #main-content { margin-left: 60px; width: calc(100% - 60px); padding: 16px; }
  .chat-message { max-width: 90%; }
  .stat-card .number { font-size: 1.5rem; }
}

/* Page headers */
.page-header { margin-bottom: 24px; }
.page-header h2 { font-weight: 700; font-size: 1.5rem; color: #1a1a2e; }
.page-header p { color: #6c757d; font-size: 0.9rem; }
