.inventra-admin {
  min-height: 100dvh;
  background: #f5f5f9;
  color: var(--color-text);
}

.admin-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 8px clamp(16px, 4vw, 32px);
  background: var(--color-primary);
  color: white;
}

.admin-brand,
.admin-account summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.admin-brand {
  color: inherit;
  font-weight: 600;
}

.admin-brand img {
  display: block;
  width: 120px;
}

.admin-topbar :focus-visible {
  outline-color: white;
}

.admin-shell {
  display: flex;
  min-height: calc(100dvh - 62px);
}

.admin-navigation {
  display: flex;
  flex: 0 0 220px;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  border-inline-end: 1px solid var(--color-border);
  background: var(--color-surface);
}

.admin-navigation a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--color-text);
}

.admin-navigation a:hover {
  background: var(--color-hover);
}

.admin-navigation a[aria-current="page"] {
  background: #e9eaf4;
  color: var(--color-primary);
  font-weight: 600;
}

.admin-main {
  flex: 1;
  min-width: 0;
  padding: clamp(16px, 4vw, 40px);
}

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

  .admin-navigation {
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
    border-inline-end: 0;
    border-bottom: 1px solid var(--color-border);
  }
}

/* Order Status */
.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: inline-block;
  text-transform: capitalize;
}

.status-success {
  background: #dcfce7;
  color: #166534;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-failed {
  background: #fee2e2;
  color: #991b1b;
}

.status-default {
  background: #e5e7eb;
  color: #374151;
}

.admin-users-muted,
.admin-user-portals span {
  color: var(--color-field-text);
}

.admin-users-table {
  width: 100%;
  min-width: 620px;
  border-spacing: 0;
  font-size: 14px;
  text-align: left;
}

.admin-users-table :is(th, td) {
  display: table-cell;
  padding: 12px 16px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.admin-users-table thead th {
  background: #f1f1f7;
  color: var(--color-field-text);
  font-weight: 600;
}

.admin-users-table tbody :is(th, td) {
  border-top: 1px solid var(--color-border);
}

.admin-users-table tbody th {
  font-weight: 500;
}

.admin-user-portals {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-user-portals li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.admin-user-portals strong {
  font-weight: 500;
}

.admin-overview .theme-panel + .theme-panel {
  margin-top: 16px;
}

.admin-user-portals li {
  justify-content: space-between;
  align-items: baseline;
}

.admin-user-portals li div {
  display: grid;
  gap: 2px;
}

.admin-history-link {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.theme-sync-state {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--color-hover);
  color: var(--color-text);
}

.theme-sync-state--succeeded {
  background: #dcfce7;
  color: #166534;
}

.theme-sync-state--failed {
  background: #fee2e2;
  color: #991b1b;
}

.admin-account {
  position: relative;
}

.admin-account summary {
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}

.admin-account summary::-webkit-details-marker {
  display: none;
}

.admin-account summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin: 0 3px 3px 0;
  border-right: 2px solid;
  border-bottom: 2px solid;
  transform: rotate(45deg);
}

.admin-account__initial {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e9eaf4;
  color: var(--color-primary);
}

.admin-account__options {
  position: absolute;
  inset-block-start: 100%;
  inset-inline-end: 0;
  z-index: 10;
  min-width: 180px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

.admin-account__options :is(a, button) {
  display: flex;
  align-items: center;
  min-height: 44px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.admin-account__options :is(a, button):hover {
  background: var(--color-hover);
}

.admin-account__options :focus-visible {
  outline-color: var(--color-focus);
}
