/**
 * Lightspeed shell: topbar + dual sidebar (icon rail | secondary submenu)
 */
:root {
  --ls-accent: #5844ed;
  --ls-accent-hover: #4634d6;
  --ls-accent-soft: rgba(88, 68, 237, 0.12);
  --ls-rail-width: 72px;
  --ls-secondary-width: 220px;
  --ls-topbar-height: 52px;
  --ls-border: #e5e7eb;
  --ls-text: #1f2430;
  --ls-muted: #6b7280;
  --ls-canvas: #f3f4f6;
  --ls-card: #ffffff;
  --ls-rail-bg: #eceef2;
  --ls-content-pad-top: 32px;
}

body.zoho-theme {
  --zoho-primary: var(--ls-accent);
  --p-blue: var(--ls-accent);
  --p-blue-dark: var(--ls-accent-hover);
  --p-blue-soft: var(--ls-accent-soft);
  --p-ink: var(--ls-text);
  --p-muted: var(--ls-muted);
  --p-line: var(--ls-border);
  --p-bg: var(--ls-canvas);
}

body.zoho-theme:not(.pos-sale-theme):not(.lockscreen) .thetop {
  background: #1f232b !important;
  border-bottom: none !important;
  min-height: var(--ls-topbar-height) !important;
}

/* Global Lightspeed canvas on every page */
body.zoho-theme:not(.pos-sale-theme):not(.lockscreen) .zoho-app-body,
body.zoho-theme:not(.pos-sale-theme):not(.lockscreen) .zoho-main-column,
body.zoho-theme:not(.pos-sale-theme):not(.lockscreen) #scrollable-container,
body.zoho-theme:not(.pos-sale-theme):not(.lockscreen) .content-wrapper,
body.zoho-theme:not(.pos-sale-theme):not(.lockscreen) .content {
  background: var(--ls-canvas) !important;
}

/* Gap under top bar → content (all pages) */
body.zoho-theme:not(.pos-sale-theme) #scrollable-container {
  padding-top: var(--ls-content-pad-top) !important;
  box-sizing: border-box;
}

body.zoho-theme:not(.pos-sale-theme) #scrollable-container > .content-header {
  padding-top: 4px !important;
}

body.zoho-theme:not(.pos-sale-theme) #scrollable-container > .content,
body.zoho-theme:not(.pos-sale-theme) #scrollable-container > section.content {
  padding-top: 4px !important;
}

/* Top bar */
body.zoho-theme .ls-topbar {
  background: #1f232b;
  height: var(--ls-topbar-height);
  min-height: var(--ls-topbar-height);
  position: relative;
  z-index: 1030;
}

.ls-topbar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--ls-topbar-height);
  padding: 0 16px;
}

.ls-topbar__left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  flex-shrink: 0;
}

.ls-topbar__brand {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  text-transform: lowercase;
  letter-spacing: -0.02em;
}

.ls-topbar__brand-name {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ls-topbar__search {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.ls-topbar__search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: #2a2f3a;
  border-radius: 8px;
  padding: 0 12px;
  height: 34px;
  position: relative;
  z-index: 2;
}

.ls-topbar__search.is-open .ls-topbar__search-box {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.ls-topbar__search-icon {
  width: 16px;
  height: 16px;
  color: #9aa3b2;
  flex-shrink: 0;
}

.ls-topbar__search-input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 13px;
  min-width: 0;
}

.ls-topbar__search-input::placeholder {
  color: #8b93a3;
}

.ls-topbar__search-kbd {
  font-size: 11px;
  color: #8b93a3;
  border: 0;
  background: transparent;
  font-family: inherit;
  flex-shrink: 0;
}

/* Global search dropdown */
.ls-gs-panel {
  position: fixed;
  top: 60px;
  left: 0;
  width: 560px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  z-index: 1050;
  border: 1px solid #e5e7eb;
}

/* Hide search panel when modal is open */
body.modal-open .ls-gs-panel {
  display: none !important;
}

.ls-gs-tabs {
  display: flex;
  gap: 0;
  padding: 0 8px;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
  scrollbar-width: none;
}

.ls-gs-tabs::-webkit-scrollbar {
  display: none;
}

.ls-gs-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 12px 14px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #1f2430;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.ls-gs-tab:hover {
  color: var(--ls-accent);
}

.ls-gs-tab.is-active {
  color: var(--ls-accent);
  border-bottom-color: var(--ls-accent);
}

.ls-gs-results {
  max-height: min(420px, 60vh);
  overflow-y: auto;
  padding: 6px 0;
}

.ls-gs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none !important;
  color: inherit;
  transition: background 0.12s ease;
}

.ls-gs-item:hover,
.ls-gs-item.is-active {
  background: rgba(88, 68, 237, 0.08);
  text-decoration: none !important;
}

.ls-gs-item__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ls-gs-item__icon svg {
  width: 18px;
  height: 18px;
}

.ls-gs-item__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ls-gs-item__title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ls-gs-item__sub {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.2;
}

.ls-gs-empty,
.ls-gs-loading {
  padding: 28px 16px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
}

@media (max-width: 1023px) {
  .ls-topbar__search {
    max-width: none;
    margin: 0 8px;
  }

  .ls-topbar__search-kbd {
    display: none;
  }
}

.ls-topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.ls-topbar__text-link {
  color: #d1d5db;
  font-size: 13px;
  text-decoration: none;
}

.ls-topbar__text-link:hover {
  color: #fff;
}

.ls-topbar__icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ls-topbar__user > summary {
  list-style: none;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.ls-topbar__user > summary::-webkit-details-marker {
  display: none;
}

.ls-topbar__user {
  position: relative;
}

.ls-topbar__user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  width: 220px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--ls-border);
  padding: 4px 0;
  margin: 0;
  list-style: none;
}

.ls-topbar__user-meta {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f1f3;
}

.ls-topbar__user-menu a {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  color: #374151;
  text-decoration: none;
}

.ls-topbar .notifications_count,
.ls-topbar .label-warning {
  background: var(--ls-accent) !important;
}

/* Dual sidebar widths — beat premium 248px !important */
body.zoho-theme:not(.pos-sale-theme) .side-bar.ls-sidebar,
body.zoho-theme:not(.pos-sale-theme) aside.side-bar.ls-sidebar {
  width: var(--ls-rail-width) !important;
  min-width: var(--ls-rail-width) !important;
  max-width: var(--ls-rail-width) !important;
  background: var(--ls-rail-bg) !important;
  border-right: 1px solid var(--ls-border) !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 40;
  transition: none;
  box-shadow: none !important;
}

/* Keep rail width fixed — secondary panel overlays main content (no push) */
body.zoho-theme:not(.pos-sale-theme) .side-bar.ls-sidebar.ls-sidebar--panel-open,
body.zoho-theme:not(.pos-sale-theme) aside.side-bar.ls-sidebar.ls-sidebar--panel-open {
  width: var(--ls-rail-width) !important;
  min-width: var(--ls-rail-width) !important;
  max-width: var(--ls-rail-width) !important;
  background: var(--ls-rail-bg) !important;
}

body.zoho-theme:not(.pos-sale-theme) .side-bar.ls-sidebar.zoho-sidebar-collapsed,
body.zoho-theme:not(.pos-sale-theme) aside.side-bar.ls-sidebar.zoho-sidebar-collapsed,
body.zoho-theme:not(.pos-sale-theme).sidebar-collapse .side-bar.ls-sidebar,
body.zoho-theme:not(.pos-sale-theme).sidebar-collapse aside.side-bar.ls-sidebar {
  width: var(--ls-rail-width) !important;
  min-width: var(--ls-rail-width) !important;
  max-width: var(--ls-rail-width) !important;
}

body.zoho-theme:not(.pos-sale-theme) .side-bar.ls-sidebar.zoho-sidebar-collapsed .ls-secondary,
body.zoho-theme:not(.pos-sale-theme).sidebar-collapse .side-bar.ls-sidebar .ls-secondary {
  display: none !important;
  width: 0 !important;
}

/* Override premium #side-bar scroll/padding — this is the dual-rail flex row */
body.zoho-theme:not(.pos-sale-theme) .ls-sidebar #side-bar.ls-nav,
body.zoho-theme:not(.pos-sale-theme) .ls-sidebar .ls-nav#side-bar {
  display: flex !important;
  flex-direction: row !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  position: relative !important;
}

.ls-icon-rail {
  width: var(--ls-rail-width);
  flex-shrink: 0;
  background: var(--ls-rail-bg);
  border-right: 1px solid var(--ls-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 0 12px;
}

.ls-icon-rail__top,
.ls-icon-rail__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Collapse chevron: only when secondary submenu panel is open */
body.zoho-theme:not(.pos-sale-theme) .ls-rail-collapse,
body.zoho-theme:not(.pos-sale-theme) .ls-icon-rail__bottom .side-bar-collapse {
  display: none !important;
}

body.zoho-theme:not(.pos-sale-theme) .ls-sidebar--panel-open .ls-rail-collapse,
body.zoho-theme:not(.pos-sale-theme) .ls-sidebar--panel-open .ls-icon-rail__bottom .side-bar-collapse {
  display: inline-flex !important;
}

.ls-icon-rail__top {
  padding-top: 4px;
}

.ls-rail-btn {
  width: 56px;
  min-height: 52px;
  padding: 6px 4px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: #4b5563;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.ls-rail-btn:hover {
  background: rgba(88, 68, 237, 0.08);
  color: var(--ls-accent);
}

.ls-rail-btn.is-active {
  color: var(--ls-accent);
  background: var(--ls-accent-soft);
}

.ls-rail-btn.is-active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--ls-accent);
}

.ls-rail-icon svg {
  width: 20px;
  height: 20px;
}

.ls-rail-label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Secondary submenu panel — overlay to the right of icon rail */
.ls-secondary {
  position: absolute;
  left: var(--ls-rail-width);
  top: 0;
  bottom: 0;
  width: 0;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  opacity: 0;
  z-index: 45;
  border-right: 1px solid var(--ls-border);
  box-shadow: 8px 0 24px rgba(26, 29, 38, 0.08);
  /* No width transition on load — prevents submenu flash during navigation */
  transition: none;
  pointer-events: none;
}

.ls-sidebar--panel-open .ls-secondary,
.ls-secondary.is-visible:not(.ls-secondary--empty) {
  width: var(--ls-secondary-width);
  opacity: 1;
  overflow: hidden;
  pointer-events: auto;
}

.ls-secondary--empty {
  width: 0 !important;
  opacity: 0 !important;
  pointer-events: none;
}

/* Dim page behind subcategory panel on small / laptop screens */
.ls-secondary-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(26, 29, 38, 0.35);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.ls-secondary-backdrop.is-visible {
  display: block;
}

@media (min-width: 1281px) {
  .ls-secondary-backdrop {
    display: none !important;
  }
}

.ls-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.ls-panel.is-open {
  display: flex;
}

.ls-panel[hidden] {
  display: none !important;
}

.ls-panel-title {
  padding: 22px 16px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
}

.ls-panel-scroll {
  overflow-y: auto;
  padding: 4px 0 16px;
  flex: 1;
  scrollbar-width: none;
}

.ls-panel-scroll::-webkit-scrollbar {
  display: none;
}

.ls-panel-section {
  padding: 12px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
}

.ls-panel-row {
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 8px;
}

.ls-panel-link {
  flex: 1;
  display: block;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--ls-text);
  text-decoration: none;
  border-radius: 6px;
}

.ls-panel-row:hover .ls-panel-link {
  background: #f7f8fa;
}

.ls-panel-row.is-active .ls-panel-link,
.ls-panel-link.is-active {
  color: #1e293b;
  font-weight: 600;
  background: rgba(88, 68, 237, 0.08);
  border-radius: 6px;
}

.ls-panel-row.is-active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--ls-accent);
}

.ls-panel-add {
  display: none;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  color: var(--ls-accent);
  text-decoration: none;
  font-weight: 600;
  margin-right: 4px;
  border-radius: 6px;
}

.ls-panel-row.has-add:hover .ls-panel-add,
.ls-panel-row.has-add.is-active .ls-panel-add {
  display: inline-flex;
}

body.zoho-theme .zoho-app-body,
body.zoho-theme .zoho-main-column,
body.zoho-theme #scrollable-container {
  background: var(--ls-canvas) !important;
}

body.zoho-theme .zoho-sidebar-search {
  display: none !important;
}

/* Links / accents globally (not nav chrome) */
body.zoho-theme a:not(.btn):not(.ls-rail-btn):not(.ls-panel-link):not(.ls-panel-add):not(.ls-topbar__brand):not(.ls-topbar__text-link):not(.ls-topbar__icon-btn):not(.ls-topbar__user-btn):not(.ls-gs-item):not(.ls-gs-tab) {
  color: var(--ls-accent);
}

<body.zoho-theme .pagination > .active > a,
body.zoho-theme .pagination > .active > span {
  background-color: var(--ls-accent) !important;
  border-color: var(--ls-accent) !important;
}

body.zoho-theme .label-primary,
body.zoho-theme .badge-primary,
body.zoho-theme .bg-primary {
  background-color: var(--ls-accent) !important;
}

@media (max-width: 1023px) {
  .ls-topbar__search-kbd {
    display: none;
  }

  body.zoho-theme:not(.pos-sale-theme) #scrollable-container {
    padding-top: 28px !important;
  }
}
