:root {
  --maroon-900: #2a0a0f;
  --maroon-800: #3d0f17;
  --maroon-700: #561520;
  --gold: #f2b93b;
  --gold-soft: #ffd97a;
  --cream: #fff6e5;
  --ink: #2b1a14;
  --green: #2e9e6a;
  --red: #d1495b;
  --muted: #8c7a6b;
  --line: #ecdcc3;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(242, 185, 59, .18), transparent 38%),
    radial-gradient(circle at 90% 90%, rgba(242, 185, 59, .12), transparent 40%),
    linear-gradient(160deg, var(--maroon-900), var(--maroon-700));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 14px 40px;
}

header.brand {
  text-align: center;
  color: var(--cream);
  margin-bottom: 18px;
  max-width: 640px;
}

header.brand .diya {
  font-size: 40px;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(242, 185, 59, .7));
}

header.brand h1 {
  margin: 8px 0 2px;
  font-size: clamp(24px, 5vw, 34px);
  letter-spacing: .3px;
}

header.brand h1 span {
  color: var(--gold);
}

header.brand p {
  margin: 4px 0 0;
  color: #f3dcc0;
  font-size: 15px;
}

.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

.chip {
  background: rgba(255, 246, 229, .1);
  border: 1px solid rgba(242, 185, 59, .35);
  color: var(--gold-soft);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.card {
  background: var(--cream);
  width: 100%;
  max-width: 640px;
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  padding: 24px;
  border: 1px solid rgba(242, 185, 59, .4);
}

.card.wide {
  max-width: 1100px;
}

h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.sub {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 14px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin: 14px 0 6px;
}

input[type=text],
input[type=password],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 185, 59, .25);
}

textarea {
  resize: vertical;
  min-height: 70px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f5e8cf;
  padding: 6px;
  border-radius: 14px;
}

.tab {
  border: 0;
  background: transparent;
  padding: 12px 8px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  transition: .15s;
}

.tab[aria-selected=true].yes {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 12px rgba(46, 158, 106, .35);
}

.tab[aria-selected=true].no {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(209, 73, 91, .35);
}

.btn {
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  padding: 13px 20px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: var(--maroon-900);
  box-shadow: 0 6px 16px rgba(242, 185, 59, .35);
  transition: transform .1s, opacity .15s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.block {
  width: 100%;
  margin-top: 20px;
}

.btn.ghost {
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink);
  box-shadow: none;
  padding: 9px 14px;
  font-size: 14px;
}

.btn.danger {
  background: #fff;
  border: 1.5px solid var(--red);
  color: var(--red);
  box-shadow: none;
  padding: 9px 14px;
  font-size: 14px;
}

.btn.small {
  padding: 7px 11px;
  font-size: 13px;
}

.err {
  color: var(--red);
  font-size: 14px;
  margin-top: 10px;
  min-height: 18px;
}

.hidden {
  display: none !important;
}

.thanks {
  text-align: center;
  padding: 10px 0;
}

.thanks .big {
  font-size: 54px;
}

.thanks h2 {
  font-size: 24px;
}

.footer {
  margin-top: 22px;
  color: #e8cfae;
  font-size: 13px;
  text-align: center;
}

.footer a {
  color: var(--gold-soft);
  cursor: pointer;
  text-decoration: underline;
}

/* admin */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.stat .n {
  font-size: 30px;
  font-weight: 800;
}

.stat .l {
  font-size: 13px;
  color: var(--muted);
}

.stat.g .n {
  color: var(--green);
}

.stat.r .n {
  color: var(--red);
}

.stat.o .n {
  color: #b9831a;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 14px 0;
}

.toolbar input[type=text] {
  max-width: 260px;
  padding: 9px 12px;
  font-size: 14px;
}

.spacer {
  flex: 1;
}

.ftabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ftab {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
}

.ftab[aria-selected=true] {
  background: var(--maroon-800);
  border-color: var(--maroon-800);
  color: var(--gold-soft);
}

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 480px;
}

th, td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid #f1e6d2;
  vertical-align: top;
}

th {
  background: #f8ecd6;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #6b5646;
}

tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.yes {
  background: #dff5ea;
  color: #1c7a4e;
}

.pill.no {
  background: #fbe1e5;
  color: #b22f42;
}

.empty {
  text-align: center;
  padding: 30px;
  color: var(--muted);
}

.note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
  line-height: 1.5;
}

@media(max-width: 520px) {
  .card {
    padding: 18px;
  }
}
