.btn-primary {
    background: linear-gradient(145deg, #ff3a00, #f52200);
    border: 1px solid #ff3b00;
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.25),
                -3px -3px 8px rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
    padding: 6px 18px;
}

/* เอฟเฟกต์ hover — ดูนูนขึ้น */
.btn-primary:hover {
    background: linear-gradient(145deg, #ff3a00, #f52200);
    border-color: #df3206;
    transform: translateY(-2px);
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.25),
                -5px -5px 10px rgba(255, 255, 255, 0.4);
}

/* เอฟเฟกต์ตอนคลิก — ดูจมลง */
.btn-primary:active {
    background: linear-gradient(145deg, #ff3a00, #f52200);
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.3),
                inset -3px -3px 6px rgba(255, 255, 255, 0.3);
    transform: translateY(1px);
}

/* focus outline */
.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.4);
}

/* ปุ่มที่ไม่ได้ active (เช่น .btn-outline-primary) */
.btn-outline-primary {
    color: #357abd;
    border: 1px solid #4a90e2;
    background: #e8f0fa;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    background: linear-gradient(145deg, #606368, #3a3c3f);
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1),
                inset -2px -2px 5px rgba(255, 255, 255, 0.5);
}

/* 🟧 หัวตารางโทนส้มทอง (บังคับให้ใช้แน่นอน) */
table.table thead.thead-orange {
    background: linear-gradient(145deg, #ff9800, #f57c00);
    color: #fff !important;
    border-bottom: 2px solid #ff5e00 !important;
    box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.2),
                0 3px 6px rgba(230, 126, 34, 0.3);
}

/* ✅ ปิดการสืบทอด background ของ bootstrap */
table.table thead.thead-orange th {
    background: transparent !important;
    font-weight: 600;
    text-align: center;
    padding: 12px;
    border-color: #ffffff2e  !important;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

/* 🧾 ปรับตารางให้เข้าชุดกัน */
.table {
    background: #ff3a0000;
    border-radius: 0px;
    /* border: 1px solid #f1c27b; */
    overflow: hidden;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.05),
                -2px -2px 6px rgba(255, 255, 255, 0.6);
}

/* 🎨 แถวสลับสี */
.table tbody tr:nth-child(odd) {
    background: #fff;
}
.table tbody tr:nth-child(even) {
    background: #fffaf3;
}

/* ✨ Hover */
.table tbody tr:hover {
    background: #fff3e0;
    transition: 0.25s ease;
}

/* ขอบ */
.table-bordered th,
.table-bordered td {
    border: 1px solid #e0e0de47  !important;
}


/* ✅ ขนาดปกติ (เดสก์ท็อป) */
body, table, th, td, button, a {
    font-size: 16px;
}

/* 📱 ลดขนาดอัตโนมัติเมื่ออยู่ในมือถือ */
@media (max-width: 768px) {
    body, table, th, td, button{
        font-size: 13px !important; /* ลดขนาดลง */
    }

    /* หัวตารางเล็กลง */
    .thead-orange th {
        font-size: 12px !important;
        padding: 8px !important;
    }

    /* ปุ่มเล็กลง */
    .btn {
        font-size: 12px !important;
        padding: 6px 8px !important;
    }

    /* ปรับ spacing ของตาราง */
    .table td, .table th {
        padding: 6px 4px !important;
    }
}
/* ปรับระยะห่างปุ่มภายในเซลล์ตาราง */
.table td .btn {
    margin: 2px 0 !important; /* ✅ ระยะห่างบน–ล่าง */
}


body {
    font-family: 'Kanit', sans-serif;
    /* background: #e0e5ec; */
    background-image: url(../img/bg-1.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* 🔸 ซ่อนบนจอใหญ่ */
.neumorphic-navbar {
    display: none;
}

/* 🔸 แสดงเฉพาะบนมือถือ */
@media (max-width: 768px) {
    .neumorphic-navbar {
        display: flex;
        position: fixed;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        background: #e0e5ec;
        border-radius: 20px;
        box-shadow: 8px 8px 16px #ff3a00, -8px -8px 16px #fc840c;
        justify-content: space-around;
        align-items: center;
        width: 95%;
        padding: 8px 5px;
    }

    body {
        padding-bottom: 90px; /* กันเมนูทับเนื้อหา */
    }

    /* ปุ่มแต่ละอัน */
    .menu-item {
        flex: 1;
        text-decoration: none;
        color: #333;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        background: #e0e5ec;
        border-radius: 14px;
        padding: 8px 0px;
        margin: 0 4px;
        box-shadow: 5px 5px 10px #a3b1c6, -5px -5px 10px #ffffff;
        transition: all 0.25s ease;
        position: relative;
        cursor: pointer;
    }

    /* ไอคอน */
    .menu-item i {
        font-size: 20px;
        margin-bottom: 4px;
        color: #343a40;
    }

    /* Hover effect */
    .menu-item:hover {
        box-shadow: inset 4px 4px 8px #a3b1c6, inset -4px -4px 8px #ffffff;
        transform: translateY(-2px);
        color: #111;
    }

    /* ปุ่ม active (ปุ่มหน้าปัจจุบัน) */
    .menu-item.active {
        background: linear-gradient(145deg, #d6dbe4, #f3f6fb);
        box-shadow: inset 3px 3px 7px #a3b1c6, inset -3px -3px 7px #ffffff;
        color: #000;
        font-weight: 600;
    }

    /* ปุ่มเข้าสู่ระบบ */
    .login-btn {
        background: linear-gradient(145deg, #ff5e00, #f2c94c);
        color: #333;
        font-weight: 600;
        border-radius: 14px;
        padding: 8px 10px;
        box-shadow: 4px 4px 10px #b0b8c0, -4px -4px 10px #ffffff;
    }

    .login-btn:hover {
        background: linear-gradient(145deg, #ff5e00, #f2c94c);
        box-shadow: inset 3px 3px 6px #b0b8c0, inset -3px -3px 6px #ffffff;
        transform: translateY(-2px);
    }

/* 🎨 Neumorphic Dropdown - ปรับระยะห่างฝั่งขวา */
.dropdown-menu-custom {
    position: absolute;
    bottom: 70px;
    right: -20px; /* ✅ ยึดขอบขวาของปุ่ม */
    transform: translateX(-10px) translateY(10px); /* ✅ เลื่อนเข้าซ้ายเล็กน้อย */
    background: linear-gradient(145deg, #e6ebf0, #d4d8dd);
    border-radius: 18px;
    box-shadow:
        5px 5px 12px rgba(163, 177, 198, 0.6),
        -5px -5px 12px rgba(255, 255, 255, 0.8);
    padding: 10px 0;
    min-width: 200px;
    text-align: left;
    display: none;
    opacity: 0;
    transition: all 0.25s ease;
    z-index: 9999;
}

/* แสดงเมื่อเปิด */
.dropdown-menu-custom.show {
    display: block !important;
    opacity: 1 !important;
    transform: translateX(-10px) translateY(0);
}

/* ลิงก์ภายใน */
.dropdown-menu-custom a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    font-size: 14px;
    color: #444;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-menu-custom a i {
    font-size: 17px;
    color: #555;
    width: 22px;
    text-align: center;
}

/* Hover */
.dropdown-menu-custom a:hover {
    background: #dfe3eb;
    border-radius: 10px;
    color: #000;
    transform: translateY(-1px);
}

.dropdown-menu-custom a + a {
    border-top: 1px solid #d4d8dd;
}

}


    .login-wrapper {
        max-width: 400px;
        width: 90%;
        margin: 60px auto;
        /* background: linear-gradient(135deg, #ff9800, #ff6d00); */
        border-radius: 25px;
        box-shadow: 9px 9px 16px #fb4d04, -9px -9px 16px #fe700b;
        padding: 40px 30px 50px;
        text-align: center;
        transition: all 0.3s ease;
    }

    .login-icon {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        background: #e0e5ec;
        margin: 0 auto 25px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: inset 6px 6px 10px #c3c8d3,
                    inset -6px -6px 10px #ffffff;
    }

    .login-icon i {
        font-size: 30px;
        color: #6b6b83;
    }

    h2 {
        font-weight: 600;
        color: #3a3a50;
        font-size: 1.8rem;
    }

    p.subtext {
        color: #777;
        margin-bottom: 30px;
        font-size: 0.9rem;
    }

    .form-control {
        border: none;
        outline: none;
        background: #e0e5ec;
        border-radius: 12px;
        box-shadow: inset 3px 3px 6px #c3c8d3,
                    inset -3px -3px 6px #ffffff;
        padding: 13px 15px;
        font-size: 15px;
        color: #333;
        width: 100%;
        transition: box-shadow 0.2s ease;
    }

    .form-control:focus {
        box-shadow: inset 2px 2px 5px #babecc,
                    inset -2px -2px 5px #ffffff;
    }

    .btn-login {
        width: 100%;
        border: none;
        background: #e0e5ec;
        border-radius: 12px;
        padding: 13px;
        font-weight: 600;
        color: #3a3a50;
        box-shadow: 5px 5px 10px #ff3a00, -5px -5px 10px #fd8c0c;
        transition: all 0.2s ease;
        font-size: 1rem;
        margin-top: 5px;
    }

    .btn-login:hover {
        box-shadow: inset 3px 3px 6px #a3b1c6,
                    inset -3px -3px 6px #ffffff;
    }

    .remember-me {
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.9rem;
        color: #555;
        margin-bottom: 25px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .remember-me input[type="checkbox"] {
        accent-color: #6b6b83;
        margin-right: 5px;
    }

    .social-btns {
        display: flex;
        justify-content: center;
        gap: 15px;
        margin: 25px 0;
        flex-wrap: wrap;
    }

    .social-btns a {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        background: #e0e5ec;
        box-shadow: 5px 5px 10px #f52200, -5px -5px 10px #fd870c;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #555;
        font-size: 20px;
        transition: 0.2s;
    }

    .social-btns a:hover {
        box-shadow: inset 3px 3px 6px #a3b1c6,
                    inset -3px -3px 6px #ffffff;
    }

    .signup-link {
        font-size: 0.9rem;
        color: #555;
    }

    .signup-link a {
        color: #3a3a50;
        font-weight: 600;
        text-decoration: none;
    }

    .signup-link a:hover {
        text-decoration: underline;
    }

    @media (max-width: 576px) {
        .login-wrapper {
            padding: 30px 20px;
        }

        h2 {
            font-size: 1.5rem;
        }

        .login-icon {
            width: 70px;
            height: 70px;
        }

        .btn-login {
            font-size: 0.95rem;
        }
    }
    .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    }

    .icon-left {
        position: absolute;
        left: 15px;
        color: #6b6b83;
        font-size: 16px;
    }

    .icon-right {
        position: absolute;
        right: 15px;
        color: #6b6b83;
        font-size: 16px;
    }

    .input-wrapper .form-control {
        padding-left: 40px;  /* เผื่อช่องให้ไอคอนซ้าย */
        padding-right: 40px; /* เผื่อช่องให้ไอคอนขวา */
    }

    .border-bottom {
        border-bottom: var(--bs-border-width) var(--bs-border-style) #ff7500 !important;
    }

    .navbar-expand-lg {
        background: linear-gradient(135deg, #ff9800, #ff6d00);
    }

/* กล่องฟอร์มสมัคร */
    .register-wrapper {
        max-width: 380px; /* ลดความกว้าง */
        margin: 40px auto 60px; /* ลดระยะบนเหลือ 40px */
        /* background: #e0e5ec; */
        border-radius: 25px;
        box-shadow: 9px 9px 16px #fb4d04, -9px -9px 16px #fe700b;
        padding: 30px 20px 40px; /* ลด padding ซ้ายขวา */
        text-align: center;
        transition: all 0.3s ease;
    }

    /* ไอคอนกลมบนหัว */
    .register-icon {
        width: 75px;
        height: 75px;
        border-radius: 50%;
        background: #e0e5ec;
        margin: 0 auto 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: inset 6px 6px 10px #c3c8d3,
                    inset -6px -6px 10px #ffffff;
    }

    .register-icon i {
        font-size: 28px;
        color: #6b6b83;
    }

    h2 {
        font-weight: 600;
        color: #3a3a50;
        font-size: 1.6rem;
        margin-bottom: 20px;
    }

    p.subtext {
        color: #777;
        margin-bottom: 25px;
        font-size: 0.9rem;
    }

    /* input field */
    .form-control {
        border: none;
        outline: none;
        background: #e0e5ec;
        border-radius: 12px;
        box-shadow: inset 3px 3px 6px #c3c8d3,
                    inset -3px -3px 6px #ffffff;
        padding: 12px 14px;
        font-size: 15px;
        color: #333;
        width: 100%;
        transition: box-shadow 0.2s ease;
    }

    .form-control:focus {
        box-shadow: inset 2px 2px 5px #babecc,
                    inset -2px -2px 5px #ffffff;
    }

    /* ปุ่มสมัคร */
    .btn-register {
        width: 100%;
        border: none;
        background: #e0e5ec;
        border-radius: 12px;
        padding: 12px;
        font-weight: 600;
        color: #3a3a50;
        box-shadow: 5px 5px 10px #a3b1c6,
                    -5px -5px 10px #ffffff;
        transition: all 0.2s ease;
        font-size: 1rem;
        margin-top: 5px;
    }

    .btn-register:hover {
        box-shadow: inset 3px 3px 6px #a3b1c6,
                    inset -3px -3px 6px #ffffff;
    }

    /* ลิงก์เข้าสู่ระบบ */
    .link-login {
        font-size: 0.9rem;
        color: #555;
        text-decoration: none;
        transition: 0.2s;
    }

    .link-login:hover {
        color: #3a3a50;
        text-decoration: underline;
    }

    /* ปรับให้พอดีบนมือถือ */
    @media (max-width: 576px) {
        .register-wrapper {
            max-width: 92%;
            margin: 25px auto 70px; /* ลดช่องว่างบน-ล่างลงอีก */
            padding: 25px 15px 35px; /* เว้นขอบซ้ายขวาน้อยลง */
        }

        h2 {
            font-size: 1.4rem;
        }

        .register-icon {
            width: 65px;
            height: 65px;
        }

        .btn-register {
            font-size: 0.95rem;
        }
    }
/* end */


table thead.thead-soft th {
    font-size: clamp(0.8rem, 1vw + 0.5rem, 1rem);
    font-weight: 600;
    background: #000000;
    color: #ffffff !important;
    white-space: nowrap;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #fb8c00
;
}
/* end */

    @media (max-width: 768px) {
        .btn {
            font-size: 10px !important;
            padding: 6px 10px !important;
        }
    }

    table.table thead.thead-orange th {
        font-size: clamp(0.75rem, 0.55rem + 0.6vw, 0.95rem); /* มือถือเล็กก็ไม่เล็กเกิน, จอใหญ่ก็ไม่โตเว่อร์ */
        font-weight: 600;
        white-space: nowrap;         /* กันคำตัดบรรทัดในหัวตาราง */
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
    }

    .form-control-m {
        border: none;
        outline: none;
        background: #ffffff;
        border-radius: 4px;
        padding: 8px 14px;
        font-size: 15px;
        color: #333;
        width: 100%;
    }

    .text-primary {
    --bs-text-opacity: 1;
    color: #343a40 !important;
}

/* มือถือ: ให้แต่ละช่องในฟิลเตอร์กินพื้นที่ 50% = 2 ช่องต่อแถว */
@media (max-width: 576px) {
  form.row.g-3.mb-4 .col-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}


/* ปรับมิติให้ปุ่ม .btn-success */
.btn-success {
    background: linear-gradient(135deg, #28a745, #218838);
    border-color: #1e7e34;
    color: #fff;
    font-weight: 600;

    border-radius: 8px;           /* ทรง pill นุ่ม ๆ */
    padding: 0.45rem 1.2rem;

    box-shadow:
        0 3px 6px rgba(33, 136, 56, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    transition:
        transform 0.12s ease-out,
        box-shadow 0.12s ease-out,
        background 0.12s ease-out;
}

/* hover: ยกนิด ๆ + สีสดขึ้น */
.btn-success:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow:
        0 6px 12px rgba(39, 174, 96, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

/* focus: ขอบเรืองแสงเล็กน้อย */
.btn-success:focus,
.btn-success:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 0.18rem rgba(40, 167, 69, 0.4),
        0 3px 6px rgba(33, 136, 56, 0.35);
}

/* active: กดจมลงเล็กน้อย */
.btn-success:active,
.btn-success.active {
    transform: translateY(1px);
    background: linear-gradient(135deg, #218838, #1e7e34);
    box-shadow:
        0 2px 4px rgba(33, 136, 56, 0.3) inset;
}

/* ทั่วไป: ให้ปุ่มกว้างตามเนื้อหา */
.table td .btn1 {
    margin: 2px 0 !important;
    width: 50%;
}

/* มือถือ: ให้ปุ่มเต็มความกว้าง cell เพื่อกดง่าย */
@media (max-width: 576px) {
    .table td .btn1 {
        display: block;
        width: 100%;
    }
}

.card-body {
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
}

/* ทั่วไป: ให้ปุ่ม select-pick-btn กว้าง 50% */
.table td .btn.select-pick-btn {
    margin: 2px 0 !important;
    width: 50%;
}

/* มือถือ: ให้ปุ่ม select-pick-btn เต็มความกว้าง cell */
@media (max-width: 576px) {
    .table td .btn.select-pick-btn {
        display: block;
        width: 100%;
    }
}

/* ปรับข้อความใน thead.table-light ให้เหมาะกับทุกหน้าจอ */
table thead.table-light th {
    font-size: clamp(0.75rem, 0.55rem + 0.6vw, 0.95rem); /* มือถือไม่เล็กเกิน / จอใหญ่ไม่ใหญ่เว่อร์ */
    font-weight: 600;
    white-space: nowrap;       /* กันหัวคอลัมน์ขึ้นบรรทัดใหม่บนจอแคบ */
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.nav-item .nav-link {
    color: #000 !important;
}

@media (min-width: 992px) {
    .navbar-expand-lg .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
        background: linear-gradient(135deg, #f5f7fa, #dfe3e8);
        border-radius: 0.75rem;
    	padding: 0.35rem 0.9rem;
    	box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
        padding: 0.35rem 0.9rem;
        margin: 0.25rem 0;
    }

    /* ถ้าอยากให้ระยะระหว่างเมนูดูพอดีด้วย */
    .navbar-expand-lg .navbar-nav .nav-link {
        padding: 0.50rem 0.9rem;
    }
}

.nav-pills .nav-link.active, .nav-pills .show>.nav-link {
    color: var(--bs-nav-pills-link-active-color);
    background-color: #dee2e6;
}


/* ตัดเส้นแนวตั้งเฉพาะตารางที่ใช้ thead-orange */
.table.table-bordered thead.thead-orange th,
.table.table-bordered thead.thead-orange ~ tbody td {
    border-left: none !important;
    border-right: none !important;
}

/* ถ้าไม่อยากให้มีกรอบซ้าย-ขวาของทั้งตารางเลยด้วย */
.table.table-bordered thead.thead-orange {
    border-left: none !important;
    border-right: none !important;
}

/* ตัดเส้นแนวตั้งของตารางที่หัวเป็น table-light */
.table.table-bordered thead.table-light th,
.table.table-bordered thead.table-light ~ tbody td {
    border-left: none !important;
    border-right: none !important;
}

/* ถ้าไม่อยากให้มีกรอบซ้าย-ขวาของทั้งตารางด้วย */
.table.table-bordered thead.table-light {
    border-left: none !important;
    border-right: none !important;
}

/* มือถือ: ทำปุ่มให้ใหญ่และสูงขึ้นจริง ๆ */
@media (max-width: 576px) {
    .mt-3.text-center button.btn.btn-success {
        width: 100%;

        font-size: 1.05rem;

        /* แยกเขียน top/bottom เพื่อทับของเดิมชัด ๆ */
        padding-top: 1.2rem !important;
        padding-bottom: 1.2rem !important;
        padding-left: 0.75rem;
        padding-right: 0.75rem;

        border-radius: 12px;
    }
}

.text-warning1 {
    background: linear-gradient(45deg, #833401, #f57100, #ff3a00, #bd6000);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}


/* ให้ dropup มีขนาดเท่าปุ่มอื่นใน bottom navbar */
.neumorphic-navbar {
    display: flex;
}

.neumorphic-navbar .menu-item {
    flex: 1;
}

/* ให้กล่อง dropup กินพื้นที่เท่าปุ่ม 1 ช่อง */
.neumorphic-navbar .dropup {
    flex: 1;
    display: flex;
}

/* ให้ปุ่มด้านในกว้างเต็มช่องเหมือนปุ่มอื่น */
.neumorphic-navbar .dropup > .menu-item {
    width: 100%;
    justify-content: center;
}

/* ซ่อนลูกศรเล็ก ๆ ใต้คำว่า "อันดับ" */
.neumorphic-navbar .dropdown-toggle::after {
    display: none;
}

.bg-light {
    --bs-bg-opacity: 1;
    background-color: #FFE6B3 !important;
    border: 1.5px solid #F5C26B;
    border-radius: 10px;
    color: #333333;
    background: #FFE6B3;
    color: #3b2a12;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #F5C26B;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .06);
    font-size: 13px;
}

.card-header:first-child {
    background: beige;
}

/* ===== Desktop / ทั่วไป ===== */
.top-nav-wrapper {
    gap: 0.75rem;
    flex-wrap: nowrap;   /* ให้ทุกอย่างอยู่แถวเดียวบนเดสก์ท็อป */
}

.top-nav-switch {
    flex: 0 0 auto;      /* กว้างตามปุ่ม ไม่ดันเมนูอื่นลงบรรทัดใหม่ */
}

.top-nav-main .nav-link {
    font-size: 14px;
    padding: .35rem .9rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

.top-nav-main .nav-link i {
    font-size: 15px;
}

/* active ให้ดูเป็น pill */
.top-nav-main .nav-link.active {
    color: #000 !important;
}

.top-nav-main .nav-link.active i {
    color: #ffc107; /* ไอคอนทองนิด ๆ */
}

/* กลุ่มข้อมูลผู้ใช้ */
.top-nav-user {
    font-size: 13px;
    gap: 1rem;
}

.top-nav-user .nav-link {
    padding-inline: .25rem;
}

/* ===== Mobile (<= 991.98px) ===== */
@media (max-width: 991.98px) {

  .top-nav-wrapper {
      flex-direction: column;
      align-items: stretch;
      gap: 1rem;
  }

  /* ปุ่ม ทายหวย / ทายบอล ใน hamburger menu */
  #mainNavbar .top-nav-switch {
      flex-direction: row;
      justify-content: flex-start;
      width: 100%;
      padding: 0 0.75rem;   /* ระยะห่างจากขอบซ้าย-ขวา */
      gap: .75rem;          /* ระยะห่างระหว่างสองปุ่ม */
  }

  #mainNavbar .top-nav-switch .nav-item {
      flex: 1;              /* แบ่ง 50/50 */
  }

  #mainNavbar .top-nav-switch .nav-item .btn {
      width: 100%;
      text-align: center;
  }

  .top-nav-main {
      flex-wrap: wrap;
      gap: .25rem;
  }

  .top-nav-main .nav-item {
      flex: 1 1 45%;
  }

  .top-nav-user {
      flex-wrap: wrap;
      justify-content: flex-start;
  }

  /* กล่องเมนูตอนกด Hamburger */
  header .navbar-collapse {
      background: rgba(255, 255, 255, 0.15);
      border-radius: 18px;
      padding: .75rem .9rem 1rem;
      margin-top: .5rem;
  }

  /* ให้ทุก ul ใน collapse กินความกว้างเต็ม */
  #mainNavbar .navbar-nav {
      width: 100%;
      margin-bottom: .75rem;
  }

  /* กลุ่มเมนูหลัก (หน้าหลัก / อันดับ / เช็คอิน / แลกรางวัล / Admin) */
  #mainNavbar .navbar-nav.me-auto {
      flex-direction: column;
      align-items: stretch;
      gap: .35rem;
  }

  #mainNavbar .navbar-nav.me-auto .nav-item {
      width: 100%;
  }

  #mainNavbar .navbar-nav.me-auto .nav-link {
      display: flex;
      align-items: center;
      gap: .55rem;
      background: rgba(255, 255, 255, 0.93);
      border-radius: 999px;
      padding: .45rem .95rem;
      color: #222;
      box-shadow: 0 2px 5px rgba(0,0,0,.08);
  }

  #mainNavbar .navbar-nav.me-auto .nav-link i {
      width: 22px;
      text-align: center;
  }

  #mainNavbar .navbar-nav.me-auto .nav-link.active {
      background: #ffffff;
      box-shadow: 0 3px 8px rgba(0,0,0,.18);
  }

  /* กลุ่มข้อมูลผู้ใช้ด้านล่าง */
  #mainNavbar .navbar-nav.align-items-center {
      flex-direction: column;
      align-items: flex-start;
      gap: .2rem;
      border-top: 1px solid rgba(255,255,255,.35);
      padding-top: .6rem;
      margin-top: .25rem;
  }

  #mainNavbar .navbar-nav.align-items-center .nav-item {
      width: 100%;
  }

  #mainNavbar .navbar-nav.align-items-center .nav-link {
      padding: .3rem 0;
  }

  #mainNavbar .navbar-nav.align-items-center a.text-dark {
      padding: .3rem 0;
  }
}
/* ===== END ===== */





