﻿/*
    HHP GLOBAL - Giao diện điện thoại.
    Chỉ áp dụng cho màn hình tối đa 760px.
*/
@media screen and (max-width: 760px) {

    /* ==============================
       BỐ CỤC CHUNG
       ============================== */

    html body {
        font-size: 16px;
        line-height: 1.6;
        -webkit-text-size-adjust: 100%;
    }

        html body .hhp-header-inner,
        html body .hhp-navigation-inner,
        html body main.container {
            width: calc(100% - 24px) !important;
            min-width: 0;
        }

        html body main.container {
            margin-top: 20px;
            margin-bottom: 32px;
        }

            html body main.container > *,
            html body .cards > *,
            html body .profile-layout > *,
            html body .login-layout > * {
                min-width: 0;
            }

            html body main.container .card {
                padding: 18px;
                border-radius: 12px;
            }

                html body main.container .card .card {
                    padding: 14px;
                }

            html body main.container h1 {
                margin-bottom: 18px;
                font-size: 26px;
                line-height: 1.3;
                overflow-wrap: anywhere;
            }

            html body main.container h2 {
                margin-bottom: 16px;
                font-size: 21px;
                line-height: 1.4;
            }

            html body main.container h3 {
                font-size: 17px;
                line-height: 1.6;
            }

        html body .help,
        html body .muted,
        html body .message {
            font-size: 14px;
            line-height: 1.7;
            overflow-wrap: anywhere;
        }

        html body .message {
            margin: 14px 0;
        }

        html body footer {
            padding: 20px 16px;
            font-size: 12px;
        }

        /* ==============================
       LOGO, TÀI KHOẢN VÀ MENU
       Nền bên ngoài vẫn full màn hình.
       ============================== */

        html body .hhp-header-inner {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: center;
            gap: 12px;
            padding: 14px 0;
        }

        html body .topbar .brand {
            min-width: 0;
        }

        html body .topbar .hhp-company-logo {
            display: block;
            width: 180px;
            max-width: 100%;
            height: 52px;
            object-fit: contain;
            object-position: left center;
        }

        html body .topbar .user {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 6px;
            width: auto;
            max-width: 150px;
            color: #fff;
            font-size: 13px;
            text-align: right;
        }

            html body .topbar .user > span {
                overflow-wrap: anywhere;
            }

        html body .topbar .button.ghost {
            min-height: 44px;
            padding: 9px 14px;
            font-size: 13px;
            white-space: nowrap;
        }

        html body .hhp-navigation-inner {
            display: flex;
            flex-wrap: nowrap;
            align-items: center;
            gap: 6px;
            padding: 7px 0;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

            html body .hhp-navigation-inner a {
                display: inline-flex;
                flex: 0 0 auto;
                align-items: center;
                justify-content: center;
                min-height: 44px;
                padding: 10px 12px;
                font-size: 14px;
                white-space: nowrap;
                border-radius: 7px;
            }

                html body .hhp-navigation-inner a:focus-visible {
                    outline: 2px solid #0066B2;
                    outline-offset: -2px;
                }

        /* ==============================
       Ô NHẬP VÀ NÚT BẤM
       ============================== */

        html body main.container input[type="text"],
        html body main.container input[type="password"],
        html body main.container input[type="email"],
        html body main.container input[type="tel"],
        html body main.container input[type="search"],
        html body main.container textarea,
        html body main.container select {
            width: 100%;
            min-width: 0;
            max-width: 100%;
            min-height: 48px;
            padding: 12px;
            font: inherit;
            font-size: 16px;
            border: 1px solid #c9d6e0;
            border-radius: 8px;
            background: #fff;
            color: #183047;
        }

        html body main.container textarea {
            min-height: 110px;
            resize: vertical;
        }

        html body main.container label {
            font-size: 15px;
        }

        html body main.container .button {
            min-height: 46px;
            max-width: 100%;
            padding: 12px 16px;
            font-size: 15px;
            line-height: 1.5;
            white-space: normal;
        }

        html body main.container a.button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        html body main.container input[type="checkbox"],
        html body main.container input[type="radio"] {
            width: 22px;
            height: 22px;
            accent-color: #0066B2;
        }

        html body main.container .button:focus-visible {
            outline: 3px solid #00A1D0;
            outline-offset: 3px;
        }

        /* ==============================
       ĐĂNG NHẬP
       Đưa ô đăng nhập lên trước lời giới thiệu.
       ============================== */

        html body .login-layout {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            gap: 20px;
            min-height: 0;
        }

            html body .login-layout .login-card {
                order: 1;
            }

            html body .login-layout .intro {
                order: 2;
                padding: 0 4px;
            }

                html body .login-layout .intro h1 {
                    margin-top: 0;
                    font-size: 22px;
                }

                html body .login-layout .intro p {
                    max-width: none;
                    margin-bottom: 0;
                    font-size: 15px;
                }

                html body .login-layout .intro .stripe {
                    display: none;
                }

        html body .login-card .button {
            width: 100%;
            margin-top: 18px;
        }

        /* ==============================
       TRANG CÁ NHÂN, HỒ SƠ, MẬT KHẨU
       ============================== */

        html body .cards,
        html body .profile-layout,
        html body .hr-editor .profile-layout,
        html body .period-fields,
        html body .hr-filter,
        html body .hr-unit-fields {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            gap: 18px;
        }

        html body .welcome {
            padding: 20px;
            margin-bottom: 18px;
        }

            html body .welcome h1 {
                font-size: 25px;
            }

            html body .welcome p {
                margin-bottom: 0;
            }

        html body .cards .button,
        html body .profile-layout .button,
        html body .narrow .button {
            width: 100%;
        }

        html body .narrow {
            width: 100%;
            max-width: none;
            margin: 0;
        }

        html body dd {
            margin-left: 0;
            overflow-wrap: anywhere;
        }

        /* ==============================
       TỰ ĐÁNH GIÁ
       ============================== */

        html body .self-question,
        html body .grade-question {
            margin-top: 22px;
            padding-top: 18px;
        }

            html body .self-question h3,
            html body .grade-question h3 {
                margin-top: 0;
                margin-bottom: 6px;
            }

            html body .self-question .help,
            html body .grade-question .help {
                margin-top: 0;
                margin-bottom: 14px;
            }

        /*
        RadioButtonList hiện dùng RepeatLayout="Flow".
        Mỗi lựa chọn gồm radio và label liên kết với nhau.
    */
        html body .self-options,
        html body .grade-options {
            display: grid;
            grid-template-columns: 26px minmax(0, 1fr);
            align-items: center;
            column-gap: 8px;
            row-gap: 10px;
        }

            html body .self-options br,
            html body .grade-options br {
                display: none;
            }

            html body .self-options input[type="radio"],
            html body .grade-options input[type="radio"] {
                justify-self: center;
                align-self: center;
                margin: 0;
            }

            html body .self-options label,
            html body .grade-options label {
                display: flex;
                align-items: center;
                min-height: 52px;
                margin: 0;
                padding: 12px;
                background: #f8fafc;
                border: 1px solid #dce6ee;
                border-radius: 9px;
                font-size: 15px;
                font-weight: 400;
                line-height: 1.7;
                overflow-wrap: anywhere;
            }

            html body .self-options input:checked + label,
            html body .grade-options input:checked + label {
                background: #edf8ef;
                border-color: #39B54A;
                color: #1f612a;
                box-shadow: inset 3px 0 0 #39B54A;
            }

            html body .self-options input:focus-visible + label,
            html body .grade-options input:focus-visible + label {
                outline: 2px solid #0066B2;
                outline-offset: 2px;
            }

        html body .self-actions,
        html body .grade-actions,
        html body .matrix-actions {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            gap: 12px;
            margin-top: 24px;
        }

            html body .self-actions .button,
            html body .grade-actions .button,
            html body .matrix-actions .button {
                width: 100%;
            }

            html body .self-actions input[id$="btnDraft"],
            html body .grade-actions input[id$="btnDraft"],
            html body .matrix-actions input[id$="btnDraft"] {
                background: #edf5fb;
                color: #0066B2;
                border: 1px solid #bfd8ea;
            }

        /* ==============================
       BẢNG PHIẾU VÀ KẾT QUẢ THÀNH THẺ
       JavaScript thêm nhãn từ tiêu đề cột.
       ============================== */

        html body table.hhp-mobile-cards.hhp-labelled {
            display: block;
            width: 100%;
            min-width: 0;
            border: 0;
            background: transparent;
        }

            html body table.hhp-mobile-cards.hhp-labelled tbody {
                display: block;
                width: 100%;
            }

        html body table.hhp-mobile-cards .hhp-header-row {
            display: none;
        }

        html body table.hhp-mobile-cards .hhp-data-row {
            display: block;
            margin-bottom: 14px;
            padding: 12px;
            background: #fff;
            border: 1px solid #dce6ee;
            border-radius: 10px;
        }

            html body table.hhp-mobile-cards .hhp-data-row:last-child {
                margin-bottom: 0;
            }

            html body table.hhp-mobile-cards .hhp-data-row td {
                display: grid;
                grid-template-columns: 110px minmax(0, 1fr);
                gap: 12px;
                width: auto;
                min-width: 0;
                max-width: none;
                padding: 9px 0;
                background: transparent;
                border: 0;
                border-bottom: 1px solid #eef2f6;
                font-size: 15px;
                line-height: 1.6;
                text-align: left;
                white-space: normal;
                overflow-wrap: anywhere;
            }

                html body table.hhp-mobile-cards .hhp-data-row td::before {
                    content: attr(data-label);
                    color: #64748b;
                    font-size: 13px;
                    font-weight: 500;
                }

                html body table.hhp-mobile-cards .hhp-data-row td:last-child {
                    border-bottom: 0;
                }

        /* Nút mở phiếu nằm cuối thẻ */
        html body table.kpi-mine-table.hhp-labelled .hhp-data-row td:last-child {
            display: block;
            padding-top: 14px;
        }

            html body table.kpi-mine-table.hhp-labelled .hhp-data-row td:last-child::before {
                display: none;
            }

        html body table.kpi-mine-table.hhp-labelled a.button {
            width: 100%;
            min-height: 46px;
            font-size: 15px;
        }

        /* ==============================
       CHI TIẾT KẾT QUẢ
       ============================== */

        html body .leader-result .kpi-result-summary {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            gap: 12px;
            margin-bottom: 18px;
        }

        html body .leader-result .kpi-result-summary-item {
            min-width: 0;
            padding: 16px;
        }

        html body .leader-result .kpi-result-score {
            font-size: 28px;
        }

        html body .leader-result .kpi-result-reviewers {
            font-size: 14px;
            overflow-wrap: anywhere;
        }

        html body .leader-result .kpi-result-table-wrap {
            border: 0;
            border-radius: 0;
        }

        /*
        Mỗi tiêu chí là một thẻ.
        Các điểm chia thành hai cột.
    */
        html body table.kpi-result-table.hhp-labelled .hhp-data-row {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px 14px;
            padding: 14px;
        }

            html body table.kpi-result-table.hhp-labelled .hhp-data-row td {
                display: block;
                padding: 4px 0;
                border: 0;
                font-size: 16px;
            }

                html body table.kpi-result-table.hhp-labelled .hhp-data-row td::before {
                    display: block;
                    margin-bottom: 3px;
                    font-size: 12px;
                }

                /* STT đã có thứ tự thẻ, không cần chiếm một ô */
                html body table.kpi-result-table.hhp-labelled .hhp-data-row td:first-child {
                    display: none;
                }

                html body table.kpi-result-table.hhp-labelled .hhp-data-row td:nth-child(2) {
                    grid-column: 1 / -1;
                    min-width: 0;
                    padding-bottom: 10px;
                    border-bottom: 1px solid #e6edf3;
                    font-size: 16px;
                    font-weight: 600;
                    color: #0066B2;
                }

        /* ==============================
       BẢNG QUẢN TRỊ VÀ BẢNG CHẤM
       Cuộn trong vùng bảng.
       ============================== */

        html body .table-scroll,
        html body .matrix-scroll {
            min-width: 0;
            max-width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

            html body .table-scroll > table:not(.hhp-labelled) {
                min-width: 680px;
            }

            html body .table-scroll .button {
                min-height: 44px;
            }

        html body .matrix-scroll {
            max-height: 65vh;
            border-radius: 8px;
        }

        html body .kpi-matrix {
            font-size: 14px;
        }

            html body .kpi-matrix .matrix-score {
                width: 68px;
                min-width: 68px;
                min-height: 46px;
                padding: 8px;
                font-size: 16px;
            }

        html body .matrix-guide summary,
        html body .hr-unit summary {
            min-height: 44px;
            padding: 10px 0;
            font-size: 15px;
            cursor: pointer;
        }

        html body .matrix-guide ol,
        html body .matrix-guide ul {
            padding-left: 22px;
        }

        html body .matrix-guide li {
            line-height: 1.8;
        }

        html body .hr-filter .button,
        html body .hr-unit-fields .button,
        html body .period-actions .button {
            width: 100%;
            height: auto;
            min-height: 46px;
        }
}

@media screen and (max-width: 760px) {

    html body .home-tasks {
        margin-bottom: 22px;
    }

    html body .home-notice {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
    }

        html body .home-notice h3 {
            font-size: 17px;
        }

        html body .home-notice p {
            font-size: 15px;
        }

        html body .home-notice .home-notice-help {
            font-size: 13px;
        }

        html body .home-notice .home-notice-button {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            min-height: 48px;
            margin: 0;
            white-space: normal;
            text-align: center;
        }
}
