/* GROUP-LAYOUT-1.0.1: four readable areas, balanced sidebar and narrow screens. */
.shell { grid-template-columns: 260px minmax(0, 1fr); }
.main { min-width: 0; }
.topbar .search { min-width: 0; }
@media (min-width: 681px) {
  .topbar .gc-mobile-nav { display: none; }
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 24px 18px 16px;
  gap: 16px;
  overflow: hidden;
}
.sidebar .brand {
  flex: 0 0 52px;
  min-width: 0;
  padding: 0 8px;
}
.sidebar .brand img {
  max-width: 188px;
  max-height: 44px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.group-company-caption {
  margin: 0 5px -8px;
  color: #526373;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.sidebar .company-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 7px;
  margin: 0;
  border: 1px solid #e1e7ee;
  border-radius: 15px;
  background: #f3f6f9;
  flex-shrink: 0;
}
.sidebar .company-switch button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 6px;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: .015em;
  white-space: nowrap;
  color: #465969;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}
.sidebar .company-switch button::first-letter { font-size: inherit; }
.sidebar .company-switch button:hover { background: #e8eef4; }
.sidebar .company-switch button.active {
  color: var(--accent);
  background: #fff;
  border-color: color-mix(in srgb, var(--accent) 25%, #dce3ea);
  box-shadow: 0 2px 6px #142e4310;
}
.sidebar .company-switch button:focus-visible,
.sidebar .nav button:focus-visible {
  outline: 3px solid #488ec7;
  outline-offset: -2px;
}
.sidebar .nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd6e0 transparent;
  overscroll-behavior: contain;
  padding: 2px 3px 6px;
  gap: 5px;
}
.sidebar .nav button {
  flex-shrink: 0;
  min-height: 42px;
  width: 100%;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}
.sidebar .nav button::first-letter { font-size: inherit; }
.sidebar .nav button[data-view="group-crm"] {
  min-height: 46px;
  margin-bottom: 9px;
  font-weight: 700;
}
.sidebar .sidebar-foot {
  flex-shrink: 0;
  display: block;
  margin-top: 0;
  padding: 10px 8px 0;
  border-top: 1px solid #e5ebf0;
  font-size: 10px;
  line-height: 1.6;
}
@media (min-width: 681px) and (max-width: 1100px) {
  .shell { grid-template-columns: 236px minmax(0, 1fr); }
  .sidebar { padding: 20px 14px 14px; }
  .sidebar .brand img { max-width: 178px; }
  .gc-workspace { grid-template-columns: minmax(0, 1fr); }
  .gc-customers { position: static; max-height: 350px; }
  .gc-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .main .topbar { height: auto; min-height: 72px; padding: 12px 16px; }
  .topbar .top-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
  .topbar .user-chip { margin-left: auto; }
  .topbar .gc-mobile-nav { min-height: 40px; padding: 9px 12px; }
}
