/* Trang khai chuyến công tác. Không phông tải ngoài, không thư viện; màu theo biến để có chế độ tối. */

:root {
  --nen: #f4f1ea;
  --nen-2: #ebe6da;
  --mat: #ffffff;
  --mat-2: #faf8f3;
  --chu: #1a2131;
  --chu-phu: #5a6374;
  --chu-mo: #8a909d;
  --vien: #e5dfd2;
  --vien-dam: #d2c9b6;

  --muc: #13213d;
  --muc-2: #1d3260;
  --vang: #a67a2e;
  --vang-sang: #cfa95f;
  --vang-dam: #74541a;
  --vang-nen: #f6eedc;
  --xanh: #1c6a56;
  --xanh-nen: #e2f0eb;
  --do: #a7322a;
  --do-nen: #f9e7e4;

  --nut-chinh-nen: #13213d;
  --nut-chinh-nen-2: #1d3260;
  --nut-chinh-chu: #ffffff;

  --bong: 0 1px 2px rgba(19, 33, 61, .06), 0 14px 34px -18px rgba(19, 33, 61, .32);
  --bong-nho: 0 1px 2px rgba(19, 33, 61, .07);
  --vong: 0 0 0 4px rgba(166, 122, 46, .2);

  --phong: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --nen: #0c111d;
    --nen-2: #151c2c;
    --mat: #131a29;
    --mat-2: #0f1524;
    --chu: #ebe7de;
    --chu-phu: #a7adba;
    --chu-mo: #7b8394;
    --vien: #222b40;
    --vien-dam: #2f3a55;

    --muc: #0a1120;
    --muc-2: #16223d;
    --vang: #d3ae68;
    --vang-sang: #e0c387;
    --vang-dam: #e0c387;
    --vang-nen: rgba(211, 174, 104, .12);
    --xanh: #80cfb4;
    --xanh-nen: rgba(128, 207, 180, .12);
    --do: #f0998e;
    --do-nen: rgba(240, 153, 142, .12);

    --nut-chinh-nen: #e8d7b0;
    --nut-chinh-nen-2: #f1e3c4;
    --nut-chinh-chu: #12203b;

    --bong: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 36px -18px rgba(0, 0, 0, .7);
    --bong-nho: 0 1px 2px rgba(0, 0, 0, .35);
    --vong: 0 0 0 4px rgba(211, 174, 104, .22);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

/* Nền đặt ở html để trang ngắn không lộ khoảng trắng phía dưới */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--nen); }
html.khoa-cuon { overflow: hidden; }

/* Không đặt min-height theo vh cho mọi màn: trên Android (nhất là trình duyệt trong Zalo) bàn phím bật lên làm vh
   đổi, cả trang dàn lại, ô đang gõ bị đẩy đi và bàn phím tự đóng. Chỉ màn có thanh nút dưới mới cần cao bằng màn hình
   để thanh nằm sát đáy; màn đăng nhập / kích hoạt không có thanh nên không dùng vh. */
body {
  margin: 0;
  background: var(--nen);
  color: var(--chu);
  font: 16px/1.5 var(--phong);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
/* Màn lịch trình (có thanh nút dưới): cao bằng màn hình để thanh nằm sát đáy. Trình duyệt cũ không hiểu :has thì thanh
   chỉ nằm ngay sau nội dung, vẫn dùng được. */
body:has(#thanh-duoi:not([hidden])) { min-height: 100vh; }

h1, h2, p, dl, dd, ol, ul { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--vang); outline-offset: 2px; }

.ic {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.an-doc {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.khung {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* ---------- Đầu trang ---------- */

.dau {
  position: relative;
  color: #f4eee2;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(207, 169, 95, .22) 0%, rgba(207, 169, 95, 0) 46%),
    linear-gradient(165deg, #1a2d55 0%, #13213d 55%, #0e1930 100%);
  padding: calc(18px + env(safe-area-inset-top)) 0 64px;
  overflow: hidden;
}
.dau::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(207, 169, 95, 0), rgba(207, 169, 95, .55), rgba(207, 169, 95, 0));
}
.dau-trong { display: flex; align-items: center; gap: 14px; }
.dau-logo {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  color: #e3c68a;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(227, 198, 138, .35);
  font-size: 22px;
}
.dau-nhan {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #d9bd83;
}
.dau-tieu-de { font-size: 21px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
.dau-chu { flex: 1; min-width: 0; }
.dau-nut {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(227, 198, 138, .35);
  background: rgba(255, 255, 255, .06);
  color: #e3c68a;
  font-size: 20px;
}
.dau-nut:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Nội dung ---------- */

.noi-dung {
  flex: 1;
  margin-top: -44px;
  padding-bottom: 28px;
  position: relative;
}
.noi-dung:focus { outline: none; }

.the {
  background: var(--mat);
  border: 1px solid var(--vien);
  border-radius: 20px;
  box-shadow: var(--bong);
}

/* Thẻ người khai */
.the-nguoi { position: relative; padding: 18px 18px 6px; overflow: hidden; }
.the-nguoi::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--vang), var(--vang-sang), var(--vang));
}
.the-nguoi-dau { display: flex; align-items: center; gap: 12px; }
.chu-viet-tat {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  flex: none;
  border-radius: 50%;
  background: var(--muc);
  color: var(--vang-sang);
  font-weight: 650;
  font-size: 16px;
  letter-spacing: .04em;
  box-shadow: inset 0 0 0 1px rgba(207, 169, 95, .35);
}
.the-nguoi-ten { flex: 1; min-width: 0; }
.ten-dong { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.the-nguoi-ten .ten { font-size: 18px; font-weight: 650; letter-spacing: -.01em; line-height: 1.3; overflow-wrap: anywhere; }
.the-nguoi-ten .thang { font-size: 13.5px; color: var(--chu-phu); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-cho { background: var(--vang-nen); color: var(--vang-dam); }
.chip-ok { background: var(--xanh-nen); color: var(--xanh); }
.chip-khoa { background: var(--nen-2); color: var(--chu-phu); }

.tom-tat {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 16px;
  border-top: 1px solid var(--vien);
}
.o-so { padding: 12px 4px 12px 0; }
.o-so + .o-so { padding-left: 14px; border-left: 1px solid var(--vien); }
.o-so dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--chu-mo);
}
.o-so dd {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* Bảng tin */
.bang-tin {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
}
.bang-tin .ic { margin-top: 1px; }
.bang-tin-vang { background: var(--vang-nen); color: var(--vang-dam); border: 1px solid rgba(166, 122, 46, .25); }
.bang-tin-khoa { background: var(--nen-2); color: var(--chu-phu); border: 1px solid var(--vien); }
.bang-tin-do { background: var(--do-nen); color: var(--do); border: 1px solid rgba(167, 50, 42, .25); }
.bang-tin-do .nut-lien { color: var(--do); min-height: 36px; padding: 0 2px; font-size: 13.5px; }
.bang-tin-nut { display: flex; flex-wrap: wrap; gap: 0 14px; margin-top: 4px; }
.chip-loi { background: var(--do-nen); color: var(--do); }
.hang-khoa-ten .chip { margin-left: 6px; font-size: 11.5px; padding: 3px 8px; vertical-align: 1px; }
.hang-hd.la-loi > .ic { color: var(--do); }
.dau-nut { position: relative; }
.dau-nut.co-canh-bao::after {
  content: "";
  position: absolute;
  top: 4px; right: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #e5484d;
  box-shadow: 0 0 0 2px #13213d;
}

/* Tiêu đề mục */
.muc-dau {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 4px 10px;
}
.muc-tieu-de {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--chu-phu);
}
.muc-dem { font-size: 13px; color: var(--chu-mo); font-variant-numeric: tabular-nums; }

/* Danh sách chuyến */
.ds-chuyen { list-style: none; padding: 0; display: grid; gap: 10px; }
.the-chuyen {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  background: var(--mat);
  border: 1px solid var(--vien);
  border-radius: 16px;
  box-shadow: var(--bong-nho);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
@media (hover: hover) {
  .the-chuyen:hover { box-shadow: var(--bong); border-color: var(--vien-dam); transform: translateY(-1px); }
}

.khoi-ngay {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--vien);
  border-radius: 12px;
  overflow: hidden;
  background: var(--mat-2);
  font-variant-numeric: tabular-nums;
}
.khoi-ngay-thang {
  align-self: stretch;
  text-align: center;
  padding: 3px 0 2px;
  background: var(--muc);
  color: var(--vang-sang);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .1em;
}
.khoi-ngay-so { font-size: 24px; font-weight: 650; line-height: 1.15; padding-top: 4px; letter-spacing: -.02em; }
.khoi-ngay-thu { font-size: 11.5px; color: var(--chu-phu); padding-bottom: 5px; }

.the-chuyen-than { min-width: 0; }
.the-chuyen-ngay {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-weight: 650;
  font-size: 15.5px;
  font-variant-numeric: tabular-nums;
}
.nhan-ngay {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--nen-2);
  color: var(--chu-phu);
}
.the-chuyen-xa {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 14.5px;
  font-weight: 550;
}
.the-chuyen-xa .ic { color: var(--vang); font-size: 15px; }
.the-chuyen-nd {
  margin-top: 4px;
  font-size: 14px;
  color: var(--chu-phu);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.the-chuyen-nut { display: flex; flex-direction: column; gap: 2px; margin: -6px -6px 0 0; }

.nut-ic {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--chu-phu);
  transition: background .15s, color .15s;
}
.nut-ic:hover { background: var(--nen); color: var(--chu); }
.nut-ic-nguy:hover { background: var(--do-nen); color: var(--do); }

/* Chưa có chuyến */
.the-rong {
  text-align: center;
  padding: 30px 22px 26px;
  border: 1.5px dashed var(--vien-dam);
  border-radius: 18px;
  background: var(--mat-2);
}
.rong-ic {
  display: inline-grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--vang-nen);
  color: var(--vang);
  font-size: 26px;
}
.rong-tieu-de { margin-top: 12px; font-weight: 650; font-size: 17px; }
.rong-chu { margin: 6px auto 18px; max-width: 34ch; color: var(--chu-phu); font-size: 14.5px; }

.chu-thich {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 26px;
  font-size: 12.5px;
  color: var(--chu-mo);
  text-align: center;
}

/* Màn báo lỗi / trạng thái */
.the-trang { text-align: center; padding: 34px 24px 28px; }
.trang-ic {
  display: inline-grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  font-size: 28px;
  background: var(--do-nen);
  color: var(--do);
}
.the-trang.tin .trang-ic { background: var(--nen-2); color: var(--chu-phu); }
.trang-tieu-de { margin-top: 14px; font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.trang-chu { margin: 8px auto 0; max-width: 38ch; color: var(--chu-phu); }
.trang-phu {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--chu-mo);
}
.the-trang .nut { margin-top: 20px; }

/* Khung xương khi đang tải */
.xuong {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--nen-2) 25%, var(--mat-2) 50%, var(--nen-2) 75%);
  background-size: 200% 100%;
  animation: xuong 1.3s ease-in-out infinite;
}
@keyframes xuong { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.xuong-tron { width: 46px; height: 46px; border-radius: 50%; flex: none; }
.xuong-cot { flex: 1; display: grid; gap: 8px; }
.xuong-dong { height: 12px; }
.xuong-khoi { height: 54px; margin: 16px 0 12px; }
.xuong-ngay { width: 58px; height: 66px; border-radius: 12px; }
.w35 { width: 35%; } .w45 { width: 45%; } .w60 { width: 60%; } .w70 { width: 70%; } .w90 { width: 90%; }
.la-xuong { grid-template-columns: 58px 1fr; margin-top: 10px; }
.la-xuong:first-of-type { margin-top: 26px; }

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

.nut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .005em;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .1s, opacity .15s;
}
.nut:active:not(:disabled) { transform: scale(.985); }
.nut:disabled { opacity: .45; cursor: not-allowed; }
.nut-chinh {
  background: var(--nut-chinh-nen);
  color: var(--nut-chinh-chu);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 18px -10px rgba(19, 33, 61, .7);
}
.nut-chinh:hover:not(:disabled) { background: var(--nut-chinh-nen-2); }
.nut-phu { background: var(--mat); color: var(--chu); border-color: var(--vien-dam); }
.nut-phu:hover:not(:disabled) { background: var(--mat-2); }
.nut-vang { background: var(--vang-nen); color: var(--vang-dam); border-color: rgba(166, 122, 46, .4); }
.nut-vang:hover:not(:disabled) { border-color: var(--vang); }
.nut-vang.da-xong { background: var(--xanh-nen); color: var(--xanh); border-color: transparent; opacity: 1; }
.nut-nguy { background: var(--do); color: #fff; }
.nut-nguy:hover:not(:disabled) { filter: brightness(1.06); }
.nut.dang-cho { position: relative; color: transparent !important; pointer-events: none; }
.nut.dang-cho::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--chu-mo);
  border-top-color: transparent;
  animation: quay .7s linear infinite;
}
.nut-chinh.dang-cho::after { border-color: var(--nut-chinh-chu); border-top-color: transparent; }
@keyframes quay { to { transform: rotate(360deg); } }

/* Thanh dưới cố định */
.thanh-duoi {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: rgba(244, 241, 234, .86);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--vien);
}
@media (prefers-color-scheme: dark) { .thanh-duoi { background: rgba(12, 17, 29, .86); } }
.thanh-duoi-trong {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 10px;
  padding-top: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
/* Màn rất hẹp: chữ trong nút được xuống dòng thay vì tràn ra ngoài */
.thanh-duoi-trong .nut { min-width: 0; white-space: normal; line-height: 1.2; text-align: center; }

/* ---------- Tấm (hộp thoại trượt lên) ---------- */

.lop-phu {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 13, 25, .55);
  opacity: 0;
  transition: opacity .2s ease;
}
.lop-phu.mo { opacity: 1; }
.tam {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  max-height: 92dvh;
  background: var(--mat);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, .35);
  transform: translateY(28px);
  transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.lop-phu.mo .tam { transform: none; }
@media (min-width: 640px) {
  .lop-phu { align-items: center; padding: 24px; }
  .tam { border-radius: 22px; max-height: 88vh; }
}
.tam-dau {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 14px 12px 22px;
  border-bottom: 1px solid var(--vien);
}
.tam-dau::before {
  content: "";
  position: absolute;
  top: 7px; left: 50%;
  width: 38px; height: 4px;
  margin-left: -19px;
  border-radius: 4px;
  background: var(--vien-dam);
}
@media (min-width: 640px) { .tam-dau::before { display: none; } }
.tam-tieu-de { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.tam-than { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 22px 8px; }
.tam-chan {
  display: flex;
  gap: 10px;
  padding: 12px 22px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--vien);
}
.tam-chan .nut { flex: 1; }
.tam-chan .nut-chinh, .tam-chan .nut-nguy { flex: 1.4; }

/* Biểu mẫu */
.truong { margin-bottom: 18px; }
.nhan { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; }
.bat-buoc { color: var(--vang); }
.hang-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hang-2 .truong { margin-bottom: 0; }

input[type="date"], input[type="search"], input[type="text"], input[type="password"], textarea, .o-chon {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--vien-dam);
  border-radius: 13px;
  background: var(--mat-2);
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input[type="date"] { -webkit-appearance: none; appearance: none; font-variant-numeric: tabular-nums; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
input:focus, textarea:focus, .o-chon:focus { outline: none; border-color: var(--vang); box-shadow: var(--vong); background: var(--mat); }
/* Ô mật khẩu trong trình duyệt nhúng: chỉ dùng khi trình duyệt hiểu thuộc tính này (app.js kiểm tra trước) */
.o-che-chu { -webkit-text-security: disc; }
[aria-invalid="true"] { border-color: var(--do) !important; }
[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px var(--do-nen) !important; }

.o-chon { display: flex; align-items: center; gap: 10px; text-align: left; }
.o-chon .ic-dau { color: var(--vang); }
.o-chon .ic-cuoi { color: var(--chu-mo); margin-left: auto; }
.o-chon-gt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-chon-gt.trong { color: var(--chu-mo); }

.tom-ngay {
  min-height: 1.5em;
  margin: 8px 2px 18px;
  font-size: 13.5px;
  color: var(--chu-phu);
  font-variant-numeric: tabular-nums;
}
.truong-phu { display: flex; justify-content: flex-end; margin-top: 6px; }
.dem-ky-tu { font-size: 12px; color: var(--chu-mo); font-variant-numeric: tabular-nums; }
.dem-ky-tu.gan-het { color: var(--vang-dam); font-weight: 600; }
.loi-truong {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--do);
}
.loi-truong .ic { margin-top: 1px; font-size: 14px; }
.loi-chung {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--do-nen);
  color: var(--do);
  font-size: 14px;
}

/* Hộp hỏi xác nhận */
.tam-hoi { max-width: 440px; }
.hoi-chu { color: var(--chu-phu); }
.hoi-chu + .hoi-chu, .hoi-ban + .hoi-chu, .hoi-chu + .hoi-ban { margin-top: 10px; }
.hoi-ban {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--mat-2);
  border: 1px solid var(--vien);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Chọn xã */
.tam-xa { height: 86vh; height: 86dvh; }
.tam-xa .tam-than { padding-top: 0; }
.xa-tim {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 -22px;
  padding: 14px 22px 8px;
  background: var(--mat);
}
.tim-boc { position: relative; }
.tim-boc .ic-tim { position: absolute; left: 15px; top: 50%; margin-top: -.625em; color: var(--chu-mo); pointer-events: none; }
.o-tim { padding-left: 44px !important; }
.o-tim::-webkit-search-cancel-button { cursor: pointer; }
.xa-dem { margin: 8px 2px 0; font-size: 12.5px; color: var(--chu-mo); font-variant-numeric: tabular-nums; }
.ds-xa { list-style: none; padding: 4px 0 12px; margin: 0 -10px; }
.xa-dong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 15.5px;
  cursor: pointer;
}
.xa-dong:hover, .xa-dong:focus { background: var(--nen); outline: none; }
.xa-dong:focus-visible { box-shadow: inset 0 0 0 2px var(--vang); }
.xa-dong.dang-chon { font-weight: 650; color: var(--chu); }
.xa-dong.dang-chon .ic { color: var(--vang); }
.xa-dong mark { background: var(--vang-nen); color: var(--vang-dam); font-weight: 650; border-radius: 3px; }
.xa-rong {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 30px 0;
  color: var(--chu-mo);
  font-size: 14.5px;
}

/* Báo xong */
.tam-xong { max-width: 440px; }
.xong { text-align: center; padding: 14px 4px 6px; }
.xong-ic {
  display: inline-grid;
  place-items: center;
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--xanh-nen);
  color: var(--xanh);
  font-size: 34px;
  animation: noi .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.xong-ic .ic { stroke-width: 2.2; }
@keyframes noi { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.xong-tieu-de { margin-top: 16px; font-size: 20px; font-weight: 650; }
.xong-chu { margin-top: 8px; color: var(--chu-phu); }
.xong-chu.phu { font-size: 13.5px; color: var(--chu-mo); }

/* ---------- Thông báo nổi ---------- */

.thong-bao {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 80;
  display: grid;
  gap: 8px;
  width: 92vw;
  max-width: 480px;
  transform: translateX(-50%);
  pointer-events: none;
}
.tb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #1a2131;
  color: #f4eee2;
  font-size: 14.5px;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .5);
  pointer-events: auto;
  animation: tb-vao .22s ease both;
  transition: opacity .2s, transform .2s;
}
.tb-an { opacity: 0; transform: translateY(6px); }
.tb-ok .ic { color: #8fd6bc; }
.tb-loi .ic { color: #f3a79d; }
.tb-tin .ic { color: #e0c387; }
.tb-chu { flex: 1; }
.tb-nut { border: 0; background: none; color: #e0c387; font-weight: 650; padding: 4px 6px; }
@keyframes tb-vao { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Tài khoản (link chung): đăng nhập, kích hoạt, các tháng, quản lý khóa ---------- */

.the-form { padding: 24px 20px 20px; }
.the-tk { padding-bottom: 18px; }
.form-dau { text-align: center; margin-bottom: 20px; }
.form-dau .trang-ic { background: var(--vang-nen); color: var(--vang); }
.form-dau .trang-tieu-de { margin-top: 12px; }
.form-dau .trang-chu { margin-top: 6px; font-size: 14.5px; }
.the-form .nut { width: 100%; }
.the-form .nut + .nut { margin-top: 10px; }
.hoac {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 12.5px;
  color: var(--chu-mo);
}
.hoac::before, .hoac::after { content: ""; flex: 1; height: 1px; background: var(--vien); }
.nut-lien {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--vang-dam);
  font-weight: 600;
  font-size: 14.5px;
}
.nut-lien:hover { text-decoration: underline; }
.form-chan { margin-top: 14px; text-align: center; }
.goi-y { margin-top: 14px; font-size: 13px; color: var(--chu-mo); text-align: center; }

.nut-lui {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 10px -4px;
  min-height: 40px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  color: #f4eee2;
  font-size: 14px;
  font-weight: 600;
}
.nut-lui:hover { background: rgba(255, 255, 255, .14); }

.ds-thang { list-style: none; padding: 0; display: grid; gap: 10px; }
.the-thang {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  text-align: left;
  background: var(--mat);
  border: 1px solid var(--vien);
  border-radius: 16px;
  box-shadow: var(--bong-nho);
  transition: box-shadow .2s, border-color .2s;
}
.the-thang:hover { box-shadow: var(--bong); border-color: var(--vien-dam); }
.the-thang .khoi-ngay { width: 58px; flex: none; }
.the-thang-than { flex: 1; min-width: 0; }
.the-thang-ten { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-weight: 650; font-size: 16px; }
.the-thang-phu { margin-top: 3px; font-size: 13.5px; color: var(--chu-phu); }
.the-thang > .ic { color: var(--chu-mo); transform: rotate(-90deg); }

.muc-tk { padding: 16px 0; border-top: 1px solid var(--vien); }
.muc-tk:first-child { border-top: 0; padding-top: 4px; }
.muc-tk-tieu-de { font-size: 14px; font-weight: 650; margin-bottom: 8px; }
.muc-tk-chu { font-size: 13.5px; color: var(--chu-phu); }
.muc-tk .nut { margin-top: 10px; }
.ds-khoa { list-style: none; padding: 0; margin: 6px 0 0; }
.hang-khoa {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--vien);
}
.hang-khoa > .ic { color: var(--vang); }
.hang-khoa-than { flex: 1; min-width: 0; }
.hang-khoa-ten { font-weight: 600; overflow-wrap: anywhere; }
.hang-khoa-phu { font-size: 12.5px; color: var(--chu-mo); }

.cong-tac { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; cursor: pointer; }
.cong-tac input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cong-tac-nut {
  position: relative;
  flex: none;
  width: 46px; height: 28px;
  border-radius: 999px;
  background: var(--vien-dam);
  transition: background .2s;
}
.cong-tac-nut::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .2s;
}
.cong-tac input:checked + .cong-tac-nut { background: var(--xanh); }
.cong-tac input:checked + .cong-tac-nut::after { transform: translateX(18px); }
.cong-tac input:focus-visible + .cong-tac-nut { box-shadow: var(--vong); }
.cong-tac input:disabled + .cong-tac-nut { opacity: .45; }
.cong-tac-chu { font-size: 14px; }
.cong-tac-chu small { display: block; color: var(--chu-mo); font-size: 12.5px; margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 360px) {
  .khung { padding-left: 12px; padding-right: 12px; }
  .the-chuyen { grid-template-columns: 52px 1fr auto; gap: 11px; padding: 12px; }
  .o-so dd { font-size: 18px; }
  .nut { padding: 0 12px; font-size: 15px; }
}
