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

.sidebar {
  background: var(--color-sidebar);
  border-right: 1px solid var(--color-line);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  inset: 0 auto 0 0;
  padding: 1rem;
  position: fixed;
  height: 100dvh;
  width: 17rem;
  z-index: 30;
}

.brand {
  align-items: center;
  display: flex;
  gap: 0.85rem;
  padding: 0.25rem 0.25rem 1.25rem;
}

.brand-logo {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  display: inline-flex;
  flex: 0 0 auto;
  height: 3.1rem;
  justify-content: center;
  overflow: hidden;
  padding: 0.25rem;
  width: 4.4rem;
}

.brand-logo img,
.auth-logo-frame img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.brand strong {
  color: #0f172a;
  display: block;
  font-size: 1rem;
}

.brand small,
.topbar small {
  display: block;
  font-size: 0.8rem;
}

.brand small {
  color: var(--color-muted);
}

.sidebar-nav {
  border-top: 1px solid var(--color-line);
  display: grid;
  flex: 1;
  gap: 0.35rem;
  min-height: 0;
  overflow-y: auto;
  padding-top: 1rem;
}

.sidebar-mobile-close,
.sidebar-backdrop {
  display: none;
}

.sidebar-link {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: #334155;
  cursor: pointer;
  display: flex;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 400;
  gap: 0.75rem;
  padding: 0.76rem 0.85rem;
  text-align: left;
  width: 100%;
}

.sidebar-label {
  letter-spacing: 0;
  line-height: 1.2;
}

.sidebar-link.is-active .sidebar-label {
  font-weight: 400;
}

.sidebar-link:hover,
.sidebar-link.is-active {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.sidebar-footer {
  background: #f8fafc;
  border: 1px solid var(--color-line);
  border-radius: 16px;
  margin-top: auto;
  padding: 0.85rem;
}

.sidebar-footer small {
  color: var(--color-muted);
  display: block;
  font-size: 0.74rem;
}

.sidebar-footer strong {
  color: #0f172a;
  display: block;
  font-size: 0.92rem;
  margin: 0.35rem 0 0.7rem;
}

.sidebar-footer form {
  display: block;
}

.sidebar-logout {
  background: var(--color-primary);
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  min-height: 2.25rem;
  width: 100%;
}

.nav-symbol {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--color-line);
  border-radius: 9px;
  color: currentColor;
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 700;
  height: 1.55rem;
  justify-content: center;
  line-height: 1;
  width: 1.55rem;
}

.sidebar-link:hover .nav-symbol,
.sidebar-link.is-active .nav-symbol {
  background: #ffffff;
  border-color: color-mix(in srgb, var(--color-primary) 25%, var(--color-line));
}

.app-main {
  margin-left: 17rem;
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-line);
  display: flex;
  justify-content: space-between;
  min-height: 4.25rem;
  padding: 0.8rem 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar strong {
  color: #0f172a;
}

.topbar > div {
  min-width: 0;
}

.topbar > div strong,
.topbar > div small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .topbar-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 0.55rem;
}

.topbar-password {
  background: #ffffff;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  color: #334155;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
}

.topbar-password:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.topbar-pill {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  color: #047857;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0.42rem 0.75rem;
}

.content {
  padding: 2rem;
}

.page-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.auth-shell {
  align-items: center;
  background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.07), transparent 30rem), #f8fafc;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  padding: 4rem 1rem 2rem;
  place-items: center;
}

.auth-card {
  background: #ffffff;
  border: 1px solid var(--color-line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  color: var(--color-text);
  margin: 0;
  max-width: 100%;
  min-width: 0;
  padding: 2rem;
  position: relative;
  width: 28rem;
}

.auth-logo-frame {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  display: flex;
  height: 5rem;
  justify-content: center;
  margin: -4.75rem auto 1rem;
  overflow: hidden;
  padding: 0.4rem;
  width: 8rem;
}

.auth-heading {
  margin-bottom: 1.7rem;
  text-align: center;
}

.auth-heading h1,
.auth-card h2 {
  color: #020617;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.auth-heading p,
.auth-card .muted {
  color: var(--color-muted);
  font-size: 1rem;
  margin-top: 0.45rem;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

.auth-links a {
  font-size: 0.9rem;
}

.auth-company {
  color: var(--color-muted);
  font-size: 0.78rem;
  margin-top: 1.35rem;
  text-align: center;
}

.mobile-only,
.icon-button.mobile-only {
  display: none;
}

@media (max-width: 900px) {
  .sidebar {
    box-shadow: 18px 0 50px rgba(15, 23, 42, 0.18);
    max-width: 86vw;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar-backdrop {
    background: rgba(15, 23, 42, 0.48);
    border: 0;
    display: block;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.24s ease;
    visibility: hidden;
    z-index: 25;
  }

  .sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  .sidebar-mobile-close,
  .sidebar-mobile-close.mobile-only {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--color-line);
    border-radius: 10px;
    color: var(--color-text);
    cursor: pointer;
    display: inline-flex;
    font-size: 1.5rem;
    height: 2.5rem;
    justify-content: center;
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    width: 2.5rem;
    z-index: 1;
  }

  .sidebar .brand {
    padding-right: 2.75rem;
  }

  .app-main {
    margin-left: 0;
  }

  .mobile-only,
  .icon-button.mobile-only {
    display: inline-flex;
  }

  .content,
  .topbar {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .topbar {
    gap: 0.75rem;
  }

  .topbar > div {
    flex: 1;
  }

  .topbar .topbar-actions {
    flex: 0 0 auto;
  }
}

@media (max-width: 700px) {
  .content {
    padding-bottom: 1.5rem;
    padding-top: 1.25rem;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header > .button,
  .page-header > a.button {
    width: 100%;
  }

  .auth-shell {
    padding: 3.5rem 0.75rem 1rem;
  }

  .auth-card {
    padding: 1.25rem;
  }
}

@media (max-width: 430px) {
  .topbar-pill {
    display: none;
  }

  .topbar-password {
    padding-inline: 0.6rem;
  }
}
