:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #0b1220;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #6366f1;
  --primary-600: #4f46e5;
  --accent: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border: #1f2937;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  padding: 24px;
  font: 14px system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), #0b1220 60%);
}

a { color: #7dd3fc; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1120px; margin: 0 auto; }
.header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.title { font-size: 28px; font-weight: 700; }
.tabs { display:flex; gap:8px; margin: 16px 0 8px; }
.tab { padding:10px 12px; border-radius:10px; background: var(--panel); border:1px solid var(--border); color: var(--muted); cursor:pointer; display:flex; align-items:center; gap:8px; }
.tab .icon { opacity:0.8; }
.tab.active { color:#fff; background: var(--primary); border-color: var(--primary); }

.card { background: rgba(255,255,255,0.02); border:1px solid var(--border); border-radius:12px; padding:16px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.controls { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-bottom: 12px; }
.row { display:flex; flex-direction:column; gap:6px; margin:6px 0; }
label { font-weight:600; color:#cbd5e1; }
input, select, button { padding: 8px 10px; font-size:14px; background: var(--panel); color: var(--text); border:1px solid var(--border); border-radius:8px; }
input::placeholder { color: #6b7280; }
button { cursor:pointer; }
button.primary { background: var(--primary); border-color: var(--primary); }
button.primary:hover { background: var(--primary-600); }
button.ghost { background: transparent; border-color: var(--border); }
button.danger { background: var(--danger); border-color: var(--danger); }

table { width:100%; border-collapse:separate; border-spacing:0; margin-top:12px; }
th, td { padding: 10px 12px; border-bottom:1px solid var(--border); }
th { text-align:left; color:#a6adbb; position:sticky; top:0; background: linear-gradient(180deg, #0b1220, #0b1220cc); backdrop-filter: blur(4px); }
tr:hover td { background: rgba(255,255,255,0.02); }
.badge { display:inline-block; padding:2px 8px; font-size:12px; border-radius:999px; border:1px solid var(--border); color:#cbd5e1; }
.badge.green { background: rgba(34,197,94,0.12); border-color: #14532d; color:#86efac; }
.badge.gray { background: rgba(148,163,184,0.12); border-color: #334155; color:#cbd5e1; }

.pagination { margin-top: 12px; display:flex; align-items:center; gap:8px; }
.error { color: #fecaca; margin-left: 8px; }

.hidden { display:none; }
.drag-handle { cursor: grab; user-select:none; opacity:0.7; }
.thumb { width:48px; height:32px; object-fit:cover; border-radius:6px; border:1px solid var(--border); }

/* Sidebar dashboard layout */
.layout { display:flex; gap:16px; }
.sidebar { width: 240px; background: var(--panel-2); border:1px solid var(--border); border-radius:16px; padding:16px; height: calc(100vh - 72px); position: sticky; top: 24px; display:flex; flex-direction:column; }
.sidebar .brand { margin-bottom: 8px; }
.sidebar .logo { margin:0; font-size:18px; }
.sidebar .small { color: var(--muted); font-size: 12px; }
.sidebar .nav { display:flex; flex-direction:column; gap:8px; margin-top:12px; }
.sidebar .tab { width:100%; justify-content:flex-start; }
.sidebar .tab.active { box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset; }
.sidebar .spacer { flex:1; }
.sidebar .meta { display:flex; align-items:center; justify-content:flex-start; }
.main { flex:1; display:flex; flex-direction:column; gap:16px; }

@media (max-width: 900px){
  .layout { flex-direction:column; }
  .sidebar { position:relative; height:auto; }
}

/* Analytics summary metrics */
.metrics { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:12px; margin: 12px 0 8px; }
.metric { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display:flex; flex-direction:column; gap:4px; }
.metric .label { color: var(--muted); font-size: 12px; }
.metric .value { font-size: 20px; font-weight: 700; }

.chart-wrap { width: 100%; overflow: hidden; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); }
