/* =========================================================
   TIENHUB — GLOBAL CSS
   Header / Navigation / Search / Profile / Footer
========================================================= */


/* =========================================================
   VARIABLES
========================================================= */

:root {
    --bg: #061522;
    --bg-soft: #081b2a;

    --text: #f2f7fa;
    --muted: #849aa8;

    --cyan: #18c8f5;
    --cyan-2: #0aa7d7;

    --line: rgba(72, 191, 235, 0.24);
    --line-soft: rgba(127, 171, 193, 0.14);

    --content: 1360px;
    --nav-height: 62px;
}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


html {
    min-width: 320px;
    min-height: 100%;

    background: var(--bg);

    scroll-behavior: smooth;
}


body {
    min-width: 320px;
    min-height: 100vh;

    overflow-x: hidden;

    background:
        radial-gradient(
            circle at 50% -10%,
            rgba(15, 90, 126, 0.12),
            transparent 42%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


button,
input {
    font: inherit;
}


button {
    border: 0;
}


a {
    color: inherit;
    text-decoration: none;
}


img {
    display: block;
    max-width: 100%;
}


/* =========================================================
   HEADER
========================================================= */

.site-header {
    position: sticky;
    top: 0;

    z-index: 1000;

    width: 100%;
    height: var(--nav-height);

    border-bottom:
        1px solid rgba(91, 142, 166, 0.13);

    background:
        rgba(5, 17, 28, 0.96);

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


.nav-shell {
    width: min(100%, var(--content));
    height: 100%;

    margin: 0 auto;

    padding: 0 18px;

    display: flex;
    align-items: center;

    gap: 34px;
}


/* =========================================================
   LOGO
========================================================= */

.brand {
    display: inline-flex;
    align-items: center;

    gap: 10px;

    flex: 0 0 auto;

    color: #f2f7fa;

    transition:
        opacity .18s ease,
        transform .18s ease;
}


.brand:hover {
    opacity: .92;
}


.brand:active {
    transform: scale(.98);
}


.brand-mark {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    overflow: hidden;
}


.brand-mark img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}


.brand-name {
    white-space: nowrap;

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

    letter-spacing: -.5px;
}


/* =========================================================
   NAVIGATION
========================================================= */

.main-nav {
    height: 100%;

    display: flex;
    align-items: center;

    gap: 4px;
}


.main-nav a {
    position: relative;

    height: 100%;

    padding: 0 14px;

    display: flex;
    align-items: center;

    color: #b0c0ca;

    font-size: 13px;
    font-weight: 650;

    white-space: nowrap;

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


.main-nav a:hover {
    color: #ffffff;
}


.main-nav a.active {
    color: #ffffff;

    background:
        rgba(24, 200, 245, .055);
}


.main-nav a::after {
    content: "";

    position: absolute;

    left: 14px;
    right: 14px;
    bottom: 0;

    height: 2px;

    border-radius: 99px;

    background: var(--cyan);

    opacity: 0;

    transform: scaleX(.5);

    transition:
        opacity .18s ease,
        transform .18s ease;
}


.main-nav a.active::after {
    opacity: 1;

    transform: scaleX(1);
}


/* =========================================================
   NAV ACTIONS
========================================================= */

.nav-actions {
    margin-left: auto;

    display: flex;
    align-items: center;

    gap: 12px;

    min-width: 0;
}


/* =========================================================
   SEARCH
========================================================= */

.search {
    position: relative;

    width: 214px;
    height: 34px;

    display: flex;
    align-items: center;
}


.search svg {
    position: absolute;

    left: 11px;

    width: 16px;
    height: 16px;

    fill: none;

    stroke: #8fa9b5;
    stroke-width: 1.8;

    pointer-events: none;

    transition:
        stroke .18s ease;
}


.search input {
    width: 100%;
    height: 100%;

    padding:
        0
        12px
        0
        35px;

    border:
        1px solid rgba(26, 190, 239, .28);

    border-radius: 8px;

    outline: none;

    background:
        rgba(4, 29, 44, .85);

    color: #ffffff;

    font-size: 12px;

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


.search input::placeholder {
    color: #708894;
}


.search input:focus {
    border-color:
        rgba(45, 211, 255, .72);

    background:
        rgba(5, 31, 46, .96);

    box-shadow:
        0 0 0 3px rgba(24, 200, 245, .06);
}


.search:focus-within svg {
    stroke: var(--cyan);
}


/* =========================================================
   NAV DIVIDER
========================================================= */

.nav-divider {
    width: 1px;
    height: 22px;

    flex-shrink: 0;

    background:
        rgba(113, 150, 166, .22);
}


/* =========================================================
   PROFILE WRAPPER
========================================================= */

.profile-wrap {
    position: relative;

    flex-shrink: 0;
}


/* =========================================================
   PROFILE BUTTON
========================================================= */

.profile {
    min-width: 0;
    height: 38px;

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

    gap: 8px;

    padding:
        3px
        11px
        3px
        4px;

    border:
        1px solid rgba(39, 180, 228, .28);

    border-radius: 999px;

    background:
        rgba(9, 32, 47, .82);

    color: #e7f0f4;

    cursor: pointer;

    transition:
        background .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}


.profile:hover {
    background:
        rgba(12, 48, 68, .95);

    border-color:
        rgba(39, 200, 245, .58);

    box-shadow:
        0 5px 18px rgba(0, 0, 0, .20);
}


.profile-wrap.open .profile {
    background:
        rgba(12, 48, 68, .95);

    border-color:
        rgba(39, 200, 245, .65);

    box-shadow:
        0 5px 18px rgba(0, 0, 0, .24);
}


.profile:active {
    transform: scale(.98);
}


/* =========================================================
   PROFILE AVATAR
========================================================= */

.profile-avatar {
    width: 30px;
    height: 30px;

    flex: 0 0 30px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background:
        linear-gradient(
            145deg,
            #19c8f5,
            #08749d
        );

    color: #ffffff;

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

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.16),
        0 2px 8px rgba(0,0,0,.22);
}


/* =========================================================
   PROFILE NAME
========================================================= */

.profile-name {
    max-width: 110px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    color: #e7f0f4;

    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   PROFILE DROPDOWN
========================================================= */

.profile-menu {
    position: absolute;

    top: calc(100% + 9px);
    right: 0;

    width: 220px;

    padding: 7px;

    border:
        1px solid rgba(40, 190, 237, .32);

    border-radius: 14px;

    background:
        linear-gradient(
            180deg,
            rgba(11, 35, 51, .98),
            rgba(6, 23, 35, .98)
        );

    box-shadow:
        0 18px 45px rgba(0, 0, 0, .38),
        0 0 20px rgba(24, 200, 245, .06);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform:
        translateY(-7px)
        scale(.98);

    transform-origin:
        top right;

    transition:
        opacity .18s ease,
        transform .22s ease,
        visibility .22s ease;
}


.profile-wrap.open .profile-menu {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform:
        translateY(0)
        scale(1);
}


/* =========================================================
   PROFILE MENU HEADER
========================================================= */

.profile-menu-head {
    padding:
        10px
        10px
        9px;

    border-bottom:
        1px solid rgba(127, 171, 193, .13);
}


.profile-menu-head strong {
    display: block;

    margin-bottom: 3px;

    color: #f2f7fa;

    font-size: 13px;
    font-weight: 750;
}


.profile-menu-head span {
    display: block;

    color: #849aa8;

    font-size: 10px;

    line-height: 1.4;
}


/* =========================================================
   PROFILE MENU ITEMS
========================================================= */

.profile-menu a,
.profile-menu button {
    width: 100%;
    min-height: 36px;

    display: flex;
    align-items: center;

    padding: 0 10px;

    border-radius: 8px;

    background: transparent;

    color: #dce9ee;

    font-size: 11px;

    cursor: pointer;

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


.profile-menu a:hover,
.profile-menu button:hover {
    background:
        rgba(24, 200, 245, .10);

    color: #ffffff;
}


.profile-logout {
    margin-top: 3px;

    border-top:
        1px solid rgba(127, 171, 193, .11) !important;

    color:
        #ff9d9d !important;
}


/* =========================================================
   FOOTER
========================================================= */

.site-footer {
    margin-top: 30px;

    border-top:
        1px solid rgba(37, 181, 230, .22);

    background:
        #04121d;
}


.footer-inner {
    width: min(100%, var(--content));

    margin: 0 auto;

    padding:
        28px
        18px
        24px;

    display: grid;

    grid-template-columns:
        1.8fr
        .8fr
        .8fr
        .9fr
        1.4fr;

    gap: 36px;
}


/* =========================================================
   FOOTER BRAND
========================================================= */

.footer-brand {
    max-width: 300px;
}


.footer-logo {
    display: inline-flex;
    align-items: center;

    gap: 9px;

    margin-bottom: 8px;

    font-size: 18px;
}


.footer-logo img {
    width: 32px;
    height: 32px;

    object-fit: contain;
}


.footer-logo strong {
    color: #f2f7fa;

    font-weight: 800;
}


.footer-brand p {
    margin: 0;

    color: #8096a4;

    font-size: 11px;

    line-height: 1.6;
}


/* =========================================================
   FOOTER COLUMNS
========================================================= */

.footer-column {
    display: flex;

    flex-direction: column;

    align-items: flex-start;

    gap: 7px;
}


.footer-column strong {
    margin:
        2px 0
        4px;

    color: #dce9ee;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: .04em;
}


.footer-column a {
    color: #8399a6;

    font-size: 11px;

    transition:
        color .18s ease;
}


.footer-column a:hover {
    color: var(--cyan);
}


/* =========================================================
   SYSTEM STATUS
========================================================= */

.system-status {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 8px;

    align-self: flex-start;

    color: #778d99;

    font-size: 10px;

    white-space: nowrap;
}


.status-dot {
    width: 7px;
    height: 7px;

    flex: 0 0 7px;

    border-radius: 50%;

    background: #16dc87;

    box-shadow:
        0 0 9px rgba(22, 220, 135, .7);
}


/* =========================================================
   FOOTER BOTTOM
========================================================= */

.footer-bottom {
    width: min(100%, var(--content));

    margin: 0 auto;

    padding:
        13px
        18px
        17px;

    border-top:
        1px solid rgba(101, 151, 169, .09);

    color: #425b67;

    font-size: 9px;

    text-align: center;
}


/* =========================================================
   SCROLLBAR
========================================================= */

::-webkit-scrollbar {
    width: 7px;
}


::-webkit-scrollbar-track {
    background: #061019;
}


::-webkit-scrollbar-thumb {
    border-radius: 999px;

    background:
        rgba(70, 126, 146, .35);
}


::-webkit-scrollbar-thumb:hover {
    background:
        rgba(70, 160, 184, .52);
}


/* =========================================================
   SELECTION
========================================================= */

::selection {
    background:
        rgba(27, 195, 239, .25);

    color: #ffffff;
}


/* =========================================================
   RESPONSIVE — TABLET
========================================================= */

@media (max-width: 980px) {

    .nav-shell {
        gap: 12px;
    }


    .main-nav {
        gap: 0;
    }


    .main-nav a {
        padding:
            0 8px;

        font-size: 12px;
    }


    .main-nav a::after {
        left: 8px;
        right: 8px;
    }


    .search {
        width: 165px;
    }


    .footer-inner {
        grid-template-columns:
            1.5fr
            1fr
            1fr;
    }


    .system-status {
        justify-content: flex-start;

        grid-column: 1 / -1;
    }
}


/* =========================================================
   RESPONSIVE — MOBILE
========================================================= */

@media (max-width: 760px) {

    :root {
        --nav-height: 58px;
    }


    .nav-shell {
        padding:
            0 12px;

        gap: 8px;
    }


    .brand-name {
        display: none;
    }


    .main-nav {
        overflow-x: auto;

        scrollbar-width: none;
    }


    .main-nav::-webkit-scrollbar {
        display: none;
    }


    .main-nav a {
        padding:
            0 7px;

        font-size: 11px;
    }


    .main-nav a::after {
        left: 7px;
        right: 7px;
    }


    .nav-actions {
        gap: 6px;
    }


    .search {
        width: 36px;
    }


    .search input {
        width: 36px;

        padding: 0;

        font-size: 0;

        background: transparent;

        border-color: transparent;
    }


    .search svg {
        left: 9px;
    }


    .nav-divider {
        display: none;
    }


    .profile {
        width: 40px;
        height: 40px;

        padding: 3px;
    }


    .profile-name {
        display: none;
    }


    .profile-menu {
        right: 0;
    }


    .footer-inner {
        grid-template-columns:
            1fr 1fr;

        gap: 28px;
    }


    .footer-brand {
        grid-column:
            1 / -1;

        max-width: none;
    }


    .system-status {
        grid-column:
            1 / -1;
    }
}


/* =========================================================
   RESPONSIVE — SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    .footer-inner {
        grid-template-columns: 1fr;
    }


    .footer-brand {
        grid-column: auto;
    }


    .system-status {
        grid-column: auto;

        justify-content: flex-start;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration: .01ms !important;

        animation-duration: .01ms !important;

        animation-iteration-count: 1 !important;
    }
}