/* ReviewJalpi — global styles. Brand tokens live in brand/README.md.
 * Primary palette is "Sea Glass" (cyan-600). The historical --rj-indigo names
 * are kept as aliases so older view files keep rendering without changes.
 */

:root {
    /* Canonical brand tokens */
    --rj-primary:     #0891B2;   /* cyan-600  */
    --rj-primary-600: #0E7490;   /* cyan-700  */
    --rj-primary-50:  #ECFEFF;   /* cyan-50   */

    /* Aliases (old name → new value) so legacy templates still work */
    --rj-indigo:     var(--rj-primary);
    --rj-indigo-600: var(--rj-primary-600);
    --rj-indigo-50:  var(--rj-primary-50);

    --rj-gold:    #FBBF24;
    --rj-ink:     #0F172A;
    --rj-surface: #F7F7FA;
    --rj-border:  #E5E7EB;
    --rj-muted:   #6B7280;
    --rj-success: #10B981;
    --rj-warning: #F59E0B;
    --rj-danger:  #EF4444;
    --rj-radius:  10px;
}

html, body {
    font-family: 'Inter', 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    color: var(--rj-ink);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
}

/* Accessibility: visible keyboard focus ring */
:focus-visible {
    outline: 2px solid var(--rj-indigo);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Accessibility: skip-to-content link, visible on focus only */
.rj-skip-link {
    position: absolute;
    left: -1000px;
    top: 0;
    background: var(--rj-indigo);
    color: #fff;
    padding: 8px 14px;
    border-radius: 0 0 6px 0;
    font-size: 14px;
    z-index: 9999;
    text-decoration: none;
}
.rj-skip-link:focus { left: 0; }

/* Brand color overrides for Bootstrap primary */
.btn-primary,
.bg-primary {
    background-color: var(--rj-indigo) !important;
    border-color: var(--rj-indigo) !important;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--rj-indigo-600) !important;
    border-color: var(--rj-indigo-600) !important;
}
.btn-outline-primary {
    color: var(--rj-indigo);
    border-color: var(--rj-indigo);
}
.btn-outline-primary:hover {
    background-color: var(--rj-indigo);
    border-color: var(--rj-indigo);
    color: #fff;
}

.rj-btn {
    border-radius: var(--rj-radius);
    font-weight: 600;
    padding: .5rem 1.25rem;
}

.text-gold {
    color: var(--rj-gold);
}

/* Marketing navigation */
.rj-nav {
    background: #fff;
}
.rj-nav-link {
    color: var(--rj-ink);
    text-decoration: none;
    font-weight: 500;
}
.rj-nav-link:hover {
    color: var(--rj-indigo);
}

/* Marketing hero (cyan-warm gradient is defined further down) */
.rj-eyebrow {
    color: var(--rj-indigo);
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .8rem;
}
.rj-h1 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 800;
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.rj-h2 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    letter-spacing: -0.01em;
}
.rj-hero-icon {
    width: 100%;
    max-width: 280px;
    height: auto;
    filter: drop-shadow(0 14px 36px rgba(8, 145, 178, 0.30));
}

/* Sea Glass hero gradient — soft cyan top-left, warm gold top-right,
 * fading to white. Echoes the gold star without competing with it.
 */
.rj-hero {
    background:
        radial-gradient(at 0% 0%,    #CFFAFE 0,                  transparent 55%),
        radial-gradient(at 100% 0%,  #FEF3C7 0,                  transparent 50%),
        linear-gradient(180deg,       var(--rj-primary-50)  0%,  #ffffff 100%);
}

/* Auth */
.rj-auth-body {
    background: var(--rj-surface);
}
.rj-auth-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}
.rj-auth-card {
    background: #fff;
    border: 1px solid var(--rj-border);
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
}

.rj-auth-divider {
    position: relative;
    text-align: center;
    margin: 1.25rem 0;
}
.rj-auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--rj-border);
}
.rj-auth-divider span {
    position: relative;
    background: #fff;
    padding: 0 .75rem;
    color: var(--rj-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* Authyo SDK container -- the SDK injects a flex column with
 *   justify-content: space-between; height: 100%
 * which pushes its footer to the bottom of whatever container it sits in.
 * If our container has any explicit height (or inherits one from the auth
 * card), the SDK spreads its children apart and leaves a huge visible gap.
 *
 * Fix: force the SDK's outer flex container to size to its content, and
 * override the height:100% on its first child so space-between collapses. */
html body #authyo-sdk {
    margin: 0 0 .5rem !important;
    padding: 0 !important;
    text-align: center;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: block !important;
    flex: 0 0 auto !important;
}
html body #authyo-sdk div[style*="height: 100%"],
html body #authyo-sdk div[style*="flex-grow: 1"],
html body #authyo-sdk div[style*="justify-content: space-between"] {
    height: auto !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
    flex-grow: 0 !important;
    gap: 8px;
}

/* App shell (authenticated pages) */
.rj-app-shell {
    display: grid;
    grid-template-columns: 264px 1fr;
    min-height: 100vh;
    align-items: start;          /* let the sidebar be its own height (sticky), not stretched */
}

/* ----- Sidebar -----
 * Sticky to the viewport so the brand stays at the top and the user footer
 * stays at the bottom regardless of page scroll. Only the middle nav section
 * scrolls if it runs out of room (rare — happens on <700px viewports).
 *
 * Deep gradient base, subtle inner highlight at top, ambient cyan glow at bottom-left.
 * Each nav item slides right on hover, active item gets a cyan glow strip + gradient pill.
 */
.rj-app-side {
    background:
        radial-gradient(at 0% 100%, rgba(8, 145, 178, 0.18) 0, transparent 55%),
        linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: sticky;
    top: 0;
    height: 100vh;               /* full viewport height; footer never scrolls off-screen */
    overflow: hidden;            /* keep gradients tidy; inner nav handles its own overflow */
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.12);
}
.rj-app-side::before {
    /* Thin gradient hairline along the right edge for "lifted off the page" depth */
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; width: 1px;
    background: linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 60%);
    pointer-events: none;
}

/* Brand block — larger, on a subtle inner panel */
.rj-app-side .rj-brand {
    padding: 1.25rem 1.25rem 1rem;
    margin-bottom: .75rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    background: linear-gradient(180deg, rgba(255,255,255,.025) 0%, transparent 100%);
}
.rj-app-side .rj-brand a { display: inline-flex; align-items: center; }
.rj-app-side .rj-brand img {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(8, 145, 178, 0.35));
}

/* Nav list */
.rj-app-side nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .5rem 1rem;           /* was 0 .65rem — more side breathing room + top padding */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.08) transparent;
}
.rj-app-side nav::-webkit-scrollbar { width: 6px; }
.rj-app-side nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.08); border-radius: 3px;
}
.rj-app-side nav a {
    display: flex;
    align-items: center;
    gap: .85rem;                   /* was .65rem — icon ↔ label gap loosened */
    padding: .65rem .9rem;          /* was .42 / .7  — taller pill, more horizontal cushion */
    margin: 3px 0;                  /* was 1px — vertical breathing room between items */
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: .93rem;              /* was .88 — back to readable */
    border-radius: 10px;            /* was 8px — softer corners */
    position: relative;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease, padding-left 160ms ease;
}
.rj-app-side nav a .rj-nav-icon {
    width: 19px; height: 19px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .9;
    transition: transform 160ms ease;
}
.rj-app-side nav a .rj-nav-label { flex: 1; min-width: 0; }
.rj-app-side nav a .rj-nav-badge {
    background: var(--rj-gold);
    color: #0F172A;
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    line-height: 1.4;
}
.rj-app-side nav a:hover {
    background: rgba(255, 255, 255, .04);
    color: #fff;
    padding-left: 1.15rem;
}
.rj-app-side nav a:hover .rj-nav-icon { transform: translateX(2px); }

.rj-app-side nav a.active {
    background: linear-gradient(90deg, rgba(8, 145, 178, 0.28) 0%, rgba(8, 145, 178, 0.05) 100%);
    color: #fff;
    box-shadow:
        inset 3px 0 0 0 var(--rj-gold),
        0 1px 0 rgba(255,255,255,.05);
}
.rj-app-side nav a.active::after {
    /* Soft cyan inner glow on the active item */
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    box-shadow: 0 0 24px rgba(8, 145, 178, 0.25);
    pointer-events: none;
}
.rj-app-side nav a.active .rj-nav-icon { opacity: 1; stroke: #ECFEFF; }

/* Fade-in once on first render — keeps it feeling alive but not noisy */
.rj-app-side nav a {
    animation: rj-nav-in 320ms ease-out both;
}
.rj-app-side nav a:nth-child(2)  { animation-delay: 30ms; }
.rj-app-side nav a:nth-child(3)  { animation-delay: 60ms; }
.rj-app-side nav a:nth-child(4)  { animation-delay: 90ms; }
.rj-app-side nav a:nth-child(5)  { animation-delay: 120ms; }
.rj-app-side nav a:nth-child(6)  { animation-delay: 150ms; }
.rj-app-side nav a:nth-child(7)  { animation-delay: 180ms; }
.rj-app-side nav a:nth-child(8)  { animation-delay: 210ms; }
.rj-app-side nav a:nth-child(9)  { animation-delay: 240ms; }
.rj-app-side nav a:nth-child(10) { animation-delay: 270ms; }
.rj-app-side nav a:nth-child(11) { animation-delay: 300ms; }
@keyframes rj-nav-in {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
    .rj-app-side nav a { animation: none; transition: none; }
}
.rj-app-main {
    background: var(--rj-surface);
    padding: 0;                              /* topbar is full-bleed; sections add their own padding */
    min-width: 0;                             /* prevent wide tables from blowing out the grid column */
}
.rj-app-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 2rem;
    background: #ffffff;
    border-bottom: 1px solid var(--rj-border);
    position: sticky;
    top: 0;
    z-index: 10;                              /* above sticky table headers */
    margin-bottom: 0;
}
/* Each route's body renders inside this padded area beneath the topbar */
.rj-app-main > :not(.rj-app-topbar) {
    padding: 1.25rem 2rem 2rem;
}
.rj-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rj-ink);
    letter-spacing: -0.01em;
    margin: 0;
}
/* PageActions sits next to user menu on the right. The helpdesk pill anchors
 * the right cluster (Helpdesk → UserMenu) with margin-left:auto. */
/* Right cluster anchor: the FIRST item in (bell, helpdesk, user-menu) gets margin-left:auto. */
.rj-app-topbar .rj-bell             { margin-left: auto; }
.rj-app-topbar .rj-bell + .rj-topbar-helpdesk { margin-left: .35rem; }
.rj-app-topbar .rj-topbar-helpdesk:first-of-type:not(.rj-bell + .rj-topbar-helpdesk) { margin-left: auto; }
.rj-app-topbar .rj-user-menu       { margin-left: .25rem; }

/* Helpdesk pill in the topbar */
.rj-topbar-helpdesk {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .8rem;
    border: 1px solid var(--rj-border);
    background: #fff;
    border-radius: 999px;
    color: var(--rj-ink);
    text-decoration: none;
    font-weight: 600;
    font-size: .85rem;
    line-height: 1;
    transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.rj-topbar-helpdesk:hover {
    border-color: rgba(8, 145, 178, .4);
    background: var(--rj-primary-50);
    color: var(--rj-primary-600);
    box-shadow: 0 4px 14px -6px rgba(8, 145, 178, .35);
}
.rj-topbar-helpdesk svg { width: 16px; height: 16px; flex-shrink: 0; }
.rj-topbar-helpdesk-label { letter-spacing: -.005em; }
@media (max-width: 768px) {
    .rj-topbar-helpdesk-label { display: none; }
    .rj-topbar-helpdesk { padding: .45rem .55rem; }
}

/* ----------------------------------------------------------------------------
 * User menu — avatar button in topbar opens a glassy dropdown panel.
 * Mirrors the Stripe / Linear / Notion pattern.
 * --------------------------------------------------------------------------*/
.rj-user-menu { position: relative; }

.rj-user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    padding: .25rem .5rem .25rem .85rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.rj-user-menu-trigger:hover,
.rj-user-menu-trigger[aria-expanded="true"] {
    background: var(--rj-surface);
    border-color: var(--rj-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.rj-user-menu-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.15;
}
.rj-user-menu-name  { font-size: .9rem;  font-weight: 600; color: var(--rj-ink); }
.rj-user-menu-email { font-size: .72rem; color: var(--rj-muted); }
/* The trigger only shows the name — email lives in the dropdown header. */
.rj-user-menu-trigger .rj-user-menu-email { display: none; }
.rj-avatar-circle {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: inline-grid; place-items: center;
    background: linear-gradient(135deg, var(--rj-primary) 0%, var(--rj-primary-600) 100%);
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .02em;
    box-shadow: 0 2px 8px rgba(8, 145, 178, .25), inset 0 1px 0 rgba(255,255,255,.18);
}
.rj-avatar-lg { width: 44px; height: 44px; font-size: 1.15rem; }
.rj-user-menu-caret {
    color: var(--rj-muted);
    transition: transform 200ms ease;
}
.rj-user-menu-trigger[aria-expanded="true"] .rj-user-menu-caret {
    transform: rotate(180deg);
}

/* Panel */
.rj-user-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 280px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid var(--rj-border);
    border-radius: 14px;
    padding: .5rem;
    /* 3D shadow stack */
    box-shadow:
        0 1px 0 rgba(255,255,255,.6) inset,
        0 12px 28px rgba(15, 23, 42, 0.14),
        0 4px 10px rgba(15, 23, 42, 0.06);
    z-index: 100;
    /* hidden by default; JS toggles the .open class */
    opacity: 0;
    transform: translateY(-8px) scale(.98);
    pointer-events: none;
    transition:
        opacity 180ms ease,
        transform 180ms cubic-bezier(.2, 1.2, .4, 1);
}
.rj-user-menu.open .rj-user-menu-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.rj-user-menu-panel::before {
    /* Small chevron pointing back to the avatar */
    content: "";
    position: absolute;
    top: -6px; right: 18px;
    width: 12px; height: 12px;
    background: inherit;
    border-left: 1px solid var(--rj-border);
    border-top: 1px solid var(--rj-border);
    transform: rotate(45deg);
}

.rj-user-menu-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .75rem;
}
.rj-user-menu-meta-block { min-width: 0; flex: 1; }
.rj-user-menu-meta-block .rj-user-menu-name { font-size: .95rem; }
.rj-user-menu-meta-block .rj-user-menu-email {
    font-size: .8rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rj-user-menu-tenant {
    font-size: .72rem;
    color: var(--rj-muted);
    margin-top: 4px;
}
.rj-user-menu-tenant code {
    background: var(--rj-primary-50);
    color: var(--rj-primary-600);
    padding: 1px 5px; border-radius: 4px;
    font-size: .68rem;
}

.rj-user-menu-divider {
    height: 1px; background: var(--rj-border);
    margin: .35rem 0;
}

.rj-user-menu-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    border-radius: 8px;
    color: var(--rj-ink);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}
.rj-user-menu-item svg {
    width: 16px; height: 16px;
    color: var(--rj-muted);
    flex-shrink: 0;
    transition: color 140ms ease, transform 140ms ease;
}
.rj-user-menu-item:hover {
    background: var(--rj-primary-50);
    color: var(--rj-primary-600);
}
.rj-user-menu-item:hover svg {
    color: var(--rj-primary);
    transform: translateX(2px);
}
.rj-user-menu-item-danger { color: var(--rj-danger); }
.rj-user-menu-item-danger svg { color: var(--rj-danger); }
.rj-user-menu-item-danger:hover {
    background: #FEE2E2;
    color: var(--rj-danger);
}
.rj-user-menu-item-danger:hover svg { color: var(--rj-danger); }

/* "Opens in a new tab" hint shown next to cross-property Jalpi links. */
.rj-user-menu-ext {
    margin-left: auto;
    font-size: .7rem;
    color: var(--rj-muted);
}
.rj-user-menu-item:hover .rj-user-menu-ext { color: var(--rj-primary); }

/* Hide just the username text on small screens — keep the avatar tappable */
@media (max-width: 640px) {
    .rj-user-menu-meta { display: none; }
}

/* ============================================================================
 * Full /notifications page -- friendly list with icons (Phase 16)
 * ============================================================================ */
.rj-notif-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.rj-notif-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--rj-ink);
    margin: 0 0 .2rem;
    letter-spacing: -.015em;
}
.rj-notif-sub {
    color: var(--rj-muted);
    font-size: .88rem;
    margin: 0;
}
.rj-notif-sub strong { color: var(--rj-primary-600); font-weight: 700; }
.rj-notif-sub a { color: var(--rj-primary-600); text-decoration: none; font-weight: 600; }
.rj-notif-sub a:hover { text-decoration: underline; }

.rj-notif-tabs {
    display: inline-flex;
    background: #F1F5F9;
    border-radius: 999px;
    padding: 4px;
    gap: 3px;
}
.rj-notif-tab {
    padding: .4rem .95rem;
    border-radius: 999px;
    color: var(--rj-ink);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.rj-notif-tab:hover { color: var(--rj-primary-600); }
.rj-notif-tab.on {
    background: #fff;
    color: var(--rj-primary-600);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.rj-notif-empty {
    background: #fff;
    border: 1px solid var(--rj-border);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    color: var(--rj-muted);
}
.rj-notif-empty h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--rj-ink);
    margin: 14px 0 6px;
}
.rj-notif-empty p { margin: 0; font-size: .88rem; }

.rj-notif-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #fff;
    border: 1px solid var(--rj-border);
    border-radius: 12px;
    overflow: hidden;
}
.rj-notif-row {
    border-bottom: 1px solid var(--rj-border);
    transition: background .12s ease;
}
.rj-notif-row:last-child { border-bottom: none; }
.rj-notif-row:hover { background: #F8FAFC; }
.rj-notif-row.unread { background: rgba(8, 145, 178, .04); }
.rj-notif-row.unread:hover { background: rgba(8, 145, 178, .07); }

.rj-notif-link {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 14px;
    padding: 14px 18px;
    text-decoration: none;
    color: inherit;
    align-items: center;
}
.rj-notif-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}
.rj-notif-icon svg { width: 20px; height: 20px; }
.rj-notif-icon.kind-review  { background: rgba(251, 191, 36, .14); color: #B45309; }
.rj-notif-icon.kind-warning { background: rgba(239, 68, 68, .12);  color: #B91C1C; }
.rj-notif-icon.kind-success { background: rgba(16, 185, 129, .12); color: #047857; }
.rj-notif-icon.kind-info    { background: rgba(8, 145, 178, .12);  color: var(--rj-primary-600); }

.rj-notif-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.rj-notif-row-title {
    font-weight: 600;
    color: var(--rj-ink);
    font-size: .92rem;
    line-height: 1.3;
}
.rj-notif-row-summary {
    color: var(--rj-muted);
    font-size: .82rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rj-notif-row-time {
    color: #94A3B8;
    font-size: .73rem;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.rj-notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rj-primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, .18);
    align-self: center;
}

@media (max-width: 575.98px) {
    .rj-notif-link { grid-template-columns: 36px 1fr auto; padding: 12px 14px; gap: 10px; }
    .rj-notif-icon { width: 34px; height: 34px; }
    .rj-notif-icon svg { width: 16px; height: 16px; }
}

/* ============================================================================
 * Topbar notification bell + dropdown (Phase 16)
 * ============================================================================ */
.rj-bell { position: relative; display: inline-flex; }
.rj-bell-btn {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid var(--rj-border);
    background: #fff;
    color: var(--rj-ink);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    position: relative;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.rj-bell-btn:hover {
    background: var(--rj-primary-50);
    border-color: rgba(8, 145, 178, .35);
    color: var(--rj-primary-600);
}
.rj-bell-btn svg { width: 18px; height: 18px; }
.rj-bell-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, .25);
}

/* Unread count badge -- red dot for any unread, with the count text inside */
.rj-bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #EF4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #fff;
    line-height: 1;
}
.rj-bell.has-unread .rj-bell-btn { color: var(--rj-primary-600); border-color: rgba(8, 145, 178, .35); }

/* Dropdown panel */
.rj-bell-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: #fff;
    border: 1px solid var(--rj-border);
    border-radius: 12px;
    box-shadow:
        0 24px 48px -16px rgba(15, 23, 42, .28),
        0 8px 20px -8px rgba(15, 23, 42, .14);
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .15s ease, transform .18s cubic-bezier(.16, 1, .3, 1);
}
.rj-bell.open .rj-bell-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.rj-bell-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--rj-border);
    background: #FAFBFC;
}
.rj-bell-head strong {
    font-size: .9rem;
    color: var(--rj-ink);
    font-weight: 700;
}
.rj-bell-mark-all {
    background: none;
    border: none;
    color: var(--rj-primary-600);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.rj-bell-mark-all:hover { text-decoration: underline; }
.rj-bell-mark-all[hidden] { display: none; }

.rj-bell-body {
    max-height: 380px;
    overflow-y: auto;
}
.rj-bell-loading,
.rj-bell-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--rj-muted);
    font-size: .85rem;
}
.rj-bell-empty strong {
    display: block;
    color: var(--rj-ink);
    font-size: .92rem;
    margin-bottom: 4px;
}

.rj-bell-item {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid var(--rj-border);
    color: var(--rj-ink);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: background .12s ease;
}
.rj-bell-item:last-child { border-bottom: none; }
.rj-bell-item:hover { background: #F8FAFC; color: var(--rj-ink); }
.rj-bell-item.unread { background: rgba(8, 145, 178, .04); }
.rj-bell-item.unread::before {
    content: "";
    position: absolute;
    left: 4px; top: 50%;
    transform: translateY(-50%);
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--rj-primary);
}
.rj-bell-item-title {
    font-weight: 600;
    font-size: .86rem;
    color: var(--rj-ink);
    margin: 0 0 2px;
    line-height: 1.3;
}
.rj-bell-item-body {
    font-size: .78rem;
    color: var(--rj-muted);
    margin: 0 0 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rj-bell-item-time {
    font-size: .72rem;
    color: #94A3B8;
}

.rj-bell-foot {
    display: block;
    padding: 11px 14px;
    text-align: center;
    background: #FAFBFC;
    border-top: 1px solid var(--rj-border);
    color: var(--rj-primary-600);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 600;
    transition: background .12s ease;
}
.rj-bell-foot:hover { background: var(--rj-primary-50); color: var(--rj-primary-600); }

@media (max-width: 575.98px) {
    .rj-bell-panel {
        width: calc(100vw - 32px);
        right: -8px;
    }
}

/* ============================================================================
 * Sending channels sub-tabs (Phase 17a) -- nested under the main Settings tabs.
 * ============================================================================ */
.rj-sending-sub {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: #F1F5F9;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}
.rj-sending-sub-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: .35rem .85rem;
    border-radius: 999px;
    color: var(--rj-ink);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 600;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.rj-sending-sub-tab:hover { color: var(--rj-primary-600); }
.rj-sending-sub-tab.on {
    background: #fff;
    color: var(--rj-primary-600);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}
.rj-sending-sub-soon {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: rgba(251, 191, 36, .25);
    color: #92400E;
    padding: 1px 6px;
    border-radius: 999px;
}

/* Status banner inside /settings/sending/email */
.rj-sending-status {
    padding: .65rem .9rem;
    border-radius: 8px;
    font-size: .85rem;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.rj-sending-status.ok      { background: rgba(16, 185, 129, .08); border: 1px solid rgba(16, 185, 129, .25); color: #047857; }
.rj-sending-status.err     { background: rgba(239, 68, 68, .08);  border: 1px solid rgba(239, 68, 68, .25);  color: #B91C1C; }
.rj-sending-status.neutral { background: #F8FAFC; border: 1px solid var(--rj-border); color: var(--rj-ink); }
.rj-sending-status-ok  { color: #047857; font-weight: 600; }
.rj-sending-status-err { color: #B91C1C; font-weight: 600; }

/* ============================================================================
 * Settings tab strip -- shared header + horizontal nav for every /settings/* page
 * ============================================================================ */
.rj-settings-shell { margin-bottom: 1.25rem; }
.rj-settings-head { margin-bottom: 1rem; }
.rj-settings-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--rj-ink);
    margin: 0 0 .2rem;
    letter-spacing: -.015em;
}
.rj-settings-sub {
    color: var(--rj-muted);
    font-size: .9rem;
    margin: 0;
}
.rj-settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    border-bottom: 1px solid var(--rj-border);
    margin-bottom: 1.25rem;
}
.rj-settings-tab {
    display: inline-block;
    padding: .65rem 1.1rem;
    color: var(--rj-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: .88rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
    border-radius: 7px 7px 0 0;
}
.rj-settings-tab:hover {
    color: var(--rj-ink);
    background: var(--rj-primary-50);
}
.rj-settings-tab.on {
    color: var(--rj-primary-600);
    border-bottom-color: var(--rj-primary);
}

.rj-card {
    background: #fff;
    border: 1px solid var(--rj-border);
    border-radius: 12px;
    padding: 1.25rem;
}

/* ==========================================================================
   Sources page (Phase 9a) — enterprise catalog layout
   ========================================================================== */
.rj-src-section-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--rj-ink);
    margin: 0 0 .25rem;
    letter-spacing: -.01em;
}
.rj-src-section-hint {
    color: var(--rj-muted);
    font-size: .85rem;
    margin: 0 0 1.25rem;
}

/* Connected source row -- compact, status-pill on the right */
.rj-src-conn {
    display: grid;
    grid-template-columns: 44px 1fr auto auto;
    gap: .9rem;
    align-items: center;
    padding: .85rem 1rem;
    border: 1px solid var(--rj-border);
    border-radius: 10px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.rj-src-conn + .rj-src-conn { margin-top: .55rem; }
.rj-src-conn:hover { border-color: rgba(8, 145, 178, .35); box-shadow: 0 4px 14px rgba(15, 23, 42, .05); }

.rj-src-badge {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: grid; place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
    overflow: hidden;
}
/* Simple-Icons SVGs are black on transparent.  Flip them to white so they
 * read against the brand-colored badge background. */
.rj-src-badge-logo {
    width: 56%;
    height: 56%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
.rj-src-meta .rj-src-title  {
    font-weight: 600; color: var(--rj-ink); font-size: .95rem; line-height: 1.2;
}
.rj-src-meta .rj-src-sub {
    color: var(--rj-muted); font-size: .8rem; margin-top: 2px;
}

/* Sync status pill */
.rj-src-pill {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .75rem; font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}
.rj-src-pill .dot {
    width: 7px; height: 7px; border-radius: 50%;
}
.rj-src-pill.ok        { background: rgba(16, 185, 129, .1);  color: #047857; border-color: rgba(16, 185, 129, .25); }
.rj-src-pill.ok .dot   { background: #10B981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .15); }
.rj-src-pill.syncing   { background: rgba(8, 145, 178, .1);   color: #0E7490; border-color: rgba(8, 145, 178, .25); }
.rj-src-pill.syncing .dot { background: #0891B2; animation: rj-src-pulse 1.4s ease-in-out infinite; }
.rj-src-pill.pending   { background: rgba(245, 158, 11, .12); color: #B45309; border-color: rgba(245, 158, 11, .3); }
.rj-src-pill.pending .dot { background: #F59E0B; }
.rj-src-pill.error     { background: rgba(239, 68, 68, .1);   color: #B91C1C; border-color: rgba(239, 68, 68, .25); }
.rj-src-pill.error .dot{ background: #EF4444; }
.rj-src-pill.disabled  { background: #F1F5F9; color: #6B7280; border-color: #E5E7EB; }
.rj-src-pill.disabled .dot{ background: #94A3B8; }
@keyframes rj-src-pulse {
    0%,100% { opacity: 1;   transform: scale(1);   }
    50%     { opacity: .35; transform: scale(1.4); }
}

.rj-src-actions { display: flex; gap: .35rem; }
.rj-src-actions .btn { padding: .3rem .65rem; font-size: .8rem; }

/* Catalog grid -- responsive tiles */
.rj-src-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .75rem;
}
.rj-src-tile {
    position: relative;
    display: flex; align-items: center; gap: .75rem;
    padding: .85rem 1rem;
    border: 1px solid var(--rj-border);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
    cursor: pointer;
    color: var(--rj-ink);
    text-decoration: none;
    width: 100%;
    font-family: inherit;
    font-size: .9rem;
}
.rj-src-tile:hover {
    border-color: rgba(8, 145, 178, .4);
    box-shadow: 0 8px 22px -10px rgba(8, 145, 178, .35);
    transform: translateY(-1px);
    color: var(--rj-ink);
}
.rj-src-tile .rj-src-badge { width: 34px; height: 34px; font-size: .9rem; border-radius: 8px; }
.rj-src-tile .nm { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rj-src-tile .add-hint {
    color: var(--rj-primary);
    font-size: .75rem; font-weight: 600;
    opacity: 0; transition: opacity .15s ease;
}
.rj-src-tile:hover .add-hint { opacity: 1; }
.rj-src-tile .add-hint.manual { color: #6B7280; }

.rj-src-search {
    width: 100%;
    padding: .55rem .85rem .55rem 2.2rem;
    border: 1px solid var(--rj-border);
    border-radius: 8px;
    font-size: .9rem;
    background:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>") 10px center no-repeat #fff;
    background-size: 16px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.rj-src-search:focus {
    outline: none;
    border-color: var(--rj-primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, .15);
}

.rj-src-cat-label {
    font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .1em;
    color: var(--rj-muted);
    margin: 1.25rem 0 .65rem;
}
.rj-src-cat-label:first-child { margin-top: 0; }

/* Custom platform chip -- shows next to the catalog */
.rj-src-cp-chip {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .35rem .65rem .35rem .4rem;
    border: 1px solid var(--rj-border);
    border-radius: 999px;
    background: #fff;
    font-size: .8rem;
    color: var(--rj-ink);
}
.rj-src-cp-chip .rj-src-badge { width: 22px; height: 22px; font-size: .75rem; border-radius: 6px; }

/* Import-history mini-table */
.rj-src-import-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: .9rem;
    padding: .6rem 0;
    align-items: center;
    border-bottom: 1px solid var(--rj-border);
    font-size: .85rem;
}
.rj-src-import-row:last-child { border-bottom: none; }
.rj-src-import-row .ok   { color: #047857; font-weight: 600; }
.rj-src-import-row .skip { color: #6B7280; }
.rj-src-import-row .err  { color: #B91C1C; }
.rj-kpi {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--rj-ink);
}
.rj-kpi-label {
    color: var(--rj-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

@media (max-width: 768px) {
    .rj-app-shell { grid-template-columns: 1fr; }
    .rj-app-side { display: none; }
}

/* Reviews inbox */
.rj-stars { color: var(--rj-gold); letter-spacing: 1px; }
.rj-body-cell { max-width: 480px; overflow: hidden; text-overflow: ellipsis; }
.rj-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--rj-indigo-50); color: var(--rj-indigo);
    display: grid; place-items: center; font-weight: 700; font-size: 1.25rem;
    flex-shrink: 0;
}
.rj-sent-pill {
    display: inline-block; padding: 1px 8px; border-radius: 999px;
    font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.rj-sent-pos { background: #DCFCE7; color: #166534; }
.rj-sent-neu { background: #F1F5F9; color: #475569; }
.rj-sent-neg { background: #FEE2E2; color: #991B1B; }

.badge-status-new      { background: #E0E7FF; color: #3730A3; }
.badge-status-viewed   { background: #F1F5F9; color: #475569; }
.badge-status-replied  { background: #DCFCE7; color: #166534; }
.badge-status-flagged  { background: #FEF3C7; color: #92400E; }
.badge-status-ignored  { background: #F1F5F9; color: #94A3B8; }
.badge-status-resolved { background: #DBEAFE; color: #1E40AF; }
