@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #030712;
  --card-bg: rgba(17, 24, 39, 0.7);
  --card-hover: rgba(31, 41, 55, 0.8);
  --border: rgba(255, 255, 255, 0.08);
  --text: #F9FAFB;
  --text-muted: #9CA3AF;
  --accent: #0EA5E9;
  --green: #10B981;
  --yellow: #F59E0B;
  --red: #EF4444;
  --purple: #8B5CF6;
  --sidebar-width: 280px;
  --glass: blur(16px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 0% 0%, rgba(14, 165, 233, 0.08) 0, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.08) 0, transparent 40%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(3, 7, 18, 0.95);
  backdrop-filter: var(--glass);
  border-right: 1px solid var(--border);
  height: 100vh;
  position: fixed;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 2000;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 32px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo { font-size: 1.8rem; filter: drop-shadow(0 0 10px var(--accent)); }
.sidebar-title { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.03em; }

.nav-group { margin-bottom: 24px; }
.nav-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); padding: 0 24px 8px; font-weight: 700; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  margin: 2px 16px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: 0.2s;
  cursor: pointer;
}

.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-item.active { background: var(--accent); color: white; box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3); }

/* Main Content */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 40px;
  max-width: 1200px;
  transition: 0.4s;
}

header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.page-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; }

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.bento-card {
  background: var(--card-bg);
  backdrop-filter: var(--glass);
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.bento-card:hover { border-color: rgba(255,255,255,0.2); transform: translateY(-4px); }

.stat-val { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.stat-tag { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }

/* Section Containers */
.section-panel {
  background: var(--card-bg);
  border-radius: 32px;
  border: 1px solid var(--border);
  padding: 32px;
}

/* List Items (Agents/Sessions) */
.agent-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }

.agent-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  cursor: pointer;
  transition: 0.2s;
  border: 1px solid transparent;
}

.agent-row:hover { background: rgba(255,255,255,0.06); border-color: var(--border); }

.agent-avatar { font-size: 1.8rem; background: var(--bg); width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 14px; }

.agent-info { flex: 1; }
.agent-name { font-weight: 600; font-size: 1rem; }
.agent-meta { font-size: 0.75rem; color: var(--text-muted); }

.status-badge { font-size: 0.65rem; font-weight: 800; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; }
.status-badge.online { background: rgba(16, 185, 129, 0.1); color: var(--green); }

/* Vitals Group */
.vitals-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.vital-item { margin-bottom: 16px; background: rgba(0,0,0,0.2); padding: 16px; border-radius: 16px; }
.vital-label-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); }
.progress-bg { height: 8px; background: rgba(255,255,255,0.05); border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 10px; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: var(--glass);
  z-index: 1500;
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.menu-btn { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }

/* Detail Panel */
.agent-detail {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 500px;
  height: 100vh;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 2600;
  padding: 32px;
  box-shadow: -10px 0 40px rgba(0,0,0,0.6);
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(100%);
  display: none;
}
.detail-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2500;
  backdrop-filter: blur(8px);
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); width: 280px; }
  .sidebar.active { transform: translateX(0); }
  .main-wrapper { margin-left: 0; padding: 80px 20px 40px; }
  .mobile-header { display: flex; }
  .bento-grid { grid-template-columns: 1fr 1fr; }
  .vitals-stack { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .bento-grid { grid-template-columns: 1fr; }
  .stat-val { font-size: 1.8rem; }
  .page-title { font-size: 1.5rem; }
}
