/* Application shell and shared layout */

/* Sidebar IA + collapse */
.app {
  transition: grid-template-columns .18s ease;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: width .18s ease, padding .18s ease;
  overflow-x: hidden;
  overflow-y: auto;
}

.main {
  grid-column: 2;
  min-width: 0;
}

.sidebar-toggle {
  position: absolute;
  top: 18px;
  right: 10px;
  z-index: 20;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  background: #fff;
  color: #596600;
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(44,52,24,.12);
  font-size: 20px;
  line-height: 1;
}

.sidebar-toggle:hover {
  transform: none;
}

.sidebar .brand {
  border-bottom: 0;
  margin-bottom: 14px;
  padding-bottom: 10px;
}

.sidebar-client-card {
  width: 100%;
  display: block;
  text-align: left;
  background: rgba(255,255,255,.8);
  color: #172033;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin: 0 0 20px;
  box-shadow: 0 14px 36px rgba(44,52,24,.08);
}

.sidebar-client-card:hover {
  transform: none;
  background: #fff;
}

.sidebar-client-card.active {
  background: #f8faeb;
  border-color: #cdd4ad;
}

.sidebar-section-label,
.nav-heading {
  display: block;
  margin: 0 0 9px;
  color: #8a9462;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.sidebar-client-main {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
}

.sidebar-client-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #f2efff;
  color: #6b46c1;
  font-size: 15px;
}

.sidebar-client-main strong {
  display: block;
  color: #172033;
  font-size: 15px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-client-main small {
  display: block;
  margin-top: 3px;
  color: #63708a;
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-client-arrow {
  color: #3f4609;
  font-size: 24px;
  font-weight: 800;
}

.sidebar-client-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: #63708a;
  font-size: 11px;
  line-height: 1.2;
}

.sidebar-client-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sidebar-client-meta .ok::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #5aa832;
}

.nav {
  gap: 0;
}

.nav-hidden-button {
  display: none !important;
}

.nav-group {
  display: grid;
  gap: 6px;
  padding: 0 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(217,222,195,.85);
}

.nav-group:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.nav button {
  min-height: 46px;
  border-radius: 12px;
  color: #4b5567;
  font-weight: 850;
}

.nav-group-primary button {
  color: #3f4609;
}

.nav-group-secondary button {
  opacity: .78;
}

.nav-group-secondary button.active,
.nav-group-secondary button:hover {
  opacity: 1;
}

.nav-icon {
  width: 24px;
  display: inline-grid;
  place-items: center;
  font-size: 19px;
  color: #7b61ff;
  flex: 0 0 24px;
}

.nav-group-primary .nav-icon {
  color: #596600;
}

.nav-group-secondary:nth-of-type(3) .nav-icon {
  color: #43a77a;
}

.nav-group-secondary:nth-of-type(4) .nav-icon {
  color: #7668d8;
}

.nav-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.sidebar-collapsed {
  --sidebar: 82px;
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar);
  padding: 22px 12px;
  overflow-x: hidden;
}

body.sidebar-collapsed .sidebar-toggle {
  right: 8px;
}

body.sidebar-collapsed .brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

body.sidebar-collapsed .brand > div:not(.logo),
body.sidebar-collapsed .sidebar-client-card,
body.sidebar-collapsed .nav-heading,
body.sidebar-collapsed .nav-text {
  display: none;
}

body.sidebar-collapsed .logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

body.sidebar-collapsed .nav-group {
  justify-items: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
}

body.sidebar-collapsed .nav button {
  width: 48px;
  height: 48px;
  min-height: 48px;
  justify-content: center;
  padding: 0;
  border-radius: 14px;
}

body.sidebar-collapsed .nav-icon {
  width: auto;
  flex-basis: auto;
}

@media (max-width: 1180px) {
  .sidebar {
    position: relative;
    width: auto;
    height: auto;
    inset: auto;
  }

  .main {
    grid-column: 1;
  }
}

/* Force recommendations full width */
.recommendation-section,
#recommendationsPanelMount,
#recommendationEngine {
  width: 100% !important;
  max-width: none !important;
  grid-column: 1 / -1 !important;
  box-sizing: border-box !important;
}
