/*
 * Nizam Premium Modern Light design system
 * Arabic-first, bilingual, offline-safe, and layered over local Bootstrap 5.
 */

/* ========================================================================== 
   Local typography
   ========================================================================== */
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/assets/fonts/IBMPlexSansArabic-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/assets/fonts/IBMPlexSansArabic-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/assets/fonts/IBMPlexSansArabic-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/assets/fonts/IBMPlexSansArabic-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --n-sidebar-width: 272px;
  --n-sidebar-collapsed-width: 82px;
  --n-topbar-height: 72px;
  --n-content-max: 1600px;

  --n-canvas: #f6f8fc;
  --n-surface: #ffffff;
  --n-surface-subtle: #f0f3f8;
  --n-surface-muted: #e9eef6;
  --n-ink: #172033;
  --n-ink-soft: #334155;
  --n-muted: #64748b;
  --n-faint: #94a3b8;
  --n-border: #e4eaf2;
  --n-border-strong: #d3dce8;

  --n-primary: #315efb;
  --n-primary-hover: #2449d8;
  --n-primary-strong: #1f3faa;
  --n-primary-soft: #edf2ff;
  --n-primary-softer: #f6f8ff;
  --n-teal: #0f9f91;
  --n-teal-soft: #e8f8f5;
  --n-success: #23875a;
  --n-success-soft: #eaf7f0;
  --n-warning: #a76610;
  --n-warning-soft: #fff6df;
  --n-danger: #c63f4b;
  --n-danger-hover: #a92f3a;
  --n-danger-soft: #fff0f1;
  --n-info: #256f9c;
  --n-info-soft: #edf7fc;

  --n-radius-xs: 6px;
  --n-radius-sm: 8px;
  --n-radius: 10px;
  --n-radius-lg: 14px;
  --n-radius-xl: 18px;
  --n-radius-pill: 999px;

  --n-shadow-xs: 0 1px 2px rgba(23, 32, 51, .035);
  --n-shadow-sm: 0 2px 8px rgba(23, 32, 51, .055);
  --n-shadow: 0 10px 30px rgba(23, 32, 51, .075);
  --n-shadow-lg: 0 24px 64px rgba(23, 32, 51, .16);

  --n-fast: 140ms;
  --n-standard: 190ms;
  --n-overlay: 240ms;
  --n-ease: cubic-bezier(.2, .8, .2, 1);

  /* Compatibility aliases for existing module markup. */
  --n-bg: var(--n-canvas);
  --n-surface-2: var(--n-surface-subtle);
  --n-surface-sunken: var(--n-surface-muted);
  --n-text: var(--n-ink);
  --n-text-muted: var(--n-muted);
  --n-text-faint: var(--n-faint);
  --n-accent: var(--n-teal);
  --n-accent-soft: var(--n-teal-soft);
}

/* ========================================================================== 
   Base and accessibility
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
html[lang="en"] body { font-family: "Inter", "Segoe UI", Arial, sans-serif; }
html[lang="ar"] body { font-family: "IBM Plex Sans Arabic", "Noto Sans Arabic", Tahoma, Arial, sans-serif; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--n-canvas);
  color: var(--n-ink);
  font-size: .925rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { color: var(--n-ink); font-weight: 650; line-height: 1.3; letter-spacing: -.018em; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] h4, [lang="ar"] h5, [lang="ar"] h6 { letter-spacing: 0; }
a { color: var(--n-primary); text-underline-offset: 3px; }
a:hover { color: var(--n-primary-hover); }
::selection { background: #dbe5ff; color: var(--n-primary-strong); }
:focus-visible { outline: 3px solid rgba(49, 94, 251, .28); outline-offset: 2px; border-radius: 5px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible, .form-check-input:focus-visible { outline: 3px solid rgba(49, 94, 251, .28); outline-offset: 1px; box-shadow: none !important; }
.text-muted, .text-body-secondary { color: var(--n-muted) !important; }
.mono, .font-monospace, .font-variant-numeric-tabular { font-family: "Cascadia Mono", Consolas, monospace !important; font-variant-numeric: tabular-nums; }
[dir="rtl"] .mono, [dir="rtl"] [dir="ltr"] { unicode-bidi: isolate; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8d3e1; border: 3px solid transparent; background-clip: padding-box; border-radius: 999px; }

.n-skip-link { position: fixed; inset-block-start: 8px; inset-inline-start: 8px; z-index: 2000; transform: translateY(-140%); background: var(--n-primary); color: #fff; padding: 9px 14px; border-radius: var(--n-radius-sm); text-decoration: none; }
.n-skip-link:focus { transform: translateY(0); color: #fff; }

/* ========================================================================== 
   Shell & Fixed-Viewport Architecture
   ========================================================================== */
@media (min-width: 992px) {
  body.n-app-body {
    height: 100%;
    overflow: hidden;
  }
  body.n-app-body .nizam-shell {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    overflow: hidden;
    width: 100%;
  }
  body.n-app-body .nizam-sidebar {
    height: 100%;
    max-height: 100%;
    position: relative;
    inset-block-start: 0;
    flex: 0 0 var(--n-sidebar-width);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--n-surface);
    border-inline-end: 1px solid var(--n-border);
    transition: width var(--n-overlay) var(--n-ease), flex-basis var(--n-overlay) var(--n-ease);
    z-index: 30;
  }
  body.n-app-body .nizam-main {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  body.n-app-body .nizam-topbar {
    position: sticky;
    inset-block-start: 0;
    z-index: 25;
    flex-shrink: 0;
  }
}

@media (max-width: 991.98px) {
  html, body.n-app-body {
    overflow-x: hidden;
    min-height: 100vh;
  }
  .nizam-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
  }
  .nizam-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  .nizam-topbar {
    position: sticky;
    inset-block-start: 0;
    z-index: 25;
  }
}

.offcanvas:not(.show) { display: none; }

/* Sidebar Brand Box & Quick Controls */
.n-sidebar-brand-box {
  min-height: 74px;
  padding: 12px 14px 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--n-border);
  flex-shrink: 0;
}
.nizam-brand {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--n-ink);
  text-decoration: none;
}
.nizam-brand:hover { color: var(--n-ink); }
.school-brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--n-border);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--n-shadow-xs);
}
.school-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.nizam-brand-copy { min-width: 0; display: flex; flex-direction: column; }
.nizam-brand-name {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--n-ink);
  font-size: .90rem;
  font-weight: 650;
  line-height: 1.25;
}
.nizam-brand-product {
  color: var(--n-primary);
  font-size: .69rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.n-sidebar-collapse-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--n-radius-sm);
  color: var(--n-muted);
  transition: all var(--n-fast);
}
.n-sidebar-collapse-btn:hover {
  color: var(--n-ink);
  background: var(--n-surface-subtle);
}
.n-sidebar-collapse-btn .n-icon { width: 16px; height: 16px; transition: transform var(--n-fast) ease; }

/* Academic Session Bar */
.n-sidebar-session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 14px 4px;
  padding: 6px 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--n-radius-pill);
  font-size: .72rem;
  flex-shrink: 0;
}
.n-session-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #166534;
}
.n-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, .7);
  animation: n-pulse 2.2s infinite;
}
@keyframes n-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .7); }
  70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
.n-session-status {
  font-size: .655rem;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.n-session-label {
  color: #14532d;
  font-weight: 700;
  font-feature-settings: "tnum";
}

/* Sidebar Search Box & Empty Filter */
.n-sidebar-search-box {
  padding: 8px 14px 4px;
  flex-shrink: 0;
}
.n-sidebar-search {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--n-surface-subtle);
  border: 1px solid var(--n-border);
  border-radius: var(--n-radius);
  transition: all var(--n-fast);
}
.n-sidebar-search:focus-within {
  /* Never force a light background here: the shell sidebar is dark, and a
     white panel with white text made the search field look blank. */
  border-color: var(--n-primary);
  box-shadow: 0 0 0 3px rgba(49, 94, 251, .12);
  transform: translateY(-1px);
}
.n-sidebar-search {
  transition: background-color var(--n-fast) ease, border-color var(--n-fast) ease,
              box-shadow var(--n-fast) ease, transform var(--n-fast) ease;
}
.n-sidebar-search .n-search-icon {
  transition: color var(--n-fast) ease, transform var(--n-fast) ease;
}
.n-sidebar-search:focus-within .n-search-icon {
  color: var(--n-primary);
  transform: scale(1.06);
}
.n-filter-input::-webkit-search-decoration,
.n-filter-input::-webkit-search-cancel-button,
.n-filter-input::-webkit-search-results-button,
.n-filter-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.n-filter-input {
  -webkit-appearance: none;
  appearance: none;
}
.n-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  color: var(--n-faint);
  flex-shrink: 0;
}
.n-search-icon .n-icon { width: 14px; height: 14px; }
.n-filter-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: .78rem;
  color: var(--n-ink);
  padding: 7px 4px 7px 0;
  font-family: inherit;
}
[dir="rtl"] .n-filter-input { padding: 7px 0 7px 4px; }
.n-filter-kbd {
  margin-inline-end: 8px;
  font-size: .62rem;
  padding: 1px 5px;
  color: var(--n-faint);
  background: #fff;
  border: 1px solid var(--n-border-strong);
  border-radius: 4px;
  pointer-events: none;
}
.n-filter-clear {
  background: transparent;
  border: 0;
  padding: 2px 6px;
  margin-inline-end: 4px;
  color: var(--n-faint);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  transition: all var(--n-fast);
}
.n-filter-clear:hover {
  color: var(--n-ink);
  background: var(--n-border);
}
.n-filter-clear .n-icon { width: 13px; height: 13px; }
.n-sidebar-empty-filter {
  padding: 28px 14px;
  text-align: center;
  color: var(--n-muted);
  font-size: .78rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.n-sidebar-empty-filter .n-icon { color: var(--n-faint); }

/* Navigation Groups & Accordions */
.n-sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 10px 18px;
  scrollbar-gutter: stable;
}
.n-nav-group {
  margin-block-start: 10px;
}
.n-nav-group:first-child {
  margin-block-start: 2px;
}
.n-nav-label {
  padding: 0 11px 7px;
  color: var(--n-faint);
  font-size: .655rem;
  font-weight: 700;
  letter-spacing: .075em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}
[dir="rtl"] .n-nav-label { letter-spacing: 0; }
.n-nav-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--n-faint);
  font-size: .655rem;
  font-weight: 700;
  letter-spacing: .075em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--n-radius-sm);
  transition: color var(--n-fast), background-color var(--n-fast);
  text-align: start;
}
[dir="rtl"] .n-nav-group-header { letter-spacing: 0; }
.n-nav-group-header:hover {
  color: var(--n-ink);
  background: var(--n-surface-subtle);
}
.n-nav-group-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.n-nav-group-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.n-nav-group-count {
  font-size: .62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--n-border);
  color: var(--n-muted);
  line-height: 1.2;
}
.n-nav-group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--n-faint);
  transition: transform var(--n-fast) ease;
}
.n-nav-group-chevron .n-icon { width: 12px; height: 12px; }
.n-nav-group.is-collapsed .n-nav-group-chevron {
  transform: rotate(-90deg);
}
[dir="rtl"] .n-nav-group.is-collapsed .n-nav-group-chevron {
  transform: rotate(90deg);
}
.n-nav-group-list {
  max-height: 1600px;
  opacity: 1;
  visibility: visible;
  overflow: hidden;
  transition: max-height .32s var(--n-ease), opacity .22s ease, visibility 0s;
}
.n-nav-group.is-collapsed .n-nav-group-list {
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: max-height .32s var(--n-ease), opacity .18s ease, visibility 0s .32s;
}
.n-nav-group-list {
  gap: 2px;
  padding: 2px 0 0;
  list-style: none;
  margin: 0;
}
.n-group-has-active .n-nav-group-title {
  color: var(--n-ink-soft);
}

/* Nav Links & Active State */
.nizam-sidebar .nav-link, .n-mobile-nav .nav-link {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: var(--n-radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--n-muted);
  font-size: .835rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: color var(--n-fast) ease, background-color var(--n-fast) ease, transform var(--n-fast) ease;
}
.nizam-sidebar .nav-link:hover, .n-mobile-nav .nav-link:hover {
  color: var(--n-ink);
  background: var(--n-surface-subtle);
  transform: translateX(2px);
}
[dir="rtl"] .nizam-sidebar .nav-link:hover, [dir="rtl"] .n-mobile-nav .nav-link:hover {
  transform: translateX(-2px);
}
.nizam-sidebar .nav-link.active, .n-mobile-nav .nav-link.active {
  color: var(--n-primary-strong);
  background: var(--n-primary-soft);
  font-weight: 650;
  transform: none !important;
}
.n-nav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}
.n-nav-icon .n-icon { width: 18px; height: 18px; }
.n-nav-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.n-nav-active-pip {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--n-primary);
  box-shadow: 0 0 6px var(--n-primary);
  margin-inline-start: auto;
  animation: n-pip-breathe 2.8s ease-in-out infinite;
}
@keyframes n-pip-breathe {
  0%, 100% { opacity: .75; transform: scale(.9); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* Sidebar entrance: groups settle in sequence, links respond to the icon. */
.nizam-sidebar .n-nav-group {
  animation: n-nav-rise .38s var(--n-ease) both;
}
.nizam-sidebar .n-nav-group:nth-child(2) { animation-delay: .03s; }
.nizam-sidebar .n-nav-group:nth-child(3) { animation-delay: .06s; }
.nizam-sidebar .n-nav-group:nth-child(4) { animation-delay: .09s; }
.nizam-sidebar .n-nav-group:nth-child(5) { animation-delay: .12s; }
.nizam-sidebar .n-nav-group:nth-child(6) { animation-delay: .15s; }
.nizam-sidebar .n-nav-group:nth-child(n+7) { animation-delay: .18s; }
@keyframes n-nav-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nizam-sidebar .nav-link .n-nav-icon {
  transition: color var(--n-fast) ease, transform var(--n-fast) ease;
}
.nizam-sidebar .nav-link:hover .n-nav-icon {
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .nizam-sidebar .n-nav-group,
  .n-nav-active-pip { animation: none !important; }
  .n-nav-group-list,
  .n-sidebar-search { transition: none !important; }
}

/* Pinned User Card at Bottom */
.n-sidebar-user-card {
  flex-shrink: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--n-border);
  background: var(--n-surface);
  display: flex;
  align-items: center;
  gap: 10px;
}
.n-user-avatar-badge {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--n-primary-strong);
  background: var(--n-primary-soft);
  border: 1.5px solid #dce5ff;
  font-size: .80rem;
  font-weight: 750;
}
.n-user-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.n-user-card-name {
  font-size: .78rem;
  font-weight: 650;
  color: var(--n-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.n-user-card-role {
  font-size: .65rem;
  color: var(--n-faint);
  font-weight: 550;
  text-transform: capitalize;
}
.n-user-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.n-user-card-actions .btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--n-radius-sm);
}
.n-user-card-actions .btn .n-icon { width: 15px; height: 15px; }

/* Collapsed Sidebar State (Rail Mode) */
.n-sidebar-collapsed .nizam-sidebar {
  width: var(--n-sidebar-collapsed-width);
  flex-basis: var(--n-sidebar-collapsed-width);
}
/* The desktop shell declares `flex: 0 0 var(--n-sidebar-width)` through the
   more-specific `body.n-app-body .nizam-sidebar` selector above. Setting only
   flex-basis here therefore lost the cascade and hid the labels while leaving
   a full 272px column behind. Override the complete flex shorthand at higher
   specificity so rail mode actually returns the space to the page. */
@media (min-width: 992px) {
  body.n-app-body .nizam-shell.n-sidebar-collapsed > .nizam-sidebar {
    width: var(--n-sidebar-collapsed-width);
    flex: 0 0 var(--n-sidebar-collapsed-width);
  }
}
.n-sidebar-collapsed .n-sidebar-brand-box {
  justify-content: center;
  padding: 12px 6px;
}
.n-sidebar-collapsed .n-sidebar-collapse-btn {
  display: none;
}
.n-sidebar-collapsed .nizam-brand {
  justify-content: center;
  flex: 0 0 auto;
}
.n-sidebar-collapsed .nizam-brand-copy,
.n-sidebar-collapsed .n-sidebar-session-bar,
.n-sidebar-collapsed .n-sidebar-search-box,
.n-sidebar-collapsed .n-nav-text,
.n-sidebar-collapsed .n-nav-group-header,
.n-sidebar-collapsed .n-nav-active-pip,
.n-sidebar-collapsed .n-user-card-info,
.n-sidebar-collapsed .n-user-card-actions {
  display: none !important;
}
.n-sidebar-collapsed .n-sidebar-nav {
  padding-inline: 8px;
}
.n-sidebar-collapsed .n-nav-group {
  margin-block-start: 6px;
  border-top: 1px solid var(--n-border);
  padding-top: 6px;
}
.n-sidebar-collapsed .n-nav-group:first-child {
  border-top: 0;
  padding-top: 0;
}
.n-sidebar-collapsed .n-nav-group.is-collapsed .n-nav-group-list {
  display: flex !important;
  max-height: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.n-sidebar-collapsed .nizam-sidebar .nav-link {
  justify-content: center;
  padding: 9px 0;
}
.n-sidebar-collapsed .n-sidebar-user-card {
  justify-content: center;
  padding: 12px 6px;
}

.nizam-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
/* The top bar is a command bar, not a second menu. It answers three
   questions in reading order: where am I, how do I get anywhere else, and
   what is the state of my session. Controls share one 40px rhythm, and the
   action rail is an explicit content-sized column so it can never grow
   backwards across the search field. */
.nizam-topbar {
  height: var(--n-topbar-height);
  position: sticky;
  inset-block-start: 0;
  z-index: 25;
  padding-inline: clamp(12px, 1.8vw, 26px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 400px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 1.2vw, 18px);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--n-border);
  backdrop-filter: blur(14px);
}
/* A single saffron-to-emerald hairline gives the bar a finished edge without
   adding a second heavy border. */
.nizam-topbar::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: -1px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(189, 139, 50, .38) 22%,
    rgba(13, 92, 74, .22) 62%,
    transparent 100%);
  pointer-events: none;
}
.n-topbar-start { grid-column: 1; min-width: 0; display: flex; align-items: center; gap: 9px; overflow: hidden; }
/* The glyph is the active module's own icon, so the header identifies the
   workspace even when the page title is truncated. */
.n-topbar-glyph {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d5e6dc;
  border-radius: 11px;
  color: var(--n-primary-strong);
  background: linear-gradient(150deg, #f0f7f3 0%, #dceae1 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(16, 36, 29, .04);
}
.n-topbar-glyph .n-icon { width: 18px; height: 18px; }
.n-topbar-context { min-width: 0; flex: 1 1 auto; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.n-breadcrumb { display: flex; align-items: center; gap: 5px; color: var(--n-faint); font-size: .66rem; line-height: 1.25; white-space: nowrap; overflow: hidden; }
.n-breadcrumb > * { flex: 0 0 auto; }
.n-breadcrumb a { display: inline-flex; align-items: center; gap: 4px; padding-block: 6px; margin-block: -6px; color: var(--n-faint); text-decoration: none; }
.n-breadcrumb a:hover { color: var(--n-primary); }
.n-breadcrumb .n-icon { width: 11px; height: 11px; }
.n-breadcrumb-group { color: var(--n-muted); font-weight: 600; }
.n-breadcrumb-sep { display: inline-flex; color: #b7ad9c; }
/* WCAG 2.2 AA 2.5.8: a standalone target is at least 24x24 CSS pixels. The
   breadcrumb link grows vertically and keeps the header height unchanged. */
.n-topbar-title { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; font-weight: 700; color: var(--n-ink); letter-spacing: -.01em; }
a.badge { display: inline-flex; align-items: center; min-height: 24px; }

.n-topbar-search { grid-column: 2; min-width: 0; display: flex; justify-content: center; }
.n-command-trigger { width: 100%; height: 40px; min-width: 0; border: 1px solid var(--n-border); border-radius: 12px; padding-block: 0; padding-inline: 9px 8px; display: flex; align-items: center; gap: 9px; color: var(--n-muted); background: linear-gradient(180deg, #fff 0%, var(--n-surface-subtle) 100%); box-shadow: inset 0 1px 2px rgba(16, 36, 29, .035); font: inherit; font-size: .78rem; text-align: start; transition: border-color var(--n-fast), box-shadow var(--n-fast), background var(--n-fast); }
.n-command-trigger:hover { background: #fff; border-color: var(--n-border-strong); box-shadow: var(--n-shadow-xs); }
.n-command-trigger:focus-visible { outline: 2px solid var(--n-primary); outline-offset: 2px; }
.n-command-icon { width: 26px; height: 26px; flex: 0 0 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--n-primary); background: var(--n-primary-softer); }
.n-command-icon .n-icon { width: 15px; height: 15px; }
.n-command-text { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { border: 1px solid var(--n-border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--n-muted); background: #fff; font-family: inherit; font-size: .65rem; font-weight: 600; box-shadow: none; }
.n-command-kbd { flex: 0 0 auto; }

.n-topbar-actions { grid-column: 3; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.n-topbar-cluster { min-width: 0; display: flex; align-items: center; gap: 5px; }
/* Language and alerts are one utility capsule: related session tools read as
   a single object instead of two unrelated icon buttons. */
.n-topbar-cluster--tools {
  padding: 3px;
  border: 1px solid var(--n-border);
  border-radius: 999px;
  background: var(--n-surface-subtle);
  box-shadow: inset 0 1px 2px rgba(16, 36, 29, .03);
}
.n-topbar-cluster--tools .btn-icon { width: 32px; min-width: 32px; height: 32px; min-height: 32px; border-radius: 999px; }
.n-tools-sep { width: 1px; height: 18px; margin-inline: 3px; background: var(--n-border-strong); opacity: .7; }
.n-topbar-divider { width: 1px; height: 24px; flex: 0 0 auto; margin-inline: 3px; background: linear-gradient(180deg, transparent, var(--n-border-strong) 18%, var(--n-border-strong) 82%, transparent); }

.n-year-pill { height: 38px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--n-border); border-radius: 999px; color: var(--n-ink-soft); background: #fff; box-shadow: var(--n-shadow-xs); font: inherit; font-size: .74rem; font-weight: 650; white-space: nowrap; cursor: pointer; transition: border-color var(--n-fast), box-shadow var(--n-fast); }
.n-year-pill:hover { border-color: var(--n-border-strong); box-shadow: var(--n-shadow-sm); }
.n-year-pill:focus-visible { outline: 2px solid var(--n-primary); outline-offset: 2px; }
.n-year-pill-icon { position: relative; display: inline-flex; color: var(--n-primary); }
.n-year-pill-icon .n-icon { width: 15px; height: 15px; }
.n-year-pill-dot { position: absolute; inset-block-end: -2px; inset-inline-end: -3px; width: 7px; height: 7px; border: 1.5px solid #fff; border-radius: 50%; background: var(--n-success); box-shadow: 0 0 0 2px rgba(20, 122, 82, .14); }
.n-year-pill-caret { color: var(--n-faint); }
/* One deliberate tiny size for disclosure carets inside pills. The global
   icon size must not win here, so the selector carries both classes. */
.n-icon.n-icon-xs { width: 12px; height: 12px; }

.n-lang-switch { height: 32px; padding: 2px; display: flex; align-items: center; gap: 2px; border-radius: 999px; background: transparent; }
.n-lang-switch a { min-width: 30px; height: 28px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; color: var(--n-muted); font-size: .68rem; font-weight: 700; text-decoration: none; transition: color var(--n-fast), background var(--n-fast), box-shadow var(--n-fast); }
.n-lang-switch a:hover { color: var(--n-ink); background: rgba(255, 255, 255, .72); }
.n-lang-switch a:focus-visible { outline: 2px solid var(--n-primary); outline-offset: 1px; }
.n-lang-switch a.active { color: #fff; background: var(--n-primary); box-shadow: 0 4px 10px -6px rgba(13, 92, 74, .9); }

.n-quick-trigger { height: 38px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.n-quick-trigger-icon { display: inline-flex; }
.n-quick-trigger .n-icon { width: 15px; height: 15px; }
.n-quick-trigger-caret { opacity: .72; }
.n-quick-trigger-label { display: none; }

.n-topbar-account { flex: 0 0 auto; }
.n-user-trigger { min-width: 38px; min-height: 40px; padding-block: 2px; padding-inline: 3px 7px; border: 1px solid transparent; border-radius: 999px; display: flex; align-items: center; gap: 8px; color: var(--n-ink); background: transparent; font: inherit; transition: background var(--n-fast), border-color var(--n-fast); }
.n-user-trigger:hover { background: var(--n-surface-subtle); border-color: var(--n-border); }
.n-user-trigger:focus-visible { outline: 2px solid var(--n-primary); outline-offset: 2px; }
.n-user-trigger-copy { min-width: 0; display: none; flex-direction: column; text-align: start; line-height: 1.2; }
.n-user-trigger-copy strong { max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; font-weight: 650; }
.n-user-trigger-copy small { color: var(--n-faint); font-size: .63rem; }
.n-user-trigger-caret { display: none; color: var(--n-faint); }
.n-user-trigger .n-user-trigger-caret { display: none; }
.n-avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--n-primary-strong); background: var(--n-primary-soft); border: 1px solid #dce5ff; font-size: .76rem; font-weight: 700; }
.nizam-content { width: 100%; max-width: var(--n-content-max); margin-inline: auto; padding: clamp(20px, 2.8vw, 40px) clamp(16px, 3.2vw, 52px) 56px; }

.n-mobile-nav { width: min(330px, 90vw) !important; background: var(--n-surface); }
.n-mobile-nav .offcanvas-header { min-height: 78px; padding: 0 16px; border-bottom: 1px solid var(--n-border); }
.n-mobile-nav .nizam-brand { min-height: auto; padding: 0; border: 0; }
.n-mobile-nav .n-sidebar-nav { padding: 14px 8px 30px; }

/* ========================================================================== 
   Command palette and dropdown surfaces
   ========================================================================== */
.n-command-open { overflow: hidden; }
.n-command-overlay { position: fixed; inset: 0; z-index: 1300; padding: min(14vh, 110px) 16px 30px; display: flex; align-items: flex-start; justify-content: center; background: rgba(23, 32, 51, .34); backdrop-filter: blur(5px); opacity: 0; transition: opacity var(--n-fast) ease; }
.n-command-overlay.show { opacity: 1; }
.n-command-dialog { width: min(620px, 100%); max-height: min(680px, 78vh); overflow: hidden; border: 1px solid rgba(255,255,255,.7); border-radius: var(--n-radius-xl); background: var(--n-surface); box-shadow: var(--n-shadow-lg); transform: translateY(-8px) scale(.985); transition: transform var(--n-overlay) var(--n-ease); }
.n-command-overlay.show .n-command-dialog { transform: translateY(0) scale(1); }
.n-command-search { min-height: 60px; padding: 0 17px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--n-border); }
.n-command-search > .n-icon { color: var(--n-primary); }
.n-command-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--n-ink); font: inherit; font-size: 1rem; }
.n-command-search input::placeholder { color: var(--n-faint); }
.n-command-meta { padding: 11px 17px 8px; display: flex; justify-content: space-between; gap: 12px; color: var(--n-muted); font-size: .72rem; }
.n-command-meta strong { color: var(--n-ink-soft); }
.n-command-results { max-height: calc(min(680px, 78vh) - 105px); padding: 4px 9px 12px; overflow-y: auto; }
.n-command-group + .n-command-group { margin-block-start: 8px; }
.n-command-group-label { padding: 8px 9px 5px; color: var(--n-faint); font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.n-command-item { min-height: 44px; padding: 7px 10px; border-radius: var(--n-radius-sm); display: flex; align-items: center; gap: 10px; color: var(--n-ink-soft); text-decoration: none; font-size: .84rem; font-weight: 500; }
.n-command-item:hover, .n-command-item.selected { color: var(--n-primary-strong); background: var(--n-primary-soft); }
.n-command-item-icon { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--n-primary); background: #fff; border: 1px solid var(--n-border); }
.n-command-arrow { margin-inline-start: auto; color: var(--n-faint); }
.n-command-empty { padding: 36px 20px; color: var(--n-muted); text-align: center; }

.dropdown-menu { padding: 7px; border: 1px solid var(--n-border); border-radius: var(--n-radius); background: var(--n-surface); box-shadow: var(--n-shadow); font-size: .82rem; animation: n-dropdown-in var(--n-fast) var(--n-ease) both; }
.dropdown-item { min-height: 38px; padding: 8px 10px; border-radius: 7px; display: flex; align-items: center; gap: 9px; color: var(--n-ink-soft); }
.dropdown-item:hover, .dropdown-item:focus { color: var(--n-ink); background: var(--n-surface-subtle); }
.dropdown-item .n-icon { color: var(--n-muted); }
.dropdown-header { padding: 7px 10px; color: var(--n-faint); font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.dropdown-divider { border-color: var(--n-border); }
.n-quick-menu { min-width: 220px; }
.n-account-menu { min-width: 245px; }
.n-account-summary { padding: 8px 9px 10px; display: flex; align-items: center; gap: 10px; }
.n-account-summary > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.n-account-summary strong { max-width: 165px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.n-account-summary small { color: var(--n-muted); font-size: .7rem; }

.n-notification-count { position: absolute; inset-block-start: -3px; inset-inline-end: -3px; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid #fff; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--n-danger); font-size: .55rem; font-weight: 700; }
.n-notification-menu { width: min(390px, calc(100vw - 22px)); padding: 0; overflow: hidden; }
.n-notification-menu-head { min-height: 48px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--n-border); }
.n-notification-menu-head .btn-link { color: var(--n-primary); font-size: .7rem; text-decoration: none; }
.n-notification-menu-list { max-height: 390px; margin: 0; padding: 5px; overflow-y: auto; list-style: none; }
.n-notification-menu-item { padding: 10px; border-radius: 8px; display: block; color: var(--n-ink); text-decoration: none; }
.n-notification-menu-item:hover { color: var(--n-ink); background: var(--n-surface-subtle); }
.n-notification-menu-item.unread { background: var(--n-primary-softer); }
.n-notification-menu-title { display: flex; align-items: center; gap: 5px; font-size: .77rem; font-weight: 650; }
.n-notification-menu-title > span:first-child { min-width: 0; flex: 1; }
.n-notification-menu-item p { margin: 3px 0 5px; color: var(--n-muted); font-size: .7rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.n-notification-menu-item time { color: var(--n-faint); font-size: .65rem; }
.n-notification-menu-empty { padding: 34px 16px; color: var(--n-muted); text-align: center; font-size: .78rem; }
.n-notification-menu-footer { min-height: 42px; display: flex; align-items: center; justify-content: center; border-top: 1px solid var(--n-border); color: var(--n-primary); font-size: .73rem; font-weight: 600; text-decoration: none; }
.n-mini-badge { padding: 2px 5px; border-radius: 999px; font-size: .55rem; font-weight: 700; }
.n-mini-badge.primary { color: var(--n-primary-strong); background: var(--n-primary-soft); }
.n-mini-badge.danger { color: var(--n-danger); background: var(--n-danger-soft); }

/* Role and permission governance */
.n-role-summary, .n-role-editor-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.n-role-summary span, .n-role-editor-stats span { min-width: 92px; padding: 7px 10px; border: 1px solid var(--n-border); border-radius: 9px; display: flex; flex-direction: column; color: var(--n-muted); font-size: .65rem; background: #fff; }
.n-role-summary strong, .n-role-editor-stats strong { color: var(--n-ink); font-size: 1rem; }
.n-role-layout { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); gap: 22px; align-items: start; }
.n-role-list { position: sticky; top: calc(var(--n-topbar-height) + 16px); padding: 6px; border: 1px solid var(--n-border); border-radius: var(--n-radius); display: flex; flex-direction: column; gap: 3px; background: var(--n-surface-subtle); }
.n-role-item { min-width: 0; min-height: 52px; padding: 7px 9px; border: 1px solid transparent; border-radius: 9px; display: flex; align-items: center; gap: 9px; color: var(--n-ink-soft); text-decoration: none; }
.n-role-item:hover { color: var(--n-ink); background: #fff; }
.n-role-item.active { color: var(--n-primary-strong); background: #fff; border-color: #cfe2d7; box-shadow: var(--n-shadow-xs); }
.n-role-item-icon { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--n-primary); background: var(--n-primary-soft); }
.n-role-item-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.n-role-item-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.n-role-item-copy small { color: var(--n-faint); font-size: .62rem; }
.n-role-item-count { min-width: 24px; height: 24px; padding: 0 5px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--n-muted); background: var(--n-surface-subtle); font-size: .65rem; font-weight: 700; }
.n-role-new-link { min-height: 42px; margin-top: 3px; padding: 8px 10px; border-top: 1px solid var(--n-border); display: flex; align-items: center; gap: 8px; color: var(--n-primary); font-size: .75rem; font-weight: 650; text-decoration: none; }
.n-role-editor { min-width: 0; }
.n-role-editor-head { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--n-border); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.n-role-editor-head h3 { margin: 2px 0; font-size: 1.25rem; }
.n-permission-head { margin-bottom: 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.n-permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.n-permission-card { min-width: 0; margin: 0; padding: 0; border: 1px solid var(--n-border); border-radius: var(--n-radius); overflow: hidden; background: #fff; }
.n-permission-card legend { width: 100%; margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--n-border); display: flex; align-items: center; gap: 8px; color: var(--n-ink); background: var(--n-surface-subtle); font-size: .76rem; font-weight: 700; }
.n-permission-card legend small { margin-inline-start: auto; color: var(--n-faint); }
.n-permission-list { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.n-permission-option { min-width: 0; margin: 0; padding: 7px 8px; border-radius: 7px; display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.n-permission-option:hover { background: var(--n-surface-subtle); }
.n-permission-option.is-checked { background: var(--n-primary-softer); }
.n-permission-option input { margin-top: 3px; }
.n-permission-option span { min-width: 0; display: flex; flex-direction: column; }
.n-permission-option strong { font-size: .72rem; font-weight: 600; }
.n-permission-option code { overflow: hidden; text-overflow: ellipsis; color: var(--n-muted); font-size: .58rem; }
.n-role-create { margin-top: 28px; padding: 18px; border: 1px dashed var(--n-border-strong); border-radius: var(--n-radius); background: var(--n-surface-subtle); }
@media (max-width: 1279.98px) { .n-role-layout { grid-template-columns: 1fr; } .n-role-list { position: static; max-height: 260px; overflow-y: auto; } }
@media (max-width: 767.98px) { .n-role-editor-head { flex-direction: column; } }
@media (max-width: 575.98px) { .n-permission-grid { grid-template-columns: 1fr; } }

/* ========================================================================== 
   Page structure and module headers
   ========================================================================== */
.n-page-head { margin-block-end: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.n-page-head-main, .n-page-head > div:first-child { min-width: 0; display: flex; align-items: flex-start; gap: 12px; }
.n-page-head > div:first-child:not(.n-page-head-main) { display: block; }
.n-page-head-icon { width: 40px; height: 40px; flex: 0 0 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--n-radius); color: var(--n-primary); background: var(--n-primary-soft); }
.n-page-head h1 { margin: 0; font-size: clamp(1.25rem, 2vw, 1.55rem); }
.n-page-head p { max-width: 68ch; margin: 5px 0 0; color: var(--n-muted); font-size: .82rem; }
.n-page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Legacy module header class, deliberately normalized into the same quiet hierarchy. */
.n-grades-header { margin-block-end: 24px; }
.n-grades-header-content { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.n-grades-header-text { min-width: 0; }
.n-grades-title { margin: 0; display: flex; align-items: center; gap: 12px; font-size: clamp(1.3rem, 2vw, 1.65rem); }
.n-grades-icon-wrapper { width: 42px; height: 42px; flex: 0 0 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--n-radius); color: var(--n-primary); background: var(--n-primary-soft); }
.n-grades-icon { width: 21px; height: 21px; }
.n-grades-subtitle { max-width: 68ch; margin: 6px 0 0 54px; color: var(--n-muted); font-size: .83rem; }
[dir="rtl"] .n-grades-subtitle { margin-inline: 54px 0; }
.n-grades-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.n-grades-stats-mini { display: flex; gap: 8px; flex-wrap: wrap; }
.n-stat-mini { min-width: 84px; min-height: 48px; padding: 6px 11px; border: 1px solid var(--n-border); border-radius: var(--n-radius); display: flex; flex-direction: column; justify-content: center; background: var(--n-surface); }
.n-stat-mini-value { color: var(--n-ink); font-size: 1rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.n-stat-mini-label { color: var(--n-muted); font-size: .62rem; white-space: nowrap; }
.n-stat-mini.success .n-stat-mini-value { color: var(--n-success); }
.n-stat-mini.archived .n-stat-mini-value { color: var(--n-muted); }
.n-grades-header .btn-outline-light { color: var(--n-ink-soft); border-color: var(--n-border-strong); background: #fff; }
.n-grades-header .btn-outline-light:hover { color: var(--n-primary-strong); border-color: #b9c8ff; background: var(--n-primary-soft); }

/* ========================================================================== 
   Cards, panels, stats, profiles
   ========================================================================== */
.card { border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--n-surface); box-shadow: var(--n-shadow-xs); overflow: hidden; }
.card-header { min-height: 50px; padding: 13px 18px; border-bottom: 1px solid var(--n-border); display: flex; align-items: center; gap: 9px; color: var(--n-ink); background: var(--n-surface) !important; font-weight: 650; }
.card-header .n-icon { color: var(--n-primary); }
.card-body { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--n-border); background: var(--n-surface-subtle) !important; }
.n-card-hover, .n-card-interactive, a.text-decoration-none .card { transition: transform var(--n-standard) var(--n-ease), box-shadow var(--n-standard) var(--n-ease), border-color var(--n-standard); }
.n-card-hover:hover, .n-card-interactive:hover, a.text-decoration-none:hover .card { transform: translateY(-2px); border-color: var(--n-border-strong); box-shadow: var(--n-shadow-sm); }
.stat-card { position: relative; overflow: hidden; transition: transform var(--n-fast), box-shadow var(--n-fast); }
.stat-card::before { content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 3px; background: var(--stat-accent, var(--n-primary)); opacity: .5; transition: opacity var(--n-fast); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--n-shadow-sm); }
.stat-card:hover::before { opacity: 1; }
.stat-card .card-body { min-height: 108px; padding: 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stat-card .stat-value { color: var(--n-ink); font-size: clamp(1.5rem, 2.7vw, 1.95rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-card .stat-label { margin-block-start: 7px; color: var(--n-muted); font-size: .72rem; font-weight: 500; }
:lang(en) .stat-card .stat-label { font-size: .66rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.stat-card .stat-icon { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; color: var(--stat-ink, var(--n-primary-strong)); background: var(--stat-tint, var(--n-primary-soft)); }
.stat-card .stat-icon .n-icon { width: 18px; height: 18px; }
.stat-card.stat-blue { --stat-accent: var(--n-primary); --stat-tint: var(--n-primary-soft); --stat-ink: var(--n-primary-strong); }
.stat-card.stat-teal { --stat-accent: var(--n-teal); --stat-tint: var(--n-teal-soft); --stat-ink: #0b7d72; }
.stat-card.stat-indigo { --stat-accent: #6d6ff0; --stat-tint: #eef0ff; --stat-ink: #4a48c0; }
.stat-card.stat-violet { --stat-accent: #9a5cf0; --stat-tint: #f5edff; --stat-ink: #7344b8; }
.stat-card.stat-amber { --stat-accent: #d9860f; --stat-tint: #fff6df; --stat-ink: #96540b; }
.n-data-panel { border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--n-surface); box-shadow: var(--n-shadow-xs); overflow: hidden; }
.n-section-head { padding: 16px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--n-border); }
.n-section-head h2 { margin: 0; font-size: .98rem; }
.n-section-head p { margin: 3px 0 0; color: var(--n-muted); font-size: .75rem; }

.n-profile-hero { margin-block-end: 20px; padding: 20px; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; background: var(--n-surface); }
.n-profile-identity { min-width: 0; display: flex; align-items: center; gap: 15px; }
.n-profile-photo { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 16px; object-fit: cover; border: 1px solid var(--n-border); background: var(--n-surface-subtle); }
.n-profile-placeholder { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--n-primary-strong); background: var(--n-primary-soft); font-size: 1.45rem; font-weight: 700; }
.n-profile-title { margin: 0; font-size: 1.35rem; }
.n-profile-code { margin-block-start: 4px; color: var(--n-muted); font-size: .76rem; }
.n-profile-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.n-detail-list { margin: 0; display: grid; grid-template-columns: minmax(130px, .65fr) minmax(0, 1.6fr); }
.n-detail-list dt, .n-detail-list dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--n-border); }
.n-detail-list dt { color: var(--n-muted); font-size: .75rem; font-weight: 600; }
.n-detail-list dd { color: var(--n-ink-soft); }
.n-detail-list dt:last-of-type, .n-detail-list dd:last-of-type { border-bottom: 0; }

.n-dashboard-welcome { position: relative; margin-block-end: 18px; padding: 20px 22px; border: 1px solid #dbe4ff; border-radius: var(--n-radius-lg); display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; background: var(--n-primary-softer); overflow: hidden; }
.n-dashboard-welcome::before { content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 3px; background: var(--n-primary); opacity: .85; }
/* Hairline ring echoing the school seal -- flat, one arc, no gradient. */
.n-dashboard-welcome::after { content: ""; position: absolute; inset-block-start: -110px; inset-inline-end: 90px; width: 260px; height: 260px; border: 34px solid rgba(49, 94, 251, .05); border-radius: 50%; pointer-events: none; }
[dir="rtl"] .n-dashboard-welcome::after { inset-inline-end: auto; inset-inline-start: 90px; }
.n-dashboard-welcome > div:first-child { position: relative; z-index: 1; }
.n-dashboard-welcome h1 { margin: 0 0 4px; font-size: clamp(1.25rem, 2vw, 1.6rem); }
.n-dashboard-welcome p { margin: 0; color: var(--n-muted); font-size: .83rem; }
.n-dashboard-context { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.n-context-chip { min-height: 34px; padding: 0 12px; border: 1px solid #d4defc; border-radius: var(--n-radius-pill); display: inline-flex; align-items: center; gap: 7px; color: var(--n-ink-soft); background: #fff; font-size: .72rem; font-weight: 600; box-shadow: var(--n-shadow-xs); }
.n-context-chip .n-icon { width: 13px; height: 13px; color: var(--n-primary); }
.n-quick-actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; }
.n-quick-action { min-height: 66px; padding: 11px; border: 1px solid var(--n-border); border-radius: var(--n-radius); display: flex; align-items: center; gap: 10px; color: var(--n-ink-soft); background: #fff; text-decoration: none; font-size: .77rem; font-weight: 600; transition: background var(--n-fast), border-color var(--n-fast), transform var(--n-fast), box-shadow var(--n-fast); }
.n-quick-action:hover { color: var(--n-primary-strong); border-color: #bdcbff; background: #fff; box-shadow: var(--n-shadow-xs); transform: translateY(-1px); }
.n-quick-action .n-icon { width: 30px; height: 30px; padding: 7px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--n-primary); background: var(--n-primary-softer); box-sizing: border-box; }
.n-quick-action:hover .n-icon { background: var(--n-primary-soft); }
.n-insight-note { padding: 11px 13px; display: flex; align-items: flex-start; gap: 8px; color: var(--n-muted); background: var(--n-surface-subtle); border-radius: var(--n-radius-sm); font-size: .72rem; }
.n-chart-wrap { width: min(100%, 720px); margin-inline: auto; min-height: 245px; display: flex; align-items: center; justify-content: center; }
.n-activity-list { margin: 0; padding: 4px 18px; list-style: none; }
.n-activity-list li { min-height: 64px; padding: 11px 0; border-bottom: 1px solid var(--n-border); display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: flex-start; gap: 10px; }
.n-activity-list li:last-child { border-bottom: 0; }
.n-activity-marker { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--n-primary); background: var(--n-primary-soft); }
.n-activity-marker .n-icon { width: 14px; height: 14px; }
.n-activity-copy { min-width: 0; display: flex; flex-direction: column; }
.n-activity-copy strong { font-size: .77rem; font-weight: 650; }
.n-activity-copy small { margin-block-start: 2px; color: var(--n-muted); font-size: .66rem; overflow-wrap: anywhere; }
.n-activity-list time { color: var(--n-faint); font-size: .63rem; white-space: nowrap; }
.n-person-cell { min-width: 0; display: inline-flex; align-items: center; gap: 10px; color: var(--n-ink); text-decoration: none; }
.n-person-cell:hover { color: var(--n-primary-strong); }
.n-person-cell > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.n-person-cell strong { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.n-person-cell small { color: var(--n-muted); font-size: .64rem; }
.n-person-avatar { width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid var(--n-border); border-radius: 10px; object-fit: cover; background: var(--n-surface-subtle); }
.n-person-initial { display: inline-flex; align-items: center; justify-content: center; color: var(--n-primary-strong); background: var(--n-primary-soft); font-size: .78rem; font-weight: 700; }
.n-tag-list { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.n-form-workspace { width: min(820px, 100%); padding: 21px; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--n-surface); box-shadow: var(--n-shadow-xs); }
.n-upload-row { display: flex; align-items: center; gap: 16px; }
.n-upload-preview { width: 78px; height: 78px; flex: 0 0 78px; border: 1px solid var(--n-border); border-radius: 14px; object-fit: cover; background: var(--n-surface-subtle); }
.n-upload-placeholder { display: inline-flex; align-items: center; justify-content: center; color: var(--n-faint); }
.n-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 8px; }
.n-check-card { min-height: 42px; padding: 8px 10px; border: 1px solid var(--n-border); border-radius: 8px; display: flex; align-items: center; gap: 8px; color: var(--n-ink-soft); background: #fff; font-size: .76rem; cursor: pointer; }
.n-check-card:has(input:checked) { color: var(--n-primary-strong); border-color: #bdcbff; background: var(--n-primary-softer); }
.n-order-chip, .n-code-chip { min-width: 30px; min-height: 28px; padding: 4px 8px; border: 1px solid var(--n-border); border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: var(--n-primary-strong); background: var(--n-primary-soft); font-size: .7rem; font-weight: 700; }
.n-code-chip { color: var(--n-ink-soft); background: var(--n-surface-subtle); }
.n-capacity-meter { min-width: 125px; display: flex; align-items: center; gap: 8px; }
.n-capacity-meter > span { width: 90px; height: 6px; border-radius: 999px; overflow: hidden; background: var(--n-surface-muted); }
.n-capacity-meter i { height: 100%; display: block; border-radius: 999px; background: var(--n-primary); }
.n-capacity-meter i.success { background: var(--n-success); }
.n-capacity-meter i.warning { background: #d49a2b; }
.n-capacity-meter i.danger { background: var(--n-danger); }
.n-capacity-meter b { color: var(--n-muted); font-size: .66rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.n-year-list { position: relative; display: flex; flex-direction: column; gap: 9px; }
.n-year-list::before { content: ""; position: absolute; inset-block: 24px; inset-inline-start: 23px; width: 1px; background: var(--n-border); }
.n-year-row { position: relative; padding: 15px 15px 15px 62px; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); display: flex; align-items: center; gap: 14px; background: var(--n-surface); }
[dir="rtl"] .n-year-row { padding: 15px 62px 15px 15px; }
.n-year-row.active { border-color: #c7d3ff; box-shadow: inset 3px 0 0 var(--n-primary); }
[dir="rtl"] .n-year-row.active { box-shadow: inset -3px 0 0 var(--n-primary); }
.n-year-row.closed { background: #fafbfc; }
.n-year-marker { position: absolute; inset-inline-start: 8px; width: 32px; height: 32px; border: 4px solid var(--n-surface); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--n-primary); background: var(--n-primary-soft); box-shadow: 0 0 0 1px var(--n-border); z-index: 1; }
.n-year-marker .n-icon { width: 14px; height: 14px; }
.n-year-main { min-width: 0; flex: 1; }
.n-year-main h2 { margin: 0; font-size: .94rem; }
.n-year-dates { margin-block-start: 5px; display: flex; align-items: center; gap: 7px; color: var(--n-muted); font-size: .7rem; }
.n-year-dates .n-icon { width: 13px; height: 13px; }
.n-year-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.n-year-actions form { margin: 0; }

/* ========================================================================== 
   Buttons and controls
   ========================================================================== */
.btn { min-height: 38px; padding: 7px 14px; border-radius: var(--n-radius-sm); display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: .805rem; font-weight: 600; line-height: 1.2; transition: transform var(--n-fast), color var(--n-fast), background-color var(--n-fast), border-color var(--n-fast), box-shadow var(--n-fast); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .n-icon { width: 16px; height: 16px; }
.btn-sm { min-height: 32px; padding: 5px 10px; border-radius: 7px; font-size: .72rem; }
.btn-lg { min-height: 44px; padding: 9px 18px; font-size: .88rem; }
.btn-icon { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; }
.btn-primary { color: #fff; background: var(--n-primary); border-color: var(--n-primary); box-shadow: 0 2px 5px rgba(49,94,251,.14); }
.btn-primary:hover, .btn-primary:focus { color: #fff; background: var(--n-primary-hover); border-color: var(--n-primary-hover); }
.btn-secondary { color: var(--n-ink-soft); background: var(--n-surface-subtle); border-color: var(--n-border); }
.btn-secondary:hover { color: var(--n-ink); background: var(--n-surface-muted); border-color: var(--n-border-strong); }
.btn-ghost { color: var(--n-muted); background: transparent; border-color: transparent; }
.btn-ghost:hover { color: var(--n-ink); background: var(--n-surface-subtle); border-color: transparent; }
.btn-outline-primary { color: var(--n-primary); border-color: #aebfff; background: #fff; }
.btn-outline-primary:hover { color: #fff; background: var(--n-primary); border-color: var(--n-primary); }
.btn-outline-secondary { color: var(--n-ink-soft); border-color: var(--n-border-strong); background: #fff; }
.btn-outline-secondary:hover { color: var(--n-ink); background: var(--n-surface-subtle); border-color: var(--n-border-strong); }
.btn-danger { color: #fff; background: var(--n-danger); border-color: var(--n-danger); }
.btn-danger:hover { color: #fff; background: var(--n-danger-hover); border-color: var(--n-danger-hover); }
.btn-outline-danger { color: var(--n-danger); border-color: #e7aeb4; background: #fff; }
.btn-outline-danger:hover { color: #fff; background: var(--n-danger); border-color: var(--n-danger); }
.btn-success { color: #fff; background: var(--n-success); border-color: var(--n-success); }
.btn-outline-success { color: var(--n-success); border-color: #9ed3b8; background: #fff; }
.btn-outline-success:hover { color: #fff; background: var(--n-success); border-color: var(--n-success); }
.btn-outline-warning { color: var(--n-warning); border-color: #e3c184; background: #fff; }
.btn-outline-warning:hover { color: #513000; background: var(--n-warning-soft); border-color: #d8ae62; }
.btn-link { color: var(--n-primary); }
.btn:disabled, .btn.disabled { opacity: .55; transform: none !important; }

.form-label, .n-form-label, .n-label-powerful { margin-block-end: 6px; color: var(--n-ink-soft); font-size: .77rem; font-weight: 600; }
.form-control, .form-select { min-height: 40px; padding: 8px 11px; border: 1px solid var(--n-border-strong); border-radius: var(--n-radius-sm); color: var(--n-ink); background-color: #fff; font: inherit; font-size: .84rem; transition: border-color var(--n-fast), box-shadow var(--n-fast), background var(--n-fast); }
.form-control:hover, .form-select:hover { border-color: #bcc8d7; }
.form-control:focus, .form-select:focus { border-color: var(--n-primary); box-shadow: 0 0 0 3px rgba(49,94,251,.12); }
.form-control::placeholder { color: var(--n-faint); }
.form-control:disabled, .form-select:disabled { color: var(--n-muted); background: var(--n-surface-subtle); }
.form-control-sm, .form-select-sm { min-height: 34px; padding: 6px 9px; font-size: .76rem; }
.form-select-lg, .form-control-lg { min-height: 46px; font-size: .9rem; }
textarea.form-control { min-height: 84px; resize: vertical; }
.form-text { margin-block-start: 5px; color: var(--n-muted); font-size: .7rem; line-height: 1.45; }
.form-check { min-height: 25px; }
.form-check-input { border-color: var(--n-border-strong); }
.form-check-input:checked { background-color: var(--n-primary); border-color: var(--n-primary); }
.form-check-input:focus { border-color: var(--n-primary); box-shadow: 0 0 0 3px rgba(49,94,251,.12); }
input[type="file"].form-control { padding: 5px; }
input[type="file"]::file-selector-button { margin-inline-end: 10px; padding: 6px 10px; border: 0; border-radius: 6px; color: var(--n-ink-soft); background: var(--n-surface-subtle); font: inherit; font-weight: 600; }
.n-form-section + .n-form-section { margin-block-start: 24px; padding-block-start: 22px; border-top: 1px solid var(--n-border); }
.n-form-section-title { margin: 0 0 13px; color: var(--n-ink); font-size: .86rem; font-weight: 650; }
.n-form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.n-form-actions { margin-block-start: 22px; padding-block-start: 16px; border-top: 1px solid var(--n-border); display: flex; justify-content: flex-end; gap: 8px; }
.n-field-error { margin-block-start: 5px; display: flex; align-items: center; gap: 5px; color: var(--n-danger); font-size: .72rem; }

.n-form-card-powerful { max-width: 720px; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--n-surface); box-shadow: var(--n-shadow-xs); overflow: hidden; }
.n-form-card-header { padding: 17px 19px; border-bottom: 1px solid var(--n-border); display: flex; align-items: center; gap: 11px; }
.n-form-card-icon { width: 36px; height: 36px; flex: 0 0 36px; border-radius: var(--n-radius-sm); display: inline-flex; align-items: center; justify-content: center; color: var(--n-primary); background: var(--n-primary-soft); }
.n-form-card-title { margin: 0; font-size: .98rem; }
.n-form-card-subtitle { margin: 3px 0 0; color: var(--n-muted); font-size: .72rem; }
.n-form-powerful { padding: 19px; }
.n-form-group-powerful + .n-form-group-powerful { margin-block-start: 15px; }
.n-label-powerful { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.n-label-example { color: var(--n-faint); font-size: .66rem; font-weight: 400; }
.n-input-powerful { width: 100%; }
.n-btn-powerful, .n-btn-powerful-secondary, .n-btn-card { box-shadow: none; }

/* ========================================================================== 
   Tabs, filters, tables, pagination
   ========================================================================== */
.nav-tabs, .n-tabs-powerful { margin: 0; padding: 3px; border: 1px solid var(--n-border); border-radius: var(--n-radius); display: inline-flex; gap: 2px; flex-wrap: wrap; background: var(--n-surface-subtle); }
.nav-tabs .nav-link, .n-tabs-powerful .nav-link { min-height: 34px; padding: 6px 11px; border: 0 !important; border-radius: 7px !important; display: flex; align-items: center; gap: 6px; color: var(--n-muted); background: transparent; font-size: .75rem; font-weight: 600; }
.nav-tabs .nav-link:hover, .n-tabs-powerful .nav-link:hover { color: var(--n-ink); }
.nav-tabs .nav-link.active, .n-tabs-powerful .nav-link.active { color: var(--n-primary-strong); background: #fff; box-shadow: var(--n-shadow-xs); }
.nav-tabs .badge, .n-tabs-powerful .badge { padding: 2px 6px; color: var(--n-muted); background: var(--n-surface-muted); font-size: .6rem; }
.n-filters-bar { padding: 5px; border: 1px solid var(--n-border); border-radius: var(--n-radius); background: var(--n-surface); }
.n-nav-pills { gap: 3px; }
.n-nav-pills .nav-link { padding: 7px 12px; border-radius: 7px; color: var(--n-muted); font-size: .75rem; font-weight: 600; }
.n-nav-pills .nav-link.active { color: var(--n-primary-strong); background: var(--n-primary-soft); }
.n-filter-panel { margin-block-end: 18px; padding: 14px; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--n-surface); }
.n-filter-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.n-filter-field { min-width: 165px; flex: 1 1 165px; }
.n-search-field { position: relative; }
.n-search-field > .n-icon { position: absolute; inset-inline-start: 11px; inset-block-start: 50%; transform: translateY(-50%); color: var(--n-faint); pointer-events: none; }
.n-search-field .form-control { padding-inline-start: 38px; }

.table-responsive { overflow-x: auto; border-radius: inherit; }
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--n-primary-softer); margin: 0; color: var(--n-ink-soft); font-size: .805rem; }
.table > :not(caption) > * > * { border-color: var(--n-border); }
.table > thead { background: var(--n-surface-subtle); }
.table > thead th { padding: 11px 14px; color: var(--n-muted); font-size: .655rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; vertical-align: middle; border-bottom-width: 1px; }
[dir="rtl"] .table > thead th { letter-spacing: 0; }
.table > tbody td { padding: 12px 14px; vertical-align: middle; }
.table > tbody tr:last-child > td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { color: var(--n-ink); }
.table-bordered { border-color: var(--n-border); }
.table-light { --bs-table-bg: var(--n-surface-subtle); --bs-table-color: var(--n-ink-soft); }
.table-dark { --bs-table-bg: #26344d; --bs-table-color: #fff; }
.n-density-compact .table > thead th { padding-block: 8px; }
.n-density-compact .table > tbody td { padding-block: 8px; }
.n-table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.pagination { gap: 3px; }
.page-link { min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid transparent; border-radius: 7px !important; display: flex; align-items: center; justify-content: center; color: var(--n-muted); background: transparent; font-size: .75rem; font-weight: 600; }
.page-link:hover { color: var(--n-ink); background: var(--n-surface-muted); border-color: transparent; }
.page-item.active .page-link { color: #fff; background: var(--n-primary); border-color: var(--n-primary); }
.page-item.disabled .page-link { color: var(--n-faint); background: transparent; }

/* Existing directory card markup, normalized into restrained directory tiles. */
.n-grades-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 12px; }
.n-grade-card { min-width: 0; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); display: flex; flex-direction: column; background: var(--n-surface); box-shadow: var(--n-shadow-xs); transition: border-color var(--n-fast), box-shadow var(--n-fast), transform var(--n-fast); }
.n-grade-card:hover { border-color: var(--n-border-strong); box-shadow: var(--n-shadow-sm); transform: translateY(-1px); }
.n-grade-card.archived { background: #fafbfc; opacity: .82; }
.n-grade-card-header { min-height: 50px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--n-border); }
.n-grade-number { min-width: 34px; height: 30px; padding: 0 9px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: var(--n-primary-strong); background: var(--n-primary-soft); font-size: .72rem; font-weight: 700; }
.n-grade-status { display: flex; align-items: center; gap: 5px; }
.n-grade-card-body { flex: 1; padding: 15px 14px; }
.n-grade-name-en { margin: 0; font-size: .95rem; }
.n-grade-name-ar { margin: 4px 0 0; color: var(--n-muted); font-size: .78rem; }
.n-grade-card-footer { padding: 10px 12px; border-top: 1px solid var(--n-border); display: flex; align-items: center; gap: 6px; background: var(--n-surface-subtle); }
.n-grade-card-footer form { margin: 0; }
.n-grade-card-gradient { display: none; }

/* ========================================================================== 
   Status, alerts, empty/loading states
   ========================================================================== */
.badge { padding: 4px 8px; border-radius: var(--n-radius-pill); display: inline-flex; align-items: center; gap: 4px; font-size: .65rem; font-weight: 650; letter-spacing: 0; }
.badge .n-icon { width: 12px; height: 12px; }
/* A requirement badge carries a label plus a counted value; on a narrow
   screen the label must be allowed to wrap instead of widening the table. */
.n-req-badges { min-width: 0; }
.n-req-badges .badge { max-width: 100%; white-space: normal; text-align: start; }
.text-bg-primary, .bg-primary { color: var(--n-primary-strong) !important; background-color: var(--n-primary-soft) !important; }
.text-bg-success, .bg-success { color: var(--n-success) !important; background-color: var(--n-success-soft) !important; }
.text-bg-warning, .bg-warning { color: var(--n-warning) !important; background-color: var(--n-warning-soft) !important; }
.text-bg-danger, .bg-danger { color: var(--n-danger) !important; background-color: var(--n-danger-soft) !important; }
.text-bg-info, .bg-info { color: var(--n-info) !important; background-color: var(--n-info-soft) !important; }
.text-bg-secondary, .bg-secondary { color: var(--n-ink-soft) !important; background-color: var(--n-surface-muted) !important; }
.text-bg-light, .bg-light { color: var(--n-ink-soft) !important; background-color: var(--n-surface-subtle) !important; }
.text-success { color: var(--n-success) !important; }
.text-danger { color: var(--n-danger) !important; }
.text-warning { color: var(--n-warning) !important; }
.text-info { color: var(--n-info) !important; }

.alert { padding: 12px 14px; border: 1px solid transparent; border-radius: var(--n-radius); display: flex; align-items: flex-start; gap: 9px; color: var(--n-ink-soft); font-size: .79rem; box-shadow: none; }
.alert-success { color: #176d46; background: var(--n-success-soft); border-color: #cdebdc; }
.alert-danger { color: #9e2934; background: var(--n-danger-soft); border-color: #f1cdd1; }
.alert-warning { color: #80500d; background: var(--n-warning-soft); border-color: #f1dfb3; }
.alert-info, .alert-secondary { color: #205f85; background: var(--n-info-soft); border-color: #cfe6f3; }
.alert-light { color: var(--n-ink-soft); background: var(--n-surface); border-color: var(--n-border); }
.alert .btn-close { margin-inline-start: auto; flex: 0 0 auto; padding: 9px; font-size: .65rem; }
.n-toast-host { position: fixed; inset-block-start: 16px; inset-inline-end: 16px; z-index: 1400; width: min(390px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; }
.n-toast-host .alert { margin: 0; background-clip: padding-box; box-shadow: var(--n-shadow); }
.n-toast-enter { animation: n-toast-in var(--n-overlay) var(--n-ease) both; }

.n-empty, .n-empty-state, .n-empty-powerful { min-height: 230px; padding: 42px 24px; border: 1px dashed var(--n-border-strong); border-radius: var(--n-radius-lg); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--n-muted); background: rgba(255,255,255,.55); text-align: center; position: relative; overflow: hidden; }
.n-empty-powerful-content { position: relative; max-width: 520px; display: flex; flex-direction: column; align-items: center; }
.n-empty-icon, .n-empty-powerful-icon { width: 54px; height: 54px; margin-block-end: 13px; border: 1px solid var(--n-border); border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; color: var(--n-primary); background: var(--n-primary-soft); }
.n-empty-icon .n-icon, .n-empty-powerful-icon .n-icon { width: 23px; height: 23px; }
.n-empty h3, .n-empty-title, .n-empty-powerful-title { margin: 0 0 5px; color: var(--n-ink); font-size: .98rem; }
.n-empty p, .n-empty-description, .n-empty-powerful-description, .n-empty-powerful-text { max-width: 48ch; margin: 0 0 16px; color: var(--n-muted); font-size: .78rem; line-height: 1.55; }
.n-empty .py-3, .n-empty .py-4 { padding: 0 !important; }
.n-icon-massive { width: 25px; height: 25px; }
.n-skeleton { border-radius: var(--n-radius-sm); background: linear-gradient(90deg, var(--n-surface-muted) 25%, #f7f9fc 45%, var(--n-surface-muted) 65%); background-size: 300% 100%; animation: n-skeleton 1.3s ease infinite; }
.n-spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; display: inline-block; animation: n-spin .65s linear infinite; }
.progress { height: 7px; border-radius: 999px; background: var(--n-surface-muted); }
.progress-bar { border-radius: 999px; transition: width 500ms var(--n-ease); }

/* ========================================================================== 
   Dialogs and offcanvas
   ========================================================================== */
.modal-backdrop { background: #172033; }
.modal-backdrop.show { opacity: .42; }
.modal-dialog { margin-block: 1.5rem; }
.modal-content { border: 1px solid rgba(255,255,255,.7); border-radius: var(--n-radius-xl); background: var(--n-surface); box-shadow: var(--n-shadow-lg); overflow: hidden; }
.modal-header { min-height: 58px; padding: 14px 18px; border-bottom: 1px solid var(--n-border); background: #fff; }
.modal-title { font-size: .96rem; font-weight: 650; }
.modal-body { padding: 18px; color: var(--n-ink-soft); }
.modal-footer { padding: 12px 18px; border-top: 1px solid var(--n-border); gap: 7px; background: var(--n-surface-subtle); }
.modal.fade .modal-dialog { transform: translateY(8px) scale(.985); transition: transform var(--n-overlay) var(--n-ease); }
.modal.show .modal-dialog { transform: translateY(0) scale(1); }
.offcanvas { border-color: var(--n-border) !important; box-shadow: var(--n-shadow-lg); }

/* ========================================================================== 
   Attendance, exams, welfare, timetable, notifications
   ========================================================================== */
.attendance-toggle { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.attendance-toggle .btn { min-height: 30px; border-radius: 6px !important; font-size: .68rem; }
.attendance-toggle .btn-success { color: var(--n-success); background: var(--n-success-soft); border-color: #b9dfcc; }
.attendance-toggle .btn-danger { color: var(--n-danger); background: var(--n-danger-soft); border-color: #efc6ca; }
.attendance-toggle .btn-warning { color: var(--n-warning); background: var(--n-warning-soft); border-color: #ead29e; }
.attendance-toggle .btn-info { color: var(--n-info); background: var(--n-info-soft); border-color: #bfdeed; }
.attendance-toggle .btn-outline-success, .attendance-toggle .btn-outline-danger, .attendance-toggle .btn-outline-warning, .attendance-toggle .btn-outline-info { color: var(--n-muted); background: #fff; border-color: var(--n-border); }
.n-attendance-save { position: sticky; inset-block-end: 12px; z-index: 4; }
.n-score-input { width: 105px; text-align: center; font-variant-numeric: tabular-nums; }

.timetable-grid { min-width: 780px; table-layout: fixed; }
.timetable-grid > thead th { text-align: center; color: var(--n-ink-soft); background: var(--n-surface-subtle); }
.timetable-grid td { height: 82px; padding: 5px !important; vertical-align: top !important; }
.n-timetable-slot { min-height: 70px; padding: 8px; border: 1px solid #d6e0ff; border-radius: 8px; display: flex; flex-direction: column; justify-content: center; background: var(--n-primary-softer); text-align: start; }
.n-timetable-slot strong { color: var(--n-primary-strong); font-size: .73rem; }
.n-timetable-slot small { margin-block-start: 3px; color: var(--n-muted); font-size: .65rem; }
.n-timetable-slot .n-slot-missing { color: #a1772a; font-style: italic; }
.n-timetable-slot .n-slot-conflict { display: inline-flex; align-items: center; gap: 3px; color: #b4493f; font-weight: 600; }
.n-timetable-slot .n-slot-conflict .n-icon { width: 11px; height: 11px; }
.n-timetable-empty { width: 100%; min-height: 70px; border: 1px dashed var(--n-border-strong); border-radius: 8px; color: var(--n-faint); background: transparent; }
.n-timetable-empty:hover { color: var(--n-primary); border-color: #9fb3ff; background: var(--n-primary-softer); }

.notifications-container { display: flex; flex-direction: column; gap: 8px; }
.notification-card { padding: 15px; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); display: flex; gap: 12px; background: var(--n-surface); }
.notification-card.notification-unread { border-color: #cfdaff; background: var(--n-primary-softer); }
.notification-icon-circle { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: var(--n-muted); background: var(--n-surface-subtle); }
.notification-icon-active { color: var(--n-primary); background: var(--n-primary-soft); }
.notification-content { min-width: 0; flex: 1; }
.notification-header, .notification-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.notification-title { margin: 0; font-size: .88rem; }
.notification-body { margin: 5px 0 9px; color: var(--n-muted); font-size: .76rem; }
.notification-time { display: inline-flex; align-items: center; gap: 5px; color: var(--n-faint); font-size: .67rem; }
.notification-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.n-welfare-nav { display: inline-flex; padding: 3px; border: 1px solid var(--n-border); border-radius: var(--n-radius); background: var(--n-surface-subtle); }
.n-welfare-nav a { padding: 6px 10px; border-radius: 7px; color: var(--n-muted); text-decoration: none; font-size: .73rem; font-weight: 600; }
.n-welfare-nav a.active { color: var(--n-primary-strong); background: #fff; box-shadow: var(--n-shadow-xs); }

/* Attendance report exception panel and inline edit controls */
.n-review-panel { border-color: #f1cdd1 !important; }
.n-review-panel > .card-header { color: var(--n-danger); background: var(--n-danger-soft) !important; }
.n-inline-edit { display: inline-flex; align-items: center; gap: 5px; }
.n-inline-edit input { width: 74px; }
.n-rank-chip { width: 30px; height: 30px; border: 1px solid var(--n-border); border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--n-ink-soft); background: var(--n-surface-subtle); font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.n-rank-chip.top { color: #fff; border-color: var(--n-primary); background: var(--n-primary); }
.n-timetable-period-head { width: 74px; }
.n-exam-term { height: 100%; }

/* Reports center and report document workspace */
.n-report-group + .n-report-group { margin-block-start: 26px; }
.n-report-card { min-height: 108px; padding: 15px; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); display: flex; align-items: center; gap: 13px; height: 100%; color: var(--n-ink); background: var(--n-surface); box-shadow: var(--n-shadow-xs); text-decoration: none; transition: border-color var(--n-fast), box-shadow var(--n-fast), transform var(--n-fast); }
.n-report-card:hover { color: var(--n-ink); border-color: #bdcbff; box-shadow: var(--n-shadow-sm); transform: translateY(-2px); }
.n-report-icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: var(--n-radius); display: inline-flex; align-items: center; justify-content: center; color: var(--n-primary); background: var(--n-primary-soft); }
.n-report-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.n-report-copy strong { font-size: .855rem; }
.n-report-copy small { color: var(--n-muted); font-size: .68rem; line-height: 1.45; }
.n-format-list { display: inline-flex; gap: 4px; }
.n-format-list b { padding: 1px 5px; border: 1px solid var(--n-border); border-radius: 5px; color: var(--n-muted); background: var(--n-surface-subtle); font-size: .55rem; font-weight: 700; letter-spacing: .04em; }
.n-report-arrow { align-self: center; color: var(--n-faint); }
.n-report-card:hover .n-report-arrow { color: var(--n-primary); }
.n-report-toolbar { margin-block-end: 14px; padding: 9px 11px; border: 1px solid var(--n-border); border-radius: var(--n-radius); display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; background: var(--n-surface); }
.n-report-document { padding: 26px clamp(18px, 4vw, 42px); border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: #fff; box-shadow: var(--n-shadow-xs); }
.n-report-document-head { margin-block-end: 18px; padding-block-end: 14px; border-bottom: 2px solid var(--n-ink); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.n-report-document-head h1, .n-report-document-head h2 { margin: 0; font-size: 1.1rem; }
.n-report-document-head small { display: block; color: var(--n-muted); font-size: .68rem; }
.n-report-table-wrap tbody tr:last-child > td { border-bottom: 0; }

/* ========================================================================== 
   Settings, import, backup and workflow presentation
   ========================================================================== */
.n-settings-layout { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 22px; align-items: start; }
/* Governance and matrix screens (roles, modules) are not single-column forms:
   they need the full content width instead of the 760px reading measure. */
.n-settings-layout--wide { grid-template-columns: 220px minmax(0, 1fr); }
.n-settings-nav { padding: 7px; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); display: flex; flex-direction: column; gap: 3px; background: var(--n-surface); }
.n-settings-nav .nav-link { min-height: 40px; padding: 8px 10px; border: 0; border-radius: 8px; color: var(--n-muted); font-size: .78rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.n-settings-nav .nav-link:hover { color: var(--n-ink); background: var(--n-surface-subtle); }
.n-settings-nav .nav-link.active { color: var(--n-primary-strong); background: var(--n-primary-soft); }
.n-settings-content { min-width: 0; }
.n-settings-card { border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--n-surface); overflow: hidden; }
.n-settings-card-head { padding: 16px 18px; border-bottom: 1px solid var(--n-border); }
.n-settings-card-head h2 { margin: 0; font-size: .98rem; }
.n-settings-card-head p { margin: 4px 0 0; color: var(--n-muted); font-size: .73rem; }
.n-settings-card-body { padding: 18px; }
.n-settings-save { margin-block-start: 20px; padding-block-start: 15px; border-top: 1px solid var(--n-border); display: flex; justify-content: flex-end; }

/* Authorized-signature live preview: a miniature of the document footer. */
.n-signature-preview { position: relative; padding: 16px 18px 13px; border: 1px dashed var(--n-border); border-radius: 10px; background: #fff; text-align: center; }
.n-signature-preview-area { position: relative; height: 42px; display: flex; align-items: flex-end; justify-content: center; }
.n-signature-preview-image { display: block; width: 150px; height: 42px; background-repeat: no-repeat; background-position: center bottom; background-size: contain; }
.n-signature-preview-stamp { position: absolute; inset-inline-end: 8%; bottom: -3px; width: 48px; height: 48px; background-repeat: no-repeat; background-position: center; background-size: contain; opacity: .9; }
.n-signature-preview-line { border-top: 1px dotted #94A3B8; }
.n-signature-preview-name { min-height: 1.6em; margin-top: 5px; color: #1F2937; font-size: 1.25rem; font-weight: 600; }
.n-signature-preview-title { margin-top: 2px; color: var(--n-muted); font-size: .72rem; }

.n-import-steps { margin: 0 0 17px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; list-style: none; }
.n-import-steps li { padding: 9px; border-radius: 8px; color: var(--n-muted); background: var(--n-surface-subtle); font-size: .68rem; text-align: center; }
.n-import-steps strong { display: block; color: var(--n-ink-soft); font-size: .74rem; }
.n-danger-zone { border-color: #efc9cd !important; background: #fffafa; }
.n-danger-zone .card-header { color: var(--n-danger); background: var(--n-danger-soft) !important; }
.n-protection-summary { padding: 13px; border: 1px solid #cfe8dc; border-radius: var(--n-radius); color: #1c704c; background: var(--n-success-soft); font-size: .74rem; }
.n-workflow-steps { margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; counter-reset: workflow; }
.n-workflow-steps.n-workflow-2 { grid-template-columns: repeat(2, 1fr); max-width: 620px; }
.n-workflow-steps li { position: relative; padding: 36px 8px 0; color: var(--n-muted); font-size: .7rem; text-align: center; counter-increment: workflow; }
.n-workflow-steps li::before { content: counter(workflow); position: absolute; inset-block-start: 0; inset-inline-start: 50%; width: 28px; height: 28px; transform: translateX(-50%); border: 1px solid var(--n-border-strong); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--n-muted); background: #fff; font-weight: 700; z-index: 2; }
[dir="rtl"] .n-workflow-steps li::before { transform: translateX(50%); }
.n-workflow-steps li::after { content: ""; position: absolute; inset-block-start: 14px; inset-inline-start: 50%; width: 100%; height: 1px; background: var(--n-border); }
.n-workflow-steps li:last-child::after { display: none; }
.n-workflow-steps li.active { color: var(--n-primary-strong); font-weight: 600; }
.n-workflow-steps li.active::before { color: #fff; border-color: var(--n-primary); background: var(--n-primary); }

/* ========================================================================== 
   Authentication, setup, and error surfaces
   ========================================================================== */
.n-auth-body { min-height: 100vh; overflow-x: hidden; background: var(--n-canvas); }
.n-auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 42%) minmax(0, 1fr); }
.n-auth-side { position: relative; padding: clamp(34px, 5vw, 68px); display: flex; flex-direction: column; justify-content: space-between; gap: 42px; overflow: hidden; color: var(--n-ink-soft); background: #eef3ff; border-inline-end: 1px solid #dce5fb; }
.n-auth-side::after { content: ""; position: absolute; width: 420px; height: 420px; inset-inline-end: -230px; inset-block-end: -220px; border: 70px solid rgba(49,94,251,.06); border-radius: 50%; pointer-events: none; }
.n-auth-side-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.auth-school-mark { width: 68px; height: 68px; flex-basis: 68px; }
.n-auth-app-name-lg { color: var(--n-ink); font-size: 1rem; font-weight: 700; }
.n-auth-app-subtitle { margin-block-start: 3px; color: var(--n-muted); font-size: .68rem; }
.n-auth-side-mid { position: relative; z-index: 1; max-width: 520px; }
.n-auth-tagline { max-width: 17ch; margin: 0 0 10px; color: var(--n-ink); font-size: clamp(1.65rem, 3vw, 2.35rem); line-height: 1.25; }
.n-auth-tagline-sub { max-width: 44ch; margin: 0 0 30px; color: var(--n-muted); font-size: .88rem; }
.n-auth-features { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; list-style: none; }
.n-auth-features li { padding: 12px; border: 1px solid rgba(49,94,251,.11); border-radius: var(--n-radius); display: flex; align-items: flex-start; gap: 10px; background: rgba(255,255,255,.64); }
.n-auth-feature-icon { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--n-primary); background: var(--n-primary-soft); }
.n-auth-feature-text { display: flex; flex-direction: column; }
.n-auth-feature-text strong { color: var(--n-ink); font-size: .75rem; }
.n-auth-feature-text span { margin-block-start: 2px; color: var(--n-muted); font-size: .65rem; line-height: 1.4; }
.n-auth-side-foot { position: relative; z-index: 1; padding-block-start: 16px; border-top: 1px solid rgba(49,94,251,.12); }
.n-auth-stat-item { display: flex; align-items: center; gap: 8px; color: var(--n-muted); font-size: .72rem; }
.n-auth-stat-icon { color: var(--n-primary); }
.n-auth-main { position: relative; padding: 60px clamp(24px, 6vw, 90px); display: flex; align-items: center; justify-content: center; background: var(--n-surface); }
.n-auth-lang { position: absolute; inset-block-start: 24px; inset-inline-end: 26px; }
.n-auth-form-wrap { width: 100%; max-width: 440px; }
.n-auth-welcome { margin-block-end: 23px; text-align: start; }
.n-auth-welcome-icon { width: 42px; height: 42px; margin-block-end: 12px; border-radius: var(--n-radius); display: flex; align-items: center; justify-content: center; color: var(--n-primary); background: var(--n-primary-soft); }
.n-auth-welcome h1 { margin: 0; font-size: 1.5rem; }
.n-auth-sub { margin: 5px 0 0; color: var(--n-muted); font-size: .82rem; }
.n-auth-form { padding: 22px; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: #fff; box-shadow: var(--n-shadow-sm); }
.n-form-group + .n-form-group { margin-block-start: 16px; }
.n-form-label { display: flex; align-items: center; gap: 6px; }
.n-form-label-icon { color: var(--n-primary); }
.n-input-enhanced { position: relative; }
.n-input-icon-prefix { position: absolute; inset-inline-start: 12px; inset-block-start: 50%; transform: translateY(-50%); color: var(--n-faint); pointer-events: none; }
.n-input-premium { height: 44px; padding-inline-start: 39px !important; background: #fff; }
.n-input-focus-border, .n-btn-shine { display: none; }
.n-btn-animated { width: 100%; margin-block-start: 20px; box-shadow: none; }
.n-btn-icon { display: inline-flex; }
.n-auth-footer { margin-block-start: 16px; text-align: center; }
.n-auth-security { display: inline-flex; align-items: center; gap: 6px; color: var(--n-muted); font-size: .68rem; }
.n-auth-security .n-icon { color: var(--n-success); }

.n-setup-body { min-height: 100vh; margin: 0; padding: 40px 16px 60px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; background: var(--n-canvas); overflow-y: auto; }
.n-setup-wrap { width: min(620px, 100%); }
.n-setup-brand { margin-block-end: 20px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.setup-school-mark { width: 54px; height: 54px; flex-basis: 54px; }
.n-setup-app-name { color: var(--n-ink); font-size: .82rem; font-weight: 650; }
.n-setup-stepper { margin-block-end: 18px; display: flex; position: relative; }
.n-setup-stepper::before { content: ""; position: absolute; inset-inline: 9%; inset-block-start: 14px; height: 1px; background: var(--n-border-strong); }
.n-setup-step { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; }
.n-setup-step-circle { width: 29px; height: 29px; border: 1px solid var(--n-border-strong); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--n-muted); background: var(--n-canvas); font-size: .7rem; font-weight: 700; }
.n-setup-step.active .n-setup-step-circle { color: #fff; border-color: var(--n-primary); background: var(--n-primary); box-shadow: 0 0 0 4px var(--n-primary-soft); }
.n-setup-step.done .n-setup-step-circle { color: var(--n-success); border-color: #9bcdb5; background: var(--n-success-soft); }
.n-setup-step-label { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--n-faint); font-size: .58rem; }
.n-setup-step.active .n-setup-step-label { color: var(--n-ink-soft); font-weight: 600; }
.n-setup-card { padding: clamp(22px, 5vw, 34px); border: 1px solid var(--n-border); border-radius: var(--n-radius-xl); background: var(--n-surface); box-shadow: var(--n-shadow); }
.n-setup-card h1 { margin: 0 0 18px; font-size: 1.2rem; }
.n-error-body { min-height: 100vh; padding: 24px; display: flex; align-items: center; justify-content: center; background: var(--n-canvas); }
.n-error-card { width: min(460px, 100%); padding: 34px; border: 1px solid var(--n-border); border-radius: var(--n-radius-xl); background: var(--n-surface); box-shadow: var(--n-shadow-sm); text-align: center; }
.n-error-icon { width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--n-primary); background: var(--n-primary-soft); }
.n-error-icon.danger { color: var(--n-danger); background: var(--n-danger-soft); }
.n-error-icon.warning { color: var(--n-warning); background: var(--n-warning-soft); }
.n-error-card h1 { margin: 0 0 7px; font-size: 1.35rem; }
.n-error-card p { margin: 0 0 20px; color: var(--n-muted); font-size: .82rem; }

/* ========================================================================== 
   Icons, animation, direction and responsive behavior
   ========================================================================== */
.n-icon { width: 17px; height: 17px; display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.n-icon-sm { width: 14px; height: 14px; }
.n-icon-lg { width: 21px; height: 21px; }
.n-icon-xl { width: 28px; height: 28px; }
[dir="rtl"] .n-flip-rtl { transform: scaleX(-1); }
.n-reveal { animation: n-fade-up var(--n-overlay) var(--n-ease) both; }
.n-reveal-item { animation: n-fade-up var(--n-overlay) var(--n-ease) both; animation-delay: calc(var(--n-stagger, 0) * 32ms); }
@keyframes n-fade-up { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
/* Popper positions dropdowns with an inline transform. Animating that same
   property overrides the coordinates and can push a menu under the sidebar or
   on top of its trigger. Keep the entrance polish without touching geometry. */
@keyframes n-dropdown-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes n-toast-in { from { opacity: 0; transform: translateY(-7px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes n-skeleton { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes n-spin { to { transform: rotate(360deg); } }

/* The sidebar already carries the signed-in user's identity on ordinary
   laptop widths. Repeating it in the header is useful only when the workspace
   is wide enough to preserve the page title and command field. */
@media (min-width: 1600px) {
  .n-quick-trigger-label { display: inline; }
  .n-user-trigger-copy { display: flex; }
  .n-user-trigger .n-user-trigger-caret { display: inline-block; }
}
@media (max-width: 1359.98px) {
  /* Keep the year switchable but collapse it to its status glyph before the
     action rail needs more room than the bar has. */
  .n-year-pill-text, .n-year-pill-caret { display: none; }
  .n-year-pill { width: 38px; padding: 0; justify-content: center; }
  .nizam-topbar { grid-template-columns: minmax(0, 1fr) minmax(180px, 340px) minmax(0, 1fr); }
}
@media (max-width: 1279.98px) {
  /* The action rail is content-sized; give it back the space it needs before
     the command field can shrink further. */
  .nizam-topbar { grid-template-columns: minmax(0, 1fr) minmax(180px, 300px) minmax(0, 1fr); }
}
@media (max-width: 1199.98px) {
  /* Below the full command field the search becomes a single icon inside the
     action cluster, so the bar keeps two zones and the title keeps a column. */
  .nizam-topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .n-topbar-search { display: none; }
  .n-topbar-actions { grid-column: 2; }
  /* The title carries page identity on its own once the bar narrows; the
     breadcrumb would only repeat or clip it. */
  .n-breadcrumb { display: none; }
  .n-topbar-title { display: block; max-width: 100%; }
  .n-command-trigger kbd { display: none; }
  .n-grades-header-actions { justify-content: flex-start; }
}
@media (max-width: 991.98px) {
  /* Three columns still fit tablet widths; explicit rows stop auto-placement
     from pushing the actions cluster onto a second, floating row. */
  .nizam-topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .n-command-trigger { grid-column: auto; grid-row: 1; }
  .n-topbar-start { grid-row: 1; }
  .n-topbar-actions { grid-row: 1; }
  .n-topbar-title { display: block; max-width: 100%; }
  .n-settings-layout { grid-template-columns: 1fr; }
  .n-settings-nav { flex-direction: row; overflow-x: auto; }
  .n-settings-nav .nav-link { white-space: nowrap; }
  .n-auth-shell { grid-template-columns: 1fr; }
  .n-auth-side { min-height: 260px; padding: 28px; border-inline-end: 0; border-bottom: 1px solid #dce5fb; }
  .n-auth-side-mid { margin-block: 24px; }
  .n-auth-tagline { max-width: 24ch; font-size: 1.55rem; }
  .n-auth-tagline-sub, .n-auth-side-foot { display: none; }
  .n-auth-features { grid-template-columns: repeat(4, 1fr); }
  .n-auth-features li { display: block; }
  .n-auth-feature-icon { margin-block-end: 7px; }
  .n-auth-main { padding-block: 70px 42px; }
}
@media (max-width: 767.98px) {
  .nizam-topbar { height: 62px; padding-inline: 10px; grid-template-columns: minmax(0, 1fr) auto; }
  /* Search moves out of the centre column and becomes a single trailing
     button that opens the same palette. */
  .n-topbar-search { display: none; }
  .n-topbar-start { grid-column: 1; grid-row: 1; }
  .n-topbar-actions { grid-column: 2; grid-row: 1; gap: 4px; }
  .nizam-content { padding: 18px 12px 42px; }
  .n-page-head, .n-grades-header-content { gap: 13px; }
  .n-page-head-actions, .n-grades-header-actions { width: 100%; }
  .n-grades-subtitle { margin-inline-start: 0; }
  [dir="rtl"] .n-grades-subtitle { margin-inline: 0; }
  .n-stat-mini { min-width: 74px; }
  .n-grades-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .n-profile-hero { padding: 16px; }
  .n-profile-actions { width: 100%; }
  .n-detail-list { grid-template-columns: 1fr; }
  .n-detail-list dt { padding-block-end: 2px; border-bottom: 0; }
  .n-detail-list dd { padding-block-start: 2px; }
  .n-workflow-steps { grid-template-columns: 1fr; gap: 7px; }
  .n-workflow-steps li { min-height: 38px; padding: 9px 10px 9px 44px; border: 1px solid var(--n-border); border-radius: 8px; text-align: start; }
  [dir="rtl"] .n-workflow-steps li { padding: 9px 44px 9px 10px; }
  .n-workflow-steps li::before { inset-block-start: 50%; inset-inline-start: 10px; transform: translateY(-50%); }
  [dir="rtl"] .n-workflow-steps li::before { inset-inline-start: auto; inset-inline-end: 10px; transform: translateY(-50%); }
  .n-workflow-steps li::after { display: none; }
  .n-auth-features { grid-template-columns: repeat(2, 1fr); }
  .n-auth-side { min-height: auto; }
  .n-auth-main { padding-inline: 16px; }
  .n-form-grid { grid-template-columns: 1fr; }
  .n-form-actions { flex-direction: column-reverse; }
  .n-form-actions .btn { width: 100%; }
}
@media (max-width: 575.98px) {
  /* The page title is the only identity that fits beside the controls. */
  .n-topbar-glyph { display: none; }
  .n-topbar-title { font-size: .86rem; }
  .n-topbar-actions { gap: 3px; }
  .n-topbar-cluster--tools { padding: 2px; }
}
@media (max-width: 640px) {
  .n-table-stack thead { display: none; }
  .n-table-stack, .n-table-stack tbody, .n-table-stack tr, .n-table-stack td { display: block; width: 100%; }
  .n-table-stack tbody { padding: 8px; }
  .n-table-stack tr { margin-block-end: 8px; padding: 6px 11px; border: 1px solid var(--n-border); border-radius: var(--n-radius); background: #fff; }
  .n-table-stack td { min-height: 34px; padding: 7px 0 !important; border-bottom: 1px solid var(--n-border) !important; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: end; }
  .n-table-stack td:last-child { border-bottom: 0 !important; }
  .n-table-stack td[data-label]::before { content: attr(data-label); color: var(--n-muted); font-size: .65rem; font-weight: 700; text-align: start; }
  .n-table-stack td.n-stack-hide:empty { display: none; }
  .n-grades-grid { grid-template-columns: 1fr; }
  .n-auth-side { padding: 22px 18px; }
  .n-auth-side-mid, .n-auth-features { display: none; }
  .n-auth-main { min-height: calc(100vh - 115px); padding-block: 65px 30px; }
  .n-auth-form { padding: 18px; }
  .n-import-steps { grid-template-columns: 1fr; }
  .n-import-steps li { text-align: start; }
}
@media (max-width: 420px) {
  .n-lang-switch a { min-width: 26px; padding-inline: 5px; }
  .n-topbar-divider { display: none; }
  /* At the narrowest phones the calendar chip and its divider give the page
     title the width it needs; the year stays switchable from Settings. */
  .n-topbar-cluster--context { display: none; }
  .n-topbar-title { font-size: .84rem; }
  .n-user-trigger .n-avatar { width: 32px; height: 32px; flex-basis: 32px; }
  .n-grades-header-actions > .btn, .n-page-head-actions > .btn { flex: 1 1 auto; }
  .n-auth-features { display: none; }
  .n-setup-step-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ========================================================================== 
   Print
   ========================================================================== */
@media print {
  body { background: #fff !important; color: #111 !important; }
  .nizam-sidebar, .nizam-topbar, .offcanvas, .modal, .n-toast-host, .n-command-overlay, .no-print { display: none !important; }
  .nizam-main, .nizam-content { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
  .card, .n-data-panel { border-color: #bbb !important; box-shadow: none !important; break-inside: avoid; }
  .table-responsive { overflow: visible !important; }
  table { width: 100% !important; border-collapse: collapse !important; }
  thead { display: table-header-group; }
  tr, td, th { break-inside: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
  @page { size: A4; margin: 13mm 11mm; }
}

/* ---- Dashboard operations: attendance today, attention list, class capacity ---- */
.n-att-rate { display: flex; align-items: center; gap: 14px; margin-block-end: 14px; }
.n-att-rate-value { font-size: 2.4rem; font-weight: 700; line-height: 1; color: var(--n-ink); font-variant-numeric: tabular-nums; }
.n-att-rate-label { display: flex; flex-direction: column; font-weight: 600; font-size: .9rem; color: var(--n-ink-soft); }
.n-att-rate-label small { font-weight: 400; color: var(--n-muted); font-size: .76rem; margin-block-start: 2px; }
.n-att-bar { display: flex; height: 10px; border-radius: var(--n-radius-pill); overflow: hidden; background: var(--n-surface-muted); gap: 2px; }
.n-att-seg { min-width: 6px; transition: flex-grow var(--n-overlay) var(--n-ease); }
.n-att-present { background: var(--n-success); }
.n-att-late { background: var(--n-warning); }
.n-att-excused { background: var(--n-info); }
.n-att-absent { background: var(--n-danger); }
.n-att-legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; }
.n-att-legend li { display: flex; align-items: center; gap: 8px; font-size: .83rem; color: var(--n-ink-soft); }
.n-att-legend strong { margin-inline-start: auto; font-variant-numeric: tabular-nums; color: var(--n-ink); }
.n-att-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.n-attention-list { list-style: none; margin: 0; padding: 4px 18px 8px; }
.n-attention-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-block-end: 1px solid var(--n-border); font-size: .88rem; flex-wrap: wrap; }
.n-attention-list li:last-child { border-block-end: 0; }
.n-attention-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--n-radius-pill); background: var(--n-warning-soft); color: var(--n-warning); font-size: .74rem; font-weight: 600; white-space: nowrap; }
.n-attention-tag svg { width: 13px; height: 13px; }
.n-attention-tag-danger { background: var(--n-danger-soft); color: var(--n-danger); }
.n-capacity-grid { list-style: none; margin: 0; padding: 16px 18px 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px 22px; }
.n-capacity-name { font-size: .83rem; font-weight: 600; color: var(--n-ink-soft); margin-block-end: 6px; }
.n-capacity-track { height: 7px; border-radius: var(--n-radius-pill); background: var(--n-surface-muted); overflow: hidden; }
.n-capacity-track span { display: block; height: 100%; border-radius: inherit; background: var(--n-primary); transition: width var(--n-overlay) var(--n-ease); }
.n-capacity-near .n-capacity-track span { background: var(--n-warning); }
.n-capacity-over .n-capacity-track span { background: var(--n-danger); }
.n-capacity-meta { display: flex; justify-content: space-between; gap: 8px; margin-block-start: 5px; font-size: .76rem; color: var(--n-muted); font-variant-numeric: tabular-nums; }
.n-capacity-meta em { font-style: normal; font-weight: 600; }
.n-capacity-over .n-capacity-meta em { color: var(--n-danger); }
.n-capacity-item { display: flex; flex-direction: column; }
.n-app-body { background-color: var(--n-canvas); color: var(--n-ink); min-height: 100vh; }
.n-reveal-group { animation: n-fade-up var(--n-overlay) var(--n-ease) both; }
.n-auth-stats { display: flex; gap: 16px; margin-block-start: 24px; }
.n-auth-alert { border-radius: var(--n-radius); }
.n-btn-text { display: inline-block; }
@media (prefers-reduced-motion: reduce) { .n-att-seg, .n-capacity-track span, .n-reveal-group { transition: none; animation: none; } }

/* ---------------------------------------------------------------- Calendar
   A month grid, a week board, a day agenda and a list, all reading the same
   normalised items. Source colour is the only strong signal, so a busy day
   still reads as "this is assessment week" at a glance. */
.n-cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-block-end: 14px; }
.n-cal-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.n-cal-range { font-size: 1rem; font-weight: 700; color: var(--n-ink); margin-inline-start: 8px; }
.n-cal-modes { display: flex; gap: 4px; margin-inline-start: auto; }
.n-cal-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 14px; }
.n-cal-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--n-radius-pill);
  border: 1px solid var(--n-border); background: var(--n-surface); color: var(--n-ink-soft); font-size: .8rem;
  font-weight: 600; text-decoration: none; transition: background var(--n-overlay) var(--n-ease), border-color var(--n-overlay) var(--n-ease); }
.n-cal-chip svg { width: 14px; height: 14px; }
.n-cal-chip:hover { border-color: var(--n-border-strong); color: var(--n-ink); }
.n-cal-chip.is-off { opacity: .5; text-decoration: line-through; }
.n-cal-chip.is-on { background: var(--n-primary-soft); border-color: transparent; color: var(--n-primary-strong); }
.n-cal-chip-count { font-variant-numeric: tabular-nums; font-size: .74rem; padding: 0 6px; border-radius: var(--n-radius-pill);
  background: var(--n-surface-muted); color: var(--n-muted); }
.n-cal-chip.is-on .n-cal-chip-count { background: var(--n-surface); color: var(--n-primary-strong); }

.n-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--n-border);
  border-radius: var(--n-radius-lg); overflow: hidden; background: var(--n-surface); box-shadow: var(--n-shadow-xs); }
.n-cal-head { padding: 9px 8px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  text-align: center; color: var(--n-muted); background: var(--n-surface-subtle); border-block-end: 1px solid var(--n-border); }
.n-cal-cell { min-height: 118px; padding: 7px; border-inline-end: 1px solid var(--n-border); border-block-end: 1px solid var(--n-border);
  overflow: hidden; }
.n-cal-cell:nth-child(7n) { border-inline-end: 0; }
.n-cal-cell.is-outside { background: var(--n-surface-subtle); }
.n-cal-cell.is-outside .n-cal-daynum { opacity: .45; }
.n-cal-cell.is-today { background: var(--n-primary-softer); box-shadow: inset 0 0 0 2px rgba(49, 94, 251, .32); }
.n-cal-daynum { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-block-end: 5px;
  font-size: .78rem; font-weight: 700; color: var(--n-muted); font-variant-numeric: tabular-nums; }
.n-cal-cell.is-today .n-cal-daynum { color: var(--n-primary-strong); }
.n-cal-add { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  border-radius: var(--n-radius-xs); color: var(--n-muted); opacity: 0; text-decoration: none; }
.n-cal-add svg { width: 12px; height: 12px; }
.n-cal-cell:hover .n-cal-add, .n-cal-add:focus-visible { opacity: 1; background: var(--n-surface-muted); color: var(--n-primary); }
.n-cal-event { display: flex; align-items: center; gap: 4px; margin-block-end: 3px; padding: 2px 5px; border-radius: var(--n-radius-xs);
  font-size: .72rem; line-height: 1.35; text-decoration: none; color: var(--n-ink-soft);
  background: var(--n-surface-muted); border-inline-start: 3px solid var(--n-muted); }
.n-cal-event svg { width: 11px; height: 11px; flex: none; }
.n-cal-event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.n-cal-event:hover { color: var(--n-ink); background: var(--n-surface-subtle); }
.n-cal-more { display: block; font-size: .7rem; font-weight: 600; color: var(--n-primary); text-decoration: none; margin-block-start: 2px; }

.n-cal-event-term { border-inline-start-color: var(--n-muted); background: var(--n-surface-subtle); }
.n-cal-event-assessment { border-inline-start-color: var(--n-primary); background: var(--n-primary-soft); }
.n-cal-event-homework { border-inline-start-color: var(--n-info); background: var(--n-info-soft); }
.n-cal-event-project { border-inline-start-color: var(--n-success); background: var(--n-success-soft); }
.n-cal-event-task { border-inline-start-color: var(--n-warning); background: var(--n-warning-soft); }
.n-cal-event-meeting { border-inline-start-color: var(--n-ink-soft); background: var(--n-surface-subtle); }
.n-cal-event-review { border-inline-start-color: var(--n-danger); background: var(--n-danger-soft); }
.n-cal-event-event { border-inline-start-color: #7c3aed; background: #f4f0ff; }

.n-cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
.n-cal-week-col { border: 1px solid var(--n-border); border-radius: var(--n-radius); background: var(--n-surface);
  padding: 10px; min-height: 160px; box-shadow: var(--n-shadow-xs); }
.n-cal-week-col.is-today { border-color: rgba(49, 94, 251, .5); box-shadow: inset 0 0 0 1px rgba(49, 94, 251, .28); }
.n-cal-week-head { display: flex; flex-direction: column; gap: 2px; padding-block-end: 7px; margin-block-end: 7px;
  border-block-end: 1px solid var(--n-border); }
.n-cal-week-dow { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--n-muted); }
.n-cal-week-date { font-size: .82rem; font-weight: 700; color: var(--n-ink); font-variant-numeric: tabular-nums; }
.n-cal-week-empty { margin: 0; }
.n-cal-week .n-cal-event span { white-space: normal; }

.n-cal-agenda-list { list-style: none; margin: 0; padding: 0; }
.n-cal-agenda-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-block-end: 1px solid var(--n-border); }
.n-cal-agenda-row:last-child { border-block-end: 0; }
.n-cal-agenda-dot { width: 9px; height: 9px; border-radius: 50%; margin-block-start: 6px; flex: none;
  background: var(--n-muted); border-inline-start: 0; }
.n-cal-agenda-dot.n-cal-event-assessment { background: var(--n-primary); }
.n-cal-agenda-dot.n-cal-event-homework { background: var(--n-info); }
.n-cal-agenda-dot.n-cal-event-project { background: var(--n-success); }
.n-cal-agenda-dot.n-cal-event-task { background: var(--n-warning); }
.n-cal-agenda-dot.n-cal-event-meeting { background: var(--n-ink-soft); }
.n-cal-agenda-dot.n-cal-event-review { background: var(--n-danger); }
.n-cal-agenda-dot.n-cal-event-event { background: #7c3aed; }
.n-cal-agenda-body { min-width: 0; }

.n-cal-list { border: 1px solid var(--n-border); border-radius: var(--n-radius); overflow: hidden; background: var(--n-surface); }
.n-cal-list-date { padding: 7px 14px; font-size: .74rem; font-weight: 700; letter-spacing: .03em; color: var(--n-muted);
  background: var(--n-surface-subtle); border-block-end: 1px solid var(--n-border); font-variant-numeric: tabular-nums; }
.n-cal-list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px;
  border-block-end: 1px solid var(--n-border); }
.n-cal-list-row:last-child { border-block-end: 0; }
.n-cal-list-source { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--n-radius-pill);
  font-size: .72rem; font-weight: 600; background: var(--n-surface-muted); color: var(--n-ink-soft); border-inline-start: 0; }
.n-cal-list-source svg { width: 12px; height: 12px; }
.n-cal-list-title { font-size: .87rem; font-weight: 600; color: var(--n-ink); }
.n-cal-list-title:hover { color: var(--n-primary); }
.n-cal-agenda-body a { color: var(--n-ink); }
.n-cal-total { display: inline-flex; align-items: center; gap: 6px; }
.n-cal-total svg { width: 14px; height: 14px; }

@media (max-width: 991.98px) {
  .n-cal-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .n-cal-modes { margin-inline-start: 0; width: 100%; overflow-x: auto; }
}
@media (max-width: 767.98px) {
  .n-cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .n-cal-cell { min-height: 74px; padding: 4px; }
  .n-cal-event span { display: none; }
  .n-cal-event { justify-content: center; }
  .n-cal-head { font-size: .64rem; padding: 6px 2px; }
  .n-cal-week { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .n-cal-chip { transition: none; } }

/* WCAG 2.2 AA 2.5.8 -- every standalone target is at least 24x24 CSS pixels.
   Inline links inside running text are exempt by the criterion and are not
   affected by these rules. Vertical padding grows an inline link's hit area
   without moving the surrounding line box. */
.nizam-content td a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item) { padding-block: 6px; }
a.fw-semibold, a.small.d-inline-block { min-height: 24px; }
.n-cal-add { width: 24px; height: 24px; }
.n-cal-event { min-height: 24px; }
.form-check-label { padding-block: 2px; }
