:root {
  --bg: #f6fbf5;
  --card: #ffffff;
  --text: #16301a;
  --muted: #5f7263;
  --line: #d7e6d5;
  --accent: #459543;
  --accent-2: #377936;
  --danger: #fe0000;
  --warning: #b86f00;
  --accent-soft: #eef8ee;
  --danger-soft: #fff1f1;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #f7fcf6 0%, #eff8ef 100%);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.mobile-shell, .admin-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.mobile-narrow, .narrow { max-width: 760px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(32, 80, 34, 0.08);
}

.public-card { margin-top: 12px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.brand::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(254, 0, 0, 0.08);
}

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

.topbar nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.subtle, .note {
  color: var(--muted);
}

h1, h2, p { margin-top: 0; }

.form-grid {
  display: grid;
  gap: 16px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label span {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

input, select, textarea, button {
  width: 100%;
  font: inherit;
}

input, select, textarea {
  padding: 12px 14px;
  border: 1px solid #c6d8c4;
  border-radius: 12px;
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(69, 149, 67, 0.12);
}

button, .button-link {
  display: inline-block;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  color: white;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(69, 149, 67, 0.18);
}

.button-link-secondary {
  background: #edf5ec;
  color: var(--text);
  box-shadow: none;
}

.button-link:hover, button:hover {
  opacity: 0.96;
  text-decoration: none;
}

.alert {
  background: var(--danger-soft);
  color: #b10000;
  border: 1px solid #ffcaca;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.status-badge {
  display: inline-block;
  margin: 6px 0 16px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: capitalize;
}

.status-active { background: #e8f6e8; color: #1f6d24; }
.status-expired { background: #fff3d7; color: #9b5e00; }
.status-void { background: #ffe8e8; color: #ba0000; }
.status-claimed { background: #fff1f1; color: #ba0000; }

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: #3c5340;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
}

.qr-box {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  padding: 20px;
  border: 1px dashed #b7d0b5;
  border-radius: 16px;
  background: var(--accent-soft);
}

.qr-box img {
  max-width: 280px;
  width: 100%;
  height: auto;
}

.actions {
  margin-top: 20px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf7 100%);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  margin-top: 10px;
}

.status-form {
  display: flex;
  gap: 12px;
  align-items: center;
}

.status-form select {
  max-width: 220px;
}

.notes-box {
  margin-top: 18px;
  padding: 16px;
  background: #f8fcf8;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.url-wrap {
  word-break: break-all;
}

code {
  background: #edf5ec;
  padding: 2px 6px;
  border-radius: 6px;
}

@media (max-width: 860px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .topbar, .info-row, .section-head, .status-form {
    flex-direction: column;
    align-items: flex-start;
  }

  .two-col, .stats-grid {
    grid-template-columns: 1fr;
  }
}

.copy-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.button-small {
  width: auto;
  padding: 9px 12px;
  font-size: 14px;
}

.status-claimed { background: #fff1f1; color: #ba0000; }
.status-void { background: #fff1f1; color: #ba0000; }

@media (max-width: 640px) {
  .copy-row {
    justify-content: flex-start;
  }
}

.success {
  background: #eef8ee;
  color: #1f6d24;
  border: 1px solid #cbe4cb;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
}


.print-status {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f4f8f3;
  border: 1px solid var(--line);
  color: var(--text);
}

.print-error {
  background: #fff1f1;
  border-color: #ffcaca;
  color: #b10000;
}

.print-ok {
  background: #eef8ee;
  border-color: #cfe8ce;
  color: #1f6d24;
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
