/* ================= An Rehab Station: professional app look =================
   Loaded after styles.css. Colours and fonts follow anrehab.com (tokens in styles.css :root). */
body { color: var(--body); letter-spacing: -0.005em; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; color: var(--text); }
h1 { font-weight: 700; font-size: 1.5rem; }
h2 { font-weight: 600; font-size: 1.12rem; }
.card, .stat, .table-wrap, .target { border-color: transparent; box-shadow: var(--shadow); }
.card, .stat { border-radius: 18px; }
.stat .v { color: var(--text); font-family: var(--font-display); }
.muted { color: var(--muted); }
a { color: var(--accent); }
button, .btn { white-space: nowrap; border-radius: 999px; font-weight: 500; transition: transform .06s ease, background .15s ease, border-color .15s ease; border-color: var(--line); }
button:hover, .btn:hover { border-color: #d8ccbe; }
button:active, .btn:active { transform: scale(.98); }
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); box-shadow: 0 6px 14px rgba(104, 74, 60, .22); }
button.primary:hover, .btn.primary:hover { background: var(--primary-dark); }
input, textarea, select { border-radius: 14px; background: #fffdf8; border-color: var(--line); }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--primary-soft); border-color: var(--primary); }
.badge.blue { background: var(--primary-soft); color: var(--primary-dark); }
th { color: var(--muted); }
.ok { color: #4d7a3a; }

/* Line icons */
.ic { display: inline-block; vertical-align: -0.2em; flex-shrink: 0; }
h1 .ic, h2 .ic { color: var(--accent); margin-right: 6px; }
button .ic, .btn .ic { margin-right: 2px; }
.card .ic { color: var(--accent); }
button.primary .ic, .btn.primary .ic { color: inherit; }

/* App bar */
.appbar {
  position: sticky; top: 0; z-index: 11;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top));
  background: rgba(255, 251, 243, .9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.appbar img { height: 32px; width: auto; }
.appbar .brand { font-family: var(--font-display); font-weight: 700; color: var(--text); font-size: 1.08rem; letter-spacing: -0.02em; }
.appbar .who { margin-left: auto; font-size: .82rem; color: var(--muted); background: var(--primary-soft); padding: 4px 10px; border-radius: 999px; }

/* Bottom / top navigation */
.nav { background: rgba(255, 253, 248, .96); backdrop-filter: blur(12px); border-top-color: var(--line); box-shadow: 0 -6px 24px rgba(74, 50, 37, .06); }
.nav a { color: #9d9184; gap: 2px; font-weight: 500; }
.nav a span { display: grid; place-items: center; width: 44px; height: 30px; border-radius: 999px; transition: background .15s ease; }
.nav a.active { color: var(--text); font-weight: 600; }
.nav a.active span { background: var(--primary-soft); color: var(--primary); }

/* Tabs as pills */
.tabs .btn[aria-pressed="true"], .tabs button[aria-pressed="true"] { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }

/* Login */
.auth { border-radius: 24px; padding: 28px 22px; }
.auth-logo { display: block; margin: 0 auto 6px; max-width: 150px; max-height: 170px; }
.auth h1 { font-size: 1.4rem; }

/* ---------- Public booking page ---------- */
body.booking { padding: 0 0 24px; background: var(--bg); }
.hero {
  background: radial-gradient(120% 90% at 50% 0%, #3a2a20 0%, var(--dark) 70%);
  color: #f3e9d8; padding: 30px 16px 58px; text-align: center;
  border-radius: 0 0 32px 32px;
}
.hero-inner { max-width: 640px; margin: 0 auto; }
.hero-logo { width: 120px; height: auto; margin-bottom: 4px; }
.hero h1 { color: #f3e9d8; font-size: 1.7rem; margin: 4px 0 6px; }
/* The logo already shows the name; keep the heading for screen readers only. */
.hero-logo + h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-logo { display: block; margin: 0 auto 12px; }
.hero-intro { color: #d8ccbe; margin: 0 auto 12px; max-width: 520px; }
.hero-contact { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; font-size: .92rem; color: #d8ccbe; }
.hero-contact a, .hero-contact span { color: #f3e9d8; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.hero-contact .ic { color: #c9a98a; }
.book-main { max-width: 640px; margin: -36px auto 0; padding: 0 16px; }
.book-footer { padding: 18px 0 8px; font-size: .8rem; }
.steps { list-style: none; padding: 12px; margin: 0 0 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .76rem; color: var(--muted); }
.steps li span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); font-weight: 700; color: var(--muted); }
.steps li.active { color: var(--text); font-weight: 600; }
.steps li.active span { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-soft); }
.steps li.done span { background: #e2d5c4; color: var(--primary-dark); }
.pick-summary { background: var(--primary-soft); color: var(--text); border-radius: 14px; padding: 10px 12px; font-size: .9rem; margin-bottom: 4px; }
.svc-list { display: grid; gap: 10px; }
.svc { display: grid; gap: 4px; text-align: left; justify-items: start; justify-content: stretch; align-content: start; width: 100%; padding: 16px 18px; background: #fff; border: 2px solid transparent; box-shadow: var(--shadow); border-radius: 18px; min-height: 0; }
.svc:hover { border-color: #e2d5c4; }
.svc-name { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--text); }
.svc-meta { color: var(--accent); font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.svc-desc { color: var(--muted); font-size: .88rem; }
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; }
.date-chip { flex: 0 0 72px; display: flex; flex-direction: column; gap: 2px; padding: 10px 4px; border-radius: 18px; background: #fff; border: 2px solid transparent; box-shadow: var(--shadow); scroll-snap-align: start; min-height: 0; }
.date-chip .dc-dow { font-size: .74rem; color: var(--muted); }
.date-chip .dc-day { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--text); }
.date-chip .dc-mon { font-size: .72rem; color: var(--muted); }
.date-chip:disabled { opacity: .35; box-shadow: none; background: transparent; }
.date-chip[aria-pressed="true"] { border-color: var(--primary); }
.slot-group { margin: 14px 0 6px; font-size: .9rem; color: var(--muted); font-weight: 600; font-family: var(--font-sans, inherit); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot { background: #fff; box-shadow: var(--shadow); border: 2px solid transparent; font-weight: 600; color: var(--text); border-radius: 14px; }
.slot:hover { border-color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { min-height: 34px; padding: 5px 12px; border-radius: 999px; font-size: .86rem; background: #fffdf8; }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
button.big { min-height: 52px; font-size: 1.05rem; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; min-height: 0; font-weight: 600; box-shadow: none; }
.back { margin-top: 16px; }
.small { font-size: .8rem; }
.done-card { padding: 28px 18px; margin-top: 10px; }
.done-icon { width: 64px; height: 64px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; color: #fff; background: var(--primary); box-shadow: 0 0 0 8px var(--primary-soft); }
.center-row { justify-content: center; }

/* ---------- Therapy (owner) ---------- */
.booking-card { border-left: 4px solid #e2d5c4; }
.booking-card.pending { border-left-color: #c58b3e; }
.booking-card.confirmed { border-left-color: var(--primary); }
.lesson-card.therapy { border-left: 4px solid #c9a98a; }
.pain-scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; }
.pain-scale button { min-height: 36px; padding: 0; font-size: .85rem; border-radius: 10px; }
.pain-scale button[aria-pressed="true"] { color: #fff; border-color: transparent; }
.pain-scale button[aria-pressed="true"][data-level="low"] { background: #5d8a4a; }
.pain-scale button[aria-pressed="true"][data-level="mid"] { background: #c58b3e; }
.pain-scale button[aria-pressed="true"][data-level="high"] { background: #b5523b; }
.visit { border-left: 3px solid var(--primary-soft); padding-left: 10px; margin: 10px 0; }
.share-link { display: flex; gap: 6px; }
.share-link input { font-size: .85rem; }
.pkg .bar { background: var(--primary-soft); }
.pkg .bar span, .bar-fill { background: var(--primary); }

@media (min-width: 900px) {
  .appbar { position: fixed; left: 0; right: 0; top: 0; }
  body:not(.booking) { padding-top: 112px; }
  .nav { top: 49px; box-shadow: 0 6px 20px rgba(74, 50, 37, .05); }
  .nav a { gap: 6px; }
  .nav a span { width: 34px; }
}

/* ================= Hệ thống giao diện v2 (dùng chung mọi trang) =================
   Khuôn chung: tiêu đề trang có dòng phụ, thẻ tóm tắt màu nâu, danh sách (biểu tượng · tên · phụ · mũi tên),
   thanh chọn, số đếm tròn. Một nút chính mỗi màn; vùng chạm ≥ 44px. */
:root { --surface2: #f6efe3; --line-soft: #f1e8da; --faint: #b3a594; }
body { font-size: 15px; line-height: 1.5; }
main { max-width: 760px; padding: 10px 20px 24px; }
h1 { font-size: 24px; line-height: 1.2; margin: 6px 0 14px; }
h2 { font-size: 17px; margin: 22px 0 10px; }
.muted { font-size: 13px; }
.nav a { color: var(--muted); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.page-head h1 { margin: 0; }
.eyebrow { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.back { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; min-height: 36px; margin: 0 0 4px -4px; color: var(--accent); }
.sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 24px 0 10px; }
.sec h2 { margin: 0; }
.sec a { font-size: 13.5px; font-weight: 600; }

/* Thẻ tóm tắt (nâu An Rehab) */
.brief { display: block; background: var(--primary); color: #fffbf3; border-radius: 22px; padding: 18px; box-shadow: 0 10px 24px rgba(104, 74, 60, .25); }
.brief .brief-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; color: #ead9c3; }
.brief .brief-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.brief .n { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.1; color: #fffbf3; font-variant-numeric: tabular-nums; }
.brief .n small { font-size: 15px; }
.brief .l { display: block; font-size: 12px; color: #ead9c3; }
a.brief:active { background: var(--primary-dark); }

/* Danh sách */
.list { background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 10px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 62px; color: var(--body); border-top: 1px solid var(--line-soft); font-weight: inherit; }
.li:first-child { border-top: 0; }
a.li:active { background: var(--surface2); }
.li .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.li .t b { font-size: 15px; font-weight: 600; color: var(--text); }
.li .t span { font-size: 12.5px; color: var(--muted); }
.li .chev { color: var(--faint); display: flex; }
.li .time { width: 50px; display: flex; flex-direction: column; font-family: var(--font-display); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.li .time span { font-family: inherit; font-size: 12px; color: var(--muted); font-weight: 500; }
.li .bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--primary); }
.li .bar.therapy { background: #c9a98a; }
.li .bar.off { background: var(--line); }

.ibox { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--primary-soft); color: var(--primary); }
.ibox .ic { color: inherit !important; margin: 0 !important; }
.ibox.green { background: #e6efdd; color: #4d7a3a; }
.ibox.amber { background: #f8ead2; color: #9a5b14; }
.ibox.red { background: #f7e1dc; color: #a33f2b; }
.ibox.gray { background: var(--surface2); color: var(--muted); }
.count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; background: var(--primary); color: #fff; }
.count.soft { background: var(--primary-soft); color: var(--primary); }

/* Thanh chọn */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: #efe4d3; border-radius: 14px; margin: 4px 0 16px; }
.seg a { min-height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 0 6px; text-align: center; line-height: 1.2; }
.seg a[aria-current="page"] { background: #fff; color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(74, 50, 37, .12); }

.stats { gap: 10px; }
.card.warn { background: #fbf1df; color: #7a4a12; box-shadow: none; }

/* Trang đặt lịch: mô tả dịch vụ dài phải xuống dòng, không tràn ngang trên điện thoại */
.svc, .svc * { white-space: normal; min-width: 0; }
.svc-list { min-width: 0; }
