/* LUMIQ — app quản lý (app.lumiq.com.vn). Bố cục kiểu app SOLIQ, màu thương hiệu LUMIQ (navy + vàng). */
:root {
  --navy: #0B1730; --navy2: #132748; --navy3: #1D3763;
  --vang: #F5B841; --vang2: #FFD98A; --vang-nhat: #FFF6E0;
  --nen: #F3F5F9; --the: #FFFFFF; --chu: #142033; --mo: #5D6B82; --mo2: #8A96AB; --vach: #E2E7EF;
  --xanh: #12A150; --do: #D93B3B; --cam: #E57A1E; --xanhd: #2563EB; --tim: #7C3AED;
  --sans: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 14px; --ben: 236px; --tren: 64px; --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--nen); color: var(--chu); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--xanhd); text-decoration: none; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }

/* ---------- Nút ---------- */
.nut {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--vach); background: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background-color .15s, border-color .15s, transform .15s;
}
.nut:hover { border-color: #C9D2E0; background: #F8FAFC; }
.nut:active { transform: translateY(1px); }
.nut:disabled { opacity: .6; cursor: progress; }
.nut-chinh { background: var(--navy); border-color: var(--navy); color: #fff; }
.nut-chinh:hover { background: var(--navy3); border-color: var(--navy3); }
.nut-do { background: var(--do); border-color: var(--do); color: #fff; }
.nut-do:hover { background: #B92F2F; border-color: #B92F2F; }
.nut-xanh { background: var(--xanh); border-color: var(--xanh); color: #fff; }
.nut-xanh:hover { background: #0E8743; border-color: #0E8743; }
.nut-do-nhat { background: #FDECEC; border-color: #F7C9C9; color: var(--do); }
.nho { height: 32px; padding: 0 12px; font-size: 13px; }
.nut:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--vang); outline-offset: 2px; }

/* ---------- Đăng nhập ---------- */
.cong { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(ellipse at 50% 115%, rgba(245, 160, 50, .32), transparent 60%), var(--navy); }
.cong-the { width: min(400px, 100%); background: #fff; border-radius: 22px; padding: 30px 28px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .6); }
.cong-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.cong-logo b { font-size: 22px; font-weight: 800; letter-spacing: .22em; color: var(--navy); }
.cong-logo span { margin-left: auto; font-size: 12px; color: var(--mo); font-weight: 600; }
.cong h1 { font-size: 22px; margin-bottom: 16px; }
.cong form { display: grid; gap: 14px; }
.cong-chu { margin: 0; font-size: 13px; color: var(--mo); text-align: center; }
.cong .nut-chinh { height: 48px; font-size: 15px; }

/* ---------- Ô nhập ---------- */
.o { display: grid; gap: 5px; min-width: 0; }
.o > span { font-size: 13px; font-weight: 600; color: #3A4860; }
.o > span i { color: var(--do); font-style: normal; }
.o small { font-size: 12px; color: var(--mo2); }
.o input, .o select, .o textarea, .cong-cu select, .cong-cu input, .o-ngang input {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid #D5DCE7; background: #fff; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.o textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.o input:focus, .o select:focus, .o textarea:focus, .cong-cu select:focus, .cong-cu input:focus { outline: none; border-color: var(--navy3); box-shadow: 0 0 0 3px rgba(29, 55, 99, .12); }
.o input:disabled { background: #F1F4F8; color: var(--mo); }
.loi { margin: 0; color: var(--do); font-size: 14px; font-weight: 500; }

/* ---------- Khung app ---------- */
.app { min-height: 100vh; }
.ben {
  position: fixed; inset: 0 auto 0 0; width: var(--ben); z-index: 20; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--navy) 0%, #0E1D3B 100%); color: #DCE3EE; padding: 18px 12px;
}
.ben-logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: #fff; }
.ben-logo b { font-size: 21px; font-weight: 800; letter-spacing: .24em; }
.ben-menu { display: grid; gap: 4px; }
.ben-menu a, .day a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: #C5CFDE; font-weight: 600; font-size: 15px; transition: background-color .15s, color .15s; }
.ben-menu a svg, .day a svg { width: 21px; height: 21px; flex: none; }
.ben-menu a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.ben-menu a.dang { background: rgba(245, 184, 65, .14); color: var(--vang2); }
.ben-toi { margin-top: auto; }
.toi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .06); cursor: pointer; text-align: left; }
.toi:hover { background: rgba(255, 255, 255, .1); }
.avt { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(180deg, #FFE19A, #F5B841); color: #1A1204; font-weight: 800; flex: none; }
.toi b { display: block; font-size: 14px; color: #fff; }
.toi small { font-size: 12px; color: #9FAEC6; }
.than { margin-left: var(--ben); min-width: 0; }
.tren {
  position: sticky; top: 0; z-index: 10; height: var(--tren); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: rgba(243, 245, 249, .96); border-bottom: 1px solid var(--vach);
}
.tren h1 { font-size: 20px; font-weight: 800; }
.tren-phai { margin-left: auto; display: flex; gap: 8px; }
.noi { padding: 22px 28px 60px; max-width: 1500px; }
.day { display: none; }
.dang-tai, .trong-lon { padding: 60px 0; text-align: center; color: var(--mo); }
.trong-nho { margin: 0; padding: 14px 0; color: var(--mo); font-size: 14px; }

/* ---------- Ô số liệu ---------- */
.o-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.o-luoi-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.o-luoi-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.o-so { background: var(--the); border: 1px solid var(--vach); border-radius: var(--r); padding: 16px 18px; min-width: 0; }
.o-so > span { display: block; font-size: 13px; color: var(--mo); font-weight: 600; }
.o-so > b { display: block; margin-top: 4px; font-size: clamp(18px, 1.45vw, 21px); font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.o-so > b em { font-style: normal; }
.o-so > small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--mo2); }
.o-vang { background: linear-gradient(180deg, #FFF8E6, #fff); border-color: #F3DDA6; }
.o-xanh { background: linear-gradient(180deg, #ECFAF2, #fff); border-color: #BFE8D0; }
.xanh-chu { color: var(--xanh); } .do-chu { color: var(--do); } .vang-chu { color: #B7791F; }

.chao { margin-bottom: 18px; }
.chao h2 { font-size: 24px; font-weight: 800; }
.chao p { margin: 2px 0 0; color: var(--mo); text-transform: capitalize; }

/* ---------- Thẻ / khối ---------- */
.the { background: var(--the); border: 1px solid var(--vach); border-radius: var(--r); padding: 16px 18px; margin-bottom: 18px; min-width: 0; }
.the-dau { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.the-dau h3 { font-size: 16px; font-weight: 700; }
.hai-cot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.hai-cot.hd-ct { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
.bang.gon td:first-child { min-width: 150px; }
.bang.gon td { white-space: nowrap; }
.bang.gon td:first-child { white-space: normal; }
.hai-cot > .the { margin-bottom: 18px; }
.ds-gon { list-style: none; margin: 0; padding: 0; }
.ds-gon li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #EEF1F6; }
.ds-gon li:first-child { border-top: 0; }
.ds-gon li a { flex: 1; min-width: 0; color: var(--chu); }
.ds-gon li a small { display: block; color: var(--mo2); font-size: 12.5px; }
.ds-gon li > span { font-weight: 700; white-space: nowrap; }
.ds-gon li.qua-han > span, .ds-gon li.qua-han small { color: var(--do); }

/* ---------- Thanh công cụ + chip lọc ---------- */
.cong-cu { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.cong-cu .tim { flex: 1 1 260px; min-width: 0; padding-left: 38px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM21 21l-5-5' fill='none' stroke='%238A96AB' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 12px center / 18px no-repeat; }
.cong-cu select { width: auto; min-width: 140px; }
.cong-cu input[type=date] { width: auto; }
.o-ngang { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--mo); }
.chip-hang { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.chip-hang::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--vach); background: #fff; font-size: 13.5px; font-weight: 600; color: #3A4860; cursor: pointer; }
.chip i { font-style: normal; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: #EEF1F6; font-size: 12px; color: var(--mo); }
.chip.dang { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.dang i { background: rgba(255, 255, 255, .18); color: #fff; }
.tab-hang { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--vach); overflow-x: auto; scrollbar-width: none; }
.tab-hang::-webkit-scrollbar { display: none; }
.tab-hang button { flex: none; height: 42px; padding: 0 14px; border: 0; background: none; font-weight: 600; color: var(--mo); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab-hang button.dang { color: var(--navy); border-bottom-color: var(--vang); }

/* ---------- Bảng (đầu bảng navy dính trên, kiểu bảng hợp đồng SOLIQ) ---------- */
.bang-cuon { overflow: auto; border-radius: var(--r); border: 1px solid var(--vach); background: #fff; max-height: calc(100vh - 220px); }
.the .bang-cuon { max-height: none; }
.bang { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.bang th {
  position: sticky; top: 0; z-index: 2; text-align: left; white-space: nowrap; padding: 11px 12px; font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
  background: var(--navy2); color: #fff; cursor: pointer; user-select: none;
}
.bang th:first-child { border-top-left-radius: 13px; } .bang th:last-child { border-top-right-radius: 13px; }
.bang th.len::after { content: ' ▲'; color: var(--vang2); font-size: 10px; }
.bang th.xuong::after { content: ' ▼'; color: var(--vang2); font-size: 10px; }
.bang td { padding: 10px 12px; border-top: 1px solid #EEF1F6; vertical-align: top; }
.bang td small { display: block; color: var(--mo2); font-size: 12.5px; margin-top: 1px; }
.bang tbody tr[data-i] { cursor: pointer; transition: background-color .12s; }
.bang tbody tr[data-i]:hover td { background: var(--vang-nhat); }
.bang tbody tr:nth-child(even) td { background: #FAFBFD; }
.bang tbody tr[data-i]:nth-child(even):hover td { background: var(--vang-nhat); }
.bang tfoot td { position: sticky; bottom: 0; background: #F1F4F9; font-weight: 700; border-top: 2px solid var(--vach); }
.bang .phai { text-align: right; font-variant-numeric: tabular-nums; }
.bang tr.mo td { opacity: .55; }
.bang tr.gach td { text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .3); }
.bang tr.trong td { text-align: center; color: var(--mo); padding: 36px 12px; cursor: default; }
.bang.gon td, .bang.gon th { padding: 8px 10px; }
.ma { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; font-weight: 700; color: var(--navy3); white-space: nowrap; }
.ma.lon { font-size: 15px; display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }

/* ---------- Nhãn trạng thái ---------- */
.nhan { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; font-family: var(--sans); }
.nhan-xam { background: #EEF1F6; color: #4B5A72; } .nhan-xanh { background: #E3EDFF; color: #1D4ED8; } .nhan-cam { background: #FFF0E0; color: #C2410C; }
.nhan-tim { background: #F1E8FF; color: #6D28D9; } .nhan-luc { background: #E3F7EC; color: #0E7A3E; } .nhan-vang { background: #FFF5D6; color: #A16207; }
.nhan-do { background: #FDE5E5; color: #B42323; }

/* ---------- Thanh tiến độ (độ rộng theo lớp w0…w100, không dùng style nội tuyến) ---------- */
.tien-do { height: 5px; border-radius: 5px; background: #E7ECF3; overflow: hidden; margin-top: 5px; min-width: 60px; }
.tien-do i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #F5A524, #FFD27A); }
.tien-do.xanh i { background: linear-gradient(90deg, #12A150, #4ADE80); } .tien-do.do i { background: linear-gradient(90deg, #D93B3B, #F87171); }
.tien-do + small { font-size: 11.5px; }
.w0{width:0}.w5{width:5%}.w10{width:10%}.w15{width:15%}.w20{width:20%}.w25{width:25%}.w30{width:30%}.w35{width:35%}.w40{width:40%}.w45{width:45%}.w50{width:50%}
.w55{width:55%}.w60{width:60%}.w65{width:65%}.w70{width:70%}.w75{width:75%}.w80{width:80%}.w85{width:85%}.w90{width:90%}.w95{width:95%}.w100{width:100%}

/* ---------- Chi tiết hợp đồng ---------- */
.quay { display: inline-block; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.hd-dau { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.hd-dau h2 { font-size: 24px; font-weight: 800; }
.hd-nut { display: flex; gap: 8px; flex-wrap: wrap; }
.phu { margin: 2px 0 0; color: var(--mo); font-size: 14px; }
.tt { display: grid; }
.tt-dong { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid #EEF1F6; font-size: 14px; }
.tt-dong:first-child { border-top: 0; }
.tt-dong span { color: var(--mo); }
.tt-dong b { font-weight: 600; word-break: break-word; }
.ghi-chu { margin-top: 10px; padding: 10px 12px; background: #FFF9EA; border-radius: 10px; font-size: 14px; white-space: pre-wrap; }
.so-lon { margin: 0 0 12px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.nk { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.nk > li { padding: 10px 0; border-top: 1px solid #EEF1F6; }
.nk > li:first-child { border-top: 0; }
.nk small { margin-left: 8px; color: var(--mo2); }
.nk ul { margin: 6px 0 0; padding-left: 18px; color: #3A4860; }
.nk s { color: var(--mo2); }

/* ---------- Biểu đồ thu chi 12 tháng (chiều cao theo lớp h0…h100) ---------- */
.cot-bd { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(42px, 1fr); gap: 6px; overflow-x: auto; padding-top: 8px; }
.cot-nhom { display: grid; justify-items: center; gap: 4px; }
.cot-doi { display: flex; align-items: flex-end; gap: 3px; height: 150px; }
.cot { display: block; width: 13px; border-radius: 4px 4px 0 0; min-height: 2px; }
.cot.thu { background: linear-gradient(180deg, #4ADE80, #12A150); } .cot.chi { background: linear-gradient(180deg, #F87171, #D93B3B); }
.cot-nhom span { font-size: 12px; color: var(--mo); font-weight: 600; }
.cot-nhom small { font-size: 11px; color: var(--mo2); white-space: nowrap; }
.h0{height:0}.h5{height:5%}.h10{height:10%}.h15{height:15%}.h20{height:20%}.h25{height:25%}.h30{height:30%}.h35{height:35%}.h40{height:40%}.h45{height:45%}.h50{height:50%}
.h55{height:55%}.h60{height:60%}.h65{height:65%}.h70{height:70%}.h75{height:75%}.h80{height:80%}.h85{height:85%}.h90{height:90%}.h95{height:95%}.h100{height:100%}
.chu-thich { font-size: 12.5px; color: var(--mo); display: inline-flex; align-items: center; gap: 6px; }
.cham-xanh, .cham-do { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--xanh); }
.cham-do { background: var(--do); margin-left: 8px; }
.hm { list-style: none; margin: 0; padding: 0; }
.hm li { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto 40px; gap: 10px; align-items: center; padding: 7px 0; font-size: 14px; border-top: 1px solid #EEF1F6; }
.hm li:first-child { border-top: 0; }
.hm li .tien-do { margin: 0; }
.hm li small { color: var(--mo2); text-align: right; }
.ds-hm { list-style: none; margin: 0; padding: 0; }
.ds-hm li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #EEF1F6; font-size: 14px; }
.ds-hm li:first-child { border-top: 0; }
.ds-hm li.mo span { color: var(--mo2); }

/* ---------- Ngăn trượt (form / chi tiết) ---------- */
.ngan-nen { position: fixed; inset: 0; z-index: 40; background: rgba(11, 23, 48, .35); opacity: 0; transition: opacity .2s; }
.ngan-nen.mo { opacity: 1; }
.ngan {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(640px, 100%); background: #fff; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s var(--ease); box-shadow: -20px 0 60px -20px rgba(0, 0, 0, .3);
}
.ngan.mo { transform: none; }
.ngan-form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.ngan-dau { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--vach); }
.ngan-dau h2 { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ngan-dau p { margin: 3px 0 0; color: var(--mo); font-size: 13.5px; }
.ngan-than { flex: 1; overflow-y: auto; padding: 18px 22px; -webkit-overflow-scrolling: touch; }
.ngan-chan { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--vach); background: #FAFBFD; }
.ngan-chan .loi { margin-right: auto; }
.x { flex: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--vach); background: #fff; font-size: 22px; line-height: 1; cursor: pointer; color: var(--mo); }
.x.nho { width: 34px; height: 34px; font-size: 18px; }
.x:hover { background: #F3F5F9; color: var(--chu); }
.nhom { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.nhom legend { padding: 0; margin-bottom: 10px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--navy3); }
.luoi { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.luoi > .o { grid-column: 1 / -1; }
.luoi > .o.o-nua { grid-column: auto; }
.nhom-nut { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.tong-gt { margin: 0 0 10px; font-size: 14px; }
.dot-dau, .dot-dong { display: grid; grid-template-columns: minmax(0, 1.6fr) 62px minmax(0, 1.2fr) minmax(0, 1fr) 34px; gap: 8px; align-items: center; }
.dot-dau { font-size: 12px; font-weight: 700; color: var(--mo); margin-bottom: 6px; }
.dot-dong { margin-bottom: 8px; }
.dot-dong input { height: 40px; padding: 0 10px; border-radius: 9px; border: 1px solid #D5DCE7; min-width: 0; width: 100%; font-size: 14px; }
.dot-nut { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* ---------- Hộp thoại ---------- */
.hop-nen { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(11, 23, 48, .45); }
.hop { width: min(460px, 100%); background: #fff; border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
.hop h3 { font-size: 17px; margin-bottom: 8px; line-height: 1.4; }
.hop-o { width: 100%; margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid #D5DCE7; font-size: 14px; resize: vertical; }
.hop-nut { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.hop-ds { display: grid; gap: 8px; margin-top: 14px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 600; font-size: 14px;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5);
}
.toast.hien { opacity: 1; transform: translate(-50%, 0); }
.toast-loi { background: var(--do); }

/* ---------- Máy tính bảng ---------- */
@media (max-width: 1100px) {
  .o-luoi-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hai-cot, .hai-cot.hd-ct { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Điện thoại: ẩn menu trái, dùng thanh dưới ---------- */
@media (max-width: 820px) {
  :root { --tren: 56px; }
  .ben { display: none; }
  .than { margin-left: 0; }
  .tren { padding: 0 16px; padding-top: env(safe-area-inset-top); height: calc(var(--tren) + env(safe-area-inset-top)); }
  .tren h1 { font-size: 18px; }
  .tren-phai .nut { height: 36px; padding: 0 10px; font-size: 13px; }
  .noi { padding: 16px 14px calc(90px + env(safe-area-inset-bottom)); }
  .day {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--navy); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px -12px rgba(0, 0, 0, .4);
  }
  .day a { flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 11.5px; justify-content: center; text-align: center; }
  .day a.dang { color: var(--vang2); background: rgba(245, 184, 65, .12); }
  .o-luoi, .o-luoi-3, .o-luoi-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .o-so { padding: 12px 14px; }
  .o-so > b { font-size: 17px; white-space: normal; word-break: break-word; }
  .bang-cuon { max-height: none; }
  .bang { font-size: 13.5px; }
  .bang th:first-child, .bang td:first-child { position: sticky; left: 0; z-index: 1; }
  .bang th:first-child { z-index: 3; }
  .bang td:first-child { background: #fff; box-shadow: 1px 0 0 #EEF1F6; }
  .bang tbody tr:nth-child(even) td:first-child { background: #FAFBFD; }
  .tt-dong { grid-template-columns: 120px 1fr; }
  .luoi { grid-template-columns: 1fr; }
  .luoi > .o.o-nua { grid-column: 1 / -1; }
  .ngan { width: 100%; }
  .ngan-dau, .ngan-than { padding-left: 16px; padding-right: 16px; }
  .dot-dau { display: none; }
  .dot-dong { grid-template-columns: minmax(0, 1fr) 70px 34px; grid-template-areas: "ten tl x" "st han han"; padding: 10px; border: 1px solid var(--vach); border-radius: 12px; }
  .dot-dong [name=d_ten] { grid-area: ten; } .dot-dong [name=d_ty_le] { grid-area: tl; } .dot-dong [name=d_so_tien] { grid-area: st; } .dot-dong [name=d_han] { grid-area: han; } .dot-dong .x { grid-area: x; }
  .cong-cu select { flex: 1 1 auto; min-width: 0; }
  .hm li { grid-template-columns: minmax(0, 1fr) 70px auto; }
  .hm li small { display: none; }
  .hd-dau h2 { font-size: 20px; }
}
@media (max-width: 380px) {
  .o-luoi, .o-luoi-3, .o-luoi-4 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
