* { box-sizing: border-box; }

:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #64748b;
  --line: #d9e2ef;
  --soft: #eef4ff;
  --brand: #4f46e5;
  --brand-strong: #3730a3;
  --success: #047857;
  --danger: #dc2626;
  --warning: #b45309;
  --shadow: 0 18px 48px rgba(15, 23, 42, .08);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(79, 70, 229, .08), transparent 32%),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 42%, #f8fafc 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1420px, calc(100vw - 48px));
  margin: 34px auto 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 560px);
  gap: 28px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 7px;
  color: var(--brand);
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}
h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 660px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
}

.token-card,
.panel,
.status-strip {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.token-card {
  padding: 18px;
}

.token-card label,
.module-head label,
.field-grid label,
.limits label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-weight: 800;
}

.token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  margin-top: 8px;
}

input,
button {
  min-height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 11px 13px;
  font: inherit;
}

input {
  width: 100%;
  background: #fff;
  color: var(--ink);
}

input:focus {
  outline: 3px solid rgba(79, 70, 229, .16);
  border-color: var(--brand);
}

button {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

button:hover { background: var(--brand-strong); }

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

.status-strip {
  display: grid;
  grid-template-columns: 190px 130px 160px minmax(240px, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 22px;
  background: var(--line);
}

.status-strip > div {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .95);
}

.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.status-strip strong {
  overflow-wrap: anywhere;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(430px, 500px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  padding: 22px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 11px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.field-grid,
.limits {
  display: grid;
  gap: 14px;
}

.limits {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.module-block {
  margin-top: 16px;
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.link-btn {
  min-height: 32px;
  padding: 5px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--brand);
}

.link-btn:hover {
  background: #eef2ff;
  color: var(--brand-strong);
}

.module-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.module-option {
  position: relative;
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: #334155;
  font-weight: 750;
  cursor: pointer;
}

.module-option input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

.primary-action {
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
}

.cancel-edit {
  width: 100%;
  margin-top: 10px;
}

.secondary-action {
  min-width: 110px;
  background: white;
  color: var(--brand);
}

.secondary-action:hover {
  background: #eef2ff;
}

.license-list {
  display: grid;
  gap: 12px;
}

.empty-state {
  display: grid;
  gap: 8px;
  min-height: 190px;
  place-content: center;
  padding: 24px;
  border: 1px dashed #b9c7da;
  border-radius: 8px;
  background: #f8fbff;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
  font-size: 18px;
}

.license {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdff;
}

.license.suspended,
.license.expired {
  border-left-color: var(--danger);
}

.license.grace {
  border-left-color: var(--warning);
}

.license-head,
.license-meta,
.actions {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.license-title {
  display: grid;
  gap: 4px;
}

.client-name {
  font-size: 18px;
  font-weight: 900;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.mode-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--success);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.license.suspended .mode-pill,
.license.expired .mode-pill {
  background: #fef2f2;
  color: var(--danger);
}

.license.grace .mode-pill {
  background: #fffbeb;
  color: var(--warning);
}

.key {
  padding: 12px;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.module-tags span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 800;
}

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

.actions button {
  min-height: 38px;
  padding: 8px 11px;
  background: white;
  color: var(--brand);
}

.actions button:hover {
  background: #eef2ff;
}

@media (max-width: 1080px) {
  .hero,
  .workspace,
  .status-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 28px, 1420px);
    margin-top: 22px;
  }

  .token-row,
  .module-options,
  .limits,
  .license-head,
  .license-meta {
    grid-template-columns: 1fr;
    display: grid;
  }
}
