:root {
  --bg: #f7f8ff;
  --ink: #11132c;
  --muted: #687086;
  --line: #e4e7f2;
  --surface: #ffffff;
  --primary: #7c3aed;
  --pink: #ec4899;
  --blue: #2563eb;
  --green: #10b981;
  --orange: #f97316;
  --red: #ef4444;
  --shadow: 0 20px 50px rgba(17,24,39,.07);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.brand { display: inline-flex; gap: 12px; align-items: center; font-weight: 900; font-size: 25px; letter-spacing: -.04em; }
.brand span span { color: #a78bfa; }
.logo-bars { display: inline-flex; gap: 3px; align-items: center; }
.logo-bars i { width: 5px; border-radius: 999px; background: linear-gradient(180deg, #ec4899, #7c3aed, #2563eb); display: block; }
.logo-bars i:nth-child(1) { height: 18px; background: linear-gradient(180deg,#fb7185,#f97316); }
.logo-bars i:nth-child(2) { height: 29px; }
.logo-bars i:nth-child(3) { height: 38px; }
.logo-bars i:nth-child(4) { height: 29px; background: linear-gradient(180deg,#a855f7,#2563eb); }
.logo-bars i:nth-child(5) { height: 18px; background: linear-gradient(180deg,#38bdf8,#7c3aed); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; padding: 26px 18px; color: white; background: radial-gradient(circle at 20% 0%, rgba(124,58,237,.45), transparent 18rem), linear-gradient(180deg,#080b23,#121536); display: flex; flex-direction: column; gap: 28px; }
.sidebar nav { display: flex; flex-direction: column; gap: 8px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 14px; color: rgba(255,255,255,.82); font-weight: 800; }
.sidebar nav a.active, .sidebar nav a:hover { background: linear-gradient(135deg,#7c3aed,#4c1d95); color: white; }
.system-card { margin-top: auto; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 16px; }
.system-card span { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; display: inline-block; margin-right: 8px; }
.system-card strong { font-size: 13px; }
.system-card p { color: rgba(255,255,255,.65); margin: 6px 0 0; }
.sidebar small { color: rgba(255,255,255,.48); }
.dashboard { margin-left: 280px; min-height: 100vh; padding: 24px clamp(20px, 3vw, 42px); }
.dash-header { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 20px; }
.dash-header h1 { margin: 0; font-size: 34px; letter-spacing: -.05em; }
.dash-header p { margin: 6px 0 0; color: var(--muted); }
.dash-actions { display: flex; align-items: center; gap: 10px; }
.primary, .ghost { border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 900; cursor: pointer; }
.primary { color: white; background: linear-gradient(135deg,var(--primary),var(--pink)); box-shadow: 0 16px 34px rgba(124,58,237,.25); }
.ghost { background: white; border: 1px solid var(--line); color: var(--ink); }
.ghost.tiny { padding: 7px 10px; border-radius: 10px; font-size: 12px; }
.alert { border-radius: 16px; padding: 14px 16px; margin-bottom: 18px; font-weight: 800; }
.alert.success { background: #ecfdf5; color: #047857; border: 1px solid #bbf7d0; }
.alert.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.metrics article { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); }
.icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-weight: 900; font-size: 23px; }
.icon.purple { background: #f3e8ff; color: var(--primary); }
.icon.blue { background: #dbeafe; color: var(--blue); }
.icon.green { background: #dcfce7; color: #16a34a; }
.icon.red { background: #fee2e2; color: var(--red); }
.icon.orange { background: #ffedd5; color: var(--orange); }
.metrics p { margin: 0 0 4px; color: var(--muted); font-weight: 800; font-size: 13px; }
.metrics strong { font-size: 27px; letter-spacing: -.04em; }
.metrics small { display: block; color: var(--muted); margin-top: 3px; }
.dash-grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(340px, .86fr); gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 22px; overflow: hidden; }
.panel.wide { grid-column: span 1; }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel h2 { margin: 0; letter-spacing: -.04em; }
.panel p { color: var(--muted); margin: 6px 0 0; line-height: 1.45; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.pill.green { color: #047857; background: #dcfce7; }
.pill.red { color: #b91c1c; background: #fee2e2; }
.pill.purple { color: #6d28d9; background: #f3e8ff; }
.pill.light { color: #4338ca; background: #eef2ff; }
.workflow { display: grid; grid-template-columns: repeat(5, minmax(130px,1fr)); gap: 14px; align-items: center; overflow-x: auto; }
.workflow b { color: #9ca3af; text-align: center; display: none; }
.workflow div { min-height: 154px; border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: linear-gradient(180deg,#fff,#fbfbff); }
.workflow span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--primary); background: #f3e8ff; font-weight: 900; margin-bottom: 12px; }
.workflow strong { display: block; }
.workflow p { font-size: 13px; }
.source-methods { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.source-methods span { border: 1px solid var(--line); background: #fbfbff; border-radius: 14px; padding: 11px 13px; color: var(--muted); font-weight: 800; }
.source-methods strong { color: var(--ink); margin-left: 4px; }
.stream-list, .queue-list { display: grid; gap: 12px; }
.stream-list > div, .queue-list > div { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: #fbfbff; border: 1px solid #eef0f8; }
.tiny-art, .thumb { width: 44px; height: 44px; border-radius: 13px; color: white; display: grid; place-items: center; font-weight: 900; background: linear-gradient(135deg,var(--primary),var(--pink)); }
.accent-blue { background: linear-gradient(135deg,#2563eb,#0f172a); }
.accent-orange { background: linear-gradient(135deg,#f97316,#dc2626); }
.accent-purple { background: linear-gradient(135deg,#7c3aed,#be185d); }
.accent-pink { background: linear-gradient(135deg,#ec4899,#312e81); }
.accent-red { background: linear-gradient(135deg,#ef4444,#991b1b); }
.accent-green { background: linear-gradient(135deg,#10b981,#064e3b); }
.accent-violet { background: linear-gradient(135deg,#8b5cf6,#4c1d95); }
.accent-navy { background: linear-gradient(135deg,#111827,#312e81); }
.stream-list strong, .queue-list strong { display: block; font-size: 14px; }
.stream-list p, .queue-list p { margin: 3px 0 0; font-size: 12px; }
.status { font-style: normal; border-radius: 999px; padding: 6px 9px; font-size: 12px; font-weight: 900; }
.status.active { background: #dcfce7; color: #047857; }
.status.warning { background: #fef3c7; color: #92400e; }
.status.inactive, .status.error { background: #fee2e2; color: #b91c1c; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); }
td strong, td small { display: block; }
td small { color: var(--muted); margin-top: 4px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.chart-grid div { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fbfbff; }
.chart-grid strong { font-size: 28px; letter-spacing: -.04em; }
.chart-grid svg { width: 100%; height: 88px; margin-top: 8px; }
.chart-grid polyline { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.strategy { color: white; background: radial-gradient(circle at 95% 10%, rgba(236,72,153,.55), transparent 16rem), linear-gradient(135deg,#0b1028,#17123c); }
.strategy p { color: rgba(255,255,255,.72); }
.strategy-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 18px; }
.strategy-grid span { padding: 16px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); font-weight: 900; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 30% 10%, rgba(124,58,237,.22), transparent 28rem), #f8f8ff; }
.login-card { width: min(460px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 28px; padding: 30px; }
.login-card h1 { margin: 28px 0 8px; font-size: 34px; letter-spacing: -.05em; }
.login-card p { color: var(--muted); line-height: 1.5; }
.login-card form { display: grid; gap: 14px; margin: 22px 0; }
.login-card label { display: grid; gap: 8px; font-weight: 900; }
.login-card input { border: 1px solid var(--line); border-radius: 14px; height: 48px; padding: 0 13px; outline: 0; }
.login-card code { background: #f3e8ff; padding: 2px 6px; border-radius: 6px; }
@media (max-width: 1180px) {
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .workflow { grid-template-columns: repeat(2, minmax(130px,1fr)); }
}
@media (max-width: 820px) {
  .sidebar { position: static; width: auto; border-radius: 0 0 28px 28px; }
  .dashboard { margin-left: 0; }
  .dash-header, .dash-actions { align-items: stretch; flex-direction: column; }
  .metrics, .chart-grid { grid-template-columns: 1fr; }
  .workflow { grid-template-columns: 1fr; }
}
