/* ระบบตัวอย่างจองแม่บ้าน — Sotofix */
@font-face { font-family: "Prompt"; src: url("../fonts/prompt-light.woff") format("woff"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Prompt"; src: url("../fonts/prompt-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Prompt"; src: url("../fonts/prompt-medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Prompt"; src: url("../fonts/prompt-semibold.woff") format("woff"); font-weight: 600; font-display: swap; }

:root {
  --brand: #12998b;
  --brand-dark: #0c4a4f;
  --brand-ink: #083236;
  --brand-soft: #e6f5f3;
  --accent: #f5b83d;
  --bg: #f6faf9;
  --card: #ffffff;
  --line: #d8e6e4;
  --ink: #1d2b2d;
  --muted: #5d7073;
  --danger: #c2410c;
  --ok: #15803d;
  --warn: #a16207;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(8, 50, 54, .08);
  --sx-dark: #002c2f;
  --sx-yellow: #fdd301;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Prompt", system-ui, sans-serif; font-weight: 400; color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 16px; }
img, svg { max-width: 100%; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 600; color: var(--brand-ink); }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); }
h2 { font-size: clamp(1.2rem, 1rem + .9vw, 1.5rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.noscript { padding: 2rem; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- แถบระบบตัวอย่าง ---------- */
.demo-bar { position: sticky; top: 0; z-index: 50; background: var(--sx-dark); color: #fff; font-size: .82rem; }
.demo-bar__in { max-width: 1240px; margin: 0 auto; padding: .45rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; }
.demo-bar__note { display: flex; align-items: center; gap: .45rem; flex: 1 1 260px; min-width: 0; }
.demo-bar__badge { background: var(--sx-yellow); color: var(--sx-dark); font-weight: 600; border-radius: 999px; padding: .05rem .55rem; white-space: nowrap; }
.demo-bar__roles { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.demo-bar__roles span { opacity: .75; }
.role-btn { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: .15rem .7rem; cursor: pointer; font-size: .8rem; }
.role-btn[aria-pressed="true"] { background: #fff; color: var(--sx-dark); border-color: #fff; font-weight: 600; }
.demo-bar__links { display: flex; gap: .8rem; align-items: center; }
.demo-bar__links a, .demo-bar__links button { color: #fff; background: none; border: 0; padding: 0; cursor: pointer; font-size: .8rem; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- หน้าร้าน ---------- */
.topstrip { background: var(--brand); color: #fff; font-size: .85rem; }
.topstrip__in, .header__in, .footer__in, .container { max-width: 1140px; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
.topstrip__in { padding-top: .35rem; padding-bottom: .35rem; display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between; }
.header { background: #fff; border-bottom: 3px solid var(--brand-soft); }
.header__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .8rem; padding-bottom: .8rem; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--brand-ink); }
.logo svg { width: 42px; height: 42px; flex: none; }
.logo__name { font-weight: 600; font-size: 1.25rem; line-height: 1.1; }
.logo__sub { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }
.header__nav { display: flex; gap: .5rem; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border-radius: 999px; padding: .62rem 1.3rem; font-weight: 500; cursor: pointer; border: 1.5px solid transparent; text-decoration: none; line-height: 1.2; text-align: center; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: #0e857a; }
.btn--dark { background: var(--brand-dark); color: #fff; }
.btn--ghost { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn--light { background: var(--brand-soft); color: var(--brand-ink); }
.btn--danger { background: #fff; color: var(--danger); border-color: #f0c2ad; }
.btn--sm { padding: .35rem .85rem; font-size: .88rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.main { padding: 2rem 0 3rem; min-height: 60vh; }
.page-head { text-align: center; margin-bottom: 1.6rem; }
.page-head__kicker { color: var(--brand); font-weight: 500; margin-bottom: .2rem; }
.page-head__rule { width: 72px; height: 3px; background: var(--brand-dark); margin: .8rem auto 0; border-radius: 2px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem; }
.narrow { max-width: 780px; margin: 0 auto; }
.mid { max-width: 940px; margin: 0 auto; }

/* ขั้นตอน */
.steps { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin: 0 auto 1.6rem; max-width: 520px; position: relative; }
.steps::before { content: ""; position: absolute; left: 40px; right: 40px; top: 19px; height: 2px; background: var(--line); }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; width: 120px; text-align: center; font-size: .9rem; color: var(--muted); }
.step__dot { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; font-weight: 600; }
.step--on { color: var(--brand); }
.step--on .step__dot { border-color: var(--brand); color: var(--brand); }
.step--done .step__dot { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ฟอร์ม */
.field { margin-bottom: 1.15rem; }
.field > label, .field__label { display: block; font-weight: 500; margin-bottom: .35rem; }
.req { color: var(--danger); }
.input, .select { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: .65rem .9rem; min-height: 46px; }
.input:focus, .select:focus { outline: 3px solid rgba(18,153,139,.2); border-color: var(--brand); }
.input[readonly] { background: #f3f7f7; color: #3d5154; }
.hint { font-size: .88rem; color: var(--muted); margin-top: .3rem; }
.hint--brand { color: var(--brand); font-weight: 500; }
.error { color: var(--danger); font-size: .88rem; margin-top: .3rem; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
.check { display: flex; gap: .55rem; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--brand); flex: none; }
.locked { border: 1.5px dashed #b8cfcc; border-radius: 12px; padding: .8rem 1rem; background: #f3f7f7; color: var(--muted); font-size: .9rem; display: flex; gap: .6rem; align-items: center; }
.locked svg { flex: none; width: 20px; height: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .25rem .75rem; font-size: .88rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 500; }
.chip--static { cursor: default; }
.demo-note { background: #fff8e6; border: 1px solid #f3dca4; color: #6b4e0a; border-radius: 12px; padding: .7rem .95rem; font-size: .9rem; margin-bottom: 1.1rem; display: flex; gap: .55rem; align-items: flex-start; }
.demo-note svg { flex: none; width: 20px; height: 20px; margin-top: .1rem; }
.actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.4rem; }
.actions--split { justify-content: space-between; }

/* ปฏิทิน */
.booking-2 { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
.cal { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cal__title { font-weight: 600; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.icon-btn svg { width: 18px; height: 18px; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal__dow { font-size: .8rem; color: var(--muted); padding: .2rem 0; }
.cal__day { height: 44px; border-radius: 10px; border: 1px solid transparent; background: var(--brand-soft); cursor: pointer; font-weight: 500; display: grid; place-items: center; font-size: .95rem; min-height: 36px; }
.cal__day:hover { border-color: var(--brand); }
.cal__day[disabled] { background: transparent; color: #a9b8ba; text-decoration: line-through; cursor: not-allowed; border-color: transparent; }
.cal__day[aria-pressed="true"] { background: var(--brand); color: #fff; }
.cal__day--blank { background: transparent; cursor: default; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .5rem; }
.slot { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: .5rem .4rem; cursor: pointer; text-align: center; line-height: 1.25; }
.slot b { display: block; font-weight: 600; }
.slot small { color: var(--muted); font-size: .78rem; }
.slot[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.slot[disabled] { opacity: .45; cursor: not-allowed; }
.summary { width: 100%; border-collapse: collapse; font-size: .95rem; }
.summary td { padding: .4rem 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.summary td:last-child { text-align: right; white-space: nowrap; padding-left: 1rem; }
.summary tr.total td { font-weight: 600; font-size: 1.1rem; color: var(--brand-ink); border-bottom: 0; padding-top: .7rem; }
.price-tag { color: var(--muted); font-size: .85rem; }

/* บัญชี */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: .55rem .9rem; cursor: pointer; color: var(--muted); font-weight: 500; }
.tab[aria-selected="true"] { color: var(--brand-ink); border-bottom-color: var(--brand); }
.list { display: grid; gap: .8rem; }
.bk { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; background: #fff; display: grid; gap: .25rem; }
.bk__top { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; align-items: center; }
.bk__title { font-weight: 600; }
.bk__meta { color: var(--muted); font-size: .9rem; }
.badge { display: inline-block; border-radius: 999px; padding: .1rem .6rem; font-size: .78rem; font-weight: 500; white-space: nowrap; }
.badge--processing { background: #e0f2fe; color: #075985; }
.badge--pending { background: #fef3c7; color: #92400e; }
.badge--completed { background: #dcfce7; color: #166534; }
.badge--cancelled { background: #f1f5f9; color: #475569; }
.badge--failed { background: #fee2e2; color: #991b1b; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.map { position: relative; height: 220px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #eaf3f1; }
.map svg { width: 100%; height: 100%; display: block; }

/* footer */
.footer { background: #e4efed; color: var(--ink); margin-top: 2rem; }
.footer__in { display: grid; grid-template-columns: 1fr; gap: 1.2rem; padding-top: 2rem; padding-bottom: 1.6rem; font-size: .93rem; }
.footer__name { font-weight: 600; color: var(--brand); font-size: 1.1rem; margin-bottom: .2rem; }
.footer__links a { margin-right: .9rem; }
.footbar { background: var(--brand); color: #fff; font-size: .85rem; }
.footbar__in { max-width: 1140px; margin: 0 auto; padding: .7rem 1rem; display: flex; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.footbar a { color: #fff; }

/* modal + toast */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(8, 30, 33, .55); display: grid; place-items: center; padding: 1rem; }
.modal__box { background: #fff; border-radius: 18px; width: min(460px, 100%); max-height: calc(100vh - 2rem); overflow: auto; padding: 1.4rem; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 90; background: var(--brand-ink); color: #fff; padding: .65rem 1.1rem; border-radius: 12px; box-shadow: var(--shadow); font-size: .92rem; max-width: calc(100vw - 2rem); }

/* ---------- หลังบ้าน ---------- */
.admin { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - 38px); }
.admin__side { background: var(--brand-ink); color: #cfe3e1; padding: .6rem; min-width: 0; }
.admin__brand { color: #fff; font-weight: 600; padding: .5rem .6rem .7rem; display: flex; gap: .5rem; align-items: center; }
.admin__brand small { display: block; font-weight: 400; color: #9fc2bf; font-size: .75rem; }
.admin__nav { display: flex; gap: .25rem; overflow-x: auto; padding-bottom: .2rem; }
.admin__nav a { color: #cfe3e1; text-decoration: none; padding: .45rem .75rem; border-radius: 10px; white-space: nowrap; font-size: .92rem; }
.admin__nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; font-weight: 500; }
.admin__main { padding: 1.2rem 1rem 3rem; min-width: 0; }
.admin__head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.admin__head h1 { font-size: 1.45rem; margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: #fff; }
.seg button { border: 0; background: none; padding: .3rem .85rem; border-radius: 999px; cursor: pointer; color: var(--muted); font-size: .9rem; }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.search { border: 1.5px solid var(--line); border-radius: 999px; padding: .4rem .9rem; min-width: 0; width: 220px; max-width: 100%; background: #fff; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 760px; }
.table th, .table td { padding: .6rem .75rem; border-bottom: 1px solid #edf3f2; text-align: left; vertical-align: middle; }
.table th { background: #f3f8f7; color: var(--muted); font-weight: 500; font-size: .82rem; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table--sm { min-width: 0; }
.table .num { text-align: right; white-space: nowrap; }
.status-select { border: 1px solid var(--line); border-radius: 8px; padding: .2rem .4rem; background: #fff; font-size: .85rem; }
.stat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; }
.stat b { display: block; font-size: 1.35rem; color: var(--brand-ink); }
.stat span { color: var(--muted); font-size: .85rem; }
.info { background: var(--brand-soft); border-radius: 12px; padding: .7rem .95rem; font-size: .9rem; margin-bottom: 1rem; color: var(--brand-ink); }
.acal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.acal__dow { background: #f3f8f7; padding: .35rem; font-size: .8rem; color: var(--muted); text-align: center; }
.acal__cell { background: #fff; min-height: 96px; padding: .3rem; font-size: .78rem; min-width: 0; }
.acal__cell--off { background: #fafcfc; color: #b4c3c4; }
.acal__cell--today { box-shadow: inset 0 0 0 2px var(--brand); }
.acal__num { font-weight: 600; font-size: .82rem; }
.acal__ev { display: block; border-radius: 6px; padding: .1rem .3rem; margin-top: 2px; background: #e0f2fe; color: #075985; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border: 0; width: 100%; text-align: left; font-size: .74rem; }
.acal__ev--completed { background: #dcfce7; color: #166534; }
.acal__ev--cancelled { background: #f1f5f9; color: #64748b; text-decoration: line-through; }
.acal__ev--failed { background: #fee2e2; color: #991b1b; }
.acal__ev--pending { background: #fef3c7; color: #92400e; }
.tl { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; overflow-x: auto; }
.tl__inner { min-width: 640px; }
.tl__hours { display: grid; margin-left: 120px; font-size: .75rem; color: var(--muted); }
.tl__row { display: flex; align-items: center; border-top: 1px solid #edf3f2; min-height: 46px; }
.tl__label { width: 120px; flex: none; font-size: .85rem; padding-right: .5rem; }
.tl__track { position: relative; flex: 1; height: 46px; }
.tl__bar { position: absolute; top: 8px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; font-size: .75rem; padding: .3rem .5rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border: 0; cursor: pointer; text-align: left; }
.tl__bar--cancelled { background: #cbd5e1; color: #334155; }
.tl__bar--completed { background: #16a34a; }
.tl__bar--failed { background: #dc2626; }
.tl__bar--pending { background: #d97706; }
.tl__grid { position: absolute; inset: 0; display: grid; pointer-events: none; }
.tl__grid span { border-left: 1px dashed #e3ecea; }
.maid-cards { display: grid; grid-template-columns: 1fr; gap: .8rem; }
.maid { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: grid; gap: .5rem; }
.maid__top { display: flex; gap: .8rem; align-items: center; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 600; flex: none; }
.avatar--lg { width: 72px; height: 72px; font-size: 1.4rem; }
.kv { display: grid; grid-template-columns: 1fr; gap: .2rem .9rem; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0 0 .4rem; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .stat-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .maid-cards { grid-template-columns: repeat(2, 1fr); }
  .kv { grid-template-columns: 170px 1fr; }
  .kv dd { margin: 0; }
}
@media (min-width: 900px) {
  .booking-2 { grid-template-columns: 1.15fr .85fr; align-items: start; }
  .footer__in { grid-template-columns: 1.4fr 1fr; }
  .admin { grid-template-columns: 232px minmax(0, 1fr); }
  .admin__side { padding: 1rem .7rem; }
  .admin__nav { flex-direction: column; overflow: visible; }
  .admin__main { padding: 1.6rem 1.8rem 3rem; }
  .maid-cards { grid-template-columns: repeat(3, 1fr); }
}
.demo-bar__short { display: none; }
@media (max-width: 639px) {
  .demo-bar { position: static; }
  .demo-bar__in { padding: .4rem .7rem; }
  .demo-bar__long { display: none; }
  .demo-bar__short { display: inline; }
  .demo-bar__note { flex: 1 1 100%; }
  .header__nav .btn { padding: .5rem .9rem; font-size: .9rem; }
  .card { padding: 1.1rem; }
  .step { width: 96px; font-size: .82rem; }
  .acal__cell { min-height: 64px; padding: .2rem; }
  .acal__ev { font-size: .66rem; padding: 0 .2rem; }
}
@media print { .demo-bar, .header__nav { display: none; } }
