*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b0e18;
  color: #e2e8f0;
  min-height: 100vh;
  font-size: 13px;
}

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: #0f1117;
  border-bottom: 1px solid #1e2736;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
}
.topbar-actions { display: flex; gap: 10px; }

/* ── Buttons ── */
.btn {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s;
}
.btn-primary { background: #534AB7; color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-ghost { background: #1e293b; color: #94a3b8; border: 1px solid #2d3748; }
.btn-ghost:hover { background: #2d3748; color: #e2e8f0; }

/* ── Stats ── */
.stats-row {
  display: flex;
  gap: 14px;
  padding: 20px 28px 0;
}
.stat-card {
  flex: 1;
  background: #161b27;
  border: 1px solid #1e2736;
  border-radius: 10px;
  padding: 16px 20px;
  text-align: center;
}
.stat-val { font-size: 28px; font-weight: 800; color: #e2e8f0; line-height: 1; }
.stat-label { font-size: 11px; color: #64748b; margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }
.stat-card.active  .stat-val { color: #4ade80; }
.stat-card.expiring .stat-val { color: #fbbf24; }
.stat-card.expired  .stat-val { color: #f87171; }
.stat-card.revoked  .stat-val { color: #64748b; }

/* ── Table ── */
.table-wrap {
  margin: 20px 28px 40px;
  background: #161b27;
  border: 1px solid #1e2736;
  border-radius: 10px;
  overflow: auto;
}
.empty {
  padding: 60px;
  text-align: center;
  color: #475569;
  font-size: 14px;
}
.lic-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
.lic-table thead tr {
  background: #1a2235;
  border-bottom: 1px solid #2d3748;
}
.lic-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.lic-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #1e2736;
  vertical-align: middle;
}
.lic-table tbody tr:last-child td { border-bottom: none; }
.lic-table tbody tr:hover { background: rgba(255,255,255,.02); }

.row-expired td { opacity: .65; }
.row-revoked td { opacity: .45; text-decoration: line-through; }

.customer { font-weight: 600; color: #e2e8f0; }
.muted    { color: #64748b; }
.mono     { font-family: monospace; font-size: 12px; color: #818cf8; letter-spacing: .5px; }

.days-left          { color: #94a3b8; }
.days-left.expired  { color: #f87171; }
.days-left.perpetual { color: #4ade80; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.badge-active   { background: #14291e; border: 1px solid #166534; color: #4ade80; }
.badge-expiring { background: #292317; border: 1px solid #92400e; color: #fbbf24; }
.badge-expired  { background: #290d0d; border: 1px solid #7f1d1d; color: #f87171; }
.badge-revoked  { background: #1a1a2e; border: 1px solid #374151; color: #64748b; }

/* ── Copy button ── */
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 5px;
  background: #1e293b;
  border: 1px solid #2d3748;
  color: #94a3b8;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
}
.btn-copy:hover { background: #2d3748; color: #e2e8f0; }

/* ── Action buttons ── */
.actions { display: flex; gap: 6px; }
.btn-action {
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
}
.btn-action.revoke { background: #292317; border-color: #92400e; color: #fbbf24; }
.btn-action.revoke:hover { background: #92400e; color: #fff; }
.btn-action.reset { background: #0f1f2e; border-color: #1e4976; color: #60a5fa; }
.btn-action.reset:hover { background: #1e4976; color: #fff; }

/* ── UUID cell ── */
.uuid-cell { color: #475569; font-size: 11px; cursor: default; }
.uuid-cell:hover { color: #818cf8; }

/* ── Reset info block ── */
.reset-info {
  background: #0f1f2e;
  border: 1px solid #1e4976;
  border-radius: 6px;
  padding: 10px 14px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}
.reset-info strong { color: #e2e8f0; }

/* ── Reset button (primary variant) ── */
.btn-reset { background: #1e4976; color: #fff; border: none; }
.btn-reset:hover { background: #2563eb; }

/* ── Notes row ── */
.notes-row td { padding: 0 14px 10px; }
.notes-cell { color: #64748b; font-size: 12px; font-style: italic; }

/* ── Modal ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200;
}
.modal-backdrop.open { display: block; }

.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -52%);
  width: 520px;
  background: #161b27;
  border: 1px solid #2d3748;
  border-radius: 12px;
  z-index: 300;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  transition: transform .2s;
}
.modal.open { display: block; transform: translate(-50%, -50%); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #2d3748;
}
.modal-header h2 { font-size: 15px; font-weight: 700; }
.modal-close { background: none; border: none; color: #64748b; font-size: 18px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: #e2e8f0; }

.modal-form { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }

.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row label { font-size: 12px; font-weight: 600; color: #94a3b8; }
.form-row .req { color: #f87171; }
.form-row input,
.form-row select,
.form-row textarea {
  background: #0f1117;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 8px 11px;
  color: #e2e8f0;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: #534AB7; }
.form-row select option { background: #161b27; }
.form-row .hint { font-size: 11px; color: #475569; }
.form-row textarea { resize: vertical; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex-direction: unset; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid #1e2736;
  margin-top: 4px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #14291e;
  border: 1px solid #166534;
  color: #4ade80;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: all .25s;
  pointer-events: none;
  z-index: 400;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Sign-in, second step, banners (2026-11-23) ───────────────────────────── */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: #14141f; border: 1px solid #2a2a3d; border-radius: 14px; padding: 28px; }
.auth-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #a5a3c0; font-size: 13px; margin-bottom: 18px; }
.auth-brand .dot { width: 12px; height: 12px; border-radius: 50%; background: #534AB7; display: inline-block; }
.auth-card h1 { font-size: 22px; margin: 0 0 14px; }
.auth-form { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.auth-form label { font-size: 13px; color: #a5a3c0; }
.auth-form input { height: 42px; padding: 0 12px; border-radius: 9px; border: 1px solid #2f2f45; background: #0e0e17; color: inherit; font-size: 15px; }
.auth-form input:focus { outline: 2px solid #534AB7; outline-offset: 0; }
.code-input { letter-spacing: .25em; text-align: center; font-size: 20px !important; }
.btn-block { width: 100%; justify-content: center; margin-top: 8px; height: 42px; }
.auth-note { font-size: 13px; color: #8f8daa; margin: 10px 0; }
.auth-note a, .link-btn { color: #9d8cff; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.auth-inline { margin: 4px 0; }
.alert { border-radius: 9px; padding: 10px 12px; font-size: 13.5px; margin: 8px 0; }
.alert-error { background: rgba(248,113,113,.12); color: #fca5a5; border: 1px solid rgba(248,113,113,.35); }
.alert-ok { background: rgba(74,222,128,.10); color: #86efac; border: 1px solid rgba(74,222,128,.3); }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 64px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #a5a3c0; cursor: pointer; font-size: 12.5px; padding: 6px 8px; border-radius: 6px; }
.pw-eye:focus-visible { outline: 2px solid #534AB7; }
.choice-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.choice { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid #2f2f45; border-radius: 10px; text-decoration: none; color: inherit; }
.choice:hover { border-color: #534AB7; }
.choice span { font-size: 13px; color: #8f8daa; }
.choice.disabled { opacity: .55; }
.qr { display: block; margin: 10px auto; background: #fff; padding: 8px; border-radius: 8px; image-rendering: pixelated; }
.secret { word-break: break-all; font-size: 12.5px; }
.banner { margin: 12px 24px 0; padding: 10px 14px; border-radius: 9px; font-size: 13.5px; }
.banner-error { background: rgba(248,113,113,.12); color: #fca5a5; border: 1px solid rgba(248,113,113,.35); }
.banner-ok { background: rgba(74,222,128,.10); color: #86efac; border: 1px solid rgba(74,222,128,.3); }
.who { font-size: 12.5px; color: #8f8daa; margin-right: 4px; }
form.inline { display: inline; }
.small { font-size: 11.5px; }
button[disabled] { opacity: .5; cursor: not-allowed; }
