/* In ấn: nút "In" trên thanh trên cùng + giao diện gọn khi in TRANG ĐANG XEM (Ctrl+P hoặc menu In › Trang đang xem).
   Mẫu in chuyên dụng (hồ sơ, bảng số liệu, phiếu trống) dựng riêng trong print.js. */
.print-wrap { position: relative; flex: none; }
.print-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; }
.print-btn svg.ico { width: 18px; height: 18px; }
.print-menu { min-width: 330px; right: 0; z-index: 60; }
.print-menu button { display: flex; align-items: center; gap: 8px; }
.print-menu button svg.ico { width: 16px; height: 16px; color: var(--brand); flex: none; }
.print-opts .check { font-size: 13.5px; }
iframe.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }
@media (max-width: 720px) { .print-btn span { display: none; } }

@media print {
  @page { size: A4; margin: 12mm 10mm 14mm 10mm; }
  :root { color-scheme: light; }
  html, body { background: #fff !important; color: #111 !important; }
  body { font-size: 11px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* bỏ khung điều hướng, nút, ô nhập không cần thiết */
  .sidebar, .topbar, .menu-btn, .toasts, .modal-back, .dropdown, .save-bar, .tabs, .subtabs, .dropzone, .draft-note,
  .print-wrap, .grid-toolbar, .crf-nav, .t-x, .t-check, .home-btn, button, .btn, input[type=search], input[type=file],
  .xu-home, .sheet-head .chev, iframe.print-frame, .up-tray, #toasts { display: none !important; }
  .shell { display: block !important; }
  .main { display: block !important; }
  .view { padding: 0 !important; max-width: none !important; }
  .page-head { margin-bottom: 8px !important; }
  .page-head p { color: #333 !important; }
  /* thẻ, lưới */
  .card { box-shadow: none !important; border: 1px solid #bbb !important; break-inside: avoid; padding: 8px 10px !important; }
  .card + .card { margin-top: 8px !important; }
  .grid, .g2, .g3, .g4, .g-side { display: block !important; }
  .grid > * + * { margin-top: 8px; }
  .crf-sections { display: block !important; }
  .crf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 4px 8px !important; }
  .fv { break-inside: avoid; padding: 4px 6px !important; border-color: #ccc !important; }
  .fv .fv-meta .row { display: none !important; }
  input, select, textarea { border: 0 !important; border-bottom: 1px dotted #888 !important; background: transparent !important;
    box-shadow: none !important; padding: 0 2px !important; color: #111 !important; }
  select { appearance: none; -webkit-appearance: none; }
  .seg { display: inline-flex !important; }
  .seg button { display: inline-block !important; border: 1px solid #bbb !important; background: #fff !important; color: #555 !important; }
  .seg button.on { background: #e3f0f0 !important; color: #0e5c63 !important; font-weight: 700; }
  /* bảng: in hết, không cuộn, không ghim */
  .table-wrap, .data-grid, .data-grid.sheet { max-height: none !important; overflow: visible !important; border: 0 !important; }
  .data-grid td, .data-grid th, .tbl th, .tbl td { position: static !important; white-space: normal !important; max-width: none !important; }
  table.tbl { font-size: 10px; }
  .tbl th, .tbl td { padding: 3px 5px !important; border: 1px solid #ccc !important; }
  .tbl thead { display: table-header-group; }
  .tbl tr { break-inside: avoid; }
  .data-grid-host.fullscreen { position: static !important; padding: 0 !important; }
  /* nội dung thu gọn: hiện đủ */
  details > summary { list-style: none; font-weight: 600; }
  .thumbs { grid-template-columns: repeat(6, 1fr) !important; }
  .progress, .spinner { display: none !important; }
  a { color: inherit !important; text-decoration: none !important; }
  .pill { border: 1px solid currentColor; }
  /* xem DICOM: bỏ danh sách loạt ảnh & thanh công cụ, giữ khung ảnh */
  .dv-side, .dv-toolbar, .dv-load, .dv-empty { display: none !important; }
  .dv-wrap { display: block !important; }
  .dv-main, .dv-grid { height: auto !important; min-height: 0 !important; }
  .dv-port { break-inside: avoid; }
  .dv-port canvas { max-width: 100% !important; }
  /* phòng ảnh: chỉ in ảnh */
  .studio { display: block !important; }
  .studio .tools, .studio .side { display: none !important; }
  .studio .stage { height: auto !important; min-height: 0 !important; background: #fff !important; }
  .studio canvas { max-width: 100% !important; height: auto !important; }
}
