:root {
  --nen: #f1f4f8;
  --the: #ffffff;
  --chu: #17212b;
  --chu-nhat: #5b6673;
  --vien: #dce3eb;
  --chinh: #1d5d9b;
  --chinh-dam: #154a7d;
  --xau: #c62828;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--nen); color: var(--chu); font: 15px/1.5 var(--font); }
a { color: var(--chinh); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; }

/* đầu trang */
.dau { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--chinh); color: #fff; }
.dau-ten { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.dau-ten img { width: 38px; height: 38px; border-radius: 9px; background: #fff2; padding: 3px; }
.dau-ten span { display: flex; flex-direction: column; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dau-ten small { font-size: 10.5px; letter-spacing: .08em; opacity: .85; font-weight: 600; }
.dau-phai { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dau .nut-chu { color: #fff; border-color: #ffffff66; }
.toi { opacity: .9; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* chọn kênh */
.kenh { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 16px 0; max-width: 1100px; margin: 0 auto; }
.kenh a { display: block; text-align: center; padding: 11px 6px; border-radius: 10px; font-weight: 700; font-size: 13.5px; letter-spacing: .03em; text-decoration: none; color: var(--k); background: color-mix(in srgb, var(--k) 10%, #fff); border: 2px solid color-mix(in srgb, var(--k) 35%, #fff); }
.kenh a[aria-current="true"] { background: var(--k); color: #fff; border-color: var(--k); }

.trang { max-width: 1100px; margin: 0 auto; padding: 14px 16px 90px; }
.cho, .trong { color: var(--chu-nhat); padding: 18px 0; }
.hop-loi { background: #fdecea; border: 1px solid #f5c2bd; color: #8a1c14; padding: 16px; border-radius: 12px; }

.trang-dau { border-left: 5px solid var(--k); padding: 2px 0 2px 12px; margin-bottom: 12px; }
.trang-dau h1 { font-size: 23px; }
.phu { margin: 4px 0 0; color: var(--chu-nhat); font-size: 13.5px; }

/* nút */
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 9px; border: 0; background: var(--chinh); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer; }
.nut:hover { background: var(--chinh-dam); }
.nut:disabled { opacity: .6; cursor: default; }
.nut-phu { background: #fff; color: var(--chinh); border: 1.5px solid var(--chinh); }
.nut-phu:hover { background: #eaf1f9; }
.nut-lon { width: 100%; padding: 13px; font-size: 16px; margin-top: 10px; }
.nut-chu { background: none; border: 1px solid var(--vien); border-radius: 7px; padding: 3px 10px; cursor: pointer; color: var(--chinh); font-size: 13px; }
.xem-them { display: flex; margin: 14px auto 0; }

/* nút lọc việc */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--vien); background: #fff; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.chip b { background: #eef2f6; border-radius: 999px; padding: 0 8px; font-size: 12.5px; }
.chip[aria-pressed="true"] { background: var(--chu); color: #fff; border-color: var(--chu); }
.chip[aria-pressed="true"] b { background: #ffffff2e; }

.bo-loc { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.bo-loc input, .bo-loc select, .truong input, .truong textarea { width: 100%; padding: 9px 11px; border: 1.5px solid var(--vien); border-radius: 9px; background: #fff; }
.dem { color: var(--chu-nhat); font-size: 13px; margin: 4px 0 10px; }

/* thẻ khách */
.ds { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.the { background: var(--the); border: 1px solid var(--vien); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 7px; cursor: pointer; box-shadow: 0 1px 2px #0000000a; }
.the:hover, .the:focus-visible { border-color: var(--chinh); outline: none; box-shadow: 0 2px 10px #1d5d9b22; }
.the-dong1 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.the-dong1 h3 { font-size: 16.5px; margin-right: 2px; }
.the-dong2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.lien-lac { display: inline-flex; gap: 6px; }
.sdt, .zalo { font-weight: 600; text-decoration: none; padding: 2px 10px; border-radius: 7px; font-size: 14px; }
.sdt { background: #e8f2ea; color: #17643f; }
.zalo { background: #e6f0ff; color: #0058d6; }
.the-so { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13.5px; color: var(--chu-nhat); }
.the-so .xau { color: var(--xau); font-weight: 600; }
.the-lh { margin: 0; font-size: 13.5px; }
.the-lh .hen { color: #b45309; font-weight: 600; }
.the-dx { margin: 0; font-size: 13.5px; color: #36414d; background: #f6f8fb; border-radius: 8px; padding: 8px 10px; }
.the-nut { display: flex; gap: 8px; margin-top: 2px; }
.the-nut .nut { flex: 1; padding: 8px; }
.nhat { color: var(--chu-nhat); font-size: 13.5px; }

.pill { --m: #64748b; display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--m); background: color-mix(in srgb, var(--m) 13%, #fff); border: 1px solid color-mix(in srgb, var(--m) 35%, #fff); white-space: nowrap; }
.pill-dac { color: #fff; background: var(--m); border-color: var(--m); }
.pill-nhat { --m: #7c3aed; }

/* hồ sơ */
.lui { display: inline-block; margin-bottom: 10px; font-weight: 600; text-decoration: none; }
.hs-dau { background: #fff; border: 1px solid var(--vien); border-top: 5px solid var(--k); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.hs-dau h1 { font-size: 21px; }
.luoi-so { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-bottom: 12px; }
.o-so { background: #fff; border: 1px solid var(--vien); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.o-so span { font-size: 12.5px; color: var(--chu-nhat); }
.o-so b { font-size: 19px; }
.o-so small { font-size: 12px; color: var(--chu-nhat); }
.hop-dx { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.hop-dx h2, .phan h2 { font-size: 16px; margin-bottom: 6px; }
.hop-dx p { margin: 0; }
.phan { background: #fff; border: 1px solid var(--vien); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.bang-cuon { overflow-x: auto; }
.bang { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.bang th { text-align: left; font-size: 12px; color: var(--chu-nhat); font-weight: 600; padding: 6px 8px; border-bottom: 2px solid var(--vien); white-space: nowrap; }
.bang td { padding: 7px 8px; border-bottom: 1px solid #edf1f5; vertical-align: top; }
.bang .dau-cot { font-weight: 600; white-space: nowrap; }
.bam-duoc { cursor: pointer; }
.bam-duoc:hover { background: #f3f7fc; }

/* ghi kết quả */
.form-ghi { background: #fff; border: 1px solid var(--vien); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.form-ghi fieldset { border: 0; padding: 0; margin: 0; }
.form-ghi legend, .truong span { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.nut-chon { display: flex; flex-wrap: wrap; gap: 8px; }
.nut-chon .chip { padding: 9px 14px; font-size: 14px; }
.truong input[type="date"] { max-width: 220px; }

.bao { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #17643f; color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 600; box-shadow: 0 6px 20px #0003; z-index: 10; max-width: calc(100% - 32px); }
.bao-loi { background: var(--xau); }

/* đăng nhập */
.trang-dn { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #1d5d9b, #0f3a63); padding: 16px; }
.dn-hop { background: #fff; border-radius: 18px; padding: 30px 26px; width: 100%; max-width: 400px; text-align: center; box-shadow: 0 20px 50px #0004; }
.dn-logo img { width: 72px; height: 72px; border-radius: 16px; background: #1d5d9b; padding: 6px; }
.dn-nho { margin: 14px 0 2px; font-size: 11.5px; letter-spacing: .1em; font-weight: 700; color: var(--chinh); }
.dn-hop h1 { font-size: 22px; }
.dn-mo { color: var(--chu-nhat); margin: 8px 0 18px; }
.dn-nut { display: flex; justify-content: center; min-height: 44px; }
.dn-loi { color: var(--xau); font-weight: 600; margin: 10px 0 0; min-height: 1em; }
#nut-thu { margin-top: 12px; }

@media (max-width: 640px) {
  .bo-loc { grid-template-columns: 1fr 1fr; }
  .bo-loc input { grid-column: 1 / -1; }
  .ds { grid-template-columns: 1fr; }
  .kenh a { font-size: 12px; padding: 10px 4px; }
  .toi { display: none; }
  .trang-dau h1 { font-size: 20px; }
}
