/* ============================================
   CRM Sidebar - Professional & Minimal Design
   Inspired by clean, modern admin interfaces
   ============================================ */

/* ---------- Layout: Sidebar Left, Header in Content Area (No Overlap) ---------- */
body.admin {
  overflow-x: hidden;
}
@media (min-width: 769px) {
  body.admin:not(.mobile) {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "sidebar header"
      "sidebar content";
    min-height: 100vh;
  }
  body.admin:not(.mobile) #menu,
  body.admin:not(.mobile) .sidebar,
  body.admin:not(.mobile) aside#menu {
    grid-area: sidebar;
    position: relative !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    height: 100vh;
    overflow-y: auto;
  }
  body.admin:not(.mobile) #header {
    grid-area: header;
    margin-left: 0 !important;
    margin-right: 0 !important;
    min-width: 0;
  }
  body.admin:not(.mobile) #wrapper {
    grid-area: content;
    margin-left: 0 !important;
    margin-right: 0 !important;
    min-width: 0;
    overflow-x: hidden;
  }
}
body.admin.hide-sidebar:not(.show-sidebar) {
  grid-template-columns: 1fr;
  grid-template-areas:
    "header"
    "content";
}
body.admin.hide-sidebar:not(.show-sidebar) #menu {
  display: none;
}
body.admin.page-small:not(.mobile) {
  grid-template-columns: 1fr;
  grid-template-areas:
    "header"
    "content";
}
body.admin.page-small:not(.mobile) #menu {
  display: none;
}
body.admin.page-small.show-sidebar:not(.mobile) {
  grid-template-columns: 260px 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar content";
}
body.admin.page-small.show-sidebar:not(.mobile) #menu {
  display: block;
  grid-area: sidebar;
}

/* ---------- Header Redesign - Professional & Beautiful ---------- */
#header {
  position: relative;
  background: #ffffff !important;
  border-bottom: 1px solid #e5e7eb !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  height: auto !important;
  min-height: 56px !important;
  padding: clamp(8px, 1.5vw, 20px) !important;
  display: flex !important;
  align-items: center !important;
  overflow: visible !important;
}
#header nav {
  width: 100% !important;
  min-height: 56px;
  display: flex !important;
  align-items: center !important;
}
#header .header-inner {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}
#header .header-search {
  flex: 1 1 0;
  min-width: 280px;
  max-width: 360px;
}
#header .header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
  margin-left: auto !important;
  min-width: 0;
}
#header .header-action-item {
  position: relative;
  flex-shrink: 0;
  flex-basis: auto;
  display: flex;
  align-items: center;
}
#header .header-action-item.dropdown {
  width: fit-content;
}
#header .header-action-item.hidden-xs {
  display: none;
}
@media (min-width: 768px) {
  #header .header-action-item.hidden-xs {
    display: block;
  }
}
#header .header-action-item.visible-xs.visible-sm {
  display: none;
}
/* Hide HR Profile "My Profile" icon from header (near QR code) - keep My Profile in dropdown */
#header a.check_in_out_timesheet[href*="hr_profile"],
#header li.dropdown:has(> a.check_in_out_timesheet[href*="hr_profile"]) {
  display: none !important;
}
@media (max-width: 991px) {
  #header .header-action-item.visible-xs.visible-sm {
    display: block;
  }
}
#header .header-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 12px !important;
  border-radius: 8px;
  color: #6b7280;
  transition: color 0.15s ease, background 0.15s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
  background: transparent;
}
#header .header-action-item:not(.header-action-with-label) .header-btn {
  width: 36px !important;
  min-width: 36px !important;
  padding: 0 !important;
}
#header .header-btn:hover {
  color: #111827 !important;
  background: #f3f4f6 !important;
}
#header .header-btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
}
#header .header-btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 6px rgba(79, 70, 229, 0.3);
}
#header .header-icon.lucide-icon,
#header .header-icon.lucide-icon svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0;
}
#header .mobile-navbar.collapse {
  overflow: hidden;
  transition: height 0.2s ease;
}
#header .mobile-navbar.collapse.in {
  overflow: visible;
}
#header .mobile-navbar {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: 100% !important;
  background: #fff !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
  border-radius: 0 0 8px 8px !important;
  border: 1px solid #e5e7eb !important;
  border-top: none !important;
  z-index: 1000 !important;
}
/* ---------- Header Search - Inline Search Bar ---------- */
#header .header-search {
  flex: 1 1 0;
  min-width: 280px;
  max-width: 360px;
}
#header .header-search-wrapper {
  position: relative;
  width: 100%;
  min-width: 280px;
  overflow: visible;
  z-index: 5;
  pointer-events: auto;
}
#header .header-search {
  overflow: visible;
}
#header .header-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 0 12px 0 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  z-index: 5;
  pointer-events: auto;
}
#header .header-search-field .header-search-icon,
#header .header-search-field .header-search-placeholder,
#header .header-search-field .header-search-kbd {
  pointer-events: none;
}
#header .header-search-field.header-search-trigger:hover {
  background: #fff;
  border-color: #cbd5e1;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}
#header .header-search-icon.lucide-icon,
#header .header-search-icon.lucide-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #94a3b8;
}
#header .header-search-placeholder {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #94a3b8;
  text-align: left;
}
#header .header-search-kbd {
  flex-shrink: 0;
  padding: 2px 6px;
  font-size: 11px;
  font-family: inherit;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}
#search_results,
#search-history {
  position: absolute;
  left: 0;
  right: auto;
  top: 100%;
  margin-top: 6px;
  z-index: 99999;
  width: 400px;
  min-width: 400px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
#header .header-search-wrapper {
  overflow: visible !important;
}
#header .header-search {
  overflow: visible !important;
}
#search_results .dropdown-menu,
#search_results .search-results,
#search_results ul {
  display: block !important;
  width: 100% !important;
}
#search_results:not(:empty),
#search-history.display-block {
  visibility: visible !important;
  opacity: 1 !important;
}

/* ---------- Command Palette (Cmd+K) ---------- */
.command-palette {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  animation: commandPaletteFadeIn 0.2s ease-out;
}
.command-palette[hidden] {
  display: none !important;
}
.command-palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.command-palette-dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  animation: commandPaletteSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.command-palette-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
}
.command-palette-search-icon {
  flex-shrink: 0;
  color: #94a3b8;
}
.command-palette-search-icon.lucide-icon,
.command-palette-search-icon.lucide-icon svg {
  width: 20px;
  height: 20px;
}
.command-palette-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0;
  font-size: 16px;
  color: #0f172a;
  background: transparent;
  border: none;
  outline: none;
}
.command-palette-input::placeholder {
  color: #94a3b8;
}
.command-palette-kbd {
  flex-shrink: 0;
  padding: 4px 8px;
  font-size: 11px;
  font-family: inherit;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.command-palette-results,
.command-palette-history {
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 114, 128, 0.4) transparent;
}
.command-palette-results::-webkit-scrollbar,
.command-palette-history::-webkit-scrollbar { width: 6px; }
.command-palette-results::-webkit-scrollbar-track,
.command-palette-history::-webkit-scrollbar-track { background: transparent; }
.command-palette-results::-webkit-scrollbar-thumb,
.command-palette-history::-webkit-scrollbar-thumb { background: rgba(107, 114, 128, 0.25); border-radius: 10px; }
.command-palette-history {
  display: none;
  list-style: none;
  margin: 0;
  padding: 8px;
}
.command-palette-history.visible {
  display: block;
}
.command-palette-history li {
  margin: 0;
}
.command-palette-history li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #334155;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  transition: background 0.15s;
}
.command-palette-history li a:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.command-palette-results {
  padding: 8px;
}
.command-palette-results .dropdown-header {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b !important;
  padding: 8px 14px 4px;
}
.command-palette-results .divider { margin: 4px 0; }
.command-palette-results li a {
  display: block;
  padding: 10px 14px;
  color: #334155;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  transition: background 0.15s;
}
.command-palette-results li a:hover {
  background: #f1f5f9;
  color: #4f46e5;
}
.command-palette-results .search-no-results {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}
@keyframes commandPaletteFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes commandPaletteSlideIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Hook-injected navbar items (e.g. hr_profile, tenant switch) */
#header .header-actions > li,
#header .header-actions li.dropdown {
  list-style: none;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}
#header .header-actions > li > a,
#header .header-actions li.dropdown > a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  color: #6b7280 !important;
  transition: all 0.15s ease;
}
#header .header-actions > li > a:hover,
#header .header-actions li.dropdown > a:hover {
  color: #111827 !important;
  background: #f3f4f6 !important;
}
#header .header-actions li a i.fa {
  font-size: 16px;
}
/* Header action labels - truncate when space is tight, dynamic layout */
#header .header-action-label {
  font-size: clamp(11px, 1.2vw, 13px);
  font-weight: 500;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
/* Todo, Timers, Notifications - icon only (no text label) */
#header .header-todo .header-action-label,
#header .header-timers .header-action-label,
#header .header-notifications .header-action-label {
  display: none !important;
}
#header .header-todo .header-btn,
#header .header-todo a.header-btn,
#header .header-timers .header-btn,
#header .header-timers a.header-btn,
#header .header-notifications .header-btn,
#header .header-notifications a.header-btn,
#header .header-notifications .notifications-icon {
  padding: 0 !important;
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  justify-content: center !important;
  position: relative !important;
  z-index: 1 !important;
  cursor: pointer !important;
}
#header .header-notifications .icon-notifications,
#header .header-notifications .icon-total-indicator,
#header .notifications-trigger-wrap .icon-notifications {
  pointer-events: none !important;
}
#header .header-action-item.notifications-wrapper {
  position: relative;
  z-index: 10;
}
#header .notifications-trigger-wrap {
  display: inline-flex;
  position: relative;
}
@media (max-width: 1280px) {
  #header .header-action-with-label .header-action-label {
    display: none !important;
  }
  #header .header-action-with-label .header-btn,
  #header .header-action-with-label a.header-btn {
    padding: 0 !important;
    width: 36px !important;
    min-width: 36px !important;
    justify-content: center !important;
  }
  #header .header-action-with-label .header-btn-primary {
    width: 36px !important;
    min-width: 36px !important;
  }
}
@media (max-width: 1199px) {
  #header .header-profile .header-profile-info,
  #header .header-profile .header-profile-chevron {
    display: none !important;
  }
  #header .header-profile .header-profile-badge {
    padding: 4px !important;
    border-radius: 50%;
  }
}

/* Header profile badge - attractive pill with name & email */
#header .header-profile-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}
#header .header-profile-badge:hover {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
  border-color: rgba(79, 70, 229, 0.2);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
}
#header .header-profile .header-profile-avatar,
#header .header-profile .staff-profile-image-small {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border-radius: 50% !important;
  object-fit: cover;
  display: block !important;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
#header .header-profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-width: 0;
}
#header .header-profile-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  line-height: 1.2;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#header .header-profile-email {
  font-size: 10px;
  color: #6b7280;
  line-height: 1.2;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#header .header-profile-chevron {
  width: 16px;
  height: 16px;
  color: #6b7280;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
#header .header-profile.open .header-profile-chevron,
#header .header-profile.dropdown.open .header-profile-chevron {
  transform: rotate(180deg);
}
[dir="rtl"] #header .header-profile-info {
  align-items: flex-end;
  text-align: right;
}

/* ---------- Tooltips - Fresh Modern Design ---------- */
.tooltip {
  position: fixed !important;
  z-index: 1080;
  font-family: inherit;
}
.tooltip .tooltip-inner {
  padding: 8px 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  color: #fff !important;
  background: #1e293b !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.06) inset !important;
  max-width: 220px;
  text-align: center;
}
.tooltip .tooltip-arrow {
  border-width: 5px !important;
}
.tooltip.top .tooltip-arrow,
.tooltip.bs-tooltip-top .tooltip-arrow {
  border-top-color: #1e293b !important;
}
.tooltip.bottom .tooltip-arrow,
.tooltip.bs-tooltip-bottom .tooltip-arrow {
  border-bottom-color: #1e293b !important;
}
.tooltip.left .tooltip-arrow,
.tooltip.bs-tooltip-left .tooltip-arrow {
  border-left-color: #1e293b !important;
}
.tooltip.right .tooltip-arrow,
.tooltip.bs-tooltip-right .tooltip-arrow {
  border-right-color: #1e293b !important;
}
.tooltip.in,
.tooltip.show {
  opacity: 1 !important;
}

#header .header-profile {
  position: relative;
  width: fit-content;
}
#header .header-profile .dropdown-menu,
#header .header-profile.dropdown .dropdown-menu.dropdown-profile {
  right: 0 !important;
  left: auto !important;
  min-width: 200px;
  max-width: min(280px, calc(100vw - 24px));
  margin-top: 8px;
  transform-origin: top right;
}
[dir="rtl"] #header .header-profile .dropdown-menu,
[dir="rtl"] #header .header-profile.dropdown .dropdown-menu.dropdown-profile {
  right: auto !important;
  left: 0 !important;
  transform-origin: top left;
}
#header .header-profile .dropdown-header {
  padding: 12px 14px;
  white-space: normal;
}
/* ========== Dropdown Animations - Fresh & Professional ========== */
@keyframes dropdownSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes dropdownItemFade {
  0% {
    opacity: 0;
    transform: translateX(-4px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}
/* Header dropdowns - base */
#header .dropdown-menu {
  border-radius: 14px !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow:
    0 20px 50px -15px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 4px 20px -5px rgba(79, 70, 229, 0.08) !important;
  padding: 10px !important;
  margin-top: 10px !important;
  animation: dropdownSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.98) !important;
}
#header .dropdown-menu li.dropdown-header {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  padding: 10px 14px 6px;
}
#header .dropdown-menu > li > a {
  padding: 12px 14px !important;
  border-radius: 10px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#header .dropdown-menu > li > a:hover {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  transform: translateX(2px);
}
[dir="rtl"] #header .dropdown-menu > li > a:hover {
  transform: translateX(-2px);
}

/* ---------- Quick Create Dropdown ---------- */
#header .dropdown-quick-create {
  min-width: 420px !important;
  max-height: 420px;
  overflow-y: auto;
  padding: 0 !important;
}
#header .dropdown-quick-create .dropdown-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 14px 14px 0 0;
  margin: 0 !important;
  padding: 12px 14px !important;
  border: none !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
  color: #4f46e5 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
}
#header .dropdown-quick-create-grid {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 0 !important;
  border-collapse: collapse;
}
#header .dropdown-quick-create .quick-create-item {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  min-height: 0;
}
#header .dropdown-quick-create .quick-create-item a {
  display: grid !important;
  grid-template-columns: 20px 1fr !important;
  grid-template-rows: 1fr 1fr !important;
  gap: 0 12px !important;
  align-items: center !important;
  height: 52px !important;
  min-height: 52px !important;
  padding: 0 14px !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 1px solid #e5e7eb !important;
  border-right: 1px solid #e5e7eb !important;
  text-decoration: none !important;
  transition: background 0.15s ease;
  box-sizing: border-box !important;
}
#header .dropdown-quick-create .quick-create-item:nth-child(2n) a {
  border-right: none !important;
}
#header .dropdown-quick-create .quick-create-item:last-child a {
  border-bottom: none !important;
}
#header .dropdown-quick-create-grid:has(> .quick-create-item:last-child:nth-child(2n)) > .quick-create-item:nth-last-child(2) a {
  border-bottom: none !important;
}
#header .dropdown-quick-create .quick-create-item a:hover {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%) !important;
}
#header .dropdown-quick-create .quick-create-item a i,
#header .dropdown-quick-create .quick-create-item a .quick-create-icon {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #4f46e5 !important;
  opacity: 0.9;
  flex-shrink: 0 !important;
  font-size: 16px !important;
  transition: opacity 0.2s, color 0.2s;
  grid-row: 1 / -1 !important;
  align-self: center !important;
}
#header .dropdown-quick-create .quick-create-item a:hover i,
#header .dropdown-quick-create .quick-create-item a:hover .quick-create-icon {
  opacity: 1;
  color: #4f46e5 !important;
}
#header .dropdown-quick-create .quick-create-item a .quick-create-name {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  align-self: end;
}
#header .dropdown-quick-create .quick-create-item a .quick-create-subtext {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  align-self: start;
}
#header .dropdown-quick-create .quick-create-name {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #374151 !important;
  line-height: 1.3 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
#header .dropdown-quick-create .quick-create-subtext {
  font-size: 11px !important;
  color: #6b7280 !important;
  line-height: 1.25 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ---------- Profile Dropdown - Compact, No Clipping ---------- */
#header .dropdown-profile {
  min-width: 200px !important;
  padding: 8px !important;
}
#header .dropdown-profile .dropdown-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 8px;
  margin-bottom: 4px;
  padding: 10px 12px !important;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
#header .dropdown-profile .dropdown-header span:first-child {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #111827 !important;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#header .dropdown-profile .dropdown-header span:last-child {
  font-size: 11px !important;
  color: #6b7280 !important;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#header .dropdown-profile .divider,
#top_search_dropdown .divider,
.dropdown-search-panel .divider {
  margin: 6px 0 !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}
#header .dropdown-profile > li > a {
  font-size: 13px;
  padding: 8px 12px !important;
  color: #374151 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px;
  line-height: 1.4;
}
#header .dropdown-profile > li > a:hover {
  color: #4f46e5 !important;
}
#header .dropdown-profile > li > a .lucide-icon,
#header .dropdown-profile > li > a .lucide-icon svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
  vertical-align: middle;
}
#header .dropdown-profile > li > a .lucide-icon {
  color: #6b7280;
  transition: color 0.15s ease;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#header .dropdown-profile > li > a:hover .lucide-icon {
  color: #4f46e5 !important;
}
/* Language submenu - align icon + text + arrow */
#header .dropdown-profile .header-languages > a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px;
}
#header .dropdown-profile .header-languages > a::after {
  margin-top: 0 !important;
  margin-left: auto !important;
  flex-shrink: 0;
}
#header .dropdown-profile .header-languages .dropdown-menu {
  animation: dropdownSlideIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ---------- Search Dropdown (results + history) ---------- */
#top_search #search_results,
#search_results {
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 400px;
  min-width: 400px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  max-height: 360px;
  overflow-y: auto;
  overflow-x: visible;
  animation: dropdownSlideIn 0.2s ease-out forwards;
  background: #fff;
}
#top_search #search_results:empty {
  display: none !important;
}
#top_search #search_results:not(:empty) {
  display: block !important;
}
#top_search #search_results ul,
#search_results ul,
#top_search_dropdown {
  list-style: none;
  margin: 0;
  padding: 8px;
  border: none;
  background: transparent;
  box-shadow: none;
}
#top_search #top_search_dropdown {
  padding: 8px;
}
#top_search .search-results .dropdown-header,
#search_results .dropdown-header,
#top_search_dropdown .dropdown-header {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4f46e5 !important;
  padding: 12px 14px 8px;
  background: linear-gradient(135deg, #fafbff 0%, #f5f3ff 100%);
  border-radius: 8px;
  margin-bottom: 4px;
  border: 1px solid rgba(79, 70, 229, 0.08);
}
#top_search .search-results li a,
#search_results li a,
#top_search_dropdown li a {
  padding: 12px 14px !important;
  border-radius: 10px !important;
  display: block;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#top_search .search-results li a:hover,
#search_results li a:hover,
#top_search_dropdown li a:hover {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%) !important;
  transform: translateX(4px);
  color: #4f46e5 !important;
}
[dir="rtl"] #top_search .search-results li a:hover,
[dir="rtl"] #search_results li a:hover,
[dir="rtl"] #top_search_dropdown li a:hover {
  transform: translateX(-4px);
}
.header-search-history.search-history.dropdown-search-panel,
#search-history.dropdown-search-panel {
  display: none;
  list-style: none;
  margin: 0;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  max-height: 300px;
  overflow-y: auto;
  animation: dropdownSlideIn 0.2s ease-out forwards;
  background: #fff;
}
.header-search-history.display-block,
#search-history.display-block {
  display: block !important;
}
#search-history li a,
.header-search-history li a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  transition: all 0.2s ease;
}
#search-history li a:hover,
.header-search-history li a:hover {
  background: #f3f4f6;
  color: #4f46e5;
}
/* ---------- Notifications Dropdown - Redesigned ---------- */
#header .dropdown-menu.dropdown-notifications,
#header .dropdown-menu.notifications,
.navbar-nav .dropdown-menu.notifications,
.dropdown-menu.notifications.width400 {
  width: 360px !important;
  max-width: 360px !important;
  max-height: 400px !important;
  overflow-y: auto !important;
  padding: 0 !important;
  flex-direction: column !important;
  display: none !important;
}
/* Only show when open - prevents "open by default" */
.notifications-wrapper.open .dropdown-menu.notifications,
.notifications-wrapper.dropdown.open .dropdown-menu.notifications {
  display: flex !important;
}
/* Align right edge with trigger to avoid clipping off viewport */
.notifications-wrapper .dropdown-menu.notifications,
#header .header-notifications .dropdown-menu.notifications {
  right: 0 !important;
  left: auto !important;
}
.dropdown-notifications-header {
  flex-shrink: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}
.dropdown-notifications-header .dropdown-notifications-mark-all {
  display: block;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #4f46e5 !important;
  text-decoration: none !important;
  text-align: right;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 14px 14px 0 0;
  transition: background 0.15s, color 0.15s;
}
.dropdown-notifications-header .dropdown-notifications-mark-all:hover {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
  color: #4338ca !important;
}
.dropdown-notifications-header + .divider {
  margin: 0 !important;
}
.dropdown-menu.notifications .notification-wrapper {
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
.dropdown-menu.notifications .notification-wrapper .notification-handler {
  display: block !important;
  padding: 12px 14px !important;
  text-decoration: none !important;
  color: inherit !important;
  border-radius: 0 !important;
  transition: background 0.15s ease;
}
.dropdown-menu.notifications .notification-wrapper .notification-handler:hover {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
}
.dropdown-menu.notifications .notification-handler.unread-notification {
  background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
}
.dropdown-menu.notifications .notification-handler.unread-notification:hover {
  background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%) !important;
}
.dropdown-menu.notifications .notification-box {
  display: flex !important;
  gap: 12px;
  padding: 0 !important;
  align-items: flex-start;
}
.dropdown-menu.notifications .notification-image,
.dropdown-menu.notifications .notification-box img {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 10px !important;
  object-fit: cover;
  margin: 0 !important;
  flex-shrink: 0;
}
.dropdown-menu.notifications .media-body {
  flex: 1;
  min-width: 0;
  font-size: 13px !important;
  line-height: 1.4;
}
.dropdown-menu.notifications .notification-title {
  display: block;
  color: #374151;
  margin-bottom: 4px;
}
.dropdown-menu.notifications .notification-title br {
  display: none;
}
.dropdown-menu.notifications .notification-date {
  font-size: 11px !important;
  color: #9ca3af !important;
}
.dropdown-menu.notifications .notification-wrapper .not-mark-as-read-inline {
  position: absolute !important;
  top: 14px;
  right: 14px;
  padding: 4px !important;
  color: #4f46e5 !important;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.dropdown-menu.notifications .notification-wrapper .not-mark-as-read-inline:hover {
  opacity: 1;
  color: #4338ca !important;
}
.dropdown-menu.notifications .notification-unread-dot.lucide-icon,
.dropdown-menu.notifications .notification-unread-dot.lucide-icon svg {
  width: 12px !important;
  height: 12px !important;
  fill: currentColor;
}
.dropdown-menu.notifications .divider-notification {
  margin: 0 !important;
  height: 1px;
  background: rgba(0, 0, 0, 0.06) !important;
  border: none !important;
}
.dropdown-notifications-footer {
  flex-shrink: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-radius: 0 0 14px 14px !important;
}
.dropdown-notifications-footer .dropdown-notifications-view-all {
  display: block;
  padding: 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: #4f46e5 !important;
  text-decoration: none !important;
  background: none !important;
  border: none !important;
  border-radius: 0 0 14px 14px;
  transition: background 0.15s, color 0.15s;
}
.dropdown-notifications-footer .dropdown-notifications-view-all:hover {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
  color: #4338ca !important;
}
.dropdown-notifications-empty {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280 !important;
}
.dropdown-notifications-empty .lucide-icon,
.dropdown-notifications-empty .lucide-icon svg {
  width: 20px !important;
  height: 20px !important;
  color: #9ca3af;
}
/* Timers dropdown */
.started-timers-top {
  border-radius: 12px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15) !important;
}
/* ---------- Sidebar Container ---------- */
.sidebar.sidebar-minimal {
  width: 260px !important;
  background: #ffffff !important;
  border-right: 1px solid #e5e7eb !important;
  padding: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-shadow: 1px 0 0 0 rgba(0, 0, 0, 0.04);
}

[dir="rtl"] .sidebar.sidebar-minimal {
  border-right: 0 !important;
  border-left: 1px solid #e5e7eb !important;
  box-shadow: -1px 0 0 0 rgba(0, 0, 0, 0.04);
}

/* ---------- Sidebar Header (Logo + Company) ---------- */
.sidebar-minimal .sidebar-header {
  padding: 20px 16px 16px;
  flex-shrink: 0;
}

.sidebar-minimal .sidebar-logo-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
}

.sidebar-minimal .sidebar-logo-link:hover {
  opacity: 0.9;
}

.sidebar-minimal .sidebar-logo-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-minimal .sidebar-logo-icon img.sidebar-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.sidebar-minimal .sidebar-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-minimal .sidebar-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.sidebar-minimal .sidebar-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
  line-height: 1.35;
}

/* ---------- Sidebar Divider ---------- */
.sidebar-minimal .sidebar-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 0 12px 12px;
}

/* ---------- Global Scrollbar - Same as sidebar everywhere ---------- */
.sidebar.sidebar-minimal,
.sidebar-minimal .sidebar-nav,
aside#menu.sidebar-minimal,
.dropdown-menu.notifications,
.dropdown-menu.dropdown-notifications,
.dropdown-quick-create,
.search-history.dropdown-search-panel,
#search-history,
#search_results,
#top_search_dropdown,
.dropdown-search-panel,
.dropdown-menu.width300,
.dropdown-menu.height500,
.started-timers-top,
.header-languages .dropdown-menu,
#header .dropdown-profile .header-languages .dropdown-menu {
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 114, 128, 0.4) transparent;
}
.sidebar.sidebar-minimal::-webkit-scrollbar,
.sidebar-minimal .sidebar-nav::-webkit-scrollbar,
.dropdown-menu.notifications::-webkit-scrollbar,
.dropdown-menu.dropdown-notifications::-webkit-scrollbar,
.dropdown-quick-create::-webkit-scrollbar,
.search-history.dropdown-search-panel::-webkit-scrollbar,
#search-history::-webkit-scrollbar,
#search_results::-webkit-scrollbar,
#top_search_dropdown::-webkit-scrollbar,
.dropdown-menu.width300::-webkit-scrollbar,
.dropdown-menu.height500::-webkit-scrollbar,
.started-timers-top::-webkit-scrollbar,
.header-languages .dropdown-menu::-webkit-scrollbar,
#header .dropdown-profile .header-languages .dropdown-menu::-webkit-scrollbar {
  width: 5px;
}
.sidebar.sidebar-minimal::-webkit-scrollbar-track,
.sidebar-minimal .sidebar-nav::-webkit-scrollbar-track,
.dropdown-menu.notifications::-webkit-scrollbar-track,
.dropdown-menu.dropdown-notifications::-webkit-scrollbar-track,
.dropdown-quick-create::-webkit-scrollbar-track,
.search-history.dropdown-search-panel::-webkit-scrollbar-track,
#search-history::-webkit-scrollbar-track,
#search_results::-webkit-scrollbar-track,
#top_search_dropdown::-webkit-scrollbar-track,
.dropdown-menu.width300::-webkit-scrollbar-track,
.dropdown-menu.height500::-webkit-scrollbar-track,
.started-timers-top::-webkit-scrollbar-track,
.header-languages .dropdown-menu::-webkit-scrollbar-track,
#header .dropdown-profile .header-languages .dropdown-menu::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}
.sidebar.sidebar-minimal::-webkit-scrollbar-thumb,
.sidebar-minimal .sidebar-nav::-webkit-scrollbar-thumb,
.dropdown-menu.notifications::-webkit-scrollbar-thumb,
.dropdown-menu.dropdown-notifications::-webkit-scrollbar-thumb,
.dropdown-quick-create::-webkit-scrollbar-thumb,
.search-history.dropdown-search-panel::-webkit-scrollbar-thumb,
#search-history::-webkit-scrollbar-thumb,
#search_results::-webkit-scrollbar-thumb,
#top_search_dropdown::-webkit-scrollbar-thumb,
.dropdown-menu.width300::-webkit-scrollbar-thumb,
.dropdown-menu.height500::-webkit-scrollbar-thumb,
.started-timers-top::-webkit-scrollbar-thumb,
.header-languages .dropdown-menu::-webkit-scrollbar-thumb,
#header .dropdown-profile .header-languages .dropdown-menu::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.25);
  border-radius: 10px;
}
.sidebar.sidebar-minimal::-webkit-scrollbar-thumb:hover,
.sidebar-minimal .sidebar-nav::-webkit-scrollbar-thumb:hover,
.dropdown-menu.notifications::-webkit-scrollbar-thumb:hover,
.dropdown-menu.dropdown-notifications::-webkit-scrollbar-thumb:hover,
.dropdown-quick-create::-webkit-scrollbar-thumb:hover,
.search-history.dropdown-search-panel::-webkit-scrollbar-thumb:hover,
#search-history::-webkit-scrollbar-thumb:hover,
#search_results::-webkit-scrollbar-thumb:hover,
#top_search_dropdown::-webkit-scrollbar-thumb:hover,
.dropdown-menu.width300::-webkit-scrollbar-thumb:hover,
.dropdown-menu.height500::-webkit-scrollbar-thumb:hover,
.started-timers-top::-webkit-scrollbar-thumb:hover,
.header-languages .dropdown-menu::-webkit-scrollbar-thumb:hover,
#header .dropdown-profile .header-languages .dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.45);
}

/* ---------- Navigation List ---------- */
.sidebar-minimal .sidebar-nav {
  margin-top: 0 !important;
  padding: 6px 12px 16px !important;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 140px);
}

.sidebar-minimal .sidebar-nav > li {
  border-left: none !important;
  border-radius: 8px;
  margin-bottom: 2px;
}

[dir="rtl"] .sidebar-minimal .sidebar-nav > li {
  border-right: none !important;
}

/* ---------- Primary Menu Items ---------- */
.sidebar-minimal .sidebar-nav > li > a {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  color: #374151 !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  border-radius: 10px !important;
  transition: background 0.15s ease, color 0.15s ease !important;
  font-weight: 500 !important;
  margin-top: 0 !important;
  border: none !important;
  border-radius: 8px;
  display: flex !important;
  align-items: center;
  gap: 12px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Lucide icons - rendered as SVG */
.sidebar-minimal .menu-icon.lucide-icon,
.sidebar-minimal .menu-icon.lucide-icon svg {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
  flex-shrink: 0;
  color: inherit;
}

.sidebar-minimal .sidebar-nav > li > a .menu-icon {
  margin-right: 0 !important;
  float: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-minimal .sidebar-nav > li > a .menu-text-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-minimal .sidebar-nav > li > a .menu-text {
  font-size: 14px;
  line-height: 1.3;
}

.sidebar-minimal .sidebar-nav > li > a .menu-subtext {
  font-size: 11px;
  font-weight: 400;
  color: #9ca3af;
  line-height: 1.3;
}

.sidebar-minimal .sidebar-nav > li > a .menu-arrow.lucide-icon,
.sidebar-minimal .sidebar-nav > li > a .menu-arrow.lucide-icon svg {
  width: 16px !important;
  height: 16px !important;
  color: #9ca3af;
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.15s ease;
}

.sidebar-minimal .sidebar-nav > li > a:hover {
  background: #f9fafb !important;
  color: #111827 !important;
}

.sidebar-minimal .sidebar-nav > li > a:hover .menu-icon {
  color: #4b5563 !important;
}

/* ---------- Active Parent Menu ---------- */
.sidebar-minimal .sidebar-nav > li.active > a,
.sidebar-minimal .sidebar-nav > li.active > a .menu-icon {
  color: #4f46e5 !important;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
}

/* Chevron rotates when dropdown expanded */
.sidebar-minimal .sidebar-nav > li.active > a .menu-arrow.lucide-icon {
  transform: rotate(180deg);
}

/* ---------- Second Level (Sub-items) ---------- */
.sidebar-minimal .sidebar-nav .nav-second-level {
  padding: 4px 0 4px 0 !important;
  margin-left: 0 !important;
}

.sidebar-minimal .sidebar-nav > li.active .nav-second-level {
  background: #f8fafc;
  border-radius: 8px;
  margin: 2px 0 6px 0;
  padding: 4px 0 !important;
}

.sidebar-minimal .sidebar-nav .nav-second-level li a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 14px 8px 46px !important;
  color: #4b5563 !important;
  font-size: 13px !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  margin-top: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 6px;
  display: flex !important;
  align-items: center;
  gap: 10px;
}

[dir="rtl"] .sidebar-minimal .sidebar-nav .nav-second-level li a {
  padding: 8px 46px 8px 14px !important;
}

.sidebar-minimal .sidebar-nav .nav-second-level a .menu-icon {
  margin-right: 0 !important;
}

.sidebar-minimal .sidebar-nav .nav-second-level a .menu-icon.lucide-icon,
.sidebar-minimal .sidebar-nav .nav-second-level a .menu-icon.lucide-icon svg {
  width: 18px !important;
  height: 18px !important;
}

.sidebar-minimal .sidebar-nav .nav-second-level a .sub-menu-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.sidebar-minimal .sidebar-nav .nav-second-level a .sub-menu-subtext {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 0;
}

.sidebar-minimal .sidebar-nav .nav-second-level li a:hover {
  color: #111827 !important;
  background: #f3f4f6 !important;
}

.sidebar-minimal .sidebar-nav .nav-second-level li a:hover .menu-icon {
  color: #6b7280 !important;
}

/* ---------- Active Sub-item ---------- */
.sidebar-minimal .sidebar-nav .nav-second-level li.active a,
.sidebar-minimal .sidebar-nav .nav-second-level li.active a .menu-icon {
  color: #4f46e5 !important;
  font-weight: 600 !important;
  background: #e0e7ff !important;
}

/* ---------- Badge styling ---------- */
.sidebar-minimal .sidebar-nav .badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
}

/* ---------- Menu indicator dot (replaces numeric badges) ---------- */
.sidebar-minimal .sidebar-nav .menu-indicator-dot {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: #eab308;
}
.sidebar-minimal .sidebar-nav > li > a {
  position: relative;
}
.sidebar-minimal .sidebar-nav .nav-second-level a {
  position: relative;
}
.sidebar-minimal .sidebar-nav .menu-indicator-dot--sub {
  top: 50%;
  transform: translateY(-50%);
  right: 6px;
}
.sidebar-minimal .sidebar-nav .menu-indicator-dot--warning {
  background-color: #eab308 !important;
}
.sidebar-minimal .sidebar-nav .menu-indicator-dot--info {
  background-color: #3b82f6 !important;
}
.sidebar-minimal .sidebar-nav .menu-indicator-dot--danger {
  background-color: #ef4444 !important;
}
.sidebar-minimal .sidebar-nav .menu-indicator-dot--success {
  background-color: #22c55e !important;
}
#setup-menu-item a {
  position: relative;
}
#setup-menu-item .menu-indicator-dot {
  position: absolute;
  top: 6px;
  right: 8px;
}

/* ---------- User Profile (Bottom) ---------- */
.sidebar-minimal .sidebar-user-profile-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  z-index: 100;
}
.sidebar-minimal .sidebar-user-profile-bottom.dropup .dropdown-menu {
  bottom: 100%;
  top: auto;
  margin-bottom: 6px;
  margin-top: 0;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}
.sidebar-minimal .sidebar-user-profile-bottom .dropdown-menu,
.sidebar-minimal .sidebar-profile-menu {
  min-width: 220px;
  padding: 8px;
  border-radius: 12px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.12);
}
.sidebar-minimal .sidebar-profile-menu .dropdown-header {
  padding: 10px 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 8px;
  margin-bottom: 4px;
}
.sidebar-minimal .sidebar-profile-menu .dropdown-header span:first-child {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}
.sidebar-minimal .sidebar-profile-menu .dropdown-header span:last-child {
  font-size: 11px;
  color: #6b7280;
}
.sidebar-minimal .sidebar-profile-menu .divider {
  margin: 6px 0;
}
.sidebar-minimal .sidebar-profile-menu > li > a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px;
  padding: 8px 12px !important;
  font-size: 13px;
  color: #374151 !important;
  border-radius: 8px;
  transition: all 0.15s ease;
}
.sidebar-minimal .sidebar-profile-menu > li > a:hover {
  background: #f1f5f9 !important;
  color: #4f46e5 !important;
}
.sidebar-minimal .sidebar-profile-menu > li > a .lucide-icon,
.sidebar-minimal .sidebar-profile-menu > li > a .lucide-icon svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
}
.sidebar-minimal .sidebar-profile-menu > li > a .lucide-icon {
  color: #94a3b8;
  transition: color 0.15s ease;
}
.sidebar-minimal .sidebar-profile-menu > li > a:hover .lucide-icon {
  color: #4f46e5 !important;
}
.sidebar-minimal .sidebar-profile-menu .header-languages > a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px;
}
.sidebar-minimal .sidebar-profile-menu .header-languages > a::after {
  display: none !important;
}
.sidebar-minimal .sidebar-profile-menu .header-languages > a .lucide-icon:last-child {
  margin-left: auto;
}
.sidebar-minimal .sidebar-profile-menu .header-languages .dropdown-menu {
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 114, 128, 0.4) transparent;
}
.sidebar-minimal .sidebar-profile-menu .header-languages .dropdown-menu::-webkit-scrollbar { width: 5px; }
.sidebar-minimal .sidebar-profile-menu .header-languages .dropdown-menu::-webkit-scrollbar-track { background: transparent; }
.sidebar-minimal .sidebar-profile-menu .header-languages .dropdown-menu::-webkit-scrollbar-thumb { background: rgba(107, 114, 128, 0.25); border-radius: 10px; }
.sidebar-minimal .sidebar-user-profile-bottom .dropdown-submenu .dropdown-menu {
  left: auto;
  right: 100%;
  top: 0;
  margin-right: 4px;
  margin-left: 0;
}
/* Show language submenu on hover (desktop) and when .open (click/touch) */
.sidebar-minimal .sidebar-user-profile-bottom .dropdown-submenu.header-languages:hover > .dropdown-menu,
.sidebar-minimal .sidebar-user-profile-bottom .dropdown-submenu.header-languages.open > .dropdown-menu {
  display: block;
}
[dir="rtl"] .sidebar-minimal .sidebar-user-profile-bottom .dropdown-submenu .dropdown-menu {
  left: 100%;
  right: auto;
  margin-right: 0;
  margin-left: 4px;
}

.sidebar-minimal .sidebar-user-profile-bottom .profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #374151;
  transition: all 0.15s ease;
}

.sidebar-minimal .sidebar-user-profile-bottom .profile:hover {
  background: #f1f5f9;
}

.sidebar-minimal .sidebar-profile-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-minimal .sidebar-user-profile-bottom .staff-profile-image-small {
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px;
  flex-shrink: 0;
}

.sidebar-minimal .sidebar-profile-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.sidebar-minimal .sidebar-profile-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-minimal .sidebar-profile-email {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nav needs bottom padding for user profile */
.sidebar-minimal .sidebar-nav {
  padding-bottom: 80px !important; /* space for bottom profile */
}

/* ---------- Wrapper - margin handled by grid layout above ---------- */
@media (max-width: 768px) {
  body.admin #wrapper {
    margin-left: 0 !important;
  }
}
[dir="rtl"] body.admin:not(.mobile) {
  grid-template-columns: 1fr 260px;
  grid-template-areas:
    "header sidebar"
    "content sidebar";
}

/* ---------- Setup menu item styling ---------- */
.sidebar-minimal #setup-menu-item a {
  color: #6b7280 !important;
}

.sidebar-minimal #setup-menu-item a:hover {
  color: #374151 !important;
}

/* ---------- Pinned projects ---------- */
.sidebar-minimal .pinned_project a {
  font-size: 13px !important;
}

/* ---------- Customer Profile Page (Client view) ---------- */
/* Layout handled by grid - no extra margin needed */
#wrapper.customer_profile {
  margin-left: 0 !important;
}

.customer_profile .content {
  padding: 25px;
}

/* Client tabs sidebar - match minimal style */
.customer_profile .customer-tabs {
  flex-shrink: 0;
}

.customer_profile .customer-tabs a {
  transition: background-color 0.15s ease, color 0.15s ease;
}

.customer_profile .customer-tabs a:hover {
  background-color: #f9fafb !important;
}

.customer_profile .customer-tabs .tw-bg-neutral-50 {
  background-color: #eef2ff !important;
}

.customer_profile .customer-tabs .tw-text-primary-600 {
  color: #4f46e5 !important;
}

.customer_profile .customer-tabs a .fa,
.customer_profile .customer-tabs a i {
  width: 20px;
  text-align: center;
}

/* Prevent nav-second-level from looking like radio buttons */
.sidebar-minimal .nav-second-level .menu-icon.lucide-icon[data-lucide="file-text"] {
  opacity: 0.85;
}

.sidebar-minimal .nav-second-level .lucide-icon svg {
  stroke-width: 2;
}

/* ============================================
   List Pages Redesign (Leads, Clients, etc.)
   Single source for table, filters, page intro
   ============================================ */

/* ---------- Page background & content area ---------- */
#wrapper {
  background: #f8fafc !important;
  min-height: 100%;
  overflow-x: hidden;
}

#wrapper .content {
  padding: 16px 20px 24px !important;
  min-width: 0;
  overflow-x: hidden;
}

/* ---------- Page intro (leads-overview, similar pattern for other list pages) ---------- */
.leads-overview {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px !important;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.leads-overview h4 {
  font-size: 22px !important;
  font-weight: 600 !important;
  color: #111827 !important;
  letter-spacing: -0.02em;
  margin-bottom: 16px !important;
}

.leads-overview .tw-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Status filter buttons (Warm, Hot, Cold, Customer) */
.leads-overview button[type="button"] {
  padding: 8px 16px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  transition: all 0.15s ease;
  border: 1px solid #e5e7eb !important;
  background: #f9fafb !important;
  color: #374151 !important;
}

.leads-overview button[type="button"]:hover {
  background: #f3f4f6 !important;
  border-color: #d1d5db !important;
  color: #111827 !important;
}

.leads-overview button .tw-font-semibold {
  color: inherit;
}

.leads-overview button span[style*="color"] {
  font-weight: 500;
}

/* Lost leads / junk label */
.leads-overview .label.label-danger {
  padding: 8px 16px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border: none !important;
}

/* ---------- Action buttons row ---------- */
._buttons {
  margin-bottom: 16px !important;
}

._buttons .btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 10px 20px !important;
  font-weight: 500 !important;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
  transition: all 0.2s ease;
}

._buttons .btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
  transform: translateY(-1px);
}

._buttons .btn-default {
  border-radius: 10px !important;
  border: 1px solid #e5e7eb !important;
  background: #ffffff !important;
  color: #4b5563 !important;
  padding: 10px 16px !important;
  transition: all 0.15s ease;
}

._buttons .btn-default:hover {
  background: #f9fafb !important;
  border-color: #d1d5db !important;
  color: #111827 !important;
}

/* ---------- Filter button (app-filters) ---------- */
._buttons .btn-group .btn-default.dropdown-toggle {
  border-radius: 10px !important;
  border: 1px solid #e5e7eb !important;
  background: #ffffff !important;
  padding: 10px 16px !important;
  font-weight: 500 !important;
}

._buttons .btn-group .btn-default.dropdown-toggle.active {
  background: #eef2ff !important;
  border-color: #c7d2fe !important;
  color: #4f46e5 !important;
}

._buttons .btn-group .dropdown-menu {
  border-radius: 12px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15) !important;
  padding: 8px !important;
  margin-top: 6px !important;
}

/* ---------- Panel & table container ---------- */
.panel_s {
  background: #ffffff !important;
  border-radius: 12px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  overflow: hidden;
}

.panel_s .panel-body {
  padding: 0 !important;
}

.panel-table-full {
  padding: 0 !important;
}

.panel-table-full .dataTables_wrapper .table-responsive,
div.dataTables_wrapper .table-responsive {
  border: none !important;
  margin: 0 !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
.panel-table-full .dataTables_wrapper,
div.dataTables_wrapper {
  overflow-x: hidden;
  max-width: 100%;
}

/* ---------- DataTables controls (length, search, export) ---------- */
.panel-table-full .dataTables_wrapper .row:first-child,
div.dataTables_wrapper .row:first-child {
  padding: 16px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  margin: 0 -1px 0 0;
}

.panel-table-full .dataTables_length label,
div.dataTables_wrapper .dataTables_length label {
  font-weight: 500 !important;
  color: #4b5563 !important;
  font-size: 13px !important;
}

.panel-table-full .dataTables_length select,
div.dataTables_wrapper .dataTables_length select {
  border-radius: 8px !important;
  border: 1px solid #e5e7eb !important;
  padding: 6px 28px 6px 12px !important;
  font-size: 13px !important;
  background: #ffffff !important;
}

.panel-table-full .dataTables_filter .input-group,
div.dataTables_wrapper .dataTables_filter .input-group {
  border-radius: 10px !important;
  border: 1px solid #e5e7eb !important;
  overflow: hidden;
  background: #ffffff !important;
}

.panel-table-full .dataTables_filter input,
div.dataTables_wrapper .dataTables_filter input {
  border: none !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
}

.panel-table-full .dataTables_filter .input-group-addon,
div.dataTables_wrapper .dataTables_filter .input-group-addon {
  background: #f9fafb !important;
  border: none !important;
  border-left: 1px solid #e5e7eb !important;
  padding: 10px 14px !important;
  color: #6b7280 !important;
}

div.dataTables_wrapper .dt-buttons .btn-default,
div.dataTables_wrapper .btn-dt-reload {
  border-radius: 8px !important;
  border: 1px solid #e5e7eb !important;
  font-size: 13px !important;
}

/* ---------- Table design ---------- */
.panel-table-full .dataTables_wrapper table.dataTable,
div.dataTables_wrapper table.dataTable {
  border: none !important;
}

.panel-table-full .dataTables_wrapper table thead th,
div.dataTables_wrapper table thead th {
  background: #f9fafb !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280 !important;
  padding: 14px 16px !important;
  border: none !important;
  border-bottom: 1px solid #e5e7eb !important;
  vertical-align: middle !important;
}

.panel-table-full .dataTables_wrapper table tbody td,
div.dataTables_wrapper table tbody td {
  padding: 14px 16px !important;
  font-size: 14px !important;
  color: #374151 !important;
  border: none !important;
  border-bottom: 1px solid #f3f4f6 !important;
  vertical-align: middle !important;
}

.panel-table-full .dataTables_wrapper table tbody tr:hover td,
div.dataTables_wrapper table tbody tr:hover td {
  background: #f9fafb !important;
}

.panel-table-full .dataTables_wrapper table tbody tr.has-row-options:hover .row-options,
div.dataTables_wrapper table tbody tr.has-row-options:hover .row-options {
  opacity: 1;
}

/* ---------- Status dropdown pills (lead status, etc.) ---------- */
.table-leads .dropdown.inline-block .dropdown-toggle,
.table .dropdown.inline-block .dropdown-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  transition: all 0.15s ease;
}

.table-leads .dropdown.inline-block .dropdown-toggle .chevron,
.table .dropdown.inline-block .dropdown-toggle .chevron {
  width: 12px;
  height: 12px;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}
/* Leads page - cleaner dropdown on hover */
.leads-page-fresh .table-leads .dropdown.inline-block .dropdown-toggle:hover,
.leads-page-fresh .table .dropdown.inline-block .dropdown-toggle:hover {
  background: rgba(99, 102, 241, 0.08) !important;
}
.leads-page-fresh .table-leads .dropdown.inline-block .dropdown-toggle:hover .chevron,
.leads-page-fresh .table .dropdown.inline-block .dropdown-toggle:hover .chevron {
  opacity: 0.8;
}

.table-leads .dropdown.inline-block .dropdown-menu,
.table .dropdown.inline-block .dropdown-menu {
  border-radius: 10px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
  padding: 6px !important;
}

.table-leads .dropdown.inline-block .dropdown-menu li a,
.table .dropdown.inline-block .dropdown-menu li a {
  padding: 8px 14px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  transition: background 0.1s ease;
}

.table-leads .dropdown.inline-block .dropdown-menu li a:hover,
.table .dropdown.inline-block .dropdown-menu li a:hover {
  background: #f3f4f6 !important;
}

/* Lead status label (non-dropdown, e.g. locked) */
.table-leads .label.lead-status,
.table .label.lead-status {
  padding: 6px 12px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

/* Lost/Junk labels in table */
.table-leads .label.label-danger,
.table-leads .label.label-warning {
  padding: 6px 12px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
}

/* ---------- Pagination ---------- */
.panel-table-full .dataTables_wrapper .dataTables_info,
div.dataTables_wrapper .dataTables_info {
  font-size: 13px !important;
  color: #6b7280 !important;
  padding: 14px 20px !important;
}

.panel-table-full .dataTables_wrapper .dataTables_paginate,
div.dataTables_wrapper .dataTables_paginate {
  padding: 14px 20px !important;
}

.panel-table-full .dataTables_wrapper .dataTables_paginate .pagination,
div.dataTables_wrapper .dataTables_paginate .pagination {
  margin: 0 !important;
}

.panel-table-full .dataTables_wrapper .dataTables_paginate .pagination > li > a,
div.dataTables_wrapper .dataTables_paginate .pagination > li > a {
  border-radius: 8px !important;
  margin: 0 3px !important;
  padding: 8px 14px !important;
  font-weight: 500 !important;
  border: 1px solid #e5e7eb !important;
  background: #ffffff !important;
  color: #4b5563 !important;
}

.panel-table-full .dataTables_wrapper .dataTables_paginate .pagination > li > a:hover,
div.dataTables_wrapper .dataTables_paginate .pagination > li > a:hover {
  background: #f9fafb !important;
  border-color: #d1d5db !important;
}

.panel-table-full .dataTables_wrapper .dataTables_paginate .pagination > li.active > a,
div.dataTables_wrapper .dataTables_paginate .pagination > li.active > a {
  background: #4f46e5 !important;
  border-color: #4f46e5 !important;
  color: #ffffff !important;
}

.panel-table-full .dataTables_wrapper .dataTables_paginate .pagination > li.disabled > a,
div.dataTables_wrapper .dataTables_paginate .pagination > li.disabled > a {
  opacity: 0.6;
}

/* ---------- Checkbox column ---------- */
.panel-table-full .dataTables_wrapper table .checkbox input,
div.dataTables_wrapper table .checkbox input {
  border-radius: 4px !important;
}

/* ---------- Bulk actions bar ---------- */
.bulk-actions-btn.table-btn {
  border-radius: 8px !important;
}

/* ---------- Filters modal (app-filters create/edit) ---------- */
.filters-modal .modal-content {
  border-radius: 12px !important;
  border: 1px solid #e5e7eb !important;
}

.filters-modal .modal-header {
  border-bottom: 1px solid #e5e7eb !important;
  padding: 16px 20px !important;
}

.filters-modal .modal-body {
  padding: 20px !important;
}

/* ============================================
   Auth Login - Richer, Floating, Dynamic
   Logo no bg, little content, dynamic colours
   ============================================ */
/* Admin and client auth: same split layout */
body.login_admin.auth-split,
body.customers.auth-split {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #334155;
  -webkit-font-smoothing: antialiased;
}

.auth-split-container { display: flex; min-height: 100vh; }

/* Brand panel: dynamic gradient + floating shapes */
.auth-split-brand {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 64px;
  overflow: hidden;
}
.auth-brand-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #334155 0%, #1e293b 40%, #0f172a 100%);
}
.auth-brand-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg,
    rgba(99, 102, 241, 0.18) 0%,
    rgba(139, 92, 246, 0.12) 35%,
    rgba(236, 72, 153, 0.1) 60%,
    rgba(34, 211, 238, 0.15) 100%);
  background-size: 300% 300%;
  animation: authGradientMove 14s ease infinite;
}
@keyframes authGradientMove {
  0%, 100% { opacity: 1; background-position: 0% 50%; }
  50% { opacity: 1; background-position: 100% 50%; }
}
.auth-float {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  animation: authFloatDrift 16s ease-in-out infinite;
}
.auth-float-1 {
  width: 260px;
  height: 260px;
  top: -50px;
  left: -50px;
  background: rgba(99, 102, 241, 0.2);
  animation-delay: 0s;
}
.auth-float-2 {
  width: 180px;
  height: 180px;
  bottom: 15%;
  right: 15%;
  background: rgba(236, 72, 153, 0.15);
  animation-delay: -5s;
}
.auth-float-3 {
  width: 140px;
  height: 140px;
  top: 45%;
  left: 8%;
  background: rgba(34, 211, 238, 0.18);
  animation-delay: -10s;
}
@keyframes authFloatDrift {
  0%, 100% { transform: translate(0, 0); opacity: 0.8; }
  50% { transform: translate(25px, -15px); opacity: 1; }
}
.auth-brand-content {
  position: relative;
  z-index: 2;
  text-align: center;
}
.auth-brand-logo {
  margin-bottom: 20px;
}
.auth-brand-logo a { display: block; }
.auth-brand-logo img {
  max-width: 200px;
  height: auto;
  display: block;
}
.auth-brand-tagline {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}
/* Footer in left brand panel */
.auth-split-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-brand-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.auth-brand-footer {
  flex-shrink: 0;
  padding: 20px 24px;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}
.auth-brand-footer-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}
.auth-brand-footer-link:hover { color: #fff; text-decoration: underline; }

/* Form panel: floating blobs + floating card */
.auth-split-form {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 64px;
  background: linear-gradient(180deg, #f0f4ff 0%, #e8eeff 50%, #fdf2f8 100%);
  overflow: hidden;
}
.auth-split-form .auth-form-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* Register: long form scrolls inside right panel, footer stays at bottom */
body.register .auth-split-form .auth-form-inner {
  justify-content: flex-start;
  align-items: flex-start;
}
.auth-page-copyright { color: inherit; }
.auth-float-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: authBlobPulse 8s ease-in-out infinite;
}
.auth-float-blob-1 {
  width: 300px;
  height: 300px;
  top: -70px;
  right: -70px;
  background: rgba(167, 139, 250, 0.35);
  animation-delay: 0s;
}
.auth-float-blob-2 {
  width: 220px;
  height: 220px;
  bottom: -50px;
  left: -50px;
  background: rgba(34, 211, 238, 0.3);
  animation-delay: -4s;
}
@keyframes authBlobPulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.08); opacity: 0.55; }
}
.auth-form-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
}
/* Register: wider card for two-column form, use more of right panel */
body.register .auth-form-inner { max-width: min(920px, 95%); align-self: stretch; }
.auth-register-card { max-width: 100%; width: 100%; }
.auth-register-body { margin-bottom: 0; }
.auth-register-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(99, 102, 241, 0.15);
  text-align: center;
}
.auth-register-footer .auth-submit { margin-bottom: 12px; }
.auth-form-footer.auth-forgot-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: none;
}
.auth-form-title {
  font-size: 26px;
  font-weight: 700;
  color: #1e1b4b;
  margin: 0 0 6px;
  letter-spacing: -0.03em;
}
.auth-form-subtitle {
  font-size: 14px;
  color: #6366f1;
  margin: 0 0 24px;
  font-weight: 500;
}
.auth-form-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 32px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.06);
}
.auth-card-float {
  box-shadow: 0 20px 60px rgba(99, 102, 241, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.auth-form-card .row { margin-left: 0; margin-right: 0; }
.auth-form-card .alert { margin-bottom: 20px; border-radius: 10px; }
.auth-form-group { margin-bottom: 20px; }
/* When captcha is off, no gap between password and Remember me */
.auth-form-group.auth-password-tight,
.form-group.auth-password-tight,
body.login_admin .auth-form-group.auth-password-tight {
  margin-bottom: 0 !important;
  margin-top: 0 !important;
  padding-bottom: 0 !important;
}
.auth-form-group.auth-password-tight .auth-input,
.auth-form-group.auth-password-tight input {
  margin-bottom: 0 !important;
}
.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
  margin-bottom: 8px;
}
.auth-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.auth-label-row .auth-label { margin-bottom: 0; }
.auth-forgot {
  font-size: 13px;
  font-weight: 500;
  color: #6366f1;
  text-decoration: none;
}
.auth-forgot:hover { color: #4f46e5; text-decoration: underline; }
.auth-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #1e1b4b;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-input::placeholder { color: #a5b4fc; }
.auth-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
/* reCAPTCHA: fixed height so container does not expand over time */
.auth-recaptcha-wrap {
  margin-bottom: 18px;
  min-height: 78px;
  max-height: 78px;
  overflow: hidden;
}
.auth-recaptcha-wrap .g-recaptcha,
.auth-recaptcha { margin-bottom: 0; }
/* No gap between password and Remember me when captcha is off */
.auth-remember.auth-no-captcha {
  margin-top: 2px !important;
  margin-bottom: 24px;
}
.auth-remember { margin-bottom: 24px; }
.auth-remember .checkbox { margin: 0; }
.auth-remember input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  vertical-align: middle;
  accent-color: #6366f1;
}
.auth-remember label {
  font-size: 14px;
  font-weight: 500;
  color: #4f46e5;
  vertical-align: middle;
  cursor: pointer;
}
.auth-submit {
  width: 100%;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  border: none !important;
  color: #fff !important;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4) !important;
}

/* Forgot password / auth form footer: Back to Login link */
.auth-form-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(99, 102, 241, 0.15);
  text-align: center;
}
.auth-back-login {
  font-size: 14px;
  font-weight: 500;
  color: #6366f1;
  text-decoration: none;
}
.auth-back-login:hover {
  color: #4f46e5;
  text-decoration: underline;
}
/* Login card footer: Forgot Password + Register links in one row */
.auth-form-footer.auth-login-links {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(99, 102, 241, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}
.auth-footer-link {
  font-size: 13px;
  font-weight: 500;
  color: #6366f1;
  text-decoration: none;
}
.auth-footer-link:hover { color: #4f46e5; text-decoration: underline; }
.auth-footer-sep {
  color: #94a3b8;
  font-size: 12px;
  user-select: none;
}

/* Responsive */
@media (max-width: 991px) {
  .auth-split-container { flex-direction: column; }
  .auth-split-brand {
    flex: none;
    min-height: 180px;
    padding: 28px 24px;
  }
  .auth-brand-logo img { max-width: 150px; }
  .auth-brand-tagline { font-size: 15px; }
  .auth-float { display: none; }
  .auth-split-form { padding: 32px 24px 0; }
  .auth-float-blob { display: none; }
  .auth-form-title { font-size: 22px; }
  .auth-form-card { padding: 24px; animation: none; }
  .auth-brand-footer { padding: 14px 16px; }
}
@media (max-width: 480px) {
  .auth-split-form { padding: 24px 16px 0; }
  .auth-form-card { padding: 20px; }
  .auth-brand-footer { padding: 10px 12px; font-size: 10px; }
}
[dir="rtl"] .auth-remember input[type="checkbox"] { margin-right: 0; margin-left: 10px; }

/* ============================================
   LEADS PAGE - Fresh Redesign v2
   Clean, editorial, distinctive
   ============================================ */

.leads-page-fresh #wrapper {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 35%, #eef2f7 100%) !important;
}

.leads-page-fresh .content {
  padding: 32px 36px 48px !important;
}

/* Hero section - editorial */
.leads-page-hero {
  margin-bottom: 32px !important;
  padding: 0;
  background: transparent;
  border: none;
}

.leads-hero-content {
  margin-bottom: 24px;
}

.leads-page-title {
  font-size: 30px !important;
  font-weight: 700 !important;
  letter-spacing: -0.04em;
  color: #0f172a !important;
  margin: 0 0 8px 0 !important;
  line-height: 1.15;
}

.leads-page-subtitle {
  font-size: 15px;
  color: #64748b !important;
  margin: 0 !important;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Status pills - crisp minimal */
.leads-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.leads-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  color: #334155 !important;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.leads-status-pill:hover {
  background: #fff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.leads-pill-count {
  font-weight: 700 !important;
  color: var(--pill-color, #475569) !important;
  font-size: 14px !important;
}

.leads-pill-name {
  color: #64748b !important;
}

.leads-status-pill--lost {
  border-color: #fecaca !important;
  background: #fef2f2 !important;
  padding: 10px 20px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
}

.leads-status-pill--lost .leads-pill-count { color: #dc2626 !important; }
.leads-status-pill--lost .leads-pill-name { color: #991b1b !important; }

/* Actions bar - unified with page */
.leads-actions-bar {
  margin-bottom: 24px !important;
  padding: 18px 24px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.leads-actions-bar .btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  border: none !important;
  padding: 12px 24px !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.leads-actions-bar .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

.leads-actions-bar .btn-default {
  border-radius: 10px !important;
  padding: 10px 20px !important;
  font-weight: 500 !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  color: #475569 !important;
}

.leads-actions-bar .btn-default:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

/* ========== LEADS TABLE - Reference layout (recreated from scratch) ========== */

/* Remove gap from empty first row (default DataTables dom) */
.leads-page-fresh .dataTables_wrapper > .row:first-child:not(:has(.dataTables_length)) {
  display: none !important;
}

/* Card - white, rounded, shadow */
.leads-page-fresh .leads-table-card.panel_s {
  border-radius: 14px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02) !important;
  overflow: hidden;
  background: #fff !important;
  margin-top: 12px !important;
}
.leads-page-fresh .leads-table-card .panel-body {
  padding: 0 !important;
}

/* Tighter spacing: actions bar to card */
.leads-page-fresh .leads-actions-bar {
  margin-bottom: 12px !important;
}

/* Toolbar - Search LEFT, 25/Export/Manipulation RIGHT (inside card) */
/* Also targets default DataTables dom when main.min.js is used (no leads-dt-toolbar class) */
.leads-page-fresh .leads-dt-toolbar,
.leads-page-fresh .dataTables_wrapper .row:has(.dataTables_length),
.leads-page-fresh .dataTables_wrapper .row:nth-child(2) {
  padding: 16px 28px 14px 28px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 16px 24px !important;
  border-bottom: 1px solid #e2e8f0;
}
.leads-page-fresh .leads-dt-toolbar > .col-md-6:first-child,
.leads-page-fresh .dataTables_wrapper .row:has(.dataTables_length) > .col-md-5,
.leads-page-fresh .dataTables_wrapper .row:nth-child(2) > .col-md-5 {
  display: flex;
  align-items: center;
}
.leads-page-fresh .leads-dt-toolbar > .col-md-6:last-child,
.leads-page-fresh .dataTables_wrapper .row:has(.dataTables_length) > .col-md-7,
.leads-page-fresh .dataTables_wrapper .row:nth-child(2) > .col-md-7 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}
.leads-page-fresh .leads-dt-toolbar .dataTables_filter,
.leads-page-fresh .dataTables_wrapper .row:has(.dataTables_length) .dataTables_filter,
.leads-page-fresh .dataTables_wrapper .row:nth-child(2) .dataTables_filter {
  margin: 0 !important;
}
.leads-page-fresh .leads-dt-toolbar .dataTables_filter label {
  width: 100%;
  margin: 0 !important;
  display: flex !important;
}
.leads-page-fresh .leads-dt-toolbar .dataTables_filter .input-group {
  width: 100% !important;
  max-width: 320px;
}
.leads-page-fresh .leads-dt-toolbar .dataTables_filter input {
  flex: 1;
  min-width: 0;
  border-radius: 8px !important;
}
.leads-page-fresh .leads-dt-toolbar .dataTables_filter input::placeholder {
  color: #94a3b8;
}
.leads-page-fresh .leads-dt-toolbar .dataTables_length,
.leads-page-fresh .dataTables_wrapper .row:has(.dataTables_length) .dataTables_length,
.leads-page-fresh .dataTables_wrapper .row:nth-child(2) .dataTables_length {
  margin: 0 12px 0 0 !important;
}
.leads-page-fresh .leads-dt-toolbar .dt-buttons .btn-group,
.leads-page-fresh .dataTables_wrapper .row:has(.dataTables_length) .dt-buttons .btn-group,
.leads-page-fresh .dataTables_wrapper .row:nth-child(2) .dt-buttons .btn-group {
  margin: 0 12px 0 0 !important;
}
.leads-page-fresh .leads-dt-toolbar .dt-buttons .btn-group + .btn-group,
.leads-page-fresh .dataTables_wrapper .dt-buttons .btn-group + .btn-group {
  margin-left: 12px !important;
}
.leads-page-fresh .leads-dt-toolbar .dt-buttons .btn,
.leads-page-fresh .dataTables_wrapper .dt-buttons .btn {
  margin: 0 !important;
}
.leads-page-fresh .leads-dt-toolbar .btn-dt-reload,
.leads-page-fresh .dataTables_wrapper .btn-dt-reload {
  margin-left: 12px !important;
}

/* Footer - Info LEFT, Pagination CENTER, Go to page RIGHT */
.leads-page-fresh .leads-dt-footer {
  padding: 18px 28px !important;
  margin: 0 !important;
  background: #fafbfc !important;
  border-top: 1px solid #e2e8f0;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 16px 24px !important;
}
.leads-page-fresh .leads-dt-footer > .col-md-4:first-child {
  display: flex;
  align-items: center;
}
.leads-page-fresh .leads-dt-footer .leads-dt-pagination-wrap {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}
.leads-page-fresh .leads-dt-footer > .col-md-4:last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.leads-page-fresh .leads-dt-footer .dataTables_info {
  margin: 0 !important;
  padding: 0 !important;
}
.leads-page-fresh .leads-dt-footer .dataTables_paginate {
  margin: 0 !important;
  padding: 0 !important;
}
.leads-page-fresh .leads-dt-footer .dataTables_paginate .pagination {
  margin: 0 !important;
}
.leads-page-fresh .leads-dt-footer .dt-page-jump {
  display: flex !important;
  align-items: center !important;
  gap: 8px;
  margin: 0 !important;
}
.leads-page-fresh .leads-dt-footer .dt-page-jump::before {
  content: "Go to page";
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
}
.leads-page-fresh .leads-dt-footer .dt-page-jump-select {
  width: 70px !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
}


/* Space between controls bar and table - minimal */

/* Table - professional, spacious */
.leads-page-fresh .panel-table-full .dataTables_wrapper table.dataTable,
.leads-page-fresh div.dataTables_wrapper table.dataTable {
  border-collapse: collapse;
}

/* Remove vertical line between checkbox and # column */
.leads-page-fresh .table-leads tbody > tr > td:first-child,
.leads-page-fresh .table-leads thead > tr > th:first-child,
.leads-page-fresh .table-leads thead th,
.leads-page-fresh .table-leads tbody td {
  border-left: none !important;
  border-right: none !important;
}

.leads-page-fresh .panel-table-full .dataTables_wrapper table thead th,
.leads-page-fresh div.dataTables_wrapper table thead th {
  background: #f8fafc !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b !important;
  padding: 14px 20px !important;
  border: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  vertical-align: middle !important;
}

.leads-page-fresh .panel-table-full .dataTables_wrapper table tbody td,
.leads-page-fresh div.dataTables_wrapper table tbody td {
  padding: 14px 20px !important;
  font-size: 14px !important;
  color: #334155 !important;
  border: none !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle !important;
  transition: background 0.15s ease;
}

/* Alternating rows - very subtle for professional look */
.leads-page-fresh .panel-table-full .dataTables_wrapper table tbody tr:nth-child(even) td,
.leads-page-fresh div.dataTables_wrapper table tbody tr:nth-child(even) td {
  background: #fcfcfd !important;
}

.leads-page-fresh .panel-table-full .dataTables_wrapper table tbody tr:hover td,
.leads-page-fresh div.dataTables_wrapper table tbody tr:hover td {
  background: #f8fafc !important;
}

.leads-page-fresh .panel-table-full .dataTables_wrapper table tbody tr:nth-child(even):hover td,
.leads-page-fresh div.dataTables_wrapper table tbody tr:nth-child(even):hover td {
  background: #f1f5f9 !important;
}

/* Table container - no left padding, table can touch left edge */
.leads-page-fresh .dataTables_wrapper .table-responsive {
  padding: 0 24px 0 0;
}

.leads-page-fresh .panel-table-full .dataTables_wrapper table tbody tr.has-row-options:hover .row-options,
.leads-page-fresh div.dataTables_wrapper table tbody tr.has-row-options:hover .row-options {
  opacity: 1;
}

.leads-page-fresh .panel-table-full .dataTables_wrapper .dataTables_paginate .pagination > li.active > a,
.leads-page-fresh div.dataTables_wrapper .dataTables_paginate .pagination > li.active > a {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  border-color: transparent !important;
}

.leads-page-fresh .panel-table-full .dataTables_wrapper .dataTables_filter input,
.leads-page-fresh div.dataTables_wrapper .dataTables_filter input {
  border-radius: 8px !important;
}

.leads-page-fresh .table-leads a.tw-font-medium {
  font-weight: 600 !important;
  color: #4f46e5 !important;
}

.leads-page-fresh .table-leads a.tw-font-medium:hover {
  color: #4338ca !important;
  text-decoration: underline;
}

/* Pagination & info - handled by dt-footer-bar */

/* Kanban view on leads page */
.leads-page-fresh .kan-ban-tab {
  margin-top: 0 !important;
}

/* Leads page - prevent overflow/clipping */
.leads-page-fresh #wrapper .content .row,
.leads-page-fresh .col-md-12 {
  min-width: 0;
  max-width: 100%;
}
.leads-page-fresh .leads-table-card,
.leads-page-fresh .panel-table-full {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* Override container-fluid table-responsive inherit (from table.css) - ensure table scrolls */
.leads-page-fresh .container-fluid .table-responsive {
  overflow-x: auto !important;
}

/* Leads page - faster perceived loading: smaller skeleton, smooth reveal */
.leads-page-fresh .table-loading table thead tr {
  min-height: 56px !important;
  height: 56px !important;
}
.leads-page-fresh .table-loading {
  transition: opacity 0.2s ease;
}
.leads-page-fresh .dataTables_wrapper:not(.table-loading) .table-responsive {
  animation: leadsTableReveal 0.25s ease-out;
}
@keyframes leadsTableReveal {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* Leads table - thin minimalistic scrollbar (like sidebar) */
.leads-page-fresh .dataTables_wrapper .table-responsive,
.leads-page-fresh .leads-table-card .table-responsive {
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 114, 128, 0.35) transparent;
}
.leads-page-fresh .dataTables_wrapper .table-responsive::-webkit-scrollbar,
.leads-page-fresh .leads-table-card .table-responsive::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.leads-page-fresh .dataTables_wrapper .table-responsive::-webkit-scrollbar-track,
.leads-page-fresh .leads-table-card .table-responsive::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}
.leads-page-fresh .dataTables_wrapper .table-responsive::-webkit-scrollbar-thumb,
.leads-page-fresh .leads-table-card .table-responsive::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.25);
  border-radius: 10px;
}
.leads-page-fresh .dataTables_wrapper .table-responsive::-webkit-scrollbar-thumb:hover,
.leads-page-fresh .leads-table-card .table-responsive::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.45);
}
/* DataTables scroll body (when scrollY used) - same thin scrollbar */
.leads-page-fresh .dataTables_scrollBody {
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 114, 128, 0.35) transparent;
}
.leads-page-fresh .dataTables_scrollBody::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.leads-page-fresh .dataTables_scrollBody::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}
.leads-page-fresh .dataTables_scrollBody::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.25);
  border-radius: 10px;
}
.leads-page-fresh .dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.45);
}

/* ---------- Theme Switcher (Header) ---------- */
#header .theme-switcher-wrapper .theme-icon-light,
#header .theme-switcher-wrapper .theme-icon-dark {
  pointer-events: none;
}
#header .theme-switcher-wrapper .theme-icon-dark { display: none; }
html.theme-dark #header .theme-switcher-wrapper .theme-icon-light { display: none !important; }
html.theme-dark #header .theme-switcher-wrapper .theme-icon-dark { display: block !important; }

/* ---------- Auth Theme Switcher ---------- */
.auth-theme-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
}
.auth-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.08);
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.auth-theme-btn:hover {
  background: #fff;
  color: #334155;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
html.theme-dark .auth-theme-btn {
  background: rgba(30,41,59,0.9);
  border-color: rgba(255,255,255,0.08);
  color: #94a3b8;
}
html.theme-dark .auth-theme-btn:hover {
  background: #334155;
  color: #e2e8f0;
}

/* ---------- Dark Mode (Universal) ---------- */
html.theme-dark {
  color-scheme: dark;
}
html.theme-dark body,
html.theme-dark body.admin {
  background: #0f172a !important;
  color: #e2e8f0 !important;
}
html.theme-dark #header {
  background: #1e293b !important;
  border-bottom-color: #334155 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
}
html.theme-dark #header .header-btn,
html.theme-dark #header .header-btn:hover {
  color: #94a3b8 !important;
}
html.theme-dark #header .header-btn:hover {
  background: #334155 !important;
}
html.theme-dark #header .header-btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  color: #fff !important;
}
html.theme-dark #header .header-search-field {
  background: #334155 !important;
  border-color: #475569 !important;
}
html.theme-dark #header .header-search-field:hover {
  background: #475569 !important;
  border-color: #64748b !important;
}
html.theme-dark #header .header-search-placeholder,
html.theme-dark #header .header-search-icon {
  color: #94a3b8 !important;
}
html.theme-dark #header .header-search-kbd {
  background: #475569 !important;
  color: #cbd5e1 !important;
  border-color: #64748b !important;
}
html.theme-dark #header .header-profile-name,
html.theme-dark #header .header-profile-badge {
  color: #e2e8f0 !important;
}
html.theme-dark #header .header-profile-email { color: #94a3b8 !important; }
html.theme-dark #menu,
html.theme-dark .sidebar,
html.theme-dark aside#menu {
  background: #1e293b !important;
  border-right-color: #334155 !important;
}
html.theme-dark #menu a,
html.theme-dark .sidebar a,
html.theme-dark #menu .menu-item a {
  color: #94a3b8 !important;
}
html.theme-dark #menu a:hover,
html.theme-dark .sidebar a:hover,
html.theme-dark #menu .menu-item a:hover,
html.theme-dark #menu li.active a {
  color: #e2e8f0 !important;
  background: #334155 !important;
}
html.theme-dark #wrapper {
  background: #0f172a !important;
}
html.theme-dark .panel_s,
html.theme-dark .panel-body,
html.theme-dark .content-wrapper {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .panel_s .panel-body { border-top-color: #334155 !important; }
html.theme-dark .table,
html.theme-dark .dataTable {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}
html.theme-dark .table > thead > tr > th,
html.theme-dark .dataTable thead th {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .table > tbody > tr > td,
html.theme-dark .table > tbody > tr > th,
html.theme-dark .dataTable tbody td {
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .table-striped > tbody > tr:nth-of-type(odd),
html.theme-dark .dataTable tbody tr:nth-child(odd) {
  background: #1e293b !important;
}
html.theme-dark .table-striped > tbody > tr:nth-of-type(even),
html.theme-dark .dataTable tbody tr:nth-child(even) {
  background: #0f172a !important;
}
html.theme-dark .form-control,
html.theme-dark input[type="text"],
html.theme-dark input[type="email"],
html.theme-dark input[type="password"],
html.theme-dark input[type="search"],
html.theme-dark select,
html.theme-dark textarea {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .form-control::placeholder,
html.theme-dark input::placeholder { color: #94a3b8 !important; }
/* DataTables filter & controls */
html.theme-dark .dataTables_wrapper .row:first-child,
html.theme-dark div.dataTables_wrapper .row:first-child {
  background: #1e293b !important;
  border-color: #334155 !important;
}
html.theme-dark .dataTables_filter .input-group,
html.theme-dark .dataTables_filter input {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .dataTables_filter .input-group-addon {
  background: #475569 !important;
  border-color: #475569 !important;
  color: #94a3b8 !important;
}
html.theme-dark .dataTables_length label,
html.theme-dark .dataTables_length select {
  color: #e2e8f0 !important;
}
html.theme-dark .dataTables_length select {
  background: #334155 !important;
  border-color: #475569 !important;
}
html.theme-dark .dt-buttons .btn-default,
html.theme-dark .btn-dt-reload {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .dt-buttons .btn-default:hover,
html.theme-dark .btn-dt-reload:hover {
  background: #475569 !important;
  color: #fff !important;
}
/* Bootstrap select */
html.theme-dark .bootstrap-select .btn-default,
html.theme-dark .bootstrap-select > .dropdown-toggle {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .bootstrap-select .dropdown-menu {
  background: #1e293b !important;
}
html.theme-dark .bootstrap-select .dropdown-menu li a {
  color: #e2e8f0 !important;
}
html.theme-dark .dropdown-menu {
  background: #1e293b !important;
  border-color: #334155 !important;
}
html.theme-dark .dropdown-menu > li > a {
  color: #e2e8f0 !important;
}
html.theme-dark .dropdown-menu > li > a:hover {
  background: #334155 !important;
  color: #fff !important;
}
html.theme-dark .dropdown-header,
html.theme-dark .dropdown-menu .divider {
  border-color: #334155 !important;
  color: #94a3b8 !important;
}
html.theme-dark .modal-content {
  background: #1e293b !important;
  border-color: #334155 !important;
}
html.theme-dark .modal-header {
  border-bottom-color: #334155 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .modal-body,
html.theme-dark .modal-footer {
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}
html.theme-dark .modal-footer { border-top-color: #334155 !important; }
html.theme-dark .btn-default {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .btn-default:hover {
  background: #475569 !important;
  color: #fff !important;
}
html.theme-dark .text-muted,
html.theme-dark .help-block { color: #94a3b8 !important; }
html.theme-dark h1, html.theme-dark h2, html.theme-dark h3,
html.theme-dark h4, html.theme-dark h5, html.theme-dark .bold {
  color: #e2e8f0 !important;
}
html.theme-dark .command-palette-backdrop { background: rgba(0,0,0,0.7) !important; }
html.theme-dark .command-palette-dialog {
  background: #1e293b !important;
  border-color: #334155 !important;
}
html.theme-dark .command-palette-input {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .command-palette-results a,
html.theme-dark .command-palette-history a {
  color: #e2e8f0 !important;
}
html.theme-dark .command-palette-results a:hover,
html.theme-dark .command-palette-history a:hover {
  background: #334155 !important;
}
html.theme-dark #mobile-collapse {
  background: #1e293b !important;
  border-color: #334155 !important;
}
html.theme-dark #mobile-collapse a { color: #e2e8f0 !important; }

/* Auth page dark mode */
html.theme-dark body.login_admin { background: #0f172a !important; color: #e2e8f0 !important; }
html.theme-dark .auth-split-form { background: #0f172a !important; }
html.theme-dark .auth-form-title,
html.theme-dark .auth-form-subtitle { color: #e2e8f0 !important; }
html.theme-dark .auth-form-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}
html.theme-dark .auth-label { color: #cbd5e1 !important; }
html.theme-dark .auth-input {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .auth-forgot { color: #94a3b8 !important; }
html.theme-dark .auth-forgot:hover { color: #e2e8f0 !important; }
html.theme-dark .auth-brand-footer { color: rgba(255, 255, 255, 0.6) !important; }
html.theme-dark .auth-brand-footer-link { color: rgba(255, 255, 255, 0.85) !important; }
html.theme-dark .auth-brand-footer-link:hover { color: #fff !important; }

/* Other auth pages (forgot, reset, set password) */
html.theme-dark body.authentication,
html.theme-dark body.forgot-password,
html.theme-dark body.reset-password {
  background: #0f172a !important;
}
html.theme-dark .authentication-form-wrapper .tw-bg-white,
html.theme-dark .authentication-form-wrappe .tw-bg-white {
  background: #1e293b !important;
  border-color: #334155 !important;
}
html.theme-dark .authentication h1,
html.theme-dark .authentication .tw-text-neutral-800 {
  color: #e2e8f0 !important;
}

/* Leads page dark mode */
html.theme-dark .leads-page-fresh #wrapper {
  background: linear-gradient(180deg, #0c1222 0%, #0f172a 24%) !important;
}
html.theme-dark .leads-page-title { color: #f1f5f9 !important; }
html.theme-dark .leads-page-subtitle { color: #94a3b8 !important; }
html.theme-dark .leads-status-pill {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .leads-status-pill:hover {
  background: #334155 !important;
  border-color: #475569 !important;
}
html.theme-dark .leads-status-pill--lost {
  background: #450a0a !important;
  border-color: #7f1d1d !important;
}
html.theme-dark .leads-actions-bar {
  background: #1e293b !important;
  border-color: #334155 !important;
}
html.theme-dark .leads-page-fresh .leads-table-card.panel_s {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3) !important;
}

/* Leads table - dark mode */
/* Leads - dark mode controls & footer */
html.theme-dark .leads-page-fresh .leads-dt-toolbar {
  border-color: #334155 !important;
}
html.theme-dark .leads-page-fresh .leads-dt-footer {
  background: #0f172a !important;
  border-color: #334155 !important;
}
html.theme-dark .leads-page-fresh .leads-dt-footer .dt-page-jump::before {
  color: #94a3b8;
}
html.theme-dark .leads-page-fresh .leads-dt-footer .dt-page-jump-select {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .leads-page-fresh .dataTables_wrapper table thead th {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border-bottom-color: #334155 !important;
}
html.theme-dark .leads-page-fresh .dataTables_wrapper table tbody td {
  color: #e2e8f0 !important;
  border-bottom-color: #1e293b !important;
}
html.theme-dark .leads-page-fresh .dataTables_wrapper table tbody tr:nth-child(odd) td {
  background: #1e293b !important;
}
html.theme-dark .leads-page-fresh .dataTables_wrapper table tbody tr:nth-child(even) td {
  background: #0f172a !important;
}
html.theme-dark .leads-page-fresh .dataTables_wrapper table tbody tr:hover td {
  background: #334155 !important;
}
html.theme-dark .leads-page-fresh .dataTables_wrapper table tbody tr:nth-child(even):hover td {
  background: #334155 !important;
}

/* Table status labels - softer in dark mode */
html.theme-dark .table-leads .dropdown-toggle.label,
html.theme-dark .table .label.lead-status,
html.theme-dark .table .dropdown.inline-block .dropdown-toggle {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .table-leads .label.label-danger,
html.theme-dark .table-leads .label.label-warning {
  background: #7f1d1d !important;
  border-color: #991b1b !important;
  color: #fecaca !important;
}
html.theme-dark .table-leads .label.label-warning {
  background: #78350f !important;
  border-color: #92400e !important;
  color: #fef3c7 !important;
}

/* App-filters / Filters button */
html.theme-dark .btn-group .dropdown-toggle.btn-default,
html.theme-dark .app-filters .btn-default {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .dataTables_info { color: #94a3b8 !important; }
html.theme-dark .pagination > li > a {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.theme-dark .pagination > li > a:hover {
  background: #475569 !important;
  color: #fff !important;
}

/* Task Board (Kanban-style to-do) */
.task-board-placeholder {
  min-height: 60px;
  background: #e5e7eb;
  border: 2px dashed #9ca3af;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
}
.task-board-kanban {
  min-height: 400px;
}
.task-board-card.ui-sortable-helper {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.task-board-page .modal-lg { max-width: 700px; }
.task-board-card-content { max-height: 3em; overflow: hidden; }
.task-board-card.bulk-selectable { cursor: pointer; }
.task-board-card.bulk-selected { outline: 2px solid #3b82f6; outline-offset: 2px; }
.task-board-column-overlimit { box-shadow: inset 0 0 0 2px #ef4444; }
.task-board-kanban .task-board-column { cursor: grab; }
.task-board-kanban .task-board-column.ui-sortable-helper { cursor: grabbing; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.task-board-color-swatch.task-board-color-selected { border-color: #1e293b !important; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1e293b; }

/* Task Board - Header & Filters */
.task-board-header { flex-wrap: nowrap; overflow-x: auto; align-items: center; }
.task-board-header .task-board-search-row { align-items: center; }
.task-board-header .task-board-search-row label { display: inline-flex; align-items: center; margin: 0; }
.task-board-filters-panel { z-index: 1050 !important; }
#task-board-filters-backdrop { z-index: 1045 !important; }

/* Task Board - Fixed overlays (settings, filters) - ensure viewport positioning when scrolling */
.task-board-fixed-overlay {
  position: fixed !important;
  contain: layout;
}
#task-board-right-panel { top: 0 !important; right: 0 !important; height: 100vh !important; }
#task-board-slideover { z-index: 9995 !important; }
#task-board-slideover-backdrop { z-index: 9994 !important; }
.task-board-table-page .table-tasks-board td { vertical-align: middle; }
.task-board-table-page .task-inline-column,
.task-board-table-page .task-inline-assignee,
.task-board-table-page .task-inline-due,
.task-board-table-page .task-inline-priority { display: none; }

/* ============================================
   Global Padding Reduction - All Pages
   Tighter, denser layout across the software
   ============================================ */
/* Main content area - already reduced above */

/* Panel bodies - reduce internal padding */
.panel-body,
.panel_s .panel-body {
  padding: 14px 18px !important;
}
.panel-heading,
.panel_s .panel-heading {
  padding: 10px 18px !important;
}
.panel-footer {
  padding: 10px 18px !important;
}

/* Form groups - reduce vertical spacing between fields */
.form-group {
  margin-bottom: 10px !important;
}

/* Bootstrap row gutters - reduce horizontal gap between columns */
.row {
  margin-left: -10px !important;
  margin-right: -10px !important;
}
.row > [class*="col-"] {
  padding-left: 10px !important;
  padding-right: 10px !important;
}

/* Page intro / overview boxes */
.leads-overview {
  padding: 14px 18px !important;
  margin-bottom: 14px !important;
}

/* Customer profile content override */
.customer_profile .content {
  padding: 16px 20px 24px !important;
}

/* Leads page fresh - reduce if present */
.leads-page-fresh .content {
  padding: 20px 24px 28px !important;
}

/* ============================================
   DataTables & Tabs Spacing Fixes - All Pages
   Fix: Export/Search/Refresh touching, tabs cramped, table cells
   ============================================ */
/* DataTables filter row - add gap between length, Export, refresh, search */
.panel-table-full .dataTables_wrapper .row:first-child,
div.dataTables_wrapper .row:first-child {
  padding: 12px 20px !important;
}
.panel-table-full .dataTables_wrapper .row:first-child > [class*="col-"],
div.dataTables_wrapper .row:first-child > [class*="col-"] {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 12px !important;
}
.panel-table-full .dataTables_length,
div.dataTables_wrapper .dataTables_length {
  margin-right: 12px !important;
}
.panel-table-full .dataTables_wrapper .dt-buttons,
div.dataTables_wrapper .dt-buttons {
  margin-right: 12px !important;
}
.panel-table-full .dataTables_wrapper .dt-buttons .btn,
div.dataTables_wrapper .dt-buttons .btn {
  margin-right: 6px !important;
}
.panel-table-full .dataTables_wrapper .btn-dt-reload,
div.dataTables_wrapper .btn-dt-reload {
  margin-right: 12px !important;
}
.panel-table-full .dataTables_filter,
div.dataTables_wrapper .dataTables_filter {
  margin: 0 !important;
}

/* Reduce excessive vertical gap above DataTables filter row */
.panel-table-full .dataTables_wrapper .row:first-child {
  margin-bottom: 0 !important;
}

/* Nav tabs (Invoice, Tasks, Activity, Reminders, Notes) - add padding above so not touching top */
.panel .nav-tabs,
.panel_s .nav-tabs,
.panel-body .nav-tabs,
.horizontal-scrollable-tabs .nav-tabs {
  padding-top: 12px !important;
  margin-top: 0 !important;
}
.panel-full-width-tabs,
.horizontal-scrollable-tabs.panel-full-width-tabs {
  padding-top: 12px !important;
}
/* Tab content area - padding below tabs */
.tab-content {
  padding-top: 14px !important;
}

/* Table cells - adequate vertical padding for readability (avoid cramped feel) */
.panel-table-full .dataTables_wrapper table thead th,
div.dataTables_wrapper table thead th {
  padding: 12px 16px !important;
}
.panel-table-full .dataTables_wrapper table tbody td,
div.dataTables_wrapper table tbody td {
  padding: 14px 16px !important;
}
