/* ============================================
   NSP CRM - TWO-PANEL CATEGORY SIDEBAR
   First Panel: Categories | Second Panel: Sub-menus
   ============================================ */

/* ============================================
   CSS Custom Properties - NSP CRM Theme (from old.css)
   ============================================ */

:root {
  /* Site.css existing variables */
  --ss-blue-dark: #0d47a1;
  --ss-blue-primary: #1976d2;
  --ss-blue-light: #e3f2fd;
  --ss-cyan: #17a2b8;
  --ss-green: #28a745;
  --sidebar-icon-strip-width: 60px;
  --sidebar-menu-width: 260px;
  --sidebar-total-width: 320px;
  --sidebar-collapsed-width: 60px;
  --sidebar-header-height: 70px;
  --sidebar-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Primary Blues - Aligned with NSP Logo (from old.css) */
  --nsp-primary-blue: #007AE3;
  --nsp-blue-light: #2196F3;
  --nsp-blue-dark: #0056B3;
  --nsp-tech-cyan: #00BCD4;
  /* Brand Colors (from old.css) */
  --nsp-brand-red: #c62828;
  /* Backgrounds (from old.css) */
  --nsp-bg-white: #ffffff;
  --nsp-bg-light: #F5F7FA;
  --nsp-bg-lighter: #E3F2FD;
  /* Text Colors (from old.css) */
  --nsp-text-primary: #333333;
  --nsp-text-dark: #2c3e50;
  --nsp-text-muted: #6c757d;
  /* Borders (from old.css) */
  --nsp-border-light: #ddd;
  --nsp-border-medium: #ccc;
  /* Shadows (from old.css) */
  --shadow-sm: 0 1px 3px rgba(0, 122, 227, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 122, 227, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 122, 227, 0.15);
  /* Spacing (from old.css) */
  --spacing-xs: 8px;
  --spacing-sm: 10px;
  --spacing-md: 12px;
  --spacing-lg: 24px;
  /* Typography (from old.css) */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bs-body-font-size: 17px;
}

/* ============================================
   Base Styles
   ============================================ */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* Base Typography (from old.css - adjusted to use existing body font-size) */
:root {
  --bs-body-font-size: var(--bs-body-font-size);
}

body {
  font-family: var(--font-family); /* Use new variable for font stack */
  font-size: 15px; /* Keeping the size from site.css */
}

/* ============================================
   Logo Configuration (from old.css)
   ============================================ */

.s-site-logo-img {
  content: url(/content/logo/logo_black_200_56.png);
  max-height: 50px;
  width: auto;
}

.s-site-login-logo-img {
  content: url(/content/logo/logo_black_200_56.png); /* Keep site.css value for this one */
  max-height: 50px;
  width: auto;
}

.s-site-home-logo-img {
  content: url(/content/logo/logo_black_200_56.png);
  max-height: 50px;
  width: auto;
}

section.content {
  /*   padding:0!important;*/
  background: #fff !important;
}
/* ============================================
   SIDEBAR STRUCTURE
   ============================================ */
.s-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-total-width);
  height: 100vh;
  display: flex;
  z-index: 1000;
  transition: width var(--sidebar-transition);
}

  .s-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
  }

  .s-sidebar.pinned {
    width: var(--sidebar-total-width) !important;
  }

  .s-sidebar.collapsed.hover-expanded {
    width: var(--sidebar-total-width);
  }

/* ============================================
   ICON STRIP - CATEGORIES PANEL (Left)
   ============================================ */
.s-sidebar-icon-strip {
  width: var(--sidebar-icon-strip-width);
  background: linear-gradient(180deg, #1e40af 0%, #1e3a8a 50%, #172554 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 0;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

/* Categories Container */
.s-sidebar-strip-categories {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 15px;
  width: 100%;
  align-items: center;
}

.s-sidebar-strip-icon {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  cursor: pointer;
  transition: all 0.25s ease;
  border-radius: 10px;
  position: relative;
}

  .s-sidebar-strip-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: scale(1.05);
  }

  .s-sidebar-strip-icon.active {
    background: rgba(96, 165, 250, 0.25);
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.4);
  }

/* Notification Badge */
.s-notification-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid #1e3a8a;
}

/* Product Logo */
.s-sidebar-strip-logo {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

  .s-sidebar-strip-logo img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
  }

.s-site-login-logo-img {
  content: url(/content/logo/logo_black_200_56.png);
  max-height: 50px;
  width: auto;
}

/* Vertical Branding Text */
.s-sidebar-strip-branding {
  margin-top: auto;
  margin-bottom: 20px;
  padding: 15px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  min-height: 250px; /* Give it more space */
}

  .s-sidebar-strip-branding img {
    transform: rotate(-90deg); /* scale(1.5); Scale up 1.5x,but changed to 1.0 */
    width: auto;
    height: auto;
    max-height: 160px;
    opacity: 0.85;
  }

@media (max-height: 768px) {
  .s-sidebar-strip-branding {
    min-height: 180px;
  }

    .s-sidebar-strip-branding img {
      max-height: 140px;
    }
}

/* For very tall screens */
@media (min-height: 1080px) {
  .s-sidebar-strip-branding img {
    max-height: 200px;
  }
}

/* Bottom Icons Group */
.s-sidebar-strip-bottom {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Single Toggle Button */
.s-sidebar-strip-toggle {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

  .s-sidebar-strip-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
  }

/* Pinned state - show thumbtack */
.s-sidebar.pinned .s-sidebar-strip-toggle i {
  display: none;
}

.s-sidebar.pinned .s-sidebar-strip-toggle::before {
  content: '\f08d';
  font-family: 'Font Awesome 5 Free', 'Font Awesome 6 Free';
  font-weight: 900;
  color: #fff;/*#60a5fa;*/
  font-size: 18px;
}

.s-sidebar.pinned .s-sidebar-strip-toggle {
  background: rgba(96, 165, 250, 0.2);
  border-color: rgba(96, 165, 250, 0.3);
}

/* Collapsed state - ensure icon shows properly */
.s-sidebar.collapsed:not(.pinned) .s-sidebar-strip-toggle i {
  display: flex !important;
  font-family: 'Font Awesome 5 Free', 'Font Awesome 6 Free';
  font-weight: 900;
}

/* Tooltips */
.s-sidebar.collapsed:not(.hover-expanded) .s-sidebar-strip-icon::after,
.s-sidebar.collapsed:not(.hover-expanded) .s-sidebar-strip-toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 65px;
  background: #1e293b;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.s-sidebar.collapsed:not(.hover-expanded) .s-sidebar-strip-icon:hover::after,
.s-sidebar.collapsed:not(.hover-expanded) .s-sidebar-strip-toggle:hover::after {
  opacity: 1;
}

/* ============================================
   MENU AREA - SUB-MENUS PANEL (Right)
   ============================================ */
.s-sidebar-menu-area {
  width: var(--sidebar-menu-width);
  background: white;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  transition: width var(--sidebar-transition), opacity var(--sidebar-transition);
  overflow: hidden;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.s-sidebar.collapsed .s-sidebar-menu-area {
  width: 0;
  opacity: 0;
}

.s-sidebar.collapsed.hover-expanded .s-sidebar-menu-area,
.s-sidebar.pinned .s-sidebar-menu-area {
  width: var(--sidebar-menu-width);
  opacity: 1;
}

/* ============================================
   Search Box
   ============================================ */
.s-sidebar-search-box {
  padding: 20px 15px 15px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.s-sidebar-search-wrapper {
  position: relative;
}

.s-sidebar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 15px;
  pointer-events: none;
}

.s-sidebar-search-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  background: #f9fafb;
  transition: all 0.2s ease;
  outline: none;
}

  .s-sidebar-search-input:focus {
    border-color: var(--ss-blue-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
    transform: translateY(-1px); /* ADD THIS - subtle lift */
  }

  .s-sidebar-search-input::placeholder {
    color: #9ca3af;
  }

/* ============================================
   Category Content Area
   ============================================ */
.s-sidebar-category-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.s-category-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  opacity: 0;
  transition: opacity 0.2s ease;
}

  .s-category-panel.active {
    display: flex;
    opacity: 1;
  }

/* Category Header */
.s-category-header {
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 700;
  color: #1e40af;
  border-left: 5px solid var(--ss-blue-primary);
  border-bottom: 1px solid #dbeafe;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #e5e7eb 0%, #f0f1f3 50%, #f9fafb 100%);
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
}

  .s-category-header i {
    font-size: 20px;
  }
/* ============================================
   Navigation
   ============================================ */
.s-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 15px 0;
  scrollbar-width: thin; /* ADD THIS - Firefox support */
  scrollbar-color: #e5e7eb transparent; /* ADD THIS - Firefox support */
}

  .s-sidebar-nav::-webkit-scrollbar {
    width: 6px;
  }

  .s-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
  }

  .s-sidebar-nav::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 3px;
  }

    .s-sidebar-nav::-webkit-scrollbar-thumb:hover {
      background: #d1d5db;
    }

/* Menu Structure */
.s-sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.s-sidebar-item {
  list-style: none;
}

/* Empty state */
.s-sidebar-empty {
  padding: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

/* Menu Links */
.s-sidebar-link {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #374151;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 14.5px;
  position: relative;
  font-weight: 400;
  border-left: 3px solid transparent;
  margin: 2px 0;
  border-radius: 0 8px 8px 0;
}

  .s-sidebar-link:hover {
    background: var(--ss-blue-light);
    color: var(--ss-blue-primary);
    text-decoration: none;
    padding-left: 24px;
    border-left-color: #93c5fd;
    transform: translateX(2px); /* ADD THIS - subtle slide right */
  }
/* Active state */
.s-sidebar-item.active > .s-sidebar-link {
  background: var(--ss-blue-light);
  color: var(--ss-blue-primary);
  font-weight: 500;
  border-left: 3px solid var(--ss-blue-primary);
  padding-left: 17px;
  box-shadow: inset 3px 0 0 var(--ss-blue-primary), 0 1px 3px rgba(25, 118, 210, 0.1); /* ADD THIS */
}

/* Icons */
.s-sidebar-icon {
  font-size: 18px;
  min-width: 28px;
  width: 28px;
  margin-right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.s-sidebar-link:hover .s-sidebar-icon {
  transform: scale(1.1); /* ADD THIS */
  transition: all 0.2s ease; /* ADD THIS */
}

.s-sidebar-link:hover .s-sidebar-icon,
.s-sidebar-item.active > .s-sidebar-link .s-sidebar-icon {
  color: var(--ss-blue-primary);
}

.s-sidebar-link-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* NEW Badge */
.s-sidebar-badge {
  display: inline-block;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  color: white;
  background: var(--ss-green);
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: 8px;
  letter-spacing: 0.3px;
  animation: pulse 2s ease-in-out infinite; /* ADD THIS */
}

/* ADD THIS NEW ANIMATION */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

/* Expand Arrow */
.s-sidebar-menu-toggle {
  margin-left: auto;
  font-size: 16px;
  color: #9ca3af;
  transition: transform 0.3s ease, color 0.2s ease;
  flex-shrink: 0;
}

.s-sidebar-link:hover .s-sidebar-menu-toggle {
  color: var(--ss-blue-primary);
}

.s-sidebar-link[aria-expanded="true"] .s-sidebar-menu-toggle {
  transform: rotate(90deg);
  color: var(--ss-blue-primary);
}

/* Submenus */
.s-sidebar-menu .s-sidebar-menu {
  background: #f9fafb;
  border-left: 2px solid var(--ss-blue-light);
  margin-left: 20px;
  position: relative; /* ADD THIS */
}

  /* ADD THIS NEW RULE */
  .s-sidebar-menu .s-sidebar-menu::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--ss-blue-primary) 0%, var(--ss-blue-light) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .s-sidebar-menu .s-sidebar-menu:hover::before {
    opacity: 1;
  }

  .s-sidebar-menu .s-sidebar-menu .s-sidebar-link {
    padding: 10px 20px 10px 30px;
    font-size: 14px;
  }

  .s-sidebar-menu .s-sidebar-menu .s-sidebar-icon {
    font-size: 16px;
    min-width: 24px;
    width: 24px;
  }

/* Collapse transitions */
.s-sidebar-menu.collapse {
  transition: height 0.35s ease;
}

/* ============================================
   HEADER
   ============================================ */
.s-sidebar-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-total-width);
  right: 0;
  height: var(--sidebar-header-height);
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border-bottom: 1px solid #e5e7eb;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 999;
  transition: left var(--sidebar-transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.s-sidebar.collapsed ~ .s-sidebar-header {
  left: var(--sidebar-collapsed-width);
}

.s-sidebar.pinned ~ .s-sidebar-header {
  left: var(--sidebar-total-width);
}

.s-sidebar-header-title {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
}

.s-sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.s-main {
  margin-left: var(--sidebar-total-width);
  /*margin-top: var(--sidebar-header-height);*/
  padding: 30px;
  transition: margin-left var(--sidebar-transition);
  min-height: calc(100vh - var(--sidebar-header-height));
  background: #f5f7fa;
}

.s-sidebar.collapsed ~ .s-main {
  margin-left: var(--sidebar-collapsed-width);
}

.s-sidebar.pinned ~ .s-main {
  margin-left: var(--sidebar-total-width);
}

/* ============================================
   DROPDOWN MENUS (Language, Profile)
   ============================================ */
.s-sidebar-dropdown-menu {
  min-width: 200px;
  margin-left: 10px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.s-user-profile-menu {
  min-width: 250px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: #374151;
  transition: all 0.2s ease;
}

  .dropdown-item:hover {
    background: #f3f4f6;
    color: #1976d2;
  }

  .dropdown-item i {
    width: 20px;
    color: #6b7280;
  }

  .dropdown-item:hover i {
    color: #1976d2;
  }

/* ============================================
   Dashboard Cards (from old.css)
   ============================================ */

.s-dashboard-card-sm .card-body {
  background: linear-gradient(135deg, rgba(0, 122, 227, 0.15) 0%, rgba(33, 150, 243, 0.08) 100%);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

  .s-dashboard-card-sm .card-body:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }

.s-dashboard-card-sm .icon {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  top: 13px;
  color: var(--nsp-primary-blue) !important;
  right: 10px;
  font-size: 64px;
  opacity: 0.3;
}

.s-dashboard-card-sm:hover .icon {
  opacity: 0.5;
  transform: scale(1.1) rotate(5deg);
}


/* ============================================
   Form Title Logo (from old.css)
   ============================================ */

.s-form-title-logo {
  background: var(--nsp-bg-white);
  border-radius: 8px;
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

/* ============================================
   Form Layouts (from old.css)
   ============================================ */

.wide-labels .caption {
  min-width: 200px;
  text-wrap: wrap;
  font-weight: 500;
  color: var(--nsp-text-dark);
}

.wide-labels .editor {
  margin-left: var(--spacing-md);
}

/* ============================================
   Translation Grid (from old.css)
   ============================================ */

.s-TranslationGrid input.custom-text {
  width: 100%;
  height: 23px;
  padding: 0 3px;
  border: 1px solid var(--nsp-border-light);
  border-radius: 4px;
  transition: border-color 0.3s ease;
}

  .s-TranslationGrid input.custom-text:focus {
    border-color: var(--nsp-primary-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 122, 227, 0.1);
  }

/* ============================================
   Permission Check Editor (from old.css)
   ============================================ */

.s-PermissionCheckEditor {
  min-height: 450px;
  border: 1px solid var(--nsp-border-light);
  border-radius: 8px;
  padding: 15px;
  background: var(--nsp-bg-white);
}

/* ============================================
   RTL Support for Arabic/Hebrew (from old.css, adjusted)
   ============================================ */

/* RTL Body */
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
  font-family: var(--font-family);
}

/* LTR Body */
html[dir="ltr"] body {
  direction: ltr;
  text-align: left;
  font-family: var(--font-family);
}

/* Margin Auto - RTL */
html[dir="rtl"] .ms-auto {
  margin-right: auto !important;
  margin-left: 0 !important;
}

/* Dashboard Card Icon - RTL (assuming default is LTR, so only RTL is needed) */
html[dir="rtl"] .s-dashboard-card-sm .icon {
  right: auto;
  left: 10px;
}

/* Content Header - RTL */
html[dir="rtl"] .content-header {
  text-align: right;
}

html[dir="ltr"] .content-header {
  text-align: left;
}

/* Page Container - RTL */
html[dir="rtl"] .page-container-common {
  direction: rtl;
}

html[dir="ltr"] .page-container-common {
  direction: ltr;
}

/* Sidebar Link Hover - RTL (keeping the general sidebar structure of site.css) */
html[dir="rtl"] .s-sidebar-link:hover {
  transform: translateX(-2px); /* Reversing the subtle slide right from site.css */
}

/* Filter Display Bar - RTL */
html[dir="rtl"] .s-FilterDisplayBar .edit {
  margin-left: 0;
  margin-right: auto;
  order: 3;
  line-height: 1.4rem;
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* Dropdown Menu - RTL */
html[dir="rtl"] .dropdown-menu-end[data-bs-popper] {
  left: 0;
  right: auto;
}

/* Dropdown Items - RTL */
html[dir="rtl"] .dropdown-item {
  text-align: right;
}

/* ============================================
   Responsive Design (from old.css, adjusted for mobile/tablet rules)
   ============================================ */

/* Tablet and Below */
@media (max-width: 768px) {
  .wide-labels .caption {
    min-width: 120px;
    max-width: 240px;
  }

  .s-sidebar-icon {
    font-size: 22px;
  }

  .s-sidebar-link {
    font-size: 15px;
  }

  .s-dashboard-card-sm .icon {
    font-size: 48px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  :root {
    --bs-body-font-size: 15px;
  }

  .s-sidebar-icon {
    font-size: 20px;
  }

  .s-sidebar-link {
    font-size: 14px;
    padding: 8px 12px;
  }

  .wide-labels .caption {
    min-width: 100%;
  }

  .wide-labels .editor {
    margin-left: 0;
    margin-top: var(--spacing-xs);
  }
}

/* ============================================
   Accessibility Enhancements (from old.css)
   ============================================ */

.s-sidebar-link:focus-visible,
.s-sidebar-header-link:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 3px solid var(--nsp-primary-blue);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .s-sidebar,
  .s-sidebar-header,
  .s-mobile-toggle {
    display: none;
  }

  .s-main {
    margin-left: 0 !important;
    margin-top: 0 !important;
  }

  /* From old.css */
  .s-dashboard-card-sm .card-body {
    background: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ============================================
   Dark Mode Support (Future Ready) (from old.css, adjusted for site.css classes)
   ============================================ */

@media (prefers-color-scheme: dark) {
  :root {
    --nsp-bg-white: #1a1a1a;
    --nsp-bg-light: #2d2d2d;
    --nsp-bg-lighter: #1e3a52;
    --nsp-text-primary: #e0e0e0;
    --nsp-text-dark: #ffffff;
    --nsp-border-light: #404040;
    --nsp-primary-blue: #4A9EFF;
    /* Site.css blue primary for dark mode */
    --ss-blue-primary: #4A9EFF;
    --ss-blue-light: #1e3a52;
  }

  /* Adjust sidebar menu area to match dark background */
  .s-sidebar-menu-area {
    background: var(--nsp-bg-white);
    border-right-color: var(--nsp-border-light);
  }

  .s-sidebar-search-input {
    background: var(--nsp-bg-light);
    color: var(--nsp-text-primary);
    border-color: var(--nsp-border-light);
  }

  .s-sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--nsp-border-light);
  }

  .s-sidebar-link {
    color: var(--nsp-text-primary);
  }

    .s-sidebar-link:hover {
      background: var(--ss-blue-light);
    }

  .s-sidebar-item.active > .s-sidebar-link {
    background: var(--ss-blue-light);
    color: var(--nsp-text-dark);
  }

  .s-sidebar-menu .s-sidebar-menu {
    background: var(--nsp-bg-light);
    border-left-color: var(--ss-blue-light);
  }

  .s-category-header {
    background: linear-gradient(90deg, #1e3a52 0%, #2d2d2d 50%, #1a1a1a 100%);
    color: var(--nsp-text-dark);
    border-bottom-color: var(--nsp-border-light);
  }

  .s-main {
    background: #121212;
  }

  .s-sidebar-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-bottom-color: var(--nsp-border-light);
  }

  .s-sidebar-header-title {
    color: var(--nsp-text-dark);
  }
}

/* ============================================
   Custom Scrollbar for Webkit Browsers (from old.css, for general content)
   ============================================ */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--nsp-bg-light);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--nsp-primary-blue) 0%, var(--nsp-blue-light) 100%);
  border-radius: 5px;
}

  ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--nsp-blue-dark) 0%, var(--nsp-primary-blue) 100%);
  }

/* ============================================
   Loading States (from old.css)
   ============================================ */

.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

  .loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--nsp-primary-blue);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   Tech Circuit Decorative Elements (from old.css)
   ============================================ */

.tech-decoration {
  position: relative;
}

  .tech-decoration::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--nsp-primary-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--nsp-primary-blue);
  }

/* ============================================
   Utility Classes (from old.css)
   ============================================ */

.text-nsp-blue {
  color: var(--nsp-primary-blue) !important;
}

.bg-nsp-blue {
  background: var(--nsp-primary-blue) !important;
}

.bg-nsp-gradient {
  background: linear-gradient(135deg, var(--nsp-primary-blue) 0%, var(--nsp-tech-cyan) 100%) !important;
}

.border-nsp-blue {
  border-color: var(--nsp-primary-blue) !important;
}

.shadow-nsp {
  box-shadow: var(--shadow-md) !important;
}

/* ============================================
   Grid Styles (from old.css - Modern Clean Version)
   ============================================ */

/* The two GridDiv blocks are merged and cleaned, prioritizing the 'Ultra Professional Modern Grid' styles but keeping the first definition's box-shadow variable */
/*#GridDiv {
  font-family: "Inter", "Segoe UI", sans-serif;
  background: var(--nsp-bg-white);*/ /* Used variable */
/*color: #1a1a1a;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);*/ /* Used explicit shadow */
/*overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: var(--spacing-sm);*/ /* Kept from first GridDiv */
/*}*/

/* 🧭 Grid Title - clean header */
#GridDiv .grid-title {
  background: none;
  padding: 14px 20px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  letter-spacing: 0.2px;
}

/* 🛠 Toolbar */
/*#GridDiv .grid-toolbar {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
    gap: 12px;
  }*/

/* 🔍 Perfectly aligned Search Bar */
/*#GridDiv .s-QuickSearchBar {
    display: flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 6px 12px;
    width: 280px;
    transition: all 0.25s ease;
  }

    #GridDiv .s-QuickSearchBar:hover {
      border-color: rgba(0, 0, 0, 0.15);
    }*/

/* 🧭 Search Icon */
/*#GridDiv .s-QuickSearchBar .quick-search-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 15px;
      flex-shrink: 0;
    }

      #GridDiv .s-QuickSearchBar .quick-search-icon i {
        color: #6b7280;
        font-size: 16px;
        line-height: 1;
      }*/

/* ✏️ Input perfectly aligned */
/*#GridDiv .s-QuickSearchBar input {
      border: none;
      width: 100%;
      font-size: 14px;
      outline: none;
      color: #111827;
    }*/

/* 🎛 Tool Buttons - elegant professional look */
/*#GridDiv .grid-toolbar .tool-button {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #0f172a;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
  }

    #GridDiv .grid-toolbar .tool-button:hover {
      background: #f3f4f6;
      border-color: rgba(0, 0, 0, 0.15);
      transform: translateY(-1px);
    }

    #GridDiv .grid-toolbar .tool-button i {
      font-size: 15px;
      color: #2563eb;
    }*/

/* 🧩 Optional - Keep search + buttons aligned on one line even if wide */
/*#GridDiv .grid-toolbar > * {
    flex-shrink: 0;
  }

  #GridDiv .grid-toolbar .left-tools,
  #GridDiv .grid-toolbar .right-tools {
    display: flex;
    align-items: center;
    gap: 10px;
  }*/

/* 📋 Header */
#GridDiv .slick-header {
  background: #f9fafb;
  color: #374151;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

#GridDiv .slick-header-column {
  padding: 12px 14px;
  border: none !important;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* 🧾 Rows */
#GridDiv .slick-row {
  font-size: 14px;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  min-height: 44px;
}

  #GridDiv .slick-row.even {
    background: #ffffff;
  }

  #GridDiv .slick-row.odd {
    background: #fdfdfd;
  }

  #GridDiv .slick-row:hover {
    background: #f0f7ff;
    box-shadow: inset 3px 0 0 #2563eb;
  }

/* 🧩 Cells */
#GridDiv .slick-cell {
  border: none !important;
  padding: 12px 14px;
  vertical-align: middle !important;
  display: flex;
  align-items: center;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 🔗 Edit Links */
#GridDiv .s-EditLink {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

  #GridDiv .s-EditLink:hover {
    color: #1d4ed8;
    text-decoration: underline;
  }

/* 📊 Pager */
#GridDiv .slick-pg {
  background: #f9fafb;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 12px 16px;
  color: #6b7280;
  font-size: 14px;
}

  #GridDiv .slick-pg input,
  #GridDiv .slick-pg select {
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    border-radius: 6px;
    padding: 5px 8px;
    transition: border-color 0.2s;
  }

    #GridDiv .slick-pg input:focus,
    #GridDiv .slick-pg select:focus {
      border-color: #2563eb;
      outline: none;
    }

/* 🖱 Scrollbar */
#GridDiv .slick-viewport::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

#GridDiv .slick-viewport::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

  #GridDiv .slick-viewport::-webkit-scrollbar-thumb:hover {
    background-color: #2563eb;
  }

#GridDiv .slick-viewport::-webkit-scrollbar-track {
  background: transparent;
}


/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
.s-mobile-toggle {
  display: none;
}

@media (max-width: 768px) {
  .s-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-total-width);
  }

    .s-sidebar.mobile-open {
      transform: translateX(0);
    }

    .s-sidebar.collapsed {
      transform: translateX(-100%);
      width: var(--sidebar-total-width);
    }

      .s-sidebar.collapsed.mobile-open {
        transform: translateX(0);
      }

    .s-sidebar.mobile-open .s-sidebar-menu-area {
      width: var(--sidebar-menu-width);
      opacity: 1;
      /*z-index: 1050;*/ /* ← ADD THIS LINE */
    }

  .s-sidebar-header {
    left: 0 !important;
  }

  .s-main {
    margin-left: 0 !important;
    padding: 5px !important;
  }

  /* Mobile toggle button */
  .s-mobile-toggle {
    display: flex;
    position: fixed;
    top: 15px;
    left: 15px;
    /*z-index: 1001;*/
    z-index: 999;
    width: 45px;
    height: 45px;
    background: var(--ss-blue-dark);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
  }

    .s-mobile-toggle:hover {
      background: var(--ss-blue-primary);
      transform: scale(1.05);
    }

  .s-sidebar.mobile-open ~ .s-mobile-toggle {
    left: calc(var(--sidebar-total-width) + 15px);
  }

  /* No tooltips on mobile */
  .s-sidebar-strip-icon::after,
  .s-sidebar-strip-toggle::after {
    display: none !important;
  }

  /* No hover expansion on mobile */
  .s-sidebar.collapsed.hover-expanded {
    width: var(--sidebar-collapsed-width);
  }

    .s-sidebar.collapsed.hover-expanded .s-sidebar-menu-area {
      width: 0;
      opacity: 0;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .s-sidebar,
  .s-sidebar-header,
  .s-mobile-toggle {
    display: none;
  }

  .s-main {
    margin-left: 0 !important;
    margin-top: 0 !important;
  }
}
/* Ensure sidebar is visible on desktop resolutions above 768px */
@media (min-width: 769px) {
  .s-sidebar {
    transform: translateX(0) !important;
  }
  
  /* Hide mobile toggle on desktop */
  .s-mobile-toggle {
    display: none !important;
  }
  
  /* Ensure proper width when not collapsed */
  .s-sidebar:not(.collapsed) {
    width: var(--sidebar-total-width);
  }
  
  /* Ensure menu area is visible when not collapsed */
  .s-sidebar:not(.collapsed) .s-sidebar-menu-area {
    width: var(--sidebar-menu-width);
    opacity: 1;
  }
}

/* Tablet breakpoint adjustment - handle medium screens better */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Optionally reduce sidebar width slightly for medium screens */
  :root {
    --sidebar-menu-width: 240px;
    --sidebar-total-width: 300px;
  }
  
  .s-main {
    padding: 20px;
  }
}

/* Additional fix: Prevent sidebar from being hidden on page load */
.s-sidebar {
  visibility: visible !important;
}

/* Fix for when sidebar state restoration might fail */
@media (min-width: 769px) {
  body:not(.mobile-view) .s-sidebar {
    display: flex !important;
    transform: translateX(0) !important;
  }
}

@media (max-width: 767px) {
  #GridDiv .grid-title {
    padding: 8px 10px !important;
    padding-left: 52px !important;
    font-size: 16px !important;
  }

  /*.toggle-button,
  .menu-toggle,
  .sidebar-toggle {
    left: 10px !important;
    width: 36px !important;
    height: 36px !important;
  }*/
}