/* Trang 1 (danh sách bệnh nhân) — giao diện 2026-10-16 theo mockup orthonew-page1-mockup-v2.
 * Mọi lớp có tiền tố p1- và nằm trong #dashboardStepContainer: không ảnh hưởng Trang 2-5. */
body.p1-active #mainAppHeader, body.p1-active #subActionBar { display: none !important; }
body.p1-active { background: #f5f8f8; }
body.p1-active .main-container { padding: 0; }

#dashboardStepContainer.p1 {
  --t9:#064e4a; --t8:#0f625d; --t7:#0f766e; --t6:#0d9488; --t5:#14b8a6; --t1:#ccfbf1; --t0:#f0fdfa;
  --ink:#142b38; --muted:#607580; --line:#dfe8e9; --shadow:0 18px 48px rgba(19,59,62,.10);
  max-width: none !important; margin: 0 !important; padding: 0 40px 64px 96px !important;
  color: var(--ink); font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  background: radial-gradient(circle at 86% -10%, rgba(20,184,166,.09), transparent 26rem);
  min-height: 100vh;
}
#dashboardStepContainer.p1 * { box-sizing: border-box; }
#dashboardStepContainer.p1 button, #dashboardStepContainer.p1 input, #dashboardStepContainer.p1 select { font-family: inherit; }
.p1 [hidden] { display: none !important; }
/* Hộp Cài đặt + bảng Tài khoản: đưa ra ngoài Trang 1 (case_manager_dashboard.js bindPage1) để mở được
 * ngay trên Trang 2-5 mà không phải về danh sách. Cùng biến màu với Trang 1. */
#p1Floating {
  --t9:#064e4a; --t8:#0f625d; --t7:#0f766e; --t6:#0d9488; --t5:#14b8a6; --t1:#ccfbf1; --t0:#f0fdfa;
  --ink:#142b38; --muted:#607580; --line:#dfe8e9; --shadow:0 18px 48px rgba(19,59,62,.10);
  color: var(--ink); font-family: 'Be Vietnam Pro', system-ui, sans-serif;
}
#p1Floating * { box-sizing: border-box; }
#p1Floating [hidden] { display: none !important; }
#p1Floating button, #p1Floating input, #p1Floating select { font-family: inherit; }
#p1Floating .p1-panel-bg { z-index: 1150; }
#p1Floating .p1-panel { z-index: 1160; }
.p1-ic { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.p1-ic svg { width: 100%; height: 100%; display: block; }

/* ---------- menu trái (tự mở khi rê chuột) ---------- */
.p1-rail { position: fixed; inset: 0 auto 0 0; width: 56px; z-index: 900; overflow: hidden;
  background: linear-gradient(180deg,#063f3d,#0b5b57 58%,#084a47); box-shadow: 4px 0 16px rgba(6,78,74,.12);
  transition: width .26s cubic-bezier(.2,.8,.2,1); }
/* :focus-visible (bàn phím) thay cho :focus-within: bấm chuột xong rời ra thì menu tự thu lại */
@media (hover: hover) { .p1-rail:hover, .p1-rail:has(:focus-visible) { width: 260px; box-shadow: 12px 0 40px rgba(6,48,46,.22); } }
.p1-rail-inner { width: 260px; height: 100%; padding: 14px 8px; display: flex; flex-direction: column; }
.p1-rail-account { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 2px; margin-bottom: 8px; color: #fff; }
.p1-avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden;
  background: #99f6e4; color: #064e4a; font-weight: 800; font-size: 13px; box-shadow: 0 7px 18px rgba(0,0,0,.18); }
.p1-avatar img { width: 100%; height: 100%; object-fit: cover; }
.p1-rail-copy { display: flex; flex-direction: column; white-space: nowrap; min-width: 0; opacity: 0; transition: opacity .18s; }
.p1-rail-copy small { font-size: 9px; color: #9de6df; }
.p1-rail-copy strong { font-size: 12px; color: #fff; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
@media (hover: hover) { .p1-rail:hover .p1-rail-copy, .p1-rail:has(:focus-visible) .p1-rail-copy, .p1-rail:hover .p1-rail-label, .p1-rail:has(:focus-visible) .p1-rail-label { opacity: 1; } }
.p1-rail-nav { display: flex; flex-direction: column; gap: 5px; }
.p1-rail-item { width: 100%; height: 44px; border: 0; background: transparent; color: #b8d9d6; display: flex; align-items: center; gap: 14px;
  padding: 0 11px; border-radius: 11px; cursor: pointer; font-size: 13px; font-weight: 600; text-align: left; transition: .16s; }
.p1-rail-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.p1-rail-item.active { background: linear-gradient(90deg,rgba(94,234,212,.2),rgba(255,255,255,.07)); color: #fff; box-shadow: inset 3px 0 #5eead4; }
.p1-rail-item.home { color: #fff; background: rgba(255,255,255,.07); }
.p1-rail-label { white-space: nowrap; opacity: 0; transition: opacity .16s; }
.p1-rail-divider { height: 1px; background: rgba(255,255,255,.1); margin: 3px 8px 5px; }
/* 3 nhóm menu (2026-10-29): 16 mục -> dòng thấp hơn, cuộn được khi màn thấp; thu gọn: tiêu đề nhóm = vạch ngăn */
.p1-rail-nav { gap: 2px; overflow-y: auto; overflow-x: hidden; min-height: 0; flex: 0 1 auto; scrollbar-width: none; }
.p1-rail-nav::-webkit-scrollbar { display: none; }
/* 2026-10-29 v2: cả menu luôn vừa 1 màn, không phải cuộn (user không biết có mục bị khuất). Chiều cao dòng tự co theo
   khoảng trống thật giữa ô tài khoản và dòng kết nối: các dòng chia đều, mỗi dòng 26–40px */
.p1-rail-inner > .p1-rail-nav { flex: 1 1 auto; min-height: 0; }
.p1-rail-nav .p1-rail-item { height: auto; flex: 1 1 0; min-height: 22px; max-height: 40px; }
.p1-rail-account { height: 46px; margin-bottom: 2px; }
.p1-rail .p1-rail-status { margin-top: auto; }
/* màn thấp (laptop nhỏ + nhiều thanh công cụ): bỏ dòng "Đã kết nối" cuối menu, dòng thấp tới 22px */
@media (max-height: 640px) { .p1-rail-nav .p1-ic { width: 18px; height: 18px; } .p1-rail .p1-rail-status { display: none; } .p1-rail .p1-rail-account { height: 40px; } }
.p1-rail-group { position: relative; height: 22px; flex: 0 0 auto; display: flex; align-items: flex-end; gap: 6px; padding: 0 12px 4px; margin-top: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #7fb5b0; white-space: nowrap; }
.p1-rail-group > * { opacity: 0; transition: opacity .16s; }
.p1-rail-group::before { content: ''; position: absolute; left: 12px; bottom: 9px; width: 16px; height: 1px; background: rgba(255,255,255,.22); transition: opacity .16s; }
@media (hover: hover) { .p1-rail:hover .p1-rail-group > *, .p1-rail:has(:focus-visible) .p1-rail-group > * { opacity: 1; } }
@media (hover: hover) { .p1-rail:hover .p1-rail-group::before, .p1-rail:has(:focus-visible) .p1-rail-group::before { opacity: 0; } }
.p1-rail-group .p1-pro-tag { letter-spacing: 0; text-transform: none; }
/* icon chung (js/icons.js) đứng cạnh chữ */
.oi { display: inline-flex; width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -.2em; }
.oi svg { width: 100%; height: 100%; }


.p1-rail-status { display: flex; align-items: center; gap: 12px; padding: 12px 6px 4px 14px; border-top: 1px solid rgba(255,255,255,.12); }
.p1-dot { width: 9px; height: 9px; border-radius: 50%; background: #5eead4; box-shadow: 0 0 0 5px rgba(94,234,212,.12); flex: 0 0 auto; }
.p1-rail-status.off .p1-dot { background: #fbbf24; box-shadow: 0 0 0 5px rgba(251,191,36,.15); }
.p1-rail-status strong { font-size: 11px; } .p1-rail-status small { font-size: 9px; color: #9ac5c1; margin-top: 2px; }

/* ---------- đầu trang ---------- */
.p1-top { padding: 20px 0 22px; border-bottom: 1px solid var(--line); }
.p1-brandline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 38px; }
.p1-home { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.p1-logo { width: 38px; height: 38px; border-radius: 11px; background: #fff; box-shadow: 0 5px 15px rgba(18,61,64,.12); overflow: hidden; flex: 0 0 auto; }
.p1-logo img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 4px; }
.p1-appname { display: flex; flex-direction: column; margin-right: 8px; }
.p1-appname strong { font-size: 14px; color: #143a56; letter-spacing: -.02em; }
.p1-appname small { font-size: 8px; color: #6c858c; letter-spacing: .08em; margin-top: 2px; }
.p1-hint { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 5px 8px 5px 12px; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: #0f766e; background: #effaf8; border: 1px solid #d3eeea; line-height: 1.5; max-width: 100%; }
#pwaHint.p1-hint { margin: 0 !important; font-size: 11px !important; flex-wrap: nowrap; white-space: nowrap; }
.p1-hint { white-space: nowrap; }
.p1-hint button.p1-mini-x { border: 0; background: transparent; color: #7d9196; font-size: 15px; line-height: 1; padding: 0 4px; cursor: pointer; }
/* hộp Cài đặt */
.p1-settings { padding: 18px 26px 24px; display: flex; flex-direction: column; gap: 12px; }
.p1-set-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.p1-set-card.col { flex-direction: column; align-items: stretch; }
.p1-set-row { display: flex; align-items: center; gap: 14px; }
.p1-set-card > div, .p1-set-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p1-set-card > .p1-set-row { flex-direction: row; }
.p1-set-card strong { font-size: 14px; } .p1-set-card small { font-size: 12px; color: var(--muted); margin-top: 2px; }
.p1-pwa-help #pwaHelpBox { display: block !important; margin: 0 !important; }
.p1-hint-tg { color: #0369a1; background: #f0f9ff; border-color: #bae6fd; }
.p1-hint button.p1-mini { border: 0; border-radius: 999px; padding: 0 11px; height: 20px; line-height: 20px; font-size: 11px; font-weight: 700; cursor: pointer; color: #fff; background: #229ed9; }
/* Hai ô nhắc (PWA, Telegram) cao bằng nhau, thẳng hàng với logo */
.p1-brandline > .p1-hint { height: 30px; padding-top: 0; padding-bottom: 0; align-self: center; box-sizing: border-box; }
.p1-inbox { color: #b45309; background: #fffbeb; border-color: #fcd34d; cursor: pointer; }
.p1-inbox b { background: #dc2626; color: #fff; border-radius: 999px; padding: 0 7px; }
.p1-resume { color: #1e40af; background: #eff6ff; border-color: #bfdbfe; cursor: pointer; }
.p1-title-row { display: flex; align-items: center; gap: 24px; margin-top: 14px; flex-wrap: wrap; }
.p1-title-row h1 { margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -.045em; color: var(--ink); }
.p1-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.p1-btn-new { height: 70px; min-width: 268px; padding: 0 16px 0 11px; border: 0; border-radius: 19px; color: #fff; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  background: linear-gradient(130deg,#12b8a6 0%,#078277 60%,#075f59 100%); box-shadow: 0 14px 34px rgba(13,148,136,.3), inset 0 1px 0 rgba(255,255,255,.25);
  position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.p1-btn-new:hover { transform: translateY(-2px); box-shadow: 0 20px 42px rgba(13,148,136,.38); }
.p1-btn-new:after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; border: 18px solid rgba(255,255,255,.06); right: -30px; top: -42px; }
.p1-plus { width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,.17); border: 1px solid rgba(255,255,255,.28); display: grid; place-items: center; font-size: 32px; font-weight: 300; line-height: 1; }
.p1-btn-new > span:nth-child(2), .p1-btn-ceph > span:nth-child(2) { display: flex; flex-direction: column; }
.p1-btn-new strong { font-size: 15px; } .p1-btn-new small { font-size: 10px; color: #ccfbf1; margin-top: 3px; }
.p1-btn-new .p1-ic { width: 18px; margin-left: auto; position: relative; z-index: 1; }
.p1-btn-ceph { height: 64px; min-width: 230px; padding: 0 16px; border-radius: 17px; background: #fff; color: #1b4550; border: 1.5px solid #bce4df; display: flex; align-items: center; gap: 11px;
  text-align: left; cursor: pointer; box-shadow: 0 9px 23px rgba(23,80,83,.09); transition: .2s; }
.p1-btn-ceph:hover { transform: translateY(-2px); border-color: #55c9bd; }
.p1-btn-ceph .p1-ceph-ico { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(145deg,#dff9f5,#b9eee8); color: #0b766e; display: grid; place-items: center; }
.p1-btn-ceph .p1-ceph-ico .p1-ic { width: 24px; height: 24px; }
.p1-btn-ceph strong { font-size: 13px; } .p1-btn-ceph small { font-size: 10px; color: #7b9095; margin-top: 3px; }
/* "Vẽ phim miễn phí, không quảng cáo": chữ đậm, ánh sáng chạy qua (tắt khi hệ điều hành giảm chuyển động) */
.p1-btn-ceph small.p1-free-shine { font-size: 11.5px; font-weight: 800; letter-spacing: .1px; white-space: nowrap;
  background: linear-gradient(100deg, #0f766e 0%, #0f766e 38%, #5eead4 48%, #fde68a 52%, #0f766e 62%, #0f766e 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: p1FreeShine 2.8s linear infinite; }
@keyframes p1FreeShine { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .p1-btn-ceph small.p1-free-shine { animation: none; color: #0f766e; background: none; } }
/* 2026-10-24: "Công cụ khác" (Hồ sơ theo dõi, Nhập ảnh qua mã QR) — khối nhỏ bên phải, nút dẹt nền nhạt, không giống 2 nút lập kế hoạch / vẽ phim */
.p1-tools { margin-left: auto; display: flex; flex-direction: column; gap: 5px; padding: 7px 9px 8px; border: 1px dashed #cbd5e1; border-radius: 14px; background: #f8fafc; }
.p1-tools-label { font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: #94a3b8; padding-left: 3px; }
.p1-tools-row { display: flex; gap: 7px; flex-wrap: wrap; }
.p1-tool { height: 40px; padding: 0 12px 0 10px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: #475569; display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; font: inherit; transition: border-color .12s, background .12s; }
.p1-tool:hover { border-color: #94a3b8; background: #f1f5f9; }
.p1-tool .p1-ic { width: 17px; height: 17px; color: #64748b; flex: 0 0 auto; }
.p1-tool > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.p1-tool strong { font-size: 12px; font-weight: 700; } .p1-tool small { font-size: 9.5px; color: #94a3b8; }

/* ---------- tổng quan ---------- */
.p1-overview { display: grid; grid-template-columns: minmax(380px,1fr) 360px; gap: 16px; margin: 22px 0; }
.p1-card { border: 1px solid var(--line); background: rgba(255,255,255,.9); border-radius: 19px; box-shadow: 0 7px 28px rgba(24,64,67,.05); }
.p1-storage { padding: 18px 21px; display: flex; gap: 16px; }
.p1-card-ico { width: 46px; height: 46px; border-radius: 14px; background: var(--t0); display: grid; place-items: center; color: var(--t7); flex: 0 0 auto; }
.p1-storage-main { flex: 1; min-width: 0; }
.p1-storage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.p1-storage-head > div { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
.p1-storage-head span { font-size: 12px; color: var(--muted); font-weight: 600; }
.p1-storage-head strong { font-size: 14px; color: var(--ink); font-family: inherit !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.p1-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--t7); }
.p1-state i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px #dcfce7; }
.p1-track { height: 7px; margin: 13px 0 9px; background: #e8eeee; border-radius: 99px; overflow: hidden; }
.p1-track span { height: 100%; width: 0; display: block; background: linear-gradient(90deg,var(--t5),#2dd4bf); border-radius: inherit; transition: width .4s; }
.p1-storage-meta { display: flex; justify-content: space-between; gap: 10px; color: #6f8389; font-size: 11px; flex-wrap: wrap; }
.p1-storage-meta b { color: #385e63; }
.p1-storage.warn .p1-track span { background: linear-gradient(90deg,#f59e0b,#fbbf24); }
.p1-storage.warn .p1-state { color: #b45309; } .p1-storage.warn .p1-state i { background: #f59e0b; box-shadow: 0 0 0 4px #fef3c7; }
.p1-storage.full { border-color: #fca5a5; } .p1-storage.full .p1-track span { background: #dc2626; }
.p1-storage.full .p1-state { color: #b91c1c; } .p1-storage.full .p1-state i { background: #dc2626; box-shadow: 0 0 0 4px #fee2e2; }
.p1-storage.full #p1StorageNote { color: #b91c1c; font-weight: 700; }
.p1-folder-btns { display: flex; gap: 6px; }
.p1-folder-btns button { border: 1px solid #cbd5e1; background: #f8fafc; color: #0f172a; border-radius: 8px; padding: 4px 10px; font-size: 11px; font-weight: 700; cursor: pointer; }
.p1-statcard { padding: 16px 18px; display: flex; align-items: center; gap: 13px; cursor: pointer; transition: .2s; }
.p1-statcard:hover { border-color: #7ed9d0; transform: translateY(-1px); box-shadow: 0 12px 30px rgba(13,113,108,.11); }
.p1-stat-copy { display: flex; flex-direction: column; min-width: 120px; }
.p1-stat-copy small { font-size: 9px; letter-spacing: .12em; font-weight: 800; color: var(--t7); }
.p1-stat-copy strong { font-size: 13px; margin-top: 4px; } .p1-stat-copy strong b { color: var(--t7); }
.p1-stat-copy span { font-size: 10px; color: #84969b; margin-top: 2px; }
.p1-mini { height: 38px; flex: 1; display: flex; align-items: flex-end; gap: 4px; padding: 0 4px; }
.p1-mini i { flex: 1; min-width: 4px; max-width: 9px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg,#2dd4bf,#0d9488); }

/* ---------- danh sách ---------- */
.p1-list { background: #fff; border: 1px solid var(--line); border-radius: 21px; box-shadow: var(--shadow); }
.p1-selbar { padding: 12px 17px; background: linear-gradient(90deg,#eafaf7,#f6fdfc); border-bottom: 1px solid #cdebe7; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-radius: 21px 21px 0 0; flex-wrap: wrap; }
.p1-selbar > div:first-child { display: flex; flex-direction: column; }
.p1-selbar strong { font-size: 13px; color: var(--t8); } .p1-selbar span { font-size: 10px; color: #72868d; margin-top: 2px; }
.p1-selacts { display: flex; gap: 6px; flex-wrap: wrap; }
.p1-selacts button { height: 34px; border: 1px solid #c7e5e1; background: #fff; color: #31575d; border-radius: 9px; padding: 0 11px; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; cursor: pointer; }
.p1-selacts button:hover { background: #dff8f4; } .p1-selacts .p1-ic { width: 15px; }
.p1-selacts .danger { color: #b42318; border-color: #f0cdc8; } .p1-selacts .danger:hover { background: #fff1f0; }
.p1-toolbar { padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.p1-toolbar-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; flex-wrap: wrap; }
.p1-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.p1-chips button { height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0 12px; font-size: 12px; font-weight: 700; color: #456066; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.p1-chips button b { font-size: 10px; background: #eef4f4; border-radius: 999px; padding: 1px 7px; color: #456066; }
.p1-chips button.active { background: var(--t7); border-color: var(--t7); color: #fff; } .p1-chips button.active b { background: rgba(255,255,255,.2); color: #fff; }
.p1-chips .p1-ic { width: 15px; height: 15px; }
.p1-search { height: 42px; flex: 1; min-width: 220px; max-width: 460px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #f8fbfb; border-radius: 13px; padding: 0 12px; color: #789096; }
.p1-search:focus-within { border-color: var(--t5); background: #fff; box-shadow: 0 0 0 4px rgba(20,184,166,.08); }
.p1-search input { border: 0 !important; outline: 0; background: transparent !important; color: var(--ink); width: 100%; font-size: 13px; padding: 0 !important; box-shadow: none !important; }
.p1-search kbd { font-family: inherit; font-size: 10px; color: #8a9a9f; border: 1px solid #dbe5e5; background: #fff; border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.p1-sortwrap { position: relative; }
.p1-btn2 { height: 42px; border-radius: 12px; padding: 0 14px; border: 1px solid var(--line); background: #fff; color: #38505b; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
.p1-btn2:hover { border-color: #9cc9c4; background: var(--t0); }
.p1-btn2 .p1-cur { padding-left: 8px; border-left: 1px solid var(--line); color: var(--t7); font-size: 11px; }
.p1-sortmenu { position: absolute; right: 0; top: 50px; width: 330px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; z-index: 50; box-shadow: 0 22px 60px rgba(19,55,58,.18); }
.p1-sortmenu h4 { margin: 0 0 8px; font-size: 11px; color: #7b8d92; }
.p1-sortgrid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-bottom: 14px; }
.p1-dirs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.p1-sortgrid button, .p1-dirs button { border: 1px solid var(--line); border-radius: 9px; background: #fff; height: 36px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--ink); }
.p1-sortgrid button.active, .p1-dirs button.active { color: var(--t8); border-color: #5eead4; background: #e7fbf7; box-shadow: inset 0 0 0 1px #5eead4; }

/* 2026-10-24: cột tên hẹp lại (ngày sửa / tạo sát thông tin BN), cột tiến độ rộng ra cho đủ chữ "Bắt đầu điều trị" */
.p1-head, .p1-row { display: grid; grid-template-columns: 58px 112px minmax(210px,1fr) 104px minmax(440px,2.1fr) 36px; column-gap: 14px; align-items: center; }
.p1-head { padding: 11px 16px; background: #fbfcfc; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: #86969b; }
.p1-headsel { display: flex; align-items: center; gap: 11px; }
.p1-check { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; border: 1.5px solid #b9cbcc; border-radius: 5px; background: #fff; display: grid; place-items: center; cursor: pointer; margin: 0; }
.p1-check:checked { border-color: var(--t6); background: var(--t6); }
.p1-check:checked:after { content: ""; width: 7px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translateY(-1px); }
.p1-check:indeterminate { border-color: var(--t6); background: var(--t6); } .p1-check:indeterminate:after { content: ""; width: 8px; height: 2px; background: #fff; }
.p1-row { min-height: 86px; padding: 12px 16px; border-bottom: 1px solid #edf1f1; cursor: pointer; position: relative; transition: background .16s, box-shadow .16s; }
.p1-row:hover { background: #f6fcfb; box-shadow: inset 3px 0 var(--t5); }
.p1-row:last-child { border-bottom: 0; }
.p1-row.is-ceph { background: linear-gradient(90deg,#f0fdfa,#fff 40%); }
.p1-idx { display: flex; align-items: center; gap: 11px; } .p1-idx strong { font-size: 11px; color: #84979b; font-variant-numeric: tabular-nums; }
.p1-code { font-family: Consolas, monospace; font-size: 11px; color: #284c55; font-weight: 700; background: #eff8f7; border: 1px solid #d9edeb; padding: 5px 8px; border-radius: 7px; display: inline-flex; align-items: center; gap: 5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p1-code.ceph { background: var(--t7); color: #fff; border-color: var(--t7); font-family: inherit; letter-spacing: .06em; font-size: 10px; }
.p1-code.ceph .p1-ic { width: 13px; height: 13px; }
.p1-code.none { color: #9aa8ac; background: #f6f8f8; border-color: #e6ecec; font-family: inherit; font-weight: 600; }
.p1-pinfo { display: flex; align-items: center; gap: 13px; min-width: 0; }
.p1-pavatar { width: 52px; height: 52px; border-radius: 16px; object-fit: cover; object-position: 50% 22%; background: #deeceb; flex: 0 0 auto; border: 2px solid #fff; box-shadow: 0 0 0 1px #d5e4e4;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; overflow: hidden; position: relative; }
.p1-pavatar.ini { background: linear-gradient(135deg,#0d9488,#0f625d); }
.p1-pavatar.cephic { background: linear-gradient(145deg,#0f766e,#064e4a); color: #ccfbf1; }
.p1-pavatar.cephic .p1-ic { width: 30px; height: 30px; }
.p1-pavatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.p1-pavatar .p1-badge { position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; border-radius: 6px; background: var(--t7); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.p1-pavatar .p1-badge .p1-ic { width: 12px; height: 12px; }
.p1-row.g-female .p1-pavatar { box-shadow: 0 0 0 2px #f5c7dc, 0 5px 13px rgba(190,63,119,.10); }
.p1-row.g-male .p1-pavatar { box-shadow: 0 0 0 2px #b9d8f8, 0 5px 13px rgba(37,99,235,.10); }
.p1-pcopy { min-width: 0; }
/* tên BN: Noto Sans, dấu tiếng Việt chồng (Ữ, Ỗ) khi in hoa rõ hơn Be Vietnam Pro (bác sĩ chọn 2026-11-07) */
/* Làm bệnh án: tên BN ở đầu trang quản lý ca, đầu các bước 2–5, ô gõ tên (tạo ca, thông tin BN, slide), tiêu đề xem kế hoạch */
#p1MgName, #p2PName, #dashboardStepContainer.p1 #p1NewName, #p1NewName, #p2PmName, #patientName, #presentationModalTitle { font-family: 'Noto Sans', 'Be Vietnam Pro', system-ui, sans-serif; }
.p1-pcopy strong { font-family: 'Noto Sans', 'Be Vietnam Pro', system-ui, sans-serif; font-weight: 700; display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.p1-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #72868d; margin-top: 5px; }
.p1-meta i { width: 3px; height: 3px; background: #a8b7ba; border-radius: 50%; }
.p1-gender { font-size: 9px; padding: 2px 7px; border-radius: 999px; font-weight: 800; border: 1px solid; }
.g-female .p1-gender { color: #a63066; background: #fce8f1; border-color: #f5c3d9; }
.g-male .p1-gender { color: #1d5c9e; background: #e7f2fd; border-color: #bfdaf6; }
.p1-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.p1-tag { font-size: 9px; font-weight: 800; border-radius: 999px; padding: 2px 7px; border: 1px solid; white-space: nowrap; }
.p1-tag.open { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.p1-tag.shared { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.p1-date { font-size: 12px; color: #4f666d; } .p1-date small { display: block; color: #9aa8ac; font-size: 10px; margin-top: 2px; }
.p1-prog { --c:#0d9488; --s:#e8f8f5; border: 1px solid #dde8e8; background: #fff; border-radius: 13px; padding: 8px 10px 9px; box-shadow: 0 3px 12px rgba(26,71,74,.04); }
.p1-prog.t0 { --c:#2563eb; --s:#eaf1ff; } .p1-prog.t1 { --c:#7c3aed; --s:#f2edff; } .p1-prog.t2 { --c:#d97706; --s:#fff4dc; } .p1-prog.t3 { --c:#0891b2; --s:#e0f6fb; } .p1-prog.t4 { --c:#059669; --s:#e5f8ef; }
.p1-prog.done { --c:#047857; --s:#d1fae5; border-color: #a7f3d0; background: #f6fffb; }
.p1-prog.ceph { --c:#b45309; --s:#fffbeb; } .p1-prog.ceph.ok { --c:#047857; --s:#ecfdf5; }
.p1-prog-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.p1-prog-head > span { font-size: 9px; font-weight: 800; letter-spacing: .07em; color: var(--c); background: var(--s); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.p1-prog-head > strong { font-size: 11px; color: #203e48; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p1-prog.ceph .p1-prog-head > strong { color: var(--c); }
.p1-warn { font-style: normal; font-size: 9px; font-weight: 800; color: #c2410c; background: #fff7ed; border: 1px solid #fdba74; border-radius: 999px; padding: 2px 7px; margin-left: auto; white-space: nowrap; }
.p1-stages { display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; }
.p1-stage { min-width: 0; border-radius: 8px; padding: 5px 3px 4px; display: flex; align-items: center; justify-content: center; gap: 4px; background: #f3f6f6; border: 1px solid transparent; color: #8a999d; }
.p1-stage i { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: #e2e8e8; color: #78888c; font-size: 8px; font-style: normal; font-weight: 800; }
.p1-stage small { font-size: 9px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p1-stage.done { background: #eff9f6; color: #39766e; } .p1-stage.done i { background: #12a18f; color: #fff; }
.p1-stage.cur { background: var(--s); border-color: var(--c); color: var(--c); } .p1-stage.cur i { background: var(--c); color: #fff; } .p1-stage.cur small { font-weight: 800; }
.p1-stage.up { opacity: .68; cursor: default; }
/* Bước đã làm / đang làm: nút mở đúng trang đó của ca */
button.p1-stage { font: inherit; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
button.p1-stage:hover { border-color: #12a18f; box-shadow: 0 3px 10px -4px rgba(18,161,143,.55); transform: translateY(-1px); }
button.p1-stage.cur:hover { border-color: var(--c); box-shadow: 0 3px 10px -4px var(--c); }
button.p1-stage:focus-visible { outline: 2px solid #12a18f; outline-offset: 1px; }
.p1-ceph-note { font-size: 10px; color: #7b8f94; }
.p1-more { width: 32px; height: 32px; border: 0; background: transparent; color: #6f858a; border-radius: 9px; display: grid; place-items: center; cursor: pointer; }
.p1-more:hover, .p1-more.open { background: #e7f7f4; color: var(--t8); }
.p1-loadmore { width: 100%; height: 52px; border: 0; border-top: 1px solid var(--line); background: #fbfdfd; color: var(--t7); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; border-radius: 0 0 21px 21px; }
.p1-loadmore:hover { background: var(--t0); }
.p1-spin { width: 16px; height: 16px; border: 2px solid #b5ded9; border-top-color: var(--t7); border-radius: 50%; animation: p1spin .8s linear infinite; opacity: 0; }
.p1-loadmore.loading .p1-spin { opacity: 1; }
.p1-end { text-align: center; border-top: 1px solid var(--line); padding: 14px; color: #87979c; font-size: 11px; }
.p1-empty { text-align: center; padding: 48px 20px; color: var(--muted); font-size: 13px; }
.p1-empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
#patientGrid > #folderAccessCard { margin: 16px; }
/* style.css (thẻ ca cũ) ép #patientGrid thành lưới và mọi svg 16px: bỏ ở giao diện mới */
#dashboardStepContainer.p1 #patientGrid { display: block !important; gap: 0 !important; grid-template-columns: none !important; }
#dashboardStepContainer.p1 #patientGrid .p1-ic svg { width: 100% !important; height: 100% !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important; max-height: none !important; display: block !important; }

/* thùng rác */
.p1-trash-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid #edf1f1; }
.p1-trash-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p1-trash-row strong { font-size: 13px; text-transform: uppercase; } .p1-trash-row small { font-size: 11px; color: #72868d; margin-top: 3px; }
.p1-trash-ava { width: 46px; height: 46px; border-radius: 12px; overflow: hidden; background: #e2e8f0; display: grid; place-items: center; filter: grayscale(.6); flex: 0 0 auto; color: #64748b; }
.p1-trash-ava img { width: 100%; height: 100%; object-fit: cover; }

/* menu ⋮ */
.p1-menu { position: fixed; z-index: 2000; width: 210px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 48px rgba(13,49,52,.22); }
.p1-menu button { width: 100%; height: 36px; border: 0; background: transparent; border-radius: 8px; padding: 0 10px; display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 650; color: #39575d; cursor: pointer; text-align: left; font-family: inherit; }
.p1-menu button:hover { background: #eff8f7; } .p1-menu .danger { color: #b42318; } .p1-menu .danger:hover { background: #fff1f0; }
.p1-menu .p1-ic { width: 16px; height: 16px; }
.p1-menu hr { border: 0; border-top: 1px solid #edf1f1; margin: 4px 2px; }

/* ---------- hộp thoại ---------- */
.p1-modal-bg { position: fixed; inset: 0; z-index: 100040; background: rgba(7,32,36,.54); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 20px; }
.p1-modal { width: min(590px,100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 24px; box-shadow: 0 32px 90px rgba(3,31,34,.35); animation: p1in .22s ease; color: var(--ink); }
.p1-modal.wide { width: min(860px,100%); }
.p1-modal.small { width: min(460px,100%); }
.p1-mhead { padding: 22px 26px 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); }
.p1-kicker { font-size: 10px; color: var(--t7); font-weight: 800; letter-spacing: .14em; }
.p1-mhead h2 { margin: 5px 0 3px; font-size: 21px; letter-spacing: -.03em; color: var(--ink); }
.p1-mhead p { margin: 0; font-size: 12px; color: var(--muted); }
.p1-x { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 11px; cursor: pointer; display: grid; place-items: center; color: #587077; flex: 0 0 auto; }
.p1-x:hover { background: #eef5f4; }
.p1-form { padding: 20px 26px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; }
.p1-f { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.p1-f.full { grid-column: 1/-1; }
.p1-f > label { font-size: 12px; font-weight: 700; color: var(--ink); } .p1-f > label span { color: #8ca0a5; font-size: 10px; font-weight: 600; }
.p1-f input:not([type=checkbox]):not([type=date]) { width: 100%; height: 46px; border: 1px solid #cfdcdc; border-radius: 11px; padding: 0 13px; background: #fbfdfd; color: var(--ink); font-size: 14px; outline: 0; margin: 0; }
.p1-f input:focus { border-color: var(--t5); background: #fff; box-shadow: 0 0 0 4px rgba(20,184,166,.09); }
.p1-f small { font-size: 11px; color: #839399; line-height: 1.5; }
.p1-f small.err, .p1-err { color: #b91c1c !important; font-weight: 700; }
.p1-codewrap, .p1-datewrap { position: relative; }
.p1-codewrap input { padding-right: 50px !important; font-family: Consolas, monospace; font-weight: 800; letter-spacing: .06em; color: var(--t8) !important; background: #effaf8 !important; }
.p1-codewrap button { position: absolute; right: 5px; top: 5px; width: 36px; height: 36px; border: 0; background: #dff6f2; color: var(--t7); border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.p1-datewrap .p1-ic { position: absolute; right: 13px; top: 13px; width: 18px; height: 18px; color: #789096; pointer-events: none; }
.p1-datewrap input[type=date] { position: absolute; right: 0; top: 0; width: 46px; height: 46px; opacity: 0; cursor: pointer; z-index: 2; border: 0; padding: 0; }
/* Lịch chọn Năm -> Tháng -> Ngày (js/date_pick.js) */
.dp-pop { position: fixed; z-index: 300000; width: 292px; padding: 12px; background: #fff; border: 1px solid #d5e2e2; border-radius: 14px; box-shadow: 0 18px 44px -14px rgba(8,40,44,.45); font-family: 'Be Vietnam Pro', system-ui, sans-serif; color: #1f3b47; box-sizing: border-box; }
.dp-pop button { font-family: inherit; }
.dp-h { display: flex; align-items: center; gap: 6px; }
.dp-nav { width: 34px; height: 34px; border: 1px solid #d5e2e2; border-radius: 9px; background: #fff; color: #0f766e; font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.dp-t { flex: 1; height: 34px; border: 0; border-radius: 9px; background: #effaf8; color: #0f766e; font-size: 13.5px; font-weight: 800; cursor: pointer; }
.dp-t:disabled { cursor: default; }
.dp-nav:disabled { opacity: .35; cursor: default; }
.dp-steps { display: flex; justify-content: center; gap: 14px; margin: 8px 0; font-size: 11px; font-weight: 600; color: #9aaeb2; }
.dp-steps span.on { color: #0f766e; font-weight: 800; }
.dp-grid { display: grid; gap: 4px; }
.dp-grid.year { grid-template-columns: repeat(4, 1fr); }
.dp-grid.month { grid-template-columns: repeat(3, 1fr); }
.dp-grid.day { grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-grid button { height: 36px; border: 0; border-radius: 9px; background: #f4f8f8; color: #1f3b47; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; }
.dp-grid.day button { height: 34px; background: transparent; }
.dp-grid button:hover:not(:disabled) { background: #d8f3ee; color: #0f766e; }
.dp-grid button.on { background: #0d9488; color: #fff; }
.dp-grid button:disabled { color: #c3cfd2; cursor: default; }
.dp-wd { text-align: center; font-size: 10.5px; font-weight: 700; color: #8ca0a5; padding: 3px 0; }
.p1-gsw { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.p1-gsw button { height: 46px; border: 1px solid #cfdcdc; border-radius: 11px; background: #fbfdfd; font-size: 14px; font-weight: 700; cursor: pointer; color: #456066; }
.p1-gsw button.active[data-g="Nữ"] { background: #fce8f1; border-color: #f5a3c7; color: #a63066; }
.p1-gsw button.active[data-g="Nam"] { background: #e7f2fd; border-color: #93c5fd; color: #1d5c9e; }
.p1-hintline { grid-column: 1/-1; margin-top: -8px; font-size: 11px; color: #4b6a70; }
.p1-consent { grid-column: 1/-1; display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: #f5fbfa; border: 1px solid #daeeec; border-radius: 12px; cursor: pointer; font-size: 12px; color: #526b72; line-height: 1.55; }
.p1-consent input { margin-top: 2px; accent-color: #0d9488; width: 16px; height: 16px; flex: 0 0 auto; }
.p1-mfoot { grid-column: 1/-1; margin: 4px -26px 0; padding: 14px 26px; background: #fbfcfc; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; border-radius: 0 0 24px 24px; }
.p1-mfoot.alone { margin: 0; }
.p1-primary, .p1-text { height: 44px; border-radius: 12px; padding: 0 18px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
.p1-primary { color: #fff; background: linear-gradient(135deg,var(--t5),var(--t7)); box-shadow: 0 9px 22px rgba(13,148,136,.24); }
.p1-primary:disabled { background: #b9c9c8; box-shadow: none; cursor: not-allowed; }
.p1-primary.danger { background: linear-gradient(135deg,#ef4444,#b91c1c); box-shadow: 0 9px 22px rgba(185,28,28,.25); }
.p1-text { background: transparent; color: #657880; }
.p1-stats { padding: 18px 26px 24px; }
.p1-counters { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 18px; }
.p1-counters span { background: #f0fdfa; border: 1px solid #ccebe7; border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; }
.p1-counters small { font-size: 10px; font-weight: 800; color: var(--t7); text-transform: uppercase; letter-spacing: .06em; }
.p1-counters strong { font-size: 22px; color: var(--t8); }
.p1-counters .dark { background: #0f2e33; border-color: #0f2e33; } .p1-counters .dark small { color: #5eead4; } .p1-counters .dark strong { color: #fff; }
.p1-stat-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.p1-period { display: flex; padding: 4px; background: #edf5f4; border-radius: 11px; }
.p1-period button { height: 34px; border: 0; border-radius: 8px; padding: 0 14px; background: transparent; color: #6a8085; font-size: 12px; font-weight: 700; cursor: pointer; }
.p1-period button.active { background: #fff; color: var(--t8); box-shadow: 0 3px 10px rgba(18,64,66,.1); }
.p1-sum { display: flex; gap: 22px; } .p1-sum span { display: flex; flex-direction: column; }
.p1-sum small { font-size: 10px; color: #89999d; text-transform: uppercase; letter-spacing: .08em; } .p1-sum strong { font-size: 13px; margin-top: 3px; }
.p1-bars { height: 260px; margin-top: 20px; padding: 20px 10px 0; border-left: 1px solid #e4ecec; border-bottom: 1px solid #e4ecec; display: grid; grid-template-columns: repeat(12,1fr); gap: 9px; align-items: end;
  background: repeating-linear-gradient(to top,transparent 0,transparent 55px,#edf2f2 56px); }
.p1-bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.p1-bar b { font-size: 10px; color: #4d6c71; }
.p1-bar i { width: min(28px,70%); min-height: 3px; background: linear-gradient(180deg,#5eead4,#0d9488); border-radius: 7px 7px 2px 2px; }
.p1-bar i.peak { background: linear-gradient(180deg,#2563eb,#0d9488); }
.p1-bar span { font-size: 10px; color: #84969a; white-space: nowrap; }
.p1-note { margin-top: 12px; font-size: 11px; color: #7e9094; }

/* tài khoản */
.p1-panel-bg { position: fixed; inset: 0; background: rgba(13,35,38,.28); z-index: 950; }
.p1-panel { position: fixed; z-index: 960; left: 56px; top: 0; bottom: 0; width: min(380px,calc(100vw - 56px)); background: #fff; padding: 34px 30px; box-shadow: 16px 0 45px rgba(15,47,50,.18); animation: p1panel .22s ease; overflow: auto; color: var(--ink); }
.p1-panel .p1-x { position: absolute; right: 16px; top: 16px; }
.p1-panel .p1-avatar { width: 56px; height: 56px; border-radius: 16px; font-size: 18px; margin: 20px 0 14px; }
.p1-panel h2 { font-size: 20px; margin: 4px 0; } .p1-panel p { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 0 0 14px; word-break: break-all; }
.p1-plist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.p1-plist div { background: #f5fbfa; border: 1px solid #daeeec; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.p1-plist small { font-size: 10px; color: #7b8f94; } .p1-plist strong { font-size: 12px; margin-top: 3px; }
/* "Số ca": 1 kế hoạch · 3 phim · 0 hồ sơ theo dõi -> cả hàng, không xuống dòng giữa chừng */
.p1-plist > div:last-child { grid-column: 1 / -1; } .p1-plist > div:last-child strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p1-pbtn { width: 100%; height: 42px; margin-top: 8px; border: 1px solid var(--line); background: #fff; border-radius: 12px; font-size: 13px; font-weight: 700; cursor: pointer; color: #38505b; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.p1-pbtn:hover { background: var(--t0); } .p1-pbtn.danger { color: #b42318; }

/* quản lí bệnh nhân */
.p1-back { border: 0; background: transparent; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #41636a; cursor: pointer; padding: 22px 0 0; }
.p1-back:hover { color: var(--t7); }
.p1-hero { margin: 18px 0; padding: 22px 25px; border-radius: 20px; color: #fff; background: linear-gradient(125deg,#064e4a,#0f766e); display: flex; align-items: center; justify-content: space-between; gap: 16px; box-shadow: 0 18px 42px rgba(6,78,74,.18); flex-wrap: wrap; }
.p1-hero-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.p1-hero .p1-pavatar { width: 70px; height: 70px; border-radius: 18px; border: 3px solid rgba(255,255,255,.75); box-shadow: none; font-size: 20px; }
.p1-hero span.code { font-family: Consolas, monospace; color: #99f6e4; font-size: 12px; }
.p1-hero h1 { font-size: 24px; margin: 4px 0; text-transform: uppercase; color: #fff; }
.p1-hero p { font-size: 12px; margin: 0; color: #c4e8e4; }
.p1-hero-status { text-align: right; } .p1-hero-status span { display: block; color: #99f6e4; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; } .p1-hero-status strong { font-size: 14px; }
.p1-tiles { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 18px; }
.p1-tile { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 18px; text-align: left; display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: .18s; color: var(--ink); }
.p1-tile:hover { border-color: #5eead4; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(17,60,62,.08); }
.p1-tile .p1-ic { width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: var(--t0); color: var(--t7); margin-bottom: 6px; }
.p1-tile strong { font-size: 14px; } .p1-tile small { font-size: 11px; color: #7b8f94; }
.p1-tile.danger .p1-ic { background: #fff1f0; color: #b42318; }
.p1-placeholder { background: #fff; border: 1.5px dashed #b9d9d5; border-radius: 20px; padding: 26px; }
.p1-placeholder h2 { margin: 6px 0; font-size: 18px; } .p1-placeholder p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }

@keyframes p1spin { to { transform: rotate(360deg); } }
@keyframes p1in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes p1panel { from { opacity: 0; transform: translateX(-18px); } }

@media (max-width: 1380px) {
  .p1-head, .p1-row { grid-template-columns: 52px 100px minmax(170px,.8fr) 96px minmax(430px,2.4fr) 32px; column-gap: 10px; }
  .p1-stages.tx { grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1.4fr) minmax(0, .8fr); gap: 4px; }
  .p1-stages.tx .p1-stage { padding-left: 2px; padding-right: 2px; gap: 3px; }
}
@media (max-width: 1180px) {
  .p1-head, .p1-row { grid-template-columns: 52px 105px minmax(180px,1fr) minmax(360px,1.9fr) 36px; }
  .p1-head > span:nth-child(4), .p1-row .p1-date { display: none; }
  .p1-overview { grid-template-columns: 1fr 300px; }
  .p1-tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) { .p1-hint, #pwaHint.p1-hint { white-space: normal; flex-wrap: wrap; } .p1-brandline > .p1-hint { height: auto; min-height: 30px; padding-top: 4px; padding-bottom: 4px; } }
@media (max-width: 820px) {
  #dashboardStepContainer.p1 { padding: 0 14px 48px 66px !important; }
  .p1-overview { grid-template-columns: 1fr; }
  .p1-head { display: none; }
  .p1-row { grid-template-columns: 44px 1fr 34px; gap: 10px; padding: 14px 12px; }
  .p1-row > .p1-idx { grid-column: 1; grid-row: 1; }
  .p1-row > .p1-codecell { display: none; }
  .p1-row > .p1-pinfo { grid-column: 2; grid-row: 1; }
  .p1-row > .p1-progcell { grid-column: 2/4; grid-row: 2; }
  .p1-row > .p1-more { grid-column: 3; grid-row: 1; }
  .p1-title-row h1 { font-size: 24px; }
  .p1-actions, .p1-btn-new, .p1-btn-ceph { width: 100%; min-width: 0; }
  .p1-tools { margin-left: 0; width: 100%; } .p1-tool { flex: 1 1 200px; }
  .p1-search { max-width: none; }
}
@media (max-width: 560px) {
  .p1-form { grid-template-columns: 1fr; } .p1-f { grid-column: 1/-1; }
  .p1-tiles { grid-template-columns: 1fr; }
  .p1-counters strong { font-size: 17px; }
  .p1-selacts button span { display: none; }
  .p1-stage small { display: none; }
}

/* ---------- Thảo luận ca (Đợt 1, 2026-10-17): nhãn ca, Danh bạ, hộp Gửi / Chia sẻ / Chuyển ca, xem ca chỉ đọc ---------- */
.p1-rail-item { position: relative; }
/* Số thông báo (2026-10-26): menu thu gọn chỉ rộng 56px và cắt phần tràn, số cũ (left 32px, kèm emoji) bị che
   nửa. Nay: chỉ số, sát góc trên phải biểu tượng; số thứ hai (🔔 + ⏰ cùng ở Lịch hẹn) xếp xuống dưới.
   Menu mở rộng: số đứng sau chữ, hiện cả biểu tượng (data-ic). */
.p1-rail-badge { position: absolute; left: 25px; top: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 9.5px; font-weight: 800; line-height: 1; display: grid; place-items: center; box-shadow: 0 0 0 2px #0b5b57; white-space: nowrap; }
.p1-rail-badge ~ .p1-rail-badge:not([hidden]) { top: 25px; }
@media (hover: hover) { .p1-rail:hover .p1-rail-badge, .p1-rail:has(:focus-visible) .p1-rail-badge { position: static; display: inline-grid; margin-left: -6px; height: 18px; font-size: 10px; padding: 0 6px; box-shadow: none; } }
.p1-tag.tl-tag { display: inline-flex; align-items: center; gap: 4px; }
.p1-tag.tl-tag svg { width: 11px; height: 11px; flex: 0 0 auto; }
.p1-tag.readonly { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.p1-tag.view { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.p1-tag.editable { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.p1-tag.sharing { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
.p1-row.is-view { background: linear-gradient(90deg,#f8fafc,#fff 45%); }
.p1-row.is-view .p1-stage { opacity: .75; }

.tl-root { --t9:#064e4a; --t8:#0f625d; --t7:#0f766e; --t6:#0d9488; --t5:#14b8a6; --t1:#ccfbf1; --t0:#f0fdfa;
  --ink:#142b38; --muted:#607580; --line:#dfe8e9; font-family: 'Be Vietnam Pro', system-ui, sans-serif; z-index: 100050; }
.tl-root *, #p1DiscussView * { box-sizing: border-box; }
.tl-root button, .tl-root input, .tl-root textarea { font-family: inherit; }
.tl-root [hidden], #p1DiscussView [hidden] { display: none !important; }
.tl-dbody { padding: 16px 26px 18px; font-size: 13px; color: #38505b; }
.tl-wait, .tl-empty { text-align: center; padding: 26px 12px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.tl-gofriends { margin-top: 12px; height: 38px; }
.tl-pick { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; margin-bottom: 12px; }
.tl-person { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; }
.tl-person.static { cursor: default; }
.tl-person:has(input:checked) { border-color: var(--t5); background: #f0fdfa; box-shadow: 0 0 0 3px rgba(20,184,166,.12); }
.tl-person input[type=radio] { accent-color: #0d9488; width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
.tl-ava { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; background: #ccfbf1; color: #0f625d; font-weight: 800; font-size: 12px; }
.tl-ava.big { width: 52px; height: 52px; border-radius: 16px; font-size: 16px; }
.tl-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tl-who strong { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-who small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tl-acts .p1-btn2, .tl-remove { height: 34px; font-size: 12px; padding: 0 11px; }
.tl-small { height: 34px !important; font-size: 12px !important; padding: 0 14px !important; box-shadow: none !important; }
.tl-chip { font-style: normal; font-size: 10px; font-weight: 700; color: #0f766e; background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.tl-consent { margin: 4px 0 0; }
.tl-note { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; font-size: 12px; font-weight: 700; color: var(--ink); }
.tl-note textarea { border: 1px solid #cfdcdc; border-radius: 11px; padding: 9px 12px; font-size: 13px; resize: vertical; background: #fbfdfd; outline: 0; font-weight: 400; }
.tl-note textarea:focus { border-color: var(--t5); box-shadow: 0 0 0 4px rgba(20,184,166,.09); }
.tl-status { min-height: 18px; margin-top: 8px; font-size: 12px; font-weight: 700; color: #0f625d; }
.tl-status.bad { color: #b91c1c; }
.tl-list { display: flex; flex-direction: column; gap: 6px; }
.tl-row { margin-top: 12px; }
.tl-row .p1-btn2 { height: 38px; font-size: 12px; }
.tl-hist { margin-top: 14px; font-size: 12px; color: #4b6a70; }
.tl-hist summary { cursor: pointer; font-weight: 700; color: #0f625d; }
.tl-hist ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.7; }
.tl-ro { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11px; font-weight: 800; color: #475569; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 999px; padding: 3px 10px; }
.tl-ro .p1-ic { width: 13px; height: 13px; }
.tl-tabs { display: flex; gap: 4px; padding: 10px 26px 0; border-bottom: 1px solid var(--line); }
.tl-tabs button { height: 38px; border: 0; background: transparent; padding: 0 14px; font-size: 13px; font-weight: 700; color: #607580; border-bottom: 2px solid transparent; cursor: pointer; }
.tl-tabs button.active { color: #0f766e; border-bottom-color: #0d9488; }
.tl-tabs.flat { padding: 0; margin-top: 14px; }
.tl-viewer { width: min(1080px,100%); }
.tl-body { padding: 18px 26px 24px; min-height: 320px; }
.tl-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); gap: 12px; }
.tl-photo, .tl-ceph { margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #f8fafa; cursor: zoom-in; }
.tl-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #0f172a; }
.tl-photo figcaption, .tl-ceph figcaption { font-size: 11px; font-weight: 700; color: #456066; padding: 7px 10px; }
.tl-ceph { margin-bottom: 14px; }
.tl-ceph img { width: 100%; max-height: 62vh; object-fit: contain; display: block; background: #0b1416; }
.tl-pdf { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 12px; background: #f1f5f9; }
/* Tab Kế hoạch: khung chỉ xem (js/view_only.js) dựng slide trên máy người xem */
.tl-recstat { font-size: 12px; font-weight: 700; color: #0f766e; margin: 0 0 8px; }
.tl-recstat.bad { color: #b91c1c; }
.tl-record { height: 72vh; background: #eef3f2; }
.tl-cephact { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.tl-zoom { position: fixed; inset: 0; z-index: 100060; background: rgba(3,12,14,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; cursor: zoom-out; }
.tl-zoom img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; border-radius: 8px; }
.tl-zoom span { color: #e2f3f1; font-size: 13px; font-weight: 700; }
.tl-zoom button { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; display: grid; place-items: center; }

#p1DiscussView { padding-top: 26px; }
.tl-top h1 { margin: 0; }
.tl-sub { margin: 6px 0 0; font-size: 13px; color: var(--muted); max-width: 760px; line-height: 1.6; }
.tl-sec { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; margin-top: 16px; box-shadow: 0 6px 18px rgba(19,59,62,.05); }
.tl-sec.hot { border-color: #fcd34d; background: #fffdf5; }
.tl-sec h3 { margin: 0 0 12px; font-size: 14px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.tl-sec h3 b { font-size: 11px; background: #eef4f4; border-radius: 999px; padding: 1px 8px; color: #456066; }
.tl-addform { display: flex; gap: 8px; flex-wrap: wrap; }
.tl-addform input { flex: 1 1 260px; height: 44px; border: 1px solid #cfdcdc; border-radius: 12px; padding: 0 14px; font-size: 14px; background: #fbfdfd; outline: 0; }
.tl-addform input:focus { border-color: var(--t5); box-shadow: 0 0 0 4px rgba(20,184,166,.09); }
.tl-hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.tl-cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 12px; }
.tl-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; background: linear-gradient(180deg,#f8fdfc,#fff); }
.tl-card strong { margin-top: 8px; font-size: 13px; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-card small { font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-card em { font-style: normal; font-size: 10px; color: #0f766e; font-weight: 700; margin-top: 4px; }
.tl-link { margin-top: 8px; border: 0; background: none; color: #94a3b8; font-size: 11px; cursor: pointer; text-decoration: underline; }
.tl-link:hover { color: #b42318; }
@media (max-width: 640px) {
  .tl-dbody, .tl-body { padding-left: 16px; padding-right: 16px; }
  .tl-tabs { padding-left: 16px; padding-right: 16px; overflow-x: auto; }
  .tl-person { flex-wrap: wrap; }
}
.p1-rail-badge[hidden] { display: none !important; }
.p1-tag.tl-tag { white-space: normal; max-width: 100%; line-height: 1.35; }
@media (max-width: 820px) { .p1-toolbar-left { flex: 1 1 100%; } }

/* ---------- Thảo luận ca Đợt 2: Đoạn chat (js/chat.js) ---------- */
.tl-tabs .tl-tabn { margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10px; display: inline-grid; place-items: center; }
.tl-chatbtn { height: 32px; font-size: 12px; margin-top: 8px; }
.tc-wrap { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - 210px); min-height: 460px; margin-top: 16px; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 6px 18px rgba(19,59,62,.05); }
.tc-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #fbfdfd; }
.tc-search { display: block; padding: 12px; }
.tc-search input { width: 100%; height: 40px; border: 1px solid #cfdcdc; border-radius: 11px; padding: 0 12px; font-size: 13px; background: #fff; outline: 0; }
.tc-search input:focus { border-color: var(--t5); }
.tc-list { flex: 1; overflow: auto; padding: 0 8px; min-height: 0; }
.tc-conv { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; position: relative; }
.tc-conv:hover { background: #eef8f6; }
.tc-conv.active { background: #dff6f2; }
.tc-cbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tc-ctop { display: flex; justify-content: space-between; gap: 6px; }
.tc-ctop strong { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-ctop small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.tc-snip { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-conv.unread .tc-snip { color: var(--ink); font-weight: 700; }
.tc-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; display: grid; place-items: center; }
.tc-start { padding: 10px 12px 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; }
.tc-start small { width: 100%; font-size: 11px; color: var(--muted); font-weight: 700; }
.tc-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 700; color: #39575d; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-chip .tl-ava { width: 24px; height: 24px; border-radius: 50%; font-size: 9px; }
.tc-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tc-blank { margin: auto; text-align: center; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 4px; padding: 20px; }
.tc-blank strong { color: var(--ink); font-size: 15px; }
.tc-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tc-hbtn { height: 36px; font-size: 12px; }
.tc-stream { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f7fafa; min-height: 0; }
.tc-older { align-self: center; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 14px; font-size: 12px; color: #456066; cursor: pointer; }
.tc-msg { display: flex; flex-direction: column; max-width: 72%; gap: 3px; }
.tc-msg.in { align-self: flex-start; align-items: flex-start; }
.tc-msg.out { align-self: flex-end; align-items: flex-end; }
.tc-bubble { padding: 9px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.tc-msg.in .tc-bubble { background: #fff; border: 1px solid #dbe5e6; color: var(--ink); border-bottom-left-radius: 5px; }
.tc-msg.out .tc-bubble { background: linear-gradient(135deg,#14b8a6,#0f766e); color: #fff; border-bottom-right-radius: 5px; }
.tc-time { font-size: 9.5px; line-height: 1.1; color: #a3b3b8; padding: 0 3px; }
.tc-delfoot { flex-wrap: wrap; gap: 8px; }
.tc-receipt { align-self: flex-end; font-size: 10px; color: #8ba0a5; margin-top: -4px; }
.tc-receipt.seen { color: #0d9488; font-weight: 700; }
.tc-card { width: 300px; max-width: 100%; background: #fff; border: 1px solid #cdeae6; border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; box-shadow: 0 6px 16px rgba(13,148,136,.08); }
.tc-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 10px; font-weight: 800; color: #0f766e; letter-spacing: .04em; }
.tc-card-top em { font-style: normal; color: #475569; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 999px; padding: 1px 8px; }
.tc-card strong { font-size: 14px; color: var(--ink); }
.tc-card small { font-size: 11px; color: var(--muted); }
.tc-card p { margin: 4px 0 0; font-size: 12px; color: #456066; line-height: 1.45; }
.tc-card .p1-btn2 { margin-top: 8px; height: 36px; font-size: 12px; justify-content: center; }
.tc-card.moved { border-color: #fcd9a8; }
.tc-card.moved .tc-card-top em { color: #9a4d00; background: #fff7ed; border-color: #fdba74; }
.tc-card p.tc-card-note { color: #9a4d00; font-weight: 600; }
.tc-compose { position: relative; display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
.tc-compose textarea { flex: 1; min-height: 40px; max-height: 220px; resize: vertical; border: 1px solid #cfdcdc; border-radius: 12px; padding: 9px 12px; font-size: 13.5px; line-height: 1.45; outline: 0; background: #fbfdfd; }
.tc-compose textarea:focus { border-color: var(--t5); background: #fff; }
.tc-icon { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 11px; font-size: 18px; cursor: pointer; flex: 0 0 auto; }
.tc-icon:hover { background: #eef8f6; }
.tc-sendbtn { height: 40px !important; padding: 0 16px !important; }
/* cảm xúc, trả lời, sticker (2026-10-31) */
.tc-icon svg { width: 20px; height: 20px; display: block; margin: auto; fill: none; stroke: #456066; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tc-msg { position: relative; }
.tc-tools { position: absolute; top: -20px; display: none; align-items: center; gap: 1px; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 22px rgba(13,49,52,.16); z-index: 4; }
.tc-msg.in .tc-tools { left: 6px; }
.tc-msg.out .tc-tools { right: 6px; }
.tc-msg:hover .tc-tools, .tc-msg.tap .tc-tools { display: flex; }
.tc-tools button { width: 30px; height: 30px; padding: 0; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #456066; transition: transform .12s; }
.tc-tools button:hover { background: #eef8f6; transform: scale(1.2); }
.tc-tools img { width: 24px; height: 24px; display: block; }
.tc-tools svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tc-tools i { width: 1px; height: 18px; background: var(--line); margin: 0 2px; }
.tc-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -8px; padding: 0 8px; position: relative; z-index: 1; }
.tc-reacts button { height: 24px; padding: 0 7px; border: 1px solid #d5e2e3; border-radius: 999px; background: #fff; display: inline-flex; align-items: center; gap: 4px; color: #456066; cursor: pointer; box-shadow: 0 2px 5px rgba(13,49,52,.08); }
.tc-reacts button.mine { background: #f0fdfa; border-color: #14b8a6; color: #0f766e; }
.tc-reacts img { width: 17px; height: 17px; display: block; }
.tc-reacts b { font-size: 11px; }
.tc-quote { display: flex; align-items: center; gap: 8px; max-width: 100%; border: 0; border-left: 3px solid #14b8a6; border-radius: 9px; background: #e9f1f1; color: #456066; padding: 5px 10px 11px; margin-bottom: -7px; text-align: left; cursor: pointer; font-size: 12px; }
.tc-quote img { width: 30px; height: 30px; object-fit: contain; }
.tc-quote span, .tc-replybar span { display: flex; flex-direction: column; min-width: 0; }
.tc-quote b, .tc-replybar b { font-size: 11px; color: #0f766e; }
.tc-quote em, .tc-replybar em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.tc-msg.flash .tc-bubble, .tc-msg.flash .tc-card, .tc-msg.flash .tc-sticker { outline: 3px solid #fbbf24; outline-offset: 2px; border-radius: 12px; }
.tc-sticker { width: 124px; height: 124px; object-fit: contain; display: block; }
.tc-replybar { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; background: #f0fdfa; border-top: 1px solid #cfeee9; font-size: 12px; color: #456066; }
.tc-replybar[hidden] { display: none !important; }
.tc-replybar > svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: #0f766e; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tc-replybar span { flex: 1; }
.tc-replybar .tc-icon { width: 32px; height: 32px; }
.tc-pick { position: absolute; bottom: calc(100% + 6px); left: 10px; width: min(376px, calc(100% - 20px)); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 40px rgba(13,49,52,.2); z-index: 20; overflow: hidden; }
.tc-pick nav { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: #fbfdfd; overflow-x: auto; }
.tc-pick nav button { flex: 0 0 auto; width: 40px; height: 40px; padding: 3px; border: 2px solid transparent; background: transparent; border-radius: 10px; font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.tc-pick nav button:hover { background: #eef8f6; }
.tc-pick nav button.on { background: #ccfbf1; border-color: #14b8a6; }
.tc-pick nav img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tc-pickgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px; height: 256px; overflow: auto; align-content: start; }
.tc-pickgrid.em { grid-template-columns: repeat(8, 1fr); height: auto; max-height: 256px; }
.tc-pickgrid button { min-width: 0; aspect-ratio: 1; padding: 3px; border: 0; background: transparent; border-radius: 10px; font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.tc-pickgrid button:hover { background: #eef8f6; }
.tc-pickgrid img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tc-pick footer { font-size: 10.5px; line-height: 1.4; color: var(--muted); padding: 6px 10px; border-top: 1px solid var(--line); }
.tc-pick footer a { color: #0f766e; }
/* avatar, cột phải, khung tự bật (2026-10-31) */
.tc-person { border-radius: 50%; overflow: hidden; }
.tc-person img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tc-msg.in { padding-left: 38px; }
.tc-mava { position: absolute; left: 0; top: 0; width: 30px; height: 30px; font-size: 10px; }
.tc-msg.in .tc-tools { left: 42px; }
.tc-wrap.has-info { grid-template-columns: 300px minmax(0,1fr) 288px; }
.tc-info { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #fbfdfd; }
.tc-info[hidden] { display: none !important; }
.tc-dock .tc-info, .tc-dock .tc-infobtn { display: none !important; }
.tc-infobtn.on { background: #f0fdfa; border-color: #14b8a6; color: #0f766e; }
.tc-isec { display: flex; flex-direction: column; flex: 0 0 auto; min-height: 0; border-bottom: 1px solid var(--line); }
.tc-isec.fill { flex: 1 1 0; min-height: 150px; border-bottom: 0; }
.tc-ihead { display: flex; align-items: center; gap: 6px; padding: 10px 12px 6px; min-height: 42px; flex-wrap: wrap; }
.tc-ihead b { font-size: 13px; color: var(--ink); }
.tc-more { margin-left: auto; border: 0; background: none; color: #0f766e; font-weight: 700; font-size: 12px; padding: 4px 2px; white-space: nowrap; cursor: pointer; }
.tc-more:hover { text-decoration: underline; }
.tc-more.back { margin-left: 0; padding-right: 6px; }
.tc-infox { display: none; width: 30px; height: 30px; padding: 0; margin-left: auto; border: 0; background: transparent; color: #456066; border-radius: 8px; cursor: pointer; }
.tc-infox svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tc-more + .tc-infox { margin-left: 0; }
.tc-fil { display: inline-flex; gap: 4px; }
.tc-fil button { height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 11.5px; font-weight: 700; color: #456066; cursor: pointer; }
.tc-fil button.on { background: #ccfbf1; border-color: #99f6e4; color: #0f625d; }
.tc-ilist { padding: 0 12px 8px; }
.tc-ibody { flex: 1; min-height: 0; overflow: auto; padding: 4px 12px 10px; }
.tc-fit { flex: 1; min-height: 0; overflow: hidden; margin: 0 12px 8px; }
.tc-mcase { width: 100%; display: flex; align-items: center; gap: 9px; padding: 6px 8px; margin-bottom: 5px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; cursor: pointer; }
.tc-mcase:hover { border-color: #14b8a6; }
.tc-mcase .tl-ava { width: 30px; height: 30px; border-radius: 9px; font-size: 10px; }
.tc-mcase strong { font-size: 12px; }
.tc-mcase small { font-size: 10.5px; }
.tc-mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tc-mgrid button { position: relative; padding: 0; border: 0; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #0f172a; cursor: zoom-in; }
.tc-mgrid button[hidden] { display: none; }
.tc-mgrid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tc-mgrid svg { position: absolute; right: 3px; top: 3px; width: 16px; height: 16px; padding: 2px; background: #0d9488; color: #fff; border-radius: 5px; fill: none; stroke: currentColor; stroke-width: 2; }
.tc-mnote { font-size: 11px; color: var(--muted); line-height: 1.5; padding: 10px 12px; border-top: 1px solid var(--line); }
.tc-heads { position: fixed; right: 20px; bottom: 56px; display: flex; flex-direction: column-reverse; gap: 8px; z-index: 1049; }
.tc-heads[hidden] { display: none !important; }
.tc-heads.beside { right: 392px; }
.tc-heads button { position: relative; width: 50px; height: 50px; padding: 0; border: 0; border-radius: 50%; background: #ccfbf1; box-shadow: 0 8px 20px rgba(13,49,52,.24); cursor: pointer; }
.tc-heads .tl-ava { width: 50px; height: 50px; border-radius: 50%; font-size: 13px; overflow: hidden; }
.tc-heads .tc-unread { position: absolute; top: -3px; right: -3px; border: 2px solid #fff; height: 22px; }
.tc-dockbtns svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 1100px) {
  .tc-wrap.has-info { grid-template-columns: 240px minmax(0,1fr); }
  .tc-info { position: fixed; right: 0; top: 0; bottom: 0; width: min(300px, 88vw); z-index: 1060; box-shadow: -14px 0 32px rgba(13,49,52,.2); }
  .tc-infox { display: grid; place-items: center; }
}
@media (max-width: 720px) {
  .tc-wrap.has-info { grid-template-columns: 1fr; }
  .tc-heads, .tc-heads.beside { right: 12px; bottom: 590px; }
}
/* ảnh trong chat (2026-10-31, js/chat_anh.js) */
.tc-pro { position: relative; }
.tc-pro em { position: absolute; top: 0; right: -2px; font-style: normal; font-size: 8.5px; font-weight: 800; letter-spacing: .03em; color: #fff; background: #d97706; border-radius: 5px; padding: 1px 3px; line-height: 1.2; }
.tc-photo { width: 280px; max-width: 100%; background: #fff; border: 1px solid #dbe5e6; border-radius: 16px; overflow: hidden; }
.tc-photo img { display: block; width: 100%; max-height: 300px; object-fit: cover; cursor: zoom-in; background: #0f172a; }
.tc-photo p { margin: 0; padding: 8px 12px 0; font-size: 13px; line-height: 1.45; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.tc-pfoot { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; }
.tc-pfoot small { flex: 1; min-width: 0; font-size: 11px; color: var(--muted); line-height: 1.35; }
.tc-save { height: 30px; padding: 0 10px; border: 1px solid #cfdcdc; background: #fff; border-radius: 9px; font-size: 12px; font-weight: 700; color: #2c4a50; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; cursor: pointer; }
.tc-save svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tc-save:hover { background: #eef8f6; }
.tc-save.on { background: #f0fdfa; border-color: #14b8a6; color: #0f766e; }
.tc-gone { height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: #eef2f4; color: #64748b; font-size: 12px; }
.tc-gone svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tc-dropping .tc-stream { outline: 3px dashed #14b8a6; outline-offset: -8px; }
.tc-dock .tc-photo { width: 230px; }
.tc-dock .tc-compose [data-image] { width: 34px; }
.tca-bg { position: fixed; inset: 0; z-index: 100055; background: rgba(3,12,14,.72); display: flex; align-items: center; justify-content: center; padding: 18px; }
.tca-ed { width: min(1160px,100%); height: min(780px,100%); background: #fff; border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; }
.tca-ed header { display: flex; align-items: center; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tca-ed header > i { width: 1px; height: 34px; background: var(--line); margin: 0 4px; }
.tca-tool { flex: 0 0 auto; min-width: 48px; height: 54px; padding: 0 7px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 1px solid transparent; background: transparent; border-radius: 12px; font-size: 11px; font-weight: 700; color: #456066; white-space: nowrap; cursor: pointer; }
.tca-tool:hover { background: #eef8f6; }
.tca-tool.on { background: #f0fdfa; border-color: #14b8a6; color: #0f766e; }
.tca-tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tca-sw { flex: 0 0 auto; width: 24px; height: 24px; margin: 0 1px; padding: 0; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #c5d3d4; cursor: pointer; }
.tca-sw.on { box-shadow: 0 0 0 3px #0d9488; }
.tca-chip { margin-left: auto; font-size: 11.5px; font-weight: 800; color: #92400e; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 999px; padding: 4px 10px; }
.tca-stage { flex: 1; min-height: 0; position: relative; background: #0d1a1d; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 12px; }
.tca-stage canvas { display: block; touch-action: none; cursor: crosshair; background: #000; }
.tca-stage canvas.sel { cursor: default; }
.tca-stage canvas.txt { cursor: text; }
.tca-hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: rgba(6,20,24,.78); color: #e6fffb; font-size: 12.5px; padding: 6px 13px; border-radius: 999px; pointer-events: none; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.tca-pop { position: absolute; display: flex; gap: 4px; align-items: center; background: #fff; padding: 5px; border-radius: 11px; box-shadow: 0 10px 26px rgba(0,0,0,.4); z-index: 3; }
.tca-pop input { width: 170px; height: 34px; border: 1px solid #cfdcdc; border-radius: 8px; padding: 0 9px; font-size: 14px; outline: 0; }
.tca-pop input:focus { border-color: #14b8a6; }
.tca-pop button { height: 34px; padding: 0 9px; border: 0; border-radius: 8px; background: #eef8f6; color: #0f766e; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
.tca-pop button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tca-pop button.bad { background: #fef2f2; color: #b42318; }
.tca-ed footer { border-top: 1px solid var(--line); padding: 9px 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tca-strip { display: flex; gap: 6px; align-items: center; max-width: 38%; overflow-x: auto; }
.tca-strip button { flex: 0 0 46px; width: 46px; height: 46px; padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden; background: #e8eeee; color: #0f766e; display: grid; place-items: center; cursor: pointer; }
.tca-strip button.on { border-color: #0d9488; }
.tca-strip img { width: 100%; height: 100%; object-fit: cover; }
.tca-strip svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tca-ed footer input[type=text] { flex: 1; min-width: 160px; height: 42px; border: 1px solid #cfdcdc; border-radius: 12px; padding: 0 12px; font-size: 13.5px; outline: 0; }
.tca-ed footer input[type=text]:focus { border-color: #14b8a6; }
.tca-size { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.tca-size b { color: #0f766e; font-size: 13px; }
.tca-ed footer .p1-primary { height: 42px; padding: 0 16px; display: inline-flex; align-items: center; gap: 6px; }
.tca-ed footer .p1-primary svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tca-ask { z-index: 100060; }
.tca-view { position: fixed; inset: 0; z-index: 100060; background: rgba(3,12,14,.93); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px; }
.tca-vstage { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.tca-vstage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; user-select: none; transform-origin: center; }
.tca-vbar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; color: #dcecea; font-size: 12.5px; }
.tca-x { position: absolute; top: 14px; right: 14px; z-index: 2; width: 42px; height: 42px; border: 0; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.tca-x svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 720px) {
  .tca-bg { padding: 0; }
  .tca-ed { height: 100%; border-radius: 0; }
  .tca-ed header { flex-wrap: nowrap; overflow-x: auto; }
  .tca-ed header [data-ed="close"] { position: sticky; right: 0; flex: 0 0 auto; background: #fff; }
  .tca-ed footer { flex-wrap: nowrap; gap: 6px; }
  .tca-strip { max-width: 30%; }
  .tca-size { display: none; }
  .tca-ed footer input[type=text] { min-width: 0; }
}
.tc-cases { max-height: 320px; }
/* Trang Thảo luận ca, tab Đoạn chat (2026-11-01): bỏ tiêu đề + dòng phụ, khung chat chiếm hết phần còn lại của màn,
   trang không cuộn (body.tl-chatfull do chat.js syncPage bật): chỉ danh bạ, luồng tin, cột phải cuộn riêng */
#p1DiscussView .tl-top { padding: 0; }
#p1DiscussView .tl-top .p1-title-row, #p1DiscussView .tl-sub { display: none; }
#p1DiscussView .tl-tabs.flat { margin-top: 0; }
@media (min-width: 821px) {
  body.tl-chatfull { overflow: hidden; }
  body.tl-chatfull #dashboardStepContainer.p1 { padding-bottom: 0 !important; } /* 64px đệm dưới làm trang dài hơn màn */
  body.tl-chatfull #p1DiscussView { padding-top: 8px; padding-bottom: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body.tl-chatfull #p1DiscussView > [data-tl-pane="chat"] { flex: 1; min-height: 0; display: flex; }
  body.tl-chatfull #p1DiscussView .tc-wrap { flex: 1; height: auto; min-height: 0; margin: 8px 0 12px; }
  #p1DiscussView .tc-wrap { grid-template-columns: 236px minmax(0,1fr); }
}
@media (min-width: 1101px) { #p1DiscussView .tc-wrap.has-info { grid-template-columns: 236px minmax(0,1fr) 288px; } }
.tc-msg.pending.text .tc-bubble { opacity: .72; }
.tc-msg.failed .tc-bubble { background: #fef2f2 !important; color: #b42318 !important; border: 1px solid #fecaca; }
.tc-msg .tc-retry { font-size: 11px; color: #b42318; display: flex; gap: 8px; align-items: center; }
.tc-msg .tc-retry button { border: 0; background: none; color: #0f766e; font-weight: 700; font-size: 11px; cursor: pointer; padding: 0; text-decoration: underline; }
@media (max-width: 820px) {
  .tc-wrap { grid-template-columns: 1fr; height: auto; }
  .tc-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 260px; }
  .tc-main { min-height: 480px; }
  .tc-msg { max-width: 88%; }
}

/* ---------- Thảo luận ca Đợt 3: khung chat nhỏ ở góc, báo tin ---------- */
.tc-back { display: none; width: 32px; height: 32px; border: 0; background: transparent; border-radius: 9px; font-size: 22px; line-height: 1; color: #456066; cursor: pointer; flex: 0 0 auto; }
.tc-back:hover { background: #eef8f6; }
.tl-navtools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.tl-navtools .p1-btn2 { height: 34px; font-size: 12px; padding: 0 12px; }
.tc-dock { position: fixed; right: 20px; bottom: 56px; width: 360px; height: min(520px, calc(100vh - 90px)); z-index: 1050;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 60px rgba(6,48,46,.28); display: flex; flex-direction: column; overflow: hidden; color: var(--ink); }
.tc-dock[hidden] { display: none !important; }
.tc-dockbar { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 14px; background: linear-gradient(90deg,#0b5b57,#0f766e); color: #fff; }
.tc-dockbar strong { font-size: 13px; }
.tc-dockbtns { margin-left: auto; display: flex; gap: 2px; }
.tc-dockbtns button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #e6fffb; font-size: 15px; cursor: pointer; }
.tc-dockbtns button:hover { background: rgba(255,255,255,.14); }
.tc-dockpane { flex: 1; min-height: 0; display: flex; }
.tc-dock .tc-wrap { flex: 1; margin: 0; height: auto; min-height: 0; grid-template-columns: 1fr; border: 0; border-radius: 0; box-shadow: none; }
.tc-dock .tc-wrap.has-active .tc-side { display: none; }
.tc-dock .tc-wrap:not(.has-active) .tc-main { display: none; }
.tc-dock .tc-side { border-right: 0; max-height: none; }
.tc-dock .tc-back { display: inline-grid; place-items: center; }
.tc-dock .tc-head { padding: 8px 10px; gap: 8px; }
.tc-dock .tc-head .tl-ava { width: 30px; height: 30px; font-size: 11px; }
.tc-dock .tc-hbtn { height: 30px; padding: 0 8px; font-size: 11px; }
.tc-dock .tc-stream { padding: 10px; }
.tc-dock .tc-msg { max-width: 86%; }
.tc-dock .tc-card { width: 250px; }
.tc-dock .tc-compose { padding: 8px; gap: 4px; }
.tc-dock .tc-compose [data-attach].tc-icon { display: none; }
.tc-dock .tc-sendbtn { padding: 0 12px !important; }
.tc-dock .tc-sticker { width: 96px; height: 96px; }
.tc-dock .tc-tools button { width: 28px; height: 28px; }
.tc-dock .tc-tools img { width: 21px; height: 21px; }
.tc-dock .tc-quote em, .tc-dock .tc-replybar em { max-width: 220px; }
/* Nhãn vàng "Pro" (Theo dõi điều trị, Lịch hẹn, Hồ sơ theo dõi, Nhập ảnh qua mã QR) + ô ví góc trên phải Trang 1 */
.p1-pro-tag { display: inline-block; vertical-align: 1px; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 9.5px; font-weight: 900; letter-spacing: .4px; line-height: 15px;
  color: #5b3300; background: linear-gradient(135deg, #fff6c2, #fcd34d 45%, #f59e0b); border: 1px solid #f6c344; }
.p1-vitop { margin-left: auto; }
/* Dải thông báo góc dưới phải (js/ui_guard.js) né khung chat */
body.tc-docked .ortho-dock { right: 400px !important; }
.tc-settings { display: flex; flex-direction: column; gap: 10px; }
.tc-settings > label { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.tc-settings > label input { margin-top: 3px; width: 17px; height: 17px; accent-color: #0d9488; flex: 0 0 auto; }
.tc-settings > label span { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.tc-settings small { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.p1-rail-badge.pulse { animation: tcpulse 1s ease 2; }
@keyframes tcpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.35); box-shadow: 0 0 0 4px rgba(239,68,68,.35); } }
@media (max-width: 640px) {
  .tc-dock { right: 8px; left: 64px; width: auto; bottom: 52px; }
  body.tc-docked .ortho-dock { right: 16px !important; bottom: calc(100vh - 120px) !important; }
  .tl-navtools { margin-left: 0; width: 100%; }
}

/* ---------- Thảo luận ca Đợt 4: nhóm hội chẩn ---------- */
.tc-newgroup { width: 100%; height: 38px; margin: 0 0 6px; border: 1px dashed #99d8cf; border-radius: 12px; background: #f0fdfa; color: #0f766e; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.tc-newgroup:hover { background: #ccfbf1; }
.tl-ava.group { background: #e0e7ff; color: #3730a3; font-size: 16px; }
.tc-sysava { background: #0f766e; overflow: hidden; }
.tc-sysava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tc-msg.bot { max-width: min(420px, 86%); }
.tc-msg.bot .tc-bubble { border-color: #b7e4dd; }
.tc-botbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tc-botbtn { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid #99d9cf; background: #fff; color: #0f766e; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.tc-botbtn.main { background: #0f766e; border-color: #0f766e; color: #fff; }
.tc-botbtn:disabled { opacity: .55; cursor: wait; }
.tc-sysnote { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: #64748b; text-align: center; background: #fff; }
.tc-msg.sys { align-self: center; max-width: 90%; }
.tc-msg.sys span { font-size: 11px; color: #64748b; background: #eef2f4; border-radius: 999px; padding: 3px 12px; text-align: center; }
.tc-sender { font-size: 11px; font-weight: 700; color: #0f766e; padding-left: 4px; }
.tc-gh { margin: 14px 0 8px; font-size: 12.5px; color: var(--ink); }
.tc-gpick { max-height: 240px; }
.tc-leave { color: #b42318 !important; margin-right: auto; }
.tl-note input { height: 42px; border: 1px solid #cfdcdc; border-radius: 11px; padding: 0 12px; font-size: 14px; background: #fbfdfd; outline: 0; font-weight: 400; }
.tl-note input:focus { border-color: var(--t5); box-shadow: 0 0 0 4px rgba(20,184,166,.09); }

/* Theo dõi điều trị (js/td_boot.js): nút trên dòng bệnh nhân đang điều trị */
.p1-tag.td-tag { border: 1px solid #99e0d6; background: #f0fdfa; color: #0f766e; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; font-family: inherit; }
.p1-tag.td-tag svg { width: 12px; height: 12px; }
.p1-tag.td-tag:hover { background: #ccfbf1; }

/* Tài khoản phụ trong bảng Tài khoản (js/td_boot.js renderStaff) */
.p1-staff { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.p1-staff strong { font-size: 13px; }
.p1-staff small { font-size: 11px; color: var(--muted); line-height: 1.45; }
.p1-staff label { font-size: 11.5px; font-weight: 700; display: flex; flex-direction: column; gap: 3px; }
.p1-staff select, .p1-staff input { height: 32px; border: 1px solid var(--line); border-radius: 9px; padding: 0 8px; font-family: inherit; }
.p1-staff-add { display: flex; gap: 6px; } .p1-staff-add input { flex: 1; min-width: 0; }
.p1-staff button { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 0 10px; height: 32px; font-weight: 700; cursor: pointer; font-family: inherit; }
.p1-staff button:disabled { opacity: .5; cursor: not-allowed; }
.p1-staff-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; border-top: 1px solid #eef3f3; padding-top: 5px; }
.p1-staff-row button { height: 26px; color: #dc2626; }

/* Thanh tiến độ: kế hoạch 4 bước + Bắt đầu điều trị / Đang điều trị / Kết thúc (js/td_boot.js) */
/* 2026-10-24: ô điều trị rộng gấp đôi (đủ chữ); "Bắt đầu điều trị" màu hồng tím + viền đậm, khác hẳn các bước kế hoạch */
.p1-stages.tx { grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1.6fr) minmax(0, .85fr); }
.p1-stages.tx3 { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.6fr) minmax(0, .85fr); }
/* ca Lập kế hoạch nhanh: 2 bước (Thêm ảnh → Lập kế hoạch nhanh) + điều trị */
.khn2 .p1-stages { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.khn2 .p1-stages.tx { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1.6fr) minmax(0, .85fr); }
.p1-stage.tx-go { background: #fdf4ff; color: #a21caf; border: 1.5px solid #d946ef; box-shadow: 0 2px 8px -3px rgba(192,38,211,.45); }
.p1-stage.tx-go i { background: #c026d3; color: #fff; }
.p1-stage.tx-go small { font-size: 10px; font-weight: 800; }
button.p1-stage.tx-go:hover { background: #fae8ff; border-color: #c026d3; box-shadow: 0 3px 10px -4px #c026d3; }
.p1-stage.tx-on { background: #fff7ed; border-color: #f59e0b; color: #b45309; }
.p1-stage.tx-on i { background: #f59e0b; color: #fff; }
.p1-stage.tx-end { background: #f3f6f6; color: #64748b; border-style: dashed; border-color: #cbd5e1; }
.p1-stage.tx-done { background: #eef2ff; color: #4338ca; } .p1-stage.tx-done i { background: #4f46e5; color: #fff; }
.p1-prog.tx-active { --c:#b45309; --s:#fff7ed; }.p1-staff-perms { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; padding: 2px 0 4px; }
.p1-staff-perms label { flex-direction: row; align-items: center; gap: 4px; font-weight: 500; }
.p1-staff-perms input { height: auto; }
/* 2026-10-24: dải báo đang lưu PDF nền sau khi xuất PPTX (js/case_manager_dashboard.js savePdfAfterPptx) */
.p1-pdfjob { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 99990; display: flex; align-items: center; gap: 9px; max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: 999px; font: 600 13px "Be Vietnam Pro", system-ui, sans-serif; color: #7c2d12; background: #fff7ed; border: 1.5px solid #fb923c; box-shadow: 0 10px 30px -10px rgba(124,45,18,.45); }
.p1-pdfjob[hidden] { display: none !important; }
.p1-pdfjob.ok { color: #065f46; background: #ecfdf5; border-color: #34d399; }
.p1-pdfjob.bad { color: #991b1b; background: #fef2f2; border-color: #f87171; }
.p1-pdfjob .p1-spin { width: 14px; height: 14px; border: 2px solid #fdba74; border-top-color: #ea580c; border-radius: 50%; animation: p1pdfspin .8s linear infinite; flex: 0 0 auto; }
@keyframes p1pdfspin { to { transform: rotate(360deg); } }

/* Màn cảm ứng (iPad, 2026-10-31) */
@media (pointer: coarse) {
  .p1-mini { min-height: 32px; }
  .p1-stage { min-height: 34px; }
  .p1-mini-x { min-width: 32px; min-height: 32px; }
}

/* ---------- Chat 2026-11-01: ảnh chờ gửi, PDF kế hoạch, xem ca cạnh chat, chuyển động ---------- */
.tc-sendbtn { display: inline-flex; align-items: center; gap: 6px; overflow: hidden; }
.tc-sendbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.tc-dock .tc-sendbtn span { display: none; }
/* ảnh đang gửi (js/chat.js hàng chờ) */
.tc-pwrap { position: relative; display: block; }
.tc-msg.pending .tc-photo img { opacity: .62; filter: saturate(.8); cursor: default; }
.tc-msg.pending.failed .tc-photo { border-color: #fca5a5; }
.tc-msg.pending.failed .tc-photo img { opacity: .4; }
.tc-spin { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 3px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: p1spin .8s linear infinite; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.tc-pfoot small.bad { color: #b42318; font-weight: 700; }
/* tab Kế hoạch: bản PDF đã xuất */
.tl-recbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; font-size: 12px; font-weight: 700; color: #0f766e; }
.tl-recbar > span { flex: 1; min-width: 200px; display: inline-flex; align-items: center; gap: 6px; }
.tl-recbar.old { color: #9a4d00; background: #fff7ed; border: 1px solid #fdba74; border-radius: 12px; padding: 8px 10px; }
.tl-recbar .p1-btn2 { height: 34px; font-size: 12px; }
/* ảnh lớn trong khung xem ca (js/pan_zoom.js) */
.tl-zoomv .tca-vstage img { max-height: calc(100vh - 80px); }
.tl-zoomv .tca-vbar span { color: #dcecea; }
/* nút Thu gọn + chế độ ca bên trái, chat bên phải */
.tl-splitbtn { margin-left: auto; height: 36px; font-size: 12.5px; flex: 0 0 auto; }
.tl-splitbtn .p1-ic { width: 17px; height: 17px; }
.tl-splitbtn + .p1-x { margin-left: 0; }
#p1CaseViewer.tl-split { inset: 0 auto 0 0; width: var(--tc-split, 60%); padding: 0; background: transparent; backdrop-filter: none; display: flex; }
#p1CaseViewer.tl-split .tl-viewer { width: 100%; height: 100%; max-height: none; border-radius: 0; display: flex; flex-direction: column; box-shadow: none; }
#p1CaseViewer.tl-split .p1-mhead { padding: 14px 18px 12px; }
#p1CaseViewer.tl-split .tl-tabs { padding: 6px 18px 0; }
#p1CaseViewer.tl-split .tl-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 18px 18px; }
#p1CaseViewer.tl-split .tl-recbody:not([hidden]) { display: flex; flex-direction: column; }
#p1CaseViewer.tl-split .tl-record { flex: 1; height: auto; min-height: 300px; }
#p1CaseViewer.tl-split .tl-splitbtn { display: none; }
.tl-splitbar { position: absolute; top: 0; bottom: 0; right: -6px; width: 12px; cursor: col-resize; z-index: 3; touch-action: none; }
.tl-splitbar::after { content: ''; position: absolute; top: 50%; left: 4px; width: 4px; height: 48px; margin-top: -24px; border-radius: 4px; background: #9fb7b8; transition: background .15s, height .15s; }
.tl-splitbar:hover::after { background: #0d9488; height: 72px; margin-top: -36px; }
body.tl-splitting { cursor: col-resize; user-select: none; }
body.tl-splitting iframe { pointer-events: none; }
body.tc-split #p1ChatDock { left: var(--tc-split, 60%); right: 0; top: 0; bottom: 0; width: auto; height: auto; border: 0; border-left: 1px solid var(--line); border-radius: 0; box-shadow: -10px 0 30px rgba(6,48,46,.14); }
body.tc-split .tc-dockbtns [data-dock="min"], body.tc-split .tc-dockbtns [data-dock="full"], body.tc-split .tc-dockbtns [data-dock="close"] { display: none; }
.tc-dockbtns .tc-unsplit { display: none; }
body.tc-split .tc-dockbtns .tc-unsplit { display: grid; place-items: center; width: 34px; height: 34px; background: rgba(255,255,255,.14); }
body.tc-split .tc-heads { display: none !important; }
body.tc-split .tc-dock .tc-msg { max-width: 82%; }
body.tc-split .tc-dock .tc-photo, body.tc-split .tc-dock .tc-card { width: 280px; }
body.tc-split .tc-dock .tc-sendbtn span { display: inline; }
body.tc-split .ortho-dock { right: calc(100% - var(--tc-split, 60%) + 16px) !important; }
@media (max-width: 760px) { /* màn hẹp: ca ở trên, chat ở dưới */
  #p1CaseViewer.tl-split { width: 100%; bottom: 50%; }
  body.tc-split #p1ChatDock { left: 0; top: 50%; border-left: 0; border-top: 1px solid var(--line); }
  .tl-splitbar { display: none; }
}
/* hạt bắn khi thả cảm xúc (js/chat_motion.js) */
.tc-particle { position: fixed; z-index: 100070; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .tc-msg:hover .tc-tools, .tc-msg.tap .tc-tools { animation: tcToolsIn .22s cubic-bezier(.34,1.56,.64,1); transform-origin: bottom center; }
  .tc-msg.out:hover .tc-tools { transform-origin: bottom right; }
  .tc-msg.in:hover .tc-tools { transform-origin: bottom left; }
  .tc-msg:hover .tc-tools button, .tc-msg.tap .tc-tools button { animation: tcToolIn .3s cubic-bezier(.34,1.56,.64,1) backwards; }
  .tc-tools button:nth-child(2) { animation-delay: .02s !important; }
  .tc-tools button:nth-child(3) { animation-delay: .04s !important; }
  .tc-tools button:nth-child(4) { animation-delay: .06s !important; }
  .tc-tools button:nth-child(5) { animation-delay: .08s !important; }
  .tc-tools button:nth-child(6) { animation-delay: .1s !important; }
  .tc-tools button:hover img { animation: tcWiggle .5s ease-in-out; }
  .tc-tools button:active { transform: scale(.85); }
  .tc-reacts button { transition: transform .15s, background .15s; }
  .tc-reacts button:hover { transform: translateY(-1px); }
  .tc-reacts button:active { transform: scale(.9); }
  .tc-replybar:not([hidden]) { animation: tcSlideUp .24s cubic-bezier(.34,1.56,.64,1); }
  .tc-pick:not([hidden]) { animation: tcPop .2s cubic-bezier(.34,1.56,.64,1); transform-origin: bottom left; }
  .tc-dock:not([hidden]) { animation: tcDockIn .26s cubic-bezier(.34,1.56,.64,1); transform-origin: bottom right; }
  body.tc-split .tc-dock:not([hidden]) { animation: tcSlideLeft .3s cubic-bezier(.22,1,.36,1); }
  #p1CaseViewer.tl-split .tl-viewer { animation: tcSlideRight .3s cubic-bezier(.22,1,.36,1); }
  .tc-heads button { animation: tcPop .3s cubic-bezier(.34,1.56,.64,1); }
  .tc-sendbtn:active, .tc-icon:active { transform: scale(.92); }
  .tc-sendbtn, .tc-icon { transition: transform .12s, background .15s; }
  .tc-receipt.seen { animation: tcFade .3s ease; }
  .tc-photo img[data-photo] { transition: transform .25s ease, filter .25s; }
  .tc-photo:hover img[data-photo] { filter: brightness(1.04); }
}
@keyframes tcToolsIn { from { opacity: 0; transform: translateY(6px) scale(.85); } }
@keyframes tcToolIn { from { opacity: 0; transform: translateY(5px) scale(.4); } }
@keyframes tcWiggle { 0%, 100% { transform: none; } 25% { transform: rotate(-12deg) scale(1.1); } 50% { transform: rotate(10deg) scale(1.15); } 75% { transform: rotate(-4deg); } }
@keyframes tcSlideUp { from { opacity: 0; transform: translateY(10px); } }
@keyframes tcPop { from { opacity: 0; transform: scale(.85); } }
@keyframes tcDockIn { from { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes tcSlideLeft { from { opacity: .3; transform: translateX(40px); } }
@keyframes tcSlideRight { from { opacity: .3; transform: translateX(-40px); } }
@keyframes tcFade { from { opacity: 0; } }
/* ---------- Xem ca 2026-11-02: đầu 3 dòng, ảnh lớn có ‹ ›, phóng to kế hoạch ---------- */
.tl-head { padding: 10px 22px 8px; align-items: center; }
.tl-hcopy { min-width: 0; flex: 1; }
.tl-hline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-head .tl-ro { margin-top: 0; padding: 1px 8px; font-size: 10.5px; }
.tl-hname { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; min-width: 0; }
.tl-head h2 { margin: 2px 0 0; }
.tl-head p { font-size: 12.5px; font-weight: 600; }
.tl-viewer .tl-tabs { padding-top: 0; padding-left: 22px; padding-right: 22px; align-items: center; }
.tl-viewer .tl-tabs button[data-tab] { height: 36px; }
.tl-viewer .tl-body { padding-top: 14px; }
#p1CaseViewer.tl-split .tl-head { padding: 8px 16px 6px; }
#p1CaseViewer.tl-split .tl-tabs { padding: 0 16px; }
#p1CaseViewer.tl-split .tl-body { padding-top: 12px; }
.tl-maxbtn { margin-left: auto; height: 30px; padding: 0 10px; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.tl-maxbtn[hidden] { display: none !important; }
.tl-maxbtn .p1-ic { width: 15px; height: 15px; }
#p1CaseViewer.tl-max { z-index: 100066; }
#p1CaseViewer.tl-max .tl-recbody { position: fixed; inset: 0; z-index: 1; margin: 0; padding: 52px 12px 12px; background: #eef3f2; display: flex; flex-direction: column; min-height: 0; }
#p1CaseViewer.tl-max .tl-record { flex: 1; height: auto; min-height: 0; }
/* Điện thoại: PDF kế hoạch vẽ thành ảnh từng trang (js/case_viewer.js vePdf, 2026-11-23) */
.tl-pdfpages { height: 72vh; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #eef3f2; border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.tl-pdfpage { margin: 0; cursor: zoom-in; }
.tl-pdfpage img { display: block; width: 100%; height: auto; background: #fff; border-radius: 6px; box-shadow: 0 1px 4px rgba(6,48,46,.15); }
#p1CaseViewer.tl-split .tl-pdfpages, #p1CaseViewer.tl-max .tl-pdfpages { flex: 1; height: auto; min-height: 0; }
#p1CaseViewer.tl-max .tl-maxbtn { position: fixed; top: 10px; right: 12px; z-index: 2; height: 34px; background: #fff; box-shadow: 0 4px 14px rgba(6,48,46,.18); }
.tl-znav { position: absolute; top: 50%; z-index: 2; width: 48px; height: 64px; margin-top: -32px; border: 0; border-radius: 14px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .15s; }
.tl-znav:hover { background: rgba(255,255,255,.26); }
.tl-znav:active { transform: scale(.92); }
.tl-znav.prev { left: 14px; } .tl-znav.next { right: 14px; }
.tl-znav .p1-ic, .tl-znav svg { width: 28px; height: 28px; }
@media (max-width: 640px) {
  .tl-head { padding: 8px 14px 6px; }
  .tl-viewer .tl-tabs { padding-left: 14px; padding-right: 14px; }
  .tl-znav { width: 40px; height: 52px; margin-top: -26px; background: rgba(0,0,0,.35); }
  .tl-znav.prev { left: 6px; } .tl-znav.next { right: 6px; }
  .tl-maxbtn span { display: none; }
}
