/* ============================================================================
   NITROSEM DESIGN SYSTEM — "Strategic Control Room"

   Bloomberg Terminal meets modern SaaS.
   90% function, 10% wow. Color = signal, not decoration.
   Dark-mode only. No light mode.
   ============================================================================ */

/* ─── FONTS ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================================
   1. DESIGN TOKENS
   ============================================================================ */
:root {
  /* Base (Dark theme) */
  --bg-primary: #0B1220;
  --bg-secondary: #111827;
  --bg-tertiary: #1A2335;
  --bg-elevated: #1E293B;

  --border-soft: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.12);
  --border-focus: rgba(59,130,246,0.4);

  /* Cold Blue Accent (NitroSEM signatur) */
  --accent-primary: #3B82F6;
  --accent-glow: #60A5FA;
  --accent-deep: #1D4ED8;
  --accent-muted: rgba(59,130,246,0.15);

  /* Text */
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --text-inverse: #0B1220;

  /* Semantic */
  --success: #22C55E;
  --success-muted: rgba(34,197,94,0.15);
  --warning: #F59E0B;
  --warning-muted: rgba(245,158,11,0.15);
  --danger: #EF4444;
  --danger-muted: rgba(239,68,68,0.15);
  --info: #38BDF8;
  --info-muted: rgba(56,189,248,0.15);

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 12px rgba(59,130,246,0.35), 0 0 24px rgba(59,130,246,0.15);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 200ms ease-out;
  --transition-slow: 400ms ease-out;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  --max-content: 1440px;
  --gutter: 24px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}


/* ============================================================================
   2. RESET & BASE
   ============================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

::selection {
  background: var(--accent-primary);
  color: white;
}

a {
  color: var(--accent-glow);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-primary);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }


/* ============================================================================
   3. TYPOGRAPHY
   ============================================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}
h1 { font-size: 1.87rem; letter-spacing: -0.02em; }
h2 { font-size: 1.47rem; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--accent-glow); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.micro-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}


/* ============================================================================
   4. LAYOUT — Sidebar + Content
   ============================================================================ */
.nsm-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.nsm-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.nsm-sidebar-brand {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-soft);
}

.nsm-sidebar-brand h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nsm-sidebar-brand .nsm-brand-sub {
  font-size: 0.73rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.nsm-sidebar-nav {
  flex: 1;
  padding: var(--space-4) 0;
}

.nsm-nav-section {
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-2);
}

.nsm-nav-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
}

.nsm-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin: 0 var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.93rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
  cursor: pointer;
}

.nsm-nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.nsm-nav-item.active {
  background: var(--accent-muted);
  color: var(--accent-glow);
  border-left-color: var(--accent-primary);
}

.nsm-nav-item .nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.6;
  flex-shrink: 0;
}

.nsm-nav-item.active .nav-icon {
  opacity: 1;
}

/* Sidebar footer */
.nsm-sidebar-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-soft);
}

.nsm-user-block {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nsm-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  color: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.nsm-user-info {
  flex: 1;
  min-width: 0;
}

.nsm-user-name {
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nsm-user-role {
  font-size: 0.73rem;
  color: var(--text-tertiary);
  text-transform: capitalize;
}

/* ─── Main Content ─── */
.nsm-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.nsm-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(11,18,32,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  padding: 0 var(--space-8);
}

.nsm-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-content);
}

.nsm-header-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nsm-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nsm-content {
  padding: var(--space-8);
  max-width: var(--max-content);
}


/* ============================================================================
   5. CARDS
   ============================================================================ */
.nsm-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--transition-fast), box-shadow var(--transition-base);
  position: relative;
}

.nsm-card:hover {
  border-color: var(--border-strong);
}

.nsm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.nsm-card-title {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nsm-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Card with glow (max 2 per screen) */
.nsm-card-glow {
  position: relative;
  overflow: hidden;
}

.nsm-card-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0.6;
}

.nsm-card-glow::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 60%;
  background: radial-gradient(circle at 50% 0%, rgba(59,130,246,0.08), transparent 70%);
  pointer-events: none;
}


/* ============================================================================
   6. DATA METRIC TILES
   ============================================================================ */
.nsm-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
}

.nsm-metric {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: border-color var(--transition-fast);
}

.nsm-metric:hover {
  border-color: var(--border-strong);
}

.nsm-metric-label {
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}

.nsm-metric-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.nsm-metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: var(--space-2);
}

.nsm-metric-trend.up { color: var(--success); }
.nsm-metric-trend.down { color: var(--danger); }
.nsm-metric-trend.flat { color: var(--text-tertiary); }

/* Metric with positive glow */
.nsm-metric.positive {
  border-color: rgba(34,197,94,0.2);
  box-shadow: 0 0 12px rgba(34,197,94,0.06);
}


/* ============================================================================
   7. TABLE SYSTEM
   ============================================================================ */
.nsm-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

.nsm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.nsm-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.nsm-table th {
  background: var(--bg-elevated);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

.nsm-table th.num,
.nsm-table td.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.nsm-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-secondary);
}

.nsm-table tbody tr {
  transition: background var(--transition-fast);
}

.nsm-table tbody tr:hover {
  background: rgba(59,130,246,0.04);
}

.nsm-table tbody tr:last-child td {
  border-bottom: none;
}

.nsm-table tbody tr.selected {
  outline: 1px solid rgba(59,130,246,0.3);
  outline-offset: -1px;
}

/* Sort indicator */
.nsm-sort-indicator {
  display: inline-block;
  margin-left: 4px;
  color: var(--accent-primary);
  font-size: 0.6rem;
}


/* ============================================================================
   8. STATUS PILLS
   ============================================================================ */
.nsm-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nsm-pill-blue,
.nsm-pill-stabilizing {
  background: var(--accent-muted);
  color: var(--accent-glow);
}

.nsm-pill-cyan,
.nsm-pill-optimizing {
  background: rgba(56,189,248,0.15);
  color: #38BDF8;
}

.nsm-pill-green,
.nsm-pill-autonomous,
.nsm-pill-active {
  background: var(--success-muted);
  color: var(--success);
}

.nsm-pill-red,
.nsm-pill-escalated,
.nsm-pill-danger {
  background: var(--danger-muted);
  color: var(--danger);
}

.nsm-pill-yellow,
.nsm-pill-warning,
.nsm-pill-paused {
  background: var(--warning-muted);
  color: var(--warning);
}

.nsm-pill-gray,
.nsm-pill-inactive {
  background: rgba(100,116,139,0.15);
  color: var(--text-tertiary);
}


/* ============================================================================
   9. BUTTONS
   ============================================================================ */
.nsm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.87rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1.5;
}

.nsm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary — with edge flame */
.nsm-btn-primary {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.nsm-btn-primary:hover:not(:disabled) {
  background: var(--accent-deep);
  box-shadow: var(--shadow-glow);
}

/* Secondary */
.nsm-btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.nsm-btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

/* Ghost */
.nsm-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: var(--space-2) var(--space-3);
}

.nsm-btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

/* Danger */
.nsm-btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(239,68,68,0.3);
}

.nsm-btn-danger:hover:not(:disabled) {
  background: var(--danger-muted);
}

/* Size variants */
.nsm-btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: 0.8rem;
}

.nsm-btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: 1rem;
}


/* ============================================================================
   10. FORM ELEMENTS
   ============================================================================ */
.nsm-input,
.nsm-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.93rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.nsm-input:focus,
.nsm-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.nsm-input::placeholder {
  color: var(--text-tertiary);
}

.nsm-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.nsm-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.nsm-form-group {
  margin-bottom: var(--space-5);
}


/* ============================================================================
   11. COLD BLUE GLOW SYSTEM
   ============================================================================ */

/* Variant A — Soft Radial (cards, focused panels) */
.nsm-glow-radial {
  position: relative;
}

.nsm-glow-radial::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 50%;
  background: radial-gradient(circle at 50% 0%, rgba(59,130,246,0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Variant B — Moving gradient (header) */
@keyframes nsm-drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.nsm-glow-drift {
  background: linear-gradient(
    135deg,
    rgba(59,130,246,0.08),
    rgba(29,78,216,0.05),
    transparent,
    rgba(59,130,246,0.06)
  );
  background-size: 300% 300%;
  animation: nsm-drift 10s ease-in-out infinite;
}

/* Variant C — Edge flame (CTA buttons, active tabs) */
.nsm-glow-edge {
  box-shadow: var(--shadow-glow);
}


/* ============================================================================
   12. MODALS & DROPDOWNS
   ============================================================================ */
.nsm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nsm-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: var(--space-8);
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.nsm-dropdown {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  min-width: 180px;
}

.nsm-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nsm-dropdown-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}


/* ============================================================================
   13. OPERATING MODE SELECTOR
   ============================================================================ */
.nsm-mode-selector {
  display: flex;
  gap: 2px;
  background: var(--bg-primary);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.nsm-mode-option {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
}

.nsm-mode-option:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
}

.nsm-mode-option.active {
  color: var(--text-primary);
}

.nsm-mode-option[data-mode="PASSIVE"].active {
  background: var(--accent-muted);
  color: var(--accent-glow);
}

.nsm-mode-option[data-mode="NEUTRAL"].active {
  background: var(--warning-muted);
  color: var(--warning);
}

.nsm-mode-option[data-mode="AGGRESSIVE"].active {
  background: var(--danger-muted);
  color: var(--danger);
}


/* ============================================================================
   14. ALERT / NOTICE PANELS
   ============================================================================ */
.nsm-alert {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: 0.87rem;
}

.nsm-alert-info {
  background: var(--info-muted);
  border-color: rgba(56,189,248,0.2);
  color: var(--info);
}

.nsm-alert-success {
  background: var(--success-muted);
  border-color: rgba(34,197,94,0.2);
  color: var(--success);
}

.nsm-alert-warning {
  background: var(--warning-muted);
  border-color: rgba(245,158,11,0.2);
  color: var(--warning);
}

.nsm-alert-danger {
  background: var(--danger-muted);
  border-color: rgba(239,68,68,0.2);
  color: var(--danger);
}


/* ============================================================================
   15. UTILITY CLASSES
   ============================================================================ */
.nsm-grid { display: grid; gap: var(--gutter); }
.nsm-grid-2 { grid-template-columns: repeat(2, 1fr); }
.nsm-grid-3 { grid-template-columns: repeat(3, 1fr); }
.nsm-grid-4 { grid-template-columns: repeat(4, 1fr); }

.nsm-flex { display: flex; }
.nsm-flex-col { flex-direction: column; }
.nsm-items-center { align-items: center; }
.nsm-justify-between { justify-content: space-between; }
.nsm-gap-2 { gap: var(--space-2); }
.nsm-gap-4 { gap: var(--space-4); }
.nsm-gap-6 { gap: var(--space-6); }

.nsm-mt-4 { margin-top: var(--space-4); }
.nsm-mt-6 { margin-top: var(--space-6); }
.nsm-mt-8 { margin-top: var(--space-8); }
.nsm-mb-4 { margin-bottom: var(--space-4); }
.nsm-mb-6 { margin-bottom: var(--space-6); }

.nsm-divider {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: var(--space-6) 0;
}

.nsm-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive */
@media (max-width: 1024px) {
  .nsm-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .nsm-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nsm-sidebar { display: none; }
  .nsm-main { margin-left: 0; }
  .nsm-grid-2,
  .nsm-grid-3,
  .nsm-grid-4 { grid-template-columns: 1fr; }
  .nsm-metrics { grid-template-columns: repeat(2, 1fr); }
}


/* ============================================================================
   16. LOGIN PAGE
   ============================================================================ */
.nsm-login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* Subtle background glow */
.nsm-login-shell::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59,130,246,0.08), transparent 70%);
  pointer-events: none;
}

.nsm-login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: var(--space-10);
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.nsm-login-brand {
  text-align: center;
  margin-bottom: var(--space-8);
}

.nsm-login-brand h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nsm-login-brand p {
  font-size: 0.87rem;
  color: var(--text-tertiary);
  margin-top: var(--space-2);
}

.nsm-login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.nsm-login-form .nsm-btn-primary {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-2);
}

.nsm-login-error {
  padding: var(--space-3) var(--space-4);
  background: var(--danger-muted);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.87rem;
  text-align: center;
}

.nsm-login-status {
  font-size: 0.87rem;
  text-align: center;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--danger-muted);
  color: var(--danger);
}


/* ============================================================================
   17. CUSTOMER LIST (ACCOUNTS)
   ============================================================================ */
.nsm-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}

.nsm-account-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.nsm-account-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

.nsm-account-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nsm-account-meta {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.nsm-account-projects {
  font-family: var(--font-mono);
  font-size: 0.87rem;
  color: var(--text-tertiary);
}


/* ============================================================================
   18. PAGE-SPECIFIC SECTIONS
   ============================================================================ */
.nsm-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.nsm-page-header h1 {
  font-size: 1.6rem;
}

.nsm-page-header-actions {
  display: flex;
  gap: var(--space-3);
}

/* Section with title */
.nsm-section {
  margin-bottom: var(--space-8);
}

.nsm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.nsm-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

/* Collapsible section */
.nsm-collapsible {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.nsm-collapsible summary {
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: var(--bg-tertiary);
  list-style: none;
  font-weight: 500;
}

.nsm-collapsible summary::-webkit-details-marker { display: none; }

.nsm-collapsible summary::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  transform: rotate(-45deg);
  transition: transform var(--transition-fast);
}

.nsm-collapsible[open] summary::after {
  transform: rotate(45deg);
}

.nsm-collapsible-content {
  padding: var(--space-4) var(--space-5);
}


/* ============================================================================
   19. SUGGESTION LIST
   ============================================================================ */
.nsm-suggestion-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
}

.nsm-suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.nsm-suggestion-item:hover {
  border-color: var(--border-strong);
}

.nsm-suggestion-title {
  font-weight: 500;
  color: var(--text-primary);
}

.nsm-suggestion-meta {
  display: flex;
  gap: var(--space-3);
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.nsm-value-high { color: var(--success); }
.nsm-value-medium { color: var(--warning); }
.nsm-value-low { color: var(--text-tertiary); }
