:root {
  --header: #243126;
  --header-ink: #f4f0e6;
  --accent: #d2a24c;
  --accent-ink: #243126;
  --page: #f4f0e6;
  --ink: #1c1915;
  --muted: #c8beab;
  color: var(--ink);
  background: var(--page);
  font-family: "Segoe UI", Candara, sans-serif;
  line-height: 1.45;
}
body { margin: 0; }
a { color: #5b3cc4; text-decoration: none; }
[hidden] { display: none !important; }
header {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: center;
  height: 5rem;
  min-height: 5rem;
  max-height: 5rem;
  padding: 0 1.2rem;
  background: var(--header);
  color: var(--header-ink);
  position: relative;
  z-index: 20;
  overflow: visible;
}
.brand { color: inherit; font-weight: 700; text-decoration: none; display: flex; gap: 0.75rem; align-items: center; height: 5rem; min-width: 0; flex: 0 1 auto; max-width: 24rem; }
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand > span:not(.brand-name) { background: var(--accent); color: var(--accent-ink); width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 4px; }
.brand img { height: 5rem; width: auto; max-width: 16rem; object-fit: contain; object-position: left center; padding: 0.4rem 0; box-sizing: border-box; }
.app-name { margin: 0; flex: 1 1 auto; min-width: 0; text-align: center; font-family: var(--heading-font, "Segoe UI", sans-serif); font-size: clamp(1rem, 1.5vw, 1.6rem); font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
nav { display: flex; gap: 0.55rem; align-items: center; overflow: visible; flex: 0 0 auto; }
.menu-toggle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.menu-button { display: none; }
.site-links { display: flex; flex-wrap: nowrap; gap: 0.55rem; align-items: center; }
.site-links > a { color: var(--header-ink); }
nav details.menu { position: relative; }
nav details.menu summary { list-style: none; cursor: pointer; color: var(--header-ink); }
nav details.menu summary::-webkit-details-marker { display: none; }
nav details.menu summary::after { content: " ▾"; font-size: 0.75em; }
nav details.menu > div { position: absolute; top: calc(100% + 0.55rem); right: 0; left: auto; width: max-content; min-width: 16rem; max-width: calc(100vw - 1.5rem); max-height: min(70vh, 32rem); overflow: auto; background: white; border-radius: 4px; padding: 0.3rem 0; z-index: 30; box-shadow: 0 8px 24px rgba(28, 25, 21, 0.28); }
nav details.menu a, nav details.menu details summary { display: block; color: #1c1915; text-decoration: none; padding: 0.5rem 0.9rem; white-space: nowrap; }
nav details.menu .menu-head { margin: 0.55rem 0 0.1rem; padding: 0.35rem 0.9rem 0.15rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #6d675c; }
nav details.menu details summary { color: #1c1915; white-space: nowrap; }
nav details.menu details > div { position: static; min-width: 0; max-width: none; max-height: none; overflow: visible; background: transparent; box-shadow: none; padding: 0 0 0.15rem 0.85rem; }
nav details.menu a:hover { background: #fff4d6; }
nav button, button, .button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 4px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
button:disabled { background: var(--muted); color: #6d675c; cursor: not-allowed; }
main { padding: 1.2rem; max-width: 1100px; }
main:has(.board-wrap) { max-width: none; padding-top: 0.6rem; }
.board-nav { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin: 0 0 0.4rem; }
.board-nav form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.board-nav input, .board-nav select, .board-nav button { margin: 0; }
.board-nav input[type="search"] { width: 12rem; }
.board-nav .stage-keys { display: flex; gap: 0.35rem; align-items: center; margin-left: auto; flex-wrap: wrap; }
.board-nav .stage-keys button { font-weight: 700; padding: 0.4rem 0.55rem; }
.board-nav .board-book { margin-left: auto; }
#book-backdrop { display: none; }
#book-backdrop.is-open { display: block !important; position: fixed; inset: 0; z-index: 9998; background: rgba(28, 25, 21, 0.45); }
#book-pop { display: none; }
#book-pop.is-open { display: block !important; position: fixed; z-index: 9999; top: 4.25rem; left: 50%; transform: translateX(-50%); width: min(32rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 5.5rem); overflow: auto; padding: 0.9rem 1rem; border-radius: 4px; background: white; color: var(--ink); box-shadow: 0 12px 40px rgba(28, 25, 21, 0.35); }
#book-pop h2 { margin: 0 0 0.4rem; }
#book-pop .actions { justify-content: flex-end; }
.board-views { display: flex; gap: 0.5rem; align-items: center; }
.board-views button.is-on { outline: 2px solid var(--header); }
.board-wrap { overflow-x: auto; background: white; width: 100%; }
.board { border-collapse: collapse; font-size: 0.78rem; table-layout: fixed; width: 100%; }
.board col.room { width: 9rem; }
.board th, .board td { border: 1px solid var(--muted); padding: 0; height: 1.8rem; text-align: center; vertical-align: middle; background: white; overflow: hidden; }
.board .room { position: sticky; left: 0; z-index: 1; width: 9rem; min-width: 9rem; text-align: left; padding: 0 0.4rem; white-space: nowrap; background: white; }
.board .type-row th { text-align: left; background: var(--header); color: var(--header-ink); padding: 0.25rem 0.45rem; }
.board .weekend { background: #f7f3ea; }
.board .open-cell { cursor: pointer; }
.board .day-num, .board .day-dow { display: block; line-height: 1.1; }
.board .day-dow { font-weight: 500; }
.board button.stay { display: block; width: calc(100% - 0.24rem); margin: 0.12rem; padding: 0.12rem 0.35rem; border: 0; border-radius: 3px; text-align: left; font: inherit; font-weight: 700; overflow: hidden; cursor: pointer; }
.board .stay-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board.view-day button.stay, .board.view-week button.stay { white-space: normal; }
.board.view-day .stay-meta, .board.view-week .stay-meta { display: block; font-weight: 500; }
.board.view-month .stay-meta { display: none; }
#stay-backdrop { display: none; }
#stay-backdrop.is-open { display: block !important; position: fixed; inset: 0; z-index: 9998; background: rgba(28, 25, 21, 0.45); }
#stay-pop { display: none; }
#stay-pop.is-open { display: block !important; position: fixed; z-index: 9999; top: 4.25rem; left: 50%; transform: translateX(-50%); width: min(32rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 5.5rem); overflow: auto; padding: 0.9rem 1rem; border-radius: 4px; background: white; color: var(--ink); box-shadow: 0 12px 40px rgba(28, 25, 21, 0.35); }
#stay-pop h2 { margin: 0 0 0.4rem; }
#edit-backdrop { display: none; }
#edit-backdrop.is-open { display: block !important; position: fixed; inset: 0; z-index: 10000; background: rgba(28, 25, 21, 0.45); }
#edit-pop { display: none; }
#edit-pop.is-open { display: block !important; position: fixed; z-index: 10001; top: 4.25rem; left: 50%; transform: translateX(-50%); width: min(64rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 5.5rem); overflow: auto; padding: 0.9rem 1rem 1.2rem; border-radius: 4px; background: white; color: var(--ink); box-shadow: 0 12px 40px rgba(28, 25, 21, 0.35); }
#edit-pop h2 { margin: 0 0 0.6rem; }
#edit-pop .actions { justify-content: flex-end; }
#stay-pop .actions { justify-content: flex-end; }
#stay-cancel { display: contents; }
label { display: grid; gap: 0.25rem; margin: 0.6rem 0; }
input[readonly] { background: white; color: inherit; }
input, select, textarea { font: inherit; padding: 0.45rem; border: 1px solid var(--muted); border-radius: 4px; background: white; }
textarea { min-height: 4.5rem; }
table { width: 100%; border-collapse: collapse; background: white; margin-top: 1rem; }
th, td { text-align: left; padding: 0.45rem; border-bottom: 1px solid #e4dccb; vertical-align: top; }
th .sort { display: inline-flex; gap: 0.15rem; margin-left: 0.3rem; }
th .sort a { color: inherit; text-decoration: none; opacity: 0.45; }
th .sort a.on { opacity: 1; font-weight: 700; }
.notice { background: #fff4d6; border: 1px solid var(--accent); padding: 0.7rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.6rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; }
.cards a { background: white; padding: 1rem; text-decoration: none; color: inherit; border-radius: 4px; }
.company-form, .font-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 1.2rem; max-width: 52rem; align-items: start; }
.company-form .wide, .company-form button { grid-column: 1 / -1; }
.setup-note { background: white; border-radius: 4px; padding: 0.8rem 1rem 0.2rem; margin: 0.8rem 0 1rem; }
.setup-note ol { margin: 0.4rem 0 0.8rem; padding-left: 1.2rem; }
.show-password { display: flex; align-items: center; gap: 0.4rem; margin: 0.15rem 0 0.6rem; }
.show-password input { width: auto; padding: 0; }
#roles-backdrop { display: none; }
#roles-backdrop.is-open { display: block !important; position: fixed; inset: 0; z-index: 9998; background: rgba(28, 25, 21, 0.45); }
#roles-pop { display: none; }
#roles-pop.is-open { display: block !important; position: fixed; z-index: 9999; top: 4.25rem; left: 50%; transform: translateX(-50%); width: min(26rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 5.5rem); overflow: auto; padding: 0.9rem 1rem; border-radius: 4px; background: white; color: var(--ink); box-shadow: 0 12px 40px rgba(28, 25, 21, 0.35); }
#roles-pop h2 { margin: 0 0 0.4rem; }
#roles-pop .role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 0.6rem; margin: 0.4rem 0; }
#roles-pop .role-opt { display: flex; align-items: center; gap: 0.4rem; margin: 0; }
#roles-pop .role-opt input { width: auto; padding: 0; }
.contact-find { position: relative; }
.contact-matches { position: absolute; z-index: 5; left: 0; right: 0; background: white; border: 1px solid var(--muted); border-radius: 4px; max-height: 12rem; overflow: auto; }
.contact-matches button { display: block; width: 100%; text-align: left; background: white; color: var(--ink); border-radius: 0; font-weight: 600; }
.record-search { display: flex; align-items: center; gap: 0.5rem; margin: 0.7rem 0 0; max-width: 28rem; }
.record-search span { font-weight: 600; }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; align-items: stretch; }
.swatch { display: grid; gap: 0.4rem; margin: 0; }
.swatch-name { font-weight: 600; }
.swatch small { display: block; line-height: 1.35; }
.colour-block { position: relative; display: block; height: 5.5rem; }
.colour-block input[type="color"] { width: 100%; height: 100%; margin: 0; padding: 0; border: 1px solid rgba(28, 25, 21, 0.28); border-radius: 4px; background: transparent; cursor: pointer; box-sizing: border-box; }
.colour-block input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.colour-block input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 3px; }
dialog.stage-dialog { border: 0; border-radius: 6px; padding: 1rem 1.2rem 1.2rem; width: min(22rem, calc(100vw - 2rem)); margin: 1rem auto auto; background: var(--page); }
dialog.stage-dialog::backdrop { background: rgba(28, 25, 21, 0.45); }
dialog.stage-dialog h2 { margin: 0 0 0.6rem; }
dialog.stage-dialog .actions { margin: 0 0 0.8rem; }
dialog.stage-dialog .colour-block { height: 9rem; }
.colour-hint { position: absolute; left: 0.4rem; right: 0.4rem; bottom: 0.4rem; text-align: center; font-size: 0.78rem; padding: 0.2rem 0.3rem; border-radius: 3px; background: rgba(255, 255, 255, 0.92); color: #1c1915; pointer-events: none; }
.line-head, .line { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr) 8rem; gap: 0.4rem 0.6rem; align-items: center; }
.calendar-head, .calendar-line { grid-template-columns: 8rem minmax(14rem, 1.8fr) 5rem 7rem 8rem 6rem; }
.rate-prices { display: grid; gap: 0.35rem; }
.rate-prices label { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.3rem; align-items: center; margin: 0; }
.extra-head, .extra-line { grid-template-columns: minmax(0, 1fr) 8rem; }
.line-head { font-weight: 600; margin-top: 0.8rem; }
.line input { width: 100%; min-width: 0; box-sizing: border-box; }
.line-field span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
tr.selectable { cursor: pointer; }
tr.selected { background: #fff4d6; }
dialog.record-dialog { border: 0; border-radius: 6px; padding: 1.2rem 1.3rem 1.4rem; width: min(64rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; background: var(--page); }
dialog.record-dialog::backdrop { background: rgba(28, 25, 21, 0.45); }
dialog.record-dialog .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 1rem; align-items: end; }
dialog.record-dialog .wide { grid-column: 1 / -1; }
.ticks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem 1rem; margin: 0.6rem 0; }
.ticks label { display: flex; align-items: center; gap: 0.4rem; margin: 0; }
.table-scroll { max-width: 100%; overflow-x: auto; }
@media (max-width: 1100px) {
  header { flex-wrap: wrap; height: auto; max-height: none; }
  .app-name { font-size: 1.35rem; }
  nav { flex: 1 1 100%; padding-bottom: 0.35rem; }
  .site-links { flex-wrap: wrap; }
  .swatches { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  header { padding: 0.35rem 0.8rem 0.45rem; }
  .brand { height: auto; }
  .brand img { height: 3.2rem; }
  .brand .brand-name, .app-name { display: none; }
  nav { flex: 0 0 auto; width: auto; margin-left: auto; padding: 0; }
  .menu-button { display: inline-block; }
  .site-links { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 40; flex-direction: column; align-items: stretch; background: var(--header); padding: 0.3rem 0.9rem 0.8rem; }
  .menu-toggle:checked ~ .site-links { display: flex; }
  nav details.menu > div { position: static; max-height: none; background: transparent; box-shadow: none; padding: 0 0 0.3rem 0.7rem; }
  nav details.menu a, nav details.menu details summary, nav details.menu .menu-head { color: var(--header-ink); }
  .company-form, .font-choices, dialog.record-dialog .grid, .ticks, .swatches { grid-template-columns: 1fr; }
  .line-head { display: none; }
  .line { grid-template-columns: 1fr; background: white; padding: 0.75rem; border-radius: 4px; margin: 0.4rem 0; }
  .line-field span { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-weight: 600; }
}
