/* Console shell: the dark sidebar (and the store sidebar and its switcher), the topbar, the phone's bottom bar, and the
   icon and avatar basics. Loaded with the other admin/*.css files by _AdminStyles. */

/* Console layout (_ConsoleLayout): dark sidebar (offcanvas below lg) + content area. Shared by the super admin
   console and the business dashboard, which differ in accent so it's always clear whose data is on screen.
   Colours come from tokens.css. */

.admin-body {
  margin-bottom: 0;
  background-color: var(--console-surface);
}

.console-badge {
  background-color: var(--console-label);
  color: var(--console-label-text);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  --bs-offcanvas-width: 260px;
  --bs-offcanvas-color: var(--console-sidebar-text);
  background-color: var(--console-sidebar) !important;
  color: var(--console-sidebar-text);
}

@media (min-width: 992px) {
  .admin-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
}

.admin-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  padding: 1.15rem 1.25rem 1rem;
  color: #fff;
  text-decoration: none;
}

.admin-brand .brand-logo {
  height: 2.65rem;
  max-width: 100%;
}

.admin-brand:hover {
  color: #fff;
}

.admin-brand small {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--console-label);
}

.admin-business {
  margin: .25rem .75rem .25rem;
  padding: .75rem 1rem;
  border-radius: .5rem;
  background-color: var(--console-sidebar-chip);
  color: var(--console-sidebar-muted);
  line-height: 1.4;
}

.admin-nav-heading {
  padding: 1.1rem 1.75rem .4rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--console-sidebar-muted);
}

.admin-nav .nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .1rem .75rem;
  padding: .55rem 1rem;
  border-radius: .5rem;
  color: var(--console-sidebar-text);
  font-size: .925rem;
}

.admin-nav .nav-link:hover,
.admin-nav .nav-link:focus-visible {
  background-color: var(--console-sidebar-hover);
  color: #fff;
}

.admin-nav .nav-link.active {
  background-color: var(--console-accent);
  color: #fff;
}

.admin-nav .nav-link.disabled {
  color: var(--console-sidebar-disabled);
}

.admin-soon {
  margin-left: auto;
  font-size: .7rem;
  font-weight: 600;
  background-color: var(--console-sidebar-line);
  color: var(--console-sidebar-muted);
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  min-height: 60px;
}

/* Icons are Bootstrap Icons (a font, /lib/bootstrap-icons): <i class="bi bi-name icon">. --icon-size is both the box and the
   glyph size, so a place that wants another size sets that one variable. */
.icon {
  --icon-size: 1.1rem;
  display: inline-block;
  flex-shrink: 0;
  width: var(--icon-size);
  height: var(--icon-size);
  font-size: var(--icon-size);
  line-height: 1;
  text-align: center;
}

.icon-lg {
  --icon-size: 1.5rem;
}

.admin-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: var(--console-accent);
  color: #fff;
  font-weight: 600;
  font-size: .875rem;
  flex-shrink: 0;
}

.admin-avatar-sm {
  width: 1.85rem;
  height: 1.85rem;
  font-size: .8rem;
  background-color: var(--console-accent-soft);
  color: var(--console-accent-text);
}

img.admin-avatar {
  object-fit: cover;
  background-color: var(--bs-tertiary-bg);
}

/* Console sidebar inside a store (_StoreNavLinks): "All stores", then which store this is with a switcher to another. */
.admin-store-switch {
  margin: 0 .75rem .25rem;
}

.admin-store-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .5rem;
  border-radius: .35rem;
  color: var(--console-sidebar-muted);
  font-size: .8125rem;
  text-decoration: none;
}

.admin-store-back:hover,
.admin-store-back:focus-visible {
  color: #fff;
  background-color: var(--console-sidebar-hover);
}

.admin-store-current {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  margin-top: .35rem;
  padding: .55rem .65rem;
  border: 1px solid var(--console-sidebar-line);
  border-radius: .6rem;
  background-color: var(--console-sidebar-chip);
  color: #fff;
}

.admin-store-current:hover,
.admin-store-current[aria-expanded="true"] {
  background-color: var(--console-sidebar-line);
}

.admin-store-current:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.admin-store-current .thumb {
  width: 2.25rem;
  height: 2.25rem;
}

.admin-store-current .small {
  color: var(--console-sidebar-muted);
}

.admin-store-current .bi {
  color: var(--console-sidebar-muted);
}

.admin-store-menu {
  min-width: 15rem;
  max-height: 60vh;
  overflow-y: auto;
}

.admin-store-menu-logo {
  width: 1.75rem;
  height: 1.75rem;
}

/* Icons in the sidebar links: one column, same size. */
.admin-nav .nav-link .bi {
  display: inline-block;
  flex-shrink: 0;
  width: 1.1rem;
  font-size: 1.05rem;
  line-height: 1;
  text-align: center;
}

/* The business pages folded under a store's: the heading is the button that opens them. */
.admin-nav-fold > summary {
  list-style: none;
}

.admin-nav-fold > summary::-webkit-details-marker {
  display: none;
}

.admin-nav-fold-toggle {
  display: flex;
  align-items: center;
  margin-top: .5rem;
  border-top: 1px solid var(--console-sidebar-line);
  cursor: pointer;
}

.admin-nav-fold-toggle:hover {
  color: #fff;
}

.admin-nav-fold-toggle:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: -3px;
}

.admin-nav-fold-toggle .bi {
  transition: transform .15s ease;
}

.admin-nav-fold[open] .admin-nav-fold-toggle .bi {
  transform: rotate(90deg);
}

@media (prefers-reduced-motion: reduce) {
  .admin-nav-fold-toggle .bi {
    transition: none;
  }
}

/* A phone's bottom bar (BottomNav in _ConsoleLayout): the pages used most, and "More" for the rest. */
.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1030;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--bs-border-color);
  background-color: var(--bs-body-bg);
  box-shadow: var(--bottom-nav-shadow);
}

.bottom-nav-link {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  min-width: 0;
  min-height: 3.5rem;
  padding: .4rem .25rem;
  border: 0;
  background: none;
  color: var(--bs-secondary-color);
  font-size: .75rem;
  text-decoration: none;
}

.bottom-nav-link.d-none {
  display: none !important;
}

.bottom-nav-link .bi {
  font-size: 1.3rem;
  line-height: 1;
}

.bottom-nav-link span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav-link.active {
  color: var(--console-accent-text);
  font-weight: 600;
}

.bottom-nav-link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: -3px;
}

/* Room under the content for the bar, and the toasts above it */
@media (max-width: 991.98px) {
  .has-bottom-nav .admin-content {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom)) !important;
  }

  .has-bottom-nav #admin-toasts {
    bottom: calc(3.5rem + env(safe-area-inset-bottom)) !important;
  }
}

/* The store system's own sign-in page (_StoreSystemDoorLayout): the console's dark bar with the logo, then the card. */
.store-system-door-bar {
  min-height: 3.75rem;
  background-color: var(--console-sidebar);
}

.store-system-door-bar .admin-brand {
  flex-direction: row;
  align-items: center;
  gap: .65rem;
}

.store-system-door-bar .admin-brand .brand-logo {
  height: 2rem;
}
