/* =============================================
   SAMG Layout — Sidebar, Topbar, Mobile Menu
   Reemplazo ligero de main.css para el chrome
   ============================================= */

/* =============================================
   Layout Grid
   ============================================= */
.all-wrapper {
  min-height: 100vh;
}
.layout-w {
  display: flex;
  min-height: 100vh;
}
.content-w {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: var(--samg-bg, #F1F5F9);
}
.content-i {
  padding: 24px 32px;
}
.content-box {
  max-width: 1200px;
  margin: 0 auto;
}
.element-wrapper {
  margin-bottom: 0;
}

/* =============================================
   Sidebar — Light Theme
   ============================================= */
.menu-w {
  width: 260px;
  min-width: 260px;
  background: #FFFFFF;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: all 0.3s ease;
  border-right: 1px solid #E2E8F0;
  box-shadow: 1px 0 8px rgba(0,0,0,0.04);
}

/* Scrollbar */
.menu-w::-webkit-scrollbar {
  width: 4px;
}
.menu-w::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

/* Logo */
.logo-w {
  padding: 20px 20px 16px;
  border-bottom: 1px solid #E2E8F0;
}
.logo-w .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #1E293B;
}
.logo-w .logo-element {
  width: 26px;
  height: 26px;
  background-color: #2A7F62;
  border-radius: 15px;
  flex-shrink: 0;
  position: relative;
  display: inline-block;
  transition: all 0.2s ease;
}
.logo-w .logo-element::after {
  content: '';
  width: 26px;
  height: 26px;
  background-color: rgba(42,127,98,0.3);
  border-radius: 15px;
  position: absolute;
  right: -14px;
  top: 0;
  transition: all 0.2s ease;
}
.logo-w .logo:hover .logo-element {
  transform: translateX(5px);
}
.logo-w .logo:hover .logo-element::after {
  transform: translateX(-10px);
}
.logo-w .logo-label {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #1E293B;
  white-space: nowrap;
  position: relative;
  margin-left: 10px;
}
.logo-w .logo-label::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #2A7F62;
  transition: all 0.25s ease;
}
.logo-w .logo:hover .logo-label::after {
  width: 100%;
}

/* Menu page header (hidden) */
.menu-page-header {
  display: none;
}

/* Main Menu */
.main-menu {
  list-style: none;
  padding: 12px 8px;
  margin: 0;
}
.main-menu .sub-header {
  padding: 20px 12px 6px;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #94A3B8;
  font-weight: 600;
}
.main-menu > li > a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: #64748B;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: 1px;
  border-left: 3px solid transparent;
}
.main-menu > li > a:hover {
  color: #1E293B;
  background: #F1F5F9;
}
.main-menu > li > a:hover .icon-w {
  color: #475569;
}
.main-menu > li.selected > a {
  color: #2A7F62;
  background: rgba(42, 127, 98, 0.08);
  font-weight: 600;
  border-left-color: #2A7F62;
}
.main-menu .icon-w {
  width: 20px;
  font-size: 0.92rem;
  text-align: center;
  color: #94A3B8;
  flex-shrink: 0;
  transition: color 0.2s ease;
}
.main-menu > li.selected .icon-w {
  color: #2A7F62;
}

/* Has-sub-menu: chevron indicator */
.main-menu > li.has-sub-menu > a {
  position: relative;
  padding-right: 36px;
}
.main-menu > li.has-sub-menu > a::after {
  content: '\f105';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: #CBD5E1;
  transition: transform 0.25s ease;
}
.main-menu > li.has-sub-menu.active > a::after {
  transform: translateY(-50%) rotate(90deg);
  color: #2A7F62;
}

/* Sub Menu Wrapper */
.sub-menu-w {
  display: none;
  overflow: hidden;
}
.main-menu > li.has-sub-menu.active > .sub-menu-w {
  display: block;
}
.sub-menu-header,
.sub-menu-icon {
  display: none;
}
.sub-menu-i {
  padding: 0;
}

/* Sub Menu List */
.sub-menu-i .sub-menu {
  list-style: none;
  padding: 2px 0 6px;
  margin: 0;
}
.sub-menu-i .sub-menu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 44px;
  color: #64748B;
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  border-radius: 6px;
  margin: 0 8px;
  position: relative;
}
.sub-menu-i .sub-menu li a::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #94A3B8;
  position: absolute;
  left: 28px;
  transition: background 0.2s ease;
}
.sub-menu-i .sub-menu li a:hover {
  color: #2A7F62;
  background: rgba(42, 127, 98, 0.06);
}
.sub-menu-i .sub-menu li a:hover::before {
  background: #2A7F62;
}
.sub-menu-i .sub-menu li.active a {
  color: #2A7F62;
  background: rgba(42, 127, 98, 0.08);
  font-weight: 600;
}
.sub-menu-i .sub-menu li.active a::before {
  background: #2A7F62;
  width: 7px;
  height: 7px;
}
.sub-menu-i .sub-menu li a div[class*='fa'] {
  display: none;
}

/* =============================================
   Top Bar
   ============================================= */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  background: #FFFFFF;
  min-height: 63px;
  border-bottom: 1px solid #E2E8F0;
}

.top-menu-controls {
  display: flex;
  align-items: center;
  width: 100%;
}

/* Search in topbar — centered Stripe-style */
.element-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.element-search input {
  width: 100%;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 14px 8px 36px;
  font-size: 0.85rem;
  background: #F8FAFC;
  color: #1E293B;
  outline: none;
  transition: all 0.25s ease;
  font-family: inherit;
}
.element-search input:focus {
  border-color: #2A7F62;
  box-shadow: 0 0 0 3px rgba(42, 127, 98, 0.12);
  background: #fff;
}
.element-search input::placeholder {
  color: #94A3B8;
}
.element-search::before {
  content: '\f002';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 0.75rem;
  pointer-events: none;
  z-index: 1;
}

/* Live search dropdown */
.livesearch {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 200;
  display: none;
  max-height: 300px;
  overflow-y: auto;
}
.livesearch.over {
  display: block;
}
.livesearch ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.livesearch ul li a {
  display: block;
  padding: 10px 14px;
  color: #1E293B;
  text-decoration: none;
  font-size: 0.85rem;
  border-bottom: 1px solid #f0f3f7;
  transition: background 0.15s ease;
}
.livesearch ul li a:hover {
  background: #F1F5F9;
}

/* =============================================
   User Avatar (topbar)
   ============================================= */
.logged-user-w {
  position: relative;
  cursor: pointer;
}
.logged-user-i {
  display: flex;
  align-items: center;
}
.avatar-w {
  position: relative;
}
.avatar-w img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #E2E8F0;
}

/* User dropdown */
.logged-user-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 240px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  z-index: 300;
  margin-top: 8px;
  overflow: visible;
  animation: dropdownFadeIn 0.2s ease;
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.logged-user-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
.logged-user-w:hover .logged-user-menu,
.logged-user-w.active .logged-user-menu {
  display: block;
}
.logged-user-avatar-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  background: linear-gradient(135deg, #2A7F62 0%, #1E5C47 100%);
  color: #fff;
  border-radius: 12px 12px 0 0;
}
.logged-user-avatar-info .avatar-w img {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255,255,255,0.4);
}
.logged-user-avatar-info .logged-user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
}
.logged-user-avatar-info .logged-user-role {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.logged-user-menu .bg-icon {
  display: none;
}
.logged-user-menu ul {
  list-style: none;
  padding: 6px 0;
  margin: 0;
}
.logged-user-menu ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: #475569;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.logged-user-menu ul li a:hover {
  background: #FEF2F2;
  color: #DC2626;
}
.logged-user-menu ul li a:hover i {
  color: #DC2626;
}
.logged-user-menu ul li a i {
  font-size: 0.95rem;
  width: 20px;
  text-align: center;
  opacity: 0.7;
}

/* =============================================
   Breadcrumbs (Bootstrap override)
   ============================================= */
.breadcrumb {
  padding: 8px 8px;
  margin: 0;
  background: #FFFFFF;
  font-size: 0.78rem;
  border-bottom: 1px solid #E2E8F0;
}
.breadcrumb-item a {
  color: #94A3B8;
  text-decoration: none;
  text-transform: capitalize;
}
.breadcrumb-item a:hover {
  color: #2A7F62;
}

/* =============================================
   Mobile Menu — Light Theme
   ============================================= */
.menu-mobile {
  display: none;
  background: #FFFFFF;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.mm-logo-buttons-w {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  min-height: 56px;
}
.mm-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #1E293B;
  font-weight: 700;
  font-size: 1.05rem;
}
.mm-logo img {
  display: none;
}
.mm-logo .logo-element {
  width: 22px;
  height: 22px;
  background-color: rgba(255,255,255,0.9);
  border-radius: 12px;
  flex-shrink: 0;
  position: relative;
  display: inline-block;
}
.mm-logo .logo-element::after {
  content: '';
  width: 22px;
  height: 22px;
  background-color: rgba(255,255,255,0.35);
  border-radius: 12px;
  position: absolute;
  right: -12px;
  top: 0;
}
.mm-logo span {
  display: inline;
  color: #1E293B;
}
.mm-buttons {
  display: flex;
  gap: 8px;
}

/* Hamburger icon — replace os-icon with FontAwesome */
.mobile-menu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: #475569;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-trigger:hover,
.mobile-menu-trigger:active {
  background: #F1F5F9;
}
/* Hide the os-icon div since font is not loaded */
.mobile-menu-trigger .os-icon {
  display: none;
}
/* Show FA bars icon instead */
.mobile-menu-trigger::before {
  content: '\f0c9';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  font-size: 1.2rem;
}
.menu-mobile.active .mobile-menu-trigger::before {
  content: '\f00d';
}

/* Menu panel */
.menu-and-user {
  display: none;
  padding: 8px 8px 16px;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  -webkit-overflow-scrolling: touch;
}
.menu-mobile.active .menu-and-user {
  display: block;
}

/* Mobile search */
.mm-search {
  padding: 12px 12px 8px;
}
.mm-search input {
  width: 100%;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #1E293B;
  background: #F8FAFC;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
}
.mm-search input:focus {
  border-color: #2A7F62;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(42, 127, 98, 0.12);
}
.mm-search input::placeholder {
  color: #94A3B8;
}

/* Mobile menu items */
.menu-mobile .main-menu {
  padding: 4px 0;
}
.menu-mobile .main-menu > li > a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  font-size: 0.92rem;
  color: #475569;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.menu-mobile .main-menu > li > a:hover,
.menu-mobile .main-menu > li > a:active {
  background: #F1F5F9;
  color: #1E293B;
}
.menu-mobile .main-menu > li.selected > a {
  background: rgba(42, 127, 98, 0.08);
  color: #2A7F62;
}

/* Hide os-icon elements globally (font not loaded) */
[class*='os-icon'] {
  font-size: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

.os-dropdown {
  display: none;
}

/* =============================================
   Display type helper
   ============================================= */
.display-type {
  display: none;
}

/* =============================================
   Responsive — Mobile
   ============================================= */
@media (max-width: 1024px) {
  .menu-w {
    display: none;
  }
  .menu-mobile {
    display: block;
  }
  .layout-w {
    flex-direction: column;
  }
  .content-w {
    padding-top: 70px;
  }
  .content-i {
    padding: 16px;
  }
  .top-bar {
    display: none;
  }
  .breadcrumb {
    padding: 0 16px 8px;
  }
}
