/* =====================================================================
   PUEBLER — Publicaciones: pasabordo (etiqueta y código de barras),
   menú de tres puntos, estadísticas, silenciados y postal digital.
   ===================================================================== */

/* ---------- Pasabordo: pie con etiqueta amarilla y código escaneable ---------- */
.pb-ticket-foot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px 14px; margin-top: 12px; }
.pb-ticket-pax { min-width: 0; }
.pb-ticket-pax b { display: block; font-size: .72rem; letter-spacing: .16em; }
.pb-ticket-pax small { display: block; font-size: .6rem; color: #64748B; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-ticket-label {
  justify-self: center; text-align: center; max-width: 100%;
  background: #FEF08A; color: #0B1D3A; border: 1.5px solid #0B1D3A; border-radius: 6px;
  padding: 5px 12px 6px; font-family: 'Courier New', ui-monospace, monospace; font-size: .7rem; font-weight: 800; letter-spacing: .1em; line-height: 1.2;
  transform: rotate(-1.5deg); box-shadow: 2px 2px 0 #0B1D3A;
}
.pb-ticket-label span { display: block; font-size: .6rem; font-weight: 700; letter-spacing: .02em; text-transform: none; }
.pb-ticket-id { font-size: .62rem; font-weight: 800; color: #64748B; letter-spacing: .06em; white-space: nowrap; }
.pb-ticket-code {
  display: block; width: 100%; margin-top: 12px; padding: 0; border: 1px solid #CBD5E1; border-radius: 10px; background: #FFFFFF;
  cursor: zoom-in; overflow: hidden; text-align: center; color: #0B1D3A;
}
.pb-ticket-code:hover { border-color: #0B1D3A; }
.pb-ticket-code:focus-visible { outline: 3px solid var(--puebler-blue); outline-offset: 2px; }
.pb-ticket-code .pp-barcode { display: block; width: 100%; height: auto; min-height: 70px; }
.pb-ticket-code-hint { display: block; padding: 4px 8px 6px; font-size: .66rem; font-weight: 700; color: #64748B; border-top: 1px dashed #E2E8F0; }
@media (max-width: 575px) {
  .pb-ticket-foot { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pb-ticket-label { justify-self: start; transform: rotate(-1deg); }
}

/* ---------- Diálogos: embeber y código ampliado ---------- */
.ps-embed { text-align: left; }
.ps-embed-help { font-size: .88rem; color: var(--puebler-text-muted); margin: 0 0 10px; }
.ps-embed-code { width: 100%; font-family: ui-monospace, 'Courier New', monospace; font-size: .78rem; resize: none; }
.ps-embed-label { font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--puebler-text-muted); margin: 14px 0 6px; }
.ps-embed-preview { width: 100%; height: 360px; border: 1px solid var(--puebler-border); border-radius: 12px; background: var(--puebler-surface-2); }
.ps-barcode-big { background: #FFFFFF; border-radius: 12px; padding: 6px; border: 1px solid #E2E8F0; }
.ps-barcode-big svg { width: 100%; height: auto; display: block; }
.ps-barcode-url { margin: 10px 0 0; font-family: ui-monospace, monospace; font-size: .85rem; word-break: break-all; }

/* ---------- Publicación oculta / autor silenciado ---------- */
.pb-post.is-collapsed { padding-top: 12px; padding-bottom: 12px; }
.ps-collapsed { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9rem; color: var(--puebler-text-muted); }
.ps-collapsed > i { font-size: 1.1rem; }
.ps-collapsed > span:first-of-type { flex: 1 1 220px; }
.ps-collapsed-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.ps-undo { border: 0; background: none; padding: 0; color: var(--puebler-blue-dark); font-weight: 700; font-size: .88rem; }
.ps-undo:hover { text-decoration: underline; }
.ps-muted li { padding: 12px 0; border-bottom: 1px solid var(--puebler-border-soft); transition: opacity .25s ease; }
.ps-muted li.is-leaving { opacity: 0; }

/* ---------- Estadísticas ---------- */
.ps-stats { background: var(--puebler-surface); min-height: calc(100vh - var(--topbar-h)); }
.ps-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding: 26px 28px 18px; border-bottom: 1px solid var(--puebler-border); }
.ps-head .pb-page-title { overflow-wrap: anywhere; }
.ps-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-bottom: 1px solid var(--puebler-border); }
.ps-kpi { padding: 18px 22px; border-right: 1px solid var(--puebler-border); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ps-kpi:last-child { border-right: 0; }
.ps-kpi i { color: var(--puebler-blue); font-size: 1.1rem; }
.ps-kpi strong { font-family: var(--font-heading); font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.ps-kpi span { font-size: .72rem; color: var(--puebler-text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ps-block { padding: 22px 28px; border-bottom: 1px solid var(--puebler-border); border-right: 1px solid var(--puebler-border); min-width: 0; }
.ps-block:nth-child(3n + 1):not(.ps-wide), .ps-block:last-child { border-right: 0; }
.ps-wide { grid-column: 1 / -1; border-right: 0; }
.ps-block h2 { font-size: 1rem; font-weight: 800; margin: 0 0 12px; }
.ps-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; font-weight: 600; color: var(--puebler-text-muted); margin-bottom: 10px; }
.ps-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.ps-chart-wrap { width: 100%; overflow: hidden; }
.ps-chart { width: 100%; max-width: 1000px; height: auto; display: block; color: var(--puebler-text); }
.ps-rows { list-style: none; padding: 0; margin: 0; }
.ps-rows li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--puebler-border-soft); font-size: .9rem; }
.ps-rows li > i, .ps-rows li > svg { width: 20px; text-align: center; color: var(--puebler-text-muted); flex-shrink: 0; }
.ps-rows li span { flex: 1; min-width: 0; }
.ps-src { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; font-size: .86rem; font-weight: 600; margin-bottom: 10px; }
.ps-src .pb-progress { grid-column: span 2; height: 6px; }
.ps-hours { width: 100%; height: auto; color: var(--puebler-text); }
.ps-note { padding: 16px 28px 30px; margin: 0; font-size: .8rem; color: var(--puebler-text-muted); }
.ps-table-wrap { overflow-x: auto; }
.ps-table { width: 100%; min-width: 760px; margin: 0; }
.ps-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--puebler-text-muted); white-space: nowrap; padding: 12px 14px; }
.ps-table td { padding: 12px 14px; vertical-align: middle; border-top: 1px solid var(--puebler-border-soft); }
.ps-table th:first-child, .ps-table td:first-child { padding-left: 28px; }
.ps-table th:last-child, .ps-table td:last-child { padding-right: 28px; }
.ps-post-cell { display: flex; gap: 10px; align-items: center; color: var(--puebler-text); min-width: 240px; max-width: 460px; }
.ps-post-cell span { display: flex; flex-direction: column; min-width: 0; }
.ps-post-cell strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.ps-post-cell small { color: var(--puebler-text-muted); font-size: .78rem; }
@media (max-width: 991px) {
  .ps-grid { grid-template-columns: 1fr; }
  .ps-block { border-right: 0; }
}
@media (max-width: 767px) {
  .ps-head, .ps-block { padding-left: 14px; padding-right: 14px; }
  .ps-note { padding: 14px; }
  .ps-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-kpi { padding: 14px; border-bottom: 1px solid var(--puebler-border); }
  .ps-kpi:nth-child(2n) { border-right: 0; }
  .ps-kpi strong { font-size: 1.4rem; }
  .ps-table th:first-child, .ps-table td:first-child { padding-left: 14px; }
}

/* ---------- Postal digital ---------- */
.pc-page { background: var(--puebler-surface); min-height: calc(100vh - var(--topbar-h)); padding: 22px 28px 40px; }
.pc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 18px; }
.pc-title { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 800; margin: 0 0 4px; overflow-wrap: anywhere; }
.pc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.pc-stage { position: relative; min-width: 0; }
.pc-canvas {
  display: block; width: min(100%, calc((100dvh - var(--topbar-h) - 150px) * 1.5)); height: auto; aspect-ratio: 3 / 2; margin: 0 auto;
  border-radius: 6px; box-shadow: 0 18px 40px rgba(20, 30, 50, .18); background: #F7F1E3;
}
.pc-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; color: var(--puebler-text-muted); background: #F7F1E3; border-radius: 6px; }
.pc-loading[hidden] { display: none; }
.pc-panel { display: flex; flex-direction: column; gap: 16px; }
.pc-field label { display: flex; justify-content: space-between; font-weight: 800; font-size: .9rem; margin-bottom: 6px; }
.pc-field textarea { resize: vertical; }
.pc-actions { display: flex; flex-direction: column; gap: 10px; }
.pc-actions .pb-btn { justify-content: center; }
.pc-note { font-size: .8rem; color: var(--puebler-text-muted); margin: 0; }
@media (max-width: 1100px) {
  .pc-layout { grid-template-columns: 1fr; }
  .pc-canvas { width: 100%; }
  .pc-panel { max-width: 640px; }
}
@media (max-width: 767px) {
  .pc-page { padding: 16px 14px 32px; }
  .pc-title { font-size: 1.35rem; }
  .pc-layout { gap: 18px; }
}

/* Código ampliado: en escritorio ocupa casi todo el ancho; en vertical se gira para usar el alto. */
.pb-swal.ps-swal-code { width: min(1100px, 96vw) !important; max-width: 96vw; }
.ps-barcode-big.is-rotated { height: min(62dvh, 620px); width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0; }
.ps-barcode-big.is-rotated svg { flex-shrink: 0; transform: rotate(90deg); }
.pb-swal.ps-swal-embed { width: min(640px, 96vw) !important; }
