/* Đặt lịch Spa (tiền tố ms-). Bảng lịch `ms-luoi` và form `ms-form` cũng được Đặt lịch Nhà hàng dùng lại (mh/dat-lich-nha-hang). */
/* Màu thanh theo thời lượng: design/tokens.json massage_thoi_luong */
.ms-trang { height: 100%; display: flex; flex-direction: column; gap: 14px; padding: 20px 24px; min-height: 0; }
.ms-thanh-cong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; }
.ms-phai { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.ms-trang .chip { height: 36px; padding: 0 14px; font-size: calc(14px * var(--co-chu)); border-width: 1.5px; }
.ms-chon-ngay-hang { display: flex; gap: 8px; }

/* Chọn ngày bằng lịch: ô ngày thật nằm đè lên chip, trong suốt */
.ms-chon-ngay { position: relative; overflow: hidden; padding: 0 10px; }
.ms-chon-ngay input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
/* Chip khung giờ có 2 mũi tên */
.chip.ms-chip-gio { padding: 0 4px; gap: 2px; cursor: default; }
.ms-chip-gio span { padding: 0 6px; min-width: 112px; text-align: center; }
.ms-chip-gio button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; color: var(--chu); }
.ms-chip-gio button:disabled { opacity: .3; cursor: default; }
.ms-chip-gio button:not(:disabled):hover { background: var(--kem); }
.ms-ngay-dt { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 4px; border-radius: 999px; background: #fff; border: 1.5px solid var(--vien-dam); }
.ms-ngay-dt button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; color: var(--chu); }
.ms-ngay-dt b { font-size: calc(14px * var(--co-chu)); padding: 0 4px; white-space: nowrap; }
.ms-ngay-dt .ms-chon-ngay { height: 32px; border: 0; padding: 0 8px; background: var(--kem); }
.ms-ngay-dt .ms-chon-ngay.on { background: var(--xanh-rung); }

.ms-chan .nut-chung.chinh { width: 100%; }
.ms-trang .hop-chan > .nut-chung, .ms-trang .hop-chan > .nut-chung.chinh { flex: 1; }

/* Chú thích màu, KTV rảnh */
.ms-hang-chu-thich { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; flex: none; font-size: calc(13px * var(--co-chu)); font-weight: 500; color: #4A4436; }
.ms-chu-thich { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ms-chu-thich span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ms-chu-thich i { display: inline-block; width: 22px; height: 12px; border-radius: 4px; flex: none; }
.ms-lg60 { background: #DCEFD9; box-shadow: inset 0 0 0 1.5px #7DBB86; }
.ms-lg90 { background: #FBEBC8; box-shadow: inset 0 0 0 1.5px #E2B65A; }
.ms-lg120 { background: #F8DDD2; box-shadow: inset 0 0 0 1.5px #D98A6B; }
.ms-lggd { background: #E2EBF5; box-shadow: inset 0 0 0 1.5px #8FB0D3; }
.ms-lgngoai { background: repeating-linear-gradient(135deg, #E4E0D4 0 4px, #F8F6F0 4px 8px); }
.ms-ranh { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: #E3F1E5; color: #1D4A27; font-weight: 700; }

/* Chờ xếp KTV */
.ms-cho-xep { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: #FFF8E8; border: 1px solid #EFC56D; min-width: 0; }
.ms-cho-xep-dau { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: calc(13.5px * var(--co-chu)); color: #7A4E05; white-space: nowrap; }
.ms-cho-xep-dau b { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--cam); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: calc(12px * var(--co-chu)); }
.ms-cho-xep-ds { display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; padding: 1px; }
.ms-cho-xep-ds::-webkit-scrollbar { display: none; }
.ms-cho-xep-muc { flex: none; height: 44px; padding: 0 12px; border-radius: 10px; background: #fff; border: 1.5px solid #EFC56D; display: inline-flex; align-items: center; gap: 10px; font-size: calc(13px * var(--co-chu)); color: var(--chu); white-space: nowrap; }
.ms-cho-xep-muc em { font-style: normal; font-weight: 700; color: var(--xanh-rung); }
.ms-cho-xep-muc:disabled { opacity: .6; cursor: default; }

/* Khung chứa bảng */
.ms-the-luoi { flex: 1; min-height: 0; overflow: auto; background: #fff; border: 1px solid var(--vien); border-radius: 16px; padding: 0 10px 8px; position: relative; }
.ms-the-luoi > .khung-trong, .ms-the-luoi > .khung-loi, .ms-the-luoi > .dang-tai-nho { margin: 40px auto; }

/* Bảng giờ */
.ms-luoi { position: relative; min-width: 0; }
.ms-luoi-dau { position: sticky; top: 0; z-index: 6; display: flex; height: 36px; background: #fff; padding-top: 2px; }
.ms-nhan-goc { width: var(--cot-nhan); flex: none; }
.ms-luoi-gio { flex: 1; position: relative; }
.ms-moc { position: absolute; top: 11px; transform: translateX(-50%); font-size: calc(12px * var(--co-chu)); font-weight: 700; color: #6B6557; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ms-moc.dau { transform: none; }
.ms-moc.cuoi { transform: translateX(-100%); }
.ms-bay-gio-nhan { position: absolute; top: 6px; transform: translateX(-50%); background: #D2452F; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 7px; z-index: 5; font-variant-numeric: tabular-nums; }
.ms-luoi-than { position: relative; }
.ms-hang { display: flex; height: var(--cao-hang); border-top: 1px solid #ECE8DE; }
.ms-ten-hang { width: var(--cot-nhan); flex: none; display: flex; flex-direction: column; justify-content: center; padding-left: 12px; font-weight: 700; font-size: calc(13px * var(--co-chu)); color: var(--chu); white-space: nowrap; line-height: 1.2; min-width: 0; }
.ms-ten-hang small { font-size: 10.5px; font-weight: 500; color: #8A8372; }
.ms-vung { position: relative; flex: 1; min-width: 0;
  background-image: linear-gradient(90deg, #DCD7C9 1px, transparent 1px), linear-gradient(90deg, #F0ECE2 1px, transparent 1px);
  background-size: calc(100% / var(--so-gio)) 100%, calc(100% / (var(--so-gio) * 4)) 100%; }
.ms-ngoai-ca { position: absolute; top: 4px; bottom: 4px; border-radius: 8px; background: repeating-linear-gradient(135deg, #EEEAE0 0 6px, #F8F6F0 6px 12px); color: #8A8372; font-size: 11px; font-weight: 700; display: flex; align-items: center; padding-left: 8px; white-space: nowrap; overflow: hidden; }
.ms-bay-gio { position: absolute; top: -8px; bottom: 0; width: 2px; margin-left: -1px; background: #D2452F; z-index: 1; pointer-events: none; }

/* Thanh lịch */
.ms-thanh { position: absolute; z-index: 2; top: 5px; height: calc(var(--cao-hang) - 10px); border: 0; border-radius: 9px; padding: 3px 8px; text-align: left; font-size: 11.5px; line-height: 1.25; font-weight: 700;
  overflow: hidden; white-space: nowrap; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.ms-thanh > b, .ms-thanh > small { display: block; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.ms-thanh > small { font-weight: 500; opacity: .8; font-size: 10.5px; }
.ms-thanh.chon { z-index: 3; box-shadow: 0 0 0 2.5px var(--xanh-dam), 0 6px 14px rgba(0, 0, 0, .18); }
.ms-thanh.hep { padding: 0; }
.ms-thanh.hep > * { display: none; }
.ms-thanh.cat-trai { border-top-left-radius: 2px; border-bottom-left-radius: 2px; }
.ms-thanh.cat-phai { border-top-right-radius: 2px; border-bottom-right-radius: 2px; }
.ms-thanh:focus-visible { outline-offset: 1px; }
.ms-m60 { background: #DCEFD9; color: #1F5A2B; }
.ms-m90 { background: #FBEBC8; color: #7A4E05; }
.ms-m120 { background: #F8DDD2; color: #7A2E14; }
.ms-mgd { background: #E2EBF5; color: #2B4C70; }

/* Điện thoại: chân trang ghi chú */
.ms-chan-dt { flex: none; display: flex; flex-direction: column; gap: 2px; font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); padding-bottom: 6px; line-height: 1.35; }
.ms-chan-dt b { color: var(--xanh-dam); font-size: calc(13px * var(--co-chu)); }
.ms-chan-dt .ms-lien-ket { display: inline; min-height: 0; padding: 0; font-size: calc(12.5px * var(--co-chu)); }
.ms-lien-ket { background: none; border: 0; padding: 4px 0; color: var(--xanh-rung); font-weight: 700; font-size: calc(13.5px * var(--co-chu)); text-align: left; text-decoration: underline; width: fit-content; min-height: 32px; }

/* Form trong ngăn bên (tạo lịch, sửa lịch) */
.ms-form { display: flex; flex-direction: column; gap: 16px; }
.ms-truong { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ms-nhan { font-size: calc(13px * var(--co-chu)); font-weight: 700; color: var(--nau); }
.ms-nhan i { color: var(--canh-bao); font-style: normal; }
.ms-nhan span { font-weight: 500; color: var(--chu-phu); font-size: calc(12.5px * var(--co-chu)); }
.ms-truong.co-loi .o-quet-vong { border-color: #E3B4AE; }
.ms-ghi-chu { font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); line-height: 1.4; }
.ms-tu-dien { padding: 11px 14px; border-radius: 12px; background: #F0FBF2; border: 1px solid #CFE6D3; font-size: calc(13.5px * var(--co-chu)); line-height: 1.5; color: var(--chu); }
.ms-tu-dien-dau { font-size: calc(13px * var(--co-chu)); font-weight: 700; color: var(--xanh-rung); }
.ms-tu-dien a { color: var(--xanh-dam); font-weight: 700; }
.ms-tu-dien-phu { color: #4A4436; font-size: calc(13px * var(--co-chu)); }
.ms-hang-gio { display: flex; gap: 10px; }
.ms-o-gio { flex: 1; min-width: 0; height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--vien-dam); background: #fff; color: var(--chu-phu); }
.ms-o-gio:focus-within { border-color: var(--xanh-rung); box-shadow: 0 0 0 3px rgba(45, 102, 53, .15); }
.ms-o-gio input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 500; color: var(--chu); font-variant-numeric: tabular-nums; }
.ms-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.ms-chon { height: 42px; padding: 0 16px; font-size: calc(14.5px * var(--co-chu)); border-width: 1px; }
.chip.ms-chon:disabled { cursor: not-allowed; }
.chip.ms-chon.ms-ban { color: #A39C8B; text-decoration: line-through; background: var(--ban-ghi); border-color: var(--vien); }
.ms-chon-phu { font-size: 11.5px; font-weight: 700; opacity: .7; }
.ms-ket-thuc { font-size: calc(13px * var(--co-chu)); color: var(--nau); }
.ms-hang-khac { display: flex; gap: 12px; align-items: center; }
.ms-hang-khac .o-nhap-nho { flex: 1; min-width: 0; height: 44px; }
.ms-tick { display: inline-flex; align-items: center; gap: 10px; font-size: calc(14.5px * var(--co-chu)); font-weight: 500; white-space: nowrap; min-height: 44px; }
.ms-tick input { width: 22px; height: 22px; accent-color: var(--xanh-rung); margin: 0; }
.ms-chan { display: flex; flex-direction: column; gap: 8px; }
.ms-chan-ghi { display: flex; gap: 6px; align-items: flex-start; font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); line-height: 1.4; }
.ms-chan-ghi svg { margin-top: 1px; }
.ms-chan-ghi.xong { color: #1D4A27; }
.ms-loi { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #FFF5F4; border: 1px solid #E3B4AE; color: var(--canh-bao); font-size: calc(13.5px * var(--co-chu)); font-weight: 500; line-height: 1.4; }
.ms-loi svg { margin-top: 1px; }
.ms-form .o-nhap-nho { border-radius: 10px; }

/* Chi tiết lịch */
.ms-chi-tiet { display: flex; flex-direction: column; gap: 2px; }
.ms-ct-dau { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ms-ct-ten { font-size: calc(17px * var(--co-chu)); font-weight: 700; color: var(--xanh-dam); }
.ms-ct-dong { display: flex; gap: 10px; padding: 7px 0; font-size: calc(14.5px * var(--co-chu)); border-bottom: 1px solid #F0ECE2; }
.ms-ct-nhan { width: 96px; flex: none; color: var(--chu-phu); font-size: calc(13.5px * var(--co-chu)); }
.ms-ct-dong b { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.ms-sdt { display: inline-flex; align-items: center; gap: 6px; color: var(--xanh-dam); font-weight: 700; }
.ms-mo { color: var(--chu-phu); font-weight: 500; }
.ms-ct-nut { display: flex; gap: 8px; margin-top: 16px; }
.ms-ct-nut > .nut-chung, .ms-ct-nut > .nut-chung.chinh { flex: 1; }

/* Báo tour */
.ms-tour-chip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ms-bang-tour { width: 100%; border-collapse: collapse; font-size: calc(14px * var(--co-chu)); }
.ms-bang-tour th { text-align: left; font-size: calc(12px * var(--co-chu)); color: var(--chu-phu); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--vien); }
.ms-bang-tour td { padding: 8px; border-bottom: 1px solid #F0ECE2; }
.ms-bang-tour .so-cot { text-align: right; }
.ms-bang-tour tr.trong td { color: #A39C8B; }
.ms-bang-tour tfoot td { font-weight: 700; color: var(--xanh-dam); border-bottom: 0; border-top: 2px solid var(--vien); }

/* iPad: bảng 6 giờ; máy tính: 8 giờ (cửa sổ giờ chọn trong mã). Điện thoại: */
@media (max-width: 767px) {
  .ms-trang { padding: 6px 12px 0; gap: 10px; }
  .ms-thanh-cong { flex-wrap: nowrap; }
  .ms-hang-chu-thich { gap: 8px 10px; flex-wrap: nowrap; }
  .ms-chip-gio span { min-width: 0; padding: 0 4px; }
  .ms-chu-thich { gap: 8px; margin-left: auto; font-size: calc(12px * var(--co-chu)); flex-wrap: nowrap; }
  .ms-chu-thich i { width: 16px; height: 10px; }
  .ms-the-luoi { padding: 0 4px 6px; border-radius: 14px; }
  .ms-luoi-dau { height: 34px; }
  .ms-ten-hang { padding-left: 10px; }
  .ms-thanh { padding: 2px 6px; border-radius: 8px; font-size: calc(12px * var(--co-chu)); }
  .ms-cho-xep { padding: 6px 8px 6px 10px; gap: 8px; }
  .ms-cho-xep-muc { height: 44px; font-size: calc(13px * var(--co-chu)); }
  .ms-tu-dien { font-size: calc(13px * var(--co-chu)); }
  .ms-hang-khac { flex-direction: column; align-items: stretch; gap: 8px; }
  .ms-hang-khac .o-nhap-nho { flex: none; width: 100%; }
}
