.icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.application-shell {
  min-height: 100vh;
  background: var(--color-bg);
}

.app-topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 var(--space-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(64, 58, 92, 0.98);
  color: white;
  box-shadow: 0 4px 20px rgba(38, 31, 66, 0.14);
  backdrop-filter: blur(14px);
}

.app-topbar__left,
.app-topbar__actions,
.app-brand,
.profile-trigger,
.location-chip {
  display: flex;
  align-items: center;
}

.app-topbar__left,
.app-topbar__actions {
  gap: var(--space-3);
}

.app-brand {
  gap: var(--space-3);
  color: white;
  text-decoration: none;
}

.app-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.app-brand strong,
.app-brand small,
.profile-trigger strong,
.profile-trigger small,
.workspace-pill strong,
.workspace-pill small,
.profile-panel__header strong,
.profile-panel__header small {
  display: block;
}

.app-brand strong {
  font-size: 1.08rem;
  font-weight: 950;
}

.app-brand small,
.profile-trigger small {
  color: rgba(255, 255, 255, 0.7);
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.app-topbar__menu,
.app-sidebar__close {
  display: none;
}

.location-chip {
  min-height: 42px;
  gap: var(--space-2);
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
}

.location-chip .icon {
  width: 18px;
  height: 18px;
  color: var(--color-turquoise);
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--color-plum);
  border-radius: 50%;
  background: var(--color-coral);
}

.profile-trigger {
  min-height: 48px;
  gap: var(--space-2);
  padding: 0.25rem 0.5rem 0.25rem 0.3rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
  text-align: left;
}

.profile-trigger:hover {
  background: rgba(255, 255, 255, 0.14);
}

.avatar {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: var(--color-raspberry);
  color: white;
  font-size: var(--font-size-sm);
  font-weight: 950;
}

.avatar--large {
  width: 56px;
  height: 56px;
  flex-basis: 56px;
  font-size: 1rem;
}

.application-frame {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 270px minmax(0, 1fr);
  padding-top: var(--header-height);
}

.app-sidebar {
  position: fixed;
  z-index: 30;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  display: flex;
  width: 270px;
  flex-direction: column;
  padding: var(--space-4);
  border-right: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 8px 0 30px rgba(64, 58, 92, 0.05);
}

.app-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.workspace-pill {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-lilac-pale);
}

.workspace-pill__icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 13px;
  background: white;
  color: var(--color-raspberry);
}

.workspace-pill__icon .icon {
  width: 20px;
  height: 20px;
}

.workspace-pill strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-pill small {
  color: var(--color-text-muted);
}

.app-sidebar__add {
  width: 100%;
  margin-bottom: var(--space-4);
}

.app-sidebar__add .icon {
  width: 19px;
  height: 19px;
}

.side-nav,
.mobile-nav {
  display: grid;
  gap: var(--space-1);
}

.side-nav__item,
.mobile-nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-plum);
  font-weight: 850;
  text-decoration: none;
}

.side-nav__item {
  min-height: 48px;
  padding: 0.65rem 0.8rem;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.side-nav__item:hover {
  background: var(--color-bg);
}

.side-nav__item.is-active {
  border-left-color: var(--color-turquoise);
  background: var(--color-raspberry-pale);
  color: var(--color-raspberry);
}

.side-nav__icon {
  width: 21px;
  height: 21px;
}

.side-nav--secondary {
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.app-sidebar__spacer {
  flex: 1;
}

.app-sidebar__version {
  margin-top: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  text-align: center;
}

.app-main {
  min-width: 0;
  grid-column: 2;
  padding: var(--space-8) clamp(1rem, 4vw, 3rem) var(--space-12);
}

.page-heading {
  display: flex;
  max-width: 1180px;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin: 0 auto var(--space-5);
}

.page-heading h1 {
  margin-bottom: 0;
}

.page-heading__lead {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
}

.preview-notice,
.app-page-content,
.app-footer {
  width: min(100%, 1180px);
  margin-inline: auto;
}

.preview-notice {
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-cream-strong);
  color: var(--color-plum);
  font-size: var(--font-size-sm);
}

.app-footer {
  margin-top: var(--space-10);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
}

.mobile-nav,
.mobile-add-button {
  display: none;
}

.profile-panel {
  position: fixed;
  z-index: 80;
  top: calc(var(--header-height) - 4px);
  right: var(--space-4);
  width: min(340px, calc(100vw - 2rem));
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-md);
}

.profile-panel__header,
.settings-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.profile-panel__header small {
  color: var(--color-text-muted);
}

.profile-panel__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.profile-panel__link {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: var(--space-3);
  padding: 0.65rem 0.7rem;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-plum);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
}

.profile-panel__link:hover {
  background: var(--color-bg);
}

.profile-panel__link .icon {
  width: 20px;
  height: 20px;
}

.profile-panel__link--danger {
  color: var(--color-danger);
}

.toast {
  position: fixed;
  z-index: 100;
  right: var(--space-5);
  bottom: var(--space-5);
  max-width: min(420px, calc(100vw - 2rem));
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-plum);
  color: white;
  box-shadow: var(--shadow-md);
  font-weight: 750;
}

.drawer-backdrop {
  position: fixed;
  z-index: 25;
  inset: var(--header-height) 0 0;
  background: rgba(35, 29, 54, 0.42);
}
