/* ================================================================
   Nexus BPMS — Design System
   Palette: deep navy sidebar / cool ground / process blue accent
   Font: Plus Jakarta Sans (Google Fonts)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ─── Design Tokens ──────────────────────────────────────────── */
:root {
  --nx-ink:          #0C1221;
  --nx-surface:      #FFFFFF;
  --nx-ground:       #EEF1F8;
  --nx-accent:       #3654E3;
  --nx-accent-hover: #2C44C9;
  --nx-accent-sub:   #EBF0FF;
  --nx-muted:        #6E7D9F;
  --nx-edge:         #D8DFFB;
  --nx-edge-light:   #ECEEF8;

  --nx-success:      #16A34A;
  --nx-success-sub:  #DCFCE7;
  --nx-warning:      #D97706;
  --nx-warning-sub:  #FEF3C7;
  --nx-danger:       #DC2626;
  --nx-danger-sub:   #FFF0F0;
  --nx-purple:       #7C3AED;
  --nx-purple-sub:   #F3F0FF;

  --nx-sidebar-w:    220px;
  --nx-sidebar-bg:   #0C1221;
  --nx-header-h:     52px;

  --nx-radius-sm:    6px;
  --nx-radius:       9px;
  --nx-radius-lg:    12px;
  --nx-radius-xl:    16px;

  --nx-shadow-sm:    0 1px 3px rgba(12,18,33,.08), 0 1px 2px rgba(12,18,33,.05);
  --nx-shadow:       0 4px 16px rgba(12,18,33,.10);
  --nx-shadow-lg:    0 12px 40px rgba(12,18,33,.18);
}

/* ─── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--nx-ink);
  background: var(--nx-ground);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

button { font-family: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #C1CAE3; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9BACD0; }

/* ─── Shell ───────────────────────────────────────────────────── */
.nx-body {
  display: flex;
  min-height: 100vh;
  background: var(--nx-ground);
}

/* ─── Sidebar ─────────────────────────────────────────────────── */
.nx-sidebar {
  width: var(--nx-sidebar-w);
  background: var(--nx-sidebar-bg);
  position: fixed;
  left: 0; top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}

.nx-sidebar-logo {
  padding: 18px 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.nx-sidebar-logo-icon {
  width: 34px; height: 34px;
  background: var(--nx-accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  color: white;
}

.nx-sidebar-logo-wordmark { line-height: 1; }

.nx-sidebar-logo-name {
  color: #E8EEFF;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.3px;
  display: block;
}

.nx-sidebar-logo-sub {
  color: #3A5277;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-top: 1px;
}

.nx-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nx-nav-section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #2D4060;
  padding: 10px 8px 4px;
}

.nx-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  color: #7A91BF;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.12s, color 0.12s;
  position: relative;
  line-height: 1;
}

.nx-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #C5D3EF;
}

.nx-nav-item.active {
  background: linear-gradient(90deg, rgba(54,84,227,0.22) 0%, rgba(54,84,227,0.08) 100%);
  color: #FFFFFF;
}

.nx-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 3px;
  background: var(--nx-accent);
  border-radius: 0 3px 3px 0;
}

.nx-nav-item i {
  width: 16px;
  text-align: center;
  font-size: 12px;
  flex-shrink: 0;
  opacity: 0.75;
}

.nx-nav-item.active i { opacity: 1; color: #7A9FFF; }

.nx-nav-badge {
  margin-left: auto;
  background: var(--nx-danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 99px;
  min-width: 16px;
  text-align: center;
  line-height: 1.7;
}

/* compact icon-only sidebar (modeler, studio) */
.nx-sidebar--compact { width: 52px; }
.nx-sidebar--compact .nx-sidebar-logo-wordmark,
.nx-sidebar--compact .nx-nav-section-label,
.nx-sidebar--compact .nx-nav-item span,
.nx-sidebar--compact .nx-nav-badge,
.nx-sidebar--compact .nx-sidebar-footer-text { display: none; }
.nx-sidebar--compact .nx-sidebar-logo { justify-content: center; padding: 16px 0; }
.nx-sidebar--compact .nx-nav-item { justify-content: center; padding: 10px 0; }
.nx-sidebar--compact .nx-nav-item i { width: auto; font-size: 14px; opacity: 1; }
.nx-sidebar--compact .nx-nav-item.active::before { top: 8px; bottom: 8px; }
.nx-sidebar--compact .nx-nav { padding: 10px 6px; }
.nx-sidebar--compact .nx-sidebar-footer { padding: 10px 6px; }
.nx-sidebar--compact .nx-user-pill { justify-content: center; }

.nx-sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nx-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 7px;
}

.nx-user-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--nx-accent), #6B8AF7);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

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

.nx-user-name {
  color: #C8D5EE;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.nx-user-role {
  color: #3A5277;
  font-size: 9.5px;
  font-weight: 600;
  display: block;
  margin-top: 1px;
}

.nx-logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  color: #3A5277;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
  font-size: 12px;
}

.nx-logout-btn:hover { color: #EF4444; background: rgba(239,68,68,0.12); }

/* ─── Overlay (mobile) ────────────────────────────────────────── */
.nx-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 190;
  opacity: 0;
  transition: opacity 0.2s;
  backdrop-filter: blur(2px);
}

/* ─── Mobile header ───────────────────────────────────────────── */
.nx-mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nx-header-h);
  background: var(--nx-sidebar-bg);
  z-index: 150;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nx-hamburger {
  width: 34px; height: 34px;
  border: none;
  background: rgba(255,255,255,0.07);
  color: #9BAECC;
  border-radius: 7px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: background 0.12s;
}

.nx-hamburger:hover { background: rgba(255,255,255,0.12); }

.nx-mobile-logo-name {
  color: #E8EEFF;
  font-weight: 800;
  font-size: 14px;
}

.nx-mobile-logo-sub {
  color: #3A5277;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ─── Bottom tab bar (mobile) ─────────────────────────────────── */
.nx-bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 58px;
  background: var(--nx-sidebar-bg);
  border-top: 1px solid rgba(255,255,255,0.06);
  z-index: 150;
  align-items: stretch;
  justify-content: space-around;
}

.nx-bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 8px;
  color: #3A5277;
  text-decoration: none;
  font-size: 9.5px;
  font-weight: 700;
  transition: color 0.12s;
  flex: 1;
}

.nx-bottom-tab i { font-size: 17px; transition: color 0.12s; }
.nx-bottom-tab:hover { color: #A0B4D0; }
.nx-bottom-tab.active { color: white; }
.nx-bottom-tab.active i { color: var(--nx-accent); }

/* ─── Page area ───────────────────────────────────────────────── */
.nx-page {
  margin-left: var(--nx-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.nx-page--compact {
  margin-left: 52px;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.nx-page--full {
  overflow: hidden;
  height: 100vh;
}

.nx-main {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px;
}

.nx-main--wide {
  max-width: none;
  padding: 0;
}

/* ─── Page header ─────────────────────────────────────────────── */
.nx-page-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.nx-page-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--nx-ink);
  letter-spacing: -0.5px;
  line-height: 1.2;
  text-wrap: balance;
}

.nx-page-sub {
  color: var(--nx-muted);
  font-size: 13px;
  margin-top: 3px;
  font-weight: 500;
}

/* ─── Cards ───────────────────────────────────────────────────── */
.nx-card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-edge);
  border-radius: var(--nx-radius-lg);
  box-shadow: var(--nx-shadow-sm);
}

.nx-card-hd {
  padding: 13px 18px;
  border-bottom: 1px solid var(--nx-edge-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nx-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--nx-ink);
  display: flex;
  align-items: center;
  gap: 7px;
}

.nx-card-title i { color: var(--nx-muted); font-size: 11px; }

/* ─── Stats ───────────────────────────────────────────────────── */
.nx-stat {
  background: var(--nx-surface);
  border: 1px solid var(--nx-edge);
  border-radius: var(--nx-radius-lg);
  padding: 16px 18px;
  box-shadow: var(--nx-shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.nx-stat:hover { transform: translateY(-2px); box-shadow: var(--nx-shadow); }

.nx-stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nx-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--nx-ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.nx-stat-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--nx-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ─── Module cards (portal grid) ─────────────────────────────── */
.nx-module-card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-edge);
  border-radius: var(--nx-radius-xl);
  padding: 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
  box-shadow: var(--nx-shadow-sm);
}

.nx-module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--nx-shadow);
  border-color: var(--nx-accent);
}

.nx-module-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: all 0.18s;
}

.nx-module-card:hover .nx-module-icon { filter: brightness(1.1); }

.nx-module-card h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--nx-ink);
  margin-bottom: 5px;
}

.nx-module-card p {
  font-size: 12px;
  color: var(--nx-muted);
  line-height: 1.55;
  font-weight: 500;
}

.nx-module-link {
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.nx-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--nx-radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.12s;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
}

.nx-btn-primary {
  background: var(--nx-accent);
  color: white;
  box-shadow: 0 2px 8px rgba(54,84,227,0.3);
}

.nx-btn-primary:hover { background: var(--nx-accent-hover); box-shadow: 0 4px 14px rgba(54,84,227,0.4); }

.nx-btn-ghost {
  background: var(--nx-surface);
  color: var(--nx-muted);
  border: 1.5px solid var(--nx-edge);
}

.nx-btn-ghost:hover { background: var(--nx-ground); color: var(--nx-ink); border-color: #B0BADC; }

.nx-btn-success {
  background: var(--nx-success);
  color: white;
  box-shadow: 0 2px 8px rgba(22,163,74,0.25);
}

.nx-btn-success:hover { background: #148040; }

.nx-btn-danger {
  background: var(--nx-danger-sub);
  color: var(--nx-danger);
  border: 1.5px solid #FFCDD2;
}

.nx-btn-danger:hover { background: #FFCDD2; }

.nx-btn-sm {
  padding: 5px 11px;
  font-size: 11.5px;
  border-radius: var(--nx-radius-sm);
}

.nx-btn-xs {
  padding: 3px 9px;
  font-size: 11px;
  border-radius: 5px;
}

.nx-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── Inputs ──────────────────────────────────────────────────── */
.nx-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--nx-edge);
  border-radius: var(--nx-radius);
  font-size: 13px;
  font-family: inherit;
  color: var(--nx-ink);
  background: var(--nx-surface);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  line-height: 1.4;
}

.nx-input:focus {
  border-color: var(--nx-accent);
  box-shadow: 0 0 0 3px rgba(54,84,227,0.12);
}

.nx-input::placeholder { color: #A8B4CC; }

.nx-select {
  padding: 8px 12px;
  border: 1.5px solid var(--nx-edge);
  border-radius: var(--nx-radius);
  font-size: 13px;
  font-family: inherit;
  color: var(--nx-ink);
  background: var(--nx-surface);
  outline: none;
  cursor: pointer;
  transition: border-color 0.12s;
  appearance: auto;
}

.nx-select:focus { border-color: var(--nx-accent); box-shadow: 0 0 0 3px rgba(54,84,227,0.1); }

.nx-input-wrap {
  position: relative;
}

.nx-input-wrap .nx-input { padding-left: 34px; }

.nx-input-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #A8B4CC;
  font-size: 12px;
  pointer-events: none;
}

/* ─── Tabs ────────────────────────────────────────────────────── */
.nx-tabs {
  display: flex;
  gap: 2px;
  background: var(--nx-surface);
  border: 1.5px solid var(--nx-edge);
  border-radius: 11px;
  padding: 4px;
  width: fit-content;
  flex-wrap: wrap;
}

.nx-tab {
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--nx-muted);
  transition: all 0.12s;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: inherit;
}

.nx-tab:hover { background: var(--nx-ground); color: var(--nx-ink); }

.nx-tab.active {
  background: var(--nx-accent);
  color: white;
  box-shadow: 0 2px 8px rgba(54,84,227,0.3);
}

/* ─── Badges ──────────────────────────────────────────────────── */
.nx-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.nx-badge-blue   { background: var(--nx-accent-sub);   color: #1E3BC0; }
.nx-badge-green  { background: var(--nx-success-sub);  color: #15803D; }
.nx-badge-yellow { background: var(--nx-warning-sub);  color: #92400E; }
.nx-badge-red    { background: var(--nx-danger-sub);   color: #B91C1C; }
.nx-badge-gray   { background: var(--nx-ground);       color: #64748B; }
.nx-badge-purple { background: var(--nx-purple-sub);   color: #6D28D9; }

/* ─── Filter pills ────────────────────────────────────────────── */
.nx-pills { display: flex; gap: 6px; flex-wrap: wrap; }

.nx-pill {
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--nx-edge);
  color: var(--nx-muted);
  background: var(--nx-surface);
  transition: all 0.12s;
}

.nx-pill:hover { border-color: var(--nx-accent); color: var(--nx-accent); }
.nx-pill.active { background: var(--nx-accent); color: white; border-color: var(--nx-accent); }

/* ─── Tables ──────────────────────────────────────────────────── */
.nx-table-wrap { overflow-x: auto; }

.nx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.nx-table th {
  background: var(--nx-ground);
  color: var(--nx-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--nx-edge);
}

.nx-table td {
  padding: 11px 14px;
  border-top: 1px solid var(--nx-edge-light);
  color: var(--nx-ink);
  font-variant-numeric: tabular-nums;
}

.nx-table tbody tr:hover td { background: #F5F7FD; }
.nx-table td:first-child, .nx-table th:first-child { padding-left: 20px; }
.nx-table td:last-child,  .nx-table th:last-child  { padding-right: 20px; }

/* ─── SLA indicators ──────────────────────────────────────────── */
.nx-sla-ok      { border-left: 3px solid var(--nx-success); }
.nx-sla-risk    { border-left: 3px solid var(--nx-warning); }
.nx-sla-overdue { border-left: 3px solid var(--nx-danger); }

/* ─── List rows ───────────────────────────────────────────────── */
.nx-list-row {
  display: flex;
  align-items: center;
  padding: 11px 18px;
  gap: 12px;
  transition: background 0.1s;
}

.nx-list-row + .nx-list-row { border-top: 1px solid var(--nx-edge-light); }
.nx-list-row:hover { background: var(--nx-ground); }

/* ─── Status dot ──────────────────────────────────────────────── */
.nx-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.nx-dot-green  { background: var(--nx-success); box-shadow: 0 0 0 3px rgba(22,163,74,0.2); }
.nx-dot-gray   { background: #CBD5E1; }
.nx-dot-red    { background: var(--nx-danger); }
.nx-dot-yellow { background: var(--nx-warning); }

/* ─── Toast ───────────────────────────────────────────────────── */
.nx-toasts {
  position: fixed;
  bottom: 72px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

@media (min-width: 641px) { .nx-toasts { bottom: 20px; } }

.nx-toast {
  background: var(--nx-ink);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  pointer-events: auto;
  box-shadow: var(--nx-shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  animation: nx-in 0.2s ease both;
}

.nx-toast.ok   { border-left: 3px solid var(--nx-success); }
.nx-toast.err  { border-left: 3px solid var(--nx-danger); }
.nx-toast.info { border-left: 3px solid var(--nx-accent); }

/* ─── Modal ───────────────────────────────────────────────────── */
.nx-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(12,18,33,0.55);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.nx-modal {
  background: var(--nx-surface);
  border-radius: 14px;
  box-shadow: var(--nx-shadow-lg);
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.nx-modal-hd {
  padding: 15px 20px;
  border-bottom: 1px solid var(--nx-edge-light);
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.nx-modal-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--nx-ink);
}

.nx-modal-hd h3 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nx-modal-close {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: none;
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s;
  flex-shrink: 0;
}

.nx-modal-close:hover { background: rgba(255,255,255,0.3); color: #fff; }

.nx-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.nx-modal-ft {
  padding: 12px 20px;
  border-top: 1px solid var(--nx-edge-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Form layout ─────────────────────────────────────────────── */
.nx-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--nx-muted);
  margin-bottom: 5px;
}

.nx-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) { .nx-form-row { grid-template-columns: 1fr; } }

/* ─── Footer ──────────────────────────────────────────────────── */
.nx-footer {
  text-align: center;
  padding: 14px 24px;
  font-size: 11px;
  color: #A8B4CC;
  border-top: 1px solid var(--nx-edge-light);
  background: var(--nx-surface);
}

.nx-footer a { color: var(--nx-accent); }
.nx-footer a:hover { text-decoration: underline; }

/* ─── Section label ───────────────────────────────────────────── */
.nx-section-lbl {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--nx-muted);
  margin-bottom: 10px;
}

/* ─── Animations ──────────────────────────────────────────────── */
@keyframes nx-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nx-in { animation: nx-in 0.22s ease both; }

@keyframes nx-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.nx-skeleton {
  background: linear-gradient(90deg, var(--nx-edge-light) 25%, var(--nx-ground) 50%, var(--nx-edge-light) 75%);
  background-size: 200% 100%;
  animation: nx-shimmer 1.5s infinite;
  border-radius: 6px;
}

/* ─── Responsive breakpoints ──────────────────────────────────── */
@media (max-width: 1024px) {
  .nx-sidebar {
    transform: translateX(-220px);
    box-shadow: none;
  }

  .nx-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.45);
  }

  .nx-overlay { display: block; pointer-events: none; }
  .nx-overlay.open { opacity: 1; pointer-events: auto; }

  .nx-page { margin-left: 0 !important; }
  .nx-mobile-header { display: flex; }

  .nx-main { padding: 20px 16px; margin-top: var(--nx-header-h); }
  .nx-page-hd { margin-bottom: 16px; }
}

@media (max-width: 640px) {
  .nx-bottom-tabs { display: flex; }
  .nx-main { padding: 14px 12px 72px; }
  .nx-page-title { font-size: 18px; }
  .nx-stat-value { font-size: 22px; }
  .nx-tabs { width: 100%; }
  .nx-tab { flex: 1; justify-content: center; }
}
