/* Giao diện QLTS IT — "sáng, hiện đại" (duyệt 19/10/2026, theo bản mẫu TongQuanV2 / ChiTietV2) */
:root {
  /* 27/10/2026: người dùng thấy chữ mờ nhạt → đậm thang màu chữ 1 bậc (cũ: ink-2 #344054, muted #667085, faint #98A2B3) */
  --bg: #F6F7F9; --surface: #FFFFFF; --ink: #0B1220; --ink-2: #1D2939; --muted: #475467; --faint: #667085;
  --line: #E4E7EC; --line-soft: #F2F4F7; --hover: #F9FAFB;
  --accent: #1F5BD8; --accent-dark: #1847AD; --accent-soft: #EEF4FF; --accent-line: #B2CCFF;
  --green: #067647; --green-soft: #ECFDF3; --red: #B42318; --red-soft: #FEF3F2; --red-dot: #F04438;
  --amber: #B54708; --amber-soft: #FFFAEB; --violet: #5925DC; --violet-soft: #F4F3FF; --gray: #475467; --gray-soft: #F2F4F7;
  --bs-body-font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-color: var(--ink); --bs-body-bg: var(--bg); --bs-border-color: var(--line);
  --bs-link-color-rgb: 31, 91, 216; --bs-link-hover-color-rgb: 24, 71, 173;
}
body { font-size: 14px; background: var(--bg); color: var(--ink); text-rendering: optimizeLegibility; }
.text-secondary { color: var(--muted) !important; }   /* chữ phụ của Bootstrap cũng theo thang màu đậm hơn */
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.mono, code.asset { font-family: 'IBM Plex Mono', ui-monospace, Consolas, monospace; }
code.asset { color: var(--ink); font-weight: 600; font-size: 13px; }
a code.asset { color: var(--accent); }
.ico { flex: none; }

/* ---------- Khung trang ---------- */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 240px; max-width: 100%; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--ink); text-decoration: none; }
/* Logo công ty (26/10/2026): ảnh chữ Nagakawa, dưới là "Quản lý tài sản IT" */
.side .brand.brand-logo { flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 10px 16px; }
.side .brand.brand-logo img { height: 24px; width: auto; display: block; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: none; }
.brand-name { font-weight: 700; font-size: 14px; line-height: 1.2; display: block; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 4px; }
.side .nav-link { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); font-weight: 600; }
.side .nav-link .ico { color: var(--ink-2); }
.side .nav-link:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.side .nav-link.active { background: var(--accent-soft); color: var(--accent); }
.side .nav-link.active .ico { color: var(--accent); }
.nav-count { margin-left: auto; font-size: 11px; font-weight: 600; background: #FEF0C7; color: #93370D; border-radius: 999px; padding: 0 7px; }
.side details { border-radius: 8px; }
.side summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.side summary::-webkit-details-marker { display: none; }
.side summary .ico { transition: transform .15s; color: var(--faint); }
.side details[open] summary .ico { transform: rotate(90deg); }
.side .sub-links { display: flex; flex-direction: column; gap: 2px; }

.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px clamp(16px, 3vw, 32px); background: var(--surface); border-bottom: 1px solid var(--line); }
.search { flex: 1 1 280px; max-width: 560px; display: flex; align-items: center; gap: 8px; border: 1px solid #D0D5DD; border-radius: 8px; padding: 0 12px; min-height: 40px; background: var(--surface); color: var(--muted); margin: 0; }
.search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { border: 0; outline: 0; font: inherit; flex: 1; min-width: 0; background: none; color: var(--ink); }
.kbd { font-size: 11px; border: 1px solid #D0D5DD; border-radius: 4px; padding: 0 5px; color: var(--muted); white-space: nowrap; }
.iconbtn { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; position: relative; color: var(--ink-2); }
.iconbtn:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.iconbtn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--red-dot); border: 2px solid var(--surface); }
.me { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.me-link { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.me-link:hover b { color: var(--accent-dark); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #D1E0FF; color: var(--accent-dark); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.me b { display: block; font-size: 13px; line-height: 1.2; }
.me span.r { font-size: 12px; color: var(--muted); }

.content { padding: 20px clamp(16px, 3vw, 32px) 48px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.page-head .sub, .sub { color: var(--muted); font-size: 13px; }
.crumb { font-size: 13px; color: var(--muted); }
.crumb a { color: var(--muted); }
.topnav { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Thẻ, ô số liệu ---------- */
.card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 16px; }
.card-header h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card-header .note { font-size: 12px; color: var(--muted); }
.card.alert-card { border-color: #FECDCA; }
.card.alert-card .card-header { background: var(--red-soft); border-radius: 12px 12px 0 0; }
.card.alert-card h2 { color: var(--red); }

.figs, .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.fig { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: inherit; }
a.fig:hover { border-color: var(--accent-line); text-decoration: none; }
.fig .k { font-size: 13px; color: var(--muted); }
.fig .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.fig .v.warn { color: var(--amber); } .fig .v.bad { color: var(--red); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; color: inherit; }
a.kpi:hover { border-color: var(--accent-line); text-decoration: none; color: inherit; }
.ki { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.ki.blue { background: var(--accent-soft); color: var(--accent); } .ki.green { background: var(--green-soft); color: var(--green); }
.ki.gray { background: var(--gray-soft); color: var(--gray); } .ki.red { background: var(--red-soft); color: var(--red); }
.ki.amber { background: var(--amber-soft); color: var(--amber); }
.kpi .k { font-size: 13px; color: var(--muted); } .kpi .v { font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .h { font-size: 12px; color: var(--muted); }

/* ---------- Bảng ---------- */
.table { --bs-table-bg: var(--surface); --bs-table-hover-bg: var(--hover); margin: 0; }
.table > thead th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--hover); border-bottom: 1px solid #EAECF0; white-space: nowrap; padding: 10px 14px; position: sticky; top: 0; }
.table td { font-variant-numeric: tabular-nums; vertical-align: middle; padding: 11px 14px; border-color: var(--line-soft); }
.table tbody tr:hover > td { background: var(--hover); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.card .table-wrap { border: 0; border-radius: 0 0 12px 12px; }
/* Bảng dài (chốt 21/10/2026): chỉ hiện 10 dòng đầu, cuộn lên xuống trong khung; tiêu đề cột đứng yên.
   app.js (gioiHan10Dong) đo đúng chiều cao 10 dòng rồi gắn class này. Bảng đặt data-no-scroll để không giới hạn. */
.table-wrap.scroll-10 { overflow-y: auto; overscroll-behavior: contain; }
.table-wrap.scroll-10 > .table > thead th { z-index: 2; box-shadow: inset 0 -1px 0 #EAECF0; }
.scroll-10-note { font-size: 12px; color: var(--muted); padding: 4px 2px 0; }
td.n, th.n { text-align: right; }
.table-compact > thead th, .table-compact td { padding: 9px 10px; }
.table-compact { min-width: 0 !important; }
.zero { color: #D0D5DD; }

/* ---------- Trạng thái (chấm tròn + màu) ---------- */
.pill, .chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: var(--gray); }
.pill::before, .chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.in_use, .pill.ok, .chip.green { background: var(--green-soft); color: var(--green); }
.pill.in_stock, .pill.info, .chip.blue { background: var(--accent-soft); color: var(--accent-dark); }
.pill.repairing, .pill.warn, .chip.amber { background: var(--amber-soft); color: var(--amber); }
.pill.broken, .pill.pending, .pill.disposed, .pill.bad, .chip.red { background: var(--red-soft); color: var(--red); }
.pill.idle, .chip.gray { background: var(--gray-soft); color: var(--gray); }
.pill.move, .chip.violet { background: var(--violet-soft); color: var(--violet); }
.br { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--gray-soft); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.away { color: var(--violet); font-weight: 600; }
.rule-box { display: flex; flex-wrap: wrap; gap: 8px 28px; background: var(--violet-soft); border: 1px solid #D9D6FE; border-radius: 10px; padding: 12px 16px; font-size: 13px; }
.rule-box b { color: var(--violet); }

/* ---------- Nút ---------- */
.btn { font-weight: 600; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; }
.btn-sm { min-height: 32px; }
.btn-primary { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: var(--accent-dark); --bs-btn-hover-border-color: var(--accent-dark); --bs-btn-active-bg: var(--accent-dark); --bs-btn-active-border-color: var(--accent-dark); }
.btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: #D0D5DD; --bs-btn-bg: var(--surface); --bs-btn-hover-bg: var(--hover); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #D0D5DD; --bs-btn-active-bg: var(--line-soft); --bs-btn-active-color: var(--ink); }
.btn-dark { --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); }
.btn:hover { text-decoration: none; }
.dropdown-menu { border-color: var(--line); border-radius: 10px; box-shadow: 0 12px 24px -4px rgba(16,24,40,.12); padding: 6px; min-width: 230px; }
.dropdown-item { display: flex; align-items: center; gap: 10px; border-radius: 6px; padding: 8px 10px; font-weight: 500; color: var(--ink-2); }
.dropdown-item .ico { color: var(--muted); }
.dropdown-item.text-danger .ico { color: var(--red); }

/* ---------- Danh sách, cặp nhãn - giá trị ---------- */
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
/* Tổng quan › Cần xử lý (21/10/2026): khung cao cố định, cuộn; dòng gọn, chữ dài cắt bằng "…" (rê chuột xem đủ) */
.todo-scroll { max-height: 400px; overflow-y: auto; overscroll-behavior: contain; }
.todo-scroll .list-row { padding: 8px 16px; gap: 10px; }
.todo-scroll .list-row .t, .todo-scroll .list-row .m { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-scroll .list-row .t { font-size: 13.5px; }
.todo-scroll .list-row .m { font-size: 12px; }
.todo-more { padding: 6px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-soft); background: var(--hover); border-radius: 0 0 12px 12px; }
.list-row .t { font-weight: 600; }
.list-row .m { font-size: 12px; color: var(--muted); }
.sev { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
.sev.red { background: var(--red-dot); } .sev.amber { background: #F79009; } .sev.violet { background: #7A5AF8; } .sev.gray { background: var(--faint); }
.empty { padding: 16px; color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kv > div { padding: 11px 16px; border-bottom: 1px solid var(--line-soft); }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Trang chi tiết thiết bị ---------- */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.hero-top { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; }
.hero-title { display: flex; gap: 14px; align-items: center; min-width: 0; }
.thumb { width: 56px; height: 56px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.hero h1 { margin: 0; font-size: 22px; font-weight: 700; font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.hero .model { color: var(--gray); font-size: 15px; }
.hero .specline { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.hero .specline b { font-weight: 600; color: var(--gray); margin-right: 2px; }
.hero .winlic { margin-top: 6px; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; color: var(--gray); background: var(--line-soft); max-width: 900px; }
.hero .winlic.ok { background: none; padding: 0; color: #067647; }
.hero .winlic.warn { background: #FFFAEB; color: #93370D; border: 1px solid #FEDF89; }
.hero .winlic.bad { background: #FEF3F2; color: #B42318; border: 1px solid #FECDCA; }
.hero .winlic .fix { margin-top: 2px; font-weight: 600; }
.hero .winlic .oem-hist { margin-top: 2px; font-size: 11.5px; opacity: .8; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.fact { background: var(--hover); padding: 12px 14px; min-width: 0; }
.fact .k { font-size: 12px; color: var(--muted); }
.fact .v { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fact .s { font-size: 12px; color: var(--muted); }
.tabbar { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid #EAECF0; flex-wrap: wrap; }
.tabbar .tab { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 12px 10px; border-bottom: 2px solid transparent; display: inline-flex; gap: 6px; align-items: center; }
.tabbar .tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabbar .tab .n { font-size: 11px; background: var(--gray-soft); color: var(--gray); border-radius: 999px; padding: 0 7px; }
.timeline { padding: 6px 16px 12px; }
.timeline .ev { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; position: relative; }
.timeline .ev::before { content: ""; position: absolute; left: 13px; top: 38px; bottom: -10px; width: 2px; background: var(--line-soft); }
.timeline .ev:last-child::before { display: none; }
.timeline .dotic { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.timeline .dotic::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dotic.ok { background: var(--green-soft); color: var(--green); } .dotic.move { background: var(--violet-soft); color: var(--violet); }
.dotic.warn { background: var(--amber-soft); color: var(--amber); } .dotic.info { background: var(--accent-soft); color: var(--accent); }
.dotic.idle { background: var(--gray-soft); color: var(--gray); } .dotic.bad { background: var(--red-soft); color: var(--red); }
.timeline .t { font-weight: 600; } .timeline .m { font-size: 13px; color: var(--muted); }
.timeline .d { font-size: 12px; color: var(--faint); white-space: nowrap; }
.cost-row { display: flex; justify-content: space-between; padding: 6px 0; font-variant-numeric: tabular-nums; }
.cost-row.total { border-top: 1px solid #EAECF0; margin-top: 6px; padding-top: 10px; font-weight: 700; }
.costbar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; margin: 4px 0 10px; background: var(--gray-soft); }
.costbar i { display: block; height: 100%; }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick a, .quick button { font: inherit; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13px; }
.quick a .ico, .quick button .ico { color: var(--accent); }
.quick a:hover, .quick button:hover { background: var(--hover); text-decoration: none; }
.dropdown-menu form { margin: 0; }
.dropdown-item { width: 100%; text-align: left; background: none; border: 0; }

/* ---------- Biểu đồ thanh theo chi nhánh ---------- */
.bars { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 13px; }
.bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--gray-soft); }
.bar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); padding: 0 16px 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.seg-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.seg-tabs button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 10px; border-radius: 6px; }
.seg-tabs button.on { background: var(--line-soft); color: var(--ink); }

/* ---------- Form ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.filters .form-control, .filters .form-select { min-width: 140px; width: auto; }
.form-label { font-weight: 600; font-size: 13px; margin-bottom: 4px; color: var(--ink-2); }
.form-control, .form-select { border-radius: 8px; border-color: #D0D5DD; min-height: 40px; }
.form-control:focus, .form-select:focus { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.form-text { font-size: 12px; color: var(--muted); }
.errorlist { color: var(--red); font-size: 12px; list-style: none; padding: 0; margin: 4px 0 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
fieldset legend { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.alert { border-radius: 10px; }

/* Ô chọn nhà cung cấp */
.sp-results { border: 1px solid var(--line); border-radius: 8px; max-height: 340px; overflow-y: auto; background: var(--surface); margin-top: 4px; box-shadow: 0 12px 24px -4px rgba(16,24,40,.08); }
.sp-company { padding: 6px 12px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--hover); font-weight: 600; }
.sp-branch { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px 8px 20px; border-bottom: 1px solid var(--line-soft); }
.sp-branch:hover, .sp-branch:focus { background: var(--accent-soft); }
.sp-branch .l1 { font-weight: 600; }
.sp-branch .l2 { font-size: 12px; color: var(--muted); }
.sp-star { color: var(--amber); }
.sp-card { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-top: 6px; }

/* Tem QR */
.labels { display: grid; grid-template-columns: repeat(auto-fill, 62mm); gap: 4mm; }
.label { width: 62mm; height: 29mm; border: 1px dashed #98A2B3; display: flex; align-items: center; gap: 2mm; padding: 2mm; box-sizing: border-box; background: #fff; overflow: hidden; border-radius: 4px; }
.label img { width: 25mm; height: 25mm; flex: none; }
.label .c { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 12pt; line-height: 1.1; }
.label .s { font-size: 7pt; color: #333; line-height: 1.2; }

/* Kết quả tìm kiếm */
.hit { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); color: inherit; }
.hit:hover { background: var(--hover); text-decoration: none; color: inherit; }
.hit:last-child { border-bottom: 0; }
.hit .ki { width: 34px; height: 34px; border-radius: 8px; }
.hit .t { font-weight: 600; } .hit .m { font-size: 12px; color: var(--muted); }

@media (max-width: 760px) {
  .side { flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .nav-group { display: none; }
  .side.open .nav-group { display: flex; flex-direction: column; gap: 2px; }
  /* Ngăn kéo nổi bên trái (27/10/2026): trước đây menu mở ở đầu trang, đang cuộn xuống thì không thấy → tưởng không bấm được */
  .side.open .nav-group { position: fixed; top: 0; left: 0; bottom: 0; width: min(84vw, 320px); z-index: 60;
                          background: var(--surface); overflow-y: auto; padding: 12px 10px 24px;
                          box-shadow: 0 0 0 100vmax rgba(16, 24, 40, .45); }
  body.menu-open { overflow: hidden; }
  .me .who { display: none; }
  /* Điện thoại / máy tính bảng dọc (27/10/2026): đầu trang gọn 2 dòng thấp thay vì ~230px */
  .shell { align-content: flex-start; }   /* không chia khoảng trống thừa cho dòng menu (đầu trang bị cao) */
  .side { padding: 8px 12px; }
  .side .brand.brand-logo { flex-direction: row; align-items: center; gap: 10px; padding: 2px 4px; }
  .side .brand.brand-logo img { height: 20px; }
  .topbar { flex-wrap: nowrap; gap: 6px; padding: 8px 12px; }
  .search { flex: 1 1 0; min-width: 0; padding: 0 10px; }
  .search .kbd { display: none; }
  .me { gap: 4px; }
  .me > a.iconbtn[href*="mat-khau"] { display: none; }   /* đổi mật khẩu: bấm vào ảnh đại diện */
  .content { padding: 14px 12px 40px; gap: 14px; }
  .page-head h1 { font-size: 21px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; gap: 8px; } .kpi .ki { display: none; } .kpi .v { font-size: 22px; }
  .filters > div { flex: 1 1 140px; }
  .filters .form-control, .filters .form-select { width: 100%; min-width: 0; }
}
/* Mã máy, số biên bản, serial trong bảng không bị bẻ dòng: bảng tự cuộn ngang trong khung */
.table td code.asset, .table td a.mono, .table td .mono { white-space: nowrap; }
@media (min-width: 761px) { .menu-toggle { display: none !important; } .side .nav-group { display: flex; flex-direction: column; gap: 2px; } }
/* Máy tính bảng / màn hình 761–1100px (27/10/2026): menu cột trái hẹp, không bị đẩy lên trên xổ cả trang */
@media (min-width: 761px) {
  .shell { flex-wrap: nowrap; }
  .side { flex: 0 0 240px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .side { flex-basis: 210px; padding: 12px 8px; }
  .side .nav-link { font-size: 13px; }
  .me .who { display: none; }
  .search .kbd { display: none; }
}
/* Quét kiểm kê (27/10/2026) */
.scan-camera { max-width: 420px; border-radius: 10px; overflow: hidden; margin-bottom: 10px; background: #000; }
.scan-log { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.scan-row { border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; padding: 8px 10px; background: var(--surface); }
.scan-row.ok { border-left-color: #12B76A; } .scan-row.warn { border-left-color: #F79009; background: #FFFAEB; }
.scan-row.bad { border-left-color: #F04438; background: #FEF3F2; } .scan-row.idle { border-left-color: #98A2B3; }
/* Danh sách chọn có ô tick (27/10/2026, khung "Cấp cho nhân viên này"): cao tối đa ~6 dòng rồi cuộn */
.pick-list { border: 1px solid var(--line, #E4E7EC); border-radius: 10px; max-height: 330px; overflow-y: auto; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line, #E4E7EC);
            cursor: pointer; margin: 0; }
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: #F9FAFB; }
.pick-row:has(input[type=checkbox]:checked) { background: #EEF4FF; }
.pick-row .form-check-input { flex: none; margin: 0; }
.pick-row.pick-off { background: var(--hover); cursor: default; } .pick-row.pick-off b { color: var(--muted); }
@media (max-width: 575px) { .pick-row { flex-wrap: wrap; } .pick-row .form-control { max-width: none !important; width: 100%; } }
/* Tự lọc (27/10/2026): app.js gắn .auto cho form.filters → ẩn nút Lọc / Tìm / Xem (lọc ngay khi chọn) */
.filters.auto > button, .filters.auto > input[type=submit] { display: none; }
/* ---------- Tổng quan mới (27/10/2026): ô số có xu hướng, việc theo mức gấp, biểu đồ SVG ---------- */
.dash { --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06); --shadow-up: 0 8px 24px -6px rgba(16,24,40,.14); }
.dash .card { border-radius: 14px; box-shadow: var(--shadow); }
.dash .hello { color: var(--muted); margin-top: 2px; }
.dk-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.dk { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; box-shadow: var(--shadow);
      color: inherit; display: block; transition: transform .15s, box-shadow .15s; min-width: 0; }
.dk:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); color: inherit; }
.dk .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.dk .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.dk .val { font-size: 29px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dk .sub { color: var(--faint); font-size: 12.5px; min-width: 0; }
.dk .row2 { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.dk .row2 svg { flex: none; }
.dk.alert { background: linear-gradient(180deg, #FFF6F5 0%, #fff 70%); border-color: #FECDCA; } .dk.alert .val { color: var(--red); }
.dk.warn { background: linear-gradient(180deg, #FFFAEB 0%, #fff 70%); border-color: #FEDF89; } .dk.warn .val { color: var(--amber); }
.delta { display: inline-flex; gap: 2px; align-items: center; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.delta.good { color: var(--green); background: var(--green-soft); } .delta.bad { color: var(--red); background: var(--red-soft); }
.delta.flat { color: var(--muted); background: var(--line-soft); }
.dash-grid { display: grid; gap: 16px; }
.dash-grid.g21 { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.dash-grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lvl { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
       color: var(--faint); padding: 10px 16px 4px; }
.lvl .dot { width: 8px; height: 8px; border-radius: 50%; }
.todo-scroll .list-row .act { flex: none; }
.btn-xs { font-size: 12px; padding: 3px 10px; border-radius: 7px; font-weight: 600; }
.donut-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 14px 16px; }
.donut-list { flex: 1; min-width: 170px; }
.donut-list a { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13px; color: inherit; }
.donut-list a:last-child { border-bottom: 0; } .donut-list a:hover { color: var(--accent); }
.donut-list .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.donut-list b { margin-left: auto; font-variant-numeric: tabular-nums; } .donut-list em { color: var(--faint); font-style: normal; width: 38px; text-align: right; font-size: 12px; }
.ages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 16px 6px; }
.ages a { border-radius: 12px; padding: 11px 12px; color: inherit; display: block; }
.ages a:hover { filter: brightness(.97); }
.ages .k { font-size: 12px; font-weight: 700; } .ages .v { font-size: 22px; font-weight: 800; line-height: 1.2; } .ages .h { font-size: 11.5px; opacity: .85; }
.ages .green { background: var(--green-soft); color: var(--green); } .ages .amber { background: var(--amber-soft); color: var(--amber); }
.ages .red { background: var(--red-soft); color: var(--red); } .ages .gray { background: var(--line-soft); color: var(--muted); }
.agebar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; margin: 8px 16px 0; background: var(--line-soft); }
.stack-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 44px; align-items: center; gap: 12px; padding: 8px 16px; }
.stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line-soft); }
.stack a { display: block; height: 100%; } .stack a:hover { filter: brightness(1.12); }
.stack-row .n { text-align: right; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 1200px) { .dk-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dash-grid.g21 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .dk-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 76%; overflow-x: auto; scroll-snap-type: x mandatory;
            padding-bottom: 6px; gap: 10px; }
  .dk { scroll-snap-align: start; }
  .dash-grid.g2 { grid-template-columns: minmax(0, 1fr); }
  .todo-scroll .list-row { flex-wrap: wrap; row-gap: 6px; }
  .todo-scroll .list-row > .flex-grow-1 { flex-basis: calc(100% - 20px); }
  .todo-scroll .list-row .chip { margin-left: 14px; } .todo-scroll .list-row .act { margin-left: auto; }
}
@media print {
  .side, .topbar, .no-print, .messages { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
  .label { border-color: #ccc; }
  .table-wrap.scroll-10 { max-height: none !important; overflow: visible !important; }   /* in thì in đủ dòng */
  .scroll-10-note { display: none; }
}

/* ---------- Trang Kho (28/10/2026): đậm hơn, số là nút bấm mở danh sách ---------- */
.wh-card .card-header { background: var(--line-soft); }
.wh-card .card-header h2 { font-size: 16px; font-weight: 700; }
.wh-table thead th { color: var(--ink-2); font-weight: 700; }
.wh-table thead th.grp-dev { background: var(--accent-soft); }
.wh-table thead th.grp-mat { background: var(--violet-soft); }
.wh-table tbody td { vertical-align: middle; }
.wh-table .wh-name { font-size: 15px; }
a.num { display: inline-block; min-width: 40px; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 15px;
  text-align: center; text-decoration: none; border: 1px solid transparent; transition: filter .12s, box-shadow .12s; }
a.num:hover { text-decoration: none; filter: brightness(.95); box-shadow: 0 1px 3px rgba(16, 24, 40, .15); }
a.num.good { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
a.num.bad { background: var(--red-soft); color: var(--red); border-color: #FECDCA; }
a.num.ok { background: var(--green-soft); color: var(--green); border-color: #ABEFC6; }
a.num.gray { background: var(--gray-soft); color: var(--gray); border-color: var(--line); }
/* Cột "Đã thanh lý (không tính tồn)" trên trang Kho (28/10/2026): nền xám, tách khỏi các cột tính tồn */
.wh-table th.col-tl, .wh-table td.col-tl { background: var(--gray-soft) !important; color: var(--muted); }
/* Ngăn trong trang chi tiết kho (28/10/2026): hiện khoảng 10 dòng, nhiều hơn thì cuộn lên xuống trong ngăn */
.bin-scroll { max-height: 590px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }

/* ---------- Bảng → thẻ trên điện thoại (28/10/2026, rà toàn bộ web) ----------
   app.js (bangThanhThe) gắn data-label cho từng ô + class cell-title / cell-check / cell-empty / cell-full.
   Mỗi dòng = 1 thẻ: ô tiêu đề ở trên, các ô sau "nhãn ……… giá trị". Bảng có data-no-card giữ dạng bảng cuộn ngang. */
@media (max-width: 760px) {
  .table-wrap:has(> .card-table) { overflow: visible; background: transparent; border: 0; border-radius: 0; }
  .card .table-wrap:has(> .card-table) { padding: 10px 10px 2px; }
  .table-wrap.scroll-10:has(> .card-table) { max-height: none !important; }
  .table-wrap.scroll-10:has(> .card-table) + .scroll-10-note { display: none; }
  table.card-table { min-width: 0 !important; width: 100%; border-collapse: separate; }
  table.card-table > thead { display: none; }
  table.card-table, table.card-table > tbody, table.card-table > tfoot { display: block; }
  table.card-table > tbody > tr, table.card-table > tfoot > tr {
    display: block; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    padding: 10px 12px; margin: 0 0 10px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
  table.card-table > tfoot > tr { background: var(--hover); }
  table.card-table > tbody > tr:hover > td { background: transparent; }
  /* Ô = khối: nhãn trôi bên trái (40%), nội dung chạy liền bên phải, ô có nhiều phần không bị chia cột */
  table.card-table td, table.card-table th {
    display: block; padding: 5px 0 !important; border: 0 !important; background: transparent !important;
    text-align: right; white-space: normal; min-width: 0; overflow-wrap: anywhere; }
  table.card-table td::after { content: ""; display: table; clear: both; }
  table.card-table td::before { content: attr(data-label); float: left; width: 40%; padding-right: 10px; text-align: left;
    font-size: 12px; font-weight: 600; color: var(--muted); white-space: normal; }
  table.card-table td[data-label=""]::before { display: none; }
  table.card-table td .d-flex { justify-content: flex-end; flex-wrap: wrap; }
  table.card-table > tbody > tr:has(td.cell-check input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
  table.card-table > tbody > tr:has(td.cell-check) { cursor: pointer; }
  table.card-table td .mono, table.card-table td code.asset, table.card-table td a.mono { white-space: normal; word-break: break-all; }
  /* Ô tiêu đề thẻ: mã / tên, in đậm, cả dòng, gạch dưới */
  table.card-table td.cell-title { display: block; text-align: left; font-size: 15px; padding: 0 28px 8px 0 !important;
    margin-bottom: 4px; border-bottom: 1px solid var(--line-soft) !important; }
  table.card-table td.cell-title::before { display: none; }
  /* Ô tích chọn (form cấp phát, thu hồi...): góc trên phải thẻ */
  table.card-table td.cell-check { position: absolute; top: 10px; right: 12px; padding: 0 !important; display: block; }
  table.card-table td.cell-check::before { display: none; }
  table.card-table td.cell-check input { width: 20px; height: 20px; }
  table.card-table td.cell-empty { display: none; }
  table.card-table td.cell-full { display: block; text-align: left; }
  table.card-table td.cell-full::before { display: none; }
  table.card-table td .btn { white-space: nowrap; }
  .table:not(.card-table) td.n { white-space: nowrap; }   /* bảng giữ dạng bảng: số không bẻ dòng ("− 0") */
  table.card-table td .form-control, table.card-table td .form-select { max-width: 60%; }
}
