.admin {
  --admin-rail-width: 230px;
  --admin-header-height: 50px;
  --ink: #18181b;
  --muted: #52525b;
  --green: #27272a;
  --line: #d4d4d8;
  --pale: #f4f4f5;
  grid-template-columns: var(--admin-rail-width) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  color: var(--ink);
  background: #f4f4f5;
}
.admin-chrome {
  position: sticky;
  z-index: 5;
  top: 0;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--admin-rail-width) minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: var(--admin-header-height);
  background: #0a0a0a;
  color: #fff;
}
.admin-chrome .brand {
  margin: 0;
  padding-inline: 15px;
  display: flex;
  gap: 9px;
  align-items: center;
  border-right: 1px solid #2d2d2d;
  letter-spacing: .025em;
}
.admin-brand-mark, .admin-avatar { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: #111; font-weight: 700; }
.admin-brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-account, .admin-account-label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.admin-account { padding-right: 16px; }
.admin-logout { background: transparent; border-color: #52525b; color: #fff; padding: 5px 10px; }
.admin-logout:hover { background: #27272a; }
.admin-modules { display: flex; min-width: 0; }
.admin-modules button {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #d6dae1;
  padding: 0 19px;
  white-space: nowrap;
}
.admin-modules button:hover, .admin-modules button[aria-current] { background: #303640; color: #fff; }
.admin-modules button[aria-current] { box-shadow: inset 0 -3px #c0c6d2; }
.admin-store-link { display: flex; gap: 6px; align-items: center; padding-inline: 18px; color: #e1e5ec; text-decoration: none; white-space: nowrap; }
.admin-store-link:hover { text-decoration: underline; }
.admin-menu-toggle { display: none; }
.operator-sidebar {
  grid-column: 1;
  top: var(--admin-header-height);
  min-height: calc(100vh - var(--admin-header-height));
  max-height: calc(100dvh - var(--admin-header-height));
  overflow: auto;
  padding: 9px 0 16px;
  background: #171717;
  border-right: 1px solid #2d2d2d;
  gap: 0;
}
.operator-user { display: flex; align-items: center; gap: 11px; padding: 9px 16px 17px; color: #fff; }
.operator-user .admin-avatar { width: 40px; height: 40px; }
.operator-user :is(strong,small) { display: block; }
.operator-user small { margin-top: 4px; color: #d4d4d8; }
.operator-user i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: #3cbb62; }
.operator-sidebar nav { gap: 0; }
.operator-sidebar summary {
  padding: 10px 12px;
  margin: 0;
  color: #a1a1aa;
  background: #0a0a0a;
  font-size: .79rem;
  font-weight: 650;
  border-radius: 0;
  cursor: pointer;
}
.operator-sidebar nav button, .operator-sidebar nav a {
  display: flex;
  width: 100%;
  gap: 7px;
  align-items: center;
  text-align: left;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  margin: 0;
  min-height: 40px;
  padding: 6px 15px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  color: #d4d4d8;
  text-decoration: none;
}
.operator-sidebar nav button:hover, .operator-sidebar nav a:hover, .operator-sidebar nav button[aria-current] {
  background: #292929;
  color: #fff;
}
.operator-sidebar nav button[aria-current] { border-left-color: #fff; }
.operator-sidebar nav button > span:first-child, .operator-sidebar nav a > span:first-child {
  flex: 0 0 20px; color: #b7c1cf; text-align: center;
}
.operator-sidebar nav a > span:last-child:not(:first-child) { margin-inline-start: auto; color: #b7c1cf; }
.admin .dashboard { --console-padding: clamp(12px, 1.7vw, 20px); min-width: 0; padding: 0 var(--console-padding) 25px; }
.admin-breadcrumb {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 46px;
  padding-inline: var(--console-padding);
  margin-inline: calc(-1 * var(--console-padding));
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .81rem;
}
.admin-location { display: flex; gap: 8px; align-items: center; }
.admin-breadcrumb button { flex: none; border: 0; background: transparent; color: var(--muted); }
.admin-breadcrumb a { text-decoration: none; }
.admin-breadcrumb strong { color: var(--ink); }
.admin .topbar {
  padding: 14px 0 0;
  border-bottom: 0;
}
.admin .topbar h1 { font-size: clamp(1.3rem, 2.3vw, 1.65rem); }
.admin .topbar { display: flex; align-items: baseline; gap: 10px; }
.admin .status { min-height: 27px; padding: 4px 0; }
.admin .panel, .admin .page-actions { border-radius: 7px; box-shadow: 0 2px 5px #24293808; }
.admin .primary:hover { background: #383e49; }
.admin .commerce-stats { margin-bottom: 15px; gap: 13px; }
.metric-tile {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  min-width: 0;
  padding: 14px;
  border-radius: 7px;
  box-shadow: 0 2px 5px #24293808;
}
.metric-tile:hover { border-color: #9ca6b5; }
.metric-glyph {
  flex: none;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 8px;
  background: #e9edf3;
  color: #414a5a;
  font-size: 1.18rem;
}
.metric-summary { display: grid; gap: 3px; }
.metric-summary .metric { line-height: 1.1; }
.metric-summary > span { color: var(--muted); font-size: .85rem; }
.admin-overview { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(200px, 1fr); gap: 14px; align-items: start; }
.admin-overview h2 { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.admin-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.admin-shortcuts button { min-height: 44px; }
.console-stats .metric-tile { min-height: 92px; justify-content: space-between; border-top: 3px solid #18181b; background: #fff; }
.console-stats .metric-glyph { background: #f4f4f5; color: #3f3f46; }
.admin .console-panel { border-top: 3px solid #18181b; margin-bottom: 15px; }
.admin .console-panel h2 { padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 11px; }
.console-trades { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.console-trades button { min-height: 68px; display: grid; place-content: center; gap: 4px; }
.console-trades strong { font-size: 1.28rem; }
.console-notices { display: grid; gap: 5px; }
.console-notices button { display: flex; justify-content: space-between; gap: 10px; }
.console-shortcuts { grid-template-columns: repeat(6,minmax(0,1fr)); }
.console-shortcuts button { display: grid; justify-items: center; gap: 5px; padding-block: 12px; }
.console-shortcuts .shortcut-glyph { font-size: 1.2rem; }
.console-shortcuts small { color: var(--muted); }

@media (max-width: 1050px) {
  .admin { --admin-rail-width: 176px; }
  .admin-modules button { padding: 0 12px; }
  .metric-tile { padding: 9px; gap: 7px; }
  .metric-glyph { width: 32px; height: 32px; }
  .admin .workbench { grid-template-columns: minmax(105px,.7fr) minmax(175px,1fr) minmax(155px,.9fr); }
}
@media (max-width: 760px) {
  .admin { display: block; --admin-header-height: 54px; }
  .admin-chrome { grid-template-columns: minmax(0, 1fr) auto auto; }
  .admin-chrome .brand { border-right: 0; padding-inline: 10px; font-size: .94rem; }
  .admin-menu-toggle { display: inline-block; align-self: center; background: #303640; border-color: #484e59; color: #fff; }
  .admin-menu-toggle:hover { background: #454b54; }
  .admin-modules { display: none; }
  .admin-account { padding-inline: 4px 8px; }
  .admin-account-label { display: none; }
  .admin-store-link { padding-inline: 10px; font-size: .81rem; }
  .operator-sidebar { display: none; position: sticky; z-index: 4; min-height: 0; max-height: 68vh; }
  .operator-sidebar.sidebar-visible { display: block; }
  .admin .commerce-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin .admin-overview { grid-template-columns: 1fr; }
  .console-shortcuts { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .admin .workbench { display: flex; flex-direction: column; align-items: stretch; }
  .admin .workbench .canvas-space { order: 1; }
  .admin .workbench .properties { order: 2; max-height: none; }
}
