:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-subtle: #f1f4f7;
  --ink: #17202a;
  --muted: #667085;
  --line: #d7dde5;
  --brand: #1f7a6d;
  --brand-strong: #145c52;
  --danger: #b42318;
  --warning: #b54708;
  --success: #027a48;
  --shadow: 0 12px 36px rgba(22, 31, 44, 0.08);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand);
  color: white;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a,
.nav button,
.button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.button.primary,
button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.button.danger,
button.danger {
  background: #fff5f5;
  border-color: #f3b7b7;
  color: var(--danger);
}

.button:disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar,
.panel,
.table-wrap,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 14px;
  position: sticky;
  top: 18px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
}

.sidebar a.active,
.sidebar a:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.main {
  display: grid;
  gap: 18px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head h1,
.auth-card h1,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.page-head p,
.panel p,
.muted {
  color: var(--muted);
}

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

.grid.cards {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.panel {
  padding: 18px;
}

.metric {
  display: grid;
  gap: 6px;
}

.metric strong {
  font-size: 26px;
}

.license-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  display: grid;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

.badge.active {
  background: #ecfdf3;
  color: var(--success);
}

.badge.revoked,
.badge.blocked,
.badge.expired {
  background: #fff1f0;
  color: var(--danger);
}

.badge.inactive {
  background: #f2f4f7;
  color: var(--muted);
}

.badge.admin,
.badge.yearly,
.badge.lifetime {
  background: #eef4ff;
  color: #175cd3;
}

.badge.monthly,
.badge.trial {
  background: #fffaeb;
  color: var(--warning);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: var(--surface-subtle);
}

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

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.auth-intro {
  background: #153f39;
  color: white;
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
}

.auth-intro p {
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.6;
}

.auth-forms {
  padding: 30px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  min-height: 40px;
  cursor: pointer;
}

.tab.active {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: #eef8f5;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

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

input:focus,
select:focus {
  outline: 3px solid rgba(31, 122, 109, 0.15);
  border-color: var(--brand);
}

.hidden {
  display: none !important;
}

.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-subtle);
  color: var(--muted);
}

.notice.error {
  background: #fff1f0;
  border-color: #f3b7b7;
  color: var(--danger);
}

.code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  word-break: break-all;
}

@media (max-width: 820px) {
  .layout,
  .auth-card {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .auth-intro {
    min-height: auto;
    gap: 24px;
  }

  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }
}
