/* הבר העליון — משותף לכל סוגי המשתמשים. */

:root {
    --top-ink: #1f2a37;
    --top-ink-soft: #5b6b7c;
    --top-line: #e3e8ee;
    --top-surface: #ffffff;
    --top-hover: #f2f5f9;
    --top-accent: #0d6efd;
    --top-accent-soft: #eaf1ff;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 0;
    background: var(--top-surface);
    border-bottom: 1px solid var(--top-line);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.topbar__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .4rem 1rem;
}

/* ---------- מותג ---------- */

.topbar__brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: 0;
    margin: 0;
    text-decoration: none;
    flex: 0 0 auto;
}

.topbar__brand:hover {
    text-decoration: none;
}

.topbar__logos {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.topbar__logos img {
    height: 36px;
    width: auto;
    border-radius: 6px;
}

.topbar__brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.topbar__brand-name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--top-ink);
}

.topbar__brand-sub {
    font-size: .7rem;
    color: var(--top-ink-soft);
}

/* ---------- קישורי ניווט ---------- */

.topbar .navbar-collapse {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar__links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.topbar__links .nav-item {
    padding: 0;
    border: 0;
}

.topbar__links .nav-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .38rem .8rem;
    border: 1px solid var(--top-line);
    border-radius: 8px;
    background: #f7f9fc;
    color: var(--top-ink) !important;
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.topbar__links .nav-link:hover,
.topbar__links .nav-link:focus-visible {
    background: #fff;
    border-color: #b9c8dc;
    color: var(--top-accent) !important;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
    text-decoration: none;
}

.topbar__links .nav-link.is-active {
    background: var(--top-accent);
    border-color: var(--top-accent);
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(13, 110, 253, .35);
}

.topbar__links .nav-link:focus-visible {
    outline: 2px solid var(--top-accent);
    outline-offset: 2px;
}

/* ---------- מונים ---------- */

.redPill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 .3rem;
    border-radius: 999px;
    background: #e5484d;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* ---------- אזור המשתמש ---------- */

.topbar__user {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.topbar__user .navbar-nav {
    flex-direction: row;
    align-items: center;
    gap: .2rem;
}

.topbar__user .nav-item {
    padding: 0;
    border: 0;
}

.topbar__user .nav-link,
.topbar__user .btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .34rem .7rem;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--top-ink-soft) !important;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    background: none;
    box-shadow: none;
}

.topbar__user .nav-link:hover,
.topbar__user .btn:hover {
    background: #fff;
    border-color: var(--top-line);
    color: var(--top-accent) !important;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
    text-decoration: none;
}

.topbar__user form {
    margin: 0;
}

/* "שלום <שם>" הוא טקסט מזהה ולא פעולה — לכן בלי מסגרת/רקע של כפתור.
   הקישור לדף המשתמש נשמר, ומסומן ב-hover בקו תחתון בלבד. */
.topbar__user .nav-link.topbar__greeting {
    padding-inline: .15rem;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-weight: 500;
}

.topbar__user .nav-link.topbar__greeting:hover {
    background: none;
    border: 0;
    box-shadow: none;
    color: var(--top-ink-soft) !important;
    text-decoration: underline;
}

/* _LoginPartial מגיע בשני מבנים שונים (מנהל / שאר התפקידים).
   כאן משטחים את שניהם לאותו מראה. */
.topbar__user .user-nav {
    background: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    gap: .2rem;
}

/* ---------- כפתור המבורגר ---------- */

.topbar__toggle {
    margin-inline-start: auto;
    padding: .35rem .55rem;
    border: 1px solid var(--top-line);
    border-radius: 8px;
}

.topbar__toggle:focus {
    box-shadow: none;
    outline: 2px solid var(--top-accent);
    outline-offset: 2px;
}

@media (max-width: 767.98px) {
    .topbar .navbar-collapse {
        flex-direction: column;
        align-items: stretch;
        gap: .35rem;
        padding: .5rem 0 .25rem;
    }

    .topbar__links {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar__links .nav-link {
        justify-content: space-between;
        padding: .5rem .75rem;
    }

    .topbar__user {
        justify-content: flex-end;
        border-top: 1px solid var(--top-line);
        padding-top: .35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .topbar__links .nav-link {
        transition: none;
    }
}

/* הפינה הסודית של המנהל (לחיצה משולשת -> /ContactAdmin).
   fixed לפינה הימנית העליונה של החלון, מתחת ללוגו כדי לא לחסום אותו. */
#adminSecretArea {
    position: fixed;
    top: 0;
    right: 0;
    width: 40px;
    height: 44px;
    z-index: 1;
    opacity: 0;
    cursor: default;
}

.topbar__brand {
    position: relative;
    z-index: 2;
}
