:root {
  --bg: #0b0f14;
  --sidebar: #111827;
  --card: #151d2b;
  --card-hover: #1a2436;
  --border: #243044;
  --text: #e8edf5;
  --muted: #8b9cb3;
  --accent: #3b82f6;
  --accent-soft: rgba(59,130,246,.12);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --chat: #ec4899;
  --purple: #8b5cf6;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0,0,0,.25);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.brand {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.brand h1 { font-size: 1.25rem; font-weight: 700; }
.brand h1 span { color: var(--accent); }
.brand p { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.search-box { padding: 12px 16px; }
.search-box input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: .9rem;
}
.emp-list { flex: 1; overflow-y: auto; padding: 8px; }
.emp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 4px;
  transition: .15s;
  border: 1px solid transparent;
}
.emp-item:hover { background: var(--card); }
.emp-item.active { background: var(--accent-soft); border-color: rgba(59,130,246,.3); }
.emp-avatar {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.emp-info { flex: 1; min-width: 0; }
.emp-name { font-weight: 600; font-size: .95rem; }
.emp-meta { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.emp-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.emp-status.online { background: var(--success); box-shadow: 0 0 8px var(--success); }
.emp-status.offline { background: #4b5563; }
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--muted);
}

/* Main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar-left h2 { font-size: 1.2rem; }
.topbar-left .sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.content { flex: 1; padding: 20px 24px; overflow-y: auto; }

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-card .label { color: var(--muted); font-size: .8rem; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; margin-top: 6px; }
.stat-card .value.blue { color: var(--accent); }
.stat-card .value.green { color: var(--success); }
.stat-card .value.pink { color: var(--chat); }
.stat-card .value.purple { color: var(--purple); }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
}
.tab {
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  color: var(--muted);
  border: none;
  background: transparent;
  transition: .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: #fff; }

/* Cards */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.panel-header h3 { font-size: 1rem; color: var(--muted); font-weight: 500; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Buttons */
.btn {
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: .88rem;
  transition: .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover { background: #7c3aed; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
select, input[type=date], input[type=datetime-local] {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .88rem;
}

/* Charts */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: .85rem; }
.bar-label { width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.bar-track { flex: 1; height: 24px; background: rgba(255,255,255,.04); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), #60a5fa); transition: width .4s; }
.bar-time { width: 60px; text-align: right; color: var(--muted); font-size: .8rem; }

.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut {
  width: 140px; height: 140px; border-radius: 50%;
  position: relative; flex-shrink: 0;
}
.donut-hole {
  position: absolute; inset: 28px; background: var(--card); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; color: var(--muted); text-align: center;
}
.legend { flex: 1; }
.legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .85rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }

/* Timeline */
.v-timeline { position: relative; padding-left: 24px; max-height: 520px; overflow-y: auto; }
.v-timeline::before {
  content: ''; position: absolute; left: 7px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding: 0 0 20px 20px; }
.tl-dot {
  position: absolute; left: -24px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--card); background: var(--accent);
}
.tl-dot.chat { background: var(--chat); }
.tl-dot.browser { background: var(--warning); }
.tl-dot.dev { background: var(--success); }
.tl-time { font-family: monospace; font-size: .8rem; color: var(--accent); }
.tl-title { font-weight: 600; margin-top: 4px; }
.tl-meta { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.tl-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: .7rem; background: var(--accent-soft); color: var(--accent); margin-top: 6px;
}

/* Screenshots */
.ss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  max-height: 600px;
  overflow-y: auto;
}
.ss-card {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: .15s;
}
.ss-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.ss-card img { width: 100%; height: 130px; object-fit: cover; display: block; }
.ss-card .info { padding: 10px; font-size: .78rem; color: var(--muted); }
.ss-card .time { color: var(--accent); font-family: monospace; margin-bottom: 4px; }

/* Report */
.report-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.report-list { list-style: none; max-height: 500px; overflow-y: auto; }
.report-list li {
  padding: 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; margin-bottom: 4px; font-size: .85rem;
}
.report-list li:hover, .report-list li.active { background: var(--accent-soft); border-color: rgba(59,130,246,.2); }
.report-list .rtype { font-size: .7rem; color: var(--muted); margin-top: 4px; }
.report-body {
  background: #0d1117; border: 1px solid var(--border); border-radius: 10px;
  padding: 24px; max-height: 600px; overflow-y: auto; line-height: 1.8;
}
.report-body h1 { font-size: 1.4rem; margin-bottom: 12px; }
.report-body h2 { font-size: 1.15rem; margin: 20px 0 10px; color: var(--accent); }
.report-body h3 { font-size: 1rem; margin: 16px 0 8px; }
.report-body ul { padding-left: 20px; margin: 8px 0; }
.report-body li { margin-bottom: 4px; }
.report-body p { margin-bottom: 10px; }
.report-body strong { color: #fff; }

/* Modal */
.modal {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.9); align-items: center; justify-content: center;
}
.modal.open { display: flex; }
.modal-box { max-width: 92vw; max-height: 92vh; position: relative; }
.modal-box img { max-width: 92vw; max-height: 80vh; border-radius: 8px; }
.modal-info {
  background: var(--card); padding: 16px; border-radius: 0 0 8px 8px;
  margin-top: -4px; font-size: .9rem;
}
.modal-close {
  position: absolute; top: -40px; right: 0; background: none; border: none;
  color: #fff; font-size: 1.5rem; cursor: pointer;
}
.modal-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1); border: none; color: #fff;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 1.2rem;
}
.modal-nav.prev { left: -60px; }
.modal-nav.next { right: -60px; }

/* Toast & Loading */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  background: var(--card); border: 1px solid var(--border);
  padding: 14px 20px; border-radius: 10px; box-shadow: var(--shadow);
  transform: translateY(100px); opacity: 0; transition: .3s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-color: var(--danger); }
.loading-overlay {
  display: none; position: fixed; inset: 0; z-index: 1500;
  background: rgba(0,0,0,.5); align-items: center; justify-content: center;
}
.loading-overlay.show { display: flex; }
.spinner {
  width: 48px; height: 48px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.empty .icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .5; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

@media (max-width: 1100px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .report-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; max-height: 200px; }
}
