*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,sans-serif;background:#f3f6fb;color:#172033}.topbar{background:#17365d;color:#fff;padding:14px 22px;display:flex;justify-content:space-between;align-items:center;gap:12px}.brand{font-weight:750}.brand small{display:block;font-size:12px;font-weight:400;opacity:.85}.userbox{font-size:13px}.userbox a{color:#fff;margin-left:12px}.container{max-width:1200px;margin:22px auto;padding:0 16px}.nav{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}.nav a,.btn{background:#eaf0f8;color:#17365d;border:0;border-radius:9px;padding:10px 13px;text-decoration:none;font-weight:650;display:inline-block;cursor:pointer}.btn.primary{background:#ef8b24;color:#fff}.btn.danger{background:#c93636;color:#fff}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.card{background:#fff;border-radius:14px;padding:18px;box-shadow:0 3px 14px #17365d0c;border:1px solid #e4eaf2}.metric{font-size:28px;font-weight:800;margin-top:8px}.muted{color:#66758a;font-size:13px}.tablewrap{overflow:auto;background:#fff;border-radius:12px;border:1px solid #e2e8f0}table{border-collapse:collapse;width:100%;min-width:720px}th,td{text-align:left;padding:11px 12px;border-bottom:1px solid #edf0f5;font-size:14px}th{background:#f7f9fc;color:#33445e}.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.field label{display:block;font-size:13px;font-weight:700;margin-bottom:5px}.field input,.field select,.field textarea{width:100%;padding:11px;border:1px solid #cbd5e1;border-radius:8px;background:#fff}.alert{padding:12px 14px;border-radius:9px;background:#fff4df;color:#7a4a00;margin:12px 0}.success{background:#e5f7ed;color:#17623b}.login{max-width:440px;margin:50px auto}.footer{text-align:center;color:#8491a3;font-size:12px;padding:28px}.groupchips{display:flex;flex-wrap:wrap;gap:8px}.groupchips span{background:#eef3fb;border-radius:20px;padding:7px 11px;font-size:13px}@media(max-width:760px){.topbar{align-items:flex-start;flex-direction:column}.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.formgrid{grid-template-columns:1fr}.container{margin:14px auto}.metric{font-size:24px}}@media(max-width:420px){.grid{grid-template-columns:1fr 1fr}.card{padding:13px}}

/* Nhận diện bệnh viện và cấu hình responsive */
.brandlockup{display:flex;align-items:center;gap:12px;color:#fff;text-decoration:none;min-width:0}.brand-logo{width:48px;height:48px;object-fit:contain;background:#fff;border-radius:10px;padding:4px}.brand-placeholder{width:48px;height:48px;display:grid;place-items:center;background:#ffffff20;border-radius:10px;font-size:26px}.brand strong{display:block;font-size:15px;letter-spacing:.1px}.brand small{display:block;font-size:12px;font-weight:400;opacity:.85;margin-top:3px}.userbox{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.userbox a{color:#fff}.pagehead{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.pagehead h1{margin:4px 0;font-size:26px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:1.6px;color:#dceaff}.eyebrow.dark{color:#526783}.settings-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(300px,.8fr);gap:18px;align-items:start}.settings-layout h2{font-size:18px;margin:0 0 18px}.image-preview{border:1px dashed #bac7d8;background:#f7f9fc;border-radius:12px;display:flex;align-items:center;justify-content:center;overflow:hidden;color:#718096;font-size:13px}.logo-preview{height:150px;width:100%;max-width:280px}.logo-preview img{max-width:100%;max-height:100%;object-fit:contain;padding:12px}.banner-preview{height:180px;width:100%;margin-top:8px}.banner-preview img{width:100%;height:100%;object-fit:cover}.form-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:22px}.brand-preview{border:1px solid #dce4ef;border-radius:14px;overflow:hidden;background:#fff}.brand-preview-head{display:flex;align-items:center;gap:10px;padding:14px;background:#17365d;color:#fff;min-height:76px}.brand-preview-head img{width:42px;height:42px;object-fit:contain;background:white;border-radius:8px;padding:3px}.brand-preview-head strong,.brand-preview-head small{display:block}.brand-preview-head strong{font-size:11px;line-height:1.4}.brand-preview-head small{font-size:11px;opacity:.8;margin-top:3px}.brand-preview-banner{height:135px;background:#dce8f5 center/cover no-repeat;display:grid;place-items:center;color:#4b5e78;font-size:13px}.brand-preview-body{padding:20px}.brand-preview-body>span{font-size:11px;font-weight:800;color:#33445e}.preview-line{height:10px;background:#edf1f6;border-radius:5px;margin-top:15px}.preview-line.short{width:70%;margin-top:8px}.preview-button{margin-top:18px;border-radius:7px;background:#ef8b24;color:white;padding:10px;text-align:center;font-size:12px;font-weight:700}.login-layout{max-width:1120px;margin:30px auto;padding:0 16px;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);gap:22px;align-items:stretch}.login-layout .login{width:100%;max-width:none;margin:0;align-self:center}.login-banner{min-height:460px;border-radius:16px;background-size:cover;background-position:center;display:flex;align-items:flex-end;padding:32px;color:#fff;background-color:#17365d}.login-banner h1{font-size:clamp(24px,3vw,38px);line-height:1.2;margin:10px 0}.login-banner p{margin:0;font-size:16px}.login-banner-default{background-image:linear-gradient(135deg,#17365d,#2e6792 60%,#78a7c7)}@media(max-width:800px){.settings-layout,.login-layout{grid-template-columns:1fr}.login-banner{min-height:250px;padding:22px}.pagehead h1{font-size:22px}.userbox{font-size:12px}.brand strong{font-size:13px}}@media(max-width:480px){.brand-logo,.brand-placeholder{width:40px;height:40px}.brand strong{font-size:11px}.topbar{padding:12px}.userbox{gap:8px}.form-actions .btn{width:100%;text-align:center}.banner-preview{height:125px}}

/* Giao diện MSGBP 2.0 - bố cục kiểu dashboard bệnh viện */
:root{--navy:#063765;--navy2:#0a477c;--blue:#0878ce;--line:#d9e4f1;--green:#08a04b;--orange:#ef8b24;--red:#d9343e}
body{background:#f1f5fb;color:#10243e}
.topbar{height:64px;padding:8px 22px;background:linear-gradient(100deg,#064477,#032b53);box-shadow:0 3px 12px #062b4c20;position:sticky;top:0;z-index:30}
.menu-toggle{border:0;background:transparent;color:white;font-size:25px;cursor:pointer;margin-right:8px}
.brandlockup{flex:1}.brand-logo,.brand-placeholder{width:42px;height:42px;border-radius:50%}.brand strong{font-size:15px;letter-spacing:.1px}.brand small{font-size:12px}
.top-actions{display:flex;align-items:center;gap:16px;color:#fff}.top-icon{font-size:22px;color:#dcecff}.top-actions>a{color:#dcecff;font-size:12px}.top-actions .userbox{display:flex;flex-direction:column;gap:0;line-height:1.2}.top-actions .userbox strong{font-size:13px}.top-actions .userbox small{font-size:11px;color:#d6e7f8}
.user-avatar{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#e5f1ff;color:#3474ad;font-size:20px;border:2px solid #fff}
.sidebar{position:fixed;z-index:25;top:64px;bottom:0;left:0;width:248px;overflow-y:auto;background:linear-gradient(180deg,#073c6a,#052d52);padding:14px 9px 18px;color:#fff;box-shadow:4px 0 12px #072b4c12}
.sidebar-caption{font-size:10px;letter-spacing:1.1px;color:#92b9dc;font-weight:800;padding:13px 13px 7px}
.side-link{display:flex;align-items:center;gap:12px;color:#eaf4ff;text-decoration:none;padding:10px 12px;border-radius:9px;font-size:13px;font-weight:650;margin:2px 0;transition:.15s}
.side-link:hover,.side-link:focus{background:#ffffff18;color:#fff}.side-link.active{background:#0878ce;color:#fff;box-shadow:0 5px 12px #001c3a30}
.side-icon{font-size:19px;width:22px;text-align:center}.side-sub{padding:7px 12px;font-weight:500;font-size:12px;color:#d6e8f8}
.sidebar-user{margin:26px 4px 12px;padding:12px 9px;border-radius:12px;background:#ffffff12;display:flex;align-items:center;gap:10px;font-size:12px}.sidebar-user .user-avatar{flex-shrink:0}.sidebar-user strong,.sidebar-user small{display:block}.sidebar-user small{opacity:.7;margin-top:4px}.sidebar-version{padding:4px 12px;color:#9dbbd6;font-size:11px}
body.has-sidebar .container{max-width:none;width:auto;margin:22px 16px 22px 264px;padding:0 8px}
body.has-sidebar .footer{margin-left:248px}
body.guest .container{margin-left:auto}
.pagehead{align-items:center;gap:14px}.pagehead h1{font-size:25px;color:#102e52}.page-actions{display:flex;gap:8px;flex-wrap:wrap}
.btn{border:1px solid #d7e3f1;box-shadow:0 1px 2px #0a37620b;transition:transform .12s,box-shadow .12s}.btn:hover{transform:translateY(-1px);box-shadow:0 4px 12px #0a37621c}.btn.primary{background:#0878ce;color:#fff;border-color:#0878ce}.btn.success-btn{background:#08a04b;color:#fff;border-color:#078b41}.btn.danger{background:#d9343e;color:#fff;border-color:#d9343e}.full-btn{width:100%;margin-top:14px}
.card{border-color:#dce6f2;box-shadow:0 4px 18px #123b6208;border-radius:13px}
.grid{gap:14px}.metric{color:#092e55}
.maintenance-page .pagehead{margin-bottom:14px}.maintenance-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin:12px 0 14px}
.kpi{min-height:76px;border-radius:12px;padding:13px 15px;display:flex;align-items:center;gap:13px;border:1px solid #dce7f4;background:#fff}
.kpi>span{display:grid;place-items:center;width:45px;height:45px;border-radius:50%;font-size:26px;font-weight:800;background:#e6f2ff;color:#0878ce;flex-shrink:0}.kpi small{display:block;font-size:12px;color:#344760;font-weight:650}.kpi strong{display:block;font-size:25px;line-height:1.2;margin-top:2px;color:#102f54}
.kpi-green{background:#e7fbf0;border-color:#c3efd7}.kpi-green>span{background:#baf0cf;color:#079449}.kpi-green strong{color:#087e3d}
.kpi-orange{background:#fff3e5;border-color:#f6dfc6}.kpi-orange>span{background:#ffe0bd;color:#d76b0a}.kpi-orange strong{color:#a84a08}
.kpi-purple{background:#f0efff;border-color:#dbd9ff}.kpi-purple>span{background:#d9d8ff;color:#3b49c8}.kpi-purple strong{color:#293ca8}
.kpi-red{background:#fff0f1;border-color:#f6d0d4}.kpi-red>span{background:#ffd8dc;color:#d52b36}.kpi-red strong{color:#b9212d}
.list-card{padding:12px;margin-bottom:15px}.tabbar{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}.tab{border-radius:8px;background:#eef3f9;border:1px solid #dce5f0;color:#213c5c;text-decoration:none;padding:9px 12px;font-size:12px;font-weight:750}.tab.active{background:#0878ce;color:#fff;border-color:#0878ce}
.filterbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:10px 0 12px}.filterbar input,.filterbar select{padding:10px 12px;border:1px solid #cbd9e9;border-radius:8px;background:#fff;min-width:160px;flex:1}.filterbar .btn{padding:9px 13px}
.maint-table{min-width:1000px}.maint-table th{background:#edf4fc;color:#1a3657;font-size:12px;white-space:nowrap}.maint-table td{font-size:12px;padding:10px 9px}.maint-table tr:hover td{background:#f6faff}.maint-table .selected-row td{background:#fff3d2}.record-link{color:#064c9b;font-weight:800;text-decoration:none}.table-sub{display:block;color:#71829a;font-size:11px;margin-top:3px}.type-pill,.status-pill{display:inline-block;border-radius:20px;padding:5px 10px;white-space:nowrap;font-size:11px;font-weight:800}.type-pill{background:#dff0ff;color:#075da5}.status-planned{background:#e9eff8;color:#52657e}.status-in_progress{background:#dceeff;color:#0769b2}.status-completed{background:#c8f6d5;color:#087b39}.status-overdue{background:#ffe0e2;color:#bb2531}.status-cancelled{background:#e8e8e8;color:#606770}.actions a{display:inline-block;color:#07549a;font-weight:900;font-size:17px;text-decoration:none;margin-right:7px}
.maintenance-detail-grid{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(290px,1fr);gap:14px;align-items:start}.detail-card{padding:0;overflow:hidden}.panel-title{background:linear-gradient(90deg,#086dbb,#0b85d5);color:#fff;font-weight:800;padding:11px 14px;border-radius:10px 10px 0 0}.detail-card>.panel-title{border-radius:12px 12px 0 0}.detail-card> :not(.panel-title){margin-left:14px;margin-right:14px}
.workflow{display:flex;align-items:center;justify-content:space-around;gap:6px;background:#f4f8fd;border:1px solid #e0e9f5;border-radius:10px;padding:13px 8px;margin-top:12px!important}.workflow>span{color:#52708e;font-size:20px}.workflow-step{display:flex;align-items:center;flex-direction:column;text-align:center;gap:3px;min-width:0}.workflow-step>b{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#cfd7e2;color:#fff;font-size:20px}.workflow-step strong{font-size:11px}.workflow-step small{font-size:10px;color:#687a91}.workflow-step.done>b{background:#0aa34d}.workflow-step.active-step>b{background:#f39a18}.workflow-step.failed-step>b{background:#df3542}.workflow-step.muted-step{opacity:.6}
.detail-columns{display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:12px 0 16px}.detail-columns h3{font-size:13px;color:#173d66;border-bottom:1px solid #e1eaf4;padding-bottom:8px;margin:10px 0}.detail-list{display:grid;grid-template-columns:115px 1fr;gap:8px;margin:0;font-size:12px}.detail-list dt{font-weight:750;color:#586a81}.detail-list dd{margin:0;overflow-wrap:anywhere}.inline-status{display:flex;gap:8px;margin-top:15px}.inline-status select{min-width:0;flex:1;border:1px solid #cbd9e9;border-radius:8px;padding:9px}
.confirmation-card{padding:12px;border-radius:10px;font-size:12px}.confirm-ok{background:#e6f8ec;border:1px solid #c1ebce;color:#0b7136}.confirm-no{background:#fff0f0;border:1px solid #f2c8cb;color:#a61f2b}.confirmation-card p{margin:7px 0}.confirm-form label,.create-form label{display:block;font-size:12px;font-weight:750;margin:9px 0 5px}.confirm-form textarea,.create-form textarea,.create-form input,.create-form select{width:100%;padding:9px;border:1px solid #cad8e8;border-radius:8px;background:#fff;font:inherit;font-size:12px}.confirm-actions{display:grid;gap:7px;margin-top:9px}.task-list,.attachment-list,.log-list{padding-left:0;list-style:none;font-size:12px}.task-list li,.attachment-list li,.log-list li{padding:7px 0;border-bottom:1px solid #eaf0f6}.task-list span{color:#08a04b;font-weight:900;margin-right:8px}.attachment-list a{color:#075ba8}.log-list small{display:block;color:#71829a;margin-top:3px}.log-list p{margin:4px 0}
#create-form{padding:0;overflow:hidden}.create-form{padding:12px 15px 16px}.create-form label{margin-top:10px}.create-form input[type=file]{font-size:11px}.empty-state{text-align:center!important;padding:28px!important;color:#6c7d92}
.module-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.module-tabs a{padding:10px 13px;border:1px solid #d7e3f1;border-radius:9px;background:#fff;text-decoration:none;color:#1d4268;font-weight:750;font-size:13px}.module-tabs a.active{background:#0878ce;color:#fff;border-color:#0878ce}.import-card{max-width:1000px}.import-form{display:flex;gap:12px;align-items:end;flex-wrap:wrap;padding:16px 0}.import-form label{display:block;font-size:13px;font-weight:750;margin-bottom:6px}.import-form input[type=file]{padding:10px;border:1px dashed #aebfd2;border-radius:8px;background:#f8fbff;flex:1;min-width:260px}.column-tags{display:flex;gap:7px;flex-wrap:wrap}.column-tags code{background:#edf3fa;border:1px solid #d9e4f0;border-radius:5px;padding:5px 7px;color:#17446f;font-size:11px}.full-span{grid-column:1/-1}.group-select{display:flex;gap:12px;flex-wrap:wrap}.group-select label{display:flex;align-items:center;gap:5px;font-size:12px;background:#f4f7fb;padding:8px;border-radius:8px}
.calibration-page .create-calibration{margin-top:16px}.calibration-page .formgrid{grid-template-columns:repeat(3,minmax(0,1fr))}
.sidebar-scrim{display:none}
@media(max-width:1150px){.maintenance-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.maintenance-detail-grid{grid-template-columns:1fr}.detail-columns{grid-template-columns:1fr 1fr}}
@media(max-width:850px){.sidebar{transform:translateX(-102%);transition:transform .2s}.sidebar-open .sidebar{transform:translateX(0)}.sidebar-open .sidebar-scrim{display:block;position:fixed;inset:64px 0 0;background:#001a33a8;z-index:20}body.has-sidebar .container{margin:16px 12px;padding:0}.top-actions .top-icon{display:none}.maintenance-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.calibration-page .formgrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.topbar{padding:8px 10px;gap:6px}.brand strong{font-size:10px}.brand small{font-size:10px}.brand-logo,.brand-placeholder{width:34px;height:34px}.top-actions{gap:6px}.top-actions .userbox{display:none}.top-actions>a{font-size:10px}.pagehead{align-items:flex-start;flex-direction:column}.pagehead h1{font-size:21px}.maintenance-kpis{grid-template-columns:1fr 1fr;gap:7px}.kpi{padding:9px;gap:8px;min-height:68px}.kpi>span{width:34px;height:34px;font-size:19px}.kpi small{font-size:10px}.kpi strong{font-size:21px}.tabbar{display:grid;grid-template-columns:1fr 1fr}.detail-columns{grid-template-columns:1fr}.workflow{gap:2px;padding:8px 3px}.workflow>span{font-size:13px}.workflow-step strong{font-size:9px}.workflow-step small{font-size:8px}.workflow-step>b{width:27px;height:27px;font-size:15px}.filterbar input,.filterbar select{min-width:100%}.calibration-page .formgrid{grid-template-columns:1fr}.import-form{align-items:stretch;flex-direction:column}.formgrid{grid-template-columns:1fr}.full-span{grid-column:auto}}

body.guest .menu-toggle{display:none}

.equipment-side{padding:0;overflow:hidden}.equipment-summary{display:flex;gap:12px;padding:16px;align-items:center}.equipment-visual{width:90px;height:90px;border-radius:12px;display:grid;place-items:center;font-size:42px;color:#0878ce;background:linear-gradient(145deg,#e6f3ff,#c9e5ff);flex-shrink:0}.equipment-summary strong,.equipment-summary small{display:block}.equipment-summary strong{font-size:13px;color:#163b61;margin-bottom:7px}.equipment-summary small{font-size:11px;color:#516780;margin:4px 0}.timeline-title{border-radius:0}.timeline-list{padding:0 16px;margin:0}.timeline-list li{position:relative;padding-left:18px}.timeline-list li:before{content:"";position:absolute;left:3px;top:12px;width:8px;height:8px;border-radius:50%;background:#0b9d4b}.timeline-list li strong{font-size:12px}.create-form-card{margin-top:14px;padding:0;overflow:hidden}.create-form-card .create-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 14px}.create-form-card .create-form label{grid-column:span 1}.create-form-card .create-form input,.create-form-card .create-form select,.create-form-card .create-form textarea{min-width:0}.create-form-card .create-form .full-btn{grid-column:1/-1}
@media(max-width:900px){.create-form-card .create-form{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.create-form-card .create-form{grid-template-columns:1fr}.create-form-card .create-form label{grid-column:auto}}

.create-form-card .create-form{display:block;max-width:900px}.create-form-card .create-form label{margin-top:12px}

/* =========================================================
   MSGBP UI polish pack – responsive desktop / tablet / mobile
   Appended overrides only; keeps existing PHP workflows intact.
   ========================================================= */
:root{
  --ms-navy:#07345d;--ms-navy-deep:#042747;--ms-blue:#0879d1;--ms-blue-dark:#075ca8;
  --ms-cyan:#20a6d9;--ms-green:#079455;--ms-orange:#ed8b24;--ms-red:#d93645;
  --ms-bg:#f3f7fc;--ms-surface:#fff;--ms-text:#142b46;--ms-muted:#657992;
  --ms-border:#dce6f2;--ms-radius:15px;--ms-shadow:0 8px 26px rgba(10,48,84,.065)
}
html{scroll-behavior:smooth;scroll-padding-top:78px}
body{font-family:Inter,"Segoe UI",Roboto,Arial,sans-serif;background:var(--ms-bg);color:var(--ms-text);line-height:1.5;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit}
button,a,input,select,textarea{outline-color:#55aaf0}
::selection{background:#cbe9ff;color:#06345c}
.topbar{height:68px;padding:8px 22px;background:linear-gradient(112deg,#07345d 0%,#07518b 58%,#0879b8 100%);box-shadow:0 4px 18px rgba(4,36,67,.2)}
.menu-toggle{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;margin:0;transition:background .18s}
.menu-toggle:hover{background:#ffffff1c}
.brandlockup{gap:11px}
.brand-logo,.brand-placeholder{width:44px;height:44px;border:1px solid #ffffff45;box-shadow:0 2px 9px #001d3b25}
.brand strong{font-size:15px;line-height:1.25;font-weight:800}
.brand small{font-size:12px;letter-spacing:.1px}
.top-actions{gap:12px}.top-icon{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:10px;background:#ffffff12}
.user-avatar{box-shadow:0 0 0 3px #ffffff1c}
.sidebar{top:68px;width:258px;padding:16px 11px 22px;background:linear-gradient(180deg,#0a416f 0%,#07345c 48%,#052847 100%);box-shadow:5px 0 22px rgba(5,35,62,.1);scrollbar-width:thin;scrollbar-color:#5680a3 transparent}
.sidebar-caption{padding:14px 13px 8px;color:#9fc7e9;font-size:10px;letter-spacing:1.25px}
.side-link{min-height:42px;padding:10px 12px;border-radius:10px;font-size:13px;gap:11px;color:#e8f3ff;transition:background .16s ease,transform .16s ease,box-shadow .16s ease}
.side-link:hover,.side-link:focus-visible{background:#ffffff18;transform:translateX(2px)}
.side-link.active{background:linear-gradient(100deg,#0879d1,#1596e2);box-shadow:0 5px 14px rgba(0,21,47,.2);font-weight:750}
.side-icon{font-size:18px;flex:0 0 22px}
.sidebar-user{border:1px solid #ffffff12;background:#ffffff0e;margin-top:24px;padding:12px;border-radius:13px}
.sidebar-version{font-size:10px;color:#a8c5df}
body.has-sidebar .container{margin:24px 22px 26px 278px;padding:0;min-width:0}
body.has-sidebar .footer{margin-left:258px;padding:22px 12px}
.container{max-width:1440px}
.pagehead{margin-bottom:20px;min-width:0}
.pagehead h1{font-size:clamp(22px,2vw,29px);font-weight:800;letter-spacing:-.45px;color:#10385f;line-height:1.25}
.eyebrow.dark{color:#5980a4;font-size:10px;letter-spacing:1.45px}
.pagehead p,.pagehead .muted{line-height:1.55}
.page-actions,.form-actions,.inline-status,.module-tabs,.nav{align-items:center}
.card{background:var(--ms-surface);border:1px solid var(--ms-border);border-radius:var(--ms-radius);box-shadow:var(--ms-shadow);padding:20px;min-width:0}
.card h2,.card h3{color:#143b62;letter-spacing:-.2px}
.grid{gap:16px}
.metric{font-size:clamp(25px,2.5vw,34px);letter-spacing:-.7px;color:#0b3762}
.muted{color:var(--ms-muted);line-height:1.55}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:39px;padding:9px 14px;border-radius:10px;background:#edf4fc;color:#174a78;border:1px solid #d5e3f3;font-size:13px;font-weight:750;text-align:center;white-space:normal;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.btn:hover{transform:translateY(-1px);box-shadow:0 5px 13px rgba(8,61,106,.14)}
.btn:active{transform:translateY(0)}
.btn.primary{background:linear-gradient(105deg,#0878ce,#1598dc);border-color:#0878ce;color:#fff}
.btn.success-btn{background:linear-gradient(105deg,#07964d,#18b765);border-color:#07964d;color:#fff}
.btn.danger{background:linear-gradient(105deg,#d93645,#ed5660);border-color:#d93645;color:#fff}
.full-btn{min-height:43px}
.field label,.create-form label,.confirm-form label,.import-form label{color:#254461;font-weight:750}
.field input,.field select,.field textarea,.create-form input,.create-form select,.create-form textarea,.confirm-form textarea,.inline-status select,.import-form input[type=file]{min-height:42px;border:1px solid #cbd9e9;border-radius:10px;padding:10px 12px;background:#fff;color:#17334f;transition:border-color .15s,box-shadow .15s}
.field textarea,.create-form textarea,.confirm-form textarea{min-height:92px;resize:vertical}
.field input:focus,.field select:focus,.field textarea:focus,.create-form input:focus,.create-form select:focus,.create-form textarea:focus,.confirm-form textarea:focus{border-color:#1688d2;box-shadow:0 0 0 3px rgba(22,136,210,.13);outline:0}
.field input[readonly],.create-form input[readonly]{background:#f0f5fb;color:#61748a}
.formgrid{gap:17px 20px}
.tablewrap{border-color:#dce6f2;border-radius:13px;box-shadow:0 2px 8px #17365d06;max-width:100%;overscroll-behavior-x:contain}
table{min-width:680px}th,td{padding:12px 14px;font-size:13px;vertical-align:middle}th{background:#edf4fc;color:#234766;font-size:12px;font-weight:800;white-space:nowrap}tbody tr{transition:background .12s}tbody tr:hover{background:#f5faff}tbody tr:last-child td{border-bottom:0}
.alert{border:1px solid #f5d9a2;border-radius:11px;line-height:1.5}.success{border-color:#bce8cd}
.groupchips span,.column-tags code{border:1px solid #dbe7f4}
.maintenance-kpis{gap:13px;margin:15px 0 18px}
.kpi{border-radius:14px;box-shadow:0 3px 12px rgba(11,55,96,.035);transition:transform .16s,box-shadow .16s}
.kpi:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(11,55,96,.09)}
.kpi small{line-height:1.35}.kpi strong{letter-spacing:-.5px}
.module-tabs a{border-radius:10px;transition:all .15s}.module-tabs a:hover{border-color:#8bbfe9;background:#f0f8ff}.module-tabs a.active{background:linear-gradient(105deg,#0878ce,#1598dc);box-shadow:0 4px 10px #0878ce25}
.filterbar{gap:10px;flex-wrap:wrap}.filterbar input,.filterbar select{min-width:170px;max-width:100%;border-radius:10px;min-height:41px}
.workflow{border-radius:13px}.workflow-step{min-width:0}
.maintenance-detail-grid,.settings-layout{min-width:0}
.equipment-side{box-shadow:var(--ms-shadow)}
.empty-state{padding:36px!important}
.login{padding:26px;background:#fff;border:1px solid var(--ms-border);border-radius:18px;box-shadow:0 14px 40px rgba(8,48,84,.12)}
.login-layout{gap:28px;max-width:1180px}.login-banner{box-shadow:var(--ms-shadow)}
.sidebar-scrim{backdrop-filter:blur(2px)}
@media(min-width:1500px){body.has-sidebar .container{margin-right:30px;margin-left:282px}.maintenance-detail-grid{gap:18px}}
@media(max-width:1150px){body.has-sidebar .container{margin-left:274px;margin-right:16px}.sidebar{width:254px}.settings-layout{grid-template-columns:minmax(0,1fr) minmax(260px,.8fr)}}
/* Desktop/tablet ngang: giữ 5 KPI chính trên cùng một hàng; KPI đến hạn 30 ngày nằm hàng riêng. */
@media(min-width:851px){.maintenance-page .maintenance-kpis{grid-template-columns:repeat(5,minmax(0,1fr));}}
@media(max-width:850px){
 .topbar{height:64px;padding:7px 12px}.sidebar{top:64px;width:min(290px,84vw);transform:translateX(-105%);box-shadow:12px 0 35px rgba(0,20,40,.25)}
 .sidebar-open .sidebar{transform:translateX(0)}.sidebar-open .sidebar-scrim{display:block;position:fixed;inset:64px 0 0;background:rgba(3,23,43,.48);z-index:20}
 body.has-sidebar .container{margin:18px 14px 24px;padding:0;width:auto}body.has-sidebar .footer{margin-left:0}
 .top-actions{gap:7px}.top-actions .top-icon{display:none}.brand strong{font-size:13px}.brand small{font-size:11px}
 .card{padding:16px}.pagehead{gap:10px}.pagehead h1{font-size:23px}
 .settings-layout,.login-layout{grid-template-columns:1fr}.login-layout{margin:18px auto}.login-banner{min-height:240px}
 .calibration-page .formgrid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:560px){
 .topbar{height:60px;padding:6px 9px;gap:7px}.sidebar{top:60px}.sidebar-open .sidebar-scrim{inset:60px 0 0}
 .menu-toggle{width:36px;height:38px;font-size:22px;flex:0 0 36px}.brandlockup{gap:7px}.brand-logo,.brand-placeholder{width:34px;height:34px;padding:2px}.brand strong{font-size:10.5px;letter-spacing:0;max-width:205px}.brand small{font-size:9.5px;margin-top:1px}.top-actions{gap:5px}.top-actions .user-avatar{width:31px;height:31px;font-size:15px}.top-actions>a{font-size:10px;white-space:nowrap}
 body.has-sidebar .container{margin:13px 10px 20px}.pagehead{margin-bottom:14px}.pagehead h1{font-size:21px;line-height:1.3}.pagehead .muted{font-size:12px}
 .card{padding:13px;border-radius:12px;margin-bottom:12px}.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.metric{font-size:24px}.kpi{padding:9px;gap:7px;min-height:72px;border-radius:11px}.kpi>span{width:32px;height:32px;font-size:18px}.kpi small{font-size:10px}.kpi strong{font-size:20px}
 .formgrid,.calibration-page .formgrid{grid-template-columns:minmax(0,1fr);gap:12px}.field label,.create-form label{font-size:12px}.field input,.field select,.field textarea,.create-form input,.create-form select,.create-form textarea{font-size:16px;min-height:44px;padding:10px 11px}
 .page-actions,.form-actions{width:100%;gap:7px}.page-actions .btn,.form-actions .btn{flex:1 1 auto;min-width:0}.full-btn{width:100%}
 .module-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.module-tabs a{padding:9px 8px;text-align:center;font-size:12px}
 .filterbar{display:grid;grid-template-columns:1fr;width:100%}.filterbar input,.filterbar select{width:100%;min-width:0}
 .tablewrap{margin-left:0;margin-right:0;border-radius:10px}th,td{padding:10px;font-size:12px}
 .detail-columns{grid-template-columns:1fr;gap:10px}.detail-list{grid-template-columns:105px minmax(0,1fr)}.workflow{overflow-x:auto;justify-content:flex-start}.workflow-step{flex:1 0 78px}
 .create-form-card .create-form{display:block}.create-form-card .create-form label{display:block}.create-form-card .create-form .full-btn{width:100%}
 .login{margin:18px auto;padding:20px}.login-layout{padding:0 10px}.login-banner{min-height:200px;padding:18px}.login-banner p{font-size:14px}
 .brand-preview-head{padding:10px}.brand-preview-banner{height:105px}.logo-preview{height:120px}
 .footer{padding:18px 8px;font-size:11px}
}
@media(max-width:360px){.brand strong{max-width:160px;font-size:9.5px}.brand small{font-size:9px}.grid{grid-template-columns:1fr 1fr}.kpi{gap:5px;padding:7px}.kpi>span{width:28px;height:28px;font-size:16px}.kpi strong{font-size:18px}.top-actions>a{font-size:9px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* Cảnh báo hồ sơ kiểm định sắp đến hạn trong 30 ngày */
.status-due-soon{background:#fff0c2;color:#8a5200;border:1px solid #f4d06f}

/* V13 maintenance due alerts */
.due-soon{color:#b45309!important;font-weight:800}.due-overdue{color:#c62828!important;font-weight:800}.maintenance-page .kpi-orange{text-decoration:none;color:inherit}


/* Bộ lọc/tìm kiếm thống nhất: luôn nằm trên một hàng, không tự xuống dòng.
   Trên màn hình hẹp, cho phép cuộn ngang thay vì đẩy điều khiển xuống hàng thứ hai. */
.filterbar{display:flex!important;flex-flow:row nowrap!important;align-items:flex-end;gap:10px;margin:10px 0 14px;max-width:100%;overflow-x:auto;overflow-y:hidden;padding:2px 2px 8px;white-space:nowrap;scrollbar-width:thin}
.filterbar>input,.filterbar>select{flex:1 0 220px;min-width:170px;max-width:none;width:auto}
.filterbar>.field{display:flex;flex:1 0 220px;flex-direction:column;min-width:190px;max-width:none}
.filterbar>.field label{font-size:11px;line-height:1.2;margin:0 0 4px;white-space:nowrap}
.filterbar .field input,.filterbar .field select{width:100%;min-width:0;min-height:41px;padding:9px 11px}
.filterbar>div:not(.field){display:flex;flex:0 0 auto;align-items:flex-end;gap:8px;white-space:nowrap}
.filterbar>.btn,.filterbar>button,.filterbar>a{flex:0 0 auto;white-space:nowrap;align-self:flex-end}
.filterbar-labeled{overflow-x:auto}
.filterbar-labeled .field:first-child{flex:2 0 300px}
.filterbar-labeled .field:not(:first-child){flex:1 0 190px}
@media(max-width:560px){.filterbar,.filterbar-labeled{display:flex!important;flex-flow:row nowrap!important;width:100%;overflow-x:auto;gap:8px}.filterbar>input,.filterbar>select{flex:0 0 220px;min-width:220px}.filterbar>.field{flex:0 0 220px;min-width:220px}.filterbar-labeled .field:first-child{flex:0 0 260px}.filterbar-labeled .field:not(:first-child){flex:0 0 210px}.filterbar .btn,.filterbar>button,.filterbar>a{flex:0 0 auto;width:auto;text-align:center}.filterbar>div:not(.field){flex:0 0 auto}}

/* V15: form bảo trì cân đối 3 cột; bỏ hàng tab điều hướng đã yêu cầu */
.maintenance-page .list-card>.tabbar{display:none!important}
.create-form-card .create-form{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 16px;max-width:none;padding:16px 18px 20px;align-items:start}
.create-form-card .create-form .field{min-width:0}
.create-form-card .create-form label{display:block;margin:0 0 6px;line-height:1.35;min-height:0}
.create-form-card .create-form input,.create-form-card .create-form select,.create-form-card .create-form textarea{width:100%;min-width:0;max-width:100%;min-height:40px;font-size:13px}
.create-form-card .create-form textarea{min-height:82px;resize:vertical}
.create-form-card .create-form input[type=file]{font-size:12px;padding:8px}
.create-form-card .create-form .form-save-field{grid-column:3;align-self:end;display:flex;flex-direction:column;gap:8px;padding-top:0}
.create-form-card .create-form .form-save-field label{visibility:hidden}
.create-form-card .create-form .form-save-field .btn{width:100%;min-height:42px;margin:0}
.create-form-card .create-form .form-save-field small{font-size:11px}
.system-form{grid-template-columns:repeat(3,minmax(0,1fr))}
.system-form .field.full{grid-column:1/-1}
.system-form input[type=file]{padding:8px;font-size:12px}
@media(max-width:1000px){.create-form-card .create-form,.system-form{grid-template-columns:repeat(2,minmax(0,1fr))}.create-form-card .create-form .form-save-field{grid-column:2}}
@media(max-width:560px){.create-form-card .create-form,.system-form{grid-template-columns:1fr}.create-form-card .create-form .form-save-field{grid-column:1}.system-form .field.full{grid-column:1}}

/* V16: KPI kiểm định/hiệu chuẩn đồng bộ với màn hình bảo trì */
.calibration-kpis{grid-template-columns:repeat(5,minmax(0,1fr));margin:12px 0 14px}
.calibration-kpis a{color:inherit;text-decoration:none}
.calibration-kpis .kpi{min-width:0}
@media(max-width:1150px){.calibration-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:560px){.calibration-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}}

/* V18: Cả 6 thẻ KPI bảo trì, bao gồm cảnh báo đến hạn 30 ngày, nằm trên cùng một hàng. */
@media(min-width:851px){
  .maintenance-page .maintenance-kpis{
    display:grid!important;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:10px!important;
  }
  .maintenance-page .maintenance-kpis>.kpi{min-width:0;padding:11px 10px;gap:9px}
  .maintenance-page .maintenance-kpis>.kpi>span{width:38px;height:38px;font-size:22px}
  .maintenance-page .maintenance-kpis>.kpi small{font-size:11px}
}
/* Điện thoại: vẫn giữ đủ 6 thẻ trên một hàng; vuốt ngang để xem toàn bộ, tránh thẻ quá hẹp. */
@media(max-width:850px){
  .maintenance-page .maintenance-kpis{
    display:grid!important;
    grid-template-columns:none!important;
    grid-auto-flow:column!important;
    grid-auto-columns:minmax(155px,42vw)!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    gap:8px!important;
    padding:2px 2px 9px;
    scroll-snap-type:x proximity;
  }
  .maintenance-page .maintenance-kpis>.kpi{scroll-snap-align:start;min-width:0}
}


/* V23: Khoa/Phòng entry form aligned in one row on desktop, responsive on small screens */
.department-formgrid{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:end;gap:12px 16px}
.department-formgrid>div:last-child{align-self:end;white-space:nowrap}
.department-formgrid .btn{min-height:42px;display:inline-flex;align-items:center;justify-content:center}
@media(max-width:760px){.department-formgrid{grid-template-columns:minmax(0,1fr)}.department-formgrid>div:last-child{white-space:normal}.department-formgrid>div:last-child .btn{margin-top:2px}}

/* Dashboard charts: responsive, no external chart library required */
.dashboard-charts{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;margin:18px 0 22px;align-items:stretch}
.chart-card{min-width:0;padding:20px}
.chart-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:18px}
.chart-heading h2{font-size:17px;margin:0 0 5px;color:#17365d}
.chart-heading p{margin:0}
.chart-tag{white-space:nowrap;border-radius:20px;background:#e9f3ff;color:#1766aa;font-size:11px;font-weight:800;padding:6px 10px}
.warning-tag{background:#fff1dc;color:#9a5b00}
.pie-layout{display:grid;grid-template-columns:minmax(130px,.8fr) minmax(0,1.2fr);align-items:center;gap:22px;min-height:190px}
.pie-chart{width:min(100%,190px);aspect-ratio:1;border-radius:50%;display:grid;place-items:center;margin:auto;box-shadow:inset 0 0 0 1px #ffffffaa}
.pie-hole{width:58%;height:58%;border-radius:50%;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:0 2px 12px #17365d12}
.pie-hole strong{font-size:25px;line-height:1.1;color:#17365d}.pie-hole small{font-size:11px;color:#718096;margin-top:4px}
.chart-legend{display:grid;gap:12px;min-width:0}.legend-row{display:grid;grid-template-columns:10px minmax(0,1fr) auto;align-items:center;gap:8px;font-size:12px;color:#43546b}.legend-row strong{font-size:13px;color:#17365d}.legend-dot{width:9px;height:9px;border-radius:50%}
.bar-chart{display:grid;gap:19px;padding:8px 0}.bar-row{display:grid;gap:7px}.bar-label{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;color:#43546b}.bar-label strong{font-size:13px;color:#17365d}.bar-track{height:13px;background:#edf2f8;border-radius:99px;overflow:hidden}.bar-fill{height:100%;border-radius:99px;transition:width .35s ease}.chart-footnote{border-top:1px solid #edf1f6;padding-top:12px;margin:9px 0 0;color:#7a899d;font-size:11px}
@media(max-width:800px){.dashboard-charts{grid-template-columns:1fr}.pie-layout{grid-template-columns:minmax(110px,.7fr) minmax(0,1.3fr);gap:15px}.chart-card{padding:16px}}
@media(max-width:420px){.pie-layout{grid-template-columns:1fr}.pie-chart{width:150px}.chart-legend{width:100%}.chart-heading h2{font-size:15px}.chart-tag{font-size:10px}}

/* PATCH: Giữ các nút Sửa / Khóa / Xóa nằm cùng một hàng trong cột Thao tác */
.tablewrap table td:last-child,
.tablewrap table th:last-child {
  white-space: nowrap;
}
.tablewrap table td:last-child {
  min-width: 190px;
}
.tablewrap table td:last-child form,
.tablewrap table td:last-child .actions,
.tablewrap table td:last-child .action-buttons,
.tablewrap table td:last-child .table-actions,
.tablewrap table td:last-child .btn-group {
  display: inline-flex !important;
  flex-flow: row nowrap !important;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  vertical-align: middle;
  margin: 0 5px 0 0;
}
.tablewrap table td:last-child form {
  width: auto !important;
}
.tablewrap table td:last-child .btn,
.tablewrap table td:last-child button,
.tablewrap table td:last-child a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto !important;
  min-width: 0;
  min-height: 30px;
  margin: 0 4px 0 0 !important;
  padding: 6px 9px;
  white-space: nowrap;
  vertical-align: middle;
}
.tablewrap table td:last-child form button,
.tablewrap table td:last-child form .btn {
  margin-bottom: 0 !important;
}
/* Nếu các nút được đặt trong một ô có class riêng */
.actions,
.action-buttons,
.table-actions,
.inline-actions {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.actions form,
.action-buttons form,
.table-actions form,
.inline-actions form {
  display: inline-flex !important;
  margin: 0 !important;
}
@media (max-width: 760px) {
  .tablewrap table td:last-child { min-width: 190px; }
  .tablewrap table td:last-child .btn,
  .tablewrap table td:last-child button,
  .tablewrap table td:last-child a { padding: 6px 8px; font-size: 11px; }
}


/* V28: Chi tiết ánh xạ thiết bị vào hệ thống */
.system-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:12px 0 24px}
.system-kpi{border:1px solid #e2eaf3;border-radius:14px;background:linear-gradient(135deg,#f8fbff,#fff);padding:18px;display:flex;flex-direction:column;gap:5px;min-width:0}
.system-kpi span{font-size:13px;color:#52647a;font-weight:700}.system-kpi strong{font-size:30px;line-height:1.2;color:#17365d;overflow-wrap:anywhere}.system-kpi small{font-size:11px;color:#75849a}
.system-map-form{grid-template-columns:minmax(0,2fr) minmax(100px,.6fr) minmax(0,1.3fr) auto;align-items:end;margin-bottom:20px}
.system-detail-card{margin-bottom:20px}.system-detail-card h3{margin:20px 0 12px}.system-detail-card .pagehead{align-items:center}
@media(max-width:850px){.system-map-form{grid-template-columns:minmax(0,1fr) minmax(100px,.5fr)}.system-map-form .field:first-child{grid-column:1/-1}}
@media(max-width:560px){.system-kpis{grid-template-columns:1fr}.system-kpi{padding:14px}.system-kpi strong{font-size:26px}.system-map-form{grid-template-columns:1fr}.system-map-form .field:first-child{grid-column:auto}.system-detail-card .pagehead{align-items:flex-start;flex-direction:column}.system-detail-card .pagehead>.btn{width:100%;justify-content:center}}



/* V33: file picker tieng Viet + checkbox gon; cache-bust bang style.css?v=33 */
.file-input-native{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important;opacity:0!important;pointer-events:none!important;}
.file-picker{display:flex;align-items:center;gap:11px;flex-wrap:wrap;min-width:0;margin:6px 0 2px;}
.file-picker-button{appearance:none!important;-webkit-appearance:none!important;display:inline-flex!important;align-items:center;justify-content:center;min-height:36px;padding:8px 15px!important;border:1px solid #0878c9!important;border-radius:8px!important;background:#0878c9!important;color:#fff!important;font-family:inherit!important;font-size:13px!important;font-weight:700!important;line-height:1.2!important;cursor:pointer;box-shadow:0 2px 5px rgba(8,101,173,.16);transition:background .15s,box-shadow .15s;}
.file-picker-button:hover{background:#0668ae!important;box-shadow:0 4px 10px rgba(8,101,173,.2)}
.file-picker-button:focus-visible{outline:3px solid rgba(8,127,201,.25);outline-offset:2px}
.file-picker-name{display:inline-block;max-width:min(560px,100%);overflow-wrap:anywhere;color:#66788d;font-size:13px;line-height:1.45;}
.file-picker.has-file .file-picker-name{color:#24506f;font-weight:650}
input[type="checkbox"],input[type="radio"]{appearance:auto!important;-webkit-appearance:auto!important;width:14px!important;height:14px!important;min-width:14px!important;min-height:14px!important;max-width:14px!important;max-height:14px!important;padding:0!important;margin:0 6px 0 0!important;accent-color:#0878ce;vertical-align:middle;cursor:pointer;box-shadow:none!important;flex:0 0 14px!important;}
.group-select{display:flex;flex-wrap:wrap;gap:7px;align-items:stretch}
.group-select label{display:flex;align-items:center;gap:7px;min-width:125px;max-width:210px;padding:6px 8px!important;border:1px solid #e0e9f3;border-radius:8px;background:#f7faff;color:#29435c;font-size:12px;line-height:1.3;cursor:pointer;}
.group-select label:hover{border-color:#9dc9ec;background:#eff7ff}
.group-select label input[type="checkbox"]{flex:0 0 14px!important}
.field>label input[type="checkbox"]{vertical-align:middle}
.import-form .file-picker{margin:8px 0 12px}
@media(max-width:560px){.file-picker{align-items:center;gap:8px}.file-picker-name{padding-top:0}.group-select label{min-width:calc(50% - 4px);max-width:none}}

/* V35: tinh chinh giao dien phan he Quan ly cac he thong */
.systems-page .systems-pagehead{align-items:center;gap:18px;margin-bottom:16px}
.systems-pagehead>.btn{flex:0 0 auto;white-space:nowrap}
.systems-dashboard{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:0 0 18px}
.system-summary-card{display:flex;align-items:center;gap:15px;min-width:0;padding:18px 20px;border:1px solid #dfe8f2;border-radius:14px;background:linear-gradient(135deg,#fff 0%,#f5f9ff 100%);box-shadow:0 3px 12px rgba(23,54,93,.045)}
.system-summary-icon{display:flex;align-items:center;justify-content:center;flex:0 0 46px;width:46px;height:46px;border-radius:12px;background:#e5f2ff;color:#0878c9;font-size:23px;font-weight:800}
.system-summary-card>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.system-summary-card small{color:#64758a;font-size:12px;font-weight:700}
.system-summary-card strong{color:#123d67;font-size:29px;line-height:1.2;font-weight:800;overflow-wrap:anywhere}
.system-summary-card span:last-child{color:#8390a1;font-size:11px;line-height:1.4}
.system-form-card[hidden]{display:none!important}
.system-form-card{margin-bottom:18px;scroll-margin-top:16px}
.system-form-head{margin-bottom:12px}
.system-form-head h2{margin:0 0 4px}
.system-form-actions{align-self:end}
.systems-list-card{margin-bottom:18px}
.systems-list-head{align-items:center;margin-bottom:14px}
.systems-list-head h2{margin:0 0 4px}
.systems-filterbar{display:grid;grid-template-columns:minmax(220px,1.6fr) minmax(150px,.8fr) minmax(180px,1fr) auto;gap:12px;align-items:end;margin:0 0 16px;padding:14px;border:1px solid #e4ebf4;border-radius:12px;background:#f8faff}
.systems-filterbar .field{min-width:0}
.systems-filterbar .field input,.systems-filterbar .field select{min-height:40px;padding:9px 11px}
.systems-filter-actions{display:flex;align-items:center;gap:7px;white-space:nowrap}
.systems-filter-actions .btn{min-height:40px;display:inline-flex;align-items:center;justify-content:center}
.system-actions-cell{white-space:nowrap;min-width:170px}
.inline-system-action{display:inline-flex;margin:0;vertical-align:middle}
.system-map-form{grid-template-columns:minmax(0,2.1fr) minmax(120px,.65fr) minmax(0,1.4fr) auto;gap:12px;align-items:end;margin-bottom:20px}
.system-map-form .field{min-width:0}
.system-map-form .field input,.system-map-form .field select{min-height:40px}
.system-map-submit{align-self:end;padding-bottom:1px}
.system-detail-card{margin-top:18px}
@media(max-width:1050px){.systems-filterbar{grid-template-columns:repeat(2,minmax(0,1fr))}.systems-filter-actions{align-self:end}.system-map-form{grid-template-columns:minmax(0,1.6fr) minmax(110px,.6fr)}.system-map-form .field:first-of-type{grid-column:1/-1}.system-map-submit{align-self:end}}
@media(max-width:650px){.systems-page .systems-pagehead{align-items:flex-start;flex-direction:column}.systems-pagehead>.btn{width:100%;text-align:center}.systems-dashboard{grid-template-columns:1fr;gap:10px}.system-summary-card{padding:14px}.system-summary-card strong{font-size:25px}.systems-filterbar{grid-template-columns:1fr;padding:11px}.systems-filter-actions{display:grid;grid-template-columns:1fr 1fr}.systems-filter-actions .btn{width:100%}.system-map-form{grid-template-columns:1fr}.system-map-form .field:first-of-type{grid-column:auto}.system-map-submit .btn{width:100%}.system-detail-card .pagehead{align-items:flex-start;flex-direction:column}.system-detail-card .pagehead>.btn{width:100%;justify-content:center}}

/* V37: collapsed forms/details and maintenance filters */
[hidden]{display:none!important}
.maintenance-filterbar{display:grid;grid-template-columns:minmax(220px,2fr) repeat(3,minmax(150px,1fr)) auto auto;gap:8px;align-items:end}
@media(max-width:900px){.maintenance-filterbar{grid-template-columns:repeat(2,minmax(0,1fr))}.maintenance-filterbar input{grid-column:1/-1}}
@media(max-width:560px){.maintenance-filterbar{grid-template-columns:1fr}.maintenance-filterbar input{grid-column:auto}}


/* V38: systems screen layout guardrails */
.systems-page .systems-dashboard{grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
.systems-page .system-map-form{display:grid;grid-template-columns:minmax(0,2.1fr) minmax(120px,.65fr) minmax(0,1.4fr) auto;align-items:end}
.systems-page .system-map-form .field{min-width:0;margin:0}
.systems-page .system-map-submit{display:flex;align-items:end;justify-content:flex-end}
.systems-page .system-form-card[hidden]{display:none!important}
@media(max-width:1050px){.systems-page .system-map-form{grid-template-columns:minmax(0,1.6fr) minmax(110px,.6fr)}.systems-page .system-map-form .field:first-of-type{grid-column:1/-1}}
@media(max-width:650px){.systems-page .systems-dashboard{grid-template-columns:1fr}.systems-page .system-map-form{grid-template-columns:1fr}.systems-page .system-map-form .field:first-of-type{grid-column:auto}.systems-page .system-map-submit .btn{width:100%}}


/* V39: Can hang cot va can thang hang trong form anh xa he thong */
.systems-page .system-map-form{
  display:grid;
  grid-template-columns:minmax(0,2.15fr) minmax(130px,.68fr) minmax(0,1.45fr) auto;
  gap:12px;
  align-items:start;
}
.systems-page .system-map-form .field{
  display:flex;
  flex-direction:column;
  align-self:start;
  min-width:0;
  margin:0;
}
.systems-page .system-map-form .field>label{
  display:block;
  min-height:18px;
  margin:0 0 7px;
  line-height:18px;
}
.systems-page .system-map-form .field select,
.systems-page .system-map-form .field input{
  box-sizing:border-box;
  width:100%;
  height:40px;
  min-height:40px;
  margin:0;
}
.systems-page .system-map-form .field small{
  display:block;
  min-height:15px;
  margin-top:5px;
  line-height:1.35;
}
.systems-page .system-map-submit{
  display:flex;
  align-items:flex-start;
  align-self:start;
  justify-content:flex-end;
  padding:25px 0 0;
  margin:0;
}
.systems-page .system-map-submit .btn{
  height:40px;
  min-height:40px;
  white-space:nowrap;
  padding:0 16px;
}
@media(max-width:900px){
  .systems-page .system-map-form{grid-template-columns:minmax(0,1.7fr) minmax(115px,.7fr);}
  .systems-page .system-map-form .field:first-of-type{grid-column:1/-1;}
  .systems-page .system-map-submit{padding-top:25px;}
}
@media(max-width:650px){
  .systems-page .system-map-form{grid-template-columns:minmax(0,1fr);gap:10px;}
  .systems-page .system-map-form .field:first-of-type{grid-column:auto;}
  .systems-page .system-map-submit{padding-top:0;}
  .systems-page .system-map-submit .btn{width:100%;}
}


/* V40: tài khoản, PWA standalone và chuẩn hóa responsive/màu trạng thái */
:root{--status-success-bg:#e6f7ed;--status-success-fg:#17683a;--status-warning-bg:#fff4d8;--status-warning-fg:#8a5700;--status-danger-bg:#ffeaec;--status-danger-fg:#b42332;--status-info-bg:#e6f2ff;--status-info-fg:#075ca8;--status-neutral-bg:#edf1f6;--status-neutral-fg:#526276}
.status-pill,.status-badge{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border-radius:999px;font-size:11px;line-height:1.25;font-weight:800;border:1px solid transparent;white-space:nowrap}
.status-success,.status-active,.status-completed,.status-in_use,.status-confirmed{background:var(--status-success-bg)!important;color:var(--status-success-fg)!important;border-color:#bce8cd!important}
.status-warning,.status-pending,.status-due-soon{background:var(--status-warning-bg)!important;color:var(--status-warning-fg)!important;border-color:#f0d99a!important}
.status-in_progress,.status-planned{background:var(--status-info-bg)!important;color:var(--status-info-fg)!important;border-color:#bfdcf8!important}
.status-danger,.status-overdue,.status-error,.status-rejected{background:var(--status-danger-bg)!important;color:var(--status-danger-fg)!important;border-color:#f2c0c5!important}
.status-info,.status-repair,.status-stored{background:var(--status-info-bg)!important;color:var(--status-info-fg)!important;border-color:#bfdcf8!important}
.status-neutral,.status-cancelled,.status-retired,.status-inactive{background:var(--status-neutral-bg)!important;color:var(--status-neutral-fg)!important;border-color:#d7e0ea!important}
.pwa-install-btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:34px;padding:7px 10px;border:1px solid #78bce8;border-radius:9px;background:#ffffff16;color:#fff;font:700 12px/1.2 system-ui,-apple-system,Segoe UI,sans-serif;cursor:pointer;white-space:nowrap}
.pwa-install-btn:hover,.pwa-install-btn.is-install-ready{background:#0878ce;border-color:#67c5ff}
.pwa-install-btn[hidden]{display:none!important}
.password-page{max-width:900px!important}
.password-card{max-width:760px;margin:0 auto}
.password-card-intro{display:flex;align-items:center;gap:14px;padding-bottom:16px;margin-bottom:18px;border-bottom:1px solid var(--ms-border,#dce6f2)}
.password-card-intro h2{margin:0 0 5px;font-size:19px}.password-card-intro p{margin:0}
.password-lock{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border-radius:14px;background:#e5f2ff;color:#0878ce;font-size:28px;font-weight:800}
.password-form{display:grid;grid-template-columns:1fr;gap:16px;max-width:600px}
.password-form .field small{display:block;margin-top:6px;color:#64778e;font-size:12px;line-height:1.45}
.password-form input{width:100%}
.password-form-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-top:4px}
.password-success-page{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at top right,#dcefff 0,transparent 36%),#f1f5fb}
.password-success-card{width:min(100%,520px);padding:34px 30px;text-align:center;background:#fff;border:1px solid #dce6f2;border-radius:22px;box-shadow:0 18px 55px rgba(8,48,84,.13)}
.password-success-icon{display:grid;place-items:center;width:66px;height:66px;margin:0 auto 18px;border-radius:50%;background:#e4f8ec;color:#168448;font-size:38px;font-weight:800}
.password-success-logo{width:54px;height:54px;object-fit:contain;margin-bottom:12px}
.password-success-card .eyebrow{margin:0 0 10px}.password-success-card h1{font-size:clamp(23px,4vw,30px);line-height:1.25;color:#12375d;margin:0 0 12px}
.password-success-card>p:not(.eyebrow):not(.password-success-brand){color:#64748b;line-height:1.65;margin:0 0 24px}
.password-login-button{min-height:44px;padding:12px 20px}.password-success-brand{font-size:11px;color:#8a98aa;margin:24px 0 0}
@media(display-mode:standalone){html{min-height:100%;background:#063765}body{padding-bottom:env(safe-area-inset-bottom)}.topbar{padding-top:max(8px,env(safe-area-inset-top))}.sidebar{padding-bottom:max(18px,env(safe-area-inset-bottom))}.password-success-page{padding-top:max(24px,env(safe-area-inset-top))}}
@media(max-width:850px){.pwa-install-btn{font-size:11px;padding:6px 8px}.top-actions .userbox{display:none}.top-actions>a{font-size:11px}}
@media(max-width:560px){.pwa-install-btn{max-width:90px;white-space:normal;line-height:1.1;padding:5px 6px;min-height:32px}.top-actions{min-width:0}.password-card-intro{align-items:flex-start}.password-card{padding:16px}.password-form-actions{display:grid;grid-template-columns:1fr}.password-form-actions .btn{width:100%}.password-success-card{padding:28px 20px;border-radius:17px}}
@media(max-width:360px){.pwa-install-btn{font-size:10px;max-width:72px}.top-actions>a{font-size:9px}}


/* TBMSG V41 — popup thông báo lưu/xác nhận dùng chung */
.tbmsg-modal-backdrop{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(5,25,48,.48);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);opacity:1;transition:opacity .18s ease}
.tbmsg-modal-backdrop[hidden]{display:none!important}
.tbmsg-modal{position:relative;width:min(100%,440px);max-height:min(82vh,620px);overflow:auto;background:#fff;border:1px solid #e2eaf3;border-radius:20px;padding:30px 28px 24px;box-shadow:0 24px 80px rgba(5,35,67,.28);text-align:center;animation:tbmsgPopupIn .18s ease-out}
.tbmsg-modal-x{position:absolute;top:10px;right:12px;width:34px;height:34px;border:0;border-radius:10px;background:#f0f4f9;color:#53677d;font-size:25px;line-height:1;cursor:pointer}
.tbmsg-modal-icon{width:54px;height:54px;margin:0 auto 14px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#e5f7ed;color:#16834a;font-size:28px;font-weight:800}
.tbmsg-modal h2{margin:0 24px 10px;color:#12395f;font-size:21px;line-height:1.3}
.tbmsg-modal p{margin:0;color:#52657a;font-size:15px;line-height:1.65;white-space:pre-line;overflow-wrap:anywhere}
.tbmsg-modal-actions{display:flex;justify-content:center;margin-top:24px}
.tbmsg-modal-close{min-width:116px;padding:10px 22px!important;border-radius:10px!important;font-weight:750!important}
.tbmsg-modal-backdrop.is-error .tbmsg-modal-icon{background:#fff0f0;color:#c63232}
.tbmsg-modal-backdrop.is-loading .tbmsg-modal-icon{background:#e8f4ff;color:#087cc1;animation:tbmsgPulse 1s ease-in-out infinite}
.tbmsg-modal-backdrop.is-loading .tbmsg-modal h2{color:#0875b9}
body.tbmsg-modal-open{overflow:hidden}
@keyframes tbmsgPopupIn{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes tbmsgPulse{0%,100%{transform:scale(1)}50%{transform:scale(.92)}}
@media(max-width:520px){.tbmsg-modal-backdrop{padding:14px;align-items:center}.tbmsg-modal{padding:28px 20px 20px;border-radius:17px;max-height:calc(100dvh - 28px)}.tbmsg-modal h2{font-size:19px}.tbmsg-modal p{font-size:14px}.tbmsg-modal-actions .btn{width:100%}}
@media(prefers-reduced-motion:reduce){.tbmsg-modal-backdrop,.tbmsg-modal{animation:none;transition:none}.tbmsg-modal-icon{animation:none!important}}


/* V45: Can hang thao tac Import Excel thanh mot hang gon gang tren man hinh lon */
.import-page .import-card .import-form{
  display:grid;
  grid-template-columns:max-content minmax(250px,1fr) max-content;
  align-items:center;
  gap:12px;
  width:100%;
  padding:16px 0;
  margin:0;
}
.import-page .import-form>label{
  display:block;
  margin:0;
  padding:0;
  white-space:nowrap;
  line-height:1.35;
}
.import-page .import-form .file-picker{
  display:flex;
  flex-flow:row nowrap;
  align-items:center;
  gap:10px;
  min-width:0;
  width:100%;
  margin:0;
}
.import-page .import-form .file-picker-button{
  flex:0 0 auto;
  white-space:nowrap;
}
.import-page .import-form .file-picker-name{
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.import-page .import-form>button[type=submit]{
  flex:0 0 auto;
  white-space:nowrap;
  min-height:40px;
  margin:0;
}
@media(max-width:760px){
  .import-page .import-form{
    grid-template-columns:minmax(0,1fr);
    align-items:stretch;
    gap:10px;
  }
  .import-page .import-form>label{white-space:normal}
  .import-page .import-form .file-picker{
    flex-wrap:wrap;
    align-items:center;
  }
  .import-page .import-form .file-picker-name{
    flex:1 1 140px;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .import-page .import-form>button[type=submit]{width:100%}
}

/* TBMSG V46 — chuẩn hóa giao diện toàn hệ thống, responsive và trạng thái */
:root{
  --tb-bg:#f3f7fc;--tb-surface:#fff;--tb-text:#17324f;--tb-muted:#63758a;
  --tb-primary:#0878ce;--tb-primary-dark:#075fa4;--tb-border:#dbe5f0;
  --tb-success-bg:#e7f8ee;--tb-success-text:#147443;--tb-info-bg:#e8f3ff;--tb-info-text:#075fa4;
  --tb-warning-bg:#fff4dc;--tb-warning-text:#8a5700;--tb-danger-bg:#fff0f0;--tb-danger-text:#b4232d;
  --tb-neutral-bg:#eef2f6;--tb-neutral-text:#536273;--tb-radius:12px;
}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:14px;line-height:1.5;color:var(--tb-text);background:var(--tb-bg);overflow-x:hidden}
button,input,select,textarea{font:inherit}
button,a,input,select,textarea{touch-action:manipulation}
:where(a,button,input,select,textarea,[tabindex]):focus-visible{outline:3px solid #53a8f3;outline-offset:2px}
:where(.card,.tablewrap,.brand-preview,.chart-card,.system-detail-card){min-width:0}
.container{min-width:0;max-width:100%;}
.pagehead{min-width:0;flex-wrap:wrap}
.pagehead h1{font-size:clamp(21px,2vw,28px);line-height:1.25;letter-spacing:-.025em;overflow-wrap:anywhere}
.pagehead h2,.card h2,.card h3{line-height:1.35;overflow-wrap:anywhere}
.muted,.field small,.help-text{color:var(--tb-muted)}
.field{min-width:0}
.field label,.create-form label{font-size:12px;line-height:1.4;color:#28445f}
.field input,.field select,.field textarea,.create-form input,.create-form select,.create-form textarea,
.confirm-form textarea,.inline-status select{max-width:100%;min-width:0;border-color:#cbd9e8;border-radius:10px;color:var(--tb-text);background-color:#fff}
.field input:focus,.field select:focus,.field textarea:focus,.create-form input:focus,.create-form select:focus,.create-form textarea:focus{border-color:var(--tb-primary);box-shadow:0 0 0 3px #0878ce1c;outline:0}
.btn{min-height:39px;line-height:1.3;max-width:100%;overflow-wrap:anywhere}
.btn:disabled,button:disabled{opacity:.55;cursor:not-allowed;transform:none;box-shadow:none}
.btn.primary{background:var(--tb-primary);border-color:var(--tb-primary)}
.btn.primary:hover{background:var(--tb-primary-dark);border-color:var(--tb-primary-dark)}
.btn.success-btn{background:#16834a;border-color:#16834a}
.btn.danger{background:#c93640;border-color:#c93640}
.page-actions,.form-actions,.system-form-actions,.actions,.action-buttons,.table-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;min-width:0}
.tablewrap{width:100%;max-width:100%;overflow:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;border:1px solid var(--tb-border);background:var(--tb-surface)}
.tablewrap table{width:100%;border-collapse:separate;border-spacing:0}
.tablewrap th{background:#edf4fb;color:#294966;font-size:11px;font-weight:800;letter-spacing:.01em;white-space:nowrap}
.tablewrap td{vertical-align:middle;overflow-wrap:anywhere}
.tablewrap tr:last-child td{border-bottom:0}
.tablewrap tbody tr:hover{background:#f8fbff}
/* One shared semantic palette for all status chips/badges used by modules. */
.status-pill,.status-badge,.badge-status,.status-due-soon{display:inline-flex;align-items:center;justify-content:center;gap:5px;max-width:100%;padding:4px 9px;border:1px solid transparent;border-radius:999px;font-size:11px;font-weight:750;line-height:1.35;white-space:normal;overflow-wrap:anywhere}
.status-completed,.status-active,.status-success,.status-in-use,.status-available,.status-approved,.status-paid{background:var(--tb-success-bg)!important;color:var(--tb-success-text)!important;border-color:#bde8cd!important}
.status-pending,.status-waiting,.status-planned,.status-scheduled,.status-due-soon,.status-warning,.status-in-progress,.status-processing{background:var(--tb-warning-bg)!important;color:var(--tb-warning-text)!important;border-color:#f0d48b!important}
.status-overdue,.status-danger,.status-error,.status-cancelled,.status-rejected,.status-expired,.status-inactive{background:var(--tb-danger-bg)!important;color:var(--tb-danger-text)!important;border-color:#f2c5c8!important}
.status-info,.status-confirmed,.status-received,.status-repair,.status-blue{background:var(--tb-info-bg)!important;color:var(--tb-info-text)!important;border-color:#c4def7!important}
.status-muted,.status-neutral,.status-stored,.status-disposed,.status-transferred,.status-closed{background:var(--tb-neutral-bg)!important;color:var(--tb-neutral-text)!important;border-color:#d7e0e8!important}
/* Navigation: clearer hierarchy and predictable touch targets. */
.sidebar{overscroll-behavior:contain;scrollbar-gutter:stable;transition:transform .2s ease}
.side-link{min-height:42px;line-height:1.35;padding:10px 12px;overflow-wrap:anywhere}
.side-link.active{background:linear-gradient(105deg,#0878ce,#1495d6);box-shadow:0 4px 12px #001c3a2a}
.sidebar-caption{line-height:1.4}
.topbar{gap:10px;min-width:0}
.brandlockup{min-width:0;overflow:hidden}
.brand{min-width:0}
.brand strong,.brand small{overflow-wrap:anywhere}
.top-actions{min-width:0;gap:clamp(6px,1vw,14px)}
.logout-form{display:inline-flex;margin:0}
.logout-link{appearance:none;background:transparent;border:0;color:#eaf4ff;text-decoration:underline;text-underline-offset:3px;font:inherit;font-size:12px;cursor:pointer;padding:7px 2px}
.logout-link:hover{color:#fff}
.sidebar-user{min-width:0;overflow-wrap:anywhere}
.sidebar-user>div:last-child{min-width:0}
/* Inputs and import controls remain readable without forcing whole-page overflow. */
.file-picker{min-width:0;max-width:100%}
.file-picker-name{min-width:0;overflow-wrap:anywhere}
.filterbar,.filterbar-labeled{max-width:100%;scrollbar-width:thin}
input[type=checkbox],input[type=radio]{accent-color:var(--tb-primary);width:16px;height:16px;vertical-align:middle}
.alert{overflow-wrap:anywhere;line-height:1.55}
.empty-state{text-align:center;color:var(--tb-muted);padding:22px!important}
@media(max-width:1100px){
  .topbar{padding-left:14px;padding-right:14px}
  .brand strong{font-size:13px}
  .top-actions{gap:8px}
  .maintenance-kpis{gap:8px}
}
@media(max-width:850px){
  .topbar{position:sticky;top:0;z-index:50}
  .sidebar{z-index:60}
  .sidebar-open .sidebar-scrim{z-index:55}
  .top-actions .top-icon{display:none}
  .top-actions .userbox{display:none}
  body.has-sidebar .container{margin-left:12px;margin-right:12px;width:auto;max-width:none;padding:0}
  body.has-sidebar .footer{margin-left:0}
  .pagehead{align-items:flex-start}
  .page-actions{width:100%}
  .page-actions .btn{flex:0 1 auto}
  .settings-layout,.login-layout{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:560px){
  body{font-size:14px}
  .topbar{height:60px;padding:6px 9px;gap:6px}
  .menu-toggle{flex:0 0 auto;margin:0 2px 0 0;padding:5px;font-size:23px}
  .brandlockup{gap:7px}
  .brand-logo,.brand-placeholder{width:34px;height:34px;flex:0 0 34px}
  .brand strong{font-size:10.5px;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .brand small{font-size:9px;line-height:1.2}
  .top-actions{flex:0 0 auto;gap:6px}
  .top-actions .user-avatar{width:30px;height:30px;font-size:14px}
  .pwa-install-btn{font-size:10px!important;padding:7px 8px!important;min-height:32px;white-space:nowrap}
  .logout-link{font-size:10px;white-space:nowrap}
  body.has-sidebar .container{margin:12px 9px 20px}
  .card{padding:13px;border-radius:12px}
  .pagehead h1{font-size:21px}
  .pagehead .muted{font-size:12px}
  .page-actions,.form-actions{gap:7px}
  .page-actions .btn,.form-actions .btn{min-height:40px}
  .tablewrap{border-radius:10px}
  .tablewrap th,.tablewrap td{padding:9px 10px;font-size:12px}
  .status-pill,.status-badge,.badge-status{font-size:10px;padding:4px 7px}
  .login-layout{margin:12px auto;padding:0 10px;gap:12px}
  .login-banner{min-height:160px;padding:18px}
  .login-banner p{font-size:13px}
  .tbmsg-modal{width:100%}
}
@media(max-width:360px){
  .brand strong{max-width:118px;font-size:9.5px}
  .brand small{font-size:8px}
  .pwa-install-btn{max-width:84px;white-space:normal;line-height:1.15}
  .top-actions{gap:4px}
  .pagehead h1{font-size:19px}
  .card{padding:11px}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{transition:none!important;animation:none!important}}


/* TBMSG V47 — chuẩn hóa giao diện toàn cục, bổ sung sau V46 */
:root{
  --ui-primary:#0878c9;--ui-primary-hover:#0668ad;--ui-navy:#063765;
  --ui-text:#18364f;--ui-muted:#64768a;--ui-border:#d7e0e9;--ui-surface:#fff;
  --ui-bg:#f3f7fc;--ui-success-bg:#e7f7ee;--ui-success-fg:#17683a;
  --ui-info-bg:#e7f2ff;--ui-info-fg:#075ca8;--ui-warning-bg:#fff3d6;--ui-warning-fg:#875500;
  --ui-danger-bg:#ffeaec;--ui-danger-fg:#b42332;--ui-neutral-bg:#edf1f6;--ui-neutral-fg:#526276;
}
html{scroll-padding-top:76px;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{font-family:Inter,"Segoe UI",Roboto,Arial,sans-serif;font-size:14px;line-height:1.5;color:var(--ui-text);background:var(--ui-bg);overflow-x:clip}
button,input,select,textarea{font:inherit}
button,.btn,a.btn{touch-action:manipulation}
:where(a,button,input,select,textarea,[tabindex]):focus-visible{outline:3px solid rgba(8,120,201,.38)!important;outline-offset:2px!important}
:where(.card,.tablewrap,.filterbar,.filterbar-labeled,.formgrid,.field,.pagehead,.top-actions,.brandlockup){min-width:0;max-width:100%}
.field label,label{color:#29465f;font-weight:700;line-height:1.4}
input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea{max-width:100%;border-color:var(--ui-border);border-radius:9px;min-height:40px}
textarea{min-height:92px;resize:vertical}
.btn,button.btn{min-height:36px;border-radius:9px;font-weight:700;line-height:1.25;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease,transform .15s ease}
.btn.primary,button.btn.primary{background:var(--ui-primary);border-color:var(--ui-primary);color:#fff}
.btn.primary:hover,button.btn.primary:hover{background:var(--ui-primary-hover);border-color:var(--ui-primary-hover)}
.btn.danger,button.btn.danger{background:#fff1f2;border-color:#f3c3c8;color:#a61b29}
.card{border-color:#e0e8f0;border-radius:16px;box-shadow:0 5px 20px rgba(24,54,79,.045)}
.muted,small.muted,.muted small{color:var(--ui-muted)}
/* Màu trạng thái dùng chung; giữ nguyên tên class mà các phân hệ đang xuất ra. */
.status-pill,.status-badge,.badge-status{border:1px solid transparent;font-weight:750}
.status-completed,.status-active,.status-in_use,.status-accepted,.status-success,.status-valid,.status-stored{background:var(--ui-success-bg)!important;color:var(--ui-success-fg)!important;border-color:#b9e6ca!important}
.status-in_progress,.status-info,.status-processing,.status-mapped{background:var(--ui-info-bg)!important;color:var(--ui-info-fg)!important;border-color:#c4ddfb!important}
.status-planned,.status-pending,.status-due-soon,.status-due_soon,.status-warning,.status-waiting,.status-scheduled{background:var(--ui-warning-bg)!important;color:var(--ui-warning-fg)!important;border-color:#f1d89a!important}
.status-overdue,.status-expired,.status-failed,.status-danger,.status-repair,.status-error{background:var(--ui-danger-bg)!important;color:var(--ui-danger-fg)!important;border-color:#f3c3c8!important}
.status-cancelled,.status-inactive,.status-disposed,.status-transferred,.status-neutral,.status-unknown{background:var(--ui-neutral-bg)!important;color:var(--ui-neutral-fg)!important;border-color:#d8e0e8!important}
/* Menu/header: tránh co chữ, giữ vùng chạm phù hợp và không đẩy toàn trang tràn ngang. */
.topbar{gap:10px;min-width:0}
.brandlockup{min-width:0;flex:1 1 auto}
.brand strong,.brand small{overflow-wrap:anywhere}
.top-actions{display:flex;align-items:center;gap:8px;min-width:0}
.side-link{min-height:42px;line-height:1.35;border-radius:10px;gap:10px}
.side-link>span:last-child{min-width:0;overflow-wrap:anywhere}
.sidebar-caption{letter-spacing:.08em;font-size:10px;font-weight:800}
/* Bộ lọc tự co giãn, không làm tràn thẻ hoặc trang trên tablet/điện thoại. */
.filterbar,.filterbar-labeled{display:flex;flex-wrap:wrap;align-items:end;gap:10px}
.filterbar>.field,.filterbar-labeled>.field{flex:1 1 180px;min-width:min(100%,160px)}
.filterbar>div:not(.field),.filterbar-labeled>div:not(.field){max-width:100%;flex-wrap:wrap}
.tablewrap{overflow:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.tablewrap table{min-width:720px}
.tablewrap th{font-size:11px;line-height:1.35}
.tablewrap td{line-height:1.45}
input[type=checkbox],input[type=radio]{width:16px;height:16px;min-width:16px;accent-color:var(--ui-primary);vertical-align:middle}
.group-select label,.group-checkbox label{font-size:12px;line-height:1.35}
.file-picker{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0}
.file-picker-button{flex:0 0 auto}
.file-picker-name{min-width:0;overflow-wrap:anywhere;word-break:break-word}
@media(max-width:1100px){
  .topbar{gap:8px}
  .brand strong{font-size:13px}
  .filterbar>.field,.filterbar-labeled>.field{flex-basis:220px}
}
@media(max-width:850px){
  .topbar{padding-inline:12px}
  .brandlockup{max-width:calc(100% - 58px)}
  .brand strong{font-size:12px}
  .brand small{font-size:10px}
  .top-actions{gap:5px}
  .sidebar{box-shadow:12px 0 30px rgba(4,35,61,.18)}
  .side-link{min-height:44px;padding-top:10px;padding-bottom:10px}
  .filterbar,.filterbar-labeled{align-items:stretch}
  .filterbar>.field,.filterbar-labeled>.field{flex:1 1 calc(50% - 10px)}
}
@media(max-width:560px){
  body{font-size:13px}
  .card{border-radius:12px;padding:14px}
  h1{font-size:clamp(21px,6vw,28px);line-height:1.2}
  h2{font-size:clamp(17px,4.8vw,21px);line-height:1.3}
  h3{font-size:15px;line-height:1.35}
  .pagehead{gap:10px;align-items:flex-start}
  .pagehead>.btn,.pagehead .actions>.btn{max-width:100%}
  .filterbar,.filterbar-labeled{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
  .filterbar>.field,.filterbar-labeled>.field{min-width:0;width:100%}
  .filterbar>div:not(.field),.filterbar-labeled>div:not(.field){display:flex;align-items:stretch;gap:8px}
  .filterbar>div:not(.field)>.btn,.filterbar-labeled>div:not(.field)>.btn{flex:1 1 auto;justify-content:center}
  .tablewrap{max-width:calc(100vw - 26px);border-radius:10px}
  .tablewrap table{min-width:700px}
  .tablewrap th,.tablewrap td{padding:9px 10px;font-size:12px}
  .actions,.system-actions-cell{white-space:normal;min-width:150px}
  .actions .btn,.system-actions-cell .btn{margin:2px 2px 2px 0}
  .file-picker{align-items:center}
  .file-picker-name{flex:1 1 120px;font-size:12px}
  .btn,button.btn{min-height:38px}
  .sidebar-user{margin-top:14px}
}
@media(max-width:360px){
  .topbar{padding-inline:8px}
  .brand strong{font-size:11px}
  .pwa-install-btn{max-width:68px;overflow-wrap:anywhere}
  .card{padding:11px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* V48 hotfix: mobile header stays on one row; prevents account controls overlapping page content. */
.topbar{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:visible}
.topbar>.menu-toggle{flex:0 0 42px}
.topbar>.brandlockup{flex:1 1 auto;width:auto;max-width:none;min-width:0}
.topbar>.top-actions{flex:0 1 auto;width:auto;max-width:48%;min-width:0;white-space:nowrap}
.top-actions .top-icon{flex:0 0 auto}
@media(max-width:850px){
  .topbar{flex-wrap:nowrap;height:64px;min-height:64px;overflow:hidden}
  .topbar>.brandlockup{flex:1 1 0;max-width:none;min-width:0}
  .topbar>.top-actions{flex:0 0 auto;max-width:42%;gap:6px}
  .top-actions .top-icon,.top-actions .userbox{display:none!important}
  .top-actions .pwa-install-btn{max-width:100px;white-space:normal;line-height:1.15}
  .top-actions .user-avatar{flex:0 0 30px}
  .top-actions>a,.top-actions .logout-link{font-size:10px;white-space:nowrap}
}
@media(max-width:560px){
  .topbar{height:60px;min-height:60px;padding:6px 8px;gap:6px}
  .topbar>.menu-toggle{flex-basis:34px;width:34px;height:38px;margin:0;padding:3px}
  .topbar>.brandlockup{gap:6px}
  .brand-logo,.brand-placeholder{width:32px;height:32px;flex:0 0 32px}
  .brand strong{font-size:10px;line-height:1.2;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
  .brand small{font-size:8.5px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar>.top-actions{max-width:43%;gap:5px}
  .top-actions .pwa-install-btn{max-width:78px;min-height:30px;padding:4px 5px!important;font-size:9px!important;white-space:normal;line-height:1.1}
  .top-actions .user-avatar{width:27px;height:27px;flex-basis:27px;font-size:12px}
  .top-actions>a,.top-actions .logout-link{font-size:9px}
}
@media(max-width:390px){
  .topbar>.top-actions{max-width:40%;gap:4px}
  .top-actions .user-avatar{display:none}
  .top-actions .pwa-install-btn{max-width:70px;font-size:8.5px!important}
  .top-actions>a,.top-actions .logout-link{font-size:8.5px}
  .brand strong{font-size:9.5px}
}


/* TBMSG V49 — sửa dứt điểm header mobile: override flex-direction:column còn sót từ CSS cũ. */
.topbar{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:flex-start !important;
  width:100%;
  min-width:0;
  gap:10px;
}
.topbar > .menu-toggle{
  position:relative !important;
  inset:auto !important;
  display:grid !important;
  place-items:center;
  flex:0 0 40px !important;
  width:40px;
  min-width:40px;
  height:40px;
  margin:0 !important;
  padding:0 !important;
}
.topbar > .brandlockup{
  display:flex !important;
  flex:1 1 auto !important;
  align-items:center !important;
  width:auto !important;
  min-width:0 !important;
  max-width:none !important;
  visibility:visible !important;
  overflow:hidden;
}
.topbar > .brandlockup .brand{
  display:block !important;
  flex:1 1 auto;
  min-width:0;
  visibility:visible !important;
}
.topbar > .brandlockup .brand strong,
.topbar > .brandlockup .brand small{
  display:block;
  max-width:100%;
  color:#fff;
}
.topbar > .top-actions{
  display:flex !important;
  flex:0 0 auto !important;
  align-items:center !important;
  width:auto !important;
  min-width:0 !important;
  max-width:42%;
  margin-left:auto;
  white-space:nowrap;
}
@media(max-width:850px){
  .topbar{height:64px !important;min-height:64px !important;padding:7px 12px !important;overflow:hidden !important;}
  .topbar > .menu-toggle{flex-basis:38px !important;width:38px;min-width:38px;height:40px;}
  .topbar > .brandlockup{gap:8px !important;}
  .topbar > .brandlockup .brand-logo,
  .topbar > .brandlockup .brand-placeholder{display:grid;flex:0 0 34px;width:34px;height:34px;}
  .topbar > .brandlockup .brand strong{font-size:clamp(9px,2.5vw,12px) !important;line-height:1.2;white-space:normal;overflow-wrap:anywhere;}
  .topbar > .brandlockup .brand small{font-size:9px !important;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .topbar > .top-actions{gap:5px !important;max-width:36%;}
  .topbar > .top-actions .top-icon,
  .topbar > .top-actions .userbox{display:none !important;}
  .topbar > .top-actions .pwa-install-btn{max-width:86px;min-height:30px;padding:5px 7px !important;font-size:9px !important;line-height:1.15;white-space:normal;}
  .topbar > .top-actions .user-avatar{width:28px;height:28px;flex:0 0 28px;}
  .topbar > .top-actions > a{font-size:10px;white-space:nowrap;}
}
@media(max-width:560px){
  .topbar{height:60px !important;min-height:60px !important;padding:6px 9px !important;gap:6px !important;}
  .topbar > .menu-toggle{flex-basis:34px !important;width:34px;min-width:34px;height:38px;font-size:22px !important;}
  .topbar > .brandlockup{gap:6px !important;}
  .topbar > .brandlockup .brand-logo,
  .topbar > .brandlockup .brand-placeholder{flex-basis:31px;width:31px;height:31px;}
  .topbar > .brandlockup .brand strong{font-size:clamp(8.5px,2.7vw,10.5px) !important;max-width:none;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
  .topbar > .brandlockup .brand small{font-size:8.5px !important;}
  .topbar > .top-actions{max-width:31%;gap:4px !important;}
  .topbar > .top-actions .pwa-install-btn{max-width:68px;font-size:8px !important;padding:4px 5px !important;}
  .topbar > .top-actions .user-avatar{display:none !important;}
  .topbar > .top-actions > a{font-size:9px;}
}
@media(max-width:360px){
  .topbar{padding-inline:6px !important;gap:4px !important;}
  .topbar > .menu-toggle{flex-basis:30px !important;width:30px;min-width:30px;}
  .topbar > .brandlockup{gap:4px !important;}
  .topbar > .brandlockup .brand-logo,
  .topbar > .brandlockup .brand-placeholder{flex-basis:27px;width:27px;height:27px;}
  .topbar > .brandlockup .brand strong{font-size:8px !important;}
  .topbar > .brandlockup .brand small{font-size:7.5px !important;}
  .topbar > .top-actions{max-width:29%;}
  .topbar > .top-actions .pwa-install-btn{max-width:58px;font-size:7.5px !important;}
}


/* TBMSG V50 — final mobile header/layout stabilization. Append-only overrides. */
html,body{max-width:100%;overflow-x:hidden}
body{min-width:0}
.topbar{
  position:sticky !important;top:0 !important;z-index:100 !important;
  display:flex !important;flex-direction:row !important;flex-wrap:nowrap !important;
  align-items:center !important;justify-content:space-between !important;
  box-sizing:border-box !important;width:100% !important;height:68px !important;min-height:68px !important;
  padding:8px 16px !important;gap:12px !important;overflow:hidden !important;
}
.topbar > .menu-toggle{
  position:relative !important;inset:auto !important;align-self:center !important;
  display:grid !important;place-items:center !important;order:0 !important;
  flex:0 0 40px !important;width:40px !important;min-width:40px !important;height:40px !important;
  margin:0 !important;padding:0 !important;transform:none !important;
}
.topbar > .brandlockup{
  position:relative !important;inset:auto !important;order:1 !important;
  display:flex !important;flex:1 1 auto !important;align-self:center !important;
  width:auto !important;min-width:0 !important;max-width:none !important;height:auto !important;
  margin:0 !important;padding:0 !important;gap:9px !important;overflow:hidden !important;
  visibility:visible !important;transform:none !important;
}
.topbar > .brandlockup .brand-logo,.topbar > .brandlockup .brand-placeholder{
  display:grid !important;place-items:center !important;position:relative !important;
  flex:0 0 38px !important;width:38px !important;height:38px !important;min-width:38px !important;
  object-fit:contain;border-radius:50%;
}
.topbar > .brandlockup .brand{display:block !important;position:relative !important;flex:1 1 auto !important;min-width:0 !important;overflow:hidden !important;visibility:visible !important}
.topbar > .brandlockup .brand strong{display:block !important;max-width:100% !important;color:#fff !important;font-size:clamp(10px,1.05vw,14px) !important;line-height:1.2 !important;white-space:normal !important;overflow-wrap:anywhere !important}
.topbar > .brandlockup .brand small{display:block !important;max-width:100% !important;color:rgba(255,255,255,.88) !important;font-size:11px !important;line-height:1.25 !important;white-space:nowrap !important;overflow:hidden !important;text-overflow:ellipsis !important}
.topbar > .top-actions{
  position:relative !important;inset:auto !important;order:2 !important;
  display:flex !important;flex:0 0 auto !important;align-items:center !important;justify-content:flex-end !important;
  width:auto !important;min-width:0 !important;max-width:42% !important;height:auto !important;
  margin:0 0 0 auto !important;padding:0 !important;gap:8px !important;white-space:nowrap !important;
  overflow:hidden !important;transform:none !important;
}
.topbar > .top-actions .top-icon,.topbar > .top-actions .userbox{display:none !important}
.topbar > .top-actions .pwa-install-btn{display:inline-flex !important;align-items:center !important;justify-content:center !important;flex:0 1 auto !important;max-width:120px !important;min-width:0 !important;min-height:34px !important;padding:6px 9px !important;font-size:11px !important;line-height:1.15 !important;white-space:normal !important}
.topbar > .top-actions .user-avatar{display:none !important}
.topbar > .top-actions > a,.topbar > .top-actions .logout-link{display:inline-flex !important;align-items:center !important;flex:0 0 auto !important;margin:0 !important;font-size:11px !important;line-height:1.2 !important;white-space:nowrap !important}
body.has-sidebar .container{position:relative;z-index:1;min-width:0;max-width:100%;box-sizing:border-box}
.pagehead,.page-actions,.card,.grid,.metric-grid,.dashboard-grid,.chart-card{min-width:0;max-width:100%;box-sizing:border-box}
.page-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.page-actions .btn{max-width:100%;white-space:normal;overflow-wrap:anywhere}
@media(max-width:850px){
 .topbar{height:62px !important;min-height:62px !important;padding:7px 11px !important;gap:8px !important}
 .topbar > .menu-toggle{flex-basis:36px !important;width:36px !important;min-width:36px !important;height:38px !important}
 .topbar > .brandlockup{gap:7px !important}
 .topbar > .brandlockup .brand-logo,.topbar > .brandlockup .brand-placeholder{flex-basis:32px !important;width:32px !important;height:32px !important;min-width:32px !important}
 .topbar > .brandlockup .brand strong{font-size:clamp(9px,2.5vw,12px) !important;line-height:1.15 !important}
 .topbar > .brandlockup .brand small{font-size:9px !important}
 .topbar > .top-actions{max-width:31% !important;gap:5px !important}
 .topbar > .top-actions .pwa-install-btn{max-width:72px !important;min-height:30px !important;padding:4px 5px !important;font-size:9px !important}
 .topbar > .top-actions > a,.topbar > .top-actions .logout-link{font-size:10px !important}
 body.has-sidebar .container{margin:16px 12px 24px !important;padding:0 !important;width:auto !important;max-width:none !important}
 body.has-sidebar .footer{margin-left:0 !important}
}
@media(max-width:560px){
 .topbar{height:60px !important;min-height:60px !important;padding:6px 8px !important;gap:6px !important}
 .topbar > .menu-toggle{flex-basis:32px !important;width:32px !important;min-width:32px !important;height:36px !important;font-size:21px !important}
 .topbar > .brandlockup{gap:5px !important}
 .topbar > .brandlockup .brand-logo,.topbar > .brandlockup .brand-placeholder{flex-basis:29px !important;width:29px !important;height:29px !important;min-width:29px !important}
 .topbar > .brandlockup .brand strong{font-size:clamp(8px,2.65vw,10px) !important;line-height:1.15 !important;display:-webkit-box !important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden !important}
 .topbar > .brandlockup .brand small{font-size:8px !important}
 .topbar > .top-actions{max-width:27% !important;gap:4px !important}
 .topbar > .top-actions .pwa-install-btn{display:none !important}
 .topbar > .top-actions > a,.topbar > .top-actions .logout-link{font-size:9px !important}
 body.has-sidebar .container{margin:13px 10px 20px !important}
 .pagehead{align-items:flex-start !important;gap:8px !important}
 .pagehead h1{font-size:clamp(21px,5.6vw,25px) !important;line-height:1.22 !important;overflow-wrap:anywhere}
 .pagehead p,.pagehead .muted{font-size:13px !important;line-height:1.5 !important}
 .page-actions{display:flex !important;flex-wrap:wrap !important;width:100% !important;gap:8px !important}
 .page-actions .btn{flex:1 1 auto !important;min-height:42px !important;font-size:12px !important}
 .grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:10px !important}
 .card{padding:13px !important;border-radius:13px !important}
 .tablewrap{max-width:100% !important;overflow-x:auto !important}
}
@media(max-width:380px){
 .topbar{padding-inline:6px !important;gap:4px !important}
 .topbar > .menu-toggle{flex-basis:29px !important;width:29px !important;min-width:29px !important}
 .topbar > .brandlockup .brand-logo,.topbar > .brandlockup .brand-placeholder{flex-basis:25px !important;width:25px !important;height:25px !important;min-width:25px !important}
 .topbar > .brandlockup .brand strong{font-size:8px !important}
 .topbar > .brandlockup .brand small{font-size:7.5px !important}
 .topbar > .top-actions{max-width:23% !important}
 .topbar > .top-actions > a,.topbar > .top-actions .logout-link{font-size:8px !important}
 .grid{grid-template-columns:minmax(0,1fr) !important}
}


/* V51 - Trang đăng nhập căn giữa, chuyên nghiệp và responsive; không thay đổi nghiệp vụ */
body.guest{min-height:100vh;background:radial-gradient(ellipse at top,#e5effb 0%,#f4f7fc 52%,#edf3fa 100%);font-family:Inter,"Segoe UI",Roboto,Arial,sans-serif}
body.guest .topbar{position:relative;display:flex;align-items:center;justify-content:flex-end;min-height:66px;height:66px;padding:8px clamp(14px,3vw,34px);background:linear-gradient(110deg,#07345d 0%,#0a4d82 58%,#087db6 100%)}
body.guest .topbar>.menu-toggle{display:none!important}
body.guest .topbar>.brandlockup{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;justify-content:center;align-items:center;gap:11px;max-width:calc(100% - 190px);width:max-content;flex:0 1 auto;text-align:left}
body.guest .topbar>.brandlockup .brand-logo,body.guest .topbar>.brandlockup .brand-placeholder{width:40px;height:40px;min-width:40px;flex:0 0 40px}
body.guest .topbar>.brandlockup .brand strong{font-size:clamp(12px,1.2vw,16px);line-height:1.25;font-weight:800;color:#fff}
body.guest .topbar>.brandlockup .brand small{font-size:11px;line-height:1.3;color:#e4f0fc;white-space:normal}
body.guest .topbar>.top-actions{position:relative;z-index:1;max-width:160px;flex:0 0 auto}
body.guest .login-page{width:100%;min-height:calc(100vh - 66px);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:34px 18px 20px}
body.guest .login-banner{display:none!important}
body.guest .login-layout{display:block;width:100%;max-width:460px;margin:0 auto;padding:0}
body.guest .login-layout .login,body.guest .login-page>.login{width:100%;max-width:460px;margin:0 auto;padding:clamp(24px,4vw,38px);border:1px solid #dce6f1;border-radius:22px;background:rgba(255,255,255,.97);box-shadow:0 18px 50px rgba(16,55,91,.12);align-self:auto}
body.guest .login-brand{text-align:center;display:flex;flex-direction:column;align-items:center;gap:0;margin:0 auto 20px;max-width:100%}
body.guest .login-logo{display:block;width:76px;height:76px;object-fit:contain;padding:7px;border-radius:19px;background:#fff;border:1px solid #e2eaf3;box-shadow:0 6px 18px rgba(15,55,92,.08);margin:0 auto 15px}
body.guest .login-logo-fallback{display:grid;place-items:center;color:#fff;background:linear-gradient(135deg,#0a477c,#1489c9);font-size:35px;font-weight:800}
body.guest .login-kicker{margin:0 0 7px;color:#4e789e;font-size:10px;line-height:1.4;font-weight:850;letter-spacing:1.7px}
body.guest .login-brand h1{margin:0;color:#123b62;font-size:clamp(20px,3vw,26px);font-weight:850;line-height:1.25;letter-spacing:-.45px;overflow-wrap:anywhere}
body.guest .login-app-name{margin:7px 0 0;color:#647991;font-size:13px;line-height:1.5}
body.guest .login-divider{height:1px;width:100%;background:linear-gradient(90deg,transparent,#dce6f1,transparent);margin:0 0 23px}
body.guest .login h2{margin:0 0 7px;text-align:center;color:#173d63;font-size:22px;line-height:1.3;font-weight:800;letter-spacing:-.3px}
body.guest .login-intro{text-align:center;margin:0 0 22px;font-size:13px;line-height:1.55;color:#718197}
body.guest .login-form{display:flex;flex-direction:column;gap:16px}
body.guest .login-form .field{margin:0;min-width:0}
body.guest .login-form .field label{display:block;margin:0 0 7px;font-size:13px;font-weight:750;color:#294863}
body.guest .login-form .field input{display:block;width:100%;min-width:0;min-height:48px;padding:12px 14px;border:1px solid #cbd9e8;border-radius:11px;background:#fbfdff;color:#153651;font:inherit;font-size:15px;transition:border-color .16s,box-shadow .16s}
body.guest .login-form .field input:focus{outline:0;border-color:#1688d2;background:#fff;box-shadow:0 0 0 4px rgba(22,136,210,.13)}
body.guest .login-submit{display:flex;align-items:center;justify-content:center;width:min(100%,220px);min-height:48px;margin:7px auto 0;padding:12px 24px;border:0;border-radius:11px;background:linear-gradient(105deg,#0878ce,#1598dc);box-shadow:0 7px 16px rgba(8,120,206,.2);color:#fff;font-size:15px;font-weight:800;letter-spacing:.1px}
body.guest .login-submit:hover{background:linear-gradient(105deg,#076bb8,#087fc3);box-shadow:0 9px 20px rgba(8,120,206,.25);transform:translateY(-1px)}
body.guest .login-security{text-align:center;color:#8392a5;font-size:11px;line-height:1.5;margin:20px 0 0}
body.guest .login-footer{padding:22px 8px 0;text-align:center;color:#7e8ea2;font-size:11px;line-height:1.5}
body.guest .alert{font-size:13px;line-height:1.5}
@media(max-width:600px){
 body.guest .topbar{height:58px;min-height:58px;padding:6px 10px}
 body.guest .topbar>.brandlockup{max-width:calc(100% - 24px);gap:7px}
 body.guest .topbar>.brandlockup .brand-logo,body.guest .topbar>.brandlockup .brand-placeholder{width:32px;height:32px;min-width:32px;flex-basis:32px}
 body.guest .topbar>.brandlockup .brand strong{font-size:clamp(10px,3vw,13px);line-height:1.2}
 body.guest .topbar>.brandlockup .brand small{font-size:9px;line-height:1.2}
 body.guest .topbar>.top-actions{display:none!important}
 body.guest .login-page{min-height:calc(100vh - 58px);padding:24px 14px 18px;justify-content:center}
 body.guest .login-page>.login{max-width:430px;padding:25px 21px;border-radius:18px}
 body.guest .login-logo{width:66px;height:66px;border-radius:16px;margin-bottom:12px}
 body.guest .login-brand h1{font-size:clamp(19px,5vw,23px)}
 body.guest .login h2{font-size:20px}
 body.guest .login-form .field input{min-height:47px;font-size:16px}
 body.guest .login-submit{width:100%;max-width:280px;min-height:48px}
}
@media(max-width:360px){body.guest .login-page{padding:16px 10px}body.guest .login-page>.login{padding:22px 16px}body.guest .login-logo{width:58px;height:58px}body.guest .login-brand h1{font-size:18px}body.guest .login-intro{font-size:12px}}
@media(min-width:601px) and (max-height:700px){body.guest .login-page{padding-top:20px;padding-bottom:12px}body.guest .login-page>.login{padding:22px 30px}body.guest .login-logo{width:58px;height:58px;margin-bottom:10px}body.guest .login-brand{margin-bottom:14px}body.guest .login-divider{margin-bottom:16px}body.guest .login-form{gap:12px}}

/* TBMSG pagination controls - responsive, shared across list modules */
.list-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0 8px;padding:10px 12px;background:#fff;border:1px solid #e2e8f0;border-radius:10px;color:#526176;font-size:13px}
.list-pagination__left,.list-pagination__right{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.list-pagination label{font-weight:650;color:#33445e}
.list-pagination select{min-height:34px;min-width:78px;padding:5px 28px 5px 9px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#172033;font:inherit}
.list-pagination button{min-height:34px;padding:6px 11px;border:1px solid #cbd5e1;border-radius:8px;background:#f7f9fc;color:#17365d;font:inherit;font-weight:700;cursor:pointer}
.list-pagination button:hover:not(:disabled){background:#eaf0f8}
.list-pagination button:disabled{opacity:.42;cursor:not-allowed}
.list-pagination__summary{font-variant-numeric:tabular-nums;white-space:nowrap}
@media(max-width:600px){.list-pagination{align-items:stretch;flex-direction:column;gap:9px;padding:10px}.list-pagination__left,.list-pagination__right{justify-content:space-between;width:100%}.list-pagination__summary{white-space:normal}.list-pagination select{flex:1;max-width:130px}}



/* V53 - tinh chỉnh giao diện đăng nhập trên điện thoại và bỏ các dòng lặp */
body.guest .login-page{width:100%;min-height:calc(100svh - 66px);padding:24px 16px 26px;gap:0}
body.guest .login-page>.login{width:100%;max-width:470px;padding:clamp(22px,4vw,34px);margin-inline:auto;overflow:hidden}
body.guest .login-brand{width:100%;text-align:center;align-items:center;justify-content:center;margin:0 auto 18px}
body.guest .login-logo{max-width:min(100%,120px);height:auto;aspect-ratio:1;object-fit:contain;margin:0 auto 14px}
body.guest .login-brand h1{width:100%;text-align:center;text-wrap:balance}
body.guest .login-app-name{width:100%;text-align:center}
body.guest .login-divider{margin:0 auto 20px}
body.guest .login h2,body.guest .login-intro,body.guest .login-security{text-align:center}
body.guest .login-form{width:100%;gap:15px}
body.guest .login-form .field{width:100%;text-align:left}
body.guest .login-form .field input{width:100%;max-width:100%;min-height:50px}
body.guest .login-submit{width:100%;max-width:none;min-height:50px;margin:5px auto 0}
body.guest .login-footer{width:100%;max-width:470px;padding:16px 8px 0;margin:0 auto;text-align:center}
body.guest>.footer{display:none!important}
@media(max-width:600px){
 body.guest .login-page{min-height:calc(100svh - 58px);padding:16px 12px 20px}
 body.guest .login-page>.login{max-width:460px;padding:23px 20px;border-radius:18px}
 body.guest .login-logo{width:68px;height:68px;margin-bottom:12px}
 body.guest .login-brand{margin-bottom:16px}
 body.guest .login-brand h1{font-size:clamp(20px,5.4vw,25px);line-height:1.25}
 body.guest .login-app-name{font-size:14px;margin-top:6px}
 body.guest .login-divider{margin-bottom:18px}
 body.guest .login h2{font-size:21px;margin-bottom:8px}
 body.guest .login-intro{font-size:13px;margin-bottom:20px}
 body.guest .login-form{gap:14px}
 body.guest .login-form .field label{font-size:14px}
 body.guest .login-form .field input{font-size:16px;padding:12px 13px}
 body.guest .login-submit{max-width:none;font-size:16px}
 body.guest .login-security{font-size:12px;margin-top:18px}
 body.guest .login-footer{font-size:11px;padding-top:14px}
}
@media(max-width:360px){
 body.guest .login-page{padding:12px 8px 16px}
 body.guest .login-page>.login{padding:20px 15px}
 body.guest .login-brand h1{font-size:19px}
 body.guest .login h2{font-size:19px}
}
