/* Compartir con el cliente (compartir.js): WhatsApp, correo, copiar o menú del sistema; texto, enlace o PDF */
#compartir-dialog { color: var(--texto, #172d42); background: var(--panel, #fff); border: 1px solid var(--borde, #dce4eb); border-radius: 22px;
  width: min(640px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; box-shadow: 0 24px 64px rgba(14, 34, 54, .28); overflow: auto; }
#compartir-dialog::backdrop { background: #0e2236c2; backdrop-filter: blur(5px); }
#compartir-dialog * { box-sizing: border-box; }
#compartir-dialog h2, #compartir-dialog p { margin: 0; }
#compartir-dialog button, #compartir-dialog input, #compartir-dialog textarea { font: inherit; }
#compartir-dialog button { cursor: pointer; }
#compartir-dialog button:disabled { cursor: not-allowed; opacity: .55; }
#compartir-dialog :focus-visible { outline: 3px solid #087f93; outline-offset: 2px; }
#compartir-dialog svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cp-cab { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 20px 22px 12px; border-bottom: 1px solid var(--borde, #dce4eb); }
.cp-cab h2 { font-size: 21px; letter-spacing: -.3px; }
.cp-cab p { color: var(--suave, #536575); font-size: 13px; margin-top: 4px; }
.cp-x { background: none; border: 0; color: inherit; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.cp-x:hover { background: var(--fondo-2, #f1f5f8); }
.cp-cuerpo { padding: 16px 22px; display: grid; gap: 16px; }
.cp-cuerpo fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; min-width: 0; }
.cp-cuerpo legend { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--suave, #536575); font-weight: 700; margin-bottom: 8px; padding: 0; }
.cp-para { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cp-para .cp-nota { grid-column: 1 / -1; }
.cp-campo { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; min-width: 0; }
.cp-campo small { font-weight: 400; color: var(--suave, #536575); }
.cp-campo input, .cp-campo textarea { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; font-weight: 400; padding: 9px 11px; border: 1px solid var(--borde, #c9d4dd); border-radius: 10px; background: var(--panel, #fff); color: var(--texto, #172d42); }
.cp-campo textarea { resize: vertical; line-height: 1.45; min-height: 170px; }
.cp-nota { font-size: 12.5px; color: var(--suave, #536575); line-height: 1.45; }
.cp-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cp-op { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--borde, #dce4eb); border-radius: 12px; cursor: pointer; min-height: 44px; }
.cp-op:has(input:checked) { border-color: #087f93; background: #eaf7fa; box-shadow: inset 0 0 0 1px #087f93; }
.cp-op input { accent-color: #087f93; width: 18px; height: 18px; margin: 2px 0 0; flex: none; }
.cp-op b { display: block; font-size: 13.5px; } .cp-op small { display: block; font-size: 12px; color: var(--suave, #536575); margin-top: 2px; }
.cp-formato > .btn { justify-self: start; min-height: 44px; display: inline-flex; gap: 8px; align-items: center; }
.cp-enlace { background: none; border: 0; padding: 0; color: #087f93; text-decoration: underline; font-size: inherit; min-height: 24px; }
.cp-emitir { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; align-items: end; padding: 12px; border-radius: 14px; background: var(--fondo-2, #f6f9fb); border: 1px solid var(--borde, #dce4eb); }
.cp-confirmar { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.4; cursor: pointer; }
.cp-confirmar input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: #0e2236; }
.cp-error { color: #a3312b; background: #fdecea; border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.cp-aviso { color: #135c3e; background: #e8f6ee; border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.cp-pie { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 22px 18px; background: var(--panel, #fff); border-top: 1px solid var(--borde, #dce4eb); }
.cp-pie .btn { min-height: 44px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; }
.cp-pie .btn[data-cp-canal="whatsapp"] { background: #1f8a4c; border-color: #1f8a4c; color: #fff; }
@media (max-width: 560px) {
  .cp-cab, .cp-cuerpo, .cp-pie { padding-inline: 16px; }
  .cp-para, .cp-emitir { grid-template-columns: minmax(0, 1fr); }
  .cp-pie { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cp-op:has(input:checked) { background: #0b3b44; }
  :root:not([data-theme="light"]) .cp-error { background: #4a1d1a; color: #ffd2cd; }
  :root:not([data-theme="light"]) .cp-aviso { background: #123a28; color: #c9f1da; }
}
:root[data-theme="dark"] .cp-op:has(input:checked) { background: #0b3b44; }
:root[data-theme="dark"] .cp-error { background: #4a1d1a; color: #ffd2cd; }
:root[data-theme="dark"] .cp-aviso { background: #123a28; color: #c9f1da; }
/* 12-11-2026: al emitir, los botones esperan la casilla de confirmación */
.cp-falta { margin: 0 16px; padding: 8px 12px; border-radius: 10px; background: #fbf0d9; color: #7a4d00; font-size: 12.5px; font-weight: 600; }
.cp-pie .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Casilla de confirmación sin marcar al pulsar emitir, descargar o compartir (13-11-2026) */
.falta-confirmar { outline: 3px solid #f5a623; outline-offset: 3px; border-radius: 12px; background: rgba(245, 166, 35, .14); animation: falta-confirmar 1.1s ease-out 2; }
@keyframes falta-confirmar { 0% { box-shadow: 0 0 0 0 rgba(245, 166, 35, .55); } 100% { box-shadow: 0 0 0 16px rgba(245, 166, 35, 0); } }
@media (prefers-reduced-motion: reduce) { .falta-confirmar { animation: none; } }
