/* ═══════════════════════════════════════════
   NEURAL × PULSE — CORE DESIGN TOKENS
   Single source of truth for all OMNIS pages
   ═══════════════════════════════════════════ */
:root {
  /* Signal */
  --c: #E8234A;
  --cd: #C41D3E;
  --cl: rgba(232, 35, 74, .08);
  --cf: rgba(232, 35, 74, .18);
  --cg: 0 2px 8px rgba(232,35,74,.2);
  --cgx: 0 0 40px rgba(232,35,74,.06);

  /* Substrate */
  --bg: #030305;
  --s1: #08080B;
  --s2: #0D0D11;
  --s3: #121216;

  /* Borders */
  --b: rgba(255, 255, 255, .045);
  --bh: rgba(255, 255, 255, .08);
  --bf: var(--cf);

  /* Text */
  --t1: #E8E8EC;
  --t2: #7C7C86;
  --t3: #4A4A54;
  --w: #FFFFFF;

  /* Status */
  --g: #2DD4A8;
  --gb: rgba(45, 212, 168, .07);
  --am: #E5A011;
  --ab: rgba(229, 160, 17, .07);
  --rd: #E84545;
  --rb: rgba(232, 69, 69, .07);
  --bl: #00C2F0;
  --bb: rgba(0, 194, 240, .07);
  --p: #9F6CF7;
  --pb: rgba(159, 108, 247, .07);

  /* Radius */
  --r: 10px;
  --rl: 14px;

  /* Shadows */
  --sh-modal: 0 32px 80px rgba(0,0,0,.6), var(--cgx);
  --sh-btn: var(--cg);

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--t1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* Noise overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.012;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


/* ═══════════════════════════════════════════
   NXP COMPONENTS — CANONICAL DEFINITIONS
   Copy these exactly. No freestyle.
   ═══════════════════════════════════════════ */

/* === BUTTONS === */
.btn {
  font-family: 'Figtree', sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--cf); outline-offset: 2px; }

.btn-p { background: var(--c); color: #fff; box-shadow: var(--sh-btn); }
.btn-p:hover { background: var(--cd); box-shadow: 0 4px 16px rgba(232,35,74,.3); }
.btn-p:disabled { background: var(--t3); color: var(--t2); box-shadow: none; cursor: not-allowed; }

.btn-o { background: transparent; color: var(--t2); border: 1px solid var(--b); }
.btn-o:hover { border-color: var(--bh); color: var(--t1); }
.btn-o:disabled { color: var(--t3); border-color: rgba(255,255,255,.02); cursor: not-allowed; }

.btn-ghost { background: transparent; color: var(--t2); border: none; }
.btn-ghost:hover { color: var(--t1); background: rgba(255,255,255,.04); }

.btn-danger { background: var(--rb); color: var(--rd); border: 1px solid rgba(232,69,69,.15); }
.btn-danger:hover { background: rgba(232,69,69,.12); border-color: rgba(232,69,69,.25); }

.btn-success { background: var(--gb); color: var(--g); border: 1px solid rgba(45,212,168,.15); }
.btn-success:hover { background: rgba(45,212,168,.12); border-color: rgba(45,212,168,.25); }

.btn-ai { background: var(--pb); color: var(--p); border: 1px solid rgba(159,108,247,.12); }
.btn-ai:hover { background: rgba(159,108,247,.12); border-color: rgba(159,108,247,.2); }

.btn-icon { width: 28px; height: 28px; border-radius: 8px; padding: 0; justify-content: center; background: rgba(255,255,255,.03); border: 1px solid var(--b); color: var(--t3); }
.btn-icon:hover { background: rgba(255,255,255,.06); color: var(--t1); }

.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.6rem; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.7rem; }
.btn-md { padding: 0.4rem 1rem; font-size: 0.78rem; }
.btn-lg { padding: 0.5rem 1.25rem; font-size: 0.85rem; }

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.6rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-g { background: var(--gb); color: var(--g); }
.badge-g::before { background: var(--g); }
.badge-am { background: var(--ab); color: var(--am); }
.badge-am::before { background: var(--am); }
.badge-rd { background: var(--rb); color: var(--rd); }
.badge-rd::before { background: var(--rd); }
.badge-bl { background: var(--bb); color: var(--bl); }
.badge-bl::before { background: var(--bl); }
.badge-p { background: var(--pb); color: var(--p); }
.badge-p::before { background: var(--p); }
.badge-n { background: rgba(124,124,134,.06); color: var(--t2); }
.badge-n::before { background: var(--t3); }

.badge-live::before { animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* === CARDS === */
.card {
  background: var(--s1);
  border: 1px solid var(--b);
  border-radius: var(--rl);
  overflow: hidden;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--bh); }

.card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--b);
}
.card-title { font-weight: 600; font-size: 0.78rem; }
.card-body { padding: 0.75rem 1rem; }

/* KPI Card */
.kpi-card {
  background: var(--s1);
  border: 1px solid var(--b);
  border-radius: var(--rl);
  padding: 1rem;
  transition: border-color 0.15s;
}
.kpi-card:hover { border-color: var(--bh); }
.kpi-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t3);
  margin-bottom: 0.35rem;
}
.kpi-val {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  line-height: 1;
}
.kpi-sub {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.4rem;
  font-size: 0.65rem;
}
.kpi-up { color: var(--g); }
.kpi-down { color: var(--rd); }
.kpi-flat { color: var(--t3); }

/* === FORMS === */
.fi {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--s2);
  border: 1px solid var(--b);
  border-radius: 8px;
  color: var(--t1);
  font-family: 'Figtree', sans-serif;
  font-size: 0.8rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fi:focus { outline: none; border-color: var(--bf); box-shadow: 0 0 0 3px rgba(232,35,74,.08); }
.fi::placeholder { color: var(--t3); }
.fi:disabled { opacity: 0.4; cursor: not-allowed; }

.fi-error { border-color: rgba(232,69,69,.4); }
.fi-error:focus { box-shadow: 0 0 0 3px rgba(232,69,69,.08); }

.fi-success { border-color: rgba(45,212,168,.4); }

.fl {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  font-weight: 500;
  color: var(--t3);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fi-help {
  font-size: 0.62rem;
  color: var(--t3);
  margin-top: 3px;
}
.fi-help.error { color: var(--rd); }

/* Search input */
.fi-search {
  padding-left: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234A4A54' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.65rem center;
  border-radius: 100px;
}

/* Select */
select.fi {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234A4A54' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}

/* Toggle */
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  cursor: pointer;
}
.toggle input { display: none; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--s3);
  border: 1px solid var(--b);
  border-radius: 100px;
  transition: all 0.2s;
}
.toggle input:checked + .toggle-track { background: var(--cl); border-color: rgba(232,35,74,.2); }
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--t2);
  transition: all 0.2s;
}
.toggle input:checked ~ .toggle-thumb { left: 19px; background: var(--c); }

/* Checkbox */
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.75rem;
}
.check input { display: none; }
.check-box {
  width: 16px;
  height: 16px;
  border: 1px solid var(--b);
  border-radius: 4px;
  background: var(--s2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.check input:checked + .check-box {
  background: var(--c);
  border-color: var(--c);
}
.check input:checked + .check-box::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

/* === DATA TABLE === */
.ct { width: 100%; border-collapse: collapse; }
.ct th {
  text-align: left;
  padding: 0.45rem 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  font-weight: 500;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--b);
  background: var(--s2);
}
.ct td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,.02);
  font-size: 0.73rem;
}
.ct tr:hover td { background: rgba(255,255,255,.015); }
.ct td .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: -0.01em;
}

/* === DOCK TILES === */
.dk {
  background: var(--s2);
  border: 1px solid var(--b);
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
  text-align: center;
  transition: all 0.15s;
  cursor: pointer;
  position: relative;
}
.dk:hover { border-color: var(--bh); transform: translateY(-1px); }
.dk::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 6px 6px 0 0;
}
.dk.free::before { background: var(--t3); opacity: .3; }
.dk.load::before { background: var(--g); }
.dk.unload::before { background: var(--bl); }
.dk.queue::before { background: var(--am); }
.dk.alert::before { background: var(--rd); }

.dk.load { border-color: rgba(45,212,168,.2); background: rgba(45,212,168,.03); }
.dk.unload { border-color: rgba(0,194,240,.2); background: rgba(0,194,240,.03); }
.dk.queue { border-color: rgba(229,160,17,.2); background: rgba(229,160,17,.03); }
.dk.alert { border-color: rgba(232,69,69,.2); background: rgba(232,69,69,.03); }

.dk-code {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 0.75rem;
}
.dk-sub {
  font-size: 0.55rem;
  color: var(--t3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === ACTIVITY FEED === */
.fd {
  display: flex;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255,255,255,.02);
}
.fd:last-child { border: none; }
.fd-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.fd-dot.ok { background: var(--g); }
.fd-dot.warn { background: var(--am); }
.fd-dot.err { background: var(--rd); }
.fd-dot.info { background: var(--bl); }
.fd-dot.ai { background: var(--p); }
.fd-text {
  font-size: 0.7rem;
  color: var(--t2);
  line-height: 1.45;
  flex: 1;
}
.fd-text b { color: var(--t1); font-weight: 500; }
.fd-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: var(--t3);
  margin-top: 1px;
  flex-shrink: 0;
}

/* === TOAST NOTIFICATIONS === */
.toast-wrap {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  transform: translateX(120%);
  transition: transform 0.3s var(--ease);
  pointer-events: auto;
}
.toast.show { transform: translateX(0); }
.t-ok { background: var(--g); color: #050507; }
.t-err { background: var(--rd); color: #fff; }
.t-warn { background: var(--am); color: #050507; }
.t-info { background: var(--bl); color: #050507; }

/* === AI PILL === */
.ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--pb);
  border: 1px solid rgba(159,108,247,.12);
  border-radius: 100px;
  font-size: 0.68rem;
  color: var(--p);
  cursor: pointer;
  transition: all 0.15s;
}
.ai-pill:hover { background: rgba(159,108,247,.1); border-color: rgba(159,108,247,.2); }
.ai-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--p);
  animation: pulse 2s infinite;
}

/* === MODAL === */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--s1);
  border: 1px solid var(--b);
  border-radius: 16px;
  padding: 1.5rem;
  width: 90%;
  max-width: 440px;
  box-shadow: var(--sh-modal);
}
.modal-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}
.modal-desc {
  color: var(--t2);
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* === TABS === */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--b);
}
.tab {
  padding: 0.55rem 1rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--t3);
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'Figtree', sans-serif;
}
.tab:hover { color: var(--t2); }
.tab.active { color: var(--c); border-bottom-color: var(--c); }

/* === PROGRESS BAR === */
.prog-track {
  height: 4px;
  background: var(--s3);
  border-radius: 100px;
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.6s var(--ease);
}
.prog-fill.g { background: var(--g); }
.prog-fill.c { background: var(--c); }
.prog-fill.am { background: var(--am); }
.prog-fill.rd { background: var(--rd); }
.prog-fill.p { background: var(--p); }

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--s2);
  border: 1px solid var(--b);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--t3);
}
.empty-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.empty-desc {
  color: var(--t3);
  font-size: 0.72rem;
  max-width: 280px;
  margin: 0 auto 1rem;
  line-height: 1.5;
}

/* === SKELETON LOADING === */
.skel {
  background: linear-gradient(90deg, var(--s2) 25%, var(--s3) 50%, var(--s2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* === TOOLTIP === */
.tip {
  position: relative;
}
.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  padding: 4px 8px;
  background: var(--s3);
  border: 1px solid var(--b);
  border-radius: 6px;
  font-size: 0.6rem;
  color: var(--t1);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.15s;
}
.tip:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }

/* === DIVIDER === */
.divider {
  height: 1px;
  background: var(--b);
  margin: 1rem 0;
}

/* === AVATAR === */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--s3);
  border: 1px solid var(--b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  font-weight: 500;
  color: var(--t2);
  flex-shrink: 0;
}
.avatar.sm { width: 22px; height: 22px; font-size: 0.48rem; }
.avatar.lg { width: 36px; height: 36px; font-size: 0.65rem; }

