/*
 * DentalNote UI Foundation
 * Infraestructura global para migracion gradual de componentes.
 * No reemplaza clases historicas; convive con ellas.
 */

:root {
    --dn-font-sans: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", Inter, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    --dn-bg: var(--bg, #f4f8fb);
    --dn-surface: var(--surface, #ffffff);
    --dn-surface-soft: var(--surface-soft, #f8fbfc);
    --dn-text: var(--text, #112235);
    --dn-muted: var(--muted, #637487);
    --dn-line: var(--line, #dce7ee);
    --dn-line-soft: var(--line-soft, #eaf1f5);
    --dn-primary: var(--primary, #17426f);
    --dn-primary-strong: var(--primary-strong, #0f766e);
    --dn-primary-soft: var(--primary-soft, #eef8f6);
    --dn-primary-line: var(--primary-line, #b9ddd8);
    --dn-success: var(--success, #16a34a);
    --dn-warning: var(--accent, #f59e0b);
    --dn-danger: #be123c;
    --dn-info: #1d4ed8;
    --dn-money: #15803d;
    --dn-clinical: #0e7490;
    --dn-shadow-sm: 0 6px 14px rgba(15, 23, 42, 0.04);
    --dn-shadow-md: 0 18px 44px rgba(15, 23, 42, 0.13);
    --dn-radius-sm: 10px;
    --dn-radius-md: 14px;
    --dn-radius-lg: 18px;
    --dn-focus-ring: 0 0 0 3px rgba(15, 118, 110, 0.14);
    --dn-z-modal-backdrop: 100000;
    --dn-z-modal-panel: 100010;
}

html {
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body,
button,
input,
select,
textarea {
    font-family: var(--font-family-base, var(--dn-font-sans));
    font-synthesis-weight: none;
}

/* Buttons */
.dn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 31px;
    padding: 0 10px;
    border: 1px solid var(--dn-line);
    border-radius: 10px;
    background: var(--dn-surface);
    color: var(--dn-text);
    font: inherit;
    font-size: 12.5px;
    font-weight: 670;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: box-shadow .14s ease, background .14s ease, border-color .14s ease, color .14s ease;
}

.dn-btn:hover {
    color: var(--dn-text);
    background: var(--dn-surface-soft);
    border-color: #cfe0ea;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.032);
    text-decoration: none;
}

.dn-btn:focus-visible {
    outline: none;
    box-shadow: var(--dn-focus-ring);
}

.dn-btn:disabled,
.dn-btn[aria-disabled="true"],
.dn-btn.is-disabled {
    opacity: .52;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dn-btn-primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #17426f 0%, #176c73 100%);
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.10);
}

.dn-btn-primary:hover {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #143a63 0%, #145f66 100%);
}

.dn-btn-secondary {
    color: var(--dn-primary);
    background: #fff;
    border-color: #cfe0ea;
}

.dn-btn-secondary:hover {
    color: var(--dn-primary);
    background: #f8fbfc;
}

.dn-btn-ghost {
    color: var(--dn-muted);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.dn-btn-ghost:hover {
    color: var(--dn-text);
    background: var(--dn-surface-soft);
    border-color: var(--dn-line-soft);
}

.dn-btn-success {
    color: #166534;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.dn-btn-success:hover { color: #14532d; background: #dcfce7; border-color: #86efac; }

.dn-btn-warning {
    color: #7c2d12;
    border-color: #fed7aa;
    background: #fff7ed;
}

.dn-btn-warning:hover { color: #7c2d12; background: #ffedd5; border-color: #fdba74; }

.dn-btn-danger {
    color: #be123c;
    border-color: #fecdd3;
    background: #fff1f2;
}

.dn-btn-danger:hover { color: #9f1239; background: #ffe4e6; border-color: #fda4af; }

.dn-btn-icon {
    width: 31px;
    min-width: 31px;
    padding: 0;
    border-radius: 10px;
}

.dn-btn-compact {
    min-height: 25px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 660;
}

/* Cards */
.dn-card {
    min-width: 0;
    border: 1px solid var(--dn-line);
    border-radius: var(--dn-radius-lg);
    background: var(--dn-surface);
    box-shadow: var(--dn-shadow-sm);
    overflow: hidden;
}

.dn-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-width: 0;
    padding: 12px 14px;
    border-bottom: 1px solid var(--dn-line-soft);
}

.dn-card-title {
    min-width: 0;
    margin: 0;
    color: var(--dn-text);
    font-size: 16px;
    font-weight: 850;
    line-height: 1.25;
}

.dn-card-subtitle {
    display: block;
    margin-top: 2px;
    color: var(--dn-muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

.dn-card-body {
    min-width: 0;
    padding: 12px 14px;
}

.dn-card-footer,
.dn-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    padding: 10px 14px;
    border-top: 1px solid var(--dn-line-soft);
}

/* Form fields */
.dn-form-field {
    display: grid;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.dn-label {
    margin: 0;
    color: var(--dn-text);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.3;
}

.dn-input,
.dn-select,
.dn-textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--dn-line);
    border-radius: 10px;
    background: var(--dn-surface);
    color: var(--dn-text);
    font: inherit;
    font-size: 12.5px;
    line-height: 1.3;
}

.dn-input,
.dn-select {
    min-height: 34px;
    padding: 0 10px;
}

.dn-textarea {
    min-height: 96px;
    padding: 9px 10px;
    resize: vertical;
}

.dn-input:focus-visible,
.dn-select:focus-visible,
.dn-textarea:focus-visible {
    outline: none;
    border-color: var(--dn-primary-strong);
    box-shadow: var(--dn-focus-ring);
}

.dn-input:disabled,
.dn-select:disabled,
.dn-textarea:disabled,
.dn-input[readonly],
.dn-textarea[readonly] {
    background: var(--dn-surface-soft);
    color: var(--dn-muted);
    cursor: not-allowed;
    opacity: .72;
}

[data-dn-comuna-select]:disabled {
    background: #eef2f6 !important;
    border-color: #d9e1e8 !important;
    color: #8a98a8 !important;
    cursor: not-allowed;
    opacity: 1;
}

.dn-input[aria-invalid="true"],
.dn-select[aria-invalid="true"],
.dn-textarea[aria-invalid="true"] {
    border-color: var(--dn-danger);
}

.dn-help-text,
.dn-error {
    margin: 0;
    font-size: 11px;
    font-weight: 620;
    line-height: 1.35;
}

.dn-help-text { color: var(--dn-muted); }
.dn-error { color: var(--dn-danger); }

/* Badges */
.dn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    min-height: 18px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--dn-surface-soft);
    color: var(--dn-muted);
    font-size: 10px;
    font-weight: 670;
    line-height: 1;
    white-space: nowrap;
}

.dn-badge-success { background: #f0fdf4; color: #166534; border-color: #d4f6df; }
.dn-badge-warning { background: #fff8ed; color: #b45309; border-color: #fde6bf; }
.dn-badge-danger { background: #fff5f6; color: #be123c; border-color: #f8d6dd; }
.dn-badge-info { background: #eef6ff; color: #17426f; border-color: #d5e7f7; }
.dn-badge-muted { background: #f6f8fb; color: #64748b; border-color: #e6edf4; }
.dn-badge-money { background: #f3fbf5; color: #15803d; border-color: #d8f2df; }
.dn-badge-clinical { background: #eef8f6; color: #0f766e; border-color: #d1e9e5; }

/* Empty states */
.dn-empty-state {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 14px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--dn-muted);
    text-align: center;
}

.dn-empty-state-title {
    margin: 0;
    color: var(--dn-text);
    font-size: 13.5px;
    font-weight: 780;
    line-height: 1.25;
}

.dn-empty-state-description {
    max-width: 520px;
    margin: 0;
    color: var(--dn-muted);
    font-size: 12.5px;
    font-weight: 620;
    line-height: 1.45;
}

.dn-empty-state-action {
    margin-top: 4px;
}

.dn-empty-state-informativo {
    background: transparent;
}

.dn-empty-state-accionable {
    border: 1px solid var(--dn-line-soft);
    border-radius: var(--dn-radius-md);
    background: #fbfdff;
}

.dn-empty-state-error {
    border: 1px solid #f8d6dd;
    border-radius: var(--dn-radius-md);
    background: #fff7f8;
}

.dn-empty-state-error .dn-empty-state-title {
    color: var(--dn-danger);
}

/* Modal */
.dn-modal {
    position: fixed;
    inset: 0;
    z-index: var(--dn-z-modal-backdrop);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(17, 34, 53, .30);
    backdrop-filter: blur(8px);
}

.dn-modal.is-open {
    display: flex;
}

.dn-modal-panel {
    position: relative;
    z-index: var(--dn-z-modal-panel);
    width: min(760px, 100%);
    max-height: min(820px, calc(100vh - 36px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(220, 231, 238, .9);
    border-radius: var(--dn-radius-lg);
    background: var(--dn-surface);
    box-shadow: 0 22px 60px rgba(15, 23, 42, .17);
    animation: dn-modal-in .16s cubic-bezier(.16, 1, .3, 1);
}

.dn-modal-panel-sm { width: min(520px, 100%); }
.dn-modal-panel-lg { width: min(980px, 100%); }
.dn-modal-panel-compact { width: min(480px, 100%); }
.dn-modal-panel-form { width: min(760px, 100%); }
.dn-modal-panel-wide { width: min(1040px, 100%); }

@keyframes dn-modal-in {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to { opacity: 1; transform: none; }
}

.dn-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 17px;
    border-bottom: 1px solid var(--dn-line-soft);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.dn-modal-title {
    margin: 0;
    color: var(--dn-text);
    font-size: 18px;
    font-weight: 820;
    line-height: 1.12;
}

.dn-modal-subtitle {
    margin: 5px 0 0;
    color: var(--dn-muted);
    font-size: 12.5px;
    font-weight: 620;
    line-height: 1.35;
}

.dn-modal-close {
    flex: 0 0 auto;
}

.dn-modal-body {
    min-height: 0;
    overflow: auto;
    padding: 18px;
    background: #fff;
}

.dn-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 17px;
    border-top: 1px solid var(--dn-line-soft);
    background: var(--dn-surface-soft);
}

.dn-modal-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 28px 18px;
    color: var(--dn-muted);
    font-size: 13px;
    font-weight: 750;
    text-align: center;
}

.dn-modal-state-error {
    color: var(--dn-danger);
}

.dn-modal-error {
    margin: 0 0 14px;
    padding: 11px 13px;
    border: 1px solid #f8d6dd;
    border-radius: var(--dn-radius-sm);
    background: #fff7f8;
    color: var(--dn-danger);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.dn-modal.is-loading .dn-modal-panel {
    cursor: progress;
}

.dn-modal-spinner {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 3px solid #dce7ee;
    border-top-color: var(--dn-primary-strong);
    animation: dn-spin .78s linear infinite;
}

@keyframes dn-spin { to { transform: rotate(360deg); } }

body.dn-modal-open {
    overflow: hidden;
}

.admin-modal-backdrop,
.op-confirm-modal,
.op-bulk-modal,
.ops-action-modal-backdrop,
.ops-modal-backdrop,
.confirmaciones-modal,
.evolucion-edit-modal,
.gestion-drawer {
    position: fixed !important;
    z-index: var(--dn-z-modal-backdrop) !important;
}

.admin-modal-card,
.op-confirm-dialog,
.op-bulk-dialog,
.ops-action-modal-card,
.ops-modal-card,
.confirmaciones-dialogo,
.evolucion-edit-panel,
.evolucion-edit-dialog,
.gestion-drawer-panel {
    position: relative;
    z-index: var(--dn-z-modal-panel) !important;
}

/* Quick Action Modal */
.dn-quick-modal .dn-modal-panel {
    width: min(540px, 100%);
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.dn-quick-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 17px 12px;
    border-bottom: 1px solid var(--dn-line-soft);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.dn-quick-heading {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.dn-quick-title {
    margin: 0;
    color: var(--dn-text);
    font-size: 19px;
    font-weight: 820;
    line-height: 1.12;
    letter-spacing: 0;
}

.dn-quick-subtitle {
    margin: 0;
    color: var(--dn-muted);
    font-size: 12.5px;
    font-weight: 640;
    line-height: 1.35;
}

.dn-quick-body {
    display: grid;
    gap: 11px;
    min-height: 0;
    overflow: auto;
    padding: 13px 17px;
    background: #fff;
}

.dn-quick-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.dn-quick-field {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.dn-quick-field-wide {
    grid-column: 1 / -1;
}

.dn-quick-label {
    color: var(--dn-muted);
    font-size: 9.5px;
    font-weight: 780;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.dn-quick-value {
    min-width: 0;
    color: var(--dn-text);
    font-size: 12.5px;
    font-weight: 690;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.dn-quick-muted {
    color: var(--dn-muted);
}

.dn-quick-state {
    display: grid;
    gap: 7px;
    padding-top: 2px;
}

.dn-quick-state-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.dn-quick-state-btn {
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid var(--dn-line);
    border-radius: 999px;
    background: #fff;
    color: var(--dn-text);
    font-size: 11px;
    font-weight: 720;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.dn-quick-state-btn:hover {
    border-color: var(--dn-primary-line);
    background: var(--dn-primary-soft);
    color: var(--dn-primary-strong);
}

.dn-quick-state-btn.is-active {
    border-color: var(--dn-primary-line);
    background: var(--dn-primary-soft);
    color: var(--dn-primary-strong);
}

.dn-quick-state-btn.is-loading {
    opacity: .58;
    pointer-events: none;
}

.dn-quick-note {
    display: none;
    padding: 9px 10px;
    border: 1px solid #fed7aa;
    border-radius: var(--dn-radius-sm);
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    font-weight: 700;
}

.dn-quick-note.is-alert {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.dn-quick-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 11px 17px;
    border-top: 1px solid var(--dn-line-soft);
    background: var(--dn-surface-soft);
}

.dn-quick-footer form {
    margin: 0;
}

.dn-quick-footer .dn-btn {
    min-height: 32px;
}

.dn-quick-danger-note {
    flex-basis: 100%;
    color: var(--dn-danger);
    font-size: 12px;
    font-weight: 680;
    text-align: right;
}

@media (max-width: 720px) {
    .dn-modal {
        align-items: flex-end;
        padding: 0;
    }

    .dn-modal-panel,
    .dn-modal-panel-sm,
    .dn-modal-panel-lg,
    .dn-modal-panel-compact,
    .dn-modal-panel-form,
    .dn-modal-panel-wide {
        width: 100vw;
        max-height: calc(100vh - 18px);
        border-radius: 20px 20px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }

    .dn-modal-header,
    .dn-modal-body,
    .dn-modal-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .dn-modal-footer .dn-btn {
        flex: 1 1 auto;
    }

    .dn-quick-header,
    .dn-quick-body,
    .dn-quick-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .dn-quick-summary {
        grid-template-columns: 1fr;
    }

    .dn-quick-footer {
        justify-content: stretch;
    }

    .dn-quick-footer .dn-btn,
    .dn-quick-footer form,
    .dn-quick-footer form .dn-btn {
        width: 100%;
    }

    .dn-quick-danger-note {
        text-align: left;
    }
}
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
/* Skeleton global para cargas de regiones completas. */
.dn-skeleton-host { position: relative; min-height: 180px; }
.dn-skeleton-host--overlay { overflow: hidden; }
.dn-skeleton-host--overlay > :not(.dn-skeleton) { visibility: hidden !important; }
.dn-skeleton {
    box-sizing: border-box;
    display: grid;
    gap: 14px;
    width: 100%;
    min-height: clamp(260px, 42vh, 540px);
    padding: clamp(14px, 2vw, 22px);
    color: transparent;
    pointer-events: none;
}
.dn-skeleton-host--overlay > .dn-skeleton { position: absolute; inset: 0; z-index: 20; overflow: hidden; background: #f8fbfc; }
.dn-skeleton-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; align-content:start; }
.dn-skeleton-stack { display:grid; gap:14px; align-content:start; }
.dn-skeleton-card,.dn-skeleton-table,.dn-skeleton-form,.dn-skeleton-calendar { background:#fff; border:1px solid #e2e8f0; border-radius:18px; padding:18px; box-shadow:0 10px 28px rgba(15,23,42,.035); }
.dn-skeleton-line,.dn-skeleton-block,.dn-skeleton-cell,.dn-skeleton-field,.dn-skeleton-action { display:block; border-radius:8px; background:#e9eff4; background-image:linear-gradient(100deg,#e9eff4 20%,#f8fafc 42%,#e9eff4 64%); background-size:220% 100%; animation:dn-skeleton-shimmer 1.55s ease-in-out infinite; }
.dn-skeleton-line { height:11px; margin-top:11px; }
.dn-skeleton-line:first-child { margin-top:0; }
.dn-skeleton-line.is-title { width:42%; height:16px; }
.dn-skeleton-line.is-short { width:62%; }
.dn-skeleton-block { height:72px; margin-top:16px; }
.dn-skeleton-block.is-tall { height:108px; }
.dn-skeleton-row { display:grid; grid-template-columns:1.1fr 1.8fr 1fr .8fr; gap:12px; padding:13px 0; border-top:1px solid #edf1f5; }
.dn-skeleton-row:first-child { border-top:0; }
.dn-skeleton-cell { height:12px; }
.dn-skeleton-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:22px; }
.dn-skeleton-field { height:48px; }
.dn-skeleton-action { width:150px; height:42px; margin-top:20px; }
.dn-skeleton-calendar { padding:12px; }
.dn-skeleton-calendar-head .dn-skeleton-row,.dn-skeleton-calendar-grid .dn-skeleton-row { grid-template-columns:72px repeat(5,minmax(0,1fr)); gap:10px; }
.dn-skeleton-calendar-head .dn-skeleton-cell { height:24px; }
.dn-skeleton-calendar-grid .dn-skeleton-cell { height:58px; border-radius:10px; }
@keyframes dn-skeleton-shimmer { to { background-position-x:-220%; } }
@media (max-width:760px) {
    .dn-skeleton { min-height:360px; padding:12px; }
    .dn-skeleton-cards,.dn-skeleton-fields { grid-template-columns:1fr; }
    .dn-skeleton-row { grid-template-columns:1fr 1.4fr; }
    .dn-skeleton-row .dn-skeleton-cell:nth-child(n+3) { display:none; }
    .dn-skeleton-calendar-head .dn-skeleton-row,.dn-skeleton-calendar-grid .dn-skeleton-row { grid-template-columns:48px repeat(2,minmax(0,1fr)); }
    .dn-skeleton-calendar-head .dn-skeleton-cell:nth-child(n+4),.dn-skeleton-calendar-grid .dn-skeleton-cell:nth-child(n+4) { display:none; }
}
@media (prefers-reduced-motion:reduce) {
    .dn-skeleton-line,.dn-skeleton-block,.dn-skeleton-cell,.dn-skeleton-field,.dn-skeleton-action { animation:none; background-image:none; }
}
.dn-notification-host {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    z-index: 2147483647;
    display: flex;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    pointer-events: none;
}
.dn-notification { display:flex; align-items:flex-start; gap:12px; padding:14px 14px 14px 16px; border:1px solid transparent; border-radius:14px; box-shadow:0 18px 48px rgba(8,35,52,.28); color:#fff; pointer-events:auto; animation:dn-notification-in .2s ease-out; }
.dn-notification--success { background:#166534; border-color:#15803d; }
.dn-notification--error { background:#991b1b; border-color:#b91c1c; }
.dn-notification--warning { background:#9a3412; border-color:#c2410c; }
.dn-notification--info { background:#174f70; border-color:#1e668e; }
.dn-notification__body { flex:1; font-size:14px; font-weight:700; line-height:1.45; }
.dn-notification__close { border:0; background:transparent; color:inherit; font:inherit; font-size:20px; line-height:1; cursor:pointer; opacity:.9; }
.dn-notification.is-leaving { animation:dn-notification-out .2s ease-in forwards; }
@keyframes dn-notification-in { from { opacity:0; transform:translateY(-8px); } }
@keyframes dn-notification-out { to { opacity:0; transform:translateY(-8px); } }
@media (max-width:575px) { .dn-notification-host { left:12px; right:12px; width:auto; } }
@media (prefers-reduced-motion:reduce) { .dn-notification, .dn-notification.is-leaving { animation:none; } }
/* Confirmación reutilizable para formularios modales con cambios pendientes. */
.dn-unsaved-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147483200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(8, 28, 43, .44);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.dn-unsaved-dialog {
    box-sizing: border-box;
    width: min(100%, 430px);
    padding: 26px;
    border: 1px solid #dce8ed;
    border-radius: 20px;
    background: #fff;
    color: #102a3b;
    box-shadow: 0 24px 64px rgba(8, 35, 52, .22);
    text-align: center;
}

.dn-unsaved-icon {
    display: grid;
    width: 42px;
    height: 42px;
    margin: 0 auto 13px;
    place-items: center;
    border-radius: 14px;
    background: #fff7ed;
    color: #b45309;
    font-size: 20px;
    font-weight: 850;
}

.dn-unsaved-dialog h2 { margin: 0; color: #102a3b; font-size: 19px; line-height: 1.25; }
.dn-unsaved-dialog p { margin: 8px 0 0; color: #5b6f7b; font-size: 14px; line-height: 1.5; }
.dn-unsaved-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.dn-unsaved-actions button { min-height: 44px; padding: 0 16px; border-radius: 11px; font: inherit; font-size: 14px; font-weight: 750; cursor: pointer; }
.dn-unsaved-keep { border: 1px solid #174f70; background: #174f70; color: #fff; }
.dn-unsaved-discard { border: 1px solid #d8e3e8; background: #fff; color: #36576a; }
.dn-unsaved-actions button:focus-visible { outline: 3px solid rgba(15, 118, 110, .24); outline-offset: 3px; }

@media (max-width: 520px) {
    .dn-unsaved-backdrop { align-items: end; padding: 12px; }
    .dn-unsaved-dialog { padding: 24px 20px 20px; border-radius: 20px; }
    .dn-unsaved-actions { flex-direction: column; }
    .dn-unsaved-actions button { width: 100%; }
}
