/* Cusstom Scrollbar*/
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    border-radius: 10px;
    background: rgba(0,0,0,0.1);
}
::-webkit-scrollbar-thumb{
    border-radius: 10px;
    background: rgba(0,0,0,0.2);
}
::-webkit-scrollbar-thumb:hover{
  	background: rgba(0,0,0,0.4);
}
::-webkit-scrollbar-thumb:active{
  	background: rgba(0,0,0,.9);
}
/*//////*/

/* loggin */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    position: relative;
}
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.6); /* ความโปร่งใสของฟอร์ม */
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px); /* เพิ่มความเบลอเบาๆ */
    z-index: 1; /* ให้ฟอร์มอยู่ด้านบนสุด */
}
.login-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    color: #007bff;
    text-transform: uppercase;
}
/*//////*/

:root {
    --nav-height: 96px;
    --footer-height: 57px;
    --margin-bottom: 1.5rem;
    --margin-top: 3rem;
}

header {
    display: contents;
}

body {
    font-family: 'Kanit';
    background-color: #f2f3f4;
    width: 100%;
    min-height: calc(100vh - var(--nav-height));
    margin: 0;
    padding: 0;
}

.main-footer {
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    color: #869099;
    padding: 1rem;
}

.section-with-footer {
    min-height: calc(100vh - (var(--nav-height) + var(--footer-height)));
}

.menu-btn {
    width: 157px;
}

.menu-icons{
    width: 100px;
    height: 100px;
}

.w-fit-content {
    width: fit-content;
}

.h-fit-content {
    height: fit-content;
}

.btn-danger-no-hover, .btn-danger-no-hover:hover {
    cursor: auto !important;
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
    box-shadow: none;
    pointer-events: none;
    white-space: nowrap;
}

.btn-warning-no-hover, .btn-warning-no-hover:hover {
    cursor: auto !important;
    color: #000;
    background-color: #ffc107;
    border-color: #ffc107;
    box-shadow: none;
    pointer-events: none;
    white-space: nowrap;
}

.btn-success-no-hover, .btn-success-no-hover:hover {
    cursor: auto !important;
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
    box-shadow: none;
    pointer-events: none;
    white-space: nowrap;
}

.border-under-dot {
    border-bottom: 1px dotted #000;
}

.table-fixed {
    table-layout: auto;  /* ให้ตารางสามารถปรับขนาดตามเนื้อหาได้ */
}

.min-vh-100-with-footer {
    min-height: calc(100vh - (var(--nav-height) + var(--footer-height)));
}

.vh-100-with-footer-and-my {
    height: calc(100vh - ((var(--nav-height) + var(--footer-height) + (var(--margin-bottom) + var(--margin-top)))));
}

/* loading screen */
div.loaderscreen {
    position: fixed;
    z-index: 9009;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
}

.loader {
    width: 50px;
    aspect-ratio: 1;
    display: grid;
    border: 4px solid #0000;
    border-radius: 50%;
    border-right-color: #25b09b;
    animation: l15 1s infinite linear;
}

.loader::before,
.loader::after {    
    content: "";
    grid-area: 1/1;
    margin: 2px;
    border: inherit;
    border-radius: 50%;
    animation: l15 2s infinite;
}

.loader::after {
    margin: 8px;
    animation-duration: 3s;
}

@keyframes l15{ 
    100%{transform: rotate(1turn)}
}
/*//////*/

/* Cusstom CSS Bootstrap*/
.custom-tooltip {
    --bs-tooltip-bg: #333;
}

.invalid-tooltip {
    top: auto;
}

.offcanvas.offcanvas-start {
    width: 200px;
    left: 0;
}

.offcanvas svg {
    width: 18px;
}

.form-check-inline {
    margin-right: 0;
    padding-right: 1rem;
}

h3.card-title {
    margin-bottom: unset;
}
/*//////*/

/* Custom SweetAlert 2*/
.swal2-input[type="date"] {
    display: block !important;
}
/*//////*/

/* Cusstom Input*/
.form-select option[value=""] {
    color: red;
}

input.has-min-width, select.has-min-width {
    min-width: 300px !important;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

fieldset.form-group {
    position: relative;
}

fieldset textarea + label {
    top: 1.15rem;
}

fieldset input + label {
    top: 50%;
}

fieldset label {
    position: absolute;
    top: 50%;
    left: 1.5rem;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    font-size: 16px;
    color: #6c757d;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: calc(100% - 3rem);
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.input-group fieldset label {
    left: .8rem;
}

input.has-min-width, select.has-min-width {
    min-width: 100% !important;
}

fieldset input:focus + label,
fieldset input.is-invalid:focus + label,
fieldset textarea:focus + label,
fieldset textarea.is-invalid:focus + label {
    top: -10px;
    font-size: 15px;
    color: #007bff;
}

fieldset input:not(:placeholder-shown) + label,
fieldset textarea:not(:placeholder-shown) + label,
fieldset textarea[placeholder]:placeholder-shown + label,
fieldset select + label {
    top: -10px;
    font-size: 15px;
}

fieldset input.is-invalid:focus + label {
    color: #dc3545;
}

fieldset input.is-invalid + label,
fieldset select.is-invalid + label {
    color: #dc3545;
}
/*//////*/

/* Cusstom Nav left * Manager */
.custom-collapse-dropdown {
    --bs-dropdown-zindex: 1000;
    --bs-dropdown-min-width: 10rem;
    --bs-dropdown-padding-x: 0;
    --bs-dropdown-padding-y: 0.5rem;
    --bs-dropdown-spacer: 0.125rem;
    --bs-dropdown-font-size: 1rem;
    --bs-dropdown-color: var(--bs-body-color);
    --bs-dropdown-bg: var(--bs-body-bg);
    --bs-dropdown-border-color: var(--bs-border-color-translucent);
    --bs-dropdown-border-radius: var(--bs-border-radius);
    --bs-dropdown-border-width: var(--bs-border-width);
    --bs-dropdown-inner-border-radius: calc(var(--bs-border-radius) - var(--bs-border-width));
    --bs-dropdown-divider-bg: var(--bs-border-color-translucent);
    --bs-dropdown-divider-margin-y: 0.5rem;
    --bs-dropdown-box-shadow: var(--bs-box-shadow);
    --bs-dropdown-link-color: var(--bs-body-color);
    --bs-dropdown-link-hover-color: var(--bs-body-color);
    --bs-dropdown-link-hover-bg: var(--bs-tertiary-bg);
    --bs-dropdown-link-active-color: #fff;
    --bs-dropdown-link-active-bg: #0d6efd;
    --bs-dropdown-link-disabled-color: var(--bs-tertiary-color);
    --bs-dropdown-item-padding-x: 1rem;
    --bs-dropdown-item-padding-y: 0.25rem;
    --bs-dropdown-header-color: #6c757d;
    --bs-dropdown-header-padding-x: 1rem;
    --bs-dropdown-header-padding-y: 0.5rem;
    min-width: var(--bs-dropdown-min-width);
    padding: var(--bs-dropdown-padding-y) var(--bs-dropdown-padding-x);
    margin: 0;
    font-size: var(--bs-dropdown-font-size);
    color: var(--bs-dropdown-color);
    text-align: left;
    list-style: none;
    background-color: var(--bs-dropdown-bg);
    background-clip: padding-box;
    border: var(--bs-dropdown-border-width) solid var(--bs-dropdown-border-color);
    border-radius: var(--bs-dropdown-border-radius)
}

.custom-collapse-dropdown {
    background-color: #24303F;
}

.sidebar-manager svg {
    width: 24px;
    height: 21px;
    color: white;
}

.sidebar-manager .dropdown-menu {
    background-color: #24303F;

    a {
        color: white;
    }

    a:hover {
        color: black;
    }
}

.sidebar-manager a {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    transition: opacity 0.5s ease;
    opacity: 1;
}

.sidebar-manager span {
    display: none;
    width: 0;
}

.rp-sidebar-body {
    padding-left: 1rem !important;
    margin-right: 1rem !important;
}

.gap-2rem {
    gap: 2rem;
}

.input-group input,
.input-group fieldset input {
    border-radius: 0;
}

/* กรณีมี fieldset ครอบ input ตัวแรก */
.input-group fieldset:first-child input {
    border-radius: var(--bs-border-radius) 0px 0px var(--bs-border-radius);
}

/* ถ้าไม่มี fieldset ให้ input ตัวแรกมี border-radius */
.input-group > input:first-child {
    border-radius: var(--bs-border-radius) 0 0 var(--bs-border-radius);
}

/* input ตัวสุดท้าย */
.input-group > input:last-child,
.input-group fieldset:last-child input {
    border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
/*//////*/
@media (max-width: 440px) {
    :root {
        --footer-height: 81px;
    }
}

@media (max-width: 430px) {
    .input-group fieldset {
        max-width: calc(100% - 67px);
        min-width: 0 !important;
    }

    fieldset {
        min-width: 100% !important;
    }

    /* fieldset label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: calc(100% - 1.75rem);
    }

    input.has-min-width, select.has-min-width {
        min-width: 100% !important;
    } */
}

@media (min-width: 576px) {
    .w-sm-auto {
        width: auto !important;
    }
}

@media (max-width: 576px) {
    .login-container {
        height: 100% !important;
        max-width: 100% !important;
    }
}

@media (min-width: 768px) {
    .w-md-auto {
        width: auto !important;
    }

    .rp-sidebar-body {
        padding-left: 3rem !important;
        margin-right: 2.5rem !important;
    }
}

@media (min-width: 992px) {
    .w-lg-auto {
        width: auto !important;
    }
    
    .min-vh-100-with-footer {
        min-height: calc(100vh - var(--footer-height));
    }

    .section-with-footer {
        min-height: calc(100vh - var(--footer-height) - var(--nav-height));
    }

    /* Cusstom Nav left * Manager */
    .sidebar-manager {
        z-index: 9000;
        min-width: 80px;
        background-color: #0c1a2a;
        opacity: 1;
        transition: min-width 0.3s;
        position: fixed;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* ตั้งค่าปกติ */
    .body-p-sidebar-manager,
    .rp-sidebar-footer {
        transition: all 0.3s ease;
    }

    .rp-sidebar-body {
        padding-left: calc(3rem + 80px) !important;
        margin-right: 2.5rem !important;
    }

    .rp-sidebar-footer {
        padding-left: calc(1rem + 80px) !important;
    }
    /*//////*/
}

@media (min-width: 816px) {
    .w-816px-auto {
        width: auto !important;
    }
}

@media (min-width: 1200px) {
    .w-xl-auto {
        width: auto !important;
    }
}

@media (min-width: 1400px) {
    .w-xxl-auto {
        width: auto !important;
    }
}