/* =========================================================
   THIẾT LẬP CHUNG
   ========================================================= */

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    overflow: hidden;
    background-color: #f4f6f9;
    color: #212529;
}


/* =========================================================
   FOCUS BOOTSTRAP
   ========================================================= */

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}


/* =========================================================
   APP SHELL
   ========================================================= */

.app-shell {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


/* =========================================================
   HEADER
   ========================================================= */

.app-header {
    height: 78px;
    min-height: 78px;
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    align-items: center;
    background-color: #0d5c3d;
    color: white;
    border-bottom: 4px solid #e0a800;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
    z-index: 100;
}


/* =========================================================
   THÔNG TIN ĐƠN VỊ
   ========================================================= */

.header-unit {
    padding-left: 22px;
    line-height: 1.25;
}

.header-province {
    font-size: 15px;
    font-weight: 600;
}

.header-ward {
    margin-top: 4px;
    font-size: 17px;
    font-weight: 700;
}


/* =========================================================
   TIÊU ĐỀ HỆ THỐNG
   ========================================================= */

.header-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}


/* =========================================================
   KHU VỰC USER
   ========================================================= */

.header-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
}


    /*
   _LoginPartial mặc định của ASP.NET có thể chứa ul.navbar-nav.
   Các rule dưới đây giúp nó phù hợp với Header mới.
*/

    .header-user .navbar-nav {
        flex-direction: row;
        align-items: center;
    }

    .header-user .nav-link {
        color: white !important;
        padding-left: 8px;
        padding-right: 8px;
    }

        .header-user .nav-link:hover {
            color: #ffe082 !important;
        }


/* =========================================================
   BODY
   ========================================================= */

.app-body {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.app-sidebar {
    width: 230px;
    min-width: 230px;
    background-color: #ffffff;
    border-right: 1px solid #d6dce1;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}


/* =========================================================
   TIÊU ĐỀ SIDEBAR
   ========================================================= */

.sidebar-title {
    height: 48px;
    display: flex;
    align-items: center;
    padding-left: 20px;
    background-color: #f0f3f5;
    border-bottom: 1px solid #d9dee3;
    color: #495057;
    font-size: 14px;
    font-weight: 700;
}


/* =========================================================
   MENU
   ========================================================= */

.sidebar-menu {
    padding-top: 8px;
    padding-bottom: 20px;
}


/* =========================================================
   NHÓM MENU
   ========================================================= */

.sidebar-group-title {
    margin-top: 13px;
    padding: 8px 16px 5px 18px;
    color: #7a858e;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}


/* =========================================================
   MENU ITEM
   ========================================================= */

.sidebar-item {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px 9px 18px;
    color: #343a40;
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

    .sidebar-item:hover {
        background-color: #eaf4ef;
        color: #0d5c3d;
        border-left-color: #0d5c3d;
        text-decoration: none;
    }


/* =========================================================
   ICON MENU
   ========================================================= */

.menu-icon {
    width: 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 17px;
    color: #55736a;
}


/* =========================================================
   VÙNG HIỂN THỊ TRANG CON
   ========================================================= */

.app-content {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 18px 22px;
    background-color: #f4f6f9;
}


    /*
   Các View cũ có .container của Bootstrap.
   Trong vùng làm việc của ứng dụng không cần giới hạn
   chiều rộng như một website thông thường.
*/

    .app-content > .container,
    .app-content > .container-fluid {
        max-width: none;
    }


/* =========================================================
   FOOTER
   ========================================================= */

.app-footer {
    height: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    background-color: #ffffff;
    border-top: 1px solid #d6dce1;
    color: #6c757d;
    font-size: 12px;
    z-index: 100;
}

.footer-version {
    white-space: nowrap;
}

.footer-author {
    text-align: right;
    white-space: nowrap;
}

    .footer-author strong {
        color: #495057;
    }

.footer-separator {
    margin-left: 8px;
    margin-right: 8px;
    color: #adb5bd;
}


/* =========================================================
   FORM FLOATING
   ========================================================= */

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {

    .app-header {
        grid-template-columns: 210px 1fr 210px;
    }

    .header-title {
        font-size: 18px;
    }

    .app-sidebar {
        width: 210px;
        min-width: 210px;
    }
}


@media (max-width: 768px) {

    body {
        overflow: auto;
    }

    .app-shell {
        min-height: 100vh;
        height: auto;
    }

    .app-header {
        height: auto;
        min-height: 90px;
        grid-template-columns: 1fr;
        padding: 8px 12px;
    }

    .header-unit {
        padding-left: 0;
        text-align: center;
    }

    .header-title {
        margin-top: 7px;
        white-space: normal;
        font-size: 17px;
    }

    .header-user {
        justify-content: center;
        padding-right: 0;
        margin-top: 5px;
    }

    .app-body {
        flex-direction: column;
        overflow: visible;
    }

    .app-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #d6dce1;
    }

    .app-content {
        overflow: visible;
        padding: 15px 12px;
    }

    .app-footer {
        height: auto;
        min-height: 45px;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        padding: 6px 10px;
    }

    .footer-author {
        text-align: center;
        white-space: normal;
    }
}
