.admin-shell {
  --workbench-blue: #2455d8;
  --workbench-navy: #122945;
  --workbench-muted: #536981;
  --workbench-line: #d9e5f2;
}

.admin-shell .sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 16px 8px 10px;
  overflow: hidden;
  background: #102a48;
}

.admin-shell .sidebar-brand {
  flex: none;
  min-height: 58px;
  padding: 0 10px 10px;
  border: 0;
  gap: 11px;
}

.admin-shell .sidebar-brand strong {
  font-size: 16px;
  line-height: 1.35;
}

.admin-menu-search {
  position: relative;
  flex: none;
  margin: 11px 8px 9px;
}

.admin-menu-search > svg {
  position: absolute;
  inset-inline-start: 10px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  color: #c3d7ee;
  pointer-events: none;
}

.admin-menu-search input {
  width: 100%;
  height: 39px;
  min-height: 39px;
  padding: 0 35px 0 33px;
  border: 1px solid #526d8c;
  border-radius: 8px;
  background: #1a3658;
  color: #fff;
  font-size: 14px;
}

.admin-menu-search input::placeholder {
  color: #d5e3f4;
  opacity: 1;
}

.admin-menu-search input::-webkit-search-cancel-button { appearance: none; }

.admin-menu-search button,
.admin-nav-close {
  position: absolute;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #e2edfa;
}

.admin-menu-search button {
  inset-inline-end: 2px;
  top: 2px;
}

.admin-menu-search button[hidden],
.admin-nav-close {
  display: none;
}

.admin-nav-close {
  z-index: 1;
  top: 22px;
  inset-inline-end: 8px;
}

.admin-shell .sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  gap: 4px;
  margin: 4px 0 0;
  padding: 0 0 6px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #476484 transparent;
}

.admin-nav-group,
.admin-shell .sidebar-nav .admin-nav-home {
  flex: none;
}

.admin-shell .sidebar-nav .admin-nav-item,
.admin-nav-group summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  padding: 8px 15px 8px 17px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #edf5ff;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
}

.admin-nav-group summary {
  cursor: pointer;
  list-style: none;
}

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

.admin-nav-group summary > svg,
.admin-nav-home > svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.admin-nav-group summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-inline-start: auto;
  flex: none;
  border: solid #c5d6e9;
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg);
}

.admin-nav-group[open] > summary::after {
  transform: translateY(-2px) rotate(45deg);
}

.admin-nav-group[open] > summary,
.admin-nav-current-group > summary {
  background: #193e67;
  color: #fff;
}

.admin-nav-children {
  display: grid;
  margin: 5px 3px 7px 26px;
  padding-inline-start: 5px;
  border-inline-start: 1px solid #4a6582;
}

.admin-shell .sidebar-nav .admin-nav-children .admin-nav-item {
  min-height: 36px;
  gap: 4px;
  padding: 6px 11px 6px 16px;
  color: #dce9f8;
  font-size: 14px;
  font-weight: 540;
}

.admin-shell .sidebar-nav .admin-nav-item:hover,
.admin-nav-group summary:hover,
.admin-menu-search button:hover,
.admin-nav-close:hover {
  background: #264a71;
  color: #fff;
}

.admin-shell .sidebar-nav .admin-nav-item.active {
  background: #2356dc;
  color: #fff;
  font-weight: 750;
}

.admin-nav-item.active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 7px 0 0 7px;
  background: #5cd3ff;
}

.admin-shell .sidebar-nav :is(.admin-nav-item[hidden], .admin-nav-filtered),
.admin-nav-group:not(:has(.admin-nav-item:not([hidden], .admin-nav-filtered))),
.admin-nav-empty[hidden] {
  display: none !important;
}

.admin-nav-empty {
  margin: 8px 16px;
  color: #c5d9ee;
  font-size: 14px;
}

.admin-shell .sidebar :is(summary, button, a, input):focus-visible {
  outline: 2px solid #86d9ff;
  outline-offset: -2px;
  box-shadow: none;
}

.admin-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: #233d61;
}

.admin-topbar .admin-breadcrumb strong {
  font-size: 16px;
}

.admin-breadcrumb-parent {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: #425d7d;
  font-size: 14px;
  white-space: nowrap;
}

.admin-breadcrumb-parent a {
  color: #244f83;
  text-decoration: none;
}

.admin-breadcrumb-parent a:hover { text-decoration: underline; }
.admin-breadcrumb-parent::after { content: "/"; color: #607793; }

.admin-breadcrumb-parent[hidden],
.admin-topbar-context > small {
  display: none;
}

.admin-topbar-context { min-width: 0; }

.admin-dashboard-details summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

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

.admin-dashboard-details summary::after {
  content: "";
  margin-left: auto;
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg);
}

.admin-dashboard-details[open] summary::after {
  transform: rotate(45deg);
}

.admin-sidebar-backdrop {
  display: none;
}

.admin-dashboard-active .main-area {
  background: #eef4fa;
}

.admin-dashboard-active .admin-topbar [data-api-status] {
  display: none;
}

.admin-dashboard {
  max-width: 1520px;
  margin-inline: auto;
  color: var(--workbench-navy);
}

.admin-dashboard-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
}

.admin-dashboard-heading h1 {
  margin: 0;
  font-size: clamp(25px, 2.3vw, 34px);
  line-height: 1.25;
}

.admin-dashboard-metrics,
.admin-dashboard-panels,
.admin-dashboard-actions,
.admin-dashboard-overview {
  display: grid;
  gap: 14px;
}

.admin-dashboard-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-dashboard-metrics article,
.admin-dashboard-panel {
  min-width: 0;
  border: 1px solid var(--workbench-line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 3px 10px #183b6710;
}

.admin-dashboard-metrics article {
  min-height: 107px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px clamp(12px, 1.35vw, 22px);
}

.admin-dashboard-metrics svg {
  width: 29px;
  height: 29px;
  flex: none;
  color: var(--workbench-blue);
}

.admin-dashboard-metrics span,
.admin-dashboard-overview dt {
  color: var(--workbench-muted);
  font-size: 14px;
  font-weight: 650;
}

.admin-dashboard-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(26px, 2.65vw, 40px);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.admin-dashboard-panels {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  margin-top: 14px;
  align-items: stretch;
}

.admin-dashboard-panel {
  padding: 17px;
}

.admin-dashboard-panel h2,
.admin-dashboard-details summary {
  margin: 0 0 13px;
  font-size: 18px;
  font-weight: 750;
}

.admin-dashboard-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-dashboard-actions > :is(button, a) {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 82px;
  padding: 9px 5px;
  border: 1px solid #e0eaf8;
  border-radius: 10px;
  background: #f0f5ff;
  color: var(--workbench-blue);
  text-align: center;
  font: inherit;
}

.admin-dashboard-actions svg {
  width: 23px;
  height: 23px;
}

.admin-dashboard-actions span {
  min-width: min(100%, 116px);
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--workbench-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.admin-dashboard-actions > :is(button, a):hover {
  background: #e4eeff;
  border-color: #b0c7f8;
}

.admin-dashboard-todos,
.admin-dashboard-status,
.admin-dashboard-overview {
  margin: 0;
  padding: 0;
}

.admin-dashboard-todos {
  display: grid;
  gap: 8px;
  list-style: none;
}

.admin-dashboard-todos li {
  min-height: 49px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 3px;
  padding: 7px 10px;
  border: 1px solid #e4ecf7;
  border-radius: 9px;
  background: #f8faff;
}

.admin-dashboard-todos svg {
  flex: none;
  color: var(--workbench-blue);
}

.admin-dashboard-todos strong {
  flex: 1 0 auto;
  font-size: 14px;
}

.admin-dashboard-todos li > span {
  color: var(--workbench-muted);
  font-size: 12px;
}

.admin-dashboard-todos button,
.admin-dashboard-status a {
  border: 0;
  background: none;
  color: var(--workbench-blue);
  font-size: 13px;
  font-weight: 700;
}

.admin-dashboard-todos button {
  min-height: 32px;
  padding: 0 2px;
}

.admin-dashboard-details summary {
  gap: 12px;
  margin-bottom: 0;
}

.admin-dashboard-details[open] summary {
  margin-bottom: 13px;
}

.admin-dashboard-overview {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 8px 0;
  text-align: center;
}

.admin-dashboard-overview div + div {
  border-inline-start: 1px solid var(--workbench-line);
}

.admin-dashboard-overview dd {
  margin: 6px 0 0;
  font-size: clamp(19px, 2vw, 26px);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.admin-dashboard-status div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  font-size: 14px;
}

.admin-dashboard-status div + div {
  border-top: 1px solid #e8eff7;
}

.admin-dashboard-status dd {
  margin: 0;
  font-size: 12px;
}

.admin-dashboard-status dd[data-state] {
  padding: 2px 7px;
  border-radius: 6px;
  background: #edf3fb;
  color: var(--workbench-muted);
}

.admin-dashboard-status dd[data-state="ok"] {
  background: #e3f7ec;
  color: #086941;
}

.admin-dashboard-status dd[data-state="warn"] {
  background: #fff2dc;
  color: #80501b;
}

@media (min-width: 1081px) {
  .admin-shell {
    grid-template-columns: 268px minmax(0, 1fr);
  }

  .admin-shell .sidebar {
    position: sticky;
    top: 0;
    max-height: 100dvh;
    align-self: start;
    min-height: 100dvh;
  }

  .admin-topbar .search-box {
    width: clamp(150px, 16vw, 265px);
  }
}

@media (max-width: 1080px) {
  body.sidebar-open .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 49;
    background: #102d4c66;
  }

  .admin-shell .sidebar {
    position: fixed;
    visibility: hidden;
    width: min(288px, 88vw);
  }

  body.sidebar-open .admin-shell .sidebar {
    visibility: visible;
  }

  .admin-nav-close {
    display: grid;
  }

  .admin-shell .sidebar-brand {
    padding-inline-end: 42px;
  }

  .admin-shell .sidebar-nav .admin-nav-children .admin-nav-item {
    min-height: 42px;
  }

  .admin-breadcrumb-parent {
    display: none;
  }

  .admin-shell .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: auto;
    min-height: 42px;
    padding: 0 10px;
    font-weight: 700;
  }
}

@media (max-width: 720px) {
  .admin-dashboard-active .admin-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 60px;
    gap: 9px;
    padding: 8px 12px;
    background: var(--workbench-blue);
    color: #fff;
  }

  .admin-dashboard-active .admin-topbar strong {
    font-size: clamp(14px, 4.25vw, 18px);
    text-align: center;
  }

  .admin-dashboard-active .admin-topbar small,
  .admin-dashboard-active .topbar-tools :is(.search-box, .ghost-button) {
    display: none;
  }

  .admin-dashboard-active .topbar-tools {
    width: auto;
    margin: 0;
  }

  .admin-dashboard-active :is(.sidebar-toggle, .avatar-button) {
    background: #fff;
    color: var(--workbench-blue);
    box-shadow: none;
  }

  .admin-dashboard-heading h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .admin-dashboard-heading {
    margin-bottom: 9px;
  }

  .admin-dashboard-active .content-area {
    padding: 12px 12px 22px;
  }

  .admin-dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .admin-dashboard-metrics article {
    min-height: 74px;
    gap: 8px;
    padding: 9px;
  }

  .admin-dashboard-metrics svg {
    width: 22px;
    height: 22px;
  }

  .admin-dashboard-metrics span {
    font-size: 13px;
  }

  .admin-dashboard-metrics strong {
    font-size: 27px;
  }

  .admin-dashboard-panels {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 10px;
  }

  .admin-dashboard-panel {
    padding: 12px;
  }

  .admin-dashboard-panel h2,
  .admin-dashboard-details summary {
    font-size: 16px;
  }

  .admin-dashboard-panel h2 {
    margin-bottom: 8px;
  }

  .admin-dashboard-actions {
    gap: 7px;
  }

  .admin-dashboard-actions > :is(button, a) {
    min-height: 60px;
    gap: 3px;
    padding: 5px 3px;
  }

  .admin-dashboard-actions svg {
    width: 19px;
    height: 19px;
  }

  .admin-dashboard-actions span {
    padding: 3px 7px;
    font-size: 12px;
  }

  .admin-dashboard-todos li {
    min-height: 42px;
    padding: 4px 7px;
    column-gap: 5px;
  }

  .admin-dashboard-todos button {
    min-height: 36px;
  }

  .admin-dashboard-overview dt {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-shell .sidebar {
    transition: none;
  }
}
