:root {
  --bg: #fbf6ee;
  --surface: #ffffff;
  --ink: #2a1a14;
  --muted: #7a6559;
  --line: #ecdfd0;
  --maroon: #8e1f2f;
  --maroon-dark: #6d1522;
  --marigold: #f2a516;
  --marigold-soft: #fff1d3;
  --ok: #1f7a4d;   --ok-soft: #e3f4ea;
  --warn: #9a5b00; --warn-soft: #fff1d3;
  --bad: #b3261e;  --bad-soft: #fde7e5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60,30,10,.06), 0 8px 24px rgba(60,30,10,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.55 "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; line-height: 1.2; margin: 0 0 .5em; }
a { color: var(--maroon); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 28px; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.opt { color: var(--muted); font-weight: 400; font-size: 12px; }

/* ---------- top bar ---------- */
.topbar { background: var(--maroon); color: #fff; border-bottom: 4px solid var(--marigold); }
.area-admin .topbar { background: #2a1a14; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.logo { width: 44px; height: 44px; border-radius: 50%; object-fit: contain; background: #fff8ec; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: "Fraunces", serif; font-size: 17px; }
.brand-text small { opacity: .8; font-size: 12px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav a { color: #fff; text-decoration: none; padding: 7px 11px; border-radius: 8px; font-weight: 500; font-size: 14px; opacity: .88; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.14); opacity: 1; }
.nav a.nav-out { border: 1px solid rgba(255,255,255,.35); }
.nav-hello { opacity: .8; font-size: 14px; margin-right: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 14px/1.2 "Inter", sans-serif;
  cursor: pointer; text-decoration: none; transition: background .15s, transform .05s;
}
.btn:hover { background: #f6eee4; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-dark); }
.btn-ghost { background: transparent; }
.btn-danger-ghost { background: transparent; color: var(--bad); border-color: #f1c3be; }
.btn-danger-ghost:hover { background: var(--bad-soft); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }

/* ---------- alerts ---------- */
.alert { padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; font-weight: 500; }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--bad-soft); color: var(--bad); }
.alert-info { background: var(--marigold-soft); color: var(--warn); }
.alert-big { font-size: 18px; text-align: center; padding: 18px; font-family: "Fraunces", serif; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input, textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: 15px "Inter", sans-serif; background: #fffdf9; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--marigold); outline-offset: 1px; border-color: var(--marigold); }
input[type=checkbox] { width: auto; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checks { display: grid; gap: 8px; align-content: end; }
.form .check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.form-actions { display: flex; gap: 10px; }
.inline-form { grid-template-columns: 1fr auto; }

.auth-card { max-width: 480px; margin: 0 auto; background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); border-top: 4px solid var(--marigold); }
.switch { text-align: center; margin: 16px 0 0; }

/* ---------- hero ---------- */
.hero { background: var(--surface); border-radius: 20px; padding: 40px 32px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: "✿ ✿ ✿"; position: absolute; right: 24px; top: 18px; color: var(--marigold); letter-spacing: 8px; opacity: .5; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); color: var(--maroon); }
.lead { font-size: 17px; max-width: 620px; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 600; color: var(--warn); margin: 0 0 8px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 28px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { background: var(--bg); border-radius: 12px; padding: 14px; display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: 14px; }
.steps span { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--marigold); color: var(--maroon); font-weight: 700; display: grid; place-items: center; }
.section-title { margin: 36px 0 16px; }
.page-title { font-size: 30px; }

/* ---------- gifts ---------- */
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-top: 18px; }
.gift-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.gift-img { aspect-ratio: 4/3; background: var(--marigold-soft); display: grid; place-items: center; font-size: 56px; }
.gift-img img { width: 100%; height: 100%; object-fit: cover; }
.gift-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.gift-body h3 { font-size: 18px; margin: 0; }
.gift-body p { margin: 0; color: var(--muted); font-size: 14px; }
.gift-body form, .gift-body > .btn { margin-top: auto; }
.gift-card.is-out { opacity: .6; }
.stock-low { color: var(--warn) !important; font-weight: 600; font-size: 13px !important; }

.profile-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: var(--surface); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 24px; }
.profile-strip .label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.chosen { display: grid; grid-template-columns: 340px 1fr; gap: 28px; background: var(--surface); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); border: 2px solid var(--marigold); }
.chosen-img { background: var(--marigold-soft); display: grid; place-items: center; font-size: 90px; min-height: 260px; }
.chosen-img img { width: 100%; height: 100%; object-fit: cover; }
.chosen-body { padding: 28px 28px 28px 0; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.chosen-body h1 { font-size: 32px; color: var(--maroon); margin: 0; }
.status { font-weight: 600; padding: 10px 14px; border-radius: 10px; margin: 8px 0 0; }
.status-pending { background: var(--marigold-soft); color: var(--warn); }
.status-done { background: var(--ok-soft); color: var(--ok); }
.chosen form { margin-top: 12px; }
.empty { background: var(--surface); padding: 40px; border-radius: var(--radius); text-align: center; color: var(--muted); }

/* ---------- admin ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; border-left: 4px solid var(--marigold); }
.stat-n { font-family: "Fraunces", serif; font-size: 32px; font-weight: 700; color: var(--maroon); }
.stat-l { color: var(--muted); font-size: 13px; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.panel h2 { font-size: 20px; }
.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel-row .panel { margin-bottom: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search input, .search select { width: auto; min-width: 160px; padding: 7px 10px; font-size: 14px; }
.txt-ok { color: var(--ok); } .txt-bad { color: var(--bad); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: #fffaf2; }
td.thumb { width: 56px; font-size: 28px; }
td.thumb img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; display: block; }
td.actions { white-space: nowrap; }
td.actions form, td.actions .btn, td.actions details { display: inline-block; margin: 0 4px 4px 0; vertical-align: top; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-off { background: #f1ebe4; color: var(--muted); }

details.pop { position: relative; }
details.pop summary { list-style: none; }
details.pop summary::-webkit-details-marker { display: none; }
.pop-body { position: absolute; z-index: 5; right: 0; top: 36px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 10px; border-radius: 10px; display: flex; gap: 6px; width: 260px; }
.pop-body input { padding: 6px 8px; font-size: 13px; }

code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.footer { padding: 20px 0; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); text-align: center; }

/* ---------- banner ---------- */
.main-flush { padding-top: 0; }
.flash-wrap { padding-top: 16px; }
.banner { background: #8e1f2f center / cover no-repeat; min-height: 460px; display: flex; }
.banner-overlay { flex: 1; display: flex; align-items: center;
  background: linear-gradient(90deg, rgba(40,6,12,.82) 0%, rgba(40,6,12,.55) 45%, rgba(40,6,12,.05) 80%); }
.banner-inner { padding-top: 48px; padding-bottom: 72px; color: #fff; }
.banner-logo { width: 84px; height: 84px; border-radius: 50%; object-fit: contain; background: #fff8ec; box-shadow: 0 4px 18px rgba(0,0,0,.35); margin-bottom: 14px; }
.banner h1 { font-size: clamp(30px, 5vw, 52px); max-width: 640px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.banner-sub { font-size: 17px; max-width: 560px; opacity: .92; margin: 0; }
.eyebrow-light { color: var(--marigold); }
.btn-gold { background: var(--marigold); border-color: var(--marigold); color: #3a0912; }
.btn-gold:hover { background: #ffb933; }
.btn-light { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.55); color: #fff; }
.btn-light:hover { background: rgba(255,255,255,.22); }
.steps-float { margin-top: -38px; position: relative; }
.steps-float li { background: var(--surface); box-shadow: var(--shadow); }
.mini-banner { background: #8e1f2f center / cover no-repeat; border-radius: 20px; overflow: hidden; margin-bottom: 18px; }
.mini-banner-overlay { padding: 34px 28px; background: linear-gradient(90deg, rgba(40,6,12,.82), rgba(40,6,12,.2)); color: #fff; }
.mini-banner h1 { color: #fff; margin: 0; font-size: 30px; }
.banner-thumb { width: 100%; aspect-ratio: 1920/700; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 12px; }
.banner-preview { background: center / cover no-repeat; border-radius: 12px; aspect-ratio: 1920/600; display: flex; align-items: center; overflow: hidden; }
.banner-preview-text { padding: 20px 26px; color: #fff; display: grid; gap: 6px; max-width: 60%;
  background: linear-gradient(90deg, rgba(40,6,12,.85), rgba(40,6,12,0)); height: 100%; align-content: center; }
.banner-preview-text strong { font-family: "Fraunces", serif; font-size: 22px; }
.banner-preview-text span { font-size: 13px; opacity: .9; }
.logo-preview-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 96px; height: 96px; border-radius: 16px; background: var(--bg); display: grid; place-items: center; border: 1px solid var(--line); }
.logo-preview img { width: 76px; height: 76px; object-fit: contain; }
.logo-on-dark { background: var(--maroon); }

/* ---------- mobile ---------- */
@media (max-width: 800px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .panel-row, .row-2, .steps, .profile-strip { grid-template-columns: 1fr; }
  .chosen { grid-template-columns: 1fr; }
  .chosen-body { padding: 0 20px 24px; }
  .hero { padding: 28px 20px; }
  .auth-card { padding: 22px 18px; }
  .banner { min-height: 420px; }
  .banner-overlay { background: linear-gradient(180deg, rgba(40,6,12,.55), rgba(40,6,12,.85)); }
  .banner-preview-text { max-width: 100%; }
  .steps-float { margin-top: -28px; }
}
.mini-banner .eyebrow { color: var(--marigold); }
