﻿@font-face {
    font-family: THSarabunNew;
    src: url("../fonts/THSarabunNew.ttf?45905ce12b4739c794a5ebdaee506202") format("truetype")
}

@font-face {
    font-family: THSarabunNew;
    font-weight: 900;
    src: url("../fonts/THSarabunNew\ Bold.ttf?bdd8eb542ab9aa84e5809edb230f07cc") format("truetype")
}

@font-face {
    font-family: THSarabunNew;
    font-style: italic;
    src: url("../fonts/THSarabunNew\ Italic.ttf?05a052030bb61432929f643579b82ce1") format("truetype")
}

@font-face {
    font-family: THSarabunNew;
    font-style: italic;
    font-weight: 900;
    src: url("../fonts/THSarabunNew\ BoldItalic.ttf?0b381613886ea1af245b0a8120019ecb") format("truetype")
}

.spRequire, .required {
    color: red !important;
}

.spBlue {
    color: blue !important;
}

.spGreen {
    color: green !important;
}

.fnWhite {
    color: white !important;
}

.fnWPS {
    color: #562DB7;
}

.fnWeight600 {
    font-weight: 600 !important;
}

.fnWeight900 {
    font-weight: 900 !important;
}

.noDisplay {
    display: none;
}

.mouseClick {
    cursor: pointer;
}

.btnWidth {
    padding-left: 15px;
    padding-right: 20px;
}

.modal-lg1000 {
    max-width: 1000px;
}

.modal-lg1200 {
    max-width: 1200px;
}

.form-group label, form label {
    text-transform: none !important;
    margin-top: .5rem !important;
    margin-bottom: 0 !important;
}

.text-right {
 text-align:right;
}

.text-left {
    text-align: left;
}

/*Template*/
.gradient-wps {
    background-image: linear-gradient(45deg, #562DB7, #60AFF0);
    background-repeat: repeat-x;
}

.gradient-green-red-wps {
    background-image: linear-gradient(45deg, #32b714, #cc3415);
    background-repeat: repeat-x;
}


.modal {
    overflow: auto !important;
}

.control-label {
    font-weight: 900 !important;
    text-align:right;
}

/* Custom Template */
body {
    font-family: THSarabunNew !important;
    font-size: 1.3rem !important;
    color:black !important;
}

.auth-body-bg {
    background-image: url(../img/SAT_banner_01.png) !important;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    padding-top: 80px;
}

.bg-overlay {
    background-color: #0074BD !important;
    width: 100%;
    height: 100%;
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0px;
    top: 0px;
}

.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
    font-family: inherit !important;
}

.form-control {
    font-size: inherit !important;
    color: inherit !important;
    font-weight: 600 !important;
}

.btn {
    font-size: inherit !important;
    font-weight: 600 !important;
}

body[data-topbar=dark] #page-topbar {
    background-color: #0074BD;
}

#sidebar-menu ul li a {
    padding: .1rem 1rem;
    font-size: inherit !important;
    /*color: inherit !important;*/
    font-family: inherit !important;
    font-weight: 600;
}

.card-title {
    margin: 15px 0 7px 15px;
    font-weight: 700;
    font-family: inherit !important;
    font-size: inherit;
}

.metismenu li {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

#sidebar-menu ul li ul.sub-menu li a {
    padding: .1rem 0 .1rem 2.8rem !important;
}

#sidebar-menu ul li ul.sub-menu li ul.sub-menu li a {
    padding: 0.1rem 0rem .1rem 3.5rem !important;
}

.page-title-box h4 {
    font-size: inherit;
    font-weight: 600;
}

.page-title-box {
    padding-bottom: inherit !important;
    color: #0F9CF3 !important;
    /* class นี้เป็น class เฉพาะของธีมเก่าที่ทุกหน้ายังใช้ห่อ breadcrumb/หัวข้อหน้าอยู่
       ธีม Datix (main.min.css) ไม่มีนิยาม margin ให้ เลยเพิ่มไว้กันเนื้อหาด้านล่างติดกันเกินไป */
    margin-bottom: 1rem;
}

/* Datix .login-bg อ้างอิงรูปพื้นหลัง assets/images/login.jpg ที่ไม่มีอยู่ใน asset pack นี้
   ใช้ gradient สีธีมแทนไปก่อน */
.login-bg {
    background: linear-gradient(135deg, #5387e4 0%, #2c4a7a 100%) !important;
}

.form-select {
    font-size: 1.3rem !important;
}

.dropdown-menu {
    font-size: 1.3rem !important;
}

.toast {
    font-size: 2rem;
    font-weight: 700;
}

.swal2-container .swal2-title {
    font-size: 2em !important;
}

.swal2-content {
    font-size: 2em !important;
}

.swal2-styled.swal2-confirm {
    font-size: 1.5em !important;
}

.swal2-styled.swal2-cancel {
    font-size: 1.5em !important;
}

.icon-position-btn{
    position:relative;
    top: 3px;
}

/*.dropdown-menu {
    padding: .1rem 0;
    font-size: inherit !important;
    color: black;
}

#sidebar-menu ul li a i {
    font-size: 1.1rem;
    color: black;
    font-weight: 400;
}

#sidebar-menu ul li a {
    padding: .4rem 1rem;
    line-height: 1;
    display: flex;
}

#sidebar-menu ul li:hover {
    color: #0f9cf3 !important;
    border: 1px solid #e8ecf4;
    background-color: #eff2f7;
}

#sidebar-menu ul li.menu-title i {
    font-size: 1.1rem;
    color: black;
    font-weight: 400;
    vertical-align: middle;
}

.mm-active,
.mm-active .active {
    color: black !important;
}


.menu-title {
    font-size: 1.3rem;
    color: black;
    font-weight: 600;
    font-family: inherit !important;
    opacity: 1;
    vertical-align: middle;
}

.menu-dot {
    margin-right: 5px;
    font-size: 70px;
    line-height: 16px !important;
}

.form-control {
    padding: .1rem .75rem;
    line-height: 1.5;
}

.line {
    position: absolute;
    width: 2px;
    height: 21px;
    background-color: #1194f6;
    top: 0;
    margin: auto;
    margin-top:15px;
}

*/

/*Modal Overlay*/

.modal_shade {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: silver;
    opacity: 0.5;
    filter: alpha(opacity=50);
}

/*Swagger*/

.swagger-section {
    color: black;
}

.swagger-section div.heading {
    background-color: #e7f0f7;
    border: 1px solid #c3d9ec;
    float: none;
    clear: both;
    overflow: hidden;
    display: block;
    margin: 0;
    padding: 0;
}

.swagger-section div.heading h3 {
    display: block;
    clear: none;
    float: left;
    width: auto;
    margin: 0;
    padding: 0;
    line-height: 1.1em;
    color: black;
}

.swagger-section div.heading h3 span {
    margin: 0;
    padding: 0;
}

.swagger-section div.heading h3 span.http_method a {
    background-color: #0f6ab4;
}

.swagger-section div.heading h3 span.http_method a {
    text-transform: uppercase;
    text-decoration: none;
    color: white;
    display: inline-block;
    width: 50px;
    font-size: 0.7em;
    text-align: center;
    padding: 7px 0 4px;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    -o-border-radius: 2px;
    -ms-border-radius: 2px;
    -khtml-border-radius: 2px;
    border-radius: 2px;
}

.swagger-section div.heading h3 span.path {
    padding-left: 10px;
}

.swagger-section div.heading h3 span.path a {
    color: black;
    text-decoration: none;
}

.swagger-section div.content {
    border-top: none;
    background-color: #ebf3f9;
    border: 1px solid #c3d9ec;
    padding: 10px;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    margin: 0 0 20px;
}

.swagger-section div.content h4 {
    font-size: 1.1em;
    margin: 0;
    padding: 15px 0 5px;
    color: #0f6ab4;
}

.swagger-section-section .authorize-wrapper_operation {
    float: right;
}

.swagger-section .authorize-wrapper {
    margin: 15px 0 10px;
}

.swagger-section  ol, .swagger-section  ul {
    list-style: none;
}

.swagger-section .authorize__btn_operation_logout {
    background-position: -30px 0;
    width: 18px;
    margin-top: -6px;
    margin-left: 4px;
}

.swagger-section .authorize__btn_operation {
    height: 18px;
    vertical-align: middle;
    display: inline-block;
    background: url(../customize/img/explorer_icons.png) no-repeat;
}

.swagger-section .authorize-scopes {
    position: absolute;
    margin-top: 20px;
    background: #FFF;
    border: 1px solid #ccc;
    border-radius: 5px;
    display: none;
    font-size: 13px;
    max-width: 300px;
    line-height: 30px;
    color: black;
    padding: 5px;
}

.swagger-section  .model-signature {
    font-size: 1em;
    line-height: 1.5em;
}

.swagger-section  p {
    line-height: 1.4em;
    padding: 0 0 10px;
    color: #333333;
}

.swagger-section  .model-signature ul.signature-nav {
    display: block;
    min-width: 230px;
    margin: 0;
    padding: 0;
}

.swagger-section  .model-signature .signature-nav a {
    text-decoration: none;
    color: #AAA;
}

.swagger-section  .model-signature .signature-container {
    clear: both;
}

.swagger-section .model-signature pre {
    /*font-size: .75em;*/
    line-height: 1.2em;
    overflow: auto;
    max-height: 200px;
    cursor: pointer;
}

.swagger-section pre {
    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
    background-color: #fcf6db;
    border: 1px solid #e5e0c6;
    font-size: .65em;
    line-height: 1.2em;
    overflow: auto;
    max-height: 200px;
    cursor: pointer;
    margin-top: 5px;
    padding: 5px;
}

.swagger-section .hljs-type, .swagger-section .hljs-string, .swagger-section .hljs-number, .swagger-section .hljs-selector-id, .swagger-section .hljs-selector-class, .swagger-section .hljs-quote, .swagger-section .hljs-template-tag, .swagger-section .hljs-deletion {
    color: #880000;
}

.swagger-section .hljs, .swagger-section .hljs-subst {
    color: #444;
}

.swagger-section  table.fullwidth {
    width: 100%;
}

.swagger-section  table {
    border-collapse: collapse;
    border-spacing: 0;
}

.swagger-section  table tbody tr:last-child td {
    border-bottom: none;
}

.swagger-section  .required {
    font-weight: bold;
}

.swagger-section  table tbody tr td {
    padding: 6px;
    font-size: 0.9em;
    vertical-align: top;
    line-height: 1.3em;
}

.swagger-section  caption, .swagger-section  th, .swagger-section  td {
    text-align: left;
}

.swagger-section  table thead tr th {
    padding: 5px;
    font-size: 0.9em;
    color: #666666;
    border-bottom: 1px solid #999999;
}

.swagger-section  caption, .swagger-section  th, .swagger-section  td {
    text-align: left;
    font-weight: normal;
    vertical-align: middle;
}

.swagger-section .model-signature {
    font-size: 1em;
    line-height: 0.85em;
}

.swagger-section p {
    padding: 0 0 2px;
    color: #333333;
}

.swagger-section .strong {
    font-weight: 800;
    color: #000;
    font-size: 1em;
}

.swagger-section .propType {
    color: #5555aa;
}

.swagger-section .propOptKey {
    font-style: italic;
}

.swagger-section .description div {
    font-size: 0.9em;
    line-height: 1.5em;
    margin-left: 1em;
}

.swagger-section ul.signature-nav {
    display: block;
    min-width: 230px;
    margin: 0;
    padding: 0;
}

.swagger-section ul {
    list-style: none;
}

.swagger-section ul.signature-nav li {
    float: left;
    margin: 0 5px 5px 0;
    padding: 2px 5px 2px 0;
    border-right: 1px solid #ddd;
}

.swagger-section pre code {
    /*line-height: 1.6em;*/
    background: none;
    display: block;
    padding: 0.5em;
}

.swagger-section ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre {
    font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
    padding: 10px;
    font-size: 0.9em;
    max-height: 400px;
    overflow-y: auto;
}


/*AI*/

/* ===== เนื้อหา AI ===== */
.ai-markup {
    font-size: .95rem;
    line-height: 1.6;
    color: #1f2937;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
}

    .ai-markup b
    .ai-markup strong {
        color: #1f2937;
        font-weight: 600;
    }

    .ai-markup ul {
        margin: .5rem 0 .5rem 1.2rem;
        padding: 0;
    }

    .ai-markup li {
        margin: .2rem 0;
    }

    .ai-markup h1, .ai-markup h2, .ai-markup h3 {
        margin: .4rem 0 .3rem
    }

    .ai-markup h1 {
        font-size: 1.35rem
    }

    .ai-markup h2 {
        font-size: 1.2rem
    }

    .ai-markup h3 {
        font-size: 1.05rem
    }

    .ai-markup blockquote {
        border-left: 3px solid #e5e7eb;
        margin: .4rem 0;
        padding: .2rem .8rem;
        color: #374151;
        background: #f9fafb;
        border-radius: .25rem
    }

    .ai-markup pre {
        background: #1e293b; /* พื้นหลังโทน Slate ชัดกว่า #0f172a */
        color: #f8fafc; /* สีตัวหนังสือขาว */
        padding: .75rem 1rem;
        border-radius: .5rem;
        white-space: pre-wrap;
        word-break: break-word;
        overflow-x: auto;
        max-width: 100%;
        font-family: 'Fira Code', 'Courier New', monospace; /* ฟอนต์อ่านง่าย */
        font-size: .9rem;
    }

    .ai-markup code {
        background: none !important;
        color: white !important;
        padding: .15rem .4rem;
        border-radius: .35rem;
        font-family: 'Fira Code', 'Courier New', monospace;
        font-size: .9rem;
    }


    .ai-markup a {
        color: #2563eb;
        text-decoration: none
    }

        .ai-markup a:hover {
            text-decoration: underline
        }

    .ai-markup img, .ai-markup table {
        max-width: 100%;
        height: auto
    }

.ai-toolbar {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding-top: .25rem;
    border-top: 1px dashed #e5e7eb;
    margin-top: .5rem
}

.icon-btn {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: .5rem;
    padding: .35rem .45rem;
    cursor: pointer
}

    .icon-btn:hover {
        background: #f8fafc
    }

    .icon-btn:disabled {
        opacity: .5;
        cursor: not-allowed
    }

.icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle
}

.card .card-body {
    overflow: hidden
}

.e-grid .e-rowcell {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word
}

/* ==== THINK STYLE ==== */
.ai-think-wrap {
    display: block;
    margin: .25rem 0 .6rem;
    background-color: #f9f9f9;
    border-radius: 1rem;
    padding: 15px 0px 10px 10px;
}

.ai-think-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: .2rem;
    font-weight: 800;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    background: linear-gradient(90deg, #0f9cf3 0%, #374151 25%, #6b7280 50%, #562DB7 75%, #111827 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% 100%;
    animation: thinkFade 3s linear infinite;
}

.ai-think-text {
    display: block;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: .85rem;
  
    background: linear-gradient(90deg, #111827 0%, #374151 25%, #6b7280 50%, #9ca3af 75%, #111827 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% 100%;
    animation: thinkFade 3s linear infinite;
}

.think {
    color: #6b7280; /* เทา */
    font-style: italic;
    background: #f9fafb;
    padding: 2px 4px;
    border-radius: 4px;
}

.think-block {
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: opacity 0.5s ease-in-out;
}

.ai-think-wrap {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #f9fafb;
    border-left: 3px solid #6366f1;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* block reasoning ทีละก้อน */
.ai-think-text {
    display: block;
    margin: 0.25rem 0;
    color: #374151;
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

    /* ทำให้ข้อความที่ mark fade ค่อยๆ หายไป */
    .ai-think-text.fade {
        opacity: 0;
    }

.fade {
    animation: fadeInOut 4s linear;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.scroll-down-btn {
    position: fixed;
    bottom: 90px;
    left: 50%; /* จัดให้อยู่กึ่งกลาง */
    transform: translateX(-50%); /* เลื่อนกลับครึ่งนึง */
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex; /* ทำให้ icon อยู่ตรงกลาง */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,.2);
    transition: opacity 0.3s ease;
    z-index: 999;
}

    .scroll-down-btn:hover {
        background: #f0f0f0;
    }
/* ===== Approx Template Overrides ===== */

/* Sidebar nav menu font */
.startbar .navbar-nav .nav-link {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    font-family: THSarabunNew !important;
    letter-spacing: 0.02em;
}

.startbar .navbar-nav .nav-link span {
    font-size: 1.16rem !important;
    font-weight: 800 !important;
}

/* Sidebar submenu font */
.startbar .navbar-nav .collapse .nav-link {
    font-size: 1rem !important;
    font-weight: 600 !important;
    padding-left: 2.8rem !important;
}

/* Sidebar menu label */
.startbar .menu-label small {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    font-family: THSarabunNew !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Topbar user name */
.topbar .nav-link span {
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    font-family: THSarabunNew !important;
}

/* Sidebar brand user info */
.startbar .brand ~ .startbar-menu .d-flex h5,
.startbar .brand ~ .startbar-menu .d-flex small {
    font-family: THSarabunNew !important;
}

/* ===== Fix: Login page width ===== */
.wrapper-page {
    max-width: 500px !important;
    margin: 0 auto !important;
    padding: 40px 15px !important;
}

/* ===== Fix: Sidebar user info alignment ===== */
.sidebar-user-info {
    padding-left: 10px !important;
    padding-right: 10px !important;
}
.sidebar-user-info img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
.sidebar-user-info h5,
.sidebar-user-info small {
    display: block !important;
    text-align: center !important;
    width: 100% !important;
}

/* ===== Fix: Logo collapsed/expanded visibility ===== */
.startbar .brand .logo .logo-sm {
    display: none !important;
}
.startbar .brand .logo .logo-lg {
    display: inline-block !important;
}
body[data-sidebar-size="collapsed"] .startbar .brand .logo .logo-sm {
    display: inline-block !important;
}
body[data-sidebar-size="collapsed"] .startbar .brand .logo .logo-lg {
    display: none !important;
}

/* ===== Fix: Sidebar user-info hide on collapsed ===== */
body[data-sidebar-size="collapsed"] .sidebar-user-info h5,
body[data-sidebar-size="collapsed"] .sidebar-user-info small,
body[data-sidebar-size="collapsed"] .sidebar-user-info img {
    display: none !important;
}
body[data-sidebar-size="collapsed"] .sidebar-user-info {
    padding: 5px !important;
}

/* ===== Fix: menu-label hide on collapsed ===== */
body[data-sidebar-size="collapsed"] .startbar .menu-label {
    display: none !important;
}

/* ===== Avatar popup opens on hover instead of click (Datix .dropdown-menu is
   display:none by default, so plain CSS :hover is enough — no Bootstrap JS involved) ===== */
.dropdown-hover .dropdown-menu {
    display: none;
    margin-top: 0;
}
.dropdown-hover:hover .dropdown-menu {
    display: block;
}

/* ===== Sidebar: พื้นหลังสีกรมท่าเข้ม แทนสีเทาอ่อนเดิมของ Datix (#e6eaf1) =====
   ปรับสีตัวอักษร/ไอคอนของเมนูที่ไม่ active ให้เป็นสีอ่อนตามไปด้วย เพราะสีเดิม (#3f415e)
   ออกแบบมาให้อ่านบนพื้นอ่อน ถ้าไม่ปรับจะกลายเป็นตัวอักษรเข้มบนพื้นเข้ม อ่านไม่ออก
   ส่วนเมนูที่ active/current-page ยังคงพื้นหลังสีอ่อนแบบเดิม (.sidebar-menu>li.active>a ฯลฯ)
   จึงต้องบังคับสีตัวอักษรกลับเป็นสีเข้มเฉพาะตอน active เพื่อให้อ่านออกบนพื้นอ่อนนั้น */
.sidebar-wrapper {
    background: #13243F !important;
}

.sidebar-menu > li > a,
.treeview-menu > li > a {
    color: #c9d3e0 !important;
}

.treeview-menu > li > a {
    border-left-color: #2c3e5c !important;
}

.menu-label small {
    color: #8fa0bd !important;
}

.sidebar-menu > li.active > a,
.sidebar-menu > li.current-page > a,
.treeview-menu > li > a.active-sub {
    color: #1f2a44 !important;
}

/* วงกลมตกแต่งโค้งรอบเมนู active (li.current-page::before/::after) เดิม background เป็น #e6eaf1
   ให้กลืนกับสี sidebar เก่า ตอนนี้ sidebar เปลี่ยนเป็นสีเข้มแล้วต้องปรับให้กลืนตามไปด้วย
   (box-shadow สีอ่อน #eff2f8 คงไว้เหมือนเดิม เพราะมันคือสีพื้นหลังฝั่งเนื้อหาหลัก ไม่ใช่ sidebar) */
li.current-page::before,
li.current-page::after {
    background: #13243F !important;
}

/* ===== ไอคอนกล่องเมนู sidebar + แถบ profile-actions บนสุด =====
   เดิม background ของกล่องไอคอนเป็น #eff2f8/#eff2f8 (สีอ่อนมาก) และสีไอคอน/ตัวหนังสือก็เป็นโทนอ่อน
   (#c9d3e0 ที่ปรับไว้ก่อนหน้า) ทำให้ไอคอนกับกล่องกลืนเป็นสีเดียวกันจนไม่มี contrast
   ปรับกล่องให้เป็นกรมท่าอ่อนกว่าพื้นหลัง sidebar เล็กน้อย (แยกออกจากพื้นหลังชัดเจน) ใส่ shadow ให้มีมิติ
   ไอคอนเป็นสีฟ้าสว่าง (#7fb2ff) ให้เด่นตัดกับกล่อง */
.sidebar-menu > li > a > i {
    background: #1e3252 !important;
    color: #7fb2ff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
    transition: background .15s ease, box-shadow .15s ease;
}

.sidebar-menu > li > a:hover > i {
    background: #24406b !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .1);
}

/* เมนู active/current-page ใช้พื้นฟ้าเข้มเต็ม (ตามดีไซน์เดิมของ Datix) เพิ่ม glow ให้เด่นขึ้น */
.sidebar-menu > li.active > a i,
.sidebar-menu > li.current-page > a i {
    background: #5387e4 !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(83, 135, 228, .55);
}

.profile-actions > li {
    background: #1e3252 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06) !important;
    transition: background .15s ease, box-shadow .15s ease;
}

.profile-actions > li a {
    color: #7fb2ff !important;
}

.profile-actions > li:hover {
    background: #24406b !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .1) !important;
}

/* ตอน hover เมนู sidebar จะได้พื้นหลังสีอ่อน (#e1e5ed จาก main.min.css) แต่ตัวหนังสือยังเป็นสีอ่อน
   (#c9d3e0 ที่ปรับไว้สำหรับพื้น sidebar สีเข้ม) เลยอ่านไม่ออกตอน hover — บังคับให้เข้มขึ้นเฉพาะตอน hover */
.sidebar-menu > li:hover > a {
    color: #1f2a44 !important;
}

/* เมนูย่อย (treeview-menu) ก็เจอปัญหาเดียวกัน: ตอน hover ได้พื้นอ่อน (#e1e5ed) แต่ตัวหนังสือยังจาง (#c9d3e0)
   และเมนูย่อยที่ active-sub (หน้าปัจจุบัน) ก็ตัวหนังสือจางเหมือนกันเพราะไม่มี color ของตัวเองมาก่อน
   เลยบังคับให้เข้มทั้งคู่ พร้อมให้ hover ใช้โทนฟ้าอ่อนแยกจาก active-sub (เทาอ่อน #d7dde7 เดิม)
   จะได้ดูออกว่าอันไหนแค่ hover อันไหนคือหน้าที่เลือกอยู่จริง */
.sidebar-menu .treeview-menu > li > a.active-sub {
    color: #1f2a44 !important;
}

.sidebar-menu .treeview-menu > li > a:hover {
    background-color: #dbe6fb !important;
    color: #1f2a44 !important;
}

/* ===== Shim: .mr-1/.ml-1 (Bootstrap 4) ไม่มีอยู่ใน Bootstrap 5 ที่ธีมนี้ใช้ (เปลี่ยนชื่อเป็น .me-1/.ms-1 แล้ว)
   ปุ่มแก้ไข/ลบในคอลัมน์ "จัดการ" ของทุก grid ทั่วทั้งแอปยังใช้ mr-1/ml-1 ค้างอยู่ (มากกว่า 10 หน้า)
   ทำให้ปุ่มชิดกันสนิทเพราะ class ไม่มีผลอะไรเลย — เติม class เดิมกลับเข้ามาให้ทำงานแทนที่จะไล่แก้ทีละหน้า */
.mr-1 {
    margin-right: .25rem !important;
}
.ml-1 {
    margin-left: .25rem !important;
}

/* กันกรอบ focus สีดำที่ browser วาดให้อัตโนมัติตอนโหลดหน้าแรก/คลิกด้วยเมาส์ (ไม่ใช่การกด Tab จริง)
   :focus-visible ยังทำงานตามปกติเวลากด Tab ไล่ด้วยคีย์บอร์ด จึงไม่กระทบ accessibility */
:focus:not(:focus-visible) {
    outline: none !important;
}

/* ===== ขนาดตัวอักษรใน popup avatar/notification ไม่เท่ากัน =====
   ชื่อ+ตำแหน่งใน header ของ popup avatar (.user-header h6) และหัวข้อ/ชื่อรายการใน popup แจ้งเตือน
   (.dropdown-header, h6.fs-13) เดิมเล็กกว่าบรรทัด "จำนวน...รายการ" (<small>) เพราะมี class/selector
   เฉพาะ (h6, .fs-13) ที่กำหนด font-size ของตัวเองไว้เล็ก ชนะค่า font-size:1.3rem ของ body ไป —
   ขยายให้เท่ากับขนาดเดิมของ <small> (ซึ่งไม่ได้ตั้ง font-size เอง เลยได้ 1.3rem จาก body ตามปกติ) */
.user-header h6,
.dropdown-header.fw-semibold,
.dropdown-menu h6.fs-13 {
    font-size: 1.3rem !important;
}

/* ===== Footer (.app-footer) ให้ติดล่างสุดของหน้าจอเสมอ ไม่ใช่ลอยอยู่ต่อจากเนื้อหาสั้น ๆ =====
   ทำแบบ "sticky footer" มาตรฐาน: .app-container เป็น flex column สูงเต็ม viewport,
   .app-body ยืด (flex:1) กินพื้นที่ว่างทั้งหมด ดัน footer ลงไปชิดขอบล่างเสมอเมื่อเนื้อหาสั้นกว่าจอ
   ถ้าเนื้อหายาวเกินจอ footer จะอยู่ท้ายเนื้อหาตามปกติ (ไม่ใช่ fixed ทับเนื้อหา) */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-body {
    flex: 1 0 auto;
}

.app-footer {
    font-size: 1em !important;
}

/* ===== ขนาดโลโก้ sidebar + สลับเป็นโลโก้เล็กตอน sidebar ยุบเหลือแค่ไอคอน =====
   .pinned:not(.sidebar-hovered) คือสถานะ sidebar ย่อเหลือแถบไอคอนแคบ ๆ (70px) บนจอเดสก์ท็อป
   ซึ่งเป็นกลไก "ย่อ sidebar" ตัวเดียวที่มีผลจริงตอนนี้ (ปุ่ม #toggle-sidebar เดิมมีคลาส .toggled
   ที่ main.min.css กำหนดผลไว้เฉพาะจอมือถือ <991px เท่านั้น บนเดสก์ท็อปกดแล้วยังไม่มีผลอะไร) */
.app-brand {
    justify-content: center;
}

.app-brand .logo-full {
    max-height: 80px;
}

.app-brand .logo-collapsed {
    max-height: 60px;
    display: none;
}

.page-wrapper.pinned:not(.sidebar-hovered) .app-brand .logo-full {
    display: none;
}

.page-wrapper.pinned:not(.sidebar-hovered) .app-brand .logo-collapsed {
    display: inline-block;
}
