.da-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:14px 0}.da-toolbar input,.da-toolbar select,.da-toolbar button,#daDialog button,#daDialog input,#daDialog select{font:inherit;padding:9px 12px;border:1px solid #d6ded9;border-radius:8px;background:#fff;color:#183e33}.da-toolbar button[aria-pressed=true]{background:#e1f0e9;border-color:#18745f}.da-toolbar input{min-width:250px}.da-select{position:absolute;left:10px;top:10px;z-index:4;display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:#ffffffdd;border:1px solid #d6ded9}.da-select input{width:18px;height:18px;margin:0}.da-list{grid-template-columns:1fr!important}.da-list .da-card{display:flex;min-height:130px}.da-list .da-visual{width:180px;min-width:180px}.da-list .da-body{flex:1;padding-right:50px}.da-menu{max-height:350px;overflow:auto;z-index:10}#daDialog::backdrop{background:#123b3055}#daDialog td,#daDialog th{padding:10px;border-bottom:1px solid #ddd;text-align:left}#daDialog table{border-collapse:collapse;width:100%}@media(hover:none){.da-card .da-more{opacity:1!important}}@media(max-width:600px){.da-grid{grid-template-columns:1fr!important}.da-tools,.da-head{flex-wrap:wrap}.da-list .da-card{display:flex;flex-direction:column}.da-list .da-visual{width:100%;min-width:0;height:150px}.da-list .da-body{padding-right:12px}.da-toolbar input{min-width:0;width:100%}.da-toolbar{gap:6px}.da-toolbar>button{flex:1 1 auto}.da-menu{position:fixed;left:12px;right:12px;top:auto;bottom:12px;max-height:55vh;overflow:auto;z-index:40}.da-menu button{min-height:44px}#daDialog{width:calc(100vw - 20px)!important;max-height:88vh!important;padding:16px!important}#daDialog table{min-width:520px}#daDialog>div{overflow-x:auto}}

/* Bình ghép nhiều dự án (v0.9.264) */
.da-b-wrap{display:grid;grid-template-columns:minmax(340px,1fr) minmax(320px,1.1fr);gap:18px;align-items:start}
@media(max-width:900px){.da-b-wrap{grid-template-columns:1fr}}
.da-b-table{width:100%;border-collapse:collapse;margin:10px 0;font-size:12px}
.da-b-table th{text-align:left;font-weight:700;color:#42515e;border-bottom:1px solid #dbe3e6;padding:6px 8px 6px 0}
.da-b-table td{border-bottom:1px solid #eef2f4;padding:7px 8px 7px 0;vertical-align:top}
.da-b-table input{width:96px;height:32px;border:1px solid #cfd8dd;border-radius:8px;padding:0 8px;font:inherit;font-size:12px}
.da-b-meta{font-size:10.5px;color:#7b8792;margin-top:2px}
.da-b-err{color:#b3261e}
.da-b-check{display:flex;align-items:center;gap:6px;font-size:12px}
.da-b-primary{background:#18745f;color:#fff;border:0;border-radius:9px;height:36px;padding:0 16px;font:inherit;font-weight:700;cursor:pointer}
.da-b-primary:disabled{opacity:.6;cursor:default}
.da-b-sum{font-size:12px;font-weight:700;color:#18745f}
.da-b-note{font-size:11px;color:#7b8792;margin:6px 0 0;line-height:1.5}
.da-b-preview{border:1px solid #d9e1e5;border-radius:12px;background:#eef2f4;padding:10px;min-height:220px;display:flex;align-items:center;justify-content:center;font-size:12px;color:#7b8792}
.da-b-preview svg{width:100%;height:auto;max-height:52vh;background:#fff;box-shadow:0 6px 18px rgba(20,40,50,.12)}
.da-b-legend{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.da-b-chip{display:inline-flex;align-items:center;gap:6px;font-size:11px;padding:4px 9px;border:1px solid #dbe3e6;border-radius:999px;background:#fff}
.da-b-chip i{width:10px;height:10px;border-radius:3px;display:block}

/* v0.9.267 — khoá bề rộng cột trái: bảng và ô nhập không tràn sang khung xem trước */
.da-b-wrap{grid-template-columns:minmax(360px,1.15fr) minmax(300px,1fr)}
#daDialog .da-b-form{min-width:0}
#daDialog .da-b-form .da-toolbar{gap:8px}
#daDialog .da-b-form .da-toolbar label{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:#42515e}
#daDialog .da-b-form .da-toolbar input[type=number],#daDialog .da-b-form .da-toolbar select{min-width:0;padding:7px 9px;font-size:12px}
#daDialog .da-b-form .da-toolbar input[type=number]{width:76px}
#daDialog .da-b-form .da-toolbar .da-b-check{display:inline-flex;width:auto}
#daDialog .da-b-form .da-toolbar input[type=checkbox]{width:16px;min-width:0;height:16px;padding:0;margin:0;flex:0 0 auto}
#daDialog .da-b-table{table-layout:fixed;min-width:0}
#daDialog .da-b-table th,#daDialog .da-b-table td{padding:7px 8px 7px 0;font-size:12px;word-break:break-word}
#daDialog .da-b-table th:nth-child(2),#daDialog .da-b-table td:nth-child(2){width:92px}
#daDialog .da-b-table th:nth-child(3),#daDialog .da-b-table td:nth-child(3){width:92px}
#daDialog .da-b-table th:nth-child(4),#daDialog .da-b-table td:nth-child(4){width:104px}
#daDialog .da-b-table input{width:100%;max-width:84px}

/* ── Trang Bình ghép /#/binh-ghep (v0.9.268) ──────────────────────────────────
   Dùng lại đúng ngôn ngữ thị giác của tab Bình khuôn bên /app: khung xem nền
   xám #e9eef0 có kéo/phóng, rail thông số nền trắng viền trái. */
/* 64px = chiều cao thanh `.app-top`; lấy đúng số này thì trang không sinh thanh
   cuộn dọc thừa 8px như bản đầu (đo live 2026-09-06). */
/* v0.9.277 — BA PANEL: trái = các mẫu, giữa = khổ giấy, phải = thông số bình.
   Owner 2026-09-06: *"cấu trúc trang cần làm như bên bình khuôn, tức có 3
   panel"*. Bản hai cột trước đó nhét bảng mặt hàng vào rail phải 372px nên tên
   dự án bị bóp còn 3–4 chữ mỗi dòng. */
.bg-shell{display:grid;grid-template-columns:300px minmax(0,1fr) 340px;height:calc(100vh - 64px);background:#fff}
/* Chừa đáy 64px để thanh phóng to/thu nhỏ không bao giờ đè lên tờ (owner
   2026-09-06: nút "Vừa khung" bị tờ che mất một nửa). */
/*
 * CỘT GIỮA DỰNG NHƯ /app (v0.9.279). Owner 2026-09-06: *"phần zoom và vừa
 * khung thiết kế cho giống hình… ở dưới sẽ có tổng số tờ cần in để đủ số
 * lượng"*. Ba tầng đúng như `.canvas-column` bên /app: thanh công cụ trên
 * (dải bản trái, cụm phóng phải), khung tờ giữa, dải chỉ số dưới. Nút phóng
 * không còn NỔI TRÊN tờ nên không bao giờ bị tờ che, và người dùng chuyển từ
 * /app sang đây thấy đúng một bộ nút ở đúng một chỗ.
 */
/* `min-height:0` bắt buộc: ô lưới mặc định `min-height:auto` nên hàng `1fr`
   không ép nổi khung xem, cột phình theo chiều cao tờ và dải chỉ số bị đẩy
   khỏi màn hình (đo live 2026-09-06). */
.bg-col{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto auto;min-width:0;min-height:0;background:#e9eef0}
/* v0.9.298: ghim TỪNG hàng vào đúng ô lưới. Trước đây `.bg-kho:empty{display:none}`
   rút hàng 1 khỏi lưới lúc chưa tính, mọi hàng dồn lên một ô: khung xem rơi vào ô
   `auto` (co còn một dòng chữ) còn dải chỉ số rơi vào ô `1fr` — phình thành năm
   cột trống cao cả màn hình (ảnh owner 2026-09-08). */
.bg-kho{grid-row:1}.bg-toolbar{grid-row:2}.bg-canvas{grid-row:3}.bg-metrics{grid-row:4}.bg-ghichu{grid-row:5}
.bg-kho{padding:7px 14px;border-bottom:1px solid #dde4e8;background:#f4f7f5}.bg-kho:empty{padding:0;border:0;min-height:0}.bg-kho button[data-bgkho="-1"]{border-style:dashed}
.bg-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:46px;padding:7px 14px;border-bottom:1px solid #dde4e8;background:#fff}
.bg-actions{display:flex;align-items:center;gap:5px;flex:0 0 auto}
.bg-icon{display:grid;place-items:center;min-width:30px;height:30px;padding:0 8px;border:1px solid #d6ded9;border-radius:8px;background:#fff;color:#183e33;font:inherit;font-size:14px;line-height:1;cursor:pointer}
.bg-icon:hover{background:#eef5f2;border-color:#b9cfc7}
.bg-zoomlabel{min-width:46px;text-align:center;font-size:11.5px;font-weight:700;color:#42515e}
.bg-metrics{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:1px;border-top:1px solid #dde4e8;background:#dde4e8}
.bg-metrics article{display:flex;flex-direction:column;gap:2px;padding:6px 14px;background:#fff;min-width:0}
.bg-metrics span{color:#78848f;font-size:9.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
.bg-metrics strong{color:#183e33;font-size:14px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:1180px){.bg-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
.bg-canvas{position:relative;display:grid;place-items:center;overflow:hidden;padding:26px 26px 52px;background:#e9eef0;cursor:grab;touch-action:none}
.bg-canvas.dragging{cursor:grabbing}
/*
 * VỪA KHUNG THẬT SỰ (v0.9.278). Bản cũ để `.bg-sheet` co theo nội dung rồi
 * ràng `max-width:100%` lên chính SVG — mà SVG khai `width="1090mm"` nên nó
 * rộng ~4120px, phần trăm không có mốc để quy chiếu và tờ TRÀN khỏi ô, người
 * dùng chỉ thấy một mảng trắng. Nay ô chứa chiếm trọn khung xem và SVG nhận
 * `width/height:100%`; `viewBox` lo phần tỉ lệ nên tờ luôn nằm gọn, canh giữa.
 */
.bg-sheet{display:grid;place-items:center;width:100%;height:100%;min-width:0;min-height:0}
.bg-sheet svg{display:block;width:100%;height:100%;transform-origin:center center;transition:transform .08s linear}
.bg-empty{max-width:420px;text-align:center;color:#78848f;font-size:13px;line-height:1.6}
.bg-empty a{color:#18745f;font-weight:700;cursor:pointer;text-decoration:underline}
.bg-tabs{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0}
.bg-tabs-nhan{padding:5px 10px;border-radius:999px;background:#183e33e6;color:#fff;font-size:10.5px;font-weight:700;letter-spacing:.01em}
.bg-tabs button{padding:6px 12px;border:1px solid #d6ded9;border-radius:999px;background:#ffffffe6;color:#42515e;font:inherit;font-size:11.5px;font-weight:700;cursor:pointer;box-shadow:0 2px 6px rgba(20,40,50,.08)}
.bg-tabs button[aria-pressed=true]{background:#18745f;border-color:#18745f;color:#fff}
.bg-tabs button small{display:block;font-size:9.5px;font-weight:600;opacity:.75}
.bg-legend{position:absolute;left:16px;right:16px;bottom:14px;display:flex;flex-wrap:wrap;gap:7px;pointer-events:none}
/* ĐANG TÍNH (v0.9.281) — cùng bộ với `.imp-busy` bên /app (styles.css). Hai
   trang là hai stylesheet riêng nên phải khai lại; giữ NGUYÊN tên lớp và số đo
   để hai nơi không bao giờ lệch nhau. */
.imp-busy{position:absolute;inset:0;z-index:20;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:11px;background:rgba(233,238,240,.93);color:#42515e;text-align:center;padding:20px}
.imp-busy.hidden{display:none}
.imp-busy strong{font-size:13px;font-weight:800;color:#183e33}
.imp-busy small{font-size:11px;color:#78848f;max-width:340px;line-height:1.5}
.imp-busy-sheet{display:grid;grid-template-columns:repeat(3,34px);grid-auto-rows:26px;gap:5px;padding:9px;border:1px solid #354555;border-radius:3px;background:#fff;box-shadow:0 6px 16px rgba(30,45,55,.12)}
.imp-busy-sheet i{display:block;border-radius:2px;background:#dfeee9;border:1px solid #18745f;opacity:0;animation:impDrop 1.8s ease-in-out infinite}
.imp-busy-sheet i:nth-child(2){animation-delay:.15s}
.imp-busy-sheet i:nth-child(3){animation-delay:.3s}
.imp-busy-sheet i:nth-child(4){animation-delay:.45s}
.imp-busy-sheet i:nth-child(5){animation-delay:.6s}
.imp-busy-sheet i:nth-child(6){animation-delay:.75s}
@keyframes impDrop{0%{opacity:0;transform:translateY(-7px) scale(.9)}18%,72%{opacity:1;transform:none}100%{opacity:0;transform:none}}
@media (prefers-reduced-motion:reduce){.imp-busy-sheet i{animation:none;opacity:1}}
.bg-legend .da-b-chip{background:#ffffffe6;box-shadow:0 2px 6px rgba(20,40,50,.08)}
.bg-rail{overflow:auto;max-height:calc(100vh - 64px);padding:18px 20px 28px;border-left:1px solid #e0e6ea;background:#fff}
.bg-rail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:12px}
.bg-rail-head h2{margin:5px 0 0;font-size:22px;line-height:1.2}
.bg-back{align-self:center;font-size:12px;color:#18745f;font-weight:700;cursor:pointer;white-space:nowrap}
.bg-sum{margin:0 0 4px;padding:10px 12px;border-radius:9px;background:#eef5f2;color:#18745f;font-size:12px;font-weight:700;line-height:1.5}
.bg-sec{padding:14px 0;border-top:1px solid #e6eaed}
.bg-sec-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:9px}
.bg-sec-title h3{margin:0;font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:#183e33}
.bg-chip{padding:3px 8px;border-radius:999px;background:#e1f0e9;color:#18745f;font-size:9.5px;font-weight:800;letter-spacing:.03em}
.bg-grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}
.bg-field span{display:block;margin-bottom:5px;color:#596674;font-size:9.5px;font-weight:700}
.bg-field input,.bg-field select{width:100%;height:36px;border:1px solid #d6dde2;border-radius:7px;background:#fff;padding:0 9px;font:inherit;font-size:12px;color:#183e33;outline:none}
.bg-field input:focus,.bg-field select:focus{border-color:#58a893;box-shadow:0 0 0 3px rgba(24,116,95,.09)}
.bg-field.full{display:block;margin-top:8px}
.bg-check{display:flex;align-items:center;gap:7px;margin-top:10px;color:#3b4a57;font-size:11px;line-height:1.35}
.bg-check input{width:16px;height:16px;margin:0;flex:0 0 auto;accent-color:#18745f}
.bg-check span{margin:0}
/* `min-width:0` để thắng luật chung `table{min-width:640px}` của trang chủ —
   không có nó bảng rộng 640px và tràn khỏi rail 372px. */
.bg-table{width:100%;min-width:0;table-layout:fixed;border-collapse:collapse;font-size:11.5px}
.bg-table th{text-align:left;font-weight:700;color:#7a8691;font-size:9.5px;text-transform:uppercase;letter-spacing:.03em;border-bottom:1px solid #dbe3e6;padding:0 6px 6px 0}
.bg-table td{border-bottom:1px solid #eef2f4;padding:7px 6px 7px 0;vertical-align:top;word-break:break-word}
.bg-table th:nth-child(2),.bg-table td:nth-child(2),.bg-table th:nth-child(3),.bg-table td:nth-child(3){width:70px}
.bg-table th:nth-child(4),.bg-table td:nth-child(4){width:84px}
.bg-table input{width:100%;height:30px;border:1px solid #cfd8dd;border-radius:7px;padding:0 6px;font:inherit;font-size:11.5px}
.bg-table .da-b-meta{font-size:10px}
.bg-primary{width:100%;margin-top:14px;height:40px;border:0;border-radius:9px;background:#18745f;color:#fff;font:inherit;font-weight:800;cursor:pointer}
.bg-primary:disabled{opacity:.6;cursor:default}
.bg-export{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.bg-export button{flex:1 1 auto;height:34px;padding:0 12px;border:1px solid #d6ded9;border-radius:8px;background:#fff;color:#183e33;font:inherit;font-size:11.5px;cursor:pointer}
.bg-export button:hover{background:#eef5f2}
.bg-note{margin:10px 0 0;color:#7b8792;font-size:10.5px;line-height:1.55}
/* ── PANEL TRÁI: các mẫu đem bình (v0.9.277) ─────────────────────────────── */
.bg-list{overflow:auto;max-height:calc(100vh - 64px);padding:18px 16px 28px;border-right:1px solid #e0e6ea;background:#fff}
.bg-list-head{margin-bottom:14px}
.bg-list-head h2{margin:5px 0 0;font-size:19px;line-height:1.25}
.bg-list-head .bg-back{display:inline-block;margin-top:6px}
.bg-items{display:flex;flex-direction:column;gap:10px;margin-top:9px}
.bg-item{border:1px solid #e0e6ea;border-radius:10px;background:#fff;padding:9px}
.bg-item-top{display:flex;gap:9px;align-items:flex-start}
.bg-item-thumb{flex:0 0 auto;width:52px;height:52px;display:grid;place-items:center;border:1px solid #eaeef1;border-radius:8px;background:#f7faf8 radial-gradient(#dde7e2 1px,transparent 1px);background-size:8px 8px;color:#9aa7b0;font-size:15px;overflow:hidden}
.bg-item-thumb img{width:100%;height:100%;object-fit:contain}
.bg-item-name{min-width:0;display:block}
.bg-item-name b{display:block;font-size:12.5px;line-height:1.35;color:#183e33}
.bg-item-name small{display:block;margin-top:2px;font-size:10.5px;line-height:1.4;color:#7b8792}
.bg-item-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:9px}
.bg-item-fields label{display:block;min-width:0}
.bg-item-fields span{display:block;margin-bottom:4px;color:#596674;font-size:9.5px;font-weight:700}
.bg-item-fields input{width:100%;height:32px;border:1px solid #d6dde2;border-radius:7px;background:#fff;padding:0 8px;font:inherit;font-size:12px;color:#183e33;outline:none}
.bg-item-fields input:focus{border-color:#58a893;box-shadow:0 0 0 3px rgba(24,116,95,.09)}
.bg-item .bg-out{margin-top:8px;padding-top:8px;border-top:1px solid #f0f3f5;font-size:11.5px;color:#42515e;line-height:1.45}
.bg-item .bg-out .da-b-meta{font-size:10px;margin-top:2px}

@media(max-width:1180px){.bg-shell{grid-template-columns:270px minmax(0,1fr) 310px}}
@media(max-width:1000px){
  .bg-shell{grid-template-columns:1fr;height:auto}
  .bg-list{max-height:none;border-right:0;border-bottom:1px solid #e0e6ea}
  .bg-items{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px}
  .bg-canvas{min-height:52vh;padding:14px}
  .bg-rail{max-height:none;border-left:0;border-top:1px solid #e0e6ea}
  .bg-legend{position:static;margin-top:10px}
}
  

/* ── Trang Dự án: MỘT thanh công cụ (v0.9.276) ────────────────────────────────
   Owner 2026-09-06: *"các hàng nút, tìm kiếm phải sắp xếp gọn gàng cùng 1 hàng"*.
   Bản cũ là ba hàng `.da-toolbar` xếp chồng, mỗi hàng một kiểu chiều cao nên
   nhìn rời rạc. Bản này:
     · MỘT thanh nền trắng bo góc, các NHÓM chức năng ngăn nhau bằng vạch mảnh;
     · mọi ô nhập/nút cao đúng 34px, bo 8px — cùng ngôn ngữ với rail bên /app;
     · ô tìm co giãn chiếm hết chỗ trống ở giữa nên thanh luôn đầy, không hở;
     · dải THƯ MỤC tách xuống dưới dạng chip (số thư mục do người dùng tạo, nhét
       chung vào thanh thì thêm vài cái là vỡ dòng).
   `.da-toolbar` cũ GIỮ NGUYÊN vì hộp thoại bình ghép vẫn dùng. */
.da-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px;margin:0 0 12px;border:1px solid #e0e6ea;border-radius:12px;background:#fff;box-shadow:0 1px 2px rgba(20,40,50,.05)}
.da-bar-group{display:flex;align-items:center;gap:6px;min-width:0}
.da-bar-group+.da-bar-group{padding-left:8px;border-left:1px solid #e9eef1}
/* MỘT HÀNG, KHÔNG VỠ DÒNG (v0.9.280). Owner 2026-09-06: *"các hàng nút, tìm
   kiếm phải sắp xếp gọn gàng cùng 1 hàng"* — nhưng ở màn 1200px thật, ba ô
   select đều nở tới `max-width:190px` (570px chỉ riêng chúng) nên nút "Bình
   các dự án đã chọn" bị đẩy xuống dòng hai. Nay: select hẹp lại và CO ĐƯỢC, ô
   tìm nhận phần thừa chứ không đòi 220px cứng, nút chính không co. */
.da-bar-group.grow{flex:1 1 130px;min-width:120px}
.da-bar-group:last-child{flex:0 0 auto}
.da-bar select,.da-bar button,.da-bar input{height:34px;font:inherit;font-size:12.5px;color:#183e33;border:1px solid #d6dde2;border-radius:8px;background:#fff;box-sizing:border-box}
.da-bar select{flex:0 1 auto;padding:0 24px 0 9px;min-width:0;max-width:150px;cursor:pointer;appearance:none;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23596674' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 9px center;background-size:10px}
.da-bar button{padding:0 12px;cursor:pointer;white-space:nowrap}
.da-bar button:hover,.da-bar select:hover{border-color:#b9c6cd}
.da-bar select:focus,.da-bar input:focus,.da-bar button:focus-visible{outline:none;border-color:#58a893;box-shadow:0 0 0 3px rgba(24,116,95,.1)}
.da-bar .da-ico{width:34px;padding:0;display:grid;place-items:center;font-size:14px;line-height:1;color:#42515e}

/* Cặp Dự án / Thùng rác dính liền thành một nút gạt — đọc ra ngay là hai trạng
   thái loại trừ nhau, không phải hai lệnh rời. */
.da-bar .da-seg{gap:0}
.da-bar .da-seg button{border-radius:0;margin-left:-1px}
.da-bar .da-seg button:first-child{border-radius:8px 0 0 8px;margin-left:0}
.da-bar .da-seg button:last-child{border-radius:0 8px 8px 0}
.da-bar .da-seg button[aria-pressed=true]{background:#18745f;border-color:#18745f;color:#fff;position:relative;z-index:1}

.da-bar .da-search{position:relative;display:flex;align-items:center;width:100%;min-width:0}
.da-bar .da-search svg{position:absolute;left:10px;width:15px;height:15px;fill:none;stroke:#8a97a1;stroke-width:1.9;stroke-linecap:round;pointer-events:none}
.da-bar .da-search input{width:100%;min-width:0;padding:0 10px 0 31px}
.da-bar .da-search input::-webkit-search-cancel-button{cursor:pointer}

.da-bar .da-cta{padding:0 11px;border-color:#18745f;color:#18745f;font-weight:700;background:#f2f9f6}
.da-bar .da-cta:hover{background:#e1f0e9;border-color:#18745f}

/* Dải thư mục: chip nhẹ, chấm màu thay cho vạch viền trái của bản cũ. */
.da-chips{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 16px}
.da-chips button{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;font:inherit;font-size:12px;color:#42515e;border:1px solid #e0e6ea;border-radius:999px;background:#fff;cursor:pointer;white-space:nowrap}
.da-chips button:hover{border-color:#b9c6cd;background:#f6faf8}
.da-chips button[aria-pressed=true]{background:#18745f;border-color:#18745f;color:#fff;font-weight:700}
.da-chips button i{width:8px;height:8px;border-radius:50%;display:block;flex:0 0 auto}
.da-chips button[aria-pressed=true] i{box-shadow:0 0 0 1.5px #ffffffaa}
.da-chips .da-chip-add{color:#18745f;border-style:dashed}
.da-chips .da-chip-sep{width:1px;height:18px;background:#e0e6ea;margin:0 2px}
/* Kéo–thả khuôn vào thư mục (v0.9.279). Chip đang được rê tới phải nổi hẳn:
   nếu chỉ đổi màu nhạt thì người dùng thả trượt sang chip bên cạnh mà không
   biết, và khuôn "biến mất" khỏi thư mục họ đang xem. */
.da-card.da-dragging{opacity:.45;transform:scale(.98)}
.da-chips button.da-drop{background:#e1f0e9;border-color:#18745f;color:#18745f;font-weight:700;box-shadow:0 0 0 3px rgba(24,116,95,.16)}

@media(max-width:820px){
  .da-bar-group+.da-bar-group{padding-left:0;border-left:0}
  .da-bar-group.grow{flex:1 1 100%;order:-1}
  .da-bar select{max-width:none;flex:1 1 auto}
  .da-bar .da-cta{flex:1 1 100%}
}

/* ── Lưới thẻ dự án (v0.9.277) ────────────────────────────────────────────────
   Owner 2026-09-06: *"cho sắp nhiều ô trên 1 hàng, đừng mỗi mẫu là 1 ô"*.

   LỖI THẬT: `.da-card` nền khai `flex-direction:column`, còn `.da-list .da-card`
   chỉ ghi đè `display:flex` mà QUÊN đổi hướng. Nên chế độ danh sách không phải
   là hàng ngang gọn — nó là một khối cao chiếm trọn bề ngang, ảnh nằm trên tên
   nằm dưới, mỗi dự án ăn hết một màn hình cuộn. Đúng cái owner thấy.
   Sửa: ép `flex-direction:row` và khoá chiều cao hàng cho gọn.

   Lưới thường cũng cho hẹp lại 200px để màn rộng xếp được nhiều cột hơn. */
.da-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}
.da-list{grid-template-columns:1fr!important}
.da-list .da-card{flex-direction:row;align-items:stretch;min-height:0}
.da-list .da-visual{width:150px;min-width:150px;height:auto;min-height:96px}
.da-list .da-visual img.da-2d{height:100%;max-height:120px}
.da-list .da-visual img.da-3d{width:38px;height:38px;right:5px;bottom:5px}
.da-list .da-body{flex:1;min-width:0;padding:10px 52px 10px 14px;display:flex;flex-direction:column;justify-content:center}
.da-list .da-select{left:8px;top:8px;width:28px;height:28px}
@media(max-width:600px){
  .da-list .da-card{flex-direction:column}
  .da-list .da-visual{width:100%;min-width:0;height:150px}
  .da-list .da-body{padding:10px 12px 12px}
}

/* Tờ mặc định lúc chưa tính (v0.9.298): khung tờ đúng tỉ lệ + lề/nhíp, thay cho một dòng chữ. */
.bg-to-trong{width:100%;height:100%;min-height:0;display:grid;place-items:center}
.bg-to-trong svg{width:100%;height:100%;max-height:100%;display:block}
.bg-to-trong .to{fill:#fff;stroke:#9aa9b3;stroke-width:1}
.bg-to-trong .le{fill:none;stroke:#b9c7cf;stroke-width:.8;stroke-dasharray:5 4}
.bg-to-trong .nhip{fill:#eef2f4}
.bg-to-trong text{font:600 13px system-ui,sans-serif;fill:#78848f}
.bg-to-trong text.nho{font-size:11px;font-weight:500}

/* v0.9.300: lỗi / ghi chú dưới dải chỉ số. */
.bg-ghichu{background:#fff;border-top:1px solid #dde4e8;font-size:12px;line-height:1.5}
.bg-ghichu:empty{display:none}
.bg-ghichu .loi{margin:0;padding:8px 14px;color:#b3261e;background:#fdf0ee;font-weight:700}
.bg-ghichu .ghi{margin:0;padding:6px 14px;color:#5b6a76;font-size:11.5px}
.bg-ghichu .ghi b{color:#b9c7cf;font-weight:400;margin:0 2px}
.da-b-du{color:#78848f;font-weight:500;font-size:11.5px}
/* v0.9.302: khổ vượt máy chạy thường (720×1020) nhưng còn trong trần 790×1090 — vàng. */
.bg-kho button.bg-kho-vang{background:#fff6d6;border-color:#e6c45a}
.bg-kho button.bg-kho-vang[aria-pressed="true"]{background:#b8860b;border-color:#b8860b;color:#fff}
.bg-kho button.bg-kho-vang[aria-pressed="true"] small{color:#fff6d6}
/* v0.9.305: thêm / bỏ / sửa mẫu trên trang bình ghép */
.bg-item{position:relative}
.bg-item-tool{position:absolute;top:6px;right:6px;display:flex;gap:4px}
.bg-item-tool a,.bg-item-tool button{display:grid;place-items:center;width:22px;height:22px;border:1px solid #e0e6ea;border-radius:6px;background:#fff;color:#78848f;font:inherit;font-size:12px;line-height:1;cursor:pointer;text-decoration:none}
.bg-item-tool a:hover{color:#18745f;border-color:#b9cfc7}
.bg-item-tool button:hover{color:#b3261e;border-color:#e8b4b0;background:#fdf0ee}
.bg-item-name{padding-right:52px}
.bg-them{margin-top:10px;width:100%;padding:8px 10px;border:1px dashed #b9cfc7;border-radius:10px;background:#f4f9f7;color:#18745f;font:inherit;font-size:12.5px;font-weight:700;cursor:pointer}
.bg-them:hover{background:#e9f3ef}
.bg-chon-list{display:flex;flex-direction:column;gap:6px;max-height:56vh;overflow:auto;margin-top:10px}
.bg-chon-list button{display:flex;align-items:center;gap:10px;width:100%;padding:7px 9px;border:1px solid #e0e6ea;border-radius:9px;background:#fff;font:inherit;text-align:left;cursor:pointer}
.bg-chon-list button:hover{border-color:#b9cfc7;background:#f4f9f7}
.bg-chon-list img{width:42px;height:34px;object-fit:contain;flex:0 0 auto}
.bg-chon-list b{display:block;font-size:12.5px;color:#183e33}
.bg-chon-list small{display:block;font-size:11px;color:#78848f}
.bg-chon-tim{width:100%;padding:8px 10px;border:1px solid #d6ded9;border-radius:8px;font:inherit;font-size:13px}
.da-b-chip em{font-style:normal;color:#b8860b;font-weight:600}

/* v0.9.315: cài đặt máy & đơn giá riêng từng tài khoản */
.bg-btn-nho{font:inherit;font-size:12px;padding:5px 10px;border:1px solid #cfd8d3;border-radius:8px;background:#fff;cursor:pointer;color:#183e33}
.bg-btn-nho:hover{background:#eef4f1}
.bg-cd{font-size:12.5px;color:#1f2d28}
.bg-cd .bg-cd-row{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:12px}
.bg-cd .bg-cd-row label{display:flex;flex-direction:column;gap:3px;font-size:11px;color:#5d6d66;font-weight:600}
.bg-cd input[type=text],.bg-cd input[type=number]{font:inherit;font-size:12.5px;padding:4px 6px;border:1px solid #cfd8d3;border-radius:6px;min-width:0}
.bg-cd input[type=number]{width:6.2em}
.bg-cd fieldset{border:1px solid #dbe4df;border-radius:10px;padding:8px 10px 10px;margin:0 0 10px}
.bg-cd legend{display:flex;gap:8px;align-items:center;padding:0 6px;font-weight:700}
.bg-cd legend input[type=text]{width:16em;font-weight:700}
.bg-cd .bg-cd-may{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:4px 0 8px;color:#5d6d66}
.bg-cd .bg-cd-may input[type=number]{width:5em}
.bg-cd table{border-collapse:collapse;width:100%}
.bg-cd th{font-size:10.5px;text-transform:uppercase;letter-spacing:.03em;color:#78848f;text-align:left;padding:2px 4px;font-weight:700}
.bg-cd td{padding:2px 4px}
.bg-cd td input[type=text]{width:5.5em}
.bg-cd td input[type=number]{width:5.2em}
.bg-cd td input.bg-cd-tien{width:7.5em}
.bg-cd .bg-cd-xoa{border:0;background:none;color:#b3261e;cursor:pointer;font-size:14px;padding:0 4px}
.bg-cd .bg-cd-them{font:inherit;font-size:12px;border:1px dashed #9fb3aa;background:#fff;border-radius:8px;padding:4px 10px;cursor:pointer;color:#2b4a40;margin-top:6px}
.bg-cd .bg-cd-nut{display:flex;gap:10px;justify-content:flex-end;margin-top:14px;align-items:center}
.bg-cd .bg-cd-nut .bg-cd-luu{background:#0f5f4c;color:#fff;border:0;border-radius:10px;padding:8px 16px;font:inherit;font-weight:700;cursor:pointer}
.bg-cd .bg-cd-loi{color:#b3261e;margin-right:auto;font-size:12px}
.bg-cd small.bg-cd-goi{color:#78848f;display:block;margin:-6px 0 10px}
/* hộp thoại cài đặt: thắng kiểu input toàn cục (padding lớn, width 100 %) */
#daDialog .bg-cd input[type=text],#daDialog .bg-cd input[type=number]{width:auto;padding:3px 6px!important;height:auto!important;min-height:0!important;font-size:12.5px!important;line-height:1.3!important;border-radius:6px!important;margin:0!important;box-sizing:border-box}
#daDialog .bg-cd input[type=number]{width:6.2em!important}
#daDialog .bg-cd .bg-cd-may input[type=number]{width:5em!important}
#daDialog .bg-cd legend input[type=text]{width:16em!important}
#daDialog .bg-cd td{white-space:nowrap;vertical-align:middle}
#daDialog .bg-cd td input[type=text]{width:5.5em!important}
#daDialog .bg-cd td input[type=number]{width:4.8em!important}
#daDialog .bg-cd td input.bg-cd-tien{width:7.2em!important}
#daDialog .bg-cd .bg-cd-row input[type=text]{width:14em!important}
#daDialog .bg-cd .bg-cd-row input[type=number]{width:7em!important}
#daDialog .bg-cd input[type=checkbox]{width:auto!important;height:auto!important;margin:0 4px 0 0!important}
#daDialog .bg-cd th{white-space:nowrap}
#daDialog .bg-cd fieldset{overflow-x:auto}
