/**
 * NOXEN CSS FRAMEWORK v2.1.2
 * Layer 3 — Component System (25+ components)
 * All driven by nx="" attribute + modifiers.
 * Zero class names needed.
 */

/* ═══════════════════════════════════════
   CARD  nx="card"
═══════════════════════════════════════ */
[nx="card"] {
  background: var(--nx-color-surface);
  border: 1px solid var(--nx-color-border);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-space-6);
  position: relative;
  overflow: hidden;
  transition:
    transform var(--nx-duration-base) var(--nx-ease-spring),
    border-color var(--nx-duration-base),
    box-shadow var(--nx-duration-base);
}

[nx="card"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--nx-color-accent-lo), transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--nx-duration-base);
}

[nx="card"]:hover {
  transform: translateY(-4px);
  border-color: var(--nx-color-border-2);
  box-shadow: var(--nx-shadow-lg), var(--nx-shadow-glow);
}

[nx="card"]:hover::before {
  opacity: 1;
}

[nx="card"][no-hover]:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--nx-color-border);
}

[nx="card"][variant="ghost"] {
  background: transparent;
}

[nx="card"][variant="solid"] {
  background: var(--nx-color-surface-2);
  border-color: transparent;
}

[nx="card"][variant="raised"] {
  background: var(--nx-color-surface);
  box-shadow: var(--nx-shadow-md);
}

[nx="card"][variant="accent"] {
  background: var(--nx-color-accent-lo);
  border-color: var(--nx-color-border-2);
}

[nx="card"][variant="outline"] {
  background: transparent;
  border-color: var(--nx-color-border-2);
}

[nx="card"][variant="glass"] {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: rgba(255, 255, 255, 0.08);
}

[nx="card"][size="sm"] {
  padding: var(--nx-space-4);
  border-radius: var(--nx-radius-md);
}

[nx="card"][size="lg"] {
  padding: var(--nx-space-8);
  border-radius: var(--nx-radius-xl);
}

[nx="card"][size="xl"] {
  padding: var(--nx-space-9);
  border-radius: var(--nx-radius-2xl);
}

/* ═══════════════════════════════════════
   BUTTON  nx="btn"
═══════════════════════════════════════ */
[nx="btn"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--nx-space-2);
  padding: 10px var(--nx-space-6);
  border-radius: var(--nx-radius-full);
  border: none;
  font-family: var(--nx-font-display);
  font-size: var(--nx-text-sm);
  font-weight: 600;
  letter-spacing: var(--nx-tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: var(--nx-color-accent);
  color: var(--nx-color-text-inv);
  transition: transform var(--nx-duration-fast) var(--nx-ease-spring), box-shadow var(--nx-duration-base);
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
}

[nx="btn"]::after {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 50%;
  height: 180%;
  background: rgba(255, 255, 255, 0.22);
  transform: skewX(-18deg) translateX(-100%);
  transition: transform var(--nx-duration-slow) var(--nx-ease-default);
}

[nx="btn"]:hover {
  transform: scale(1.04);
  box-shadow: var(--nx-shadow-glow);
}

[nx="btn"]:hover::after {
  transform: skewX(-18deg) translateX(500%);
}

[nx="btn"]:active {
  transform: scale(0.97);
}

[nx="btn"][variant="outline"] {
  background: transparent;
  color: var(--nx-color-accent);
  border: 1.5px solid var(--nx-color-accent);
}

[nx="btn"][variant="outline"]:hover {
  background: var(--nx-color-accent-lo);
}

[nx="btn"][variant="ghost"] {
  background: var(--nx-color-surface-2);
  color: var(--nx-color-text-2);
  border: 1px solid var(--nx-color-border);
}

[nx="btn"][variant="ghost"]:hover {
  color: var(--nx-color-text);
  border-color: var(--nx-color-border-2);
  background: var(--nx-color-surface-3);
}

[nx="btn"][variant="solid"] {
  background: var(--nx-color-surface-3);
  color: var(--nx-color-text);
}

[nx="btn"][variant="danger"] {
  background: var(--nx-color-err);
  color: #fff;
}

[nx="btn"][variant="danger"]:hover {
  box-shadow: 0 0 20px var(--nx-color-err-md);
}

[nx="btn"][size="xs"] {
  padding: 5px var(--nx-space-3);
  font-size: var(--nx-text-xs);
}

[nx="btn"][size="sm"] {
  padding: 7px var(--nx-space-4);
  font-size: var(--nx-text-xs);
}

[nx="btn"][size="lg"] {
  padding: 14px var(--nx-space-7);
  font-size: var(--nx-text-md);
}

[nx="btn"][size="xl"] {
  padding: 18px var(--nx-space-8);
  font-size: var(--nx-text-lg);
}

[nx="btn"][full] {
  width: 100%;
}

[nx="btn"][loading] {
  pointer-events: none;
  opacity: 0.7;
}

[nx="btn"][loading]::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: nx-spin 0.6s linear infinite;
  margin-right: var(--nx-space-2);
}

/* ═══════════════════════════════════════
   BADGE  nx="badge"
═══════════════════════════════════════ */
[nx="badge"] {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px var(--nx-space-3);
  border-radius: var(--nx-radius-full);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-text-xs);
  font-weight: 500;
  letter-spacing: 0.4px;
  background: var(--nx-color-accent-lo);
  color: var(--nx-color-accent);
  border: 1px solid var(--nx-color-border-2);
  white-space: nowrap;
}

[nx="badge"][tone="ok"] {
  color: var(--nx-color-ok);
  background: var(--nx-color-ok-lo);
  border-color: rgba(0, 255, 136, 0.25);
}

[nx="badge"][tone="warn"] {
  color: var(--nx-color-warn);
  background: var(--nx-color-warn-lo);
  border-color: rgba(255, 204, 0, 0.25);
}

[nx="badge"][tone="err"] {
  color: var(--nx-color-err);
  background: var(--nx-color-err-lo);
  border-color: rgba(255, 60, 60, 0.25);
}

[nx="badge"][tone="info"] {
  color: var(--nx-color-info);
  background: var(--nx-color-info-lo);
  border-color: rgba(191, 95, 255, 0.25);
}

[nx="badge"][size="sm"] {
  padding: 2px var(--nx-space-2);
  font-size: 10px;
}

[nx="badge"][size="lg"] {
  padding: 5px var(--nx-space-4);
  font-size: var(--nx-text-sm);
}

/* ═══════════════════════════════════════
   INPUT / TEXTAREA / SELECT  nx="input"
═══════════════════════════════════════ */
[nx="input"],
[nx="textarea"],
[nx="select"] {
  width: 100%;
  padding: 10px var(--nx-space-4);
  background: var(--nx-color-surface-2);
  border: 1.5px solid var(--nx-color-border);
  border-radius: var(--nx-radius-md);
  color: var(--nx-color-text);
  font-family: var(--nx-font-body);
  font-size: var(--nx-text-base);
  line-height: var(--nx-leading-normal);
  outline: none;
  transition: border-color var(--nx-duration-fast), box-shadow var(--nx-duration-fast);
  -webkit-appearance: none;
  appearance: none;
}

[nx="input"]:focus,
[nx="textarea"]:focus,
[nx="select"]:focus {
  border-color: var(--nx-color-accent);
  box-shadow: 0 0 0 3px var(--nx-color-accent-lo);
}

[nx="input"]::placeholder,
[nx="textarea"]::placeholder {
  color: var(--nx-color-text-3);
}

[nx="textarea"] {
  resize: vertical;
  min-height: 100px;
}

[nx="select"] {
  cursor: pointer;
}

[nx="input"][variant="filled"],
[nx="textarea"][variant="filled"] {
  background: var(--nx-color-surface-3);
  border-color: transparent;
}

[nx="input"][variant="underline"] {
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--nx-color-border);
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
}

[nx="input"][size="sm"] {
  padding: 7px var(--nx-space-3);
  font-size: var(--nx-text-sm);
}

[nx="input"][size="lg"] {
  padding: 14px var(--nx-space-5);
  font-size: var(--nx-text-md);
}

[nx="input"][tone="err"] {
  border-color: var(--nx-color-err);
}

[nx="input"][tone="ok"] {
  border-color: var(--nx-color-ok);
}

/* ═══════════════════════════════════════
   ALERT  nx="alert"
═══════════════════════════════════════ */
[nx="alert"] {
  display: flex;
  gap: var(--nx-space-3);
  align-items: flex-start;
  padding: var(--nx-space-4) var(--nx-space-5);
  border-radius: var(--nx-radius-md);
  border-left: 3px solid var(--nx-color-accent);
  background: var(--nx-color-accent-lo);
  color: var(--nx-color-text-2);
  font-size: var(--nx-text-base);
  line-height: var(--nx-leading-normal);
}

[nx="alert"][tone="ok"] {
  border-color: var(--nx-color-ok);
  background: var(--nx-color-ok-lo);
}

[nx="alert"][tone="warn"] {
  border-color: var(--nx-color-warn);
  background: var(--nx-color-warn-lo);
}

[nx="alert"][tone="err"] {
  border-color: var(--nx-color-err);
  background: var(--nx-color-err-lo);
}

[nx="alert"][tone="info"] {
  border-color: var(--nx-color-info);
  background: var(--nx-color-info-lo);
}

[nx="alert"][dismissible] {
  padding-right: var(--nx-space-8);
  position: relative;
}

/* ═══════════════════════════════════════
   AVATAR  nx="avatar"
═══════════════════════════════════════ */
[nx="avatar"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--nx-radius-full);
  background: var(--nx-color-surface-3);
  border: 2px solid var(--nx-color-border-2);
  font-family: var(--nx-font-display);
  font-size: var(--nx-text-sm);
  font-weight: 700;
  color: var(--nx-color-accent);
  overflow: hidden;
  flex-shrink: 0;
}

[nx="avatar"][size="xs"] {
  width: 24px;
  height: 24px;
  font-size: var(--nx-text-xs);
}

[nx="avatar"][size="sm"] {
  width: 32px;
  height: 32px;
  font-size: var(--nx-text-xs);
}

[nx="avatar"][size="lg"] {
  width: 56px;
  height: 56px;
  font-size: var(--nx-text-md);
}

[nx="avatar"][size="xl"] {
  width: 72px;
  height: 72px;
  font-size: var(--nx-text-lg);
}

[nx="avatar"][size="2xl"] {
  width: 96px;
  height: 96px;
  font-size: var(--nx-text-2xl);
}

[nx="avatar"][variant="square"] {
  border-radius: var(--nx-radius-md);
}

/* Avatar group */
[nx="avatar-group"] {
  display: flex;
}

[nx="avatar-group"] [nx="avatar"] {
  margin-left: -10px;
  border: 2px solid var(--nx-color-bg);
}

[nx="avatar-group"] [nx="avatar"]:first-child {
  margin-left: 0;
}

/* ═══════════════════════════════════════
   PROGRESS  nx="progress"
═══════════════════════════════════════ */
[nx="progress"] {
  height: 4px;
  background: var(--nx-color-surface-3);
  border-radius: var(--nx-radius-full);
  overflow: hidden;
  position: relative;
}

[nx="progress"][size="xs"] {
  height: 2px;
}

[nx="progress"][size="sm"] {
  height: 3px;
}

[nx="progress"][size="lg"] {
  height: 8px;
}

[nx="progress"][size="xl"] {
  height: 12px;
}

[nx="progress"]::after {
  content: '';
  display: block;
  height: 100%;
  width: calc(var(--nx-progress, 0) * 1%);
  border-radius: var(--nx-radius-full);
  background: linear-gradient(90deg, var(--nx-color-accent), var(--nx-color-accent-2));
  box-shadow: 0 0 8px var(--nx-color-accent-md);
  transition: width var(--nx-duration-slower) var(--nx-ease-default);
}

[nx="progress"][tone="ok"]::after {
  background: var(--nx-color-ok);
  box-shadow: none;
}

[nx="progress"][tone="warn"]::after {
  background: var(--nx-color-warn);
  box-shadow: none;
}

[nx="progress"][tone="err"]::after {
  background: var(--nx-color-err);
  box-shadow: none;
}

[nx="progress"][indeterminate]::after {
  width: 40%;
  animation: nx-progress-slide 1.5s ease-in-out infinite;
}

/* ═══════════════════════════════════════
   CHIP  nx="chip"
═══════════════════════════════════════ */
[nx="chip"] {
  display: inline-flex;
  align-items: center;
  gap: var(--nx-space-2);
  padding: 4px var(--nx-space-3);
  border-radius: var(--nx-radius-full);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-text-xs);
  background: var(--nx-color-surface-2);
  color: var(--nx-color-text-2);
  border: 1px solid var(--nx-color-border);
  cursor: pointer;
  transition: background var(--nx-duration-fast), color var(--nx-duration-fast), border-color var(--nx-duration-fast);
  -webkit-user-select: none;
  user-select: none;
}

[nx="chip"]:hover,
[nx="chip"][active],
[nx="chip"].active {
  background: var(--nx-color-accent-lo);
  color: var(--nx-color-accent);
  border-color: var(--nx-color-border-2);
}

[nx="chip"][tone="ok"] {
  color: var(--nx-color-ok);
  background: var(--nx-color-ok-lo);
  border-color: rgba(0, 255, 136, 0.20);
}

[nx="chip"][tone="warn"] {
  color: var(--nx-color-warn);
  background: var(--nx-color-warn-lo);
  border-color: rgba(255, 204, 0, 0.20);
}

[nx="chip"][tone="err"] {
  color: var(--nx-color-err);
  background: var(--nx-color-err-lo);
  border-color: rgba(255, 60, 60, 0.20);
}

/* ═══════════════════════════════════════
   TOOLTIP  nx="tooltip"
═══════════════════════════════════════ */
[nx="tooltip"] {
  position: relative;
  display: inline-flex;
}

[nx="tooltip"][tip]::after {
  content: attr(tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--nx-color-surface-4);
  color: var(--nx-color-text);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-text-xs);
  padding: 4px 10px;
  border-radius: var(--nx-radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--nx-duration-fast), transform var(--nx-duration-fast);
  border: 1px solid var(--nx-color-border);
  z-index: var(--nx-z-dropdown);
  max-width: 240px;
  white-space: normal;
  text-align: center;
}

[nx="tooltip"][tip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

[nx="tooltip"][tip-pos="bottom"]::after {
  bottom: auto;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-6px);
}

[nx="tooltip"][tip-pos="left"]::after {
  left: auto;
  right: calc(100% + 8px);
  bottom: 50%;
  transform: translateY(50%) translateX(-6px);
}

[nx="tooltip"][tip-pos="right"]::after {
  left: calc(100% + 8px);
  bottom: 50%;
  transform: translateY(50%) translateX(6px);
}

/* ═══════════════════════════════════════
   TOGGLE  nx="toggle"
═══════════════════════════════════════ */
[nx="toggle"] {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: var(--nx-color-surface-3);
  border-radius: var(--nx-radius-full);
  border: 1px solid var(--nx-color-border);
  cursor: pointer;
  transition: background var(--nx-duration-fast), border-color var(--nx-duration-fast);
  flex-shrink: 0;
}

[nx="toggle"]::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--nx-color-text-3);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: left var(--nx-duration-fast) var(--nx-ease-spring), background var(--nx-duration-fast);
}

[nx="toggle"][on],
[nx="toggle"].on {
  background: var(--nx-color-accent);
  border-color: var(--nx-color-accent);
}

[nx="toggle"][on]::after,
[nx="toggle"].on::after {
  left: 21px;
  background: var(--nx-color-text-inv);
}

[nx="toggle"][size="sm"] {
  width: 34px;
  height: 18px;
}

[nx="toggle"][size="sm"]::after {
  width: 12px;
  height: 12px;
  top: 2px;
  left: 2px;
}

[nx="toggle"][size="sm"][on]::after,
[nx="toggle"][size="sm"].on::after {
  left: 16px;
}

[nx="toggle"][size="lg"] {
  width: 56px;
  height: 30px;
}

[nx="toggle"][size="lg"]::after {
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
}

[nx="toggle"][size="lg"][on]::after,
[nx="toggle"][size="lg"].on::after {
  left: 27px;
}

/* ═══════════════════════════════════════
   LABEL  nx="label"
═══════════════════════════════════════ */
[nx="label"] {
  display: inline-block;
  font-family: var(--nx-font-mono);
  font-size: var(--nx-text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--nx-tracking-wider);
  color: var(--nx-color-accent);
}

[nx="label"][muted] {
  color: var(--nx-color-text-3);
}

[nx="label"][size="lg"] {
  font-size: var(--nx-text-sm);
}

/* ═══════════════════════════════════════
   SKELETON  nx="skeleton"
═══════════════════════════════════════ */
[nx="skeleton"] {
  background: linear-gradient(90deg,
      var(--nx-color-surface-2) 25%,
      var(--nx-color-surface-3) 50%,
      var(--nx-color-surface-2) 75%);
  background-size: 200% 100%;
  border-radius: var(--nx-radius-sm);
  animation: nx-shimmer 1.5s infinite;
}

@keyframes nx-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ═══════════════════════════════════════
   MODAL  nx="modal"
═══════════════════════════════════════ */
[nx="modal-backdrop"] {
  position: fixed;
  inset: 0;
  background: var(--nx-color-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--nx-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--nx-space-5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--nx-duration-base);
}

[nx="modal-backdrop"][open] {
  opacity: 1;
  pointer-events: all;
}

[nx="modal"] {
  background: var(--nx-color-surface);
  border: 1px solid var(--nx-color-border-2);
  border-radius: var(--nx-radius-xl);
  padding: var(--nx-space-7);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--nx-shadow-xl);
  transform: scale(0.95) translateY(16px);
  transition: transform var(--nx-duration-base) var(--nx-ease-spring);
}

[nx="modal-backdrop"][open] [nx="modal"] {
  transform: scale(1) translateY(0);
}

/* ═══════════════════════════════════════
   TOAST  nx="toast"
═══════════════════════════════════════ */
[nx="toast-stack"] {
  position: fixed;
  bottom: var(--nx-space-5);
  right: var(--nx-space-5);
  z-index: var(--nx-z-toast);
  display: flex;
  flex-direction: column-reverse;
  /* newest at bottom */
  gap: var(--nx-space-2);
  max-width: 380px;
  width: 100%;
  pointer-events: none;
}

[nx="toast"] {
  background: var(--nx-color-surface-2);
  border: 1px solid var(--nx-color-border-2);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-space-4) var(--nx-space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--nx-space-3);
  box-shadow: var(--nx-shadow-lg);
  animation: nx-toast-in var(--nx-duration-base) var(--nx-ease-spring) both;
  pointer-events: auto;
}

@keyframes nx-toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

[nx="toast"][tone="ok"] {
  border-left: 3px solid var(--nx-color-ok);
}

[nx="toast"][tone="warn"] {
  border-left: 3px solid var(--nx-color-warn);
}

[nx="toast"][tone="err"] {
  border-left: 3px solid var(--nx-color-err);
}

[nx="toast"][tone="info"] {
  border-left: 3px solid var(--nx-color-info);
}

/* ═══════════════════════════════════════
   NAVBAR  nx="navbar"
═══════════════════════════════════════ */
[nx="navbar"] {
  display: flex;
  align-items: center;
  gap: var(--nx-space-4);
  height: 60px;
  padding: 0 var(--nx-space-6);
  background: var(--nx-color-surface);
  border-bottom: 1px solid var(--nx-color-border);
}

[nx="navbar"][sticky] {
  position: sticky;
  top: 0;
  z-index: var(--nx-z-sticky);
}

[nx="navbar"][fixed] {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--nx-z-sticky);
}

[nx="navbar"][glass] {
  background: rgba(8, 8, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

[nx="navbar"][variant="transparent"] {
  background: transparent;
  border-color: transparent;
}

/* ═══════════════════════════════════════
   TABLE  nx="table"
═══════════════════════════════════════ */
[nx="table"] {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--nx-text-sm);
}

[nx="table"] th {
  background: var(--nx-color-surface-2);
  color: var(--nx-color-text-2);
  font-family: var(--nx-font-mono);
  font-weight: 500;
  font-size: var(--nx-text-xs);
  text-transform: uppercase;
  letter-spacing: var(--nx-tracking-wide);
  padding: var(--nx-space-3) var(--nx-space-4);
  text-align: left;
  border-bottom: 1px solid var(--nx-color-border);
}

[nx="table"] td {
  padding: var(--nx-space-3) var(--nx-space-4);
  border-bottom: 1px solid var(--nx-color-border);
  color: var(--nx-color-text-2);
}

[nx="table"][striped] tbody tr:nth-child(odd) td {
  background: var(--nx-color-surface-2);
}

[nx="table"][hover] tbody tr:hover td {
  background: var(--nx-color-accent-lo);
}

/* ═══════════════════════════════════════
   TABS  nx="tabs"
═══════════════════════════════════════ */
[nx="tabs"] {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--nx-color-border);
}

[nx="tab"] {
  padding: var(--nx-space-3) var(--nx-space-5);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-text-sm);
  color: var(--nx-color-text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--nx-duration-fast), border-color var(--nx-duration-fast);
  -webkit-user-select: none;
  user-select: none;
}

[nx="tab"]:hover {
  color: var(--nx-color-text-2);
}

[nx="tab"][active],
[nx="tab"].active {
  color: var(--nx-color-accent);
  border-bottom-color: var(--nx-color-accent);
}

/* ═══════════════════════════════════════
   ACCORDION  nx="accordion"
═══════════════════════════════════════ */
[nx="accordion"] {
  border: 1px solid var(--nx-color-border);
  border-radius: var(--nx-radius-lg);
  overflow: hidden;
}

[nx="accordion-item"] {
  border-bottom: 1px solid var(--nx-color-border);
}

[nx="accordion-item"]:last-child {
  border-bottom: none;
}

[nx="accordion-trigger"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--nx-space-4) var(--nx-space-5);
  background: none;
  border: none;
  color: var(--nx-color-text);
  font-family: var(--nx-font-body);
  font-size: var(--nx-text-base);
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background var(--nx-duration-fast);
}

[nx="accordion-trigger"]:hover {
  background: var(--nx-color-surface-2);
}

[nx="accordion-trigger"]::after {
  content: '+';
  font-size: var(--nx-text-lg);
  color: var(--nx-color-accent);
  transition: transform var(--nx-duration-base) var(--nx-ease-spring);
  flex-shrink: 0;
}

[nx="accordion-trigger"][open]::after,
[nx="accordion-trigger"].open::after {
  transform: rotate(45deg);
}

[nx="accordion-content"] {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--nx-duration-slow) var(--nx-ease-default);
  padding: 0 var(--nx-space-5);
}

[nx="accordion-content"][open],
[nx="accordion-content"].open {
  max-height: 600px;
  padding-bottom: var(--nx-space-4);
}

/* ═══════════════════════════════════════
   DROPDOWN  nx="dropdown"
═══════════════════════════════════════ */
[nx="dropdown"] {
  position: relative;
  display: inline-block;
}

[nx="dropdown-menu"] {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background: var(--nx-color-surface-2);
  border: 1px solid var(--nx-color-border-2);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-space-2);
  box-shadow: var(--nx-shadow-lg);
  z-index: var(--nx-z-dropdown);
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  pointer-events: none;
  transition: opacity var(--nx-duration-fast) var(--nx-ease-default), transform var(--nx-duration-fast) var(--nx-ease-spring);
}

[nx="dropdown-menu"][open],
[nx="dropdown-menu"].open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

[nx="dropdown-item"] {
  display: flex;
  align-items: center;
  gap: var(--nx-space-2);
  padding: var(--nx-space-2) var(--nx-space-3);
  border-radius: var(--nx-radius-sm);
  font-size: var(--nx-text-base);
  color: var(--nx-color-text-2);
  cursor: pointer;
  transition: background var(--nx-duration-fast), color var(--nx-duration-fast);
  -webkit-user-select: none;
  user-select: none;
}

[nx="dropdown-item"]:hover {
  background: var(--nx-color-accent-lo);
  color: var(--nx-color-accent);
}

/* ═══════════════════════════════════════
   CARD HEADER / FOOTER helpers
═══════════════════════════════════════ */
[nx="card-header"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--nx-space-3);
  margin-bottom: var(--nx-space-5);
  padding-bottom: var(--nx-space-4);
  border-bottom: 1px solid var(--nx-color-border);
}

[nx="card-footer"] {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--nx-space-3);
  margin-top: var(--nx-space-5);
  padding-top: var(--nx-space-4);
  border-top: 1px solid var(--nx-color-border);
}

/* ═══════════════════════════════════════
   STAT  nx="stat"
═══════════════════════════════════════ */
[nx="stat"] {
  display: flex;
  flex-direction: column;
  gap: var(--nx-space-2);
}

[nx="stat-label"] {
  font-family: var(--nx-font-mono);
  font-size: var(--nx-text-xs);
  text-transform: uppercase;
  letter-spacing: var(--nx-tracking-wider);
  color: var(--nx-color-text-3);
}

[nx="stat-value"] {
  font-family: var(--nx-font-display);
  font-size: var(--nx-text-4xl);
  font-weight: 800;
  color: var(--nx-color-text);
  line-height: 1;
  letter-spacing: var(--nx-tracking-tight);
}

[nx="stat-desc"] {
  font-size: var(--nx-text-sm);
  color: var(--nx-color-text-2);
}

/* ═══════════════════════════════════════
   SIDEBAR  nx="sidebar"
═══════════════════════════════════════ */
[nx="sidebar"] {
  --nx-sidebar-width: 260px;
  --nx-sidebar-mini-width: 64px;
  width: var(--nx-sidebar-width);
  min-height: 100vh;
  background: var(--nx-color-surface);
  border-right: 1px solid var(--nx-color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--nx-duration-slow) var(--nx-ease-spring),
    transform var(--nx-duration-slow) var(--nx-ease-spring);
  overflow: hidden;
  position: relative;
  z-index: var(--nx-z-raised);
}

[nx="sidebar"][variant="glass"] {
  background: rgba(8, 8, 15, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

[nx="sidebar"][variant="dark"] {
  background: var(--nx-color-bg);
  border-right-color: var(--nx-color-border);
}

[nx="sidebar"][variant="accent"] {
  background: var(--nx-color-accent);
}

[nx="sidebar"][variant="accent"] [nx="sidebar-link"] {
  color: rgba(0, 0, 0, 0.7);
}

[nx="sidebar"][variant="accent"] [nx="sidebar-link"]:hover,
[nx="sidebar"][variant="accent"] [nx="sidebar-link"][active] {
  color: #000;
  background: rgba(0, 0, 0, 0.12);
}

[nx="sidebar"][collapsed] {
  width: var(--nx-sidebar-mini-width);
}

[nx="sidebar"][collapsed] [nx="sidebar-label"],
[nx="sidebar"][collapsed] [nx="sidebar-group-label"],
[nx="sidebar"][collapsed] [nx="sidebar-link-text"],
[nx="sidebar"][collapsed] [nx="sidebar-badge"],
[nx="sidebar"][collapsed] [nx="sidebar-section-title"],
[nx="sidebar"][collapsed] .sb-chevron {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}

[nx="sidebar"][collapsed] [nx="sidebar-link"] {
  justify-content: center;
  padding: 10px;
}

[nx="sidebar"][collapsed] [nx="sidebar-header"] {
  justify-content: center;
  padding: var(--nx-space-4) var(--nx-space-3);
}

[nx="sidebar"][collapsed] [nx="sidebar-logo-text"] {
  display: none;
}

[nx="sidebar"][collapsed] [nx="sidebar-link"] {
  position: relative;
}

[nx="sidebar"][collapsed] [nx="sidebar-link"]:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--nx-color-surface-3);
  color: var(--nx-color-text);
  border: 1px solid var(--nx-color-border-2);
  border-radius: var(--nx-radius-md);
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
  font-family: var(--nx-font-body);
  box-shadow: var(--nx-shadow-lg);
  z-index: 999;
  pointer-events: none;
}

[nx="sidebar-header"] {
  display: flex;
  align-items: center;
  gap: var(--nx-space-3);
  padding: var(--nx-space-5) var(--nx-space-5);
  border-bottom: 1px solid var(--nx-color-border);
  flex-shrink: 0;
  min-height: 64px;
}

[nx="sidebar-logo"] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--nx-radius-md);
  background: var(--nx-color-accent);
  color: #000;
  font-weight: 900;
  font-size: 16px;
  flex-shrink: 0;
  font-family: var(--nx-font-display);
}

[nx="sidebar-logo-text"] {
  font-family: var(--nx-font-display);
  font-size: var(--nx-text-md);
  font-weight: 700;
  color: var(--nx-color-text);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--nx-duration-base), width var(--nx-duration-slow);
}

[nx="sidebar-body"] {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--nx-space-3) var(--nx-space-3);
  scrollbar-width: thin;
  scrollbar-color: var(--nx-color-surface-3) transparent;
}

[nx="sidebar-body"]::-webkit-scrollbar {
  width: 4px;
}

[nx="sidebar-body"]::-webkit-scrollbar-thumb {
  background: var(--nx-color-surface-3);
  border-radius: 4px;
}

[nx="sidebar-section"] {
  margin-bottom: var(--nx-space-5);
}

[nx="sidebar-section-title"] {
  font-family: var(--nx-font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--nx-tracking-widest);
  color: var(--nx-color-text-3);
  padding: 0 var(--nx-space-3);
  margin-bottom: var(--nx-space-2);
  white-space: nowrap;
  transition: opacity var(--nx-duration-base);
}

[nx="sidebar-link"] {
  display: flex;
  align-items: center;
  gap: var(--nx-space-3);
  padding: 9px var(--nx-space-3);
  border-radius: var(--nx-radius-md);
  color: var(--nx-color-text-2);
  text-decoration: none;
  font-size: var(--nx-text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--nx-duration-fast), color var(--nx-duration-fast),
    padding var(--nx-duration-slow) var(--nx-ease-spring);
  position: relative;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

[nx="sidebar-link"]:hover {
  background: var(--nx-color-surface-2);
  color: var(--nx-color-text);
}

[nx="sidebar-link"][active],
[nx="sidebar-link"].active {
  background: var(--nx-color-accent-lo);
  color: var(--nx-color-accent);
  font-weight: 600;
}

[nx="sidebar-link"][active]::before,
[nx="sidebar-link"].active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--nx-color-accent);
}

[nx="sidebar-icon"] {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  color: inherit;
  opacity: 0.8;
  transition: opacity var(--nx-duration-fast);
}

[nx="sidebar-link"]:hover [nx="sidebar-icon"],
[nx="sidebar-link"][active] [nx="sidebar-icon"] {
  opacity: 1;
}

[nx="sidebar-link-text"] {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--nx-duration-base), width var(--nx-duration-slow);
}

[nx="sidebar-badge"] {
  font-family: var(--nx-font-mono);
  font-size: 10px;
  font-weight: 700;
  background: var(--nx-color-accent);
  color: #000;
  border-radius: 99px;
  padding: 2px 7px;
  flex-shrink: 0;
  transition: opacity var(--nx-duration-base);
}

[nx="sidebar-badge"][tone="ok"] {
  background: var(--nx-color-ok);
}

[nx="sidebar-badge"][tone="warn"] {
  background: var(--nx-color-warn);
}

[nx="sidebar-badge"][tone="err"] {
  background: var(--nx-color-err);
}

.sb-chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--nx-duration-fast), opacity var(--nx-duration-base);
  flex-shrink: 0;
  opacity: 0.5;
}

[nx="sidebar-link"][open] .sb-chevron {
  transform: rotate(-135deg);
}

[nx="sidebar-sub"] {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--nx-duration-slow) var(--nx-ease-default);
  margin-left: var(--nx-space-3);
  padding-left: var(--nx-space-3);
  border-left: 1px solid var(--nx-color-border);
}

[nx="sidebar-sub"][open] {
  max-height: 600px;
}

[nx="sidebar-sub-link"] {
  display: flex;
  align-items: center;
  gap: var(--nx-space-2);
  padding: 7px var(--nx-space-3);
  border-radius: var(--nx-radius-md);
  color: var(--nx-color-text-3);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--nx-duration-fast), color var(--nx-duration-fast);
  white-space: nowrap;
}

[nx="sidebar-sub-link"]:hover {
  color: var(--nx-color-text);
  background: var(--nx-color-surface-2);
}

[nx="sidebar-sub-link"][active],
[nx="sidebar-sub-link"].active {
  color: var(--nx-color-accent);
}

[nx="sidebar-sub-link"]::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.4;
}

[nx="sidebar-sub-link"][active]::before,
[nx="sidebar-sub-link"].active::before {
  opacity: 1;
}

[nx="sidebar-divider"] {
  height: 1px;
  background: var(--nx-color-border);
  margin: var(--nx-space-3) 0;
}

[nx="sidebar-footer"] {
  flex-shrink: 0;
  padding: var(--nx-space-3) var(--nx-space-3);
  border-top: 1px solid var(--nx-color-border);
}

[nx="sidebar-toggle"],
[nx="sidebar-close"] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--nx-radius-md);
  background: var(--nx-color-surface-2);
  border: 1px solid var(--nx-color-border);
  cursor: pointer;
  color: var(--nx-color-text-3);
  font-size: 14px;
  line-height: 1;
  transition: all var(--nx-duration-fast);
  margin-left: auto;
  flex-shrink: 0;
}

[nx="sidebar-toggle"]:hover,
[nx="sidebar-close"]:hover {
  background: var(--nx-color-accent-lo);
  color: var(--nx-color-accent);
  border-color: var(--nx-color-border-2);
}

.mob-only {
  display: none !important;
}

@media (max-width: 768px) {
  .mob-only {
    display: flex !important;
  }

  .desktop-only {
    display: none !important;
  }
}

/* ─── Dashboard Layout ─── */
[nx="dashboard-layout"] {
  display: flex;
  min-height: 100vh;
}

[nx="dashboard-main"] {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

[nx="dashboard-content"] {
  flex: 1;
  padding: var(--nx-space-6);
  overflow-y: auto;
}

[nx="sidebar-overlay"] {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--nx-color-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: calc(var(--nx-z-sticky) - 1);
  opacity: 0;
  transition: opacity var(--nx-duration-base);
}

[nx="sidebar-overlay"][open] {
  opacity: 1;
}

@media (max-width: 768px) {
  [nx="sidebar"] {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: calc(var(--nx-z-overlay) + 2);
    box-shadow: var(--nx-shadow-xl);
    width: var(--nx-sidebar-width) !important;
  }

  [nx="sidebar"][open] {
    transform: translateX(0);
  }

  [nx="sidebar-overlay"] {
    display: block;
    pointer-events: none;
    z-index: calc(var(--nx-z-overlay) + 1);
  }

  [nx="sidebar-overlay"][open] {
    pointer-events: all;
  }

  [nx="sidebar"][open][collapsed] [nx="sidebar-label"],
  [nx="sidebar"][open][collapsed] [nx="sidebar-link-text"],
  [nx="sidebar"][open][collapsed] [nx="sidebar-badge"],
  [nx="sidebar"][open][collapsed] [nx="sidebar-section-title"],
  [nx="sidebar"][open][collapsed] [nx="sidebar-logo-text"] {
    opacity: 1;
    width: auto;
    pointer-events: auto;
  }

  [nx="sidebar"][open][collapsed] [nx="sidebar-link"] {
    justify-content: flex-start;
    padding: 9px var(--nx-space-3);
  }

  [nx="sidebar"][open][collapsed] [nx="sidebar-header"] {
    justify-content: flex-start;
    padding: var(--nx-space-5);
  }

  [nx="sidebar"][open][collapsed] [nx="sidebar-logo-text"] {
    display: block;
  }
}

/* ═══════════════════════════════════════
   GLOBAL ANIMATIONS
═══════════════════════════════════════ */
@keyframes nx-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes nx-progress-slide {
  0% {
    margin-left: -40%;
  }

  100% {
    margin-left: 100%;
  }
}

@keyframes nx-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

@keyframes nx-bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}