/* =========================================================
   نظام نوران — Theme
   هوية "النور": كنبة داكنة فاخرة + توهج كهرماني/ذهبي
   ========================================================= */

@font-face { font-family:'Tajawal'; font-style:normal; font-weight:300; font-display:swap; src:url('/fonts/tajawal-300.woff2') format('woff2'); }
@font-face { font-family:'Tajawal'; font-style:normal; font-weight:400; font-display:swap; src:url('/fonts/tajawal-400.woff2') format('woff2'); }
@font-face { font-family:'Tajawal'; font-style:normal; font-weight:500; font-display:swap; src:url('/fonts/tajawal-500.woff2') format('woff2'); }
@font-face { font-family:'Tajawal'; font-style:normal; font-weight:700; font-display:swap; src:url('/fonts/tajawal-700.woff2') format('woff2'); }
@font-face { font-family:'Tajawal'; font-style:normal; font-weight:800; font-display:swap; src:url('/fonts/tajawal-800.woff2') format('woff2'); }

:root {
  --nr-bg: #f4f5f9;
  --nr-surface: #ffffff;
  --nr-surface-2: #fafbfd;
  --nr-border: #e7e9f2;
  --nr-text: #1c1f2e;
  --nr-text-dim: #6b7086;
  --nr-text-faint: #9598ab;

  --nr-ink: #10131f;
  --nr-ink-2: #171b2c;
  --nr-ink-3: #1f2438;

  --nr-gold: #d9a441;
  --nr-gold-light: #f0c675;
  --nr-gold-dim: #a67a2c;
  --nr-glow: 0 0 0 rgba(217, 164, 65, 0);

  --nr-emerald: #1fa971;
  --nr-emerald-bg: #e7f8f0;
  --nr-amber: #c8830c;
  --nr-amber-bg: #fdf1dc;
  --nr-rose: #d8455c;
  --nr-rose-bg: #fbe8ea;
  --nr-sky: #2f7bd6;
  --nr-sky-bg: #e8f1fc;
  --nr-violet: #7a5ce0;
  --nr-violet-bg: #efeafc;
  --nr-slate: #6b7086;
  --nr-slate-bg: #eef0f5;

  --nr-radius-sm: 10px;
  --nr-radius: 16px;
  --nr-radius-lg: 22px;
  --nr-shadow-sm: 0 1px 2px rgba(16, 19, 31, .06);
  --nr-shadow: 0 8px 24px -8px rgba(16, 19, 31, .12);
  --nr-shadow-lg: 0 20px 48px -16px rgba(16, 19, 31, .22);

  --nr-sidebar-w: 264px;
  --nr-topbar-h: 68px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--nr-bg);
  color: var(--nr-text);
  font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, .nr-heading { font-weight: 800; letter-spacing: -.01em; color: var(--nr-ink); }
a { color: inherit; text-decoration: none; }

.icon { width: 20px; height: 20px; display: inline-block; vertical-align: -4px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; vertical-align: -2px; }
.icon-lg { width: 28px; height: 28px; }

/* ---------- App shell ---------- */
.nr-app { min-height: 100vh; display: flex; }

.nr-sidebar {
  width: var(--nr-sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(185deg, var(--nr-ink) 0%, var(--nr-ink-2) 55%, var(--nr-ink-3) 100%);
  color: #cfd2e4;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.nr-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px;
}
.nr-brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: radial-gradient(circle at 30% 25%, var(--nr-gold-light), var(--nr-gold) 55%, var(--nr-gold-dim) 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 6px 18px -4px rgba(217,164,65,.55);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #241705; font-size: 18px;
}
.nr-brand-text { font-weight: 800; font-size: 17px; color: #fff; line-height: 1.1; }
.nr-brand-sub { font-size: 11px; color: #8b8fa8; margin-top: 2px; }

.nr-nav { flex: 1; overflow-y: auto; padding: 6px 12px; display: flex; flex-direction: column; gap: 3px; }
.nr-nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  color: #b7bad0; font-weight: 500; font-size: 14.5px;
  transition: background .15s ease, color .15s ease;
  position: relative;
}
.nr-nav-link .icon { color: #7d81a0; transition: color .15s ease; }
.nr-nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nr-nav-link:hover .icon { color: var(--nr-gold-light); }
.nr-nav-link.active {
  background: linear-gradient(90deg, rgba(217,164,65,.18), rgba(217,164,65,.04));
  color: #fff;
}
.nr-nav-link.active .icon { color: var(--nr-gold-light); }
.nr-nav-link.active::before {
  content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: linear-gradient(180deg, var(--nr-gold-light), var(--nr-gold));
}

.nr-sidebar-footer { padding: 14px 16px 20px; border-top: 1px solid rgba(255,255,255,.06); }
.nr-user-chip { display: flex; align-items: center; gap: 10px; }
.nr-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(145deg, #2a2f47, #1a1e30);
  border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--nr-gold-light); font-size: 14px;
}
.nr-user-name { color: #fff; font-size: 13.5px; font-weight: 600; }
.nr-user-role { color: #8b8fa8; font-size: 11.5px; }

.nr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.nr-topbar {
  height: var(--nr-topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--nr-border);
  position: sticky; top: 0; z-index: 30;
}
.nr-search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 8px;
  background: var(--nr-surface-2); border: 1px solid var(--nr-border);
  border-radius: 12px; padding: 9px 14px; color: var(--nr-text-dim);
}
.nr-search input { border: 0; background: transparent; outline: none; flex: 1; font-family: inherit; font-size: 14px; color: var(--nr-text); }
.nr-topbar-spacer { flex: 1; }
.nr-icon-btn {
  width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--nr-surface-2); border: 1px solid var(--nr-border); color: var(--nr-text-dim); cursor: pointer;
}
.nr-icon-btn:hover { color: var(--nr-gold-dim); border-color: var(--nr-gold); }
.nr-mobile-toggle { display: none; }

.nr-content { padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }
.nr-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.nr-page-title { font-size: 24px; font-weight: 800; color: var(--nr-ink); margin: 0; }
.nr-page-sub { color: var(--nr-text-dim); font-size: 13.5px; margin-top: 4px; }
.nr-breadcrumb { font-size: 12.5px; color: var(--nr-text-faint); margin-bottom: 6px; }

/* ---------- Cards ---------- */
.nr-card {
  background: var(--nr-surface);
  border: 1px solid var(--nr-border);
  border-radius: var(--nr-radius);
  box-shadow: var(--nr-shadow-sm);
}
.nr-card-body { padding: 20px 22px; }
.nr-card-header { padding: 18px 22px; border-bottom: 1px solid var(--nr-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nr-card-title { font-weight: 700; font-size: 15.5px; color: var(--nr-ink); }

.nr-glass {
  background: linear-gradient(155deg, rgba(255,255,255,.9), rgba(255,255,255,.65));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.5);
}

.nr-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.nr-stat {
  border-radius: var(--nr-radius); padding: 18px 20px; position: relative; overflow: hidden;
  background: var(--nr-surface); border: 1px solid var(--nr-border); box-shadow: var(--nr-shadow-sm);
}
.nr-stat::after {
  content: ""; position: absolute; inset-inline-end: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, var(--stat-color, var(--nr-gold)) 0%, transparent 70%); opacity: .18;
}
.nr-stat-label { font-size: 12.5px; color: var(--nr-text-dim); font-weight: 600; }
.nr-stat-value { font-size: 27px; font-weight: 800; color: var(--nr-ink); margin-top: 6px; }
.nr-stat-icon {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--stat-color, var(--nr-gold)) 14%, white); color: var(--stat-color, var(--nr-gold));
  margin-bottom: 10px;
}

/* ---------- Badges ---------- */
.badge-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-slate { background: var(--nr-slate-bg); color: var(--nr-slate); }
.badge-amber { background: var(--nr-amber-bg); color: var(--nr-amber); }
.badge-emerald { background: var(--nr-emerald-bg); color: var(--nr-emerald); }
.badge-rose { background: var(--nr-rose-bg); color: var(--nr-rose); }
.badge-sky { background: var(--nr-sky-bg); color: var(--nr-sky); }
.badge-violet { background: var(--nr-violet-bg); color: var(--nr-violet); }

/* ---------- Buttons ---------- */
.btn-nr {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; padding: 10px 18px; font-weight: 700; font-size: 14px; border: 1px solid transparent;
  cursor: pointer; transition: transform .1s ease, box-shadow .15s ease, background .15s ease; font-family: inherit;
}
.btn-nr:active { transform: translateY(1px); }
.btn-nr-primary { background: linear-gradient(135deg, var(--nr-gold-light), var(--nr-gold)); color: #2a1c05; box-shadow: 0 8px 20px -8px rgba(217,164,65,.65); }
.btn-nr-primary:hover { box-shadow: 0 10px 26px -8px rgba(217,164,65,.8); color: #2a1c05; }
.btn-nr-dark { background: var(--nr-ink); color: #fff; }
.btn-nr-dark:hover { background: var(--nr-ink-2); color: #fff; }
.btn-nr-ghost { background: var(--nr-surface-2); color: var(--nr-text); border-color: var(--nr-border); }
.btn-nr-ghost:hover { border-color: var(--nr-gold); color: var(--nr-gold-dim); }
.btn-nr-danger { background: var(--nr-rose-bg); color: var(--nr-rose); }
.btn-nr-danger:hover { background: var(--nr-rose); color: #fff; }
.btn-nr-sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn-nr-icon { width: 38px; height: 38px; padding: 0; border-radius: 11px; }
.btn-nr:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.nr-label { display: block; font-size: 13px; font-weight: 700; color: var(--nr-text); margin-bottom: 6px; }
.nr-input, .nr-select, textarea.nr-input {
  width: 100%; border: 1px solid var(--nr-border); background: var(--nr-surface-2);
  border-radius: 11px; padding: 10px 13px; font-family: inherit; font-size: 14px; color: var(--nr-text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nr-input:focus, .nr-select:focus { outline: none; border-color: var(--nr-gold); box-shadow: 0 0 0 3px rgba(217,164,65,.15); background: #fff; }
.nr-field { margin-bottom: 16px; }
.nr-hint { font-size: 12px; color: var(--nr-text-faint); margin-top: 5px; }
.nr-error { font-size: 12px; color: var(--nr-rose); margin-top: 5px; font-weight: 600; }
.text-danger { color: var(--nr-rose) !important; }
.validation-summary-errors { background: var(--nr-rose-bg); color: var(--nr-rose); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 13.5px; }
.validation-summary-errors ul { margin: 0; padding-inline-start: 18px; }

/* ---------- Tables ---------- */
.nr-table-wrap { overflow-x: auto; border-radius: var(--nr-radius); border: 1px solid var(--nr-border); background: var(--nr-surface); }
table.nr-table { width: 100%; border-collapse: collapse; font-size: 13.8px; min-width: 640px; }
table.nr-table thead th {
  text-align: start; padding: 13px 16px; font-weight: 700; color: var(--nr-text-dim); font-size: 12.3px;
  background: var(--nr-surface-2); border-bottom: 1px solid var(--nr-border); white-space: nowrap;
}
table.nr-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--nr-border); vertical-align: middle; }
table.nr-table tbody tr:last-child td { border-bottom: none; }
table.nr-table tbody tr:hover { background: var(--nr-surface-2); }
.nr-table-empty { padding: 40px 20px; text-align: center; color: var(--nr-text-faint); }

/* ---------- Item thumb ---------- */
.nr-thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--nr-slate-bg); border: 1px solid var(--nr-border); }
.nr-thumb-lg { width: 100%; aspect-ratio: 1; border-radius: var(--nr-radius); object-fit: cover; background: var(--nr-slate-bg); }

/* ---------- Login ---------- */
.nr-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(circle at 20% 20%, #1c2138 0%, var(--nr-ink) 55%, #05060a 100%);
}
.nr-login-card {
  width: 100%; max-width: 400px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--nr-radius-lg); padding: 34px 30px; backdrop-filter: blur(16px); box-shadow: var(--nr-shadow-lg);
}
.nr-login-mark { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 18px;
  background: radial-gradient(circle at 30% 25%, var(--nr-gold-light), var(--nr-gold) 55%, var(--nr-gold-dim) 100%);
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: #241705; font-size: 22px;
  box-shadow: 0 0 40px -6px rgba(217,164,65,.7);
}
.nr-login-title { text-align: center; color: #fff; font-weight: 800; font-size: 21px; margin-bottom: 4px; }
.nr-login-sub { text-align: center; color: #8b8fa8; font-size: 13px; margin-bottom: 26px; }
.nr-login-wrap .nr-label { color: #cfd2e4; }
.nr-login-wrap .nr-input { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); color: #fff; }
.nr-login-wrap .nr-input:focus { background: rgba(255,255,255,.08); }
.nr-login-wrap .nr-input::placeholder { color: #6c7090; }

/* ---------- Utility ---------- */
.nr-empty { text-align: center; padding: 60px 20px; color: var(--nr-text-faint); }
.nr-empty .icon-lg { color: var(--nr-text-faint); margin-bottom: 10px; }
.nr-flex { display: flex; align-items: center; }
.nr-gap-2 { gap: 8px; } .nr-gap-3 { gap: 12px; }
.nr-muted { color: var(--nr-text-dim); }
.nr-mb-0 { margin-bottom: 0 !important; }

/* ---------- Bottom mobile nav ---------- */
.nr-bottom-nav {
  display: none; position: fixed; bottom: 0; inset-inline: 0; z-index: 50;
  background: rgba(16,19,31,.96); backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.nr-bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #8b8fa8; font-size: 10.5px; font-weight: 600; padding: 6px 8px; border-radius: 10px; flex: 1; max-width: 84px; }
.nr-bottom-nav a.active { color: var(--nr-gold-light); }
.nr-bottom-nav a .icon { width: 21px; height: 21px; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .nr-sidebar { position: fixed; inset-inline-start: 0; top: 0; transform: translateX(110%); transition: transform .25s ease; box-shadow: var(--nr-shadow-lg); }
  html[dir="rtl"] .nr-sidebar { transform: translateX(110%); }
  .nr-sidebar.open { transform: translateX(0); }
  .nr-sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(10,11,18,.5); z-index: 39; }
  .nr-sidebar-backdrop.open { display: block; }
  .nr-mobile-toggle { display: flex; }
  .nr-content { padding: 16px; padding-bottom: 88px; }
  .nr-bottom-nav { display: flex; }
  .nr-search { display: none; }
  .nr-topbar { padding: 0 14px; }
}
@media (max-width: 560px) {
  .nr-stat-grid { grid-template-columns: 1fr 1fr; }
  .nr-page-title { font-size: 20px; }
  .nr-card-body { padding: 16px; }
}
