/*
 * nawajeeva-theme.css
 * ---------------------------------------------------------------------------
 * Nawajeeva Backoffice - Emerald / Forest palette and rail navigation.
 *
 * MUST be linked AFTER vendor/css/core.css. This file never edits the vendor
 * stylesheet, it only re-declares the design tokens core.css already derives
 * everything from, then adds the chrome for the new navigation.
 * ---------------------------------------------------------------------------
 */

/* ===========================================================================
   1. PALETTE - Emerald / Forest
   =========================================================================== */

:root,
[data-bs-theme='light'] {
  /* --- Brand scale ------------------------------------------------------- */
  --nj-green-50: #e9f7f0;
  --nj-green-100: #c9ecdc;
  --nj-green-200: #98dcbe;
  --nj-green-300: #5fc79b;
  --nj-green-400: #2aa877;
  --nj-green-500: #0b8457;
  --nj-green-600: #0a7350;
  --nj-green-700: #095c41;
  --nj-green-800: #074833;
  --nj-green-900: #053426;

  /* Forest ink - drives every neutral mix in core.css */
  --nj-ink: #10241c;
  --nj-ink-rgb: 16, 36, 28;

  /* --- Bootstrap named colours ------------------------------------------ */
  --bs-blue: #0ea5e9;
  --bs-indigo: #2aa877;
  --bs-purple: #0b8457;
  --bs-pink: #d6336c;
  --bs-red: #dc4c3e;
  --bs-orange: #f0a02a;
  --bs-yellow: #f0a02a;
  --bs-green: #74b336;
  --bs-teal: #12a594;
  --bs-cyan: #0ea5e9;
  --bs-black: var(--nj-ink);
  --bs-gray: #eceeed;
  --bs-gray-dark: #4f5b55;

  /* --- Green tinted neutral ramp ---------------------------------------- */
  --bs-gray-25: #fafbfa;
  --bs-gray-50: #f2f5f3;
  --bs-gray-75: #eef2f0;
  --bs-gray-100: #e8edea;
  --bs-gray-200: #d4dcd8;
  --bs-gray-300: #bec8c3;
  --bs-gray-400: #a7b4ae;
  --bs-gray-500: #909e98;
  --bs-gray-600: #79877f;
  --bs-gray-700: #626e68;
  --bs-gray-800: #4f5b55;
  --bs-gray-900: #3a453f;

  /* --- Semantic colours -------------------------------------------------- */
  --bs-primary: #0b8457;
  --bs-secondary: #7d8b84;
  --bs-success: #74b336;
  --bs-info: #0ea5e9;
  --bs-warning: #f0a02a;
  --bs-danger: #dc4c3e;
  --bs-light: #dfe7e3;
  --bs-dark: #0f2a20;

  --bs-primary-rgb: 11, 132, 87;
  --bs-secondary-rgb: 125, 139, 132;
  --bs-success-rgb: 116, 179, 54;
  --bs-info-rgb: 14, 165, 233;
  --bs-warning-rgb: 240, 160, 42;
  --bs-danger-rgb: 220, 76, 62;
  --bs-light-rgb: 223, 231, 227;
  --bs-dark-rgb: 15, 42, 32;
  --bs-gray-rgb: 236, 238, 237;
  --bs-black-rgb: var(--nj-ink-rgb);

  --bs-primary-text-emphasis: #074833;
  --bs-secondary-text-emphasis: #323a36;
  --bs-success-text-emphasis: #2f4a12;
  --bs-info-text-emphasis: #063f5c;
  --bs-warning-text-emphasis: #60400a;
  --bs-danger-text-emphasis: #581913;
  --bs-light-text-emphasis: #626e68;
  --bs-dark-text-emphasis: #626e68;

  --bs-primary-bg-subtle: #e6f4ee;
  --bs-secondary-bg-subtle: #ebefed;
  --bs-success-bg-subtle: #eff7e4;
  --bs-info-bg-subtle: #e3f4fd;
  --bs-warning-bg-subtle: #fdf1de;
  --bs-danger-bg-subtle: #fbe9e7;
  --bs-light-bg-subtle: #f4f8f6;
  --bs-dark-bg-subtle: #d7dedb;

  --bs-primary-border-subtle: #c2e4d5;
  --bs-secondary-border-subtle: #d5dcd9;
  --bs-success-border-subtle: #d6ebbb;
  --bs-info-border-subtle: #bce4f9;
  --bs-warning-border-subtle: #fadfb4;
  --bs-danger-border-subtle: #f5c7c2;
  --bs-light-border-subtle: #d5dcd9;
  --bs-dark-border-subtle: #b9c3bf;

  /* --- Surfaces and typography ------------------------------------------ */
  --bs-base-color: var(--nj-ink);
  --bs-base-color-rgb: var(--nj-ink-rgb);
  --bs-paper-bg: #ffffff;
  --bs-paper-bg-rgb: 255, 255, 255;

  --bs-body-color: #55635c;
  --bs-body-color-rgb: 85, 99, 92;
  --bs-body-bg: #f1f6f3;
  --bs-body-bg-rgb: 241, 246, 243;

  --bs-emphasis-color: var(--nj-ink);
  --bs-emphasis-color-rgb: var(--nj-ink-rgb);
  --bs-secondary-color: #97a39d;
  --bs-secondary-color-rgb: 151, 163, 157;
  --bs-secondary-bg: #d4dcd8;
  --bs-secondary-bg-rgb: 212, 220, 216;
  --bs-tertiary-color: rgba(85, 99, 92, 0.5);
  --bs-tertiary-color-rgb: 85, 99, 92;
  --bs-tertiary-bg: #dfe7e3;
  --bs-tertiary-bg-rgb: 223, 231, 227;

  --bs-heading-color: color-mix(in sRGB, var(--nj-ink) 92%, #fff);
  --bs-border-color: color-mix(in sRGB, var(--nj-ink) 13%, #fff);
  --bs-border-color-translucent: rgba(var(--nj-ink-rgb), 0.08);

  --bs-link-color: #0b8457;
  --bs-link-color-rgb: 11, 132, 87;
  --bs-link-hover-color: #0a7350;
  --bs-link-hover-color-rgb: 10, 115, 80;

  --bs-code-color: #0a7350;
  --bs-highlight-color: #55635c;
  --bs-highlight-bg: #fdf1de;

  --bs-focus-ring-color: rgba(11, 132, 87, 0.35);
  --bs-form-valid-color: #74b336;
  --bs-form-valid-border-color: #74b336;
  --bs-form-invalid-color: #dc4c3e;
  --bs-form-invalid-border-color: #dc4c3e;

  --bs-box-shadow: 0 0.25rem 0.625rem 0 rgba(var(--nj-ink-rgb), 0.18);
  --bs-box-shadow-sm: 0 0.1875rem 0.375rem 0 rgba(var(--nj-ink-rgb), 0.14);
  --bs-box-shadow-lg: 0 0.375rem 1rem 0 rgba(var(--nj-ink-rgb), 0.2);
  --bs-box-shadow-inset: inset 0 1px 2px rgba(var(--nj-ink-rgb), 0.07);
  --bs-navbar-search-shadow: 0 0.25rem 0.5rem -0.25rem rgba(var(--nj-ink-rgb), 0.35);
  --bs-menu-box-shadow: 0 0.375rem 1rem 0 rgba(var(--nj-ink-rgb), 0.2);

  /* --- Navigation geometry ---------------------------------------------- */
  --nj-rail-w: 4.75rem;
  --nj-panel-w: 17.5rem;
  --nj-radius: 0.625rem;

  /* Hand the rail width to Materio so every layout offset stays correct. */
  --bs-menu-width: var(--nj-rail-w);
  --bs-menu-collapsed-width: var(--nj-rail-w);
}

[data-bs-theme='dark'] {
  --bs-body-color: #c3cec8;
  --bs-body-color-rgb: 195, 206, 200;
  --bs-body-bg: #12211b;
  --bs-body-bg-rgb: 18, 33, 27;
  --bs-base-color: #dcebe4;
  --bs-base-color-rgb: 220, 235, 228;
  --bs-paper-bg: #172a22;
  --bs-paper-bg-rgb: 23, 42, 34;
  --bs-emphasis-color: #ffffff;
  --bs-emphasis-color-rgb: 255, 255, 255;
  --bs-secondary-color: rgba(195, 206, 200, 0.75);
  --bs-secondary-bg: #294237;
  --bs-tertiary-bg: #20362c;
  --bs-heading-color: inherit;
  --bs-border-color: #34503f;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.14);

  --bs-primary-text-emphasis: #6fc79b;
  --bs-success-text-emphasis: #a8d474;
  --bs-info-text-emphasis: #7dd0f7;
  --bs-warning-text-emphasis: #f7ca85;
  --bs-danger-text-emphasis: #f0958b;

  --bs-primary-bg-subtle: #06251a;
  --bs-success-bg-subtle: #1d2c0d;
  --bs-info-bg-subtle: #052b3f;
  --bs-warning-bg-subtle: #3c2807;
  --bs-danger-bg-subtle: #38130f;

  --bs-primary-border-subtle: #0f5c3f;
  --bs-success-border-subtle: #4a7522;
  --bs-info-border-subtle: #0a6d99;
  --bs-warning-border-subtle: #9c681b;
  --bs-danger-border-subtle: #913228;

  --bs-link-color: #6fc79b;
  --bs-link-color-rgb: 111, 199, 155;
  --bs-link-hover-color: #98dcbe;
  --bs-link-hover-color-rgb: 152, 220, 190;
  --bs-code-color: #98dcbe;
}

/* ---------------------------------------------------------------------------
   1b. Selectors in core.css that hardcode the old purple.
   --------------------------------------------------------------------------- */

.btn-primary {
  --bs-btn-bg: #0b8457;
  --bs-btn-border-color: #0b8457;
  --bs-btn-hover-bg: #0a7350;
  --bs-btn-hover-border-color: #095c41;
  --bs-btn-focus-shadow-rgb: 11, 132, 87;
  --bs-btn-active-bg: #0a7350;
  --bs-btn-active-border-color: #074833;
  --bs-btn-disabled-bg: #0b8457;
  --bs-btn-disabled-border-color: #0b8457;
}

.btn-outline-primary {
  --bs-btn-color: #0b8457;
  --bs-btn-border-color: #0b8457;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #0b8457;
  --bs-btn-hover-border-color: #0b8457;
  --bs-btn-focus-shadow-rgb: 11, 132, 87;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #074833;
  --bs-btn-active-border-color: #074833;
  --bs-btn-disabled-color: #0b8457;
  --bs-btn-disabled-border-color: #0b8457;
}

.btn-outline-primary:hover,
.btn-outline-primary:hover i,
.btn-outline-primary:hover .icon-base,
.btn-outline-primary:focus i,
.btn-outline-primary:focus .icon-base,
.btn-outline-primary:active i,
.btn-outline-primary:active .icon-base {
  color: #ffffff !important;
}

.btn-outline-secondary:hover i,
.btn-outline-secondary:hover .icon-base,
.btn-outline-success:hover i,
.btn-outline-success:hover .icon-base,
.btn-outline-danger:hover i,
.btn-outline-danger:hover .icon-base,
.btn-outline-warning:hover i,
.btn-outline-warning:hover .icon-base,
.btn-outline-info:hover i,
.btn-outline-info:hover .icon-base,
.btn-outline-dark:hover i,
.btn-outline-dark:hover .icon-base {
  color: #ffffff !important;
}

.progress {
  --bs-progress-bar-bg: #0b8457;
}

[data-bs-theme='dark'] .accordion-button::after {
  --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236fc79b'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3e%3c/svg%3e");
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236fc79b'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3e%3c/svg%3e");
}

/* Subtle organic depth behind the whole application. */
body {
  background-image:
    radial-gradient(58rem 32rem at 100% -8%, rgba(42, 168, 119, 0.09), transparent 60%),
    radial-gradient(46rem 30rem at -10% 108%, rgba(11, 132, 87, 0.07), transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* ===========================================================================
   2. NAVIGATION RAIL
   =========================================================================== */

.nj-rail {
  display: flex;
  overflow: visible;
  flex-direction: column;
  align-items: center;
  border-inline-end: 1px solid var(--bs-border-color);
  background:
    linear-gradient(180deg, var(--nj-green-900) 0%, #072b1f 42%, var(--nj-green-800) 100%);
  inline-size: var(--nj-rail-w);
  min-inline-size: var(--nj-rail-w);
  padding-block: 0.75rem 0.5rem;
}

.nj-rail::after {
  position: absolute;
  background: linear-gradient(180deg, transparent, rgba(42, 168, 119, 0.55), transparent);
  content: '';
  inline-size: 1px;
  inset-block: 12%;
  inset-inline-end: 0;
  pointer-events: none;
}

/* --- Brand ---------------------------------------------------------------- */
.nj-rail .nj-brand {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  inline-size: 100%;
  margin-block-end: 0.75rem;
  text-decoration: none;
}

.nj-brand-mark {
  display: grid;
  border: 1px solid rgba(152, 220, 190, 0.35);
  background: linear-gradient(140deg, var(--nj-green-400), var(--nj-green-600));
  block-size: 2.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 0.375rem 0.875rem rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.125rem;
  inline-size: 2.25rem;
  place-items: center;
}

.nj-brand-name {
  color: rgba(233, 247, 240, 0.72);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- Category buttons ---------------------------------------------------- */
.nj-rail-nav {
  display: flex;
  overflow: hidden auto;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.25rem;
  inline-size: 100%;
  padding-inline: 0.375rem;
  scrollbar-width: none;
}

.nj-rail-nav::-webkit-scrollbar {
  display: none;
}

.nj-rail-foot {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 0.25rem;
  border-block-start: 1px solid rgba(152, 220, 190, 0.18);
  inline-size: 100%;
  margin-block-start: 0.5rem;
  padding-block-start: 0.5rem;
  padding-inline: 0.375rem;
}

.nj-rail-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4375rem 0.125rem 0.375rem;
  border: 0;
  background: transparent;
  border-radius: 0.75rem;
  color: rgba(201, 236, 220, 0.82);
  cursor: pointer;
  gap: 0.1875rem;
  inline-size: 100%;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nj-rail-ico {
  display: grid;
  block-size: 1.5rem;
  font-size: 1.375rem;
  line-height: 1;
  place-items: center;
}

.nj-rail-txt {
  max-inline-size: 100%;
  overflow: hidden;
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nj-rail-item:hover,
.nj-rail-item:focus-visible {
  background: rgba(152, 220, 190, 0.14);
  color: #f2fbf7;
  outline: none;
  transform: translateY(-1px);
}

.nj-rail-item.is-open {
  background: rgba(152, 220, 190, 0.18);
  color: #f2fbf7;
}

.nj-rail-item.is-current {
  background: linear-gradient(140deg, var(--nj-green-400), var(--nj-green-600));
  box-shadow: 0 0.375rem 0.875rem rgba(0, 0, 0, 0.32);
  color: #fff;
}

.nj-rail-item.is-current::before {
  position: absolute;
  background: #d7f5e7;
  block-size: 1.375rem;
  border-radius: 0 0.25rem 0.25rem 0;
  content: '';
  inline-size: 0.1875rem;
  inset-block-start: 50%;
  inset-inline-start: -0.375rem;
  transform: translateY(-50%);
}

.nj-rail-action {
  color: rgba(201, 236, 220, 0.6);
}

/* ===========================================================================
   3. FLYOUT PANEL
   =========================================================================== */

.nj-panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid var(--bs-border-color);
  background: var(--bs-paper-bg);
  box-shadow: 0.75rem 0 2rem rgba(var(--nj-ink-rgb), 0.16);
  inline-size: var(--nj-panel-w);
  inset-block: 0;
  inset-inline-start: 100%;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-0.75rem);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  visibility: hidden;
}

.nj-rail.is-open .nj-panel,
.nj-pinned .nj-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  visibility: visible;
}

.nj-panel-view {
  display: flex;
  overflow: hidden;
  flex: 1 1 auto;
  flex-direction: column;
}

.nj-panel-view[hidden] {
  display: none;
}

/* --- Panel header -------------------------------------------------------- */
.nj-panel-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0.875rem 0.75rem 1.125rem;
  /* border-block-end: 1px solid var(--bs-border-color); */
  gap: 0.5rem;
}

.nj-panel-heading {
  display: flex;
  min-inline-size: 0;
  flex-direction: column;
}

.nj-panel-eyebrow {
  color: var(--bs-secondary-color);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nj-panel-title {
  overflow: hidden;
  color: var(--bs-heading-color);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nj-panel-pin {
  display: grid;
  flex: 0 0 auto;
  border: 1px solid transparent;
  background: transparent;
  block-size: 1.875rem;
  border-radius: 0.5rem;
  color: var(--bs-secondary-color);
  cursor: pointer;
  font-size: 1rem;
  inline-size: 1.875rem;
  place-items: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nj-panel-pin:hover {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
}

.nj-pinned .nj-panel-pin {
  border-color: var(--bs-primary-border-subtle);
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  transform: rotate(45deg);
}

/* Pinning is a desktop affordance only. */
@media (max-width: 1199.98px) {
  .nj-panel-pin {
    display: none;
  }
}

/* --- Panel body ---------------------------------------------------------- */
.nj-panel-scroll {
  overflow: hidden auto;
  flex: 1 1 auto;
  padding: 0.625rem 0.625rem 1rem;
  overscroll-behavior: contain;
  scrollbar-color: var(--bs-gray-300) transparent;
  scrollbar-width: thin;
}

.nj-panel-group + .nj-panel-group {
  border-block-start: 1px dashed var(--bs-border-color);
  margin-block-start: 0.625rem;
  padding-block-start: 0.625rem;
}

.nj-panel-group-label {
  display: flex;
  align-items: center;
  padding-inline: 0.5rem;
  margin-block: 0.25rem 0.375rem;
  color: var(--bs-secondary-color);
  font-size: 0.625rem;
  font-weight: 700;
  gap: 0.375rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nj-panel-group-ops .nj-panel-group-label {
  color: var(--bs-primary);
}

.nj-panel-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.4375rem 0.5rem;
  border-radius: 0.5rem;
  color: var(--bs-body-color);
  font-size: 0.875rem;
  gap: 0.625rem;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nj-panel-link-ico {
  display: grid;
  flex: 0 0 auto;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-light-bg-subtle);
  block-size: 1.75rem;
  border-radius: 0.4375rem;
  color: var(--bs-secondary-color);
  font-size: 0.9375rem;
  inline-size: 1.75rem;
  place-items: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nj-panel-link-txt {
  overflow: hidden;
  flex: 1 1 auto;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nj-panel-link-ext {
  flex: 0 0 auto;
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
}

.nj-panel-link:hover {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
}

.nj-panel-link:hover .nj-panel-link-ico {
  border-color: var(--bs-primary-border-subtle);
  background: #fff;
  color: var(--bs-primary);
}

.nj-panel-link.is-active {
  background: linear-gradient(90deg, var(--bs-primary) 0%, var(--nj-green-400) 100%);
  box-shadow: 0 0.25rem 0.625rem rgba(11, 132, 87, 0.28);
  color: #fff;
  font-weight: 600;
}

.nj-panel-link.is-active .nj-panel-link-ico {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.nj-panel-link.is-active .nj-panel-link-ext {
  color: rgba(255, 255, 255, 0.8);
}

/* --- Pinned panel reserves real layout space ---------------------------- */
@media (min-width: 1200px) {
  .layout-menu-fixed.nj-pinned .layout-page,
  .layout-menu-fixed-offcanvas.nj-pinned .layout-page {
    padding-inline-start: calc(var(--nj-rail-w) + var(--nj-panel-w));
    transition: padding-inline-start 0.18s ease;
  }
}

/* --- Small screens: rail + panel travel together as one drawer ---------- */
@media (max-width: 1199.98px) {
  :root,
  [data-bs-theme='light'] {
    --nj-rail-w: 5.25rem;
  }

  .nj-rail {
    inline-size: var(--nj-rail-w) !important;
  }

  .nj-panel {
    inline-size: min(var(--nj-panel-w), calc(100vw - var(--nj-rail-w) - 1rem));
    border-start-end-radius: var(--nj-radius);
    border-end-end-radius: var(--nj-radius);
  }
}

/* ===========================================================================
   4. NAVBAR
   =========================================================================== */

.layout-navbar.navbar-detached {
  border: 1px solid var(--bs-border-color);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0.125rem 0.5rem rgba(var(--nj-ink-rgb), 0.05);
  gap: 0.75rem;
}

.nj-navbar-lead {
  display: flex;
  min-inline-size: 0;
  flex: 1 1 auto;
  align-items: center;
  padding-inline-start: 1rem;
}

/* --- Breadcrumb ---------------------------------------------------------- */
.nj-crumb {
  display: flex;
  align-items: center;
  min-inline-size: 0;
  inline-size: auto;
  max-inline-size: 100%;
}

.nj-crumb ol {
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
  flex-wrap: nowrap;
  gap: 0.375rem;
  list-style: none;
}

.nj-crumb li {
  display: flex;
  min-inline-size: 0;
  align-items: center;
  gap: 0.375rem;
}

.nj-crumb li + li::before {
  color: var(--bs-gray-400);
  content: '/';
  font-size: 0.8125rem;
  margin-inline-end: 0.125rem;
}

.nj-crumb a,
.nj-crumb-cat {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border: 0;
  background: transparent;
  border-radius: 0.375rem;
  color: var(--bs-secondary-color);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  gap: 0.25rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nj-crumb a:hover,
.nj-crumb-cat:hover {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
}

.nj-crumb-leaf {
  display: flex;
  min-inline-size: 0;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .nj-crumb li:not(:last-child) {
    display: none;
  }

  .nj-crumb li + li::before {
    content: none;
  }
}

/* --- Palette trigger ----------------------------------------------------- */
.nj-search-trigger {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.5rem 0.375rem 0.75rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-light-bg-subtle);
  border-radius: 50rem;
  color: var(--bs-secondary-color);
  cursor: pointer;
  font-size: 0.8125rem;
  gap: 0.5rem;
  inline-size: 15rem;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.nj-search-trigger:hover {
  border-color: var(--bs-primary-border-subtle);
  background: #fff;
  color: var(--bs-primary);
}

.nj-search-trigger i {
  font-size: 1.0625rem;
}

.nj-search-trigger span {
  overflow: hidden;
  flex: 1 1 auto;
  text-align: start;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nj-kbd {
  border: 1px solid var(--bs-border-color);
  background: #fff;
  border-radius: 0.25rem;
  box-shadow: 0 1px 0 var(--bs-border-color);
  color: var(--bs-secondary-color);
  font-family: var(--bs-font-monospace);
  font-size: 0.625rem;
  line-height: 1;
  padding-block: 0.1875rem;
  padding-inline: 0.3125rem;
}

@media (max-width: 991.98px) {
  .nj-search-trigger {
    inline-size: auto;
    padding-inline: 0.5rem;
  }

  .nj-search-trigger span,
  .nj-search-trigger .nj-kbd {
    display: none;
  }
}

/* --- Right hand icon buttons -------------------------------------------- */
.nj-nav-icon {
  display: grid;
  border: 1px solid transparent;
  background: transparent;
  block-size: 2.25rem;
  border-radius: 0.5rem;
  color: var(--bs-secondary-color);
  font-size: 1.125rem;
  inline-size: 2.25rem;
  place-items: center;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nj-nav-icon:hover,
.nj-nav-icon:focus,
.show > .nj-nav-icon {
  border-color: var(--bs-primary-border-subtle);
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
}

.nj-nav-icon::after {
  display: none;
}

.nj-user-chip {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.375rem;
  border: 0;
  background: transparent;
  color: var(--bs-heading-color);
  gap: 0.5rem;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.nj-user-chip::after {
  display: none;
}

.nj-user-chip:hover,
.show > .nj-user-chip {
  border-color: transparent;
  background: transparent;
  opacity: 0.85;
}

.nj-user-avatar {
  display: grid;
  background: linear-gradient(140deg, var(--nj-green-400), var(--nj-green-600));
  block-size: 1.75rem;
  border-radius: 50%;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  inline-size: 1.75rem;
  place-items: center;
}

.nj-user-meta {
  display: flex;
  max-inline-size: 9rem;
  flex-direction: column;
  line-height: 1.15;
}

.nj-user-name {
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nj-user-role {
  overflow: hidden;
  color: var(--bs-secondary-color);
  font-size: 0.6875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .nj-user-meta {
    display: none;
  }

  .nj-user-chip {
    padding: 0.25rem;
    border-color: transparent;
    background: transparent;
  }
}

.dropdown-menu .nj-dropdown-label {
  display: block;
  padding: 0.375rem 1rem 0.25rem;
  color: var(--bs-secondary-color);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ===========================================================================
   5. COMMAND PALETTE
   =========================================================================== */

.nj-cmd {
  position: fixed;
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-block-start: 8vh;
  padding-inline: 1rem;
  inset: 0;
}

.nj-cmd[hidden] {
  display: none;
}

.nj-cmd-scrim {
  position: absolute;
  backdrop-filter: blur(3px);
  background: rgba(var(--nj-ink-rgb), 0.45);
  inset: 0;
}

.nj-cmd-box {
  position: relative;
  display: flex;
  max-block-size: 78vh;
  max-inline-size: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-paper-bg);
  border-radius: 0.875rem;
  box-shadow: 0 1.5rem 3.5rem rgba(var(--nj-ink-rgb), 0.32);
  inline-size: 40rem;
  animation: njCmdIn 0.16s ease-out;
}

@keyframes njCmdIn {
  from {
    opacity: 0;
    transform: translateY(-0.75rem) scale(0.985);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.nj-cmd-field {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0.75rem 0.875rem;
  /* border-block-end: 1px solid var(--bs-border-color); */
  gap: 0.625rem;
}

.nj-cmd-field > i {
  color: var(--bs-primary);
  font-size: 1.25rem;
}

.nj-cmd-field input {
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  color: var(--bs-heading-color);
  font-size: 0.9375rem;
  outline: none;
}

.nj-cmd-field input::placeholder {
  color: var(--bs-secondary-color);
}

.nj-cmd-results {
  overflow: hidden auto;
  flex: 1 1 auto;
  padding: 0.375rem;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.nj-cmd-group {
  padding: 0.5rem 0.625rem 0.25rem;
  color: var(--bs-secondary-color);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nj-cmd-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  color: var(--bs-body-color);
  gap: 0.625rem;
  text-decoration: none;
}

.nj-cmd-item-ico {
  display: grid;
  flex: 0 0 auto;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-light-bg-subtle);
  block-size: 1.875rem;
  border-radius: 0.4375rem;
  color: var(--bs-secondary-color);
  font-size: 1rem;
  inline-size: 1.875rem;
  place-items: center;
}

.nj-cmd-item-body {
  display: flex;
  min-inline-size: 0;
  flex: 1 1 auto;
  flex-direction: column;
  line-height: 1.25;
}

.nj-cmd-item-title {
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nj-cmd-item-title mark {
  padding: 0;
  background: transparent;
  color: var(--bs-primary);
  font-weight: 700;
}

.nj-cmd-item-path {
  color: var(--bs-secondary-color);
  font-size: 0.6875rem;
}

.nj-cmd-item-enter {
  flex: 0 0 auto;
  color: var(--bs-secondary-color);
  font-size: 1rem;
  opacity: 0;
}

.nj-cmd-item.is-cursor {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
}

.nj-cmd-item.is-cursor .nj-cmd-item-ico {
  border-color: var(--bs-primary-border-subtle);
  background: #fff;
  color: var(--bs-primary);
}

.nj-cmd-item.is-cursor .nj-cmd-item-enter {
  color: var(--bs-primary);
  opacity: 1;
}

.nj-cmd-empty {
  padding: 2.25rem 1rem;
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
  text-align: center;
}

.nj-cmd-empty i {
  display: block;
  margin-block-end: 0.5rem;
  color: var(--bs-gray-300);
  font-size: 1.75rem;
}

.nj-cmd-foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0.5rem 0.875rem;
  border-block-start: 1px solid var(--bs-border-color);
  background: var(--bs-light-bg-subtle);
  color: var(--bs-secondary-color);
  font-size: 0.6875rem;
  gap: 1rem;
}

.nj-cmd-foot span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

@media (max-width: 575.98px) {
  .nj-cmd-foot span:not(.nj-cmd-foot-brand) {
    display: none;
  }
}

/* ===========================================================================
   6. CONTENT POLISH
   =========================================================================== */

/* Module pages emit `<br>` `menu_crumb()` `<br>` before their heading. The
   breadcrumb now renders in the navbar, so collapse the leftover gap. */
.container-p-y > div > br:first-child,
.container-p-y > div > br:first-child + br {
  display: none;
}

.container-p-y > div > h4 {
  margin-block-end: 0.25rem;
  color: var(--bs-heading-color);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  box-shadow: 0 0.125rem 0.375rem rgba(var(--nj-ink-rgb), 0.04);
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 1.25rem 1.5rem;
  /* border-block-end: 1px solid var(--bs-border-color); */
  background-color: transparent;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-block-start: 1px solid var(--bs-border-color);
  background-color: transparent;
}

/* --- Input Boxes & Form Controls Polish --------------------------------- */
.form-control,
.form-select {
  padding-block: 0.5625rem;
  padding-inline-start: 1.25rem !important;
  padding-inline-end: 1.25rem !important;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.45;
  border-color: var(--bs-border-color);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control::placeholder,
textarea.form-control::placeholder {
  color: var(--bs-secondary-color);
  opacity: 0.65;
  font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary);
}

/* Floating labels polish (e.g. hpt_add.php) */
.form-floating,
.form-floating-outline {
  position: relative;
}

.form-floating > .form-control,
.form-floating > .form-select,
.form-floating-outline > .form-control,
.form-floating-outline > .form-select {
  padding-inline-start: 1.25rem !important;
  padding-inline-end: 1.25rem !important;
}

.form-floating > textarea.form-control,
.form-floating-outline > textarea.form-control {
  padding-inline-start: 1.25rem !important;
  padding-inline-end: 1.25rem !important;
  padding-block-start: 1.25rem !important;
}

.form-floating > label,
.form-floating-outline > label {
  padding-inline-start: 0.7rem !important;
  padding-inline-end: 0.7rem !important;
  display: flex !important;
  align-items: center !important;
  top: 0 !important;
  height: 100% !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Exclude textarea from vertical middle centering */
.form-floating > textarea ~ label,
.form-floating-outline > textarea ~ label,
.form-floating > textarea.form-control ~ label,
.form-floating-outline > textarea.form-control ~ label {
  align-items: flex-start !important;
  padding-top: 0.8555rem !important;
  height: auto !important;
}

/* Reset height and padding when label floats (focused, populated, autofilled) */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-control:-webkit-autofill ~ label,
.form-floating > .form-select:focus ~ label,
.form-floating > .form-select:not([value=""]) ~ label,
.form-floating-outline > .form-control:focus ~ label,
.form-floating-outline > .form-control:not(:placeholder-shown) ~ label,
.form-floating-outline > .form-control:-webkit-autofill ~ label,
.form-floating-outline > .form-select:focus ~ label,
.form-floating-outline > .form-select:not([value=""]) ~ label,
.form-floating-outline:focus-within > label,
.form-floating:focus-within > label {
  height: auto !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.input-group {
  align-items: stretch !important;
}

.input-group > .form-control,
.input-group > .form-select {
  padding-inline-start: 1rem;
  padding-inline-end: 1rem;
}

.input-group > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 1rem;
}

#search-button:hover,
#search-button:hover i,
#search-button:hover .icon-base,
#search-button:focus i,
#search-button:active i {
  color: #ffffff !important;
}

.input-group-text {
  padding-inline: 1rem;
  background-color: var(--bs-light-bg-subtle);
  border-color: var(--bs-border-color);
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
}

.input-group-merge .input-group-text + .form-control {
  padding-inline-start: 0.75rem;
}

.table > thead > tr > th {
  background: var(--bs-light-bg-subtle);
  color: var(--bs-heading-color);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.875rem 1.25rem;
}

.table > tbody > tr > td {
  font-size: 0.875rem;
  vertical-align: middle;
  padding: 0.875rem 1.25rem;
}

.table-hover > tbody > tr:hover > * {
  --bs-table-accent-bg: var(--bs-primary-bg-subtle);
  background-color: var(--bs-primary-bg-subtle);
}

/* Legacy `bgcolor="#e5e5e5"` empty state cells. */
.table td[bgcolor] {
  background-color: var(--bs-light-bg-subtle) !important;
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
}

.pagination .page-link {
  border-radius: 0.375rem;
}

.badge {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ===========================================================================
   7. LOGIN / FRONT PAGES
   =========================================================================== */

.nj-auth {
  /* Grid rather than flex centring: when the panel is taller than the viewport
     the row simply grows instead of clipping the top of the content. */
  display: grid;
  min-block-size: 100vh;
  padding-block: 2.5rem;
  padding-inline: 1rem;
  background:
    radial-gradient(48rem 30rem at 12% 0%, rgba(42, 168, 119, 0.16), transparent 62%),
    radial-gradient(42rem 28rem at 92% 100%, rgba(11, 132, 87, 0.14), transparent 62%);
  place-items: center;
}

.nj-auth .card {
  border-color: var(--bs-border-color);
  box-shadow: 0 1.25rem 3rem rgba(var(--nj-ink-rgb), 0.12);
}

.nj-auth .app-brand-text {
  color: var(--bs-heading-color);
}

/* ===========================================================================
   Global Input Floating Label Size Customization
   =========================================================================== */
:root {
  --app-form-label-font-size: 0.70rem;       /* Resting label font size inside input box */
  --app-form-label-floating-size: 0.70rem;   /* Floating label font size when active/focused */
}

.form-floating > label,
.form-floating-outline > label,
.form-floating > .form-control ~ label,
.form-floating > .form-select ~ label,
.form-floating-outline .form-control ~ label,
.form-floating-outline .form-select ~ label {
  font-size: var(--app-form-label-font-size) !important;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label,
.form-floating-outline .form-control:focus ~ label,
.form-floating-outline .form-control:not(:placeholder-shown) ~ label,
.form-floating-outline .form-select:focus ~ label,
.form-floating-outline .form-select:not([value=""]) ~ label,
.form-floating-outline:focus-within > label {
  font-size: var(--app-form-label-floating-size) !important;
}