/* =====================================================================
   Las pantallas del dinero: Recibir pedido, Gastos y retiros, y Cuadre de caja.
   ===================================================================== */

/* ---------- recibir pedido ---------- */
.ped-tbl .cell-input { width: 80px; }
.ped-tbl th { line-height: 1.15; }
.ped-tbl td { padding-left: 8px; padding-right: 8px; }
.ped-tbl .desc { min-width: 170px; }
.ped-tbl [data-cu] { font-size: 12.5px; margin-top: 2px; white-space: nowrap; }
.ped-total b { font-size: 40px; white-space: nowrap; }
.pay-opt { justify-content: flex-start; text-align: left; white-space: normal; min-height: 46px; font-size: 15px; }
.pay-opt[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
@media (max-width: 640px) {
  .ped-tbl thead { display: none; }
  .ped-tbl, .ped-tbl tbody { display: block; }
  .ped-tbl tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; grid-template-areas: "desc desc desc del" "q c u u" "sub sub sub sub"; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .ped-tbl td { display: block; padding: 0; border: 0; min-width: 0; }
  .ped-tbl td:nth-child(1) { grid-area: desc; }
  .ped-tbl td:nth-child(2) { grid-area: q; }
  .ped-tbl td:nth-child(3) { grid-area: c; }
  .ped-tbl td:nth-child(4) { grid-area: u; }
  .ped-tbl td:nth-child(5) { grid-area: sub; }
  .ped-tbl td:nth-child(6) { grid-area: del; }
  .ped-tbl .cell-input { width: 100%; }
  .ped-tbl td[data-l]::before { content: attr(data-l); display: block; text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 2px; white-space: normal; }
}

/* ---------- gastos y retiros ---------- */
.gs-tbl .gs-d { min-width: 150px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 6px; }
.cat-grid button { min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink-2); font-weight: 700; font-size: 14.5px; line-height: 1.2; cursor: pointer; }
.cat-grid button:hover { background: var(--panel-2); color: var(--ink); }
.cat-grid button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.cat-grid .cat-retiro { grid-column: 1 / -1; border-style: dashed; }
.cat-grid .cat-retiro[aria-pressed="true"] { background: var(--warn); border-color: var(--warn); border-style: solid; color: var(--panel); }

/* ---------- cuadre de caja ---------- */
.cu-pos { grid-template-columns: minmax(0, 1fr) 340px; }
.cu-ent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cu-group { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); }
.cu-group > .btn { align-self: flex-start; }
.cu-gh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cu-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.cu-head > b { font-size: 19px; white-space: nowrap; }
.cu-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.cu-row .input { min-height: 40px; }
.cu-sug { display: flex; align-items: flex-start; gap: 6px; width: 100%; padding: 8px 10px; border: 1px dashed var(--brand); border-radius: 8px; background: var(--brand-soft); color: var(--brand); font: inherit; font-size: 14px; line-height: 1.35; text-align: left; cursor: pointer; }
.cu-sug svg { width: 16px; height: 16px; margin-top: 1px; }
.cu-sug span { flex: 1; min-width: 0; }
.cu-sug.ok { border-style: solid; border-color: var(--line-2); background: transparent; color: var(--ink-3); cursor: default; }
.cu-count { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; }
.cu-den { display: grid; grid-template-columns: 64px 92px minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 6px; }
.cu-den > span:first-child { font-weight: 700; }
.cu-den .input { min-height: 38px; }
.cu-den > span:last-child { text-align: right; color: var(--ink-2); }
.cu-faj { display: grid; grid-template-columns: 104px 76px auto 76px minmax(0, 1fr) auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.cu-faj .input, .cu-faj .select { min-height: 38px; }
.cu-faj > [data-fsub] { text-align: right; color: var(--ink-2); }
.cu-ro { display: flex; align-items: center; justify-content: flex-end; background: var(--panel-2); font-weight: 700; }
.cu-side .line small { display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
.cu-strong { padding-top: 8px; border-top: 1px solid var(--line); }
.cu-strong > span { font-weight: 700; }
.cu-strong > b { font-size: 19px; }
.cu-dif { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; border-radius: 10px; }
.cu-dif span { font-weight: 700; font-size: 17px; }
.cu-dif b { font-family: var(--num); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.cu-dif.ok { background: var(--ok-soft); color: var(--ok); }
.cu-dif.warn { background: var(--warn-soft); color: var(--warn); }
.cu-dif.bad { background: var(--bad-soft); color: var(--bad); }
@media (max-width: 640px) {
  .cu-ent, .cu-count { grid-template-columns: minmax(0, 1fr); }
  .cu-faj { grid-template-columns: minmax(0, 1fr) 70px auto 70px auto; }
  .cu-faj > [data-fsub] { grid-column: 1 / -1; text-align: left; }
}
