.admin-shell {
  display: flex;
  flex: 1;
  height: 100%;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: #f3f5f4;
}

.admin-shell__sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: 17.5rem;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  padding: 1.25rem 1rem 1.5rem;
  color: #f8faf9;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 20;
  background:
    radial-gradient(circle at 0% 0%, rgb(247 232 22 / 0.14), transparent 42%),
    radial-gradient(circle at 100% 100%, rgb(0 0 0 / 0.18), transparent 48%),
    linear-gradient(180deg, #056832 0%, #067b3a 48%, #045a2c 100%);
  border-right: 1px solid rgb(0 0 0 / 0.12);
  box-shadow: 8px 0 32px rgb(4 90 44 / 0.12);
}

.admin-shell__sidebar-top {
  display: grid;
  gap: 1.25rem;
  flex-shrink: 0;
}

.admin-shell__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(255 255 255 / 0.88);
  text-decoration: none;
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(255 255 255 / 0.12);
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.admin-shell__back:hover {
  background: rgb(255 255 255 / 0.14);
  border-color: rgb(255 255 255 / 0.2);
}

.admin-shell__back-icon {
  width: 1rem;
  height: 1rem;
}

.admin-shell__brand {
  display: grid;
  gap: 0.875rem;
  padding: 0 0 0.5rem;
}

.admin-shell__logo {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  border-radius: 0.5rem;
  background: rgb(255 255 255 / 0.96);
  padding: 0.35rem 0.5rem;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.12);
  box-sizing: border-box;
}

.admin-shell__brand-copy {
  display: grid;
  gap: 0.35rem;
}

.admin-shell__app-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

.admin-shell__badge {
  margin: 0;
  width: fit-content;
  padding: 0.28rem 0.6rem 0.2rem;
  border-radius: 999px;
  font-family: var(--ds-font-tag, var(--ds-font-display, "Inter", sans-serif));
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-transform: uppercase;
  color: #fff;
  background: #d63516;
}

.admin-shell--manager {
  flex-direction: column;
  --manager-pad-x: clamp(1.125rem, 2vw, 1.75rem);
  --manager-pad-y: 1.25rem;
  --manager-gap: 1rem;
  --manager-green: #067b3a;
  --manager-green-deep: #04532a;
  --manager-green-mid: #056832;
  --console-accent: #f7e816;
  --console-accent-ink: #1d1d1b;
  --console-active-icon-bg: #1d1d1b;
  --console-active-icon-ink: #f7e816;
}

.admin-shell--admin {
  --console-accent: #d63516;
  --console-accent-ink: #fff;
  --console-active-icon-bg: #fff;
  --console-active-icon-ink: #d63516;
}

/* Shared canvas for every association-management route. The global admin
 * console keeps its own neutral background via `.admin-shell--admin`. */
.admin-shell--manager:not(.admin-shell--admin) .admin-shell__main,
.admin-shell--manager:not(.admin-shell--admin) .background--admin {
  background: linear-gradient(180deg, #f3f7f5 0%, #eef5f2 58%, #e8f2f6 100%);
}

.admin-shell--manager:not(.admin-shell--admin)
  .background--admin
  .background__gradient {
  background:
    radial-gradient(circle at 8% 12%, rgb(6 123 58 / 0.055), transparent 36%),
    radial-gradient(
      circle at 82% 100%,
      rgb(80 186 199 / 0.11),
      transparent 42%
    ),
    linear-gradient(180deg, rgb(255 255 255 / 0.08), rgb(85 154 190 / 0.06));
}

.admin-shell--manager .admin-shell__badge--manager {
  color: var(--console-accent-ink);
  background: var(--console-accent);
}

.admin-shell--manager .admin-shell__sidebar {
  width: 17rem;
  padding: var(--manager-pad-y) var(--manager-pad-x);
  background: linear-gradient(
    180deg,
    var(--manager-green) 0%,
    var(--manager-green-mid) 55%,
    #044f28 100%
  );
  height: 100%;
  max-height: none;
  align-self: stretch;
  box-shadow: none;
  border-right: 1px solid rgb(0 0 0 / 0.1);
}

.admin-shell--manager .admin-shell__link--active {
  color: var(--console-accent-ink);
  background: var(--console-accent);
  border-color: var(--console-accent);
}

.manager-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 22rem) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  width: 100%;
  min-height: 3.15rem;
  padding: 0.65rem var(--manager-pad-x);
  color: #fff;
  background: var(--manager-green-deep);
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  box-shadow: none;
  box-sizing: border-box;
  z-index: 40;
}

.admin-shell--admin .manager-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.manager-topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  justify-self: start;
}

.manager-topbar__app-name {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
}

.manager-topbar__badge {
  margin: 0;
  flex-shrink: 0;
  padding: 0.32rem 0.65rem 0.24rem;
  border-radius: 0.35rem;
  font-family: var(--ds-font-tag, var(--ds-font-display, "Inter", sans-serif));
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--console-accent-ink);
  background: var(--console-accent);
}

.manager-topbar__select {
  justify-self: center;
  width: 100%;
  max-width: 22rem;
  z-index: 50;
}

.manager-topbar__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  justify-self: end;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 0.5rem;
  box-sizing: border-box;
  min-height: 2.35rem;
  font-family: var(
    --ds-font-button,
    var(--ds-font-accent, "Poppins", sans-serif)
  );
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: var(--ds-button-line-height, 1.2);
  color: rgb(255 255 255 / 0.92);
  text-decoration: none;
  background: rgb(255 255 255 / 0.08);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.manager-topbar__back:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.14);
  border-color: rgb(255 255 255 / 0.32);
}

.manager-shell__body {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.manager-shell__body > .admin-shell__main {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.manager-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--manager-gap);
}

.manager-sidebar__top {
  display: grid;
  gap: var(--manager-gap);
  flex-shrink: 0;
}

.manager-sidebar__logo {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0.5rem 0.6rem;
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.1);
  box-sizing: border-box;
}

.manager-sidebar__asso {
  display: grid;
  gap: 0.3rem;
  padding: 0.15rem 0.15rem 0;
}

.manager-sidebar__asso-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

.manager-sidebar__asso-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(255 255 255 / 0.72);
  text-decoration: none;
}

.manager-sidebar__asso-link:hover {
  color: var(--console-accent);
  text-decoration: underline;
}

.manager-sidebar__asso-icon {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.manager-sidebar__nav {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.18rem;
  margin: 0;
  padding: 0.25rem;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 0.75rem;
  background: rgb(0 0 0 / 0.1);
}

.manager-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.55rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  color: rgb(255 255 255 / 0.88);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  isolation: isolate;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.manager-sidebar__link > * {
  pointer-events: none;
}

.manager-sidebar__link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  flex-shrink: 0;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 0.55rem;
  color: currentColor;
  background: rgb(255 255 255 / 0.08);
  box-shadow: none;
  line-height: 0;
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.manager-sidebar__link-icon .admin-shell__icon {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
}

.manager-sidebar__link-label {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.manager-sidebar__link-count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0.12rem 0.35rem 0.04rem;
  border-radius: 999px;
  font-family: var(--ds-font-tag, var(--ds-font-display, "Inter", sans-serif));
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  color: #1d1d1b;
  background: #f7e816;
}

.manager-sidebar__link--active .manager-sidebar__link-count {
  color: #f7e816;
  background: #1d1d1b;
}

.manager-sidebar__link:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.1);
}

.manager-sidebar__link--active {
  color: var(--console-accent-ink);
  background: var(--console-accent);
  border-color: var(--console-accent);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.22),
    0 7px 16px rgb(0 0 0 / 0.14);
}

.manager-sidebar__link--active .manager-sidebar__link-icon {
  color: var(--console-active-icon-ink);
  background: var(--console-active-icon-bg);
  border-color: transparent;
  box-shadow: 0 4px 10px rgb(0 0 0 / 0.2);
  transform: scale(1.06);
}

.manager-sidebar__link--active:hover {
  color: var(--console-accent-ink);
  background: var(--console-accent);
  border-color: var(--console-accent);
}

.manager-sidebar__footer {
  display: grid;
  gap: 0.65rem;
  margin-top: auto;
  padding-top: var(--manager-gap);
  flex-shrink: 0;
}

.console-account {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 0.8rem;
  background: linear-gradient(
    145deg,
    rgb(255 255 255 / 0.12),
    rgb(0 0 0 / 0.1)
  );
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.1);
}

.console-account__identity {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.console-account__avatar {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: 0.7rem;
  color: var(--console-sidebar, #056832);
  background: #fff;
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  box-shadow: 0 5px 14px rgb(0 0 0 / 0.14);
}

.console-account__copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.console-account__name,
.console-account__email,
.console-account__role {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-account__name {
  font-size: 0.875rem;
  font-weight: 750;
  line-height: 1.25;
  color: #fff;
}

.console-account__email {
  font-size: 0.75rem;
  font-weight: 550;
  line-height: 1.3;
  color: rgb(255 255 255 / 0.78);
}

.console-account__role {
  width: fit-content;
  margin-top: 0.12rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.86);
  background: rgb(255 255 255 / 0.1);
}

.console-account__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 2rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 0.55rem;
  background: rgb(214 53 22 / 0.76);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.console-account__logout-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.console-account__logout:hover {
  border-color: rgb(255 255 255 / 0.45);
  background: #d63516;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgb(116 22 9 / 0.28);
}

.console-account__logout:active {
  transform: translateY(0);
}

.console-account__logout:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.manager-association-picker {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.manager-association-picker__label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.72);
}

.manager-association-picker__control {
  position: relative;
}

.manager-association-picker__select {
  appearance: none;
  width: 100%;
  padding: 0.8rem 2.4rem 0.8rem 0.9rem;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 0.75rem;
  background: linear-gradient(
    180deg,
    rgb(255 255 255 / 0.18),
    rgb(255 255 255 / 0.1)
  );
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.manager-association-picker__select:hover:not(:disabled) {
  border-color: rgb(247 232 22 / 0.55);
  background: linear-gradient(
    180deg,
    rgb(255 255 255 / 0.24),
    rgb(255 255 255 / 0.12)
  );
}

.manager-association-picker__select:focus-visible {
  outline: 2px solid #f7e816;
  outline-offset: 2px;
}

.manager-association-picker__select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.manager-association-picker__select option {
  color: #111827;
  background: #fff;
}

.manager-association-picker__chevron {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  width: 1.1rem;
  height: 1.1rem;
  color: #f7e816;
  pointer-events: none;
  transform: translateY(-50%);
}

.manager-association-picker__chevron svg {
  display: block;
  width: 100%;
  height: 100%;
}

.admin-shell__nav {
  display: grid;
  gap: 0.4rem;
  margin-top: 1.75rem;
  flex-shrink: 0;
  padding: 0.5rem;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 0.875rem;
  background: rgb(0 0 0 / 0.08);
}

.admin-shell__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: rgb(255 255 255 / 0.82);
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.admin-shell__link:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.1);
  border-color: rgb(255 255 255 / 0.08);
}

.admin-shell__link--active {
  color: #045a2c;
  background: #fff;
  border-color: rgb(255 255 255 / 0.92);
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.12);
}

.admin-shell__icon {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}

.admin-shell__sidebar-footer {
  display: grid;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1.5rem;
  flex-shrink: 0;
}

.admin-shell__footer-text {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgb(255 255 255 / 0.58);
}

.admin-shell__main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f3f5f4;
}

.admin-shell__main > * {
  flex: 1;
  min-height: 0;
  min-width: 0;
}

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

  .admin-shell--manager {
    flex-direction: column;
  }

  .manager-shell__body {
    flex-direction: column;
    overflow: auto;
  }

  .manager-topbar {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding-block: 0.75rem;
  }

  .manager-topbar__brand,
  .manager-topbar__select,
  .manager-topbar__back {
    justify-self: stretch;
  }

  .manager-topbar__back {
    justify-content: center;
  }

  .manager-topbar__select {
    max-width: none;
    order: 2;
  }

  .manager-topbar__back {
    order: 3;
  }

  .admin-shell__sidebar {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
    flex-shrink: 0;
    padding: 1rem 1rem 1.125rem;
    box-shadow: 0 8px 24px rgb(4 90 44 / 0.1);
    overflow-y: visible;
  }

  .admin-shell--manager .admin-shell__sidebar {
    height: auto;
  }

  .admin-shell__brand {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 0.875rem;
  }

  .admin-shell__logo {
    width: 100%;
    max-width: none;
  }

  .admin-shell__nav {
    margin-top: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-shell--admin .manager-topbar {
    grid-template-columns: 1fr;
  }

  .admin-shell--manager:not(.admin-shell--admin) .manager-sidebar__nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-shell--admin .manager-sidebar__nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .manager-sidebar__footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .admin-shell__sidebar-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding-top: 1rem;
  }

  .console-account {
    padding: 0.75rem;
  }

  .admin-shell__footer-text {
    display: none;
  }
}

@media (max-width: 560px) {
  .admin-shell__nav {
    grid-template-columns: 1fr;
  }
}
