.topbar .navbar .notification-dropdown-menu {
    width: min(410px, calc(100vw - 24px));
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.topbar .navbar .notification-dropdown-menu::after {
    display: none;
}

.staff-notification-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 12px);
    right: -55px;
    width: min(410px, calc(100vw - 96px));
}

.notification-panel,
.notification-history {
    --panel-bg: #fff;
    --panel-text: #192b25;
    --panel-muted: #52615b;
    --panel-border: #dfe6e2;
    --read-bg: #eef0f2;
    --read-hover: #e1e5e8;
    --unread-bg: #ffe3e5;
    --unread-hover: #ffd5d9;
    --unread-accent: #d72138;
    --footer-text: #176343;
    --footer-hover: #edf7f0;
}

.notification-panel {
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    color: var(--panel-text);
    background: var(--panel-bg);
    box-shadow: 0 16px 40px rgba(21, 40, 32, .18);
    text-align: left;
}

html.dark-theme :is(.notification-panel, .notification-history) {
    --panel-bg: #202725;
    --panel-text: #f5f7f6;
    --panel-muted: #c0cbc6;
    --panel-border: #3a4741;
    --read-bg: #323a3e;
    --read-hover: #3e484d;
    --unread-bg: #51282e;
    --unread-hover: #653039;
    --unread-accent: #ff5c6e;
    --footer-text: #a5e2bf;
    --footer-hover: #2c3d34;
}

.notification-panel-heading {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--panel-border);
    font-size: 16px;
    font-weight: 750;
    line-height: 1.25;
}

.notification-panel-list {
    display: grid;
    gap: 6px;
    max-height: min(440px, 62vh);
    max-height: min(440px, 62dvh);
    padding: 8px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

.notification-panel [hidden] {
    display: none;
}

.notification-panel .notification-row.dropdown-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    color: var(--panel-text);
    background: var(--row-bg);
    white-space: normal;
    overflow-wrap: anywhere;
    text-decoration: none;
    box-sizing: border-box;
}

.notification-row--read {
    --row-bg: var(--read-bg);
    --row-hover: var(--read-hover);
}

.notification-row--unread {
    --row-bg: var(--unread-bg);
    --row-hover: var(--unread-hover);
}

.notification-panel .notification-row.dropdown-item:is(:hover, :focus-visible) {
    background: var(--row-hover);
}

.notification-panel .dropdown-item:focus-visible {
    outline: 2px solid var(--footer-text);
    outline-offset: -2px;
}

.notification-row-icon {
    position: relative;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    color: #475569;
    background: #e2e8f0;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}

.notification-row-icon--finance { color: #176343; background: #d9f3e4; }
.notification-row-icon--patient { color: #b91d36; background: #fff4f5; }
.notification-row-icon--staff { color: #305ba7; background: #dce9ff; }
.notification-row-icon--product { color: #8b5020; background: #fce8cc; }

.notification-row-icon svg {
    display: block;
    width: 21px;
    height: 21px;
}

.notification-row-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--panel-bg);
    border-radius: 50%;
    background: var(--unread-accent);
    box-sizing: content-box;
}

.notification-row-title,
.notification-row-message,
.notification-row-meta {
    display: block;
}

.notification-row-title {
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
}

.notification-row--unread .notification-row-title {
    font-weight: 750;
}

.notification-row-message {
    margin-top: 3px;
    color: var(--panel-muted);
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-line;
}

.notification-row-meta {
    margin-top: 4px;
    color: var(--panel-muted);
    font-size: 11px;
    line-height: 1.4;
    white-space: pre-line;
}

.notification-panel-empty {
    margin: 0;
    padding: 16px 8px;
    color: var(--panel-muted);
    text-align: center;
    font-size: 13px;
}

.notification-panel .notification-panel-footer.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border-top: 1px solid var(--panel-border);
    color: var(--footer-text);
    background: var(--panel-bg);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
}

.notification-panel .notification-panel-footer.dropdown-item:is(:hover, :focus-visible) {
    color: var(--footer-text);
    background: var(--footer-hover);
}

.notification-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.notification-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 12px;
    padding: clamp(12px, 2vw, 20px);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: var(--row-bg);
    overflow-wrap: anywhere;
}

.notification-card h2 {
    margin: 0 0 4px;
    color: var(--panel-text);
    font: 650 17px/1.4 Manrope, sans-serif;
}

.notification-card.notification-row--unread h2 {
    font-weight: 750;
}

.notification-message {
    margin: 0;
    color: var(--panel-muted);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 12px;
    color: var(--panel-muted);
    font-size: 12px;
}

.notification-card .notification-meta a {
    color: var(--footer-text);
    font-weight: 700;
}

@media (max-width: 620px) {
    .topbar .navbar .notification-dropdown-menu.dropdown-menu-end {
        left: 8px;
        right: 8px;
        width: auto !important;
    }
}
