/* Admin key dashboard — functional and responsive. */
.admin-page { background: radial-gradient(900px 500px at 80% -10%, rgba(221,96,58,.08), transparent 62%), var(--paper); }
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 66px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(245,239,227,.9);
  backdrop-filter: blur(16px);
}
.admin-top-label { color: var(--muted-light); font-family: var(--mono); font-size: 8px; letter-spacing: .12em; }
.admin-top-actions { margin-left: auto; display: flex; align-items: center; gap: 15px; }
.admin-top-actions a, .admin-logout { color: var(--muted); font-size: 10.5px; background: transparent; border: 0; cursor: pointer; }
.admin-top-actions a:hover, .admin-logout:hover { color: var(--accent-deep); }
.admin-shell { max-width: 1200px; margin: 0 auto; padding: 44px 34px 80px; }
.admin-login { max-width: 460px; margin: 7vh auto 0; padding: 31px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-md); }
.admin-login h1 { margin-top: 8px; font-size: 34px; font-weight: 500; letter-spacing: -.04em; }
.admin-login > p { margin-top: 9px; color: var(--muted); font-size: 11.5px; line-height: 1.75; }
.admin-login form { margin-top: 22px; }
.admin-login label { display: block; color: var(--muted); font-size: 9.5px; letter-spacing: .05em; margin-bottom: 6px; }
.admin-input-row { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); }
.admin-input-row:focus-within { border-color: var(--accent); background: var(--surface); }
.admin-input-row .ic { width: 14px; height: 14px; color: var(--muted); }
.admin-input-row input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.admin-primary { width: 100%; height: 43px; margin-top: 13px; border-radius: 8px; background: var(--accent); color: #fff8ed; font-size: 11.5px; font-weight: 600; }
.admin-primary:hover { background: var(--accent-deep); }
.admin-msg { min-height: 17px; margin-top: 8px; color: var(--accent-deep); font-size: 10.5px; line-height: 1.5; }
.admin-msg.is-error { color: #b9472b; }
.admin-hint { display: flex; gap: 8px; align-items: flex-start; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9.5px; line-height: 1.65; }
.admin-hint .ic { width: 14px; height: 14px; flex: 0 0 auto; color: var(--muted); margin-top: 1px; }
.admin-hint code { color: var(--ink-soft); font-family: var(--mono); font-size: 9px; }

.admin-app { animation: fadeUp .4s ease both; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.admin-head h1 { margin-top: 6px; font-size: 37px; font-weight: 500; letter-spacing: -.04em; }
.admin-quiet { display: inline-flex; align-items: center; gap: 5px; height: 33px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font-size: 10px; }
.admin-quiet:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface-2); }
.admin-quiet .ic { width: 12px; height: 12px; }
.admin-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin-top: 21px; }
.admin-stats > div { padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.admin-stats span { display: block; color: var(--muted); font-size: 9px; }
.admin-stats strong { display: block; margin-top: 4px; font-size: 24px; font-weight: 500; letter-spacing: -.04em; }
.admin-generator { position: relative; margin-top: 23px; padding: 24px; border-radius: 16px; background: #202820; color: #fbf7ea; }
.admin-gen-copy .mini-label { color: rgba(255,255,255,.42); }
.admin-gen-copy h2 { margin-top: 7px; font-size: 25px; font-weight: 500; letter-spacing: -.03em; }
.admin-gen-copy p { max-width: 620px; margin-top: 7px; color: rgba(251,247,234,.53); font-size: 10px; line-height: 1.7; }
.admin-gen-form { display: flex; align-items: flex-end; gap: 10px; margin-top: 17px; flex-wrap: wrap; }
.admin-gen-form label { flex: 1 1 160px; color: rgba(251,247,234,.5); font-size: 9px; }
.admin-gen-form select, .admin-gen-form input { display: block; width: 100%; height: 39px; margin-top: 5px; padding: 0 9px; border: 1px solid rgba(255,255,255,.16); border-radius: 7px; background: rgba(255,255,255,.07); color: #fbf7ea; font-size: 10.5px; outline: 0; }
.admin-gen-form select option { color: #202820; }
.admin-gen-form input { min-width: 0; }
.admin-gen-form .admin-primary { flex: 0 0 auto; width: auto; min-width: 128px; padding: 0 16px; margin-top: 0; background: #f3c2a6; color: #352b22; }
.admin-gen-form .admin-primary:hover { background: #f7d2bb; }
.admin-gen-form .admin-primary .ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.generated-box { margin-top: 17px; padding: 13px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: rgba(255,255,255,.05); }
.generated-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.generated-head strong { font-size: 10.5px; font-weight: 500; }
.generated-head button { border: 0; background: transparent; color: #efb491; font-size: 9.5px; cursor: pointer; margin-left: 10px; }
.generated-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.generated-key { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; padding: 7px 8px; border-radius: 5px; background: rgba(0,0,0,.18); color: #fbf7ea; font-family: var(--mono); font-size: 9px; letter-spacing: .03em; }
.generated-key button { border: 0; background: transparent; color: rgba(255,255,255,.55); cursor: pointer; padding: 0; }
.generated-key button:hover { color: #fff; }
.generated-key button .ic { width: 11px; height: 11px; }
.admin-generator > .admin-msg { color: #efb491; margin-bottom: 0; }
.admin-table-section { margin-top: 30px; }
.admin-table-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.admin-table-head h2 { margin-top: 5px; font-size: 25px; font-weight: 500; letter-spacing: -.03em; }
.admin-table-actions { display: flex; align-items: center; gap: 7px; }
.admin-table-actions input { width: 190px; height: 33px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: var(--surface); color: var(--ink); font-size: 10px; }
.admin-table-actions input:focus { border-color: var(--line-strong); }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 880px; }
.admin-table th { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8.5px; font-weight: 500; letter-spacing: .04em; white-space: nowrap; background: var(--surface-2); }
.admin-table td { padding: 11px 12px; border-bottom: 1px solid rgba(230,220,203,.66); color: var(--ink-soft); font-size: 9.5px; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td.key-cell { color: var(--ink); font-family: var(--mono); font-size: 9px; letter-spacing: .03em; white-space: nowrap; }
.admin-table td.key-cell button { margin-left: 5px; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0; vertical-align: -2px; }
.admin-table td.key-cell button:hover { color: var(--accent-deep); }
.admin-table td.key-cell .ic { width: 11px; height: 11px; }
.status-badge { display: inline-flex; align-items: center; height: 19px; padding: 0 6px; border-radius: 4px; font-size: 8px; white-space: nowrap; }
.status-unused { color: var(--accent-deep); background: var(--accent-soft); }
.status-active { color: var(--green-deep); background: var(--green-soft); }
.status-expired { color: #7d7161; background: var(--surface-3); }
.status-revoked { color: #9d4b39; background: #f7e4dd; }
.admin-revoke { border: 0; background: transparent; color: #a34b37; font-size: 9px; cursor: pointer; padding: 0; }
.admin-revoke:hover { text-decoration: underline; }
.admin-revoke:disabled { color: var(--muted-light); cursor: default; text-decoration: none; }
.admin-empty { display: none; padding: 45px 20px; text-align: center; color: var(--muted); font-size: 11px; }
.admin-empty.is-visible { display: block; }
.admin-table-empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 11px; }
.admin-page .toast { z-index: 100; }

@media (max-width: 900px) {
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
  .generated-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .admin-topbar { height: 61px; padding: 0 18px; gap: 10px; }
  .admin-top-label { display: none; }
  .admin-top-actions { gap: 10px; }
  .admin-top-actions a:first-child { display: none; }
  .admin-shell { padding: 26px 18px 56px; }
  .admin-login { margin-top: 3vh; padding: 23px 20px; border-radius: 18px; }
  .admin-login h1 { font-size: 29px; }
  .admin-head h1 { font-size: 30px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-generator { padding: 19px 16px; border-radius: 13px; }
  .admin-gen-form { flex-direction: column; align-items: stretch; }
  .admin-gen-form label { flex: 0 0 auto; width: 100%; }
  .admin-gen-form .admin-primary { width: 100%; }
  .admin-gen-form .admin-primary { margin-top: 4px; }
  .generated-list { grid-template-columns: 1fr; }
  .admin-table-head { align-items: flex-start; }
  .admin-table-actions { width: 100%; }
  .admin-table-actions input { flex: 1; width: auto; }
  .admin-table-actions .admin-quiet { flex: 0 0 auto; }
  .admin-table-wrap { border-radius: 10px; }
}
@media (max-width: 420px) {
  .admin-top-actions a { font-size: 9.5px; }
  .admin-login h1 { font-size: 26px; }
  .admin-stats { gap: 6px; }
  .admin-stats > div { padding: 11px; }
  .admin-stats strong { font-size: 21px; }
}

/* Invite / account admin additions */
[hidden] { display: none !important; }
.admin-login form .admin-input-row + label { margin-top: 12px; }
.admin-gen-form label:last-of-type { flex: 1.4 1 190px; }
.admin-table td b { font-weight: 600; color: var(--ink); }
.admin-table td .status-badge { margin: 0; }
.admin-revoke:disabled { color: var(--muted-light); background: var(--surface-2); cursor: default; }
.status-used { color: #5b6658; background: var(--surface-3); }
