/* Barbershop — RTL design system. Brand colours are injected as CSS variables from the admin settings. */
:root {
  --primary: #1f2a44;
  --accent: #c8a15a;
  --primary-ink: #ffffff;
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-2: #f3efe7;
  --text: #1b1f2a;
  --muted: #5f6675;
  --line: #e6e0d4;
  --ok: #17724a;
  --ok-bg: #e3f4ea;
  --warn: #8a5a00;
  --warn-bg: #fff2d6;
  --bad: #a52a1d;
  --bad-bg: #fde5e1;
  --info: #1d4f91;
  --info-bg: #e3eefc;
  --done: #4a3a8a;
  --done-bg: #ebe6fb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 8px 24px rgba(20, 24, 40, .06);
  --font: 'Vazirmatn', 'Vazir', Tahoma, 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.8; font-size: 16px; direction: rtl; text-align: right;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { font-feature-settings: "tnum"; direction: rtl; unicode-bidi: plaintext; }
.ltr { direction: ltr; unicode-bidi: embed; text-align: left; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.container { width: min(1140px, 100% - 32px); margin-inline: auto; }
.section { padding: 56px 0; }
.section.alt { background: var(--surface-2); }
.section-head { margin-bottom: 28px; }
.section-head p { color: var(--muted); max-width: 60ch; }
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 12px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none !important;
  background: var(--primary); color: var(--primary-ink); transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: not-allowed; }
.btn.accent { background: var(--accent); color: #1b1305; }
.btn.ghost { background: transparent; color: var(--primary); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--primary); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: .9rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.link { background: none; color: var(--primary); border: 0; min-height: 0; padding: 0; text-decoration: underline !important; font-weight: 600; }

/* Cards & surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h3 { margin-bottom: .35em; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* Badges: colour + glyph + text so meaning never relies on colour alone */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: #b9e3cb; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: #f0d79b; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: #f4bdb6; }
.badge.info { background: var(--info-bg); color: var(--info); border-color: #bcd3f2; }
.badge.done { background: var(--done-bg); color: var(--done); border-color: #d1c8f5; }
.badge.muted { background: #eceff3; color: #4b5563; border-color: #d9dee5; }
.badge.test { background: #fff; color: #7a3e00; border: 1px dashed #c98a3a; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 12px; border: 1px solid; margin: 0 0 16px; display: flow-root; }
.alert > span[aria-hidden=true]:first-child { float: inline-start; margin-inline-end: 10px; font-weight: 800; }
.alert > div { overflow: hidden; }
.alert.success { background: var(--ok-bg); border-color: #b9e3cb; color: #0f5a39; }
.alert.error { background: var(--bad-bg); border-color: #f4bdb6; color: #7d1d13; }
.alert.warning { background: var(--warn-bg); border-color: #f0d79b; color: #6b4600; }
.alert.info { background: var(--info-bg); border-color: #bcd3f2; color: #153e73; }

/* Forms */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-weight: 700; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.error-text { color: var(--bad); font-size: .88rem; margin-top: 4px; font-weight: 600; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=time],
input[type=date], input[type=search], input[type=url], input[type=file], select, textarea {
  width: 100%; min-height: 46px; padding: 8px 14px; font: inherit; color: var(--text);
  background: #fff; border: 1.5px solid #d3cdbf; border-radius: 12px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(200, 161, 90, .35); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checkbox input { width: 20px; height: 20px; margin-top: 5px; accent-color: var(--primary); flex: none; }
input[type=color] { width: 56px; height: 44px; padding: 2px; border-radius: 10px; border: 1.5px solid #d3cdbf; background: #fff; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.input-ltr { direction: ltr; text-align: left; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--surface-2); font-weight: 800; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfaf6; }

/* Header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.site-header .bar { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.2rem; color: var(--primary); text-decoration: none !important; }
.brand img { height: 40px; width: auto; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: var(--accent); display: grid; place-items: center; font-size: 1.3rem; }
.nav { display: flex; gap: 6px; align-items: center; margin-inline-start: 12px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--text); font-weight: 600; }
.nav a:hover, .nav a.active { background: var(--surface-2); text-decoration: none; }
.nav-toggle { display: none; margin-inline-start: auto; }
.site-footer { background: var(--primary); color: #e9ecf3; padding: 40px 0 24px; margin-top: 0; }
.site-footer a { color: #f1e3c4; }
.site-footer h4 { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 24px; padding-top: 16px; font-size: .85rem; color: #b8c0d4; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary), #0f1630 70%); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background:
  radial-gradient(500px 300px at 85% 20%, rgba(200,161,90,.28), transparent 70%),
  repeating-linear-gradient(115deg, rgba(255,255,255,.03) 0 2px, transparent 2px 14px); pointer-events: none; }
.hero .container { position: relative; z-index: 1; display: grid; gap: 32px; padding: 72px 0; grid-template-columns: 1.2fr .8fr; align-items: center; }
.hero p { color: #d7dcea; font-size: 1.1rem; max-width: 46ch; }
.hero .eyebrow { color: var(--accent); font-weight: 800; letter-spacing: .02em; }
.hero-art { aspect-ratio: 1; border-radius: 28px; background: var(--hero-img, none) center/cover, linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.18); display: grid; place-items: center; font-size: 6rem; }

/* Service cards */
.service-card { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.service-card .thumb { aspect-ratio: 16/9; border-radius: 10px; background: var(--surface-2) var(--img, none) center/cover; display: grid; place-items: center; font-size: 2rem; color: var(--accent); }
.price { font-weight: 900; font-size: 1.1rem; }
.price del { color: var(--muted); font-weight: 500; font-size: .9rem; margin-inline-start: 6px; }
.steps { counter-reset: s; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.steps li { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative; }
.steps li::before { counter-increment: s; content: counter(s, persian); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #1b1305; font-weight: 900; margin-bottom: 8px; }
.steps { padding: 0; margin: 0; }

details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
details.faq p { color: var(--muted); }

/* Booking stepper + calendar */
.stepper { display: flex; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; flex-wrap: wrap; }
.stepper li { flex: 1; min-width: 110px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line); font-weight: 700; font-size: .9rem; display: flex; gap: 8px; align-items: center; color: var(--muted); }
.stepper li .n { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: .85rem; flex: none; }
.stepper li.active { border-color: var(--primary); color: var(--primary); background: #fff; }
.stepper li.active .n, .stepper li.done .n { background: var(--primary); color: #fff; }
.stepper li.done { color: var(--ok); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: .8rem; font-weight: 800; color: var(--muted); padding: 4px 0; }
.cal-day { position: relative; height: 58px; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.cal-day small { font-size: .68rem; font-weight: 600; color: var(--muted); }
.cal-day.open { border-color: #9fd3b5; background: #f2fbf6; }
.cal-day.open:hover { border-color: var(--ok); }
.cal-day.full { background: #f6f1f0; color: #8d6f6a; cursor: not-allowed; }
.cal-day.closed, .cal-day.past, .cal-day.far { background: #f1f1f1; color: #9aa0aa; cursor: not-allowed; border-style: dashed; }
.cal-day.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.cal-day.selected small { color: #e5e9f4; }
.cal-day.today::after { content: ""; position: absolute; top: 5px; inset-inline-end: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cal-day.empty { visibility: hidden; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid; vertical-align: -2px; margin-inline-end: 4px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.slot { min-height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.slot:hover { border-color: var(--primary); }
.slot.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; background: #fff; }
.choice:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(200, 161, 90, .35); }
.choice input { margin-top: 6px; accent-color: var(--primary); }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.summary-row:last-child { border-bottom: 0; }
.summary-row.total { font-weight: 900; font-size: 1.1rem; }
.loader { display: inline-block; width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); background: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 18px 8px 0; border-inline-start: 2px solid var(--line); margin-inline-start: 6px; position: relative; font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }

/* Tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; }
.tabs a { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; white-space: nowrap; color: var(--text); }
.tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; padding: 0; margin: 20px 0 0; }
.pagination a, .pagination span { display: block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pagination .active span { background: var(--primary); color: #fff; }

/* Account + admin layout */
.account-layout { display: grid; gap: 24px; grid-template-columns: 240px 1fr; padding: 32px 0 56px; align-items: start; }
.side-nav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; position: sticky; top: 84px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 600; }
.side-nav a:hover { background: var(--surface-2); text-decoration: none; }
.side-nav a.active { background: var(--primary); color: #fff; }
.side-nav .count { margin-inline-start: auto; background: var(--accent); color: #1b1305; border-radius: 999px; padding: 0 8px; font-size: .78rem; font-weight: 800; }
.side-nav hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }

.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-side { background: var(--primary); color: #dfe4f1; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { color: #fff; padding: 6px 10px 16px; }
.admin-side a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; color: #dfe4f1; font-weight: 600; }
.admin-side a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.admin-side a.active { background: var(--accent); color: #1b1305; }
.admin-nav-toggle { display: none; }
.admin-links { display: block; }
.admin-side .group { font-size: .75rem; color: #9aa6c4; padding: 14px 12px 4px; font-weight: 800; }
.admin-main { padding: 24px clamp(16px, 3vw, 36px) 56px; min-width: 0; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .v { font-size: 1.6rem; font-weight: 900; line-height: 1.3; }
.stat .l { color: var(--muted); font-size: .88rem; }
.stat.warn { border-color: #f0d79b; background: #fffaf0; }

/* Admin calendar */
.week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.day-col { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 180px; }
.day-col.today { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(200, 161, 90, .35); }
.day-col.closed { background: #f4f4f4; }
.day-col h4 { font-size: .95rem; margin: 0 0 2px; }
.ev { display: block; border-radius: 10px; padding: 6px 8px; margin-top: 6px; font-size: .84rem; border-inline-start: 4px solid; text-decoration: none !important; color: var(--text); background: #f7f7f7; }
.ev.ok { background: var(--ok-bg); border-color: var(--ok); }
.ev.warn { background: var(--warn-bg); border-color: var(--warn); }
.ev.info { background: var(--info-bg); border-color: var(--info); }
.ev.done { background: var(--done-bg); border-color: var(--done); }
.ev.bad { background: var(--bad-bg); border-color: var(--bad); }
.ev b { display: block; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.month .day-col { min-height: 110px; padding: 6px; }
.month .ev { font-size: .75rem; padding: 3px 6px; }
.bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }

dialog { border: 0; border-radius: 16px; padding: 0; width: min(520px, 94vw); box-shadow: 0 24px 80px rgba(0, 0, 0, .35); font-family: var(--font); direction: rtl; }
dialog::backdrop { background: rgba(15, 20, 40, .55); }
.dialog-body { padding: 22px; }

.auth-wrap { min-height: 70vh; display: grid; place-items: center; padding: 32px 0; }
.auth-card { width: min(440px, 100%); }

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; padding: 48px 0; }
  .hero-art { display: none; }
  .account-layout { grid-template-columns: 1fr; }
  .side-nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .side-nav a { white-space: nowrap; }
  .side-nav hr { display: none; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; padding: 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .admin-side .brand { padding: 4px 6px; }
  .admin-nav-toggle { display: inline-flex; min-height: 44px; }
  .admin-links { display: none; width: 100%; }
  .admin-side.open .admin-links { display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-side .group { width: 100%; padding-bottom: 0; }
  .nav { display: none; position: absolute; top: 68px; inset-inline: 0; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px 16px; margin: 0; }
  .nav.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .week { grid-template-columns: repeat(7, 190px); }
  .month { grid-template-columns: repeat(7, minmax(92px, 1fr)); overflow-x: auto; }
}
@media (max-width: 520px) {
  .section { padding: 36px 0; }
  .stepper li span.t { display: none; }
  .stepper li { min-width: 0; justify-content: center; flex: 1; }
  .stepper li.active span.t { display: inline; }
  th, td { padding: 10px; }
}
@media print { .site-header, .site-footer, .btn, .side-nav { display: none !important; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ==========================================================================
   Barbershop theme layer (loaded last; overrides the base design system above)
   Motifs: barber pole stripe, scissors, comb, razor, brass + navy + cream.
   ========================================================================== */
:root {
  --pole-red: #c0392b;
  --pole-blue: #27508f;
  --brass-grad: linear-gradient(135deg, #f1dba4 0%, #c8a15a 45%, #8f6a2b 100%);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --tool-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200' fill='none' stroke='%23ffffff' stroke-opacity='.07' stroke-width='.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='translate(20 26) scale(2.6) rotate(-14 12 12)'%3E%3Ccircle cx='6' cy='6' r='3'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Cpath d='M20 4 8.12 15.88M14.47 14.48 20 20M8.12 8.12 12 12'/%3E%3C/g%3E%3Cg transform='translate(112 40) scale(2.4) rotate(12 12 12)'%3E%3Crect x='2' y='5.5' width='20' height='6' rx='1.8'/%3E%3Cpath d='M5 11.5v6M8.5 11.5v6M12 11.5v6M15.5 11.5v6M19 11.5v6'/%3E%3C/g%3E%3Cg transform='translate(58 118) scale(2.5)'%3E%3Crect x='8' y='3' width='8' height='18' rx='4'/%3E%3Cpath d='m8 8 8-3M8 13l8-3M8 18l8-3'/%3E%3C/g%3E%3Cg transform='translate(140 128) scale(2.2) rotate(-20 12 12)'%3E%3Cpath d='M3.5 20.5 13 11'/%3E%3Cpath d='m13 11 6.2-6.2a1.4 1.4 0 0 1 2 2L15 13z'/%3E%3C/g%3E%3C/svg%3E");
  --tool-tile-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200' fill='none' stroke='%231f2a44' stroke-opacity='.07' stroke-width='.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='translate(20 26) scale(2.6) rotate(-14 12 12)'%3E%3Ccircle cx='6' cy='6' r='3'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Cpath d='M20 4 8.12 15.88M14.47 14.48 20 20M8.12 8.12 12 12'/%3E%3C/g%3E%3Cg transform='translate(112 40) scale(2.4) rotate(12 12 12)'%3E%3Crect x='2' y='5.5' width='20' height='6' rx='1.8'/%3E%3Cpath d='M5 11.5v6M8.5 11.5v6M12 11.5v6M15.5 11.5v6M19 11.5v6'/%3E%3C/g%3E%3Cg transform='translate(58 118) scale(2.5)'%3E%3Crect x='8' y='3' width='8' height='18' rx='4'/%3E%3Cpath d='m8 8 8-3M8 13l8-3M8 18l8-3'/%3E%3C/g%3E%3Cg transform='translate(140 128) scale(2.2) rotate(-20 12 12)'%3E%3Cpath d='M3.5 20.5 13 11'/%3E%3Cpath d='m13 11 6.2-6.2a1.4 1.4 0 0 1 2 2L15 13z'/%3E%3C/g%3E%3C/svg%3E");
}

.icon { flex: none; vertical-align: -0.2em; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip-link:focus { top: 10px; }

/* barber-pole stripe: header bottom edge, footer top edge, dividers */
.pole-stripe { height: 6px; background: repeating-linear-gradient(-45deg, var(--pole-red) 0 12px, #fbf7ee 12px 24px, var(--pole-blue) 24px 36px, #fbf7ee 36px 48px); }
.pole-stripe.thin { height: 4px; }

/* header (fixes the mobile overlap: nothing wraps, brand truncates, login moves into the menu) */
.site-header { box-shadow: 0 1px 0 var(--line); }
.site-header .bar { flex-wrap: nowrap; gap: 10px; min-height: 64px; }
.brand { min-width: 0; flex: 0 1 auto; }
.brand-mark { background: var(--primary); color: var(--accent); border: 1.5px solid var(--accent); }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.1rem; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex: none; }
.nav-toggle { width: 44px; height: 44px; padding: 0; min-height: 44px; }
.nav-account { display: none; }
.hide-sm { display: inline-flex; }

/* hero */
.hero { background:
    var(--tool-tile),
    radial-gradient(620px 360px at 88% 12%, rgba(200, 161, 90, .26), transparent 70%),
    linear-gradient(140deg, #1b2440 0%, #0d1328 70%); }
.hero::after { display: none; }
.hero .container { padding: 64px 0 72px; }
.hero h1 { font-size: clamp(1.9rem, 5.2vw, 3.1rem); letter-spacing: -.01em; margin-bottom: .45em; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1px solid rgba(200, 161, 90, .5); border-radius: 999px; font-size: .9rem; margin-bottom: 14px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 26px; color: #cfd6ea; font-size: .92rem; }
.hero-badges span { display: inline-flex; gap: 6px; align-items: center; }
.hero-badges .icon { color: var(--accent); }
.hero-art { aspect-ratio: auto; border: 0; background: none; display: block; font-size: inherit; }
.hero-svg { width: 100%; max-width: 440px; height: auto; margin-inline: auto; display: block; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .45)); animation: floaty 7s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero .container > div:first-child { animation: rise .7s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* concise answer block (also read by search/AI engines) */
.answer-box { background: var(--surface); border: 1px solid var(--line); border-inline-start: 5px solid var(--accent); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin: -32px auto 0; position: relative; z-index: 2; max-width: 880px; }
.answer-box h2 { font-size: 1.1rem; margin-bottom: .3em; }
.answer-box p { margin: 0; color: var(--text); }

/* section rhythm + "cut here" divider */
.section-head h2 { position: relative; padding-bottom: 12px; }
.section-head h2::after { content: ""; position: absolute; inset-inline-start: 0; bottom: 0; width: 56px; height: 4px; border-radius: 4px; background: var(--brass-grad); }
.section.alt { background: var(--tool-tile-dark), var(--surface-2); }
.cut-line { display: flex; align-items: center; gap: 14px; color: var(--accent); margin: 8px 0; }
.cut-line::before, .cut-line::after { content: ""; flex: 1; border-top: 2px dashed #d9cfb9; }

/* service cards with tool icons */
.service-card { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.service-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 2px 4px rgba(20, 24, 40, .06), 0 16px 34px rgba(20, 24, 40, .12); }
.service-card .thumb { aspect-ratio: 16 / 7; color: var(--accent); background: var(--img, none) center/cover, var(--tool-tile) , linear-gradient(135deg, #1f2a44, #0f1630); position: relative; overflow: hidden; }
.service-card .thumb .icon { width: 44px; height: 44px; padding: 10px; border-radius: 50%; border: 1.5px solid var(--accent); background: rgba(15, 22, 48, .55); box-sizing: content-box; }
.price { color: var(--primary); }

/* steps with icons */
.steps li { padding-top: 62px; transition: transform .25s var(--ease), border-color .25s; }
.steps li:hover { transform: translateY(-2px); border-color: var(--accent); }
.steps li::before { position: absolute; top: 18px; inset-inline-start: 18px; width: 30px; height: 30px; font-size: .9rem; margin: 0; }
.steps li .icon { position: absolute; top: 16px; inset-inline-end: 18px; color: var(--primary); opacity: .75; width: 30px; height: 30px; }

/* contact rows */
.contact-row { display: flex; gap: 10px; align-items: flex-start; }
.contact-row .icon { color: var(--accent); margin-top: 4px; }

/* footer */
.site-footer { background: var(--tool-tile), linear-gradient(180deg, #17203a, #0c1226); padding-top: 0; }
.site-footer .pole-stripe { margin-bottom: 36px; }
.site-footer .contact-row .icon { color: var(--accent); }

/* booking summary ticket */
#flow-grid aside.card { border-style: dashed; border-width: 2px; background: linear-gradient(180deg, #fff, #fbf8f1); }
#flow-grid aside.card h3::before { content: "✂"; color: var(--accent); margin-inline-end: 8px; }

/* touch targets & small refinements */
.btn.small { min-height: 40px; }
.btn.accent { background: var(--brass-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn.accent:hover { filter: brightness(1.05); }
.btn { transition: transform .12s var(--ease), box-shadow .2s, filter .2s, background .2s; }
.badge.test { white-space: normal; }

/* auth cards get a brass top edge */
.auth-card { border-top: 4px solid var(--accent); }

@media (max-width: 900px) {
  .hide-sm { display: none; }
  .nav { top: 100%; box-shadow: 0 18px 30px rgba(15, 20, 40, .18); }
  .nav a { padding: 12px 14px; font-size: 1.02rem; }
  .nav-account { display: contents; }
  .nav-toggle { display: inline-flex; }
  .hero .container { padding: 40px 0 56px; }
  .hero-art { display: block; order: -1; max-width: 240px; margin-inline: auto; }
  .hero-svg { max-width: 240px; }
  .answer-box { margin-top: -24px; }
}
@media (max-width: 420px) {
  .container { width: calc(100% - 24px); }
  .brand-name { font-size: 1rem; max-width: 9.5em; }
  .brand-mark { width: 36px; height: 36px; font-size: 1.1rem; }
  .header-actions .btn.accent { padding: 0 14px; }
  .hero-badges { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { .hero-svg, .hero .container > div:first-child { animation: none !important; } }
/* ==========================================================================
   Mobile pass + unified header (appended last)
   ========================================================================== */
.site-header .bar { min-height: 68px; gap: 12px; }
.brand-name { font-weight: 900; font-size: 1.12rem; color: var(--primary); line-height: 1.2; }
.header-actions { gap: 10px; }
.header-actions .btn { height: 44px; min-height: 44px; padding: 0 18px; border-radius: 12px; font-size: .98rem; font-weight: 800; line-height: 1; letter-spacing: 0; }
.header-actions .btn.ghost { background: #fff; border: 1.5px solid #d3cdbf; color: var(--primary); }
.header-actions .btn.ghost:hover { border-color: var(--primary); text-decoration: none; }
.header-actions .btn.accent { color: #1b1305; border: 1.5px solid #a98336; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
.header-actions .nav-toggle { width: 44px; padding: 0; }
.nav a { font-weight: 700; }

/* booking flow grid: two columns on desktop, one on mobile (summary no longer squeezes the form) */
.flow-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.flow-summary { position: sticky; top: 92px; }
.step-label { display: none; margin: 0 0 12px; font-weight: 800; color: var(--primary); }
.choice { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; align-items: start; }
.choice > .num { text-align: left; }
.choice .small { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .flow-grid { grid-template-columns: minmax(0, 1fr); }
  .flow-summary { position: static; }
}
@media (max-width: 640px) {
  .step-label { display: block; }
  .stepper { gap: 6px; margin-bottom: 14px; }
  .stepper li { min-width: 0; flex: 1; padding: 8px 4px; justify-content: center; }
  .stepper li .t { display: none !important; }
  .stepper li.active { box-shadow: 0 0 0 3px rgba(200, 161, 90, .35); }
  .choice { grid-template-columns: auto minmax(0, 1fr); }
  .choice > .num { grid-column: 2; text-align: right; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
  .choice > .num .small { display: inline !important; }
  .cal-grid { gap: 4px; }
  .cal-day { height: 52px; min-height: 44px; border-radius: 10px; }
  .cal-day small { font-size: .62rem; }
  .cal-head .btn { padding: 0 10px; }
  .slots { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .card { padding: 16px; }
  .section-head.row.between { align-items: flex-start; }
  h1 { font-size: 1.55rem; }
  .btn { min-height: 46px; }
  .row.between { gap: 8px; }
  .summary-row { gap: 8px; }
  .summary-row > :last-child { text-align: left; }
  .tabs a { padding: 8px 12px; }
  .admin-main { padding: 16px 14px 48px; }
  .admin-top h1 { font-size: 1.35rem; }
  .week { grid-template-columns: repeat(7, 170px); }
}
@media (max-width: 380px) {
  .header-actions .btn { padding: 0 12px; font-size: .92rem; }
  .brand-name { max-width: 8em; }
}
/* account side-nav on phones: wrap into a 2-column grid so every link (incl. logout) is visible */
@media (max-width: 900px) {
  .side-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; overflow: visible; }
  .side-nav a, .side-nav form button { width: 100%; justify-content: center; text-align: center; min-height: 44px; display: flex; align-items: center; }
  .side-nav form { display: contents; }
  .side-nav .btn.link { text-decoration: none !important; border-radius: 10px; }
}
@media (max-width: 640px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 12px; }
  .stat .v { font-size: 1.25rem; }
}
/* ==========================================================================
   Full-width, fluid, scroll-aware header (appended last)
   ========================================================================== */
.container { width: min(1280px, 100% - 2 * clamp(16px, 4vw, 56px)); }
.site-header { background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); transition: box-shadow .25s var(--ease), background .25s; }
.site-header .container.bar { width: 100%; max-width: none; margin: 0; padding-inline: clamp(16px, 3vw, 56px); min-height: 80px; gap: clamp(10px, 2vw, 28px); transition: min-height .25s var(--ease); }
.site-header.is-scrolled { background: rgba(255, 255, 255, .98); box-shadow: 0 10px 28px rgba(15, 20, 40, .12); }
.site-header.is-scrolled .container.bar { min-height: 62px; }
.site-header .brand-mark { width: 46px; height: 46px; transition: transform .25s var(--ease), width .25s, height .25s; }
.site-header.is-scrolled .brand-mark { width: 40px; height: 40px; }
.site-header .brand-name { font-size: clamp(1.05rem, 1.3vw, 1.35rem); }
.site-header .nav { flex: 1 1 auto; justify-content: center; margin: 0; gap: clamp(2px, .8vw, 14px); }
.site-header .nav a { padding: 10px clamp(10px, 1.1vw, 18px); font-size: clamp(.95rem, 1.05vw, 1.05rem); border-radius: 12px; position: relative; }
.site-header .nav a.active::after { content: ""; position: absolute; inset-inline: 22%; bottom: 3px; height: 3px; border-radius: 3px; background: var(--brass-grad); }
.site-header .nav a.active { background: transparent; color: var(--primary); }
.header-actions { margin-inline-start: 0; }

@media (max-width: 900px) {
  .site-header .container.bar { min-height: 68px; }
  .site-header.is-scrolled .container.bar { min-height: 58px; }
  .site-header .header-actions { margin-inline-start: auto; }
  .site-header .nav { justify-content: stretch; }
  .site-header .nav a.active::after { inset-inline: 14px; }
}