/* ── Poppins self-hosted ── */
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/poppins/poppins-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/poppins/poppins-medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/poppins/poppins-semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/poppins/poppins-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--nx-font);
  font-size: var(--nx-fs-base);
  line-height: var(--nx-lh);
  color: var(--nx-ink);
  background-color: var(--nx-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--nx-primary); text-decoration: none; }
a:hover { color: var(--nx-primary-dk); }
button { font-family: var(--nx-font); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: var(--nx-font); }
ul, ol { list-style: none; }
table { border-collapse: collapse; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--nx-surface); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--nx-ink-4); }

/* ── App shell ── */
.nx-shell {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  overflow-x: hidden;
  background-color: var(--nx-bg);
}

/* Background mesh gradient */
.nx-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(63, 114, 175, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 70% 80% at 85% 90%, rgba(17, 45, 78, 0.08) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.nx-shell > * { position: relative; z-index: 1; }

/* ── Glass utility ── */
.glass {
  background: var(--nx-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--nx-glass-brd);
  border-radius: var(--nx-r);
  box-shadow: var(--nx-shadow);
}

/* ── Typography helpers ── */
.nx-h1 { font-size: var(--nx-fs-2xl); font-weight: 700; line-height: 1.25; }
.nx-h2 { font-size: var(--nx-fs-xl);  font-weight: 600; line-height: 1.3; }
.nx-h3 { font-size: var(--nx-fs-lg);  font-weight: 600; line-height: 1.4; }
.nx-h4 { font-size: var(--nx-fs-md);  font-weight: 600; line-height: 1.4; }
.nx-label  { font-size: var(--nx-fs-sm); font-weight: 500; color: var(--nx-ink-3); letter-spacing: 0.03em; text-transform: uppercase; }
.nx-muted  { color: var(--nx-ink-3); font-size: var(--nx-fs-sm); }
.nx-strong { font-weight: 600; }
.text-primary { color: var(--nx-primary); }
.text-ink { color: var(--nx-ink); }

/* ── Status badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--nx-space-1);
  padding: 2px var(--nx-space-2);
  border-radius: var(--nx-r-xs);
  font-size: var(--nx-fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: var(--nx-success-bg); color: var(--nx-success); }
.badge-warning { background: var(--nx-warning-bg); color: var(--nx-warning); }
.badge-danger  { background: var(--nx-danger-bg);  color: var(--nx-danger);  }
.badge-info    { background: var(--nx-info-bg);    color: var(--nx-info);    }
.badge-default { background: var(--nx-surface);    color: var(--nx-ink-2);   }

/* ── Flex / layout helpers ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: var(--nx-space-1); }
.gap-2 { gap: var(--nx-space-2); }
.gap-3 { gap: var(--nx-space-3); }
.gap-4 { gap: var(--nx-space-4); }
.gap-6 { gap: var(--nx-space-6); }
.gap-8 { gap: var(--nx-space-8); }
.w-full { width: 100%; }

/* ── Spacing helpers ── */
.mt-2 { margin-top: var(--nx-space-2); }
.mt-4 { margin-top: var(--nx-space-4); }
.mt-6 { margin-top: var(--nx-space-6); }
.mb-2 { margin-bottom: var(--nx-space-2); }
.mb-4 { margin-bottom: var(--nx-space-4); }
.mb-6 { margin-bottom: var(--nx-space-6); }
.p-4 { padding: var(--nx-space-4); }
.p-6 { padding: var(--nx-space-6); }
.p-8 { padding: var(--nx-space-8); }

/* ── Focus ring ── */
:focus-visible {
  outline: 2px solid var(--nx-primary);
  outline-offset: 2px;
  border-radius: var(--nx-r-xs);
}

/* ── Page content area ── */
.nx-content {
  flex: 1;
  min-width: 0;
  width: calc(100vw - var(--nx-sidebar-w));
  margin-left: var(--nx-sidebar-w);
  padding-top: var(--nx-header-h);
  min-height: 100vh;
  transition: margin-left var(--nx-dur-lg) var(--nx-ease),
              width var(--nx-dur-lg) var(--nx-ease);
}

.nx-page {
  padding: var(--nx-space-8);
  width: 100%;
}

/* ── Sidebar collapsed state ── */
.sidebar-collapsed .nx-content {
  margin-left: var(--nx-sidebar-collapsed-w);
  width: calc(100vw - var(--nx-sidebar-collapsed-w));
}

.sidebar-collapsed .nx-header {
  left: var(--nx-sidebar-collapsed-w);
}

.nx-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--nx-space-8);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .nx-content { margin-left: 0; }
  .nx-page { padding: var(--nx-space-4); }
}
