:root {
  --bg: #f4f1ea;
  --paper: #fffcf8;
  --ink: #1c2430;
  --muted: #5d6672;
  --line: #e4ddd2;
  --pine: #0f7a5a;
  --pine-dark: #0c5c44;
  --danger: #8d2f2f;
  --ok-bg: #e5f5ee;
  --warn-bg: #f8efd8;
  --warn: #8a5a12;
  --side: #1b2330;
  --top: 64px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--pine); }
:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
button, .button {
  font: inherit;
  background: var(--pine);
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:hover, .button:hover { background: var(--pine-dark); }
.button.secondary, .ghost {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}
.button.secondary:hover, .ghost:hover { background: #f7f4ee; }
.button.is-disabled {
  background: #e7e2d9;
  color: var(--muted);
  cursor: default;
}
.danger { background: var(--danger); color: white; border: 0; }
.danger:hover { background: #6f2424; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app { min-height: 100vh; }
.topbar {
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-size: 18px;
  flex: 0 0 auto;
}
.brand em { font-style: normal; color: var(--pine); }
.property-switch { margin-left: 8px; }
.property-switch select, .property-name {
  width: auto;
  min-width: 180px;
  max-width: 280px;
  margin: 0;
  border-radius: 999px;
  background: var(--bg);
  font-weight: 650;
  padding: 8px 14px;
}
.property-name { border: 1px solid var(--line); }
.account { margin-left: auto; position: relative; }
.account summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: white;
}
.account summary::-webkit-details-marker { display: none; }
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 260px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 30px rgba(28, 36, 48, 0.08);
}
.account-menu p { margin: 0 0 10px; word-break: break-all; }
.account-menu button { width: 100%; }

.nav-open {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.menu-btn, .scrim { display: none; }
.frame { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - var(--top)); }
.side {
  background: var(--side);
  color: #e7ebf0;
  padding: 16px 12px;
}
.side nav {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.side a {
  color: inherit;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
}
.side a.active { background: rgba(255,255,255,0.08); box-shadow: inset 3px 0 0 var(--pine); }
.side a:hover { background: rgba(255,255,255,0.06); }
.side a.settings { margin-top: auto; }
.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: #0e6b52;
  color: white;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}
.message-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: #f3f8f5;
  border: 1px solid #b7d7c8;
  border-radius: 16px;
  padding: 14px 16px;
  margin: 0 0 18px;
}
.message-banner p { margin: 4px 0 0; color: #3d4a57; }
a.message-row { display: block; color: inherit; text-decoration: none; margin-bottom: 10px; }
a.message-row.is-unread { box-shadow: inset 3px 0 0 var(--pine); }
a.message-row p:last-child { margin-bottom: 0; }

main { padding: 28px 32px 72px; max-width: 920px; }
main > h1 { font-size: 34px; letter-spacing: -0.03em; margin: 0 0 8px; }
h1 { font-size: 28px; margin: 0 0 8px; }
h2 { font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 28px 0 10px; }
.panel h2 {
  margin: 0 0 14px;
  text-transform: none;
  letter-spacing: -0.02em;
  font-size: 18px;
  color: var(--ink);
}
.kicker, .muted, .lede, .help { color: var(--muted); }
.kicker { margin: 0 0 4px; }
.lede { margin-top: 0; max-width: 62ch; }
.hello { font-size: 20px; margin: 8px 0 20px; }
.panel, .card, .form-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.panel + .panel, form .panel { margin-top: 16px; }
.status-list { margin: 0; }
.status-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.status-list div:last-child { border-bottom: 0; }
.status-list dt { color: var(--muted); }
.status-list dd { margin: 0; font-weight: 650; }
.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 14px;
  font-weight: 650;
}
.pill.ok { background: var(--ok-bg); color: var(--pine-dark); }
.sheet { width: 100%; border-collapse: collapse; }
.sheet th, .sheet td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pay-qr, .guest-qr { width: 180px; height: auto; background: white; border-radius: 12px; }
.product-photo { width: min(220px, 100%); height: auto; object-fit: cover; border-radius: 12px; background: white; }
.catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 8px;
}
.catalog-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.catalog-card img, .catalog-missing {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #efeae2;
}
.catalog-body { display: grid; gap: 8px; padding: 16px; }
.catalog-body h3 { margin: 0; font-size: 20px; letter-spacing: -0.02em; text-transform: none; color: var(--ink); }
.catalog-body p { margin: 0; }
.catalog-body .price { font-size: 22px; font-weight: 750; }
.order-card { margin-top: 16px; }
.order-card h2 { font-size: 22px; }
.order-card h1 { margin-bottom: 8px; }
@media (min-width: 640px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.qty { display: flex; gap: 8px; align-items: center; }
.qty input { width: 72px; text-align: center; }
.order-card + .order-card { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.pay-block, .guest-block { margin-top: 22px; padding-top: 8px; }
.guest-block { border-top: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
a.button { text-decoration: none; display: inline-block; }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stay + .stay { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.stay-when { font-size: 22px; margin: 0; letter-spacing: -0.02em; }
.pin { margin: 4px 0 0; letter-spacing: 0.08em; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field-grid .wide { grid-column: 1 / -1; }
label { display: block; margin: 0; }
.field-grid label, .form-card label { margin: 12px 0; }
label.check {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}
label.check input, label.checkbox input { width: auto; }
select, input, textarea {
  font: inherit;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  margin-top: 4px;
}
.copy-row { display: flex; gap: 12px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.copy-row .help { margin: 0; flex: 1; min-width: 220px; }
.savebar { margin-top: 16px; }
.help, .errorlist { font-size: 13px; margin: 4px 0 0; }
.errorlist { color: var(--danger); padding-left: 18px; }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { border-radius: 12px; padding: 12px 14px; }
.messages .success { background: var(--ok-bg); color: var(--pine-dark); }
.messages .success::before { content: "✓ "; }
.messages .error { background: #fdecec; color: var(--danger); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat strong { display: block; font-size: 28px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.photos img { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; }
.badge { font-size: 12px; background: var(--ok-bg); border-radius: 999px; padding: 2px 8px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card { width: min(420px, 100%); }
.login-card h1 { letter-spacing: -0.03em; }
.login-card h1 em { font-style: normal; color: var(--pine); }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.page-head .button { flex: 0 0 auto; }
.item-list { display: flex; flex-direction: column; gap: 12px; }
.item-card { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.item-card h2 { margin: 0 0 2px; }
.item-spec { margin: 0 0 8px; font-weight: 650; }
.item-text { margin: 0 0 12px; white-space: pre-line; }
.item-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.empty-state h2 { margin-top: 0; }
.linked { margin: 20px 0 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.link-list { margin: 0 0 8px; padding-left: 18px; }
fieldset.choice-list { border: 0; margin: 16px 0; padding: 0; }
fieldset.choice-list legend { font-weight: 650; padding: 0; }
.choice-list ul { list-style: none; margin: 8px 0 0; padding: 0; }
.choice-list li { margin: 8px 0; }
.choice-list label { display: flex; gap: 8px; align-items: center; }
.choice-list input { width: auto; margin: 0; }
fieldset.option-block { border: 0; margin: 16px 0 8px; padding: 0; min-width: 0; }
fieldset.option-block legend,
.option-heading { font-weight: 650; padding: 0; margin: 0 0 8px; }
.option-rows { max-width: 520px; margin: 0 0 12px; }
.option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(28, 36, 48, 0.03);
  font-weight: 450;
}
.option-rows > .option-row:first-child { border-top: 1px solid var(--line); }
.option-row span { min-width: 0; }
.form-card label.option-row,
label.option-row { display: flex; margin: 0; }
.option-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}
.visibility-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.cover-pick { margin: 8px 0 20px; padding-top: 8px; border-top: 1px solid var(--line); }
.cover-pick h2 { margin: 0 0 6px; font-size: 18px; }
.cover-current { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.cover-current img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; background: #efeae2; }
.cover-quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.cover-grid[hidden], .cover-current[hidden], [data-cover-empty][hidden] { display: none; }
.cover-thumb {
  padding: 0;
  border: 2px solid transparent;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.cover-thumb.is-selected { border-color: var(--pine); }
.cover-thumb img { display: block; width: 100%; height: 90px; object-fit: cover; border-radius: 8px; background: #efeae2; }
.cover-thumb span { display: block; font-size: 12px; color: var(--muted); padding: 4px 2px 2px; }

@media (max-width: 860px) {
  .menu-btn {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
  }
  .topbar { gap: 8px; padding: 0 12px; }
  .brand { font-size: 16px; }
  .property-switch { margin-left: 0; min-width: 0; flex: 1; }
  .property-switch select, .property-name { min-width: 0; width: 100%; max-width: none; }
  .frame { display: block; }
  .side {
    position: fixed;
    top: var(--top);
    bottom: 0;
    left: 0;
    width: min(280px, 86vw);
    z-index: 20;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
  }
  .nav-open:checked ~ .frame .side { transform: none; }
  .nav-open:checked ~ .scrim {
    display: block;
    position: fixed;
    inset: var(--top) 0 0 0;
    background: rgba(20, 24, 32, 0.45);
    z-index: 15;
  }
  main { padding: 20px 16px 64px; }
  main > h1, h1 { font-size: 28px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .wide { grid-column: auto; }
  .actions { display: grid; }
  .page-head, .item-card, .item-actions { flex-direction: column; align-items: stretch; }
}
