/* OSV Facility – giao diện lấy cảm hứng Oracle Redwood / EAM Cloud */
:root {
  --bg: #F5F4F2;
  --surface: #FFFFFF;
  --surface-2: #FBFAF8;
  --header: #312D2A;
  --header-2: #3F3A36;
  --text: #161513;
  --muted: #6F6B67;
  --faint: #9E9A96;
  --border: #E4E1DD;
  --primary: #227E9E;
  --primary-dark: #1A637C;
  --primary-soft: #E3F1F5;
  --red: #C74634;
  --red-soft: #FBE9E6;
  --orange: #AC630C;
  --orange-soft: #FCF0E0;
  --green: #508223;
  --green-soft: #EAF2E1;
  --slate: #6F7E8C;
  --slate-soft: #ECEFF2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(22, 21, 19, .06), 0 2px 8px rgba(22, 21, 19, .05);
  --shadow-lg: 0 8px 28px rgba(22, 21, 19, .18);
  --nav-h: 64px;
  --bar-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 18px; height: 18px; }
svg.i.lg { width: 28px; height: 28px; }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30; height: var(--bar-h);
  background: var(--header); color: #fff; display: flex; align-items: center; gap: 4px; padding: 0 6px 0 4px;
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
}
.appbar .title { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 6px; }
.appbar .title small { display: block; font-size: 11.5px; font-weight: 400; opacity: .72; margin-top: -2px; }
.iconbtn {
  width: 44px; height: 44px; border: 0; background: transparent; color: inherit; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative;
}
.iconbtn:active { background: rgba(255,255,255,.14); }
.iconbtn .dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--header); }
.brand { display: flex; align-items: center; gap: 10px; padding-left: 8px; flex: 1; min-width: 0; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #C74634, #E07A5F); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; letter-spacing: -.5px; }
.brand b { font-size: 16px; font-weight: 600; }
.brand span { display: block; font-size: 11px; opacity: .7; margin-top: -3px; }

/* ---------- Layout ---------- */
#main { padding: 0 0 calc(var(--nav-h) + 24px + var(--safe-b)); min-height: calc(100vh - var(--bar-h)); }
.page { max-width: 900px; margin: 0 auto; padding: 14px 14px 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 6px 2px 12px; }
.page-head h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.2px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 20px 4px 8px; display: flex; justify-content: space-between; align-items: center; }
.section-title a { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface); border-top: 1px solid var(--border); display: flex; justify-content: space-around;
}
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11.5px; font-weight: 500; position: relative; }
.bottomnav a.on { color: var(--primary); }
.bottomnav a.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
.bottomnav .badge-n { position: absolute; top: 7px; left: calc(50% + 6px); background: var(--red); color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.has-actionbar .bottomnav { display: none; }
.has-actionbar #main { padding-bottom: calc(86px + var(--safe-b)); }

/* ---------- Hero (trang chủ) ---------- */
.hero {
  background: radial-gradient(120% 140% at 100% 0%, #5A4A3F 0%, #312D2A 55%, #2A2624 100%);
  color: #fff; padding: 18px 18px 64px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; opacity: .13; pointer-events: none;
  background-image: repeating-linear-gradient(135deg, #fff 0 1px, transparent 1px 14px);
  mask-image: linear-gradient(90deg, transparent 30%, #000);
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.hero h2 { margin: 2px 0 2px; font-size: 22px; font-weight: 600; }
.hero p { margin: 0; opacity: .78; font-size: 13.5px; }
.hero .pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; background: rgba(255,255,255,.12); padding: 5px 10px; border-radius: 20px; font-size: 12.5px; }
.hero .pill i { width: 8px; height: 8px; border-radius: 50%; background: #9BD36E; display: inline-block; }
.hero .pill.warn i { background: #F2B24C; }
.kpi-wrap { margin: -48px 0 0; padding: 0 14px; position: relative; z-index: 2; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 900px; margin: 0 auto; }
.kpi { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 12px 10px; border: 0; text-align: left; cursor: pointer; position: relative; overflow: hidden; min-height: 92px; }
.kpi b { display: block; font-size: 26px; font-weight: 650; line-height: 1.1; color: var(--text); }
.kpi span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.25; }
.kpi em { font-style: normal; display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--red); background: var(--red-soft); padding: 1px 7px; border-radius: 10px; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--kc, var(--primary)); }

/* Springboard */
.springboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 0; padding: 14px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; text-align: center; font-size: 12.5px; font-weight: 500; color: var(--text); }
.tile .ti { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--tc, var(--primary)); }
.tile:active, .kpi:active, .card.click:active, .row.click:active { transform: scale(.985); }

/* ---------- Cards / list ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; }
.card.pad { padding: 14px; }
.card.click { cursor: pointer; transition: transform .08s; }
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--border); position: relative; background: var(--surface); }
.row:last-child { border-bottom: 0; }
.row.click { cursor: pointer; }
.row .bar { position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 3px 3px 0; }
.row .main { flex: 1; min-width: 0; }
.row .t1 { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.row .t2 { color: var(--muted); font-size: 13px; margin-top: 2px; }
.row .t3 { color: var(--text); font-size: 13.5px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .side { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.row .chev { color: var(--faint); align-self: center; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty svg { width: 54px; height: 54px; stroke: var(--faint); margin-bottom: 8px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; background: var(--slate-soft); color: #44505C; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.blue { background: var(--primary-soft); color: var(--primary-dark); }
.badge.solid-red { background: var(--red); color: #fff; }
.badge.solid-orange { background: var(--orange); color: #fff; }
.badge.solid-green { background: var(--green); color: #fff; }
.badge.dark { background: var(--header); color: #fff; }
.cls { display: inline-flex; width: 22px; height: 22px; border-radius: 6px; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; background: var(--slate-soft); color: #44505C; flex: none; }
.cls.hot { background: var(--red); color: #fff; }

/* ---------- Toolbar: search + chips ---------- */
.toolbar { position: sticky; top: var(--bar-h); z-index: 20; background: var(--bg); padding: 10px 14px 8px; margin: 0 -14px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 0 14px; height: 44px; }
.search input { border: 0; outline: 0; flex: 1; background: transparent; min-width: 0; font-size: 15px; }
.search svg { color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--border); background: var(--surface); border-radius: 20px; padding: 6px 13px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--header); border-color: var(--header); color: #fff; }
.chip .n { font-size: 11px; opacity: .75; }
select.chip { appearance: none; -webkit-appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }
.seg { display: flex; background: #EAE7E3; border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.count-line { font-size: 12.5px; color: var(--muted); margin: 4px 4px 8px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Detail header (EAM style) ---------- */
.dhead { background: var(--surface); padding: 16px 16px 0; border-bottom: 1px solid var(--border); }
.dhead .code { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dhead h2 { margin: 4px 0 6px; font-size: 19px; font-weight: 600; line-height: 1.3; }
.dhead .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 10px 0 12px; }
.fact small { display: block; font-size: 11.5px; color: var(--muted); }
.fact b { font-size: 14px; font-weight: 600; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 10px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 12px 12px 11px; font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.rpn-big { display: flex; align-items: center; gap: 12px; }
.rpn-big .num { font-size: 30px; font-weight: 700; line-height: 1; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.fld label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 5px 2px; }
.fld label .req { color: var(--red); }
.fld .hint { font-size: 12px; color: var(--muted); margin: 4px 2px 0; }
.inp, .fld input:not([type=checkbox]):not([type=file]), .fld select, .fld textarea {
  width: 100%; border: 1px solid #CFCAC5; background: var(--surface); border-radius: 8px; padding: 10px 12px; min-height: 44px; outline: none; font-size: 15px;
}
.fld textarea { min-height: 84px; resize: vertical; }
.inp:focus, .fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.fld.err input, .fld.err textarea, .inp.err { border-color: var(--red); background: #FFF8F7; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid #CFCAC5; border-radius: 8px; padding: 10px 12px; min-height: 44px; cursor: pointer; }
.switch { width: 44px; height: 26px; border-radius: 13px; background: #CFCAC5; position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.toggle.on .switch { background: var(--primary); }
.toggle.on .switch::after { left: 21px; }
.optset { display: flex; flex-wrap: wrap; gap: 8px; }
.optset .chip { padding: 8px 14px; }
fieldset.sect { border: 0; padding: 0; margin: 0 0 12px; }
.acc { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden; }
.acc > summary { list-style: none; padding: 14px 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .n { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.acc > summary .chev { margin-left: auto; transition: transform .15s; color: var(--muted); }
.acc[open] > summary .chev { transform: rotate(90deg); }
.acc > .body { padding: 0 16px 16px; }

/* Stepper S/O/D */
.score { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.score .top { display: flex; align-items: center; gap: 10px; }
.score .lbl { font-weight: 700; width: 22px; font-size: 18px; }
.score .name { flex: 1; font-size: 13px; color: var(--muted); }
.score .stp { display: flex; align-items: center; gap: 6px; }
.score .stp button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font-size: 20px; cursor: pointer; }
.score .stp b { width: 30px; text-align: center; font-size: 20px; }
.score .desc { font-size: 13px; margin-top: 8px; color: var(--text); }
.score .scale { display: flex; gap: 3px; margin-top: 8px; }
.score .scale i { flex: 1; height: 6px; border-radius: 3px; background: #E4E1DD; }
.score .scale i.on { background: var(--sc, var(--primary)); }

/* ---------- Buttons ---------- */
.btn { border: 1px solid transparent; border-radius: 22px; padding: 0 18px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 14.5px; cursor: pointer; background: var(--surface); border-color: #CFCAC5; color: var(--text); white-space: nowrap; }
.btn.primary { background: var(--header); border-color: var(--header); color: #fff; }
.btn.accent { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--surface); border-top: 1px solid var(--border);
  padding: 10px 14px calc(10px + var(--safe-b)); display: flex; gap: 10px; box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}
.actionbar .btn { flex: 1; }
.fab { position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px + var(--safe-b)); z-index: 35; width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--primary); color: #fff; box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fab svg { width: 28px; height: 28px; stroke-width: 2.2; }

/* ---------- Checklist run ---------- */
.progress { height: 6px; background: #E4E1DD; border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); transition: width .2s; }
.prog-line { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin: 0 2px 6px; }
.sec-h { font-size: 13px; font-weight: 700; color: var(--primary-dark); background: var(--primary-soft); border-radius: 8px; padding: 8px 12px; margin: 16px 0 8px; }
.item { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 12px 12px 14px; margin-bottom: 10px; border-left: 4px solid transparent; }
.item.ok { border-left-color: var(--green); }
.item.ng { border-left-color: var(--red); }
.item.na { border-left-color: var(--slate); }
.item .ih { display: flex; gap: 10px; align-items: flex-start; }
.item .no { font-weight: 700; color: var(--muted); min-width: 22px; font-size: 14px; padding-top: 1px; }
.item .tx { flex: 1; font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.item .tx .vi { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.item .crit { font-size: 12.5px; color: var(--muted); margin: 6px 0 0 32px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.item .crit b { color: var(--text); font-weight: 600; }
.item .ctl { margin: 10px 0 0 32px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.okng { display: flex; gap: 8px; flex: 1; min-width: 220px; }
.okng button { flex: 1; height: 44px; border-radius: 10px; border: 1.5px solid #CFCAC5; background: var(--surface); font-weight: 700; font-size: 14px; cursor: pointer; color: var(--muted); }
.okng button.on.ok { background: var(--green); border-color: var(--green); color: #fff; }
.okng button.on.ng { background: var(--red); border-color: var(--red); color: #fff; }
.okng button.on.na { background: var(--slate); border-color: var(--slate); color: #fff; }
.measure { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; }
.measure input { width: 130px; height: 44px; border: 1.5px solid #CFCAC5; border-radius: 10px; padding: 0 12px; font-size: 18px; font-weight: 600; text-align: right; outline: none; }
.measure input.bad { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.measure input.good { border-color: var(--green); }
.measure .u { color: var(--muted); font-weight: 600; }
.item .more { margin: 10px 0 0 32px; display: grid; gap: 8px; }
.item textarea { width: 100%; border: 1px solid #CFCAC5; border-radius: 8px; padding: 9px 11px; min-height: 60px; font-size: 14px; outline: none; }
.item textarea.err { border-color: var(--red); background: #FFF8F7; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.photo-btn { width: 64px; height: 64px; border-radius: 8px; border: 1.5px dashed #B9B4AF; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10.5px; color: var(--muted); cursor: pointer; gap: 2px; }
.mini { font-size: 12px; color: var(--muted); }
.reg-row { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 8px; overflow: hidden; }
.reg-row > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.reg-row > summary::-webkit-details-marker { display: none; }
.reg-row .body { padding: 0 14px 14px; display: grid; gap: 10px; }
.reg-field { display: grid; gap: 4px; }
.reg-field > span { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: pre-line; }

/* ---------- Sheet / modal / toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(22, 21, 19, .45); z-index: 80; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--surface); width: 100%; max-width: 640px; max-height: 92vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: up .2s ease-out; padding-bottom: var(--safe-b); }
.sheet .sh-h { padding: 10px 16px 8px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.sheet .sh-h::before { content: ""; position: absolute; left: 50%; transform: translateX(-50%); margin-top: -22px; width: 40px; height: 4px; border-radius: 2px; background: #CFCAC5; }
.sheet .sh-h h3 { flex: 1; margin: 6px 0; font-size: 17px; font-weight: 600; }
.sheet .sh-b { padding: 16px; overflow-y: auto; }
.sheet .sh-f { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.sheet .sh-f .btn { flex: 1; }
@media (min-width: 700px) { .scrim { align-items: center; } .sheet { border-radius: 18px; } }
@keyframes up { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 22px + var(--safe-b)); z-index: 90; background: var(--header); color: #fff; padding: 11px 18px; border-radius: 24px; font-size: 14px; box-shadow: var(--shadow-lg); max-width: 90vw; animation: up .2s; display: flex; align-items: center; gap: 8px; }
.toast.ok svg { color: #9BD36E; } .toast.err { background: var(--red); }
.loading { position: fixed; inset: 0; z-index: 95; background: rgba(245,244,242,.75); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; font-weight: 600; color: var(--muted); }
.spin { width: 36px; height: 36px; border: 3px solid #E4E1DD; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Fishbone, 5-Why */
.fish { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; position: relative; }
.fish .bone { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; min-height: 64px; }
.fish .bone b { display: block; font-size: 12px; color: var(--primary-dark); margin-bottom: 3px; }
.fish .spine { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.fish .spine::before { content: ""; flex: 1; height: 3px; background: var(--header); border-radius: 2px; }
.fish .head { background: var(--red); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; max-width: 60%; }
.why { display: grid; gap: 0; }
.why .w { display: flex; gap: 10px; }
.why .w .rail { display: flex; flex-direction: column; align-items: center; }
.why .w .rail b { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.why .w .rail i { flex: 1; width: 2px; background: var(--border); margin: 2px 0; }
.why .w .fld { flex: 1; padding-bottom: 12px; }
.stepper { display: flex; overflow-x: auto; gap: 6px; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--border); scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper button { flex: none; border: 1px solid var(--border); background: var(--surface); border-radius: 20px; padding: 6px 12px 6px 6px; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
.stepper button b { width: 24px; height: 24px; border-radius: 50%; background: #EAE7E3; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.stepper button.on { border-color: var(--header); background: var(--header); color: #fff; }
.stepper button.on b { background: rgba(255,255,255,.2); }
.stepper button.done b { background: var(--green); color: #fff; }
.checkline { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 14px; }
.checkline .ok { color: var(--green); } .checkline .no { color: var(--red); }

/* Heat map FMEA */
.heat { display: grid; grid-template-columns: 26px repeat(10, 1fr); gap: 2px; font-size: 10.5px; }
.heat div { aspect-ratio: 1; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.heat .ax { color: var(--muted); background: none; font-weight: 600; }
.bars .b { display: grid; grid-template-columns: 110px 1fr 34px; gap: 8px; align-items: center; font-size: 12.5px; margin: 6px 0; }
.bars .b .track { height: 10px; border-radius: 5px; background: #EAE7E3; overflow: hidden; display: flex; }
.bars .b .track i { display: block; height: 100%; }

@media (min-width: 700px) {
  .springboard { grid-template-columns: repeat(6, 1fr); }
  .kpis { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 360px) {
  .springboard { grid-template-columns: repeat(3, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}
.hide { display: none !important; }
.mt { margin-top: 12px; } .mt2 { margin-top: 20px; }
.muted { color: var(--muted); } .red { color: var(--red); } .green { color: var(--green); }
.small { font-size: 12.5px; }
.pre { white-space: pre-wrap; }
.kv { display: grid; grid-template-columns: 40% 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; white-space: pre-wrap; word-break: break-word; }
.has-actionbar .toast { bottom: calc(92px + var(--safe-b)); }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ===== v1.1: đo nhiều giá trị, lần trước, xu hướng, Min/Max ===== */
.bottomnav a.scan svg { background: var(--header); color: #fff; border-radius: 14px; width: 44px; height: 32px; padding: 5px 11px; margin-top: -2px; }
.bottomnav a.scan.on svg { background: var(--primary); }
.measures { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.measure-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.measure-row input { width: 120px; height: 46px; border: 1.5px solid #CFCAC5; border-radius: 10px; padding: 0 12px; font-size: 19px; font-weight: 650; text-align: right; outline: none; background: var(--surface); }
.measure-row input.bad { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.measure-row input.warn { border-color: #E0A100; background: #FFF6D6; color: #8A6400; }
.measure-row input.good { border-color: var(--green); }
.measure-row .u { color: var(--muted); font-weight: 600; min-width: 28px; }
.sublbl { flex-basis: 100%; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: -2px; }
.prev { font-size: 11.5px; color: var(--muted); line-height: 1.3; flex: 1; min-width: 90px; }
.prev b { color: var(--text); }
.warnc { color: #B07D00 !important; }
.spark { flex: none; }
.limbar { position: relative; height: 8px; border-radius: 4px; background: #EAE7E3; margin: 2px 0 6px; overflow: visible; }
.limbar span { position: absolute; top: 0; bottom: 0; }
.limbar .bad { background: #F3C6BF; } .limbar .good { background: #C7DDB2; }
.limbar span:first-child { border-radius: 4px 0 0 4px; } .limbar span:nth-child(3) { border-radius: 0 4px 4px 0; }
.limbar .mk { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; background: var(--header); }
.opl { display: flex; gap: 10px; align-items: center; background: var(--green-soft); border-radius: 10px; padding: 6px 8px; margin: 6px 0; font-size: 13px; }
.opl img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; cursor: zoom-in; }
.tagpick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--muted); }
.tagbtn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1.5px solid #CFCAC5; background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; }
.tagbtn.red { color: var(--red); } .tagbtn.blue { color: var(--primary); }
.tagbtn.red.on { background: var(--red); border-color: var(--red); color: #fff; }
.tagbtn.blue.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.item .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; min-height: 22px; }
.mini { font-size: 11px; color: var(--faint); display: inline-flex; align-items: center; gap: 4px; }
.routebar { display: flex; align-items: center; gap: 8px; background: #E2F0EC; color: #1F5A4F; border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.routebar span { flex: 1; } .routebar a { color: #1F5A4F; }
.warnbox { background: #FFF6D6; box-shadow: none; border: 1px solid #F0DC9A; color: #6B5100; margin-bottom: 10px; }

/* ===== lịch ca, lộ trình ===== */
.stchip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 12px; background: var(--slate-soft); color: var(--slate); white-space: nowrap; }
.stchip.done { background: var(--green-soft); color: var(--green); }
.stchip.due { background: #FFF3C4; color: #8A6400; }
.stchip.doing { background: var(--primary-soft); color: var(--primary-dark); }
.stchip.late { background: var(--red-soft); color: var(--red); }
.stackbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #EAE7E3; gap: 2px; }
.stackbar i { display: block; height: 100%; }
.steps { margin-top: 12px; position: relative; }
.stepline { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; margin-bottom: 8px; cursor: pointer; position: relative; }
.stepline .dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; background: var(--slate-soft); color: var(--slate); }
.stepline.done .dot { background: var(--green); color: #fff; }
.stepline.doing .dot { background: var(--primary); color: #fff; }
.stepline.due .dot { background: #FFF3C4; color: #8A6400; }
.stepline .main { flex: 1; min-width: 0; }
.stepline .t1 { font-weight: 600; } .stepline .t2 { font-size: 12.5px; color: var(--muted); }
.stepline .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ===== QR ===== */
.scanbox { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 1; max-height: 60vh; margin: 0 auto; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanbox .frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.9); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.scanbox p { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; color: #fff !important; margin: 0; padding: 0 12px; }
.qrthumb { width: 44px; height: 44px; flex: none; } .qrthumb svg { width: 100%; height: 100%; }
.qrbig { width: 132px; height: 132px; flex: none; } .qrbig svg { width: 100%; height: 100%; }
.devcode { font: 700 30px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 4px; text-align: center; padding: 14px; margin: 10px 0 4px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; user-select: all; }

/* ===== bảng xếp hạng, bảng, biểu đồ ===== */
.rank { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; background: var(--slate-soft); color: var(--slate); flex: none; }
.rank.r1 { background: #F2C94C; color: #5B4500; } .rank.r2 { background: #D5D8DC; color: #3D4247; } .rank.r3 { background: #E3B58C; color: #5A3412; }
.track1 { height: 6px; border-radius: 3px; background: #EAE7E3; margin: 5px 0 3px; overflow: hidden; } .track1 i { display: block; height: 100%; background: #7A5C99; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th, .tbl td { padding: 8px 8px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { color: var(--muted); font-weight: 600; background: var(--surface-2); }
.vbars { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding-top: 6px; }
.vbars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.vbars i { display: block; width: 100%; border-radius: 4px 4px 0 0; }
.vbars span { font-size: 9.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.bars .b small { font-size: 11px; text-align: right; }
select.chip, input.chip { font: inherit; font-size: 13px; color: var(--text); }

/* ===== v1.2: luồng NG, nơi lưu ===== */
.flowline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.timeline .tl { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.timeline .tl:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.timeline .tl:last-child { padding-bottom: 0; }
.tld { width: 28px; height: 28px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; }
.tld .i { width: 15px; height: 15px; stroke: #fff; }
.timeline .t1 { font-weight: 600; } .timeline .t2 { font-size: 12px; color: var(--muted); } .timeline .t3 { font-size: 13.5px; margin-top: 3px; white-space: pre-wrap; }
.flowbtns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .flowbtns .btn { justify-content: center; min-height: 46px; white-space: normal; min-width: 0; text-align: center; line-height: 1.2; }
.wrbox { white-space: pre-wrap; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; max-height: 38vh; overflow: auto; user-select: all; }
.dest { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.dest.on { border-color: #C7DDB2; background: #F6FAF1; }
.orange { color: var(--orange); }

/* ===== thư viện RCA & cây quyết định ===== */
.ti.doc { width: 42px; height: 42px; border-radius: 10px; background: var(--orange-soft); color: var(--orange); font: 700 10.5px/42px system-ui, sans-serif; text-align: center; flex: none; display: inline-block; }
.whychain { display: flex; flex-direction: column; gap: 0; }
.whychain .wy { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; display: flex; gap: 10px; position: relative; margin-bottom: 14px; }
.whychain .wy:not(:last-child)::after { content: "↓"; position: absolute; left: 22px; bottom: -15px; color: var(--faint); font-size: 13px; }
.whychain .wy b { color: var(--orange); white-space: nowrap; font-size: 12.5px; }
.dtree ul { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.dtree li { position: relative; padding: 8px 0 0 14px; }
.dtree li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--border); }
.dtree li:last-child::before { height: 30px; bottom: auto; }
.dtree li::after { content: ""; position: absolute; left: 0; top: 30px; width: 12px; border-top: 2px solid var(--border); }
.dnode { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 13.5px; }
.dnode.root { background: var(--red-soft); color: #7A2418; }
.dnode.cause { border-left: 4px solid var(--orange); }
.dnode.act { background: var(--green-soft); box-shadow: none; }
.dnode .step { width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; font-size: 12px; }
.pbar { height: 5px; border-radius: 3px; background: #EAE7E3; margin: 5px 0 2px; overflow: hidden; } .pbar i { display: block; height: 100%; background: var(--orange); }
.srcs { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 11.5px; } .srcs a { color: var(--primary-dark); }
.row.on { background: var(--primary-soft); }

/* ===== v1.3: nhận diện qua mã quét, chữ ký điện tử ===== */
.identcard { border-left: 4px solid var(--green); margin-bottom: 10px; }
.identcard .idg { display: grid; grid-template-columns: 74px 1fr; gap: 3px 10px; margin: 8px 0 6px; font-size: 13.5px; }
.identcard .idg span { color: var(--muted); } .identcard .idg b { word-break: break-word; }
.sigpad { position: relative; height: 150px; border: 1.5px dashed #B9B4AE; border-radius: 12px; background: #fff; margin: 6px 0; touch-action: none; }
.sigpad canvas { width: 100%; height: 100%; display: block; border-radius: 12px; }
.sigpad span { position: absolute; left: 12px; bottom: 10px; font-size: 11px; color: var(--faint); pointer-events: none; border-top: 1px solid var(--border); padding-top: 2px; width: 60%; }
.sigprev { display: flex; gap: 12px; align-items: center; }
.sigprev img { width: 130px; height: 52px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 8px; flex: none; }
.sigcard { margin: 10px 0 4px; box-shadow: none; border: 1px solid var(--border); }
.sigrow { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.sigrow img { width: 96px; height: 40px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 6px; flex: none; }
.sigph { width: 96px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--faint); border: 1px dashed var(--border); border-radius: 6px; }
.sigthumb { width: 64px; height: 28px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 5px; flex: none; }

/* thiết bị an toàn theo khu vực */
.item.sv .crit, .item.sv .ctl, .item.sv .more { margin-left: 0; }
.item.err { box-shadow: 0 0 0 2px var(--red); }

/* Lịch đi ca – kéo thả */
.rpool { position: sticky; top: 0; z-index: 5; max-height: 34vh; overflow: auto; }
.rchip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; margin: 0 6px 6px 0; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.rchip.me { border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.rchip.pick { background: var(--primary); color: #fff; border-color: var(--primary); }
.rchip .n { font-size: 11px; color: var(--muted); margin-left: 2px; }
.rchip.pick .n { color: #fff; }
.rchip i { font-style: normal; color: var(--red); padding: 0 2px 0 4px; cursor: pointer; }
.rchip.ghost { position: fixed; z-index: 9999; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.25); background: var(--surface); }
.rday { margin-bottom: 10px; }
.rday.today { box-shadow: 0 0 0 2px var(--primary); }
.rdh { margin-bottom: 6px; }
.rcell { display: flex; gap: 8px; align-items: flex-start; border-left: 4px solid var(--sc); background: var(--surface-2); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; min-height: 40px; }
.rcell.drop { background: var(--primary-soft); outline: 2px dashed var(--primary); }
.rsl { font-weight: 700; font-size: 12px; color: var(--sc); min-width: 34px; padding-top: 6px; }
.rnames { flex: 1; display: flex; flex-wrap: wrap; }
.rnames .rchip { margin: 2px 4px 2px 0; background: var(--surface); }

/* khoá PIN mở nhanh */
.pinlock { position: fixed; inset: 0; z-index: 10000; background: var(--header); color: #fff; display: flex; align-items: center; justify-content: center; padding: 24px 16px; overflow: auto; }
.pinlock .pl-in { width: 100%; max-width: 320px; text-align: center; }
.pinlock .logo { display: inline-flex; width: 56px; height: 56px; border-radius: 16px; background: var(--primary); align-items: center; justify-content: center; font-weight: 800; }
.pinlock h2 { margin: 12px 0 2px; font-size: 20px; }
.pinlock p { margin: 0; opacity: .8; }
.pinlock a { color: #fff; }
.pl-dots { display: flex; gap: 12px; justify-content: center; margin: 22px 0 6px; min-height: 16px; }
.pl-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; }
.pl-dots i.on { background: #fff; }
.pl-err { color: #FFB4A8; min-height: 18px; opacity: 1 !important; }
.pl-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
.pl-keys button { height: 60px; border-radius: 30px; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 24px; font-weight: 600; }
.pl-keys button:active { background: rgba(255,255,255,.3); }

/* Dashboard */
.dash .dfil { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.dkpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.dkpis .kpi { cursor: default; }
.dkpis .kpi[data-href] { cursor: pointer; }
.dlt { font-weight: 600; }
.dchip { display: inline-block; min-width: 52px; text-align: center; padding: 2px 8px; border-radius: 10px; font-weight: 600; background: var(--surface-2); }
.dchip.green { background: var(--green-soft, #E3F1EA); color: var(--green); }
.dchip.orange { background: #FFF3D6; color: #9A6B00; }
.dchip.red { background: var(--red-soft); color: var(--red); }
.dash tr.click { cursor: pointer; }
.dash tr.click:active td { background: var(--surface-2); }
.dgrid { display: block; }
@media (min-width: 760px) {
  .dash.wide { max-width: 1280px; }
  .dash.wide .dkpis { grid-template-columns: repeat(4, 1fr); }
  .dash.wide .dgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
}
.dkpis .kpi .small span { display: inline; font-size: inherit; margin: 0; color: inherit; }
.dkpis .kpi .small .red { color: var(--red); }
.dkpis .kpi .small .green { color: var(--green); }

/* checklist nhà thầu */
.cfld { padding: 10px 0; border-bottom: 1px solid var(--border); }
.cfld:last-child { border-bottom: 0; }
.cfld.ng { background: var(--red-soft); margin: 0 -12px; padding: 10px 12px; }
.clbl { margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.cgrid label { display: flex; flex-direction: column; gap: 2px; }
.dtabs { margin: 0 0 4px; overflow-x: auto; }
.dtabs button { position: relative; }
.dweak { display: block; font-style: normal; font-size: 9.5px; font-weight: 600; color: var(--red); line-height: 1.1; }
.dsum { border-left: 4px solid var(--red); margin-bottom: 10px; color: var(--text); }
.sysgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sysgrid .card { margin: 0; }
.steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.steps > div { flex: 1; min-width: 70px; text-align: center; }
.steps b { display: block; font-size: 18px; }
.steps span { display: block; font-size: 12px; color: var(--muted); }
.steps em { font-style: normal; font-size: 11px; color: var(--faint); }
.steps > i { font-style: normal; color: var(--faint); font-size: 20px; }
.pbar { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 44px; gap: 8px; align-items: center; font-size: 12.5px; margin: 6px 0; }
.pbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbar i { display: block; height: 10px; border-radius: 5px; background: var(--orange); min-width: 2px; }
.pbar b { text-align: right; }
.tbl.heat td { text-align: center; }
.tbl.heat td.hmiss { background: var(--red-soft); color: var(--red); font-weight: 600; }
.tbl.heat td.hmiss .small { font-weight: 400; white-space: normal; }
.tbl.heat td.hok { background: #E8F3EE; }
.subtabs { margin: 0 0 10px; overflow-x: auto; }
.hoprev { border: 2px solid var(--primary); background: var(--primary-soft); }
.horemind { background: #FFF6DB; border-radius: 8px; padding: 6px 8px; }
.hohist { background: var(--surface-2); border-radius: 8px; padding: 6px 8px; font-size: 12px; max-height: 140px; overflow: auto; }
.hohist div { margin: 2px 0; }

/* PCCC & thoát hiểm */
.firehd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.firehd b { display: block; font-size: 20px; }
.firehd span { font-size: 11px; color: var(--muted); }
.radar { position: sticky; top: 0; z-index: 4; background: #FFF6DB; border: 1px solid #F0D58A; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; font-size: 13px; max-height: 120px; overflow: auto; }
.radar div { margin-top: 4px; }
.rchip2 { border: 1px solid #E0A100; background: #fff; border-radius: 12px; padding: 3px 8px; margin: 0 4px 4px 0; font-size: 12px; font-weight: 600; color: #8A6200; }
.flist { display: flex; flex-direction: column; gap: 6px; }
.frow { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 10px; padding: 8px 10px; box-shadow: var(--shadow); border-left: 5px solid #E0A100; }
.frow.ok { border-left-color: var(--green); }
.frow.ng { border-left-color: var(--red); }
.frow .fmain { flex: 1; min-width: 0; cursor: pointer; }
.frow .fmain b { display: block; font-size: 15px; }
.frow .fmain span { font-size: 12px; color: var(--muted); }
.fbtn { border: 0; border-radius: 10px; padding: 12px 12px; font-weight: 700; font-size: 14px; min-width: 74px; }
.fbtn.okb { background: var(--green); color: #fff; }
.fbtn.ngb { background: var(--red-soft); color: var(--red); }
.fbtn.qr { background: var(--primary); color: #fff; display: inline-flex; gap: 4px; align-items: center; }
.frow.ok .fbtn.okb, .frow.ng .fbtn.ngb { opacity: .45; }
.tbl.fcfg td { text-align: center; }
.tbl.fcfg .qn { width: 64px; text-align: center; padding: 6px; }
