.has-app-shell {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: inherit;
  color: inherit;
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  flex: 0 0 248px;
  max-width: 248px;
  height: 100vh;
  border-right: 1px solid color-mix(in srgb, #475569 55%, transparent);
  background: color-mix(in srgb, #0f172a 86%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body.theme-light .app-sidebar {
  background: color-mix(in srgb, #ffffff 92%, transparent);
  border-color: color-mix(in srgb, #94a3b8 45%, transparent);
}

.app-sidebar__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.75rem 1.25rem;
  gap: 1.5rem;
}

.app-sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-sidebar__brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.app-sidebar__brand-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.app-sidebar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.85rem;
  color: color-mix(in srgb, #e2e8f0 72%, transparent);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  border: 1px solid transparent;
}

.app-sidebar__link:hover {
  color: #f8fafc;
  background: color-mix(in srgb, #94a3b8 18%, transparent);
  border-color: color-mix(in srgb, #94a3b8 18%, transparent);
}

.app-sidebar__link.is-active {
  color: #bbf7d0;
  background: color-mix(in srgb, #10b981 22%, transparent);
  border-color: color-mix(in srgb, #10b981 40%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #10b981 28%, transparent);
}

body.theme-light .app-sidebar__link {
  color: color-mix(in srgb, #1e293b 74%, transparent);
}

body.theme-light .app-sidebar__link:hover {
  color: #0f172a;
  background: color-mix(in srgb, #94a3b8 22%, transparent);
  border-color: color-mix(in srgb, #94a3b8 28%, transparent);
}

body.theme-light .app-sidebar__link.is-active {
  color: #047857;
  background: color-mix(in srgb, #10b981 18%, transparent);
  border-color: color-mix(in srgb, #10b981 35%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #10b981 20%, transparent);
}

.app-sidebar__link.is-disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.app-sidebar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 0.75rem;
  background: color-mix(in srgb, #0f172a 55%, transparent);
  color: #94a3b8;
}

body.theme-light .app-sidebar__icon {
  background: color-mix(in srgb, #94a3b8 22%, transparent);
  color: color-mix(in srgb, #0f172a 68%, transparent);
}

.app-sidebar__icon-svg {
  width: 18px;
  height: 18px;
  display: block;
}

.app-sidebar__label {
  flex: 1;
  line-height: 1.25;
  text-wrap: pretty;
}

.app-sidebar__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: color-mix(in srgb, #94a3b8 18%, transparent);
  color: color-mix(in srgb, #e2e8f0 78%, transparent);
}

body.theme-light .app-sidebar__badge {
  background: color-mix(in srgb, #94a3b8 16%, transparent);
  color: color-mix(in srgb, #1e293b 68%, transparent);
}

.app-sidebar__spacer {
  flex: 1 1 auto;
}

.app-sidebar__user {
  position: relative;
}

.app-sidebar__user-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.95rem;
  border: 1px solid color-mix(in srgb, #94a3b8 20%, transparent);
  background: color-mix(in srgb, #0f172a 55%, transparent);
  color: #f1f5f9;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.app-sidebar__user-btn:hover {
  background: color-mix(in srgb, #0f172a 68%, transparent);
  border-color: color-mix(in srgb, #94a3b8 32%, transparent);
}

body.theme-light .app-sidebar__user-btn {
  background: color-mix(in srgb, #e2e8f0 75%, transparent);
  color: #0f172a;
  border-color: color-mix(in srgb, #94a3b8 32%, transparent);
}

body.theme-light .app-sidebar__user-btn:hover {
  background: color-mix(in srgb, #e2e8f0 92%, transparent);
}

.app-sidebar__user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
}

.app-sidebar__user-name {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.app-sidebar__user-caret {
  font-size: 0.65rem;
  opacity: 0.75;
}

.app-sidebar__user-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: auto;
  bottom: calc(100% + 0.75rem);
  border-radius: 0.95rem;
  border: 1px solid color-mix(in srgb, #94a3b8 22%, transparent);
  background: color-mix(in srgb, #0f172a 95%, transparent);
  box-shadow: 0 20px 45px color-mix(in srgb, #0f172a 45%, transparent);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 60;
}

.app-sidebar__user-menu-item {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #f4f4f5;
  background: transparent;
  border: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.app-sidebar__user-menu-item:hover {
  background: color-mix(in srgb, #f87171 22%, transparent);
  color: #fecaca;
}

body.theme-light .app-sidebar__user-menu {
  background: color-mix(in srgb, #ffffff 98%, transparent);
  border-color: color-mix(in srgb, #94a3b8 28%, transparent);
  box-shadow: 0 18px 40px color-mix(in srgb, #0f172a 18%, transparent);
}

body.theme-light .app-sidebar__user-menu-item {
  color: #0f172a;
}

body.theme-light .app-sidebar__user-menu-item:hover {
  background: color-mix(in srgb, #f87171 18%, transparent);
  color: #9f1239;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  background: inherit;
  color: inherit;
}

@media (max-width: 1024px) {
  .app-shell {
    flex-direction: column;
  }

  .app-sidebar {
    flex: 0 0 auto;
    max-width: none;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid color-mix(in srgb, #475569 55%, transparent);
  }

  body.theme-light .app-sidebar {
    border-bottom-color: color-mix(in srgb, #94a3b8 45%, transparent);
  }

  .app-sidebar__inner {
    flex-direction: column;
    gap: 1.25rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .app-sidebar__nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 0.75rem;
    padding-bottom: 0.4rem;
  }

  .app-sidebar__link {
    flex: 0 0 auto;
    min-width: 160px;
  }

  .app-sidebar__spacer {
    display: none;
  }

  .app-sidebar__user {
    align-self: stretch;
  }

  .app-sidebar__user-menu {
    bottom: auto;
    top: calc(100% + 0.5rem);
  }
}

@media (max-width: 640px) {
  .app-sidebar__inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .app-sidebar__link {
    min-width: 140px;
    padding: 0.6rem 0.75rem;
  }

  .app-sidebar__badge {
    display: none;
  }
}
