:root {
  --bg: #f7f3ec;
  --paper: #fffdf9;
  --ink: #2a2521;
  --muted: #6f655c;
  --line: #e6ddd0;
  --accent: #2f5d50;
  --accent-ink: #fff;
  --amber: #b86b1f;
  --wa: #1f9d55;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(42, 37, 33, .06), 0 6px 20px rgba(42, 37, 33, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }

/* Hero */
.hero { background: var(--paper); border-bottom: 1px solid var(--line); padding: 44px 0 36px; margin-bottom: 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--accent); font-weight: 700; margin: 0 0 8px; }
.hero h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; font-size: clamp(1.8rem, 4.5vw, 2.8rem); max-width: 22ch; }
.badge { display: inline-block; margin: 18px 0 6px; padding: 8px 14px; border-radius: 999px; background: #e9f1ed; color: var(--accent); font-weight: 650; }
.intro { max-width: 62ch; color: #3f3832; }
.intro p { margin: 12px 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(.95); }
.btn:disabled { opacity: .6; cursor: default; }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-danger { background: #a33a2b; color: #fff; }
.btn-sm { padding: 8px 12px; font-size: .92rem; }
.hero .btn-wa { margin-top: 8px; }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.howto { color: var(--muted); margin: 4px 0 20px; font-size: .95rem; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* Grid & Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h2 { font-size: 1.15rem; }
.desc { margin: 0; color: #4a423b; font-size: .96rem; }
.actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn-primary { width: 100%; }
.status { color: var(--muted); font-weight: 600; }
.card[data-state="reserved"]:not(.mine) .gallery img,
.card[data-state="gone"] .gallery img { filter: grayscale(.6) opacity(.7); }
.card.mine { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(47, 93, 80, .25), var(--shadow); }
body.only-free .card:not([data-state="free"]):not(.mine) { display: none; }

/* Galerie */
.gallery { position: relative; aspect-ratio: 4 / 3; background: #ece5da; }
.slides { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slides img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; cursor: zoom-in; display: block; }
.noimg { height: 100%; display: grid; place-items: center; color: var(--muted); }
.nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .88); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
.nav.prev { left: 10px; } .nav.next { right: 10px; }
.counter { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .8rem; padding: 2px 8px; border-radius: 999px; }
.flag:empty { display: none; }
.flag { position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--amber); color: #fff; }
.card.mine .flag { background: var(--accent); }
.card[data-state="gone"] .flag { background: #5b544e; }

/* Dialoge */
dialog { border: 0; border-radius: var(--radius); padding: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); max-width: min(440px, calc(100vw - 32px)); width: 100%; }
dialog::backdrop { background: rgba(30, 26, 22, .55); }
dialog form { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
dialog h3 { font-size: 1.15rem; margin-bottom: 4px; }
dialog label { font-weight: 600; font-size: .92rem; }
input[type=text], input[type=password], input:not([type]), textarea, input[type=number] {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid rgba(47, 93, 80, .35); border-color: var(--accent); }
.hint { font-size: .86rem; color: var(--muted); margin: 0; }
.err { color: #a33a2b; margin: 0; font-weight: 600; }
.row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.lightbox { max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgba(15, 13, 11, .94); border-radius: 0; }
.lightbox img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lb-close, .lb-nav { position: absolute; border: 0; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; border-radius: 50%; width: 46px; height: 46px; font-size: 1.8rem; line-height: 1; }
.lb-close { top: 14px; right: 14px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lightbox.single .lb-nav { display: none; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; transition: .25s; max-width: calc(100vw - 32px); z-index: 10;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot { color: var(--muted); font-size: .86rem; padding-top: 36px; padding-bottom: 40px; }

/* ---------- Admin ---------- */
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 22px 0; }
.admin-top h1 { font-size: 1.4rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 22px; box-shadow: var(--shadow); }
.stats { display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); }
.stats b { color: var(--ink); font-size: 1.3rem; display: block; }
.alist { display: flex; flex-direction: column; gap: 12px; }
.arow { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.arow img, .arow .noimg { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: #ece5da; font-size: .75rem; }
.arow h3 { font-size: 1rem; }
.arow .meta { font-size: .88rem; color: var(--muted); }
.arow .res { color: var(--amber); font-weight: 700; }
.arow.gone { opacity: .6; }
.arow.hidden-item { border-style: dashed; }
.arow .btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.arow form { display: inline; margin: 0; }
.inline-res { display: flex; gap: 6px; margin-top: 6px; }
.inline-res input { padding: 6px 10px; max-width: 200px; }
@media (max-width: 640px) {
  .arow { grid-template-columns: 72px 1fr; }
  .arow img, .arow .noimg { width: 72px; height: 56px; }
  .arow .btns { grid-column: 1 / -1; justify-content: flex-start; }
}
.form-grid { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.form-grid label { font-weight: 600; font-size: .92rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { position: relative; }
.thumb img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; display: block; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; }
.thumb .cover { position: absolute; left: 4px; bottom: 4px; font-size: .7rem; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 999px; }
.thumb .mk { position: absolute; left: 4px; bottom: 4px; font-size: .7rem; border: 0; background: rgba(0,0,0,.6); color: #fff; padding: 2px 6px; border-radius: 999px; cursor: pointer; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); }
.progress { font-size: .9rem; color: var(--accent); font-weight: 600; }
table.log { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.log td, table.log th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.login { max-width: 360px; margin: 12vh auto; }
.flash { background: #e9f1ed; color: var(--accent); padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
