/* ============================================================
   Tiskalnica Portal — Job ticket (production work order)
   Opens in its own window from a task; print-friendly.
   ============================================================ */

body.jt-body { background: var(--bg); }

.jt-wrap { max-width: 1080px; margin: 0 auto; padding: 18px 22px 60px; }

/* ---------- screen-only action bar ---------- */
.jt-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 0 14px;
}
.jt-bar .back-link { margin: 0; }

/* ---------- sheet ---------- */
.jt-sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.jt-head {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 24px 28px 20px;
  border-bottom: 2px solid var(--ink);
}
.jt-eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-700); margin-bottom: 6px;
}
.jt-title { font-size: 24px; font-weight: 800; line-height: 1.2; margin: 0; }
.jt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.jt-due-box { margin-left: auto; text-align: right; flex: 0 0 auto; }
.jt-due-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); }
.jt-due-val { font-size: 20px; font-weight: 800; margin-top: 2px; white-space: nowrap; }
.jt-due-val.late { color: var(--critical); }
.jt-stamp {
  display: inline-block; margin-top: 8px;
  border: 2.5px solid var(--critical); color: var(--critical);
  font-weight: 800; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 3px 12px; border-radius: 4px; transform: rotate(-3deg);
}
.jt-stamp.warn { border-color: var(--warn); color: var(--warn); }

/* ---------- status strip ---------- */
.jt-status {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 28px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.jt-status-acts { display: flex; gap: 8px; margin-left: auto; }
.jt-prog { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.jt-prog .progress { width: 110px; }

/* ---------- banners ---------- */
.jt-banner {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 16px 28px 0; padding: 11px 14px;
  border-radius: var(--r); font-size: 13px; line-height: 1.45;
}
.jt-banner.crit { background: var(--critical-soft); color: #8c2a25; border: 1px solid #f0c4c1; }
.jt-banner.warn { background: var(--warn-soft); color: #7a5210; border: 1px solid #ecd9ae; }
.jt-banner svg { flex: 0 0 auto; margin-top: 1px; }

/* ---------- sections ---------- */
.jt-section { padding: 20px 28px 4px; }
.jt-section:last-of-type { padding-bottom: 24px; }
.jt-sec-title {
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); display: flex; align-items: center; gap: 8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.jt-sec-title .spacer { flex: 1; }
.jt-sec-title .t { white-space: nowrap; }
.jt-sec-note { font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-4); }

/* meta grid */
.jt-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 18px; }
.jt-meta-item .l { font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 3px; }
.jt-meta-item .v { font-size: 13.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; min-height: 20px; }
.jt-meta-item .s { font-size: 11.5px; color: var(--ink-4); margin-top: 1px; }

/* ---------- checklist ---------- */
.jt-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; }
.jt-step {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; font-weight: 600;
}
.jt-step:hover { background: var(--surface-2); }
.jt-step-box {
  width: 17px; height: 17px; flex: 0 0 auto; border-radius: 4px;
  border: 1.6px solid var(--ink-4); display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.jt-step.done .jt-step-box { background: var(--good); border-color: var(--good); }
.jt-step.done { color: var(--ink-4); text-decoration: line-through; }

/* deps */
.jt-dep {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none;
  width: 100%; background: none; font-family: inherit; text-align: left; cursor: pointer;
}
.jt-dep:hover { border-color: var(--accent-soft-2); background: var(--accent-soft); }
.jt-dep .id { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-4); margin-left: auto; }

/* ---------- items table ---------- */
.jt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.jt-table th {
  text-align: left; font-size: 10.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-4); padding: 6px 10px 8px; border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
.jt-table td { padding: 10px; border-bottom: 1px solid var(--border-2); vertical-align: top; }
.jt-table tr:last-child td { border-bottom: none; }
.jt-table tr.hl td { background: var(--accent-soft); }
.jt-table tr.hl td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.jt-item-name { font-weight: 700; }
.jt-item-sku { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-4); margin-top: 1px; }
.jt-qty { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 14px; white-space: nowrap; }
.jt-sizerun { display: flex; flex-wrap: wrap; gap: 4px; }
.jt-sz {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; white-space: nowrap;
}
.jt-sz b { font-weight: 600; }
.jt-tech {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.jt-tech .dot { width: 6px; height: 6px; border-radius: 50%; }
.jt-place { font-size: 12px; color: var(--ink-2); }
.jt-dz-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 7px; margin: 1px 3px 1px 0; white-space: nowrap;
}
.jt-dz-chip.missing { color: var(--critical); border-color: #f0c4c1; background: var(--critical-soft); }
.jt-stock-ok { font-size: 12px; font-weight: 700; color: var(--good); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.jt-stock-short { font-size: 12px; font-weight: 700; color: var(--warn); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.jt-stock-sub { font-size: 11px; color: var(--ink-4); font-weight: 500; margin-top: 1px; }

/* ---------- artwork ---------- */
.jt-art { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jt-art-card {
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start;
}
.jt-art-card.review { border-color: #ecd9ae; background: #fffdf6; }
.jt-art-thumb {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
}
.jt-art-name { font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jt-art-file {
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--ink-2);
  display: flex; align-items: center; gap: 5px; margin-top: 4px;
}
.jt-art-file .sz { color: var(--ink-4); }
.jt-art-spec { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }
.jt-art-spec b { color: var(--ink-2); font-weight: 700; }
.jt-art-lines { font-size: 11.5px; color: var(--ink-4); margin-top: 5px; }

/* ---------- sequence ---------- */
.jt-seq { display: flex; flex-direction: column; }
.jt-seq-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-bottom: 1px solid var(--border-2); font-size: 13px;
  color: inherit; text-decoration: none;
}
button.jt-seq-row { width: 100%; background: none; border: none; border-bottom: 1px solid var(--border-2); font-family: inherit; text-align: left; cursor: pointer; }
.jt-seq-row:last-child { border-bottom: none; }
.jt-seq-row.cur { background: var(--accent-soft); border-radius: var(--r-sm); box-shadow: inset 3px 0 0 var(--accent); }
a.jt-seq-row:hover, button.jt-seq-row:hover { background: var(--surface-2); }
.jt-seq-id { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-4); width: 46px; flex: 0 0 auto; }
.jt-seq-title { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jt-seq-who { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.jt-seq-due { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--ink-4); white-space: nowrap; }

/* notes */
.jt-note {
  background: var(--warn-soft); border: 1px solid #ecd9ae; border-radius: var(--r);
  padding: 12px 14px; font-size: 13px; line-height: 1.5; color: #5d460e;
}

/* ---------- sign-off footer ---------- */
.jt-signoff {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px;
  padding: 22px 28px 26px; border-top: 1.5px solid var(--border); margin-top: 18px;
}
.jt-sign { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-4); }
.jt-sign .line { border-bottom: 1.5px solid var(--ink-3); height: 34px; margin-bottom: 6px; }
.jt-printed { padding: 0 28px 18px; font-size: 11px; color: var(--ink-4); text-align: right; }

.jt-missing { padding: 60px 28px; text-align: center; color: var(--ink-3); font-size: 14px; }

@media (max-width: 760px) {
  .jt-meta { grid-template-columns: 1fr 1fr; }
  .jt-art { grid-template-columns: 1fr; }
  .jt-steps { grid-template-columns: 1fr; }
}

/* ---------- print (scoped: only while the job ticket page is mounted) ---------- */
@media print {
  body.jt-print-scope { background: #fff; }
  body.jt-print-scope .sidebar,
  body.jt-print-scope .topbar,
  body.jt-print-scope .back-link,
  body.jt-print-scope .jt-noprint { display: none !important; }
  body.jt-print-scope .app { display: block; }
  body.jt-print-scope .main { display: block; }
  body.jt-print-scope .page { padding: 0; overflow: visible; height: auto; }
  body.jt-print-scope .jt-sheet { border: none; box-shadow: none; border-radius: 0; }
  body.jt-print-scope .jt-status { background: #fff; }
  .jt-step, .jt-art-card, .jt-seq-row, .jt-table tr { break-inside: avoid; }
}
