:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #66746d;
  --line: #d9e0dc;
  --panel: #ffffff;
  --canvas: #f4f7f5;
  --accent: #156f5b;
  --danger: #b42318;
  --warn: #9a6700;
  --ok: #087443;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: #eef4f1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.server-status,
header p,
label,
.muted {
  color: var(--muted);
}

.mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

nav {
  display: grid;
  gap: 8px;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button.active,
button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

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

.workspace {
  position: relative;
  padding: 40px;
}

.panel {
  display: none;
  max-width: 980px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel.active {
  display: block;
}

header {
  max-width: 720px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-size: 32px;
  line-height: 1.15;
}

p {
  line-height: 1.55;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.compact-grid {
  margin-top: 24px;
  grid-template-columns: minmax(0, 1fr) 140px 180px 160px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.checkline {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
}

.checkline input {
  width: auto;
  min-height: auto;
}

input,
select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #ffffff;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid rgba(21, 111, 91, 0.18);
  border-color: var(--accent);
}

.result {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.item strong,
.item span {
  display: block;
}

.code-toolbar {
  display: flex;
  justify-content: flex-end;
}

.code-item {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 120px;
}

.assign-item {
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr) 120px;
  margin-top: -4px;
  background: #f6faf8;
}

.code-actions {
  display: grid;
  gap: 8px;
}

.code-value {
  margin-bottom: 7px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-weight: 800;
}

.status {
  font-weight: 800;
}

.status.active,
.status.trial {
  color: var(--ok);
}

.status.pending {
  color: var(--warn);
}

.status.suspended,
.error {
  color: var(--danger);
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #edf1ef;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 16px 40px rgba(23, 32, 28, 0.22);
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    padding: 20px;
  }

  .panel {
    padding: 22px;
  }

  .grid,
  .compact-grid,
  .item,
  .assign-item,
  .code-item {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 26px;
  }
}
