/* ====== EL TICKET ====== */
.ticket {
  --ticket-w: 340px;
  width: var(--ticket-w);
  background: var(--paper);
  color: #000;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  font-family: var(--ui);
}

.t-slogan {
  margin: 0;
  text-align: center;
  font-family: "Segoe Script", "Bradley Hand", "Brush Script MT", cursive;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 600;
}
.t-date { margin: 2px 0 14px; text-align: center; font-style: italic; color: #555; font-size: 13px; }

.t-meta { font-size: 14px; margin-bottom: 8px; }
.t-meta__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.t-meta__row span { font-weight: 700; }
.t-meta__row b {
  font-weight: 600;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  word-break: break-word;
}
.t-estado { margin-top: 8px; text-align: center; font-size: 13.5px; }

.t-table { width: 100%; border-collapse: collapse; margin: 10px 0 0; font-size: 13.5px; }
.t-table th {
  background: var(--sage);
  color: #1f2a10;
  font-weight: 700;
  text-align: center;
  padding: 7px 6px;
  border: 1px solid var(--sage-deep);
}
.t-table td {
  text-align: center;
  padding: 5px 6px;
  border-bottom: 1px solid #eee;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.t-table .num { text-align: right; }
.t-table tbody tr:last-child td { border-bottom: 0; }

.t-totals, .t-soles { width: 100%; border-collapse: collapse; font-size: 14px; }
.t-totals { margin-top: 8px; border-top: 2px solid #000; }
.t-totals td { padding: 5px 6px; }
.t-totals td:nth-child(1) { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; }
.t-totals td:nth-child(2) { font-weight: 700; }
.t-totals .cur { text-align: center; color: #333; }
.t-totals .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.t-totals__line td { border-top: 1px solid #bbb; padding-top: 7px; }

.t-soles { margin-top: 6px; }
.t-soles td { padding: 6px; border: 1px solid #ccc; }
.t-soles td:first-child { font-weight: 700; }
.t-soles .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.t-soles__total td { background: #f3f4ee; border-color: #999; font-size: 15px; }

/* ====== Liquidación dinámica ====== */
.t-liq { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.t-liq td { padding: 5px 6px; }
.t-liq .lq-c { font-weight: 600; }
.t-liq .lq-u, .t-liq .lq-s { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.t-liq .lq-s { padding-left: 10px; }
.t-liq__total td { border-top: 2px solid #000; font-weight: 700; }
.t-liq__total .lq-c { font-weight: 700; }
.t-liq__line td { border-top: 1px solid #bbb; padding-top: 7px; }
.t-liq__line .lq-c, .t-liq__line .lq-u { font-weight: 700; }
.t-liq__soles td { background: #f3f4ee; border-top: 1px solid #999; font-size: 15px; }
.t-liq__soles .lq-c, .t-liq__soles .lq-s { font-weight: 700; }

/* ====== IMPRESIÓN ====== */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .layout { display: block; max-width: none; padding: 0; margin: 0; }
  .preview { position: static; display: block; }
  .ticket {
    --ticket-w: 100%;
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
  /* En A4 limitamos el ancho para que parezca un ticket */
  body[data-print="a4"] .ticket { max-width: 84mm; }
}
