body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: #eef3f8;
  color: #1a2433;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}

.hero,
.section-head,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-actions,
.top-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.grid.two-cols {
  grid-template-columns: 1fr 1fr;
  margin: 0;
}

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

.card {
  background: #fff;
  border: 1px solid #d6e0ea;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(15, 39, 73, 0.06);
}

.compact-card {
  padding: 12px;
}

.subtle-card {
  background: #f8fbff;
  border-color: #dce6f0;
  box-shadow: none;
}

.stack {
  display: grid;
  gap: 10px;
}

.compact-grid {
  gap: 10px;
  margin-bottom: 0;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

fieldset {
  border: 1px solid #d6e0ea;
  border-radius: 10px;
  padding: 10px;
  margin: 0;
}

legend {
  padding: 0 6px;
  font-weight: 600;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  padding: 10px 12px;
  border: 1px solid #bcc9d8;
  border-radius: 8px;
  background: #fbfdff;
}

.checkbox {
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
}

button {
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: #0b64d8;
  color: white;
  cursor: pointer;
}

button:hover {
  background: #084fae;
}

button.secondary {
  background: #eef3f8;
  color: #1a2433;
  border: 1px solid #bcc9d8;
}

button.secondary:hover {
  background: #dde7f2;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: #1a2433;
  background: #eef3f8;
  border: 1px solid #d6e0ea;
  font-weight: 600;
}

.nav-link.is-active {
  background: #0b64d8;
  border-color: #0b64d8;
  color: #fff;
}

.kv-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 14px;
}

.kv-list dt {
  font-weight: 700;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid #e1e8f0;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

.compact-table td,
.compact-table th {
  white-space: nowrap;
}

.compact-table td:last-child,
.compact-table th:last-child {
  white-space: normal;
}

.license-row {
  cursor: pointer;
}

.license-row:hover {
  background: #f6faff;
}

.license-row.is-selected {
  background: #dbeafe;
}

.license-row.is-blocked td {
  color: #8a1c1c;
}

.login-card {
  max-width: 520px;
  margin: 40px auto 0;
}

.compact-stats input[readonly] {
  background: #f4f7fa;
}

.message {
  min-height: 24px;
  margin-top: 16px;
  font-weight: 600;
}

#adminContent.is-locked {
  display: none;
}

.actions.start {
  justify-content: flex-start;
}

.actions.wrap {
  flex-wrap: wrap;
}

.align-end {
  align-items: end;
}

.table-wrap {
  overflow-x: auto;
}

.scrollable-table {
  max-height: 430px;
  overflow: auto;
}

.sortable-table th[data-sort-key] {
  cursor: pointer;
  user-select: none;
}

.sortable-table th[data-sort-key]::after {
  content: " \2195";
  color: #8aa0b8;
  font-size: 12px;
}

.sortable-table th.sort-asc::after {
  content: " \2191";
  color: #0b64d8;
}

.sortable-table th.sort-desc::after {
  content: " \2193";
  color: #0b64d8;
}

.toolbar-search {
  min-width: 220px;
}

.file-action {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.file-action input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  box-sizing: border-box;
}

.request-kv dd {
  word-break: break-word;
}

.compact-request-kv {
  grid-template-columns: max-content 1fr;
  padding: 10px 12px;
  border: 1px solid #dce6f0;
  border-radius: 10px;
  background: #fff;
}

dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(540px, 96vw);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
}

dialog form {
  padding: 18px;
}

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

  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}
