/* Portal chrome — the white nav bar, alerts bell, user menu and mobile drawer.
   Shared by the manager pages (database.html, farms.html). Page-specific CSS stays in the page.
   Extracted verbatim from database.html on 2026-09-08. */
/* Override green header with white nav bar */
.header { display: none !important; }
.hamburger { display: none !important; }

.nav-bar {
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-right {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 100%;
}
.nav-brand {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #1F2937;
    margin-left: 32px;
    padding-bottom: 10px;
}
.nav-logo { height: 40px; }
.nav-tabs {
    display: flex;
    align-items: flex-end;
    gap: 0;
    height: 100%;
}
.nav-tab {
    padding: 0 20px 8px;
    display: flex;
    align-items: flex-end;
    font-size: 15px;
    font-weight: 500;
    color: #6B7280;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    font-family: 'Heebo', sans-serif;
}
.nav-tab:hover { color: #1B5E20; }
.nav-tab.active {
    color: #1B5E20;
    border-bottom-color: #1B5E20;
    font-weight: 600;
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
/* bell + badge styles in style.css */
.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0D9488;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
}
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: #1F2937;
    cursor: pointer;
    padding: 8px;
}
.db-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
}
.db-mobile-overlay.open { display: block; }
.db-mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100%;
    background: #FFFFFF;
    z-index: 200;
    padding: 20px;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    visibility: hidden;
}
.db-mobile-menu.open {
    transform: translateX(0);
    visibility: visible;
}
.db-mobile-menu-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #6B7280;
    cursor: pointer;
    margin-bottom: 24px;
}
.db-mobile-menu a {
    display: block;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-family: 'Heebo', sans-serif;
}
.db-mobile-menu a:hover { background: #eef0fb; color: #1B5E20; }
.db-mobile-menu a.active { background: #eef0fb; color: #1B5E20; font-weight: 600; }

@media (max-width: 768px) {
    .nav-bar { padding: 0 16px; }
    .nav-tabs { display: none; }
    .nav-hamburger { display: block; }
    .nav-brand span { display: none; }
    .nav-user-name { display: none; }
}

/* ── AgroPulse: brand link + the פטם ↔ רביה ומדגרה switcher ── */
a.nav-brand { text-decoration: none; }
.nav-brand span { font-size: 14px; font-weight: 600; color: #1B5E20; padding-inline-start: 12px; border-inline-start: 1px solid #E5E7EB; }
.nav-hamburger { background: none; border: 0; color: #374151; cursor: pointer; }
.app-switch { display: flex; background: #F3F4F6; border-radius: 10px; padding: 3px; }
.app-switch a {
    display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px;
    font-family: 'Heebo', sans-serif; font-size: 13px; font-weight: 600; color: #4B5563; text-decoration: none;
}
.app-switch a:hover { color: #1B5E20; }
.app-switch a.on { color: #1B5E20; font-weight: 700; background: #FFFFFF; box-shadow: 0 1px 2px rgba(16,24,40,0.08); }
.db-mobile-menu .mobile-switch { color: #1B5E20; font-weight: 700; }
@media (max-width: 768px) {
    .app-switch a { padding: 7px 10px; }
    .app-switch svg { display: none; }
    .nav-user-name { display: none; }
}
/* On a phone the bar carried logo + switcher + avatar and came out ~420px wide:
   the avatar fell off the start edge and the whole page scrolled sideways. The
   switcher is in the drawer ("מעבר לפטם"), so at this width the bar drops it. */
@media (max-width: 600px) {
    .nav-bar .app-switch { display: none; }
    .nav-brand { margin-left: 12px; }
}

/* The פטם ⇄ רביה pills are gone from the bar; the crossing lives in the user menu. */
.user-menu-switch {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    font-family: 'Heebo', sans-serif; font-size: 14px; font-weight: 600;
    color: #1B5E20; text-decoration: none;
}
.user-menu-switch:hover { background: #F3F8F4; }
.user-menu-switch svg { flex: none; }

/* ── Headings with a list under them (issue #8) ──
   פרגיות, רביה and מדגרה do not navigate: on a desktop the heading opens its list on
   hover or keyboard focus, in the drawer the list is always open under it. */
.nav-group { position: relative; display: flex; align-items: flex-end; height: 100%; }
.nav-head { cursor: default; user-select: none; outline: none; }
.nav-head:hover { color: #6B7280; }
.nav-head.active:hover { color: #1B5E20; }
.nav-head:focus-visible { color: #1B5E20; }
.nav-sub {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    min-width: 190px;
    max-height: 70vh;
    overflow-y: auto;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-top: 0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 24px rgba(16,24,40,0.10);
    padding: 6px;
    z-index: 101;
}
.nav-sub:empty { padding: 0; border: 0; }
.nav-group:hover .nav-sub,
.nav-group:focus-within .nav-sub { display: block; }
/* A heading that was clicked keeps the focus, and with it its list — so while the
   pointer is on another heading, only that one's list shows. */
.nav-tabs:hover .nav-group:not(:hover) .nav-sub { display: none; }
.nav-sub-item {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    font-family: 'Heebo', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    white-space: nowrap;
}
a.nav-sub-item:hover { background: #F3F8F4; color: #1B5E20; }
.nav-sub-item.active { background: #F3F8F4; color: #1B5E20; font-weight: 600; }
.nav-sub-item.none { color: #9CA3AF; font-weight: 400; }

.db-mobile-menu { overflow-y: auto; }
.db-mobile-menu .mm-head {
    padding: 14px 16px 4px;
    font-family: 'Heebo', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #6B7280;
}
.db-mobile-menu a.mm-sub { padding: 10px 28px 10px 16px; font-size: 15px; margin-bottom: 2px; }
.db-mobile-menu span.mm-sub.none {
    display: block;
    padding: 6px 28px 10px 16px;
    font-family: 'Heebo', sans-serif;
    font-size: 14px;
    color: #9CA3AF;
}
