:root{--navy:#0b3158;--blue:#1169cf;--bg:#f4f8fc;--border:#dbe7f3;--text:#0b2e5b}*{box-sizing:border-box}body{margin:0;background:var(--bg);font-family:Segoe UI,Arial,sans-serif;color:var(--text)}.sidebar{position:fixed;width:280px;inset:0 auto 0 0;background:linear-gradient(180deg,#092d51,#164a76);color:#fff;padding:18px 10px;z-index:3}.brand{display:flex;gap:12px;align-items:center;font-weight:700;font-size:17px;padding:0 12px 20px}.brand img{width:58px;height:58px;object-fit:contain;background:#fff;border-radius:50%;padding:3px}.sidebar nav{display:grid;gap:5px}.sidebar a{color:#eef7ff;text-decoration:none;padding:13px 18px;border-radius:7px;display:flex;gap:14px;align-items:center}.sidebar a:hover{background:#1470c9}.sidebar i{width:22px;text-align:center}main{margin-left:280px}.topbar{height:68px;background:#fff;display:flex;justify-content:space-between;align-items:center;padding:0 28px;box-shadow:0 1px 5px #dce5ef;position:sticky;top:0;z-index:2}.content{padding:24px}.hero{background:linear-gradient(90deg,rgba(246,251,255,.98),rgba(246,251,255,.80)),url('/images/trung-tam.jpg') right center/55% auto no-repeat;border:1px solid var(--border);border-radius:12px;padding:26px 30px}.hero h1{font-size:38px;font-weight:800;margin:0}.hero h2{color:#1671dd;font-size:32px;font-weight:800}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:14px 0}.kpi,.panel{background:#fff;border:1px solid var(--border);border-radius:10px;box-shadow:0 2px 8px rgba(29,74,115,.04)}.kpi{padding:18px}.kpi .value{font-size:35px;font-weight:800;color:#1270d9}.grid-main{display:grid;grid-template-columns:1fr 1fr 300px;gap:12px}.panel{padding:16px}.panel h3{font-size:18px;font-weight:800}.qr{text-align:center;grid-row:span 2}.qr img{width:260px;max-width:100%}.inventory{grid-column:1/3;display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.inv{background:#f8fbff;border-radius:8px;padding:14px;text-align:center}.inv b{font-size:25px}.table-card{background:#fff;border:1px solid var(--border);border-radius:10px;padding:20px}.page-title{font-weight:800;margin-bottom:18px}@media(max-width:1100px){.sidebar{width:220px}.brand span{font-size:13px}main{margin-left:220px}.cards{grid-template-columns:repeat(2,1fr)}.grid-main{grid-template-columns:1fr}.qr{grid-row:auto}.inventory{grid-column:auto;grid-template-columns:repeat(2,1fr)}}
.page-head,.dashboard-toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px}.page-head h2{margin:0;color:#0b2e63;font-weight:800}.page-head p{margin:4px 0 0;color:#6b7b91}.dashboard-toolbar form{max-width:430px}.dashboard-toolbar input{min-width:180px}.form-panel{margin-bottom:18px}.form-panel h3{font-size:18px;color:#0b2e63;border-bottom:1px solid #e6edf6;padding-bottom:10px;margin-bottom:16px}.form-panel h4{font-size:16px;color:#244a78;margin:15px 0 10px}.form-panel label{font-size:13px;font-weight:600;color:#52657c;margin-bottom:5px}.admin-tabs{position:sticky;top:66px;z-index:5;background:#fff;border:1px solid #e3ebf5;border-radius:12px;padding:10px;margin-bottom:16px;display:flex;gap:8px;flex-wrap:wrap;box-shadow:0 4px 14px #173b6a0d}.admin-tabs a{text-decoration:none;color:#164b86;background:#f1f6fb;padding:7px 12px;border-radius:8px;font-size:13px}.patient-admin{display:flex;justify-content:space-between;align-items:center;border:1px solid #e6edf5;border-radius:10px;padding:12px;margin-bottom:8px}.empty-state{text-align:center;background:#fff;border:1px dashed #cbd9e9;border-radius:16px;padding:55px 20px;color:#64748b}.empty-state i{font-size:42px;color:#7aa6d8;margin-bottom:15px}.empty-state h3{color:#173b6a}.table form{margin:0}@media(max-width:768px){.page-head,.dashboard-toolbar{align-items:stretch;flex-direction:column}.admin-tabs{position:static}}
.dept-add-grid{display:grid;grid-template-columns:130px 2fr 150px 110px 150px 100px;gap:10px;align-items:end}.check-line{display:flex;align-items:center;gap:7px;height:38px}.dept-table .actions{display:flex;gap:6px}.dept-table input[type=checkbox]{width:18px;height:18px}.input-table{table-layout:fixed}.input-table th{vertical-align:middle;text-align:center;background:#f4f8fc;color:#153e70}.input-table td{vertical-align:middle}.input-table .form-control{min-width:0}.input-table .code{display:block;color:#789;font-size:11px;margin-top:2px}.readonly{background:#eef3f8!important;font-weight:700}.kcb-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.subtable-title{font-size:15px;font-weight:800;color:#0b4b8f;background:#eef6ff;border-left:4px solid #1671dd;padding:8px 12px;border-radius:5px}.inpatient-table th,.inpatient-table td{text-align:center}.inpatient-table th:first-child,.inpatient-table td:first-child{text-align:left;width:24%}.inpatient-table input{text-align:center}@media(max-width:1100px){.dept-add-grid{grid-template-columns:1fr 2fr 1fr}.kcb-grid{grid-template-columns:repeat(2,1fr)}}
/* Dashboard desktop: ưu tiên hiển thị trọn trong một màn hình 1080p */
.dashboard-page .dashboard-toolbar{margin-bottom:8px;height:38px}.dashboard-page .dashboard-toolbar .form-control,.dashboard-page .dashboard-toolbar .btn{height:36px;padding-top:5px;padding-bottom:5px}.dashboard-page .hero{padding:12px 20px}.dashboard-page .hero h1{font-size:27px}.dashboard-page .hero h2{font-size:23px;margin:2px 0}.dashboard-page .hero .fs-5{font-size:14px!important}.dashboard-page .hero p{margin:5px 0;font-size:13px}.dashboard-page .cards{margin:8px 0;gap:8px}.dashboard-page .kpi{padding:9px 14px}.dashboard-page .kpi .value{font-size:26px;line-height:30px}.dashboard-page .kpi small{font-size:11px}.dashboard-page .grid-main{gap:8px;grid-template-columns:1fr 1fr 250px}.dashboard-page .panel{padding:9px}.dashboard-page .panel h3{font-size:14px;margin:0 0 5px}.dashboard-page canvas{max-height:190px!important}.dashboard-page .qr img{width:205px}.dashboard-page .qr small{font-size:11px}.dashboard-page .qr .alert{font-size:11px;margin:5px 0 0}.dashboard-page .inventory{gap:5px}.dashboard-page .inv{padding:5px}.dashboard-page .inv b{font-size:19px}.dashboard-page .inv span{font-size:11px}.dashboard-page .grid-main>.panel:not(.qr):not(.inventory){font-size:11px}.dashboard-page .grid-main>.panel:not(.qr):not(.inventory) small{font-size:10px}
@media(min-width:1200px) and (min-height:850px){body:has(.dashboard-page){overflow:hidden}body:has(.dashboard-page) .content{padding:12px 18px}body:has(.dashboard-page) .topbar{height:58px}.dashboard-page{height:calc(100vh - 82px);overflow:hidden}}
/* V1.4 - bảng nghiệp vụ ngân hàng máu */
.blood-receive-table,.inventory-input-table,.issue-table{table-layout:fixed;margin-top:10px}.blood-receive-table thead th,.inventory-input-table thead th,.issue-table thead th{background:#edf5fd;color:#103d70;text-align:center;vertical-align:middle;border-color:#cfddec}.blood-receive-table td,.inventory-input-table td,.issue-table td{vertical-align:middle;text-align:center}.blood-receive-table th:first-child{width:24%}.inventory-input-table th:first-child{width:25%}.issue-table th:first-child{width:12%}.blood-receive-table input,.inventory-input-table input,.issue-table input{text-align:center;padding-left:6px;padding-right:6px}.blood-receive-table tbody tr:nth-child(even),.inventory-input-table tbody tr:nth-child(even),.issue-table tbody tr:nth-child(even){background:#fafcff}.issue-table tfoot th{background:#f2f7fc;text-align:center}.form-panel .subtable-title{margin-bottom:10px}

/* V1.5 - bảng nhập và xem báo cáo dùng chung bố cục */
.form-panel form > .btn-primary{display:block;margin-left:auto;margin-top:14px}
[id="chung"],[id="nhanluc"],[id="kcb"],[id="mau"],[id="capphat"],[id="benhnhan"]{scroll-margin-top:145px}
.report-actions{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.exam-table{min-width:920px;margin-top:10px}.exam-table th,.exam-table td{text-align:center;vertical-align:middle}.exam-table th:last-child{width:17%}.exam-table input{text-align:center;padding:6px}
.inventory-input-table{min-width:850px}.inventory-input-table th:first-child{width:22%}.inventory-input-table th:nth-child(2){width:7%}
.issue-table{min-width:1080px;table-layout:fixed}.issue-table .issue-location{width:6%}.issue-table .issue-department{width:16%}.issue-table th:first-child{width:auto}.issue-table .group-end{border-right:2px solid #b7cadf}.issue-table{border:1px solid #b7cadf}.issue-table thead{border-bottom:2px solid #b7cadf}.issue-table td[rowspan]{border-right:1px solid #b7cadf}.issue-table tfoot{border-top:2px solid #b7cadf}.issue-table tfoot tr:last-child{border-top:1px solid #b7cadf}
.edit-target{outline:2px solid #78b4f1;outline-offset:3px}
