/* NOUBA - one stylesheet for the client page, the barber dashboard and the poster.
   Look: barber-pole stripe (red / white / blue) + paper ticket. */
:root {
  color-scheme: light;
  --paper: #EEF2F1;
  --card: #FFFFFF;
  --ink: #10262C;
  --muted: #566A70;
  --line: #CFD9D7;
  --red: #CF2E3B;
  --blue: #1B5AA3;
  --go: #0F7A57;
  --go-soft: #DDF3EA;
  --warn-soft: #FFF1D6;
  --pick: #EAF1FA;
  --radius: 14px;
  /* Room kept free at the bottom of the screen for the host's "Powered by" badge.
     Set to 0px if you move to a host without a badge. */
  --badge-space: 0px;
  --font: "Readex Pro", "Segoe UI", system-ui, -apple-system, "Noto Sans Arabic", Tahoma, sans-serif;
}
/* women's salons: same layout, plum and teal stripe instead of barber red and blue */
body.women { --red: #8F2D6B; --blue: #1F6F78; --pick: #E6F2F3; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.45;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* the signature: a barber pole laid flat across the top */
.pole {
  height: 12px;
  background: repeating-linear-gradient(135deg,
    var(--red) 0 14px, #fff 14px 28px, var(--blue) 28px 42px, #fff 42px 56px);
  background-size: 79.2px 100%;
}
.pole.spin { animation: pole 1.2s linear infinite; }
@keyframes pole { to { background-position: 79.2px 0; } }
@media (prefers-reduced-motion: reduce) { .pole.spin { animation: none; } }

.wrap { max-width: 520px; margin: 0 auto; padding: 16px 16px calc(40px + var(--badge-space)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.shop { font-size: 22px; font-weight: 700; line-height: 1.2; margin: 0; }
.shop .logo { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); vertical-align: middle; margin-inline-end: 10px; }
.logo-preview { width: 120px; height: 120px; border-radius: 22px; object-fit: contain; background: #fff; border: 1px solid var(--line); display: block; margin: 0 auto 12px; }
.brand { color: var(--muted); font-size: 13px; }

.langs { display: flex; gap: 4px; flex-shrink: 0; }
.langs button {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 6px 10px; font-size: 13px; min-height: 36px;
}
.langs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.msg { text-align: center; padding: 36px 18px; font-size: 19px; }

/* live strip: how busy the shop is right now */
.live { display: flex; gap: 10px; margin-bottom: 14px; }
.live div { flex: 1; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 12px 14px; }
.live b { display: block; font-size: 30px; line-height: 1.1; font-weight: 700; }
.live span { font-size: 13px; opacity: .8; }

h2 { font-size: 15px; font-weight: 600; color: var(--muted); margin: 18px 0 8px; }
.opts { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: start;
  width: 100%; min-height: 58px; padding: 10px 14px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
}
.opt small { color: var(--muted); white-space: nowrap; }
.opt.on { border-color: var(--blue); background: var(--pick); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 8px 16px; border-radius: 999px;
  background: var(--card); border: 2px solid var(--line);
}
.chip.on { border-color: var(--blue); background: var(--pick); }

label { display: block; font-size: 15px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
input, select {
  width: 100%; min-height: 54px; padding: 10px 14px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
}
input:focus, select:focus { border-color: var(--blue); outline: none; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.err { color: var(--red); font-weight: 600; margin: 12px 0 0; min-height: 1.4em; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  width: 100%; min-height: 60px; padding: 12px 18px; margin-top: 16px;
  border: 0; border-radius: var(--radius); background: var(--red); color: #fff;
  font-size: 19px; font-weight: 700;
}
.btn:disabled { opacity: .55; }
.btn.go { background: var(--go); }
.btn.dark { background: var(--ink); }
.btn.quiet { background: transparent; color: var(--muted); border: 2px solid var(--line); font-weight: 600; font-size: 16px; min-height: 50px; }

/* the paper ticket */
.ticket {
  position: relative; background: var(--card); border-radius: var(--radius);
  padding: 22px 18px 20px; text-align: center; border: 1px solid var(--line);
}
.ticket::before, .ticket::after {
  content: ""; position: absolute; top: 96px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line);
}
.ticket::before { inset-inline-start: -12px; }
.ticket::after { inset-inline-end: -12px; }
.ticket .lbl { color: var(--muted); font-size: 14px; }
.ticket .num { font-size: 84px; font-weight: 700; line-height: 1; letter-spacing: -2px; margin: 2px 0 14px; }
.ticket .num.sm { font-size: 44px; letter-spacing: 0; margin: 14px 0 22px; }
.ticket .tear { border-top: 2px dashed var(--line); margin: 0 -6px 16px; }
.ticket .who { color: var(--muted); font-size: 15px; margin-top: 12px; }
.facts { display: flex; gap: 10px; }
.facts div { flex: 1; background: var(--paper); border-radius: 10px; padding: 10px; }
.facts b { display: block; font-size: 28px; line-height: 1.1; }
.facts span { font-size: 13px; color: var(--muted); }
.banner { border-radius: var(--radius); padding: 14px 16px; font-weight: 700; margin-bottom: 12px; text-align: center; }
.banner.near { background: var(--warn-soft); }
.banner.turn { background: var(--go); color: #fff; font-size: 24px; }
.banner.turn small { display: block; font-size: 16px; font-weight: 400; opacity: .9; }

/* ---------- barber dashboard ---------- */
.dash .wrap { padding-bottom: calc(110px + var(--badge-space)); }
.toggle {
  border: 2px solid var(--line); background: var(--card); border-radius: 999px;
  min-height: 44px; padding: 6px 16px; font-weight: 700;
}
.toggle.on { background: var(--go-soft); border-color: var(--go); color: var(--go); }
.toggle.off { background: #FBE4E6; border-color: var(--red); color: var(--red); }

.chair { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.chair.idle { border-style: dashed; }
.chair.off { opacity: .6; }
.chair .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chair .bname { font-weight: 700; font-size: 18px; }
.chair .link { background: none; border: 0; color: var(--muted); text-decoration: underline; min-height: 40px; padding: 4px 6px; font-size: 14px; }
.chair .now { margin: 8px 0 12px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.chair .now b { font-size: 26px; }
.chair .now span { color: var(--muted); font-size: 15px; }
.acts { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.acts.one { grid-template-columns: 1fr; }
.act {
  min-height: 68px; border: 0; border-radius: 12px; color: #fff; font-weight: 700; font-size: 17px; padding: 6px;
}
.act.next { background: var(--go); font-size: 22px; }
.act.done { background: var(--ink); }
.act.noshow { background: var(--red); }
.act:disabled { opacity: .5; }

.qhead { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 8px; }
.qhead h2 { margin: 0; font-size: 17px; color: var(--ink); }
.qhead span { color: var(--muted); font-size: 14px; }
.row {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
}
.row.alerted { border-color: var(--go); }
.row .n { min-width: 46px; font-size: 22px; font-weight: 700; text-align: center; }
.row .n.rdv { font-size: 13px; background: var(--blue); color: #fff; border-radius: 8px; padding: 4px 2px; }
.row .mid { flex: 1; min-width: 0; }
.row .mid b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .mid span { color: var(--muted); font-size: 14px; }
.row .eta { color: var(--muted); font-size: 14px; white-space: nowrap; }
.icon {
  width: 46px; height: 46px; flex-shrink: 0; display: grid; place-items: center; text-decoration: none;
  border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font-size: 20px; color: var(--ink);
}
.icon.wa { background: #DDF6E4; border-color: #9AD8AE; color: #0B6B2E; font-size: 13px; font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 22px 12px; border: 2px dashed var(--line); border-radius: var(--radius); }
.stats { display: flex; gap: 16px; color: var(--muted); font-size: 14px; margin-top: 18px; flex-wrap: wrap; }
.stats a { color: var(--blue); }

.bar {
  position: fixed; inset-inline: 0; bottom: 0; background: var(--paper); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + var(--badge-space) + env(safe-area-inset-bottom, 0px));
}
.bar .in { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.bar .btn { margin: 0; min-height: 62px; font-size: 17px; }

.sheet { position: fixed; inset: 0; background: rgba(16, 38, 44, .55); display: none; align-items: flex-end; z-index: 5; }
.sheet.show { display: flex; }
.sheet .panel {
  width: 100%; max-width: 520px; margin: 0 auto; max-height: 92vh; overflow: auto;
  background: var(--paper); border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
}
.sheet h3 { margin: 0 0 4px; font-size: 20px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- colours by audience ----------
   Clients: bright and welcoming, in the shop's own colour.
   Barbers and owners: a calm workspace, dark header with the shop's colour underneath. */
:root { --brand: #1B5AA3; --brand-ink: #FFFFFF; --brand-deep: #133F72; --brand-deep-ink: #FFFFFF; --brand-soft: #E1EAF4; --brand-tint: #F0F4F9; }

body.client {
  --paper: var(--brand-tint); --line: #E6E1DA;
  background: linear-gradient(180deg, var(--brand-soft) 0, var(--brand-tint) 320px, #FBF9F6 760px) fixed;
  min-height: 100vh;
}
.client .pole, .poster .pole {
  background: repeating-linear-gradient(135deg, var(--brand) 0 14px, #fff 14px 28px, var(--brand-deep) 28px 42px, #fff 42px 56px);
  background-size: 79.2px 100%;
}
.client .top {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: var(--brand-ink);
  border-radius: 22px; padding: 14px; box-shadow: 0 12px 28px rgba(16, 38, 44, .16);
}
.client .top .brand { color: inherit; opacity: .8; }
.client .top .langs button { color: inherit; border-color: currentColor; opacity: .85; }
.client .top .langs button.on { background: var(--brand-ink); color: var(--brand); border-color: var(--brand-ink); opacity: 1; }
.client .shop .logo { border-color: transparent; }
.client .card, .client .ticket, .client .opt, .client .chip, .client input { box-shadow: 0 4px 14px rgba(16, 38, 44, .06); }
.client .opt.on, .client .chip.on { border-color: var(--brand); background: var(--brand-soft); }
.client input:focus { border-color: var(--brand); }
.client .btn:not(.quiet):not(.go):not(.dark) { background: var(--brand); color: var(--brand-ink); box-shadow: 0 8px 20px rgba(16, 38, 44, .18); }
.client .live div { background: var(--brand-deep); color: var(--brand-deep-ink); }
.client .facts div { background: var(--brand-tint); }

body.dash, body.pro { --paper: #E9EEF1; --line: #D4DDE1; background: #E9EEF1; }
.dash .top, .pro .top {
  background: var(--ink); color: #fff; margin: -16px -16px 14px; padding: 16px;
  border-radius: 0 0 22px 22px; border-bottom: 5px solid var(--brand); box-shadow: 0 10px 24px rgba(16, 38, 44, .2);
}
.dash .top .brand, .pro .top .brand { color: rgba(255, 255, 255, .75); }
.dash .top .langs button, .pro .top .langs button { color: #fff; border-color: rgba(255, 255, 255, .4); }
.dash .top .langs button.on, .pro .top .langs button.on { background: #fff; color: var(--ink); border-color: #fff; }
.dash .shop .logo, .pro .shop .logo { border-color: transparent; }
.dash .chair { border: 0; border-inline-start: 6px solid var(--brand); box-shadow: 0 4px 14px rgba(16, 38, 44, .08); }
.dash .chair.idle { border: 2px dashed var(--line); border-inline-start: 6px solid var(--brand); box-shadow: none; }
.dash .row { border-color: transparent; box-shadow: 0 2px 10px rgba(16, 38, 44, .06); }
.dash .row.alerted { border-color: var(--go); }
.dash .bar { background: #fff; border-top: 0; box-shadow: 0 -8px 24px rgba(16, 38, 44, .1); }
.pro .card { border-color: transparent; box-shadow: 0 4px 14px rgba(16, 38, 44, .07); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 4px 0 6px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }

/* ---------- poster ---------- */
.poster { background: #fff; }
.poster .sheet-a { max-width: 620px; margin: 0 auto; padding: 28px 24px; text-align: center; }
.poster h1 { font-size: 34px; line-height: 1.2; margin: 18px 0 6px; }
.poster .ar { font-size: 30px; font-weight: 700; margin: 0 0 18px; }
.poster #qr { display: inline-block; padding: 16px; border: 6px solid var(--ink); border-radius: 18px; }
.poster .steps { font-size: 18px; margin: 18px 0 4px; }
.poster .url { color: var(--muted); font-size: 14px; word-break: break-all; }
@media print { .noprint { display: none !important; } .poster .sheet-a { padding: 0; } }
