/* Công Việc Bình Minh (mảng Chấm công) — theo BRAND.md v2.0: app nội bộ nền navy đậm, chữ trắng */
:root {
  --bm-cam: #E88031; --bm-la: #7DC045; --bm-duong: #4898C9; --bm-navy: #104168; --bm-navy-dam: #071C31;
  --bm-trang: #FFFFFF; --bm-muc: #101A28; --bm-xam: #5B6475; --bm-do: #C0392B;
  --nen: var(--bm-navy-dam); --the: #0E2A47; --the-2: #133456; --chu: #FFFFFF; --chu-phu: #B8C4D6; --vien: rgba(255,255,255,.99);
  --tot: #7DC045; --canh: #F2B84B; --xau: #FF7A6B; --thong-tin: #4898C9;
  --bo: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--nen); color: var(--chu); font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 16px; line-height: 1.45; }
body { padding: 12px 16px 88px; max-width: 560px; margin: 0 auto; }
body.rong { max-width: 1400px; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; }
h1 { font-size: 20px; letter-spacing: .5px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
[hidden] { display: none !important; }
.phu { color: var(--chu-phu); font-size: 13.5px; }
.so { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border-radius: var(--bo); border: 1.5px solid var(--vien); background: var(--the-2); color: var(--chu); padding: 12px 14px; }
button:disabled { opacity: .45; cursor: default; }
button.chinh { background: var(--bm-cam); color: var(--bm-muc); font-weight: 700; }
button.tot { background: var(--bm-la); color: var(--bm-muc); font-weight: 700; }
button.xau { background: #7a2318; }
button.nho { padding: 6px 10px; font-size: 14px; border-width: 1px; }
input, select, textarea { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid #3b5575; background: #0A2139; color: var(--chu); margin: 4px 0 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--bm-duong); }
label { display: block; font-size: 14px; color: var(--chu-phu); }
.the { background: var(--the); border: 1px solid #22476e; border-radius: 14px; padding: 14px; margin: 10px 0; }
.dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.luoi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.luoi .to { grid-column: span 1; min-height: 64px; font-size: 18px; font-weight: 700; }
.luoi .den { background: var(--bm-la); color: var(--bm-muc); }
.luoi .ve { background: var(--bm-cam); color: var(--bm-muc); }
.luoi-phu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.luoi-phu button { font-size: 14px; padding: 10px 6px; min-height: 52px; }
.hop { background: var(--the); border: 1.5px solid var(--bm-duong); border-radius: 14px; padding: 14px; margin: 10px 0; }
.hop .nut { display: flex; gap: 8px; }
.hop .nut button { flex: 1; }
.tb { white-space: pre-line; border-radius: 12px; padding: 12px; margin: 10px 0; }
.tb.ok { background: rgba(125,192,69,.14); border: 1px solid var(--tot); }
.tb.loi { background: rgba(192,57,43,.2); border: 1px solid var(--xau); }
.tb.cho { background: rgba(72,152,201,.16); border: 1px solid var(--bm-duong); }
.canh-do { background: rgba(192,57,43,.22); border: 1.5px solid var(--xau); border-radius: 12px; padding: 12px; margin: 10px 0; }
.canh-vang { background: rgba(242,184,75,.14); border: 1.5px solid var(--canh); border-radius: 12px; padding: 12px; margin: 10px 0; }
.nhan { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.nhan::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.n-tot { color: var(--tot); } .n-canh { color: var(--canh); } .n-xau { color: var(--xau); } .n-tt { color: var(--bm-duong); } .n-xam { color: var(--chu-phu); }
.doan { border-top: 1px dashed #2c4d73; padding: 8px 0; }
.doan:first-child { border-top: 0; }
.dieu-huong { position: fixed; left: 0; right: 0; bottom: 0; background: #06172A; border-top: 1px solid #22476e; display: flex; justify-content: center; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 5; }
.dieu-huong .trong { display: flex; gap: 6px; width: 100%; max-width: 560px; }
.dieu-huong button { flex: 1; border: 0; background: transparent; font-size: 13px; padding: 8px 2px; position: relative; }
.dieu-huong button[aria-current="page"] { color: var(--bm-cam); font-weight: 700; }
.cham-do { position: absolute; top: 2px; right: 18%; background: var(--bm-do); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; }
.dong { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #1d3e62; }
.dong:last-child { border-bottom: 0; }
.chon-khoang { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chon-khoang button { padding: 6px 10px; font-size: 14px; border-width: 1px; }
.chon-khoang button[aria-pressed="true"] { background: var(--bm-duong); color: var(--bm-muc); font-weight: 700; }
.trong-rong { color: var(--chu-phu); font-style: italic; font-size: 14px; }
.dang-nhap { max-width: 380px; margin: 8vh auto 0; }
.ca-nghi label { display: flex; gap: 8px; align-items: center; color: var(--chu); font-size: 15px; margin: 6px 0; }
.ca-nghi input { width: auto; margin: 0; }
/* ---- trang quản lý ---- */
.bo-cuc { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.menu { position: sticky; top: 12px; align-self: start; display: flex; flex-direction: column; gap: 6px; }
.menu button { text-align: left; border-width: 1px; }
.menu button[aria-current="page"] { background: var(--bm-navy); border-color: var(--bm-cam); font-weight: 700; }
.bang { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.bang th, .bang td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #1d3e62; vertical-align: top; }
.bang th { color: var(--chu-phu); font-weight: 600; font-size: 13px; }
.bang tr.bam { cursor: pointer; }
.bang tr.bam:hover td { background: #0f2c4c; }
.tong-quan { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.o-so { background: var(--the); border: 1px solid #22476e; border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.o-so .gt { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.phu-nen { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; z-index: 20; overflow: auto; }
.phu-nen .hop { max-width: 720px; width: 100%; background: var(--nen); }
.hang { display: flex; gap: 8px; flex-wrap: wrap; }
.hang > * { flex: 1; min-width: 140px; }
.gach { text-decoration: line-through; color: var(--chu-phu); }
@media (max-width: 820px) {
  .bo-cuc { grid-template-columns: 1fr; }
  /* Menu: các nút nhỏ xuống dòng, thấy hết 10 mục, không phải vuốt ngang */
  .menu { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .menu button { white-space: nowrap; padding: 7px 11px; font-size: 14px; }
  .an-hep { display: none; }
}
/* ---- Điện thoại: đầu trang gọn, bảng thành thẻ, form một cột ---- */
@media (max-width: 640px) {
  body { padding: 10px 12px 72px; }
  .dau-trang h1 { font-size: 16px; letter-spacing: .3px; }
  .dau-trang .phu { font-size: 12.5px; }
  .dau-trang button.nho { padding: 5px 9px; font-size: 13px; white-space: nowrap; flex: 0 0 auto; }
  h2 { font-size: 17px; }
  .the { padding: 12px; }
  /* Bảng -> mỗi dòng là một thẻ; nhãn cột hiện bên trái giá trị (gắn bằng app-ql.js: data-nhan) */
  .bang thead { display: none; }
  .bang, .bang tbody, .bang tr, .bang td { display: block; width: 100%; }
  .bang tr { padding: 10px 0; border-bottom: 1px solid #1d3e62; }
  .bang tr:last-child { border-bottom: 0; }
  .bang td { border: 0; padding: 3px 0; }
  .bang td[data-nhan] { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; text-align: right; }
  .bang td[data-nhan]::before { content: attr(data-nhan); color: var(--chu-phu); font-size: 13px; text-align: left; flex: 0 0 auto; max-width: 45%; }
  .bang td:first-child { font-size: 15.5px; padding-bottom: 6px; }
  .bang td:empty { display: none; }
  .tong-quan { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .o-so { padding: 8px 10px; }
  .o-so .gt { font-size: 20px; }
  .o-so .phu { font-size: 12.5px; }
  /* Form trong hộp nổi: mỗi ô một dòng (không ép 2 cột) */
  .phu-nen .hang > div { flex-basis: 100%; }
  .phu-nen { padding: 3vh 8px; }
  .hop { padding: 12px; }
}
