/* =============================================
   Promo Layout — Sidebar, Topbar, Mobile Menu
   Adapted from SAMG layout.css for promolocales
   ============================================= */

/* =============================================
   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(--promo-bg, #F1F5F9);
}
.content-i {
  padding: 24px 32px;
}
.content-box {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}
.element-wrapper {
  margin-bottom: 0;
}

/* =============================================
   Legacy OS-theme Components (Asset Isolation)
   Ported from main.css for activity dashboard
   ============================================= */
.element-header {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--promo-slate, #334155);
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.element-box {
  background: #fff;
  border-radius: var(--promo-radius-sm, 8px);
  border: 1px solid var(--promo-border, #E2E8F0);
  padding: 20px;
  margin-bottom: 20px;
}
/* Dashboard row spacing */
.content-box > .row {
  margin-bottom: 24px;
}
/* Neutralize element-box inside promo-table-wrapper (avoid double card) */
.promo-table-wrapper .element-box {
  border: none;
  border-radius: 0;
  margin-bottom: 0;
  box-shadow: none;
}
.element-box-tp {
  padding: 16px;
}
.el-tablo {
  text-align: center;
}
.el-tablo .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748B;
  font-weight: 600;
  margin-bottom: 6px;
}
.el-tablo .value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--promo-slate, #334155);
  line-height: 1.2;
}
.el-tablo .trending {
  margin-top: 6px;
  font-size: 0.72rem;
}
/* Equal height for KPI cards */
.el-tablo {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* Activity timeline */
#timelineRecentActivity {
  max-height: 500px;
  overflow-y: auto;
}
#timelineRecentActivity li {
  padding: 10px 14px;
  border-left: 3px solid var(--promo-primary, #034B98);
  background: #F8FAFC;
  border-radius: 0 6px 6px 0;
  margin-bottom: 6px;
  transition: background 0.2s ease;
}
#timelineRecentActivity li:hover {
  background: #EFF6FF;
}
#timelineRecentActivity li .badge {
  font-size: 0.65rem;
}
#timelineRecentActivity li .d-flex {
  flex-direction: column;
  gap: 2px;
}
#timelineRecentActivity li .mr-2 {
  margin-right: 0 !important;
}
#timelineRecentActivity li .mr-2 .badge {
  background: none;
  color: #94A3B8;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0;
  display: block;
  margin-bottom: 2px;
}
/* Dashboard card detail links */
.element-box > .mt-2.text-right {
  border-top: 1px solid var(--promo-border, #E2E8F0);
  margin-top: 16px !important;
  padding-top: 12px;
}
.element-box > .mt-2.text-right a {
  color: var(--promo-primary, #034B98);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}
.element-box > .mt-2.text-right a:hover {
  color: #0369A1;
  text-decoration: underline;
}
/* Activity legend (collapsible) */
.activity-legend {
  background: #fff;
  border: 1px solid var(--promo-border, #E2E8F0);
  border-radius: var(--promo-radius-sm, 8px);
  overflow: hidden;
}
.activity-legend summary {
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
}
.activity-legend summary:hover {
  background: #F8FAFC;
}
.activity-legend summary::-webkit-details-marker { display: none; }
.activity-legend summary::after {
  content: '▸';
  margin-left: auto;
  transition: transform 0.2s ease;
}
.activity-legend[open] summary::after {
  transform: rotate(90deg);
}
.activity-legend-body {
  padding: 16px 20px;
  border-top: 1px solid var(--promo-border, #E2E8F0);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.legend-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legend-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
  padding-bottom: 4px;
  border-bottom: 1px solid #F1F5F9;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.legend-item .badge {
  flex-shrink: 0;
  min-width: 130px;
  text-align: center;
}
.legend-desc {
  font-size: 0.75rem;
  color: #64748B;
  line-height: 1.4;
}
@media (max-width: 768px) {
  .activity-legend-body {
    grid-template-columns: 1fr;
  }
}
/* Nav Tabs — activity section navigation */
.nav-tabs .nav-link {
  color: #64748B;
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  transition: all 0.2s ease;
}
.nav-tabs .nav-link:hover {
  color: var(--promo-primary, #034B98);
  border-bottom-color: rgba(3, 75, 152, 0.3);
}
.nav-tabs .nav-link.active {
  color: var(--promo-primary, #034B98);
  background: transparent;
  border-bottom: 2px solid var(--promo-primary, #034B98);
  font-weight: 600;
}
/* Badges */
.badge-success { background: #10B981; color: #fff; }
.badge-info { background: #3B82F6; color: #fff; }
.badge-primary { background: var(--promo-primary, #034B98); color: #fff; }
.badge-warning { background: #F59E0B; color: #fff; }
.badge-secondary { background: #64748B; color: #fff; }
.badge-dark { background: #1E293B; color: #fff; }
.badge-light { background: #F1F5F9; color: #334155; }
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
}
/* Table utilities */
.table-lightborder td, .table-lightborder th {
  border-color: #F1F5F9;
}
.nowrap {
  white-space: nowrap;
}

/* =============================================
   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: #034B98;
  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(3,75,152,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: #034B98;
  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: #034B98;
  background: rgba(3, 75, 152, 0.08);
  font-weight: 600;
  border-left-color: #034B98;
}
.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: #034B98;
}

/* 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: #034B98;
}

/* 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: #034B98;
  background: rgba(3, 75, 152, 0.06);
}
.sub-menu-i .sub-menu li a:hover::before {
  background: #034B98;
}
.sub-menu-i .sub-menu li.active a {
  color: #034B98;
  background: rgba(3, 75, 152, 0.08);
  font-weight: 600;
}
.sub-menu-i .sub-menu li.active a::before {
  background: #034B98;
  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;
  justify-content: flex-end;
  width: 100%;
  gap: 16px;
}

/* Search in topbar — centered */
.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: #034B98;
  box-shadow: 0 0 0 3px rgba(3, 75, 152, 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, #034B98 0%, #023670 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: 12px 24px;
  margin: 0;
  background: transparent;
  font-size: 0.78rem;
  border-bottom: none;
}
.breadcrumb-item a {
  color: #94A3B8;
  text-decoration: none;
  text-transform: capitalize;
}
.breadcrumb-item a:hover {
  color: #034B98;
}

/* =============================================
   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: #034B98;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(3, 75, 152, 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(3, 75, 152, 0.08);
  color: #034B98;
}

/* 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;
  }
}
