/* Phiếu bug (giống file PDF gửi dev) + các phần mới của form gửi bug. */

/* ---------- form 5 phần ---------- */
.form-step { padding-top: 14px; }
.step-title { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin: 0 0 12px; }
.step-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none;
  border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: 0.95rem;
}
.mt-8 { margin-top: 8px; }
.step-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.step-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.step-no {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 0.9rem;
}
.step-del { min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font: inherit; cursor: pointer; }
.field.invalid .step-input { border-color: var(--danger); background: var(--danger-soft); }
.field.invalid > .label { color: var(--danger); }
.ev-mark {
  position: absolute; left: 4px; bottom: 24px; /* nằm trên dòng "Đã tải lên / Lỗi tải lên" ở đáy, không đè nút Xóa */ min-height: 32px; padding: 4px 10px; border-radius: 999px; border: 0;
  background: #e61414; color: #fff; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer;
}
.ev-item.is-marked { outline: 3px solid #e61414; outline-offset: -3px; }
.hint-list { margin: 6px 0 0; padding-left: 20px; }
.preview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

/* ---------- trình khoanh lỗi ---------- */
body.no-scroll { overflow: hidden; }
.markup-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(12, 16, 24, 0.85); display: flex; align-items: center; justify-content: center; padding: 12px; }
.markup-box { background: #fff; border-radius: var(--radius); padding: 12px; width: min(100%, 1100px); max-height: 100%; overflow: auto; }
.markup-help { margin: 0 0 8px; font-weight: 600; }
.markup-stage { width: 100%; display: flex; justify-content: center; }
.markup-stage canvas { max-width: 100%; touch-action: none; cursor: crosshair; border-radius: 6px; }
.markup-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* ---------- phiếu ---------- */
.ticket { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.t-title { font-size: 1.15rem; margin: 0 0 10px; color: #1f3864; line-height: 1.35; }
.t-code { display: inline-block; background: #1f3864; color: #fff; border-radius: 6px; padding: 1px 8px; margin-right: 6px; font-size: 0.95rem; }
.t-info { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-bottom: 6px; table-layout: fixed; }
.t-info th, .t-info td { border: 1px solid #c9d1de; padding: 5px 8px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.t-info th { background: #e8edf5; width: 17%; font-weight: 700; }
.t-sec { font-size: 1rem; margin: 14px 0 4px; color: #1f3864; }
.t-sec.t-bad { color: #c00000; }
.t-sec.t-good { color: #1f7a4d; }
.t-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.t-steps { margin: 0; padding-left: 22px; }
.t-steps li { margin: 2px 0; }
.t-fig { margin: 8px 0 12px; }
.t-fig img, .t-fig video { display: block; max-width: 100%; border: 1px solid var(--line); border-radius: 6px; }
.t-fig figcaption { font-size: 0.85rem; font-style: italic; color: var(--muted); margin-top: 4px; }
.t-history { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 0.92rem; }
.ticket-toolbar { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 12px; }
@media (max-width: 520px) {
  .t-info, .t-info tbody, .t-info tr { display: block; }
  .t-info tr { display: grid; grid-template-columns: 34% 66%; }
  .t-info th, .t-info td { width: auto; }
}

/* ---------- bản in: chỉ phiếu, mỗi phiếu 1 trang ---------- */
@media print {
  .no-print, .topbar { display: none !important; }
  body { background: #fff; }
  .page { max-width: none; padding: 0; }
  .ticket { border: 0; padding: 0; }
  .t-fig { break-inside: avoid; }
  .t-fig img { max-height: 11cm; }
  .t-code, .t-info th { -webkit-print-color-adjust: exact; print-color-adjust: exact; } /* giữ nền khi in */
}
