:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #2b2620;
  --muted: #8a8178;
  --accent: #7a5c3e;
  --accent-2: #a9835f;
  --ok: #2e7d32;
  --err: #c62828;
  --warn: #ef6c00;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(60, 45, 30, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 20px 16px 60px; }
.wrap.narrow { max-width: 480px; }
h1 { font-size: 1.5rem; margin: 0 0 .3rem; }
h2 { font-size: 1.15rem; margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
code { background: #efe9e0; padding: .1em .35em; border-radius: 6px; font-size: .85em; }
ul.plain { list-style: none; padding-left: 0; margin: .4rem 0; }
ul.plain li { padding: .15rem 0; }

/* Flash messages */
.flash-stack { position: sticky; top: 0; z-index: 50; display: grid; gap: 6px; padding: 8px 12px 0; }
.flash { padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow); font-size: .92rem; }
.flash-success { background: #e8f5e9; color: var(--ok); }
.flash-error { background: #fdecea; color: var(--err); }
.flash-warn { background: #fff3e0; color: var(--warn); }

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 16px;
}
.hero h1 { font-size: 1.8rem; }
.room-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }

/* Buttons */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font: inherit; border-radius: 12px; padding: 10px 16px; transition: .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-2); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: #f1e8dd; }
.btn-danger { background: #fdecea; color: var(--err); }
.btn-big { width: 100%; padding: 15px; font-size: 1.05rem; font-weight: 600; margin-top: 10px; }
.btn-sm { padding: 5px 9px; font-size: .85rem; border-radius: 9px; }

/* Room header */
.room-header { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.room-badge {
  min-width: 58px; height: 58px; border-radius: 16px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 1.4rem; font-weight: 700;
}

/* Product grid */
.grid {
  display: grid; gap: 12px; margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.product-card {
  position: relative;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer;
  border: 2.5px solid transparent; transition: .15s;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-2px); }
.product-card.selected { border-color: var(--accent); }
.product-card img, .product-card .ph {
  width: 100%; height: 96px; object-fit: cover; display: block;
  background: linear-gradient(135deg, #efe6da, #e3d5c3);
}
.product-card .ph { display: grid; place-items: center; font-size: 2.2rem; }
.p-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.p-body small { color: var(--muted); }
.price { font-weight: 700; color: var(--accent); margin-top: auto; }
.check {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.85); color: transparent;
  display: grid; place-items: center; font-weight: 700;
  border: 2px solid #d8cfc4; transition: .15s;
}
.product-card.selected .check { background: var(--accent); color: #fff; border-color: var(--accent); }
.qty-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; padding: 0 10px 10px;
}
.qty-btn {
  width: 30px; height: 30px; border-radius: 9px; border: 1.5px solid var(--accent);
  background: #fff; color: var(--accent); font-size: 1.1rem; cursor: pointer;
}
.qty-input {
  width: 46px; text-align: center; border: 0; font: inherit; background: transparent;
  -moz-appearance: textfield; appearance: textfield;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px;
  padding: 0; border: 0; clip: rect(0 0 0 0); overflow: hidden;
}

/* Extras / summary */
.extras label { display: block; margin: 8px 0; font-size: .9rem; color: var(--muted); }
.extras input, .extras textarea, .prod-form input, .prod-form textarea {
  width: 100%; font: inherit; color: var(--ink);
  border: 1.5px solid #ddd3c7; border-radius: 10px; padding: 9px 11px; margin-top: 4px;
  background: #fdfbf8;
}
.summary {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px dashed #ddd3c7; margin-top: 10px; padding-top: 10px; font-weight: 600;
}
.warn-note { font-size: .82rem; color: var(--warn); margin: 8px 0 0; }
.empty { text-align: center; }

/* Done page */
.done-card { text-align: center; padding: 34px 22px; }
.done-emoji { font-size: 3rem; }

/* Admin */
.admin-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 18px; margin-top: 4px;
}
.admin-nav .brand { font-weight: 700; text-decoration: none; color: var(--ink); }
.admin-nav .links a { margin-left: 14px; color: var(--accent); text-decoration: none; font-weight: 500; }
.admin-nav .links a:hover { text-decoration: underline; }
.frow { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; margin: 8px 0; }
.frow label { flex: 1; min-width: 160px; font-size: .9rem; color: var(--muted); }
.prod-form label { display: block; margin: 8px 0; font-size: .9rem; color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .8rem; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid #eee4d8; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid #f0e9df; vertical-align: top; }
.tbl tr.inactive { opacity: .5; }
.actions { display: flex; gap: 6px; align-items: center; }
.actions form { margin: 0; }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; }
.ph-sm { font-size: 1.6rem; }
.qr { margin-top: 6px; border-radius: 8px; background: #fff; }

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
