/* Diálogos compartidos: el contenido variable siempre se presenta como texto. */
.app-dialog {
  box-sizing: border-box; width: min(540px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px); margin: auto; padding: 0; overflow: auto;
  border: 1px solid #e2e8f0; border-radius: 22px; background: #fff; color: #0f172a;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .24); font: inherit;
}
.app-dialog::backdrop { background: rgba(15, 23, 42, .52); backdrop-filter: blur(4px); }
.app-dialog[open] { animation: app-dialog-enter .16s ease-out; }
.app-dialog-content { padding: 28px; }
.app-dialog-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.app-dialog-mark { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px;
  border-radius: 14px; color: #1d4ed8; background: #eff6ff; font-size: 23px; font-weight: 800; }
.app-dialog[data-tone="danger"] .app-dialog-mark { background: #fef2f2; color: #b91c1c; }
.app-dialog h2 { margin: 0; color: #0f172a; font-size: 1.3rem; line-height: 1.3; font-weight: 800; }
.app-dialog-kicker { margin: 0 0 5px; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: #64748b; font-weight: 700; }
.app-dialog-description { margin: 0 0 20px; color: #475569; font-size: .9rem; line-height: 1.6; overflow-wrap: anywhere; }
.app-dialog-details { display: grid; gap: 12px; padding: 16px; margin: 0 0 20px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; }
.app-dialog-details > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.app-dialog-details dt { font-size: .8rem; color: #64748b; }
.app-dialog-details dd { margin: 0; font-size: .85rem; font-weight: 700; overflow-wrap: anywhere; }
.app-dialog-fields { display: grid; gap: 16px; }
.app-dialog-field { display: grid; gap: 7px; color: #334155; font-size: .85rem; font-weight: 600; }
.app-dialog-field input, .app-dialog-field select, .app-dialog-field textarea {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px;
  border: 1px solid #cbd5e1; border-radius: 9px; font: inherit; background: #fff; color: #0f172a;
}
.app-dialog-field small { font-size: .77rem; font-weight: 400; color: #64748b; line-height: 1.5; }
.app-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.app-dialog-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 17px; font: inherit; font-size: .85rem;
  font-weight: 700; cursor: pointer; background: #fff; color: #334155; text-decoration: none; }
.app-dialog-button:hover { background: #f1f5f9; }
.app-dialog-button--primary { color: #fff; border-color: #2563eb; background: #2563eb; }
.app-dialog-button--primary:hover { background: #1d4ed8; }
.app-dialog-button--danger { color: #fff; border-color: #b91c1c; background: #b91c1c; }
.app-dialog-button--danger:hover { background: #991b1b; }
.app-dialog-button:disabled { opacity: .55; cursor: wait; }
.app-dialog :focus-visible, .app-dialog-button:focus-visible, [data-dialog-open]:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.app-dialog [hidden] { display: none !important; }
.app-dialog-error { margin: 12px 0 0; color: #b91c1c; font-size: .85rem; }
html.app-dialog-open { overflow: hidden; }
@keyframes app-dialog-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) { .app-dialog-content { padding: 22px; } .app-dialog-actions > * { flex: 1; } .app-dialog-details > div { grid-template-columns: 90px minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .app-dialog[open] { animation: none; } }
/* El diálogo se abre desde celdas de tabla que no parten el texto: no hereda eso. */
.app-dialog { white-space: normal; }
