:root {
  color-scheme: dark;
  --bg: #09111f;
  --panel: #121c2f;
  --panel-alt: #0f1729;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef2ff;
  --muted: #9aa8c7;
  --blue: #3b82f6;
  --blue-2: #2563eb;
  --green: #16a34a;
  --red: #ef4444;
  --yellow: #f59e0b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #13213e, var(--bg));
  color: var(--text);
}

.hidden { display: none !important; }
.layout { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(4, 10, 20, 0.75);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; }
.content { padding: 30px; }
.stack { display: flex; flex-direction: column; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 20px; }
.field-label, .muted { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.compact { align-items: start; }
.panel {
  background: linear-gradient(180deg, rgba(18, 28, 47, 0.95), rgba(12, 20, 36, 0.95));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.22);
}
.hero-panel { min-height: 100%; justify-content: center; }
.hero-panel h1, .header-row h1 { font-size: 42px; line-height: 1.05; margin: 10px 0 12px; letter-spacing: -0.04em; }
.hero-panel p { max-width: 650px; color: #c9d6f5; }
.feature-list { line-height: 1.9; color: #dbe7ff; padding-left: 18px; }
.panel-header, .header-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.header-row { margin-bottom: 6px; }
.input, .textarea, select, button {
  font: inherit;
}
.input, .textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: 12px 14px;
}
.input::placeholder, .textarea::placeholder { color: #7f8eb0; }
.textarea { min-height: 110px; resize: vertical; }
.button {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 600;
}
.button.primary { background: linear-gradient(180deg, var(--blue), var(--blue-2)); color: white; }
.button.ghost { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid var(--line); }
.button.link { background: transparent; color: #9dc0ff; padding: 0; }
.badge { display: inline-flex; width: fit-content; border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: rgba(59, 130, 246, 0.18); color: #bdd4ff; }
.nav { display: flex; flex-direction: column; gap: 8px; }
.nav-link {
  text-align: left;
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  color: var(--text);
  padding: 11px 14px;
  border-radius: 14px;
}
.nav-link.active { background: rgba(59,130,246,0.16); border-color: rgba(59,130,246,0.4); }
.session-card { background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.checkbox { display: inline-flex; gap: 10px; align-items: center; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,0.07); vertical-align: top; }
.table th { color: #8ca4d9; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi { padding: 18px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); }
.kpi-value { font-size: 30px; font-weight: 800; margin-top: 10px; }
.inline-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,0.08); color: #d9e5ff; font-size: 12px; }
.status { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status.active, .status.accepted, .status.enabled { background: rgba(22, 163, 74, 0.15); color: #9ef2b3; }
.status.pending { background: rgba(245, 158, 11, 0.15); color: #f7cf7b; }
.status.suspended, .status.revoked, .status.disabled { background: rgba(239, 68, 68, 0.16); color: #ffb0b0; }
.status.expired { background: rgba(148, 163, 184, 0.14); color: #d5dff1; }
.margin-top { margin-top: 16px; }
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  padding: 14px 16px;
  background: rgba(12, 18, 31, 0.95);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.25);
  max-width: 360px;
}
.small { font-size: 13px; color: var(--muted); }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .grid.two-col, .grid.three-col { grid-template-columns: 1fr; }
}

.status.running { background: rgba(59, 130, 246, 0.18); color: #bdd4ff; }
.status.completed, .status.success { background: rgba(22, 163, 74, 0.15); color: #9ef2b3; }
.status.failed { background: rgba(239, 68, 68, 0.16); color: #ffb0b0; }
.status.cancelled { background: rgba(148, 163, 184, 0.14); color: #d5dff1; }
.status.queued { background: rgba(245, 158, 11, 0.15); color: #f7cf7b; }
.list-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.list-card.clickable { cursor: pointer; }
.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.metric-row:last-child { border-bottom: 0; }
.source-list {
  display: grid;
  gap: 8px;
}
.source-item {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}
