/* Style Mantra app — aubergine and gold, arches from the salon's website */
:root {
  --ink: #2B1D2E;
  --ink-2: #3D2B40;
  --gold: #B08A3E;
  --gold-text: #7A5A1E;
  --gold-wash: #F3EAD8;
  --porcelain: #F7F5F8;
  --paper: #FFFFFF;
  --blush: #F1E8EF;
  --line: #E4DCE6;
  --text: #2B1D2E;
  --muted: #6B5E6E;
  --sage: #3B7157;
  --rose: #A5433A;
  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 10px;
  --rail: 232px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--sans); color: var(--text); background: var(--porcelain); }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--gold); }
a:hover { color: var(--gold-text); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
h1, h2 { margin: 0; line-height: 1.2; }
h1 { font: 500 30px/1.15 var(--serif); font-variation-settings: "opsz" 72; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 600; margin-bottom: 14px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.rail { background: var(--ink); color: #E9E0EA; }
.wordmark { font: italic 500 22px/1 var(--serif); color: var(--gold); text-decoration: none; letter-spacing: .01em; }
.wordmark:hover { color: #D2B06A; }
.wordmark.lg { display: block; font-size: 30px; text-align: center; margin-bottom: 26px; }
.nav a { display: flex; align-items: center; gap: 12px; color: #D8CEDA; text-decoration: none; font-weight: 500; }
.nav svg { width: 22px; height: 22px; flex: none; }
.nav a.on { color: #fff; }
.who { display: none; }
.main { padding: 20px 18px 110px; max-width: 1080px; }

@media (max-width: 859px) {
  .rail { position: sticky; top: 0; z-index: 5; padding: 14px 18px calc(12px); padding-top: calc(14px + env(safe-area-inset-top)); }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around; background: var(--ink); border-top: 1px solid var(--ink-2); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .nav a { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 8px; border-radius: 8px; min-width: 56px; }
  .nav a.on { color: var(--gold); }
}
@media (min-width: 860px) {
  body.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
  .rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 30px 18px 22px; }
  .rail .wordmark { font-size: 26px; padding: 0 12px 34px; }
  .nav { display: grid; gap: 2px; }
  .nav a { padding: 10px 12px; border-radius: 8px; position: relative; }
  .nav a:hover { background: var(--ink-2); color: #fff; }
  .nav a.on { background: var(--ink-2); }
  .nav a.on::before { content: ""; position: absolute; left: -18px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
  .who { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--ink-2); }
  .who-text { display: grid; line-height: 1.3; }
  .who-text small { color: #B7A9BA; }
  .who form { grid-column: 2; }
  .who .link-quiet { color: #CBBFCD; padding: 0; }
  .main { padding: 40px 44px 64px; }
}

/* ---------- arches (the salon's signature shape) ---------- */
.arch-avatar { display: inline-grid; place-items: center; flex: none; width: 44px; height: 52px; border-radius: 22px 22px 6px 6px; background: var(--blush); color: var(--ink); font: 500 16px/1 var(--serif); border: 1px solid #E3D2DF; }
.arch-avatar.sm { width: 32px; height: 38px; border-radius: 16px 16px 5px 5px; font-size: 13px; background: var(--ink-2); color: var(--gold); border-color: #4E3A52; }
.arch-avatar.lg { width: 72px; height: 86px; border-radius: 36px 36px 8px 8px; font-size: 28px; }

/* ---------- auth ---------- */
body.bare { background: var(--ink); min-height: 100vh; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { position: relative; width: 100%; max-width: 380px; background: var(--paper); border-radius: 190px 190px var(--r) var(--r); padding: 96px 30px 30px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.auth-card .arch-top { position: absolute; inset: 12px 12px auto; height: 170px; border: 1px solid var(--gold); border-bottom: 0; border-radius: 180px 180px 0 0; pointer-events: none; opacity: .7; }
.auth-card h1 { font-size: 24px; text-align: center; margin-bottom: 20px; }
.auth-card .muted.small { margin-top: 18px; }
.main:has(.auth) { padding: 0; max-width: none; }

/* ---------- page parts ---------- */
.page-head { display: flex; gap: 18px; align-items: center; margin-bottom: 24px; }
.page-head.split { justify-content: space-between; flex-wrap: wrap; align-items: flex-end; }
.page-head p { margin-top: 6px; max-width: 60ch; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 6px; text-decoration: none; }
.back::before { content: "‹ "; }
.greeting { margin: 4px 0 28px; }
.greeting h1 { font-size: 36px; margin: 4px 0 6px; }
@media (min-width: 860px) { .greeting h1 { font-size: 44px; } }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 20px; }
.panel.narrow { max-width: 620px; }
.panel.callout { border-color: var(--gold); background: var(--gold-wash); }
.panel.callout p { margin: -6px 0 14px; }
.empty { text-align: center; padding: 40px 24px; }
.empty p { max-width: 46ch; margin: 0 auto 18px; }

.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; border-left: 3px solid; font-weight: 500; }
.flash-ok { background: #EAF3EE; border-color: var(--sage); color: #22503A; }
.flash-err { background: #F8ECEA; border-color: var(--rose); color: #7A2C25; }
.errlist { margin: 0 0 18px; padding-left: 18px; color: #7A2C25; font-size: 14px; }

/* checklist — a real sequence, so it's numbered */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px 0 14px 44px; border-top: 1px solid var(--line); position: relative; }
.steps li:first-child { border-top: 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 14px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold-text); display: grid; place-items: center; font: 500 14px/1 var(--serif); }
.steps li.done::before { content: "✓"; background: var(--sage); border-color: var(--sage); color: #fff; font-family: var(--sans); }
.steps li.done strong { color: var(--muted); font-weight: 500; }
.steps p { font-size: 14px; margin-top: 2px; }
.tick { color: var(--sage); font-weight: 600; font-size: 14px; }
@media (max-width: 600px) { .steps li { flex-direction: column; align-items: flex-start; } }

.figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 20px; }
.figures > div { background: var(--paper); padding: 18px 20px; display: grid; gap: 2px; }
.fig { font: 500 38px/1 var(--serif); color: var(--ink); }
@media (min-width: 860px) { .figures { grid-template-columns: repeat(4, 1fr); } }

.activity { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.activity li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line); }
.activity li:first-child { border-top: 0; }
.activity span::first-letter { text-transform: uppercase; }
.activity time { white-space: nowrap; }

/* ---------- forms ---------- */
.stack { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 500; font-size: 14px; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--text); background: var(--paper); border: 1px solid #D5CBD8; border-radius: 8px; padding: 10px 12px; width: 100%; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }
p.hint { margin-top: -8px; }
.row2 { display: grid; gap: 16px; }
@media (min-width: 600px) { .row2 { grid-template-columns: 1fr 1fr; align-items: start; } }
.check { display: flex; gap: 10px; align-items: center; font-weight: 400; font-size: 15px; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--ink); }
.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seg legend { font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; width: 1px; min-height: 0; }
.seg span { display: inline-block; padding: 9px 16px; border: 1px solid #D5CBD8; border-radius: 999px; font-weight: 500; cursor: pointer; }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.with-btn { display: flex; gap: 8px; }
.private { border: 1px dashed #D5CBD8; border-radius: var(--r); padding: 14px; display: grid; gap: 12px; }
.form-actions { display: flex; gap: 18px; align-items: center; }
.form-actions.sticky { position: sticky; bottom: 76px; background: var(--porcelain); padding: 12px 0; }
@media (min-width: 860px) { .form-actions.sticky { bottom: 0; } }
.inline { display: flex; gap: 10px; flex-wrap: wrap; }
.inline .grow { flex: 1 1 220px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--ink-2); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: #CDBFD0; }
.btn.ghost:hover { border-color: var(--ink); color: var(--ink); background: var(--blush); }
.btn.wide { width: 100%; }
.stack > .btn { justify-self: start; }
.panel + .panel, .table-wrap + p + .panel { margin-top: 20px; }
.signout-mobile { margin-top: 8px; }
@media (min-width: 860px) { .signout-mobile { display: none; } }
.link-quiet { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; text-decoration-color: #CDBFD0; text-underline-offset: 3px; padding: 6px 0; }
.link-quiet:hover { color: var(--ink); }

/* ---------- lists & tables ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.chips a { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; font-size: 14px; font-weight: 500; }
.chips a small { color: var(--muted); margin-left: 4px; }
.chips a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips a.on small { color: #CBBFCD; }
.search { display: block; margin-bottom: 14px; max-width: 420px; }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th, .list td { padding: 11px 14px; text-align: left; border-top: 1px solid var(--line); }
.list thead th { border-top: 0; font-size: 13px; font-weight: 600; color: var(--muted); background: #FBFAFC; }
.list tr.group th { font: italic 500 17px/1.2 var(--serif); color: var(--gold-text); background: #FDFBF7; padding-top: 16px; }
.list td a { text-decoration: none; font-weight: 500; }
.list td a:hover { text-decoration: underline; }
.list .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.list tr.off td { color: var(--muted); }
.row-actions { text-align: right; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #EFEAF0; color: var(--muted); }
.tag.gold { background: var(--gold-wash); color: var(--gold-text); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.howto { padding-left: 20px; margin: 0 0 20px; display: grid; gap: 8px; font-size: 14px; }

.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.people li { display: flex; gap: 14px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.people li.off { opacity: .6; }
.person { display: grid; gap: 3px; flex: 1; min-width: 0; }
.person a { text-decoration: none; }
.person-meta { display: grid; text-align: right; gap: 2px; font-size: 14px; }
@media (max-width: 600px) { .people li { flex-wrap: wrap; } .person-meta { text-align: left; width: 100%; padding-left: 58px; } }

.settings-grid { display: grid; gap: 0 20px; }
@media (min-width: 1000px) { .settings-grid { grid-template-columns: 1fr 1fr; align-items: start; } .settings-grid .form-actions { grid-column: 1 / -1; } }
table.hours { width: 100%; border-collapse: collapse; font-size: 14px; }
.hours th, .hours td { padding: 6px 6px 6px 0; text-align: left; }
.hours thead th { color: var(--muted); font-weight: 600; font-size: 13px; }
.hours tbody th { font-weight: 500; }
.hours input[type=time] { padding: 8px; min-height: 40px; }
.hours input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--ink); }
.hours tr.off input[type=time] { opacity: .35; }

@media (prefers-reduced-motion: no-preference) {
  .greeting h1 { animation: rise .6s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
}

.show-sm { display: none; }
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .show-sm { display: block; font-size: 12px; margin-top: 2px; }
  .list th, .list td { padding: 10px 10px; }
}

/* ================= Phase 2: bookings ================= */
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel-head h2 { margin-bottom: 4px; }
.btn.wa { background: #1F7A4D; border-color: #1F7A4D; }
.btn.wa:hover { background: #17633E; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.tag.st-confirmed { background: var(--gold-wash); color: var(--gold-text); }
.tag.st-completed { background: #E4F0E9; color: #22503A; }
.tag.st-cancelled, .tag.st-no_show { background: #F6E6E3; color: #7A2C25; }

.agenda { list-style: none; margin: 10px 0 0; padding: 0; }
.agenda li { border-top: 1px solid var(--line); }
.agenda li:first-child { border-top: 0; }
.agenda a { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center; padding: 11px 2px; text-decoration: none; }
.agenda a:hover { background: #FBF9FB; }
.agenda time { font: 500 16px/1.1 var(--serif); color: var(--gold-text); }
.agenda.big a { grid-template-columns: 64px 1fr auto; padding: 16px 16px; }
.agenda.big { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.agenda.big time { font-size: 26px; display: grid; }
.agenda.big time small { font: 600 11px/1 var(--sans); color: var(--muted); margin-top: 4px; }
.agenda.big span { display: grid; gap: 2px; font-size: 14px; }
.agenda.big strong { font-size: 16px; }
.agenda.big em { font-style: normal; color: var(--muted); font-size: 13px; }
.agenda li.st-completed time, .agenda li.st-no_show time { color: var(--muted); }
.day-nav { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.day-nav strong { min-width: 90px; text-align: center; font-size: 16px; }
.day-nav .btn:last-child { margin-left: auto; }

.share { display: grid; gap: 12px; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-row input { flex: 1 1 260px; background: #FBF9FB; }
@media (min-width: 860px) { .share { grid-template-columns: 1fr 1.3fr; align-items: center; } .share h2 { margin-bottom: 4px; } }

.detail-grid { display: grid; gap: 0 20px; }
@media (min-width: 900px) { .detail-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.ticket-lines { margin: 0; display: grid; }
.ticket-lines > div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.ticket-lines > div:first-child { border-top: 0; }
.ticket-lines dt { color: var(--muted); font-size: 14px; }
.ticket-lines dd { margin: 0; }
.ticket-lines.compact > div { padding: 8px 0; }

/* Calendar: one column per stylist */
.cal-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.cal { min-width: calc(64px + var(--cols) * 170px); }
.cal-head, .cal-body { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(170px, 1fr)); }
.cal-head { position: sticky; top: 0; background: #FBFAFC; border-bottom: 1px solid var(--line); z-index: 2; }
.cal-head span { padding: 12px; font-weight: 600; font-size: 14px; border-left: 1px solid var(--line); }
.cal-head span:first-child { border-left: 0; }
.cal-body { height: calc(var(--h) + 12px); }
.cal-times, .cal-col { position: relative; }
.cal-times span { position: absolute; right: 10px; transform: translateY(-50%); font-size: 12px; color: var(--muted); margin-top: 6px; }
.cal-times span:first-child { transform: none; margin-top: 4px; }
.cal-col { border-left: 1px solid var(--line); }
.cal-col i { position: absolute; left: 0; right: 0; border-top: 1px dashed #ECE5EE; }
.appt { position: absolute; left: 5px; right: 5px; margin-top: 2px; border-radius: 14px 14px 6px 6px; padding: 6px 10px; overflow: hidden; text-decoration: none; font-size: 12.5px; line-height: 1.3; background: var(--gold-wash); border: 1px solid #E2CFA6; color: var(--ink); display: flex; flex-direction: column; }
.appt strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt span { color: #5E4C60; overflow: hidden; }
.appt:hover { border-color: var(--gold); color: var(--ink); box-shadow: 0 6px 16px -10px rgba(43,29,46,.5); }
.appt.src-phone, .appt.src-walk_in { background: var(--blush); border-color: #DCC7D7; }
.appt.st-completed { background: #E7F1EB; border-color: #BFD8C9; }
.appt.st-no_show { background: #F4F1F4; border-color: #E0D8E1; text-decoration: line-through; }
.now { position: absolute; left: -1px; right: 0; border-top: 2px solid var(--rose); z-index: 1; }
.now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--rose); }
.legend { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.key { display: inline-block; width: 14px; height: 14px; border-radius: 7px 7px 3px 3px; border: 1px solid; vertical-align: -2px; margin-right: -8px; }
.key.online { background: var(--gold-wash); border-color: #E2CFA6; }
.key.phone { background: var(--blush); border-color: #DCC7D7; }
.key.done { background: #E7F1EB; border-color: #BFD8C9; }

.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slots form { margin: 0; }
.slot, .slots.pick span { display: inline-flex; align-items: center; justify-content: center; min-width: 92px; min-height: 44px; padding: 8px 12px; border-radius: 22px 22px 8px 8px; border: 1px solid #D8CCDA; background: var(--paper); font: 500 15px/1 var(--sans); color: var(--ink); text-decoration: none; cursor: pointer; font-variant-numeric: tabular-nums; }
.slot:hover { border-color: var(--gold); background: var(--gold-wash); color: var(--ink); }
.slots.pick label { display: block; }
.slots.pick input { position: absolute; opacity: 0; width: 1px; min-height: 0; }
.slots.pick input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.slots.pick input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.slot-group { font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 8px; }
select[multiple] { min-height: 180px; padding: 6px; }

/* ================= Public booking page ================= */
body.public { background: var(--porcelain); }
.pub-head { background: var(--ink); color: #CFC3D1; text-align: center; padding: calc(28px + env(safe-area-inset-top)) 20px 78px; }
.pub-head .wordmark { font-size: 34px; }
.pub-head p { font-size: 13px; margin-top: 8px; }
.pub-main { max-width: 640px; margin: -56px auto 0; padding: 0 14px 40px; }
.pub-foot { text-align: center; color: var(--muted); font-size: 14px; padding: 10px 20px 40px; }
.bcard { background: var(--paper); border: 1px solid var(--line); border-radius: 160px 160px var(--r) var(--r); padding: 56px 22px 24px; box-shadow: 0 20px 40px -32px rgba(43,29,46,.55); margin-bottom: 18px; }
@media (max-width: 480px) { .bcard { border-radius: 120px 120px var(--r) var(--r); padding-top: 48px; } }
.bcard h1 { text-align: center; font-size: 28px; margin: 6px 0 12px; }
.bcard > p.muted { text-align: center; margin-bottom: 18px; }
.bcard .back { display: block; text-align: center; }
.bcard.center { text-align: center; }
.bcard.center p { margin: 0 auto 18px; max-width: 40ch; }
.bsteps { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: -4px 0 14px; padding: 0; counter-reset: b; font-size: 12px; color: var(--muted); }
.bsteps li { counter-increment: b; display: flex; align-items: center; gap: 5px; }
.bsteps li + li::before { content: ""; width: 14px; height: 1px; background: #D5CBD8; margin-right: 1px; }
.bsteps li::after { content: none; }
.bsteps li.cur { color: var(--ink); font-weight: 600; }
.bsteps li.done { color: var(--gold-text); }
.field-block { margin: 20px 0 0; }
.label { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.datestrip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.datestrip a { flex: none; scroll-snap-align: start; display: grid; justify-items: center; gap: 2px; width: 62px; padding: 10px 0 8px; border-radius: 31px 31px 8px 8px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; color: var(--ink); }
.datestrip strong { font: 500 22px/1 var(--serif); }
.datestrip small { font-size: 11px; color: var(--muted); }
.datestrip a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.datestrip a.on small { color: #CBBFCD; }
.svc-group { border: 0; padding: 0; margin: 18px 0 0; }
.svc-group legend { font: italic 500 19px/1.2 var(--serif); color: var(--gold-text); padding: 0; margin-bottom: 6px; }
.svc { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); font-weight: 400; cursor: pointer; }
.svc input { width: 20px; height: 20px; min-height: 0; accent-color: var(--ink); }
.svc-name { font-size: 15px; }
.svc-meta { display: grid; justify-items: end; font-size: 14px; white-space: nowrap; }
.svc:has(input:checked) { background: #FCF8F0; }
.basket { position: sticky; bottom: 0; margin: 18px -22px -24px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); display: flex; gap: 12px; align-items: center; justify-content: space-between; font-size: 14px; }
.trap { position: absolute; left: -9999px; }
.ticket h1 { margin-bottom: 8px; }
.ticket .btn.wa { margin: 6px 0 18px; }
.ticket .ref { font: 500 18px/1 var(--serif); letter-spacing: .06em; }
.ticket-actions { display: flex; gap: 18px; align-items: center; margin: 16px 0 8px; }
.arch-badge { width: 56px; height: 66px; margin: 0 auto; border-radius: 28px 28px 8px 8px; background: var(--sage); color: #fff; display: grid; place-items: center; font-size: 26px; }

/* ================= Phase 3: billing & stock ================= */
@media (max-width: 859px) { .nav a.desk-only { display: none; } }
.more-links { display: grid; padding: 6px 20px; }
.more-links a { padding: 13px 0; border-top: 1px solid var(--line); text-decoration: none; font-weight: 500; }
.more-links a:first-child { border-top: 0; }
.more-links a::after { content: "›"; float: right; color: var(--muted); }
@media (min-width: 860px) { .more-links { display: none; } }
.fig-link { display: grid; gap: 2px; text-decoration: none; }
.figures-note { margin: -10px 0 20px; }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.picker { display: grid; gap: 10px; margin-bottom: 14px; }
.picker .search { margin: 0; max-width: none; }
.pick-results { display: grid; gap: 6px; }
.pick { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: #FBFAFC; font: inherit; color: var(--ink); cursor: pointer; }
.pick:hover, .pick:focus-visible { border-color: var(--gold); background: var(--gold-wash); }
.pick small { font-size: 12px; }
.n-in { width: 64px; min-height: 38px; padding: 6px 8px; text-align: right; }
.n-in.wide { width: 96px; }
.lines select { min-height: 38px; padding: 6px 8px; min-width: 120px; }
.lines td { vertical-align: middle; }
.bill-grid { display: grid; gap: 0 20px; }
@media (min-width: 900px) { .bill-grid { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.pct { margin: 10px 0 16px; }
.note-field { margin-top: 4px; }
.totals dl { margin: 0 0 16px; display: grid; }
.totals dl > div { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line); }
.totals dl > div:first-child { border-top: 0; }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals .grand dt { font-weight: 600; }
.totals .grand dd { font: 500 30px/1 var(--serif); }
.pay3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 6px; }
.small.ok { color: var(--sage); font-weight: 500; }
.small.warn { color: var(--rose); font-weight: 500; }
.totals .btn.wide { margin-top: 12px; }

.receipt { background: var(--paper); border: 1px solid var(--line); border-radius: 120px 120px var(--r) var(--r); padding: 54px 26px 26px; margin-bottom: 20px; position: relative; max-width: 460px; }
.receipt header { text-align: center; margin-bottom: 16px; }
.receipt .wordmark { font-size: 28px; display: block; margin-bottom: 6px; }
.rc-meta { margin: 0 0 12px; font-size: 14px; }
.rc-meta > div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.rc-meta dt { color: var(--muted); }
.rc-meta dd { margin: 0; text-align: right; }
.rc-items { width: 100%; border-collapse: collapse; font-size: 14px; }
.rc-items td { padding: 8px 0; border-top: 1px dashed #DCD2DE; vertical-align: top; }
.rc-items td small { display: block; font-size: 12px; }
.rc-items .num { text-align: right; white-space: nowrap; padding-left: 12px; }
.rc-items tfoot td { border-top: 1px solid var(--line); }
.rc-items .grand td { font: 500 22px/1.2 var(--serif); padding-top: 12px; }
.rc-thanks { margin-top: 16px; font-style: italic; }
.receipt.void { opacity: .75; }
.void-stamp { margin-top: 14px; text-align: center; color: var(--rose); font-weight: 600; border: 2px solid var(--rose); border-radius: 8px; padding: 8px; }
details.danger { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
details.danger summary { cursor: pointer; color: var(--rose); font-weight: 500; font-size: 14px; }
details.danger form { margin-top: 12px; }
.use-form { align-items: end; margin-top: 12px; }
.use-form label { flex: none; }
.use-form .grow { flex: 1 1 220px; }

@media print {
  .rail, .nav, .noprint, .flash { display: none !important; }
  body, body.shell { display: block; background: #fff; }
  .main { padding: 0; }
  .detail-grid { display: block; }
  .receipt { border: 0; border-radius: 0; padding: 0; max-width: 80mm; margin: 0 auto; }
}
@media (max-width: 640px) {
  .lines thead { display: none; }
  .lines, .lines tbody, .lines tr, .lines td { display: block; }
  .lines tr { display: grid; grid-template-columns: 64px 96px 1fr; gap: 8px 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
  .lines tr:first-child { border-top: 0; }
  .lines td { border: 0; padding: 0; text-align: left; }
  .lines td:first-child { grid-column: 1 / -1; font-weight: 500; }
  .lines td.num { text-align: left; }
  .lines select { min-width: 0; width: 100%; }
  .lines td[data-amount] { grid-column: 1 / 3; align-self: center; font-weight: 600; }
  .lines td:last-child { text-align: right; }
  .lines .n-in, .lines .n-in.wide { width: 100%; }
}

/* ================= Founder view: profit and loss ================= */
.pl-figs > div { gap: 4px; }
.pl-figs .fig { font-size: 34px; }
.pl-figs .gain .fig { color: var(--sage); }
.pl-figs .loss .fig, tr.total.loss td { color: var(--rose); }
.delta { font-size: 12px; font-weight: 600; }
.delta.up { color: var(--sage); }
.delta.down { color: var(--rose); }
.daybars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: 150px; align-items: end; margin: 6px 0 10px; }
.db { height: 100%; display: grid; grid-template-rows: 1fr auto; align-items: end; gap: 4px; }
.db i { display: block; width: 100%; min-height: 0; background: var(--gold); border-radius: 99px 99px 2px 2px; opacity: .85; }
.db:hover i { opacity: 1; background: var(--gold-text); }
.db.future i { background: var(--line); }
.db small { font-size: 10px; color: var(--muted); text-align: center; height: 12px; }
table.pl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.pl th, .pl td { padding: 8px 0; text-align: left; font-weight: 400; }
.pl thead th { font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 0; }
.pl .num { text-align: right; padding-left: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl tr.line th { padding-left: 14px; color: #4A3B4D; }
.pl tr.sub th, .pl tr.sub td { font-weight: 600; border-top: 1px solid var(--line); }
.pl tr.total th, .pl tr.total td { border-top: 2px solid var(--ink); padding-top: 12px; }
.pl tr.total th { font: 500 20px/1.2 var(--serif); }
.pl tr.total td:nth-child(2) { font: 500 22px/1.2 var(--serif); }
.pl-note { margin-top: 12px; }
.table-wrap.flat { border: 0; }
.pl-teaser { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; text-decoration: none; color: var(--ink); }
.pl-teaser > span { display: grid; }
.pl-teaser strong { font: 500 22px/1.2 var(--serif); }
.pl-teaser .gain strong { color: var(--sage); }
.pl-teaser .loss strong { color: var(--rose); }
.pl-teaser .go { margin-left: auto; font-weight: 600; color: var(--gold-text); }
.pl-teaser:hover { border-color: var(--gold); color: var(--ink); }
.errbox { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: #F8ECEA; color: #7A2C25; padding: 12px 14px; border-radius: 8px; text-align: left; max-width: 70ch; margin: 0 auto 16px; word-break: break-word; }

/* ================= Super admin ================= */
.btn.danger { background: transparent; color: var(--rose); border-color: #E3B8B2; }
.btn.danger:hover { background: #F8ECEA; color: #7A2C25; border-color: var(--rose); }
.delete-form { margin-top: 20px; padding-top: 16px; border-top: 1px dashed #E3B8B2; }
.activity .delete-form { margin: 0; padding: 0; border: 0; }
.activity .delete-form .btn { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.admin-figs { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 860px) { .admin-figs { grid-template-columns: repeat(3, 1fr); } }
.admin-figs .fig { font-size: 30px; }
.search-row { margin-bottom: 14px; max-width: 560px; }
.panel-head select { min-height: 36px; padding: 4px 10px; width: auto; }

/* Returning customer suggestions */
.suggest-wrap { position: relative; }
.cust-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--paper); border: 1px solid #D5CBD8; border-radius: 10px; box-shadow: 0 14px 30px -18px rgba(43,29,46,.55); max-height: 320px; overflow-y: auto; }
.cust-suggest li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 9px 10px; border-radius: 7px; cursor: pointer; font-weight: 400; }
.cust-suggest li small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.cust-suggest li span { font-variant-numeric: tabular-nums; }
.cust-suggest li:hover, .cust-suggest li.on { background: var(--gold-wash); }
.cust-info { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #EAF3EE; color: #22503A; font-size: 14px; grid-column: 1 / -1; }
.cust-info a { color: #22503A; font-weight: 600; }
.cust-note { display: block; margin-top: 4px; color: var(--ink); }
.cust-summary dt { width: auto; }
.plain-link { color: inherit; }
.bulk-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 10px; border: 1px dashed #E3B8B2; border-radius: 10px; background: #FDF7F6; font-size: 14px; color: #7A2C25; }
.pick-col { width: 40px; }
.pick-col input { width: 18px; height: 18px; min-height: 0; accent-color: var(--rose); }
.row-del { text-align: right; width: 1%; }
.link-danger { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 13px; color: var(--rose); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-danger:hover { color: #7A2C25; }
.row-actions form { display: inline; }
.row-actions .link-danger { margin-left: 12px; }
p.small.warn { margin-top: 6px; max-width: 70ch; }

/* Category management */
.cat-panel { max-width: 820px; }
.cat-list { list-style: none; margin: 8px 0 16px; padding: 0; }
.cat-list > li { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.cat-list > li:first-child { border-top: 0; }
.cat-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cat-row .grow { flex: 1 1 220px; }
.cat-row input, .cat-row select { min-height: 38px; padding: 6px 10px; }
.cat-row.sub { padding-left: 14px; font-size: 13px; }
.cat-row.sub label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.cat-row.sub select { width: auto; flex: 1; }
.btn.icon { min-width: 38px; padding: 6px 0; }
.btn[disabled].icon { opacity: .3; }
.cat-n { min-width: 80px; text-align: right; }
.cat-del { padding-left: 14px; }
.add-cat { padding-top: 12px; border-top: 1px solid var(--line); }
.row-actions > a.link-quiet { margin-right: 12px; }
.cat-more summary { cursor: pointer; font-size: 13px; color: var(--muted); padding-left: 14px; width: max-content; }
.cat-more summary:hover { color: var(--ink); }
.cat-more[open] { display: grid; gap: 8px; }
.cat-more[open] summary { margin-bottom: 4px; }

/* ================= Attendance ================= */
@media (min-width: 860px) { .more-links.always { display: grid; } }
.att { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #EFEAF0; color: var(--muted); white-space: nowrap; }
.att-present, .att-open { background: #E4F0E9; color: #22503A; }
.att-late, .att-missing_out { background: var(--gold-wash); color: var(--gold-text); }
.att-absent { background: #F6E6E3; color: #7A2C25; }
.att-leave, .att-off { background: #ECE8F4; color: #4B3F6B; }
.att + small, td > small.muted { display: block; }
.att-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.att-card.in { border-color: #BFD8C9; background: #F4FAF6; }
.att-card.out { border-color: var(--gold); background: var(--gold-wash); }
.att-card strong { font-size: 16px; }
.att-card .att { margin-left: 8px; }
.att-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--sage); margin-right: 8px; box-shadow: 0 0 0 4px #DDEEE4; }
.seg-links { display: inline-flex; border: 1px solid #CDBFD0; border-radius: 999px; overflow: hidden; }
.seg-links a { padding: 9px 18px; text-decoration: none; font-weight: 600; font-size: 14px; }
.seg-links a.on { background: var(--ink); color: #fff; }
table.register { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.register th, .register td { border-top: 1px solid var(--line); padding: 6px 4px; text-align: center; min-width: 26px; }
.register thead th { font-weight: 600; color: var(--muted); background: #FBFAFC; line-height: 1.1; }
.register thead th small { display: block; font-size: 10px; font-weight: 400; }
.register th.who { text-align: left; padding-left: 12px; min-width: 130px; position: sticky; left: 0; background: var(--paper); z-index: 1; }
.register thead th.who { background: #FBFAFC; }
.register .shut, .register td.c-closed { background: #F4F1F5; }
.register th.today { color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }
.register td a { text-decoration: none; display: block; font-weight: 600; }
.register td.c-present a, .register td.c-present, .register td.c-open, .register td.c-missing_out, .register td.c-missing_out a, .register td.c-open a { color: var(--sage); }
.register td.c-late, .register td.c-late a { color: var(--gold-text); background: #FCF6EA; }
.register td.c-absent, .register td.c-absent a { color: var(--rose); background: #FBF0EE; }
.register td.c-leave, .register td.c-off, .register td.c-leave a, .register td.c-off a { color: #4B3F6B; }
.register .tot { font-weight: 600; min-width: 60px; white-space: nowrap; border-left: 1px solid var(--line); }
.register .tot small { font-weight: 400; }
.register .tot { border-left: 0; background: #FBFAFC; }
.register .first { border-left: 2px solid var(--line); }
.register td.tot small { display: block; }
.main { min-width: 0; }
.day-nav { flex-wrap: wrap; }
@media (max-width: 600px) { .day-nav .btn:not(.ghost), .day-nav .btn.ghost:nth-last-child(2):not([aria-label]) { margin-left: 0; } .day-nav > a:not([aria-label]) { flex: 1 1 40%; } }

/* ================= Salaries ================= */
.flash-warn { background: var(--gold-wash); border-color: var(--gold); color: var(--gold-text); }
.pay-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pay-list > li { margin: 0; }
.pay-list > li.settled { opacity: .75; }
.pay-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.pay-head strong { font-size: 17px; margin-right: 8px; }
.pay-head .tag { margin-left: 6px; }
.pay-due { display: grid; justify-items: end; }
.pay-due .fig { font-size: 30px; }
.pay-lines { margin: 0 0 8px; display: grid; }
.pay-lines > div { display: grid; grid-template-columns: 190px 1fr; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.pay-lines dt { color: var(--muted); }
.pay-lines dd { margin: 0; }
.pay-lines .total dt, .pay-lines .total dd { font-weight: 600; }
@media (max-width: 600px) { .pay-lines > div { grid-template-columns: 1fr; gap: 2px; } }
.pay-form { margin-top: 10px; }
.pay-form summary { list-style: none; }
.pay-form summary::-webkit-details-marker { display: none; }
.pay-form[open] summary { display: none; }
.pay-form form { margin-top: 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: #FBFAFC; }
.pl-teaser.due { border-color: var(--gold); background: var(--gold-wash); }

/* Check in / Check out button in the header */
.att-pill { display: flex; align-items: center; gap: 8px; border-radius: 999px; padding: 4px 4px 4px 12px; font-size: 13px; }
.att-pill.in { background: rgba(59,113,87,.22); color: #D5ECDF; }
.att-pill.out { background: rgba(176,138,62,.22); color: #F0E2C4; }
.att-pill button { border: 0; border-radius: 999px; padding: 7px 14px; font: 600 13px/1 var(--sans); cursor: pointer; }
.att-pill.in button { background: #E4F0E9; color: #1E4A34; }
.att-pill.out button { background: var(--gold); color: var(--ink); }
.att-pill-text { white-space: nowrap; }
.btn.big { min-height: 52px; padding: 12px 28px; font-size: 16px; }
@media (max-width: 859px) {
  .rail { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .att-pill-text { display: none; }
  .att-pill { padding: 0; background: none !important; }
}
@media (min-width: 860px) {
  .rail .att-pill { margin: -18px 0 22px; justify-content: space-between; }
}
.att-pill button { white-space: nowrap; }
.att-card p strong { font-size: inherit; }
