/* Sổ khách hàng · Tiệm Bánh Nhà Mây — giao diện điện thoại, chữ to, ít nút */

@font-face { font-family: 'Be Vietnam Pro'; src: url('../font/BeVietnamPro-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('../font/BeVietnamPro-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('../font/PlayfairDisplay-700.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --caramel: #C0703A;
  --caramel-dam: #A65E2E;
  --caramel-nhat: #F8E7D8;
  --cacao: #3B2A20;
  --kem: #F3E3D3;
  --nen: #FBF6EF;
  --trang: #FFFFFF;
  --chu: #3B2A20;
  --chu-phu: #76604F;
  --vien: #EFE4D8;
  --do: #C2412D;
  --do-dam: #A8301F;
  --do-nhat: #FCE9E5;
  --xanh: #4F6330;
  --xanh-nhat: #E8EEDD;
  --xam-nhat: #F1EBE4;
  --bong: 0 1px 2px rgba(59, 42, 32, .06), 0 6px 18px rgba(59, 42, 32, .07);
  --bong-cao: 0 10px 30px rgba(59, 42, 32, .16);
  --be-rong: 480px;
  --an-toan-duoi: env(safe-area-inset-bottom, 0px);
  --an-toan-tren: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.45;
  color: var(--chu);
  background: #EADFD3;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

.khung {
  position: relative;
  max-width: var(--be-rong);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--nen);
  padding-bottom: calc(112px + var(--an-toan-duoi));
}
@media (min-width: 520px) {
  body { background: radial-gradient(circle at 20% 10%, #F3E3D3 0, #EADFD3 45%, #E2D3C4 100%) fixed; }
  .khung { box-shadow: 0 0 0 1px rgba(59, 42, 32, .05), 0 20px 60px rgba(59, 42, 32, .18); }
}

.bt { width: 24px; height: 24px; flex: none; }

/* ---------- Màn chờ, lỗi ---------- */
.man-cho {
  min-height: 80vh; display: grid; place-content: center; justify-items: center; gap: 14px;
  color: var(--chu-phu);
}
.man-cho img { animation: tho 1.4s ease-in-out infinite; }
@keyframes tho { 50% { transform: translateY(-6px); } }

/* ---------- Đầu trang Hôm nay ---------- */
.dau {
  position: relative;
  padding: calc(var(--an-toan-tren) + 16px) 20px 56px;
  color: var(--kem);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(192, 112, 58, .45) 0, rgba(192, 112, 58, 0) 60%),
    var(--cacao);
  border-radius: 0 0 30px 30px;
}
.dau__tren { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.thuong-hieu { display: flex; align-items: center; gap: 10px; min-width: 0; }
.thuong-hieu__logo {
  width: 46px; height: 46px; border-radius: 14px; background: var(--nen);
  display: grid; place-items: center; flex: none;
}
.thuong-hieu__logo img { width: 38px; height: auto; display: block; }
.thuong-hieu__chu { display: flex; flex-direction: column; line-height: 1.2; }
.thuong-hieu__chu b { font-size: 17px; color: var(--kem); }
.thuong-hieu__chu span { font-size: 15px; color: #E3B48F; }
.dau h1 {
  margin-top: 18px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 30px; line-height: 1.15; color: #FFF7EE;
}
.dau__ngay { margin-top: 6px; font-size: 17px; color: rgba(243, 227, 211, .82); }

.so-lieu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.so-lieu__o {
  padding: 10px 9px 10px 11px;
  border-radius: 18px;
  min-width: 0;
  background: rgba(255, 247, 238, .08);
  border: 1px solid rgba(243, 227, 211, .14);
}
.so-lieu__so { display: block; font-family: 'Playfair Display', Georgia, serif; font-size: 30px; line-height: 1.1; color: #FFF7EE; }
.so-lieu__nhan { display: block; margin-top: 1px; font-size: 15px; color: rgba(243, 227, 211, .85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-lieu__o--qua .so-lieu__so { color: #FF9C87; }
.so-lieu__o--homnay .so-lieu__so { color: #F5C79F; }

.nut-nguoi {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(243, 227, 211, .5);
  padding: 0; background: none; flex: none; display: grid; place-items: center;
}
.nut-nguoi .anh { width: 42px; height: 42px; font-size: 16px; }

/* ---------- Ảnh chữ cái đầu ---------- */
.anh {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: var(--nen-anh, var(--kem)); color: var(--chu-anh, var(--cacao));
  font-weight: 700; font-size: 20px; letter-spacing: .5px;
  box-shadow: inset 0 0 0 1px rgba(59, 42, 32, .06);
}
.anh--lon { width: 92px; height: 92px; font-size: 32px; box-shadow: 0 0 0 5px var(--trang), var(--bong); }

/* ---------- Ô tìm ---------- */
.o-tim { position: relative; margin: -32px 16px 0; z-index: 2; }
.o-tim--phang { margin: 0 16px; }
.o-tim .bt { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--caramel); pointer-events: none; }
.o-tim input {
  width: 100%; height: 62px; border-radius: 20px; border: 1px solid var(--vien);
  background: var(--trang); padding: 0 16px 0 54px; font-size: 18px;
  box-shadow: var(--bong-cao); outline: none; -webkit-appearance: none; appearance: none;
}
.o-tim--phang input { box-shadow: var(--bong); }
.o-tim input::placeholder { color: #9C8676; }
.o-tim input:focus { border-color: var(--caramel); box-shadow: 0 0 0 4px rgba(192, 112, 58, .18), var(--bong-cao); }
.o-tim input::-webkit-search-cancel-button { display: none; }
.o-tim__xoa {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--xam-nhat); color: var(--chu-phu);
  display: none; place-items: center;
}
.o-tim--co-chu .o-tim__xoa { display: grid; }
.o-tim--co-chu input { padding-right: 60px; }
.o-tim__xoa .bt { position: static; transform: none; color: inherit; width: 20px; height: 20px; }

/* ---------- Thanh chọn chia đều: chọn sale (quản lý), chọn nhóm ---------- */
.phan-doan {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(76px, 1fr); gap: 4px;
  margin: 16px 16px 0; padding: 5px; overflow-x: auto; scrollbar-width: none;
  background: var(--trang); border: 1px solid var(--vien); border-radius: 20px; box-shadow: var(--bong);
}
.phan-doan::-webkit-scrollbar { display: none; }
.doan {
  min-height: 60px; padding: 6px 6px; border: 0; border-radius: 15px; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 17px; font-weight: 700; line-height: 1.2; color: var(--chu); white-space: nowrap;
}
.doan__so { font-size: 15px; font-weight: 400; color: var(--chu-phu); }
.doan--chon { background: var(--cacao); color: var(--kem); box-shadow: 0 4px 10px rgba(59, 42, 32, .2); }
.doan--chon .doan__so { color: rgba(243, 227, 211, .85); }

/* ---------- Nhóm và thẻ khách ---------- */
.nhom { margin-top: 24px; }
.nhom__dau {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 20px 12px;
}
.nhom__dau h2 { font-size: 19px; display: flex; align-items: center; gap: 9px; }
.nhom__dau h2::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--caramel); }
.nhom--qua .nhom__dau h2::before { background: var(--do); box-shadow: 0 0 0 4px var(--do-nhat); }
.nhom__dem { font-size: 16px; color: var(--chu-phu); }

.the {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  margin: 0 16px 12px; padding: 14px 12px 14px 14px; min-height: 92px;
  background: var(--trang); border: 1px solid var(--vien); border-radius: 22px;
  box-shadow: var(--bong); text-decoration: none; color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.the:active { transform: scale(.985); box-shadow: 0 1px 2px rgba(59, 42, 32, .08); }
.the--qua { box-shadow: inset 5px 0 0 var(--do), var(--bong); border-color: #F3D2CB; }
.the--homnay { box-shadow: inset 5px 0 0 var(--caramel), var(--bong); }
.the--ngung { opacity: .78; }
.the__giua { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.the__ten {
  font-size: 19px; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.the__dong { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.the__sale { display: inline-flex; align-items: center; gap: 5px; font-size: 16px; color: var(--chu-phu); }
.the__sale .bt { width: 17px; height: 17px; }
.the__ghi { font-size: 16px; color: var(--chu-phu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.the__mui { color: #C9B5A4; display: grid; }

.nhan {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 15px;
  font-size: 15px; font-weight: 700; white-space: nowrap;
}
.nhan--qua { background: var(--do-nhat); color: var(--do-dam); }
.nhan--homnay { background: var(--caramel-nhat); color: #8E4C20; }
.nhan--sap { background: var(--xanh-nhat); color: var(--xanh); }
.nhan--xa, .nhan--khong { background: var(--xam-nhat); color: var(--chu-phu); }
.nhan--ngung { background: #ECE7E2; color: #6E655E; }

/* Thẻ gợi ý "sắp tới" */
.the-goi-y {
  display: flex; align-items: center; gap: 14px; margin: 8px 16px 0; padding: 16px;
  border-radius: 22px; border: 1.5px dashed #E2CDB8; background: #FFFBF6;
  text-decoration: none; color: inherit;
}
.the-goi-y__bt {
  width: 48px; height: 48px; border-radius: 15px; background: var(--caramel-nhat); color: var(--caramel-dam);
  display: grid; place-items: center; flex: none;
}
.the-goi-y__chu b { display: block; font-size: 18px; }
.the-goi-y__chu span { display: block; font-size: 16px; color: var(--chu-phu); }
.the-goi-y > .bt { margin-left: auto; color: #C9B5A4; }

/* ---------- Màn trống ---------- */
.trong {
  margin: 28px 16px 0; padding: 26px 22px 28px; text-align: center;
  background: var(--trang); border: 1px solid var(--vien); border-radius: 26px; box-shadow: var(--bong);
}
.hinh-may { width: 150px; height: auto; display: block; margin: 0 auto 10px; }
.trong h3 { font-family: 'Playfair Display', Georgia, serif; font-size: 25px; }
.trong p { margin-top: 8px; color: var(--chu-phu); font-size: 17px; }
.man-loi { padding-top: 72px; } /* đệm thay cho lề, để lề không lọt ra ngoài khung */

/* ---------- Thanh dưới ---------- */
.thanh-duoi {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 20;
  width: 100%; max-width: var(--be-rong);
  display: flex; align-items: flex-end; justify-content: space-around;
  padding: 8px 12px calc(10px + var(--an-toan-duoi));
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--vien);
  box-shadow: 0 -6px 24px rgba(59, 42, 32, .06);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: #8D7867; font-size: 15px; font-weight: 700; padding: 4px 0;
}
.tab__bt { width: 64px; height: 36px; border-radius: 18px; display: grid; place-items: center; position: relative; }
.tab--chon { color: var(--caramel-dam); }
.tab--chon .tab__bt { background: var(--caramel-nhat); }
.tab__dem {
  position: absolute; top: -3px; right: 6px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: var(--do); color: #fff; font-size: 13px; line-height: 22px; text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

/* ---------- Thanh trên màn con ---------- */
.thanh-tren {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(var(--an-toan-tren) + 10px) 16px 10px;
  background: rgba(251, 246, 239, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.thanh-tren__tieu-de { font-size: 18px; font-weight: 700; flex: 1; text-align: center; }
.nut-tron {
  width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--vien);
  background: var(--trang); box-shadow: var(--bong); display: grid; place-items: center; color: var(--cacao);
  flex: none; text-decoration: none;
}
.ma-khach {
  min-width: 50px; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--kem);
  color: var(--caramel-dam); font-weight: 700; font-size: 15px; display: grid; place-items: center;
}

/* ---------- Hồ sơ khách ---------- */
.ho-so { text-align: center; padding: 8px 20px 0; }
.ho-so .anh--lon { margin: 4px auto 0; }
.ho-so h1 { margin-top: 16px; font-family: 'Playfair Display', Georgia, serif; font-size: 28px; line-height: 1.2; }
.ho-so__sdt { display: inline-block; margin-top: 6px; font-size: 21px; font-weight: 700; color: var(--caramel-dam); letter-spacing: .3px; text-decoration: none; }
.ho-so__chip { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.chip-nho {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: 18px;
  background: var(--trang); border: 1px solid var(--vien); font-size: 16px; color: var(--chu-phu);
}
.chip-nho .bt { width: 18px; height: 18px; color: var(--caramel); }
.chip-nho--dang { background: var(--xanh-nhat); border-color: #D6E0C6; color: var(--xanh); }
.chip-nho--dang .bt { color: var(--xanh); }
.chip-nho--ngung { background: #ECE7E2; color: #6E655E; }
.chip-nho--ngung .bt { color: #6E655E; }

.o-hen {
  display: flex; align-items: center; gap: 14px; margin: 22px 16px 0; padding: 16px;
  border-radius: 22px; background: var(--trang); border: 1px solid var(--vien); box-shadow: var(--bong);
}
.o-hen__bt {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none;
  background: var(--caramel-nhat); color: var(--caramel-dam);
}
.o-hen__chu { flex: 1; min-width: 0; }
.o-hen__tren { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16px; color: var(--chu-phu); }
.o-hen__chu b { display: block; font-size: 20px; }
.o-hen--qua { background: #FFF5F3; border-color: #F3D2CB; }
.o-hen--qua .o-hen__bt { background: var(--do-nhat); color: var(--do); }
.o-hen--homnay { background: #FFF8F1; border-color: #F0D9C4; }
.o-hen--ngung .o-hen__bt, .o-hen--khong .o-hen__bt { background: var(--xam-nhat); color: var(--chu-phu); }

/* Dòng thời gian lịch sử */
.dong-tg { list-style: none; margin: 0; padding: 0 16px; }
.dong-tg li { position: relative; padding: 0 0 14px 34px; }
.dong-tg li::before {
  content: ''; position: absolute; left: 10px; top: 26px; bottom: -4px; width: 2px; background: #E7D7C7;
}
.dong-tg li:last-child::before { display: none; }
.dong-tg__cham {
  position: absolute; left: 2px; top: 18px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--nen); border: 3px solid #D9C2AC;
}
.dong-tg li:first-child .dong-tg__cham { background: var(--caramel); border-color: var(--caramel-nhat); box-shadow: 0 0 0 3px var(--caramel-nhat); }
.dong-tg__the {
  padding: 14px 16px; border-radius: 20px; background: var(--trang); border: 1px solid var(--vien); box-shadow: var(--bong);
}
.dong-tg__ngay { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16px; color: var(--chu-phu); }
.dong-tg__ngay b { color: var(--chu); }
.dong-tg__moi { font-size: 13px; font-weight: 700; color: var(--caramel-dam); background: var(--caramel-nhat); padding: 3px 9px; border-radius: 10px; }
.dong-tg__nd { margin-top: 6px; font-size: 18px; line-height: 1.45; overflow-wrap: anywhere; }
.dong-tg__hen { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 15px; font-weight: 700; color: var(--caramel-dam); background: #FBF1E7; padding: 5px 11px; border-radius: 12px; }
.dong-tg__hen .bt { width: 17px; height: 17px; }
.dong-tg__hen--khong { color: var(--chu-phu); background: var(--xam-nhat); }

/* Thanh nút dưới màn khách */
.thanh-nut {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 20;
  width: 100%; max-width: var(--be-rong);
  display: flex; gap: 10px; padding: 12px 16px calc(12px + var(--an-toan-duoi));
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--vien); box-shadow: 0 -6px 24px rgba(59, 42, 32, .07);
}
.nut {
  flex: 1; height: 62px; border-radius: 20px; border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 19px; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, filter .12s ease;
}
.nut:active { transform: scale(.98); filter: brightness(.95); }
.nut--chinh { background: var(--caramel); color: #fff; box-shadow: 0 8px 18px rgba(192, 112, 58, .35); }
.nut--toi { background: var(--cacao); color: var(--kem); }
.nut--vien { background: var(--trang); color: var(--cacao); border: 1.5px solid #E2D2C2; }

/* ---------- Chọn người dùng ---------- */
.chon-nguoi { padding: calc(var(--an-toan-tren) + 18px) 20px 30px; text-align: center; }
.chon-nguoi__logo { width: 220px; max-width: 64%; height: auto; margin: 0 auto; display: block; }
.chon-nguoi h1 { font-family: 'Playfair Display', Georgia, serif; font-size: 28px; margin-top: 10px; }
.chon-nguoi__phu { margin-top: 6px; color: var(--chu-phu); font-size: 17px; }
.ds-nguoi { display: grid; gap: 12px; margin-top: 22px; text-align: left; }
.nut-chon {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 84px; padding: 12px 16px;
  border-radius: 22px; border: 1px solid var(--vien); background: var(--trang); box-shadow: var(--bong);
  text-align: left;
}
.nut-chon:active { transform: scale(.985); }
.nut-chon b { display: block; font-size: 20px; }
.nut-chon span.nut-chon__phu { display: block; font-size: 16px; color: var(--chu-phu); }
.nut-chon > .bt { margin-left: auto; color: #C9B5A4; }
.ghi-chu-nho {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; padding: 14px 16px; border-radius: 18px;
  background: #F6EDE3; color: var(--chu-phu); font-size: 16px; text-align: left;
}
.ghi-chu-nho .bt { color: var(--caramel); margin-top: 1px; }

/* ---------- Bảng chọn trượt lên (menu) ---------- */
.lop-phu {
  position: fixed; inset: 0; z-index: 50; background: rgba(36, 24, 17, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: hien .18s ease;
}
.tam {
  width: 100%; max-width: var(--be-rong); background: var(--nen);
  border-radius: 28px 28px 0 0; padding: 10px 16px calc(18px + var(--an-toan-duoi));
  animation: truot .22s cubic-bezier(.2, .8, .2, 1);
}
.tam::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: #DCCBBB; margin: 0 auto 14px; }
.tam__dau { display: flex; align-items: center; gap: 14px; padding: 4px 4px 16px; }
.tam__chu { min-width: 0; }
.tam__chu b { display: block; font-size: 20px; }
.tam__chu span { display: block; font-size: 16px; color: var(--chu-phu); }
.tam h3 { font-size: 21px; padding: 0 4px; }
.tam p.tam__noi { padding: 6px 4px 0; color: var(--chu-phu); font-size: 17px; }
.muc-menu {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 62px; padding: 0 16px; margin-top: 8px;
  border: 1px solid var(--vien); border-radius: 18px; background: var(--trang); font-size: 18px; font-weight: 700; text-align: left;
}
.muc-menu .bt { color: var(--caramel); }
.muc-menu--nguy { color: var(--do-dam); }
.muc-menu--nguy .bt { color: var(--do); }
.hang-nut { display: flex; gap: 10px; margin-top: 16px; }
@keyframes hien { from { opacity: 0; } }
@keyframes truot { from { transform: translateY(40px); opacity: .4; } }

/* ---------- Thông báo nhanh ---------- */
#thong-bao {
  position: fixed; left: 50%; bottom: calc(100px + var(--an-toan-duoi)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(calc(100vw - 32px), 448px);
  padding: 14px 18px; border-radius: 18px; background: var(--cacao); color: var(--kem);
  font-size: 17px; font-weight: 700; box-shadow: var(--bong-cao);
  transition: opacity .2s ease, transform .2s ease;
}
#thong-bao.hien { opacity: 1; transform: translate(-50%, 0); }
#thong-bao .bt { color: #9FD18B; }
#thong-bao.loi .bt { color: #FF9C87; }

/* ---------- Khác ---------- */
.dau-nhe { padding: calc(var(--an-toan-tren) + 22px) 20px 16px; }
.dau-nhe h1 { font-family: 'Playfair Display', Georgia, serif; font-size: 30px; }
.dau-nhe p { margin-top: 4px; color: var(--chu-phu); font-size: 17px; }
.chan-trang { text-align: center; padding: 26px 20px 4px; color: #A28D7C; font-size: 15px; }
.an { display: none !important; }
:focus-visible { outline: 3px solid rgba(192, 112, 58, .55); outline-offset: 2px; }

/* ================= Phần 2: thêm khách, ghi chú ================= */

/* Nút "+" giữa thanh dưới */
.nut-them {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: var(--caramel-dam); font-size: 15px; font-weight: 700; padding-top: 4px;
}
.nut-them__tron {
  width: 62px; height: 62px; margin-top: -32px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, #CF8148 0%, var(--caramel) 55%, #A9602F 100%);
  box-shadow: 0 0 0 6px #fff, 0 10px 22px rgba(192, 112, 58, .45);
  transition: transform .12s ease;
}
.nut-them:active .nut-them__tron { transform: scale(.94); }
.nut-them__tron .bt { width: 30px; height: 30px; stroke-width: 2.6; }

.nut-tron--an { visibility: hidden; box-shadow: none; }

/* Nút chữ nhỏ (Ngừng chăm) */
.hang-nut-chu { display: flex; justify-content: center; padding: 22px 16px 0; }
.nut-chu {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border: 0; border-radius: 24px; background: transparent; font-size: 17px; font-weight: 700; color: var(--chu-phu);
}
.nut-chu .bt { width: 20px; height: 20px; }
.nut-chu--nguy { color: var(--do-dam); }
.nut-chu:active { background: var(--xam-nhat); }

/* Khách đang ghi chú */
.khach-nho {
  display: flex; align-items: center; gap: 12px; margin: 4px 16px 0; padding: 12px 14px;
  border-radius: 20px; background: var(--trang); border: 1px solid var(--vien); box-shadow: var(--bong);
}
.khach-nho .anh { width: 48px; height: 48px; font-size: 17px; }
.khach-nho__chu { flex: 1; min-width: 0; }
.khach-nho__chu b { font-size: 18px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.khach-nho__chu span { display: block; font-size: 16px; color: var(--chu-phu); }

/* Form */
.form { padding: 0 16px; }
.truong { margin-top: 22px; }
.truong__nhan { display: block; margin-bottom: 10px; font-size: 18px; font-weight: 700; }
.truong__nhan small { font-size: 16px; font-weight: 400; color: var(--chu-phu); }
.o-nhap {
  display: block; width: 100%; height: 62px; padding: 0 18px;
  border: 1.5px solid #E4D5C6; border-radius: 18px; background: var(--trang);
  font-size: 19px; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.o-nhap { height: auto; min-height: 64px; padding: 15px 18px; line-height: 1.45; resize: vertical; }
.o-nhap::placeholder { color: #A8927F; }
.o-nhap:focus { border-color: var(--caramel); box-shadow: 0 0 0 4px rgba(192, 112, 58, .16); }
.o-nhap--so { font-size: 21px; letter-spacing: .5px; font-weight: 700; }
.o-ngay { margin-top: 10px; }
.truong--loi .o-nhap { border-color: var(--do); box-shadow: 0 0 0 4px rgba(194, 65, 45, .12); }
.loi-truong { margin-top: 8px; font-size: 16px; font-weight: 700; color: var(--do-dam); }
.loi-truong:empty { display: none; }
.truong--loi .cum-nut { border-radius: 20px; box-shadow: 0 0 0 2px rgba(194, 65, 45, .55); }

/* Câu chạm nhanh */
.cau-nhanh { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip-cau {
  height: 44px; padding: 0 15px; border-radius: 22px; border: 1px solid #EADBCB;
  background: #F8EFE6; color: var(--cacao); font-size: 16px; font-weight: 700;
}
.chip-cau::before { content: '+ '; color: var(--caramel); }
.chip-cau:active { background: var(--kem); }

/* Nút lựa chọn to (ngày hẹn, nguồn, sale) */
.cum-nut { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.nut-luachon {
  min-height: 70px; padding: 8px 6px; border-radius: 18px; border: 1.5px solid #E4D5C6; background: var(--trang);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.2;
  transition: background .12s ease, border-color .12s ease, transform .1s ease;
}
.nut-luachon b { font-size: 19px; }
.nut-luachon small { font-size: 15px; color: var(--chu-phu); }
.nut-luachon--mot { min-height: 60px; }
.nut-luachon--mot b { font-size: 18px; }
.nut-luachon:active { transform: scale(.97); }
.nut-luachon[aria-pressed="true"] {
  background: var(--cacao); border-color: var(--cacao); color: var(--kem);
  box-shadow: 0 6px 14px rgba(59, 42, 32, .22);
}
.nut-luachon[aria-pressed="true"] small { color: rgba(243, 227, 211, .85); }
.nut-ngay-khac {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; margin-top: 10px;
  border: 1.5px dashed #DCC6B1; border-radius: 16px; background: transparent; color: var(--caramel-dam); font-size: 17px; font-weight: 700;
}
.nut-ngay-khac .bt { width: 20px; height: 20px; }
.tom-tat {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px;
  border-radius: 16px; background: #FBF1E7; color: var(--chu-phu); font-size: 16px;
}
.tom-tat b { color: var(--cacao); }
.tom-tat .bt { color: var(--caramel); width: 20px; height: 20px; }

/* Báo trùng số điện thoại */
.bao-trung {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 12px 14px;
  border-radius: 16px; background: #FFF5F3; border: 1px solid #F3D2CB; color: var(--do-dam); font-size: 16px;
}
.bao-trung span { flex: 1; }
.bao-trung a {
  flex: none; height: 40px; padding: 0 16px; border-radius: 20px; background: var(--trang); border: 1px solid #F3D2CB;
  display: grid; place-items: center; font-weight: 700; text-decoration: none; color: var(--do-dam);
}

/* Nút đang lưu */
.nut:disabled { opacity: .85; }
.xoay {
  width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: xoay .8s linear infinite;
}
@keyframes xoay { to { transform: rotate(360deg); } }
.trong .hang-nut { justify-content: center; margin-top: 18px; }

/* ================= Phần 3: màn nhập mã ================= */
.form--ma { padding: 0; margin-top: 22px; }
.form--ma .truong { margin-top: 0; }
.o-nhap--ma {
  height: 70px; text-align: center; font-size: 28px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase;
}
.o-nhap--ma::placeholder { letter-spacing: 4px; color: #CDBBAA; }
.chon-nguoi .hang-nut { margin-top: 14px; }
.chon-nguoi .loi-truong { text-align: center; }
