:root {
  --sidebar: #111827;
  --sidebar-2: #1f2937;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #4f46e5;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2)); color: white; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 800; font-size: 21px; letter-spacing: -0.02em; margin-bottom: 26px; }
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.sidebar a { color: #d1d5db; text-decoration: none; padding: 11px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.sidebar a:hover, .sidebar a.active { color: white; background: rgba(255,255,255,0.12); }

.main { flex: 1; min-width: 0; }
.topbar { background: white; border-bottom: 1px solid #e5e7eb; padding: 22px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
#site-filter { min-width: 180px; }

.content { padding: 26px 28px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.metric-card, .panel { background: var(--card); border: 1px solid #e5e7eb; border-radius: 16px; box-shadow: 0 8px 24px rgba(15,23,42,0.04); }
.metric-card { padding: 20px; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.metric-value { font-size: 28px; font-weight: 800; margin-top: 8px; }
.metric-note { color: var(--muted); font-size: 13px; margin-top: 6px; }
.panel { margin-bottom: 22px; overflow: hidden; }
.panel-header { padding: 16px 18px; border-bottom: 1px solid #e5e7eb; display:flex; justify-content:space-between; align-items:center; gap:12px; }
.panel-title { margin: 0; font-weight: 800; font-size: 16px; }
.panel-body { padding: 18px; }
.table { margin: 0; }
.table th { color: #4b5563; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-soft { border-radius: 999px; padding: 6px 10px; font-weight: 700; font-size: 12px; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.action-row { display:flex; gap:8px; flex-wrap:wrap; }
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 9999; display: grid; gap: 10px; }
.toast-msg { background:#111827; color:white; border-radius:12px; padding:12px 14px; min-width:280px; box-shadow:0 12px 32px rgba(0,0,0,0.25); }
pre.json { background:#0f172a; color:#e5e7eb; padding:16px; border-radius:14px; overflow:auto; max-height:500px; }

@media (max-width: 980px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .sidebar nav { flex-direction: row; overflow-x: auto; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .metric-grid { grid-template-columns: 1fr; }
}
