:root {
  --shell-bg: var(--color-background);
  --shell-border: var(--color-border);
  --shell-text: var(--color-text);
  --shell-muted: var(--color-text-muted);
  --shell-link: var(--color-accent);
  --shell-sidebar-bg: var(--color-sidebar-bg);
  --shell-sidebar-border: var(--color-sidebar-border);
  --shell-sidebar-text: var(--color-sidebar-text);
  --shell-sidebar-width: var(--sidebar-width);
  --shell-sidebar-collapsed-width: var(--sidebar-collapsed-width);
  --shell-main-gutter: var(--page-inline-padding);
  --shell-warm-gradient: var(--gradient-brand);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.auth-shell-body {
  margin: 0;
  min-height: 100vh;
  color: var(--shell-text);
  font-family: var(--font-body);
  background: var(--shell-bg);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--shell-sidebar-width) minmax(0, 1fr);
}

.auth-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--shell-sidebar-bg);
  color: var(--shell-sidebar-text);
  padding: 18px 14px;
  border-right: 1px solid rgba(31, 31, 31, 0.35);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: width 180ms ease, padding 180ms ease;
  z-index: 20;
}

.auth-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  text-decoration: none;
  color: inherit;
}

.auth-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  background: var(--shell-warm-gradient);
  color: #ffffff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 10px 22px rgba(244, 111, 58, 0.3);
}

.auth-brand-text {
  font: 700 22px/1 var(--font-display);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.auth-sidebar-toggle {
  appearance: none;
  border: 1px solid var(--shell-sidebar-border);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.auth-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.auth-sidebar-toggle-bar {
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
}

.auth-user {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  line-height: 1.4;
  padding: 0 4px;
  word-break: break-word;
}

.auth-user-email {
  margin: -4px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.auth-user-block {
  display: grid;
  gap: 10px;
  padding: 0 4px;
}

.auth-org-static {
  display: grid;
  gap: 6px;
  margin: 0;
}

.auth-org-label {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-org-name {
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.auth-nav {
  display: grid;
  gap: 8px;
}

.auth-nav-group {
  display: grid;
  gap: 6px;
}

.auth-nav-link,
.auth-signout-btn {
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font: 600 14px/1.25 "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: pointer;
  text-align: left;
  transition: background 130ms ease, border-color 130ms ease, transform 130ms ease;
}

.auth-nav-toggle {
  justify-content: flex-start;
}

.auth-nav-link:hover,
.auth-signout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.auth-nav-link.is-active {
  background: linear-gradient(135deg, rgba(244, 160, 65, 0.34), rgba(244, 111, 58, 0.34));
  border-color: rgba(242, 199, 68, 0.84);
  color: #ffffff;
}

.auth-nav-icon {
  width: 20px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-nav-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.auth-nav-text {
  display: inline-block;
  white-space: nowrap;
}

.auth-nav-caret {
  margin-left: auto;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 130ms ease;
}

.auth-nav-toggle[aria-expanded="true"] .auth-nav-caret {
  transform: rotate(225deg);
}

.auth-subnav {
  display: grid;
  gap: 4px;
  padding-left: 18px;
}

.auth-subnav[hidden] {
  display: none;
}

.auth-subnav-link {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  border-radius: 10px;
  padding: 7px 12px;
  font: 600 13px/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
  transition: background 130ms ease, color 130ms ease;
}

.auth-subnav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.auth-subnav-link.is-active {
  background: rgba(244, 160, 65, 0.2);
  color: #ffffff;
 }

.auth-sidebar-footer {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-main {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.auth-main-top {
  min-height: 0;
  padding: 12px var(--shell-main-gutter) 0;
}

.auth-mobile-nav-toggle,
.auth-sidebar-scrim {
  display: none;
}

.auth-main .page {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px var(--shell-main-gutter) 52px;
}

.auth-main .hero h1 {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-weight: 700;
}

.auth-main .hero p {
  color: var(--shell-muted);
}

body.is-sidebar-collapsed .auth-shell {
  grid-template-columns: var(--shell-sidebar-collapsed-width) minmax(0, 1fr);
}

body.is-sidebar-collapsed .auth-sidebar {
  padding-left: 10px;
  padding-right: 10px;
}

body.is-sidebar-collapsed .auth-brand {
  justify-content: center;
  width: 100%;
}

body.is-sidebar-collapsed .auth-brand-text,
body.is-sidebar-collapsed .auth-user,
body.is-sidebar-collapsed .auth-user-email,
body.is-sidebar-collapsed .auth-org-static,
body.is-sidebar-collapsed .auth-nav-text,
body.is-sidebar-collapsed .auth-subnav {
  display: none;
}

body.is-sidebar-collapsed .auth-sidebar-toggle {
  margin: 0 auto;
}

body.is-sidebar-collapsed .auth-nav-link,
body.is-sidebar-collapsed .auth-signout-btn {
  justify-content: center;
  padding-left: 10px;
  padding-right: 10px;
}

body.is-sidebar-collapsed .auth-nav-caret {
  display: none;
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(84vw, 316px);
    max-width: 316px;
    transform: translateX(-104%);
    transition: transform 180ms ease;
    box-shadow: 0 24px 48px rgba(31, 31, 31, 0.36);
  }

  body.is-mobile-nav-open .auth-sidebar {
    transform: translateX(0);
  }

  .auth-sidebar-scrim {
    border: 0;
    padding: 0;
    margin: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.36);
    position: fixed;
    inset: 0;
    z-index: 15;
    cursor: pointer;
  }

  body.is-mobile-nav-open .auth-sidebar-scrim {
    display: block;
  }

  .auth-mobile-nav-toggle {
    appearance: none;
    border: 1px solid var(--shell-border);
    background: #ffffff;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
  }

  .auth-mobile-nav-toggle span {
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: #1f1f1f;
  }

  .auth-main .page {
    padding-top: 16px;
  }
}
