/* Hall booking requests: compact styles for the public page and the admin page. */

:root {
  --paper: #f6f2eb;
  --card: #fffdf9;
  --ink: #24201b;
  --muted: #706858;
  --line: #e4dccf;
  --field: #d3c9b9;
  --accent: #b4532a;
  --accent-soft: #f6e4d9;
  --free: #dcebd6;
  --free-ink: #2f5a26;
  --partial: #f5e0ad;
  --partial-ink: #7a5300;
  --full: #ecd8d3;
  --full-ink: #7d2f24;
  --err: #a42c1e;
  --r: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
p { margin: 0; }
b { font-weight: 650; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: .85rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.top { padding: 18px 0 12px; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; }
.brand h1 { font-size: 1.9rem; letter-spacing: -.01em; }
.brand p { color: var(--muted); }
.chip { font-size: .78rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 5px 11px; border-radius: 999px; }

/* Policy strip */
.policy { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); overflow: hidden; }
.pol { padding: 10px 14px 10px 44px; position: relative; font-size: .92rem; color: var(--muted); }
.pol b { color: var(--ink); }
.pol::before { position: absolute; left: 14px; top: 10px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; }
.pol-yes { border-left: 4px solid var(--free-ink); }
.pol-no { border-left: 4px solid var(--full-ink); }
.pol-yes::before { content: "\2713"; background: var(--free); color: var(--free-ink); }
.pol-no::before { content: "\2715"; background: var(--full); color: var(--full-ink); }

/* Steps */
.steps { list-style: none; margin: 10px 0 14px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; font-size: .88rem; }
.steps li { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.steps li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: .72rem; }
.steps .steps-note { font-weight: 400; color: var(--muted); margin-left: auto; }

/* Layout */
.main { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; scroll-margin-top: 10px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2 { font-size: 1.2rem; }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-title { font-size: 1rem; font-family: var(--sans); font-weight: 650; }
.cal-title:focus { outline: none; }
.cal-nav { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .9rem; }
.cal-nav:hover { border-color: var(--accent); background: var(--accent-soft); }
.cal-nav.is-off { opacity: .3; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-wd { text-align: center; font-size: .68rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 2px 0; }
.day { height: 36px; border-radius: 6px; display: grid; place-items: center; text-decoration: none; color: inherit; font-size: .85rem; font-weight: 600; position: relative; border: 2px solid transparent; }
a.day:hover { border-color: rgba(36, 32, 27, .3); }
a.day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.day.is-free { background: var(--free); color: var(--free-ink); }
.day.is-partial { background: var(--partial); color: var(--partial-ink); }
.day.is-partial::after { content: ""; position: absolute; right: 4px; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.day.is-full, .day.is-closed { background: repeating-linear-gradient(135deg, var(--full) 0 4px, #f4e8e5 4px 8px); color: var(--full-ink); }
.day.is-out { color: #c3bbae; font-weight: 400; }
.day.is-today .day-n { text-decoration: underline; text-underline-offset: 2px; }
.day.is-selected { border-color: var(--ink); }

.legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 12px; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.legend li { display: flex; align-items: center; gap: 5px; }
.sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sw.is-free { background: var(--free); }
.sw.is-partial { background: var(--partial); }
.sw.is-full { background: repeating-linear-gradient(135deg, var(--full) 0 2px, #f4e8e5 2px 4px); border: 1px solid var(--full); }
.day-info { margin-top: 10px; padding: 7px 10px; border-radius: 7px; background: var(--paper); border-left: 3px solid var(--line); font-size: .85rem; }
.day-info b { margin-right: 4px; }
.day-info a { white-space: nowrap; font-weight: 650; margin-left: 4px; }
.day-info.is-free { border-left-color: var(--free-ink); }
.day-info.is-partial { border-left-color: var(--partial-ink); }
.day-info.is-full, .day-info.is-closed { border-left-color: var(--full-ink); }

/* Form grid: six columns. sN = span N columns, mN = span on small screens. */
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 10px; }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s6 { grid-column: 1 / -1; }
.f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.f > span { font-size: .76rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.f em { font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password], select, textarea {
  width: 100%; height: 36px; font: inherit; font-size: .93rem; color: inherit; padding: 6px 9px;
  border: 1px solid var(--field); border-radius: 7px; background: #fff;
}
textarea { height: auto; min-height: 68px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(180, 83, 42, .16); }
[aria-invalid=true] { border-color: var(--err); }
.field-error { color: var(--err); font-size: .8rem; font-weight: 600; }
.date-busy { font-size: .82rem; color: var(--muted); margin-top: -2px; }
.date-busy:empty { display: none; }
.date-busy.is-warn { color: var(--err); font-weight: 600; }
.date-busy.is-full, .date-busy.is-closed { color: var(--full-ink); }
.submit-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; flex: 1 1 260px; }
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); flex: none; }
.check.has-error { color: var(--err); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 16px; border: 1px solid var(--accent); border-radius: 7px;
  background: var(--accent); color: #fff; font: 650 .9rem var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); }
.btn-sm { height: 28px; padding: 0 10px; font-size: .8rem; border-radius: 6px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--field); }
.btn-ghost:hover { background: var(--paper); filter: none; }
.btn-ok { background: var(--free-ink); border-color: var(--free-ink); }
.btn-no { background: var(--err); border-color: var(--err); }
.btn-link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .82rem; text-decoration: underline; cursor: pointer; }
.btn-link:hover { color: var(--err); }

.notice { border-radius: 7px; padding: 8px 12px; margin-bottom: 10px; font-size: .9rem; }
.notice.ok { background: var(--free); color: var(--free-ink); }
.notice.err { background: #f8ddd7; color: var(--err); }
.notice.warn { background: var(--partial); color: var(--partial-ink); }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

.foot { color: var(--muted); font-size: .8rem; padding: 4px 0 24px; }

/* Admin */
.abar { background: var(--ink); color: #efe9e0; }
.abar-in { display: flex; align-items: center; gap: 6px 18px; min-height: 46px; flex-wrap: wrap; }
.abar strong { font-family: var(--serif); font-size: 1.05rem; margin-right: 6px; }
.abar nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.abar nav a { color: #cfc6b8; text-decoration: none; padding: 5px 10px; border-radius: 6px; font-size: .88rem; font-weight: 600; }
.abar nav a:hover { color: #fff; }
.abar nav a.on { background: #3b352d; color: #fff; }
.abar .right { display: flex; align-items: center; gap: 12px; font-size: .85rem; }
.abar .right a { color: #cfc6b8; }
.abar form { margin: 0; }
.abar .btn-link { color: #cfc6b8; }
.count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; text-align: center; line-height: 18px; }
.amain { padding-top: 14px; padding-bottom: 30px; }
.agrid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 0 8px 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.nw { white-space: nowrap; }
.tbl a.row-link { color: var(--ink); font-weight: 650; text-decoration: none; }
.tbl a.row-link:hover { text-decoration: underline; }
.acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.acts form { margin: 0; display: contents; }
.tag { display: inline-block; font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.tag-pending { background: var(--partial); color: var(--partial-ink); }
.tag-accepted { background: var(--free); color: var(--free-ink); }
.tag-declined, .tag-cancelled { background: #e9e4dc; color: var(--muted); }
.tag-closed, .tag-flag { background: var(--full); color: var(--full-ink); }
.dl { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: 5px 12px; margin: 0; font-size: .9rem; }
.dl dt { color: var(--muted); font-size: .76rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.dl .wide { grid-column: 2 / -1; white-space: pre-wrap; }
.reply textarea { min-height: 56px; }
.reply-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.reply-row .sep { flex: 1; }
.mini-h { font-size: .76rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 6px; }
.addform { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.addform .f { flex: 1 1 120px; }
.addform .f.wide { flex: 3 1 200px; }
.addform .check { flex: 0 0 auto; height: 36px; }
.login { max-width: 400px; margin: 70px auto; }
.login form { display: flex; gap: 8px; margin-top: 10px; }
.empty { color: var(--muted); padding: 14px; text-align: center; font-size: .9rem; }

@media (max-width: 860px) {
  .main, .agrid { grid-template-columns: 1fr; }
  .cal-card { max-width: 480px; }
  .steps .steps-note { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 600px) {
  .policy { grid-template-columns: 1fr; }
  .pol-no { border-top: 1px solid var(--line); }
  .grid > .m6 { grid-column: span 6; }
  .grid > .m3 { grid-column: span 3; }
  .dl { grid-template-columns: max-content 1fr; }
  .dl .wide { grid-column: 2; }
  .tbl .hide-s { display: none; }
  .brand h1 { font-size: 1.6rem; }
}
.mt { margin-top: 14px; }
h1.h2 { font-size: 1.2rem; }
/* Wide screens: the form beside the calendar already shows the chosen day's booked times. */
@media (min-width: 861px) { .day-info { display: none; } }
