
/* Styles */

/* ===== Giao diện "247 Nhà đầu tư": điện thoại trước (máy tính dùng được), đỏ 247, chữ ≥ 16px, nút ≥ 44px. ===== */
:root {
  --do: #c8102e; --do-dam: #a00d25; --do-nhat: #fdecef; --vang-vien: #ffc61a;
  --chu: #1d1d1f; --chu-phu: #5f6368; --chu-mo: #80868b; --vien: #e3e3e6; --nen: #f6f6f7; --the: #ffffff;
  --xanh: #1e7e34; --xanh-nen: #e6f4ea; --vang: #8a5a00; --vang-nen: #fff4d6; --lam: #1a56a6; --lam-nen: #e8f0fe; --xam: #5f6368; --xam-nen: #eeeff1;
  --bo: 14px; --cao-nut: 44px; --day-duoi: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--chu); background: var(--nen); -webkit-text-size-adjust: 100%; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 20px 0 10px; }
a { color: var(--do); }
button, input, select, textarea { font: inherit; }
.boot, .dang-tai { padding: 40px 16px; text-align: center; color: var(--chu-phu); }
.o-loi { margin: 16px; padding: 12px 14px; border-radius: var(--bo); background: var(--do-nhat); color: var(--do-dam); }

/* Khung: thanh trên + nội dung + thanh dưới 4 mục */
.thanh-tren { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--do); color: #fff; }
.thanh-tren img { width: 32px; height: 32px; }
.thanh-tren .tieu-de { flex: 1; font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nut-chuong { position: relative; min-width: var(--cao-nut); min-height: var(--cao-nut); border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 22px; cursor: pointer; }
.nut-chuong .so { position: absolute; top: 4px; right: 2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--vang-vien); color: var(--chu); font-size: 12px; font-weight: 700; line-height: 20px; }
.noi-dung { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(96px + var(--day-duoi)); }
.thanh-duoi { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; background: var(--the); border-top: 1px solid var(--vien); padding-bottom: var(--day-duoi); }
.thanh-duoi a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; color: var(--chu-phu); text-decoration: none; font-size: 13px; }
.thanh-duoi a .bt { font-size: 20px; line-height: 1.2; }
.thanh-duoi a.dang { color: var(--do); font-weight: 700; }

/* Thẻ, ô số, danh sách */
.the-trang { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo); padding: 14px 16px; margin-bottom: 12px; }
.the-bam { cursor: pointer; display: block; width: 100%; text-align: left; color: inherit; font: inherit; }
.the-bam:active { background: var(--nen); }
.o-so { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.o-so .the-trang { margin: 0; }
.o-so .nhan { color: var(--chu-phu); font-size: 14px; }
.o-so .gia-tri { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.o-so .lon { grid-column: 1 / -1; }
.o-so .lon .gia-tri { font-size: 28px; color: var(--do); }
.dong-tt { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--vien); }
.dong-tt:last-child { border-bottom: 0; }
.dong-tt .nhan { color: var(--chu-phu); }
.dong-tt .gt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dong-tt.dai .gt { white-space: normal; word-break: break-word; }
.phu { color: var(--chu-phu); font-size: 14px; }
.loi-nhan { white-space: pre-line; margin: 6px 0 0; }
.mo-ta { color: var(--chu-phu); margin: 0 0 12px; }
.the { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.the.xanh { background: var(--xanh-nen); color: var(--xanh); }
.the.vang { background: var(--vang-nen); color: var(--vang); }
.the.lam { background: var(--lam-nen); color: var(--lam); }
.the.xam { background: var(--xam-nen); color: var(--xam); }
.hang { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Kỳ trả lãi */
.ky { padding: 12px 0; border-bottom: 1px solid var(--vien); }
.ky:last-child { border-bottom: 0; }
.ky .tien { font-weight: 700; font-variant-numeric: tabular-nums; }
.ky .chi-tiet { color: var(--chu-phu); font-size: 14px; margin-top: 4px; }
.ky .nut-xn { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* Nút + ô nhập */
.nut { min-height: var(--cao-nut); padding: 10px 18px; border: 1px solid var(--vien); border-radius: 12px; background: var(--the); color: var(--chu); font-weight: 600; cursor: pointer; }
.nut.chinh { background: var(--do); border-color: var(--do); color: #fff; }
.nut.vien-do { border-color: var(--do); color: var(--do); }
.nut.nho { min-height: 40px; padding: 6px 14px; font-size: 15px; }
.nut.rong { width: 100%; }
.nut:disabled { opacity: .55; cursor: default; }
.nhom-nut { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.nhom-nut .nut { flex: 1; }
.nhom-nut.sat { margin: 0; flex-wrap: nowrap; }
.nhom-nut.sat .nut { flex: 0 0 auto; }
.o-nhap { margin-bottom: 14px; }
.o-nhap label { display: block; font-weight: 600; margin-bottom: 6px; }
.o-nhap input, .o-nhap select, .o-nhap textarea { width: 100%; min-height: var(--cao-nut); padding: 10px 12px; border: 1px solid var(--vien); border-radius: 12px; background: #fff; font-size: 16px; }
.o-nhap textarea { min-height: 96px; resize: vertical; }
.o-nhap .goi-y { color: var(--chu-phu); font-size: 14px; margin-top: 4px; }
.chon-khoan label { display: flex; align-items: center; gap: 10px; min-height: var(--cao-nut); font-weight: 400; }
.chon-khoan input { width: 22px; height: 22px; min-height: 0; }

/* Màn chào / khoá / mời */
.man-chao { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; text-align: center; background: var(--the); }
.man-chao img.logo { width: 96px; height: 96px; margin-bottom: 16px; }
.man-chao h1 { font-size: 24px; }
.man-chao p { max-width: 420px; color: var(--chu-phu); }
.man-chao .nut { min-width: 260px; margin-top: 12px; }
.buoc { text-align: left; max-width: 420px; margin: 8px auto; padding-left: 22px; }
.buoc li { margin: 6px 0; }

/* Biểu đồ cột công ty (1 chuỗi: không chú giải, tiêu đề gọi tên) */
.bieu-do svg { width: 100%; height: auto; display: block; }
.bieu-do .luoi { stroke: var(--vien); stroke-width: 1; }
.bieu-do .truc { fill: var(--chu-mo); font-size: 11px; }
.bieu-do .cot { fill: var(--do); }
.bieu-do .cot.chon { fill: var(--do-dam); }
.bieu-do .nhan-cot { fill: var(--chu); font-size: 12px; font-weight: 700; }
.bieu-do .vung-bam { fill: transparent; cursor: pointer; }
.bieu-do .goi-y-cot { min-height: 24px; margin-top: 6px; color: var(--chu-phu); font-size: 14px; }
table.bang { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.bang { font-size: 15px; }
table.bang th, table.bang td { padding: 8px 4px; border-bottom: 1px solid var(--vien); text-align: right; white-space: nowrap; }
table.bang th:first-child, table.bang td:first-child { text-align: left; }
table.bang th { color: var(--chu-phu); font-weight: 600; font-size: 14px; }

/* Thông báo, hộp, toast */
.tb { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--vien); background: var(--the); color: inherit; cursor: pointer; }
.tb.moi { background: var(--do-nhat); }
.tb .tieu { font-weight: 700; }
.modal-bg { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .4); }
.modal { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; padding: 18px 16px calc(16px + var(--day-duoi)); border-radius: 18px 18px 0 0; background: var(--the); }
.modal h2 { margin-top: 0; }
.modal-nut { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-nut .nut { flex: 1; }
#toasts { position: fixed; left: 16px; right: 16px; bottom: calc(76px + var(--day-duoi)); z-index: 30; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { max-width: 480px; padding: 10px 16px; border-radius: 12px; background: #323232; color: #fff; }
.toast.loi { background: var(--do-dam); }
.toast.ok { background: var(--xanh); }
@media (min-width: 760px) { .modal-bg { align-items: center; } .modal { border-radius: 18px; } }

/* In bản kê lãi năm: chỉ phần bản kê, không thanh / nút */
@media print {
  body { background: #fff; }
  .thanh-tren, .thanh-duoi, .khong-in, #toasts { display: none !important; }
  .noi-dung { padding: 0; max-width: none; }
  .the-trang { border: 0; padding: 0; }
}
