:root {
  font-family: Inter, "Segoe UI", "Microsoft JhengHei", sans-serif;
  color: #e7edf7;
  background: #0b1120;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: flex;
  min-height: 100vh;
}
aside {
  width: 250px;
  padding: 35px 24px;
  background: #10192b;
  border-right: 1px solid #26334b;
  position: fixed;
  height: 100vh;
}
.brand {
  font-size: 25px;
  font-weight: 800;
  color: #5eead4;
  letter-spacing: 3px;
}
aside p,
small {
  color: #93a5be;
  font-size: 12px;
}
nav {
  display: grid;
  gap: 8px;
  margin: 40px 0;
}
nav button {
  text-align: left;
  background: transparent;
}
nav button.active {
  background: #203d4e;
  color: #79f5da;
}
main {
  margin-left: 250px;
  padding: 40px;
  width: calc(100% - 250px);
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
header span {
  font-size: 12px;
  color: #5eead4;
  letter-spacing: 2px;
}
h1 {
  font-size: 30px;
  margin: 8px 0;
}
h2 {
  font-size: 19px;
}
section,
.panel {
  background: #121e32;
  border: 1px solid #293950;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}
#login {
  max-width: 480px;
}
#workspace {
  padding: 0;
  background: none;
  border: none;
}
form {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: end;
}
#login form {
  display: grid;
}
label {
  display: grid;
  gap: 8px;
  color: #b8c9df;
  font-size: 13px;
  min-width: 160px;
}
input,
select {
  padding: 11px;
  border: 1px solid #3b4c65;
  border-radius: 7px;
  background: #0d1627;
  color: #edf5ff;
  max-width: 260px;
}
button {
  border: 0;
  border-radius: 7px;
  padding: 11px 17px;
  color: #062d2b;
  background: #5eead4;
  font-weight: 600;
  cursor: pointer;
}
button.secondary {
  background: #293b55;
  color: #e2ecf9;
}
button:disabled {
  opacity: 0.5;
}
#notice {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #fcd58b;
  margin-bottom: 20px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 13px;
  border-bottom: 1px solid #293950;
  max-width: 300px;
  overflow-wrap: anywhere;
}
th {
  color: #93a5be;
  font-weight: 500;
}
.table-wrap {
  overflow: auto;
  border: 1px solid #293950;
  border-radius: 12px;
}
.empty {
  padding: 35px;
  color: #93a5be;
}
code {
  color: #7ae8d2;
}
p {
  line-height: 1.8;
}
@media (max-width: 800px) {
  aside {
    position: static;
    width: 100%;
    height: auto;
  }
  body {
    display: block;
  }
  nav {
    display: flex;
    flex-wrap: wrap;
    margin: 15px 0;
  }
  main {
    margin: 0;
    padding: 20px;
    width: 100%;
  }
  aside small {
    display: none;
  }
}

dialog {
  background: #10192b;
  color: #e7edf7;
  border: 1px solid #35506e;
  border-radius: 12px;
  width: min(720px, 92vw);
  max-height: 85vh;
  overflow: auto;
}
dialog::backdrop {
  background: #020617bb;
}
dialog form {
  display: block;
}
dialog label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}
dialog input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
nav button {
  color: #b7c9df;
}
nav button:hover {
  background: #1c2b40;
  color: #ffffff;
}
.table-wrap table {
  min-width: 1100px;
}
.table-wrap th,
.table-wrap td {
  overflow-wrap: normal;
  white-space: nowrap;
}
.table-wrap td:last-child {
  min-width: 195px;
}
.panel > button,
td > button,
dialog button {
  margin: 4px 6px 4px 0;
}

.loading-state {
  padding: 36px;
  color: #b7c9df;
  border: 1px solid #293950;
  border-radius: 12px;
}
.loading-state::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #35506e;
  border-top-color: #5eead4;
  border-radius: 50%;
  margin-right: 12px;
  animation: loading-spin 0.8s linear infinite;
}
@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading-state::before {
    animation: none;
  }
}
a {
  color: #7ae8d2;
}
.editor-form {
  display: block;
}
.editor-form .form-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 14px 0;
}
.editor-form input:not([type="checkbox"]),
.editor-form select {
  width: 100%;
  max-width: none;
}
.editor-form .check-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}
.editor-form fieldset {
  border: 1px solid #35506e;
  border-radius: 8px;
  padding: 14px;
  margin: 20px 0;
}
.dialog-controls {
  position: sticky;
  bottom: 0;
  background: #10192b;
  padding: 12px 0;
  display: flex;
  gap: 8px;
}
.form-error {
  color: #fda4af;
}
.dialog-body pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.query-form {
  background: #121e31;
  border: 1px solid #293950;
  border-radius: 12px;
  padding: 20px;
}
#actions {
  margin-bottom: 20px;
}
