/*
    Glocke mit Benachrichtigungen in der Kopfleiste (Views/Components/Notifications/NotificationBell.razor).
    Alles ist auf ".ntf" bzw. ".ntf-popover" begrenzt; es werden nur Theme-Farben (var(--mud-palette-*)) verwendet.
*/

.ntf {
    position: relative;
    display: flex;
    align-items: center;
    margin-inline: 4px;
}

/* Zähler näher an die Glocke */
.ntf-badge .mud-badge.mud-badge-overlap {
    inset: auto auto calc(100% - 24px) calc(100% - 24px) !important;
    font-weight: 700;
}

/* Die Liste liegt über der unsichtbaren Fläche, die sie beim Klick daneben schließt */
.ntf-popover.mud-popover {
    z-index: calc(var(--mud-zindex-popover) + 1);
    margin-top: 6px;
    border: 1px solid color-mix(in srgb, var(--mud-palette-lines-default) 85%, transparent);
    border-radius: 14px;
    background-color: var(--mud-palette-surface);
    box-shadow: 0 18px 40px -14px rgba(16, 24, 40, 0.35), 0 4px 12px rgba(16, 24, 40, 0.08) !important;
    overflow: hidden;
}

.ntf-panel {
    display: flex;
    flex-direction: column;
    width: min(380px, calc(100vw - 24px));
    max-height: min(520px, calc(100vh - 110px));
    color: var(--mud-palette-text-primary);
    text-align: left;
}

.ntf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--mud-palette-lines-default) 85%, transparent);
}

.ntf-head__title {
    font-size: 1rem;
    font-weight: 700;
}

.ntf-clear {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 2px 6px;
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--mud-palette-primary);
    background-color: transparent;
    cursor: pointer;
}

.ntf-clear:hover {
    background-color: color-mix(in srgb, var(--mud-palette-primary) 9%, transparent);
}

.ntf-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 16px;
    font-size: 0.9375rem;
    color: var(--mud-palette-text-secondary);
}

.ntf-empty .mud-icon-root {
    font-size: 2rem;
    opacity: 0.55;
}

.ntf-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Eintrag: links der klickbare Inhalt (öffnet den Auftrag), rechts "Als gelesen markieren" */
.ntf-item {
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid color-mix(in srgb, var(--mud-palette-lines-default) 60%, transparent);
    transition: background-color 0.15s;
}

.ntf-item:last-child {
    border-bottom: 0;
}

.ntf-item:hover {
    background-color: var(--mud-palette-action-default-hover);
}

/* ungelesen */
.ntf-item--new {
    background-color: color-mix(in srgb, var(--mud-palette-primary) 7%, transparent);
}

.ntf-item__main {
    display: flex;
    flex: 1 1 auto;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 12px 8px 12px 16px;
    border: 0;
    font: inherit;
    text-align: left;
    color: inherit;
    background-color: transparent;
    cursor: pointer;
}

.ntf-item__read {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 12px 10px 0 0;
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 25%, transparent);
    border-radius: 8px;
    color: var(--mud-palette-primary);
    background-color: var(--mud-palette-surface);
    cursor: pointer;
    transition: background-color 0.15s;
}

.ntf-item__read:hover {
    background-color: color-mix(in srgb, var(--mud-palette-primary) 10%, var(--mud-palette-surface));
}

.ntf-item__icon {
    --ntf-kind: var(--mud-palette-primary);

    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--ntf-kind);
    background-color: color-mix(in srgb, var(--ntf-kind) 12%, transparent);
}

.ntf-item__icon--auftrag { --ntf-kind: var(--mud-palette-warning); }
.ntf-item__icon--termin { --ntf-kind: var(--mud-palette-info); }
.ntf-item__icon--taetigkeit { --ntf-kind: var(--mud-palette-success); }

.ntf-item__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.ntf-item__title {
    font-size: 0.875rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.ntf-item--new .ntf-item__title {
    font-weight: 700;
}

.ntf-item__body {
    font-size: 0.8125rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    color: var(--mud-palette-text-secondary);
}

.ntf-item__time {
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

