:root{--bg:#f6f7f5;--card:#fff;--line:#e3e6e1;--text:#1d221f;--muted:#6b736d;--green:#1f6f43;--green-2:#e6f2ea;--red:#b3261e;--red-2:#fdecea;--amber:#9a6700;--amber-2:#fff4d6;--blue:#1d4ed8;--blue-2:#e8efff;--radius:10px}
[hidden]{display:none!important}*{box-sizing:border-box}html,body{margin:0;background:var(--bg);color:var(--text);font:15px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
a{color:var(--green);text-decoration:none}button{font:inherit;cursor:pointer}input,select,textarea{font:inherit}
.center{display:flex;align-items:center;justify-content:center;min-height:60vh}.muted{color:var(--muted)}.small{font-size:13px}.mono{font-family:ui-monospace,Menlo,monospace}
.top{position:sticky;top:0;z-index:5;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:6px;padding:8px 16px;flex-wrap:wrap}
.top .brand{font-weight:800;color:var(--green);letter-spacing:.5px;margin-right:12px}
.top nav{display:flex;gap:2px;flex-wrap:wrap}.top nav a{padding:7px 12px;border-radius:8px;color:var(--text);font-weight:600;font-size:13px;letter-spacing:.4px}.top nav a.on{background:var(--green-2);color:var(--green)}
.top .sp{flex:1}.top .who{font-size:13px;color:var(--muted)}.top input.search{padding:6px 10px;border:1px solid var(--line);border-radius:8px;width:180px}
main{max-width:1240px;margin:0 auto;padding:18px 16px 40px}
body.has-kathy #app{width:calc(100% - var(--kw,50vw) - 28px);min-width:0}
h1{font-size:22px;margin:0 0 4px}h2{font-size:15px;text-transform:uppercase;letter-spacing:.6px;color:var(--muted);margin:22px 0 10px}h3{font-size:15px;margin:0 0 6px}
.q{font-size:18px;font-weight:700;color:var(--green);margin:0 0 14px}
.grid{display:grid;gap:12px}.g2{grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}.g3{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px}
.card.p0{border-left:4px solid var(--red)}.card.p1{border-left:4px solid var(--amber)}.card.p2{border-left:4px solid var(--blue)}.card.p3{border-left:4px solid var(--line)}
.card .what{font-weight:700;font-size:15px}.card .why{color:var(--muted);margin:3px 0 8px}.card .meta{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:13px;color:var(--muted)}.card .meta b{color:var(--text);font-weight:600}
.card .next{margin-top:8px;font-size:14px}.card .next b{color:var(--green)}
.cta{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.btn{border:1px solid var(--line);background:#fff;border-radius:8px;padding:6px 11px;font-size:13px;font-weight:600;color:var(--text)}.btn:hover{border-color:#b9c0b8}.btn.pri{background:var(--green);border-color:var(--green);color:#fff}.btn.danger{color:var(--red)}.btn.sm{padding:3px 8px;font-size:12px}.btn.ghost{border-color:transparent;background:transparent}
.badge{display:inline-block;padding:2px 7px;border-radius:6px;font-size:11px;font-weight:700;letter-spacing:.3px}.badge.p0{background:var(--red-2);color:var(--red)}.badge.p1{background:var(--amber-2);color:var(--amber)}.badge.p2{background:var(--blue-2);color:var(--blue)}.badge.p3,.badge.gray{background:#eef0ed;color:var(--muted)}.badge.ok{background:var(--green-2);color:var(--green)}.badge.bad{background:var(--red-2);color:var(--red)}.badge.warn{background:var(--amber-2);color:var(--amber)}
.kpis{display:flex;gap:10px;flex-wrap:wrap;margin:8px 0 4px}.kpi{background:#fff;border:1px solid var(--line);border-radius:8px;padding:8px 12px;min-width:120px}.kpi .v{font-size:20px;font-weight:800}.kpi .l{font-size:12px;color:var(--muted)}
table{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;font-size:14px}th,td{padding:8px 10px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top}th{font-size:12px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);background:#fafbf9}tr:last-child td{border-bottom:0}tr.row:hover td{background:#f8faf7;cursor:pointer}td.r,th.r{text-align:right}
.tabs{display:flex;gap:4px;flex-wrap:wrap;margin-bottom:12px}.tabs a{padding:6px 11px;border-radius:8px;font-size:13px;font-weight:600;color:var(--muted);border:1px solid transparent}.tabs a.on{background:#fff;border-color:var(--line);color:var(--text)}
.bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:6px 0 12px}
.list{margin:0;padding:0;list-style:none}.list li{padding:8px 0;border-bottom:1px solid var(--line)}.list li:last-child{border-bottom:0}.list .t{font-weight:600}.list .s{color:var(--muted);font-size:13px}
.empty{color:var(--muted);padding:14px;text-align:center;border:1px dashed var(--line);border-radius:var(--radius);background:#fff}
.modal{position:fixed;inset:0;background:rgba(20,25,22,.45);display:flex;align-items:flex-start;justify-content:center;padding:40px 12px;overflow:auto;z-index:20}.modal .box{background:#fff;border-radius:12px;max-width:640px;width:100%;padding:18px 20px;box-shadow:0 20px 60px rgba(0,0,0,.25)}.modal h3{margin-bottom:12px}
.form{display:grid;grid-template-columns:1fr 1fr;gap:10px 14px}.form label{display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--muted);font-weight:600}.form label.w{grid-column:1/-1}.form input,.form select,.form textarea{padding:7px 9px;border:1px solid var(--line);border-radius:7px;font-size:14px;color:var(--text);background:#fff}.form textarea{min-height:64px}.form .acts{grid-column:1/-1;display:flex;gap:8px;justify-content:flex-end;margin-top:6px}
.login{max-width:380px;margin:80px auto;background:#fff;border:1px solid var(--line);border-radius:14px;padding:26px}.login h1{color:var(--green)}.login input{width:100%;padding:10px;border:1px solid var(--line);border-radius:8px;margin:6px 0 12px}.login .btn{width:100%;padding:10px}
/* ===== KHUNG CHAT KATHY — thiết kế đồng bộ Kathy SBH (chế độ tối DeepSeek, anh Tiền chốt 31/08/2026):
   nền #1E1E1E · viền #34343A · chữ #E6E6EA · phụ #8A8A93 · người gửi bong bóng than #2F3033 · Kathy chữ trơn không khung ·
   nút gửi tròn xanh #4D6BFE · ô nhập nhiều dòng, Enter 2 lần để gửi · chip gợi ý viên thuốc. */
.kathy{position:fixed;right:14px;top:14px;bottom:14px;width:var(--kw,50vw);max-width:calc(100vw - 28px);background:#1E1E1E;color:#E6E6EA;border:1px solid #34343A;border-radius:16px;overflow:hidden;box-shadow:0 6px 28px rgba(0,0,0,.22);display:flex;flex-direction:column;z-index:15;font-size:14px}
.kathy.drag{user-select:none}
.kathy .grip{position:absolute;left:-5px;top:0;bottom:0;width:11px;cursor:col-resize;z-index:2}.kathy .grip::after{content:"";position:absolute;left:4px;top:50%;height:44px;width:4px;margin-top:-22px;border-radius:999px;background:#3A3A41}.kathy .grip:hover::after,.kathy.drag .grip::after{background:#4D6BFE}
.kathy .zone-head{display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid #34343A;background:#1E1E1E;min-height:48px}.kathy .zone-head .thu{display:none}
.kathy .zone-head h2{margin:0;font-size:15px;font-weight:650;color:#F5F5F5;letter-spacing:.02em}.kathy .ico{border:0;background:transparent;color:#8A8A93;font-size:20px;line-height:1;width:32px;height:32px;border-radius:8px;cursor:pointer;display:grid;place-items:center}.kathy .ico:hover{background:#2F2F33;color:#F5F5F5}
.kathy .conv{position:absolute;left:0;top:48px;bottom:0;width:min(300px,100%);background:#232327;border-right:1px solid #34343A;z-index:3;display:flex;flex-direction:column}.kathy .conv h4{margin:0;padding:10px 14px;font-size:11px;letter-spacing:.06em;color:#8A8A93;text-transform:uppercase}.kathy .conv ul{list-style:none;margin:0;padding:0 6px;overflow-y:auto;flex:1}.kathy .conv li{padding:8px 10px;border-radius:8px;cursor:pointer;display:flex;gap:6px;align-items:center;color:#DEDEDE;font-size:13px}.kathy .conv li:hover,.kathy .conv li.on{background:#2F2F33}.kathy .conv li .t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kathy .conv li .d{font-size:10px;color:#8A8A93;white-space:nowrap}.kathy .conv li .x{color:#8A8A93;font-size:14px;padding:0 2px}.kathy .conv li .x:hover{color:#ff6b6b}.kathy .conv .empty{color:#8A8A93;padding:14px;text-align:center;border:0;background:transparent}.kathy .zone-head .zone-slogan{font-size:11px;color:#8A8A93}
.kathy .sizes{display:flex;gap:4px;margin-left:auto}.kathy .sizes button{border:1px solid #3A3A41;background:#232327;border-radius:8px;padding:3px 8px;font-size:12px;color:#DEDEDE;cursor:pointer}.kathy .sizes button:hover{border-color:#4D6BFE;color:#7B93FF}.kathy .sizes button.on{background:#243052;color:#7B93FF;border-color:#2E3A5C}
.kathy .ctx-bar{display:flex;align-items:center;gap:6px;padding:4px 14px;min-height:26px;border-bottom:1px solid #34343A;background:#232327;font-size:10.5px;color:#8A8A93;flex-wrap:wrap}.kathy .ctx-chip{background:#243052;color:#7B93FF;border:1px solid #2E3A5C;border-radius:999px;padding:1px 8px}
.kathy .zone-head,.kathy .ctx-bar,.kathy .goi-y-row,.kathy .chat-form,.kathy .chat-trace{flex:0 0 auto}
.kathy .goi-y-row{display:flex;flex-wrap:wrap;gap:6px;padding:8px 14px 4px;max-height:96px;overflow-y:auto}.kathy .goi-y-row:empty{display:none}.kathy .goi-y-chip{border:1px solid #3A3A41;background:#232327;color:#DEDEDE;border-radius:999px;padding:6px 12px;font-size:12px;cursor:pointer}.kathy .goi-y-chip:hover{border-color:#4D6BFE;color:#7B93FF}
.kathy .chat-list{flex:1 1 auto;min-height:0;overflow-y:auto;padding:12px 14px;display:flex;flex-direction:column;gap:10px;background:#1E1E1E}
.kathy .chat-message{display:flex;gap:8px}.kathy .chat-message.from-user{flex-direction:row-reverse}
.kathy .chat-avatar{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font-size:11px;font-weight:700;flex:0 0 auto}.kathy .from-user .chat-avatar{background:#4D6BFE;color:#fff}.kathy .from-system .chat-avatar{background:#2A3A66;color:#7B93FF}
.kathy .chat-bubble{max-width:84%;min-width:0}.kathy .from-user .chat-bubble{text-align:right}.kathy .from-system .chat-bubble{max-width:100%}
.kathy .chat-sender{font-size:11px;color:#8A8A93;margin-bottom:2px}
.kathy .chat-text{display:inline-block;margin:0;padding:8px 12px;font-size:13.5px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55;text-align:left}
.kathy .from-user .chat-text{background:#2F3033;color:#F5F5F5;border-radius:16px 16px 16px 6px}
.kathy .from-system .chat-text{background:transparent;padding:2px 0;color:#E6E6EA;display:block}.kathy .from-system .chat-bubble{max-width:100%;flex:1}
.kathy .chat-text b{color:#F5F5F5;font-weight:650}.kathy .chat-text code{background:#2F2F33;padding:0 4px;border-radius:4px;font-size:12.5px}
.kathy .kathy-dang-soan{color:#8A8A93}.kathy .kds-sec{color:#7B93FF;font-variant-numeric:tabular-nums;margin-left:4px}.kathy .kds-chu::after{content:'…';display:inline-block;overflow:hidden;vertical-align:bottom;animation:kathy-cham 1.2s steps(4,end) infinite;width:0}@keyframes kathy-cham{to{width:1.2em}}
.kathy .msg-acts{display:flex;gap:4px;margin-top:6px}.kathy .msg-acts.u{justify-content:flex-end}.kathy .msg-acts button{border:0;background:transparent;color:#8A8A93;width:30px;height:28px;border-radius:6px;cursor:pointer;display:grid;place-items:center;padding:0}.kathy .msg-acts button:hover{background:#2F2F33;color:#F5F5F5}.kathy .msg-acts button.on{color:#7B93FF}.kathy .msg-acts svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.kathy .mem-prop{background:#243052;border:1px solid #2E3A5C;border-radius:10px;padding:8px 10px;color:#DEDEDE;font-size:13px;margin-top:6px}.kathy .mem-prop .btn{margin-left:4px}
.kathy .chat-goiy{margin-top:6px;display:flex;flex-direction:column;gap:3px;font-size:12px;color:#8A8A93}.kathy .chat-goiy .badge{margin-right:4px}
.kathy .chat-form{display:block;padding:10px 14px 4px;border-top:0;background:#1E1E1E;flex:0 0 auto}
.kathy .chat-pill{display:flex;align-items:center;gap:8px;background:#2B2B2F;border:1px solid #3A3A41;border-radius:32px;padding:8px 8px 8px 16px;min-height:64px}.kathy .chat-pill:focus-within{border-color:#4D6BFE;box-shadow:0 0 0 3px rgba(77,107,254,.18)}
.kathy .btn-tep{border:0;background:transparent;color:#9A9AA3;font-size:22px;line-height:1;cursor:pointer;padding:6px;border-radius:50%;flex:0 0 auto}.kathy .btn-tep:hover{color:#F5F5F5;background:#3A3A41}
.kathy .chat-input{flex:1;min-width:0;resize:none;overflow-y:auto;line-height:1.45;max-height:140px;font-family:inherit;font-size:15px;color:#F5F5F5;background:transparent;border:0;padding:8px 4px;outline:none;box-shadow:none}.kathy .chat-input::placeholder{color:#8A8A93}.kathy .chat-input:focus{border:0;box-shadow:none}
.kathy .btn-send-tron{width:46px;height:46px;border-radius:50%;flex:0 0 auto;border:0;background:#fff;color:#1E1E1E;font-size:22px;line-height:1;cursor:pointer;display:grid;place-items:center}.kathy .btn-send-tron:hover{background:#E6E6EA}.kathy .btn-send-tron:disabled{opacity:.5;cursor:default}
.kathy .tep-chip-row{padding:0 18px 4px;display:flex;gap:6px;flex-wrap:wrap}.kathy .tep-chip-row:empty{display:none}.kathy .tep-chip{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:#DEDEDE;background:#232327;border:1px solid #3A3A41;border-radius:999px;padding:3px 10px}.kathy .tep-chip .tep-bo{cursor:pointer;color:#8A8A93}.kathy .tep-chip .tep-bo:hover{color:#ff6b6b}
.kathy .chat-trace{order:10;padding:4px 18px 12px;border-top:0;font-size:12.5px;color:#8A94A6;background:#1E1E1E;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}.kathy .chat-trace .tr{font-size:10.5px;color:#6F7580;letter-spacing:.02em}
@media (max-width:720px){body.has-kathy #app{width:100%;padding-bottom:52vh}.kathy{top:auto;bottom:0;left:0;right:0;width:100vw!important;max-width:100vw;height:50vh;border:0;border-top:1px solid #34343A;border-radius:14px 14px 0 0;box-shadow:0 -10px 30px rgba(0,0,0,.35);padding-bottom:env(safe-area-inset-bottom,0px)}.kathy.thu{height:48px}.kathy.thu>*:not(.zone-head){display:none}.kathy .zone-head .ico{position:relative;z-index:2}.kathy .grip,.kathy .sizes{display:none}.kathy .zone-head{cursor:pointer;justify-content:center;position:relative}.kathy .zone-head::before{content:"";position:absolute;top:5px;left:50%;width:44px;height:5px;margin-left:-22px;border-radius:999px;background:#8a8a92}.kathy .zone-head .thu{display:inline;margin-left:auto;color:#8A8A93;font-size:12px}.kathy .zone-head .zone-slogan{display:none}body.has-kathy.kathy-thu #app{padding-bottom:60px}.kathy .goi-y-row{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;max-height:none;-webkit-overflow-scrolling:touch}.kathy .goi-y-chip{white-space:nowrap}.kathy .ctx-bar>span:last-child{display:none}.kathy .chat-input{font-size:16px}.kathy .chat-form{padding-bottom:max(10px,env(safe-area-inset-bottom,0px))}}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:#1d221f;color:#fff;padding:10px 16px;border-radius:8px;z-index:30;font-size:14px}
.prog{height:6px;background:#eef0ed;border-radius:3px;overflow:hidden}.prog i{display:block;height:100%;background:var(--green)}
.score{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px}.score .kpi .v{font-size:24px}
.stage{display:grid;grid-template-columns:repeat(7,minmax(150px,1fr));gap:8px;overflow-x:auto}.stage .col{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:8px;min-height:120px}.stage .col h4{margin:0 0 6px;font-size:11px;text-transform:uppercase;color:var(--muted);letter-spacing:.4px}.stage .it{border:1px solid var(--line);border-radius:7px;padding:6px 8px;margin-bottom:6px;font-size:13px;cursor:pointer}.stage .it b{display:block}
.pos{border:1px solid var(--line);border-radius:8px;padding:8px 10px;margin:6px 0;background:#fff;cursor:pointer}.pos .n{font-weight:700}.pos .h{font-size:13px;color:var(--muted)}.pos .h.vac{color:var(--red)}
@media (max-width:720px){.form{grid-template-columns:1fr}.top nav a{padding:6px 8px;font-size:12px}main{padding:12px 10px 90px}}
