/* ================= Điều động xe - giao diện ================= */
:root {
  --chinh: #4f46e5;
  --chinh-dam: #4338ca;
  --chinh-nhat: #eef2ff;
  --xanh: #059669;
  --xanh-nhat: #ecfdf5;
  --do: #e11d48;
  --do-nhat: #fff1f2;
  --cam: #ea580c;
  --cam-nhat: #fff7ed;
  --vang-nhat: #fffbeb;
  --chu: #0f172a;
  --chu-phu: #64748b;
  --vien: #e5e7eb;
  --nen: #f4f6fb;
  --the: #ffffff;
  --bo: 14px;
  --bo-nho: 10px;
  --bong: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --bong-lon: 0 20px 50px rgba(15, 23, 42, .18);
  --chuyen: .18s ease;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--chu); background: var(--nen);
  -webkit-font-smoothing: antialiased;
}
h2 { margin: 0 0 14px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
h3 { margin: 18px 0 12px; font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
h4 { margin: 18px 0 8px; font-size: 14px; font-weight: 650; color: #334155; }
a { color: var(--chinh); }
.an { display: none !important; }
.ghi-chu { color: var(--chu-phu); font-size: 13px; font-weight: 400; }
.loi { color: var(--do); margin: 8px 0; min-height: 20px; font-size: 13px; font-weight: 500; }
.chu-do { color: var(--do); font-weight: 600; }
.chu-xanh { color: var(--xanh); font-weight: 600; }
.chu-cam { color: var(--cam); font-weight: 600; }

/* ================= Thanh trên ================= */
.thanh-tren {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 10px 24px; color: #fff; position: sticky; top: 0; z-index: 20;
  background: linear-gradient(120deg, #312e81 0%, #4338ca 55%, #6d28d9 100%);
  box-shadow: 0 4px 20px rgba(49, 46, 129, .25);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; white-space: nowrap; flex-shrink: 0; letter-spacing: -.01em; }
.logo-icon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}
.logo-icon svg { width: 20px; height: 20px; }
#menu { display: flex; gap: 4px; flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; }
#menu::-webkit-scrollbar { display: none; }
#menu button {
  background: transparent; color: rgba(255, 255, 255, .78); border: 0; padding: 8px 14px; border-radius: 999px;
  cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap; flex-shrink: 0; font-family: inherit;
  transition: background var(--chuyen), color var(--chuyen);
}
#menu button svg, .nut-icon svg {
  width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
#menu button { display: inline-flex; align-items: center; gap: 7px; }
#menu button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
#menu button.chon { background: #fff; color: var(--chinh-dam); font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.nguoi-dung { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: nowrap; min-width: 0; margin-left: auto; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, #fbbf24, #f472b6); color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
}
.nguoi-dung span#tenNguoiDung { min-width: 0; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.nguoi-dung .nut { white-space: nowrap; flex-shrink: 0; }

@media (max-width: 1100px) {
  .thanh-tren { row-gap: 8px; }
  #menu { order: 3; flex: 0 0 100%; }
}
main { padding: 24px; max-width: 1400px; margin: 0 auto; animation: hien .25s ease; }

/* ================= Nút ================= */
.nut {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--bo-nho); padding: 9px 16px; cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: inherit; line-height: 1.2;
  background: #eef0f4; color: var(--chu); text-decoration: none;
  transition: background var(--chuyen), border-color var(--chuyen), box-shadow var(--chuyen), transform .08s ease;
}
.nut:hover { filter: brightness(.97); }
.nut:active { transform: translateY(1px); }
.nut:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(79, 70, 229, .3); }
.nut:disabled { opacity: .5; cursor: not-allowed; }
.nut-nho { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.nut-rong { width: 100%; margin-top: 10px; }
.nut-chinh { background: var(--chinh); color: #fff; box-shadow: 0 2px 8px rgba(79, 70, 229, .3); }
.nut-chinh:hover { background: var(--chinh-dam); filter: none; }
.nut-xanh { background: var(--xanh); color: #fff; box-shadow: 0 2px 8px rgba(5, 150, 105, .28); }
.nut-do { background: var(--do); color: #fff; box-shadow: 0 2px 8px rgba(225, 29, 72, .25); }
.nut-cam { background: var(--cam); color: #fff; box-shadow: 0 2px 8px rgba(234, 88, 12, .28); }
.nut-vien { background: #fff; border-color: var(--vien); color: #334155; }
.nut-vien:hover { background: #f8fafc; border-color: #cbd5e1; filter: none; }
.nut-vien-trang { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .3); }
.nut-vien-trang:hover { background: rgba(255, 255, 255, .2); filter: none; }
.nut-lon { width: 100%; padding: 16px; font-size: 18px; font-weight: 700; border-radius: 14px; }

/* ================= Form ================= */
label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 13px; color: #334155; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d8dce5; border-radius: var(--bo-nho);
  font-size: 14px; font-family: inherit; background: #fff; color: var(--chu);
  transition: border-color var(--chuyen), box-shadow var(--chuyen);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #9ca3af; }
input:hover, select:hover, textarea:hover { border-color: #b8bfcc; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--chinh); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
input:disabled { background: #f3f4f6; color: var(--chu-phu); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--chinh); cursor: pointer; }
input[type=file] { padding: 8px; background: #f8fafc; border-style: dashed; cursor: pointer; }
input[type=file]::file-selector-button {
  border: 0; border-radius: 8px; padding: 7px 14px; margin-right: 12px; cursor: pointer;
  background: var(--chinh); color: #fff; font-weight: 600; font-family: inherit;
}
.luoi { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
form > .nut-chinh[type=submit] { margin-top: 18px; padding: 11px 22px; }

/* ================= Thẻ ================= */
.the {
  background: var(--the); border-radius: var(--bo); padding: 20px 22px; margin-bottom: 18px;
  box-shadow: var(--bong); border: 1px solid rgba(15, 23, 42, .04);
}
.the > h2:first-child, .the > h3:first-child { margin-top: 0; }
.the > h3:first-child::before, .dau-the h3::before {
  content: ""; width: 4px; height: 18px; border-radius: 4px; background: var(--chinh); flex-shrink: 0;
}
.dau-the, .dau-trang { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dau-the h2, .dau-the h3 { margin: 0; }
.dau-trang { margin-bottom: 18px; }
.dau-trang h2 { margin: 0; font-size: 24px; }
.nhom-nut { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.luoi-the { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 8px; }
.the-nho {
  border: 1px solid var(--vien); border-radius: 12px; padding: 12px 14px; background: #fff; position: relative; overflow: hidden;
  transition: box-shadow var(--chuyen), transform var(--chuyen);
}
.the-nho::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--xanh); }
.the-nho:hover { box-shadow: var(--bong); transform: translateY(-1px); }
.the-nho.ban::before { background: var(--chinh); }
.the-nho.qua-han { background: var(--do-nhat); border-color: #fecdd3; }
.the-nho.qua-han::before { background: var(--do); }
.the-nho.nghi { background: #f8fafc; }
.the-nho.nghi::before { background: #94a3b8; }
.the-nho .tieu-de { font-weight: 700; margin-bottom: 2px; }

/* ================= Bảng ================= */
.cuon { overflow-x: auto; border-radius: var(--bo-nho); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th, td { padding: 11px 12px; border-bottom: 1px solid #eef0f4; text-align: left; vertical-align: top; }
th {
  background: #f8f9fc; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--chu-phu); white-space: nowrap; border-bottom: 1px solid var(--vien);
}
th:first-child { border-top-left-radius: var(--bo-nho); }
th:last-child { border-top-right-radius: var(--bo-nho); }
tbody tr { transition: background var(--chuyen); }
tbody tr:hover td { background: #fafbff; }
tbody tr:last-child td { border-bottom: 0; }
tr.qua-han td { background: var(--do-nhat); }
tr.bat-buoc td { background: var(--cam-nhat); }
td .nut { margin: 2px 0; }
.rong {
  text-align: center; color: #94a3b8; padding: 32px 20px; font-size: 14px;
  border: 1px dashed #e2e8f0; border-radius: 12px; background: #fcfcfe;
}

/* ================= Nhãn trạng thái ================= */
.nhan {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.4;
}
.nhan::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.nhan-CHO_DUYET { background: #fef3c7; color: #92400e; }
.nhan-DA_DUYET { background: #e0e7ff; color: #3730a3; }
.nhan-DANG_DI { background: #dbeafe; color: #1d4ed8; }
.nhan-QUA_HAN { background: #ffe4e6; color: #be123c; }
.nhan-HOAN_THANH { background: #d1fae5; color: #047857; }
.nhan-TU_CHOI, .nhan-HUY { background: #f1f5f9; color: #475569; }
.nhan-NHANH { background: #ffedd5; color: #9a3412; }
.nhan-MUON { background: #cffafe; color: #0e7490; }
.nhan-NGHI { background: #e2e8f0; color: #334155; }
.nhan-CHO_TAI_XE { background: #ffedd5; color: #c2410c; }
.nhan-BAT_BUOC { background: var(--do); color: #fff; }
.huy-hieu {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px;
  background: var(--do); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.huy-hieu:empty { display: none; }
.huy-hieu-xanh { background: var(--chinh); }
.huy-hieu-cam { background: var(--cam); }

.o-tick {
  display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--vien); border-radius: var(--bo-nho); background: #fafbfc;
  transition: border-color var(--chuyen), background var(--chuyen);
}
.o-tick:hover { border-color: #c7d2fe; background: var(--chinh-nhat); }
.o-tick input { margin-top: 3px; flex-shrink: 0; }
.hop-xe-ranh { font-size: 13px; margin: 10px 0 4px; padding: 10px 12px; background: #f8fafc; border-radius: var(--bo-nho); }
.hop-xe-ranh:empty { display: none; }
.ds-xe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.xe-tag {
  display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid #a7f3d0; background: var(--xanh-nhat); color: #047857; font-weight: 600;
}
.xe-tag.ban { border-color: var(--vien); background: #f8fafc; color: #94a3b8; font-weight: 400; text-decoration: line-through; }

.canh-bao-vung {
  display: flex; gap: 10px; align-items: flex-start; background: var(--do-nhat); border: 1px solid #fecdd3; color: #9f1239;
  border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-weight: 600;
}
.thong-tin-vung {
  background: var(--chinh-nhat); border: 1px solid #c7d2fe; color: #3730a3;
  border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-weight: 600;
}
.nhom-chon-nhanh { display: flex; gap: 8px; flex-wrap: wrap; }
.nhom-chon-nhanh .nut { flex: 1 1 auto; }
.buoc { padding-left: 22px; margin: 8px 0; }
.buoc li { margin: 10px 0; padding-left: 4px; }
.buoc li::marker { color: var(--chinh); font-weight: 700; }
.buoc a.nut { display: inline-flex; }
.hop-thong-tin {
  background: linear-gradient(135deg, #f8fafc, var(--chinh-nhat)); border: 1px solid #e0e7ff;
  border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
}
.hop-thong-tin div { margin: 2px 0; }

/* ================= Tab ================= */
.tab {
  display: inline-flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; padding: 4px;
  background: #e9ecf3; border-radius: 12px;
}
.tab button {
  border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 500; color: #475569; transition: background var(--chuyen), color var(--chuyen);
}
.tab button:hover { color: var(--chu); }
.tab button.chon { background: #fff; color: var(--chinh-dam); font-weight: 600; box-shadow: 0 1px 4px rgba(15, 23, 42, .1); }

/* ================= Đăng nhập ================= */
#manDangNhap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.dn-gioi-thieu {
  position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .14), transparent 40%),
    linear-gradient(140deg, #1e1b4b 0%, #4338ca 55%, #7c3aed 100%);
}
.dn-gioi-thieu::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 65%);
}
.dn-thuong-hieu { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; }
.dn-thuong-hieu .logo-icon { width: 44px; height: 44px; border-radius: 12px; }
.dn-thuong-hieu .logo-icon svg { width: 26px; height: 26px; }
.dn-gioi-thieu h1 { font-size: 38px; line-height: 1.15; margin: 0 0 14px; letter-spacing: -.02em; max-width: 480px; }
.dn-gioi-thieu p { font-size: 16px; opacity: .85; max-width: 440px; margin: 0; }
.dn-tinh-nang { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; position: relative; z-index: 1; }
.dn-tinh-nang li { display: flex; gap: 12px; align-items: center; font-size: 15px; }
.dn-tinh-nang li span {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
  background: rgba(255, 255, 255, .14); font-size: 16px;
}
.dn-chan { font-size: 13px; opacity: .6; position: relative; z-index: 1; }
.dn-form-vung { display: grid; place-items: center; padding: 32px 24px; background: #fff; }
.khung-dang-nhap { width: 100%; max-width: 380px; animation: hien .35s ease; }
.khung-dang-nhap h2 { font-size: 28px; margin: 0 0 6px; }
.khung-dang-nhap .ghi-chu { font-size: 14px; margin: 0 0 22px; }
.khung-dang-nhap input { padding: 12px 14px; font-size: 15px; }
.khung-dang-nhap .nut-rong { padding: 13px; font-size: 15px; margin-top: 12px; }
.logo-lon { display: none; }

/* ================= Hộp thoại ================= */
.hop-thoai {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center; z-index: 50; overflow-y: auto; padding: 48px 12px;
  animation: mo .2s ease;
}
.hop-thoai-khung {
  background: #fff; border-radius: 18px; width: 100%; max-width: 640px; padding: 22px 26px;
  box-shadow: var(--bong-lon); animation: noi .22s cubic-bezier(.2, .9, .3, 1.2);
}
.hop-thoai-dau { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.hop-thoai-dau h3 { margin: 0; font-size: 18px; }
.dong {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: #f1f5f9; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: #64748b; transition: background var(--chuyen);
}
.dong:hover { background: #e2e8f0; color: var(--chu); }
.hang-nut { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }

/* ================= Thông báo ================= */
.thong-bao-vung { position: fixed; top: 76px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: 90vw; }
.thong-bao {
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px 13px 14px; border-radius: 12px; max-width: 420px;
  background: #fff; color: var(--chu); font-weight: 500; box-shadow: 0 10px 30px rgba(15, 23, 42, .16);
  border-left: 4px solid var(--xanh); animation: truot .28s cubic-bezier(.2, .9, .3, 1.2);
}
.thong-bao::before {
  content: "✓"; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  font-size: 13px; font-weight: 700; color: #fff; background: var(--xanh);
}
.thong-bao.loi-tb { border-left-color: var(--do); }
.thong-bao.loi-tb::before { content: "!"; background: var(--do); }
.thong-bao.canh-bao { border-left-color: var(--cam); }
.thong-bao.canh-bao::before { content: "!"; background: var(--cam); }

/* Đang tải: thanh tiến trình mảnh trên cùng, chặn bấm trùng nhưng không che màn hình */
.dang-tai { position: fixed; inset: 0; z-index: 90; background: transparent; cursor: progress; }
.dang-tai::before {
  content: ""; position: absolute; top: 0; left: 0; height: 3px; width: 40%;
  background: linear-gradient(90deg, #818cf8, #c084fc, #f472b6); border-radius: 0 3px 3px 0;
  animation: tien-trinh 1s ease-in-out infinite;
}
.xoay { display: none; }

/* ================= Tài xế ================= */
.tai-xe { max-width: 640px; margin: 0 auto; }
.chuyen {
  background: #fff; border-radius: 16px; padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--bong);
  border: 1px solid rgba(15, 23, 42, .04); border-left: 5px solid var(--chinh);
}
.chuyen.qua-han { border-left-color: var(--do); }
.chuyen.nghi { border-left-color: #94a3b8; }
.chuyen.cho-xac-nhan { border-left-color: var(--cam); background: linear-gradient(135deg, #fff, var(--vang-nhat)); }
.chuyen.nghi.cho-duyet { border-left-color: #f59e0b; background: linear-gradient(135deg, #fff, var(--vang-nhat)); }
.chuyen.nghi.tu-choi { border-left-color: var(--do); opacity: .85; }
.the-cho-duyet { border: 1px solid #fde68a; background: linear-gradient(135deg, #fff, var(--vang-nhat)); }
.chuyen .gio { font-size: 22px; font-weight: 750; margin: 8px 0; letter-spacing: -.01em; }
.chuyen div { margin: 3px 0; }
.hang-nut-tx { display: flex; gap: 10px; margin-top: 14px; }
.hang-nut-tx .nut { flex: 1; }

/* ================= Hiệu ứng ================= */
@keyframes hien { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes mo { from { opacity: 0; } to { opacity: 1; } }
@keyframes noi { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes truot { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes tien-trinh { 0% { left: -40%; } 100% { left: 100%; } }
@keyframes xoay { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ================= Máy tính bảng nhỏ: đăng nhập 1 cột ================= */
@media (max-width: 900px) {
  #manDangNhap { grid-template-columns: 1fr; }
  .dn-gioi-thieu { padding: 28px 24px 34px; }
  .dn-gioi-thieu h1 { font-size: 26px; margin-top: 22px; }
  .dn-gioi-thieu p { font-size: 14px; }
  .dn-tinh-nang, .dn-chan { display: none; }
  .dn-form-vung { place-items: start center; padding: 28px 20px 40px; border-radius: 24px 24px 0 0; margin-top: -20px; position: relative; z-index: 2; }
}

/* ================= Điện thoại / máy tính bảng dọc ================= */
@media (max-width: 768px) {
  body { font-size: 15px; }
  main { padding: 14px 12px 24px; }
  h2 { font-size: 19px; }
  .dau-trang h2 { font-size: 21px; }

  /* Header sáng, gọn; menu chuyển xuống thanh dưới đáy cho dễ bấm bằng một tay */
  .thanh-tren {
    padding: calc(8px + env(safe-area-inset-top)) 14px 8px; gap: 10px; flex-wrap: nowrap;
    /* Không dùng backdrop-filter ở đây: nó biến header thành khung chứa của #menu (position: fixed) */
    background: #fff; color: var(--chu); box-shadow: 0 1px 0 var(--vien);
  }
  .logo { font-size: 16px; color: var(--chu); }
  .logo-icon { width: 32px; height: 32px; background: var(--chinh); color: #fff; box-shadow: 0 3px 10px rgba(79, 70, 229, .3); }
  .logo-icon svg { width: 18px; height: 18px; }
  .nguoi-dung { margin-left: auto; gap: 6px; }
  .nguoi-dung span#tenNguoiDung { display: none; }
  .avatar { width: 34px; height: 34px; box-shadow: none; }
  .nguoi-dung .nut-icon {
    width: 38px; height: 38px; min-height: 0; padding: 0; border-radius: 12px;
    background: var(--nen); color: var(--chu-phu); border: 1px solid var(--vien);
  }
  .nguoi-dung .nut-icon:active { background: var(--chinh-nhat); color: var(--chinh); }
  .nguoi-dung .nut-icon svg { width: 19px; height: 19px; }
  .nguoi-dung .nut-icon span { display: none; }

  #menu {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; order: 0;
    display: flex; gap: 0; overflow: visible; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); border-top: 1px solid var(--vien);
    -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, .06);
  }
  #menu button {
    flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; padding: 6px 2px 4px; border-radius: 12px;
    background: transparent; color: #64748b; font-size: 11px; font-weight: 600; box-shadow: none;
    -webkit-tap-highlight-color: transparent;
  }
  #menu button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #menu button svg {
    width: 44px; height: 28px; padding: 4px 12px; border-radius: 999px; box-sizing: border-box;
    transition: background var(--chuyen), color var(--chuyen);
  }
  #menu button:hover { background: transparent; color: #64748b; }
  #menu button.chon, #menu button.chon:hover { background: transparent; color: var(--chinh); box-shadow: none; }
  #menu button.chon svg { background: var(--chinh-nhat); stroke-width: 2.3; }
  #menu.mot-muc { display: none; }
  .co-menu-duoi main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

  /* Chữ ô nhập >= 16px để iPhone không tự phóng to khi chạm */
  input, select, textarea { font-size: 16px; padding: 11px 12px; }
  .nut { min-height: 42px; }
  .nut-nho { min-height: 36px; padding: 6px 12px; }
  form > .nut-chinh[type=submit] { width: 100%; padding: 13px; font-size: 16px; }

  .the { padding: 16px 14px; border-radius: 14px; }
  .dau-trang .nhom-nut { width: 100%; }
  .dau-trang .nhom-nut .nut { flex: 1; }
  .dau-trang .nhom-nut .ghi-chu { flex-basis: 100%; }

  .luoi-the { grid-template-columns: 1fr 1fr; gap: 8px; }
  .the-nho { padding: 10px 10px 10px 14px; font-size: 13px; }

  /* Bảng -> danh sách thẻ */
  .cuon { overflow-x: visible; }
  .bang-the, .bang-the tbody, .bang-the tr, .bang-the td { display: block; width: 100%; }
  .bang-the thead { display: none; }
  .bang-the tr {
    border: 1px solid var(--vien); border-radius: 14px; margin-bottom: 10px; padding: 10px 14px;
    background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
  }
  .bang-the tbody tr:hover td { background: transparent; }
  .bang-the tr.qua-han { border-color: #fda4af; background: var(--do-nhat); }
  .bang-the tr.qua-han td { background: transparent; }
  .bang-the tr.bat-buoc { border-color: #fdba74; background: var(--cam-nhat); }
  .bang-the tr.bat-buoc td { background: transparent; }
  .bang-the td { border: 0; padding: 5px 0; display: flex; gap: 10px; white-space: normal !important; }
  .bang-the td::before { content: attr(data-nhan); flex: 0 0 96px; color: var(--chu-phu); font-size: 12px; font-weight: 600; padding-top: 2px; }
  .bang-the td .o { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .bang-the td.trong { display: none; }
  .bang-the td:first-child .o { font-weight: 700; }
  .bang-the td:first-child .o .ghi-chu { font-weight: 400; }
  .bang-the td.hanh-dong { padding-top: 10px; margin-top: 6px; border-top: 1px dashed var(--vien); }
  .bang-the td.hanh-dong::before { display: none; }
  .bang-the td.hanh-dong:empty, .bang-the td.hanh-dong .o:empty { display: none; }
  .bang-the td.hanh-dong .o { display: flex; gap: 8px; flex-wrap: wrap; }
  .bang-the td.hanh-dong .nut { flex: 1; min-height: 42px; margin: 0; }

  /* Hộp thoại trượt từ dưới lên */
  .hop-thoai { padding: 0; align-items: flex-end; }
  .hop-thoai-khung {
    max-width: none; border-radius: 22px 22px 0 0; max-height: 92vh; overflow-y: auto;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); animation: len .25s ease;
  }
  .hop-thoai-khung::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: #e2e8f0; margin: -6px auto 12px; }
  .hang-nut { position: sticky; bottom: -16px; background: #fff; padding: 12px 0 4px; margin-top: 14px; }
  .hang-nut .nut { flex: 1; min-height: 46px; }

  .thong-bao-vung { top: auto; bottom: calc(14px + env(safe-area-inset-bottom)); left: 12px; right: 12px; max-width: none; }
  .co-menu-duoi .thong-bao-vung { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .thong-bao { max-width: none; }

  .tab { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tab::-webkit-scrollbar { display: none; }
  .tab button { white-space: nowrap; }
}
@keyframes len { from { transform: translateY(100%); } to { transform: none; } }
