/* SpaX — giao diện ưu tiên điện thoại.
   KTV và lễ tân dùng máy trong lúc đứng, một tay: nút to, chữ đủ lớn,
   ô nhập tối thiểu 16px để iOS không tự phóng to trang khi bấm vào ô. */

:root {
  --nen: #f6f7f9;
  --the: #ffffff;
  --vien: #e3e6ea;
  --chu: #1c2430;
  --chu-nhat: #64707f;
  --chinh: #0f766e;
  --chinh-dam: #0b5c55;
  --chinh-nhat: #e6f3f1;
  --do: #b42318;
  --do-nhat: #fdecea;
  --vang: #b54708;
  --vang-nhat: #fdf3e7;
  --xanh: #067647;
  --xanh-nhat: #e8f6ef;
  --bo-tron: 10px;
  --bong: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--nen);
  color: var(--chu);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--chinh); }

/* ---------- Khung ---------- */

.thanh-tren {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--the);
  border-bottom: 1px solid var(--vien);
}
.thanh-tren .ten-spa {
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  color: var(--chu);
}
.thanh-tren .chi-nhanh {
  font-size: 13px;
  color: var(--chu-nhat);
}
.thanh-tren .phai { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.thanh-tren .nguoi { font-size: 13px; color: var(--chu-nhat); text-align: right; line-height: 1.3; }
.thanh-tren .nguoi b { display: block; color: var(--chu); font-size: 14px; }

.than { padding: 14px; max-width: 900px; margin: 0 auto; }

.chan {
  padding: 24px 14px 40px;
  text-align: center;
  font-size: 12px;
  color: var(--chu-nhat);
}

/* ---------- Thẻ ---------- */

.the {
  background: var(--the);
  border: 1px solid var(--vien);
  border-radius: var(--bo-tron);
  box-shadow: var(--bong);
  padding: 16px;
  margin-bottom: 14px;
}
.the h2 { margin: 0 0 12px; font-size: 16px; }
.the h2 .phu { font-weight: 400; color: var(--chu-nhat); font-size: 13px; }

h1 { font-size: 20px; margin: 0 0 14px; }

/* ---------- Ô nhập ---------- */

label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
label .goi-y { display: block; font-weight: 400; color: var(--chu-nhat); font-size: 12px; margin-top: 2px; }

input[type=text], input[type=tel], input[type=password], input[type=number],
input[type=date], input[type=search], select, textarea {
  width: 100%;
  margin-top: 5px;
  padding: 11px 12px;
  font-size: 16px;   /* dưới 16px iOS sẽ tự phóng to trang */
  font-family: inherit;
  color: var(--chu);
  background: var(--the);
  border: 1px solid var(--vien);
  border-radius: 8px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--chinh);
  outline-offset: -1px;
  border-color: var(--chinh);
}
textarea { min-height: 90px; resize: vertical; }

/* Ô mật khẩu kèm nút hiện/ẩn. Mật khẩu tạm là 11 ký tự ngẫu nhiên; gõ mù thì
   sai một ký tự cũng không biết sai ở đâu, chỉ thấy "không đúng" lặp lại.
   Dùng grid để lề trên 5px của input không bị gộp ra ngoài .o-mk — nếu gộp,
   nút sẽ lệch lên 5px so với ô. */
.o-mk { position: relative; display: grid; }
.o-mk input { padding-right: 62px; }

.hien-mk {
  position: absolute;
  top: 5px;                /* đúng bằng margin-top của input */
  right: 4px;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--chinh);
  cursor: pointer;
}
.hien-mk:hover { background: var(--chinh-nhat); }

.hang { display: flex; gap: 10px; flex-wrap: wrap; }
.hang > * { flex: 1 1 160px; }

/* ---------- Nút ---------- */

.nut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;          /* ngón tay cần chừng này */
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--chinh);
  border: 1px solid var(--chinh);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}
.nut:active { background: var(--chinh-dam); }
.nut.phu { color: var(--chu); background: var(--the); border-color: var(--vien); }
.nut.nguy { color: var(--do); background: var(--do-nhat); border-color: #f5c4bf; }
.nut.rong { width: 100%; }
.nut[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Nhãn thông báo ---------- */

.bao {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 14px;
  border: 1px solid transparent;
}
.bao.ok  { background: var(--xanh-nhat); color: var(--xanh); border-color: #bfe5d2; }
.bao.nhac{ background: var(--vang-nhat); color: var(--vang); border-color: #f2d9b8; }

/* Báo lỗi phải đập vào mắt. Ô lỗi nhạt 14px nằm phía trên nút bấm thì người
   dùng bấm xong nhìn xuống nút, không thấy chữ, tưởng nút hỏng. */
.bao.loi {
  background: var(--do-nhat);
  color: var(--do);
  border-color: #f5c4bf;
  border-left: 4px solid var(--do);
  font-size: 15px;
  font-weight: 600;
}

/* Dải cảnh báo y tế. Cố ý to và đỏ hơn .bao.loi: KTV đọc dòng này lúc đang
   đứng cạnh giường, nhìn lướt một cái phải thấy ngay "đang mang thai". */
.canh-bao-yte {
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--do-nhat);
  border: 1px solid #f5c4bf;
  border-left: 5px solid var(--do);
  border-radius: 8px;
  color: var(--do);
}
.canh-bao-yte b {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.canh-bao-yte ul { margin: 0; padding-left: 20px; font-size: 16px; font-weight: 600; }
.canh-bao-yte li + li { margin-top: 3px; }

/* ---------- Tra cứu ---------- */

.o-tim { display: flex; gap: 8px; align-items: stretch; }
.o-tim input { flex: 1 1 auto; margin-top: 0; min-width: 0; }
.o-tim .nut { flex: 0 0 auto; }

/* ---------- Bảng ---------- */

.cuon { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--vien); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--chu-nhat); font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
td.so, th.so { text-align: right; font-variant-numeric: tabular-nums; }

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--chinh-nhat);
  color: var(--chinh-dam);
}
.chip.tat { background: #eef0f3; color: var(--chu-nhat); }
.chip.canh { background: var(--vang-nhat); color: var(--vang); }

/* Số buổi còn lại — con số duy nhất KTV cần thấy từ xa, đứng cách giường máy tính. */
.so-lon { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; }
.so-lon b { font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.so-lon span { color: var(--chu-nhat); font-size: 14px; }

.trong { padding: 28px 12px; text-align: center; color: var(--chu-nhat); font-size: 14px; }

/* Danh sách nhãn — giá trị. Cột nhãn co theo chữ dài nhất nên không cần đo tay. */
.bang-doi {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 7px 14px;
  font-size: 14px;
}
.bang-doi dt { color: var(--chu-nhat); }
.bang-doi dd { margin: 0; }

/* ---------- Điều hướng ---------- */

.menu { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.menu a {
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--chu-nhat);
  background: var(--the);
  border: 1px solid var(--vien);
  border-radius: 999px;
}
.menu a.dang { color: #fff; background: var(--chinh); border-color: var(--chinh); }

.o-chuc-nang { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.o-chuc-nang a {
  display: block;
  padding: 18px 14px;
  background: var(--the);
  border: 1px solid var(--vien);
  border-radius: var(--bo-tron);
  box-shadow: var(--bong);
  text-decoration: none;
  color: var(--chu);
  font-weight: 600;
}
.o-chuc-nang a .mo-ta { display: block; font-weight: 400; font-size: 13px; color: var(--chu-nhat); margin-top: 3px; }

/* ---------- Màn đăng nhập ---------- */

.man-dang-nhap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.man-dang-nhap .the { width: 100%; max-width: 380px; margin: 0; }
.man-dang-nhap .hieu { text-align: center; margin-bottom: 20px; }
.man-dang-nhap .hieu b { font-size: 22px; }
.man-dang-nhap .hieu span { display: block; color: var(--chu-nhat); font-size: 13px; }
