/* «Nuevo para ti» (assets/js/novedades-highlight.js). Mismos tokens que el tour (feature-tour.css). */

.mgn-card {
    --mgn-primary: var(--mg-primary, #dc3751);
    --mgn-violet: #7c3aed;
    --mgn-ink: #0f172a;
    --mgn-muted: #64748b;
    --mgn-surface: #fff;
    --mgn-soft: #f8f7fb;
    --mgn-line: rgba(15, 23, 42, 0.08);
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1980;
    width: 384px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    background: var(--mgn-surface);
    color: var(--mgn-ink);
    box-shadow: 0 30px 70px -20px rgba(15, 23, 42, 0.45), 0 0 0 1px var(--mgn-line);
    overflow: hidden;
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    transition: opacity 0.28s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.mgn-card.is-in { opacity: 1; transform: none; }
.mgn-card.is-out { opacity: 0; transform: translateY(16px) scale(0.98); }

.mgn-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--mgn-primary), var(--mgn-violet));
}

.mgn-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 6px 18px;
}

.mgn-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--mgn-primary);
    background: rgba(220, 55, 81, 0.1);
}

.mgn-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--mgn-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.mgn-close:hover { background: var(--mgn-soft); color: var(--mgn-ink); }

.mgn-body { padding: 6px 18px 4px; overflow-y: auto; }

.mgn-media {
    position: relative;
    display: block;
    width: 100%;
    margin: 6px 0 14px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    background: var(--mgn-soft);
    box-shadow: 0 0 0 1px var(--mgn-line);
    aspect-ratio: 16 / 9;
}

.mgn-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mgn-media--video { cursor: pointer; }

.mgn-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    background: var(--mgn-primary);
    box-shadow: 0 10px 30px -8px rgba(220, 55, 81, 0.8);
    transition: transform 0.2s ease;
}

.mgn-media--video:hover .mgn-play { transform: scale(1.08); }

.mgn-media-label {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: rgba(15, 23, 42, 0.7);
}

.mgn-title { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; color: var(--mgn-ink); }
.mgn-summary { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--mgn-muted); }
.mgn-how { margin: 14px 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mgn-muted); }

.mgn-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mgn-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--mgn-ink); }

.mgn-step-n {
    flex: 0 0 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--mgn-primary), var(--mgn-violet));
}

.mgn-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px 0;
}

.mgn-arrow {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: var(--mgn-soft);
    color: var(--mgn-ink);
    cursor: pointer;
}

.mgn-arrow:disabled { opacity: 0.35; cursor: default; }
.mgn-dots { display: flex; gap: 5px; }
.mgn-dot { width: 6px; height: 6px; border-radius: 999px; background: rgba(15, 23, 42, 0.18); transition: width 0.2s ease, background 0.2s ease; }
.mgn-dot.is-on { width: 18px; background: linear-gradient(90deg, var(--mgn-primary), var(--mgn-violet)); }
.mgn-count { font-size: 12px; color: var(--mgn-muted); }
.mgn-all { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--mgn-primary); text-decoration: none; }
.mgn-all:hover { text-decoration: underline; }

.mgn-foot { padding: 12px 18px 18px; }
.mgn-actions { display: flex; gap: 10px; align-items: center; }

.mgn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.mgn-btn--primary {
    flex: 1;
    color: #fff;
    background: linear-gradient(135deg, var(--mgn-primary), #b81f45);
    box-shadow: 0 12px 24px -12px rgba(220, 55, 81, 0.9);
}

.mgn-btn--primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 16px 28px -12px rgba(220, 55, 81, 0.95); }
.mgn-btn--ghost { background: transparent; color: var(--mgn-muted); }
.mgn-btn--ghost:hover { background: var(--mgn-soft); color: var(--mgn-ink); }

.mgn-card :focus-visible { outline: 3px solid rgba(124, 58, 237, 0.55); outline-offset: 2px; }

/* Video del tutorial */
.mgn-video {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.75);
    animation: mgn-fade 0.2s ease;
}

.mgn-video-box { position: relative; width: min(960px, 100%); aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.8); }
.mgn-video-box iframe { width: 100%; height: 100%; border: 0; display: block; }

.mgn-video-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: rgba(15, 23, 42, 0.65);
    cursor: pointer;
}

@keyframes mgn-fade { from { opacity: 0; } to { opacity: 1; } }

/* Móvil: hoja inferior */
@media (max-width: 640px) {
    .mgn-card {
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        max-height: 82vh;
        border-radius: 22px 22px 0 0;
        transform: translateY(100%);
    }
    .mgn-card.is-in { transform: none; }
    .mgn-card.is-out { transform: translateY(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .mgn-card, .mgn-dot, .mgn-btn, .mgn-play { transition: none; }
}

/* Modo oscuro */
[data-theme="dark"] .mgn-card {
    --mgn-ink: #f1f5f9;
    --mgn-muted: #a3a9b8;
    --mgn-surface: #1b1b22;
    --mgn-soft: #26262f;
    --mgn-line: rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--mgn-line);
}

[data-theme="dark"] .mgn-badge { background: rgba(220, 55, 81, 0.18); }
[data-theme="dark"] .mgn-dot { background: rgba(255, 255, 255, 0.2); }

/* Widget «Novedad destacada» (backend/panel/notifications/widgets/widget-notifications-priority.html).
   Misma familia que «Novedades recientes»: tarjeta blanca, título de widget, acentos de marca.
   Ocupa todo el alto de su fila y muestra la imagen o el video de la novedad. */
.widget-item:has(.card-notifications-priority) { display: flex; flex-direction: column; }
.widget-item:has(.card-notifications-priority) .widget-content { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.cnp { flex: 1 1 auto; height: 100%; min-height: 320px; display: flex; flex-direction: column; }
.cnp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cnp .cnp-heading { margin: 0; }
.cnp-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; white-space: nowrap;
    font-size: 12px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
    color: var(--mg-primary, #dc3751); background: var(--mg-primary-light, rgba(220, 55, 81, 0.1));
}
.cnp-media {
    position: relative; display: block; width: 100%; margin: 0 0 16px; padding: 0; border: 0;
    border-radius: var(--border-radius-small, 12px); overflow: hidden; aspect-ratio: 16 / 9; max-height: 320px;
    background: var(--mg-white-100, #f6f6f8); box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.cnp-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform 0.4s ease; }
.cnp-media--video { cursor: pointer; }
.cnp-media--video:hover img { transform: scale(1.03); }
.cnp-play {
    position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
    background: var(--mg-primary, #dc3751); box-shadow: 0 12px 30px -8px rgba(220, 55, 81, 0.8); transition: transform 0.2s ease;
}
.cnp-media--video:hover .cnp-play { transform: scale(1.08); }
.cnp-media-label {
    position: absolute; left: 12px; bottom: 12px; padding: 5px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 700; color: #fff; background: rgba(15, 23, 42, 0.72);
}
.dashboard-card h3.cnp-title { margin: 0; font-size: 1.15rem; line-height: 1.35; font-weight: 700; color: var(--mg-grey); letter-spacing: -0.01em; }
.cnp-summary { margin: 8px 0 0; font-size: 0.92rem; line-height: 1.5; color: var(--mg-lavanda-500); }
.cnp-foot { margin-top: auto; padding-top: 18px; }
.cnp-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8rem; color: var(--mg-lavanda-500); margin-bottom: 14px; }
.cnp-meta i { margin-right: 4px; }
.cnp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.cnp-btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 12px;
    font-size: 0.9rem; font-weight: 700; color: #fff; text-decoration: none;
    background: linear-gradient(135deg, var(--mg-primary, #dc3751), #b81f45); box-shadow: 0 12px 24px -12px rgba(220, 55, 81, 0.9);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cnp-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 16px 28px -12px rgba(220, 55, 81, 0.95); }
.cnp-link { font-size: 0.88rem; font-weight: 600; color: var(--mg-primary, #dc3751); text-decoration: none; }
.cnp-link:hover { text-decoration: underline; }
[data-theme="dark"] .dashboard-card h3.cnp-title { color: #f1f5f9; }
[data-theme="dark"] .cnp-media { background: #26262f; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .cnp-badge { background: rgba(220, 55, 81, 0.18); }
