
:root {
  color-scheme: dark;
  --bg: #09070f;
  --panel: #14101f;
  --panel-2: #1d162a;
  --ink: #f3eefc;
  --muted: #a89bb9;
  --line: #352847;
  --accent: #b76cff;
  --accent-2: #6df0cc;
  --warn: #ffd166;
  --danger: #ff6b7d;
  --ok: #72e38f;
  --shadow: 0 18px 50px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(183,108,255,.16), transparent 34rem),
    linear-gradient(145deg, #08070d 0%, #120d1a 55%, #060609 100%);
  color: var(--ink);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
button {
  border: 1px solid var(--line);
  background: #211733;
  color: var(--ink);
  border-radius: 8px;
  padding: .68rem .82rem;
  min-height: 42px;
  cursor: pointer;
}
button:hover { border-color: var(--accent); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 268px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: rgba(10,8,16,.82);
  border-right: 1px solid var(--line);
  overflow: auto;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.mark {
  width: 42px; height: 42px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #8c46ff, #241833);
  font-weight: 800;
}
.brand span, .sidebar-note span, .eyebrow, .muted { color: var(--muted); }
nav { display: grid; gap: 6px; }
.nav-link {
  text-align: left;
  width: 100%;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}
.nav-link.active, .nav-link:hover { color: var(--ink); background: #181123; border-color: var(--line); }
.sidebar-note {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #100c18;
  display: grid;
  gap: 4px;
}
.main { min-width: 0; padding: 22px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}
.topbar h1 { margin: 0; font-size: 2rem; line-height: 1.05; }
.eyebrow { margin: 0 0 4px; text-transform: uppercase; font-size: .74rem; letter-spacing: .08em; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.content-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.right-rail { display: grid; gap: 14px; position: sticky; top: 18px; }
.card {
  border: 1px solid var(--line);
  background: rgba(20,16,31,.92);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.card h2, .card h3 { margin: 0 0 10px; }
.metric-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #100c18; }
.metric strong { display: block; font-size: 1.35rem; }
.list { display: grid; gap: 8px; }
.item { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #100c18; }
.item-title { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: .16rem .52rem; color: var(--muted); white-space: nowrap; }
.tag.green { color: var(--ok); border-color: rgba(114,227,143,.45); }
.tag.yellow { color: var(--warn); border-color: rgba(255,209,102,.45); }
.tag.orange { color: #ffb86b; border-color: rgba(255,184,107,.45); }
.tag.red { color: var(--danger); border-color: rgba(255,107,125,.45); }
.path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.flow { display: grid; gap: 8px; }
.flow .item { border-left: 3px solid var(--accent); }
.code {
  display: block;
  padding: 10px;
  background: #07050b;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  color: #d8c7ec;
}
.mobile-priority { display: none; }
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #160f22;
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 1040px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout { grid-template-columns: 1fr; }
  .right-rail { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .main { padding: 12px; }
  .topbar { display: grid; }
  .top-actions { justify-content: stretch; }
  .top-actions button { flex: 1 1 150px; }
  nav { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .nav-link { min-width: 158px; }
  .mobile-priority { display: block; margin-bottom: 12px; }
  .content-grid, .right-rail, .path-grid, .metric-row { display: grid; grid-template-columns: 1fr; }
  .span-12, .span-8, .span-6, .span-4 { grid-column: span 1; }
  .item-title { display: grid; }
  button { min-height: 48px; }
}
