/* Phase 4 — order operations. One stylesheet for the merchant pipeline, the preparation sheet,
   the back-in-stock list and the customer's notify form, loaded by both layouts so a shared
   component (a badge, a compact button) looks the same on both sides. */

/* Feature 11 — the pipeline. A horizontal strip of stages with the count above the name; it
   replaces the status dropdown as the primary way to move between stages, and reads left to
   right in the order work actually flows. */
.order-pipeline{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 18px}
.pipeline-step{flex:1 1 96px;min-width:96px;display:flex;flex-direction:column;gap:2px;padding:10px 14px;background:var(--surface,#fff);border:1px solid var(--line,#e6ddcd);border-radius:10px;text-decoration:none;color:var(--ink,#211d18);transition:border-color .15s ease,transform .15s ease}
.pipeline-step strong{font-size:1.35rem;line-height:1.1}
.pipeline-step span{font-size:.76rem;letter-spacing:.04em;text-transform:uppercase;color:var(--muted,#78705f)}
.pipeline-step:hover{border-color:var(--brand,#21503e);transform:translateY(-1px)}
.pipeline-step.active{border-color:var(--brand,#21503e);box-shadow:inset 0 -3px 0 var(--brand,#21503e)}
.pipeline-step.active strong{color:var(--brand,#21503e)}

/* Feature 11 — the reason a cancelled row is cancelled, without opening the order. */
.cancel-reason{display:block;margin-top:4px;color:var(--muted,#78705f);font-size:.74rem;max-width:190px;line-height:1.35}

/* Feature 11 — the one-click forward step plus Open. Kept on one line and never wrapped. */
.order-row-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:flex-end}
.order-row-actions form{margin:0}
.order-row-actions .button{white-space:nowrap}

/* Feature 26 — the edit panel. Reads like the order itself (one row per line) so the merchant
   recognises what they are changing, with the new-line pickers underneath. */
.order-edit-panel{margin-top:20px}
.order-edit-lines{width:100%;border-collapse:collapse;margin:6px 0 14px}
.order-edit-lines th{text-align:left;font-size:.72rem;letter-spacing:.05em;text-transform:uppercase;color:var(--muted,#78705f);padding:0 10px 8px 0;border-bottom:1px solid var(--line,#e6ddcd)}
.order-edit-lines td{padding:12px 10px 12px 0;border-bottom:1px solid var(--line,#e6ddcd);vertical-align:top}
.order-edit-lines td:first-child strong{display:block}
.order-edit-lines td:first-child span,.order-edit-lines td:first-child small{display:block;color:var(--muted,#78705f);font-size:.78rem}
.order-edit-lines input[type=number]{width:76px;padding:8px 10px;border:1px solid var(--line,#e6ddcd);border-radius:8px;font:inherit}
.order-edit-lines td:nth-child(3){text-align:right;font-weight:600;white-space:nowrap}
.order-edit-add{display:grid;gap:10px}
.order-edit-add-row{display:grid;grid-template-columns:1fr 90px auto;gap:10px;align-items:center;padding:10px 12px;background:#f8f9fb;border:1px solid var(--line,#e6ddcd);border-radius:10px}
.order-edit-add-row select,.order-edit-add-row input{width:100%;padding:8px 10px;border:1px solid var(--line,#e6ddcd);border-radius:8px;font:inherit}
.order-edit-actions{margin-top:16px}
.order-edit-panel .small{font-size:.8rem}

/* Feature 24 — the day's numbers, on one line above the two tables. */
.prep-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 20px}
.prep-stat{background:#1c1712;color:#fff;border-radius:12px;padding:18px 20px}
.prep-stat strong{display:block;font-size:1.8rem;line-height:1.1}
.prep-stat span{display:block;margin-top:6px;color:#98a2b3;font-size:.78rem}
.prep-grid{margin-top:0}
.prep-table td:first-child strong{display:block}
.prep-table td{white-space:nowrap}
.prep-orders{display:grid;gap:12px;margin-top:12px}
.prep-order{border:1px solid var(--line,#e6ddcd);border-radius:10px;padding:14px 16px;background:var(--surface,#fff)}
.prep-order header{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.prep-order header a{text-decoration:none}
.prep-order header small{color:var(--muted,#78705f);font-size:.76rem;margin-left:auto}
.prep-order ul{margin:10px 0 0;padding:0;list-style:none;display:grid;gap:6px}
.prep-order li{display:flex;justify-content:space-between;gap:12px;font-size:.9rem;border-top:1px dashed var(--line,#e6ddcd);padding-top:6px}
.prep-order li small{color:var(--muted,#78705f)}
.prep-note{margin:12px 0 0;padding:10px 12px;background:#fffaeb;border-radius:8px;color:#93370d;font-size:.85rem}
.panel-title.pad{padding:16px 18px 0}
.inline-field{display:flex;align-items:center;gap:10px;margin:0}
.inline-field input{padding:9px 12px;border:1px solid var(--line,#e6ddcd);border-radius:8px;font:inherit}

/* Feature 19 — three states, three colours: nothing to do yet, worth writing now, handled. */
.badge.notify-ready{background:#ecfdf3;color:#027a48}
.badge.notify-waiting{background:#f2f4f7;color:#475467}
.badge.notify-done{background:#eff8ff;color:#175cd3}
.stock-notify-table td:first-child strong,.stock-notify-table td:nth-child(2) small{display:block}
.stock-notify-table td:nth-child(2) small,.stock-notify-table td:nth-child(4) small{color:var(--muted,#78705f);font-size:.76rem;margin-top:3px}

/* Feature 19 — the customer's form on the product page. Collapsed by default: someone who can buy
   the thing should not have to scroll past a waiting list to do it. */
.notify-panel{margin:16px 0 4px;border:1px dashed var(--line,#e6ddcd);border-radius:10px;padding:12px 14px;background:var(--surface,#fff)}
.notify-panel summary{cursor:pointer;font-weight:600;color:var(--brand,#21503e)}
.notify-form{display:grid;gap:12px;margin-top:14px;max-width:420px}
.notify-form .field{display:grid;gap:6px;font-weight:600;font-size:.85rem}
.notify-form input,.notify-form select{padding:11px 12px;border:1px solid var(--line,#e6ddcd);border-radius:8px;font:inherit;font-weight:400}
.notify-form .button{justify-self:start}
.notify-note{margin:0;color:var(--muted,#78705f);font-size:.78rem;line-height:1.45}

@media(max-width:700px){
  .pipeline-step{flex:1 1 44%;min-width:0}
  .prep-summary{grid-template-columns:1fr}
  .order-edit-add-row{grid-template-columns:1fr}
  .order-row-actions{justify-content:flex-start}
  .prep-order header small{margin-left:0}
}
