@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  line-height: 1.5;
  color: #333;
  background: #fff;
}

/* Site header - McMaster-Carr style */
.site-header {
  background-color: #0b80a4;
  border-bottom: 2px solid #FED700;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 9999;
  box-shadow: none;
  transition: all 0.3s ease;
}

/* Header Scrolled State */
.site-header.header-scrolled {
  background-color: rgba(11, 128, 164, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(254, 215, 0, 0.5);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.site-header.header-scrolled .header-top {
  background-color: transparent;
}

.site-header.header-scrolled .shell-layout-masthead-nav-container {
  overflow: hidden !important;
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  border-top: none !important;
}

.header-top-logo {
  display: flex;
  align-items: center;
  max-width: 0;
  opacity: 0;
  margin-right: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-top-logo img {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
  object-fit: contain;
}

.site-header.header-scrolled .header-top-logo {
  max-width: 200px;
  opacity: 1;
  margin-right: 1.25rem;
}

.site-header .header-top,
.audit-minimal-header .header-top {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 12px;
  max-width: 100%;
  margin: 0;
  min-height: 60px;
  justify-content: space-between;
  position: relative;
  background-color: #0b80a4;
}

@media screen and (max-width: 768px) {

  .site-header .header-top,
  .audit-minimal-header .header-top {
    flex-wrap: wrap;
    padding: 10px 15px;
    gap: 10px;
  }

  .shell-layout-search-entry-container {
    order: 3;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
  }

  .masthead-top-right {
    order: 2;
    font-size: 11px;
  }

  .nav-button-text {
    display: none;
  }

  .nav-button {
    padding: 0.5rem;
    min-width: 40px;
    justify-content: center;
  }

  .header-link-text {
    display: none;
  }

  .header-icon-link .header-icon {
    width: 20px;
    height: 20px;
  }

  [data-tooltip]::after {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
}

/* Extra tight spacing for phones < 480px */
@media screen and (max-width: 480px) {
  .site-header .header-top,
  .audit-minimal-header .header-top {
    gap: 4px;
    padding: 8px 10px;
  }

  .nav-buttons-container {
    gap: 2px;
  }

  .nav-button {
    padding: 0.375rem;
    min-width: 36px;
    font-size: 0.75rem;
  }

  .nav-button-icon {
    width: 18px;
    height: 18px;
  }

  .masthead-top-right {
    font-size: 9px;
  }

  .header-user {
    font-size: 0.6rem;
    padding-left: 4px;
    margin-left: 0;
    gap: 2px;
    border-left: 1px solid rgba(255,255,255,0.1);
  }

  .header-right {
    gap: 2px;
  }

  .divider {
    display: none;
  }

  /* Hide less essential buttons on very small screens */
  .nav-button--lab-reports,
  .nav-button--sobre-nosotros,
  .nav-button--audit {
    display: none;
  }

  #MainContent {
    padding: 0 0.5rem;
  }

  .main-content {
    padding: 0.75rem;
    padding-top: 80px;
  }

  .page {
    gap: 1rem;
  }
}

/* Browse Catalog Button */
#ShellLayout_BrowseCatalog_Cntnr {
  position: relative;
  flex-shrink: 0;
}

.nav-buttons-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: white;
  cursor: pointer;
  font-family: "FuturaLTPro-BoldCond", Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  padding: 0.625rem;
  min-width: 44px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.12);
  transition: all 0.2s ease;
}

.nav-button:active {
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.1s ease;
}

.nav-button-icon {
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 20px;
  height: 20px;
}

.nav-button-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-button:hover .nav-button-icon {
  transform: scale(1.15) rotate(5deg);
}

.nav-button:hover .nav-button-icon img {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8));
}

/* Nav buttons: icon only, label shown in header-active-value on the right */
.nav-button-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-button-collapsed .nav-button-text,
.nav-button .nav-button-text {
  display: none;
}

.nav-button-collapsed {
  padding: 0.625rem;
  min-width: 44px;
  justify-content: center;
}

.nav-button-collapsed:hover .nav-button-text,
.nav-button-collapsed:focus .nav-button-text,
.nav-button-collapsed.expanded .nav-button-text {
  display: none;
}

/* Tooltip styles */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(0, 0, 0, 0.92);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.72rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 10000;
  font-family: Arial, sans-serif;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  letter-spacing: 0.02em;
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 10001;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Nav-button tooltips: show BELOW the icon (header is at top of page) */
.nav-button[data-tooltip]::after,
.nav-buttons-container [data-tooltip]::after {
  bottom: auto;
  top: 100%;
  transform: translateX(-50%) translateY(6px);
}
.nav-button[data-tooltip]:hover::after,
.nav-buttons-container [data-tooltip]:hover::after {
  transform: translateX(-50%) translateY(4px);
}
.nav-button[data-tooltip]::before,
.nav-buttons-container [data-tooltip]::before {
  bottom: auto;
  top: 100%;
  transform: translateX(-50%) translateY(2px);
  border-top-color: transparent;
  border-bottom-color: rgba(0,0,0,0.92);
}
.nav-button[data-tooltip]:hover::before,
.nav-buttons-container [data-tooltip]:hover::before {
  transform: translateX(-50%) translateY(2px);
  opacity: 1;
}
/* header-right buttons also show below */
.header-right [data-tooltip]::after {
  bottom: auto;
  top: 100%;
  transform: translateX(-50%) translateY(6px);
}
.header-right [data-tooltip]:hover::after {
  transform: translateX(-50%) translateY(4px);
}
.header-right [data-tooltip]::before {
  bottom: auto;
  top: 100%;
  transform: translateX(-50%) translateY(2px);
  border-top-color: transparent;
  border-bottom-color: rgba(0,0,0,0.92);
}
.header-right [data-tooltip]:hover::before {
  transform: translateX(-50%) translateY(2px);
  opacity: 1;
}

/* Legacy support for old ID */
#BrowseCatalog_Button {
  color: inherit;
  background: inherit;
  border: inherit;
  padding: inherit;
  text-decoration: none;
}

#BrowseCatalog_Button:hover {
  text-decoration: none;
}

/* Browse Catalog Menu */
#BrowseCatalog_Cntnr {
  position: relative;
}

#BrowseCatalog_Cntnr .overlay {
  background: #999;
  bottom: 0;
  left: 0;
  pointer-events: none;
  opacity: 0;
  position: fixed;
  right: 0;
  top: 0;
  transition: opacity 0.3s ease-out 0s;
  z-index: 10000000;
}

#BrowseCatalog_Cntnr .overlay.active {
  opacity: 0.6;
  pointer-events: auto;
}

.browse-catalog-menu {
  background-color: white;
  display: flex;
  flex-flow: column nowrap;
  height: 100%;
  left: -400px;
  position: fixed;
  top: 0;
  transition: left 0.3s ease-out 0s;
  width: 400px;
  z-index: 10000005;
}

.browse-catalog-menu.active {
  left: 0;
}

.browse-catalog-menu header {
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.browse-catalog-menu header .logo-link img {
  height: 24px;
  width: auto;
  max-width: 140px;
}

.browse-catalog-menu header .close-button {
  background-image: url("https://images1.mcmaster.com/mvC/gfx/cancel.png?ver=1746113590");
  background-origin: content-box;
  background-repeat: no-repeat;
  background-size: contain;
  cursor: pointer;
  height: 16px;
  position: absolute;
  right: 21px;
  top: 21px;
  width: 16px;
  border: none;
  background-color: transparent;
}

.browse-catalog-menu .category-list {
  overflow-y: scroll;
  list-style: none;
  padding: 0;
  margin: 0;
}

.browse-catalog-menu .category-list::-webkit-scrollbar {
  position: relative;
  width: 10px;
  background-color: #c9c9c9;
}

.browse-catalog-menu .category-list::-webkit-scrollbar-thumb {
  background-color: #a0a0a0;
}

.browse-catalog-menu .category-tile {
  align-items: center;
  border-color: #efefef;
  border-radius: 0px;
  border-style: solid;
  border-width: 0.01px;
  box-sizing: border-box;
  color: #000;
  display: flex;
  height: 62px;
  padding: 9.75px 8.5px;
  width: 100%;
  text-decoration: none;
}

.browse-catalog-menu .category-tile:hover {
  background-color: #EDF2ED;
}

.browse-catalog-menu .category-tile>img {
  height: 40.5px;
  margin-right: 9.25px;
  width: 40.5px;
}

.browse-catalog-menu .category-tile>.category-name {
  font-family: "HelveticaNeueeTextPro-Roman", Arial, sans-serif;
  font-size: 13px;
  font-style: normal;
  font-weight: bold;
}

/* Masthead Top Right */
.masthead-top-right {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  order: 3;
  white-space: nowrap;
  margin-left: auto;
}

.masthead-top-right .link-wrapper {
  display: inline-block;
}

.masthead-top-right .link-wrapper>a {
  color: white;
  font-family: "HelveticaNeueeTextPro-Roman", Arial, sans-serif;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
  padding: 4px 8px;
  border-radius: 4px;
  position: relative;
}

.header-active-value {
  color: #ffffff;
}

.masthead-top-right [data-tooltip]::after {
  bottom: auto;
  top: 100%;
  margin-top: 8px;
}

.masthead-top-right [data-tooltip]::before {
  bottom: auto;
  top: 100%;
  margin-top: 2px;
  border-top-color: transparent;
  border-bottom-color: rgba(0, 0, 0, 0.95);
}

.masthead-top-right [data-tooltip]:hover::after,
.masthead-top-right [data-tooltip]:hover::before {
  transform: translateX(-50%) translateY(4px);
}

.masthead-top-right .link-wrapper>a:hover {
  background: rgba(255, 255, 255, 0.15);
}

.header-icon-link .header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  transition: opacity 0.2s ease;
}

.header-icon-link .header-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.header-icon-link:hover .header-icon {
  opacity: 0.8;
}

.header-link-text {
  white-space: nowrap;
}

.masthead-top-right .link-wrapper:last-of-type {
  border-right: 0;
  padding-right: 0;
}

.masthead-top-right .divider {
  background-color: rgba(255, 255, 255, 0.5);
  display: inline-block;
  height: 7px;
  width: 1px;
  margin: 1px 12px;
}

/* User info styles */
.masthead-top-right .user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.masthead-top-right .user-greeting {
  color: white;
  font-family: "HelveticaNeueeTextPro-Roman", Arial, sans-serif;
  font-size: 12px;
}

.masthead-top-right .user-greeting strong {
  font-weight: 600;
  color: white;
}

.masthead-top-right .admin-badge {
  display: inline-block;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.masthead-top-right .logout-link {
  color: white;
  font-family: "HelveticaNeueeTextPro-Roman", Arial, sans-serif;
  font-size: 12px;
  text-decoration: none;
  margin-left: 4px;
}

.masthead-top-right .logout-link:hover {
  text-decoration: underline;
  color: rgba(255, 255, 255, 0.8);
}

/* Logo Container */
.shell-layout-logo-container {
  flex-shrink: 0;
  margin-right: auto;
  order: 1;
}

.logo-web-part {
  display: block;
  line-height: 0;
}

.logo-web-part a {
  display: block;
  line-height: 0;
  text-decoration: none;
}

.logo-web-part a img {
  height: 24px !important;
  width: auto !important;
  max-width: 140px !important;
  display: block;
  object-fit: contain;
  border: 0;
  outline: none;
}

/* Search Entry - moved to catalog content */
.shell-layout-search-entry-container {
  display: none;
}

/* Header search - if we add it back */
.header-search-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  max-width: calc(100% - 400px);
}

.container-searchentry {
  position: relative;
  width: 100%;
}

.container-searchentry .searchbar {
  background-color: #fff;
  border: 1px solid #999;
  border-radius: 999px;
  padding-right: 80px;
  text-indent: 2px;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  font-size: 13px;
  height: 32px;
  padding-left: 5px;
  padding-top: 2px;
  vertical-align: middle;
  width: 100%;
  z-index: 1000;
  display: block;
  pointer-events: auto;
  -webkit-user-select: text;
  user-select: text;
  color: #000;
}

.container-searchentry .ac-searchbar {
  z-index: -1;
  display: inline;
  position: absolute;
  left: 0px;
  height: 32px;
  width: 100%;
  padding-left: 6px;
  padding-top: 2px;
  padding-right: 68px;
  vertical-align: middle;
  font-family: arial, sans-serif;
  font-size: 13px;
  line-height: 20px;
  text-indent: 2px;
  border: 1px;
  border-radius: 2px;
  box-shadow: none;
  color: #888888;
  overflow: hidden;
  box-sizing: border-box;
}

.container-searchentry .clear-button {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 0C2.7 0 0 2.7 0 6s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6zm2.5 7.5L7.5 6l1-1.5L6.5 3.5 5 4.5 4 3 2.5 4.5 4 6l-1.5 1.5L4 9l1-1 1.5 1.5L8 8.5l1-1z'/%3E%3C/svg%3E") center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  cursor: pointer;
  height: 12px;
  position: absolute;
  top: 10px;
  right: 45px;
  width: 12px;
  border: none;
  background-color: transparent;
}

.container-searchentry .clear-button {
  display: block;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.container-searchentry .clear-button:hover {
  opacity: 1;
}

.container-searchentry .clear-button.inactive {
  opacity: 0;
  pointer-events: none;
}

.container-searchentry .VerticalSeprt {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='14' viewBox='0 0 1 14'%3E%3Cpath fill='%23999' d='M0 0h1v14H0z'/%3E%3C/svg%3E") center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  height: 14px;
  position: absolute;
  top: 9px;
  right: 35px;
  width: 1px;
}

.container-searchentry .VerticalSeprt.inactive {
  display: none;
}

.container-searchentry .searchbar-button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-block;
  height: 24px;
  padding: 0 12px;
  border: 1px solid #999;
  background: #363;
  color: white;
  font-family: Arial, sans-serif;
  font-size: 12px;
  cursor: pointer;
  z-index: 1001;
  border-radius: 999px;
  line-height: 24px;
}

.container-searchentry .searchbar-button:hover {
  background: #2a4a2a;
}

/* Autocomplete */
.search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #999;
  border-top: none;
  max-height: 400px;
  overflow-y: auto;
  z-index: 10000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: none;
}

.search-autocomplete.active {
  display: block;
}

.search-autocomplete-item {
  padding: 14px 18px;
  cursor: pointer;
  border-bottom: 1px solid rgba(100, 116, 139, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  background: #1e293b;
  color: #f1f5f9;
}

.search-autocomplete-item-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: #334155;
  border: 1px solid #475569;
}

.search-autocomplete-item:hover,
.search-autocomplete-item.highlighted {
  background: linear-gradient(135deg, #334155 0%, #475569 100%);
  color: #ffffff;
  transform: translateX(4px);
  box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1);
}

.search-autocomplete-item.highlighted {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
}

.search-autocomplete-item-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #ffffff;
  padding: 0.3rem 0.6rem;
  background: rgba(59, 130, 246, 0.3);
  border-radius: 3px;
  min-width: 90px;
  text-align: center;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

.search-autocomplete-item-name {
  flex: 1;
  color: #ffffff;
  font-weight: 500;
}

.search-autocomplete-item-type.category {
  background: #dbeafe;
  color: #1e40af;
}

.search-autocomplete-item-type.subcategory {
  background: #fef3c7;
  color: #92400e;
}

.search-autocomplete-item-type.product {
  background: #d1fae5;
  color: #065f46;
}

.search-autocomplete-item-type.supplier {
  background: #fce7f3;
  color: #9f1239;
}

.search-autocomplete-item-type.client {
  background: #e0e7ff;
  color: #3730a3;
}

/* Masthead Nav */
.shell-layout-masthead-nav-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid #e5e7eb;
  background-color: #fff;
  padding: 6px 12px;
  max-width: 100%;
  margin: 0;
  justify-content: space-between;
}

.shell-layout-logo-container-masthead {
  flex-shrink: 0;
  margin-right: 1rem;
}

.shell-layout-logo-container-masthead .logo-web-part {
  display: block;
  line-height: 0;
}

.shell-layout-logo-container-masthead .logo-web-part a {
  display: block;
  line-height: 0;
  text-decoration: none;
}

.shell-layout-logo-container-masthead .masthead-logo {
  height: 45px !important;
  width: auto !important;
  max-width: 240px !important;
  display: block;
  object-fit: contain;
  border: 0;
  outline: none;
}

.masthead-nav .masthead-nav-ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.masthead-nav .li-masthead {
  position: relative;
  display: block;
  float: left;
  white-space: nowrap;
  margin-right: 1rem;
}

.masthead-nav .li-masthead:last-of-type {
  margin-right: 0;
}

.masthead-nav .li-masthead.li-masthead--order {
  width: auto;
}

.masthead-nav a {
  font-size: 16px;
  font-family: "FuturaLTPro-BoldCond", Arial, sans-serif;
  text-transform: uppercase;
  color: #0066cc;
  text-decoration: none;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.masthead-nav a:hover {
  text-decoration: underline;
  color: #0052a3;
}

.masthead-nav-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.shell-contentcontainer {
  position: relative;
  width: 100%;
  padding-top: 0;
  background: #fff;
}

/* Bottom Nav */
#BottomNavWebPart_Cntnr {
  padding-top: 0;
  padding-bottom: 2px;
  padding-left: 5px;
}

#BottomNavWebPart_Cntnr .VerticalSeprt {
  display: inline;
  font-size: 16px;
  color: #999;
}

#BottomNavWebPart_TermsCntnr {
  float: right;
  padding-top: 4px;
  padding-right: 8px;
  padding-left: 15px;
}

#BottomNavWebPart_TermsCntnr .TermsTxt {
  color: #000;
  font-size: 11px;
}

#BottomNavWebPart_LnksCntnr {
  display: inline;
}

#BottomNavWebPart_LnksCntnr .BottomNavLnk {
  display: inline-block;
  padding: 3px 7px;
  color: #000;
  text-decoration: none;
  font-size: 11px;
}

#BottomNavWebPart_LnksCntnr .BottomNavLnk:hover {
  text-decoration: underline;
}

@media screen and (max-width: 950px) {
  #BottomNavWebPart_LnksCntnr .BottomNavLnk {
    padding: 3px 4px;
  }
}

/* Simplified Footer */
.footer {
  border-top: 1px solid #ddd;
  background-color: #f8f8f8;
  padding: 15px 0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-nav a {
  color: #333;
  text-decoration: none;
  font-size: 14px;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-nav span {
  color: #999;
}

.footer-copyright {
  color: #666;
  font-size: 12px;
}

.footer-copyright p {
  margin: 0;
}

@media screen and (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
}

/* Body and HTML */
html {
  height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100%;
  position: relative;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

#ShellLayout_Cntnr {
  min-height: 100%;
  position: relative;
}

#ShellLayout_MainContent_Cntnr {
  border-right: 0;
  border-left: none;
  width: 100%;
}

#MainContent {
  background-color: #FFF;
  padding: 0 10px 0 20px;
  position: relative;
  zoom: 1;
}

.main-content {
  min-height: calc(100vh - 200px);
  padding: 2rem;
  padding-top: 90px;
  max-width: 1200px;
  margin: 0 auto;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 3rem;
}

.hero {
  background: linear-gradient(135deg, rgba(11, 128, 164, 0.7), rgba(14, 79, 104, 0.75)), url('/images/categories/abt_laboratorios.png');
  background-size: cover;
  background-position: center;
  color: white;
  padding: 2rem 0;
  border-radius: 0;
  position: relative;
  overflow: visible;
  border-bottom: 1px solid #e5e7eb;
}

.hero::after {
  display: none;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  max-width: 720px;
  color: white;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
  max-width: 620px;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.hero-actions a {
  background: #363;
  color: white;
  border-radius: 4px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #363;
  display: inline-block;
}

.hero-actions a:hover {
  background: #2a4a2a;
  border-color: #2a4a2a;
}

.hero-actions a.secondary {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
  backdrop-filter: blur(10px);
}

.hero-actions a.secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.7);
}

.hero-search {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.hero-search-container {
  width: 100%;
  max-width: 600px;
  position: relative;
  overflow: visible;
  z-index: 1;
}

.hero-search-container .container-searchentry {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: visible;
  min-width: 0;
}

.hero-searchbar {
  flex: 1;
  padding: 0.9rem 1.25rem;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  background: transparent;
  color: #333;
  outline: none;
  min-width: 0;
  width: 0;
}

.hero-searchbar::placeholder {
  color: #999;
}

.hero-search-container .searchbar-button {
  background: #0B80A4;
  color: white;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.hero-search-container .searchbar-button:hover {
  background: #0e4f68;
}

.hero-search-container .clear-button {
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 0.5rem;
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-search-container .clear-button.inactive {
  display: none;
}

.hero-search-container .search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-top: 4px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 10000;
  display: none;
}

.hero-search-container .search-autocomplete.active {
  display: block;
}

.hero-search-container .search-autocomplete-results {
  padding: 0.5rem;
}

.hero-search-container .search-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.hero-search-container .search-autocomplete-item:hover,
.hero-search-container .search-autocomplete-item.highlighted {
  background: #f3f4f6;
}

.hero-search-container .search-autocomplete-item-image {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  flex-shrink: 0;
}

.hero-search-container .search-autocomplete-item-name {
  flex: 1;
  color: #333;
  font-size: 0.9rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.section-header h2,
.section-header h1 {
  color: #333;
  font-weight: 600;
  margin: 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background: white;
  border-radius: 0;
  padding: 1.25rem;
  box-shadow: none;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background-color 0.15s;
  border: 1px solid #e5e7eb;
}

.category-card:hover {
  border-color: #363;
  background: #f9f9f9;
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.category-card h3 {
  margin: 0.25rem 0;
  font-size: 1.1rem;
  color: #333;
  font-weight: 600;
}

.category-card ul {
  margin-top: 0.75rem;
  padding-left: 1.25rem;
  color: #666;
  font-size: 0.9rem;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.quick-links a {
  display: block;
  text-decoration: none;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: white;
  font-weight: 600;
  color: #0B80A4;
  border: 1px solid rgba(15, 118, 227, 0.2);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.featured-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: white;
  border-radius: 0;
  padding: 1.25rem;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid #e5e7eb;
}

.product-card:hover {
  border-color: #e0e7ef;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.product-card ul {
  padding-left: 1.1rem;
  color: #475569;
}

.contact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  background: #0B80A4;
  color: white;
  border-radius: 1rem;
  padding: 1.5rem;
  align-items: center;
}

.contact-strip a {
  color: white;
  text-decoration: underline;
}

.product-catalog {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.product-category {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
}

.product-category h3 {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
  color: #0B80A4;
}

.product-category h4 {
  margin-top: 1.5rem;
  color: #0e4f68;
}

.product-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.catalog-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-top: 0;
}

.catalog-sidebar {
  position: sticky;
  top: 110px;
  width: 260px;
  background: #fef9c3;
  border: 1px solid #e5de8a;
  border-radius: 0.75rem;
  padding: 0.5rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}

.idexx-agua-sidebar {
  padding: 0.75rem;
  width: 220px;
}

.catalog-sidebar-header p {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.catalog-sidebar-header h2 {
  font-size: 0.85rem;
  color: #333;
  text-transform: none;
  font-weight: 600;
  margin: 0;
}

.catalog-nav {
  display: flex;
  flex-direction: column;
  margin-top: 0.5rem;
  list-style: none;
  padding: 0;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.catalog-nav::-webkit-scrollbar {
  width: 6px;
}

.catalog-nav::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.catalog-nav::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.catalog-nav::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.catalog-nav-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.2rem;
  color: #333;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  font-size: 0.65rem;
}

.catalog-nav-link:hover {
  background: #f5f5f5;
  border-left-color: #363;
}

.catalog-nav-index {
  font-family: Arial, sans-serif;
  font-size: 0.65rem;
  color: #999;
  width: 20px;
  font-weight: 600;
  flex-shrink: 0;
}

.catalog-nav-label {
  font-size: 0.65rem;
  font-weight: normal;
  color: #333;
}

.catalog-nav-category {
  margin-bottom: 0.1rem;
}

.catalog-subcategories {
  margin-left: 1.25rem;
  margin-top: 0.1rem;
  margin-bottom: 0.25rem;
  display: block;
  list-style: none;
  padding: 0;
}

.catalog-subcategories-nested {
  margin-left: 0.5rem;
  margin-top: 0.15rem;
  display: block;
  list-style: none;
  padding: 0;
}

.catalog-subcategories-nested .catalog-subcategory-link {
  font-size: 0.55rem;
  color: #666;
  padding-left: 0.5rem;
}

.catalog-subcategories-nested .catalog-subcategory-link:hover {
  color: #0B80A4;
}

.catalog-subcategory-link {
  display: block;
  padding: 0.1rem 0.2rem;
  color: #555;
  text-decoration: none;
  font-size: 0.6rem;
  border-left: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  margin-left: 0.25rem;
}

.catalog-subcategory-link:hover {
  background: #f5f5f5;
  border-left-color: #363;
  color: #333;
}

.catalog-sidebar-note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Catalog Filters */
.catalog-filters {
  margin-top: 1rem;
}

.idexx-agua-sidebar .catalog-filters {
  margin-top: 0;
}

.catalog-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.idexx-agua-sidebar .catalog-filters-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5de8a;
}

.catalog-filters-header h3 {
  font-size: 1rem;
  color: #363;
  text-transform: uppercase;
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
}

.idexx-agua-sidebar .catalog-filters-header span {
  font-size: 0.75rem;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-clear {
  background: transparent;
  border: 1px solid #999;
  color: #666;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.idexx-agua-sidebar .filter-clear {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid #ccc;
  color: #555;
}

.filter-clear:hover {
  background: #f5f5f5;
}

.catalog-filters-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.25rem;
}

.catalog-filters-content::-webkit-scrollbar {
  width: 6px;
}

.catalog-filters-content::-webkit-scrollbar-track {
  background: #f9f4d3;
  border-radius: 3px;
}

.catalog-filters-content::-webkit-scrollbar-thumb {
  background: #c4b550;
  border-radius: 3px;
}

.catalog-filters-content::-webkit-scrollbar-thumb:hover {
  background: #a89a3d;
}

.idexx-agua-sidebar .catalog-filters-content {
  gap: 0;
}

.filter-item {
  padding: 0.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.idexx-agua-sidebar .filter-group {
  margin-bottom: 0;
}

.filter-group-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'JetBrains Mono', monospace;
}

.idexx-agua-sidebar .filter-group-label {
  display: none;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.idexx-agua-sidebar .filter-options {
  gap: 0;
  display: block;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #333;
  cursor: pointer;
  padding: 0.25rem 0;
  font-family: 'JetBrains Mono', monospace;
}

.idexx-agua-sidebar .filter-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  padding: 0.15rem 0;
  line-height: 1.3;
}

.filter-option:hover {
  color: #0066cc;
}

.filter-checkbox {
  margin: 0;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.idexx-agua-sidebar .filter-checkbox,
.idexx-agua-sidebar .filter-idexx-agua-checkbox {
  width: 14px;
  height: 14px;
  margin: 0;
  flex-shrink: 0;
}

/* Modular Filter System Styles */
.filter-group-collapsible {
  margin-bottom: 0.5rem;
}

.filter-group-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
  cursor: pointer;
  user-select: none;
}

.filter-group-toggle {
  background: transparent;
  border: none;
  padding: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.875rem;
  color: #666;
  flex-shrink: 0;
}

.filter-group-toggle:hover {
  color: #333;
}

.filter-group-toggle-icon {
  font-weight: bold;
  line-height: 1;
}

.filter-group-content {
  margin-left: 0;
}

.filter-group-collapsible .filter-group-content {
  transition: max-height 0.2s ease-out, opacity 0.2s ease-out;
  overflow: hidden;
}

.filter-option-image {
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin-right: 0.4rem;
  flex-shrink: 0;
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  background: white;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  padding: 0.15rem 0;
  line-height: 1.3;
  cursor: pointer;
}

.filter-option:hover {
  color: #0066cc;
}

.filter-option input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.filter-option span {
  flex: 1;
  min-width: 0;
}

/* Compact sidebar for modular filters */
.modular-filter-sidebar {
  padding: 0.75rem;
  width: 220px;
  font-family: 'JetBrains Mono', monospace;
}

.modular-filter-sidebar .catalog-filters {
  margin-top: 0;
}

.modular-filter-sidebar .catalog-filters-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5de8a;
}

.modular-filter-sidebar .catalog-filters-header span {
  font-size: 0.75rem;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'JetBrains Mono', monospace;
}

.modular-filter-sidebar .filter-clear {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid #ccc;
  color: #555;
  font-family: 'JetBrains Mono', monospace;
}

.modular-filter-sidebar .catalog-filters-content {
  gap: 0;
}

.modular-filter-sidebar .filter-group {
  margin-bottom: 0.5rem;
}

.modular-filter-sidebar .filter-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
}

.modular-filter-sidebar .filter-options {
  gap: 0;
  display: block;
  margin-top: 0.15rem;
}

/* Filter search input for large lists */
.filter-search-input {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  outline: none;
}

.filter-search-input:focus {
  border-color: #0B80A4;
  box-shadow: 0 0 0 2px rgba(11, 128, 164, 0.1);
}

.filter-options-scrollable {
  max-height: 250px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.filter-options-scrollable::-webkit-scrollbar {
  width: 6px;
}

.filter-options-scrollable::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.filter-options-scrollable::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.filter-options-scrollable::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.filter-option-hidden {
  display: none !important;
}

.filter-item strong {
  color: #363;
  margin-right: 0.5rem;
}

.filter-remove {
  background: transparent;
  border: none;
  color: #999;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.filter-remove:hover {
  color: #666;
}

.catalog-content {
  flex: 1;
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  min-width: 0;
  overflow-x: auto;
}

.catalog-intro p:first-child {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.catalog-intro h1 {
  font-size: 1.75rem;
  margin: 0 0 0.75rem 0;
  color: #333;
  font-weight: 600;
}

.catalog-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.catalog-total-count {
  font-size: 0.875rem;
  color: #666;
  font-weight: normal;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

.catalog-search-container {
  margin-top: 0;
  margin-bottom: 0;
  max-width: 600px;
  display: block;
}

.shell-layout-masthead-nav-container .catalog-search-container {
  margin-bottom: 0;
  margin-right: auto;
  flex: 1;
  max-width: 500px;
  min-width: 200px;
}

.shell-layout-masthead-nav-container .masthead-nav {
  margin-left: auto;
  flex-shrink: 0;
}

.product-detail-page .catalog-search-container {
  margin-bottom: 1.5rem;
  margin-top: 1rem;
  display: block !important;
  width: 100%;
  max-width: 600px;
}

.catalog-search-container .container-searchentry {
  width: 100%;
  position: relative;
}

.catalog-search-container .search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10000;
}

.catalog-search {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.catalog-search input {
  flex: 1;
  border: 1px solid #cbd5f5;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
}

.catalog-search button {
  border: none;
  background: #363;
  color: white;
  padding: 0 1.75rem;
  border-radius: 999px;
  font-weight: 600;
}

.catalog-section {
  border-top: 2px solid #e5e7eb;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.catalog-section-head {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.catalog-section-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.catalog-section-order {
  font-family: Arial, sans-serif;
  font-size: 1.5rem;
  color: #999;
  font-weight: 600;
  min-width: 40px;
}

.catalog-section-head h2 {
  font-size: 1.4rem;
  color: #333;
  font-weight: 600;
  margin: 0;
}

.catalog-section-description {
  max-width: 100%;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 0.5rem;
  flex: 1;
  min-width: 300px;
}

.catalog-subsection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
}

.catalog-subsection-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #397ea0;
  font-weight: 600;
}

.catalog-product-count {
  font-size: 0.875rem;
  color: #666;
  font-weight: normal;
  white-space: nowrap;
}

.catalog-subsections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
  width: 100%;
}

.catalog-subsection {
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
  width: 100%;
}

.catalog-subsection-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0.5rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #f0f0f0;
  height: 100%;
  min-height: auto;
}

.catalog-subsection-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #d0d5dd;
}

.catalog-subsection-image {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.catalog-subsection-info {
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.catalog-subsection-info h3 {
  font-size: 0.8rem;
  color: #1e293b;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.catalog-subsection-info .catalog-product-count {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: normal;
}

.catalog-items-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem 0.75rem;
  margin: 0;
  padding: 0;
}

.catalog-item {
  background: white;
  border: none;
  border-radius: 0;
  padding: 0;
  transition: opacity 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.catalog-item:hover {
  opacity: 0.8;
}

.catalog-item a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.catalog-item-image {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  filter: grayscale(100%);
  transition: filter 0.2s;
}

.catalog-item:hover .catalog-item-image {
  filter: grayscale(0%);
}

.catalog-item-name {
  font-weight: normal;
  color: #333;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: center;
  margin: 0;
}

.catalog-item a:hover .catalog-item-name {
  text-decoration: underline;
  color: #069;
}

.delete-product-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 10;
  padding: 0;
  font-weight: bold;
}

.catalog-item:hover .delete-product-btn {
  opacity: 1;
}

.delete-product-btn:hover {
  background: #dc2626;
}

.delete-product-btn:active {
  background: #b91c1c;
}

.delete-product-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.catalog-item-meta {
  font-size: 0.75rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.catalog-empty {
  font-size: 0.9rem;
  color: #94a3b8;
  font-style: italic;
}

.footer {
  background: #e2e8f0;
  border-radius: 1rem;
  margin-top: 3rem;
  padding: 1.5rem;
  text-align: center;
  color: #475569;
}

/* Admin pages */
.admin-dashboard {
  padding: 2rem;
}

.admin-nav {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
}

.admin-nav a {
  padding: 0.75rem 1.5rem;
  background: #0B80A4;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s;
}

.admin-nav a:hover {
  background: #066a87;
}

.product-form,
.category-form,
.page-form {
  background: #f9f9f9;
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.product-form form,
.category-form form,
.page-form form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-form label,
.category-form label,
.page-form label {
  font-weight: 500;
  color: #333;
}

.product-form input,
.category-form input,
.page-form input,
.product-form textarea,
.category-form textarea,
.page-form textarea {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.product-form button,
.category-form button,
.page-form button {
  padding: 0.75rem 1.5rem;
  background: #0B80A4;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.product-form button:hover,
.category-form button:hover,
.page-form button:hover {
  background: #066a87;
}

.products-list,
.categories-list,
.pages-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.product-item,
.category-item,
.page-item {
  padding: 1.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: white;
}

.product-item button,
.category-item button,
.page-item button {
  margin: 0.5rem 0.5rem 0.5rem 0;
  padding: 0.5rem 1rem;
  background: #0B80A4;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.product-item button:hover,
.category-item button:hover,
.page-item button:hover {
  background: #066a87;
}

@media (max-width: 1024px) {
  .catalog-layout {
    gap: 1.5rem;
  }

  .catalog-sidebar {
    width: 220px;
  }

  .catalog-content {
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .catalog-layout {
    gap: 1rem;
  }

  .catalog-sidebar {
    width: 200px;
    padding: 1rem;
  }

  .catalog-content {
    padding: 0.75rem;
  }
}

@media (max-width: 768px) {
  .catalog-layout {
    flex-direction: column;
    gap: 1rem;
  }

  .catalog-sidebar,
  .modular-filter-sidebar {
    display: none;
  }

  /* On product detail pages, show sidebar below the product content */
  .product-detail-page .catalog-sidebar {
    display: block;
    width: 100%;
    order: 2;
    position: relative;
    top: 0;
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
    margin-top: 0.5rem;
  }

  .product-detail-page .product-detail-left-sidebar {
    order: 2;
    position: relative;
    top: 0;
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
    margin-top: 0.5rem;
  }

  .product-detail-page .product-content-wrapper {
    order: 1;
  }

  .catalog-content {
    width: 100%;
    padding: 1rem;
  }

  .catalog-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem 0.5rem;
  }

  .catalog-item-image {
    width: 60px;
    height: 60px;
  }

  .catalog-item-name {
    font-size: 0.7rem;
  }

  .nav {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ClojureScript component logo styles */
.header .nav .logo,
img.logo {
  height: 24px !important;
  width: auto !important;
  max-width: 140px !important;
  display: block;
  object-fit: contain;
  border: 0;
  outline: none;
}

.header .nav a {
  display: inline-block;
  line-height: 0;
}

.main-content {
  padding: 1rem;
}

.hero {
  padding: 2rem;
}

.hero h1 {
  font-size: 2rem;
}

.hero-actions {
  flex-direction: column;
}

.product-groups,
.category-grid,
.quick-links,
.featured-products {
  grid-template-columns: 1fr;
}

.catalog-nav-link {
  border-left: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.catalog-subsections-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.catalog-subsection-image {
  width: 80px;
  height: 80px;
}

.catalog-subsection-link {
  padding: 0.5rem;
  min-height: auto;
}
}

@media (max-width: 640px) {
  .catalog-subsections-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .catalog-subsection-link {
    padding: 0.5rem;
    min-height: auto;
  }

  .catalog-subsection-image {
    width: 64px;
    height: 64px;
  }

  .catalog-subsection-info h3 {
    font-size: 0.7rem;
  }
}

@media (max-width: 640px) {
  .catalog-content {
    padding: 0.75rem;
  }

  .catalog-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
  }

  .catalog-item-image {
    width: 50px;
    height: 50px;
  }

  .catalog-item-name {
    font-size: 0.65rem;
  }
}

/* Product Detail Page - McMaster-Carr Style */
.product-detail-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

.product-content-wrapper {
  flex: 1;
  min-width: 0;
}

.breadcrumb {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #64748b;
}

.breadcrumb a {
  color: #069;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 0.5rem;
  color: #999;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.product-title-section {
  flex: 1;
}

.product-title {
  font-size: 2rem;
  font-weight: 600;
  color: #397ea0;
  margin: 0 0 0.5rem 0;
}

.product-meta {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #64748b;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.product-meta span {
  display: inline-flex;
  align-items: center;
}

.product-meta strong {
  color: #0f172a;
  font-weight: 600;
  margin-left: 0.25rem;
}

.product-category {
  display: none !important;
}

.product-availability {
  text-align: right;
}

.availability-badge {
  display: inline-block;
  background: #10b981;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.availability-text {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

.product-content-layout {
  display: block;
  margin-top: 2rem;
  position: relative;
  z-index: 0;
}

.product-content-wrapper .product-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}

.product-main {
  min-width: 0;
}

.product-image-wrapper-section {
  margin-bottom: 2rem;
}

.product-image-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
}

.product-price-order {
  min-width: 300px;
}

.product-image-section {
  margin-bottom: 0;
}

.product-image-wrapper .product-tags {
  margin-top: 0;
  margin-bottom: 0;
}

.product-image-wrapper .product-tags .tags-container {
  margin-top: 0.5rem;
}

.product-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  object-fit: contain;
}

.product-description {
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.product-description img,
.product-description table,
.product-description pre {
  max-width: 100%;
  overflow-x: auto;
}

.product-description-content {
  width: 100%;
}

.product-info-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 1rem;
}

.product-info-tab {
  padding: 12px 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  position: relative;
}

.product-info-tab:hover {
  color: #2563eb;
}

.product-info-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.product-tab-panel {
  display: none;
}

.product-tab-panel.active {
  display: block;
}

.markdown-content {
  width: 100%;
}

/* LaTeX/Katex styling */
.katex {
  font-size: 1.1em;
}

.katex-display {
  margin: 1em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.katex-display>.katex {
  display: inline-block;
  text-align: initial;
}

max-width: 100%;
}

.product-description h2 {
  font-size: 1.5rem;
  color: #0f172a;
  margin-bottom: 1rem;
}

.product-description p {
  color: #475569;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.admin-content-tab-btn {
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  transition: all 0.2s;
}

.admin-content-tab-btn:hover {
  color: #2563eb;
}

.admin-content-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.admin-editor-content-panel {
  margin-top: 15px;
}

.product-features {
  margin-top: 1.5rem;
}

.product-features h3 {
  font-size: 1.2rem;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.product-features ul {
  list-style: disc;
  padding-left: 1.5rem;
  color: #475569;
}

.product-features li {
  margin-bottom: 0.5rem;
}

.product-attachments {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.product-attachments h2 {
  font-size: 1.2rem;
  color: #333;
  font-weight: 600;
  margin-bottom: 1rem;
}

.attachments-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.attachment-item {
  margin: 0;
}

.attachment-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s;
}

.attachment-link:hover {
  background: #f3f4f6;
  border-color: #0066cc;
  color: #0066cc;
}

.attachment-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.attachment-name {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Product Tags */
.product-tags {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.product-tags h3 {
  font-size: 1.2rem;
  color: #0f172a;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Tag color variations */
.tag-familia {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.tag-supplier {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.tag-category {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.tag-subcategory {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: #1a202c;
}

.tag-brand {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: #1a202c;
}

.tag-type {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
  color: white;
}

.tag-material {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  color: #1a202c;
}

.tag-default {
  background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
  color: #1a202c;
}

.product-specs {
  margin-top: 2rem;
}

.product-specs h2 {
  font-size: 1.25rem;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
}

.spec-item {
  display: flex;
  gap: 0.5rem;
}

.spec-label {
  color: #64748b;
  font-weight: 500;
  min-width: 120px;
}

.spec-value {
  color: #0f172a;
}

.spec-value[contenteditable="true"]:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.specs-table tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.15s ease;
}

.specs-table tr:hover {
  background-color: #f9fafb;
}

.specs-table tr:last-child {
  border-bottom: none;
}

.specs-table td {
  padding: 1rem;
  vertical-align: top;
}

.specs-table td:first-child {
  width: 40%;
  color: #64748b;
  font-weight: 500;
}

.specs-table td:last-child {
  color: #0f172a;
  font-weight: 400;
}

/* Admin image list */
.admin-image-list {
  margin-top: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.admin-image-list h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.admin-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.admin-image-item {
  position: relative;
  border: 2px solid #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  background: white;
  cursor: move;
  transition: all 0.2s;
}

.admin-image-item:hover {
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.admin-image-item.drag-over {
  border-color: #2563eb;
  border-width: 3px;
  background: #eff6ff;
  transform: scale(1.05);
}

.admin-image-item[draggable="true"]:active {
  opacity: 0.5;
}

.admin-drag-handle {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  z-index: 10;
  cursor: move;
  user-select: none;
  pointer-events: none;
}

.admin-image-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}

.admin-delete-image-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background 0.2s;
}

.admin-delete-image-btn:hover {
  background: #dc2626;
}

.product-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
  z-index: 1;
}

/* Unified left sidebar for product detail pages */
.product-detail-left-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  align-self: flex-start;
  position: sticky;
  top: 80px;
}

/* Dashboard row: description + specs side by side */
.product-dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.product-dashboard-cell {
  min-width: 0;
}

.product-dashboard-desc {
  grid-column: 1 / -1;
}

/* Scrollbar styling for sibling list */
.pd-sibling-scroll-list::-webkit-scrollbar {
  width: 5px;
}

.pd-sibling-scroll-list::-webkit-scrollbar-track {
  background: transparent;
}

.pd-sibling-scroll-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.pd-sibling-scroll-list::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.contact-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.contact-box h3 {
  font-size: 1.2rem;
  color: #0f172a;
  margin: 0 0 0.75rem 0;
}

.contact-box p {
  color: #475569;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.button-primary {
  display: inline-block;
  background: #363;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  width: 100%;
  margin-bottom: 1rem;
  transition: background 0.2s;
}

.button-primary:hover {
  background: #3c773c;
}

.contact-info {
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
  margin-top: 1rem;
}

.contact-info p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: #475569;
}

.related-products-sidebar {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
}

.related-products-sidebar h3 {
  font-size: 1.1rem;
  color: #0f172a;
  margin: 0 0 1rem 0;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-list li {
  margin-bottom: 0.75rem;
}

.related-list a {
  color: #069;
  text-decoration: none;
  font-size: 0.9rem;
}

.related-list a:hover {
  text-decoration: underline;
}

.related-products-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #e5e7eb;
  clear: both;
  width: 100%;
  position: relative;
  overflow: visible;
}

.related-products-section h2 {
  font-size: 1.5rem;
  color: #0f172a;
  margin-bottom: 1.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  width: 100%;
  position: relative;
}

.related-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  transition: box-shadow 0.2s;
  background: white;
  display: block;
  position: relative;
  overflow: hidden;
}

.related-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.related-card a {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
  height: 100%;
}

.related-card h4 {
  font-size: 1rem;
  color: #0f172a;
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  line-height: 1.4;
}

.related-card p {
  margin: 0;
  color: #069;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Compact Dry Page Styles */
/* IDEXX AGUA Page Styles */
.idexx-agua-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

.idexx-agua-header {
  margin-bottom: 2rem;
}

.idexx-agua-header h1 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.idexx-agua-subtitle {
  font-size: 1rem;
  color: #666;
  margin-bottom: 1rem;
}

.idexx-agua-total-count {
  font-size: 0.875rem;
  color: #666;
  font-weight: normal;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

.idexx-agua-content {
  flex: 1;
  min-width: 0;
}

.idexx-agua-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .idexx-agua-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .idexx-agua-grid {
    grid-template-columns: 1fr;
  }

  .catalog-layout {
    flex-direction: column;
    gap: 1.5rem;
  }

  .catalog-sidebar {
    width: 100%;
    position: relative;
    top: 0;
  }

  .idexx-agua-content {
    width: 100%;
  }
}

.idexx-agua-item {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #e5e7eb;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.idexx-agua-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.idexx-agua-item a {
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: 1rem;
  width: 100%;
  align-items: flex-start;
}

.idexx-agua-image {
  width: 100px;
  height: 100px;
  min-width: 100px;
  object-fit: contain;
  border-radius: 4px;
  background: #f9fafb;
  flex-shrink: 0;
}

.idexx-agua-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.idexx-agua-name {
  font-size: 0.95rem;
  color: #333;
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  line-height: 1.4;
}

.idexx-agua-code {
  font-size: 0.875rem;
  color: #666;
  display: block;
  margin-top: 0.25rem;
}

.compact-dry-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

.compact-dry-header {
  margin-bottom: 2rem;
}

.compact-dry-main-image {
  width: 100%;
  max-width: 800px;
  height: auto;
  object-fit: contain;
  margin-bottom: 1.5rem;
  border-radius: 8px;
}

.compact-dry-header h1 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.compact-dry-subtitle {
  font-size: 1rem;
  color: #666;
  margin-bottom: 1rem;
}

.compact-dry-total-count {
  font-size: 0.875rem;
  color: #666;
  font-weight: normal;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

.compact-dry-content {
  flex: 1;
  min-width: 0;
}

.compact-dry-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.compact-dry-type-group {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.compact-dry-type-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.compact-dry-type-image {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  padding: 4px;
  flex-shrink: 0;
  background: white;
}

.compact-dry-type-info {
  flex: 1;
  min-width: 0;
}

.compact-dry-type-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.compact-dry-type-name {
  font-size: 1.25rem;
  color: #333;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.compact-dry-type-description {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.compact-dry-type-count {
  font-size: 0.875rem;
  color: #666;
  font-weight: normal;
  display: block;
  margin-bottom: 1rem;
}

.compact-dry-products-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.compact-dry-product-item {
  margin: 0;
}

.compact-dry-product-item a {
  color: #0066cc;
  text-decoration: none;
  font-size: 0.9rem;
  display: block;
  padding: 0.5rem 0;
  transition: color 0.2s;
}

.compact-dry-product-item a:hover {
  text-decoration: underline;
  color: #0052a3;
}

/* Category Page Styles */
.category-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

.category-header {
  margin-bottom: 2rem;
}

.category-header h1 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.category-subtitle {
  font-size: 1rem;
  color: #666;
  margin-bottom: 1rem;
}

.category-total-count {
  font-size: 0.875rem;
  color: #666;
  font-weight: normal;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

.category-content {
  flex: 1;
  min-width: 0;
}

.category-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.category-type-group {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.category-type-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* Compact balance sections */
.balance-section {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
}

.balance-section-header {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.balance-section-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
}

.balance-section-count {
  font-size: 0.85rem;
  color: #64748b;
}

.balance-products-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.admin-section-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.admin-edit-section-btn,
.admin-move-products-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 500;
}

.admin-edit-section-btn {
  background: #2563eb;
  color: white;
}

.admin-edit-section-btn:hover {
  background: #1d4ed8;
}

.admin-move-products-btn {
  background: #10b981;
  color: white;
}

.admin-move-products-btn:hover {
  background: #059669;
}

.balance-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-type-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.category-type-image {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  padding: 4px;
  flex-shrink: 0;
  background: white;
}

.category-type-info {
  flex: 1;
  min-width: 0;
}

.category-type-name {
  font-size: 1.25rem;
  color: #333;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.category-type-description {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.category-type-count {
  font-size: 0.875rem;
  color: #666;
  font-weight: normal;
  display: block;
  margin-bottom: 1rem;
}

.category-products-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .category-products-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .category-products-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1400px) {
  .category-products-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

.category-product-item {
  margin: 0;
}

.category-product-item a {
  color: #0066cc;
  text-decoration: none;
  font-size: 0.9rem;
  display: block;
  padding: 0.5rem 0;
  transition: color 0.2s;
}

.category-product-item a:hover {
  text-decoration: underline;
  color: #0052a3;
}

/* McMaster-Carr style grid for category products */
.category-type-group.mcmaster-style {
  margin-bottom: 2.5rem;
}

.category-type-group.mcmaster-style .category-type-header {
  margin-bottom: 1.25rem;
}

.category-type-group.mcmaster-style .category-type-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.category-type-group.mcmaster-style .category-type-description {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0;
}

.category-products-grid-mcmaster {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.category-product-item-mcmaster {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.category-product-item-mcmaster a {
  text-decoration: none;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0.75rem 0.5rem;
  border-radius: 8px;
  transition: background 0.2s, box-shadow 0.2s;
}

.category-product-item-mcmaster a:hover {
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-product-icon-container {
  width: 100%;
  max-width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.category-product-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(80%);
  opacity: 0.8;
  transition: filter 0.2s, opacity 0.2s, transform 0.2s;
}

.category-product-item-mcmaster a:hover .category-product-icon {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}

.category-product-name-mcmaster {
  font-size: 0.8125rem;
  line-height: 1.3;
  color: #334155;
  text-align: center;
  word-wrap: break-word;
  max-width: 100%;
  display: block;
  font-weight: 500;
}

.category-product-item-mcmaster a:hover .category-product-name-mcmaster {
  color: #2563eb;
}

@media (min-width: 640px) {
  .category-products-grid-mcmaster {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
  }

  .category-product-icon-container {
    max-width: 130px;
    height: 130px;
  }

  .category-product-name-mcmaster {
    font-size: 0.875rem;
  }
}

@media (min-width: 1024px) {
  .category-products-grid-mcmaster {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
  }

  .category-product-icon-container {
    max-width: 150px;
    height: 150px;
  }

  .category-product-name-mcmaster {
    font-size: 0.875rem;
  }
}

@media (min-width: 1400px) {
  .category-products-grid-mcmaster {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* Product sales floating widget: column layout, corner resize (all viewports; handle hidden on narrow screens below) */
#widget-expanded {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#widget-expanded .widget-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#widget-expanded .widget-tabs {
  flex-shrink: 0;
}
#widget-expanded .widget-tab-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: none;
}
#widget-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  z-index: 20;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 50%,
    rgba(148, 163, 184, 0.35) 50%,
    rgba(148, 163, 184, 0.55) 100%
  );
  border-bottom-right-radius: 0.65rem;
}
#widget-resize-handle:hover {
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 45%,
    rgba(59, 130, 246, 0.25) 45%,
    rgba(37, 99, 235, 0.45) 100%
  );
}

@media (max-width: 968px) {
  .product-content-layout {
    display: block;
  }

  .product-sidebar {
    position: relative;
    top: 0;
  }

  .product-detail-left-sidebar {
    position: relative;
    top: 0;
    min-width: unset;
    max-width: unset;
    width: 100%;
    margin-bottom: 1.5rem;
  }

  .product-dashboard-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .product-header {
    flex-direction: column;
  }

  .product-availability {
    text-align: left;
    margin-top: 1rem;
  }

  .product-image-wrapper-section {
    flex-direction: column;
    gap: 1rem;
  }

  .product-image-wrapper {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .product-price-order {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100%;
  }

  .product-detail-page {
    padding: 0 0.5rem;
    overflow-x: hidden;
  }

  .product-content-wrapper {
    overflow-x: hidden;
    width: 100%;
  }

  .product-title {
    font-size: 1.4rem;
    word-break: break-word;
  }

  .product-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }

  #product-sales-widget-ssr[data-collapsed="false"] #widget-resize-handle {
    display: none;
  }

  /* Sales widget: full-width bottom sheet on mobile when expanded */
  #product-sales-widget-ssr[data-collapsed="false"] {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    z-index: 8000 !important;
  }
  #product-sales-widget-ssr[data-collapsed="false"] #widget-expanded {
    border-radius: 0.75rem 0.75rem 0 0 !important;
    max-height: 60vh;
    overflow-y: auto;
  }
}

/* Extra-narrow mobile (< 480px) */
@media (max-width: 480px) {
  .product-detail-page {
    padding: 0 0.25rem;
  }

  .product-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .product-title {
    font-size: 1.2rem;
  }

  .product-meta {
    font-size: 0.8rem;
    gap: 0.5rem;
  }

  .product-image-wrapper-section {
    gap: 0.75rem !important;
  }

  .product-dashboard-row {
    gap: 0.75rem;
    margin-top: 1rem;
  }

  .breadcrumb {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .carousel-image {
    width: 80px !important;
    height: 80px !important;
  }

  /* Ensure nothing overflows */
  .product-content-layout,
  .product-main,
  .product-content-wrapper,
  .unified-page,
  .tab-content {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .unified-page .wrapper {
    padding: 0.5rem 0 !important;
  }
}

/* Labplas Page Styles */
.labplas-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

.labplas-header {
  margin-bottom: 2rem;
}

.labplas-header h1 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.labplas-subtitle {
  font-size: 1rem;
  color: #666;
  margin-bottom: 1rem;
}

.labplas-intro {
  background: #f9fafb;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1rem 0;
  border-left: 4px solid #10b981;
}

.labplas-intro p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
}

.labplas-intro p:first-child {
  margin-top: 0;
}

.labplas-intro p:last-child {
  margin-bottom: 0;
}

.labplas-total-count {
  font-size: 0.875rem;
  color: #666;
  font-weight: normal;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

.labplas-content {
  flex: 1;
  min-width: 0;
}

.labplas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .labplas-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .labplas-grid {
    grid-template-columns: 1fr;
  }
}

.labplas-item {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #e5e7eb;
}

.labplas-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.labplas-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.labplas-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.labplas-name {
  font-size: 0.95rem;
  color: #333;
  margin: 0;
  font-weight: 600;
  line-height: 1.4;
}

.labplas-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #666;
}

.labplas-spec {
  background: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.labplas-subtype {
  font-size: 0.8125rem;
  color: #666;
  margin: 0;
  font-style: italic;
  line-height: 1.4;
}

.labplas-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.labplas-type-section {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 2rem;
}

.labplas-type-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.labplas-type-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.labplas-type-name {
  font-size: 1.5rem;
  color: #333;
  margin: 0;
  font-weight: 600;
}

.labplas-type-count {
  font-size: 0.875rem;
  color: #666;
  font-weight: normal;
}

.labplas-type-description {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  margin: 0.5rem 0 1.5rem 0;
}

.labplas-type-section .labplas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .labplas-type-section .labplas-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .labplas-type-section .labplas-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin editing styles */
.admin-edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
}

.admin-edit-overlay .admin-edit-btn {
  pointer-events: auto;
}

[data-editable="true"]:hover .admin-edit-overlay {
  opacity: 1;
}

/* Always show edit button in admin mode for image section */
.product-image-section[data-editable="true"] .admin-edit-overlay {
  opacity: 0.8;
}

.product-image-section[data-editable="true"]:hover .admin-edit-overlay {
  opacity: 1;
}

.admin-edit-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.admin-edit-btn:hover {
  background: #1d4ed8;
}

.admin-edit-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.admin-delete-btn {
  padding: 0.5rem 1rem;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
}

.admin-delete-btn:hover {
  background: #dc2626;
}

.admin-delete-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.product-image-section {
  position: relative;
}

.product-image-section[data-editable="true"] {
  cursor: pointer;
}

.product-image-section.drag-over {
  border: 2px dashed #2563eb;
  background: rgba(37, 99, 235, 0.1);
}

.admin-image-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
}

.admin-image-controls .admin-edit-btn {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.admin-drop-zone {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  pointer-events: none;
}

/* Product image gallery */
.product-image-gallery {
  position: relative;
}

.product-image-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.product-image-thumbnails .thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 2px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.product-image-thumbnails .thumbnail:hover {
  border-color: #2563eb;
}

/* Description editor overlay */
.admin-description-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.admin-editor-container {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.admin-editor-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  border-bottom: 1px solid #ddd;
}

.admin-tab-btn {
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
  font-size: 14px;
  color: #666;
}

.admin-tab-btn:hover {
  color: #2563eb;
}

.admin-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

.admin-editor-preview {
  background: #f9fafb;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  min-height: 400px;
}

.admin-editor-preview h1,
.admin-editor-preview h2,
.admin-editor-preview h3 {
  margin-top: 0;
}

.admin-editor-preview code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
}

.admin-editor-preview pre {
  background: #f3f4f6;
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
}

.admin-editor-preview pre code {
  background: none;
  padding: 0;
}

.admin-description-editor {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}

.admin-editor-actions,
.admin-specs-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.admin-save-btn,
.admin-cancel-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.admin-save-btn {
  background: #10b981;
  color: white;
}

.admin-save-btn:hover {
  background: #059669;
}

.admin-cancel-btn {
  background: #6b7280;
  color: white;
}

.admin-cancel-btn:hover {
  background: #4b5563;
}

.admin-specs-edit-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.2s;
}

.admin-specs-edit-btn:hover {
  background: #1d4ed8;
}

.specs-table [contenteditable="true"] {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.markdown-content {
  line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  margin-top: 1em;
  margin-bottom: 0.5em;
  font-weight: 600;
}

.markdown-content h1 {
  font-size: 1.5em;
}

.markdown-content h2 {
  font-size: 1.3em;
}

.markdown-content h3 {
  font-size: 1.1em;
}

.markdown-content strong {
  font-weight: 600;
}

.markdown-content em {
  font-style: italic;
}

.markdown-content a {
  color: #2563eb;
  text-decoration: underline;
}

.markdown-content a:hover {
  color: #1d4ed8;
}

/* Login page styles */
.page.login-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
  max-width: 420px;
  width: 100%;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.login-header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  padding: 40px 30px;
  text-align: center;
  color: white;
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: white;
}

.login-subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
}

.login-form {
  padding: 40px 30px;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}

/* Country Select Dropdown - Custom Styling */
.country-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.country-select:hover {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.country-select:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
  outline: none;
}

.country-select option {
  padding: 0.5rem;
  background: white;
  color: #333;
}

.country-select option:checked {
  background: #059669;
  color: white;
}

.country-select option:hover {
  background: #f3f4f6;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s;
  box-sizing: border-box;
  background: white;
  color: #111827;
}

.form-input::placeholder {
  color: #9ca3af;
}

.form-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.password-input-wrapper {
  position: relative;
}

.password-input {
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: color 0.2s;
  border-radius: 4px;
}

.password-toggle:hover {
  color: #2563eb;
  background: #f3f4f6;
}

.password-toggle:active {
  background: #e5e7eb;
}

.password-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.password-toggle.active .password-icon {
  color: #2563eb;
}

.login-button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.login-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.login-button:active:not(:disabled) {
  transform: translateY(0);
}

.login-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-error {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 14px;
  text-align: center;
}

.login-footer {
  padding: 20px 30px;
  text-align: center;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.login-link {
  color: #2563eb;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.login-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .login-container {
    margin: 20px;
    border-radius: 12px;
  }

  .login-header {
    padding: 30px 20px;
  }

  .login-form {
    padding: 30px 20px;
  }

  .login-title {
    font-size: 24px;
  }
}

/* Admin Move Modal Styles */
.admin-move-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-move-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.admin-move-modal-content {
  position: relative;
  background: white;
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
}

.admin-move-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.admin-move-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

.admin-move-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.admin-move-modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.admin-move-modal-body {
  padding: 1.25rem;
}

.admin-move-modal-body p {
  margin: 0 0 1rem 0;
  color: #374151;
}

.admin-move-sections-list label {
  display: block;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.admin-move-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  background: white;
  color: #111827;
  cursor: pointer;
  transition: border-color 0.2s;
}

.admin-move-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.admin-move-new-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.admin-move-new-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.admin-move-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem;
  border-top: 1px solid #e5e7eb;
}

.admin-move-modal-cancel,
.admin-move-modal-confirm {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.admin-move-modal-cancel {
  background: #f3f4f6;
  color: #374151;
}

.admin-move-modal-cancel:hover {
  background: #e5e7eb;
}

.admin-move-modal-confirm {
  background: #10b981;
  color: white;
}

.admin-move-modal-confirm:hover:not(:disabled) {
  background: #059669;
}

.admin-move-modal-confirm:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Stats Pages Styles */
/* ═══════════════════════════════════════════════════════════════════
   STATS DASHBOARD — Modern redesign
   ═══════════════════════════════════════════════════════════════════ */

/* ── Design tokens ─────────────────────────────────────────────── */
:root {
  --stats-bg:        #f0f4f8;
  --stats-surface:   #ffffff;
  --stats-surface2:  #f8fafc;
  --stats-border:    #e2e8f0;
  --stats-accent:    #2563eb;
  --stats-accent2:   #7c3aed;
  --stats-success:   #059669;
  --stats-warn:      #d97706;
  --stats-danger:    #dc2626;
  --stats-text:      #0f172a;
  --stats-muted:     #64748b;
  --stats-radius:    10px;
  --stats-shadow:    0 1px 4px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05);
}

/* ── Shell ─────────────────────────────────────────────────────── */
.stats-container {
  max-width: 1600px;
  margin: -10px -20px 0 -20px;
  padding: 0 0 40px;
  background: var(--stats-bg);
  min-height: 100vh;
  color: var(--stats-text);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Header ────────────────────────────────────────────────────── */
.stats-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stats-border);
}

.stats-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--stats-text);
  margin: 0;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-header h1::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 22px;
  background: linear-gradient(to bottom, var(--stats-accent), var(--stats-accent2));
  border-radius: 4px;
}

.stats-date-range {
  font-size: 0.75rem;
  color: var(--stats-muted);
  background: var(--stats-surface);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--stats-border);
}

/* ── Left sidebar (filters + summary + actions) ─────────────────── */
.stats-top-row,
.stats-filters-wrapper,
.stats-summary-actions-row {
  display: contents;
}

.stats-filters-card,
.stats-summary-card,
.stats-actions-card {
  background: var(--stats-surface);
  border: 1px solid var(--stats-border);
  border-radius: var(--stats-radius);
  padding: 14px;
  box-shadow: var(--stats-shadow);
}

/* ── Filter card ───────────────────────────────────────────────── */
.stats-filters-card {
  grid-row: span 3;
}

.stats-filters-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--stats-border);
}

.stats-filter-icon {
  width: 15px;
  height: 15px;
  opacity: 0.7;
  filter: invert(1);
}

.stats-filters-card h2,
.stats-actions-card h2 {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--stats-muted);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-field label {
  font-size: 0.68rem;
  color: var(--stats-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-label-icon {
  width: 11px;
  height: 11px;
  opacity: 0.5;
  filter: invert(1);
}

.filter-field input[type="text"],
.filter-field input[type="date"],
.filter-field select {
  width: 100%;
  padding: 6px 9px;
  font-size: 0.78rem;
  background: var(--stats-surface2);
  color: var(--stats-text);
  border: 1px solid var(--stats-border);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.filter-field input::placeholder {
  color: var(--stats-muted);
  opacity: 0.7;
}

.filter-field input:focus,
.filter-field select:focus {
  outline: none;
  border-color: var(--stats-accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.12);
}

.filter-field select option {
  background: #1e293b;
  color: var(--stats-text);
}

#group-by,
#filter-product,
#filter-client-search,
#filter-client,
#filter-supplier {
  background: var(--stats-surface2) !important;
  color: var(--stats-text) !important;
}

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 2px;
  background: var(--stats-surface2);
  border-radius: 8px;
  padding: 3px;
  border: none !important;
  margin-bottom: 8px;
}

.filter-tab-btn {
  flex: 1;
  padding: 5px 8px !important;
  border-radius: 6px !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  background: transparent !important;
  color: var(--stats-muted) !important;
  border: none !important;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.filter-tab-btn img {
  filter: invert(1);
  opacity: 0.5;
}

.filter-tab-btn.filter-tab-active,
.filter-tab-btn[style*="border-bottom: 2px solid #2563eb"] {
  background: var(--stats-accent) !important;
  color: #0f172a !important;
  border-bottom: none !important;
  box-shadow: 0 2px 8px rgba(56,189,248,0.25);
}

.filter-tab-btn.filter-tab-active img {
  filter: invert(0);
  opacity: 1;
}

/* Year quick-tags */
.stats-year-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.stats-year-tag-btn {
  padding: 3px 8px !important;
  font-size: 0.68rem !important;
  border-radius: 20px !important;
  background: var(--stats-surface2) !important;
  color: var(--stats-muted) !important;
  border: 1px solid var(--stats-border) !important;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600 !important;
}

.stats-year-tag-btn:hover,
.stats-year-tag-btn.active {
  background: var(--stats-accent) !important;
  color: #0f172a !important;
  border-color: var(--stats-accent) !important;
}

/* ── Summary card ──────────────────────────────────────────────── */
.stats-summary-card {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
  border: 1px solid rgba(56,189,248,0.18);
  position: relative;
  overflow: hidden;
}

.stats-summary-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.stats-summary-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.stats-summary-icon {
  width: 15px;
  height: 15px;
  opacity: 0.8;
  filter: invert(1);
}

.stats-summary-card h2 {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--stats-accent);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* #summary-stats is now a grid rendered by stats-summary-strip */

/* ── Actions card ──────────────────────────────────────────────── */
.stats-actions-card {
  padding: 12px;
}

.stats-actions-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-action-buttons {
  display: flex;
  gap: 6px;
}

.stats-btn-primary {
  flex: 1;
  background: linear-gradient(135deg, var(--stats-accent), var(--stats-accent2));
  color: #0f172a;
  padding: 8px 10px;
  font-size: 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}

.stats-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.stats-btn-primary:active { transform: translateY(0); }

.stats-btn-secondary {
  flex: 1;
  background: var(--stats-surface2);
  color: var(--stats-text);
  padding: 8px 10px;
  font-size: 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid var(--stats-border);
  cursor: pointer;
  transition: all 0.2s;
}

.stats-btn-secondary:hover {
  background: var(--stats-surface);
  border-color: var(--stats-accent);
  color: var(--stats-accent);
}

/* Chart type pills */
.stats-chart-controls {
  padding-top: 8px;
  border-top: 1px solid var(--stats-border);
}

.stats-chart-controls p {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--stats-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 6px;
}

.chart-icon {
  width: 13px !important;
  height: 13px !important;
  flex-shrink: 0;
  opacity: 0.8;
  filter: invert(1);
  vertical-align: middle;
}

.stats-chart-btn-primary,
.stats-chart-btn-secondary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  font-size: 0.73rem;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid var(--stats-border);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 5px;
}

.stats-chart-btn-primary {
  background: linear-gradient(135deg, rgba(56,189,248,0.2), rgba(129,140,248,0.2));
  color: var(--stats-accent);
  border-color: rgba(56,189,248,0.3);
}

.stats-chart-btn-secondary {
  background: transparent;
  color: var(--stats-muted);
}

.stats-chart-btn-secondary:hover {
  background: var(--stats-surface2);
  color: var(--stats-text);
  border-color: rgba(255,255,255,0.15);
}

/* ── Riva-style topbar ────────────────────────────────────────── */
.stats-container {
  grid-template-columns: 1fr;
  padding-top: 0;
  overflow: visible;
}

/* Let client/supplier dropdowns extend past #MainContent / webpart wrappers */
#MainContent .shell-initial-content,
#HomePageParent {
  overflow: visible;
}

.stats-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 0 20px;
  height: 52px;
  min-height: 52px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  /* overflow-x: auto here clipped absolutely positioned .stats-dropdown-menu (search + list). */
  overflow-x: visible;
  overflow-y: visible;
}
.stats-topbar::-webkit-scrollbar { display: none; }

.stats-topbar-left {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.stats-topbar-page {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.stats-topbar-range {
  font-size: 0.68rem;
  color: #64748b;
  white-space: nowrap;
}

.stats-topbar-center {
  display: flex;
  gap: 2px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  flex-shrink: 0;
}

.stats-period-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.stats-period-btn:hover { background: #e2e8f0; color: #0f172a; }
.stats-period-btn.active { background: #2563eb; color: #fff; }

.stats-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.stats-groupby-tabs {
  display: flex;
  gap: 2px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  position: relative;
}
.stats-groupby-glider {
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 0;
  border-radius: 5px;
  background: #2563eb;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35);
  pointer-events: none;
  z-index: 0;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, width;
}
.stats-groupby-btn {
  position: relative;
  z-index: 1;
  padding: 4px 10px;
  font-size: 0.73rem;
  font-weight: 500;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
  white-space: nowrap;
}
.stats-groupby-btn:hover:not(.active) { background: rgba(255, 255, 255, 0.65); color: #0f172a; }
.stats-groupby-btn.active {
  background: transparent;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

/* ── Dropdown selector ──────────────────────────────────────── */
.stats-selector-area { position: relative; }

.stats-selector-panels {
  display: grid;
  grid-template-columns: minmax(140px, 1fr);
  grid-template-rows: minmax(32px, auto);
  align-items: start;
}
.stats-filter-panel {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateX(10px);
  filter: blur(0.5px);
  pointer-events: none;
  transition:
    opacity 0.26s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.26s ease;
}
.stats-filter-panel.is-active {
  opacity: 1;
  transform: translateX(0);
  filter: none;
  pointer-events: auto;
  z-index: 1;
}

.stats-product-field {
  position: relative;
  width: 100%;
  min-width: 160px;
}
.stats-product-ac {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 240px;
  max-height: min(40vh, 280px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 600;
  padding: 4px;
}
.stats-product-ac.is-open { display: block; }
.stats-product-ac-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #0f172a;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.stats-product-ac-item:hover { background: #eff6ff; color: #1e40af; }
.stats-product-ac-name { font-weight: 500; line-height: 1.2; }
.stats-product-ac-meta { font-size: 0.72rem; color: #64748b; }

@keyframes stats-reset-flash {
  0% { box-shadow: inset 0 0 0 0 rgba(37, 99, 235, 0); }
  35% { box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.45); }
  100% { box-shadow: inset 0 0 0 0 rgba(37, 99, 235, 0); }
}
@keyframes stats-reset-spring {
  0% { opacity: 1; transform: scale(1); }
  40% { opacity: 0.94; transform: scale(0.992); }
  100% { opacity: 1; transform: scale(1); }
}
.stats-topbar.stats-reset-flash {
  animation: stats-reset-flash 0.55s ease-out;
}
.stats-container.stats-reset-spring {
  animation: stats-reset-spring 0.48s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center top;
}

.stats-dropdown-wrap { position: relative; }

.stats-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #334155;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  min-width: 150px;
  user-select: none;
  height: 32px;
  box-sizing: border-box;
}
.stats-dropdown-trigger:hover { border-color: #2563eb; background: #eff6ff; }
.stats-dropdown-trigger span { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.stats-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  max-height: min(50vh, 320px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 500;
  padding: 6px;
}
.stats-dropdown-menu.open { display: block; }

.stats-dropdown-search {
  width: 100%;
  padding: 7px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #0f172a;
  font-size: 0.8rem;
  margin-bottom: 6px;
  box-sizing: border-box;
  outline: none;
}
.stats-dropdown-search::placeholder { color: #94a3b8; }

.stats-dropdown-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.stats-dropdown-menu li {
  padding: 7px 10px;
  font-size: 0.8rem;
  color: #334155;
  border-radius: 5px;
  cursor: pointer;
}
.stats-dropdown-menu li:hover,
.stats-dropdown-menu li.dd-hover { background: #eff6ff; color: #1e40af; }
.stats-dropdown-menu li.active { background: #2563eb; color: #fff; }

.stats-dropdown-wrap input.stats-dropdown-search {
  display: block;
  width: 100%;
}

@media (max-width: 900px) {
  .stats-dropdown-trigger {
    min-height: 44px;
    padding: 8px 12px;
  }
  .stats-dropdown-menu li {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .stats-dropdown-search {
    min-height: 44px;
    font-size: 16px;
  }
}

/* Product inline search */
#stats-product-wrap input {
  padding: 5px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #334155;
  font-size: 0.78rem;
  min-width: 170px;
  height: 32px;
  box-sizing: border-box;
  outline: none;
}
#stats-product-wrap input::placeholder { color: #94a3b8; }

/* ── Date range pill ────────────────────────────────────────── */
.stats-daterange-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.78rem;
  white-space: nowrap;
  height: 32px;
  box-sizing: border-box;
}

.stats-date-inline {
  background: transparent;
  border: none;
  color: #334155;
  font-size: 0.76rem;
  outline: none;
  cursor: pointer;
  width: 96px;
  padding: 0;
  color-scheme: light;
}

.stats-btn-apply {
  padding: 5px 14px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  height: 32px;
  box-sizing: border-box;
  transition: background .15s;
  flex-shrink: 0;
}
.stats-btn-apply:hover { background: #1d4ed8; }

/* ── Summary strip ──────────────────────────────────────────── */
.stats-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 16px;
}
@media (max-width: 700px) {
  .stats-summary-strip { grid-template-columns: repeat(2, 1fr); }
}

.summary-kpi {
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: default;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: transform .12s, box-shadow .12s;
}
.summary-kpi:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.summary-kpi-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
}
.summary-kpi-value {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* ── Chart section (main bar + right donut panel) ───────────── */
.stats-chart-section {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 12px;
  align-items: stretch;
  padding: 0 16px;
}
@media (max-width: 900px) {
  .stats-chart-section { grid-template-columns: 1fr; }
}

.stats-chart-main {
  background: var(--stats-surface, #1e293b);
  border: 1px solid var(--stats-border, rgba(255,255,255,0.07));
  border-radius: 12px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-chart-type-pills {
  display: flex;
  gap: 4px;
}
.stats-chart-type-pills .chart-toggle {
  padding: 4px 11px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--stats-border, rgba(255,255,255,0.1));
  border-radius: 20px;
  background: transparent;
  color: var(--stats-muted, #94a3b8);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.stats-chart-type-pills .chart-toggle:hover { background: #f1f5f9; color: #0f172a; border-color: #cbd5e1; }
.stats-chart-type-pills .chart-toggle.active { background: #2563eb; color: #fff; border-color: #2563eb; }

.stats-chart-right {
  background: var(--stats-surface, #1e293b);
  border: 1px solid var(--stats-border, rgba(255,255,255,0.07));
  border-radius: 12px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stats-donut-header {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--stats-muted, #94a3b8);
}

.stats-donut-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.stats-donut-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.stats-donut-icon {
  display: flex;
  align-items: center;
  color: var(--stats-accent, #2563eb);
}
.stats-donut-head-text {
  flex: 1;
  min-width: 0;
}
.stats-donut-sub {
  margin: 2px 0 0;
  font-size: 0.68rem;
  color: var(--stats-muted, #94a3b8);
  line-height: 1.3;
}
.stats-donut-plot {
  width: 100%;
  min-height: 160px;
  height: 200px;
  border-radius: 10px;
  background: transparent;
}
.stats-donut-legend-host {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 2px 2px;
  border-radius: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
}
.stats-donut-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stats-donut-legend-item {
  display: grid;
  grid-template-columns: 22px 10px 1fr auto;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: #e2e8f0;
  line-height: 1.25;
}
.stats-donut-legend-rank {
  text-align: center;
  font-size: 0.85rem;
  line-height: 1;
}
.stats-donut-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8);
  flex-shrink: 0;
}
.stats-donut-legend-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-donut-legend-meta {
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
  font-size: 0.65rem;
  white-space: nowrap;
}
.stats-btn-overlay {
  width: 100%;
  margin-top: 4px;
}

/* keep old .stats-chart-controls for the overlay button */
.stats-chart-controls { display: flex; flex-direction: column; gap: 4px; }

/* ── Table toolbar & pivot-style scroll ─────────────────────── */
.stats-table-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.stats-table-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.stats-table-toolbar-left h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.stats-reset-view {
  padding: 8px 14px;
  background: #397ea0;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.stats-table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.stats-heat-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.68rem;
  color: #64748b;
}
.stats-heat-key-label {
  font-weight: 600;
  margin-right: 2px;
}
.stats-heat-chip {
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}
.stats-heat-chip.stats-heat-high {
  background: rgba(16, 185, 129, 0.2);
  color: #047857;
}
.stats-heat-chip.stats-heat-mid {
  background: rgba(245, 158, 11, 0.22);
  color: #b45309;
}
.stats-heat-chip.stats-heat-low {
  background: rgba(148, 163, 184, 0.22);
  color: #475569;
}
.stats-currency-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.stats-currency-label {
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}

.stats-table-scroll {
  max-height: min(62vh, 780px);
  overflow: auto;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.stats-table-scroll .stats-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: 0 1px 0 #e2e8f0;
}

/* Numeric heat (mayor / medio / menor) */
.stats-table td.stats-heat-high {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.22), rgba(16, 185, 129, 0.06)) !important;
  border-left: 3px solid #059669;
}
.stats-table td.stats-heat-mid {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.06)) !important;
  border-left: 3px solid #d97706;
}
.stats-table td.stats-heat-low {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.16), rgba(148, 163, 184, 0.04)) !important;
  border-left: 3px solid #64748b;
}
.stats-table td.stats-heat-neutral {
  background: rgba(241, 245, 249, 0.35) !important;
}

/* ── Main chart area ───────────────────────────────────────────── */
.chart-container {
  grid-column: 2;
  background: var(--stats-surface);
  border: 1px solid var(--stats-border);
  border-radius: var(--stats-radius);
  padding: 16px;
  box-shadow: var(--stats-shadow);
  position: relative;
  overflow: hidden;
}

.chart-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(56,189,248,0.03) 0%, transparent 40%);
  pointer-events: none;
}

@media (max-width: 1024px) {
  .chart-container {
    grid-column: 1;
  }
}

/* ── Table area ────────────────────────────────────────────────── */
.stats-table-container {
  margin: 0 16px;
  background: var(--stats-surface);
  border: 1px solid var(--stats-border);
  border-radius: var(--stats-radius);
  box-shadow: var(--stats-shadow);
  padding: 16px;
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.stats-table th {
  padding: 9px 12px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  white-space: nowrap;
}

.stats-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
  line-height: 1.4;
}

.stats-table tbody tr {
  transition: background 0.12s;
}

.stats-table tbody tr:hover {
  background: #f8fafc !important;
}

.stats-table tbody tr.clickable-row {
  cursor: pointer;
}

.stats-table tbody tr.row-selected {
  background: #eff6ff !important;
  outline: 1.5px solid #2563eb;
  outline-offset: -1px;
}

.stats-table td.long-text-cell {
  font-size: 0.82rem;
  max-width: 520px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: #475569;
}

.stats-table td.long-text-cell a {
  display: inline-block;
  margin: 2px 3px 2px 0;
  padding: 2px 7px;
  border-radius: 4px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  font-size: 0.78rem;
  transition: all 0.15s;
  white-space: nowrap;
}

.stats-table td.long-text-cell a:hover {
  background: #dbeafe;
  text-decoration: none;
}

/* Rank / number column badge */
.stats-table td:first-child {
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Amount cells */
.stats-table .amount-cell {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #059669;
  white-space: nowrap;
}

/* ── Floating product panel (iframe embed) ─────────────────────── */
.stats-product-panel {
  position: fixed;
  top: 72px;
  left: 4%;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  width: min(92vw, 1200px);
  height: min(88vh, 900px);
  max-height: calc(100vh - 80px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
  font-family: inherit;
}
.spp-frame-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #f8fafc;
}
.spp-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.stats-product-panel .spp-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  font-size: 0.82rem;
  color: #64748b;
  background: rgba(255,255,255,0.92);
}
.spp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  cursor: grab;
  user-select: none;
}
.spp-header:active { cursor: grabbing; }
.spp-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.spp-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.spp-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #2563eb;
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 5px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  transition: background 0.15s;
  white-space: nowrap;
}
.spp-link:hover { background: #dbeafe; }
.spp-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  color: #94a3b8;
  padding: 0;
}
.spp-close:hover { background: #f1f5f9; color: #475569; }
.spp-body {
  display: flex;
  gap: 12px;
  padding: 14px;
}
.spp-img-wrap {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spp-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.spp-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.spp-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}
.spp-meta {
  font-size: 0.75rem;
  color: #64748b;
}
.spp-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: #2563eb;
  margin-top: 2px;
}
.spp-desc {
  font-size: 0.73rem;
  color: #64748b;
  line-height: 1.4;
  margin-top: 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.spp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  font-size: 0.82rem;
  color: #64748b;
}
.spp-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spp-spin 0.7s linear infinite;
}
@keyframes spp-spin { to { transform: rotate(360deg); } }

/* ── Rivia analysis stats widget ────────────────────────────────── */
.stats-rivia-analisis {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(37,99,235,0.06);
  border: 1px solid rgba(37,99,235,0.18);
  border-radius: 10px;
}
.stats-rivia-header {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--stats-muted, #94a3b8);
  margin-bottom: 6px;
}
.stats-rivia-year { color: #60a5fa; }
.stats-rivia-list { display: flex; flex-direction: column; gap: 4px; }
.stats-rivia-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stats-rivia-label { color: var(--stats-text, #e2e8f0); }
.stats-rivia-count {
  font-weight: 700;
  color: #60a5fa;
  font-variant-numeric: tabular-nums;
}

/* ── Detail / drill-down area ──────────────────────────────────── */
.stats-detail-container {
  margin: 0 16px;
  background: var(--stats-surface);
  border: 1px solid var(--stats-border);
  border-radius: var(--stats-radius);
  padding: 16px;
  box-shadow: var(--stats-shadow);
}

.stats-detail-container h2 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}

#chart-detail p {
  color: #94a3b8;
  font-size: 0.82rem;
  font-style: italic;
}

/* ── Top clients / entities container ─────────────────────────── */
.top-clients-container {
  margin: 0 16px;
  background: var(--stats-surface);
  border: 1px solid var(--stats-border);
  border-radius: var(--stats-radius);
  padding: 16px;
  box-shadow: var(--stats-shadow);
}

.top-clients-container h2 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}

/* ── Currency toggle ───────────────────────────────────────────── */
.currency-toggle-btn {
  padding: 5px 10px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  border: none !important;
  cursor: pointer;
  transition: all 0.2s;
}

.currency-toggle-btn.active {
  background: #2563eb !important;
  color: #fff !important;
}

.currency-toggle-btn:not(.active) {
  background: #f1f5f9 !important;
  color: #64748b !important;
}

/* ── Reset view button ─────────────────────────────────────────── */
#reset-view-btn {
  padding: 6px 14px !important;
  background: var(--stats-surface2) !important;
  color: var(--stats-accent) !important;
  border: 1px solid rgba(56,189,248,0.3) !important;
  border-radius: 7px !important;
  cursor: pointer;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  transition: all 0.2s;
}

#reset-view-btn:hover {
  background: rgba(56,189,248,0.12) !important;
}

/* ── Chart modal ───────────────────────────────────────────────── */
.chart-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.chart-modal.active { display: flex; }

.chart-modal-content {
  background: var(--stats-surface);
  border: 1px solid var(--stats-border);
  border-radius: var(--stats-radius);
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
  width: 90vw;
  max-width: 1100px;
  max-height: 88vh;
  overflow: auto;
  position: relative;
}

.chart-modal-close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 1.4rem;
  color: var(--stats-muted);
  cursor: pointer;
  line-height: 1;
  z-index: 10;
  transition: color 0.2s;
}

.chart-modal-close:hover { color: var(--stats-text); }

.chart-modal-body {
  padding: 20px;
}

/* ── Legacy / shared overrides that affect inline styles ─────── */
.filter-search-container { position: relative; }

.filter-tab-content { width: 100%; }

/* Autocomplete dropdown */
.filter-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--stats-surface2);
  border: 1px solid var(--stats-border);
  border-radius: 0 0 8px 8px;
  z-index: 100;
  max-height: 180px;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.filter-autocomplete-dropdown .autocomplete-item {
  padding: 7px 10px;
  font-size: 0.78rem;
  color: var(--stats-text);
  cursor: pointer;
  transition: background 0.15s;
}

.filter-autocomplete-dropdown .autocomplete-item:hover,
.filter-autocomplete-dropdown .autocomplete-item.selected {
  background: rgba(56,189,248,0.15);
  color: var(--stats-accent);
}

/* Summary stats rendered by JS */
#summary-stats .stats-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--stats-text);
}

#summary-stats .stats-row:last-child { border-bottom: none; }

#summary-stats .stats-row .label { color: var(--stats-muted); }

#summary-stats .stats-row .value {
  font-weight: 700;
  color: var(--stats-accent);
}

/* Detailed data section header row */
.stats-table-container > div:first-child {
  margin-bottom: 12px;
}

.stats-table-container h2 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--stats-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

/* ── Responsive tweaks ─────────────────────────────────────────── */
@media (max-width: 720px) {
  .stats-container { padding: 12px 10px; gap: 12px; }
  .stats-filters-card { grid-row: unset; }
  .chart-container { min-height: 280px; }
}

/* 3D Model Viewer Styles */
.product-3d-viewer-container {
  position: relative;
}

.model-viewer-loading {
  transition: opacity 0.3s ease-out;
}

model-viewer.product-3d-model-viewer:not([loaded])~.model-viewer-loading,
.product-3d-viewer-container:has(model-viewer.product-3d-model-viewer[loaded]) .model-viewer-loading {
  display: none !important;
}

/* Team Section Styles */
.team-member-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-member-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

.team-member-image {
  transition: transform 0.3s ease;
}

.team-member-card:hover .team-member-image {
  transform: scale(1.05);
}

.team-member-image img {
  transition: filter 0.3s ease;
}

.team-member-card:hover .team-member-image img {
  filter: brightness(1.05);
}

@media (max-width: 768px) {
  .team-member-card {
    max-width: 100%;
  }

  .team-member-image {
    width: 150px !important;
    height: 150px !important;
  }
}

/* Order Status Badges */
.status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
}

/* Responsive status labels - show shorter version on narrow displays */
@media (max-width: 768px) {
  .order-status-select {
    font-size: 0.65rem !important;
    padding: 3px 8px !important;
    min-width: 90px;
  }

  .order-status-select option {
    font-size: 0.65rem !important;
  }
}

/* Custom fields container */
.client-custom-fields {
  margin-top: 1rem;
}

.status-badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-badge-fulfilled {
  background: #d1fae5;
  color: #065f46;
}

.status-badge-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

/* Client Info Section - Collapsible as vertical stripe/column */
.client-info-section {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: auto;
  min-width: 300px;
  overflow: hidden;
}

.client-info-section[data-collapsed="true"] {
  width: 40px !important;
  min-width: 40px !important;
  padding: 1.5rem 0.5rem !important;
}

.client-info-section[data-collapsed="true"] .client-info-content {
  display: none !important;
}

.client-info-section[data-collapsed="true"] .client-info-title {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.client-info-header {
  user-select: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.client-info-header:hover {
  opacity: 0.8;
}

.client-info-title {
  transition: opacity 0.3s ease, width 0.3s ease;
}

.client-info-toggle {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.client-info-content {
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Client info grid - two columns on desktop, one on mobile */
.client-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .client-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Ficha cliente (/clientes/...) — anular reglas de “columna colapsable” del .client-info-section global */
.client-detail-page .client-info-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}
.client-detail-page .client-info-grid {
  min-width: 0;
}
.client-detail-page .client-info-item {
  min-width: 0;
}
.client-detail-page .client-info-item--full {
  grid-column: 1 / -1;
}
.client-detail-page .client-info-item .client-info-value {
  max-width: 100%;
}
.client-detail-page .client-header .client-meta {
  align-items: flex-start;
}

/* Navegación lateral de pestañas (iconos SVG fijos; evita img grow por reglas globales / flex) */
.client-detail-page .client-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 200px;
  max-width: 280px;
  padding-right: 1.25rem;
  flex-shrink: 0;
}
.client-detail-page .client-tab-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  min-width: 0;
  box-sizing: border-box;
}
.client-detail-page .client-tab-btn.client-tab-active {
  background: #f0f4ff;
  color: #2563eb;
  border-left-color: #2563eb;
}
.client-detail-page .client-tab-btn:not(.client-tab-active) {
  background: transparent;
  color: #64748b;
}
.client-detail-page .client-tab-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.client-detail-page .client-tab-btn.client-tab-active:hover {
  background: #e8eeff;
  color: #1d4ed8;
}
.client-detail-page .client-tab-icon-wrap {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}
.client-detail-page .client-tab-icon {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  min-width: 0 !important;
  object-fit: contain !important;
  display: block !important;
}
.client-detail-page .client-tab-text {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
}

@media (max-width: 960px) {
  .client-detail-page .client-detail-layout {
    flex-direction: column;
    align-items: stretch !important;
  }
  .client-detail-page .client-tabs-container {
    max-width: none;
  }
  .client-detail-page .client-tabs {
    flex-direction: row !important;
    flex-wrap: wrap;
    max-width: none !important;
    min-width: 0 !important;
    padding-right: 0 !important;
    gap: 0.5rem !important;
  }
  .client-detail-page .client-tab-btn {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(50% - 0.35rem);
    justify-content: flex-start;
  }
}

/* Editable field styles */
.editable-field {
  user-select: none;
  position: relative;
}

.editable-field:hover {
  background-color: #f8fafc;
  border-bottom-color: #94a3b8 !important;
  cursor: text !important;
}

.editable-field:active {
  background-color: #f1f5f9;
}

/* ── Combined single-bar header ──────────────────────────────────────────── */
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.header-logo-img {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
  object-fit: contain;
  display: block;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  white-space: nowrap;
  border-left: 1px solid rgba(255,255,255,0.25);
  padding-left: 10px;
  margin-left: 4px;
}
.header-user-name {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-family: "HelveticaNeueeTextPro-Roman", Arial, sans-serif;
  transition: color 0.2s;
}
.header-user-name:hover { color: #FED700; }
.header-user-sep { color: rgba(255,255,255,0.35); font-size: 11px; }
.header-user-logout,
.header-user-login {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-family: "HelveticaNeueeTextPro-Roman", Arial, sans-serif;
  transition: color 0.2s;
}
.header-user-logout:hover,
.header-user-login:hover { color: #fff; text-decoration: underline; }
.header-admin-badge {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}
.header-right-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  text-decoration: none;
  padding: 6px 9px;
  border-radius: 5px;
  font-size: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.header-right-btn:hover { background: rgba(255,255,255,0.15); }
.header-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 5px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  color: #fff;
  transition: background 0.2s, border-color 0.2s;
  margin-left: 2px;
}
.header-search-btn:hover,
.header-search-btn.search-active {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
}
.header-search-btn svg { display: block; }
/* Omnibar search overlay */
.header-search-overlay {
  position: fixed;
  top: 60px; /* fallback; JS will set exact value */
  left: 0;
  right: 0;
  background: rgba(7, 100, 128, 0.97);
  padding: 0.85rem 1.5rem;
  border-bottom: 3px solid #FED700;
  box-shadow: 0 10px 36px rgba(0,0,0,0.32);
  z-index: 99990;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.18s ease, opacity 0.18s ease, visibility 0s linear 0.18s;
}
.header-search-overlay.search-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition: transform 0.18s ease, opacity 0.18s ease, visibility 0s linear 0s;
}
.header-search-overlay .catalog-search-container {
  max-width: 700px;
  margin: 0 auto;
}
.header-search-overlay .catalog-search-container .searchbar {
  background: rgba(255,255,255,0.95);
  border-color: rgba(255,255,255,0.6);
  color: #0f172a;
}
.header-search-overlay .catalog-search-container .searchbar::placeholder {
  color: #64748b;
}
@media (max-width: 768px) {
  .header-user {
    font-size: 0.75rem;
    white-space: nowrap;
    padding-left: 6px;
    margin-left: 2px;
    border-left: 1px solid rgba(255,255,255,0.15);
    gap: 3px;
    flex-shrink: 1;
    min-width: 0;
  }

  .header-right {
    gap: 4px;
    flex-wrap: wrap;
  }
}

/* OmniREPL Command Styling */
.command-item {
  display: flex;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  gap: 0.75rem;
  cursor: pointer;
  border-left: 4px solid #FF9500;
  background: #fff;
  border-bottom: 1px solid #eee;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.command-item:hover {
  background: #fafafa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.command-item:hover .command-item-name {
  color: #FF9500;
}

.command-item-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.command-item:hover .command-item-icon {
  opacity: 1;
}

.command-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.command-item-name {
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  word-break: break-word;
  transition: color 0.15s ease;
}

.command-item-desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.3;
  word-break: break-word;
}

/* Highlighted state for keyboard navigation */
.command-item.highlighted {
  background: #e8f4f8;
  border-left-color: #0764A0;
}

.command-item.highlighted .command-item-name {
  color: #0764A0;
}

/* ========================================
   CLOJURE EXPRESSION EVALUATION STYLES
   ======================================== */

.expr-result {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.375rem;
  border: 1px solid rgba(75, 85, 99, 0.3);
}

.expr-result > div {
  margin-bottom: 0.75rem;
}

.expr-result > div:last-child {
  margin-bottom: 0;
}

.expr-result code {
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.75rem;
  color: #d1d5db;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem;
  border-radius: 0.25rem;
  display: block;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.expr-result .expr-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.expr-result .expr-code {
  border: none;
  border-left: 3px solid rgba(100, 116, 139, 0.5);
}

.expr-result .expr-success {
  border-left-color: #10b981;
  color: #10b981;
}

.expr-result .expr-error {
  border-left-color: #ef4444;
  color: #ef4444;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .command-item {
    padding: 0.6rem 0.8rem;
    border-left-width: 3px;
    gap: 0.6rem;
  }

  .command-item-icon {
    width: 24px;
    height: 24px;
    font-size: 1rem;
  }

  .command-item-name {
    font-size: 0.85rem;
  }

  .command-item-desc {
    font-size: 0.75rem;
  }
}