:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --primary: #155eef;
  --primary-dark: #0f49bc;
  --danger: #b42318;
  --ok: #067647;
  --warn: #b54708;
  --radius: 8px;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: #111827;
  color: #fff;
}

.topbar h1,
.panel h2 {
  margin: 0;
}

.topbar h1 {
  font-size: 22px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.subtle {
  margin: 4px 0 0;
  color: var(--muted);
}

.topbar .subtle {
  color: #b8c1d1;
}

.panel,
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.panel.narrow {
  max-width: 560px;
}

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

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

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric {
  padding: 16px 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

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

.form-row,
.two-cols,
.edit-grid {
  display: grid;
  gap: 14px;
}

.form-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-top: 16px;
}

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

.edit-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

label,
fieldset {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 600;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

legend {
  padding: 0 5px;
}

input,
select {
  width: 100%;
  border: 1px solid #c5cfdd;
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(21, 94, 239, 0.22);
  outline-offset: 1px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.checkline input {
  width: auto;
}

button {
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  background: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  color: #1d2939;
  background: #fff;
  border-color: #b8c3d3;
}

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

button.danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status {
  margin-bottom: 18px;
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.status.ok {
  border-color: #98d8bd;
  background: #effaf5;
  color: var(--ok);
}

.status.error {
  border-color: #f4aaa6;
  background: #fff2f1;
  color: var(--danger);
}

.status.warn {
  border-color: #f7c98a;
  background: #fff8eb;
  color: var(--warn);
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
}

td code,
.license-key-box code {
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.pill.ok {
  background: #dcfae6;
  color: #067647;
}

.pill.danger {
  background: #fee4e2;
  color: #b42318;
}

.pill.muted {
  background: #eef2f7;
  color: #475467;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.license-key-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  border: 1px solid #f7c98a;
  border-radius: var(--radius);
  background: #fff8eb;
  padding: 12px;
}

.license-key-box code {
  overflow-wrap: anywhere;
  font-weight: 700;
}

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

  .topbar,
  .form-row,
  .two-cols {
    grid-template-columns: 1fr;
  }

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

  main {
    padding: 16px;
  }
}
