/* ==========================================================================
   KAVORA · Demo «Recepción de pedidos»
   Estilos propios de la página (usa las variables de ../styles.css).
   ========================================================================== */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Tokens locales de la app */
.pd-app, .pd-hero {
  --pd-amber: #E0A84F;
  --pd-amber-text: #F2CC8A;
  --pd-red-text: #F4B9BC;
  --pd-panel: #111D21;
  --pd-panel-2: #18262B;
  --pd-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* ---------- Hero ---------- */
.pd-demo-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 7px 14px;
  border: 1px solid rgba(95, 197, 174, 0.55);
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--marfil);
  background: rgba(95, 197, 174, 0.08);
}
.pd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--jade); flex-shrink: 0; }
.pd-hero h1 { max-width: 24ch; }
.pd-principle {
  margin: 28px 0 36px;
  padding: 16px 0 16px 20px;
  border-left: 2px solid var(--jade-logo);
  max-width: 62ch;
  font-size: 1.125rem;
  color: rgba(246, 245, 240, 0.9) !important;
}
.pd-principle strong { color: var(--jade); font-weight: 600; }

/* ---------- Cómo funciona ---------- */
.pd-how {
  background: var(--grafito);
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
  padding-block: clamp(36px, 5vw, 56px);
}
.pd-how-title {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--jade);
  margin-bottom: 24px;
}
.pd-how-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.pd-how-steps li { padding: 4px 24px 4px 0; position: relative; }
.pd-how-steps li + li { padding-left: 24px; border-left: 1px solid var(--line-dark); }
.pd-how-num {
  display: block;
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--jade);
  margin-bottom: 10px;
}
.pd-how-steps h3 { font-size: 1.0625rem; margin-bottom: 6px; }
.pd-how-steps p { font-size: 0.9375rem; color: rgba(246, 245, 240, 0.76); margin: 0; }

@media (max-width: 900px) {
  .pd-how-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .pd-how-steps li:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 560px) {
  .pd-how-steps { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .pd-how-steps li, .pd-how-steps li + li { padding: 18px 0; border-left: 0; }
  .pd-how-steps li + li { border-top: 1px solid var(--line-dark); }
}

/* ---------- Sección demo ---------- */
.pd-demo-section { padding-top: clamp(56px, 8vw, 104px); }
.pd-demo-head { margin-bottom: clamp(28px, 4vw, 48px); }

/* ---------- Marco de la app ---------- */
.pd-app {
  border: 1px solid var(--line-dark);
  background: var(--grafito);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.32);
  color: var(--marfil);
  font-size: 0.9875rem;
}
.pd-app p { color: inherit; }

.pd-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--pd-panel);
  border-bottom: 1px solid var(--line-dark);
}
.pd-appbar-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.pd-appbar-title img { width: 22px; height: auto; }
.pd-appbar-title > span:first-of-type {
  font-family: var(--font-head);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pd-chip-demo {
  font-family: var(--font-head);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pd-amber-text);
  border: 1px solid rgba(224, 168, 79, 0.5);
  padding: 3px 8px;
  border-radius: 2px;
}

.pd-app-body {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  min-height: 560px;
}

/* ---------- Botones de la app ---------- */
.pd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-head);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
}
.pd-btn svg { width: 18px; height: 18px; }
.pd-btn-primary { background: var(--jade-deep); color: var(--marfil); }
.pd-btn-primary:hover:not(:disabled) { background: var(--jade-text); }
.pd-btn-primary:disabled {
  background: transparent;
  border-color: var(--line-dark);
  color: rgba(246, 245, 240, 0.5);
  cursor: not-allowed;
}
.pd-btn-ghost { border-color: rgba(246, 245, 240, 0.45); color: var(--marfil); background: transparent; }
.pd-btn-ghost:hover { border-color: var(--marfil); background: rgba(246, 245, 240, 0.06); }
.pd-btn-quiet {
  min-height: 40px;
  padding: 8px 14px;
  background: transparent;
  color: rgba(246, 245, 240, 0.86);
  border-color: var(--line-dark);
  font-weight: 500;
}
.pd-btn-quiet:hover { border-color: rgba(95, 197, 174, 0.6); color: var(--marfil); }

/* ---------- Bandeja ---------- */
.pd-inbox {
  background: var(--pd-panel);
  border-right: 1px solid var(--line-dark);
  padding: 18px 0 16px;
  display: flex;
  flex-direction: column;
}
.pd-inbox-title {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--acero-claro);
}
.pd-count {
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: rgba(95, 197, 174, 0.16);
  color: var(--jade);
  font-size: 0.75rem;
  letter-spacing: 0;
}
.pd-inbox-list { list-style: none; margin: 0; padding: 0; }
.pd-inbox-item {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas: "icon text" "icon state";
  gap: 4px 12px;
  text-align: left;
  padding: 14px 18px;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--line-dark);
  color: var(--marfil);
  font: inherit;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.pd-inbox-list li:first-child .pd-inbox-item { border-top: 1px solid var(--line-dark); }
.pd-inbox-item:hover { background: rgba(246, 245, 240, 0.03); }
.pd-inbox-item.is-selected { background: rgba(95, 197, 174, 0.08); border-left-color: var(--jade); }
.pd-inbox-item:focus-visible { outline-offset: -3px; }
.pd-inbox-icon {
  grid-area: icon;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  color: var(--jade);
}
.pd-inbox-icon svg { width: 18px; height: 18px; }
.pd-inbox-text { grid-area: text; display: flex; flex-direction: column; min-width: 0; }
.pd-inbox-from { font-family: var(--font-head); font-size: 0.8125rem; font-weight: 600; line-height: 1.3; }
.pd-inbox-subject {
  font-size: 0.875rem; color: rgba(246, 245, 240, 0.78);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pd-inbox-meta { display: flex; gap: 8px; align-items: center; font-size: 0.75rem; color: var(--acero-claro); margin-top: 2px; }
.pd-kind {
  font-family: var(--font-head);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid var(--line-dark);
  border-radius: 2px;
  color: var(--acero-claro);
}
.pd-inbox-state {
  grid-area: state;
  justify-self: start;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--acero-claro);
}
.pd-inbox-state::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin-right: 6px; vertical-align: 1px;
}
.pd-inbox-state.is-preview { color: var(--marfil); }
.pd-inbox-state.is-processing, .pd-inbox-state.is-review { color: var(--pd-amber-text); }
.pd-inbox-state.is-done { color: var(--jade); }
.pd-inbox-note { margin: auto 0 0; padding: 18px 18px 0; font-size: 0.8125rem; color: var(--acero-claro) !important; }

/* ---------- Panel principal ---------- */
.pd-main { container-type: inline-size; container-name: pdmain; min-width: 0; }
.pd-main-inner { padding: clamp(18px, 3vw, 32px); }

.pd-stage-head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line-dark); }
.pd-stage-eyebrow {
  font-family: var(--font-head);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--jade);
  margin: 0 0 6px;
}
.pd-stage-title { font-size: clamp(1.25rem, 2.4vw, 1.625rem); margin: 0 0 8px; overflow-wrap: anywhere; }
.pd-stage-title:focus { outline: none; }
.pd-stage-title:focus-visible { outline: 2px solid var(--jade); outline-offset: 4px; }
.pd-stage-meta { overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; font-size: 0.875rem; color: var(--acero-claro) !important; }

.pd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 24px; }
.pd-actions-tight { margin-top: 18px; }
.pd-hint { margin: 0; font-size: 0.875rem; color: var(--acero-claro) !important; }

/* ---------- Documentos originales ---------- */
.pd-original { color: var(--ink); }
.pd-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.pd-scroll:focus-visible { outline-offset: 2px; }

.pd-mail {
  background: var(--marfil);
  border-radius: var(--radius);
  max-width: 680px;
  overflow: hidden;
}
.pd-mail-head {
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-light);
  background: #FBFAF6;
  font-size: 0.875rem;
}
.pd-mail-head div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; padding: 2px 0; }
.pd-mail-head dt { color: var(--acero-text); font-weight: 600; }
.pd-mail-head dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.pd-mail-body {
  padding: 20px;
  white-space: pre-line;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.pd-file-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--pd-panel);
  border: 1px solid var(--line-dark);
  border-bottom: 0;
  font-size: 0.8125rem;
  color: var(--acero-claro);
}
.pd-file-bar svg { width: 16px; height: 16px; color: var(--jade); flex-shrink: 0; }
.pd-file-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pd-sheet-wrap .pd-scroll { background: #2A383D; padding: clamp(12px, 3vw, 28px); border: 1px solid var(--line-dark); }
.pd-sheet {
  background: #FFFFFF;
  color: #1E2A2E;
  min-width: 560px;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 30px 22px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.pd-sheet p { margin: 0; color: #1E2A2E; }
.pd-sheet-top { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 2px solid #1E2A2E; }
.pd-sheet-company { font-family: var(--font-head); font-weight: 700; font-size: 1rem; letter-spacing: 0.04em; }
.pd-sheet-title { font-family: var(--font-head); font-weight: 700; letter-spacing: 0.08em; text-align: right; }
.pd-sheet-doc .pd-sheet-small { text-align: right; }
.pd-sheet-small { font-size: 0.75rem; color: #56676D !important; }
.pd-sheet-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 0; }
.pd-sheet-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.pd-sheet-table th { text-align: left; background: #EEF0EE; font-weight: 600; padding: 6px 8px; border: 1px solid #CDD3D3; }
.pd-sheet-table td { padding: 6px 8px; border: 1px solid #DDE1E1; vertical-align: top; }
.pd-sheet-table .num { text-align: right; white-space: nowrap; }
.pd-sheet-table tfoot td { font-weight: 600; background: #F6F7F6; }
.pd-sheet-table tfoot td:first-child { text-align: right; }
.pd-sheet-foot { margin-top: 12px !important; }

.pd-xls-formula {
  display: flex; gap: 12px; align-items: center;
  padding: 6px 12px;
  background: #F4F4F1;
  border: 1px solid var(--line-dark);
  border-bottom: 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.pd-xls-formula span:first-child { font-style: italic; color: var(--acero-text); padding-right: 12px; border-right: 1px solid #D6D6D0; }
.pd-xls-wrap .pd-scroll { background: #FFFFFF; border: 1px solid var(--line-dark); }
.pd-xls { border-collapse: collapse; min-width: 560px; width: 100%; font-size: 0.8125rem; color: #1E2A2E; font-family: var(--font-body); }
.pd-xls td, .pd-xls th { border: 1px solid #DCDCD6; padding: 5px 10px; white-space: nowrap; text-align: left; font-weight: 400; }
.pd-xls .pd-xls-letter { background: #EFEFEA; color: #56676D; text-align: center; font-size: 0.75rem; }
.pd-xls .pd-xls-row { background: #EFEFEA; color: #56676D; text-align: center; width: 38px; font-size: 0.75rem; }
.pd-xls .pd-xls-head td { font-weight: 600; background: #E4F2EE; }
.pd-xls .num { text-align: right; }

/* ---------- Pipeline ---------- */
.pd-pipeline { padding-top: 4px; }
.pd-steps {
  list-style: none; margin: 0 0 24px; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.pd-step {
  position: relative;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  color: rgba(246, 245, 240, 0.55);
  transition: border-color .3s ease, color .3s ease, background-color .3s ease;
}
.pd-step-num {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 0.8125rem; font-weight: 600;
  position: relative;
}
.pd-step-num svg { width: 16px; height: 16px; display: none; }
.pd-step-text { display: flex; flex-direction: column; min-width: 0; }
.pd-step-title { font-family: var(--font-head); font-size: 0.8125rem; font-weight: 600; line-height: 1.3; }
.pd-step-sub { font-size: 0.8125rem; color: var(--acero-claro); }
.pd-step.is-active { border-color: rgba(95, 197, 174, 0.7); color: var(--marfil); background: rgba(95, 197, 174, 0.06); }
.pd-step.is-active .pd-step-num { border-color: var(--jade); color: var(--jade); }
.pd-step.is-active .pd-step-num::after {
  content: ""; position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: var(--jade);
  animation: pdSpin 1s linear infinite;
}
.pd-step.is-done { color: var(--marfil); border-color: rgba(95, 197, 174, 0.35); }
.pd-step.is-done .pd-step-num { background: var(--jade-deep); border-color: var(--jade-deep); color: var(--marfil); }
.pd-step.is-done .pd-step-n { display: none; }
.pd-step.is-done .pd-step-num svg { display: block; }
@keyframes pdSpin { to { transform: rotate(360deg); } }

.pd-progress-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pd-progress { flex: 1; height: 4px; background: rgba(246, 245, 240, 0.1); border-radius: 2px; overflow: hidden; }
.pd-progress-fill { height: 100%; width: 0; background: var(--jade); transition: width .35s ease; }
.pd-progress-pct { font-family: var(--font-head); font-size: 0.8125rem; font-weight: 600; color: var(--jade); min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }

.pd-log {
  list-style: none; margin: 0; padding: 14px 16px;
  min-height: 180px;
  background: var(--grafito-deep);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  font-family: var(--pd-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: rgba(246, 245, 240, 0.82);
}
.pd-log-line { display: flex; gap: 10px; animation: pdFade .35s ease both; }
.pd-log-line.is-final { color: var(--jade); }
.pd-log-mark { color: var(--jade); flex-shrink: 0; }
@keyframes pdFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Revisión ---------- */
.pd-fields {
  margin: 0 0 20px;
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-dark);
  border-left: 1px solid var(--line-dark);
}
.pd-fields div {
  flex: 1 1 190px;
  min-width: 0;
  padding: 10px 14px;
  border-right: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}
.pd-fields dt { font-family: var(--font-head); font-size: 0.625rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--acero-claro); }
.pd-fields dd { margin: 2px 0 0; font-size: 0.875rem; line-height: 1.4; }

.pd-callout {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 0 18px;
  padding: 12px 16px;
  border-left: 2px solid var(--jade);
  background: rgba(95, 197, 174, 0.07);
  font-size: 0.9375rem;
}
.pd-callout svg { width: 18px; height: 18px; color: var(--jade); flex-shrink: 0; margin-top: 3px; }
.pd-callout strong { color: var(--jade); font-weight: 600; }

.pd-orig-details { margin-bottom: 20px; border: 1px solid var(--line-dark); border-radius: var(--radius); }
.pd-orig-details summary {
  cursor: pointer;
  padding: 10px 14px;
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--marfil);
  list-style-position: inside;
}
.pd-orig-details summary:hover { color: var(--jade); }
.pd-orig-details[open] summary { border-bottom: 1px solid var(--line-dark); }
.pd-orig-details .pd-original { padding: 14px; }

.pd-n { font-family: var(--font-head); font-size: 0.8125rem; font-weight: 600; color: var(--jade); }

.pd-qty {
  font: inherit;
  font-size: 0.875rem;
  color: var(--marfil);
  background: var(--grafito-deep);
  border: 1px solid rgba(246, 245, 240, 0.28);
  border-radius: var(--radius);
  min-height: 40px;
}
.pd-qty { width: 72px; padding: 8px 10px; text-align: right; font-variant-numeric: tabular-nums; }
.pd-qty:hover { border-color: rgba(95, 197, 174, 0.6); }
.pd-qty:focus-visible { outline: 2px solid var(--jade); outline-offset: 1px; border-color: var(--jade); }
.pd-qty:disabled { opacity: 0.6; cursor: not-allowed; }
.pd-qty[aria-invalid="true"] { border-color: #E07A7F; }
.pd-field-error { display: block; margin-top: 4px; font-size: 0.75rem; color: var(--pd-red-text); max-width: 14ch; }
.pd-field-error[hidden] { display: none; }
.pd-sku-desc { display: block; font-size: 0.8125rem; color: rgba(246, 245, 240, 0.78); margin-top: 5px; line-height: 1.35; }
.pd-sku-desc.is-empty { color: var(--pd-red-text); }
.pd-unit { display: block; font-size: 0.8125rem; color: rgba(246, 245, 240, 0.78); margin-top: 5px; line-height: 1.3; }
.pd-price { display: block; white-space: nowrap; padding-top: 9px; font-variant-numeric: tabular-nums; }
.pd-sub { display: block; font-size: 0.75rem; color: var(--acero-claro); white-space: nowrap; }

.pd-conf {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.pd-conf.is-high { color: var(--jade); }
.pd-conf.is-mid { color: var(--pd-amber-text); }
.pd-conf.is-low { color: var(--pd-amber-text); border-style: dashed; }
.pd-conf.is-none { color: var(--pd-red-text); }
.pd-conf.is-manual { color: var(--marfil); border-color: rgba(246, 245, 240, 0.45); }

.pd-ex-label { display: inline-flex; align-items: center; gap: 8px; padding-top: 8px; cursor: pointer; font-size: 0.8125rem; color: rgba(246, 245, 240, 0.8); }
.pd-ex { width: 18px; height: 18px; accent-color: var(--jade-deep); margin: 0; cursor: pointer; }
.pd-ex-label span { display: none; }

/* Alertas */
.pd-alerts { display: flex; flex-direction: column; gap: 8px; }
.pd-note-ok { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.8125rem; color: var(--acero-claro) !important; }
.pd-note-ok svg { width: 15px; height: 15px; color: var(--jade); flex-shrink: 0; }
.pd-alert {
  border: 1px solid rgba(224, 168, 79, 0.42);
  border-left: 3px solid var(--pd-amber);
  background: rgba(224, 168, 79, 0.07);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.pd-alert.is-unknown { border-color: rgba(179, 40, 47, 0.6); border-left-color: var(--bermellon); background: rgba(179, 40, 47, 0.12); }
.pd-alert.is-resolved { border-color: rgba(95, 197, 174, 0.3); border-left-color: var(--jade); background: rgba(95, 197, 174, 0.05); }
.pd-alert p { margin: 0; }
.pd-alert-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.pd-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--pd-amber-text);
}
.pd-chip svg { width: 15px; height: 15px; flex-shrink: 0; }
.pd-alert.is-unknown .pd-chip { color: var(--pd-red-text); }
.pd-alert.is-resolved .pd-chip { color: var(--jade); }
.pd-alert-state { font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--acero-claro); }
.pd-alert-detail { font-size: 0.8125rem; color: rgba(246, 245, 240, 0.8) !important; margin-top: 4px !important; }
.pd-alert-hint { font-size: 0.8125rem; margin-top: 6px !important; color: var(--marfil) !important; }
.pd-alert-hint label { color: var(--jade); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.pd-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pd-opt {
  font: inherit;
  font-size: 0.8125rem;
  min-height: 36px;
  padding: 6px 12px;
  background: transparent;
  color: var(--marfil);
  border: 1px solid rgba(246, 245, 240, 0.32);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: border-color .2s ease, background-color .2s ease;
}
.pd-opt:hover { border-color: var(--jade); }
.pd-opt.is-on { background: rgba(95, 197, 174, 0.16); border-color: var(--jade); }
.pd-opt.is-on::before { content: "✓ "; color: var(--jade); }

/* Duda como pregunta + respuestas grandes */
.pd-app .pd-question { margin: 10px 0 0 !important; font-family: var(--font-head); font-size: 0.9375rem; font-weight: 700; line-height: 1.35; color: var(--marfil); }
.pd-answers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pd-answer {
  font: inherit; font-size: 0.9375rem; font-weight: 600; line-height: 1.25;
  min-height: 48px; min-width: 96px; padding: 10px 18px;
  color: var(--marfil); background: transparent;
  border: 2px solid rgba(246, 245, 240, 0.4); border-radius: var(--radius);
  cursor: pointer; text-align: center;
  transition: border-color .2s ease, background-color .2s ease;
}
.pd-answer:hover { border-color: var(--jade); background: rgba(95, 197, 174, 0.1); }
.pd-answer.is-rec { background: var(--jade); border-color: var(--jade); color: var(--ink, #0D1618); }
.pd-answer.is-rec:hover { background: #79d3bf; }
.pd-answer.is-on { box-shadow: 0 0 0 3px rgba(95, 197, 174, 0.35); border-color: var(--jade); }
.pd-answer.is-on::before { content: "✓ "; }
.pd-answer:focus-visible, .pd-change:focus-visible { outline: 2px solid var(--marfil); outline-offset: 2px; }
.pd-alert.is-collapsed { padding: 4px 4px 4px 12px; }
.pd-app .pd-done { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 !important; font-size: 0.875rem; color: var(--marfil) !important; }
.pd-done svg { width: 16px; height: 16px; color: var(--jade); flex-shrink: 0; }
.pd-done-t { flex: 1 1 200px; }
.pd-done strong { color: var(--jade); font-weight: 600; }
.pd-change {
  font: inherit; font-size: 0.8125rem; font-weight: 600;
  min-height: 44px; padding: 6px 14px;
  color: var(--jade); background: transparent; border: 0; border-radius: var(--radius);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.pd-change:hover { background: rgba(95, 197, 174, 0.1); }
.pd-alert.is-collapsed .pd-ask-answer { margin: 2px 0 8px !important; }
@media (max-width: 560px) {
  .pd-answer { flex: 1 1 calc(50% - 4px); }
}

/* Barra de aprobación */
.pd-approve-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 20px;
  margin: 22px calc(-1 * clamp(18px, 3vw, 32px)) calc(-1 * clamp(18px, 3vw, 32px));
  padding: 14px clamp(18px, 3vw, 32px);
  background: rgba(17, 29, 33, 0.97);
  border-top: 1px solid var(--line-dark);
}
.pd-approve-info { min-width: 0; }
.pd-pending { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.9375rem; font-weight: 600; }
.pd-pending svg { width: 17px; height: 17px; flex-shrink: 0; }
.pd-pending.is-open { color: var(--pd-amber-text) !important; }
.pd-pending.is-ok { color: var(--jade) !important; }
.pd-total { margin: 2px 0 0; font-size: 0.875rem; color: var(--acero-claro) !important; font-variant-numeric: tabular-nums; }

/* ---------- Resumen ---------- */
.pd-kpis {
  list-style: none; margin: 0 0 24px; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-dark);
  border: 1px solid var(--line-dark);
}
.pd-kpis li { background: var(--grafito); padding: 16px; }
.pd-kpis strong { display: block; font-family: var(--font-head); font-size: clamp(1.125rem, 2.2vw, 1.5rem); font-weight: 600; color: var(--jade); line-height: 1.15; margin-bottom: 4px; overflow-wrap: anywhere; }
.pd-kpis span { display: block; font-size: 0.8125rem; color: rgba(246, 245, 240, 0.78); }
.pd-kpis em { display: block; margin-top: 4px; font-style: normal; font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pd-amber-text); }

.pd-final-wrap { border: 1px solid var(--line-dark); }
.pd-final { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 0.875rem; }
.pd-final th { text-align: left; font-family: var(--font-head); font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--acero-claro); padding: 10px 12px; border-bottom: 1px solid var(--line-dark); font-weight: 600; }
.pd-final td { padding: 9px 12px; border-bottom: 1px solid var(--line-dark); vertical-align: top; }
.pd-final tr:last-child td { border-bottom: 0; }
.pd-final .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* En pantallas angostas cada línea aprobada pasa a ser una tarjeta compacta
   (SKU + subtotal, producto, cantidad y unidad) en lugar de una tabla con scroll lateral */
@media (max-width: 560px) {
  .pd-final { min-width: 0; }
  .pd-final thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pd-final, .pd-final tbody { display: block; width: 100%; }
  .pd-final tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 8px; align-items: baseline;
    padding: 10px 12px; border-bottom: 1px solid var(--line-dark);
  }
  .pd-final tbody tr:last-child { border-bottom: 0; }
  .pd-final td { display: block; padding: 0; border: 0; }
  .pd-final td:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
  .pd-final td:nth-child(5) { grid-column: 3; grid-row: 1; }
  .pd-final td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; margin: 2px 0; }
  .pd-final td:nth-child(3) { grid-column: 1; grid-row: 3; text-align: left; color: var(--acero-claro); }
  .pd-final td:nth-child(4) { grid-column: 2 / -1; grid-row: 3; color: var(--acero-claro); }
  .pd-final-wrap { overflow: visible; }
}
.pd-mono { font-family: var(--pd-mono); font-size: 0.8125rem; white-space: nowrap; color: var(--jade); }

.pd-exlog { margin-top: 22px; padding: 16px 18px; border: 1px solid var(--line-dark); background: var(--pd-panel); }
.pd-exlog h4 { font-family: var(--font-head); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--acero-claro); margin: 0 0 10px; }
.pd-exlog ul { margin: 0 0 10px; padding-left: 18px; font-size: 0.875rem; }
.pd-exlog li { margin-bottom: 4px; }
.pd-export-note { margin: 18px 0 0; font-size: 0.875rem; color: rgba(246, 245, 240, 0.78) !important; max-width: 72ch; }
.pd-export-note strong { color: var(--marfil); }

/* ---------- Estado y notas bajo la app ---------- */
.pd-status { margin: 14px 0 0; min-height: 1.5em; font-size: 0.875rem; color: var(--jade) !important; }
.pd-honesty { margin-top: 6px; max-width: 80ch; }

/* ---------- Qué incluye ---------- */
.pd-includes {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 0 clamp(20px, 3vw, 36px);
}
.pd-includes li { padding: 22px 0; border-top: 1px solid var(--line-light); }
.pd-inc-num { display: block; font-family: var(--font-head); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.1em; color: var(--jade-text); margin-bottom: 12px; }
.pd-includes h3 { font-size: 1.0625rem; color: var(--ink); margin-bottom: 8px; }
.pd-includes p { font-size: 0.9375rem; margin: 0; }

/* ==========================================================================
   Responsive de la app
   ========================================================================== */
@media (max-width: 900px) {
  .pd-app-body { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .pd-inbox { border-right: 0; border-bottom: 1px solid var(--line-dark); padding-bottom: 12px; }
  .pd-inbox-note { padding-top: 12px; }
}

/* El panel principal se adapta a su propio ancho (container queries) */
@container pdmain (max-width: 760px) {
  .pd-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-sheet-meta { grid-template-columns: minmax(0, 1fr); gap: 2px; }

}

@container pdmain (max-width: 440px) {
  .pd-steps { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pd-step { padding: 10px 12px; }
  .pd-kpis { grid-template-columns: minmax(0, 1fr); }
  .pd-approve-bar .pd-btn { width: 100%; }
  .pd-actions .pd-btn { width: 100%; }
  .pd-mail-head div { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 3px 0; }
  .pd-mail-body, .pd-mail-head { padding-inline: 14px; }
}

@media (max-width: 420px) {
  .pd-appbar { padding: 10px 12px; }
  .pd-appbar .pd-btn-quiet { padding-inline: 10px; }
  .pd-inbox-item { padding: 12px 14px; }
  .pd-inbox-title, .pd-inbox-note { padding-inline: 14px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .pd-step.is-active .pd-step-num::after { animation: none; border-color: var(--jade); }
  .pd-log-line { animation: none; }
  .pd-progress-fill { transition: none; }
}

/* ---------- Impresión ---------- */
@media print {
  .pd-app { box-shadow: none; }
  .pd-approve-bar { position: static; }
}

/* ==========================================================================
   WhatsApp + persona en el circuito (v2)
   ========================================================================== */
.pd-app, .pd-hero, .pd-how {
  --pd-wa-out: #0B5F52;
  --pd-wa-bg: #0F1B1E;
  --pd-hl: rgba(224, 168, 79, 0.34);
  --pd-hand: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
}

/* ---------- Hero: resultados ---------- */
.pd-results {
  list-style: none; margin: 26px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  max-width: 900px;
}
.pd-results li {
  padding: 14px 16px;
  border: 1px solid var(--line-dark);
  border-top: 2px solid var(--jade);
  background: rgba(13, 22, 24, 0.45);
}
.pd-results strong { display: block; font-family: var(--font-head); font-size: 1rem; font-weight: 600; color: var(--marfil); margin-bottom: 4px; }
.pd-results span { display: block; font-size: 0.9375rem; color: rgba(246, 245, 240, 0.8); line-height: 1.45; }
@media (max-width: 720px) { .pd-results { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Barra de la app: revisor ---------- */
.pd-reviewer {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8125rem; color: var(--marfil);
  padding: 3px 10px 3px 3px;
  border: 1px solid var(--line-dark); border-radius: 999px;
}
.pd-reviewer-av {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--jade-deep); color: var(--marfil);
  font-family: var(--font-head); font-size: 0.6875rem; font-weight: 700;
}
.pd-reviewer-k { color: var(--acero-claro); }

/* ---------- Filtro por canal ---------- */
.pd-filter { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; }
.pd-filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 4px 10px;
  font: inherit; font-size: 0.8125rem; font-weight: 600;
  color: rgba(246, 245, 240, 0.86);
  background: transparent;
  border: 1px solid var(--line-dark); border-radius: 999px;
  cursor: pointer;
}
.pd-filter-btn svg { width: 15px; height: 15px; }
.pd-filter-btn:hover { border-color: rgba(95, 197, 174, 0.6); }
.pd-filter-btn.is-on { background: rgba(95, 197, 174, 0.16); border-color: var(--jade); color: var(--marfil); }
.pd-filter-n {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(246, 245, 240, 0.12); font-size: 0.6875rem;
}
.pd-filter-btn.is-wa .pd-filter-n { background: rgba(95, 197, 174, 0.22); color: var(--jade); }

.pd-kind.is-wa { color: var(--jade); border-color: rgba(95, 197, 174, 0.45); }
.pd-inbox-icon.pd-kind-wa { border-color: rgba(95, 197, 174, 0.45); background: rgba(95, 197, 174, 0.08); }
.pd-inbox-badge {
  font-size: 0.6875rem; font-weight: 600; color: var(--pd-amber-text);
  border: 1px solid rgba(224, 168, 79, 0.5); border-radius: 2px; padding: 1px 5px;
}
.pd-inbox-meta { flex-wrap: wrap; }
.pd-inbox-state.is-ready { color: var(--jade); }

/* ---------- Chat de WhatsApp (estilo propio, sin marca) ---------- */
.pd-wa {
  max-width: 640px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  overflow: hidden;
  background: var(--pd-wa-bg);
  color: var(--marfil);
}
.pd-wa-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--grafito-soft);
  border-bottom: 1px solid var(--line-dark);
}
.pd-wa-av {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #2F4A50; color: var(--marfil);
  font-family: var(--font-head); font-weight: 700;
}
.pd-wa-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pd-wa-name { font-family: var(--font-head); font-size: 0.8125rem; font-weight: 600; overflow-wrap: anywhere; }
.pd-wa-phone { font-size: 0.75rem; color: var(--acero-claro); }
.pd-wa-chan {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-family: var(--font-head); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--jade); border: 1px solid rgba(95, 197, 174, 0.45); border-radius: 999px; padding: 3px 8px;
}
.pd-wa-chan svg { width: 14px; height: 14px; }
.pd-wa-body {
  list-style: none; margin: 0; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
  background-color: var(--pd-wa-bg);
  background-image: radial-gradient(rgba(95, 197, 174, 0.07) 1px, transparent 1.2px);
  background-size: 18px 18px;
}
.pd-bubble { display: flex; }
.pd-bubble.is-out { justify-content: flex-end; }
.pd-bubble-inner {
  position: relative;
  max-width: min(86%, 460px);
  padding: 8px 10px 6px 12px;
  border-radius: 10px;
  font-size: 0.9375rem; line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.pd-bubble.is-in .pd-bubble-inner { background: var(--marfil); color: var(--ink); border-top-left-radius: 2px; }
.pd-bubble.is-out .pd-bubble-inner { background: var(--pd-wa-out); color: var(--marfil); border-top-right-radius: 2px; }
.pd-bubble.is-old { opacity: 0.62; }
.pd-bubble.is-fresh .pd-bubble-inner { box-shadow: 0 0 0 2px var(--pd-amber), 0 1px 2px rgba(0, 0, 0, 0.3); }
.pd-bubble-new {
  display: inline-block; margin-bottom: 4px;
  font-family: var(--font-head); font-size: 0.625rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #6B4A12; background: #F6DDAF; padding: 1px 6px; border-radius: 2px;
}
.pd-app .pd-bubble-text { margin: 0; color: inherit; overflow-wrap: anywhere; }
.pd-bubble.is-in .pd-bubble-text { color: var(--ink); }
.pd-bubble-hint { margin: 6px 0 0; font-size: 0.8125rem; color: var(--acero-text) !important; font-style: italic; }
.pd-bubble-time { display: block; text-align: right; font-size: 0.6875rem; margin-top: 2px; opacity: 0.75; }
.pd-bubble.is-in .pd-bubble-time { color: var(--acero-text); opacity: 1; }

/* Audio */
.pd-audio { display: flex; align-items: center; gap: 10px; min-width: 230px; padding: 2px 0; }
.pd-audio-play {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--jade-deep); color: var(--marfil); border: 0; cursor: pointer;
}
.pd-audio-play svg { width: 18px; height: 18px; }
.pd-audio-play:hover { background: var(--jade-text); }
.pd-audio-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pd-wave { display: flex; align-items: center; gap: 2px; height: 22px; }
.pd-wave span { display: block; width: 3px; border-radius: 2px; background: #7E9196; }
.pd-wave.is-playing span { background: var(--jade-deep); animation: pdWave 0.9s ease-in-out infinite alternate; }
.pd-wave.is-playing span:nth-child(3n) { animation-delay: .15s; }
.pd-wave.is-playing span:nth-child(3n+1) { animation-delay: .3s; }
@keyframes pdWave { from { transform: scaleY(0.45); } to { transform: scaleY(1); } }
.pd-audio-dur { font-size: 0.75rem; color: var(--acero-text); font-variant-numeric: tabular-nums; }
.pd-transcript { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(21, 33, 38, 0.25); }
.pd-app .pd-transcript-label { display: flex; align-items: center; gap: 5px; margin: 0 0 4px; font-family: var(--font-head); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--acero-text); }
.pd-transcript-label svg { width: 14px; height: 14px; }

/* Foto de una lista escrita a mano */
.pd-photo {
  margin: 0 0 6px;
  padding: 14px 16px;
  border-radius: 6px;
  background: linear-gradient(135deg, #5B4B3A 0%, #3F342A 100%);
  overflow: hidden;
}
.pd-paper {
  position: relative;
  max-width: 330px;
  margin: 0 auto;
  padding: 16px 18px 12px 34px;
  transform: rotate(-1.6deg);
  background-color: #FBF8EE;
  background-image:
    linear-gradient(90deg, transparent 24px, rgba(179, 40, 47, 0.35) 24px, rgba(179, 40, 47, 0.35) 25px, transparent 25px),
    repeating-linear-gradient(180deg, transparent 0, transparent 29px, rgba(70, 110, 160, 0.28) 29px, rgba(70, 110, 160, 0.28) 30px);
  background-position: 0 0, 0 14px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45), inset 0 0 40px rgba(120, 100, 60, 0.12);
  color: #233A6B;
  font-family: var(--pd-hand);
}
.pd-paper::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.28), transparent 45%, rgba(0, 0, 0, 0.06));
}
.pd-app .pd-paper-title { margin: 0 0 2px; font-size: 1.375rem; line-height: 30px; font-weight: 600; color: #233A6B; text-decoration: underline; text-decoration-thickness: 1px; }
.pd-paper-lines { list-style: none; margin: 0; padding: 0; }
.pd-paper-lines li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; font-size: 1.3125rem; line-height: 30px; }
.pd-paper-lines li:nth-child(2n) .pd-hand { transform: rotate(0.6deg); display: inline-block; }
.pd-paper .pd-hand { font-size: inherit; line-height: inherit; }
.pd-app .pd-paper-sign { margin: 4px 0 0; text-align: right; font-size: 1.25rem; color: #233A6B; }
.pd-smudge { position: relative; display: inline-block; filter: blur(0.7px); color: #2C447A; }
.pd-smudge::after {
  content: ""; position: absolute; left: -3px; right: -3px; top: 45%; height: 6px;
  background: rgba(35, 58, 107, 0.35); transform: rotate(-14deg); border-radius: 3px;
}
.pd-ocr-badge {
  flex-shrink: 0;
  font-family: var(--font-body); font-size: 0.6875rem; font-weight: 600; line-height: 1.2;
  padding: 2px 6px; border-radius: 2px;
  background: #DDF1EB; color: #0B5A4D; border: 1px solid #8FCFBF;
}
.pd-ocr-badge.is-mid { background: #F8E8C8; color: #6B4A12; border-color: #E0A84F; }
.pd-ocr-badge.is-low { background: #F8E8C8; color: #6B4A12; border-color: #C7801F; border-style: dashed; }
.pd-paper-lines li.is-low { background: rgba(224, 168, 79, 0.18); }
.pd-app .pd-photo-cap { margin: 10px 0 0; font-size: 0.75rem; color: rgba(246, 245, 240, 0.85); text-align: center; }

/* Resaltado de lo que se leyó */
.pd-hl { background: var(--pd-hl); color: inherit; padding: 0 2px; border-radius: 2px; box-shadow: inset 0 -2px 0 rgba(199, 128, 31, 0.8); }
.pd-hl.is-change { background: rgba(95, 197, 174, 0.3); box-shadow: inset 0 -2px 0 var(--jade-deep); }
.pd-hl-n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 4px; margin-left: 2px;
  vertical-align: 2px;
  font-family: var(--font-head); font-size: 0.625rem; font-weight: 700;
  border-radius: 9px; background: var(--grafito); color: var(--marfil);
}
.pd-row-hl td, .pd-row-hl th { background: rgba(224, 168, 79, 0.16) !important; }
.pd-mail-body .pd-hl { color: var(--ink); }
.pd-orig-details .pd-original { overflow: hidden; }

/* ---------- Callouts ---------- */
.pd-callout.is-amber { border-left-color: var(--pd-amber); background: rgba(224, 168, 79, 0.08); }
.pd-callout.is-amber svg, .pd-callout.is-amber strong { color: var(--pd-amber-text); }

/* ---------- Cola de revisión ---------- */
.pd-queue { margin: 0 0 18px; border: 1px solid var(--line-dark); background: var(--pd-panel); }
.pd-queue-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 12px 16px; border-bottom: 1px solid var(--line-dark); }
.pd-queue-head h4 { margin: 0; font-family: var(--font-head); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--marfil); }
.pd-app .pd-queue-head p { margin: 0; font-size: 0.8125rem; color: var(--acero-claro); }
.pd-queue-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pd-q-col { padding: 12px 16px 14px; min-width: 0; }
.pd-q-col + .pd-q-col { border-left: 1px solid var(--line-dark); }
.pd-q-col h5 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-family: var(--font-head); font-size: 0.8125rem; font-weight: 600; }
.pd-q-col h5 svg { width: 16px; height: 16px; }
.pd-q-col.is-need h5 { color: var(--pd-amber-text); }
.pd-q-col.is-ready h5 { color: var(--jade); }
.pd-q-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.6875rem; background: rgba(246, 245, 240, 0.1); color: var(--marfil); }
.pd-q-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pd-q-item {
  width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left;
  padding: 7px 8px; min-height: 36px;
  font: inherit; font-size: 0.8125rem; color: var(--marfil);
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
}
.pd-q-item:hover { border-color: var(--line-dark); background: rgba(246, 245, 240, 0.04); }
.pd-q-n { flex-shrink: 0; font-family: var(--font-head); font-weight: 700; font-size: 0.75rem; color: var(--jade); padding-top: 1px; }
.pd-is-need .pd-q-n, .pd-q-col.is-need .pd-q-n { color: var(--pd-amber-text); }
.pd-q-text { display: flex; flex-direction: column; min-width: 0; }
.pd-q-prod { overflow-wrap: anywhere; }
.pd-q-why { font-size: 0.75rem; color: var(--pd-amber-text); }
.pd-app .pd-q-empty { margin: 0; font-size: 0.8125rem; color: var(--acero-claro); }

/* ---------- Tarjetas de línea: original ↔ propuesta ---------- */
.pd-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pd-card {
  border: 1px solid var(--line-dark);
  border-left: 3px solid rgba(95, 197, 174, 0.55);
  border-radius: var(--radius);
  background: rgba(13, 22, 24, 0.35);
  padding: 12px 16px 14px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.pd-card.has-pending { border-left-color: var(--pd-amber); background: rgba(224, 168, 79, 0.035); }
.pd-card.is-excluded { border-left-color: var(--acero); }
.pd-card.is-excluded .pd-card-body { opacity: 0.55; }
.pd-card.is-excluded .pd-prop-desc { text-decoration: line-through; }
.pd-card.is-flash { animation: pdFlash 1.2s ease; }
@keyframes pdFlash { 0% { box-shadow: 0 0 0 3px var(--jade); } 100% { box-shadow: 0 0 0 0 transparent; } }

.pd-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line-dark); }
.pd-card-title { margin: 0; font-size: 0.875rem; }
.pd-card-title:focus { outline: none; }
.pd-card-title:focus-visible { outline: 2px solid var(--jade); outline-offset: 3px; }
.pd-card-status { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.pd-card-status.is-need { color: var(--pd-amber-text); }
.pd-card-status.is-ready { color: var(--jade); }
.pd-card-status.is-out { color: var(--acero-claro); }
.pd-card-head .pd-ex-label { margin-left: auto; padding-top: 0; min-height: 44px; }
.pd-card-head .pd-ex-label span { display: inline; }

.pd-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1.2fr);
  align-items: stretch;
  gap: 10px;
}
.pd-card-arrow { display: flex; align-items: center; justify-content: center; color: var(--jade); }
.pd-card-arrow svg { width: 20px; height: 20px; }
.pd-src, .pd-prop { min-width: 0; padding: 10px 12px; border-radius: var(--radius); }
.pd-src { background: rgba(246, 245, 240, 0.05); border: 1px dashed rgba(246, 245, 240, 0.22); }
.pd-prop { background: var(--pd-panel); border: 1px solid var(--line-dark); }
.pd-app .pd-side-label {
  display: flex; align-items: center; gap: 6px; margin: 0 0 6px;
  font-family: var(--font-head); font-size: 0.625rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--acero-claro);
}
.pd-side-label svg { width: 14px; height: 14px; color: var(--jade); flex-shrink: 0; }
.pd-app .pd-side-label.is-change { color: var(--jade); }
.pd-app .pd-src-text { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: rgba(246, 245, 240, 0.92); overflow-wrap: anywhere; }
.pd-src-text .pd-hl { color: var(--marfil); background: rgba(224, 168, 79, 0.28); }
.pd-src-text .pd-hl.is-change { background: rgba(95, 197, 174, 0.26); }
.pd-hand-strip { padding: 2px 10px; background: #FBF8EE; border-radius: 2px; }
.pd-app .pd-hand-strip { color: #233A6B; }
.pd-hand { font-family: var(--pd-hand); font-size: 1.375rem; line-height: 1.35; color: #233A6B; }
.pd-app .pd-src-read { margin: 6px 0 0; font-size: 0.8125rem; color: var(--acero-claro); }
.pd-src-read strong { color: var(--marfil); font-weight: 600; }
.pd-src-change { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(246, 245, 240, 0.2); }

.pd-prop-prod { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pd-prop-names { display: flex; flex-direction: column; min-width: 0; flex: 1 1 180px; }
.pd-prop-sku { font-family: var(--pd-mono); font-size: 0.8125rem; color: var(--jade); }
.pd-prop-sku.is-empty { color: var(--pd-red-text); font-family: var(--font-head); font-weight: 600; }
.pd-prop-desc { font-size: 0.9375rem; line-height: 1.35; overflow-wrap: anywhere; }
.pd-prop-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.9fr); gap: 10px 12px; margin-top: 12px; }
.pd-prop-k { display: block; font-family: var(--font-head); font-size: 0.625rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--acero-claro); margin-bottom: 4px; }
.pd-qty-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pd-qty-row .pd-unit { margin-top: 0; }
.pd-price { padding-top: 0; }
.pd-conf { margin-top: 0; }
.pd-field-error { max-width: none; }

.pd-mini {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 6px 12px;
  font: inherit; font-size: 0.8125rem; font-weight: 600;
  color: var(--marfil); background: transparent;
  border: 1px solid rgba(95, 197, 174, 0.6); border-radius: var(--radius);
  cursor: pointer;
}
.pd-mini svg { width: 15px; height: 15px; color: var(--jade); }
.pd-mini:hover:not(:disabled) { background: rgba(95, 197, 174, 0.12); }
.pd-mini:disabled { opacity: 0.5; cursor: not-allowed; }
.pd-mini.is-quiet { border-color: rgba(246, 245, 240, 0.3); }

/* Búsqueda en el catálogo */
.pd-search { margin-top: 10px; padding: 10px; border: 1px solid rgba(95, 197, 174, 0.4); border-radius: var(--radius); background: var(--grafito-deep); }
.pd-search[hidden] { display: none; }
.pd-search label { display: block; font-family: var(--font-head); font-size: 0.75rem; font-weight: 600; margin-bottom: 6px; }
.pd-search-field { position: relative; }
.pd-search-field svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--acero-claro); }
.pd-search-input {
  width: 100%; min-height: 40px; padding: 8px 10px 8px 34px;
  font: inherit; font-size: 0.875rem; color: var(--marfil);
  background: var(--grafito); border: 1px solid rgba(246, 245, 240, 0.28); border-radius: var(--radius);
}
.pd-search-input::placeholder { color: rgba(169, 182, 186, 0.85); }
.pd-search-input:focus-visible { outline: 2px solid var(--jade); outline-offset: 1px; }
.pd-app .pd-search-count { margin: 8px 0 6px; font-size: 0.75rem; color: var(--acero-claro); }
.pd-search-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pd-result {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; text-align: left;
  padding: 7px 10px; min-height: 40px;
  font: inherit; font-size: 0.8125rem; color: var(--marfil);
  background: transparent; border: 1px solid var(--line-dark); border-radius: var(--radius); cursor: pointer;
}
.pd-result:hover { border-color: var(--jade); }
.pd-result.is-on { background: rgba(95, 197, 174, 0.14); border-color: var(--jade); }
.pd-result-sku { font-family: var(--pd-mono); color: var(--jade); grid-row: span 2; padding-top: 1px; }
.pd-result-desc { overflow-wrap: anywhere; }
.pd-result-price { color: var(--acero-claro); font-size: 0.75rem; }

/* Alertas: motivo, historial y consulta al cliente */
.pd-alerts { margin-top: 10px; }
.pd-why { font-weight: 600; color: var(--marfil); }
.pd-alert.is-mod { border-color: rgba(95, 197, 174, 0.45); border-left-color: var(--jade); background: rgba(95, 197, 174, 0.06); }
.pd-alert.is-mod .pd-chip { color: var(--jade); }
.pd-alert.is-mod.is-resolved { border-color: rgba(95, 197, 174, 0.3); }
.pd-opt.is-accent { border-color: var(--jade); }
.pd-opts .pd-opt:first-child:not(.is-on) { border-color: rgba(95, 197, 174, 0.55); }
.pd-alert-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pd-hist { margin-top: 6px; padding: 0 10px; background: rgba(13, 22, 24, 0.5); border-radius: var(--radius); }
.pd-hist[open] { padding-bottom: 8px; }
.pd-app .pd-hist > summary { font-size: 0.75rem; cursor: pointer; min-height: 32px; display: flex; align-items: center; color: var(--jade) !important; }
.pd-hist > summary::before { content: "▸ "; white-space: pre; }
.pd-hist[open] > summary::before { content: "▾ "; }
.pd-hist > summary::-webkit-details-marker { display: none; }
.pd-hist > summary { list-style: none; }
.pd-app .pd-hist-t { margin: 0 0 4px !important; font-family: var(--font-head); font-size: 0.625rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--acero-claro); }
.pd-hist ul { margin: 0; padding-left: 18px; font-size: 0.8125rem; color: rgba(246, 245, 240, 0.85); }
.pd-ask { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line-dark); border-radius: var(--radius); background: rgba(13, 22, 24, 0.5); }
.pd-app .pd-ask-t { display: flex; align-items: center; gap: 6px; margin: 0 0 6px !important; font-size: 0.8125rem; font-weight: 600; color: var(--marfil); }
.pd-ask-t svg { width: 15px; height: 15px; color: var(--jade); flex-shrink: 0; }
.pd-app .pd-ask-q {
  margin: 0 0 8px !important; padding: 8px 10px; max-width: 520px;
  background: var(--pd-wa-out); color: var(--marfil);
  border-radius: 10px; border-top-right-radius: 2px;
  font-size: 0.875rem; line-height: 1.45;
}
.pd-ask-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-app .pd-ask-answer { margin: 8px 0 0 !important; padding: 8px 10px; max-width: 520px; background: var(--marfil); color: var(--ink); border-radius: 10px; border-top-left-radius: 2px; font-size: 0.875rem; }
.pd-ask-answer strong { color: var(--ink); }
.pd-ask-answer:focus { outline: 2px solid var(--jade); outline-offset: 2px; }

/* Historial de cambios (auditoría) */
.pd-audit { margin-top: 18px; border: 1px solid var(--line-dark); border-radius: var(--radius); }
.pd-audit summary { cursor: pointer; padding: 10px 14px; font-family: var(--font-head); font-size: 0.8125rem; font-weight: 600; }
.pd-audit summary:hover { color: var(--jade); }
.pd-audit[open] summary { border-bottom: 1px solid var(--line-dark); }
.pd-audit .pd-audit-list { padding: 10px 14px; }
.pd-audit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.8125rem; }
.pd-audit-item { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; line-height: 1.45; }
.pd-audit-time { font-variant-numeric: tabular-nums; color: var(--acero-claro); }
.pd-audit-text { overflow-wrap: anywhere; color: rgba(246, 245, 240, 0.88); }
.pd-audit-text strong { font-weight: 600; color: var(--marfil); }
.pd-audit-item.is-sys strong { color: var(--acero-claro); }
.pd-audit-item.is-cli strong { color: var(--pd-amber-text); }
.pd-audit-item.is-ok strong { color: var(--jade); }

.pd-approve-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.pd-approve-who { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--acero-claro); }
.pd-approve-who svg { width: 15px; height: 15px; }

/* ---------- Aprobado ---------- */
.pd-stamp {
  display: flex; gap: 14px; align-items: flex-start;
  margin: 0 0 20px; padding: 14px 16px;
  border: 1px solid rgba(95, 197, 174, 0.5); background: rgba(95, 197, 174, 0.08); border-radius: var(--radius);
}
.pd-stamp-ic { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--jade-deep); color: var(--marfil); }
.pd-stamp-ic svg { width: 18px; height: 18px; }
.pd-app .pd-stamp-main { margin: 0; font-size: 1rem; }
.pd-stamp-main strong { color: var(--jade); }
.pd-app .pd-stamp-sub { margin: 2px 0 0; font-size: 0.8125rem; color: var(--acero-claro); }

.pd-confirm { margin-top: 24px; padding: 16px 18px; border: 1px solid var(--line-dark); background: var(--pd-wa-bg); }
.pd-confirm h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-family: var(--font-head); font-size: 0.8125rem; font-weight: 600; }
.pd-confirm h4 svg { width: 17px; height: 17px; color: var(--jade); flex-shrink: 0; }
.pd-confirm-chat { display: flex; justify-content: flex-end; }
.pd-app .pd-confirm-msg {
  margin: 0; white-space: pre-line; max-width: 480px;
  padding: 10px 12px; font-size: 0.875rem; line-height: 1.5;
  background: var(--pd-wa-out); color: var(--marfil);
  border-radius: 10px; border-top-right-radius: 2px;
}
.pd-confirm-mail .pd-confirm-msg { background: var(--marfil); color: var(--ink); border-radius: var(--radius); max-width: 560px; }
.pd-exlog .pd-audit-list { margin-bottom: 10px; }

/* ---------- Responsive de las piezas nuevas ---------- */
@container pdmain (max-width: 640px) {
  .pd-card-body { grid-template-columns: minmax(0, 1fr); }
  .pd-card-arrow { transform: rotate(90deg); height: 20px; }
  .pd-queue-cols { grid-template-columns: minmax(0, 1fr); }
  .pd-q-col + .pd-q-col { border-left: 0; border-top: 1px solid var(--line-dark); }
  .pd-prop-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pd-prop-grid > :first-child { grid-column: 1 / -1; }
  .pd-card-head .pd-ex-label { margin-left: 0; }
}
@container pdmain (max-width: 440px) {
  .pd-card { padding: 10px 12px 12px; }
  .pd-approve-act { width: 100%; }
  .pd-confirm { padding: 12px; }
  .pd-wa-chan { display: none; }
  .pd-bubble-inner { max-width: 94%; }
  .pd-audio { min-width: 0; }
  .pd-photo { padding: 10px 4px; }
  .pd-paper { padding: 12px 8px 10px 28px; transform: rotate(-1deg); }
  .pd-app .pd-paper-title { font-size: 1.125rem; }
  .pd-paper { padding-right: 6px; }
  .pd-paper-lines li { font-size: 1.0625rem; line-height: 30px; gap: 4px; }
  .pd-paper-lines .pd-hand { min-width: 0; overflow-wrap: anywhere; }
  .pd-ocr-badge { font-size: 0.625rem; padding: 1px 3px; }
}
@media (max-width: 900px) {
  .pd-inbox-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-inbox-list li:nth-child(2) .pd-inbox-item { border-top: 1px solid var(--line-dark); }
  .pd-inbox-list li:nth-child(2n) .pd-inbox-item { border-left-color: transparent; }
  .pd-inbox-list li .pd-inbox-item.is-selected { border-left-color: var(--jade); }
}
@media (max-width: 560px) {
  .pd-inbox-list { grid-template-columns: minmax(0, 1fr); }
  .pd-inbox-list li:nth-child(2) .pd-inbox-item { border-top: 0; }
  .pd-filter { padding-inline: 14px; }
  .pd-reviewer { font-size: 0.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-wave.is-playing span { animation: none; }
  .pd-card.is-flash { animation: none; outline: 2px solid var(--jade); }
}

/* ==========================================================================
   Aprobación por línea + botón final imposible de no ver (v3)
   ========================================================================== */

/* Cómo se termina */
.pd-howto {
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid rgba(95, 197, 174, 0.45);
  border-radius: var(--radius);
  background: rgba(95, 197, 174, 0.07);
}
.pd-app .pd-howto-t { margin: 0 0 8px; font-size: 0.9375rem; color: var(--marfil); }
.pd-howto-t strong { color: var(--jade); font-weight: 700; }
.pd-howto-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.pd-howto-steps li {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line-dark); border-radius: 999px;
  background: var(--pd-panel);
  font-family: var(--font-head); font-size: 0.75rem; font-weight: 600; color: var(--marfil);
}
.pd-howto-steps li svg { width: 15px; height: 15px; color: var(--jade); }
.pd-howto-steps li:last-child { border-color: var(--jade); color: var(--jade); }
.pd-howto-n {
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--jade-deep); color: var(--marfil); font-size: 0.6875rem;
}

/* Cola de revisión: tres columnas */
.pd-queue-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pd-q-col.is-ready h5 { color: var(--marfil); }
.pd-q-col.is-ready h5 svg { color: var(--jade); }
.pd-q-col.is-done h5 { color: var(--jade); }
.pd-q-col.is-ready .pd-q-n { color: var(--marfil); }
.pd-q-why.is-ready { color: var(--jade); }
.pd-q-item.is-out { opacity: 0.7; }
.pd-q-item.is-out .pd-q-n { color: var(--acero-claro); }

/* Atajo: aprobar las líneas sin dudas */
.pd-bulk {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px; margin: 0 0 12px; padding: 10px 14px;
  border: 1px dashed rgba(95, 197, 174, 0.5); border-radius: var(--radius);
}
.pd-bulk.is-empty { border-color: var(--line-dark); }
.pd-app .pd-bulk-t { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.875rem; color: rgba(246, 245, 240, 0.88); flex: 1 1 260px; }
.pd-bulk-t svg { width: 18px; height: 18px; color: var(--jade); flex-shrink: 0; }
.pd-bulk-btn { border: 2px solid var(--jade); font-size: 0.875rem; padding-inline: 14px; }
.pd-bulk-btn svg { width: 18px; height: 18px; }

/* Tarjeta: estados de aprobación */
.pd-card.is-waiting { border-left-color: var(--jade); }
.pd-card.is-approved {
  border-left: 5px solid var(--jade);
  border-color: rgba(95, 197, 174, 0.5);
  background: rgba(95, 197, 174, 0.07);
}
.pd-card-status.is-ok { color: var(--ink, #0D1618); background: var(--jade); border-color: var(--jade); }
.pd-card-status.is-ready { color: var(--marfil); border-color: var(--jade); }

/* Botón «Aprobar esta línea» */
.pd-ok-slot.is-top { display: inline-flex; }
.pd-line-ok {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; min-width: 210px; padding: 6px 14px 6px 10px;
  font: inherit; text-align: left; cursor: pointer;
  color: var(--marfil); background: transparent;
  border: 2px solid var(--jade); border-radius: var(--radius);
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.pd-line-ok-ic { display: inline-flex; flex-shrink: 0; }
.pd-line-ok-ic svg { width: 26px; height: 26px; }
.pd-line-ok-ic svg path { stroke-width: 2; }
.pd-line-ok-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.pd-line-ok-main { font-family: var(--font-head); font-size: 0.9375rem; font-weight: 700; }
.pd-line-ok-sub { font-size: 0.75rem; margin-top: 2px; color: rgba(246, 245, 240, 0.78); }
.pd-line-ok:focus-visible { outline: 2px solid var(--marfil); outline-offset: 2px; }

.pd-line-ok.is-ready { background: rgba(95, 197, 174, 0.1); box-shadow: 0 0 0 3px rgba(95, 197, 174, 0.18); }
.pd-line-ok.is-ready .pd-line-ok-ic { color: var(--jade); }
.pd-line-ok.is-ready:hover { background: rgba(95, 197, 174, 0.2); }

.pd-line-ok.is-on { background: var(--jade); border-color: var(--jade); color: var(--ink, #0D1618); }
.pd-line-ok.is-on .pd-line-ok-sub { color: rgba(13, 22, 24, 0.75); }
.pd-line-ok.is-on:hover { background: #79d3bf; }

.pd-line-ok.is-blocked {
  cursor: not-allowed;
  border-style: dashed; border-color: rgba(246, 245, 240, 0.32);
  color: rgba(246, 245, 240, 0.62);
}
.pd-line-ok.is-blocked .pd-line-ok-sub { color: var(--pd-amber-text); font-weight: 600; }
.pd-line-ok.is-out {
  cursor: default; border-style: dashed; border-color: var(--line-dark);
  color: var(--acero-claro); min-width: 0;
}

.pd-card-foot { display: none; }

/* Barra final: fija abajo, alta y con progreso */
.pd-approve-bar {
  position: sticky; bottom: 0; z-index: 5;
  padding-block: 16px;
  background: #0B1416;
  border-top: 2px solid var(--pd-amber);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.45);
}
.pd-approve-bar.is-ready { border-top-color: var(--jade); background: #0A1A19; }
.pd-approve-info { flex: 1 1 280px; }
.pd-app .pd-approve-prog { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 6px; }
.pd-approve-count { font-family: var(--font-head); font-size: 0.875rem; font-weight: 600; color: var(--marfil); white-space: nowrap; }
.pd-approve-count-n { color: var(--jade); font-size: 1.0625rem; }
.pd-approve-meter { flex: 1 1 120px; max-width: 260px; height: 8px; border-radius: 4px; background: rgba(246, 245, 240, 0.14); overflow: hidden; }
.pd-approve-meter-fill { display: block; height: 100%; width: 0; background: var(--jade); border-radius: 4px; transition: width .3s ease; }
.pd-approve-bar .pd-pending { font-size: 1rem; }

.pd-btn-final {
  min-height: 60px; padding: 12px 26px; gap: 12px;
  font-size: 1.0625rem; font-weight: 700;
  border-width: 2px;
}
.pd-btn-final svg { width: 22px; height: 22px; }
.pd-btn-final svg path { stroke-width: 2.2; }
.pd-btn-final-arrow { font-size: 1.25rem; line-height: 1; }
.pd-btn-primary.pd-btn-final:not(:disabled):not(.is-disabled) {
  background: var(--jade); color: var(--ink, #0D1618); border-color: var(--jade);
  animation: pdGlow 2s ease-in-out infinite;
}
.pd-btn-primary.pd-btn-final:hover:not(:disabled):not(.is-disabled) { background: #79d3bf; }
.pd-btn-primary.pd-btn-final:disabled, .pd-btn-primary.pd-btn-final.is-disabled {
  background: rgba(246, 245, 240, 0.06);
  border: 2px dashed rgba(246, 245, 240, 0.4);
  color: rgba(246, 245, 240, 0.72);
}
.pd-btn-final:focus-visible { outline: 2px solid var(--marfil); outline-offset: 3px; }
@keyframes pdGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(95, 197, 174, 0.55), 0 6px 18px rgba(95, 197, 174, 0.25); }
  50% { box-shadow: 0 0 0 8px rgba(95, 197, 174, 0), 0 6px 22px rgba(95, 197, 174, 0.45); }
}

/* Angosto: el botón de la línea pasa al pie de la tarjeta, a todo el ancho */
@container pdmain (max-width: 640px) {
  .pd-ok-slot.is-top { display: none; }
  .pd-card-foot { display: block; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-dark); }
  .pd-card-foot .pd-line-ok { width: 100%; justify-content: center; min-height: 56px; }
  .pd-card-foot .pd-line-ok-txt { align-items: center; text-align: center; }
  .pd-queue-cols { grid-template-columns: minmax(0, 1fr); }
  .pd-q-col + .pd-q-col { border-left: 0; border-top: 1px solid var(--line-dark); }
}
@container pdmain (max-width: 440px) {
  .pd-approve-bar { padding-block: 12px; gap: 8px; }
  .pd-approve-bar .pd-pending { font-size: 0.9375rem; }
  .pd-approve-who { display: none; }
  .pd-btn-final { min-height: 56px; font-size: 1rem; padding-inline: 16px; }
  .pd-bulk-btn { width: 100%; justify-content: center; }
  .pd-howto { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-btn-primary.pd-btn-final:not(:disabled):not(.is-disabled) { animation: none; box-shadow: 0 0 0 3px rgba(95, 197, 174, 0.45); }
  .pd-approve-meter-fill { transition: none; }
}
@media print {
  .pd-btn-primary.pd-btn-final { animation: none; }
  .pd-approve-bar { position: static; box-shadow: none; }
}
/* Barra final en una sola fila cuando hay lugar */
.pd-approve-bar { flex-wrap: nowrap; }
.pd-approve-info { flex: 1 1 0; min-width: 0; }
.pd-approve-act { flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 6px; }
@container pdmain (max-width: 760px) {
  .pd-approve-bar { flex-wrap: wrap; }
  .pd-approve-info { flex: 1 1 100%; }
  .pd-approve-act { flex: 1 1 100%; align-items: stretch; }
  .pd-approve-act .pd-btn-final { width: 100%; }
}
/* Mientras se revisa un pedido, el botón flotante de WhatsApp se oculta:
   no tapa la barra final ni los botones «Aprobar esta línea». Vuelve al salir de la revisión. */
.wa-float { transition: opacity .2s ease, visibility .2s ease, background-color .2s ease, transform .2s ease; }
html.pd-bar-on .wa-float { opacity: 0; visibility: hidden; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .wa-float { transition: none; } }
/* El botón final deshabilitado sigue siendo bien visible (se nota que existe) */
.pd-btn-primary.pd-btn-final:disabled, .pd-btn-primary.pd-btn-final.is-disabled { color: rgba(246, 245, 240, 0.86); border-color: rgba(246, 245, 240, 0.55); background: rgba(246, 245, 240, 0.08); }

/* Atención en la línea pendiente al tocar «Aprobar y pasar al sistema» antes de tiempo */
.pd-attn { animation: pd-attn 0.7s ease-in-out 3; outline: 3px solid #E7B54A; outline-offset: 3px; }
@keyframes pd-attn { 0%,100% { box-shadow: 0 0 0 0 rgba(231,181,74,0); } 50% { box-shadow: 0 0 0 8px rgba(231,181,74,0.45); } }
@media (prefers-reduced-motion: reduce) { .pd-attn { animation: none; } }
.pd-btn-primary.pd-btn-final.is-disabled { cursor: pointer; }
