/* Notifications: the navigation bell (loaded on every page) and the page. */

.app-bell-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.app-bell-icon {
    width: 1.15rem;
    height: 1.15rem;
    display: inline-block;
}

.app-bell-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #dc4254;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
}

.notifications-page {
    display: grid;
    gap: 1.25rem;
}

.notifications-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.notifications-header h1 {
    margin: 0.15rem 0 0.35rem;
    font-size: 1.75rem;
    font-weight: 800;
    color: #1c315e;
}

.notifications-header p {
    margin: 0;
    max-width: 46rem;
    color: #72809f;
    font-size: 0.9rem;
}

.notifications-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.notifications-unread-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: #edf0ff;
    color: #1c315e;
    font-size: 0.82rem;
    font-weight: 700;
}

.notifications-unread-pill.has-unread {
    background: #fde7ea;
    color: #a91e39;
}

.notifications-inline-form {
    margin: 0;
}

.notifications-preferences {
    border: 1px solid rgba(91, 106, 140, 0.18);
    border-radius: 0.9rem;
    background: #fff;
    padding: 0.85rem 1.1rem;
}

.notifications-preferences summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    list-style: none;
}

.notifications-preferences summary::-webkit-details-marker {
    display: none;
}

.notifications-preferences-title {
    font-weight: 800;
    color: #1c315e;
}

.notifications-preferences-state {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
}

.notifications-preferences-state.is-on {
    background: #e6f4ea;
    color: #1e6b3a;
}

.notifications-preferences-state.is-off {
    background: #edf0ff;
    color: #3b4a6b;
}

.notifications-preferences-form {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(91, 106, 140, 0.15);
}

.notifications-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: #3b4a6b;
    font-size: 0.9rem;
}

.notifications-toggle input {
    margin-top: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
}

.notifications-preferences-note {
    margin: 0;
    color: #72809f;
    font-size: 0.8rem;
}

.notifications-preferences-form .btn {
    justify-self: start;
}

.notifications-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    border: 1px dashed rgba(91, 106, 140, 0.3);
    border-radius: 1rem;
    background: #fff;
    display: grid;
    gap: 0.5rem;
    justify-items: center;
}

.notifications-empty h2 {
    margin: 0;
    font-size: 1.15rem;
    color: #1c315e;
}

.notifications-empty p {
    margin: 0;
    color: #72809f;
    max-width: 34rem;
}

.notifications-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.7rem;
}

.notifications-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.9rem;
    align-items: start;
    padding: 0.95rem 1.1rem;
    border: 1px solid rgba(91, 106, 140, 0.18);
    border-left-width: 5px;
    border-radius: 0.9rem;
    background: #fff;
}

.notifications-item.is-unread {
    background: #fbfcff;
}

.notifications-item.is-read {
    opacity: 0.86;
}

.notifications-item-critical { border-left-color: #a91e39; }
.notifications-item-urgent { border-left-color: #dc4254; }
.notifications-item-warning { border-left-color: #d9a520; }

.notifications-item-icon {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 0.7rem;
    font-size: 0.95rem;
    font-weight: 900;
}

.notifications-item-critical .notifications-item-icon { background: #efc0c8; color: #8f1830; }
.notifications-item-urgent .notifications-item-icon { background: #f9d7db; color: #be1832; }
.notifications-item-warning .notifications-item-icon { background: #f8e4af; color: #a16400; }

.notifications-item-body {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.notifications-item-topline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.notifications-item-title {
    color: #1c315e;
    font-size: 0.98rem;
}

.notifications-item-unread-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #dc4254;
}

.notifications-item-status {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #edf0ff;
    color: #3b4a6b;
}

.notifications-item.is-current .notifications-item-status { background: #fde7ea; color: #a91e39; }
.notifications-item.is-resolved .notifications-item-status { background: #e6f4ea; color: #1e6b3a; }

.notifications-item-card {
    color: #1c315e;
    font-weight: 600;
    text-decoration: none;
}

.notifications-item-card:hover,
.notifications-item-card:focus-visible {
    text-decoration: underline;
}

.notifications-item-due {
    display: inline-block;
    justify-self: start;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.notifications-item-due-critical { background: #fde7ea; color: #a91e39; }
.notifications-item-due-urgent { background: #fdecef; color: #be1832; }
.notifications-item-due-warning { background: #fff3cf; color: #8a5a00; }

.notifications-item-amount {
    color: #3b4a6b;
    font-size: 0.88rem;
}

.notifications-item-meta {
    color: #72809f;
    font-size: 0.78rem;
}

.notifications-read-button {
    border: 1px solid rgba(91, 106, 140, 0.3);
    background: #fff;
    color: #1c315e;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 0.6rem;
    white-space: nowrap;
}

.notifications-read-button:hover,
.notifications-read-button:focus-visible {
    background: #edf0ff;
}

.notifications-pager {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0 1rem;
}

@media (max-width: 640px) {
    .notifications-item {
        grid-template-columns: auto 1fr;
    }

    .notifications-item .notifications-inline-form {
        grid-column: 2;
    }
}
