/* Màu thương hiệu Dipushop (lấy từ dipushop.com.vn): sửa nhóm biến dưới đây để đổi toàn bộ giao diện */
:root {
  --chinh: #16414F;
  --chinh-dam: #0E2C36;
  --chinh-nhat: #DCEDF1;
  --cam: #D95B36;
  --cam-dam: #B8461F;
  --cam-nhat: #FFF1EA;
  --muc: #16414F;
  --phu: #5F7D88;
  --nen: #F0FAF7;
  --giay: #FFFFFF;
  --vien: #CFE2E6;
  --tot: #1E7B4E;
  --tot-nhat: #E2F2E9;
  --xau: #B3261E;
  --xau-nhat: #FBE7E5;
  --canh: #9A5B00;
  --canh-nhat: #FCEFD9;
  --chu: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --so: ui-monospace, 'Cascadia Mono', 'Consolas', 'SF Mono', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--chu); color: var(--muc); background: var(--nen); }
h1 { font-size: 24px; line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0; font-weight: 600; }
a { color: var(--chinh); }
:focus-visible { outline: 2px solid var(--chinh); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Đăng nhập: khung kiểu nhãn dán + hình em bé vẽ nét (cùng nét viền với logo) ---------- */
.dn { position: relative; min-height: 100%; display: grid; place-items: center; padding: 24px; overflow: hidden; background: var(--nen); }
.dn-nen { position: absolute; inset: 0; pointer-events: none; }
.dn-nen::before, .dn-nen::after { content: ''; position: absolute; border-radius: 50%; }
.dn-nen::before { width: 560px; height: 560px; left: -190px; top: -210px; background: #DDF3EE; }
.dn-nen::after { width: 480px; height: 480px; right: -170px; bottom: -190px; background: #FFEDE4; }
.dn-hinh { position: absolute; z-index: 1; display: block; width: var(--c, 88px); rotate: var(--x, 0deg); animation: nhunNhay var(--t, 7s) ease-in-out infinite; }
.dn-hinh svg { display: block; width: 100%; height: auto; overflow: visible; }
@keyframes nhunNhay { 50% { translate: 0 -9px; } }
.h1 { --c: 122px; --x: -14deg; --t: 7s; left: 8%; top: 10%; }
.h2 { --c: 104px; --x: 12deg; --t: 8s; right: 9%; top: 9%; }
.h3 { --c: 100px; --x: 20deg; --t: 7.5s; left: 13%; bottom: 9%; }
.h4 { --c: 122px; --t: 6.5s; right: 10%; bottom: 10%; }
.h5 { --c: 84px; --x: -10deg; --t: 9s; left: 3%; top: 46%; }
.h6 { --c: 98px; --x: 6deg; --t: 8.5s; right: 3%; top: 42%; }
.h7 { --c: 40px; --t: 6s; left: 27%; top: 7%; }
.h8 { --c: 34px; --x: 15deg; --t: 7s; right: 26%; bottom: 7%; }
.h9 { --c: 38px; --x: -12deg; --t: 6.5s; left: 26%; bottom: 20%; }
.h10 { --c: 80px; --t: 10s; right: 21%; top: 25%; }
.h11 { --c: 64px; --t: 11s; left: 19%; top: 31%; }
.h12 { --c: 30px; --x: 10deg; --t: 6s; right: 29%; top: 6%; }
.dn-hop { position: relative; z-index: 2; width: 100%; max-width: 380px; background: var(--giay); border: 2.4px solid var(--chinh); border-radius: 26px; padding: 26px 28px 30px; box-shadow: 7px 8px 0 #BFEBE2; text-align: center; }
.dn-logo { display: block; width: 100px; height: auto; margin: 0 auto 6px; }
.dn-hop h1 { font-size: 22px; }
.dn-hop p { color: var(--phu); margin: 4px 0 20px; }
.dn-hop form { display: grid; gap: 14px; text-align: left; }
.dn-hop input { border-radius: 14px; padding: 11px 14px; border-width: 1.6px; }
.dn-hop .nut { border-radius: 999px; padding: 11px 18px; font-size: 16px; }
.dn-hop .bat-tat { border-radius: 999px; justify-self: stretch; }
@media (prefers-reduced-motion: reduce) { .dn-hinh { animation: none; } }
@media (max-width: 640px) {
  .dn-hinh { width: calc(var(--c, 88px) * .64); }
  .h7, .h9, .h11, .h12 { display: none; }
  .h1 { left: 4%; top: 4%; } .h2 { right: 4%; top: 5%; } .h3 { left: 6%; bottom: 4%; } .h4 { right: 5%; bottom: 4%; }
  .h10 { right: 34%; top: 2%; } .h8 { right: 42%; bottom: 3%; }
  .dn-hop { padding: 22px 20px 24px; box-shadow: 5px 6px 0 #BFEBE2; }
}

/* ---------- Khung ứng dụng ---------- */
.logo { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--chinh); }
.logo { display: flex; align-items: center; gap: 8px; }
.logo img { display: block; height: auto; }
#app { display: grid; grid-template-columns: 248px 1fr; min-height: 100%; }
.ben { background: var(--giay); border-right: 1px solid var(--vien); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.ben .logo { padding: 0 10px; }
.nhom-ten { font-size: 12px; color: var(--phu); padding: 0 10px 4px; font-weight: 600; }
#menu { display: grid; gap: 14px; }
#menu a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--muc); text-decoration: none; }
#menu a:hover { background: var(--nen); }
#menu a.dang { background: var(--chinh-nhat); color: var(--chinh-dam); font-weight: 600; }
.toi { margin-top: auto; border-top: 1px solid var(--vien); padding: 12px 10px 0; display: grid; gap: 8px; font-size: 14px; }
.dau-dt, .man-che { display: none; }
main { padding: 28px 32px 60px; max-width: 1240px; width: 100%; min-width: 0; }

/* ---------- Thành phần ---------- */
.tieu-de { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.tieu-de h1, .tieu-de h2 { margin-right: auto; }
.tieu-de.nho { margin-bottom: 12px; }
.khung { background: var(--giay); border: 1px solid var(--vien); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.khung > h2 { margin-bottom: 12px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--phu); font-weight: 500; }
input, select, textarea { font: inherit; color: var(--muc); background: var(--giay); border: 1px solid var(--vien); border-radius: 6px; padding: 8px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--chinh); outline: none; box-shadow: 0 0 0 3px var(--chinh-nhat); }
input[readonly] { background: var(--nen); }
input[type=search] { width: 240px; }
.luoi3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; margin: 16px 0; }
.luoi4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 16px; }
.rong2 { grid-column: span 2; } .rong3 { grid-column: 1 / -1; }
.hang-nut { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.nut { font: inherit; font-weight: 600; border: 1px solid var(--chinh); background: var(--chinh); color: #fff; border-radius: 6px; padding: 8px 16px; cursor: pointer; white-space: nowrap; }
.nut:hover { background: var(--chinh-dam); border-color: var(--chinh-dam); }
.nut.cam { background: var(--cam); border-color: var(--cam); }
.nut.cam:hover { background: var(--cam-dam); border-color: var(--cam-dam); }
label.nut { display: inline-block; color: var(--muc); font-size: 15px; }
.nut.phu { background: var(--giay); color: var(--muc); border-color: var(--vien); font-weight: 500; }
.nut.phu:hover { border-color: var(--muc); }
.nut.xau { background: var(--giay); color: var(--xau); border-color: var(--xau); }
.nut.xau:hover { background: var(--xau-nhat); }
.nut.nho { padding: 4px 10px; font-size: 13px; }
.nut:disabled { opacity: .45; cursor: not-allowed; }
.bat-tat { font: inherit; font-size: 14px; border: 1px solid var(--chinh); background: var(--giay); color: var(--chinh); border-radius: 6px; padding: 7px 14px; cursor: pointer; justify-self: start; }
.bat-tat.bat { background: var(--chinh); color: #fff; }
.bat-tat.nho { padding: 3px 10px; font-size: 13px; }
.bat-tat:disabled { cursor: default; opacity: .7; }
.bang-quyen td { vertical-align: middle; }
.bang-quyen td.mo { font-size: 13px; max-width: 360px; }

.cuon { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 13px; color: var(--phu); border-bottom: 1px solid var(--vien); padding: 8px 10px; white-space: nowrap; }
td { border-bottom: 1px solid var(--nen); padding: 9px 10px; vertical-align: top; }
td.so, th.so { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.chi-tiet td { background: #F7F9FB; }
tfoot td { font-weight: 700; border-top: 1px solid var(--vien); }
.trong { color: var(--phu); text-align: center; padding: 24px 0; margin: 0; }
.cho { color: var(--phu); }
.loi-trang { color: var(--xau); }
.mo { color: var(--phu); font-size: 13px; }

/* IMEI như tem dán máy */
.imei { display: inline-block; font-family: var(--so); font-size: 13px; letter-spacing: .04em; background: var(--giay); border: 1px solid var(--vien); border-left: 3px solid var(--cam); border-radius: 3px; padding: 1px 7px; margin: 2px 4px 2px 0; white-space: nowrap; }
.imei small { font-family: var(--chu); letter-spacing: 0; color: var(--phu); margin-left: 6px; }
.imei.da-ban { border-left-color: var(--phu); color: var(--phu); }
.o-imei { font-family: var(--so); letter-spacing: .04em; }
.quet input { font-size: 22px; padding: 12px 14px; border-width: 2px; border-color: var(--chinh); }

.nhan { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; background: var(--nen); color: var(--phu); }
.nhan.tot { background: var(--tot-nhat); color: var(--tot); }
.nhan.xau { background: var(--xau-nhat); color: var(--xau); }
.nhan.canh { background: var(--canh-nhat); color: var(--canh); }
.nhan.chinh { background: var(--chinh-nhat); color: var(--chinh-dam); }
.am { color: var(--xau); } .duong { color: var(--muc); }

.tab { display: flex; gap: 4px; border-bottom: 1px solid var(--vien); margin-bottom: 16px; overflow-x: auto; }
.tab button { font: inherit; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; cursor: pointer; color: var(--phu); white-space: nowrap; }
.tab button.dang { color: var(--chinh-dam); border-bottom-color: var(--chinh); font-weight: 600; }
.dem { font-size: 12px; background: var(--nen); border-radius: 999px; padding: 0 7px; margin-left: 4px; }

.tong { font-size: 18px; text-align: right; margin: 12px 0 0; }
.so-lon { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 16px; }
.so-lon div { display: grid; }
.so-lon b { font-size: 22px; font-variant-numeric: tabular-nums; }
.so-lon span { color: var(--phu); font-size: 13px; }
.cham { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cham .gio { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ma-du-phong { font-family: var(--so); font-size: 16px; display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 24px; margin: 12px 0; }
.qr { background: #fff; display: inline-block; padding: 8px; border: 1px solid var(--vien); border-radius: 6px; }

tr.bam { cursor: pointer; }
tr.bam:hover td { background: var(--nen); }
tr.xong td { background: var(--tot-nhat); }
.lien-ket { font: inherit; background: none; border: 0; padding: 0; color: var(--chinh); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.quet-hang { display: flex; gap: 10px; align-items: end; }
.quet-hang .quet { flex: 1; }
.quet-hang > .nut { padding: 13px 18px; }
.goi-y { position: absolute; left: 0; right: 0; z-index: 10; background: var(--giay); border-radius: 6px; box-shadow: 0 6px 20px rgba(22, 65, 79, .18); display: grid; }
.goi-y button { font: inherit; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--nen); padding: 9px 12px; cursor: pointer; color: var(--muc); }
.goi-y button:hover, .goi-y button:focus-visible { background: var(--chinh-nhat); }
.khach-chon { background: var(--chinh-nhat); border-radius: 6px; padding: 8px 12px; margin: 0 0 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tien-do { height: 8px; background: var(--nen); border-radius: 999px; overflow: hidden; margin: 14px 0 0; }
.tien-do span { display: block; height: 100%; background: var(--cam); transition: width .2s; }
.the-anh { display: flex; flex-wrap: wrap; gap: 10px; }
.anh-nho { display: grid; gap: 4px; justify-items: center; background: none; border: 0; padding: 0; cursor: pointer; }
.anh-nho img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--vien); }
.anh-sua { display: flex; gap: 14px; align-items: start; }
.anh-sua #hhXem { width: 120px; height: 120px; border: 1px dashed var(--vien); border-radius: 6px; display: grid; place-items: center; overflow: hidden; flex: none; }
.anh-sua img { width: 100%; height: 100%; object-fit: contain; }
.nhom-imei { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1.3fr 90px auto; gap: 8px; align-items: end; padding-bottom: 10px; border-bottom: 1px solid var(--nen); }
.chon-tem { width: auto; }
@media (prefers-reduced-motion: reduce) { .tien-do span { transition: none; } }

/* ---------- Hộp thoại + thông báo ---------- */
.hop-nen { position: fixed; inset: 0; background: rgba(23, 34, 51, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.hop { background: var(--giay); border-radius: 10px; width: 100%; max-width: 760px; max-height: 90vh; display: flex; flex-direction: column; }
.hop-dau { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--vien); }
.hop-than { padding: 16px 20px; overflow-y: auto; display: grid; gap: 12px; }
.hop-chan { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--vien); flex-wrap: wrap; }
.hop-chan .trai { margin-right: auto; }
#bao { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 60; }
.bao { background: var(--muc); color: #fff; padding: 10px 16px; border-radius: 8px; max-width: 380px; animation: hien .2s ease-out; }
.bao.xau { background: var(--xau); }
@keyframes hien { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .bao { animation: none; } }

/* ---------- Điện thoại ---------- */
@media (max-width: 900px) {
  #app { grid-template-columns: minmax(0, 1fr); align-content: start; }   /* không kéo giãn thanh trên khi trang ít nội dung */
  .dau-dt { display: flex; justify-content: flex-start; gap: 12px; align-items: center; padding: 10px 16px; background: var(--giay); border-bottom: 1px solid var(--vien); position: sticky; top: 0; z-index: 20; }
  .ben { display: none; position: fixed; inset: 62px auto 0 0; width: 60%; height: auto; z-index: 30; box-shadow: 4px 0 18px rgba(22, 65, 79, .18); }
  body.mo-menu .man-che { display: block; position: fixed; inset: 62px 0 0 0; z-index: 25; background: rgba(22, 65, 79, .32); }
  body.mo-menu .ben { display: flex; }
  .ben > .logo { display: none; }
  main { padding: 18px 14px 60px; }
  .luoi3, .luoi4 { grid-template-columns: 1fr 1fr; }
  .nhom-imei { grid-template-columns: 1fr 1fr; }
  input[type=search] { width: 100%; }
}
@media (max-width: 520px) {
  .luoi3, .luoi4 { grid-template-columns: 1fr; }
  .rong2 { grid-column: auto; }
}
