/* ── Shared topographic surface ─────────────────────────────────────────── */
body {
    font-family: 'Nunito Sans', sans-serif;
}

.topo-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.85;
}
.topo-layer { transform: none; }
.topo-map-fill {
    fill: rgba(106, 179, 86, 0.08);
    stroke: none;
}
.portal-hero-topo,
.topo-card-topo {
    opacity: 0.55;
}
.topo-grid {
    position: absolute; inset: 0; pointer-events: none; opacity: 0.2;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, #000 15%, transparent 78%);
}
.topo-vignette {
    position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse 60% 55% at 50% 48%, transparent 0%, rgba(10, 20, 8, 0.45) 100%);
}

/* ── Portal hero (leader pages) ───────────────────────────────────────── */
.portal-hero, .home-hero-1 {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 70% 55% at 50% 40%, rgba(106, 179, 86, 0.12) 0%, transparent 55%),
        linear-gradient(165deg, #1a2e16 0%, #243d1f 40%, #2d4d27 72%, #1e3419 100%);
}
.portal-hero.d-none { display: none !important; }
@media (min-width: 768px) {
    .portal-hero.d-md-flex { display: flex !important; }
}
/* Logged-in shell: clear the fixed site navbar */
.site-navbar ~ #router > .portal-hero {
    padding-top: 96px;
    box-sizing: border-box;
}
.site-navbar ~ #router > .portal-hero.portal-hero--sm { min-height: calc(22vh + 96px); }
.site-navbar ~ #router > .portal-hero.portal-hero--md { min-height: calc(28vh + 96px); }
.site-navbar ~ #router > .portal-hero.portal-hero--lg { min-height: calc(30vh + 96px); }
.site-navbar ~ #router > .portal-hero.portal-hero--xl { min-height: calc(35vh + 96px); }
.portal-hero--sm, .home-hero-1.portal-hero--sm { min-height: 22vh; }
.portal-hero--md, .home-hero-1 { min-height: 28vh; }
.portal-hero--lg { min-height: 30vh; }
.portal-hero--xl { min-height: 35vh; }
.portal-hero-inner {
    position: relative; z-index: 2; text-align: center; color: #fff; padding: 24px 20px;
}
.portal-hero-logo {
    width: 50px; height: auto; margin-bottom: 12px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}
.portal-hero--sm .portal-hero-logo { width: 44px; margin-bottom: 8px; }
.portal-hero--compact .portal-hero-logo { width: 44px; }
.welcome-card h1,
.yg-hero h1,
.yg-hero-inner h1 {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 800;
}
.welcome-card h1 { font-size: 1.6rem; margin: 0 0 4px; }
.yg-hero h1 { font-size: 1.75rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.portal-hero-title {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 800; letter-spacing: 3px; font-size: 1.8rem; margin: 0;
    text-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.portal-hero--sm .portal-hero-title,
.portal-hero--compact .portal-hero-title { font-size: 1.4rem; letter-spacing: 2px; }
.portal-hero-sub {
    opacity: 0.78; font-size: 0.88rem; margin: 6px 0 0; letter-spacing: 0.04em;
}

.portal-mobile-bar { display: none !important; }

/* Portal layout — flush to viewport edges */
#router > .container-fluid {
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
}

@media (max-width: 767.98px) {
    #router #sidebarMenu.collapse.show {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        z-index: 999;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        box-shadow: 0 8px 24px rgba(0,0,0,0.28);
    }
    #router #sidebarMenu.collapse:not(.show) {
        pointer-events: none;
        visibility: hidden;
    }
    .site-navbar ~ #router > .portal-hero {
        padding-top: 0;
        min-height: auto;
    }
    .site-navbar ~ #router > .portal-hero.portal-hero--md { min-height: auto; }
}

/* ── Public home hero ───────────────────────────────────────────────────── */
.home-hero {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 60% at 50% 45%, rgba(106, 179, 86, 0.14) 0%, transparent 55%),
        linear-gradient(165deg, #1a2e16 0%, #243d1f 35%, #2d4d27 65%, #3d6b35 100%) !important;
}
.home-hero::before, .home-hero::after { display: none; }
.home-hero .hero-inner { position: relative; z-index: 2; }
.home-hero .fdl-wrap {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.28);
    box-shadow: 0 0 0 1px rgba(106,179,86,0.12), 0 8px 28px rgba(0,0,0,0.2);
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
    background:
        radial-gradient(ellipse 80% 40% at 50% 0%, rgba(106,179,86,0.08) 0%, transparent 60%),
        linear-gradient(180deg, #2a4823 0%, #1e3419 55%, #152612 100%) !important;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}
.sidebar::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.sidebar::after {
    content: '';
    position: absolute; bottom: -20px; left: -10%; right: -10%; height: 120px;
    background: repeating-linear-gradient(
        0deg,
        transparent, transparent 8px,
        rgba(106,179,86,0.06) 8px, rgba(106,179,86,0.06) 9px
    );
    border-radius: 50% 50% 0 0;
    pointer-events: none;
    opacity: 0.6;
}
.sidebar .nav-link {
    color: rgba(255,255,255,0.82) !important;
    padding: 10px 14px; border-radius: 8px; margin-bottom: 3px;
    font-size: 0.88rem; transition: background 0.15s, color 0.15s;
    position: relative; z-index: 1;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,0.1); color: #fff !important; }
.sidebar .nav-link.active {
    background: rgba(106,179,86,0.18); color: #fff !important; font-weight: 700;
    box-shadow: inset 3px 0 0 rgba(163,232,122,0.6);
}
.sidebar hr { border-color: rgba(255,255,255,0.12); position: relative; z-index: 1; }
.sidebar .nav-section { list-style: none; }
.sidebar-section-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 4px 6px;
    position: relative;
    z-index: 1;
}
.sidebar-section-divider::before,
.sidebar-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.12);
}
.sidebar-section-tag {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.42);
    white-space: nowrap;
    flex-shrink: 0;
}
.sidebar-brand {
    text-align: center; padding: 24px 0 16px; position: relative; z-index: 1;
}
.sidebar-brand h6 {
    font-weight: 800; letter-spacing: 2px; color: #fff;
    font-size: 0.78rem; margin: 8px 0 0;
}
.sidebar-brand img { filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25)); }

.main-content { background: #eef1ee; min-height: 100vh; }
@media (min-width: 768px) { .main-content { padding: 36px 32px; } }
@media (max-width: 767.98px) {
    .sidebar { min-height: auto; }
    .main-content { padding: 20px 14px; }
    #router .container-fluid > .row > main.main-content {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }
    #router .container-fluid > .row > .sidebar.collapse:not(.show) {
        height: 0;
        overflow: hidden;
        padding: 0 !important;
        min-height: 0 !important;
    }
}

/* ── Dashboard / GLV topo cards ─────────────────────────────────────────── */
.topo-card, .welcome-card, .yg-hero {
    position: relative; overflow: hidden; color: #fff;
    background:
        radial-gradient(ellipse 60% 80% at 80% 20%, rgba(106,179,86,0.15) 0%, transparent 50%),
        linear-gradient(135deg, #1e3419 0%, #2d4d27 45%, #3a6b32 100%) !important;
    box-shadow: 0 8px 28px rgba(26,46,22,0.28);
}
.topo-card { border-radius: 18px; }
.welcome-card { border-radius: 16px; padding: 28px 32px; margin-bottom: 28px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.yg-hero { border-radius: 20px; padding: 28px 24px; margin-bottom: 20px; }
.yg-hero::before, .yg-hero::after { display: none; }

.topo-card-topo { opacity: 0.55; }
.topo-card-grid { opacity: 0.2; mask-image: radial-gradient(ellipse 90% 80% at 30% 50%, #000 10%, transparent 70%); }
.topo-card-vignette { background: radial-gradient(ellipse 70% 60% at 20% 50%, transparent 0%, rgba(10,20,8,0.35) 100%); }
.topo-card-inner, .yg-hero-inner { position: relative; z-index: 2; }
.welcome-card > *:not(.topo-svg):not(.topo-grid):not(.topo-vignette) { position: relative; z-index: 2; }

.welcome-card p { opacity: 0.82; font-size: 0.88rem; margin: 0; }
.level-chip {
    background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.28);
    border-radius: 20px; padding: 6px 16px; font-size: 0.78rem; font-weight: 700;
    color: #fff; white-space: nowrap; position: relative; z-index: 2;
}

.glv-hub-promo {
    position: relative; overflow: hidden;
    background:
        radial-gradient(ellipse 50% 80% at 100% 0%, rgba(163,232,122,0.12) 0%, transparent 55%),
        linear-gradient(135deg, #243d1f 0%, #355a2c 50%, #437037 100%) !important;
    border: 1.5px solid rgba(106,179,86,0.25);
}

/* ── 404 page ─────────────────────────────────────────────────────────────── */
.error-page-wrap { min-height: 55vh; display: flex; align-items: center; justify-content: center; }
.error-page-inner { text-align: center; max-width: 480px; padding: 2rem; position: relative; z-index: 2; }
.error-page-code {
    font-size: 7rem; font-weight: 800; line-height: 1; letter-spacing: -4px;
    background: linear-gradient(180deg, #6ab356 0%, #2d4d27 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    opacity: 0.85;
}
.error-page-title { font-weight: 800; color: #2d4d27; margin: 0.25rem 0 0.5rem; }
.error-page-text { color: #888; font-size: 0.95rem; margin-bottom: 2rem; }
.error-page-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.btn-topo-primary {
    background: linear-gradient(135deg, #437037, #2d4d27); color: #fff !important;
    border: none; border-radius: 10px; padding: 10px 24px; font-size: 13px; font-weight: 700;
    text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn-topo-primary:hover { color: #fff; background: linear-gradient(135deg, #355a2c, #1e3419); }
.btn-topo-outline {
    background: #fff; color: #437037; border: 1.5px solid #437037; border-radius: 10px;
    padding: 10px 24px; font-size: 13px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-topo-outline:hover { background: #f4f9f4; }
