/* Panel de la tienda */
body.panel { background: var(--soft); }
.p-top {
  background: #fff; border-bottom: 1.5px solid var(--ink);
  position: sticky; top: 0; z-index: 10;
}
.p-top .in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; }
.p-top img { width: 52px; height: 52px; object-fit: contain; }
.p-top .tit { flex: 1 1 auto; min-width: 0; }
.p-top .tit h1 { font-size: 24px; }
.p-top .tit p { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 0; border: 1.5px solid var(--ink); }
.tabs button { min-height: 42px; padding: 10px 16px 7px; border: 0; background: #fff; cursor: pointer; font-weight: 600; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; }
.tabs button + button { border-left: 1.5px solid var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }

.p-main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }
.p-filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.p-filtros .chip .n { display: inline-block; min-width: 22px; margin-left: 6px; padding: 2px 6px 0; border-radius: 10px; background: var(--soft); color: var(--ink); font-size: 12px; text-align: center; }
.p-filtros .chip[aria-pressed="true"] .n { background: #fff; }
.p-filtros .buscar { margin: 0 0 0 auto; width: 280px; max-width: 100%; }
.p-filtros .buscar input { height: 42px; font-size: 15px; }

.grid { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; align-items: start; }
.pedido { background: #fff; border: 1.5px solid var(--ink); padding: 16px 16px 14px; }
.pedido.nuevo { border-width: 3px; padding: 14.5px 14.5px 12.5px; }
.pedido.cancelado { opacity: 0.6; }
.pedido header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pedido .cod { font-family: var(--serif); font-weight: 900; font-size: 26px; line-height: 1; letter-spacing: 0.03em; }
.pedido .cuando { font-size: 13px; color: var(--muted); margin-top: 4px; }
.badge { flex: 0 0 auto; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; padding: 6px 9px 4px; border: 1.5px solid var(--ink); }
.badge.nuevo { background: var(--ink); color: #fff; }
.badge.preparado { background: #fff; }
.badge.entregado { border-color: var(--ok); color: var(--ok); }
.badge.cancelado { border-color: var(--red); color: var(--red); }
.pedido h3 { margin-top: 12px; font-size: 20px; }
.contacto { margin-top: 4px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.contacto a { overflow-wrap: anywhere; }
.pedido .lineas { margin-top: 10px; border-top: 1px solid var(--line); }
.pedido .linea { padding: 8px 0 6px; gap: 8px; font-size: 15px; }
.pedido .linea .q { flex: 0 0 auto; font-weight: 600; min-width: 28px; }
.pedido .linea .n strong { font-size: 16px; }
.pedido .linea .imp { min-width: 60px; }
.pedido .stepper button { width: 36px; height: 34px; }
.pedido .stepper output { min-width: 24px; font-size: 15px; }
.quitar { border: 0; background: none; padding: 6px; cursor: pointer; color: var(--red); }
.quitar svg { width: 16px; height: 16px; display: block; }
.anadir { display: flex; gap: 8px; margin-top: 10px; }
.anadir select { flex: 1 1 auto; min-width: 0; min-height: 40px; border: 1.5px solid var(--ink); background: #fff; padding: 6px 8px; font-size: 14px; border-radius: 0; }
.notas { margin-top: 10px; padding: 8px 10px 6px; background: var(--soft); font-size: 14px; white-space: pre-wrap; }
.pedido .total-fila { padding: 10px 0 0; }
.pedido .total-fila strong { font-size: 24px; }
.pagado { margin-top: 8px; font-size: 14px; color: var(--ok); font-weight: 600; }
.acciones { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.acciones .btn { flex: 1 1 auto; }
.acciones .btn.wa { background: #fff; color: var(--ink); }
.vacio-p { text-align: center; color: var(--muted); padding: 60px 0; grid-column: 1 / -1; }

/* login */
.login { max-width: 420px; margin: 10vh auto 0; background: #fff; border: 1.5px solid var(--ink); padding: 34px 28px; text-align: center; }
.login img { width: 110px; height: 110px; object-fit: contain; }
.login h1 { margin-top: 12px; font-size: 34px; }
.login p { margin-top: 10px; color: var(--ink2); }
.login .btn { margin-top: 22px; }

/* diálogo de cobro */
dialog.modal { width: min(460px, calc(100% - 24px)); padding: 0; border: 2px solid var(--ink); background: #fff; color: var(--ink); }
.modal-in { padding: 20px 20px 22px; }
.modal-in h2 { font-size: 28px; }
.modal-in .sub { margin-top: 4px; color: var(--muted); font-size: 15px; }
.big-total { margin-top: 16px; text-align: center; border: 1.5px solid var(--ink); padding: 14px 10px 10px; }
.big-total strong { display: block; font-family: var(--serif); font-size: 46px; line-height: 1.05; }
.metodos { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metodo { min-height: 64px; border: 1.5px solid var(--ink); background: #fff; cursor: pointer; font-weight: 600; font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase; display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 3px; }
.metodo svg { width: 22px; height: 22px; }
.metodo[aria-pressed="true"] { background: var(--ink); color: #fff; }
.modal-acc { margin-top: 18px; display: grid; gap: 10px; }
.envio { margin-top: 14px; display: grid; gap: 10px; }
.envio .fila { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.linkbox { margin-top: 12px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; background: var(--soft); padding: 8px 10px 6px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px 9px; font-weight: 600; z-index: 50; }

/* ventas */
.v-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.v-head h2 { font-size: 34px; }
.v-head .campo input { width: auto; min-height: 44px; }
.resumen-v { margin-top: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1.5px solid var(--ink); background: #fff; }
.resumen-v div { padding: 14px 14px 10px; }
.resumen-v div + div { border-left: 1.5px solid var(--ink); }
.resumen-v strong { display: block; margin-top: 6px; font-family: var(--serif); font-size: 28px; line-height: 1.1; }
.tabla-wrap { margin-top: 16px; overflow-x: auto; background: #fff; border: 1.5px solid var(--ink); }
table.ventas { width: 100%; border-collapse: collapse; font-size: 15px; }
.ventas th, .ventas td { text-align: left; padding: 11px 12px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ventas th { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.ventas td.num, .ventas th.num { text-align: right; }
.v-acc { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .p-top .tit p { display: none; }
  .p-top img { width: 42px; height: 42px; }
  .p-filtros .buscar { width: 100%; margin: 4px 0 0; }
  .resumen-v { grid-template-columns: 1fr 1fr; }
  .resumen-v div:nth-child(3) { border-left: 0; }
  .resumen-v div:nth-child(n+3) { border-top: 1.5px solid var(--ink); }
  .grid { grid-template-columns: 1fr; }
}

/* edición de pedido */
.linea.ed .n strong { font-size: 15px; }
.precio-ed { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.precio-ed input { width: 72px; min-height: 32px; border: 1.5px solid var(--ink); padding: 4px 6px 2px; font-size: 14px; text-align: right; border-radius: 0; }
.anadir { display: block; margin-top: 12px; }
.anadir input[type="search"], .manual input { width: 100%; min-height: 40px; border: 1.5px solid var(--ink); padding: 6px 10px 4px; font-size: 15px; border-radius: 0; -webkit-appearance: none; appearance: none; }
.res-add { list-style: none; margin: 0; padding: 0; border: 1.5px solid var(--ink); border-top: 0; }
.res-add:empty { display: none; }
.res-add li + li { border-top: 1px solid var(--line); }
.res-add button { width: 100%; display: flex; justify-content: space-between; gap: 10px; text-align: left; background: #fff; border: 0; padding: 9px 10px 7px; cursor: pointer; font-size: 14px; }
.res-add button:hover { background: var(--soft); }
.res-add .nada { padding: 9px 10px 7px; font-size: 14px; color: var(--muted); }
.manual { display: grid; grid-template-columns: 1fr 76px auto; gap: 6px; margin-top: 8px; }
.m-lineas { margin-top: 12px; max-height: 38vh; overflow: auto; border-top: 1px solid var(--line); }
.m-lineas .linea { padding: 7px 0 5px; font-size: 15px; }
.m-lineas .linea .n strong { font-size: 15px; font-family: var(--sans); font-weight: 600; }

.btn.borrar { color: var(--red); border-color: var(--red); }
.btn.borrar:hover { background: #fbeeee; color: var(--red); }

/* pedido modificado respecto al original */
.acciones .btn.wa-conf { flex-basis: 100%; }
.original { margin-top: 10px; border: 1.5px dashed var(--ink); padding: 8px 10px; font-size: 14px; }
.original summary { cursor: pointer; font-weight: 700; }
.original ul { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.original p { margin-top: 6px; color: var(--muted); }

/* artículos de la entrada (vasos, packs) al cobrar */
.atajos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.atajos .chip { font-size: 13px; }
.extras { margin-top: 14px; padding-top: 12px; border-top: 1.5px solid var(--ink); display: grid; gap: 8px; }
.extras .eyebrow { margin: 0; }
.extra { display: grid; grid-template-columns: 1fr 84px auto; gap: 6px; align-items: center; }
.extra label { font-weight: 600; font-size: 15px; }
.extra input { width: 100%; min-height: 40px; border: 1.5px solid var(--ink); padding: 6px 10px 4px; font-size: 16px; border-radius: 0; -webkit-appearance: none; appearance: none; }
.m-lineas .linea .quitar { margin-left: 6px; }

/* aviso de pedidos nuevos */
.sonido { display: inline-flex; align-items: center; gap: 6px; }
.sonido svg { width: 18px; height: 18px; }
.sonido[aria-pressed="false"] { color: var(--muted); border-color: var(--muted); text-decoration: line-through; }
.activar-sonido button { width: 100%; border: 0; border-top: 1.5px solid var(--ink); background: var(--ink); color: #fff; padding: 10px 16px 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.alerta { background: #FFD84D; border-top: 1.5px solid var(--ink); animation: parpadeo 1.2s ease-in-out infinite; }
.alerta .al-in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 12px; }
.alerta svg { width: 26px; height: 26px; flex: 0 0 auto; }
.alerta p { flex: 1 1 auto; min-width: 0; font-size: 16px; line-height: 1.3; }
.alerta p strong { margin-right: 6px; }
.alerta .btn { flex: 0 0 auto; min-height: 44px; }
.pedido.sin-ver { box-shadow: 0 0 0 4px #FFD84D; }
@keyframes parpadeo { 50% { background: #FFE98F; } }
@media (prefers-reduced-motion: reduce) { .alerta { animation: none; } }
@media (max-width: 640px) {
  .p-top > .in { flex-wrap: wrap; row-gap: 8px; }
  .p-top .tabs { order: 5; width: 100%; }
  .p-top .tabs button { flex: 1 1 0; }
}

.extra-otra { grid-template-columns: 1fr 84px auto; }
.extra-otra input { width: 100%; min-height: 40px; border: 1.5px solid var(--ink); padding: 6px 10px 4px; font-size: 16px; border-radius: 0; -webkit-appearance: none; appearance: none; }
.aviso-otra { margin: 12px 0 0; padding: 10px 12px; background: #FFF3CF; border: 1.5px solid var(--ink); font-size: 14px; line-height: 1.4; }

.dto-btn { margin-top: 14px; }
.dto-det { margin: 4px 0 2px; font-size: 15px; color: var(--muted); }
.dto-fila { display: flex; justify-content: space-between; padding: 6px 0 0; font-size: 14px; color: var(--muted); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; }
.badge.dto { background: #FFD84D; color: var(--ink); border-color: var(--ink); }
