:root {
  /* Watercolour garden in daylight: paper white, blush, sage, lilac and gold */
  --night-950: #f3f1e6; --night-900: #fdf7f2; --night-800: #fffdf9;
  --moss-700: #e8f0e2; --moss-600: #d6e4cd; --moss-500: #85a283; --moss-300: #5f7d62; --moss-200: #5f7d62;
  --gold: #d7b46f; --gold-bright: #c26d8a; --cream: #41573f; --blush: #f2a5ba; --lavender: #a992cf; --toadstool: #d88aa2;
  --muted: #7f9180; --line: rgba(215, 180, 111, 0.55); --border: rgba(215, 180, 111, 0.4);
  --panel: rgba(255, 253, 249, 0.92); --shadow: 0 20px 60px rgba(150, 110, 100, 0.14);
  --font-display: 'Cormorant Garamond', Georgia, serif; --font-body: 'Quicksand', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body); font-size: 15px; line-height: 1.55; color: var(--cream);
  background:
    radial-gradient(1000px 600px at 80% -10%, rgba(247, 195, 207, 0.3), transparent 60%),
    radial-gradient(800px 500px at 0% 60%, rgba(188, 214, 236, 0.28), transparent 60%),
    linear-gradient(180deg, var(--night-800), var(--night-900) 60%, var(--night-950));
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; line-height: 1.15; }
h1 { font-size: 2rem; font-style: italic; }
h2 { font-size: 1.35rem; color: var(--gold-bright); margin-bottom: 0.7rem; }
p { margin: 0 0 0.6rem; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }
code { font-size: 0.85em; background: rgba(65,87,63,0.08); padding: 0.1em 0.4em; border-radius: 6px; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.plain { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; border-radius: 6px; }

/* ---- shared controls ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.6rem 1.15rem; border-radius: 999px; border: 1px solid transparent; font-weight: 700; letter-spacing: 0.02em; transition: transform 0.25s, box-shadow 0.25s, background 0.25s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn--gold { background: linear-gradient(180deg, #fde3e9, #f8c9d4); color: #c26d8a; border-color: var(--gold); box-shadow: 0 8px 24px rgba(242,165,186,0.28); }
.btn--ghost { background: #fff; border-color: var(--border); color: var(--cream); }
.btn--ghost:hover { background: #fde9ee; color: var(--cream); border-color: var(--blush); }
.btn--danger { background: #fde9ee; border-color: rgba(216,138,162,0.5); color: #a84e6c; }
.btn--sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn--wa { background: #25d366; color: #05311a; }
.btn[disabled] { opacity: 0.55; cursor: wait; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: #fff; font-size: 1.2rem; line-height: 1; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field > span { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; color: var(--moss-200); }
.field input, .field textarea, .field select, .search {
  width: 100%; padding: 0.65rem 0.85rem; border-radius: 12px; border: 1px solid var(--border);
  background: #fff; color: var(--cream); transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus, .field select:focus, .search:focus { outline: none; border-color: var(--blush); box-shadow: 0 0 0 3px rgba(242,165,186,0.2); }
.field textarea { resize: vertical; }
.field--full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; color: var(--moss-200); }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.form-error { color: #a84e6c; background: #fde9ee; border: 1px solid rgba(216,138,162,0.5); padding: 0.6rem 0.9rem; border-radius: 10px; font-size: 0.9rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

/* ---- login ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login__card { width: min(400px, 100%); padding: 2rem; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.9rem; text-align: center; }
.login__art { font-size: 2.4rem; }
.login__card h1 { color: var(--gold-bright); }
.login__card .field { text-align: left; }

/* ---- layout ---- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 1.4rem 1rem; background: rgba(255,253,249,0.85); border-right: 1px solid var(--border); backdrop-filter: blur(10px); }
.side__brand { font-family: var(--font-display); font-size: 1.35rem; color: var(--cream); padding: 0.4rem 0.6rem 1.2rem; }
.side__brand span { color: var(--blush); font-size: 0.9rem; }
.side__brand i { color: var(--gold); font-size: 1rem; }
.side__nav { display: flex; flex-direction: column; gap: 0.25rem; }
.side__link { text-align: left; padding: 0.7rem 0.8rem; border-radius: 12px; border: 0; background: transparent; color: var(--moss-200); font-weight: 600; transition: background 0.2s, color 0.2s; }
.side__link:hover { background: rgba(65,87,63,0.06); color: var(--cream); }
.side__link.is-active { background: #fde9ee; color: #c26d8a; }
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.3rem; }
.side__mini { text-align: left; padding: 0.5rem 0.8rem; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.side__mini:hover { color: var(--gold-bright); background: rgba(65,87,63,0.05); }
.content { padding: 1.6rem clamp(1rem, 3vw, 2.4rem) 4rem; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.2rem; margin-bottom: 1.2rem; }
.page-head h1 { color: var(--cream); }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.banner { padding: 0.7rem 1rem; border-radius: 12px; background: #fff6e3; border: 1px solid var(--line); color: #8a6a2a; margin-bottom: 1rem; font-size: 0.9rem; }
.banner--info { background: #f0f5fb; border-color: rgba(143,182,217,0.5); color: var(--moss-200); }
.panel { padding: 1.2rem 1.3rem; border-radius: 18px; background: var(--panel); border: 1px solid var(--border); box-shadow: 0 10px 40px rgba(150,110,100,0.1); margin-bottom: 1.1rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.8rem; }
  .side__brand { padding: 0.3rem 0.5rem; width: 100%; }
  .side__nav { flex-direction: row; flex-wrap: wrap; }
  .side__link { padding: 0.45rem 0.7rem; font-size: 0.85rem; }
  .side__foot { margin-top: 0; flex-direction: row; margin-left: auto; }
}

/* ---- tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; margin-bottom: 1.1rem; }
.tile { padding: 1rem 1.1rem; border-radius: 16px; background: #fff; border: 1px solid var(--border); }
.tile__num { font-family: var(--font-display); font-size: 2.3rem; font-weight: 600; line-height: 1; color: var(--cream); }
.tile__label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; margin-top: 0.3rem; }
.tile--hero { background: linear-gradient(135deg, #fde9ee, #f9c9d5 60%, #f2a5ba); border-color: transparent; }
.tile--hero .tile__num, .tile--hero .tile__label { color: #8a4a62; }
.bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: #eef2ea; margin: 0.5rem 0 0.7rem; }
.bar span { height: 100%; transition: width 0.6s ease; }
.bar .b-att { background: var(--blush); }
.bar .b-dec { background: var(--lavender); }
.bar .b-pen { background: #d6e4cd; }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.35rem; vertical-align: middle; }
.recent { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.recent:last-child { border-bottom: 0; }
.dietary-item { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.dietary-item:last-child { border-bottom: 0; }

/* ---- guests ---- */
.toolbar { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; margin-bottom: 0.9rem; }
.search { flex: 1 1 260px; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip { padding: 0.35rem 0.8rem; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.chip.is-active { background: #fde9ee; border-color: var(--blush); color: #c26d8a; }
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--border); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--border); }
.table td { padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fff8f9; }
.g-name { font-weight: 700; color: var(--cream); }
.g-sub { color: var(--muted); font-size: 0.82rem; }
.g-tag { display: inline-block; margin-top: 0.2rem; font-size: 0.7rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: #efe9f8; color: var(--lavender); }
.status { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.status--attending { background: #fde9ee; color: #c26d8a; }
.status--declined { background: #efe9f8; color: var(--lavender); }
.status--pending { background: #eef2ea; color: var(--muted); }
.row-actions { display: flex; gap: 0.3rem; justify-content: flex-end; flex-wrap: wrap; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }
.note { font-size: 0.82rem; color: var(--moss-200); margin-top: 0.2rem; white-space: pre-wrap; }

/* ---- wishes ---- */
.wishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.8rem; }
.wish-row { padding: 1rem 1.1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.5rem; }
.wish-row.is-hidden { opacity: 0.55; }
.wish-row blockquote { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-style: italic; }
.wish-row .meta { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--muted); }

/* ---- settings ---- */
.settings .field { margin-bottom: 0.8rem; }
.settings .grid2 .field { margin-bottom: 0; }
.save-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 1rem; padding: 0.9rem 0; background: linear-gradient(180deg, transparent, #fdf7f2 40%); }

/* ---- drawer ---- */
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(65,87,63,0.35); backdrop-filter: blur(4px); }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: #fffdf9; border-left: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--border); }
.drawer__head h2 { margin: 0; color: var(--gold-bright); font-size: 1.5rem; font-style: italic; }
.drawer__body { padding: 1.2rem 1.3rem 2rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.drawer__body .field { margin-bottom: 0.2rem; }
.share { display: grid; gap: 0.6rem; }
.share__link { display: flex; gap: 0.5rem; align-items: center; }
.share__link input { flex: 1; }
.share__row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.qr { width: 180px; height: 180px; border-radius: 14px; overflow: hidden; background: #fff; padding: 8px; margin: 0.3rem auto; }
.qr svg { width: 100%; height: 100%; display: block; }
.preview { white-space: pre-wrap; font-size: 0.86rem; padding: 0.8rem 0.9rem; border-radius: 12px; background: #fff; border: 1px dashed var(--border); color: var(--moss-200); max-height: 200px; overflow: auto; }
.sub-h { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); font-weight: 700; margin: 0.4rem 0 0.2rem; }
.drawer-actions { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; z-index: 200; transform: translate(-50%, 20px); padding: 0.7rem 1.2rem; border-radius: 999px; background: #41573f; color: #fff; font-weight: 600; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transition: opacity 0.3s, transform 0.4s, visibility 0.3s; max-width: 90vw; text-align: center; }
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
