/* laGloria · Sistema de pedidos — estilos (sin dependencias) */
:root {
  --olive: #49532d;
  --olive-d: #2e3519;
  --olive-l: #617040;
  --olive-pale: #f0f3e8;
  --gold: #c9a054;
  --gold-pale: #f6eedb;
  --cream: #fdfbf7;
  --card: #ffffff;
  --line: rgba(73, 83, 45, 0.14);
  --text: #2b301f;
  --muted: #6c725e;
  --ok: #3d7a4f;
  --ok-pale: #e6f2e9;
  --warn: #9a6b12;
  --warn-pale: #fbf1dc;
  --bad: #b3261e;
  --bad-pale: #fbe9e7;
  --r: 16px;
  --r-sm: 10px;
  --sh: 0 2px 10px rgba(43, 48, 31, 0.07);
  --sh-lg: 0 18px 50px rgba(43, 48, 31, 0.2);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--cream);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}
img {
  max-width: 100%;
  display: block;
}
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
a {
  color: var(--olive);
}
h1, h2, h3 {
  font-family: var(--serif);
  color: var(--olive-d);
  line-height: 1.15;
  margin: 0;
}
h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.6rem;
}
h3 {
  font-size: 1.25rem;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
.tiny {
  font-size: 0.75rem;
}
.mono {
  font-variant-numeric: tabular-nums;
}
.hidden {
  display: none !important;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.stack > * + * {
  margin-top: 12px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Cabecera ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(253, 251, 247, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--olive);
  text-decoration: none;
  white-space: nowrap;
}
.logo em {
  font-weight: 400;
}
.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar {
  display: none;
}
.nav button {
  border: 0;
  background: none;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.nav button[aria-current='true'] {
  background: var(--olive);
  color: #fff;
}
.nav .l-short {
  display: none;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-chip .who {
  text-align: right;
  line-height: 1.2;
}
.user-chip .who b {
  display: block;
  font-size: 0.9rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--olive-pale);
  color: var(--olive);
  white-space: nowrap;
}
.badge.gold {
  background: var(--gold-pale);
  color: #7a5a17;
}
.badge.ok {
  background: var(--ok-pale);
  color: var(--ok);
}
.badge.warn {
  background: var(--warn-pale);
  color: var(--warn);
}
.badge.bad {
  background: var(--bad-pale);
  color: var(--bad);
}
.main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 16px 120px;
}

/* ---------- Botones y formularios ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--olive-pale);
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--olive);
  border-color: var(--olive);
  color: #fff;
}
.btn.primary:hover {
  background: var(--olive-d);
}
.btn.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--olive-d);
}
.btn.danger {
  color: var(--bad);
  border-color: rgba(179, 38, 30, 0.3);
}
.btn.danger:hover {
  background: var(--bad-pale);
}
.btn.ghost {
  border-color: transparent;
  background: none;
}
.btn.sm {
  padding: 5px 11px;
  font-size: 0.8rem;
}
.btn.icon-only {
  padding: 7px;
  border-radius: 50%;
}
.btn.block {
  width: 100%;
}
label.field {
  display: block;
}
label.field > span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.input, select.input, textarea.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  outline: none;
}
.input:focus {
  border-color: var(--olive-l);
  box-shadow: 0 0 0 3px rgba(73, 83, 45, 0.12);
}
textarea.input {
  resize: vertical;
  min-height: 70px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 640px) {
  .grid2, .grid3 {
    grid-template-columns: 1fr;
  }
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--olive);
}
.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}
.hint.ok {
  color: var(--ok);
}
.hint.bad {
  color: var(--bad);
}

/* ---------- Tarjetas y tablas ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--sh);
}
.card.pale {
  background: var(--olive-pale);
  box-shadow: none;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
}
.kpi .v {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--olive-d);
  line-height: 1.1;
}
.kpi .l {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
}
table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.t th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
  background: var(--olive-pale);
  white-space: nowrap;
}
table.t td {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
table.t tr.off td {
  opacity: 0.5;
}
table.t td.num, table.t th.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 34px 16px;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 26px 0 12px;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}
.chip[aria-pressed='true'] {
  background: var(--olive);
  color: #fff;
  border-color: var(--olive);
}
.scroll-x {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

/* ---------- Acceso ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-hero {
  background: #3e4921;
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-hero .brand {
  width: 240px;
  max-width: 70%;
}
.auth-hero h1 {
  color: #fff;
  font-size: 2.8rem;
  max-width: 12ch;
}
.auth-hero p {
  color: rgba(255, 255, 255, 0.8);
  max-width: 40ch;
}
.auth-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}
.auth-card {
  width: 100%;
  max-width: 410px;
}
@media (max-width: 860px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    padding: 26px 20px;
  }
  .auth-hero h1 {
    font-size: 1.9rem;
  }
  .auth-hero .foot {
    display: none;
  }
}

/* ---------- Empleado ---------- */
.hello {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.info-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.82rem;
}
.pill b {
  display: block;
  font-size: 1rem;
  color: var(--olive-d);
}
.days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}
.day {
  flex: none;
  min-width: 92px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 9px 12px;
  cursor: pointer;
  text-align: left;
  position: relative;
}
.day .dn {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.day .dd {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.day .ds {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 3px;
}
.day[aria-pressed='true'] {
  background: var(--olive);
  border-color: var(--olive);
  color: #fff;
}
.day[aria-pressed='true'] .dn, .day[aria-pressed='true'] .ds {
  color: rgba(255, 255, 255, 0.8);
}
.day .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
}
.day .dot.done {
  background: var(--ok);
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}
.layout > * {
  min-width: 0;
}
@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 1fr;
  }
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 14px 0;
}
.search {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.search .input {
  padding-left: 36px;
  border-radius: 999px;
}
.dishes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.dish {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh);
}
.dish .ph {
  aspect-ratio: 4/3;
  background: var(--olive-pale) center/cover no-repeat;
  cursor: pointer;
  position: relative;
}
.dish .ph .tags {
  position: absolute;
  left: 8px;
  top: 8px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  z-index: 1;
}
.dish .ph > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dish .bd {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.dish .nm {
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}
.dish .al {
  font-size: 0.9rem;
  letter-spacing: 1px;
  min-height: 1.2em;
}
.dish .ft {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.price {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--olive-d);
}
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.qty button {
  border: 0;
  background: none;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.qty button:hover {
  background: var(--olive-pale);
}
.qty span {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
}
.cart {
  position: sticky;
  top: 76px;
}
.cart-day {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  margin-top: 10px;
}
.pick-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 4px 2px 10px;
  background: var(--gold-pale);
  color: #6b4f14;
  font-size: 0.85rem;
  font-weight: 600;
}
.pick-time.missing {
  background: #fbe3c4;
  outline: 2px solid #e8a33d;
}
.pick-time .icon {
  width: 15px;
  height: 15px;
}
.pick-time select {
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 4px 2px;
  cursor: pointer;
}
.cart-line {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.88rem;
  padding: 3px 0;
}
.sum-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 3px 0;
}
.sum-line.total {
  font-weight: 700;
  font-size: 1.05rem;
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 8px;
}
.cart-fab {
  display: none;
}
@media (max-width: 1000px) {
  /* 82dvh = alto visible real (en el móvil la barra del navegador tapaba el final del carrito) */
  .cart {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    z-index: 50;
    border-radius: 20px 20px 0 0;
    max-height: 82vh;
    max-height: 82dvh;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    transform: translateY(105%);
    transition: transform 0.25s;
    box-shadow: var(--sh-lg);
  }
  .cart.open {
    transform: none;
  }
  .cart-fab {
    display: flex;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 45;
    justify-content: space-between;
    padding: 14px 20px;
    box-shadow: var(--sh-lg);
  }
}
.order {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.order:first-child {
  border-top: 0;
}
.order > .grow {
  flex: 1 1 280px;
}
.order-actions {
  flex: 0 1 auto;
}
@media (max-width: 520px) {
  .order-actions {
    width: 100%;
  }
  .order-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--olive);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn .icon {
  width: 15px;
  height: 15px;
}
.cart-line.removed > .grow, .cart-line.removed > .mono {
  opacity: 0.45;
  text-decoration: line-through;
}

/* ---------- Modal y avisos ---------- */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(30, 34, 20, 0.45);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  animation: fade 0.15s;
}
.modal {
  background: var(--cream);
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow: auto;
  box-shadow: var(--sh-lg);
  animation: pop 0.18s;
}
.modal.wide {
  max-width: 860px;
}
.modal-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--cream);
  z-index: 1;
}
.modal-b {
  padding: 18px 20px;
}
.modal-f {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: var(--cream);
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }
}
.toasts {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
}
.toast {
  background: var(--olive-d);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--sh-lg);
  font-size: 0.9rem;
  animation: pop 0.2s;
}
.toast.bad {
  background: var(--bad);
}
.loading {
  display: grid;
  place-items: center;
  min-height: 40vh;
  color: var(--muted);
}
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--olive-pale);
  border-top-color: var(--olive);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.notice {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.88rem;
  background: var(--gold-pale);
  color: #6b4f14;
}
.notice.ok {
  background: var(--ok-pale);
  color: var(--ok);
}
.notice.bad {
  background: var(--bad-pale);
  color: var(--bad);
}
.notice.already {
  flex-basis: 100%;
  width: 100%;
  margin: 8px 0 4px;
  padding: 9px 12px;
  line-height: 1.4;
}
.code-box {
  font-family: ui-monospace, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: #fff;
  border: 1px dashed var(--olive-l);
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--olive-d);
}

/* ---------- Calendario de disponibilidad ---------- */
.cal {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.cal .wk {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 8px;
}
.cal .wk .wk-all {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--olive);
  border-color: rgba(73, 83, 45, 0.35);
}
.cal .wk .wk-all[aria-pressed='true'] {
  color: #fff;
}
.cal button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 0.82rem;
}
.cal button[aria-pressed='true'] {
  background: var(--olive);
  color: #fff;
  border-color: var(--olive);
}

/* ---------- Impresión (parte de cocina y albaranes) ---------- */
.print-only {
  display: none;
}
.albaran {
  break-inside: avoid;
  page-break-after: always;
}
.alb-totals {
  text-align: right;
}
@media (max-width: 520px) {
  .alb-totals {
    text-align: left;
    width: 100%;
  }
  .alb-totals .price {
    display: inline-block;
    margin-right: 8px;
  }
  .alb-totals .small {
    display: inline;
  }
}
.sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.sign div {
  border-top: 1px solid var(--text);
  padding-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  height: 70px;
}
@media print {
  body {
    background: #fff;
    font-size: 12px;
  }
  .topbar, .no-print, .cart-fab, .toasts {
    display: none !important;
  }
  .print-only {
    display: block;
  }
  .main {
    padding: 0;
    max-width: none;
  }
  .card, .table-wrap {
    box-shadow: none;
    border-color: #bbb;
  }
  .albaran:last-child {
    page-break-after: auto;
  }
}

/* ---------- Parte de cocina: categorías marcadas y compacto al imprimir ---------- */
table.kitchen .cat-row td {
  background: var(--olive);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  padding: 7px 12px;
}
table.kitchen .cat-row td span.cat-n {
  float: right;
  font-weight: 600;
  opacity: 0.85;
}
table.kitchen td.ktot {
  font-size: 1.15rem;
  width: 70px;
}
table.kitchen .total-row td {
  border-top: 2px solid var(--text);
}
.kprog {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.kp-btn, .kp-ok {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  color: var(--text);
}
.kp-btn .icon, .kp-ok .icon {
  width: 16px;
  height: 16px;
}
.kp-ok.on {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.kp-in {
  width: 46px;
  height: 32px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  -moz-appearance: textfield;
}
.kp-in::-webkit-outer-spin-button, .kp-in::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.kp-left {
  font-size: 0.8rem;
  font-weight: 700;
  color: #b4690e;
  min-width: 62px;
}
.kp-left.ok {
  color: var(--ok);
}
table.kitchen tr.k-done td:not(.no-print), .kdish.k-done .kn {
  color: var(--muted);
}
table.kitchen tr.k-done .kname {
  text-decoration: line-through;
}
.kcell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  flex-wrap: wrap;
}
.kdish .kpl {
  grid-column: 1 / -1;
  margin-top: 4px;
}
.kp-print {
  display: none;
}
.kp-actions {
  gap: 6px;
  flex-wrap: nowrap;
}
.kp-actions .btn {
  white-space: nowrap;
}
@media (max-width: 520px) {
  .kp-actions .btn .icon {
    display: none;
  }
  .kp-actions .btn {
    padding: 6px 11px;
  }
  .kp-actions .check {
    white-space: nowrap;
  }
}
@media print {
  body.print-progress .kp-print {
    display: inline;
    font-size: 9.5px;
    font-weight: 700;
    margin-left: 8px;
  }
}
@media print {
  table.kitchen tr.k-done td, .kdish.k-done .kn {
    color: #000 !important;
  }
  .k-done .kname {
    text-decoration: none !important;
  }
}
@media (max-width: 520px) {
  .kitchen-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
  }
  .kitchen-kpis .kpi {
    border: 0;
    background: none;
    padding: 0;
  }
  .kitchen-kpis .kpi .v {
    font-size: 1.25rem;
    display: inline;
  }
  .kitchen-kpis .kpi .l {
    display: inline;
    margin-left: 4px;
  }
}
.klist {
  columns: 2 340px;
  column-gap: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
}
.kcat {
  margin-bottom: 12px;
}
.kcat h4 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 4px;
  padding: 6px 10px;
  background: var(--olive);
  color: #fff;
  border-radius: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  break-after: avoid;
  break-inside: avoid;
}
.kdish {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 10px;
  padding: 5px 2px;
  border-bottom: 1px solid var(--line);
  break-inside: avoid;
}
.kdish .kq {
  font-size: 1.1rem;
}
.kdish .kb {
  grid-column: 1 / -1;
  font-size: 0.74rem;
  color: var(--muted);
}
.kdish .kb b {
  color: var(--text);
}
.ktotal {
  display: flex;
  justify-content: space-between;
  border-top: 2px solid var(--text);
  padding: 6px 2px;
  font-weight: 700;
  break-inside: avoid;
}
@media print {
  @page {
    margin: 10mm;
  } /* sin tamaño fijo: se puede elegir vertical u horizontal al imprimir */
  .klist {
    columns: 2;
    column-gap: 8mm;
    border: 0;
    padding: 0;
    font-size: 10px;
  }
  .kcat {
    margin-bottom: 6px;
  }
  .kcat h4 {
    background: none;
    color: #000;
    border-radius: 0;
    border-top: 2px solid #000;
    border-bottom: 1px solid #000;
    padding: 4px 2px 2px;
    font-size: 10px;
  }
  .kdish {
    padding: 2px 2px;
    border-color: #ccc;
  }
  .kdish .kq {
    font-size: 11.5px;
  }
  .kdish .kb {
    font-size: 8.5px;
    color: #444;
  }
}
@media print and (orientation: landscape) {
  .klist {
    columns: 3;
    column-gap: 7mm;
  }
  .kitchen-kpis {
    display: flex;
    gap: 14px;
    margin: 6px 0 8px !important;
  }
  .kitchen-kpis .kpi {
    border: 0;
    padding: 0;
  }
  .kitchen-kpis .kpi .v {
    font-size: 13px;
    display: inline;
  }
  .kitchen-kpis .kpi .l {
    font-size: 10px;
    display: inline;
    margin-left: 3px;
  }
  .section-head h1 {
    font-size: 18px;
  }
  table.kitchen {
    font-size: 10.5px;
  }
  table.kitchen th, table.kitchen td {
    padding: 3px 8px;
  }
  table.kitchen td.ktot {
    font-size: 12px;
  }
  /* sin fondos para ahorrar tinta: la categoría se marca con raya gruesa y mayúsculas */
  table.kitchen .cat-row td {
    background: none;
    color: #000;
    border-top: 2px solid #000;
    border-bottom: 1px solid #000;
    padding: 6px 8px 3px;
    font-size: 10.5px;
  }
  table.kitchen tr {
    break-inside: avoid;
  }
  .table-wrap {
    border-radius: 0;
  }
}

/* Móvil: dos platos por fila y tarjetas compactas */
@media (max-width: 520px) {
  .main {
    padding: 14px 12px 110px;
  }
  h1 {
    font-size: 1.7rem;
  }
  .dishes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .dish .bd {
    padding: 9px 10px 11px;
  }
  .dish .nm {
    font-size: 0.88rem;
  }
  .dish .ft {
    flex-wrap: wrap;
  }
  .dish .ft .btn {
    padding: 5px 10px;
  }
  .price {
    font-size: 1.15rem;
  }
  .user-chip .who {
    display: none;
  }
  .card {
    padding: 14px;
  }
  .topbar-in {
    gap: 6px;
    padding: 10px 10px;
  }
  .logo {
    font-size: 1.35rem;
  }
  .nav {
    gap: 2px;
  }
  .nav button {
    padding: 7px 9px;
    font-size: 0.88rem;
  }
  .nav .l-long {
    display: none;
  }
  .nav .l-short {
    display: inline;
  }
}

/* ---------- Tienda (take away) ---------- */
.store-hero {
  background: #3e4921;
  color: #fff;
}
.store-hero-in {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.store-hero .brand {
  width: 150px;
}
.store-hero h1 {
  color: #fff;
  font-size: 1.7rem;
}
.store-hero p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.store-hero .btn {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.45rem;
  margin-bottom: 10px;
}
.step span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--olive-d);
  font-family: var(--sans);
  font-size: 0.95rem;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
}
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}
.slot-grid .chip {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.slot-grid .chip:disabled {
  opacity: 0.35;
  text-decoration: line-through;
  cursor: not-allowed;
}
.store-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (max-width: 520px) {
  .store-hero-in {
    gap: 10px 14px;
    padding: 14px 16px;
  }
  .store-hero .brand {
    width: 96px;
  }
  .store-hero h1 {
    font-size: 1.25rem;
  }
  .store-user {
    flex-basis: 100%;
  }
  .store-user > span {
    margin-right: auto;
  }
}
/* Cartel con QR para imprimir */
.poster {
  background: #3e4921;
  color: #fff;
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}
.poster img.brand {
  width: 260px;
  margin: 0 auto 18px;
}
.poster h2 {
  color: #fff;
  font-size: 2.4rem;
  margin-bottom: 8px;
}
.poster p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
}
.poster .qr {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  width: 300px;
  height: 300px;
  margin: 22px auto;
  display: grid;
  place-items: center;
}
.poster .qr img, .poster .qr canvas {
  width: 264px !important;
  height: 264px !important;
}
.poster .url {
  font-family: ui-monospace, monospace;
  font-size: 1rem;
  color: var(--gold);
  word-break: break-all;
}
@media print {
  .poster {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    margin-top: 20mm;
  }
}
@media print {
  body.print-poster #app {
    display: none !important;
  }
  body.print-poster .modal-bg {
    position: static;
    background: none;
    padding: 0;
  }
  body.print-poster .modal {
    box-shadow: none;
    max-height: none;
    overflow: visible;
    background: #fff;
  }
  body.print-poster .modal-h, body.print-poster .modal-f {
    display: none;
  }
}

/* ---------- Menú semanal ---------- */
table.planner th.c, table.planner td.c {
  text-align: center;
  width: 64px;
}
table.planner td {
  vertical-align: middle;
  padding: 6px 10px;
}
table.planner input[type='checkbox'] {
  width: 20px;
  height: 20px;
  accent-color: var(--olive);
  cursor: pointer;
}
table.planner input[type='checkbox']:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
table.planner tr.cat td {
  background: var(--gold-pale);
  font-weight: 700;
  font-size: 0.8rem;
}
table.planner .org-btn {
  font-weight: 500;
  white-space: normal;
  text-align: left;
}

/* Barra de días fija al bajar por la carta */
.day-bar {
  position: sticky;
  top: 61px;
  z-index: 30;
  background: var(--cream);
  margin: 0 -8px;
  padding: 6px 8px 8px;
  border-bottom: 1px solid transparent;
}
.day-bar.store {
  top: 0;
}
.day-bar .days {
  padding-top: 2px;
}
.day.locked {
  background: repeating-linear-gradient(135deg, #fff, #fff 6px, var(--olive-pale) 6px, var(--olive-pale) 12px);
}
.day.locked .dd {
  opacity: 0.55;
}
.day.locked[aria-pressed='true'] {
  background: var(--olive-l);
}
@media (max-width: 520px) {
  .day-bar {
    top: 57px;
  }
  .day-bar .day {
    min-width: 64px;
    padding: 6px 9px;
  }
  .day-bar .day .dd {
    font-size: 1.2rem;
  }
}
.day-bar .cats-bar {
  margin-top: 6px;
  padding-bottom: 2px;
}
.day-bar .cats-bar .chip {
  padding: 5px 12px;
}
.day-bar.stuck {
  box-shadow: 0 6px 12px -10px rgba(43, 48, 31, 0.35);
}

/* Página intermedia de pago */
.pay-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.pay-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
  display: grid;
  gap: 10px;
  padding: 26px 22px;
}
.pay-card h2 {
  margin: 0;
}
.pay-logo {
  height: 44px;
  margin: 0 auto 4px;
}
.pay-amount {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 6px 0 10px;
}
.pay-wait {
  display: grid;
  gap: 8px;
  place-items: center;
  text-align: center;
  padding: 6px 0;
}

/* Protección de datos */
.consent {
  align-items: flex-start;
  line-height: 1.4;
}
.consent input {
  margin-top: 1px;
  flex: none;
}
.legal-links {
  text-align: center;
  margin: 14px 0 22px;
}
.legal-links a {
  color: inherit;
}
footer.legal-links {
  padding: 0 16px;
  line-height: 1.5;
}
footer.legal-links p {
  margin: 4px 0;
}
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  line-height: 1.6;
}
.legal-page h1 {
  margin-bottom: 4px;
}
.legal-page h2 {
  margin-top: 28px;
  font-size: 1.2rem;
}
.legal-page .pendiente {
  background: var(--gold-pale);
  padding: 0 4px;
  border-radius: 4px;
}
.legal-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.legal-page th, .legal-page td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  vertical-align: top;
}

/* Ventas: gráfico de barras apiladas (empresas + tienda) */
.sales-chart {
  position: relative;
  margin-top: 12px;
}
.sc-max {
  position: absolute;
  top: -2px;
  left: 0;
}
.sc-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 190px;
  padding-top: 18px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), var(--line) calc(25% - 1px) 25%);
  background-clip: content-box;
}
.sc-col {
  flex: 1 1 0;
  min-width: 3px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
  outline: none;
}
.sc-stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  height: 100%;
}
.sc-stack i {
  display: block;
  min-height: 2px;
}
.sc-stack i:first-child {
  border-radius: 4px 4px 0 0;
}
.sc-col.on .sc-stack, .sc-col:focus-visible .sc-stack {
  filter: brightness(1.12);
}
.sc-col.on, .sc-col:focus-visible {
  background: rgba(73, 83, 45, 0.06);
}
.sc-x {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}
.sales-chart {
  padding-bottom: 22px;
}
.sc-tip {
  position: absolute;
  top: 0;
  z-index: 2;
  background: var(--olive-d);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-line;
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: var(--sh-lg);
  pointer-events: none;
}
.sc-key {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  vertical-align: -1px;
}
