/* GenesisBudget app navigation system */

.gb-nav-shell {
    position: sticky;
    top: 0;
    z-index: 1040;
    width: 100%;
    background: #101827;
    color: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
}

.gb-top-nav {
    background: #101827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gb-nav-inner {
    max-width: 1440px;
    min-height: 70px;
    margin: 0 auto;
    padding: 0.58rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.gb-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 160px;
    color: #fff;
    text-decoration: none;
}

.gb-brand:hover {
    color: #fff;
    text-decoration: none;
}

.gb-brand-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    overflow: visible;
}

.gb-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(2);
    transform-origin: center;
}

.gb-brand-copy {
    display: grid;
    line-height: 1;
}

.gb-brand-copy strong {
    font-size: 1rem;
    letter-spacing: 0;
}

.gb-brand-copy small {
    color: #9eddd4;
    font-size: 0.76rem;
    font-weight: 700;
    margin-top: 0.2rem;
}

.gb-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.gb-nav-menu {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    min-width: 0;
}

.gb-nav-main,
.gb-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.22rem;
    min-width: 0;
}

.gb-nav-actions {
    justify-content: flex-end;
}

.gb-nav-link,
.gb-action-btn,
.gb-command-btn,
.gb-icon-btn,
.gb-account-btn,
.gb-admin-link,
.gb-app-shortcut,
.gb-mobile-link {
    text-decoration: none;
    border-radius: 8px;
    letter-spacing: 0;
}

.gb-nav-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.48rem 0.55rem;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.82);
    background: transparent;
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
}

.gb-nav-link:hover,
.gb-nav-link:focus,
.gb-nav-link.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.gb-nav-link.is-active {
    box-shadow: inset 0 -2px 0 #22c55e;
}

.gb-nav-dropdown-trigger {
    cursor: pointer;
}

.gb-chevron {
    font-size: 0.68rem;
    color: #9eddd4;
}

.gb-mega-menu {
    min-width: min(540px, calc(100vw - 2rem));
    padding: 0.7rem;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

.gb-mega-menu-wide {
    min-width: min(660px, calc(100vw - 2rem));
}

.gb-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.gb-menu-card {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    min-height: 58px;
    padding: 0.62rem;
    border-radius: 8px;
    color: #172033;
    white-space: normal;
}

.gb-menu-card:hover,
.gb-menu-card:focus,
.gb-menu-card.is-active {
    color: #0f172a;
    background: #eef7f2;
    text-decoration: none;
}

.gb-menu-card i {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #e0f2fe;
    color: #075985;
}

.gb-menu-card strong,
.gb-menu-card small {
    display: block;
}

.gb-menu-card strong {
    color: #172033;
    font-size: 0.92rem;
    line-height: 1.2;
}

.gb-menu-card small {
    color: #607086;
    font-size: 0.78rem;
    line-height: 1.25;
    margin-top: 0.12rem;
}

.gb-action-btn,
.gb-command-btn,
.gb-icon-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.36rem;
    padding: 0.44rem 0.58rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    font-weight: 800;
    white-space: nowrap;
}

.gb-action-btn:hover,
.gb-command-btn:hover,
.gb-icon-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    text-decoration: none;
}

.gb-command-btn {
    cursor: pointer;
}

.gb-action-primary {
    background: #22c55e;
    border-color: #22c55e;
    color: #052e16;
}

.gb-action-primary:hover {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.gb-icon-btn {
    position: relative;
    width: 40px;
    padding: 0;
}

.gb-notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 0.28rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    border: 2px solid #101827;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
}

.gb-notif-badge.is-empty {
    display: none;
}

.gb-demo-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #78350f;
    font-size: 0.78rem;
    font-weight: 900;
}

.gb-account-btn {
    min-height: 42px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
    max-width: 190px;
    padding: 0.3rem 0.55rem 0.3rem 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.gb-account-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.gb-account-avatar {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #d9f99d;
    color: #365314;
    font-weight: 900;
}

.gb-account-copy {
    display: grid;
    min-width: 0;
    text-align: left;
    line-height: 1.1;
}

.gb-account-copy strong,
.gb-account-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gb-account-copy strong {
    font-size: 0.84rem;
}

.gb-account-copy small {
    color: #9eddd4;
    font-size: 0.72rem;
    margin-top: 0.15rem;
}

.gb-action-menu,
.gb-account-menu {
    border-radius: 8px;
    border: 1px solid #dfe7ef;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
    padding: 0.45rem;
}

.gb-action-menu .dropdown-item,
.gb-account-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 8px;
    padding: 0.58rem 0.68rem;
    font-weight: 700;
}

.gb-action-menu .dropdown-item i,
.gb-account-menu .dropdown-item i {
    width: 18px;
    text-align: center;
    color: #0f766e;
}

.gb-admin-rail {
    background: #f8fafc;
    border-bottom: 1px solid #dfe6ee;
}

.gb-admin-rail-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.45rem 1rem;
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gb-admin-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.65rem;
    color: #334155;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.gb-admin-link:hover,
.gb-admin-link.is-active {
    color: #0f172a;
    background: #e0f2fe;
    border-color: #bae6fd;
    text-decoration: none;
}

.gb-app-strip,
.gb-admin-context {
    background: #f8fafc;
    border-bottom: 1px solid #dfe6ee;
}

.gb-app-strip-inner,
.gb-admin-context-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.42rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gb-section-pill,
.gb-app-shortcut {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    padding: 0.38rem 0.62rem;
    border: 1px solid #dbe7ef;
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

.gb-section-pill {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #ecfdf5;
    color: #065f46;
}

.gb-app-shortcuts,
.gb-admin-shortcuts {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.gb-app-shortcut {
    color: #334155;
    background: #fff;
    cursor: pointer;
}

.gb-app-shortcut:hover,
.gb-app-shortcut:focus,
.gb-app-shortcut.is-active {
    color: #0f172a;
    background: #e0f2fe;
    border-color: #bae6fd;
    text-decoration: none;
}

.gb-admin-context {
    background: #eef6ff;
}

.gb-admin-section-pill {
    background: #dbeafe;
    border-color: #bfdbfe;
    color: #1e3a8a;
}

.gb-admin-shortcut.is-active {
    background: #dbeafe;
    border-color: #93c5fd;
}

.gb-mobile-rail {
    display: none;
}

.gb-command-palette {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 1rem 1rem;
}

body.gb-command-open {
    overflow: hidden;
}

.gb-command-palette.is-open {
    display: flex;
}

.gb-command-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(8px);
}

.gb-command-panel {
    position: relative;
    width: min(680px, 100%);
    max-height: min(78vh, 720px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    background: #fff;
    color: #172033;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.32);
    overflow: hidden;
}

.gb-command-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.75rem;
}

.gb-command-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0;
}

.gb-command-close {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    color: #334155;
    background: #f8fafc;
}

.gb-command-search {
    margin: 0 1rem 0.8rem;
    min-height: 46px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
}

.gb-command-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #172033;
    font-size: 1rem;
    font-weight: 700;
}

.gb-command-list {
    display: grid;
    gap: 0.35rem;
    padding: 0 0.8rem 0.8rem;
    overflow-y: auto;
}

.gb-command-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
    min-height: 58px;
    padding: 0.62rem;
    border-radius: 8px;
    color: #172033;
    text-decoration: none;
}

.gb-command-item:hover,
.gb-command-item:focus,
.gb-command-item.is-focus {
    color: #0f172a;
    background: #eef7f2;
    text-decoration: none;
}

.gb-command-item i {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #e0f2fe;
    color: #075985;
}

.gb-command-item strong,
.gb-command-item small {
    display: block;
}

.gb-command-item strong {
    font-size: 0.95rem;
    line-height: 1.2;
}

.gb-command-item small {
    margin-top: 0.12rem;
    color: #607086;
    font-size: 0.78rem;
    line-height: 1.25;
}

.gb-command-item.is-hidden,
.gb-command-empty {
    display: none;
}

.gb-command-empty.is-visible {
    display: block;
    padding: 1rem;
    color: #64748b;
    text-align: center;
    font-weight: 800;
}

@media (max-width: 1320px) {
    .gb-command-btn span,
    .gb-nav-actions .gb-action-btn:not(.gb-action-primary) span {
        display: none;
    }

    .gb-command-btn,
    .gb-nav-actions .gb-action-btn:not(.gb-action-primary) {
        width: 40px;
        padding-inline: 0;
    }

    .gb-nav-actions .gb-action-primary {
        padding-inline: 0.68rem;
    }

    .gb-demo-chip {
        padding-inline: 0.48rem;
    }
}

@media (max-width: 1120px) {
    .gb-brand {
        min-width: auto;
    }

    .gb-brand-copy small {
        display: none;
    }

    .gb-nav-link {
        padding-inline: 0.48rem;
    }
}

@media (max-width: 1079.98px) {
    .gb-nav-inner {
        min-height: 64px;
        position: relative;
    }

    .gb-menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .gb-nav-menu {
        display: none;
        position: absolute;
        top: calc(100% - 0.2rem);
        left: 0.75rem;
        right: 0.75rem;
        max-height: min(78vh, 720px);
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.8rem;
        background: #111827;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28);
    }

    .gb-nav-menu.is-open {
        display: flex;
    }

    .gb-nav-main,
    .gb-nav-actions {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 0.45rem;
    }

    .gb-nav-link,
    .gb-action-btn,
    .gb-command-btn,
    .gb-account-btn {
        width: 100%;
        justify-content: flex-start;
    }

    .gb-command-btn span,
    .gb-nav-actions .gb-action-btn span {
        display: inline;
    }

    .gb-icon-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 0.48rem 0.75rem;
    }

    .gb-icon-btn::after {
        content: "Notifications";
        font-weight: 800;
        margin-left: 0.2rem;
    }

    .gb-mega-menu,
    .gb-mega-menu-wide {
        min-width: 100%;
        width: 100%;
    }

    .gb-menu-grid {
        grid-template-columns: 1fr;
    }

    .gb-command-palette {
        padding-top: 1rem;
    }

    .gb-account-btn {
        max-width: none;
    }
}

@media (max-width: 767.98px) {
    body.gb-has-mobile-rail {
        padding-bottom: 78px;
    }

    .gb-nav-inner {
        padding-inline: 0.75rem;
    }

    .gb-brand-copy strong {
        font-size: 0.95rem;
    }

    .gb-admin-rail-inner {
        padding-inline: 0.75rem;
    }

    .gb-app-strip,
    .gb-admin-context {
        display: none;
    }

    .gb-mobile-rail {
        position: fixed;
        left: 0.7rem;
        right: 0.7rem;
        bottom: 0.55rem;
        z-index: 1050;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.25rem;
        padding: 0.35rem;
        background: rgba(15, 23, 42, 0.96);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
        backdrop-filter: blur(10px);
    }

    .gb-mobile-link {
        min-height: 54px;
        display: grid;
        place-items: center;
        gap: 0.15rem;
        padding: 0.3rem 0.15rem;
        border: 0;
        color: rgba(255, 255, 255, 0.76);
        background: transparent;
        font-size: 0.72rem;
        font-weight: 800;
        line-height: 1.05;
    }

    .gb-mobile-link i {
        font-size: 1rem;
    }

    .gb-mobile-link:hover,
    .gb-mobile-link.is-active {
        color: #fff;
        background: rgba(34, 197, 94, 0.18);
        text-decoration: none;
    }

    .gb-command-panel {
        max-height: calc(100vh - 2rem);
    }
}

@media (max-width: 420px) {
    .gb-brand {
        gap: 0.45rem;
    }

    .gb-brand-icon {
        width: 38px;
        height: 38px;
    }

    .gb-brand-copy strong {
        max-width: 142px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

[data-theme="dark"] .gb-admin-rail {
    background: #0f172a;
    border-color: #243447;
}

[data-theme="dark"] .gb-app-strip,
[data-theme="dark"] .gb-admin-context {
    background: #0f172a;
    border-color: #243447;
}

[data-theme="dark"] .gb-admin-link {
    background: #111827;
    border-color: #243447;
    color: #cbd5e1;
}

[data-theme="dark"] .gb-admin-link:hover,
[data-theme="dark"] .gb-admin-link.is-active {
    background: #1f2937;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .gb-section-pill {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(74, 222, 128, 0.22);
    color: #bbf7d0;
}

[data-theme="dark"] .gb-admin-section-pill {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(96, 165, 250, 0.24);
    color: #bfdbfe;
}

[data-theme="dark"] .gb-app-shortcut {
    background: #111827;
    border-color: #243447;
    color: #cbd5e1;
}

[data-theme="dark"] .gb-app-shortcut:hover,
[data-theme="dark"] .gb-app-shortcut:focus,
[data-theme="dark"] .gb-app-shortcut.is-active {
    background: #1f2937;
    color: #f8fafc;
}

[data-theme="dark"] .gb-admin-link {
    background: #111827;
    border-color: #243447;
    color: #cbd5e1;
}

[data-theme="dark"] .gb-admin-link:hover,
[data-theme="dark"] .gb-admin-link.is-active {
    color: #f8fafc;
    background: #1f2937;
}

[data-theme="dark"] .gb-mega-menu,
[data-theme="dark"] .gb-action-menu,
[data-theme="dark"] .gb-account-menu,
[data-theme="dark"] .gb-command-panel {
    background: #111827;
    border-color: #243447;
}

[data-theme="dark"] .gb-menu-card,
[data-theme="dark"] .gb-action-menu .dropdown-item,
[data-theme="dark"] .gb-account-menu .dropdown-item,
[data-theme="dark"] .gb-command-item {
    color: #e5edf7;
}

[data-theme="dark"] .gb-menu-card strong,
[data-theme="dark"] .gb-command-item strong,
[data-theme="dark"] .gb-command-head h2,
[data-theme="dark"] .gb-command-search input {
    color: #f8fafc;
}

[data-theme="dark"] .gb-menu-card small,
[data-theme="dark"] .gb-command-item small {
    color: #aebed1;
}

[data-theme="dark"] .gb-menu-card:hover,
[data-theme="dark"] .gb-menu-card:focus,
[data-theme="dark"] .gb-menu-card.is-active,
[data-theme="dark"] .gb-command-item:hover,
[data-theme="dark"] .gb-command-item:focus,
[data-theme="dark"] .gb-command-item.is-focus {
    background: #1f2937;
}

[data-theme="dark"] .gb-command-search,
[data-theme="dark"] .gb-command-close {
    background: #0f172a;
    border-color: #243447;
    color: #cbd5e1;
}
