/* NEW FILE — css/systemNotifications.css — notifications bell in the top bar (menu.php) */

.tn-bell {
    position: relative;
    display: table-cell;
    width: 1%;
    vertical-align: middle;
    padding: 0 18px 0 6px;
    font-family: 'Poppins', sans-serif;
    text-align: left;
}
.tn-bell.tn-bell--collapsed {
    display: block;
    float: right;
    width: auto;
    padding: 0;
    margin: 10px 26px 0 0;
}
@media (min-width: 1025px) {
    .tn-bell.tn-bell--collapsed { margin-top: 4px; }
}

.tn-bell__btn {
    position: relative;
    display: block;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
}
.tn-bell__btn:hover,
.tn-bell__btn[aria-expanded="true"] { background: rgba(255, 255, 255, .14); }
.tn-bell__btn:focus { outline: none; }
.tn-bell__btn:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: 1px; }
.tn-bell__btn svg { width: 22px; height: 22px; display: block; margin: 8px auto; }
.tn-bell__btn.has-alerts svg { animation: tn-ring 1.2s ease 1; transform-origin: 50% 2px; }

.tn-bell__badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e5484d;
    border: 2px solid #1f3b57;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    box-sizing: border-box;
}
.tn-bell__badge[hidden] { display: none; }

@keyframes tn-ring {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(8deg); }
    60% { transform: rotate(-6deg); }
    75% { transform: rotate(3deg); }
}

/* ── Panel ─────────────────────────────────────────────── */
.tn-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    width: 400px;
    max-width: calc(100vw - 24px);
    background: #fff;
    color: #1e293b;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(15, 35, 70, .22);
    overflow: hidden;
    text-align: left;
}
.tn-panel[hidden] { display: none; }
.tn-bell:not(.tn-bell--collapsed) .tn-panel { right: 12px; }

.tn-panel__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #eef1f5;
}
.tn-panel__title { font-size: 15px; font-weight: 600; color: #0f2a4a; margin: 0; }
.tn-panel__count {
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
    background: #e5484d; color: #fff; font-size: 11px; font-weight: 700;
    line-height: 22px; text-align: center; box-sizing: border-box;
}
.tn-panel__count.is-zero { background: #e7f6ec; color: #1a7f45; }
.tn-panel__checked { margin-left: auto; font-size: 11px; color: #8492a6; white-space: nowrap; }
.tn-panel__refresh {
    width: 28px; height: 28px; padding: 0; border: 1px solid #e3e8ef; border-radius: 8px;
    background: #fff; color: #1a4fa0; cursor: pointer; flex-shrink: 0;
}
.tn-panel__refresh:hover { background: #f5f9ff; }
.tn-panel__refresh svg { width: 14px; height: 14px; display: block; margin: 0 auto; }
.tn-panel__refresh.is-spinning svg { animation: tn-spin .9s linear infinite; }
@keyframes tn-spin { to { transform: rotate(360deg); } }

.tn-panel__body { max-height: 70vh; max-height: min(520px, 70vh); overflow-y: auto; }

.tn-group + .tn-group { border-top: 6px solid #f4f6fa; }
.tn-group__head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px 8px;
    position: sticky; top: 0; background: #fff; z-index: 1;
}
.tn-group__name { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5b6b80; }
.tn-group__count {
    font-size: 11px; font-weight: 700; color: #c23a2a; background: #fdeceb;
    border-radius: 9px; padding: 1px 8px;
}
.tn-group__all { margin-left: auto; font-size: 12px; font-weight: 600; color: #1a4fa0 !important; text-decoration: none; }
.tn-group__all:hover { text-decoration: underline; }

.tn-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid #f1f3f7;
    color: #1e293b !important;
    text-decoration: none !important;
    transition: background .12s;
}
a.tn-item:hover { background: #f5f9ff; }
.tn-item__icon {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px;
    background: #fdeceb; color: #d23b2f;
}
.tn-item__icon svg { width: 16px; height: 16px; display: block; margin: 8px auto; }
.tn-item--warning .tn-item__icon { background: #fff4e0; color: #c47a00; }
.tn-item__text { flex: 1; min-width: 0; font-size: 12px; line-height: 1.45; }
.tn-item__text strong { display: block; font-size: 13px; font-weight: 600; color: #0f2a4a; }
.tn-item__text span { display: block; color: #5b6b80; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-item__text em { display: block; font-style: normal; font-size: 11px; color: #94a3b8; margin-top: 1px; }
.tn-item__go { flex-shrink: 0; align-self: center; font-size: 20px; color: #b4bfcd; line-height: 1; }
a.tn-item:hover .tn-item__go { color: #1a4fa0; }

.tn-more {
    display: block; padding: 10px 16px; border-top: 1px solid #f1f3f7;
    font-size: 12px; font-weight: 600; color: #1a4fa0 !important; text-decoration: none; text-align: center;
}
.tn-more:hover { background: #f5f9ff; }

.tn-empty { padding: 32px 20px; text-align: center; font-size: 13px; color: #5b6b80; line-height: 1.6; }
.tn-empty code { font-size: 11px; background: #f4f6fa; padding: 1px 4px; border-radius: 4px; }
.tn-empty--ok strong { display: block; color: #0f2a4a; font-size: 14px; }
.tn-empty--ok span { display: block; }
.tn-empty__icon {
    display: block !important; width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%;
    background: #e7f6ec; color: #1a7f45;
}
.tn-empty__icon svg { width: 22px; height: 22px; display: block; margin: 11px auto; }

@media (max-width: 480px) {
    .tn-panel { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; max-width: none; }
}
