:root {
  --teal: #1ABB9C;
  --navy: #2A3F54;
  --ink: #1a2332;
  --muted: #73879C;
  --border: #E6E9ED;
  --bg: #F7F7F7;
  --white: #fff;
  --danger: #E74C3C;
  --warning: #F39C12;
  --info: #3498DB;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--navy);
  font-size: 14px;
  line-height: 1.5;
}

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

.sidebar {
  width: 230px;
  background: var(--navy);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 18px 16px;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand svg { flex-shrink: 0; }

.sidebar nav { padding: 10px 0; flex: 1; overflow-y: auto; }

.sidebar nav button,
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 18px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

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

.sidebar nav button.active,
.sidebar nav a.active {
  background: rgba(26,187,156,0.18);
  color: #fff;
  border-left: 3px solid var(--teal);
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  padding: 14px 22px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar h1 { margin: 0; font-size: 20px; font-weight: 600; }

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

.search-box {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  width: 200px;
  background: #fafbfc;
}

.badge-live {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(26,187,156,0.12);
  padding: 4px 10px;
  border-radius: 999px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), #15967d);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.content { flex: 1; overflow-y: auto; padding: 20px 22px 28px; }

.page { display: none; }
.page.active { display: block; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.stat .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat .value { font-size: 28px; font-weight: 700; margin: 6px 0 2px; }
.stat .change { font-size: 12px; font-weight: 600; }
.stat .change.up { color: var(--teal); }
.stat .change.down { color: var(--danger); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body { padding: 18px; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th,
table.data td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.data th {
  background: #f8f9fa;
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

table.data tr:hover td { background: rgba(26,187,156,0.04); }

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.pill.success { background: rgba(26,187,156,0.15); color: #12866f; }
.pill.warning { background: rgba(243,156,18,0.18); color: #9a6209; }
.pill.danger { background: rgba(231,76,60,0.15); color: #c0392b; }

.progress { height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 4px; background: var(--teal); transition: width 0.4s; }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.activity-item:last-child { border: 0; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  margin-top: 6px;
  flex-shrink: 0;
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s;
  pointer-events: none;
  z-index: 200;
}

.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar nav { display: flex; overflow-x: auto; padding: 0; }
  .sidebar nav button { white-space: nowrap; border-left: 0 !important; }
  .search-box { display: none; }
}
