/* The daily screens of the redesign (0.26.0, wave 2): Pedidos, Entregas, WhatsApp (called Clientes until 0.36.0), Productos,
   Descuentos Y Regalos. The customer book (Clientes since 0.36.0) has its own classes in clientes.css.
   The approved mockup (Mockups/rediseno-panel-admin/) is the reference; the brand tokens stay in app.css and the shell,
   the page header (.phead), the chips (.pill) and the "?" (.help) in shell.css. Loaded after shell.css. */

/* a screen never grows past the main box: what is wide (a table, the tabs) scrolls in its own box */
.main > .view { min-width: 0; }
.scr { gap: 16px; padding-bottom: 24px; }
.scr .phead { flex-wrap: nowrap; }
.scr .phead h1 { display: flex; align-items: center; gap: 8px; }
.scr .phead .acts { flex-wrap: wrap; justify-content: flex-end; }

/* tabs with their counts, underlined */
.ptabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; flex: none; }
.ptabs button { border: 0; background: none; padding: 10px 12px; font-weight: 600; color: #4A5A52; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13.5px; display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.ptabs button .cnt { background: #F0EEE6; border-radius: 999px; font-size: 11px; padding: 1px 7px; color: #4A5A52; }
.ptabs button.on { color: var(--navy); border-bottom-color: var(--navy); }
.ptabs button.on .cnt { background: var(--navy); color: #fff; }

.ptools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ptools .sel.s { flex: 0 1 280px; min-width: 0; }
/* clip, not hidden: a card is no scrolling box, so the bar of unsaved changes stays at the foot of the screen */
.scr .card { overflow: clip; min-width: 0; }
.scr .card.tcard { flex: none; }
.tscroll { overflow-x: auto; }
.tscroll.more { -webkit-mask-image: linear-gradient(to left, transparent, #000 36px); mask-image: linear-gradient(to left, transparent, #000 36px); }
.scr .ch { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #F0EEE6; }
.scr .ch h2 { margin: 0; font-size: 14px; font-weight: 600; }
.scr .ch .r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.scr .ch .x { background: none; border: 0; font-size: 22px; line-height: 1; color: #4A5A52; padding: 0 2px; }
.scr .cb { padding: 16px 18px; }
.scr .cb.sm, .sm { font-size: 12.5px; color: #4A5A52; }
.scr .link { background: none; border: 0; padding: 0; color: var(--text); font-size: inherit; text-decoration: underline; }
.grow1 { flex: 1; justify-content: center; }
.nowrap { white-space: nowrap; }

/* the mockup's table */
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: #8A978F; font-weight: 600; padding: 10px 14px; border-bottom: 1px solid #F0EEE6; background: #FCFBF7; white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid #F0EEE6; vertical-align: middle; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t th.num, table.t td.num { text-align: right; white-space: nowrap; }
table.t .pill { white-space: nowrap; }
table.t.rows tr[tabindex]:hover td, table.t.rows tr[tabindex]:focus td { background: #FCFBF7; }
table.t tr.on td, table.t.rows tr.on:hover td { background: #FFFBEA; }
table.t.flush td { padding: 9px 0; }
table.t.flush td + td { padding-left: 12px; }

/* a person (or a candle): a circle with the initials, the name, a muted line */
.ppl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ppl .av { width: 30px; height: 30px; border-radius: 50%; background: #E3EEE7; color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.ppl .tx { min-width: 0; }
.ppl .nm { font-weight: 600; }
.ppl .sb { font-size: 12px; color: #8A978F; }

.tl { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; margin: 0; padding: 0; }
.tl li { display: block; position: relative; text-align: center; padding: 0 4px; }
.tl li .pt { display: block; width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%; background: #fff; border: 2px solid var(--border); margin: 0 auto; position: relative; z-index: 1; }
.tl li::before, .tl li::after { content: ""; position: absolute; top: 7.5px; height: 3px; background: var(--border); }
.tl li::before { left: 0; right: 50%; }
.tl li::after { left: 50%; right: 0; }
.tl li:first-child::before, .tl li:last-child::after { display: none; }
.tl li.done .pt { background: #1E7A4A; border-color: #1E7A4A; }
.tl li.done::before, .tl li.done::after { background: #1E7A4A; }
.tl li.now .pt { background: var(--oro); border-color: var(--oro); box-shadow: 0 0 0 4px #FFF3C4; }
.tl li.now::before { background: #1E7A4A; }
.tl li.bad .pt { background: #B42318; border-color: #B42318; }
.tl li.bad::before { background: #B42318; }
.tl li .t { margin-top: 10px; font-weight: 600; font-size: 13px; }
.tl li .w { font-size: 12px; color: #8A978F; margin-top: 2px; line-height: 1.3; }
.tl li.todo .t { color: #8A978F; font-weight: 500; }
.tl li.bad .t { color: #B42318; }
@media (max-width: 480px) { .tl li { padding: 0 2px; } .tl li .t { font-size: 12px; } .tl li .w { font-size: 11px; } }
.pmain { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.pmain + .ptools { margin-top: 8px; }
.psec { padding: 16px 18px; border-top: 1px solid #F0EEE6; }
.psec h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.kvl { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 6px 12px; font-size: 13px; margin: 0; }
.kvl dt { color: #8A978F; } .kvl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
details.adv { border-top: 1px solid #F0EEE6; }
details.adv summary { padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: #4A5A52; list-style: none; display: flex; align-items: center; gap: 8px; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary::before { content: "›"; font-size: 18px; line-height: 1; transition: transform .15s; color: #8A978F; }
details.adv[open] summary::before { transform: rotate(90deg); }
details.adv .cb { padding-top: 0; }
#pedido .acc { padding: 10px 12px; flex-wrap: wrap; }

/* Productos: the stock bar and the bar of unsaved changes */
.stock { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.stock .sbar { width: 60px; height: 6px; border-radius: 3px; background: #F0EEE6; overflow: hidden; flex: none; }
.stock .sbar i { display: block; height: 100%; background: #1E7A4A; }
.stock.low .sbar i { background: #9A5B00; } .stock.out .sbar i { background: #B42318; }
.stock .sw-low { color: #9A5B00; font-size: 12.5px; } .stock .sw-out { color: #B42318; font-size: 12.5px; }
.stock .cell { width: 72px; }
.savebar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border); padding: 12px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.savebar .ms { color: #4A5A52; font-size: 13px; min-width: 0; overflow-wrap: anywhere; flex: 1 1 260px; }
.savebar .grow { display: none; }

/* Entregas */
.ent-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ent-kpis .kpi { padding: 16px 18px; }
.ent-kpis .kpi .l { font-size: 12px; color: #4A5A52; font-weight: 500; }
.ent-kpis .kpi .v { font-size: 26px; font-weight: 600; margin: 6px 0 2px; line-height: 1.1; }
.ent-kpis .kpi .d { font-size: 12px; color: #8A978F; }
.ent-g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.courier { padding: 16px 18px; border-bottom: 1px solid #F0EEE6; }
.courier:last-child { border-bottom: 0; }
.courier .hd { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.courier .hd .grow { flex: 1; }
.stops { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.stop { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; min-width: 150px; background: #fff; }
.stop b { display: block; font-size: 13px; }
.stop.done { border-color: #E6F4EC; background: #E6F4EC; }
.stop.now { border-color: var(--oro); background: #FFFBEA; }
.stop.bad { border-color: #FDEBE9; background: #FDEBE9; }
.zone { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #F0EEE6; flex-wrap: wrap; }
.zone:last-child { border-bottom: 0; }
.zone .n { font-weight: 600; min-width: 150px; }
.zone .pf { font-size: 12px; color: #8A978F; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.scr .form { margin: 0; }

/* WhatsApp (called Clientes until 0.36.0): the chat card fills the screen; the list scrolls, the messages scroll */
.wa-page { min-height: 0; overflow: hidden; }
#v-whatsapp .wa { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); }
#v-whatsapp .wa-list { width: auto; border-right: 1px solid #F0EEE6; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#v-whatsapp .wa-search { padding: 12px; border: 0; position: static; }
#v-whatsapp .wa-search input { width: 100%; }
#v-whatsapp .wa-list .ptabs { margin: 0 12px 4px; }
#v-whatsapp .wa-list .ptabs button { padding: 8px 7px; font-size: 13px; gap: 5px; }
#w-list { flex: 1; overflow: auto; min-height: 0; }
#v-whatsapp .wa-c { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #F0EEE6; cursor: pointer; align-items: center; }
#v-whatsapp .wa-c.on { background: #FFFBEA; }
#v-whatsapp .wa-c .av { width: 36px; height: 36px; border-radius: 50%; background: #E3EEE7; color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
#v-whatsapp .wa-c .m2 { flex: 1; min-width: 0; }
#v-whatsapp .wa-c .n { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
#v-whatsapp .wa-c .n b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#v-whatsapp .wa-c .tm { color: #8A978F; font-size: 11.5px; white-space: nowrap; }
#v-whatsapp .wa-c .p { font-size: 12.5px; color: #4A5A52; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
#v-whatsapp .wa-c .un, #v-whatsapp .wa-c .bd { float: none; background: #1E7A4A; color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 6px; flex: none; }
#v-whatsapp .wa-c .bd.red { background: #D14B3E; }
#v-whatsapp .wa-conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#v-whatsapp .wa-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #F0EEE6; flex-wrap: wrap; }
#v-whatsapp .wa-head .grow { flex: 1; min-width: 0; }
#v-whatsapp .wa-head .acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
#v-whatsapp .wa-msgs { flex: 1; overflow: auto; min-height: 0; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: #FCFBF7; }
#v-whatsapp .b-in, #v-whatsapp .b-out { max-width: 72%; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; box-shadow: none; }
#v-whatsapp .b-in { background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
#v-whatsapp .b-out { background: #E3EEE7; border-bottom-right-radius: 4px; }
#v-whatsapp .b-in small, #v-whatsapp .b-out small { text-align: left; margin-top: 4px; color: #8A978F; }
#v-whatsapp .b-out small b { color: var(--navy); font-weight: 600; }
.wa-compose { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid #F0EEE6; align-items: center; }
.wa-compose textarea { flex: 1; min-width: 0; resize: none; }
.swl { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; }

@media (max-width: 820px) {
  .scr .phead { flex-wrap: wrap; }
  .scr .phead .acts { margin-left: 0; justify-content: flex-start; }
  table.t th, table.t td { padding-left: 10px; padding-right: 10px; }
  table.t .ppl .av, table.t .thumb { display: none; }
  .stock .sbar { display: none; }
  .stock .cell { width: 60px; }
  .ent-kpis, .ent-g2 { grid-template-columns: minmax(0, 1fr); }
  .ent-kpis .kpi .v { font-size: 20px; }
  #v-whatsapp .wa { display: flex; }
  #v-whatsapp .wa-list { flex: 1; border-right: 0; }
  #v-whatsapp .wa.open .wa-list { display: none; }
  #v-whatsapp .wa-conv { display: none; flex: 1; }
  #v-whatsapp .wa.open .wa-conv { display: flex; }
  #v-whatsapp .b-in, #v-whatsapp .b-out { max-width: 85%; }
  .kvl { grid-template-columns: 80px minmax(0, 1fr); }
  .stop { min-width: 0; flex: 1 1 140px; }
}

/* Productos (0.32.0): the list's row buttons and ⋯ menu, and the ficha (the approved mockup
   Mockups/productos-e-inventario/, pages #productos and #ficha): its sections, the description's toolbar,
   the photos, the prices per channel and the side column with the state and the stock. */
.rowbtns { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.pmenu { position: relative; display: inline-block; }
.pmenu .dd { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08); min-width: 170px; z-index: 30; padding: 4px; text-align: left; }
.pmenu.open .dd { display: block; }
.pmenu.up .dd { left: 0; right: auto; min-width: 300px; }
.pmenu .dd button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--text); white-space: nowrap; }
.pmenu .dd button:hover { background: #F0EEE6; }
.pmenu .dd button.d { color: #B42318; }
.pmenu .dd hr { border: 0; border-top: 1px solid #F0EEE6; margin: 4px 0; }
.pmenu .dd .dh { padding: 6px 10px 4px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 10.5px; color: #8A978F; }
.pmenu .dd .df { padding: 6px 10px 8px; line-height: 1.4; font-size: 12.5px; white-space: normal; }
table.t.prod tbody tr { cursor: pointer; }
.crumb { font-size: 12.5px; color: #8A978F; margin-bottom: -10px; }
.crumb .link { color: #4A5A52; font-weight: 500; text-decoration: none; }
.pf-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pf-side { position: sticky; top: 0; min-width: 0; }
.ficha .sec { padding: 18px; border-bottom: 1px solid #F0EEE6; }
.ficha .sec:last-of-type { border-bottom: 0; }
.ficha .sec h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.ficha .sec .sd { font-size: 12.5px; color: #8A978F; margin: 0 0 14px; }
.ficha .frm { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.ficha .frm .f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ficha .frm .f.w { grid-column: 1 / -1; }
.ficha .frm label { font-size: 12.5px; font-weight: 600; color: #4A5A52; }
.ficha .frm .hint { font-size: 12px; color: #8A978F; }
.ficha .frm .pre { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: #fff; overflow: hidden; }
.ficha .frm .pre span { padding: 7px 0 7px 10px; color: #8A978F; font-size: 12.5px; white-space: nowrap; }
.ficha .frm .pre .sel { border: 0; flex: 1; min-width: 0; padding-left: 2px; }
.ficha input.num { text-align: right; }
.ficha .sec > .tscroll { margin: 0 -18px; }
.ficha .sec > .tscroll table.t th:first-child, .ficha .sec > .tscroll table.t td:first-child { padding-left: 18px; }
.ficha .up { color: #1E7A4A; } .ficha .dn { color: #B42318; }
.ficha .addch { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ficha .savebar .pmsg { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; min-width: 0; }
.ficha .savebar .pmsg .ms { flex: none; }
.ficha .pline { font-size: 12.5px; }
/* the description's editor */
.rt { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.rt .tb { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid #F0EEE6; background: #FCFBF7; flex-wrap: wrap; }
.rt .tb button { border: 0; background: none; min-width: 28px; height: 26px; border-radius: 5px; color: #4A5A52; font-size: 13px; font-weight: 600; }
.rt .tb button:hover { background: #F0EEE6; }
.rt .tb button.ask { color: var(--navy); padding: 0 8px; }
.rt .tb .sep { width: 1px; background: var(--border); margin: 4px 6px; }
.rt .body { padding: 12px 14px; font-size: 13.5px; line-height: 1.55; min-height: 150px; outline: none; }
.rt .body p { margin: 0 0 10px; } .rt .body ul, .rt .body ol { margin: 0 0 10px; padding-left: 20px; } .rt .body h3 { margin: 6px 0 8px; font-size: 15px; }
/* the photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 1; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .wait { display: grid; place-items: center; height: 100%; }
.photo .tag { position: absolute; left: 6px; top: 6px; background: var(--oro); color: var(--navy); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; }
.photo .ops { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 6px; background: linear-gradient(transparent, rgba(0, 0, 0, .45)); opacity: 0; transition: .15s; }
.photo:hover .ops, .photo:focus-within .ops { opacity: 1; }
.photo .ops button { border: 0; background: rgba(255, 255, 255, .92); border-radius: 5px; font-size: 11px; font-weight: 600; padding: 3px 7px; color: var(--text); }
.photo .hd { position: absolute; right: 6px; top: 6px; color: #fff; font-size: 14px; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); cursor: grab; }
.photo.add { border-style: dashed; display: grid; place-items: center; color: #8A978F; font-size: 12.5px; text-align: center; padding: 10px; cursor: pointer; }
.photo.add b { display: block; font-size: 22px; color: #4A5A52; }
/* the side column */
.pf-side .sec { padding: 18px; border-bottom: 1px solid #F0EEE6; }
.pf-side .sec:last-child { border-bottom: 0; }
.pf-side .sec h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.pf-side .swl { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; }
.stk { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stk > div { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.stk .l { font-size: 11px; color: #8A978F; text-transform: uppercase; letter-spacing: .04em; }
.stk .v { font-size: 18px; font-weight: 600; }
@media (max-width: 1100px) {
  .pf-split { grid-template-columns: minmax(0, 1fr); }
  .pf-side { position: static; }
  .ficha .frm { grid-template-columns: 1fr; }
}
@media (hover: none) { .photo .ops { opacity: 1; } }

/* Inventario (0.34.0): the four numbers, the list with the drawer "Ajustar", Historial, Contar and Recibir. The approved
   mockup (Mockups/productos-e-inventario/, #inventario #recibir #contar #historial) is the reference. */
.inv-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.inv-kpis .kpi { padding: 16px 18px; }
.inv-kpis .kpi .l { font-size: 12px; color: #4A5A52; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.inv-kpis .kpi .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin: 6px 0 2px; line-height: 1.1; }
.inv-kpis .kpi .v.wn { color: #9A5B00; } .inv-kpis .kpi .v.dn { color: #B42318; }
.inv-kpis .kpi .d { font-size: 12px; color: #8A978F; }
.inv table.t td.dn { color: #B42318; font-weight: 600; }
.inv table.invt tbody tr { cursor: pointer; }
.inv-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.inv-split.open { grid-template-columns: minmax(0, 1fr) 340px; }
/* 0.34.1: with the drawer open the table keeps every column whole and slides in its .tscroll box */
.inv-split.open table.invt { min-width: 900px; }
.inv-drawer { position: sticky; top: 0; min-width: 0; }
.inv-drawer .sec { padding: 18px; border-bottom: 1px solid #F0EEE6; display: flex; flex-direction: column; gap: 8px; }
.inv-drawer .sec:last-child { border-bottom: 0; }
.inv-drawer h3 { margin: 0; font-size: 14px; font-weight: 600; }
.inv-drawer .dh { display: flex; align-items: center; gap: 8px; }
.inv-drawer .dh h3 { flex: 1; }
.inv-drawer .x { background: none; border: 0; font-size: 22px; line-height: 1; color: #4A5A52; padding: 0 2px; }
.inv-drawer .sd { font-size: 12.5px; color: #8A978F; margin: 0 0 6px; }
.inv-drawer .lb { font-size: 12.5px; font-weight: 600; color: #4A5A52; margin-top: 6px; }
.inv-drawer .sel { width: 100%; }
.inv-drawer .acts2 { display: flex; gap: 8px; margin-top: 6px; }
.inv-drawer .sec > .btn { align-self: flex-start; }
.reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.reasons button { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; display: flex; gap: 8px; align-items: center; background: #fff; color: var(--text); text-align: left; }
.reasons button.on { border-color: var(--navy); background: #E3EEE7; font-weight: 600; }
.reasons button i { width: 8px; height: 8px; border-radius: 50%; background: #8A978F; flex: none; }
.reasons button.plus i { background: #1E7A4A; } .reasons button.minus i { background: #B42318; } .reasons button.set i { background: #1F4E8C; }
.inv-drawer details.more summary { font-size: 12.5px; color: #4A5A52; cursor: pointer; }
.inv-drawer details.more .reasons { margin-top: 6px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 34px; height: 34px; border: 1px solid var(--border); background: #fff; border-radius: 8px; font-size: 18px; font-weight: 600; color: var(--text); flex: none; }
.inv-drawer .qty .sel { width: 72px; text-align: center; font-weight: 600; font-size: 15px; }
.delta { font-weight: 700; } .delta.plus { color: #1E7A4A; } .delta.minus { color: #B42318; }
.preview { background: #FCFBF7; border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.preview b { font-size: 18px; }
/* app.css has a .diff box (the Bandeja's before/after); this is the count's coloured cell */
table.t td.diff { border: 0; border-bottom: 1px solid #F0EEE6; border-radius: 0; overflow: visible; margin: 0; font-weight: 600; }
table.t td.diff.plus { color: #1E7A4A; } table.t td.diff.minus { color: #B42318; } table.t td.diff.zero { color: #8A978F; }
.callout { background: #E9F0FA; color: #1F4E8C; border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.callout b { font-weight: 600; }
.inv .sel.num { text-align: right; }
@media (max-width: 1100px) {
  .inv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-split.open { grid-template-columns: minmax(0, 1fr); }
  .inv-split.open table.invt { min-width: 0; }
  .inv-drawer { position: static; }
}
/* Escáner (0.39.0, public/escaner.js): the camera overlay shared by Inventario → Escanear, Recibir Mercancía and the
   courier's "Escanear Velas"; phone first, over everything. */
.sc-over { position: fixed; inset: 0; z-index: 1000; background: rgba(10, 20, 15, .72); display: flex; align-items: flex-start; justify-content: center; padding: 12px; overflow-y: auto; }
.sc-box { background: #fff; border-radius: 14px; width: 100%; max-width: 460px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sc-head { display: flex; align-items: center; gap: 8px; }
.sc-head b { flex: 1; font-size: 16px; color: var(--navy); }
.sc-cam { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; }
.sc-cam[hidden] { display: none; }
.sc-video { width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: center; }
/* 0.44.4: a wide, short band for a barcode; the decoder reads only what is under it */
.sc-frame { position: absolute; left: 10%; right: 10%; top: 37.5%; bottom: 37.5%; border: 3px solid var(--oro); border-radius: 10px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); pointer-events: none; }
.sc-zoom { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 4px; }
.sc-z { background: rgba(255, 255, 255, .9); border: 0; border-radius: 99px; min-width: 40px; padding: 6px 8px; font-size: 13px; font-weight: 600; color: var(--navy); }
.sc-z[aria-pressed="true"] { background: var(--oro); }
.sc-debug { position: absolute; left: 6px; top: 6px; right: 6px; font: 10px/1.3 ui-monospace, monospace; color: #fff; text-shadow: 0 0 2px #000; pointer-events: none; }
.sc-torch { position: absolute; right: 8px; bottom: 8px; background: rgba(255, 255, 255, .9); border: 0; border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--navy); }
.sc-torch[aria-pressed="true"] { background: var(--oro); }
.sc-last { border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; background: #FCFBF7; border: 1px solid var(--border); color: var(--text); overflow-wrap: anywhere; }
.sc-last.ok { animation: sc-ok 1.2s ease-out; background: #dff3e6; border-color: #9fd3b2; color: #15663a; }
.sc-last.bad { animation: sc-bad 1.2s ease-out; background: #fbe1e1; border-color: #eba7a7; color: #8f2424; }
@keyframes sc-ok { from { background: #7ed69f; } }
@keyframes sc-bad { from { background: #f08a8a; } }
.sc-type { align-self: stretch; }
.sc-manual { display: flex; gap: 8px; }
.sc-manual[hidden] { display: none; }
.sc-manual .sc-num { flex: 1; min-width: 0; font-size: 18px; letter-spacing: 1px; }
/* a stored SKU that fails the check digit (Inventario's list and the Escanear lines) */
.sku-bad { color: #9a4b0a; font-size: 12px; margin-top: 2px; }
/* Inventario → Escanear */
.ivs-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ivs-group .lb { font-size: 12.5px; font-weight: 600; color: #4A5A52; margin-bottom: 6px; }
.ivs-group .reasons { grid-template-columns: 1fr; }
.ivs-t .ivs-n { min-width: 28px; text-align: center; font-size: 16px; }
.ivs-t tr.bad td { background: #FDF3F2; }
.ivs-results { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin-top: 8px; }
.ivs-results:empty { display: none; }
.ivs-ok { color: #15663a; } .ivs-err { color: #8f2424; }
@media (max-width: 600px) { .ivs-kinds { grid-template-columns: 1fr; } }

/* 0.41.0: POS (public/pos.js), the sale typed by hand: one row per candle (size, how many, price, trash), the total */
.pos-head, .pos-line { display: grid; grid-template-columns: minmax(0, 1fr) 84px 150px 34px; gap: 8px; align-items: center; }
.pos-head { font-size: 12px; margin-bottom: 4px; }
.pos-line { margin-bottom: 8px; }
.pos-line select, .pos-line input { width: 100%; min-width: 0; }
.pos-sec { margin: 6px 0 -6px; }
.pos-home { grid-column: 1 / -1; }
.pos-total { font-weight: 600; margin: 12px 0 4px; }
.pos-day-t { margin: 18px 0 8px; }
@media (max-width: 820px) {
  .pos-head { display: none; }
  .pos-line { grid-template-columns: 72px minmax(0, 1fr) 34px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
  .pos-line .pos-vela { grid-column: 1 / -1; }
}

/* 0.44.0: Contabilidad → Facturas (public/facturas.js): the state chip picked */
.ft-chips .chip { cursor: pointer; }
.ft-chips .chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* 0.46.0: Órdenes De Compra (public/compras.js), from the approved mockup Mockups/ordenes-de-compra/: the three-step strip,
   the stepper of an order, the three dots of the list's Paso, the totals line, the comparison's red rows */
.flow { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--corner); padding: 14px 18px; }
.flow div { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.flow b { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: var(--oro); display: grid; place-items: center; font-size: 13px; }
.flow span { font-weight: 600; } .flow small { color: #8A978F; font-size: 12px; }
.flow i { width: 40px; height: 2px; background: var(--border); flex: none; }
.steps3 { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: 6px; }
.steps3 i { width: 14px; height: 6px; border-radius: 3px; background: var(--border); }
.steps3 i.d { background: #1E7A4A; } .steps3 i.now { background: var(--oro); } .steps3 i.part { background: linear-gradient(90deg, #1E7A4A 60%, var(--border) 60%); }
.stepper { display: flex; gap: 8px; }
.stepper div { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--corner); background: var(--surface); border: 1px solid var(--border); color: #8A978F; font-weight: 600; font-size: 13.5px; min-width: 0; }
.stepper b { width: 24px; height: 24px; border-radius: 50%; background: #F0EEE6; display: grid; place-items: center; font-size: 12px; flex: none; }
.stepper .done { color: #1E7A4A; } .stepper .done b { background: #E6F4EC; }
.stepper .now { color: var(--navy); border-color: var(--oro); box-shadow: 0 0 0 2px var(--oro) inset; } .stepper .now b { background: var(--oro); color: var(--navy); }
.totals { display: flex; gap: 24px; justify-content: flex-end; align-items: center; flex-wrap: wrap; font-size: 13px; color: #4A5A52; }
.totals b { font-size: 15px; color: var(--text); } .totals b.dn { color: #B42318; } .totals b.up { color: #1E7A4A; }
.oc .callout.warn, .modal .callout.warn { background: #FFF2DD; color: #9A5B00; }
.oc table.t tr.bad td { background: #FFF7F6; }
.oc table.t td.dn { color: #B42318; }
.oc table.oct tbody tr { cursor: pointer; }
.oc-diff { font-weight: 600; } .oc-diff.minus { color: #B42318; } .oc-diff.plus { color: #1E7A4A; } .oc-diff.zero { color: #8A978F; }
.oc .sel.bad { border-color: #B42318; }
.oc .acts2 { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.oc .pf-side .acts2 .btn { flex: 1 1 100%; justify-content: center; }
.oc .pf-side .reasons { margin-top: 4px; }
.oc-g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.oc-kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; margin: 8px 0 0; }
.oc-kv dt { color: #8A978F; } .oc-kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.oc-log div { display: flex; gap: 16px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid #F0EEE6; }
.oc-log div:last-child { border-bottom: 0; }
.oc-log > div > span { color: #8A978F; width: 120px; flex: none; } .oc-log p { margin: 0; min-width: 0; }
.oc-bar { position: static; border-radius: var(--corner); }
@media (max-width: 1100px) {
  .flow { flex-direction: column; align-items: stretch; } .flow i { display: none; }
  .oc-g2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .stepper { flex-direction: column; }
  .oc-kv { grid-template-columns: 110px minmax(0, 1fr); }
  .oc-log div { flex-direction: column; gap: 2px; } .oc-log > div > span { width: auto; }
}
.oc .reasons.one { grid-template-columns: 1fr; }
/* 2.1.0: Órdenes De Compra W2, step 3 (mockup #ingresar, #detalle): the three mode cards, the same-person notice, the
   phone's list under the camera (N/M per candle), the pending rows */
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mode { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px 16px; border-radius: var(--corner); background: var(--surface); border: 1px solid var(--border); font: inherit; color: var(--text); cursor: pointer; }
.mode b { font-size: 15px; color: var(--navy); } .mode span { font-size: 13px; color: #4A5A52; } .mode em { font-style: normal; font-size: 12px; color: #8A978F; }
.mode.on { border-color: var(--oro); box-shadow: 0 0 0 2px var(--oro) inset; }
.mode.lock, .mode:disabled { cursor: not-allowed; opacity: .6; } .mode.lock em { color: #9A5B00; }
.auth { background: #FFF8E6; border: 1px solid #F2D68A; color: #6B4E00; border-radius: var(--corner); padding: 10px 12px; font-size: 13px; }
.auth.bad { background: #FDEBE9; border-color: #F4B9B2; color: #B42318; }
.oc .sec .ch { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 0; border: 0; }
.oc .sec .ch h3 { margin: 0; }
.oc #oc-manual { margin-top: 10px; }
.oc .pend { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F0EEE6; flex-wrap: wrap; }
.oc .pend:last-of-type { border-bottom: 0; }
.oc-plist { display: flex; flex-direction: column; gap: 2px; max-height: 32vh; overflow-y: auto; margin: 8px 0; font-size: 14px; }
.oc-plist div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 6px; background: #F7F5EE; }
.oc-plist div.ok { background: #E6F4EC; color: #1E7A4A; } .oc-plist div.w { background: #FFF2DD; color: #9A5B00; }
.oc-plist span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .modes { grid-template-columns: minmax(0, 1fr); }
  .oc table.oci th:nth-child(4), .oc table.oci td:nth-child(4) { display: none; }
}
