/* Cœura stock portal: additions on top of app.css, the factory portal's stylesheet (copied as-is so the two match). */

.badge.draft { background: var(--neutral); color: var(--neutral-ink); }
.badge.production { background: var(--info); color: var(--info-ink); }
.badge.part_shipped, .badge.shipped { background: #e6e3f2; color: #3b2f7a; }
.badge.live { background: var(--ok); color: var(--ok-ink); }
.badge.cancelled { background: var(--neutral); color: var(--ink-3); text-decoration: line-through; }
.badge.edition { background: var(--cream); color: var(--ink-2); border: 1px solid var(--line); }
.badge.edition::before { display: none; }

/* units bar in the list: received of confirmed */
.units { font-variant-numeric: tabular-nums; white-space: nowrap; }
.prog { height: 5px; background: var(--neutral); border-radius: 3px; margin-top: 5px; overflow: hidden; min-width: 70px; }
.prog i { display: block; height: 100%; background: var(--accent); }

/* next-step banner on a drop */
.next { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: 10px; background: #eef3f1; border: 1px solid #cfe0dc; }
.next .who { font-size: 12px; color: var(--ink-3); }
.next .what { font-weight: 600; }
.next .btn { margin-left: auto; }
.next.wait { background: var(--card); border-color: var(--line); }
.next.cancelled { background: var(--neutral); border-color: var(--line-2); }

.steps.drop { grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0; padding: 14px 16px; }
@media (max-width: 860px) { .steps.drop { grid-template-columns: repeat(2, 1fr); } }

/* quantity pipeline on each piece */
.qty { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.qty div { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; background: #fff; }
.qty b { display: block; font: 600 17px/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.qty span { font-size: 11px; color: var(--ink-3); }
.qty .short b { color: var(--bad-ink); }
.qty .na b { color: var(--line-2); }
@media (max-width: 520px) { .qty { grid-template-columns: repeat(3, 1fr); } }

/* shipments */
.ship { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ship:last-child { border-bottom: none; }
.ship .h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ship .h b { font-size: 14px; }
.ship .h .r { margin-left: auto; display: flex; gap: 6px; }
.ship .ls { color: var(--ink-2); margin-top: 4px; }

/* edit form */
.form .bd label { display: block; margin: 0 0 5px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.form input, .form textarea, .form select { width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; }
.form .grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.form .grid + label, .form .grid + div { margin-top: 12px; }
@media (max-width: 720px) { .form .grid { grid-template-columns: 1fr; } }
.ed { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; }
.ed .pic { width: 84px; height: 84px; border: 1px dashed var(--line-2); border-radius: 8px; background: var(--cream); display: grid; place-items: center; overflow: hidden; color: var(--ink-3); font-size: 11px; text-align: center; cursor: pointer; position: relative; }
.ed .pic img { max-width: 100%; max-height: 100%; }
.ed .pic input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ed .f { display: grid; grid-template-columns: 2fr 1fr 80px; gap: 10px; }
.ed .f2 { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 10px; }
.ed .ref { font: 12px var(--mono); color: var(--ink-3); margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.ed .ref .btn { margin-left: auto; }
.ed .chk { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.ed .chk input { width: auto; }
@media (max-width: 720px) { .ed .f, .ed .f2 { grid-template-columns: 1fr; } }
.form-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-foot .sum { color: var(--ink-3); font-size: 13px; margin-right: auto; }

/* quantity table inside modals */
.modal.wide { max-width: 560px; }
.qt { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.qt th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.qt td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.qt td.n { text-align: right; color: var(--ink-3); white-space: nowrap; }
.qt input { width: 90px !important; text-align: right; }

/* purchase order: the sample PO template (04_Product/Purchase Orders), as a stock PO */
.po { width: 831px; max-width: 100%; margin: 24px auto; padding: 3.2em 3.6em; background: #fff; color: #222; font: 13px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; box-shadow: 0 1px 4px rgba(0,0,0,.08); border-top: 9px solid #2b3990; }
.po .top { display: flex; align-items: flex-start; margin-bottom: 2em; }
.po .logo { font: 600 30px/1 var(--serif); letter-spacing: .06em; color: #111; }
.po .title { margin-left: auto; font-size: 19px; color: #555; }
.po .meta { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1em; padding-bottom: 1em; border-bottom: 1px solid #ccc; margin-bottom: 1em; }
.po .meta b, .po .parties b { display: block; font-size: 13px; color: #333; margin-bottom: 2px; }
.po .meta span { color: #666; }
.po .parties { display: grid; grid-template-columns: 2fr 1fr; gap: 1em; padding-bottom: 1em; border-bottom: 1px solid #ccc; margin-bottom: 1.4em; font-size: 11.5px; color: #555; line-height: 1.7; }
.po .parties .nm { font-weight: 600; color: #333; }
.po table { width: 100%; border-collapse: collapse; }
.po th { color: #2b3990; text-align: left; font-weight: 600; padding: 6px 6px; border-bottom: 1px solid #ccc; }
.po td { padding: 7px 6px; vertical-align: top; color: #555; }
.po tbody tr:nth-child(odd) td { background: #f2f2f2; }
.po td.it { font-weight: 600; text-transform: uppercase; color: #555; }
.po td.q, .po th.q { text-align: right; }
.po td img { height: 46px; width: auto; display: block; border: 1px solid #ddd; background: #fff; }
.po .tot { display: flex; justify-content: flex-end; gap: 3em; color: #2b3990; padding: 10px 6px; border-top: 1px solid #ccc; }
.po .tot span:last-child { color: #555; min-width: 2em; text-align: right; }
.po .notes { margin-top: 1.6em; color: #555; white-space: pre-wrap; }
.po .notes b { display: block; font-weight: 400; text-transform: uppercase; color: #555; margin-bottom: 4px; }
@media (max-width: 720px) { .po { padding: 1.4em; } .po .meta, .po .parties { grid-template-columns: 1fr; } .po td img { display: none; } }
@media print {
  .po { margin: 0; width: auto; max-width: none; box-shadow: none; padding: 0; }
  .po tbody tr:nth-child(odd) td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

a.btn { text-decoration: none; color: inherit; display: inline-block; }
a.btn.primary { color: var(--accent-ink); }
.tl li.event .text { color: var(--ink-2); }
