:root {
  --bg: #0f1221;
  --bg-2: #161a2e;
  --card: #1b203a;
  --card-2: #20264a;
  --line: #2a3158;
  --text: #e7e9f5;
  --muted: #9aa0c4;
  --primary: #6c5ce7;
  --primary-2: #8b7bff;
  --green: #2ecc71;
  --amber: #f5a623;
  --red: #ff6b6b;
  --radius: 16px;
}

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

body {
  font-family: "Inter", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #2a2f5c 0%, transparent 60%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

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

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
  box-shadow: 0 6px 18px rgba(108,92,231,.45);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; }
.brand-sub { font-size: 12px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: .15s;
}
.nav-item .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .5; }
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, rgba(108,92,231,.25), rgba(139,123,255,.1)); color: #fff; }
.nav-item.active .dot { background: var(--primary-2); opacity: 1; }
.sidebar-footer { margin-top: auto; color: var(--muted); font-size: 12px; }

/* Main */
.main { flex: 1; padding: 28px 36px; max-width: 1400px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; gap: 20px; flex-wrap: wrap; }
.topbar h1 { font-size: 24px; font-weight: 700; }
.subtitle { color: var(--muted); font-size: 14px; margin-top: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.search {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-size: 14px; width: 200px; outline: none;
}
.search:focus { border-color: var(--primary); }

.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -8px; border: 2px solid var(--bg); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff;
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.xs { width: 30px; height: 30px; font-size: 12px; flex: none; }

/* KPI cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 18px; }
.kpi { display: flex; flex-direction: column; gap: 8px; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 30px; font-weight: 800; }
.kpi-trend { font-size: 12px; font-weight: 600; }
.kpi-trend.up { color: var(--green); }
.kpi-trend.down { color: var(--primary-2); }

/* Grid */
.grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.activity { grid-column: 1 / -1; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-head h2 { font-size: 16px; font-weight: 700; }
.pill { font-size: 12px; color: var(--muted); background: var(--card-2); padding: 5px 12px; border-radius: 20px; }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 10px; text-transform: uppercase; letter-spacing: .04em; }
.table td { padding: 12px 10px; border-top: 1px solid var(--line); }
.agent { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.status { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.status.online { background: rgba(46,204,113,.15); color: var(--green); }
.status.busy { background: rgba(245,166,35,.15); color: var(--amber); }

/* Chart */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 10px; }
.bar {
  flex: 1; height: var(--h);
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  border-radius: 8px 8px 4px 4px; position: relative;
  transition: .3s; min-height: 12px;
}
.bar:hover { filter: brightness(1.2); }
.bar span { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }

/* Activity feed */
.feed { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.feed li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.feed em { color: var(--muted); font-style: normal; font-size: 12px; }

.footer { margin-top: 28px; color: var(--muted); font-size: 13px; text-align: center; }

/* Responsive */
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { display: none; }
  .main { padding: 20px; }
}
