/* Booking app: plain CSS, no build step (works as-is on shared hosting). */
:root {
    --bg: #f5f3ef;
    --card: #ffffff;
    --ink: #1f2328;
    --ink-soft: #4b5259;
    --muted: #6b7178;
    --line: #e4e0d8;
    --brand: #2f5d50;
    --brand-dark: #22463c;
    --brand-tint: #e3eee9;
    --ok-bg: #e5f3e8;   --ok: #1f6b36;
    --warn-bg: #fdf1dc; --warn: #8a5a00;
    --err-bg: #fbe9e7;  --err: #b3261e;
    --info-bg: #e8eefb; --info: #2848a0;
    --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0; }
p { margin: 0 0 .75rem; }
a { color: var(--brand); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; }

/* Top bar */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: var(--ink-soft); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a.active, .nav a:hover { color: var(--brand); border-bottom-color: var(--brand); }
.hello { color: var(--muted); }
.inline { display: inline; margin: 0; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.center, .center-text { text-align: center; }
.left-text { text-align: left; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.big { font-size: 1.25rem; font-weight: 600; margin-bottom: .25rem; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--line); margin: -4px 0 20px; }
.tab { flex: 1; text-align: center; padding: 10px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: .95rem; }
.field[hidden] { display: none; }
input[type=text], input[type=tel], input[type=password], input[type=date], select {
    font: inherit; width: 100%; padding: 10px 12px; border: 1px solid #cfc9be; border-radius: 8px; background: #fff; color: var(--ink);
    min-height: 44px;
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(47, 93, 80, .35); outline-offset: 1px; border-color: var(--brand); }
.error { color: var(--err); font-style: normal; font-size: .9rem; margin: 0; }
.error[hidden] { display: none; }
#companions { display: flex; flex-direction: column; gap: 14px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-weight: 600; padding: 10px 18px; min-height: 44px; border-radius: 8px;
    border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: #bdb6aa; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn.danger-outline { color: var(--err); border-color: #e7b9b4; }
.btn.danger-outline:hover { background: var(--err-bg); }
button.link { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--ink-soft); cursor: pointer; }
button.link:hover { color: var(--brand); }

/* Flash messages */
.flash { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-approved { background: var(--ok-bg); color: var(--ok); }
.badge-rejected { background: var(--err-bg); color: var(--err); }
.badge-changed { background: var(--info-bg); color: var(--info); }
.badge-cancelled { background: #eeece8; color: var(--muted); }

/* Fee and payment */
.feebox { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; background: var(--brand-tint); border-radius: 8px; padding: 12px 14px; }
.paybox { background: var(--warn-bg); border: 1px solid #f0d9a8; border-radius: 8px; padding: 12px 14px; margin: 12px 0; }
.paybox ul { margin: 0 0 8px; padding-left: 18px; }
.paybox-title { margin-bottom: 6px; }
.paid { color: var(--ok); font-weight: 600; }

/* Reservation cards */
.res-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.note { background: var(--info-bg); border-radius: 8px; padding: 10px 14px; margin: 8px 0 12px; }
.note p { margin: 4px 0 0; white-space: pre-line; }
.persons summary { cursor: pointer; color: var(--ink-soft); padding: 4px 0; }
.persons ul { margin: 6px 0 0; padding-left: 20px; }
.choose { display: flex; flex-direction: column; gap: 8px; background: var(--info-bg); border-radius: 8px; padding: 12px 14px; margin: 8px 0; }
.check { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.check input { width: 18px; height: 18px; }
.disabled-look { color: var(--muted); }
.cancel-form { margin: 12px 0 0; }
.tick { width: 48px; height: 48px; line-height: 48px; margin: 0 auto 8px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: 1.5rem; font-weight: 700; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }

@media (max-width: 480px) {
    .card { padding: 16px; }
    .nav { gap: 10px; font-size: .9rem; }
    .hello { display: none; }
}

/* ---------- Admin ---------- */
.is-admin .wrap { max-width: 960px; }
.brand-tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--brand-tint); color: var(--brand); padding: 2px 6px; border-radius: 4px; vertical-align: middle; margin-left: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); text-decoration: none; font-size: .9rem; min-height: 36px; }
.chip .count { background: #eeece8; color: var(--muted); border-radius: 999px; padding: 0 7px; font-size: .78rem; font-weight: 700; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.active .count { background: rgba(255,255,255,.2); color: #fff; }
.meta { color: var(--ink-soft); font-size: .92rem; margin: 2px 0 0; }
.badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.badge-auto { background: #eeece8; color: var(--ink-soft); font-weight: 600; }
.alert { padding: 8px 12px; border-radius: 8px; font-size: .92rem; margin: 8px 0; }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.err { background: var(--err-bg); color: var(--err); font-weight: 600; }
.box { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.box h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.box p { margin: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.wrap-gap { gap: 12px; }
.grow { flex: 1 1 180px; }
input.short { width: auto; flex: 0 1 180px; min-width: 110px; }
input[type=number], input[type=email], input[type=search], textarea {
    font: inherit; width: 100%; padding: 10px 12px; border: 1px solid #cfc9be; border-radius: 8px; background: #fff; color: var(--ink); min-height: 44px;
}
textarea { resize: vertical; min-height: 64px; }
.search input { flex: 1 1 220px; width: auto; }
.radio { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.change { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.change select { width: auto; min-height: 44px; }
.persons ol { margin: 6px 0 0; padding-left: 22px; }
.wa { margin: 12px 0 0; }
.wa-btn { background: #e7f6ec; border-color: #b9e2c6; color: #146c34; }
.wa-btn:hover { background: #d6f0de; }
.highlight { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-tint); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
@media (max-width: 480px) {
    .change { margin-left: 0; }
    .res-head { flex-direction: column; }
    .badges { flex-direction: row; align-items: center; }
}

/* ---------- Calendar (flatpickr pop-up) ---------- */
.flatpickr-calendar { font-family: inherit; }
.flatpickr-calendar .flatpickr-day.selected, .flatpickr-calendar .flatpickr-day.selected:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.flatpickr-day.today { border-color: var(--brand); }
.flatpickr-day.flatpickr-disabled.taken, .flatpickr-day.flatpickr-disabled.taken:hover {
    background: #e6e3dd; color: #a7a199; text-decoration: line-through; border-color: transparent; cursor: not-allowed;
}
.flatpickr-day.flatpickr-disabled:not(.taken) { color: #cfcac2; }
.flatpickr-current-month { padding-top: 6px; font-size: 1rem; }
.flatpickr-current-month select.flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    min-height: 0; width: auto; padding: 0 2px; border: 0; font-size: inherit; font-weight: 600; background: transparent; height: auto; line-height: 1.6;
}
.flatpickr-input[readonly] { background: #fff; cursor: pointer; }
.charge-form { display: flex; flex-direction: column; gap: 8px; }
