:root {
  color-scheme: light;
  --ink: #1d2428;
  --muted: #667176;
  --line: #d6ded7;
  --panel: #ffffff;
  --paper: #edf3ef;
  --gold: #a77a31;
  --gold-dark: #725018;
  --green: #1f7a55;
  --red: #a33b35;
  --shadow: 0 24px 60px rgba(32, 27, 19, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(31, 122, 85, 0.13), transparent 38%),
    linear-gradient(315deg, rgba(167, 122, 49, 0.1), transparent 36%),
    var(--paper);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-panel {
  padding: 24px;
}

.login-panel h1 {
  margin: 0 0 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
  line-height: 1;
}

.login-error {
  border: 1px solid rgba(163, 59, 53, 0.34);
  border-radius: 8px;
  margin: 0 0 16px;
  padding: 10px 12px;
  color: var(--red);
  background: rgba(163, 59, 53, 0.07);
  font-weight: 750;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

.admin-header h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4rem;
  line-height: 0.95;
}

.ghost-link {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  text-decoration: none;
  background: rgba(255, 253, 248, 0.66);
  font-weight: 700;
}

.logout-button {
  cursor: pointer;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-stack {
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.form-panel,
.list-panel {
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  font-weight: 850;
}

.status-pill,
.count-pill {
  min-width: 34px;
  border: 1px solid rgba(31, 122, 85, 0.24);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--green);
  background: rgba(31, 122, 85, 0.08);
  font-size: 0.8rem;
  text-align: center;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
}

.field input:focus {
  outline: 3px solid rgba(167, 122, 49, 0.22);
  border-color: var(--gold);
}

.logo-setting {
  min-height: 232px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 16px;
  background: #fff;
}

.current-logo {
  width: 200px;
  height: 200px;
  object-fit: contain;
}

.logo-placeholder {
  color: var(--muted);
  font-weight: 750;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  border: 1px solid var(--gold-dark);
  color: #fff;
  background: linear-gradient(180deg, #b88939, #77541d);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.full-button {
  width: 100%;
}

.danger-button {
  border: 1px solid rgba(163, 59, 53, 0.34);
  color: var(--red);
  background: rgba(163, 59, 53, 0.07);
}

.certificate-list {
  display: grid;
  gap: 12px;
}

.certificate-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.certificate-card-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.card-name {
  font-size: 1.02rem;
}

.card-number {
  color: var(--gold-dark);
  font-weight: 850;
}

.card-email,
.card-collectible-serial,
.card-collectible-status,
.card-collectible-claimed {
  color: var(--muted);
  font-size: 0.84rem;
}

.card-url {
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.collectible-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.qr-pair {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.qr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.qr-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #666);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.collectible-qr-preview,
.certificate-qr-preview {
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.audit-log {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.72);
}

.audit-log summary {
  cursor: pointer;
  font-weight: 700;
}

.audit-log-content {
  margin: 10px 0 0;
  max-height: 160px;
  overflow: auto;
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.empty-state {
  margin: 22px 0 6px;
  color: var(--muted);
  text-align: center;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: min(920px, 100%);
}

.auth-document {
  position: relative;
  overflow: hidden;
  min-height: min(780px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 50px 74px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 253, 248, 0.94)),
    repeating-linear-gradient(45deg, rgba(167, 122, 49, 0.07) 0 1px, transparent 1px 14px),
    #fffdf8;
  box-shadow: var(--shadow);
}

.auth-document::before,
.auth-document::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px solid rgba(167, 122, 49, 0.28);
  border-radius: 8px;
  pointer-events: none;
}

.auth-document::after {
  inset: 32px;
  border-width: 1px;
  border-color: rgba(31, 122, 85, 0.2);
}

.seal-mark {
  position: absolute;
  top: 30px;
  right: 30px;
  border: 1px solid rgba(31, 122, 85, 0.34);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--green);
  background: rgba(31, 122, 85, 0.08);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-logo {
  width: 400px;
  height: 400px;
  max-width: 100%;
  object-fit: contain;
  margin-bottom: 4px;
}

.auth-document h1 {
  margin: 0;
  color: var(--gold-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.6rem;
  line-height: 1.05;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: keep-all;
}

.auth-document h2 {
  margin: 0;
  font-size: 2.2rem;
  line-height: 1.08;
}

.auth-statement {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.download-button {
  width: auto;
  min-width: min(100%, 280px);
  margin-top: 8px;
}

.collectible-section {
  width: min(100%, 640px);
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(31, 122, 85, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.collectible-section h3 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
}

.collectible-preview-image {
  width: min(100%, 460px);
  border: 1px solid rgba(167, 122, 49, 0.28);
  border-radius: 12px;
  background: #fff;
}

.collectible-line,
.collectible-helper,
.collectible-note {
  margin: 8px 0 0;
  color: var(--muted);
}

.collectible-claim-button,
.collectible-open-link {
  width: 100%;
  margin-top: 10px;
}

.claim-modal {
  width: min(460px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
}

.claim-modal::backdrop {
  background: rgba(15, 20, 24, 0.52);
}

.claim-modal-shell {
  padding: 18px;
}

.claim-modal-copy {
  margin: 4px 0 14px;
  color: var(--muted);
}

.collectible-page {
  display: grid;
  place-items: center;
  padding: 22px;
}

.collectible-shell {
  width: min(980px, 100%);
}

.collectible-card {
  padding: 20px;
}

.collectible-card h1 {
  margin: 0;
  font-size: 2.4rem;
  font-family: Georgia, "Times New Roman", serif;
}

.collectible-subtitle {
  margin: 10px 0 16px;
  color: var(--muted);
}

.collectible-hero {
  display: block;
  width: min(100%, 640px);
  height: auto;
  border: 1px solid rgba(167, 122, 49, 0.28);
  border-radius: 12px;
}

.collectible-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 14px;
}

.collectible-grid p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.collectible-brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.collectible-qr {
  width: 170px;
  height: 170px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.collectible-gss-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.collectible-donor-badge {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.collectible-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.missing-document {
  min-height: 520px;
}

.donors-page {
  padding: clamp(14px, 2.6vw, 28px) 16px 40px;
}

.donors-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.donors-header {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: clamp(14px, 2.6vw, 24px);
  margin-bottom: 18px;
}

.donors-gss-logo {
  width: min(200px, 100%);
  height: min(200px, 100%);
  object-fit: contain;
}

.donors-title {
  margin: 0;
  text-align: center;
  color: var(--gold-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 2.6vw, 2.15rem);
  letter-spacing: 0.02em;
}

.donors-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.donor-column {
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto minmax(260px, 1fr);
  gap: 10px;
}

.donor-column h2 {
  margin: 0;
  text-align: center;
  color: var(--gold-dark);
  font-size: 1.15rem;
}

.donor-column-badge {
  width: min(200px, 100%);
  height: min(200px, 100%);
  margin: 0 auto;
  object-fit: contain;
}

.donor-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  align-content: start;
}

.donor-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.donor-link {
  display: block;
  padding: 10px 12px;
  color: #214e78;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.donor-link:hover {
  text-decoration: underline;
}

.donor-item-empty {
  padding: 10px 12px;
  color: var(--muted);
  text-align: center;
}

.donors-footer {
  margin: 20px 0 0;
  text-align: center;
  color: var(--gold-dark);
  font-weight: 800;
  font-size: 1.05rem;
}

@media (max-width: 1120px) {
  .donors-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .admin-header h1 {
    font-size: 3rem;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .certificate-card {
    grid-template-columns: 1fr;
  }

  .card-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .card-actions > * {
    flex: 1 1 120px;
  }

  .collectible-grid {
    grid-template-columns: 1fr;
  }

  .donors-columns {
    grid-template-columns: 1fr;
  }

  .donor-column {
    grid-template-rows: auto auto auto;
  }
}

@media (max-width: 560px) {
  .admin-shell {
    width: min(100% - 20px, 1180px);
    padding: 20px 0;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-page {
    padding: 10px;
  }

  .auth-document {
    min-height: calc(100vh - 20px);
    padding: 86px 26px 38px;
  }

  .auth-logo {
    width: min(400px, calc(100vw - 72px));
    height: min(400px, calc(100vw - 72px));
  }

  .admin-header h1 {
    font-size: 2.35rem;
  }

  .auth-document h1 {
    font-size: 1.7rem;
  }

  .auth-document h2 {
    font-size: 1.55rem;
  }

  .auth-statement {
    font-size: 1rem;
  }

  .auth-document::before {
    inset: 10px;
  }

  .auth-document::after {
    inset: 22px;
  }

  .seal-mark {
    top: 24px;
    right: 24px;
  }

  .donors-page {
    padding: 10px 10px 24px;
  }

  .donors-header {
    margin-bottom: 12px;
    gap: 10px;
  }

  .donors-gss-logo,
  .donor-column-badge {
    width: min(150px, 100%);
    height: min(150px, 100%);
  }

  .donor-column {
    padding: 14px;
    gap: 8px;
  }

  .donor-column h2 {
    font-size: 1.02rem;
  }

  .donor-link,
  .donor-item-empty {
    padding: 10px;
  }

  .donors-footer {
    margin-top: 14px;
    font-size: 0.95rem;
  }
}

@media (max-width: 380px) {
  .auth-document h1 {
    font-size: 1.55rem;
  }
}
