:root {
  --brand: #0f766e; --brand-ink: #fff; --bg: #f6f7f9; --card: #fff; --ink: #14181f; --muted: #5d6673;
  --line: #e3e6eb; --soft: #eef6f5; --danger: #b42318; --warn: #b54708; --ok: #067647; --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.45; background: var(--bg); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: .25rem 0 .75rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
a { color: var(--brand); }
button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: .6rem 1rem; border-radius: 10px; }
button:hover { border-color: var(--brand); }
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.danger { color: var(--danger); border-color: #f3c7c3; }
.big { width: 100%; padding: .9rem 1rem; font-size: 1.05rem; }
input, select, textarea { font: inherit; width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
label { display: block; font-size: .85rem; font-weight: 600; margin: .6rem 0 .25rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.error { color: var(--danger); font-weight: 600; min-height: 1.2em; }
.hidden { display: none !important; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--line); }
.pill.ok { background: #dcfae6; color: var(--ok); } .pill.warn { background: #fef0c7; color: var(--warn); }
.pill.bad { background: #fee4e2; color: var(--danger); } .pill.info { background: var(--soft); color: var(--brand); }

/* ---------- booking page ---------- */
.book-wrap { max-width: 1040px; margin: 0 auto; padding: 1.25rem 16px 6rem; display: grid; grid-template-columns: 1fr 320px; gap: 1.25rem; align-items: start; }
.book-head { grid-column: 1 / -1; }
.book-wrap > * { min-width: 0; }
.step-num { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: .85rem; margin-right: .4rem; }
.stepper { display: flex; align-items: center; gap: .5rem; }
.stepper button { width: 2.4rem; height: 2.4rem; padding: 0; border-radius: 50%; font-size: 1.2rem; }
.stepper output { min-width: 2.2rem; text-align: center; font-weight: 700; font-size: 1.1rem; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; }
.choice { text-align: left; padding: .7rem .8rem; }
.choice .sub { display: block; font-size: .8rem; color: var(--muted); }
.choice[aria-pressed="true"] { border: 2px solid var(--brand); background: var(--soft); padding: calc(.7rem - 1px) calc(.8rem - 1px); }
.days { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: thin; }
.day { flex: 0 0 auto; width: 4.2rem; text-align: center; padding: .45rem 0; }
.day b { display: block; font-size: 1.1rem; }
.day[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.day:disabled { opacity: .35; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: .4rem; margin-top: .75rem; }
.times button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.summary { position: sticky; top: 1rem; }
.summary .line { display: flex; justify-content: space-between; gap: .5rem; font-size: .92rem; margin: .2rem 0; }
.summary .total { font-size: 1.4rem; font-weight: 800; border-top: 1px solid var(--line); padding-top: .5rem; margin-top: .5rem; }
#card-element { padding: .75rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mobile-bar { display: none; }
.done { max-width: 560px; margin: 2rem auto; padding: 0 16px; }
.check { width: 3.5rem; height: 3.5rem; border-radius: 50%; background: #dcfae6; color: var(--ok); display: grid; place-items: center; font-size: 1.8rem; margin-bottom: .75rem; }

@media (max-width: 820px) {
  .book-wrap { grid-template-columns: 1fr; }
  .summary { position: static; }
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line);
    padding: .7rem 16px; justify-content: space-between; align-items: center; z-index: 5; }
  .grid2 { grid-template-columns: 1fr; }
}

/* ---------- dashboard ---------- */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: #101828; color: #d0d5dd; padding: 1rem .75rem; }
.side .brand { color: #fff; font-weight: 800; font-size: 1.1rem; padding: .25rem .5rem 1rem; }
.side button { display: block; width: 100%; text-align: left; background: none; border: 0; color: inherit; padding: .6rem .7rem; border-radius: 8px; margin-bottom: 2px; }
.side button[aria-current="page"], .side button:hover { background: #1d2939; color: #fff; }
.main { padding: 1.25rem 1.5rem; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; text-align: left; }
.stat b { display: block; font-size: 1.6rem; }
.stat.alert { border-color: #fec84b; background: #fffaeb; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.daygroup h3 { margin: 1.1rem 0 .4rem; }
.job { display: grid; grid-template-columns: 80px 1fr auto; gap: .75rem; align-items: center; background: var(--card); border: 1px solid var(--line);
  border-left: 5px solid var(--c, #98a2b3); border-radius: 10px; padding: .7rem .9rem; margin-bottom: .5rem; }
.job .time { font-weight: 700; }
.job .actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.job .actions button { padding: .4rem .7rem; font-size: .88rem; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.toolbar input, .toolbar select { width: auto; }
dialog { border: 0; border-radius: var(--radius); padding: 1.25rem; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(16,24,40,.45); }
.toast { position: fixed; bottom: 1rem; right: 1rem; background: #101828; color: #fff; padding: .75rem 1rem; border-radius: 10px; z-index: 50; max-width: 360px; }
.weekdays { display: flex; gap: .3rem; flex-wrap: wrap; }
.weekdays label { display: flex; align-items: center; gap: .25rem; font-weight: 500; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: .3rem .5rem; }
.weekdays input { width: auto; }
pre.code { background: #101828; color: #e4e7ec; padding: .8rem; border-radius: 10px; overflow-x: auto; font-size: .82rem; white-space: pre-wrap; word-break: break-all; }
.login-wrap { max-width: 400px; margin: 4rem auto; padding: 0 16px; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { display: flex; overflow-x: auto; gap: .25rem; padding: .5rem; }
  .side .brand { display: none; }
  .side button { width: auto; white-space: nowrap; }
  .main { padding: 1rem 16px; }
  .job { grid-template-columns: 1fr; }
  .job .actions { justify-content: flex-start; }
}
