/* Endurance Salon — red, white and black (the Endurance brand). One bold thing: the bill, drawn like a receipt.
   --teal is the accent name kept from the first draft; it now holds the brand red. */
:root {
  --ink: #141414; --ink2: #3D3D3D; --muted: #6E6E6E;
  --teal: #D7261E; --teal-dk: #A81B14; --mint: #FBECEB; --mint2: #F6F6F6;
  --line: #DCDCDC; --page: #F2F2F2; --paper: #FFFFFF;
  --bad: #C2362F; --bad-bg: #FBECEA; --warn-bg: #FFF4DB;
  --display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 12px; --side: 232px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.sl { margin: 0; background: var(--page); color: var(--ink); font: 400 15.5px/1.5 var(--body); }
a { color: var(--teal); }
h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; letter-spacing: -.01em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* ---------- side menu ---------- */
.sb { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px; z-index: 30; }
.sb__brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; color: var(--ink); }
.sb__brand img { width: 34px; height: 34px; }
.sb__brand b { font: 800 19px var(--display); }
.sb__brand small { display: block; font: 500 12px var(--body); color: var(--muted); margin-top: -2px; }
.sb nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.sb__grp { font-size: 12.5px; color: var(--muted); padding: 14px 12px 4px; }
.sb__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink2); text-decoration: none; font-weight: 600; }
.sb__item svg { flex: none; }
.sb__item:hover { background: var(--mint2); color: var(--ink); }
.sb__item.is-on { background: var(--ink); color: #fff; box-shadow: inset 4px 0 0 var(--teal); }
.sb__foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.sb__foot b { color: var(--ink); display: block; }
.sb__foot a { margin-left: auto; color: var(--ink2); }
.mbar { display: none; }

/* ---------- page ---------- */
.wrap { margin-left: var(--side); padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: calc(var(--side) + 1240px); }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 22px; }
.head h1 { font-size: clamp(28px, 3.2vw, 38px); font-weight: 800; line-height: 1.1; }
.head p { margin: 4px 0 0; color: var(--muted); max-width: 64ch; }
.head__act { display: flex; flex-wrap: wrap; gap: 10px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; margin-bottom: 18px; }
.card > h2 { font-size: 19px; margin-bottom: 14px; }
.card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.card__head h2 { font-size: 19px; }
.muted { color: var(--muted); }
.notice { padding: 13px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; background: #FFFFFF; color: var(--ink); border: 1px solid var(--line); border-left: 5px solid var(--ink); }
.notice.bad { background: var(--bad-bg); color: var(--bad); border-color: #F0C4C1; border-left-color: var(--bad); }
.notice.warn { background: var(--warn-bg); color: #6B4700; border-color: #F0DDAE; border-left-color: #C98A00; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.layout > * { min-width: 0; }

/* ---------- buttons and boxes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: 700 15px var(--body); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink2); }
.btn--teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn--teal:hover { background: var(--teal-dk); border-color: var(--teal-dk); }
.btn--ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--big { min-height: 54px; font-size: 16.5px; padding: 0 24px; }
.btn--sm { min-height: 36px; font-size: 13.5px; padding: 0 12px; }
.btn--bad { color: var(--bad); border-color: #E9B7B3; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font-weight: 600; font-size: 14px; color: var(--ink2); }
.fld .req { color: var(--bad); font-style: normal; }
.fld small { color: var(--muted); font-size: 12.5px; }
.ctl { width: 100%; min-height: 46px; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); font: 400 16px var(--body); color: var(--ink); }
.ctl:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(215,38,30,.15); }
textarea.ctl { min-height: 80px; resize: vertical; }
.ctl--big { min-height: 54px; font-size: 17px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .fld { min-width: 160px; }

/* pick-one / pick-many chips (real radios and checkboxes underneath) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); font-weight: 600; cursor: pointer; }
.chip span small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.chip input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip input:checked + span small { color: #F7CFCC; }
.chip input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }
.chip input:disabled + span { opacity: .4; cursor: default; }

/* ---------- tables and lists ---------- */
.dt-wrap { overflow-x: auto; }
.dt { width: 100%; border-collapse: collapse; }
.dt th { text-align: left; font-size: 13px; font-weight: 700; color: var(--muted); padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.dt td { padding: 12px 10px; border-bottom: 1px solid #EAEAEA; vertical-align: top; }
.dt tr:last-child td { border-bottom: 0; }
.dt .r { text-align: right; } .dt .num { font-variant-numeric: tabular-nums; }
.dt tr.is-off td { color: var(--muted); }
.dt tr.is-void td { text-decoration: line-through; color: var(--muted); }
.dt tfoot td { font-weight: 800; border-top: 1.5px solid var(--line); }
.empty { padding: 28px 10px; text-align: center; color: var(--muted); }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: #EFEFEF; color: var(--ink); white-space: nowrap; }
.tag.off { background: #EFEFEF; color: var(--muted); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.warn { background: var(--warn-bg); color: #7A5200; }

/* tabs and period buttons */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tabs a { padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink2); font-weight: 700; text-decoration: none; }
.tabs a.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- home ---------- */
.today { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.fig { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.fig span { display: block; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.fig b { display: block; font: 800 30px/1.15 var(--display); margin-top: 4px; font-variant-numeric: tabular-nums; }
.fig small { color: var(--muted); }
.fig--main { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: inset 0 -5px 0 var(--teal); }
.fig--main span, .fig--main small { color: #BDBDBD; } .fig--main b { color: #fff; font-size: 38px; }
.do { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.do a { display: flex; flex-direction: column; gap: 6px; padding: 18px; min-height: 120px; border-radius: var(--r); background: var(--paper); border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); }
.do a:hover { border-color: var(--teal); }
.do a b { font: 800 19px var(--display); }
.do a span { color: var(--muted); font-size: 14px; }
.do a svg { color: var(--teal); margin-bottom: 4px; }
.do a.is-main { background: var(--ink); border-color: var(--ink); color: #fff; }
.do a.is-main span { color: #BDBDBD; } .do a.is-main svg { color: #FF5A50; }

/* rows: appointments, customers */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 4px; border-bottom: 1px solid #EAEAEA; }
.rows > li:last-child { border-bottom: 0; }
.rows .when { font: 800 17px var(--display); font-variant-numeric: tabular-nums; }
.rows .who b { display: block; font-size: 16.5px; }
.rows .who small { color: var(--muted); display: block; }
.rows .act { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.rows > li.is-done, .rows > li.is-gone { opacity: .6; }

/* ---------- the bill: the one bold thing ---------- */
.bill { position: sticky; top: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; padding: 20px 20px 26px; }
.bill::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 12px;
  background: linear-gradient(-45deg, transparent 6px, var(--paper) 0) 0 0 / 12px 12px repeat-x, linear-gradient(45deg, transparent 6px, var(--paper) 0) 0 0 / 12px 12px repeat-x;
  filter: drop-shadow(0 1px 0 var(--line)); }
.bill h2 { font-size: 18px; display: flex; justify-content: space-between; align-items: baseline; }
.bill h2 small { font: 600 13px var(--body); color: var(--muted); }
.bill__lines { list-style: none; margin: 12px 0; padding: 0; border-top: 1.5px dashed var(--line); }
.bill__lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed #E6E6E6; }
.bill__lines li b { font-weight: 700; }
.bill__lines li small { grid-column: 1; color: var(--muted); }
.bill__lines .amt { font-variant-numeric: tabular-nums; font-weight: 700; }
.bill__lines .x { border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 0 4px; line-height: 1; }
.bill__lines .x:hover { color: var(--bad); }
.bill__lines .qty { width: 56px; min-height: 34px; padding: 4px 6px; text-align: center; border: 1.5px solid var(--line); border-radius: 8px; font: 600 15px var(--body); }
.bill__lines select { grid-column: 1 / -1; min-height: 36px; padding: 4px 8px; border: 1.5px solid var(--line); border-radius: 8px; font: 500 14px var(--body); background: var(--paper); }
.bill__empty { color: var(--muted); padding: 16px 0; text-align: center; }
.sums { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-variant-numeric: tabular-nums; }
.sums span { color: var(--ink2); } .sums b { text-align: right; }
.sums .less { color: var(--teal-dk); }
.disc { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.points { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--mint2); margin-bottom: 12px; font-size: 14.5px; }
.points input { width: 22px; height: 22px; accent-color: var(--teal); }
.total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; margin-top: 10px; border-top: 2px solid var(--ink); }
.total span { font: 700 16px var(--display); }
.total b { font: 800 44px/1 var(--display); letter-spacing: -.02em; color: var(--teal); font-variant-numeric: tabular-nums; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 10px; }
.modes .chip span { justify-content: center; text-align: center; }
.earn { font-size: 13.5px; color: var(--muted); margin: 8px 0 14px; }

/* the price list on the left of the bill screen */
.ptabs { display: flex; gap: 6px; margin-bottom: 12px; }
.ptabs button { flex: 1; min-height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); font: 700 15px var(--body); color: var(--ink2); cursor: pointer; }
.ptabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.items button { text-align: left; min-height: 72px; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.items button:hover { border-color: var(--teal); background: var(--mint2); }
.items button b { font-weight: 700; }
.items button span { color: var(--teal-dk); font-weight: 800; font-variant-numeric: tabular-nums; }
.items button small { color: var(--muted); font-size: 12.5px; }

/* customer drop-down */
.pick { position: relative; }
.pick__list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; max-height: 320px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1.5px solid var(--ink); border-radius: 10px; box-shadow: 0 16px 34px rgba(20,20,20,.16); }
.pick__list li[data-id] { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.pick__list li[data-id]:hover, .pick__list li.is-act { background: var(--mint); }
.pick__av { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--teal); color: #fff; font: 800 14px var(--display); }
.pick__txt { flex: 1; min-width: 0; } .pick__txt b { display: block; } .pick__txt small { color: var(--muted); }
.pick__due { flex: none; padding: 2px 9px; border-radius: 999px; background: var(--mint); color: var(--teal-dk); font-size: 12px; font-weight: 700; }
.pick__none { padding: 12px; color: var(--muted); }
.pick__caret { position: absolute; right: 16px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 2px solid var(--ink2); border-bottom: 2px solid var(--ink2); transform: rotate(45deg); pointer-events: none; }
.pick .ctl { padding-right: 40px; }
.who-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--mint2); border: 1.5px solid var(--line); }
.who-box b { display: block; } .who-box small { color: var(--muted); }
.who-box .btn { margin-left: auto; }

/* ---------- sign in ---------- */
.gate { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.gate__art { background: var(--ink); color: #fff; border-right: 6px solid var(--teal); padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.gate__art h1 { color: #fff; font-size: clamp(38px, 5vw, 64px); font-weight: 800; line-height: 1.02; max-width: 12ch; }
.gate__art p { color: #C4C4C4; max-width: 40ch; font-size: 17px; }
.gate__art svg.comb { position: absolute; right: -40px; top: -20px; width: 300px; opacity: .9; color: var(--teal); }
.gate__art > :not(svg) { position: relative; z-index: 1; }
.gate__form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--paper); }
.gate__form form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.gate__form h2 { font-size: 28px; }

/* ---------- print (bill) ---------- */
.receipt { max-width: 420px; margin: 0 auto; background: #fff; padding: 24px; border: 1px solid var(--line); border-radius: var(--r); }
.receipt h2 { text-align: center; font-size: 22px; }
.receipt .shop { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.receipt table { width: 100%; border-collapse: collapse; font-size: 14px; }
.receipt td { padding: 5px 0; vertical-align: top; } .receipt td.r { text-align: right; white-space: nowrap; }
.receipt .rule { border-top: 1.5px dashed var(--ink2); }
@media print {
  body.sl { background: #fff; } .sb, .mbar, .noprint { display: none !important; }
  .wrap { margin: 0; padding: 0; } .receipt { border: 0; padding: 0; }
}

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } .bill { position: static; } .today { grid-template-columns: 1fr 1fr; } .do { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .sb { display: none; }
  .wrap { margin-left: 0; padding: 18px 16px 96px; }
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--paper); border-top: 1px solid var(--line); overflow-x: auto; }
  .mbar a { flex: 1 0 72px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; font-size: 11.5px; font-weight: 700; color: var(--ink2); text-decoration: none; }
  .mbar a.is-on { color: var(--teal); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .gate { grid-template-columns: 1fr; } .gate__art { min-height: 240px; }
  .rows > li { grid-template-columns: 64px minmax(0, 1fr); } .rows .act { grid-column: 1 / -1; justify-content: flex-start; }
  .dt.cards thead { display: none; }
  .dt.cards tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .dt.cards td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 2px; text-align: right; }
  .dt.cards td::before { content: attr(data-label); color: var(--muted); font-weight: 600; text-align: left; }
  .dt.cards td.r { justify-content: space-between; }
}
@media (max-width: 520px) { .today { grid-template-columns: 1fr; } .do { grid-template-columns: 1fr; } .disc { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.modes .chip { display: block; } .modes .chip span { width: 100%; min-height: 50px; font-size: 16px; }

/* phones: the bill sits below the price list, so a bar keeps the running total in sight */
.mtotal { display: none; }
@media (max-width: 1100px) {
  .mtotal:not([hidden]) { display: flex; position: sticky; bottom: 76px; z-index: 20; align-items: center; gap: 12px; padding: 12px 16px; margin-top: 12px;
    border-radius: 12px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 600; box-shadow: 0 10px 24px rgba(20,20,20,.25); }
  .mtotal b { font: 800 20px var(--display); margin-right: auto; }
  .mtotal span:last-child { color: #FF5A50; }
}
@media (min-width: 861px) and (max-width: 1100px) { .mtotal:not([hidden]) { bottom: 16px; } }
@media (max-width: 860px) { .items { grid-template-columns: repeat(2, minmax(0, 1fr)); } .items button { min-height: 64px; padding: 10px 12px; } }

/* filter bar on Appointments and Bills */
.find .filters .fld { flex: 1 1 160px; }
.find__go { display: flex; gap: 8px; }
.rows .when small { display: block; font: 600 12.5px var(--body); color: var(--muted); }
@media (max-width: 600px) { .find .filters .fld { flex-basis: calc(50% - 6px); min-width: 0; } .find__go { flex: 1 1 100%; } .find__go .btn { flex: 1; } }
