@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #232326;
  --ink-soft: #55565f;
  --paper: #f6f4ef;
  --panel: #ffffff;
  --line: #dfdccf;
  --navy: #1f2a44;
  --navy-deep: #141b2e;
  --gold: #b9873c;
  --gold-soft: #e8d4ad;
  --good: #3f6b4f;
  --warn: #a4472f;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(20, 27, 46, 0.06), 0 6px 20px rgba(20, 27, 46, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, .display {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  color: var(--navy-deep);
  letter-spacing: -0.01em;
}

a { color: var(--navy); }
a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.wrap.wide { max-width: 980px; }

/* ---------- Top bar (admin) ---------- */
.topbar {
  background: var(--navy-deep);
  color: #f2efe6;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-logo {
  height: 32px;
  width: auto;
}
.topbar .brand span { color: var(--gold-soft); }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.topbar-actions a {
  color: #f2efe6;
  font-size: 0.85rem;
  text-decoration: none;
  opacity: 0.85;
}
.topbar-actions a:hover { opacity: 1; text-decoration: underline; }
.topbar form { margin: 0; }
.topbar button {
  background: transparent;
  border: 1px solid rgba(242,239,230,0.35);
  color: #f2efe6;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
}
.topbar button:hover { background: rgba(242,239,230,0.1); }

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 6px;
}

/* ---------- Forms ---------- */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin: 18px 0 6px;
}
label:first-child { margin-top: 0; }

input[type="text"],
input[type="email"],
input[type="date"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  background: #fffdf9;
  color: var(--ink);
}

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

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
}
.checkbox-row input { width: 18px; height: 18px; margin-top: 3px; }
.checkbox-row label { margin: 0; font-weight: 400; color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--navy); color: #fdfcf9; }
.btn-primary:hover { background: var(--navy-deep); }
.btn-gold { background: var(--gold); color: #211705; }
.btn-gold:hover { background: #a67a35; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--navy); }
.btn-danger { background: transparent; border-color: var(--warn); color: var(--warn); }
.btn-danger:hover { background: var(--warn); color: #fdfcf9; }
.btn-row { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

/* ---------- Status badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-draft { background: #e9e6dc; color: var(--ink-soft); }
.badge-sent { background: #dde6f0; color: var(--navy); }
.badge-viewed { background: var(--gold-soft); color: #6a4d1c; }
.badge-accepted { background: #dcead6; color: var(--good); }
.badge-expired { background: #f2ded7; color: var(--warn); }
.badge-cancelled { background: #e6e2e8; color: var(--ink-soft); }
.badge-rejected { background: #f6e4de; color: var(--warn); }

/* ---------- Dashboard table ---------- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  vertical-align: middle;
}
tr:hover td { background: #fbfaf6; }
td a { text-decoration: none; font-weight: 500; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

/* ---------- Offer letter presentation ---------- */
.letterhead {
  text-align: center;
  padding-bottom: 22px;
  margin-bottom: 26px;
  border-bottom: 3px solid var(--gold);
}
.letterhead-logo {
  width: 90px;
  height: auto;
  margin-bottom: 14px;
}
.letterhead .festival {
  font-size: 1.6rem;
}
.letterhead .org {
  color: var(--ink-soft);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

.terms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 28px;
  margin: 22px 0;
}
@media (max-width: 640px) {
  .terms-grid { grid-template-columns: 1fr; }
}
.term dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 3px;
}
.term dd {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 500;
}

.signature-block {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.notice {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.notice-error { background: #f6e4de; color: var(--warn); border: 1px solid #e3bba9; }
.notice-info { background: #eaf0e9; color: var(--good); border: 1px solid #c3d9c4; }

.helptext { color: var(--ink-soft); font-size: 0.85rem; margin-top: 4px; }

.center { text-align: center; }
.mt-0 { margin-top: 0; }

/* ---------- App footer (version marker) ---------- */
.app-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.75rem;
  opacity: 0.7;
  padding: 20px 24px 40px;
}

/* ---------- Activity history ---------- */
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.history-list li {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.history-list li:last-child { border-bottom: none; }
.history-time {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 0.8rem;
  white-space: nowrap;
  min-width: 150px;
}
.history-desc { color: var(--ink); }
