:root {
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  color: #182033;
  background: #f5f6fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #182033;
  --muted: #6e7789;
  --line: #e7e9f1;
  --accent: #6251e8;
  --accent-dark: #4d3bd0;
  --soft: #f0efff;
  --danger: #c23b53;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 12% -8%, rgba(111, 96, 239, .12), transparent 38rem),
    radial-gradient(ellipse at 100% 24%, rgba(108, 169, 255, .07), transparent 34rem),
    #f5f6fb;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.page { width: min(1060px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 25px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 27px; }
.brand-copy { min-width: 0; }
.topbar > button { margin-left: auto; }
.brand-mark { display: grid; width: 54px; height: 54px; flex: 0 0 54px; place-items: center; overflow: hidden; border: 1px solid #e7eaf1; border-radius: 16px; background: #fff; box-shadow: 0 7px 18px rgba(31, 40, 68, .09); }
.brand-logo { display: block; width: 100%; height: 100%; padding: 3px; object-fit: contain; }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 10px; letter-spacing: .14em; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 1px; font-size: 24px; letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 19px; letter-spacing: -.03em; }
h3 { margin: 0; font-size: 15px; }
.brand-subtitle { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.topbar-badge { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 8px 11px; border: 1px solid #e3e5ed; border-radius: 99px; color: #596276; background: #ffffffb8; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #38ad82; box-shadow: 0 0 0 3px #38ad821c; }
.card { padding: 25px; border: 1px solid #e8eaf2; border-radius: 19px; background: rgba(255, 255, 255, .96); box-shadow: 0 12px 34px rgba(31, 40, 68, .055), 0 2px 5px rgba(31, 40, 68, .025); }
.login-card { width: min(490px, 100%); margin: 7vh auto 0; padding: 27px; }
.section-heading, .issued-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.muted { color: var(--muted); line-height: 1.55; font-size: 13px; }
.login-card > .muted, .add-card > .muted { margin: 13px 0 14px; }
.lock-icon, .step-badge { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #e9e6ff; border-radius: 14px; color: var(--accent); background: linear-gradient(145deg, #f5f4ff, #eceaff); font-size: 20px; font-weight: 800; }
.step-badge { font-size: 12px; }
.key-help { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0 10px; padding: 12px 13px; border: 1px solid #e8e7fb; border-radius: 12px; background: linear-gradient(110deg, #f8f7ff, #fbfbff); }
.help-icon { display: grid; width: 19px; height: 19px; flex: 0 0 19px; place-items: center; margin-top: 1px; border-radius: 50%; color: white; background: #7466e8; font: 700 12px Georgia, serif; }
.key-help p { margin: 0; color: #5d6578; font-size: 11px; line-height: 1.55; }
.key-help strong { color: #343d53; }
code { padding: 2px 5px; border-radius: 5px; color: #5144b8; background: #efedff; font: 10px Consolas, monospace; }
.key-details { margin: 0 0 18px 29px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.key-details summary { width: fit-content; color: #5548c5; font-weight: 750; cursor: pointer; }
.key-details p { margin: 8px 0 0; }
.stack { display: grid; gap: 10px; }
label { color: #3f485a; font-size: 12px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #dce1ec; border-radius: 10px; outline: none; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
input { min-height: 43px; padding: 10px 12px; }
textarea { resize: vertical; min-height: 88px; padding: 12px; color: #30384b; background: #f8f9fc; font: 11px/1.55 Consolas, monospace; overflow-wrap: anywhere; }
input:focus, textarea:focus { border-color: #8175f3; box-shadow: 0 0 0 3px #8175f326; }
input::placeholder { color: #a3aab8; }
.input-with-action { position: relative; }
.input-with-action input { padding-right: 74px; }
.show-key { position: absolute; top: 50%; right: 8px; padding: 5px 7px; transform: translateY(-50%); border: 0; border-radius: 7px; color: #6254cb; background: transparent; font-size: 11px; font-weight: 750; }
.show-key:hover { background: #f2f0ff; }
.button { min-height: 38px; padding: 9px 14px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 750; transition: transform .12s, background .12s, border-color .12s, box-shadow .12s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .6; transform: none; }
.button-primary { color: white; background: linear-gradient(135deg, #7162ed, #5644da); box-shadow: 0 5px 13px #5b4ae82e; }
.button-primary:hover { background: linear-gradient(135deg, #6252e2, #4938cc); box-shadow: 0 7px 16px #5b4ae838; }
.button-secondary { color: var(--accent-dark); border-color: #ddd9ff; background: #f6f5ff; }
.button-quiet { color: #565f70; border-color: var(--line); background: #fff; }
.license-form { display: grid; grid-template-columns: minmax(180px, .85fr) minmax(280px, 1.3fr) auto; align-items: end; gap: 14px; }
.field { display: grid; gap: 8px; min-width: 0; }
.add-button { min-height: 43px; white-space: nowrap; }
.message { min-height: 18px; margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.message.error { color: var(--danger); }
.message.success { color: #16815e; }
.issued-card { margin-top: 12px; padding: 16px; border: 1px solid #dcefe8; border-radius: 13px; background: #f7fcfa; }
.issued-heading { margin-bottom: 12px; }
.issued-heading .eyebrow { margin-bottom: 3px; }
.small { margin: 7px 0 0; font-size: 11px; }
.list-card { margin-top: 20px; padding-bottom: 14px; }
.list-heading { margin-bottom: 16px; }
.list-actions { display: flex; align-items: center; gap: 9px; }
.count-badge { display: grid; min-width: 30px; height: 30px; place-items: center; padding: 0 8px; border-radius: 99px; color: var(--accent-dark); background: var(--soft); font-size: 12px; font-weight: 800; }
.notice { margin: 0 0 15px; padding: 11px 13px; border: 1px solid #f4e9cf; border-radius: 11px; color: #75552b; background: #fffaf0; font-size: 11px; line-height: 1.55; }
.table-wrap { overflow-x: auto; border: 1px solid #edf0f5; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: #7d8594; background: #fafbfe; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
td { padding: 13px 12px; border-bottom: 1px solid #eef0f5; font-size: 12px; vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafaff; }
tbody tr:last-child td { border-bottom: 0; }
.customer-cell { min-width: 140px; font-weight: 700; }
.hwid-cell { min-width: 285px; color: #596377; font: 10px Consolas, monospace; white-space: nowrap; }
.expiry-cell { min-width: 110px; color: #697386; }
.delete-cell { width: 1%; text-align: right; white-space: nowrap; }
.button-delete { color: var(--danger); border-color: #f2d7dd; background: #fff8f9; }
.button-delete:hover { background: #fff0f2; }
.empty-state { padding: 27px 12px; color: #8a92a0; text-align: center; }
footer { padding: 20px 4px 0; color: #8991a0; font-size: 11px; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .page { width: min(100% - 24px, 600px); padding-top: 20px; }
  .card { padding: 18px; }
  .login-card { padding: 21px; }
  .license-form { grid-template-columns: 1fr; }
  .add-button { width: 100%; }
  .topbar { margin-bottom: 18px; }
  h1 { font-size: 20px; }
  .list-card { padding-right: 12px; padding-left: 12px; }
  .notice { margin-right: 6px; margin-left: 6px; }
}

@media (max-width: 500px) {
  .topbar { gap: 10px; flex-wrap: wrap; }
  .brand-mark { width: 46px; height: 46px; flex-basis: 46px; border-radius: 14px; }
  .brand-subtitle { font-size: 11px; }
  .topbar-badge { margin-left: auto; }
  .topbar > button { margin-left: auto; padding: 8px 10px; }
  .list-heading { align-items: flex-start; }
  .list-actions { flex-direction: column-reverse; align-items: flex-end; }
  .key-details { margin-left: 0; }
}
