/* ── Shared nav sidebar ───────────────────────────────────────────────────── */

/* ── Page layout ──────────────────────────────────────────────────────────── */
.site-layout {
    display: block;
    min-height: 100vh;
}

.site-content,
.srch-main {
    margin-left: 280px;
    min-height: 100vh;
}

/* ── Backdrop ─────────────────────────────────────────────────────────────── */
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 190;
    display: none;
}
.nav-backdrop.visible { display: block; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.nav-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background: rgba(0,0,0,0.25);
    border-right: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow: hidden;
}

.nav-sidebar-inner {
    display: flex;
    flex-direction: column;
    padding: 16px 16px 24px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.nav-sidebar-inner::-webkit-scrollbar { width: 4px; }
.nav-sidebar-inner::-webkit-scrollbar-track { background: transparent; }
.nav-sidebar-inner::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}
.nav-sidebar-inner::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.28); }

/* Logo */
.nav-logo {
    display: block;
    text-align: center;
    padding: 8px 0 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 8px;
    flex-shrink: 0;
}
.nav-logo img {
    width: 240px;
    height: auto;
    display: inline-block;
}

/* Clock */
.nav-clock {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.03em;
    opacity: 0.6;
    text-align: right;
    margin-bottom: 4px;
    flex-shrink: 0;
}

/* ── Section buttons ─────────────────────────────────────────────────────── */
.nav-section {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.nav-section-btn {
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    padding: 12px 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
    opacity: 0.75;
    transition: opacity 0.15s;
}
.nav-section-btn:hover { opacity: 1; }
.nav-section-btn.open  { opacity: 1; }

.nav-section-icon  { font-size: 15px; flex-shrink: 0; }
.nav-section-label { flex: 1; }

.nav-chevron {
    font-size: 10px;
    transition: transform 0.2s;
    flex-shrink: 0;
    opacity: 0.5;
}
.nav-section-btn.open .nav-chevron { transform: rotate(180deg); }

/* ── Flyout panels (desktop) ─────────────────────────────────────────────── */
.nav-section-body {
    position: fixed;
    /* left + top set by JS */
    width: 300px;
    background: #00174a;
    border: 1px solid rgba(255,255,255,0.14);
    border-left: 3px solid #1466d6;
    border-radius: 0 10px 10px 0;
    z-index: 210;
    padding: 16px;
    box-shadow: 6px 4px 28px rgba(0,0,0,0.55);
    flex-direction: column;
    gap: 10px;
    display: none;
}
.nav-section-body.open { display: flex; }

/* ── Inline sections (always visible in sidebar, not a flyout) ───────────── */
.nav-section-body[data-inline] {
    position: static;
    left: auto;
    top: auto;
    width: auto;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0 2px 12px;
    display: none;
}
.nav-section-body[data-inline].open { display: flex; }

/* ── Fields ──────────────────────────────────────────────────────────────── */
.nav-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255,255,255,0.4);
}

.nav-optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.nav-ac-wrap { position: relative; }

.nav-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    padding: 8px 11px;
    outline: none;
    font-family: inherit;
    height: 36px;
}
.nav-input:focus {
    border-color: rgba(255,255,255,0.45);
    background: rgba(0,0,0,0.4);
}
.nav-input::placeholder { color: rgba(255,255,255,0.27); }

input[type="date"].nav-input,
input[type="time"].nav-input { color-scheme: dark; }

select.nav-input {
    color-scheme: dark;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

/* ── Autocomplete dropdown — position:fixed, coords set by JS ────────────── */
.nav-dropdown {
    position: fixed;
    background: #001a50;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 6px;
    z-index: 600;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.45);
}
.nav-dropdown[hidden] { display: none !important; }

.nav-drop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 11px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-size: 13px;
    gap: 8px;
}
.nav-drop-item:last-child { border-bottom: none; }
.nav-drop-item:hover,
.nav-drop-item.active { background: rgba(255,255,255,0.1); }
.nav-drop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-drop-crs  { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; color: rgba(255,255,255,0.32); flex-shrink: 0; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.nav-btn {
    background: linear-gradient(180deg, #1466d6 0%, #0c56bf 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 10px;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    transition: filter 0.15s;
}
.nav-btn:hover  { filter: brightness(1.1); }
.nav-btn:active { filter: brightness(0.92); }

/* ── Filter toggles ──────────────────────────────────────────────────────── */
.nav-filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nav-filters-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255,255,255,0.35);
}
.nav-filter-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 6px;
    color: rgba(255,255,255,0.45);
    font-size: 13px;
    font-family: inherit;
    padding: 7px 10px;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.nav-filter-btn::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1.5px solid rgba(255,255,255,0.25);
    flex-shrink: 0;
    transition: background 0.12s, border-color 0.12s;
}
.nav-filter-btn.active {
    color: #fff;
    border-color: rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.1);
}
.nav-filter-btn.active::before {
    background: #1466d6;
    border-color: #1466d6;
}
.nav-filter-btn:hover {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
}

/* ── Site content ─────────────────────────────────────────────────────────── */
.site-content { flex: 1; min-width: 0; }

/* ── Mobile top bar ──────────────────────────────────────────────────────── */
.nav-topbar {
    display: none;
    position: sticky;
    top: 0;
    height: 56px;
    background: rgba(0,10,40,0.94);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    align-items: center;
    padding: 0 14px;
    z-index: 300;
    gap: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.nav-topbar-logo img {
    height: 36px;
    width: auto;
    display: block;
}
.nav-topbar-clock {
    font-size: 14px;
    font-weight: 700;
    opacity: 0.55;
    margin-left: auto;
    letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums;
}
.nav-hamburger {
    background: none;
    border: none;
    color: #fff;
    padding: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    margin-left: 4px;
}
.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.85);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 800px) {
    .nav-topbar { display: flex; }

    .site-content,
    .srch-main { margin-left: 0; }

    /* Sidebar becomes a slide-in drawer */
    .nav-sidebar {
        left: -300px;
        width: 300px;
        background: #001840;
        overflow-y: auto;
        overflow-x: hidden;
        transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 500;
    }
    .nav-sidebar.mobile-open { left: 0; }

    .nav-sidebar-inner {
        height: auto;
        min-height: 100%;
        overflow: visible;
    }

    /* All section bodies are inline inside the drawer */
    .nav-section-body,
    .nav-section-body[data-inline] {
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: auto !important;
        background: none !important;
        border: none !important;
        border-left: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 0 2px 12px !important;
        display: none !important;
    }
    .nav-section-body.open,
    .nav-section-body[data-inline].open { display: flex !important; }

    .nav-logo img { width: 200px; }
}
