.sitebar {
  position: sticky;
  top: 8px;
  z-index: 20;
  width: 100%;
  min-height: 60px;
  margin: 0 auto 22px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass, var(--surface, rgba(255, 255, 255, 0.86)));
  backdrop-filter: blur(20px) saturate(1.35);
  box-shadow: var(--shadow, 0 10px 32px -18px rgba(0, 0, 0, 0.35));
  color: var(--text, var(--ink, #101b31));
}
.sitebar-back {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.sitebar-back:hover {
  text-decoration: underline;
}
.sitebar-brand {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}
.sitebar-brand[data-logo-mode="dark"] {
  background: transparent;
}
.sitebar-title {
  flex: 1;
  min-width: 0;
  font-size: 1.13rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.sitebar.has-search .sitebar-title {
  flex: 0 0 auto;
}
.sitebar-title small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0;
}
.sitebar-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(100%, 440px);
  min-width: 170px;
  height: 42px;
  margin: 0 auto;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg, rgba(255, 255, 255, 0.65));
  color: var(--muted);
}
.sitebar-search .search-icon {
  font-size: 1.2rem;
  line-height: 1;
}
.sitebar-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text, var(--ink, #101b31));
  font: inherit;
  font-size: 0.9rem;
}
.sitebar-search input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}
.sitebar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  white-space: nowrap;
}
.sitebar.has-search .sitebar-actions {
  margin-left: 0;
}
.sitebar .theme-toggle {
  flex: 0 0 auto;
  margin: 0;
}
.sitebar #new-client {
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  background: #075fe5;
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.sitebar #new-client:hover {
  background: #064fc0;
}
.sitebar .sitebar-actions .theme-toggle {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
@media (max-width: 720px) {
  .sitebar {
    top: 8px;
    display: grid;
    grid-template-columns: auto 34px minmax(0, 1fr) auto;
    grid-template-areas: "back brand title actions";
    gap: 8px 9px;
    min-height: 54px;
    margin: 0 0 16px;
    padding: 8px 9px;
    border-top: 1px solid var(--line);
    border-radius: 16px;
  }
  .sitebar-back {
    grid-area: back;
    font-size: 0.8rem;
  }
  .sitebar-brand {
    grid-area: brand;
    width: 32px;
    height: 32px;
  }
  .sitebar-title {
    grid-area: title;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sitebar-title small {
    display: none;
  }
  .sitebar-actions {
    grid-area: actions;
    gap: 6px;
    margin: 0;
  }
  .sitebar .theme-toggle,
  .sitebar .sitebar-actions .theme-toggle {
    min-height: 36px;
    padding: 0 8px;
    font-size: 0.75rem;
  }
  .sitebar-search {
    grid-area: search;
    width: 100%;
    min-width: 0;
    height: 42px;
    margin: 0;
  }
  .sitebar.has-search {
    grid-template-areas: "back brand title actions" "search search search search";
  }
  .sitebar #new-client {
    min-height: 36px;
    padding: 0 9px;
    font-size: 0.78rem;
  }
  .sitebar #new-employee {
    min-height: 36px;
    padding: 0 9px;
    font-size: 0.78rem;
  }
}
.sitebar #new-employee {
  background: #075fe5 !important;
  color: #fff !important;
}
.sitebar #new-employee:hover {
  background: #064fc0 !important;
}
.home-shell {
  width: min(100%, 1120px);
  margin: 12px auto 0;
}
@media (max-width: 720px) {
  .home-header.sitebar {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    grid-template-areas: "brand title theme";
  }
  .home-header .sitebar-brand {
    grid-area: brand;
  }
  .home-header .sitebar-title {
    grid-area: title;
  }
  .home-header .theme-toggle {
    grid-area: theme;
    justify-self: end;
    margin: 0;
  }
  .home-header .sitebar-title small {
    display: block;
  }
}
@media (max-width: 380px) {
  .sitebar #new-client {
    width: 36px;
    padding: 0;
    font-size: 0;
  }
  .sitebar #new-client::before {
    content: "+";
    font-size: 1.2rem;
  }
  .sitebar .sitebar-actions .theme-toggle {
    padding: 0 6px;
    font-size: 0.7rem;
  }
}
