/*!
 * Common CSS
 * Copyright 2015 - 2017, ToNict, shinobi.wk@hotmail.com
 * Author : ToNict
 */

@charset "utf-8";

@import "../components/animate.css/animate.min.css";
@import "../components/bootstrap/dist/css/bootstrap.min.css";
@import "../components/@fortawesome/fontawesome-free/css/all.min.css";
@import "../vendor/fonts/flag-icons.css";
@import "../vendor/libs/swiper/swiper.css";
@import "../vendor/libs/select2/select2.css";
@import "../components/noty/lib/noty.css";
@import "../components/noty/lib/themes/metroui.css";

@import "../plugins/jqgrid/css/ui.jqgrid.css";
@import "../plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css";
@import "../plugins/bootstrap-iconpicker/css/bootstrap-iconpicker.min.css";
@import "../css/phpgrid.css";

/* General
   ========================================================================== */
html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #FFFFFF;/* #e9eaed;*/
}

.container-body {
    padding-top: 3.714rem;
    padding-right: 10px;
    padding-left: 10px;
}

.container-body > .tab-content {
    padding-bottom: 15px;
}

.container-body > .tab-content > .tab-pane > .row {
    margin-left: -10px;
    margin-right: -10px;
}

.container-body > .tab-content > .tab-pane > .row > [class*="col-"] {
    padding-right: 10px;
    padding-left: 10px;
}

.container-body > .tab-content > .tab-pane > .alert{
    margin-bottom: 11px;
}

.show-404{
    width: 100%;
    text-align: center;
    padding-top: 20px;
}

button{
    cursor: pointer;
}
button:disabled{
    cursor: not-allowed;
}

@font-face {
  font-family: 'NotoSansThaiLooped';
  src: url('../fonts/Noto_Sans_Thai_Looped/NotoSansThaiLooped-VariableFont_wdth,wght.ttf') format('truetype-variations'),
       url('../fonts/Noto_Sans_Thai_Looped/NotoSansThaiLooped-VariableFont_wdth,wght.ttf') format('truetype'),
       url('/fonts/Noto_Sans_Thai_Looped/NotoSansThaiLooped-VariableFont_wdth,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NotoSansThaiLooped';
  src: url('../fonts/Noto_Sans_Thai_Looped/static/NotoSansThaiLooped-Regular.ttf') format('truetype'),
       url('/fonts/Noto_Sans_Thai_Looped/static/NotoSansThaiLooped-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NotoSansThaiLooped';
  src: url('../fonts/Noto_Sans_Thai_Looped/static/NotoSansThaiLooped-Medium.ttf') format('truetype'),
       url('/fonts/Noto_Sans_Thai_Looped/static/NotoSansThaiLooped-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NotoSansThaiLooped';
  src: url('../fonts/Noto_Sans_Thai_Looped/static/NotoSansThaiLooped-SemiBold.ttf') format('truetype'),
       url('/fonts/Noto_Sans_Thai_Looped/static/NotoSansThaiLooped-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NotoSansThaiLooped';
  src: url('../fonts/Noto_Sans_Thai_Looped/static/NotoSansThaiLooped-Bold.ttf') format('truetype'),
       url('/fonts/Noto_Sans_Thai_Looped/static/NotoSansThaiLooped-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@media (max-width: 1199px) {
    .container-body {
        padding-right: 5px;
        padding-left: 5px;
    }

    .container-body > .tab-content > .tab-pane > .row {
        margin-left: -5px;
        margin-right: -5px;
    }

    .container-body > .tab-content > .tab-pane > .row > [class*="col-"] {
        padding-right: 5px;
        padding-left: 5px;
    }
}

.container-body > .tab-content {
    margin-top: 11px;
    padding-bottom: 0.8rem;
}

.fieldset-custom {
    border: 1px solid #cecfd5;
    border-radius: 6px;
    padding: 15px 15px;
    margin-bottom: 1rem;
}

.fieldset-custom > legend{
    width: auto;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: .2rem;

}

/* bootstrap 4
   ========================================================================== */
.navbar {
    background-color: #34495e;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    -webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    -moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    -ms-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.navbar-nav > .nav-item .nav-link:focus {
    outline: 0 !important;
}

.navbar-nav > .nav-item-more {
    display: none;
}

.nav-link > i,
.navbar-nav .dropdown-item > i,
.dropdown-menu .dropdown-item > i {
    margin-right: 5px;
}
.sub-dropdown-menu {
    position: relative;
}

.navbar-nav .dropdown-item {
    position: relative;
}

.bg-midnightblue{
    background-color: #34495e !important;
}

/* dropdown submenu */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu a::after {
    transform: rotate(-90deg);
    position: absolute;
    right: 6px;
    top: .8em;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-left: 2.66px;
    margin-right: 2.66px;
}

.dropdown-submenu .dropdown-menu.dropdown-submenu-left {
    right: 0;
    left: auto;
}

.dropdown-submenu i {
    width: 18px;
    margin-right: 0px;
}

.invalid-feedback {
    font-size: 0.9rem;
}

@media (max-width: 991.98px) {
    .navbar .navbar-collapse {
        max-height:  calc(100vh - 105px);
        overflow-y: auto;
        overflow-x: visible;
    }

    .navbar-collapse .dropdown-menu{
        background-color:transparent;
        border: none;
        margin: 0;
        padding: 0;
        /*border-radius: 0px;*/
    }

    .navbar-collapse .dropdown-item {
        padding: .5rem 1.5rem;
        padding-left: 33px;
        color: rgba(255,255,255, .6);
    }

    .navbar-collapse .dropdown-item:focus,
    .navbar-collapse .dropdown-item:hover {
        color: rgba(255,255,255, .9);
        background-color:rgba(0, 0, 0, 0.1);
    }

    .nav-link > i {
        width: 22px;
        margin-right: 0px;
    }

    .navbar-collapse .dropdown-submenu > .dropdown-menu{
        margin: 0;
    }

    .navbar-collapse .dropdown-submenu > .dropdown-menu .dropdown-item{
        padding-left: 45px
    }

    .navbar-collapse .dropdown-submenu .sub-dropdown-menu > .dropdown-menu .dropdown-item {
        padding-left: 45px
    }

    .dropdown-submenu a::after{
        transform: rotate(-0deg);
        top: 1.1rem;
    }
}

/* Tabs Container
   ========================================================================== */
.tabs-container .nav-tabs {
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
}

.tabs-container .nav-item {
    -webkit-flex-shrink: 0;
    -ms-flex: 0 0 auto;
    flex-shrink: 0;
    position: relative;
    padding: 0.35rem 0.5rem;
}

.tabs-container .nav-link-description {
    display: inline-block;
    vertical-align: middle;
}

@media (max-width: 767px) {
    .tabs-container .nav-link-description {
        max-width: 215px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.tabs-container .nav-link-description > [class*="fa-"] {
    margin-right: 5px;
}

.tabs-container .nav-item .close {
    position: absolute;
    right: 0px;
    top: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #BDBDBD;
    margin-right: 6px;
}

.tabs-container .nav-item .close:hover {
    color: #757575;
}

.tabs-container .nav-item:not(:first-child):not(.no-close) {
    padding-right: 2rem;
}

/* Swiper Tabs
   ========================================================================== */
.swiper-tabs {
    /* ::after below is absolutely positioned with top/bottom/left/right: 0,
       which stretches to fill the nearest ANCESTOR that has a position set.
       Nothing here previously established that ancestor, so the pseudo-element
       (and its border-bottom) escaped all the way up the DOM and rendered as
       a long line far below the tab bar, behind unrelated page content. */
    position: relative;
}
.swiper-tabs > .nav-tabs {
    margin-right: 1.6rem;
}
.swiper-tabs::after {
    content: "";
    position: absolute;
    bottom: 0;
    top: 0;
    left: 0;
    right: 0;
    /* Flat gray divider under the whole tab strip — removed per user request
       (23 กันยายน 2026) once the tab bar moved into the navbar (see
       #mainSwiperTabs in main/index.volt): redundant next to the navbar's
       own bottom edge, and visually competed with the per-tab #FF7043
       active-tab underline below. The scale-in active/hover indicator
       (.swiper-tabs .nav-item::after) is untouched. */
    border-bottom: none;
}

.swiper-tabs >.nav-tabs {
    border-bottom: none;
}
.swiper-tabs .nav-item {
    border: none;
    padding: 0.4rem 0.5rem 0.65rem 0.5rem;
}
.swiper-tabs .nav-item.active,
.swiper-tabs .nav-item.active:focus,
.swiper-tabs .nav-item.active:hover {
    border-width: 0;
}
.swiper-tabs .nav-item.active,
.swiper-tabs .nav-item:hover {
    border: none;
    background: transparent;
}
.swiper-tabs .nav-item::after {
    content: "";
    background: #FF7043;
    height: 3.4px;
    position: absolute;
    width: 100%;
    left: 0px;
    bottom: -2.4px;
    transition: all 250ms ease 0s;
    transform: scale(0);
}
.swiper-tabs .nav-item.active::after,
.swiper-tabs .nav-item:hover::after {
    transform: scale(1);
}
.swiper-tabs .nav-item .close {
    margin-right: 1px;
    top: 3.5px;
}
.swiper-tabs .nav-item:not(:first-child):not(.no-close) {
    padding-right: 1.6rem;
}

/* #mainSwiperTabs only ever shows exactly one item now — every menu click
 * clears whatever else is open first (see clearOtherTabs() in custom.js) —
 * so the multi-tab look above (orange active/hover underline, pointer
 * cursor implying more tabs to flip between) reads as misleading rather
 * than useful. Flatten it down to a plain page-title label instead. The
 * underlying Swiper/phpGridTabs tab mechanism (still the same <a
 * class="nav-item nav-link" data-bs-toggle="tab">, still how page content
 * loads) is left completely untouched — this only changes how it looks
 * (23 กันยายน 2026).
 */
#mainSwiperTabs.swiper-tabs .nav-item {
    padding-block: 0.4rem;
    cursor: default;
}
#mainSwiperTabs.swiper-tabs .nav-item::after {
    display: none;
}

/* Bootstrap's reboot underlines <a> tags by default and .nav-link never
 * resets it — invisible on an inactive (gray) link against a white
 * background, but the active link's color switches to var(--bs-primary)
 * (.nav-tabs .nav-link.active), and a nested span with its own color
 * (.breadcrumb-current) still paints the inherited underline in ITS OWN
 * color per line-box — which is exactly the stray purple line the user
 * flagged in a screenshot as still looking tab-like even after the ::after
 * bar above was already hidden (23 กันยายน 2026).
 */
#mainSwiperTabs.swiper-tabs .nav-item {
    text-decoration: none;
}

/* First tried giving this its own white "card" surface, matching the
 * navbar's look (background/shadow/radius copied from core.css's
 * `.navbar-detached`/`.bg-navbar-theme`) — user found the boxed look
 * "ไม่ค่อยสวย" and asked to drop the white frame; then asked to bring the
 * text flush to the container's own left edge (no more inline padding
 * pushing it in) and add a full-width divider line under it, separating
 * the breadcrumb from the page content below now that there's no card
 * edge doing that job anymore (23 กันยายน 2026).
 */
.main-breadcrumb-bar {
    padding-block-end: 0.75rem;
    border-block-end: 1px solid var(--bs-border-color, #d9dee3);
}

/* Grid/data card below the breadcrumb was sitting noticeably more inset
 * than the breadcrumb text above it — measured live (23 กันยายน 2026):
 * container's own gutter alone puts #mainTabs/breadcrumb at 301.75px, but
 * #mainTabContent (.tab-content) carries its own separate 1.5rem side
 * padding on top of that (Bootstrap's generic `.tab-content:not(
 * .doc-example-content) { padding: 1.5rem; }`, core.css), pushing the grid
 * caption to 327.25px — a second, stacked gutter the breadcrumb never had.
 * Dropping just the inline padding here re-aligns the grid to the exact
 * same left/right edge as the breadcrumb; vertical padding (spacing above/
 * below the grid) is left untouched.
 */
/* Gap between the breadcrumb's divider line and the grid/card below it was
 * ~39px — measured live (23 กันยายน 2026): the breadcrumb bar's own
 * mb-3 (12.75px, removed from its class list in index.volt) stacked with
 * #mainTabContent's default top padding (1.5rem = 25.5px, from the same
 * Bootstrap .tab-content rule referenced above) plus the divider's own
 * border. User asked for it flush with the line instead — trimmed the
 * remaining padding-block-start down to a small breathing gap; bottom
 * padding (spacing before the footer) is left at its original 1.5rem.
 */
#mainTabContent {
    padding-inline: 0;
    padding-block-start: 0.5rem;
}

/* Breadcrumb trail inside the page-title label above (built client-side in
 * index.volt's loadPage()/buildBreadcrumb() from the sidebar's own ancestor
 * chain) — ancestor segments muted, current page normal weight/color, so
 * the hierarchy reads at a glance without needing the old tab underline
 * (23 กันยายน 2026).
 */
#mainSwiperTabs .breadcrumb-crumb {
    color: var(--bs-secondary-color, #6c757d);
}
#mainSwiperTabs .breadcrumb-crumb.breadcrumb-current {
    color: inherit;
    font-weight: 600;
}
#mainSwiperTabs .breadcrumb-sep {
    color: var(--bs-secondary-color, #6c757d);
    opacity: 0.6;
}

/* Grid detail
   ========================================================================== */

.jqgrid-detail {
    margin-top: 14px;
}

.jqgrid-detail > .jqgrid-detail-content {
    margin-bottom: 14px;
}

.jqgrid-detail > .jqgrid-detail-content > .tab-content{
    margin-top: 10px;
}

/* Highlight.js
   ========================================================================== */
pre.highlight {
    padding: 0px;
    border: 0px;
}

pre.highlight code {
    padding: 0.7em 1em;
    -webkit-text-size-adjust: none;
    border: 1px solid #1abc9c;
    border-left: 4px solid #16a085;
    border-radius: 4px;
    font-size: 1rem;
}

/* Language switcher (main navbar)
   ========================================================================== */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0.1875rem;
    background-color: var(--bs-secondary-bg, #f1f0f2);
    border-radius: 50rem;
}
.lang-switcher-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-inline-size: 2.25rem;
    padding-block: 0.25rem;
    padding-inline: 0.75rem;
    border-radius: 50rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--bs-secondary-color, #6c757d);
    text-decoration: none;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}
.lang-switcher-option:hover {
    color: var(--bs-primary);
    text-decoration: none;
}
.lang-switcher-option.active,
.lang-switcher-option.active:hover {
    background-color: var(--bs-primary);
    color: #fff;
    box-shadow: 0 2px 4px rgba(var(--bs-primary-rgb), 0.4);
}

/* Sidebar submenu tree-guide lines (main module, #layout-menu only) — a
 * file-explorer-style tree (├─ / └─), one user request at a time: (1) plain
 * one-line-per-.menu-sub trunk wasn't enough on its own to tell which items
 * belong under which parent, user asked for a proper tree look instead
 * (23 กันยายน 2026). Drawn per-<li> rather than one line for the whole
 * .menu-sub block, so the trunk can stop exactly at the last item (the "└"
 * elbow) instead of running past it:
 * - `.menu-item::before` (li) draws the vertical segment for that one row,
 *   full height so it joins seamlessly with the previous/next row's segment
 *   — except `:last-child`, which stops at the row's own vertical middle so
 *   the trunk doesn't run past the last branch.
 * - `.menu-link::before` (safe to reuse — was Vuexy's stock circle bullet,
 *   core.css `.menu-sub > .menu-item > .menu-link::before`, already
 *   overridden here) draws the short horizontal elbow tick into the row.
 * `.menu-link::after` is deliberately left untouched — that's Vuexy's own
 * toggle-chevron pseudo-element (core.css `.menu-item.open > .menu-link::
 * after`), reusing it here would break the expand/collapse arrow.
 * Inset values kept in sync with core.css's own per-depth bullet positions:
 * 1.1rem first level, 1.75rem second level.
 */
#layout-menu .menu-sub > .menu-item {
    position: relative;
}
#layout-menu .menu-sub > .menu-item::before {
    content: '';
    position: absolute;
    inset-inline-start: 1.1rem;
    inset-block-start: 0;
    inset-block-end: 0;
    border-inline-start: 1px solid var(--bs-border-color, #d9dee3);
}
#layout-menu .menu-sub > .menu-item:last-child::before {
    inset-block-end: 50%;
}
#layout-menu .menu-sub > .menu-item > .menu-link::before {
    content: '';
    position: absolute;
    inset-inline-start: 1.1rem;
    inset-block-start: 50%;
    inline-size: 0.6rem;
    block-size: 1px;
    background-color: var(--bs-border-color, #d9dee3);
    transform: translateY(-50%);
    /* override the stock circle's mask/shape without touching core.css */
    mask-image: none;
    border-radius: 0;
}
#layout-menu .menu-sub .menu-sub > .menu-item::before,
#layout-menu .menu-sub .menu-sub > .menu-item > .menu-link::before {
    inset-inline-start: 1.75rem;
}

/* Sub-items CAN carry a real icon (level-1 leaves — index.volt's `{% if
 * child['Icon'] is not empty %}` branch — render one when set in DB), which
 * would sit in the exact same spot as the elbow tick above (Vuexy's own
 * .menu-icon is a normal flex child, not absolutely positioned, so it lands
 * right where the tick is drawn) — no current menu item has one, but hide
 * the tick whenever one does so it never overlaps (23 กันยายน 2026).
 * The vertical trunk segment (.menu-item::before) is left untouched so the
 * tree line still connects through the row.
 */
#layout-menu .menu-sub > .menu-item > .menu-link:has(.menu-icon)::before {
    display: none;
}

/* Copyright line in the staff (main) layout footer: same centered, quieter
   footnote style as the applicant layout's .apply-footer-text in
   custom.css (user request, 30 กันยายน 2026). */
.apply-footer-text {
  font-family: "IBM Plex Sans Thai", sans-serif;
  font-size: .8125rem;
  line-height: 1.7;
  letter-spacing: .01em;
  color: var(--bs-secondary-color, #7a7f93) !important;
}

@media (max-width: 575.98px) {
  .apply-footer-text {
    font-size: .75rem;
    padding: 0 1rem;
  }
}
