/* =====================================================================
   Avisos: the bell of the top bar (_NavBar), its panel, the toast of a
   new aviso and the page "Ver todos los avisos" (Pages/Notifications).
   Light style, like the light pages (site-13): white sheet, tinted header
   band, navy titles, small radius, no glows. The bell itself lives in the
   navy top bar, so it keeps the look of the bar.
   ===================================================================== */

.notif {
    position: relative;
    --notif-ink: #1e293b;
    --notif-title: #1e3a66;
    --notif-muted: #64748b;
    --notif-line: #e2e8f0;
    --notif-border: #dbe3ee;
    --notif-head: #e3eaf4;
    --notif-accent: #1d4ed8;
    --notif-unread: #f1f5ff;
}

/* ----- The bell: in the navy bar, with the bar's look ----- */
.notif-bell {
    position: relative;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(226, 232, 240, 0.85);
    font-size: 1.12rem;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

    .notif-bell:hover {
        background: rgba(255, 255, 255, 0.09);
        border-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }

    .notif-bell[aria-expanded="true"] {
        background: rgba(37, 99, 235, 0.22);
        border-color: rgba(147, 197, 253, 0.5);
        color: #fff;
    }

    .notif-bell:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(96, 165, 250, .5);
    }

    .notif-bell.has-unread {
        color: #fff;
    }

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 2px solid #0f1a35;
    background: #dc2626;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1;
}

/* ----- The panel: a white sheet with the tinted header band ----- */
.notif-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 1050;
    width: min(420px, calc(100vw - 24px));
    background: #fff;
    border: 1px solid var(--notif-border);
    border-radius: 10px;
    box-shadow: 0 18px 40px -12px rgba(15, 23, 42, .35), 0 2px 6px rgba(15, 23, 42, .08);
    overflow: hidden;
    color: var(--notif-ink);
    color-scheme: light;
}

.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--notif-head);
    border-bottom: 1px solid var(--notif-border);
}

    .notif-head b {
        color: var(--notif-title);
        font-size: 1rem;
        font-weight: 600;
    }

.notif-read-all {
    border: 0;
    background: none;
    padding: 0;
    color: var(--notif-accent);
    font-size: .8rem;
    font-weight: 500;
}

    .notif-read-all:hover:not(:disabled) {
        text-decoration: underline;
    }

    .notif-read-all:disabled {
        color: #94a3b8;
        cursor: default;
    }

.notif-list {
    max-height: min(460px, calc(100vh - 200px));
    overflow-y: auto;
}

.notif-section {
    padding: 12px 18px 6px;
    color: var(--notif-muted);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* ----- One aviso (panel, toast and page) ----- */
.notif-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--notif-line);
    color: var(--notif-ink);
    text-decoration: none;
    background-image: none;
    transition: background .12s ease;
}

    .notif-item:hover {
        background: #f8fafc;
        color: var(--notif-ink);
    }

    .notif-item.is-unread {
        background: var(--notif-unread);
    }

        .notif-item.is-unread:hover {
            background: #e8eefc;
        }

        .notif-item.is-unread::before {
            content: "";
            position: absolute;
            left: 7px;
            top: 26px;
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: var(--notif-accent);
        }

.notif-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1rem;
}

.notif-icon--warn { background: #fef3e2; color: #b45309; }
.notif-icon--violet { background: #f3e8ff; color: #7e22ce; }
.notif-icon--green { background: #e3f6ec; color: #15803d; }
.notif-icon--cyan { background: #e0f2fe; color: #0369a1; }
.notif-icon--blue { background: #e0e7ff; color: #1d4ed8; }
.notif-icon--red { background: #fde8eb; color: #be123c; }

.notif-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.notif-text {
    font-size: .86rem;
    line-height: 1.4;
}

    .notif-text b {
        color: var(--notif-title);
        font-weight: 700;
    }

.notif-meta {
    margin-top: 3px;
    color: var(--notif-muted);
    font-size: .76rem;
}

.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 18px;
    color: var(--notif-muted);
    font-size: .88rem;
}

    .notif-empty .bi {
        font-size: 1.6rem;
        color: #94a3b8;
    }

.notif-foot {
    display: block;
    padding: 11px;
    border-top: 1px solid var(--notif-border);
    background: #f8fafc;
    color: var(--notif-accent);
    font-size: .84rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    background-image: none;
}

    .notif-foot:hover {
        background: var(--notif-head);
        color: var(--notif-accent);
    }

/* ----- The toast of a new aviso: a small white card ----- */
.notif-toast {
    --notif-ink: #1e293b;
    --notif-title: #1e3a66;
    --notif-muted: #64748b;
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 1080;
    width: min(380px, calc(100vw - 32px));
    display: flex;
    gap: 12px;
    padding: 12px 40px 12px 14px;
    border: 1px solid #dbe3ee;
    border-left: 4px solid #1d4ed8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 40px -12px rgba(15, 23, 42, .35), 0 2px 6px rgba(15, 23, 42, .08);
    color: var(--notif-ink);
    color-scheme: light;
    text-decoration: none;
    background-image: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease;
}

    .notif-toast.is-shown {
        opacity: 1;
        transform: none;
    }

    .notif-toast:hover {
        color: var(--notif-ink);
        background: #f8fafc;
    }

.notif-toast--warn { border-left-color: #d97706; }
.notif-toast--violet { border-left-color: #7e22ce; }
.notif-toast--green { border-left-color: #15803d; }
.notif-toast--cyan { border-left-color: #0369a1; }
.notif-toast--red { border-left-color: #be123c; }

.notif-toast-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: #94a3b8;
    font-size: 1.1rem;
}

    .notif-toast-close:hover {
        background: #eef2f8;
        color: var(--notif-ink);
    }

/* ----- The page "Ver todos los avisos" (body.page-photo: over the background photo) ----- */
.notif-page {
    --notif-ink: #1e293b;
    --notif-title: #1e3a66;
    --notif-muted: #64748b;
    --notif-line: #e2e8f0;
    --notif-border: #dbe3ee;
    --notif-accent: #1d4ed8;
    --notif-unread: #f1f5ff;
    background: #fff;
    border: 1px solid var(--notif-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

    .notif-page .notif-section {
        background: #f8fafc;
        border-top: 1px solid var(--notif-line);
    }

        .notif-page .notif-section:first-child {
            border-top: 0;
        }

    .notif-page .notif-section + .notif-item {
        border-top: 1px solid var(--notif-line);
    }

    .notif-page .notif-item {
        padding: 14px 24px;
    }

        .notif-page .notif-item.is-unread::before {
            left: 10px;
            top: 28px;
        }

@media (prefers-reduced-motion: reduce) {
    .notif-toast { transition: none; }
}

@media print {
    .notif, .notif-toast { display: none !important; }
}
