:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
  margin: 0;
  background: #fdf8e8;
  color: #2b2411;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background: #d8e24a;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

header h1 {
  margin: 0;
  font-size: 1.1rem;
}

header nav a {
  margin-right: 12px;
  color: #2b2411;
  text-decoration: none;
  font-weight: 600;
}

header nav a:hover {
  text-decoration: underline;
}

main {
  flex: 1;
  padding: 24px;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

h2 {
  margin-top: 0;
}

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  font-weight: 600;
  font-size: 0.9rem;
}

input,
select,
button {
  font-size: 1rem;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #c9c2a0;
}

button {
  background: #2b2411;
  color: #fdf8e8;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  opacity: 0.9;
}

button.secondary {
  background: transparent;
  color: #2b2411;
  border: 1px solid #2b2411;
}

.message {
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 0.9rem;
}

.message.error {
  background: #fde2e1;
  color: #8a1f1f;
}

.message.success {
  background: #e3f3d8;
  color: #2d5a1b;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

th,
td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #e3dcc0;
  font-size: 0.9rem;
}

#scan-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e3dcc0;
}

#scan-result .value {
  font-size: 1.8rem;
  font-weight: 700;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge.active {
  background: #e3f3d8;
  color: #2d5a1b;
}

.badge.used {
  background: #eee;
  color: #777;
}

#voucher-card .value {
  font-size: 2.4rem;
  font-weight: 700;
  margin: 8px 0;
}

.del-btn { padding: 4px 10px; background: #a33; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fdf8e8; color: #2b2411; padding: 20px; border-radius: 10px; max-width: 360px; width: 100%; }
.modal .row { display: flex; gap: 8px; margin-top: 12px; }
