/* Webapp kho: làm cho điện thoại trước, chữ to, nút to. */
:root {
  --nen: #f4f6f4;
  --the: #ffffff;
  --chu: #1c2421;
  --chu-mo: #5b6662;
  --vien: #d5dbd8;
  --chinh: #1f5f45;
  --chinh-nhat: #e3f0ea;
  --tot: #2e7d4f;
  --tot-nen: #e2f3e8;
  --vang: #9a6a00;
  --vang-nen: #fff3cf;
  --cam: #b4520f;
  --cam-nen: #ffe6d2;
  --do: #b3261e;
  --do-nen: #fde3e1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --nen: #121614;
    --the: #1c2220;
    --chu: #e6ece9;
    --chu-mo: #a3aeaa;
    --vien: #34403b;
    --chinh: #6cc49a;
    --chinh-nhat: #1f3a2e;
    --tot: #7fd3a1;
    --tot-nen: #183327;
    --vang: #f1c75b;
    --vang-nen: #3a3016;
    --cam: #f5a066;
    --cam-nen: #3d2616;
    --do: #ff8b82;
    --do-nen: #43201d;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--nen);
  color: var(--chu);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 640px; margin: 0 auto; padding: 12px 16px 48px; }
h1 { font-size: 1.35rem; margin: 8px 0 4px; }
h2 { font-size: 1.08rem; margin: 0 0 8px; }
h2 small { font-weight: 400; color: var(--chu-mo); }
a { color: var(--chinh); }
.mo { color: var(--chu-mo); font-size: .92rem; }

.bang-demo { background: #f2c94c; color: #3b2f00; text-align: center; font-size: .85rem; font-weight: 600; padding: 4px 8px; }
.dau { display: flex; align-items: baseline; gap: 10px; padding: 10px 16px; background: var(--chinh); color: #fff; }
.dau .ten-app { color: #fff; font-weight: 700; text-decoration: none; }
.dau .ten-ch { opacity: .9; font-size: .95rem; }
@media (prefers-color-scheme: dark) { .dau { background: #183d2e; } }
.menu { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 8px 16px; background: var(--the); border-bottom: 1px solid var(--vien); font-size: .95rem; }
.menu form { margin-left: auto; }
.bang-qt { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 16px; background: var(--chinh-nhat); font-size: .9rem; }

.the { background: var(--the); border: 1px solid var(--vien); border-radius: 12px; padding: 14px; margin: 12px 0; }
.thong-bao { background: var(--chinh-nhat); border-radius: 10px; padding: 10px 12px; }
.thong-bao.tot { background: var(--tot-nen); }
.loi-chung { background: var(--do-nen); color: var(--do); font-weight: 600; }
.loi { color: var(--do); font-size: .9rem; margin: 4px 0 0; }
.co-loi { outline: 2px solid var(--do); outline-offset: 4px; border-radius: 8px; }

.nut, button.nut {
  display: block; width: 100%; text-align: center; text-decoration: none; border: 0; border-radius: 12px;
  background: var(--chinh); color: #fff; font: inherit; font-weight: 600; padding: 14px; margin: 10px 0; cursor: pointer;
}
@media (prefers-color-scheme: dark) { .nut, button.nut { color: #0c1a14; } }
.nut.phu { background: var(--the); color: var(--chinh); border: 2px solid var(--chinh); }
.nut-gui { position: sticky; bottom: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.nut-chu { background: none; border: 0; color: var(--chinh); font: inherit; padding: 4px 0; cursor: pointer; text-decoration: underline; }
.nut-nho { border: 1px solid var(--vien); background: var(--the); color: var(--chu); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .9rem; cursor: pointer; }

label.nhan { display: block; font-weight: 600; margin: 10px 0; }
select, input[type=text], input[type=password], input[type=date], input:not([type]), textarea {
  display: block; width: 100%; font: inherit; padding: 10px 12px; margin-top: 4px;
  border: 1px solid var(--vien); border-radius: 10px; background: var(--the); color: var(--chu);
}

.tab-luot { display: flex; gap: 6px; margin: 10px 0; }
.tab-luot a { flex: 1; text-align: center; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--vien); background: var(--the); text-decoration: none; color: var(--chu); font-size: .95rem; }
.tab-luot a.chon { border: 2px solid var(--chinh); font-weight: 700; }
.tab-luot a.xong { color: var(--tot); }

.dong-lo, .dong-nvl { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--vien); }
.dong-lo:first-of-type, .dong-nvl:first-of-type { border-top: 0; }
.dong-lo .chip { justify-self: start; }
.dong-lo .buoc, .dong-lo .o-so { grid-column: 2; grid-row: 1 / span 2; }
.lo-ten { font-weight: 600; }
.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .85rem; font-weight: 600; border: 1px solid; }
.tt-tot { color: var(--tot); background: var(--tot-nen); }
.tt-gan_date { color: var(--vang); background: var(--vang-nen); }
.tt-qua_date { color: var(--cam); background: var(--cam-nen); }
.tt-phai_huy, .tt-nem_khong_dat { color: var(--do); background: var(--do-nen); }
.vien-phai_huy, .vien-nem_khong_dat { border-left: 6px solid var(--do); }
.vien-qua_date { border-left: 6px solid var(--cam); }
.vien-gan_date { border-left: 6px solid var(--vang); }

.buoc { display: flex; align-items: stretch; }
.buoc button { width: 44px; font-size: 1.3rem; border: 1px solid var(--vien); background: var(--the); color: var(--chu); cursor: pointer; }
.buoc button:first-child { border-radius: 10px 0 0 10px; }
.buoc button:last-child { border-radius: 0 10px 10px 0; }
.buoc input { width: 64px; text-align: center; font: inherit; font-weight: 600; border: 1px solid var(--vien); border-left: 0; border-right: 0; background: var(--the); color: var(--chu); padding: 8px 0; margin: 0; border-radius: 0; }
.o-so { font-size: .85rem; color: var(--do); font-weight: 600; text-align: right; }
.o-so input { width: 96px; text-align: center; border: 2px solid var(--do); border-radius: 10px; font: inherit; padding: 8px; margin-top: 2px; background: var(--the); color: var(--chu); }

fieldset.nem { border: 1px dashed var(--vien); border-radius: 10px; margin: 10px 0 0; padding: 10px 12px; }
fieldset.nem legend { font-weight: 600; padding: 0 4px; }
.chon-nem { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; margin: 0 6px 6px 0; border: 1px solid var(--vien); border-radius: 10px; cursor: pointer; }
.chon-nem input { width: 20px; height: 20px; margin: 0; }
.chon-nem.dat:has(input:checked) { border-color: var(--tot); background: var(--tot-nen); }
.chon-nem.khong-dat:has(input:checked) { border-color: var(--do); background: var(--do-nen); }
.goi-y { font-size: .9rem; color: var(--chu-mo); margin: 6px 0 0; }
/* Ô "vì sao không đạt" chỉ hiện khi chọn Không đạt */
fieldset.nem input[name^=ghi_chu_] { display: none; }
fieldset.nem:has(input[value=khong_dat]:checked) input[name^=ghi_chu_] { display: block; }

details.lo-moi { margin-top: 10px; }
details.lo-moi summary { color: var(--chinh); font-weight: 600; cursor: pointer; padding: 4px 0; }
details.lo-moi .hai-o { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
details.lo-moi label { font-size: .9rem; }

.ds-luot { list-style: none; padding: 0; margin: 0; }
.ds-luot li { padding: 6px 0; border-top: 1px solid var(--vien); }
.ds-luot li:first-child { border-top: 0; }
.xong { color: var(--tot); font-weight: 600; }
.chua { color: var(--do); font-weight: 600; }
.cac-chip { display: flex; flex-wrap: wrap; gap: 6px; }

table.bang { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.bang th, table.bang td { text-align: left; padding: 7px 6px; border-top: 1px solid var(--vien); vertical-align: top; }
table.bang th { font-size: .82rem; color: var(--chu-mo); font-weight: 600; border-top: 0; }
.cuon-ngang { overflow-x: auto; }
.luoi-o { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.luoi-o label { font-size: .9rem; font-weight: 600; }
.luoi-o .ca-dong { grid-column: 1 / -1; }
.hang-nut { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hang-nut form { margin: 0; }
.o-nho { width: 84px !important; display: inline-block !important; }
