@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,460;0,9..144,560;1,9..144,460&display=swap');

:root {
  color-scheme: light;
  --ink: #1b332c;
  --green: #1d463c;
  --green-deep: #16362e;
  --red: #9d3832;
  --gold: #b8924e;
  --ivory: #f6f1e6;
  --paper: #fffdf8;
  --muted: #6d7a70;
  --line: #e4ddcf;
  --shadow: 0 18px 50px rgba(28, 52, 42, 0.06);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(184, 146, 78, 0.16), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(29, 70, 60, 0.08), transparent 55%),
    var(--ivory);
  font: 16px/1.6 var(--sans);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button, a.primary { cursor: pointer; }
button, .primary {
  border: 1px solid #ddd4c4;
  border-radius: 999px;
  padding: 11px 18px;
  background: var(--paper);
  color: var(--green);
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(29, 70, 60, 0.08); }
button:disabled { opacity: .55; cursor: wait; transform: none; }
.primary { background: var(--red); border-color: var(--red); color: white; box-shadow: 0 10px 24px rgba(157, 56, 50, 0.18); }
button.quiet {
  border: 0;
  background: transparent;
  color: #8a5a4e;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  box-shadow: none;
}
button.quiet:hover { background: #f8efe8; transform: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(184, 146, 78, 0.45);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 16px max(4vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 253, 248, 0.86);
  border-bottom: 1px solid rgba(228, 221, 207, 0.9);
  box-shadow: 0 10px 30px rgba(28, 52, 42, 0.05);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 14px; font: 26px/1 var(--serif); }
.brand em { color: var(--red); font-style: italic; }
.brand small { display: block; margin-top: 6px; font: 600 9px/1 var(--sans); letter-spacing: 0.22em; color: var(--gold); }
.topbar nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.topbar nav a { color: var(--muted); }

main { max-width: 1280px; padding: 36px 28px 80px; margin: auto; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; color: #8d7a52; }
h1, h2, h3 { font-family: var(--serif); font-weight: 460; line-height: 1.12; color: var(--green-deep); }
h1 { font-size: clamp(34px, 4vw, 52px); margin: 8px 0 10px; letter-spacing: -0.03em; }
h2 { font-size: 32px; margin: 0; }
h3 { margin: 0 0 12px; font-size: 22px; }
p { color: var(--muted); }

#message, .notice {
  margin: 0 0 18px;
  border: 1px solid #ead3a4;
  background: #fff8ea;
  padding: 14px 18px;
  border-radius: 14px;
  color: #7a5620;
}

.login-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 680px;
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.welcome {
  position: relative;
  padding: 64px 56px;
  background:
    radial-gradient(420px 220px at 20% 100%, rgba(184, 146, 78, 0.28), transparent 70%),
    linear-gradient(165deg, #234e43, #16362e 70%);
  color: #f6efe2;
}
.welcome .eyebrow, .welcome p { color: #d9c7a4; }
.welcome h1 { color: #fffaf1; }
.welcome > p { max-width: 420px; font-size: 18px; }
.winter-art { margin: 56px 0 8px; display: flex; align-items: center; gap: 16px; color: #ead7b4; }
.winter-art span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(231, 201, 162, 0.8), transparent); }
.winter-art em { font: italic 20px/1.3 var(--serif); letter-spacing: 0; white-space: nowrap; }
.welcome-foot { font-size: 11px; letter-spacing: 0.18em; display: flex; gap: 16px; color: #eadcc0; }
.login-card { padding: 72px 56px; display: flex; flex-direction: column; justify-content: center; background: var(--paper); }
.login-card h2 { font-size: 40px; margin-bottom: 8px; }
.login-card > p { margin-top: 0; }
.login-card form { display: grid; gap: 18px; margin-top: 8px; }
.login-card form button { margin-top: 6px; min-height: 52px; }
.login-card > small { display: block; text-align: center; margin-top: 22px; color: #8b9288; font-size: 12px; }

label { display: block; font-size: 13px; font-weight: 600; color: #3e5249; }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  border: 1px solid #ddd4c4;
  border-radius: 12px;
  background: #fff;
  min-height: 48px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #b8924e; outline: none; box-shadow: 0 0 0 4px rgba(184, 146, 78, 0.16); }
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
  box-shadow: none;
}
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }

.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.dashboard-heading p { margin: 0; max-width: 460px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions button { font-size: 13px; }

.studio-tabs {
  display: flex;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  overflow: auto;
  margin: 0 0 26px;
  padding: 6px;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  scrollbar-width: none;
}
.studio-tabs::-webkit-scrollbar { display: none; }
.studio-tabs button {
  flex: none;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #5d6b63;
  padding: 10px 16px;
  white-space: nowrap;
}
.studio-tabs button:hover { transform: none; background: rgba(29, 70, 60, 0.05); }
.studio-tabs button.is-active { background: var(--green); color: #f7f1e4; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metric {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.metric::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.metric strong { display: block; margin: 10px 0 6px; font: 34px/1 var(--serif); letter-spacing: -0.03em; color: var(--green-deep); }
.metric small { display: block; font-size: 12.5px; color: var(--muted); }
.metric-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #8a7960; }
.metric:first-child { background: linear-gradient(160deg, #24584b, #16362e); border-color: transparent; color: #f6efe2; }
.metric:first-child strong, .metric:first-child .metric-label { color: #f8f1e4; }
.metric:first-child small { color: #d7c7aa; }
.metric:first-child::after { background: linear-gradient(90deg, #e7c98a, transparent); }

.operations {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  margin-top: 16px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.72);
}
.crew { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.crew span { padding: 10px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; }
.crew strong { font: 20px/1 var(--serif); margin-right: 6px; }
.fine { font-size: 12.5px; line-height: 1.7; }

.records, .studio-form .records {
  margin-top: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.records-heading { padding: 24px 26px 8px; display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; }
.records-heading p { margin: 8px 0 0; font-size: 14px; max-width: 560px; }
.records-heading label { width: min(280px, 100%); }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
th {
  position: sticky;
  top: 0;
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #f7f3ea;
  color: #746854;
}
td, th { padding: 16px 22px; border-bottom: 1px solid #efe8db; }
td { vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbf8f2; }
td strong, td small { display: block; }
td small { font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; background: #eef1e6; font-size: 12px; font-weight: 700; }
.badge.paid { color: #1f5b3a; background: #e3f0e4; }
.badge.pending { color: #8a5d1d; background: #fbf0d4; }
td button { font-size: 12px; padding: 8px 12px; }
.pagination { padding: 16px 22px 20px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
#empty, #food-empty, #stall-empty { padding: 36px; text-align: center; color: var(--muted); }

.studio-form { display: grid; gap: 18px; }
.studio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; padding: 8px 26px 26px; }
.studio-grid .wide { grid-column: 1 / -1; }
.stall-price { grid-template-columns: minmax(220px, 320px); padding-bottom: 8px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 0 26px 26px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.list-head h3 { margin: 0; }
.publish-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 16px 40px rgba(22, 54, 46, 0.12);
  backdrop-filter: blur(14px);
}
.publish-bar p { margin: 0; font-size: 14px; }
.access-copy { margin: 0; padding: 0 26px 22px; }
.stack { display: grid; gap: 10px; }
.split .stack { padding: 0; }
.edit-row, .field-card, .coupon-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.field-card {
  grid-template-columns: 1.4fr 0.8fr auto auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffaf3;
}
.field-card .stack { grid-column: 1 / -1; }
.field-card input, .field-card select, .edit-row input, .coupon-row input { margin-top: 0; }
.coupon-row {
  grid-template-columns: 72px 1fr auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.coupon-value {
  display: grid;
  place-items: center;
  height: 48px;
  border-radius: 12px;
  background: #1d463c;
  color: #f6efe2;
  font: 18px/1 var(--serif);
}
#food-editor, #affiliations, #custom-fields { padding: 8px 26px 26px; }

dialog {
  width: min(460px, 92vw);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 34px;
  text-align: center;
  color: var(--green);
  background: var(--paper);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(22, 54, 46, 0.55); backdrop-filter: blur(6px); }
.close { position: absolute; right: 12px; top: 10px; border: 0; background: none; font-size: 24px; }
#pass-qr svg { width: 210px; max-width: 100%; height: auto; }
#pass-details { white-space: pre-line; font-size: 14px; }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .login-layout, .operations, .studio-grid, .split, .field-card { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .metrics { grid-template-columns: 1fr; }
  .field-card { grid-template-columns: 1fr auto; }
  .field-card > input, .field-card > select, .field-card > .stack { grid-column: 1 / -1; }
  .dashboard-heading, .records-heading, .publish-bar { align-items: stretch; flex-direction: column; }
  .login-card, .welcome { padding: 36px 28px; }
  .welcome { min-height: 280px; }
  .winter-art em { white-space: normal; text-align: center; }
  .studio-tabs { width: 100%; }
  .coupon-row { grid-template-columns: 64px minmax(0, 1fr) auto; }
}
@media (max-width: 680px) {
  main { padding: 22px 14px 56px; }
  .topbar { padding: 14px; }
  .brand { font-size: 22px; }
  h1 { font-size: 36px; }
  .metric strong { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
