/* ============================================================
   NEXDECK — Admin Template Design System
   Inspired by Yodeck UI · Built for SaaS backoffice platforms
   ============================================================ */

/* ── 1. GOOGLE FONTS ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

/* ── 2. CSS VARIABLES ─────────────────────────────────────── */
:root {
  /* Brand */
  --nd-primary:        #E8541A;
  --nd-primary-light:  #FF6B35;
  --nd-primary-dim:    rgba(232,84,26,0.12);
  --nd-primary-dark:   #C4420F;

  /* Neutrals */
  --nd-white:          #FFFFFF;
  --nd-bg:             #F3F4F8;
  --nd-surface:        #FFFFFF;
  --nd-surface-2:      #F8F9FB;
  --nd-border:         #E4E6EF;
  --nd-border-light:   #F0F1F7;

  /* Text */
  --nd-text-primary:   #1A1D2E;
  --nd-text-secondary: #6B7280;
  --nd-text-muted:     #9CA3AF;
  --nd-text-inverse:   #FFFFFF;

  /* Status */
  --nd-success:        #10B981;
  --nd-success-dim:    rgba(16,185,129,0.12);
  --nd-warning:        #F59E0B;
  --nd-warning-dim:    rgba(245,158,11,0.12);
  --nd-danger:         #EF4444;
  --nd-danger-dim:     rgba(239,68,68,0.12);
  --nd-info:           #3B82F6;
  --nd-info-dim:       rgba(59,130,246,0.12);

  /* Sidebar */
  --nd-sidebar-w:      230px;
  --nd-sidebar-mini-w: 64px;
  --nd-sidebar-bg:     #FFFFFF;
  --nd-topbar-h:       60px;
  --nd-banner-h:       40px;

  /* Shadows */
  --nd-shadow-xs:      0 1px 2px rgba(0,0,0,0.05);
  --nd-shadow-sm:      0 2px 8px rgba(0,0,0,0.08);
  --nd-shadow-md:      0 4px 16px rgba(0,0,0,0.10);
  --nd-shadow-lg:      0 8px 32px rgba(0,0,0,0.12);
  --nd-shadow-card:    0 2px 12px rgba(0,0,0,0.07);

  /* Radius */
  --nd-radius-xs:      4px;
  --nd-radius-sm:      6px;
  --nd-radius-md:      10px;
  --nd-radius-lg:      14px;
  --nd-radius-xl:      20px;
  --nd-radius-full:    9999px;

  /* Transitions */
  --nd-transition:     all 0.2s ease;
  --nd-transition-slow: all 0.35s cubic-bezier(0.4,0,0.2,1);

  /* Typography */
  --nd-font:           'Plus Jakarta Sans', sans-serif;
  --nd-font-mono:      'DM Mono', monospace;
  --nd-fs-xs:          11px;
  --nd-fs-sm:          12px;
  --nd-fs-base:        13.5px;
  --nd-fs-md:          14px;
  --nd-fs-lg:          16px;
  --nd-fs-xl:          20px;
  --nd-fs-2xl:         24px;
  --nd-fs-3xl:         30px;

  /* Z-index */
  --nd-z-sidebar:      1000;
  --nd-z-topbar:       999;
  --nd-z-dropdown:     1100;
  --nd-z-modal:        1200;
  --nd-z-toast:        1300;
}

/* Dark theme */
[data-theme="dark"] {
  --nd-bg:             #0F1117;
  --nd-surface:        #1A1D2E;
  --nd-surface-2:      #212437;
  --nd-border:         #2D3048;
  --nd-border-light:   #252840;
  --nd-text-primary:   #F1F5F9;
  --nd-text-secondary: #94A3B8;
  --nd-text-muted:     #64748B;
  --nd-sidebar-bg:     #1A1D2E;
  --nd-shadow-card:    0 2px 12px rgba(0,0,0,0.3);
}

/* ── 3. RESET & BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--nd-font);
  font-size: var(--nd-fs-base);
  color: var(--nd-text-primary);
  background: var(--nd-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--nd-primary); text-decoration: none; transition: var(--nd-transition); }
a:hover { color: var(--nd-primary-dark); }
img { max-width: 100%; }
ul { list-style: none; }

/* ── 4. LAYOUT ────────────────────────────────────────────── */
.nd-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ── 5. BANNER ────────────────────────────────────────────── */
.nd-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nd-banner-h);
  background: var(--nd-primary-dim);
  border-bottom: 1px solid rgba(232,84,26,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: calc(var(--nd-z-topbar) + 1);
  padding: 0 20px;
}
.nd-banner p { font-size: var(--nd-fs-sm); color: var(--nd-text-primary); }
.nd-banner strong { font-weight: 700; }
.nd-banner em { font-style: italic; color: var(--nd-text-secondary); }
.nd-banner .nd-banner-close {
  position: absolute; right: 16px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: var(--nd-radius-full);
  color: var(--nd-text-secondary);
  background: none; border: none; font-size: 16px;
  transition: var(--nd-transition);
}
.nd-banner .nd-banner-close:hover { background: var(--nd-border); }
.has-banner {
  --nd-offset: calc(var(--nd-banner-h) + var(--nd-topbar-h));
}
.has-banner .nd-topbar { top: var(--nd-banner-h); }
.has-banner .nd-sidebar { top: var(--nd-banner-h); padding-top: var(--nd-topbar-h); }
.has-banner .nd-main { padding-top: var(--nd-offset); }

/* ── 6. SIDEBAR ───────────────────────────────────────────── */
.nd-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--nd-sidebar-w);
  background: var(--nd-sidebar-bg);
  border-right: 1px solid var(--nd-border);
  display: flex;
  flex-direction: column;
  z-index: var(--nd-z-sidebar);
  transition: var(--nd-transition-slow);
  overflow: hidden;
}
.nd-sidebar.mini { width: var(--nd-sidebar-mini-w); }

.nd-sidebar-logo {
  height: var(--nd-topbar-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--nd-border);
  flex-shrink: 0;
  gap: 10px;
  text-decoration: none;
}
.nd-logo-icon {
  width: 34px; height: 34px;
  background: var(--nd-primary);
  border-radius: var(--nd-radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nd-logo-icon svg { width: 18px; height: 18px; fill: white; }
.nd-logo-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--nd-text-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
  transition: var(--nd-transition);
}
.nd-logo-text span { color: var(--nd-primary); }
.nd-sidebar.mini .nd-logo-text { opacity: 0; width: 0; overflow: hidden; }

/* Sidebar scroll */
.nd-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0 24px;
}
.nd-sidebar-scroll::-webkit-scrollbar { width: 4px; }
.nd-sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.nd-sidebar-scroll::-webkit-scrollbar-thumb { background: var(--nd-border); border-radius: 2px; }

/* Sidebar section label */
.nd-nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--nd-text-muted);
  padding: 16px 16px 6px;
  white-space: nowrap;
  transition: var(--nd-transition);
}
.nd-sidebar.mini .nd-nav-label { opacity: 0; pointer-events: none; }

/* Nav items */
.nd-nav-item {
  position: relative;
  margin: 1px 8px;
}
.nd-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--nd-radius-sm);
  color: var(--nd-text-secondary);
  font-size: var(--nd-fs-md);
  font-weight: 500;
  cursor: pointer;
  transition: var(--nd-transition);
  white-space: nowrap;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nd-nav-link:hover {
  background: var(--nd-bg);
  color: var(--nd-text-primary);
}
.nd-nav-link.active {
  background: var(--nd-primary-dim);
  color: var(--nd-primary);
  font-weight: 600;
}
.nd-nav-link .nd-nav-icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  opacity: 0.7;
  transition: var(--nd-transition);
}
.nd-nav-link.active .nd-nav-icon,
.nd-nav-link:hover .nd-nav-icon { opacity: 1; }
.nd-nav-link .nd-nav-text { flex: 1; transition: var(--nd-transition); }
.nd-sidebar.mini .nd-nav-text,
.nd-sidebar.mini .nd-nav-arrow { opacity: 0; width: 0; overflow: hidden; }
.nd-nav-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--nd-radius-full);
  background: var(--nd-primary-dim);
  color: var(--nd-primary);
}
.nd-nav-badge.new { background: var(--nd-success-dim); color: var(--nd-success); }
.nd-nav-badge.enterprise { background: #FEF3C7; color: #92400E; font-size: 9px; }

/* Submenu */
.nd-nav-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
  color: var(--nd-text-muted);
}
.nd-nav-item.open > .nd-nav-link .nd-nav-arrow { transform: rotate(90deg); }
.nd-submenu {
  display: none;
  padding: 2px 0 2px 28px;
}
.nd-nav-item.open > .nd-submenu { display: block; }
.nd-submenu .nd-nav-link {
  font-size: var(--nd-fs-sm);
  padding: 7px 10px;
  color: var(--nd-text-secondary);
}
.nd-submenu .nd-nav-link::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: var(--nd-radius-full);
  background: var(--nd-border);
  flex-shrink: 0;
  transition: var(--nd-transition);
}
.nd-submenu .nd-nav-link.active::before,
.nd-submenu .nd-nav-link:hover::before { background: var(--nd-primary); }

/* Sidebar footer */
.nd-sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--nd-border);
  flex-shrink: 0;
}
.nd-sidebar-footer .nd-nav-link { font-size: var(--nd-fs-sm); }

/* Mini sidebar tooltips */
.nd-sidebar.mini .nd-nav-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(var(--nd-sidebar-mini-w) + 8px);
  top: 50%; transform: translateY(-50%);
  background: var(--nd-text-primary);
  color: white;
  padding: 5px 10px;
  border-radius: var(--nd-radius-sm);
  font-size: var(--nd-fs-sm);
  white-space: nowrap;
  z-index: var(--nd-z-dropdown);
  pointer-events: none;
}

/* Sidebar toggle button */
.nd-sidebar-toggle {
  position: absolute;
  right: -12px;
  top: calc(var(--nd-topbar-h) + 20px);
  width: 24px; height: 24px;
  border-radius: var(--nd-radius-full);
  background: var(--nd-surface);
  border: 1px solid var(--nd-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: var(--nd-transition);
  color: var(--nd-text-secondary);
  font-size: 11px;
  box-shadow: var(--nd-shadow-sm);
}
.nd-sidebar-toggle:hover { background: var(--nd-primary); color: white; border-color: var(--nd-primary); }

/* ── 7. TOPBAR ────────────────────────────────────────────── */
.nd-topbar {
  position: fixed;
  top: 0;
  left: var(--nd-sidebar-w);
  right: 0;
  height: var(--nd-topbar-h);
  background: var(--nd-surface);
  border-bottom: 1px solid var(--nd-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: var(--nd-z-topbar);
  transition: left var(--nd-transition-slow);
}
.nd-sidebar.mini ~ .nd-topbar,
body.sidebar-mini .nd-topbar { left: var(--nd-sidebar-mini-w); }

.nd-topbar-title {
  font-size: var(--nd-fs-xl);
  font-weight: 700;
  color: var(--nd-text-primary);
  flex: 1;
}
.nd-topbar-actions {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
}
.nd-topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--nd-radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--nd-text-secondary);
  background: none; border: none;
  font-size: 16px;
  transition: var(--nd-transition);
  position: relative;
}
.nd-topbar-btn:hover { background: var(--nd-bg); color: var(--nd-text-primary); }
.nd-topbar-btn .nd-badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: var(--nd-radius-full);
  background: var(--nd-danger);
  border: 2px solid var(--nd-surface);
}
.nd-topbar-divider { width: 1px; height: 24px; background: var(--nd-border); margin: 0 4px; }

/* Workspace dropdown trigger */
.nd-workspace-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: var(--nd-radius-sm);
  border: 1px solid var(--nd-border);
  background: var(--nd-bg);
  cursor: pointer;
  font-size: var(--nd-fs-sm);
  font-weight: 500;
  color: var(--nd-text-secondary);
  transition: var(--nd-transition);
}
.nd-workspace-btn:hover { border-color: var(--nd-primary); color: var(--nd-primary); }

/* Changes pushed btn */
.nd-changes-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-radius: var(--nd-radius-sm);
  background: var(--nd-text-primary);
  color: white;
  font-size: var(--nd-fs-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--nd-transition);
  white-space: nowrap;
}
.nd-changes-btn:hover { background: #0f1323; }
.nd-changes-btn .dot {
  width: 7px; height: 7px;
  border-radius: var(--nd-radius-full);
  background: var(--nd-success);
  flex-shrink: 0;
}

/* ── 8. MAIN CONTENT ──────────────────────────────────────── */
.nd-main {
  margin-left: var(--nd-sidebar-w);
  padding-top: var(--nd-topbar-h);
  min-height: 100vh;
  transition: margin-left var(--nd-transition-slow);
  width: calc(100% - var(--nd-sidebar-w));
}
body.sidebar-mini .nd-main {
  margin-left: var(--nd-sidebar-mini-w);
  width: calc(100% - var(--nd-sidebar-mini-w));
}
.nd-content {
  padding: 28px 28px;
  max-width: 1600px;
}

/* Page header */
.nd-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.nd-page-title { font-size: var(--nd-fs-2xl); font-weight: 700; color: var(--nd-text-primary); }
.nd-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--nd-fs-sm);
  color: var(--nd-text-muted);
  margin-bottom: 4px;
}
.nd-breadcrumb a { color: var(--nd-text-secondary); }
.nd-breadcrumb a:hover { color: var(--nd-primary); }
.nd-breadcrumb span { color: var(--nd-text-muted); }

/* ── 9. CARDS ─────────────────────────────────────────────── */
.nd-card {
  background: var(--nd-surface);
  border: 1px solid var(--nd-border);
  border-radius: var(--nd-radius-lg);
  box-shadow: var(--nd-shadow-card);
  overflow: hidden;
}
.nd-card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--nd-border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.nd-card-title {
  font-size: var(--nd-fs-md);
  font-weight: 700;
  color: var(--nd-text-primary);
}
.nd-card-subtitle {
  font-size: var(--nd-fs-sm);
  color: var(--nd-text-secondary);
  margin-top: 2px;
}
.nd-card-body { padding: 20px; }
.nd-card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--nd-border);
  background: var(--nd-surface-2);
}

/* KPI Cards */
.nd-kpi-card {
  background: var(--nd-surface);
  border: 1px solid var(--nd-border);
  border-radius: var(--nd-radius-lg);
  padding: 20px;
  box-shadow: var(--nd-shadow-card);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--nd-transition);
}
.nd-kpi-card:hover { box-shadow: var(--nd-shadow-md); transform: translateY(-1px); }
.nd-kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--nd-radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.nd-kpi-icon.primary { background: var(--nd-primary-dim); color: var(--nd-primary); }
.nd-kpi-icon.success { background: var(--nd-success-dim); color: var(--nd-success); }
.nd-kpi-icon.warning { background: var(--nd-warning-dim); color: var(--nd-warning); }
.nd-kpi-icon.danger  { background: var(--nd-danger-dim);  color: var(--nd-danger);  }
.nd-kpi-icon.info    { background: var(--nd-info-dim);    color: var(--nd-info);    }
.nd-kpi-content { flex: 1; min-width: 0; }
.nd-kpi-label {
  font-size: var(--nd-fs-xs);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--nd-text-muted);
  margin-bottom: 4px;
}
.nd-kpi-value {
  font-size: var(--nd-fs-2xl);
  font-weight: 800;
  color: var(--nd-text-primary);
  line-height: 1.2;
}
.nd-kpi-change {
  font-size: var(--nd-fs-xs);
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 4px;
}
.nd-kpi-change.up { color: var(--nd-success); }
.nd-kpi-change.down { color: var(--nd-danger); }
.nd-kpi-sparkline {
  margin-top: 12px;
  height: 40px;
}

/* ── 10. BUTTONS ──────────────────────────────────────────── */
.nd-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  font-family: var(--nd-font);
  font-size: var(--nd-fs-md);
  font-weight: 600;
  border-radius: var(--nd-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--nd-transition);
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
}
.nd-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.nd-btn-sm { padding: 6px 12px; font-size: var(--nd-fs-sm); }
.nd-btn-lg { padding: 11px 24px; font-size: var(--nd-fs-lg); }
.nd-btn-xs { padding: 4px 9px; font-size: var(--nd-fs-xs); border-radius: var(--nd-radius-xs); }
.nd-btn-icon { padding: 8px; }
.nd-btn-icon.nd-btn-sm { padding: 6px; }

/* Variants */
.nd-btn-primary { background: var(--nd-primary); color: white; border-color: var(--nd-primary); }
.nd-btn-primary:hover { background: var(--nd-primary-dark); border-color: var(--nd-primary-dark); color: white; }
.nd-btn-secondary { background: var(--nd-bg); color: var(--nd-text-secondary); border-color: var(--nd-border); }
.nd-btn-secondary:hover { background: var(--nd-border); color: var(--nd-text-primary); }
.nd-btn-outline { background: transparent; color: var(--nd-primary); border-color: var(--nd-primary); }
.nd-btn-outline:hover { background: var(--nd-primary-dim); }
.nd-btn-ghost { background: transparent; color: var(--nd-text-secondary); border-color: transparent; }
.nd-btn-ghost:hover { background: var(--nd-bg); color: var(--nd-text-primary); }
.nd-btn-success { background: var(--nd-success); color: white; border-color: var(--nd-success); }
.nd-btn-success:hover { background: #059669; border-color: #059669; color: white; }
.nd-btn-danger { background: var(--nd-danger); color: white; border-color: var(--nd-danger); }
.nd-btn-danger:hover { background: #DC2626; border-color: #DC2626; color: white; }
.nd-btn-dark { background: var(--nd-text-primary); color: white; border-color: var(--nd-text-primary); }
.nd-btn-dark:hover { background: #0f1323; color: white; }
.nd-btn-warning { background: var(--nd-warning); color: white; border-color: var(--nd-warning); }
.nd-btn-warning:hover { background: #D97706; border-color: #D97706; color: white; }
.nd-btn-upgrade {
  background: linear-gradient(135deg, #1e2340, #2d3561);
  color: white; border: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.nd-btn-upgrade:hover { background: linear-gradient(135deg, #252b50, #343f73); color: white; }

/* ── 11. BADGES & STATUS ──────────────────────────────────── */
.nd-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: var(--nd-radius-full);
  font-size: var(--nd-fs-xs);
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
  white-space: nowrap;
}
.nd-badge-primary { background: var(--nd-primary-dim); color: var(--nd-primary); }
.nd-badge-success { background: var(--nd-success-dim); color: var(--nd-success); }
.nd-badge-warning { background: var(--nd-warning-dim); color: var(--nd-warning); }
.nd-badge-danger  { background: var(--nd-danger-dim);  color: var(--nd-danger);  }
.nd-badge-info    { background: var(--nd-info-dim);    color: var(--nd-info);    }
.nd-badge-secondary { background: var(--nd-bg); color: var(--nd-text-secondary); border: 1px solid var(--nd-border); }
.nd-badge-dark    { background: var(--nd-text-primary); color: white; }
.nd-badge-enterprise { background: #FEF3C7; color: #92400E; }
.nd-badge-dot { width: 7px; height: 7px; border-radius: var(--nd-radius-full); flex-shrink: 0; }
.nd-badge-dot.online  { background: var(--nd-success); }
.nd-badge-dot.offline { background: var(--nd-danger);  }
.nd-badge-dot.pending { background: var(--nd-warning); }

/* Status pill */
.nd-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--nd-fs-xs); font-weight: 600;
  white-space: nowrap;
}
.nd-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: var(--nd-radius-full);
  flex-shrink: 0;
}
.nd-status.online::before  { background: var(--nd-success); }
.nd-status.offline::before { background: var(--nd-danger);  }
.nd-status.pending::before { background: var(--nd-warning); box-shadow: 0 0 0 3px var(--nd-warning-dim); }
.nd-status.online  { color: var(--nd-success); }
.nd-status.offline { color: var(--nd-danger);  }
.nd-status.pending { color: var(--nd-warning); }

/* ── 12. FORMS ────────────────────────────────────────────── */
.nd-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.nd-label {
  font-size: var(--nd-fs-sm);
  font-weight: 600;
  color: var(--nd-text-primary);
}
.nd-label-req::after { content: ' *'; color: var(--nd-danger); }
.nd-input,
.nd-select,
.nd-textarea {
  width: 100%;
  padding: 9px 13px;
  font-family: var(--nd-font);
  font-size: var(--nd-fs-md);
  color: var(--nd-text-primary);
  background: var(--nd-surface);
  border: 1px solid var(--nd-border);
  border-radius: var(--nd-radius-sm);
  outline: none;
  transition: var(--nd-transition);
  line-height: 1.5;
}
.nd-input:hover,
.nd-select:hover { border-color: #C0C4D6; }
.nd-input:focus,
.nd-select:focus,
.nd-textarea:focus {
  border-color: var(--nd-primary);
  box-shadow: 0 0 0 3px var(--nd-primary-dim);
}
.nd-input::placeholder,
.nd-textarea::placeholder { color: var(--nd-text-muted); }
.nd-input.is-invalid { border-color: var(--nd-danger); box-shadow: 0 0 0 3px var(--nd-danger-dim); }
.nd-input.is-valid   { border-color: var(--nd-success); box-shadow: 0 0 0 3px var(--nd-success-dim); }
.nd-input-hint { font-size: var(--nd-fs-xs); color: var(--nd-text-muted); }
.nd-input-error { font-size: var(--nd-fs-xs); color: var(--nd-danger); }
.nd-input-success { font-size: var(--nd-fs-xs); color: var(--nd-success); }
.nd-textarea { resize: vertical; min-height: 100px; }
.nd-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236B7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 34px; cursor: pointer; }

/* Input with icon/prefix */
.nd-input-group {
  position: relative;
  display: flex; align-items: stretch;
}
.nd-input-group .nd-input { border-radius: 0; }
.nd-input-group .nd-input:first-child { border-radius: var(--nd-radius-sm) 0 0 var(--nd-radius-sm); }
.nd-input-group .nd-input:last-child { border-radius: 0 var(--nd-radius-sm) var(--nd-radius-sm) 0; }
.nd-input-group-text {
  display: flex; align-items: center;
  padding: 0 12px;
  background: var(--nd-bg);
  border: 1px solid var(--nd-border);
  color: var(--nd-text-secondary);
  font-size: var(--nd-fs-sm);
}
.nd-input-group-text:first-child { border-right: none; border-radius: var(--nd-radius-sm) 0 0 var(--nd-radius-sm); }
.nd-input-group-text:last-child  { border-left: none;  border-radius: 0 var(--nd-radius-sm) var(--nd-radius-sm) 0; }

/* Icon inside input */
.nd-input-wrap { position: relative; }
.nd-input-wrap .nd-input { padding-left: 38px; }
.nd-input-wrap .nd-input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--nd-text-muted); font-size: 15px; pointer-events: none;
}
.nd-input-wrap.icon-right .nd-input { padding-left: 13px; padding-right: 38px; }
.nd-input-wrap.icon-right .nd-input-icon { left: auto; right: 12px; }

/* Toggle / Switch */
.nd-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.nd-switch input { display: none; }
.nd-switch-track {
  width: 40px; height: 22px;
  background: var(--nd-border);
  border-radius: var(--nd-radius-full);
  position: relative;
  transition: var(--nd-transition);
  flex-shrink: 0;
}
.nd-switch-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: var(--nd-radius-full);
  background: white;
  transition: var(--nd-transition);
  box-shadow: var(--nd-shadow-xs);
}
.nd-switch input:checked ~ .nd-switch-track { background: var(--nd-primary); }
.nd-switch input:checked ~ .nd-switch-track::after { left: 21px; }

/* Checkbox & Radio */
.nd-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--nd-fs-md); }
.nd-check input[type="checkbox"],
.nd-check input[type="radio"] { display: none; }
.nd-check-box {
  width: 17px; height: 17px;
  border: 2px solid var(--nd-border);
  border-radius: var(--nd-radius-xs);
  display: flex; align-items: center; justify-content: center;
  transition: var(--nd-transition);
  flex-shrink: 0;
  background: var(--nd-surface);
  color: white;
  font-size: 10px;
}
.nd-check input:checked ~ .nd-check-box { background: var(--nd-primary); border-color: var(--nd-primary); }
.nd-check.radio .nd-check-box { border-radius: var(--nd-radius-full); }
.nd-check.radio input:checked ~ .nd-check-box::after {
  content: ''; width: 6px; height: 6px;
  background: white; border-radius: var(--nd-radius-full);
}

/* ── 13. TABLES ───────────────────────────────────────────── */
.nd-table-wrapper { overflow-x: auto; border-radius: var(--nd-radius-md); }
.nd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--nd-fs-md);
}
.nd-table thead tr {
  border-bottom: 2px solid var(--nd-border);
}
.nd-table thead th {
  padding: 11px 16px;
  font-size: var(--nd-fs-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--nd-text-muted);
  background: var(--nd-surface-2);
  white-space: nowrap;
  user-select: none;
}
.nd-table thead th.sortable { cursor: pointer; }
.nd-table thead th.sortable:hover { color: var(--nd-text-primary); }
.nd-table thead th .sort-icon { margin-left: 4px; font-size: 10px; opacity: 0.5; }
.nd-table tbody tr {
  border-bottom: 1px solid var(--nd-border-light);
  transition: background 0.15s ease;
}
.nd-table tbody tr:last-child { border-bottom: none; }
.nd-table tbody tr:hover { background: var(--nd-surface-2); }
.nd-table tbody td {
  padding: 13px 16px;
  color: var(--nd-text-primary);
  vertical-align: middle;
}
.nd-table tbody td.text-muted { color: var(--nd-text-secondary); font-size: var(--nd-fs-sm); }

/* Table toolbar */
.nd-table-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--nd-border);
  flex-wrap: wrap;
}
.nd-table-count { font-size: var(--nd-fs-sm); color: var(--nd-text-secondary); }
.nd-table-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nd-table-search {
  position: relative;
  display: flex; align-items: center;
}
.nd-table-search input {
  padding: 7px 12px 7px 34px;
  font-family: var(--nd-font);
  font-size: var(--nd-fs-sm);
  border: 1px solid var(--nd-border);
  border-radius: var(--nd-radius-sm);
  outline: none;
  background: var(--nd-bg);
  color: var(--nd-text-primary);
  width: 220px;
  transition: var(--nd-transition);
}
.nd-table-search input:focus { border-color: var(--nd-primary); background: var(--nd-surface); width: 260px; box-shadow: 0 0 0 3px var(--nd-primary-dim); }
.nd-table-search .search-icon {
  position: absolute; left: 10px;
  color: var(--nd-text-muted); font-size: 14px; pointer-events: none;
}
.nd-table-filter-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  font-size: var(--nd-fs-sm); font-weight: 500;
  color: var(--nd-text-secondary);
  border: 1px solid var(--nd-border);
  border-radius: var(--nd-radius-sm);
  background: var(--nd-bg);
  cursor: pointer; transition: var(--nd-transition);
}
.nd-table-filter-btn:hover { border-color: var(--nd-primary); color: var(--nd-primary); }

/* Pagination */
.nd-pagination {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 4px;
  padding: 14px 16px;
  border-top: 1px solid var(--nd-border);
}
.nd-page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--nd-radius-xs);
  font-size: var(--nd-fs-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--nd-border);
  background: var(--nd-surface);
  color: var(--nd-text-secondary);
  transition: var(--nd-transition);
}
.nd-page-btn:hover { border-color: var(--nd-primary); color: var(--nd-primary); }
.nd-page-btn.active { background: var(--nd-primary); border-color: var(--nd-primary); color: white; }
.nd-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Avatar */
.nd-avatar {
  border-radius: var(--nd-radius-full);
  object-fit: cover;
  display: inline-block;
  flex-shrink: 0;
}
.nd-avatar-sm { width: 28px; height: 28px; }
.nd-avatar-md { width: 36px; height: 36px; }
.nd-avatar-lg { width: 48px; height: 48px; }
.nd-avatar-xl { width: 64px; height: 64px; }
.nd-avatar-placeholder {
  background: var(--nd-primary-dim);
  color: var(--nd-primary);
  font-weight: 700;
  font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.nd-avatar-stack { display: flex; }
.nd-avatar-stack .nd-avatar { margin-left: -8px; border: 2px solid white; }
.nd-avatar-stack .nd-avatar:first-child { margin-left: 0; }

/* ── 14. ALERTS ───────────────────────────────────────────── */
.nd-alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--nd-radius-md);
  border: 1px solid transparent;
  font-size: var(--nd-fs-sm);
  line-height: 1.5;
}
.nd-alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.nd-alert-content { flex: 1; }
.nd-alert-title { font-weight: 700; margin-bottom: 2px; }
.nd-alert-close { margin-left: auto; cursor: pointer; opacity: 0.6; font-size: 16px; }
.nd-alert-close:hover { opacity: 1; }
.nd-alert-primary { background: var(--nd-primary-dim); border-color: rgba(232,84,26,0.25); color: var(--nd-primary-dark); }
.nd-alert-success { background: var(--nd-success-dim); border-color: rgba(16,185,129,0.25); color: #047857; }
.nd-alert-warning { background: var(--nd-warning-dim); border-color: rgba(245,158,11,0.25); color: #92400E; }
.nd-alert-danger  { background: var(--nd-danger-dim);  border-color: rgba(239,68,68,0.25);  color: #991B1B; }
.nd-alert-info    { background: var(--nd-info-dim);    border-color: rgba(59,130,246,0.25);  color: #1D4ED8; }

/* ── 15. TABS ─────────────────────────────────────────────── */
.nd-tabs { border-bottom: 1px solid var(--nd-border); display: flex; gap: 0; }
.nd-tab-item {
  padding: 11px 18px;
  font-size: var(--nd-fs-sm);
  font-weight: 600;
  color: var(--nd-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--nd-transition);
  white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.nd-tab-item:hover { color: var(--nd-text-primary); }
.nd-tab-item.active { color: var(--nd-primary); border-bottom-color: var(--nd-primary); }
.nd-tab-content { display: none; padding: 20px; }
.nd-tab-content.active { display: block; }

/* Pill tabs */
.nd-tabs-pill {
  display: flex; gap: 4px;
  background: var(--nd-bg);
  padding: 4px;
  border-radius: var(--nd-radius-md);
  border: 1px solid var(--nd-border);
  width: fit-content;
}
.nd-tabs-pill .nd-tab-item {
  border-bottom: none;
  border-radius: var(--nd-radius-sm);
  padding: 7px 16px;
  margin: 0;
}
.nd-tabs-pill .nd-tab-item.active { background: var(--nd-surface); color: var(--nd-text-primary); box-shadow: var(--nd-shadow-xs); }

/* ── 16. MODALS ───────────────────────────────────────────── */
.nd-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  z-index: var(--nd-z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.nd-modal-overlay.open { opacity: 1; pointer-events: all; }
.nd-modal {
  background: var(--nd-surface);
  border-radius: var(--nd-radius-xl);
  box-shadow: var(--nd-shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.nd-modal-overlay.open .nd-modal { transform: scale(1) translateY(0); }
.nd-modal-sm  { max-width: 380px; }
.nd-modal-lg  { max-width: 760px; }
.nd-modal-xl  { max-width: 1000px; }
.nd-modal-header {
  padding: 20px 24px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--nd-border);
}
.nd-modal-title { font-size: var(--nd-fs-lg); font-weight: 700; }
.nd-modal-close {
  width: 32px; height: 32px;
  border-radius: var(--nd-radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; background: none;
  color: var(--nd-text-muted); font-size: 18px;
  transition: var(--nd-transition);
}
.nd-modal-close:hover { background: var(--nd-bg); color: var(--nd-text-primary); }
.nd-modal-body { padding: 24px; }
.nd-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--nd-border);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px;
}

/* ── 17. DROPDOWN ─────────────────────────────────────────── */
.nd-dropdown-wrapper { position: relative; display: inline-block; }
.nd-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--nd-surface);
  border: 1px solid var(--nd-border);
  border-radius: var(--nd-radius-lg);
  box-shadow: var(--nd-shadow-md);
  z-index: var(--nd-z-dropdown);
  overflow: hidden;
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.nd-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.nd-dropdown-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--nd-border);
}
.nd-dropdown-search {
  padding: 8px;
  border-bottom: 1px solid var(--nd-border);
}
.nd-dropdown-search input {
  width: 100%;
  padding: 7px 10px;
  font-family: var(--nd-font);
  font-size: var(--nd-fs-sm);
  border: 1px solid var(--nd-border);
  border-radius: var(--nd-radius-sm);
  outline: none;
  background: var(--nd-bg);
  color: var(--nd-text-primary);
}
.nd-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  font-size: var(--nd-fs-sm);
  font-weight: 500;
  color: var(--nd-text-secondary);
  cursor: pointer;
  transition: var(--nd-transition);
  border: none; background: none; width: 100%; text-align: left;
}
.nd-dropdown-item:hover { background: var(--nd-bg); color: var(--nd-text-primary); }
.nd-dropdown-item.active { color: var(--nd-primary); }
.nd-dropdown-item.danger { color: var(--nd-danger); }
.nd-dropdown-item.danger:hover { background: var(--nd-danger-dim); }
.nd-dropdown-divider { height: 1px; background: var(--nd-border); margin: 4px 0; }
.nd-dropdown-item-icon { width: 16px; font-size: 14px; text-align: center; flex-shrink: 0; }

/* ── 18. PROGRESS BARS ────────────────────────────────────── */
.nd-progress { width: 100%; background: var(--nd-bg); border-radius: var(--nd-radius-full); overflow: hidden; }
.nd-progress-xs  { height: 4px;  }
.nd-progress-sm  { height: 6px;  }
.nd-progress-md  { height: 8px;  }
.nd-progress-lg  { height: 12px; }
.nd-progress-bar {
  height: 100%;
  border-radius: var(--nd-radius-full);
  background: var(--nd-primary);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}
.nd-progress-bar.success { background: var(--nd-success); }
.nd-progress-bar.warning { background: var(--nd-warning); }
.nd-progress-bar.danger  { background: var(--nd-danger);  }
.nd-progress-bar.info    { background: var(--nd-info);    }
.nd-progress-bar.striped {
  background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
  background-size: 1rem 1rem;
  animation: nd-progress-stripes 1s linear infinite;
}
@keyframes nd-progress-stripes { from { background-position: 1rem 0; } to { background-position: 0 0; } }

/* ── 19. ACCORDION ────────────────────────────────────────── */
.nd-accordion { border: 1px solid var(--nd-border); border-radius: var(--nd-radius-lg); overflow: hidden; }
.nd-accordion-item { border-bottom: 1px solid var(--nd-border); }
.nd-accordion-item:last-child { border-bottom: none; }
.nd-accordion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  background: var(--nd-surface);
  transition: var(--nd-transition);
  font-weight: 600; font-size: var(--nd-fs-md);
}
.nd-accordion-header:hover { background: var(--nd-surface-2); }
.nd-accordion-header.active { color: var(--nd-primary); }
.nd-accordion-icon { font-size: 12px; transition: transform 0.2s ease; }
.nd-accordion-header.active .nd-accordion-icon { transform: rotate(180deg); }
.nd-accordion-body { display: none; padding: 16px 20px; background: var(--nd-surface); border-top: 1px solid var(--nd-border-light); color: var(--nd-text-secondary); font-size: var(--nd-fs-md); line-height: 1.7; }
.nd-accordion-header.active + .nd-accordion-body { display: block; }

/* ── 20. TOAST NOTIFICATIONS ──────────────────────────────── */
#nd-toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: var(--nd-z-toast);
  pointer-events: none;
}
.nd-toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--nd-text-primary);
  color: white;
  border-radius: var(--nd-radius-md);
  box-shadow: var(--nd-shadow-lg);
  font-size: var(--nd-fs-sm);
  max-width: 360px;
  pointer-events: all;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.nd-toast.show { transform: translateX(0); }
.nd-toast-icon { font-size: 18px; flex-shrink: 0; }
.nd-toast-content { flex: 1; }
.nd-toast-title { font-weight: 700; margin-bottom: 1px; }
.nd-toast-msg { opacity: 0.85; font-size: var(--nd-fs-xs); }
.nd-toast-close { cursor: pointer; opacity: 0.6; font-size: 16px; margin-left: 8px; }
.nd-toast-close:hover { opacity: 1; }
.nd-toast.success { background: #065F46; }
.nd-toast.warning { background: #92400E; }
.nd-toast.danger  { background: #991B1B; }
.nd-toast.info    { background: #1E3A8A; }

/* ── 21. TOOLTIPS ─────────────────────────────────────────── */
[data-nd-tooltip] { position: relative; }
[data-nd-tooltip]::after {
  content: attr(data-nd-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%; transform: translateX(-50%);
  background: var(--nd-text-primary);
  color: white;
  padding: 5px 10px;
  border-radius: var(--nd-radius-sm);
  font-size: var(--nd-fs-xs);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: var(--nd-z-dropdown);
}
[data-nd-tooltip]:hover::after { opacity: 1; }

/* ── 22. OFF-CANVAS ───────────────────────────────────────── */
.nd-offcanvas-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: calc(var(--nd-z-modal) - 1);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.nd-offcanvas-overlay.open { opacity: 1; pointer-events: all; }
.nd-offcanvas {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px;
  max-width: 95vw;
  background: var(--nd-surface);
  box-shadow: var(--nd-shadow-lg);
  z-index: var(--nd-z-modal);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}
.nd-offcanvas.open { transform: translateX(0); }
.nd-offcanvas-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--nd-border);
  display: flex; align-items: center; justify-content: space-between;
}
.nd-offcanvas-title { font-size: var(--nd-fs-lg); font-weight: 700; }
.nd-offcanvas-close {
  width: 32px; height: 32px;
  border-radius: var(--nd-radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; background: none;
  color: var(--nd-text-muted); font-size: 18px;
  transition: var(--nd-transition);
}
.nd-offcanvas-close:hover { background: var(--nd-bg); color: var(--nd-text-primary); }
.nd-offcanvas-body { flex: 1; overflow-y: auto; padding: 20px; }
.nd-offcanvas-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--nd-border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── 23. UPLOAD ZONE ──────────────────────────────────────── */
.nd-upload-zone {
  border: 2px dashed var(--nd-border);
  border-radius: var(--nd-radius-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--nd-transition);
  background: var(--nd-bg);
}
.nd-upload-zone:hover,
.nd-upload-zone.dragover {
  border-color: var(--nd-primary);
  background: var(--nd-primary-dim);
}
.nd-upload-icon { font-size: 40px; color: var(--nd-text-muted); margin-bottom: 10px; }
.nd-upload-title { font-weight: 700; color: var(--nd-text-primary); margin-bottom: 4px; }
.nd-upload-hint { font-size: var(--nd-fs-sm); color: var(--nd-text-secondary); }
.nd-upload-hint span { color: var(--nd-primary); font-weight: 600; }

/* ── 24. EMPTY STATES ─────────────────────────────────────── */
.nd-empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 64px 32px;
}
.nd-empty-icon {
  width: 80px; height: 80px;
  background: var(--nd-bg);
  border-radius: var(--nd-radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  margin-bottom: 20px;
  border: 2px solid var(--nd-border);
}
.nd-empty-title { font-size: var(--nd-fs-xl); font-weight: 700; color: var(--nd-text-primary); margin-bottom: 8px; }
.nd-empty-desc { font-size: var(--nd-fs-md); color: var(--nd-text-secondary); max-width: 380px; line-height: 1.6; margin-bottom: 24px; }

/* ── 25. SKELETON LOADERS ─────────────────────────────────── */
.nd-skeleton {
  background: linear-gradient(90deg, var(--nd-border) 25%, var(--nd-border-light) 50%, var(--nd-border) 75%);
  background-size: 200% 100%;
  animation: nd-skeleton 1.5s infinite;
  border-radius: var(--nd-radius-sm);
  display: block;
}
@keyframes nd-skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── 26. TIMELINE ─────────────────────────────────────────── */
.nd-timeline { position: relative; padding-left: 24px; }
.nd-timeline::before {
  content: '';
  position: absolute; left: 7px; top: 0; bottom: 0;
  width: 2px; background: var(--nd-border);
}
.nd-timeline-item { position: relative; padding-bottom: 20px; }
.nd-timeline-item::before {
  content: '';
  position: absolute; left: -20px; top: 5px;
  width: 10px; height: 10px;
  border-radius: var(--nd-radius-full);
  background: var(--nd-primary);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--nd-primary);
}
.nd-timeline-item.success::before { background: var(--nd-success); box-shadow: 0 0 0 2px var(--nd-success); }
.nd-timeline-item.warning::before { background: var(--nd-warning); box-shadow: 0 0 0 2px var(--nd-warning); }
.nd-timeline-item.danger::before  { background: var(--nd-danger);  box-shadow: 0 0 0 2px var(--nd-danger); }
.nd-timeline-time { font-size: var(--nd-fs-xs); color: var(--nd-text-muted); margin-bottom: 3px; font-family: var(--nd-font-mono); }
.nd-timeline-content { font-size: var(--nd-fs-sm); color: var(--nd-text-primary); }

/* ── 27. WIZARD STEPPER ───────────────────────────────────── */
.nd-stepper {
  display: flex; align-items: center;
  gap: 0; overflow-x: auto;
  padding-bottom: 4px;
}
.nd-step {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.nd-step-connector {
  flex: 1; height: 2px;
  background: var(--nd-border);
  min-width: 32px;
  transition: var(--nd-transition);
}
.nd-step.done .nd-step-connector { background: var(--nd-primary); }
.nd-step-num {
  width: 30px; height: 30px;
  border-radius: var(--nd-radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--nd-fs-sm); font-weight: 700;
  border: 2px solid var(--nd-border);
  color: var(--nd-text-muted);
  background: var(--nd-surface);
  flex-shrink: 0;
  transition: var(--nd-transition);
}
.nd-step.active .nd-step-num { border-color: var(--nd-primary); color: white; background: var(--nd-primary); }
.nd-step.done .nd-step-num { border-color: var(--nd-primary); color: white; background: var(--nd-primary); }
.nd-step-label { font-size: var(--nd-fs-sm); color: var(--nd-text-muted); white-space: nowrap; }
.nd-step.active .nd-step-label { color: var(--nd-primary); font-weight: 600; }
.nd-step.done .nd-step-label { color: var(--nd-text-secondary); }

/* ── 28. DEVICE CARD ──────────────────────────────────────── */
.nd-device-card {
  background: var(--nd-surface);
  border: 1px solid var(--nd-border);
  border-radius: var(--nd-radius-lg);
  padding: 16px;
  box-shadow: var(--nd-shadow-card);
  transition: var(--nd-transition);
  cursor: pointer;
}
.nd-device-card:hover { box-shadow: var(--nd-shadow-md); transform: translateY(-2px); border-color: var(--nd-primary); }
.nd-device-preview {
  background: #1A1D2E;
  border-radius: var(--nd-radius-md);
  aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
  overflow: hidden;
}
.nd-device-name { font-weight: 700; margin-bottom: 4px; }
.nd-device-meta { font-size: var(--nd-fs-xs); color: var(--nd-text-muted); }

/* ── 29. GRIDS ────────────────────────────────────────────── */
.nd-grid { display: grid; gap: 20px; }
.nd-grid-2 { grid-template-columns: repeat(2, 1fr); }
.nd-grid-3 { grid-template-columns: repeat(3, 1fr); }
.nd-grid-4 { grid-template-columns: repeat(4, 1fr); }
.nd-grid-5 { grid-template-columns: repeat(5, 1fr); }
.nd-grid-6 { grid-template-columns: repeat(6, 1fr); }
.nd-grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ── 30. UTILITIES ────────────────────────────────────────── */
.nd-flex { display: flex; }
.nd-flex-col { display: flex; flex-direction: column; }
.nd-items-center { align-items: center; }
.nd-justify-between { justify-content: space-between; }
.nd-justify-end { justify-content: flex-end; }
.nd-justify-center { justify-content: center; }
.nd-gap-1 { gap: 4px; }
.nd-gap-2 { gap: 8px; }
.nd-gap-3 { gap: 12px; }
.nd-gap-4 { gap: 16px; }
.nd-gap-5 { gap: 20px; }
.nd-gap-6 { gap: 24px; }
.nd-mt-1 { margin-top: 4px; }
.nd-mt-2 { margin-top: 8px; }
.nd-mt-3 { margin-top: 12px; }
.nd-mt-4 { margin-top: 16px; }
.nd-mt-5 { margin-top: 20px; }
.nd-mt-6 { margin-top: 24px; }
.nd-mb-1 { margin-bottom: 4px; }
.nd-mb-2 { margin-bottom: 8px; }
.nd-mb-3 { margin-bottom: 12px; }
.nd-mb-4 { margin-bottom: 16px; }
.nd-mb-5 { margin-bottom: 20px; }
.nd-mb-6 { margin-bottom: 24px; }
.nd-text-primary   { color: var(--nd-text-primary); }
.nd-text-secondary { color: var(--nd-text-secondary); }
.nd-text-muted     { color: var(--nd-text-muted); }
.nd-text-orange    { color: var(--nd-primary); }
.nd-text-success   { color: var(--nd-success); }
.nd-text-danger    { color: var(--nd-danger); }
.nd-text-warning   { color: var(--nd-warning); }
.nd-fw-500 { font-weight: 500; }
.nd-fw-600 { font-weight: 600; }
.nd-fw-700 { font-weight: 700; }
.nd-fw-800 { font-weight: 800; }
.nd-fs-xs  { font-size: var(--nd-fs-xs); }
.nd-fs-sm  { font-size: var(--nd-fs-sm); }
.nd-fs-md  { font-size: var(--nd-fs-md); }
.nd-fs-lg  { font-size: var(--nd-fs-lg); }
.nd-fs-xl  { font-size: var(--nd-fs-xl); }
.nd-mono   { font-family: var(--nd-font-mono); }
.nd-text-center { text-align: center; }
.nd-text-right  { text-align: right; }
.nd-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-w-full { width: 100%; }
.nd-h-full { height: 100%; }
.nd-relative { position: relative; }
.nd-divider { height: 1px; background: var(--nd-border); margin: 16px 0; }
.nd-divider-v { width: 1px; background: var(--nd-border); height: 100%; }

/* Role indicators */
.nd-role-admin     { background: var(--nd-info-dim);    color: var(--nd-info);    }
.nd-role-superadmin{ background: #F3E8FF;               color: #7C3AED;           }
.nd-role-user      { background: var(--nd-success-dim); color: var(--nd-success); }

/* Subscription notice */
.nd-promo-bar {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: var(--nd-radius-md);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: var(--nd-fs-sm);
}

/* ── 31. RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 1200px) {
  .nd-grid-5, .nd-grid-6 { grid-template-columns: repeat(3, 1fr); }
  .nd-grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  :root { --nd-sidebar-w: 220px; }
  .nd-grid-4, .nd-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .nd-content { padding: 20px; }
}
@media (max-width: 768px) {
  .nd-sidebar {
    transform: translateX(-100%);
    z-index: calc(var(--nd-z-sidebar) + 10);
  }
  .nd-sidebar.mobile-open { transform: translateX(0); }
  .nd-main { margin-left: 0 !important; width: 100% !important; }
  .nd-topbar { left: 0 !important; }
  .nd-grid-2, .nd-grid-3, .nd-grid-4 { grid-template-columns: 1fr; }
  .nd-page-header { flex-direction: column; align-items: flex-start; }
  .nd-content { padding: 16px; }
  .nd-topbar-title { font-size: var(--nd-fs-lg); }
  .nd-table-toolbar { flex-direction: column; align-items: flex-start; }
  .nd-table-actions { margin-left: 0; }
  .nd-table-search input { width: 100%; }
  .nd-stepper { gap: 0; }
}
@media (max-width: 480px) {
  .nd-modal { max-width: 100%; border-radius: var(--nd-radius-lg) var(--nd-radius-lg) 0 0; }
  .nd-modal-overlay { align-items: flex-end; padding: 0; }
  .nd-offcanvas { width: 100%; }
}

/* ── 32. SIDEBAR OVERLAY (mobile) ────────────────────────── */
.nd-sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: calc(var(--nd-z-sidebar) + 5);
  display: none;
}
.nd-sidebar-overlay.active { display: block; }

/* ── 33. SCROLLBAR GLOBAL ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--nd-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #C0C4D6; }
