/* Tính giá TMĐT — khung base copy y hệt trang chuẩn (giao-hang.css) để font/nút/input
   giống hệt web hiện tại. Phần tg-* bên dưới là style riêng của trang này, nhưng
   dùng chung bảng màu của web: viền #e9e4e9, chữ mờ #6e6774, nhấn đỏ #c8102e. */

*{box-sizing:border-box}
body{margin:0;font-family:'Be Vietnam Pro',sans-serif;font-size:14px;color:#232323;line-height:1.5}
button,input,select,textarea{font:inherit}button{cursor:pointer}[hidden]{display:none!important}
a{color:#b7102b;text-decoration:none}h1,h2,h3,p{margin:0}
.appnav,.navtab,.navuser{display:flex}.navtab{align-items:center;text-decoration:none}.applogo{text-decoration:none}
.page-tinhgia .workspace-main{padding:26px 24px;min-height:100vh}
.masthead{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap}
.page-tinhgia .brand h1{font-size:clamp(23px,2.3vw,34px);font-weight:800}
.brand p{margin-top:4px;color:#77717a}
.header-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.button{border-radius:7px;min-height:38px;padding:8px 14px;background:#fff;color:#b7102b;border:1px solid #eed5da;font-weight:500}
.button:hover{background:#fff2f4}.button.primary{background:#c8102e;color:#fff;border-color:#c8102e}
.button:disabled{opacity:.45;cursor:not-allowed}.nho-nut{min-height:32px;padding:5px 10px;font-size:12px}
input,select{min-height:38px;padding:8px 10px;border:1px solid #e0dce2;border-radius:7px;background:#fff;color:#303038;max-width:100%;width:100%}
.notice{background:#f8f5fa;color:#62596a;border:1px solid #ebe5ef;border-radius:7px;padding:9px 13px;font-size:12px;margin:14px 0 10px}
.notice.error{background:#fff2f3;border-color:#f3c5cf;color:#a01026}

/* ---------- Khung 2 cột ---------- */
.tg-luoi{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:start}
.tg-cot{display:flex;flex-direction:column;gap:14px;min-width:0}

.tg-the{background:#fff;border:1px solid #e9e4e9;border-radius:10px;padding:16px 18px;min-width:0}
.tg-tieude{margin:0 0 13px;border-left:4px solid #c8102e;padding-left:12px;font-size:16px;font-weight:800;letter-spacing:-.3px;color:#2d2833}
.tg-tieude em{font-style:normal;font-size:11px;font-weight:600;color:#8a8290}
.tg-tieude-phu{font-size:15px}
.tg-dau-the{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}
.tg-dau-the .tg-tieude{margin:0}
.tg-nhan-phu{font-size:11px;color:#8a8290}

/* ---------- Ô nhập ---------- */
.tg-luoi-o{display:grid;gap:10px}
.tg-5cot{grid-template-columns:repeat(5,minmax(0,1fr))}
.tg-6cot{grid-template-columns:repeat(6,minmax(0,1fr))}
.tg-o label{display:block;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;color:#8a8290;margin-bottom:4px;white-space:nowrap}
.tg-o input,.tg-o select{font-size:13px;font-weight:600;text-align:right}
.tg-o select{text-align:left}
.tg-o input:focus,.tg-o select:focus,.tg-tim-nganh input:focus{outline:none;border-color:#c8102e;box-shadow:0 0 0 3px #C8102E14}
.tg-khung-pt{position:relative}
.tg-khung-pt span{position:absolute;right:9px;top:50%;transform:translateY(-50%);font-size:11px;color:#8a8290;pointer-events:none}
.tg-khung-pt input{padding-right:22px}

/* Tìm ngành hàng */
.tg-tim-nganh{position:relative}
.tg-tim-nganh input{width:100%;padding:10px 13px;font-size:13px}
.tg-dropdown{position:absolute;z-index:30;top:calc(100% + 4px);left:0;right:0;background:#fff;border:1px solid #e9e4e9;border-radius:10px;box-shadow:0 12px 34px #3D172221;max-height:340px;overflow-y:auto}
.tg-muc-nganh{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:9px 12px;font-size:12px;border-bottom:1px solid #f0ecf1;cursor:pointer}
.tg-muc-nganh:last-child{border-bottom:0}
.tg-muc-nganh:hover{background:#fdf4f6}
.tg-muc-nganh .tg-ten-nganh{flex:1;color:#2f2b35}
.tg-phi-nganh{display:flex;gap:6px;font-size:10px;font-weight:700;white-space:nowrap}
.tg-phi-nganh span{padding:2px 7px;border-radius:6px}
.tg-phi-nbh{background:#eef2ff;color:#3b4ac2}
.tg-phi-mall{background:#f5ecff;color:#7b3fd0}
.tg-dropdown .tg-trong{padding:14px;font-size:12px;color:#8a8290}
.tg-nganh-chon{margin-top:8px;padding:8px 12px;background:#fcecef;border:1px solid #f3c5cf;color:#b7102b;border-radius:8px;font-size:12px;font-weight:600}
.tg-nganh-chon::before{content:'✓ ';font-weight:800}

/* Giá vốn / Giá bán — hai ô quan trọng nhất phía nhập */
.tg-doi-gia{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}
.tg-o-gia label{display:block;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:#8a8290;margin-bottom:5px}
.tg-khung-tien{position:relative}
.tg-khung-tien input{width:100%;border:1.5px solid #e0dce2;border-radius:9px;padding:11px 30px 11px 14px;font-size:20px;font-weight:800;color:#2d2833;text-align:right}
.tg-khung-tien span{position:absolute;right:13px;top:50%;transform:translateY(-50%);font-size:13px;font-weight:700;color:#8a8290;pointer-events:none}
.tg-gia-ban label{color:#b7102b}
.tg-gia-ban .tg-khung-tien input{border-color:#C8102E55}

/* ---------- Thẻ LNR chính ---------- */
/* Viền trái 4px đổi màu theo mức lãi — cùng pattern .the-so-nho của web. */
.tg-the-lnr{border-left:4px solid #d8d3da}
.tg-the-lnr.tg-tot{border-left-color:#15803d}
.tg-the-lnr.tg-mong{border-left-color:#b45309}
.tg-the-lnr.tg-sat{border-left-color:#8a6d1d}
.tg-the-lnr.tg-lo{border-left-color:#c8102e;background:#fffafb}
.tg-lnr-dau{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:6px}
.tg-nhan{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.8px;color:#8a8290}
.tg-badge{font-size:11px;font-weight:800;padding:4px 11px;border-radius:999px;text-transform:uppercase;letter-spacing:.4px}
.tg-badge.tg-tot{background:#e4f4ea;color:#15803d}
.tg-badge.tg-mong{background:#fdf0dd;color:#b45309}
.tg-badge.tg-sat{background:#f6f0d8;color:#8a6d1d}
.tg-badge.tg-lo{background:#fcecef;color:#b7102b}
.tg-lnr-so-wrap{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.tg-lnr-so{font-size:clamp(32px,4.5vw,44px);font-weight:800;letter-spacing:-1px;line-height:1.05;color:#2d2833}
.tg-lnr-pt{font-size:18px;font-weight:700;color:#6e6774}
.tg-lnr-so.tg-tot,.tg-lnr-pt.tg-tot{color:#15803d}
.tg-lnr-so.tg-mong,.tg-lnr-pt.tg-mong{color:#b45309}
.tg-lnr-so.tg-sat,.tg-lnr-pt.tg-sat{color:#8a6d1d}
.tg-lnr-so.tg-lo,.tg-lnr-pt.tg-lo{color:#c8102e}

.tg-tomtat{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:15px}
.tg-o-tomtat{border:1px solid #e9e4e9;border-radius:9px;padding:9px 12px;background:#fdfcfd}
.tg-tt-nhan{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.5px;color:#8a8290}
.tg-tt-so{font-size:15px;font-weight:800;margin-top:3px;color:#2d2833}
.tg-tt-pt{font-size:10px;font-weight:600;color:#8a8290}
.tg-o-tomtat.tg-tot{background:#f0f9f3;border-color:#bfe6cd}
.tg-o-tomtat.tg-tot .tg-tt-nhan,.tg-o-tomtat.tg-tot .tg-tt-so,.tg-o-tomtat.tg-tot .tg-tt-pt{color:#15803d}
.tg-o-tomtat.tg-lo{background:#fcecef;border-color:#f3c5cf}
.tg-o-tomtat.tg-lo .tg-tt-nhan,.tg-o-tomtat.tg-lo .tg-tt-so,.tg-o-tomtat.tg-lo .tg-tt-pt{color:#b7102b}

/* ---------- Breakdown ---------- */
.tg-dong{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:7px 0;font-size:13px}
.tg-dong .tg-dong-trai{display:flex;align-items:center;gap:8px;color:#2f2b35;min-width:0}
.tg-dong .tg-dong-phai{font-weight:700;white-space:nowrap}
.tg-dong .tg-tri-am{color:#b7102b;font-weight:600}
.tg-dong .tg-chip-pt{font-size:10px;font-weight:700;padding:1.5px 6px;border-radius:5px;background:#f4f1f4;color:#6e6774;flex:none}
.tg-dong .tg-chip-pt.tg-tot{background:#e4f4ea;color:#15803d}
.tg-dong .tg-chip-pt.tg-mong{background:#fdf0dd;color:#b45309}
.tg-dong .tg-chip-pt.tg-lo{background:#fcecef;color:#b7102b}
.tg-dong.tg-dong-gop{margin:6px 0;padding:9px 10px;background:#fdfcfd;border:1px solid #e9e4e9;border-radius:9px}
.tg-dong.tg-dong-gop .tg-dong-trai{font-weight:800}
.tg-cham{width:8px;height:8px;border-radius:50%;display:inline-block;flex:none}
.tg-nhom{font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.6px;color:#8a8290;margin:12px 0 4px;padding-top:10px;border-top:1px dashed #e0dce2}
.tg-nhom:first-child{border-top:0;padding-top:0;margin-top:6px}
.tg-m-tot{background:#2f9e5f}
.tg-m-mong{background:#e08a1e}
.tg-m-sat{background:#b3a24a}
.tg-m-lo{background:#c8102e}
.tg-m-nhat{background:#d6d0d6}
.tg-m-san{background:#8a93c9}

/* ---------- Kịch bản nhanh ---------- */
.tg-kich-ban{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.tg-kb{border:1px solid #e9e4e9;border-radius:9px;padding:10px 12px;background:#fff}
.tg-kb .tg-kb-ten{display:flex;align-items:center;gap:7px;font-size:12.5px;font-weight:800;color:#2f2b35}
.tg-kb .tg-kb-sub{font-size:10.5px;color:#8a8290;margin:3px 0 7px}
.tg-kb .tg-kb-so{font-size:15px;font-weight:800}
.tg-kb .tg-kb-pt{font-size:10.5px;font-weight:700;margin-top:2px}
.tg-kb.tg-tot{background:#f0f9f3;border-color:#bfe6cd}
.tg-kb.tg-tot .tg-kb-so,.tg-kb.tg-tot .tg-kb-pt{color:#15803d}
.tg-kb.tg-mong{background:#fdf6ec;border-color:#ecd3ac}
.tg-kb.tg-mong .tg-kb-so,.tg-kb.tg-mong .tg-kb-pt{color:#b45309}
.tg-kb.tg-sat{background:#faf7ec;border-color:#e0d7a8}
.tg-kb.tg-sat .tg-kb-so,.tg-kb.tg-sat .tg-kb-pt{color:#8a6d1d}
.tg-kb.tg-lo{background:#fcecef;border-color:#f3c5cf}
.tg-kb.tg-lo .tg-kb-so,.tg-kb.tg-lo .tg-kb-pt{color:#b7102b}
.tg-kb-lo-tag{font-size:9px;font-weight:800;background:#c8102e;color:#fff;padding:1px 6px;border-radius:5px;margin-left:5px;vertical-align:2px}
.tg-chu-thich{display:flex;gap:14px;flex-wrap:wrap;margin-top:11px;font-size:10.5px;color:#8a8290}
.tg-chu-thich span{display:flex;align-items:center;gap:5px}

/* ---------- Trợ lý phân tích ---------- */
.tg-advisor{display:flex;flex-direction:column;gap:9px}
.tg-goi-y{display:flex;gap:11px;border:1px solid #e9e4e9;border-radius:10px;padding:11px 13px;background:#fdfcfd}
.tg-goi-y .tg-gy-icon{width:34px;height:34px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:16px;flex:none;background:#f4f1f4}
.tg-goi-y h4{margin:0 0 3px;font-size:13px;color:#2f2b35}
.tg-goi-y p{margin:0;font-size:12px;line-height:1.55;color:#6e6774}
.tg-goi-y .tg-gy-tag{font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.4px;color:#fff;padding:2px 7px;border-radius:5px;vertical-align:1px;margin-left:6px}
.tg-goi-y.tg-nguy{background:#fcecef;border-color:#f3c5cf}
.tg-goi-y.tg-nguy .tg-gy-icon{background:#f8d7dd}
.tg-goi-y.tg-nguy .tg-gy-tag{background:#c8102e}
.tg-goi-y.tg-canh{background:#fdf6ec;border-color:#ecd3ac}
.tg-goi-y.tg-canh .tg-gy-icon{background:#f9e5c4}
.tg-goi-y.tg-canh .tg-gy-tag{background:#b45309}
.tg-goi-y.tg-ok{background:#f0f9f3;border-color:#bfe6cd}
.tg-goi-y.tg-ok .tg-gy-icon{background:#d3eedd}
.tg-goi-y.tg-ok .tg-gy-tag{background:#15803d}
.tg-goi-y.tg-tin{background:#eef1fb;border-color:#ccd4f0}
.tg-goi-y.tg-tin .tg-gy-icon{background:#dfe5f7}
.tg-goi-y.tg-tin .tg-gy-tag{background:#3b4ac2}

/* ---------- Mobile ---------- */
@media (max-width:1100px){
  .tg-6cot{grid-template-columns:repeat(3,minmax(0,1fr))}
  .tg-5cot{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:900px){
  .tg-luoi{grid-template-columns:1fr}
}
@media (max-width:640px){
  .tg-the{padding:14px}
  .tg-6cot,.tg-5cot{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tg-kich-ban{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tg-tomtat{grid-template-columns:1fr 1fr}
  .tg-tomtat .tg-o-tomtat:last-child{grid-column:1/-1}
  .tg-khung-tien input{font-size:17px}
  .tg-o input,.tg-o select{min-height:42px}
}
