:root {
  --nen: #f6f4ef;
  --the: #ffffff;
  --chu: #1f2328;
  --mo: #6b6f76;
  --vien: #e3dfd6;
  --chinh: #c2410c;
  --chinh-dam: #9a3412;
  --xanh: #15803d;
  --vang: #b45309;
  --do: #b91c1c;
  --bo: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--nen);
  color: var(--chu);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.khung { max-width: 760px; margin: 0 auto; padding: 16px; }
.khung.hep { max-width: 420px; }

header.dau {
  background: var(--chu); color: #fff;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
}
header.dau .ten { font-weight: 700; flex: 1; }
header.dau button { background: transparent; color: #fff; border: 1px solid #ffffff55; padding: 6px 12px; min-height: 0; }

h1 { font-size: 1.5rem; margin: 8px 0 16px; }
h2 { font-size: 1.15rem; margin: 24px 0 12px; }
h3 { font-size: 1.05rem; margin: 0 0 4px; }
.mo { color: var(--mo); font-size: .9rem; }

.the {
  background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo);
  padding: 16px; margin-bottom: 12px;
}

label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: .95rem; }
input, select, textarea {
  width: 100%; font: inherit; padding: 12px; border: 1px solid #cfc9bd; border-radius: 10px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--chinh); outline-offset: 1px; }
textarea { min-height: 120px; }

button, .nut {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; min-height: 48px; padding: 10px 18px;
  border-radius: 10px; border: 1px solid var(--vien); background: #fff; color: var(--chu);
  cursor: pointer; text-decoration: none;
}
button.chinh, .nut.chinh { background: var(--chinh); border-color: var(--chinh); color: #fff; }
button.chinh:hover { background: var(--chinh-dam); }
button.nho { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
button.rong { width: 100%; margin-top: 16px; }
button:disabled { opacity: .5; cursor: not-allowed; }

.tab { display: flex; gap: 4px; background: #e9e5dc; padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.tab button { flex: 1; border: 0; background: transparent; min-height: 42px; }
.tab button.chon { background: #fff; box-shadow: 0 1px 2px #0002; }

.nhan { display: inline-block; font-size: .8rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; }
.nhan.xanh { background: #dcfce7; color: var(--xanh); }
.nhan.vang { background: #fef3c7; color: var(--vang); }
.nhan.do { background: #fee2e2; color: var(--do); }
.nhan.xam { background: #eee; color: var(--mo); }

.thanh { height: 10px; background: #ebe7de; border-radius: 99px; overflow: hidden; }
.thanh > i { display: block; height: 100%; background: var(--chinh); border-radius: 99px; }
.thanh.xong > i { background: var(--xanh); }
.hm { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; margin: 10px 0; }
.hm .thanh { grid-column: 1 / -1; }
.hm b { font-variant-numeric: tabular-nums; }

.hang { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hang.giua { justify-content: space-between; }
.o-link { display: flex; gap: 8px; margin-top: 8px; }
.o-link input { font-size: .85rem; padding: 8px; background: #faf9f6; }
.chk { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 6px 0; }
.chk input { width: 22px; height: 22px; }

details.the > summary { cursor: pointer; font-weight: 700; list-style: none; }
details.the > summary::before { content: "＋ "; color: var(--chinh); }
details.the[open] > summary::before { content: "－ "; }

#bao {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 10px;
  background: var(--chu); color: #fff; font-weight: 600; box-shadow: 0 6px 24px #0004;
  display: none; z-index: 10;
}
#bao.loi { background: var(--do); }
.rong-trang { text-align: center; color: var(--mo); padding: 24px 8px; }
