/* =========================================================
   PROFESSIONAL COMPACT APPLICATION HEADER
   Karang Taruna RT 003 · Warga RW 004
   ========================================================= */

:root {
    --gm-red: #dc2626;
    --gm-red-dark: #991b1b;
    --gm-red-soft: #fef2f2;
    --gm-text: #0f172a;
    --gm-muted: #64748b;
    --gm-border: #e5e7eb;
    --gm-white: #ffffff;
    --gm-surface: #f8fafc;
}


/* ---------------------------------------------------------
   HEADER SHELL
   --------------------------------------------------------- */
.gm-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;

    background:
        rgba(255,255,255,.98);

    border-bottom:
        1px solid
        var(--gm-border);

    box-shadow:
        0 5px 22px
        rgba(15,23,42,.035);

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}


.gm-header-primary {
    width:
        min(
            1180px,
            calc(100% - 32px)
        );

    min-height: 68px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 22px;
}


.gm-brand {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 11px;

    color: var(--gm-text);
    text-decoration: none;
}


.gm-flag {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    overflow: hidden;

    display: block;

    border:
        1px solid
        #fee2e2;

    border-radius: 12px;

    box-shadow:
        0 7px 18px
        rgba(185,28,28,.10);
}


.gm-flag-red,
.gm-flag-white {
    display: block;
    height: 50%;
}


.gm-flag-red {
    background:
        var(--gm-red);
}


.gm-flag-white {
    background: #fff;
}


.gm-brand-copy {
    min-width: 0;

    line-height: 1.12;
}


.gm-brand-copy strong {
    display: block;

    color: #0f172a;

    font-size: 14px;
    font-weight: 850;

    white-space: nowrap;
}


.gm-brand-copy small {
    display: block;

    margin-top: 3px;

    color: #475569;

    font-size: 8px;
    font-weight: 800;

    white-space: nowrap;
}


.gm-location-line {
    display: block;

    margin-top: 3px;

    color: #94a3b8;

    font-size: 7px;
    line-height: 1.3;

    white-space: nowrap;
}


/* ---------------------------------------------------------
   ACCOUNT AREA
   --------------------------------------------------------- */
.gm-account {
    flex: 0 0 auto;

    display: flex;
    align-items: center;

    gap: 8px;
}


.gm-account-copy {
    max-width: 180px;

    margin-right: 3px;

    text-align: right;
}


.gm-account-copy strong {
    display: block;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #334155;

    font-size: 9px;
}


.gm-account-copy small {
    display: block;

    margin-top: 3px;

    color: #94a3b8;

    font-size: 7px;
    font-weight: 850;
}


.gm-profile-shortcut,
.gm-login,
.gm-register,
.gm-logout {
    min-height: 34px;

    padding: 8px 11px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    text-decoration: none;

    font-size: 8px;
    font-weight: 850;
}


.gm-profile-shortcut,
.gm-login {
    border:
        1px solid
        var(--gm-border);

    background: #fff;
    color: #475569;
}


.gm-register {
    border:
        1px solid
        var(--gm-red);

    background:
        var(--gm-red);

    color: #fff;
}


.gm-logout {
    border:
        1px solid
        #fecaca;

    background:
        var(--gm-red-soft);

    color:
        var(--gm-red-dark);
}


/* ---------------------------------------------------------
   DESKTOP NAV: SECOND ROW
   --------------------------------------------------------- */
.gm-header-navrow {
    border-top:
        1px solid
        #f1f5f9;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #fbfdff
        );
}


.gm-desktop-nav {
    width:
        min(
            1180px,
            calc(100% - 32px)
        );

    min-height: 47px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 5px;
}


.gm-nav-link {
    min-height: 34px;

    padding: 8px 13px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 9px;

    background: transparent;

    color: #475569;

    text-decoration: none;

    font-family: inherit;

    font-size: 9px;
    font-weight: 850;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background .15s ease,
        color .15s ease,
        box-shadow .15s ease;
}


.gm-nav-link:hover {
    background: #f8fafc;
    color: #0f172a;
}


.gm-nav-link.is-active {
    background:
        var(--gm-red-soft);

    color:
        var(--gm-red-dark);

    box-shadow:
        inset 0 0 0 1px
        #fee2e2;
}


/* ---------------------------------------------------------
   DROPDOWNS
   --------------------------------------------------------- */
.gm-nav-dropdown {
    position: relative;
    flex: 0 0 auto;
}


.gm-nav-dropdown-trigger {
    gap: 6px;
}


.gm-nav-chevron {
    position: relative;
    top: -1px;

    font-size: 11px;
    line-height: 1;

    transition:
        transform .16s ease;
}


.gm-nav-dropdown-menu {
    position: absolute;

    top:
        calc(100% + 7px);

    left: 50%;
    z-index: 1100;

    width: 285px;

    padding: 7px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform:
        translateX(-50%)
        translateY(-5px);

    border:
        1px solid
        var(--gm-border);

    border-radius: 14px;

    background:
        rgba(255,255,255,.995);

    box-shadow:
        0 20px 50px
        rgba(15,23,42,.14);

    transition:
        opacity .16s ease,
        transform .16s ease,
        visibility .16s ease;
}


.gm-nav-dropdown::before {
    content: "";

    position: absolute;

    top: 100%;
    left: 0;

    width: 100%;
    height: 10px;
}


.gm-nav-dropdown:hover
.gm-nav-dropdown-menu,
.gm-nav-dropdown:focus-within
.gm-nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform:
        translateX(-50%)
        translateY(0);
}


.gm-nav-dropdown:hover
.gm-nav-chevron,
.gm-nav-dropdown:focus-within
.gm-nav-chevron {
    transform:
        rotate(180deg);
}


.gm-nav-dropdown-menu a {
    display: block;

    padding: 11px 12px;

    border-radius: 10px;

    color: #334155;

    text-decoration: none;

    transition:
        background .15s ease,
        color .15s ease;
}


.gm-nav-dropdown-menu a + a {
    margin-top: 3px;
}


.gm-nav-dropdown-menu a:hover,
.gm-nav-dropdown-menu a.is-active {
    background:
        var(--gm-red-soft);

    color:
        var(--gm-red-dark);
}


.gm-nav-dropdown-menu strong {
    display: block;

    font-size: 9px;
    line-height: 1.4;
}


.gm-nav-dropdown-menu small {
    display: block;

    margin-top: 3px;

    color: #94a3b8;

    font-size: 7px;
    line-height: 1.45;
}


/* ---------------------------------------------------------
   MOBILE BUTTON / MENU
   --------------------------------------------------------- */
.gm-menu-button {
    width: 42px;
    height: 42px;

    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    gap: 4px;

    padding: 0;

    border:
        1px solid
        var(--gm-border);

    border-radius: 10px;

    background: #fff;

    cursor: pointer;
}


.gm-menu-button span {
    width: 17px;
    height: 2px;

    display: block;

    border-radius: 999px;

    background: #475569;
}


.gm-mobile-menu {
    display: none;
}


/* ---------------------------------------------------------
   FOOTER
   --------------------------------------------------------- */
.gm-footer {
    margin-top: 30px;

    border-top:
        1px solid
        var(--gm-border);

    background: #fff;
}


.gm-footer-inner {
    width:
        min(
            1180px,
            calc(100% - 28px)
        );

    margin: 0 auto;

    padding: 18px 0 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    color: #94a3b8;

    font-size: 8px;
}


/* ---------------------------------------------------------
   TABLET
   --------------------------------------------------------- */
@media (max-width: 980px) {

    body.gm-menu-open {
        overflow: hidden;
    }


    .gm-topbar {
        padding-top:
            env(safe-area-inset-top);
    }


    .gm-header-primary {
        min-height: 66px;

        width:
            calc(100% - 24px);
    }


    .gm-header-navrow,
    .gm-account-copy,
    .gm-profile-shortcut,
    .gm-login,
    .gm-register,
    .gm-logout {
        display: none;
    }


    .gm-menu-button {
        display: flex;

        min-width: 42px;
        min-height: 42px;
    }


    .gm-mobile-menu {
        position: fixed;

        z-index: 1001;

        top:
            calc(
                66px
                + env(safe-area-inset-top)
            );

        left:
            max(
                10px,
                env(safe-area-inset-left)
            );

        right:
            max(
                10px,
                env(safe-area-inset-right)
            );

        max-height:
            calc(
                100dvh
                - 80px
                - env(safe-area-inset-top)
            );

        overflow-y: auto;

        padding: 13px;

        display: block;

        border:
            1px solid
            var(--gm-border);

        border-radius: 16px;

        background:
            rgba(255,255,255,.995);

        box-shadow:
            0 22px 60px
            rgba(15,23,42,.18);
    }


    .gm-mobile-menu[hidden] {
        display: none !important;
    }


    .gm-mobile-user {
        display: flex;
        align-items: center;

        gap: 11px;

        padding:
            8px
            8px
            12px;

        border-bottom:
            1px solid
            #f1f5f9;
    }


    .gm-mobile-avatar {
        width: 38px;
        height: 38px;

        flex: 0 0 38px;

        display: grid;
        place-items: center;

        border-radius: 11px;

        background:
            linear-gradient(
                135deg,
                var(--gm-red),
                var(--gm-red-dark)
            );

        color: #fff;

        font-size: 14px;
        font-weight: 850;
    }


    .gm-mobile-user strong {
        display: block;

        color: #334155;

        font-size: 11px;
    }


    .gm-mobile-user small {
        display: block;

        margin-top: 3px;

        color: #94a3b8;

        font-size: 8px;
        font-weight: 850;
    }


    .gm-mobile-branding {
        margin:
            10px
            5px
            0;

        padding: 11px;

        border-radius: 11px;

        background:
            #f8fafc;
    }


    .gm-mobile-branding strong {
        display: block;

        font-size: 10px;

        color: #0f172a;
    }


    .gm-mobile-branding span {
        display: block;

        margin-top: 4px;

        color: #475569;

        font-size: 9px;
        font-weight: 850;
    }


    .gm-mobile-branding small {
        display: block;

        margin-top: 4px;

        color: #94a3b8;

        font-size: 8px;
        line-height: 1.5;
    }


    .gm-mobile-links {
        display: grid;

        gap: 5px;

        padding-top: 10px;
    }


    .gm-mobile-links > a,
    .gm-mobile-nav-group a {
        min-height: 44px;

        padding: 11px 13px;

        display: flex;
        align-items: center;

        border-radius: 10px;

        color: #475569;

        text-decoration: none;

        font-size: 10px;
        font-weight: 850;
    }


    .gm-mobile-links a:hover,
    .gm-mobile-links a.is-active {
        background:
            var(--gm-red-soft);

        color:
            var(--gm-red-dark);
    }


    .gm-mobile-nav-group {
        margin: 3px 0;

        padding: 7px;

        border:
            1px solid
            #eef2f7;

        border-radius: 12px;

        background:
            #f8fafc;
    }


    .gm-mobile-nav-label {
        display: block;

        padding:
            3px
            7px
            6px;

        color: #94a3b8;

        font-size: 7px;
        font-weight: 900;

        text-transform: uppercase;
        letter-spacing: .35px;
    }


    .gm-mobile-nav-group a {
        background: #fff;
    }


    .gm-mobile-nav-group a + a {
        margin-top: 4px;
    }


    .gm-mobile-links
    .gm-mobile-logout {
        margin-top: 4px;

        border:
            1px solid
            #fecaca;

        background:
            #fff7f7;

        color:
            var(--gm-red-dark);
    }


    .gm-footer-inner {
        display: grid;

        justify-items: center;

        text-align: center;
    }
}


/* ---------------------------------------------------------
   SMALL MOBILE
   --------------------------------------------------------- */
@media (max-width: 520px) {

    .gm-brand {
        max-width:
            calc(
                100vw - 88px
            );
    }


    .gm-brand-copy {
        max-width:
            calc(
                100vw - 145px
            );
    }


    .gm-brand-copy strong {
        overflow: hidden;
        text-overflow: ellipsis;

        font-size: 13px;
    }


    .gm-brand-copy small {
        overflow: hidden;
        text-overflow: ellipsis;

        font-size: 8px;
    }


    .gm-location-line {
        display: none;
    }


    .gm-flag {
        width: 40px;
        height: 40px;

        flex-basis: 40px;
    }
}


/* ---------------------------------------------------------
   ACCESSIBILITY
   --------------------------------------------------------- */
.gm-nav-link,
.gm-profile-shortcut,
.gm-login,
.gm-register,
.gm-logout,
.gm-menu-button,
.gm-mobile-links a {
    -webkit-tap-highlight-color:
        transparent;
}


.gm-nav-link:focus-visible,
.gm-profile-shortcut:focus-visible,
.gm-login:focus-visible,
.gm-register:focus-visible,
.gm-logout:focus-visible,
.gm-menu-button:focus-visible,
.gm-mobile-links a:focus-visible {
    outline:
        3px solid
        rgba(220,38,38,.18);

    outline-offset: 2px;
}


@media (prefers-reduced-motion: reduce) {

    .gm-nav-link,
    .gm-profile-shortcut,
    .gm-login,
    .gm-register,
    .gm-logout,
    .gm-nav-chevron,
    .gm-nav-dropdown-menu {
        transition:
            none !important;
    }
}
