:root {
  --bg: #f6f1ec; --panel: #fffdfa; --line: #e6dbd1; --ink: #2e211b; --muted: #85736a; --brand: #0d6b3c; --brand-2: #f2b33d;
  --cocoa: #4a2f23; --ok: #3f7a4a; --warn: #b7791f; --err: #b0412e; --info: #3c6e91; --radius: 8px;
  --sans: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif; --serif: 'Playfair Display', Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; font: 400 15px/1.5 var(--sans); color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0 0 .5em; color: var(--cocoa); }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; font-family: var(--sans); font-weight: 600; }
[hidden] { display: none !important; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* layout */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--cocoa); color: #f3e7dd; padding: 20px 14px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
.side .brand { font: 500 1.25rem var(--serif); color: #fff; padding: 4px 10px 20px; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.side nav a { display: flex; align-items: center; gap: 10px; color: #e8d9cd; text-decoration: none; padding: 9px 12px; border-radius: 6px; margin-bottom: 2px; font-weight: 500; white-space: nowrap; }
.side nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side nav a.on { background: var(--brand-2); color: var(--ink); }
.side nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.side .who { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; color: #d8c6b8; }
.side .who a { color: var(--brand-2); }
.main { padding: 26px 32px 60px; min-width: 0; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.topline h1 { margin: 0; }
.mobile-bar, .side-scrim { display: none; }
/* Short screens (or zoomed in): tighten the menu so all 14 items fit without scrolling. */
@media (max-height: 760px) {
  .side { padding-top: 12px; }
  .side .brand { padding-bottom: 10px; }
  .side nav a { padding: 6px 12px; margin-bottom: 1px; }
}
@media (max-height: 640px) {
  .side { padding: 8px 10px; }
  .side .brand { font-size: 1.1rem; padding-bottom: 6px; }
  .side nav a { padding: 4px 10px; font-size: .88rem; }
  .side nav svg { width: 16px; height: 16px; }
  .side .who { padding-top: 8px; font-size: .78rem; }
}
/* Narrow screens (phones, tablets, laptops zoomed past ~125%): menu slides out from ☰. */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  body.side-open .side { transform: none; box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  body.side-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  body.side-open { overflow: hidden; }
  .mobile-bar { display: flex; align-items: center; gap: 12px; background: var(--cocoa); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 30; font: 500 1.1rem var(--serif); }
  .mobile-bar button { background: none; border: 0; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 4px 6px; }
  .mobile-bar .here { margin-left: auto; font: 500 .9rem var(--sans); color: var(--brand-2); }
  .main { padding: 18px 14px 50px; }
}

/* components */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .k { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat .v { font: 500 1.7rem var(--serif); color: var(--cocoa); margin-top: 4px; }
.stat .s { font-size: .82rem; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--brand); background: var(--brand); color: #fff;
  font: 500 .88rem var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.light { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn.light:hover { border-color: var(--brand); filter: none; }
.btn.danger { background: var(--panel); color: var(--err); border-color: #e7c2b9; }
.btn.danger:hover { background: #fbeeea; filter: none; }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.sm { padding: 5px 10px; font-size: .8rem; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; text-decoration: underline; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #f0e8e1; vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fbf6f1; }
tr.dim td { opacity: .55; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap table { min-width: 640px; }
.thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #efe5dc; display: block; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 600; background: #efe5dc; color: var(--cocoa); white-space: nowrap; text-transform: capitalize; }
.pill.ok { background: #e2efe3; color: var(--ok); } .pill.warn { background: #fbefd9; color: var(--warn); }
.pill.err { background: #f8e2dc; color: var(--err); } .pill.info { background: #e1ecf4; color: var(--info); }
.pill.dim { background: #eee; color: #888; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 260px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: none; padding: 7px 12px; font: 500 .85rem var(--sans); cursor: pointer; color: var(--ink); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--cocoa); color: #fff; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0e8e1; }
.list-item:last-child { border-bottom: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.checklist li { margin-bottom: 6px; }
.checklist .done { color: var(--muted); text-decoration: line-through; }

/* forms */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--cocoa); margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); border-color: var(--brand-2); }
input[type=checkbox] { width: auto; accent-color: var(--brand); transform: scale(1.15); }
input[type=color] { padding: 2px; height: 38px; }
textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; padding-top: 22px; }
.help { font-size: .78rem; color: var(--muted); margin-top: 3px; font-weight: 400; }
.err-box { background: #f8e2dc; color: var(--err); padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; }
.img-field { display: flex; gap: 12px; align-items: center; }
.img-field img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; background: #efe5dc; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(40,25,18,.45); display: grid; place-items: center; z-index: 60; padding: 16px; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 10px; width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(900px, 100%); }
.modal header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal header h2 { margin: 0; }
.modal header button { background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; }
.modal .body { padding: 18px 20px; overflow-y: auto; }
.modal footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* timeline */
.tl-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tl { display: grid; min-width: 100%; position: relative; }
.tl-head { position: sticky; top: 0; background: var(--panel); z-index: 2; padding: 10px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tl-hours { position: relative; border-right: 1px solid var(--line); }
.tl-hour { position: absolute; left: 0; right: 0; font-size: .72rem; color: var(--muted); padding: 0 6px; transform: translateY(-50%); text-align: right; }
.tl-col { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(#0000 0 calc(var(--hr) - 1px), #f0e8e1 calc(var(--hr) - 1px) var(--hr)) #f7f3ef; cursor: copy; }
.tl-shift { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(#0000 0 calc(var(--hr) - 1px), #f0e8e1 calc(var(--hr) - 1px) var(--hr)) #fffdfa; pointer-events: none; }
.tl-bk { position: absolute; left: 4px; right: 4px; border-radius: 6px; padding: 4px 8px; font-size: .8rem; overflow: hidden; cursor: pointer; border-left: 4px solid var(--c, var(--brand));
  background: color-mix(in srgb, var(--c, var(--brand)) 16%, white); box-shadow: 0 1px 2px rgba(0,0,0,.08); line-height: 1.3; }
.tl-bk:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 3; }
.tl-bk b { display: block; }
.tl-bk.st-completed { opacity: .65; } .tl-bk.st-pending_payment { border-left-style: dashed; } .tl-bk.st-no_show { opacity: .5; text-decoration: line-through; }
.tl-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--err); z-index: 2; pointer-events: none; }

/* roster */
.roster td, .roster th { text-align: center; border: 1px solid #f0e8e1; }
.roster td:first-child, .roster th:first-child { text-align: left; }
.roster .off { color: var(--muted); font-style: italic; font-size: .82rem; }
.roster .util { height: 4px; background: #efe5dc; border-radius: 2px; margin-top: 4px; overflow: hidden; }
.roster .util i { display: block; height: 100%; background: var(--brand); }
.hours-grid { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 6px 10px; align-items: center; max-width: 420px; }
.staff-card { border-left: 5px solid var(--c); }

/* gallery */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.gal figure { margin: 0; position: relative; }
.gal img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.gal button { position: absolute; top: 6px; right: 6px; }
.gal figcaption { font-size: .8rem; color: var(--muted); padding-top: 4px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #f3dccd, transparent 50%), var(--bg); }
.login form { width: min(380px, 100%); background: var(--panel); padding: 34px; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 20px 50px -30px rgba(74,47,35,.5); }
.login h1 { text-align: center; margin-bottom: 4px; }
.login .field { margin-bottom: 14px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 150%); background: var(--cocoa); color: #fff; padding: 12px 20px; border-radius: 8px; transition: transform .25s; z-index: 90; max-width: 90vw; }
.toast { visibility: hidden; }
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.toast.err { background: var(--err); }
