/* =========================================================
   CCTV CONTROL v1.1
   HEADER MASTER
   ========================================================= */

:root {
    --header-height: 58px;
    --header-bg: #03121f;
    --header-line: #12405a;
    --header-blue: #079df5;
    --header-green: #00e6a0;
    --header-text: #f2f6fa;
    --header-muted: #829db3;
    --header-panel: #081a28;
}


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

#globalHeader {
    width: 100%;
    height: var(--header-height);
    min-height: var(--header-height);
}

.topbar {
    position: fixed;

    top: 0;
    left: 0;
    right: 0;

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

    display: flex;
    align-items: center;

    padding: 0 14px;

    box-sizing: border-box;

    background: var(--header-bg);
    border-bottom: 1px solid var(--header-line);

    z-index: 10000;
}


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

.brand {
    height: 100%;

    display: flex;
    align-items: center;

    flex: 0 0 300px;

    gap: 8px;
}

.menu-button {
    width: 30px;
    height: 30px;

    flex: 0 0 30px;

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

    padding: 0;

    border: 0;

    background: transparent;
    color: var(--header-blue);

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

    cursor: pointer;
}

.brand-logo {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

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

    overflow: hidden;
}

.brand-logo img {
    width: 42px;
    height: 42px;

    display: block;

    object-fit: contain;
}

.brand-text {
    min-width: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-title {
    color: var(--header-text);

    font-size: var(--font-page-title);
    font-weight: 700;

    line-height: 1;

    white-space: nowrap;
}

.brand-subtitle {
    margin-top: 3px;

    color: var(--header-muted);

    font-size: var(--font-secondary);
    font-weight: 500;

    line-height: 1;

    white-space: nowrap;
}


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

.navigation {
    height: 100%;

    display: flex;
    align-items: stretch;

    gap: 2px;

    flex: 1;

    min-width: 0;
}

.nav-link {
    position: relative;

    height: 100%;

    min-width: 105px;

    padding: 0 16px;

    box-sizing: border-box;

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

    gap: 7px;

    border: 0;

    background: transparent;

    color: #8ca7bb;

    font-family: inherit;
    font-size: var(--font-menu);
    font-weight: 600;

    line-height: 1;

    text-decoration: none;

    white-space: nowrap;

    cursor: pointer;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(7, 157, 245, 0.07);
}

.nav-link.active {
    color: var(--header-blue);
    background: rgba(7, 157, 245, 0.12);
}

.nav-link.active::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 3px;

    background: var(--header-blue);
}

.nav-icon {
    display: inline-flex;

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

    font-size: var(--font-menu);

    line-height: 1;
}


/* =========================================================
   SETTINGS DROPDOWN
   ========================================================= */

.nav-dropdown {
    position: relative;

    height: 100%;
}

.nav-dropdown-toggle {
    width: 100%;
}

.nav-arrow {
    margin-left: 2px;

    color: var(--header-muted);

    font-size: var(--font-dropdown);

    transition: transform 0.15s ease;
}

.nav-dropdown.open .nav-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;

    top: calc(100% + 1px);
    left: 0;

    width: 210px;

    padding: 6px;

    box-sizing: border-box;

    background: var(--header-panel);

    border: 1px solid #1a4961;
    border-radius: 8px;

    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.50);

    z-index: 20000;

    display: none;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-link {
    min-height: 36px;

    display: flex;
    align-items: center;

    gap: 9px;

    padding: 0 10px;

    border-radius: 5px;

    color: #dce7ef;

    font-size: var(--font-dropdown);
    font-weight: 500;

    line-height: 1;

    text-decoration: none;

    white-space: nowrap;
}

.nav-dropdown-link:hover {
    background: #102f43;
    color: #ffffff;
}

.nav-dropdown-link.active {
    color: var(--header-blue);
    background: rgba(7, 157, 245, 0.12);
}

.nav-dropdown-icon {
    width: 18px;
    min-width: 18px;

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

    font-size: var(--font-dropdown);
}


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

.header-right {
    height: 100%;

    margin-left: auto;

    display: flex;
    align-items: center;

    flex: 0 0 auto;
}

.system-online {
    height: 100%;

    display: flex;
    align-items: center;

    gap: 7px;

    padding: 0 14px;

    color: var(--text-primary);

    font-size: var(--font-secondary);
    font-weight: 500;

    white-space: nowrap;
}

.system-online span {
    width: 8px;
    height: 8px;

    flex: 0 0 8px;

    border-radius: 50%;

    background: var(--header-green);

    box-shadow:
        0 0 9px rgba(0, 230, 160, 0.65);
}

.header-divider {
    width: 1px;
    height: 34px;

    flex: 0 0 1px;

    background: var(--header-line);
}

.datetime {
    min-width: 100px;
    height: 100%;

    display: flex;
    flex-direction: column;

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

    padding: 0 10px;

    text-align: center;
}

.datetime div {
    color: var(--header-muted);

    font-size: var(--font-label);
    font-weight: 500;

    line-height: 1.1;
}

.datetime strong {
    margin-top: 2px;

    color: var(--header-text);

    font-size: var(--font-data);
    font-weight: 700;

    line-height: 1.1;
}


/* =========================================================
   USER MENU
   ========================================================= */

.admin-menu {
    position: relative;

    height: 100%;

    display: flex;
    align-items: center;

    z-index: 11000;
}

.admin {
    height: 100%;

    display: flex;
    align-items: center;

    gap: 6px;

    padding: 0 8px;

    border: 0;

    background: transparent;

    color: var(--text-secondary);

    font-family: inherit;
    font-size: var(--font-secondary);
    font-weight: 600;

    cursor: pointer;
}

.admin-avatar {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

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

    border-radius: 50%;

    background: #d9e5ee;
    color: #183047;

    font-size: var(--font-secondary);
    font-weight: 700;
}

#globalUserName {
    color: #dce7ef;

    font-size: var(--font-secondary);
    font-weight: 600;

    white-space: nowrap;
}

.admin b {
    color: #7894a9;

    font-size: var(--font-secondary);

    line-height: 1;
}


/* =========================================================
   USER DROPDOWN
   ========================================================= */

.admin-dropdown {
    position: absolute;

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

    width: 190px;

    padding: 6px;

    box-sizing: border-box;

    background: var(--header-panel);

    border: 1px solid #1a4961;
    border-radius: 8px;

    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.50);

    z-index: 20000;
}

.admin-dropdown[hidden] {
    display: none;
}

.admin-dropdown-item {
    width: 100%;
    min-height: 34px;

    display: flex;
    align-items: center;

    gap: 9px;

    padding: 0 9px;

    border: 0;
    border-radius: 5px;

    background: transparent;

    color: #dce7ef;

    font-family: inherit;
    font-size: var(--font-dropdown);
    font-weight: 500;

    cursor: pointer;
}

.admin-dropdown-item:hover {
    background: #102f43;
    color: #ffffff;
}

.dropdown-icon {
    width: 18px;
    min-width: 18px;

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

.dropdown-divider {
    width: 100%;
    height: 1px;

    margin: 4px 0;

    background: #173c50;
}

.logout-item {
    color: #ff7777;
}

.logout-item:hover {
    background: rgba(210, 55, 55, 0.14);
    color: #ff9999;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {

    .brand {
        flex-basis: 260px;
    }

    .nav-link {
        min-width: 90px;
        padding: 0 10px;
    }

    .system-online {
        padding: 0 9px;
    }

    .datetime {
        min-width: 90px;
    }
}


@media (max-width: 950px) {

    .brand {
        flex-basis: auto;
    }

    .brand-subtitle {
        display: none;
    }

    .nav-link {
        min-width: auto;
        padding: 0 8px;
    }

    .system-online,
    .datetime,
    .header-divider {
        display: none;
    }
}


@media (max-width: 600px) {

    #globalHeader {
        height: 54px;
        min-height: 54px;
    }

    .topbar {
        height: 54px;
    }

    .brand-logo {
        width: 38px;
        height: 38px;

        flex-basis: 38px;
    }

    .brand-logo img {
        width: 38px;
        height: 38px;
    }

    .brand-title {
        font-size: 16px;
    }

    .navigation {
        display: none;
    }
}
