:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-card: #1e2130;
  --bg-hover: #252840;
  --border: #2a2d3e;
  --text-primary: #e2e8f0;
  --text-secondary: #8892a4;
  --text-muted: #4a5568;
  --accent: #4f7cff;
  --accent-hover: #6b8fff;
  --accent-dim: rgba(79, 124, 255, 0.12);
  --success: #48bb78;
  --danger: #f56565;
  --warning: #ecc94b;
  --sidebar-width: 240px;
}

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

body {
  font-family: 'Pretendard', 'Apple SD Gothic Neo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.6;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.sidebar-logo span {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

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

.nav-section {
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  margin-bottom: 2px;
}

.nav-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--accent-dim);
  color: var(--accent);
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Main content ── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 56px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.content {
  padding: 28px;
  flex: 1;
}

/* ── Cards ── */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-action {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.card-action:hover {
  color: var(--accent-hover);
}

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

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.stat-change {
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}

.up { color: var(--danger); }
.down { color: var(--accent); }
.neutral { color: var(--text-muted); }

/* ── Report list ── */
.report-list {
  list-style: none;
}

.report-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
  cursor: pointer;
}

.report-item:last-child {
  border-bottom: none;
}

.report-item:hover .report-title {
  color: var(--accent);
}

.report-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.report-icon svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.report-info {
  flex: 1;
  min-width: 0;
}

.report-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}

.report-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.report-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background-color: var(--accent-dim);
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Quick links ── */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.15s;
  text-align: center;
}

.quick-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background-color: var(--accent-dim);
}

.quick-link svg {
  width: 22px;
  height: 22px;
  opacity: 0.8;
}

/* ── Responsive ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content {
    padding: 16px;
  }
}
