* { box-sizing: border-box; }

:root {
  --bg: #f6f7f8;
  --white: #ffffff;
  --text: #111114;
  --muted: #6b6b76;
  --border: #e7e7ec;
  --radius: 12px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

a { color: var(--text); }

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-box {
  width: 100%;
  max-width: 360px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.auth-box h1 {
  font-size: 20px;
  margin: 0 0 8px;
}

.auth-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 20px;
}

.auth-success {
  font-size: 13px;
  color: #2e7d32;
  margin: 0 0 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  font-size: 18px;
  margin: 0;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}

.topbar__right a {
  text-decoration: underline;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card h2 {
  font-size: 16px;
  margin: 0 0 16px;
}

.flash {
  background: #eaf6ea;
  color: #2e7d32;
  border: 1px solid #bfe3bf;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  margin: 0;
}

.form-error {
  color: #c0392b;
  font-size: 13px;
  margin: 0 0 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
}

.field textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}

.license-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 24px;
}

.field--top {
  grid-column: 1 / -1;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-dark {
  border: none;
  background: var(--text);
  color: var(--white);
  height: 44px;
  padding: 0 24px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-dark:hover {
  background: #2a2a2e;
}

.btn-outline-link {
  font-size: 14px;
  color: var(--muted);
  text-decoration: underline;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

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

.licenses-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.licenses-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.licenses-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.licenses-table code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12px;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge--ok {
  background: #e6f4ea;
  color: #2e7d32;
}

.status-badge--suspended {
  background: #fdecea;
  color: #c0392b;
}

.status-badge--expired {
  background: #f1f1f3;
  color: var(--muted);
}

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

.inline-form {
  display: inline;
}

.link-btn {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--text);
}

.link-btn--danger:hover {
  color: #c0392b;
}

@media (max-width: 720px) {
  .license-form { grid-template-columns: 1fr; }
  .page { padding: 16px; }
  .topbar { padding: 16px; }
}
