:root {
  --surface: #fff;
  --canvas: #edf2f9;
  --ink: #1c2f49;
  --muted: #53667c;
  --line: #cbd8e9;
  --primary: #245edb;
  --primary-hover: #184abb;
  --info: #205bc8;
  --danger: #b33540;
}
body {
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.6;
}
button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}
button {
  cursor: pointer;
}
h1,
h2,
h3 {
  color: #1d3038;
  line-height: 1.4;
}
.main > section > h2 {
  font-size: 22px;
  margin: 0 0 22px;
}
.page-head h1,
.main > section > h1 {
  font-size: 24px;
}
.main {
  padding: 26px 28px 40px;
}
.muted,
.field-help,
.filter-field > span {
  color: var(--muted);
}
.panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}
.panel > h3 {
  margin: 18px 0 12px;
  font-size: 16px;
}
.stats {
  gap: 0;
  border-block: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 24px;
}
.stat {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 20px;
}
.stat:last-child {
  border-right: 0;
}
.stat span {
  color: var(--muted);
  font-size: 12px;
}
.stat b {
  font-size: 26px;
  color: var(--info);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.input,
.filter-panel input,
.filter-panel select,
.action-row input,
.action-row select,
.override input,
.override select,
#cluster input:not([type="checkbox"]),
#cluster select {
  min-width: 0;
  min-height: 40px;
  background: #fff;
  color: var(--ink);
  border: 1px solid #c8d3d9;
  border-radius: 5px;
  padding: 8px 10px;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
  flex-shrink: 0;
}
input:disabled,
select:disabled,
textarea:disabled {
  background: #f1f4f5;
  color: #71818a;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid #398baf;
  outline-offset: 2px;
}
.btn,
#cluster button {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 600;
  line-height: 1.5;
}
.btn,
#cluster [data-action="create"],
#clusterUpload button {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn:hover:not(:disabled),
#cluster [data-action="create"]:hover:not(:disabled) {
  background: var(--primary-hover);
  color: #fff;
}
.btn.gray,
#cluster button {
  background: #fff;
  color: #445b67;
  border-color: #cdd8de;
}
.btn.gray:hover:not(:disabled),
#cluster button:hover:not(:disabled) {
  color: var(--primary-hover);
  background: #e9f0ff;
  border-color: #7c9ee5;
}
.btn.red {
  background: #fff5f5;
  color: var(--danger);
  border-color: #efc9ce;
}
.btn.red:hover:not(:disabled) {
  background: #fbe8eb;
  color: #972b36;
}
.btn.small {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}
button:disabled,
button[aria-busy="true"],
form[aria-busy="true"] button {
  opacity: 0.55;
  cursor: wait;
}
.filter-panel {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 0;
  border-block: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 0;
  background: transparent;
  gap: 12px 14px;
  margin-bottom: 16px;
}
.filter-panel .search-main {
  grid-column: span 2;
}
.filter-actions {
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}
.filter-field,
.field,
.role-setting,
.account-create > *,
.official-layout > * {
  min-width: 0;
}
.toolbar {
  flex-wrap: wrap;
  align-items: end;
  overflow: visible;
}
.toolbar > .input {
  flex: 1 1 170px;
  width: auto;
}
.toolbar > button {
  flex: 0 0 auto;
}
.result-head {
  min-height: 34px;
  margin: 16px 0 12px;
  flex-wrap: wrap;
}
table {
  border: 1px solid var(--line);
  font-size: 13px;
}
th,
#cluster th {
  background: #dce7fa;
  color: #254a83;
  font-size: 12px;
  font-weight: 650;
  padding: 12px 14px;
  white-space: nowrap;
}
td {
  padding: 14px;
  vertical-align: top;
  overflow-wrap: anywhere;
  line-height: 1.65;
}
tbody tr:hover > td {
  background-color: #f0f5ff;
}
td .muted {
  margin-top: 4px;
}
.action-row,
.profile-actions {
  gap: 7px;
  flex-wrap: wrap;
}
.action-row {
  max-width: 360px;
}
.action-row .btn {
  flex: 0 0 auto;
}
.status-badge,
.badge {
  border-radius: 4px;
  padding: 3px 7px;
  background: #edf1f4;
  color: #526670;
}
.status-badge.active {
  background: #e6f4ed;
  color: #19664c;
}
.status-badge.warn {
  background: #fff1db;
  color: #885510;
}
.role-setting {
  grid-template-columns: minmax(86px, 1fr) minmax(150px, 1.4fr);
}
.override {
  grid-template-columns: minmax(145px, 1fr) minmax(145px, 1fr);
}
.override .btn {
  width: auto;
}
.feature-group {
  border-color: var(--line);
  border-radius: 5px;
}
.feature-group summary {
  background: #e1eafb;
  color: #284d86;
  font-size: 15px;
  padding: 13px 16px;
}
.feature-group summary {
  justify-content: flex-start;
  gap: 8px;
}
.feature-group summary::before {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: url("/assets/icons/chevron-right.svg") center / 16px no-repeat;
  opacity: 0.6;
}
.feature-group[open] summary::before {
  transform: rotate(90deg);
}
.feature-group summary > span:last-child {
  margin-left: auto;
}
.permission-guide {
  border: 0;
  background: var(--line);
  border-block: 1px solid var(--line);
}
.permission-guide > div {
  background: #fff;
}
.permission-top {
  gap: 12px;
}
.permission-title {
  font-size: 15px;
}
.role-cell {
  border: 0;
  border-top: 2px solid #4277dd;
  background: #edf3ff;
}
.role-cell.is-off {
  border-color: #d9e0e4;
  background: #f3f5f7;
}
.permission-key {
  color: #667984;
}
.notice {
  border-radius: 4px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.notice.success {
  background: #e9f6ee;
  color: #256149;
}
.notice.error {
  background: #fff0f1;
  color: var(--danger);
}
.profile-item {
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  align-items: start;
  gap: 12px;
}
.profile-item > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.profile-item .profile-actions {
  flex-shrink: 0;
}
.admin-dialog,
#cluster dialog,
.admin-prompt {
  border: 1px solid #c9d5dd;
  border-radius: 8px;
  box-shadow: 0 18px 60px #25394126;
  color: var(--ink);
}
.admin-dialog::backdrop,
#cluster dialog::backdrop,
.admin-prompt::backdrop {
  background: #1d303866;
}
.dialog-head,
.dialog-foot {
  background: #e8effb;
  border-color: var(--line);
}
.dialog-head h2 {
  font-size: 18px;
}
dialog.admin-dialog {
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border: 1px solid #c9d5dd;
}
dialog.admin-dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog.admin-dialog > form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100dvh - 34px);
  min-height: 0;
}
.admin-dialog .dialog-head,
.admin-dialog .dialog-foot {
  flex-shrink: 0;
}
.admin-dialog .dialog-body {
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.monitor-editor .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}
@media (max-width: 600px) {
  .monitor-editor .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.admin-dialog fieldset,
.admin-dialog details {
  border-color: var(--line);
  border-radius: 5px;
}
.admin-prompt {
  width: min(460px, calc(100% - 32px));
  padding: 24px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
.admin-prompt h2 {
  font-size: 18px;
  margin: 0 0 12px;
}
.admin-prompt p {
  color: var(--muted);
  margin: 0 0 18px;
}
.admin-prompt .field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}
.admin-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.admin-notices {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 100;
  width: min(440px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}
.admin-toast {
  display: flex;
  align-items: start;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid #a9cbbd;
  border-radius: 6px;
  background: #f1faf5;
  color: #215940;
  box-shadow: 0 6px 24px #23363f14;
  pointer-events: auto;
  overflow-wrap: anywhere;
}
.admin-toast.error {
  color: #973540;
  border-color: #e9bac2;
  background: #fff5f6;
}
.admin-toast > span {
  flex: 1;
  min-width: 0;
}
.admin-toast-close {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 2px;
  border: 0;
  background: transparent;
  flex-shrink: 0;
}
.admin-toast-close img {
  width: 16px;
  height: 16px;
  opacity: 0.65;
}
.login {
  margin: 10vh auto;
  width: min(420px, calc(100% - 32px));
  padding: 28px;
  box-shadow: 0 12px 40px #23363f0a;
}
.login h2 {
  font-size: 22px;
  margin-top: 0;
}
#cluster .cluster-scroll {
  border-color: var(--line);
}
#cluster .cluster-stat-strip {
  border-block: 1px solid var(--line);
  padding: 16px 0;
  margin-bottom: 18px;
}
#cluster .cluster-stat-strip strong {
  color: var(--info);
}
#cluster .cluster-actions {
  min-width: 200px;
}
#cluster .cluster-heading {
  align-items: center;
  margin-bottom: 20px;
}
#cluster .cluster-heading h2 {
  font-size: 22px;
}
#cluster .node-detail-section {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
}
#cluster dialog > h3:focus {
  outline: none;
}
#cluster dialog .cluster-toolbar {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 12px;
}
#cluster .node-detail-section > summary {
  padding: 14px 10px;
  color: #2458aa;
  font-weight: 650;
  cursor: pointer;
  background: #edf3ff;
}
#cluster .node-detail-section[open] > summary {
  background: #dfeafb;
}
#cluster .node-detail-section .cluster-descriptions {
  margin: 0;
  padding: 14px 10px;
}
@media (max-width: 1440px) {
  .filter-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .filter-panel .search-main {
    grid-column: span 2;
  }
  .filter-panel .filter-actions {
    grid-column: auto;
  }
  table.responsive-table {
    border: 0;
  }
  .responsive-table tr {
    padding: 14px 18px;
    border-color: var(--line);
  }
  .responsive-table td {
    min-width: 0;
  }
}
@media (max-width: 1000px) {
  .filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-panel .filter-actions {
    grid-column: 1 / -1;
  }
  .permission-top {
    grid-template-columns: minmax(0, 1fr);
  }
  .permission-top > .btn {
    justify-self: start;
  }
}
@media (max-width: 800px) {
  .main {
    padding: 20px 14px 32px;
  }
  .main > section > h2 {
    font-size: 20px;
    margin-bottom: 16px;
  }
  .page-head h1,
  .main > section > h1 {
    font-size: 22px;
  }
  .stat {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }
  .stat:nth-child(even) {
    border-right: 0;
  }
  .filter-panel {
    gap: 12px;
    padding-block: 14px;
  }
  .filter-panel .search-main,
  .filter-panel .filter-actions {
    grid-column: 1 / -1;
  }
  .responsive-table tr {
    padding: 12px 14px;
  }
  .responsive-table td[data-label]::before {
    min-width: 0;
  }
  .account-create {
    gap: 12px;
  }
  .permission-guide {
    grid-template-columns: 1fr;
  }
  .profile-item {
    flex-direction: column;
  }
  .admin-notices {
    top: 72px;
    right: 16px;
  }
  .dialog-head,
  .dialog-footer {
    padding: 14px;
  }
  .role-setting {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  }
  .override {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
