/* Production site — builds on /styles.css (same colours and components). */
main.wide { max-width: 1280px; }
.notice.ok { background: #dcefe3; border-color: #b6dcc3; color: #1d5a37; }
.right { text-align: right; }
.btn.big { padding: 14px 28px; font-size: 1.05rem; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; } .check input { width: auto; margin: 0; }

/* stock count: one big, thumb-friendly row per flavour */
.ccard { padding: 6px 14px; }
.crow { display: grid; grid-template-columns: 1fr 110px 90px; gap: 10px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.crow:last-child { border-bottom: 0; }
.cfield { display: flex; flex-direction: column; gap: 3px; margin: 0; font-size: .72rem; color: var(--muted); font-weight: 600; }
.cfield input { font-size: 1.15rem; padding: 10px; text-align: center; }
.cwarn { color: var(--amber); font-size: .8rem; font-weight: 600; } .cwarn:empty { display: none; }
@media (max-width: 520px) { .crow { grid-template-columns: 1fr 1fr; } .cname { grid-column: 1 / -1; } }

/* plan */
.weeknav { margin: 4px 0 10px; }
.countstatus { margin-bottom: 12px; }
.stats { grid-template-columns: repeat(4, 1fr); } .stats .card { margin-bottom: 12px; padding: 12px; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.grouphead { margin: 14px 0 6px; font-size: 1rem; color: var(--green); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.grouphead:first-child { margin-top: 0; }
.batch { display: flex; gap: 12px; align-items: flex-start; padding: 10px 6px; border-bottom: 1px dashed var(--line); }
.batch.done { opacity: .55; } .batch.done .btitle b { text-decoration: line-through; }
.batch.hasws { background: #fbf6e8; border-radius: 8px; }
.bnum { width: 34px; flex: 0 0 34px; text-align: center; font-weight: 700; color: var(--muted); }
.bnum input { width: 22px; height: 22px; margin: 2px 0 0; cursor: pointer; }
.btitle { margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; background: #eef2ec; border: 1px solid #dbe3d8; border-radius: 999px; padding: 3px 10px; font-size: .8rem; }
.chip.ws { background: var(--gold); border-color: var(--gold); color: #1d2a21; }
.chip.delivered { opacity: .6; }
.explain summary { cursor: pointer; }
.xtable td, .xtable th { vertical-align: top; padding: 6px 8px; }
.xtable td.send { background: #fbf6e8; }

/* settings */
.settable input, .settable select { padding: 6px 8px; font-size: .88rem; }
.settable input[type=number] { max-width: 110px; }
.holform { display: grid; grid-template-columns: 140px 1fr; gap: 6px 10px; align-items: center; } .holform label { margin: 0; }

/* labels: A4 sheet of 24 (3 x 8) 70 x 37 mm stickers */
.labels { display: grid; grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37mm; gap: 0; justify-content: center; }
.label { box-sizing: border-box; border: 1px dashed #ccc; padding: 3mm 4mm; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: #fff; color: #000; }
.label .lf { font: 700 15pt var(--serif); line-height: 1.05; }
.label .lsize { font-size: 8pt; font-weight: 600; }
.label .ld { font-size: 8pt; line-height: 1.25; }
.label .ldest { font-size: 8.5pt; font-weight: 700; border-top: 1px solid #000; padding-top: 1mm; }
.label.ws .ldest { background: #000; color: #fff; padding: 1mm; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .topbar, .noprint, #toasts { display: none !important; }
  main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .labels { padding-top: 0; }
  .label { border: 0; break-inside: avoid; }
}

/* which outlet am I counting? */
.lead { font-size: 1.05rem; }
.outletpick { display: grid; gap: 12px; max-width: 420px; }
.outletpick .btn { font-size: 1.15rem; padding: 18px; }
.outletbanner { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--gold); color: #1d2a21; border-radius: var(--radius); padding: 12px 18px; margin-bottom: 12px; }
.outletbanner .oname { font: 700 1.8rem var(--serif); line-height: 1.1; }
.outletbanner .btn.ghost.light { border-color: #1d2a21; color: #1d2a21; background: transparent; }
.outletset { padding: 8px 0 12px; border-bottom: 1px solid var(--line); } .outletset:last-child { border-bottom: 0; }
.outletset input { flex: 1; min-width: 200px; }
.userrow { border-bottom: 1px solid var(--line); padding: 6px 0; } .userrow .row.small { gap: 10px; margin-top: 2px; }

/* production plan table — styled like the old Google Sheet: white cells, thin black grid, thick lines around each outlet
   and each pasteurisation group, pastel outlet headers, centred Arial-style text */
main.wide:has(.plantable) { max-width: 1440px; }
.plancard { padding: 12px; background: #fff; }
.plantable { font: 15px/1.35 Arial, "Helvetica Neue", Helvetica, sans-serif; color: #111; border-collapse: collapse; background: #fff; min-width: 880px; }
.plantable th, .plantable td { border: 1px solid #222; padding: 7px 10px; text-align: center; vertical-align: middle; }
.plantable thead th { font-weight: 700; font-size: 14px; color: #111; background: #fff; }
.plantable thead tr:first-child th { border-top: 3px solid #111; }
.plantable th.gh { background: #cfe2f3; }
.plantable th.oh { border-left: 3px solid #111; border-right: 3px solid #111; font-size: 15px; }
.plantable th.o0 { background: #fce5cd; } .plantable th.o1 { background: #d9ead3; } .plantable th.o2 { background: #ffe599; } .plantable th.o3 { background: #d9d2e9; }
.plantable th.sub { font-weight: 600; font-size: 13px; border-bottom: 3px solid #111; }
.plantable th.sub:not(.pts) { border-left: 3px solid #111; } .plantable th.pts { border-right: 3px solid #111; }
.plantable th.wsh { background: #f4e2b8; } .plantable th.wsh .subnote { font-weight: 400; font-size: 11px; }
.plantable th.th2, .plantable th.wsh, .plantable th.gh { border-bottom: 3px solid #111; }
.plantable td.grp { font-weight: 700; background: #fff; border-left: 3px solid #111; border-right: 3px solid #111; min-width: 96px; }
.plantable tr.gstart td { border-top: 3px solid #111; }
.plantable td.fl { font-weight: 600; text-align: left; white-space: nowrap; min-width: 170px; position: sticky; left: 0; z-index: 1; background: #fff; }
.plantable td.plan { white-space: nowrap; min-width: 150px; border-left: 3px solid #111; font-weight: 600; }
.plantable td.pt { width: 56px; border-right: 3px solid #111; font-weight: 600; }
.plantable td.plan:not(.has) { color: #bbb; font-weight: 400; }
.plantable td.plan.delivered { background: #d9ead3; }
.plantable td.na { color: #666; border-left: 3px solid #111; border-right: 3px solid #111; font-size: 14px; }
.plantable td.ws { text-align: left; min-width: 170px; font-size: 14px; }
.plantable .wsline { background: #f4e2b8; border-radius: 4px; padding: 2px 6px; margin: 2px 0; font-weight: 700; }
.plantable .wsclient { font-weight: 400; }
.plantable td.num { font-weight: 700; width: 74px; }
.plantable td.pri { width: 80px; }
.plantable tr.none td.num { color: #bbb; }
.plantable tr.alldone td:not(.grp) { color: #9a9a9a; }
.plantable tr.alldone td.fl { text-decoration: line-through; }
.plantable tr.alldone td.plan.delivered { background: #e9f2e6; }
.plantable td.done { text-align: left; white-space: nowrap; min-width: 110px; }
.plantable .tick { display: inline-flex; align-items: center; gap: 3px; margin: 1px 6px 1px 0; font-size: 13px; cursor: pointer; }
.plantable .tick input { width: 20px; height: 20px; margin: 0; }
.plantable .tick.on { color: #2e7d4f; font-weight: 700; }
.plantable tfoot td { background: #f3f3f3; border-top: 3px solid #111; border-bottom: 3px solid #111; font-size: 15px; }
.plantable tbody tr:hover td:not(.grp) { background-color: #f7f9fc; }
.plantable tbody tr:hover td.plan.delivered { background: #cfe5c8; }
.legend { margin: 10px 2px 0; }
.pastbanner { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fbefd5; border: 2px solid var(--amber); color: #5c3b06; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; }
.pastpick { width: auto; padding: 5px 10px; font-size: .85rem; }
.summary { margin: 6px 2px 8px; font-size: .95rem; }
/* fit the whole plan on a laptop screen */
.plantable th, .plantable td { padding: 6px 8px; }
.plantable td.grp { min-width: 0; width: 84px; font-size: 14px; }
.plantable th.gh { font-size: 13px; }
.plantable td.fl { min-width: 0; width: 1%; }
.plantable td.plan { min-width: 0; width: 1%; }
.plantable td.ws { min-width: 0; width: 1%; white-space: nowrap; }
.plantable td.num { width: 1%; } .plantable td.pri { width: 1%; }
.plantable th.th2 { font-size: 13px; }
.plantable { font-size: 14px; min-width: 0; }
.plantable th, .plantable td { padding: 5px 7px; }
.plantable .tick { margin-right: 2px; } .plantable .tick input { width: 18px; height: 18px; }
.plancard { padding: 8px; }

/* round 3: narrow group + pints columns, batch-detail column with tick boxes */
.plantable th.grph, .plantable td.grp { width: 44px; min-width: 0; padding: 4px 3px; font-size: 13px; }
.plantable th.pts, .plantable td.pt { width: 38px; min-width: 0; padding: 4px 3px; }
.plantable th.sub { font-size: 12px; }
.plantable th.batchh { text-align: left; min-width: 260px; }
.plantable td.batchcol { text-align: left; font-size: 13px; min-width: 260px; }
.plantable .bline { display: flex; align-items: flex-start; gap: 6px; margin: 2px 0; font-weight: 400; cursor: pointer; line-height: 1.3; }
.plantable .bline input { width: 17px; height: 17px; margin: 1px 0 0; flex: 0 0 auto; }
.plantable .bline input:disabled { cursor: not-allowed; opacity: .45; }
.plantable .bline b { white-space: nowrap; }
.plantable .bline.done { color: #8a8a8a; text-decoration: line-through; }
.plantable .stockline { font-size: 11px; font-weight: 400; color: #777; margin-top: 2px; }
.legend { gap: 12px; align-items: flex-start; }
.plantable .bline { margin: 0; padding: 1px 0; }
.plantable td.batchcol { padding-top: 3px; padding-bottom: 3px; }
.plantable { width: 100%; }
.plantable td.plan { white-space: normal; min-width: 92px; }
.plantable td.batchcol { min-width: 230px; width: 30%; }
.plantable th.batchh { min-width: 230px; }
.plantable .bline span { overflow-wrap: anywhere; }

/* round 4: slimmer pints + priority columns */
.plantable th.pts, .plantable td.pt { width: 30px; padding: 4px 2px; }
.plantable th.sub.pts { font-size: 11px; }
.plantable td.pri { width: 44px; padding: 4px 2px; }
.plantable th.th2 { font-size: 12px; padding: 4px 4px; }

/* stock count overview: same sheet look as the plan */
.counttable { width: auto; min-width: 0; }
.counttable td.plan { min-width: 74px; font-weight: 600; }
.counttable td.fl { min-width: 170px; }
.counttable .subnote { font-weight: 400; font-size: 11px; margin-top: 2px; }
.okmark { color: #2e7d4f; font-weight: 700; }

/* count form: pints stepper + sticky submit bar */
.crow { grid-template-columns: 1fr 112px 136px; }
.pstepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.pstepper button { width: 42px; height: 46px; border: 0; background: #f1ecdc; font-size: 1.3rem; font-weight: 700; color: var(--green); cursor: pointer; }
.pstepper button:active { background: #e4dbc0; }
.pstepper .pval { flex: 1; text-align: center; font-size: 1.15rem; font-weight: 600; }
.cfield input { height: 46px; }
.submitbar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--cream); border-top: 1px solid var(--line); padding: 10px 0; margin-top: 8px; z-index: 5; }
.progress { color: var(--muted); font-size: .9rem; } .progress.complete { color: #2e7d4f; font-weight: 600; }
@media (max-width: 520px) { .crow { grid-template-columns: 1fr 1fr; } .submitbar .btn.big { padding: 12px 16px; font-size: 1rem; } }
.counttable td.plan { width: 64px; } .counttable td.pt { width: 54px; } .counttable th.sub.pts { width: 54px; }
@media (max-width: 999px) { .topbar .nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .topbar .nav a { white-space: nowrap; } }

/* ---- stock count: how old is each count ---- */
.agebadge { display: inline-block; margin: 4px 0 2px; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.agebadge.now { background: #2e7d4f; color: #fff; }
.agebadge.last { background: #e8a33d; color: #fff; }
.agebadge.old { background: #b3412f; color: #fff; }
.countdate { font-size: 13px; font-weight: 700; }
.namecard { padding: 12px 16px; } .namecard label { margin-top: 0; font-weight: 700; } .nameinput { font-size: 1.1rem; }

/* ---- recipes ---- */
.rgrid { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .rgrid { grid-template-columns: 1fr; } }
.rlist { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; padding: 12px; }
.rlist h4 { margin: 14px 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rlink { display: block; padding: 5px 8px; border-radius: 6px; color: var(--ink, #1d2a21); text-decoration: none; font-size: .92rem; }
.rlink:hover { background: #f1ecdc; } .rlink.on { background: var(--green); color: #fff; } .rlink.on .pill { background: #fff; }
.rsize { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.rtable { width: auto; min-width: 380px; }
.rtable td.fl { min-width: 240px; }
.rtable td.plan { min-width: 90px; text-align: right; }
.rtable tr.secrow td, .invtable tr.secrow td { background: #f3f3f3; font-size: 12px; font-weight: 700; text-align: left; text-transform: uppercase; letter-spacing: .05em; color: #555; }
.method { white-space: pre-wrap; line-height: 1.5; }
.warnmark { color: #b3412f; font-weight: 700; }
.prepf { border-bottom: 1px solid var(--line); padding: 8px 0; } .prepf summary { cursor: pointer; } .prepf .tablewrap { margin-top: 8px; }
.editlines input, .editlines select { padding: 5px 6px; font-size: .85rem; }
/* ---- inventory + costing ---- */
.ordercard { border: 2px solid #b3412f; }
.invtable td, .costtable td { white-space: nowrap; }
.countlist { max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin-top: 10px; }
.countlist .line { align-items: center; } .countlist input { padding: 6px; }
.modal:has(.countlist), .modal:has(.holform) { max-width: 640px; }
@media print { .rlist, .rgrid > .rlist { display: none !important; } .rgrid { display: block; } }
.plantable.rtable, .plantable.counttable { width: auto; }
.plantable.rtable td:last-child { min-width: 70px; }
.agebadge { display: block; width: fit-content; margin: 5px auto 3px; }
