:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e8edf6;
  background: #0b101b;
  font-synthesis: none;
  --bg: #0b101b;
  --sidebar: #0c1321;
  --panel: #141c2c;
  --border: #293449;
  --text: #e8edf6;
  --muted: #98a6bc;
  --blue: #5a96ff;
  --green: #54d3a0;
  --red: #ff8e94;
  --radius: 13px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: .55;
}

a {
  color: #9ac1ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  color: var(--text);
  background: #111a2a;
}

textarea {
  line-height: 1.5;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #4b8cff33;
}

button:focus-visible,
a:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid #83b2ff;
  outline-offset: 2px;
}

label,
legend {
  display: block;
  margin: 0 0 7px;
  color: #c2cee1;
  font-size: 12px;
  font-weight: 700;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(25px, 3vw, 30px);
  letter-spacing: -.8px;
}

h2 {
  font-size: 18px;
  letter-spacing: -.3px;
}

h3 {
  font-size: 15px;
}

p {
  line-height: 1.55;
}

code {
  font-family: ui-monospace, Consolas, monospace;
}

::selection {
  background: #3566aa;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.fineprint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.spaced {
  margin-top: 16px;
}

.no-margin {
  margin: 0;
}

.shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.shell[hidden],
.login-page[hidden],
.boot-page[hidden],
.sidebar-scrim[hidden],
.login-error[hidden] {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-height: 100vh;
  padding: 28px 16px 20px;
  overflow-y: auto;
  border-right: 1px solid #243048;
  background: var(--sidebar);
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 12px 28px;
  color: #f5f8ff;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -.6px;
}

.brand b {
  font-weight: 800;
}

.brand-symbol {
  display: inline-grid;
  flex: 0 0 auto;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 11px;
  color: white;
  background: #286bee;
  box-shadow: 0 8px 23px #2a63ef33;
  font-size: 22px;
  font-weight: 900;
}

.sidebar-subtitle,
.nav-heading {
  padding: 7px 13px 12px;
  color: #7f8ca3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.3px;
}

.navigation {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-heading {
  padding-top: 25px;
}

.nav-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 13px;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  color: #aebbd0;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
}

.nav-item:hover {
  color: white;
  background: #1a283e;
}

.nav-item.active {
  color: #e4f0ff;
  background: #17345e;
  box-shadow: inset 3px 0 #4d96ff;
}

.nav-icon {
  width: 19px;
  color: #8fabe0;
  font-size: 19px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 19px 12px 0;
  border-top: 1px solid var(--border);
}

.server-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #43c997;
  box-shadow: 0 0 12px #46c99550;
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 77px;
  padding: 0 40px;
  border-bottom: 1px solid var(--border);
  background: #101727;
}

.breadcrumbs {
  color: #8c9ab0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
}

.breadcrumbs strong {
  color: #e3eaf7;
  font-weight: 700;
}

.sep {
  padding: 0 12px;
  color: #52617a;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.admin-email {
  color: #acb9cd;
  font-size: 12px;
}

.subtle-button,
.icon-button {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: #e0e8f6;
  background: #182236;
}

.subtle-button:hover,
.icon-button:hover {
  background: #213047;
}

.menu-button,
.menu-close,
.sidebar-scrim {
  display: none;
}

.main-content {
  max-width: 1510px;
  margin: auto;
  padding: 35px 40px 80px;
  outline: none;
}

.page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 29px;
}

.page-intro p {
  max-width: 680px;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin-bottom: 24px;
}

.card,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.card {
  padding: 22px;
}

.card-label {
  margin-bottom: 16px;
  color: #afbdd2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
}

.card-number {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -.9px;
}

.card-caption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.panel {
  margin-bottom: 20px;
  padding: 23px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.panel-head h2 {
  margin: 0;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.form-group {
  min-width: 0;
}

.check-group {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 9px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #c5d2e4;
  font-size: 12px;
}

.inline-check input {
  width: 16px;
  height: 16px;
  min-height: auto;
  flex: 0 0 auto;
}

.permission-group {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.permission-group legend {
  padding: 0 5px;
}

.direct-search {
  max-width: 360px;
}

.btn-row,
.detail-actions,
.pill-row,
.table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-row {
  margin-top: 19px;
}

.table-actions {
  gap: 14px;
}

.primary,
.secondary,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 17px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 750;
}

a.primary:hover,
a.secondary:hover {
  text-decoration: none;
}

.primary {
  color: white;
  background: #357ef0;
}

.primary:hover {
  background: #5698ff;
}

.secondary {
  border-color: #405573;
  color: #eef4ff;
  background: #243249;
}

.secondary:hover {
  background: #304463;
}

.danger {
  border-color: #774754;
  color: #ffbdc3;
  background: #432a35;
}

.danger:hover {
  background: #5b303c;
}

.full {
  width: 100%;
}

.table-scroll {
  width: 100%;
  overflow: auto;
  border-radius: 8px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  text-align: left;
  font-size: 12px;
}

.table th {
  padding: 13px 12px;
  color: #a9b8ce;
  background: #1b2638;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.table td {
  max-width: 420px;
  padding: 15px 12px;
  border-bottom: 1px solid #2a3649;
  color: #d3dcea;
  overflow-wrap: anywhere;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: #192438;
}

.table .strong {
  color: #f3f7ff;
  font-weight: 700;
}

.hash {
  display: inline-block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.action-link {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  color: #9bbdff;
  background: none;
  font-weight: 700;
}

.action-link:hover {
  text-decoration: underline;
}

.danger-link {
  color: #ffadb5;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 53px 16px;
  text-align: center;
}

.empty-icon {
  margin-bottom: 16px;
  color: #6380ae;
  font-size: 35px;
}

.empty h3 {
  margin-bottom: 5px;
}

.empty p {
  max-width: 390px;
  color: var(--muted);
  font-size: 12px;
}

.code {
  display: block;
  padding: 17px;
  overflow: auto;
  border: 1px solid #2c3d5a;
  border-radius: 9px;
  color: #b9d0ff;
  background: #0d1524;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.kv-item {
  min-width: 0;
  padding-bottom: 13px;
  border-bottom: 1px solid #273349;
}

.kv-item span {
  display: block;
  margin-bottom: 8px;
  color: #9eacc1;
  font-size: 11px;
}

.kv-item strong {
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.notice {
  padding: 14px 17px;
  border: 1px solid #42608e;
  border-radius: 10px;
  color: #d6e6ff;
  background: #1b2d49;
  font-size: 12px;
  line-height: 1.65;
}

.notice.warn {
  border-color: #7b623f;
  color: #ffe4ba;
  background: #342b25;
}

.notice-detail {
  margin-top: 5px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #405676;
  border-radius: 30px;
  color: #cfdef3;
  background: #26364f;
  font-size: 11px;
  font-weight: 700;
}

.status-pill.green {
  border-color: #36745a;
  color: #91e6b9;
  background: #244332;
}

.status-pill.red {
  border-color: #774754;
  color: #ffb4b8;
  background: #4b2d34;
}

.pill {
  padding: 6px 9px;
  border-radius: 7px;
  color: #c6daf5;
  background: #22324a;
  font-size: 11px;
  font-weight: 650;
}

.login-page,
.boot-page {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  background: radial-gradient(circle at 50% 10%, #142c54 0, #0b101b 44%, #0b101b 100%);
}

.login-card {
  width: 100%;
  max-width: 430px;
  padding: 40px;
  border: 1px solid #2d3d57;
  border-radius: 17px;
  background: #141e30;
  box-shadow: 0 24px 90px #0005;
}

.brand-login {
  margin: 0 0 43px;
}

.login-card > p {
  font-size: 13px;
}

.login-card form {
  margin-top: 28px;
}

.login-card label {
  margin-top: 19px;
}

.login-card .primary {
  margin-top: 27px;
}

.login-card .fineprint {
  margin-top: 25px;
}

.login-error {
  margin-top: 20px;
}

.boot-card {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #dce8fa;
  font-size: 14px;
  font-weight: 700;
}

.noscript {
  position: fixed;
  inset: 20px;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  color: white;
  background: #0b101b;
  text-align: center;
}

#toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
  display: none;
  max-width: min(410px, calc(100vw - 36px));
  padding: 13px 18px;
  border: 1px solid #4d7099;
  border-radius: 9px;
  color: #f2f8ff;
  background: #21364d;
  box-shadow: 0 10px 30px #0008;
  font-size: 13px;
}

#toast.show {
  display: block;
}

#toast.error {
  border-color: #b75e70;
  background: #512e39;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  padding: 18px;
  place-items: center;
  background: #050912d9;
}

.dialog {
  position: relative;
  width: min(100%, 650px);
  max-height: 90vh;
  padding: 28px;
  overflow: auto;
  border: 1px solid #435878;
  border-radius: 14px;
  background: #18243a;
  box-shadow: 0 25px 80px #0008;
}

.dialog > h2 {
  padding-right: 42px;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: #e5ecf8;
  background: #243249;
  font-size: 22px;
}

.dialog .code {
  max-height: 240px;
}

.secret-value {
  font-family: ui-monospace, Consolas, monospace;
  overflow-wrap: anywhere;
}

.clipboard-helper {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
}

.loading {
  padding: 42px 20px;
  color: #b6c6de;
  text-align: center;
}

@media (max-width: 1120px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 25px;
  }

  .topbar {
    padding: 0 25px;
  }
}

@media (max-width: 760px) {
  body.menu-open {
    overflow: hidden;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 15;
    width: min(290px, 86vw);
    transform: translateX(-110%);
    transition: transform .2s ease;
    box-shadow: 15px 0 50px #0008;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-close {
    display: inline-grid;
    flex: 0 0 auto;
    width: 40px;
    padding: 0;
    place-items: center;
    font-size: 22px;
  }

  .sidebar-scrim:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 14;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #050912b8;
  }

  .topbar {
    height: 63px;
    padding: 0 16px;
  }

  .menu-button {
    display: inline-flex;
    align-items: center;
    margin-right: 12px;
  }

  .breadcrumbs {
    margin-right: auto;
  }

  .breadcrumbs > span:first-child,
  .breadcrumbs .sep,
  .admin-email {
    display: none;
  }

  .header-right {
    gap: 8px;
  }

  .main-content {
    padding: 24px 15px 70px;
  }

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

  .card {
    padding: 17px;
  }

  .card-number {
    font-size: 21px;
  }

  .grid-2,
  .grid-3,
  .kv,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .page-intro {
    display: block;
  }

  .page-intro > .primary,
  .page-intro > .secondary,
  .page-intro > .btn-row,
  .page-intro > .detail-actions {
    margin-top: 15px;
  }

  .panel {
    padding: 17px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .panel-head .detail-actions,
  .panel-head .pill-row {
    width: 100%;
  }

  .login-card {
    padding: 27px;
  }

  .dialog {
    padding: 24px 19px;
  }

  .direct-search {
    max-width: none;
  }

  .btn-row > .primary,
  .btn-row > .secondary,
  .btn-row > .danger {
    flex-grow: 1;
  }
}

@media (max-width: 420px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
