/* Notify Joe — admin notification inbox modal.
   Namespace: .nj-*    — 2026-04-20. */

.nj-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 18, 28, 0.62);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 2vw;
    z-index: 10500;
}
.nj-overlay.nj-visible { display: flex; }

.nj-modal {
    background: var(--bg-elevated, #ffffff);
    color: var(--text, #0f1720);
    width: min(880px, 96vw);
    max-height: 92vh;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nj-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(180deg, #f5f7fb 0%, #eef1f7 100%);
}
.nj-header h2 { margin: 0; font-size: calc(1.15rem * var(--type-scale, 1)); font-weight: 600; flex: 1; }
.nj-header-actions { display: flex; gap: 8px; align-items: center; }
.nj-toggle { font-size: calc(0.85rem * var(--type-scale, 1)); color: #566; user-select: none; cursor: pointer; }
.nj-toggle input { vertical-align: middle; margin-right: 4px; }

.nj-close { font-size: calc(1.4rem * var(--type-scale, 1)); line-height: 1; padding: 0 10px; }

.nj-summary {
    padding: 10px 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: calc(0.85rem * var(--type-scale, 1));
    background: #fafbfd;
}
.nj-summary-pill {
    background: #e9edf4;
    border-radius: 999px;
    padding: 3px 10px;
    color: #344;
    font-variant-numeric: tabular-nums;
}
.nj-summary-pill.nj-high { background: #fde1e1; color: #912; font-weight: 600; }

.nj-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    background: #f7f9fc;
}

.nj-item {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 8px 4px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.nj-item.nj-unread { border-left: 3px solid #2a6fdb; }
.nj-item.nj-pri-high.nj-unread { border-left: 3px solid #c62828; background: #fff8f8; }
.nj-item.nj-pri-low { opacity: 0.78; }
.nj-item.nj-dismissed { opacity: 0.55; background: #f3f4f6; }

.nj-item-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: calc(0.95rem * var(--type-scale, 1));
}
.nj-pri-mark { width: 1em; }
.nj-pri-high .nj-pri-mark { color: #c62828; }
.nj-source {
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: calc(0.78rem * var(--type-scale, 1));
    color: #567;
    background: #eef1f7;
    padding: 1px 6px;
    border-radius: 4px;
}
.nj-subject { flex: 1; font-weight: 600; color: #0f1720; }
.nj-when { color: #899; font-size: calc(0.8rem * var(--type-scale, 1)); font-variant-numeric: tabular-nums; }

.nj-item-body {
    margin: 8px 0 6px 0;
    font-size: calc(0.9rem * var(--type-scale, 1));
    line-height: 1.45;
    color: #233;
    white-space: pre-wrap;
    word-break: break-word;
}
.nj-item-body a { color: #2a6fdb; }

.nj-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

/* E.4.5 — per-category icon + one-click affordances */
.nj-cat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #eef1f7;
    font-size: 0.95em;
    margin-right: 2px;
}
.nj-cat-recoverability { background: #ffe9d6; }
.nj-cat-cascade-alert  { background: #fde1e1; }
.nj-cat-secret-scan    { background: #ffe1e1; }
.nj-cat-backup-pair, .nj-cat-db-integrity, .nj-cat-media-presence {
    background: #e1eefd;
}
.nj-cat-drift-queue    { background: #f1e6fb; }

.nj-affordance-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed rgba(0, 0, 0, 0.06);
}

.nj-aff-btn {
    font-size: calc(0.78rem * var(--type-scale, 1));
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    cursor: pointer;
    color: #345;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.nj-aff-btn:hover:not([disabled]) { background: #eef3fb; border-color: #2a6fdb; color: #2a6fdb; }
.nj-aff-btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.nj-aff-canonical { color: #2a6fdb; border-color: rgba(42, 111, 219, 0.3); }
.nj-aff-promote   { color: #1e7a3d; border-color: rgba(30, 122, 61, 0.3); }
.nj-aff-dismiss   { color: #883; border-color: rgba(136, 136, 51, 0.3); }
.nj-aff-rollback  { color: #c4731f; border-color: rgba(196, 115, 31, 0.3); }
.nj-aff-ack       { color: #1e7a3d; border-color: rgba(30, 122, 61, 0.3); }
.nj-aff-enforce   { color: #c62828; border-color: rgba(198, 40, 40, 0.3); }

.nj-aff-toast {
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: calc(0.75rem * var(--type-scale, 1));
    background: #e6f4e8;
    color: #1e7a3d;
}
.nj-aff-toast.nj-aff-toast-error { background: #fde1e1; color: #c62828; }

.nj-btn {
    font: inherit;
    font-size: calc(0.82rem * var(--type-scale, 1));
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    background: transparent;
    color: #2a6fdb;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.nj-btn:hover { background: #eef3fb; }
.nj-btn-ghost { color: #345; border-color: rgba(0, 0, 0, 0.12); }
.nj-btn-ghost:hover { background: #eef1f7; }

.nj-empty {
    text-align: center;
    color: #789;
    padding: 40px 20px;
    font-size: calc(0.95rem * var(--type-scale, 1));
}
.nj-error { color: #a33; }

.nj-footer {
    padding: 10px 20px;
    font-size: calc(0.78rem * var(--type-scale, 1));
    color: #678;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: #fafbfd;
}
.nj-footer code {
    background: #eef1f7;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.92em;
}

/* Admin card badge state — used on #notifyJoeBadge */
#notifyJoeBadge.nj-badge-has { background: #2a6fdb; color: #fff; font-weight: 600; }
#notifyJoeBadge.nj-badge-high { background: #c62828; color: #fff; font-weight: 700; }

@media (max-width: 600px) {
    .nj-modal { width: 100%; max-height: 100vh; border-radius: 0; }
    .nj-header { flex-wrap: wrap; }
    .nj-toggle { order: 10; width: 100%; }
    .nj-item-head { flex-wrap: wrap; }
    .nj-subject { flex-basis: 100%; }
}
