/* ===================================================
   NineEdu Design System v2
   =================================================== */

/* 1. DESIGN TOKENS */
:root {
  --ne-primary:         #4F46E5;
  --ne-primary-dark:    #3730A3;
  --ne-primary-light:   #EEF2FF;
  --ne-primary-rgb:     79, 70, 229;

  --ne-success:         #10B981;
  --ne-success-light:   #ECFDF5;
  --ne-success-rgb:     16, 185, 129;

  --ne-warning:         #F59E0B;
  --ne-warning-light:   #FFFBEB;
  --ne-warning-rgb:     245, 158, 11;

  --ne-danger:          #EF4444;
  --ne-danger-light:    #FEF2F2;
  --ne-danger-rgb:      239, 68, 68;

  --ne-info:            #06B6D4;
  --ne-info-light:      #ECFEFF;
  --ne-info-rgb:        6, 182, 212;

  --ne-purple:          #8B5CF6;
  --ne-purple-light:    #F5F3FF;
  --ne-purple-rgb:      139, 92, 246;

  /* Sidebar */
  --ne-sidebar-bg:        #1E293B;
  --ne-sidebar-hover:     #334155;
  --ne-sidebar-active:    rgba(79,70,229,.18);
  --ne-sidebar-text:      #CBD5E1;
  --ne-sidebar-text-dim:  #64748B;
  --ne-sidebar-width:     260px;
  --ne-sidebar-collapsed: 68px;

  /* Layout */
  --ne-topbar-height:   64px;
  --ne-body-bg:         #F1F5F9;
  --ne-card-bg:         #FFFFFF;
  --ne-border:          #E2E8F0;
  --ne-border-light:    #F1F5F9;

  /* Text */
  --ne-text:            #0F172A;
  --ne-text-secondary:  #475569;
  --ne-text-muted:      #94A3B8;

  /* Shadows */
  --ne-shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --ne-shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --ne-shadow:     0 4px 6px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
  --ne-shadow-lg:  0 10px 25px rgba(0,0,0,.08), 0 4px 10px rgba(0,0,0,.04);

  /* Border radius */
  --ne-radius-sm: 6px;
  --ne-radius:    12px;
  --ne-radius-lg: 16px;

  /* Transition */
  --ne-tr: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* 2. BASE */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 14px;
  scroll-behavior: smooth;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) { html { font-size: 15px; } }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: var(--ne-body-bg);
  color: var(--ne-text);
  line-height: 1.6;
  margin: 0;
}

/* 3. APP SHELL */

.ne-app {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ─────────────────────────────────── */

.ne-sidebar {
  width: var(--ne-sidebar-width);
  height: 100vh;
  background: var(--ne-sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 1040;
  transition: width var(--ne-tr), transform var(--ne-tr);
  overflow: hidden;
}

.ne-sidebar.collapsed { width: var(--ne-sidebar-collapsed); }

/* Header */
.ne-sidebar-header {
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.ne-sidebar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: .75rem;
  white-space: nowrap;
  overflow: hidden;
}

.ne-sidebar-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--ne-primary) 0%, #818CF8 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.05rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
}

.ne-sidebar-brand-name {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.3px;
  transition: opacity var(--ne-tr), width var(--ne-tr);
}

.ne-sidebar.collapsed .ne-sidebar-brand-name { opacity: 0; width: 0; }

/* Nav body */
.ne-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .875rem .625rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}

.ne-sidebar-nav::-webkit-scrollbar { width: 4px; }
.ne-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.08);
  border-radius: 4px;
}

.ne-nav-section {
  margin-bottom: 1rem;
}

.ne-nav-section-label {
  display: block;
  color: var(--ne-sidebar-text-dim);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25rem .625rem .4rem;
  white-space: nowrap;
  transition: opacity var(--ne-tr);
}

.ne-sidebar.collapsed .ne-nav-section-label { opacity: 0; }

.ne-nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .5rem .625rem;
  border-radius: var(--ne-radius-sm);
  color: var(--ne-sidebar-text);
  text-decoration: none;
  font-size: .845rem;
  font-weight: 500;
  transition: background var(--ne-tr), color var(--ne-tr);
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
}

.ne-nav-link:hover { background: var(--ne-sidebar-hover); color: #fff; }
.ne-nav-link.active { background: var(--ne-sidebar-active); color: #A5B4FC; }

.ne-nav-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
}

.ne-nav-text { transition: opacity var(--ne-tr), width var(--ne-tr); }

.ne-sidebar.collapsed .ne-nav-text { opacity: 0; width: 0; }

.ne-nav-badge {
  margin-left: auto;
  font-size: .62rem;
  padding: .15rem .4rem;
  border-radius: 20px;
  background: rgba(79,70,229,.25);
  color: #A5B4FC;
  flex-shrink: 0;
  transition: opacity var(--ne-tr);
}

.ne-sidebar.collapsed .ne-nav-badge { opacity: 0; }

/* Divider */
.ne-sidebar-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,.06);
  margin: .5rem .625rem;
}

/* Footer */
.ne-sidebar-footer {
  padding: .625rem;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.ne-sidebar-user {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .45rem .375rem;
  border-radius: var(--ne-radius-sm);
  overflow: hidden;
  white-space: nowrap;
}

.ne-sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ne-primary), #818CF8);
  color: #fff;
  font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.ne-sidebar-user-info { flex: 1; min-width: 0; transition: opacity var(--ne-tr); }
.ne-sidebar.collapsed .ne-sidebar-user-info { opacity: 0; width: 0; }

.ne-sidebar-user-name {
  font-size: .78rem; font-weight: 600;
  color: #E2E8F0;
  display: block;
  overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}

.ne-sidebar-user-role {
  font-size: .68rem;
  color: var(--ne-sidebar-text-dim);
  display: block;
}

.ne-sidebar-logout {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--ne-radius-sm);
  color: var(--ne-sidebar-text-dim);
  transition: background var(--ne-tr), color var(--ne-tr);
  flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  font-size: .9rem;
  text-decoration: none;
}

.ne-sidebar-logout:hover { background: rgba(239,68,68,.15); color: #FCA5A5; }

/* Overlay mobile */
.ne-sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1039;
  backdrop-filter: blur(2px);
}

/* ─── MAIN WRAPPER ───────────────────────────── */

.ne-main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--ne-sidebar-width);
  transition: margin-left var(--ne-tr);
}

.ne-main-wrapper.no-sidebar { margin-left: 0; }

body.sidebar-collapsed .ne-main-wrapper {
  margin-left: var(--ne-sidebar-collapsed);
}

/* ─── TOPBAR ─────────────────────────────────── */

.ne-topbar {
  height: var(--ne-topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--ne-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky; top: 0;
  z-index: 1030;
  box-shadow: var(--ne-shadow-xs);
}

.ne-topbar-toggle {
  background: none; border: none;
  color: var(--ne-text-secondary);
  cursor: pointer;
  padding: .3rem;
  border-radius: var(--ne-radius-sm);
  line-height: 1;
  display: flex; align-items: center;
  transition: background var(--ne-tr), color var(--ne-tr);
  flex-shrink: 0;
}

.ne-topbar-toggle:hover { background: var(--ne-body-bg); color: var(--ne-text); }

.ne-topbar-breadcrumb {
  flex: 1;
  display: flex; align-items: center; gap: .375rem;
  font-size: .82rem;
  color: var(--ne-text-muted);
  overflow: hidden;
  min-width: 0;
}

.ne-topbar-breadcrumb .current {
  color: var(--ne-text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ne-topbar-breadcrumb a { color: var(--ne-text-muted); text-decoration: none; }
.ne-topbar-breadcrumb a:hover { color: var(--ne-primary); }

.ne-topbar-right {
  display: flex; align-items: center; gap: .5rem;
  flex-shrink: 0;
}

.ne-topbar-icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--ne-radius-sm);
  background: none;
  border: 1px solid var(--ne-border);
  color: var(--ne-text-secondary);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: background var(--ne-tr), color var(--ne-tr), border-color var(--ne-tr);
  font-size: .95rem;
  cursor: pointer;
  position: relative;
}

.ne-topbar-icon-btn:hover {
  background: var(--ne-body-bg);
  color: var(--ne-primary);
  border-color: rgba(var(--ne-primary-rgb), .3);
}

.ne-topbar-icon-btn .ne-badge-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ne-danger);
  border: 1.5px solid #fff;
}

.ne-user-btn {
  display: flex; align-items: center; gap: .5rem;
  background: none;
  border: 1px solid var(--ne-border);
  border-radius: var(--ne-radius-sm);
  padding: .25rem .625rem .25rem .3rem;
  cursor: pointer;
  transition: background var(--ne-tr);
  color: var(--ne-text);
}

.ne-user-btn:hover { background: var(--ne-body-bg); }
.ne-user-btn.dropdown-toggle::after { border-color: var(--ne-text-muted); }

.ne-topbar-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ne-primary), #818CF8);
  color: #fff;
  font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.ne-user-display { font-size: .8rem; font-weight: 500; }

/* ─── CONTENT ────────────────────────────────── */

.ne-content {
  flex: 1;
  padding: 1.75rem;
  max-width: 100%;
}

/* ─── PAGE HEADER ────────────────────────────── */

.ne-page-header {
  margin-bottom: 1.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ne-page-header-left { min-width: 0; }

.ne-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ne-text);
  margin: 0 0 .2rem;
  letter-spacing: -.02em;
  line-height: 1.3;
}

.ne-page-subtitle {
  font-size: .82rem;
  color: var(--ne-text-muted);
  margin: 0;
}

.ne-page-badge {
  padding: .35rem .75rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.ne-page-badge.primary  { background: var(--ne-primary-light); color: var(--ne-primary); }
.ne-page-badge.success  { background: var(--ne-success-light);  color: var(--ne-success); }
.ne-page-badge.warning  { background: var(--ne-warning-light);  color: var(--ne-warning); }
.ne-page-badge.info     { background: var(--ne-info-light);     color: var(--ne-info); }
.ne-page-badge.purple   { background: var(--ne-purple-light);   color: var(--ne-purple); }

/* 4. STAT CARDS */

.ne-stat-card {
  background: var(--ne-card-bg);
  border: 1px solid var(--ne-border);
  border-radius: var(--ne-radius);
  padding: 1.25rem;
  box-shadow: var(--ne-shadow-sm);
  transition: transform var(--ne-tr), box-shadow var(--ne-tr);
  height: 100%;
}

.ne-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ne-shadow);
}

.ne-stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-bottom: .875rem;
}

.ne-stat-icon.primary { background: var(--ne-primary-light); color: var(--ne-primary); }
.ne-stat-icon.success { background: var(--ne-success-light); color: var(--ne-success); }
.ne-stat-icon.warning { background: var(--ne-warning-light); color: var(--ne-warning); }
.ne-stat-icon.danger  { background: var(--ne-danger-light);  color: var(--ne-danger); }
.ne-stat-icon.info    { background: var(--ne-info-light);    color: var(--ne-info); }
.ne-stat-icon.purple  { background: var(--ne-purple-light);  color: var(--ne-purple); }

.ne-stat-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ne-text-muted);
  margin-bottom: .25rem;
  display: block;
}

.ne-stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ne-text);
  letter-spacing: -.03em;
  display: block;
  margin-bottom: .25rem;
}

.ne-stat-sub {
  font-size: .77rem;
  color: var(--ne-text-muted);
  display: block;
}

/* 5. ACTION CARDS */

.ne-action-card {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 1.1rem;
  border-radius: var(--ne-radius);
  background: var(--ne-card-bg);
  border: 1px solid var(--ne-border);
  text-decoration: none;
  color: var(--ne-text);
  transition: transform var(--ne-tr), box-shadow var(--ne-tr), border-color var(--ne-tr);
  box-shadow: var(--ne-shadow-xs);
  height: 100%;
}

.ne-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ne-shadow);
  border-color: rgba(var(--ne-primary-rgb), .25);
  color: var(--ne-text);
  text-decoration: none;
}

.ne-action-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.ne-action-icon.primary  { background: var(--ne-primary-light); color: var(--ne-primary); }
.ne-action-icon.success  { background: var(--ne-success-light);  color: var(--ne-success); }
.ne-action-icon.warning  { background: var(--ne-warning-light);  color: var(--ne-warning); }
.ne-action-icon.danger   { background: var(--ne-danger-light);   color: var(--ne-danger); }
.ne-action-icon.info     { background: var(--ne-info-light);     color: var(--ne-info); }
.ne-action-icon.purple   { background: var(--ne-purple-light);   color: var(--ne-purple); }
.ne-action-icon.neutral  { background: var(--ne-border-light);   color: var(--ne-text-secondary); }

.ne-action-title {
  font-size: .845rem;
  font-weight: 600;
  margin-bottom: .15rem;
  color: var(--ne-text);
  line-height: 1.3;
}

.ne-action-desc {
  font-size: .775rem;
  color: var(--ne-text-muted);
  line-height: 1.4;
  margin: 0;
}

/* 6. CARD BASE */

.card {
  border: 1px solid var(--ne-border);
  border-radius: var(--ne-radius);
  box-shadow: var(--ne-shadow-sm);
  background: var(--ne-card-bg);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--ne-border-light);
  padding: .875rem 1.25rem;
  font-weight: 600;
  font-size: .875rem;
  color: var(--ne-text);
}

.card-body { padding: 1.25rem; }

/* Report cycle rows */
.ne-report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .625rem 0;
  border-bottom: 1px solid var(--ne-border-light);
  font-size: .85rem;
}

.ne-report-row:last-child { border-bottom: none; }

.ne-report-row .label { color: var(--ne-text-secondary); }
.ne-report-row .value { font-weight: 700; color: var(--ne-text); }

/* Quick links list */
.ne-quick-links { list-style: none; padding: 0; margin: 0; }

.ne-quick-links li { margin-bottom: .25rem; }

.ne-quick-link {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .5rem;
  border-radius: var(--ne-radius-sm);
  color: var(--ne-text-secondary);
  text-decoration: none;
  font-size: .845rem;
  font-weight: 500;
  transition: background var(--ne-tr), color var(--ne-tr);
}

.ne-quick-link:hover { background: var(--ne-body-bg); color: var(--ne-primary); }
.ne-quick-link i { color: var(--ne-text-muted); font-size: .85rem; }
.ne-quick-link:hover i { color: var(--ne-primary); }

/* 7. BOOTSTRAP OVERRIDES */

/* Buttons */
.btn {
  border-radius: var(--ne-radius-sm);
  font-weight: 500;
  font-size: .845rem;
  padding: .45rem 1rem;
  transition: all var(--ne-tr);
}

.btn-primary {
  background: var(--ne-primary);
  border-color: var(--ne-primary);
}

.btn-primary:hover, .btn-primary:focus {
  background: var(--ne-primary-dark);
  border-color: var(--ne-primary-dark);
}

.btn:focus, .btn:active:focus,
.form-control:focus, .form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(var(--ne-primary-rgb), .18);
  outline: none;
}

.btn-outline-primary { border-color: var(--ne-primary); color: var(--ne-primary); }
.btn-outline-primary:hover { background: var(--ne-primary); border-color: var(--ne-primary); }

/* Forms */
.form-control, .form-select {
  border-color: var(--ne-border);
  border-radius: var(--ne-radius-sm);
  font-size: .845rem;
  padding: .5rem .875rem;
  transition: border-color var(--ne-tr), box-shadow var(--ne-tr);
  color: var(--ne-text);
}

.form-control:focus, .form-select:focus {
  border-color: var(--ne-primary);
  box-shadow: 0 0 0 3px rgba(var(--ne-primary-rgb), .12);
}

.form-label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--ne-text-secondary);
  margin-bottom: .375rem;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--ne-text-muted);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Input group */
.input-group-text {
  border-color: var(--ne-border);
  background: var(--ne-body-bg);
  color: var(--ne-text-muted);
  font-size: .845rem;
}

/* Tables */
.table {
  font-size: .845rem;
  color: var(--ne-text);
}

.table > thead > tr > th {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ne-text-muted);
  border-bottom-width: 1px;
  padding: .75rem 1rem;
  background: var(--ne-body-bg);
}

.table > tbody > tr > td {
  padding: .75rem 1rem;
  vertical-align: middle;
  border-color: var(--ne-border-light);
}

.table-hover > tbody > tr:hover > td {
  background: rgba(var(--ne-primary-rgb), .03);
}

/* Badges */
.badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .3em .65em;
  border-radius: 6px;
}

/* Dropdown */
.dropdown-menu {
  border: 1px solid var(--ne-border);
  border-radius: var(--ne-radius);
  box-shadow: var(--ne-shadow-lg);
  padding: .4rem;
  font-size: .845rem;
  min-width: 180px;
}

.dropdown-item {
  border-radius: var(--ne-radius-sm);
  padding: .45rem .75rem;
  font-weight: 500;
  color: var(--ne-text-secondary);
  transition: background var(--ne-tr), color var(--ne-tr);
}

.dropdown-item:hover { background: var(--ne-body-bg); color: var(--ne-text); }
.dropdown-item:focus { background: var(--ne-body-bg); color: var(--ne-text); }
.dropdown-item.text-danger:hover { background: var(--ne-danger-light); color: var(--ne-danger); }

.dropdown-divider { border-color: var(--ne-border-light); margin: .3rem 0; }

/* Breadcrumb */
.breadcrumb {
  font-size: .78rem;
  margin: 0; padding: 0;
  background: transparent;
}

.breadcrumb-item + .breadcrumb-item::before { color: var(--ne-text-muted); }
.breadcrumb-item a { color: var(--ne-text-muted); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--ne-primary); }
.breadcrumb-item.active { color: var(--ne-text-secondary); }

/* Alerts */
.alert { border-radius: var(--ne-radius-sm); font-size: .845rem; }

/* 8. DASHBOARD COMPONENTS */

/* ── Hero ───────────────────────────────────── */

.ne-hero {
  background: linear-gradient(135deg, #312e81 0%, var(--ne-primary) 45%, #6366f1 75%, #818CF8 100%);
  border-radius: var(--ne-radius-lg);
  padding: 2rem 2.25rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.ne-hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.ne-hero-orb--1 {
  width: 280px; height: 280px;
  top: -100px; right: -60px;
  background: rgba(255,255,255,.05);
}

.ne-hero-orb--2 {
  width: 160px; height: 160px;
  bottom: -70px; right: 120px;
  background: rgba(255,255,255,.04);
}

.ne-hero-orb--3 {
  width: 80px; height: 80px;
  top: 20px; left: 60%;
  background: rgba(255,255,255,.03);
}

.ne-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ne-hero-eyebrow {
  font-size: .75rem;
  color: rgba(255,255,255,.65);
  margin-bottom: .4rem;
  font-weight: 500;
}

.ne-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 .4rem;
  color: #fff;
  letter-spacing: -.025em;
  line-height: 1.25;
}

.ne-hero-desc {
  font-size: .82rem;
  color: rgba(255,255,255,.75);
  margin: 0;
}

.ne-hero-pills {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
}

.ne-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: .3rem .75rem;
  font-size: .73rem;
  font-weight: 600;
  white-space: nowrap;
}

.ne-pill--glass {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(4px);
}

.ne-pill--online {
  background: rgba(16,185,129,.25);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,.3);
  gap: .35rem;
}

.ne-live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #6ee7b7;
  animation: ne-pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

/* ── KPI Cards ──────────────────────────────── */

.ne-kpi {
  background: var(--ne-card-bg);
  border: 1px solid var(--ne-border);
  border-radius: var(--ne-radius);
  padding: 1.1rem 1.1rem 1rem;
  box-shadow: var(--ne-shadow-sm);
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: transform var(--ne-tr), box-shadow var(--ne-tr);
  position: relative;
  overflow: hidden;
}

.ne-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.ne-kpi.primary::before  { background: var(--ne-primary); }
.ne-kpi.success::before  { background: var(--ne-success); }
.ne-kpi.purple::before   { background: var(--ne-purple); }
.ne-kpi.danger::before   { background: var(--ne-danger); }
.ne-kpi.teal::before     { background: var(--ne-info); }
.ne-kpi.info::before     { background: var(--ne-info); }
.ne-kpi.warning::before  { background: var(--ne-warning); }

.ne-kpi:hover { transform: translateY(-2px); box-shadow: var(--ne-shadow); }

.ne-kpi-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ne-kpi.primary .ne-kpi-icon  { background: var(--ne-primary-light);  color: var(--ne-primary); }
.ne-kpi.success .ne-kpi-icon  { background: var(--ne-success-light);  color: var(--ne-success); }
.ne-kpi.purple .ne-kpi-icon   { background: var(--ne-purple-light);   color: var(--ne-purple); }
.ne-kpi.danger .ne-kpi-icon   { background: var(--ne-danger-light);   color: var(--ne-danger); }
.ne-kpi.teal .ne-kpi-icon     { background: var(--ne-info-light);     color: var(--ne-info); }
.ne-kpi.info .ne-kpi-icon     { background: var(--ne-info-light);     color: var(--ne-info); }
.ne-kpi.warning .ne-kpi-icon  { background: var(--ne-warning-light);  color: var(--ne-warning); }

.ne-kpi-body { flex: 1; min-width: 0; }

.ne-kpi-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ne-text);
  letter-spacing: -.03em;
}

.ne-kpi-label {
  display: block;
  font-size: .72rem;
  color: var(--ne-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: .15rem;
}

.ne-kpi-link {
  color: var(--ne-text-muted);
  font-size: 1.3rem;
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--ne-tr), transform var(--ne-tr);
}

.ne-kpi-link:hover { color: var(--ne-primary); transform: translateX(3px); }

/* ── Tool Cards ─────────────────────────────── */

.ne-tool-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1rem;
  border-radius: var(--ne-radius);
  background: var(--ne-body-bg);
  border: 1px solid var(--ne-border-light);
  text-decoration: none;
  color: var(--ne-text);
  transition: background var(--ne-tr), border-color var(--ne-tr), transform var(--ne-tr), box-shadow var(--ne-tr);
  height: 100%;
}

.ne-tool-card:hover {
  background: #fff;
  border-color: rgba(var(--ne-primary-rgb), .25);
  transform: translateY(-1px);
  box-shadow: var(--ne-shadow-sm);
  color: var(--ne-text);
  text-decoration: none;
}

.ne-tool-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.ne-tool-card-icon.primary { background: var(--ne-primary-light); color: var(--ne-primary); }
.ne-tool-card-icon.success { background: var(--ne-success-light); color: var(--ne-success); }
.ne-tool-card-icon.purple  { background: var(--ne-purple-light);  color: var(--ne-purple); }
.ne-tool-card-icon.danger  { background: var(--ne-danger-light);  color: var(--ne-danger); }
.ne-tool-card-icon.teal    { background: var(--ne-info-light);    color: var(--ne-info); }

.ne-tool-card-body { flex: 1; min-width: 0; }

.ne-tool-card-title {
  font-size: .845rem;
  font-weight: 700;
  color: var(--ne-text);
  line-height: 1.3;
}

.ne-tool-card-desc {
  font-size: .72rem;
  color: var(--ne-text-muted);
}

.ne-tool-card-count {
  background: var(--ne-primary-light);
  color: var(--ne-primary);
  border-radius: 20px;
  padding: .15rem .55rem;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ne-tool-card-arrow {
  color: var(--ne-text-muted);
  font-size: .85rem;
  flex-shrink: 0;
  transition: color var(--ne-tr);
}

.ne-tool-card:hover .ne-tool-card-arrow { color: var(--ne-primary); }

/* Section label */
.ne-section-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ne-text-muted);
}

/* ── Score Ring ──────────────────────────────── */

.ne-score-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto;
}

.ne-score-svg {
  width: 90px; height: 90px;
  transform: rotate(-90deg);
}

.ne-score-track {
  fill: none;
  stroke: var(--ne-border);
  stroke-width: 7;
}

.ne-score-fill {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dasharray .8s cubic-bezier(.4,0,.2,1);
}

.ne-score-fill.full  { stroke: var(--ne-success); }
.ne-score-fill.warn  { stroke: var(--ne-warning); }

.ne-score-label {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.ne-score-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ne-text);
  letter-spacing: -.03em;
}

.ne-score-unit {
  font-size: .6rem;
  color: var(--ne-text-muted);
  font-weight: 600;
}

/* ── Info List ──────────────────────────────── */

.ne-info-list { margin: 0; }

.ne-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem 0;
  border-bottom: 1px solid var(--ne-border-light);
  gap: .5rem;
}

.ne-info-row:last-child { border-bottom: none; }

.ne-info-row dt {
  font-size: .775rem;
  font-weight: 500;
  color: var(--ne-text-muted);
  flex-shrink: 0;
}

.ne-info-row dd {
  font-size: .775rem;
  font-weight: 600;
  color: var(--ne-text);
  margin: 0;
  text-align: right;
}

/* ── old hero kept for compat ───────────────── */
.ne-dashboard-hero {
  background: linear-gradient(135deg, var(--ne-primary-dark) 0%, var(--ne-primary) 50%, #818CF8 100%);
  border-radius: var(--ne-radius-lg);
  padding: 1.75rem 2rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.ne-dashboard-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}

.ne-dashboard-hero::after {
  content: '';
  position: absolute;
  bottom: -60px; right: 80px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
}

.ne-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ne-hero-date {
  font-size: .78rem;
  color: rgba(255,255,255,.7);
  margin: 0 0 .35rem;
  font-weight: 500;
}

.ne-hero-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 .35rem;
  color: #fff;
  letter-spacing: -.02em;
}

.ne-hero-sub {
  font-size: .82rem;
  color: rgba(255,255,255,.75);
  margin: 0;
}

.ne-hero-badge-group {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.ne-hero-badge {
  background: rgba(255,255,255,.18);
  color: #fff;
  border-radius: 20px;
  padding: .35rem .875rem;
  font-size: .75rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.15);
  white-space: nowrap;
}

.ne-hero-badge.outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.3);
}

/* Stat card bordered variant */
.ne-stat-card--bordered {
  border-top: 3px solid transparent;
}
.ne-stat-card--bordered.primary { border-top-color: var(--ne-primary); }
.ne-stat-card--bordered.success { border-top-color: var(--ne-success); }
.ne-stat-card--bordered.info    { border-top-color: var(--ne-info); }
.ne-stat-card--bordered.danger  { border-top-color: var(--ne-danger); }
.ne-stat-card--bordered.warning { border-top-color: var(--ne-warning); }

.ne-stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .875rem;
}

.ne-stat-action {
  color: var(--ne-text-muted);
  font-size: 1.1rem;
  text-decoration: none;
  transition: color var(--ne-tr), transform var(--ne-tr);
  line-height: 1;
}

.ne-stat-action:hover {
  color: var(--ne-primary);
  transform: scale(1.1);
}

/* Card header fancy */
.ne-card-header-fancy {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1rem;
}

.ne-card-header-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

.ne-card-header-icon.primary { background: var(--ne-primary-light); color: var(--ne-primary); }
.ne-card-header-icon.success { background: var(--ne-success-light); color: var(--ne-success); }
.ne-card-header-icon.info    { background: var(--ne-info-light);    color: var(--ne-info); }
.ne-card-header-icon.warning { background: var(--ne-warning-light); color: var(--ne-warning); }
.ne-card-header-icon.danger  { background: var(--ne-danger-light);  color: var(--ne-danger); }
.ne-card-header-icon.purple  { background: var(--ne-purple-light);  color: var(--ne-purple); }

.ne-card-header-title {
  font-size: .845rem;
  font-weight: 700;
  color: var(--ne-text);
  line-height: 1.3;
}

.ne-card-header-sub {
  font-size: .72rem;
  color: var(--ne-text-muted);
  line-height: 1.2;
}

/* Status pill */
.ne-status-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  font-weight: 600;
  padding: .25rem .625rem;
  border-radius: 20px;
}

.ne-status-pill.online {
  background: var(--ne-success-light);
  color: var(--ne-success);
}

.ne-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: ne-pulse 2s infinite;
}

@keyframes ne-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* Health grid */
.ne-health-grid {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

.ne-health-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .625rem;
  border-radius: var(--ne-radius-sm);
  background: var(--ne-body-bg);
  border: 1px solid var(--ne-border-light);
}

.ne-health-indicator {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ne-health-indicator.online  { background: var(--ne-success); box-shadow: 0 0 6px rgba(var(--ne-success-rgb),.5); }
.ne-health-indicator.warning { background: var(--ne-warning); box-shadow: 0 0 6px rgba(var(--ne-warning-rgb),.5); }
.ne-health-indicator.danger  { background: var(--ne-danger);  box-shadow: 0 0 6px rgba(var(--ne-danger-rgb),.5); }

.ne-health-info {
  flex: 1;
  min-width: 0;
}

.ne-health-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--ne-text);
  display: block;
  line-height: 1.3;
}

.ne-health-status {
  font-size: .72rem;
  color: var(--ne-text-muted);
  display: block;
}

.ne-health-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: .2rem .5rem;
  border-radius: 6px;
  flex-shrink: 0;
}

.ne-health-badge.success { background: var(--ne-success-light); color: var(--ne-success); }
.ne-health-badge.warning { background: var(--ne-warning-light); color: var(--ne-warning); }
.ne-health-badge.danger  { background: var(--ne-danger-light);  color: var(--ne-danger); }

/* Shortcut grid */
.ne-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .625rem;
}

.ne-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: .875rem .5rem;
  border-radius: var(--ne-radius);
  text-decoration: none;
  color: var(--ne-text-secondary);
  font-size: .72rem;
  font-weight: 600;
  text-align: center;
  background: var(--ne-body-bg);
  border: 1px solid var(--ne-border-light);
  transition: transform var(--ne-tr), box-shadow var(--ne-tr), border-color var(--ne-tr), color var(--ne-tr);
  line-height: 1.3;
}

.ne-shortcut:hover {
  transform: translateY(-3px);
  box-shadow: var(--ne-shadow);
  border-color: rgba(var(--ne-primary-rgb), .2);
  color: var(--ne-primary);
  text-decoration: none;
}

.ne-shortcut-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  background: var(--cl, var(--ne-primary-light));
  color: var(--c, var(--ne-primary));
  transition: transform var(--ne-tr);
}

.ne-shortcut:hover .ne-shortcut-icon { transform: scale(1.1); }

/* 9. RESPONSIVE */

@media (max-width: 991.98px) {
  .ne-sidebar {
    transform: translateX(-100%);
    width: var(--ne-sidebar-width) !important;
  }

  .ne-sidebar.mobile-open {
    transform: translateX(0);
  }

  .ne-sidebar-overlay.active { display: block; }

  .ne-main-wrapper { margin-left: 0 !important; }

  .ne-content { padding: 1.25rem; }
}

@media (max-width: 575.98px) {
  .ne-content { padding: 1rem; }
  .ne-stat-value { font-size: 1.7rem; }
  .ne-page-title { font-size: 1.2rem; }
  .ne-topbar { padding: 0 1rem; }
}

/* ═══════════════════════════════════════════════════════════════
   9. CHARTS & LEGENDS
   ═══════════════════════════════════════════════════════════════ */

.ne-chart-legend {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.ne-legend-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--ne-text-secondary);
}
.ne-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   10. MESSAGING MODULE
   ═══════════════════════════════════════════════════════════════ */

/* Inbox conversation list */
.ne-conversation-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ne-conversation-item {
  border-bottom: 1px solid var(--ne-border);
}
.ne-conversation-item:last-child { border-bottom: none; }
.ne-conversation-item.unread .ne-conv-name { font-weight: 700; }
.ne-conversation-item.unread .ne-conv-preview { color: var(--ne-text); font-weight: 500; }

.ne-conversation-link {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  padding: .875rem 1rem;
  color: inherit;
  text-decoration: none;
  transition: background .15s;
}
.ne-conversation-link:hover { background: var(--ne-border-light); }

.ne-conv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ne-primary-light);
  color: var(--ne-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}

.ne-conv-body { flex: 1; min-width: 0; }

.ne-conv-header {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .2rem;
}
.ne-conv-name {
  font-size: .9rem;
  color: var(--ne-text);
}
.ne-conv-time {
  font-size: .75rem;
  color: var(--ne-text-muted);
  white-space: nowrap;
}
.ne-conv-subject { font-size: .8rem; color: var(--ne-text-secondary); margin-bottom: .15rem; }
.ne-conv-preview { font-size: .82rem; color: var(--ne-text-muted); }

/* Thread view */
.ne-thread-body {
  min-height: 300px;
  max-height: 520px;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.ne-message {
  display: flex;
}
.ne-message.own { justify-content: flex-end; }
.ne-message.other { flex-direction: column; align-items: flex-start; }

.ne-message-bubble {
  max-width: 70%;
  padding: .625rem .875rem;
  border-radius: 1rem;
  font-size: .9rem;
}
.ne-message.own .ne-message-bubble {
  background: var(--ne-primary);
  color: #fff;
  border-bottom-right-radius: .25rem;
}
.ne-message.other .ne-message-bubble {
  background: var(--ne-border-light);
  color: var(--ne-text);
  border: 1px solid var(--ne-border);
  border-bottom-left-radius: .25rem;
}
.ne-message-body { margin-bottom: .15rem; line-height: 1.5; }
.ne-message-time { font-size: .72rem; opacity: .75; display: block; text-align: right; }
.ne-message.other .ne-message-time { text-align: left; }

.ne-msg-sender-label {
  font-size: .72rem;
  color: var(--ne-text-muted);
  margin-bottom: .15rem;
  padding-left: .25rem;
}

/* Empty state */
.ne-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
}
