/*!
 * Start Bootstrap - SB Admin v5.0.2 (https://startbootstrap.com/template-overviews/sb-admin)
 * Copyright 2013-2018 Start Bootstrap
 * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-sb-admin/blob/master/LICENSE)
 */

html {
  position: relative;
  min-height: 100%;
}

body {
  height: 100%;
  font-family: 'Sarabun', 'TH Sarabun New', 'Noto Sans Thai', sans-serif !important;

}

#wrapper {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

#wrapper #content-wrapper {
  overflow-x: hidden;
  width: 100%;
  padding-top: 1rem;
  padding-bottom: 80px;
}

body.fixed-nav #content-wrapper {
  margin-top: 56px;
  padding-left: 90px;
}

body.fixed-nav.sidebar-toggled #content-wrapper {
  padding-left: 0;
}

/* ================================
   FIX: Mobile Top Navbar Overflow
   ================================ */
@media (max-width: 576px) {
  .academic-bar {
    display: none !important;
  }
}

/* ===== FIX: Mobile navbar overlap ===== */
@media (max-width: 768px) {
  body {
    padding-top: 64px;
    /* เผื่อ navbar บนมือถือ */
  }

  .academic-bar {
    display: none !important;
  }
}

.scroll-to-top {
  position: fixed;
  right: 15px;
  bottom: 15px;
  display: none;
  width: 50px;
  height: 50px;
  text-align: center;
  color: #fff;
  background: rgba(52, 58, 64, 0.5);
  line-height: 46px;
}

.scroll-to-top:focus,
.scroll-to-top:hover {
  color: white;
}

.scroll-to-top:hover {
  background: #343a40;
}

.scroll-to-top i {
  font-weight: 800;
}

.smaller {
  font-size: 0.60rem;
}

.o-hidden {
  overflow: hidden !important;
}

.z-0 {
  z-index: 0;
}

.z-1 {
  z-index: 1;
}

.navbar-nav .form-inline .input-group {
  width: 100%;
}

.navbar-nav .nav-item.active .nav-link {
  color: #ffffff;
}

.navbar-nav .nav-item.dropdown .dropdown-toggle::after {
  width: 1rem;
  text-align: center;
  float: right;
  vertical-align: 0;
  border: 0;
  font-weight: 900;
  content: '\f105';
  font-family: 'Font Awesome 5 Free';
}

.navbar-nav .nav-item.dropdown.show .dropdown-toggle::after {
  content: '\f107';
}

.navbar-nav .nav-item.dropdown.no-arrow .dropdown-toggle::after {
  display: none;
}

.navbar-nav .nav-item .nav-link:focus {
  outline: none;
}

.navbar-nav .nav-item .nav-link .badge {
  position: absolute;
  margin-left: 0.75rem;
  top: 0.3rem;
  font-weight: 400;
  font-size: 0.5rem;
}



.sidebar {
  width: 90px !important;
  background-color: #232a33;
  min-height: calc(100vh - 56px);
}

.sidebar .nav-item:last-child {
  margin-bottom: 1rem;
}

.sidebar .nav-item .nav-link {
  text-align: center;
  padding: 0.75rem 1rem;
  width: 90px;
}

.sidebar .nav-item .nav-link span {
  font-size: 0.65rem;
  display: block;
}

.sidebar .nav-item .dropdown-menu {
  position: absolute !important;
  -webkit-transform: none !important;
  transform: none !important;
  left: calc(90px + 0.5rem) !important;
  margin: 0;
}

.sidebar .nav-item .dropdown-menu.dropup {
  bottom: 0;
  top: auto !important;
}

.sidebar .nav-item.dropdown .dropdown-toggle::after {
  display: none;
}

.sidebar .nav-item .nav-link {
  color: rgba(255, 255, 255, 0.5);
}

.sidebar .nav-item .nav-link:active,
.sidebar .nav-item .nav-link:focus,
.sidebar .nav-item .nav-link:hover {
  color: rgba(255, 255, 255, 0.75);
}

.sidebar.toggled {
  width: 0 !important;
  overflow: hidden;
}

@media (min-width: 768px) {
  .sidebar {
    width: 225px !important;
  }

  .sidebar .nav-item .nav-link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 1rem;
    width: 225px;
  }

  .sidebar .nav-item .nav-link span {
    font-size: 0.9rem;
    display: inline;
  }

  .sidebar .nav-item .dropdown-menu {
    position: static !important;
    margin: 0 1rem;
    top: 0;
  }

  .sidebar .nav-item.dropdown .dropdown-toggle::after {
    display: block;
  }

  .sidebar.toggled {
    overflow: visible;
    width: 90px !important;
  }

  .sidebar.toggled .nav-item:last-child {
    margin-bottom: 1rem;
  }

  .sidebar.toggled .nav-item .nav-link {
    text-align: center;
    padding: 0.75rem 1rem;
    width: 90px;
  }

  .sidebar.toggled .nav-item .nav-link span {
    font-size: 0.65rem;
    display: block;
  }

  .sidebar.toggled .nav-item .dropdown-menu {
    position: absolute !important;
    -webkit-transform: none !important;
    transform: none !important;
    left: calc(90px + 0.5rem) !important;
    margin: 0;
  }

  .sidebar.toggled .nav-item .dropdown-menu.dropup {
    bottom: 0;
    top: auto !important;
  }

  .sidebar.toggled .nav-item.dropdown .dropdown-toggle::after {
    display: none;
  }
}

.sidebar.fixed-top {
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.card-body-icon {
  position: absolute;
  z-index: 0;
  top: -1.25rem;
  right: -1rem;
  opacity: 0.4;
  font-size: 6rem;
  -webkit-transform: rotate(15deg);
  transform: rotate(15deg);
}

@media (min-width: 576px) {
  .card-columns {
    -webkit-column-count: 1;
    column-count: 1;
  }
}

@media (min-width: 768px) {
  .card-columns {
    -webkit-column-count: 2;
    column-count: 2;
  }
}

@media (min-width: 1200px) {
  .card-columns {
    -webkit-column-count: 2;
    column-count: 2;
  }
}

:root {
  --input-padding-x: 0.75rem;
  --input-padding-y: 0.75rem;
}

.card-login {
  max-width: 25rem;
}

.card-register {
  max-width: 40rem;
}



footer.sticky-footer {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  position: absolute;
  right: 0;
  bottom: 0;
  width: calc(100% - 90px);
  height: 80px;
  background-color: #e9ecef;
}

footer.sticky-footer .copyright {
  line-height: 1;
  font-size: 0.8rem;
}

@media (min-width: 768px) {
  footer.sticky-footer {
    width: calc(100% - 225px);
  }
}

body.sidebar-toggled footer.sticky-footer {
  width: 100%;
}

@media (min-width: 768px) {
  body.sidebar-toggled footer.sticky-footer {
    width: calc(100% - 90px);
  }
}


/* ===== Keep Sidebar original (no Aurora on side menu) ===== */
.sidebar {
  background-image: none !important;
  /* Keep the original dark sidebar color used in your inline style */
  background-color: #223344 !important;
}

/* Keep link colors readable on dark sidebar */
.sidebar .nav-link {
  color: rgba(255, 255, 255, .9) !important;
}

.sidebar .nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, .08);
}


/* ===== Topbar Aurora ONLY (keep sidebar original) ===== */
body#page-top>nav.navbar.navbar-dark.bg-info.static-top,
body#page-top>nav.navbar.bg-info.static-top {
  background-image: var(--aurora-grad-top, var(--aurora-grad)) !important;
  background-color: var(--aurora-purple) !important;
  color: #fff !important;
}

/* Ensure text/icons are white on the gradient */
body#page-top>nav.navbar .navbar-brand,
body#page-top>nav.navbar .nav-link,
body#page-top>nav.navbar .nav-link i,
body#page-top>nav.navbar .navbar-text {
  color: #fff !important;
}

/* Search button inside the topbar */
body#page-top>nav.navbar .btn.btn-primary {
  background-image: var(--aurora-grad-top, var(--aurora-grad)) !important;
  border: 0 !important;
  color: #fff !important;
}

body#page-top>nav.navbar .btn.btn-primary:hover {
  filter: brightness(0.95);
}

/* Dropdown menu border soften */
body#page-top>nav.navbar .dropdown-menu {
  border-color: rgba(0, 0, 0, .08);
}


/* ===== Aurora palette ===== */
:root {
  --aurora-teal: #047e91;
  --aurora-blue-deep: #1e3a8a;
  --aurora-grad: linear-gradient(135deg, var(--aurora-teal) 0%, var(--aurora-blue-deep) 50%);
  --avatar-size: 34px;
  /* ขนาดมาตรฐาน (ปรับได้) */
  --avatar-radius: 999px;
  /* วงกลม */
  --avatar-ring: 0px;
  /* เส้นขอบรอบรูป (0 = ไม่มี) เช่น 2px */
  --avatar-ring-color: rgba(0, 0, 0, .08);
}

/* 2) Sidebar: ไล่เฉด Aurora */

/* 3) เปลี่ยน family ของ “info” ให้เป็นโทน Aurora ทั่วเว็บ */
.bg-info {
  background-image: var(--aurora-grad) !important;
  background-color: var(--aurora-purple) !important;
  color: #fff !important;
}

.btn-info {
  background-image: var(--aurora-grad) !important;
  border: 0 !important;
  color: #fff !important;
}

.btn-info:hover {
  filter: brightness(0.55);
}


/* Table head ที่คุณใช้ class="info" (สไตล์แบบ BS3) */
.table thead.info {
  background-image: var(--aurora-grad) !important;
  color: #fff !important;
}

/* Card header ใช้ Aurora เสมอ */
.card-header.bg-primary {
  background-image: var(--aurora-grad-top, var(--aurora-grad)) !important;
  background-color: var(--aurora-purple) !important;
  color: #fff !important;
  border-color: var(--aurora-purple) !important;
}

/* เผื่อบางที่มี .bg-primary อยู่ใน card */
.card .bg-primary {
  background-image: var(--aurora-grad-top, var(--aurora-grad)) !important;
  background-color: var(--aurora-purple) !important;
  color: #fff !important;
}

/* หัวตารางที่ใช้ class="info" (สไตล์เก่า) */
/* แก้กรณีมี <tr bgcolor> ใน thead.info */
.table thead.info tr,
.table thead.info th,
.table thead.info th.sorting,
.table thead.info th.sorting_asc,
.table thead.info th.sorting_desc {

  background-color: var(--aurora-purple) !important;
  color: #fff !important;
}

.table thead.info th {
  border-color: rgba(255, 255, 255, .15) !important;
}

/* ---- Aurora Pagebar: ใหญ่ขึ้น + ไม่โค้งมน ---- */
.aurora-pagebar {
  background: linear-gradient(90deg, #0d88d3 0%, #1f2f91 70%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  /* เพิ่มขนาดแถบ */
  min-height: 76px;
  /* สูงขึ้น */
  border-radius: 0 !important;
  /* ไม่โค้งมน */
}

/* ตัดโค้งมนของ card/header/body ทั้งหมดให้เข้ากัน */
.card,
.card-header,
.card-body {
  border-radius: 0 !important;
}

/* ไอคอน/โลโก้ และชื่อหน้าใหญ่ขึ้นให้สมส่วน */
.aurora-pagebar img,
.aurora-pagebar i.fa {
  height: 36px;
  line-height: 36px;
  font-size: 1.6rem;
}

.aurora-pagebar .pagebar-title,
.aurora-pagebar .h6.pagebar-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
}

/* มือถือ: ยังคงใหญ่แต่ไม่อึดอัด */
@media (max-width:576px) {
  .aurora-pagebar {
    padding: .9rem 1rem;
    min-height: 68px;
  }

  .aurora-pagebar img,
  .aurora-pagebar i.fa {
    height: 32px;
    font-size: 1.35rem;
  }

  .aurora-pagebar .btn {
    font-size: 1.25rem;
    padding: .55rem 1rem;
  }
}

/* หัวข้อในแถบ Aurora */
.aurora-pagebar .pagebar-title {
  font-family: 'Sarabun', 'TH Sarabun New', sans-serif;
  font-weight: 800;
  /* 700–800 ได้ */
  font-size: 1.25rem;
  /* ปรับตามที่ต้องการ */
}

.aurora-pagebar {
  background: linear-gradient(90deg, #0d88d3 0%, #1f2f91 70%);
  color: #fff;
  padding: 1rem 1.25rem;
  min-height: 76px;
  border-radius: 0;
}

.pagebar-title {
  font-weight: 800;
  font-size: 1.35rem;
  color: #fff;
}

/* โซนแบบมินิมอล */
.zone {
  border: 1px solid #ebedf2;
  background: #fff;
  margin-bottom: .85rem;
}

.zone-compact .zone-body {
  padding: .75rem .85rem;
}

.zone-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #f7f9fc;
  color: #1f2630;
  padding: .55rem .85rem;
  font-weight: 700;
  border-bottom: 1px solid #ebedf2;
}

.zone-head i {
  color: #1f2f91;
}



/* ปุ่ม Reset ทรง pill เล็กน้อย */
.btn-pill {
  border-radius: 999px;
}

/* อวตาร: ขนาดคงที่ ไม่ยืด */
.avatar-frame {
  width: 45px;
  height: 45px;
  border: 1px solid #e6e8ee;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 992px) {
  .avatar-frame {
    width: 180px;
    height: 180px;
  }
}

/* ปุ่มเลือกไฟล์ (คลิกได้ทั้งปุ่ม) */
.btn-file {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-file input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* utilities (สำหรับธีมที่ไม่มี) */
.d-flex {
  display: flex;
}

.flex-fill {
  flex: 1 1 auto;
}

.align-items-stretch {
  align-items: stretch;
}

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

.me-2 {
  margin-right: .5rem;
}

.ms-lg-auto {
  margin-left: auto;
}

.order-lg-2 {
  order: 2;
}

.order-lg-1 {
  order: 1;
}

@media (max-width:991.98px) {

  .order-lg-2,
  .order-lg-1 {
    order: initial;
  }
}



/* โฟกัสแบบเรียบ (ถ้าอยากเห็นนิดหน่อยให้เป็นขีดล่าง) */
.ig-bare-control:focus {
  box-shadow: none !important;
  border-bottom: 2px solid #0d88d3;
  /* ถ้าอยาก “ไม่มีเส้นเลย” ให้ลบบรรทัดนี้ */
}

/* โหมดแน่น: ลดระยะบนล่าง ซ้ายขวา */
.zone-tight .zone-body {
  padding: .45rem .55rem;
}

/* ในกล่อง */
.zone-tight .lbl {
  margin-bottom: .2rem;
}

/* ระยะใต้ label */

.zone-tight .tight-row>[class*="col-"] {
  /* ลด gutter ของคอลัมน์ */
  padding-left: 6px;
  padding-right: 6px;
}

.zone-tight .tight-row {
  margin-left: -6px;
  margin-right: -6px;
}

.zone-tight .form-control {
  /* ลดขนาดช่อง */
  height: 30px;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1.2;
}


/* ระยะระหว่างแถว */
.zone-tight .mb-2 {
  margin-bottom: .35rem !important;
}

.zone-tight .mb-3 {
  margin-bottom: .55rem !important;
}

/* ================================
   Aurora polish for 2 modals only
   (Bootstrap 3 / AdminLTE compatible)
   ================================ */

/* 0) พื้นฐานกล่อง + เงา + มุมโค้ง */
#editModal .modal-content,
#modal_reset_member_pass .modal-content {
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(16, 24, 40, .22), 0 2px 6px rgba(16, 24, 40, .18);
}

/* 1) ส่วนหัว Aurora + ตัวอักษรขาว */
#editModal .modal-header,
#modal_reset_member_pass .modal-header {
  background: linear-gradient(90deg, #5c6cff, #a855f7, #f472b6);
  color: #fff;
  border-bottom: 0;
  padding: 12px 16px;
}

#editModal .modal-title,
#modal_reset_member_pass .modal-title {
  color: #fff;
  font-weight: 600;
}

#editModal .close,
#modal_reset_member_pass .close {
  color: #fff;
  text-shadow: none;
  opacity: .9;
}

#editModal .close:hover,
#modal_reset_member_pass .close:hover {
  opacity: 1;
}

/* 2) เนื้อหา: ระยะหายใจ + ตัวพิมพ์อ่านง่าย */
#editModal .modal-body,
#modal_reset_member_pass .modal-body {
  padding: 16px 18px 10px;
}

#editModal .modal-body .lead,
#modal_reset_member_pass .modal-body .lead {
  font-size: 16px;
  color: #475467;
  margin-bottom: 10px;
}

/* 3) ปุ่มท้ายโมดัล + ระยะ */
#editModal .modal-footer,
#modal_reset_member_pass .modal-footer {
  border-top: 0;
  padding: 12px 16px 16px;

}

/* ให้กับทุกเบราว์เซอร์ก่อน */
.modal select,
.modal select option {
  font-family: 'Sarabun', 'Tahoma', 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
}

/* บังคับเฉพาะ Firefox เพิ่ม */
@-moz-document url-prefix() {

  .modal select,
  .modal select option {
    font-family: 'Sarabun', 'Tahoma', 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
  }
}

/* 4) ปุ่มหลัก (OK) โทน Aurora */
#btnSaveEdit,
#btn_reset_pass {
  background: linear-gradient(90deg, #5c6cff, #a855f7);
  border: 0;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
}

#btnSaveEdit:hover,
#btn_reset_pass:hover {
  background: linear-gradient(90deg, #5360ff, #984cf3);
}

#btnSaveEdit:active,
#btn_reset_pass:active {
  background: linear-gradient(90deg, #4753ff, #8a45e6);
}

#btnSaveEdit[disabled],
#btn_reset_pass[disabled] {
  opacity: .55;
  cursor: not-allowed;
}

/* 5) ปุ่ม Close แบบสว่าง (กลมมน) */
#editModal .btn.btn-default[data-dismiss="modal"],
#modal_reset_member_pass .btn.btn-default[data-dismiss="modal"] {
  background: #fff;
  color: #344054;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
}

#editModal .btn.btn-default[data-dismiss="modal"]:hover,
#modal_reset_member_pass .btn.btn-default[data-dismiss="modal"]:hover {
  background: #f9fafb;
}

/* 6) อินพุต: สูงขึ้นเล็กน้อย + โฟกัสสีม่วง */
#editModal .form-control,
#modal_reset_member_pass .form-control {
  height: 38px;
  border-radius: 8px;
  box-shadow: none;
  border: 1px solid #e4e7ec;
}

#editModal .form-control:focus,
#modal_reset_member_pass .form-control:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, .18);
}

/* 7) Badge/Label ในโมดัลให้ดูนุ่มขึ้น */
#editModal .badge,
#modal_reset_member_pass .badge {
  background: #eef2ff;
  color: #344054;
  font-weight: 600;
  border-radius: 6px;
  padding: 4px 8px;
}

#editModal .badge.badge-warning,
#modal_reset_member_pass .badge.badge-warning {
  background: #fff7ed;
  /* ส้มอ่อน */
  color: #9a3412;
}



/* 9) ข้อความช่วย/ error (help-block) ให้คมชัด */
#editModal .help-block.text-danger,
#modal_reset_member_pass .help-block.text-danger {
  color: #e11d48;
  /* แดงชมพูชัด */
  margin-top: 6px;
}

/* 10) แถบ progress (เฉพาะใน reset modal) */
#modal_reset_member_pass #reset_progress .progress {
  height: 6px;
  background: #eef2ff;
  border-radius: 999px;
  margin: 8px 0 0;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, .06);
}

#modal_reset_member_pass #reset_progress .progress-bar {
  background: linear-gradient(90deg, #5c6cff, #a855f7);
  transition: width .25s ease;
  border-radius: 999px;
}

/* 11) Backdrop ให้มืดนุ่มตา (เฉพาะตอนเปิดหนึ่งในสองโมดัลนี้) */
body.modal-open .modal-backdrop.in {
  background: rgba(17, 24, 39, .55);
  /* ดำโปร่ง */
  /* เบลอบางเบา (ถ้าเบราว์เซอร์รองรับ) */
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* 12) ความกว้าง dialog ปรับเล็กน้อยบนจอใหญ่ */
@media (min-width: 992px) {

  #editModal .modal-dialog,
  #modal_reset_member_pass .modal-dialog {
    width: 540px;
    /* ไม่แตะโครงเดิม แค่ดูลงตัวขึ้น */
    margin-top: 40px;
  }
}

/* =========================================
   Confirm Delete Modal (scoped to #confirmDelModal)
   ใช้ได้ทุกหน้า / ไม่แตะโค้ด HTML/JS เดิม
   Bootstrap 3 / AdminLTE compatible
   ========================================= */

/* กล่อง + เงา + มุมโค้ง */
#confirmDelModal .modal-content {
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(16, 24, 40, .22), 0 2px 6px rgba(16, 24, 40, .18);
}

/* ส่วนหัวโทนอันตราย (แดงส้ม) + ตัวอักษรขาว */
#confirmDelModal .modal-header {
  background: linear-gradient(90deg, #ef4444, #f97316, #f59e0b);
  color: #fff;
  border-bottom: 0;
  padding: 12px 16px;
}

#confirmDelModal .modal-title {
  color: #fff;
  font-weight: 600;
}

#confirmDelModal .close {
  color: #fff;
  text-shadow: none;
  opacity: .9;
}

#confirmDelModal .close:hover {
  opacity: 1;
}

/* เนื้อหา: ระยะหายใจ + จัดข้อความเตือนให้อ่านชัด */
#confirmDelModal .modal-body {
  padding: 16px 18px 12px;
}

#confirmDelModal .modal-body h4 {
  font-size: 14px;
  line-height: 1.5;
  color: #1f2937;
  /* เทาเข้มอ่านง่าย */
  margin: 0 0 10px;
  text-align: center;
}

/* ไฮไลต์หมายเลขแถวที่ถูกลบ (#xrow) */
#confirmDelModal #xrow {
  display: inline-block;
  padding: 2px 8px;
  margin: 0 4px;
  background: #fee2e2;
  /* แดงอ่อน */
  color: #991b1b;
  border-radius: 999px;
  font-weight: 700;
}

/* กล่องรายละเอียดสิ่งที่จะลบ (ถ้ามี) */
#confirmDelModal #div_del_detail {
  background: #f8fafc;
  border: 1px dashed #e5e7eb;
  color: #374151;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 12px;
  max-height: 180px;
  overflow: auto;
}

/* ฟอร์มอินพุต: มนขึ้นเล็กน้อย + โฟกัสสีแดง */
#confirmDelModal .form-control {
  height: 38px;
  border-radius: 8px;
  box-shadow: none;
  border: 1px solid #e4e7ec;
}

#confirmDelModal .form-control:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, .18);
}

/* ป้าย/แบดจ์ "ระบุเหตุผล" ให้ดูนุ่ม */
#confirmDelModal .badge {
  background: #fff7ed;
  /* ส้มอ่อน */
  color: #9a3412;
  font-weight: 600;
  border-radius: 6px;
  padding: 4px 8px;
}


/* ส่วนท้ายโมดัล */
#confirmDelModal .modal-footer {
  border-top: 0;
  padding: 12px 16px 16px;
}

/* ปุ่ม Delete (อันตราย) แบบไล่เฉดแดง */
#confirmDelModal #btn_confirm_delete {
  background: linear-gradient(90deg, #ef4444, #f97316);
  border: 0;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  color: #fff;
  transition: filter .15s ease, transform .02s ease;
}

#confirmDelModal #btn_confirm_delete:hover {
  filter: brightness(.95);
}

#confirmDelModal #btn_confirm_delete:active {
  transform: translateY(1px);
}

/* ปุ่ม Close ให้ดูสว่างเรียบ */
#confirmDelModal .btn.btn-default[data-dismiss="modal"] {
  background: #fff;
  color: #374151;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
}

#confirmDelModal .btn.btn-default[data-dismiss="modal"]:hover {
  background: #f9fafb;
}

/* ความกว้าง dialog บนจอใหญ่ให้ดูพอดี */
@media (min-width: 992px) {
  #confirmDelModal .modal-dialog {
    width: 520px;
    margin-top: 40px;
  }
}

/* ตัวเลือกเสริม: เอฟเฟ็กต์สั่นเบา ๆ เวลามีการเตือน (แค่เพิ่มคลาส .shake ให้ .modal-content ผ่าน JS ก็ได้)
   ไม่กระทบตอนปกติ เพราะไม่ได้ผูก JS ในไฟล์นี้ */
@keyframes shakeX {

  10%,
  90% {
    transform: translateX(-1px)
  }

  20%,
  80% {
    transform: translateX(2px)
  }

  30%,
  50%,
  70% {
    transform: translateX(-4px)
  }

  40%,
  60% {
    transform: translateX(4px)
  }
}

#confirmDelModal .modal-content.shake {
  animation: shakeX .35s ease;
}

/* ===== Compact Sidebar (ระยะเมนูชิดขึ้น) ===== */

/* โหมดแคบ (กว้าง 90px) และทั่วไป */
.sidebar .nav-item .nav-link {
  padding: .55rem .75rem !important;
  /* เดิม .75rem 1rem */
  line-height: 1.2;
}

.sidebar .nav-item .nav-link i {
  font-size: .95rem;
  /* ไอคอนเล็กลงนิด */
  margin-right: .5rem;
  /* เผื่อกรณีเมนูเต็ม (≥768px) */
}

.sidebar .nav-item .nav-link span {
  font-size: .65rem !important;
  /* เดิม .65rem */
}

.sidebar .nav-item:last-child {
  margin-bottom: .5rem;
  /* เดิม 1rem ลดช่องว่างท้ายเมนู */
}

/* โหมดจอ ≥768px (เมนูเปิดเต็ม 225px) */
@media (min-width: 768px) {
  .sidebar .nav-item .nav-link {
    padding: .70rem .85rem !important;
    /* เดิม 1rem */
  }

  .sidebar .nav-item .nav-link span {
    font-size: .85rem !important;
    /* เดิม .9rem */
  }
}

/* เมื่อ sidebar ถูก toggle (กลับไปโหมดแคบ) */
@media (min-width: 768px) {
  .sidebar.toggled .nav-item .nav-link {
    padding: .55rem .75rem !important;
    /* เดิม .75rem 1rem */
  }

  .sidebar.toggled .nav-item .nav-link span {
    font-size: .65rem !important;
    /* เดิม .65rem */
  }
}

/* ===== Sidebar dropdown menu use main color + white text ===== */
:root {
  /* ปรับค่านี้ให้ตรงกับสีหลักของ sidebar คุณ */
  --sidebar-main-bg: #223344;
  --sidebar-hover-bg: rgba(255, 255, 255, .10);
  --sidebar-active-bg: rgba(255, 255, 255, .18);
}

/* กล่องเมนูย่อย (ภายใน .sidebar) */
.sidebar .dropdown-menu {
  background: var(--sidebar-main-bg) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* หัวข้อและเส้นคั่นในเมนูย่อย */
.sidebar .dropdown-menu .dropdown-header {
  color: rgba(255, 255, 255, .9) !important;
  font-weight: 600;
}

.sidebar .dropdown-menu .dropdown-divider {
  border-top-color: rgba(255, 255, 255, .15) !important;
}

/* รายการลิงก์ในเมนูย่อย */
.sidebar .dropdown-menu .dropdown-item {
  color: #fff !important;
  background: transparent !important;
}

.sidebar .dropdown-menu .dropdown-item:hover,
.sidebar .dropdown-menu .dropdown-item:focus {
  color: #fff !important;
  background: var(--sidebar-hover-bg) !important;
}

.sidebar .dropdown-menu .dropdown-item.active,
.sidebar .dropdown-menu .dropdown-item:active {
  color: #fff !important;
  background: var(--sidebar-active-bg) !important;
}

/* ไอคอนภายในเมนูย่อย (ถ้ามี) ให้เป็นสีขาวด้วย */
.sidebar .dropdown-menu .dropdown-item i {
  color: #fff !important;
  opacity: .95;
}

/* ==== FORCE: ทำให้ขนาดตัวอักษรเมนูหลัก/เมนูย่อย ‘เท่ากัน’ ทุกโหมด ==== */
.sidebar {
  --menu-fs: .95rem;
}

/* ปรับเลขเดียวทั้งชุดได้ที่นี่ */

.sidebar .nav-item>.nav-link,
.sidebar .nav-item>.nav-link span,
.sidebar .dropdown-menu .dropdown-item,
.sidebar.toggled .nav-item>.nav-link,
.sidebar.toggled .nav-item>.nav-link span {
  font-size: var(--menu-fs) !important;
  line-height: 1.25;
  font-weight: 600;
  /* เอาออกได้ถ้าไม่อยากหนา */
}

/* ให้ .dropdown-item ใช้ขนาดเดียวกับเมนูหลักเสมอ */
.sidebar .dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem !important;
  /* ↑↑ เพิ่มค่านี้เพื่อให้แถวสูงขึ้น */
  line-height: 1.25;
  /* ปรับหรือคงเดิมก็ได้ */
}

/* ไอคอนให้กว้างคงที่และบาลานซ์กับฟอนต์ */
.sidebar .nav-link i,
.sidebar .dropdown-menu .dropdown-item i {
  width: 1.1rem;
  text-align: center;
  font-size: var(--menu-fs);
  line-height: 1;
}

/* เคสที่กฎเก่าลดขนาด span ไว้ใน media query — ทับอีกชั้น */
@media (min-width:768px) {

  .sidebar .nav-item .nav-link span,
  .sidebar.toggled .nav-item .nav-link span {
    font-size: var(--menu-fs) !important;
  }
}

/* ลด caret ของ dropdown ให้สมส่วน (ไม่เกี่ยวกับขนาดตัวอักษร แต่ช่วยจัดภาพรวม) */
.sidebar .nav-item .dropdown-toggle::after {
  transform: scale(.9);
}

/* =====================  Global Table Style  ===================== */
/* ใช้กับตาราง .table/.table-bordered/.table-striped ทั้งระบบ */

.table,
.table-bordered,
.table-striped {
  border-collapse: collapse;
}

/* ตัดเส้นกรอบแนวตั้งออก เหลือเฉพาะเส้นแนวนอน */
.table th,
.table td {
  border-style: solid;
  /* top | right | bottom | left */
  border-width: 0 0 1px 0;
  border-color: #e5e5e5;
}

/* ตัดเส้นซ้าย-ขวา ของ .table-bordered ทิ้ง */
.table-bordered {
  border-left: 0;
  border-right: 0;
}

/* หัวตาราง – ใช้โทนฟ้าแบบตัวอย่าง และจัดกึ่งกลาง */
.table thead {
  background: linear-gradient(90deg, #007bff, #003d99);
  color: #ffffff;
  text-align: center;
  vertical-align: middle;
  border-top: 0;
  border-bottom: 2px solid #002a6f;
  /* ขอบล่างหัวตารางให้ชัดหน่อย */
  white-space: nowrap;
}

/* เนื้อหาตาราง – จัดกึ่งกลางทุกช่อง */
.table tbody td {
  text-align: center;
  vertical-align: middle;
}

/* คอลัมน์ลำดับให้แคบหน่อย (ถ้าไม่ต้องการ ลบบล็อกนี้ทิ้งได้) */
.table thead th:first-child,
.table tbody td:first-child {
  width: 60px;
}

/* ปุ่มจัดการ (แก้ไข/ลบ) ให้จัดกึ่งกลางในเซลล์ */
.table td .btn {
  margin: 0 2px;
}

/* ถ้าใช้ไอคอน/checkbox เดี่ยว ๆ ให้มันอยู่กลางเซลล์สวย ๆ */
.table td i,
.table td .fa,
.table td input[type="checkbox"] {
  vertical-align: middle;
}

/* ========== 1) Material Input ========== */
.material-input {
  background-color: transparent;
  border: none;
  border-bottom: 1px solid #ccc;
  /* เส้นฐานจาง ๆ */
  border-radius: 0;
  box-shadow: none;
  padding: 6px 0;
  font-size: 15px;
  width: 100%;
  transition: border-color .2s ease;

  /* เส้นสีเวลาฟอกัส (เริ่มจากจุดตรงกลางความกว้าง = 0) */
  background-image: linear-gradient(#007bff, #007bff);
  background-repeat: no-repeat;
  background-position: center bottom;
  /* จุดเริ่มกลางช่อง */
  background-size: 0 2px;
  /* เริ่ม 0px แล้วค่อยขยาย */
}

.material-input:focus {
  outline: none;
  border-bottom-color: transparent;
  /* ซ่อนเส้นเทาเดิมเวลา focus */
  background-size: 100% 2px;
  /* ขยายเส้นจากกลางออกจนเต็ม */
  transition: background-size .25s ease-out, border-color .2s ease;
}

/* label จาง ๆ เผื่อใช้ที่อื่น */
.custom-label {
  font-size: 10px;
  color: #6c757d;
  margin-bottom: 0;
}

/* ========== 2) official view layout ========== */

/* ตัวที่คุณใช้จริง: <div class="official-view-row row"> */
div.official-view-row.row {
  padding: .5rem 0;
  border-bottom: none !important;
  /* ❌ เอาเส้นล่างของ row ออกให้ชัวร์ */
  margin-bottom: .1rem;
  /* เว้นแถวเล็กน้อย */
}

/* กัน bg-light ไม่ให้มีผล */
div.official-view-row.row.bg-light {
  background-color: transparent !important;
}

/* ระยะของคอลัมน์ในแต่ละแถว */
div.official-view-row.row .col-md-3 {
  margin-bottom: .1rem;
}

/* label ด้านบนแต่ละช่อง */
.view-label {
  font-size: 13px;
  /* ขยายตามที่ขอ */
  font-weight: 500;
  color: #6c757d;
  margin-bottom: 1px;
  line-height: 1.2;
}

/* ถ้าใช้ wrapper ชื่อ view-value (เช่นในส่วนอื่น) */
.view-value {
  line-height: 1.0;
}

/* ถ้าคุณใช้ input อยู่ใน .view-value ด้วย ก็จะโดนตัวนี้ */
.view-value .material-input {
  font-size: 14px;
  padding: 2px 0;
  border-bottom: 1px solid #dee2e6;
}

.modal-header-actions {
  display: flex;
  align-items: center;
}

.btn-header-save {
  background: transparent;
  border: none;
  color: white;
  opacity: 0.8;
  font-size: 1.25rem;
  /* ขนาดไอคอน */
  margin-right: 15px;
  /* ระยะห่างจากปุ่มปิด */
  cursor: pointer;
  transition: opacity 0.2s;
  padding: 0;
}

.btn-header-save:hover {
  opacity: 1;
  color: #fff;
}

.modal-header .close {
  color: white;
  opacity: 0.8;
  padding: 0;
  margin: 0;
}

.modal-header .close:hover {
  opacity: 1;
}

.btn-modern {
  border: 0 !important;
  border-radius: 999px !important;
  padding: .42rem .9rem !important;
  font-weight: 600;
  box-shadow: none !important;
  transition: transform .12s ease, filter .15s ease, background-color .15s ease;
}

.btn-modern:hover {
  transform: translateY(-1px);
  filter: brightness(.98);
}

.btn-modern:active {
  transform: translateY(0);
  filter: brightness(.95);
}

.btn-modern:focus {
  box-shadow: 0 0 0 .2rem rgba(0, 0, 0, .10) !important;
  outline: none !important;
}

/* Soft color variants (เข้ากับ Bootstrap โทนเดิม) */
.btn-modern-primary {
  background: rgba(13, 110, 253, .14) !important;
  color: #0d6efd !important;
}

.btn-modern-warning {
  background: rgba(255, 193, 7, .20) !important;
  color: #8a6d00 !important;
}

.btn-modern-danger {
  background: rgba(220, 53, 69, .14) !important;
  color: #dc3545 !important;
}

.btn-modern-muted {
  background: rgba(108, 117, 125, .14) !important;
  color: #495057 !important;
}

.btn-modern-info {
  background: rgba(13, 202, 240, .14) !important;
  color: #0c96b1 !important;
}

/* Icon spacing */
.btn-modern i {
  margin-right: .4rem;
}

/* Icon-only round button (ถ้าต้องการแบบมินิมอล) */
.btn-modern-icon {
  width: 36px;
  height: 36px;
  padding: 0 !important;
  border-radius: 999px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-modern-icon i {
  margin-right: 0;
}

.table .custom-switch {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-left: 0;
  margin: 0;
}

/* 1. ปรับขนาดปุ่มให้ "เล็กกะทัดรัด" (Compact) */
.custom-switch .custom-control-label {
  padding-left: 0;
  width: 2.2rem;
  /* กว้าง */
  height: 1.2rem;
  /* สูง */
  cursor: pointer;
  position: relative;
}

/* 2. รางสวิตช์ (Background) - ปิดเป็นสีแดง */
.custom-switch .custom-control-label::before {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #dc3545;
  /* สีแดง */
  border: none;
  border-radius: 2rem;
  transition: background-color 0.15s ease-in-out;
  content: "";
  width: 100%;
  height: 100%;
}

/* 3. ลูกกลิ้ง (Knob) */
.custom-switch .custom-control-label::after {
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 0.9rem;
  /* ขนาดลูกกลิ้งเล็ก */
  height: 0.9rem;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease-in-out;
  content: "";
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* 4. สถานะเปิด (ON) - รางสีเขียว */
.custom-switch .custom-control-input:checked~.custom-control-label::before {
  background-color: #28a745 !important;
  /* สีเขียว */
}

/* 5. เลื่อนลูกกลิ้งไปขวา */
.custom-switch .custom-control-input:checked~.custom-control-label::after {
  transform: translateX(1.0rem);
}

/* คอลัมน์โภชนาการ */
.td-bmi {
  min-width: 180px;
}

.bmi-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bmi-wrap .badge {
  font-size: 11px;
  padding: 4px 8px;
}

/* bar */
.bmi-bar {
  position: relative;
  height: 14px;
  width: 140px;
  border-radius: 14px;
  overflow: hidden;
  background: #eee;
  margin-top: 4px;
}

.bmi-bar .seg {
  display: block;
  height: 14px;
  float: left;
}

/* สัดส่วนช่วง BMI บนกราฟ 12–40 (มาตรฐานตามที่เรา map pos) */
.bmi-bar .s1 {
  width: 23.5%;
  background: #f7c6c6;
}

/* ผอม */
.bmi-bar .s2 {
  width: 15.9%;
  background: #bfe7bf;
}

/* สมส่วน */
.bmi-bar .s3 {
  width: 6.9%;
  background: #ffe7a3;
}

/* ท้วม */
.bmi-bar .s4 {
  width: 17.7%;
  background: #f5a3a3;
}

/* อ้วน */
.bmi-bar .s5 {
  width: 36.0%;
  background: #d88cff;
}

/* ===== Mobile: ทำ Sidebar ให้เล็กลง + ซ่อนข้อความ ===== */
@media (max-width: 576px) {

  /* sidebar แคบลงกว่าเดิม */
  .sidebar {
    width: 60px !important;
  }

  /* ปรับ content ให้ไม่ถูก sidebar ทับ */
  body.fixed-nav #content-wrapper {
    padding-left: 60px !important;
  }

  /* ลิงก์เมนูให้กระชับ */
  .sidebar .nav-item .nav-link {
    width: 60px !important;
    padding: .65rem .35rem !important;
    text-align: center !important;
  }

  /* ซ่อนข้อความเมนูทั้งหมด (ทั้ง <span> และ .nav-link-text) */
  .sidebar .nav-item .nav-link span,
  .sidebar .nav-item .nav-link .nav-link-text {
    display: none !important;
  }

  /* ลดขนาดไอคอนให้พอดี */
  .sidebar .nav-item .nav-link i {
    font-size: 1.1rem !important;
    margin: 0 !important;
  }

  /* dropdown menu ให้ชิดกับ sidebar ใหม่ */
  .sidebar .nav-item .dropdown-menu {
    left: calc(60px + 0.5rem) !important;
  }
}

/* ==========================================================================
   GLOBAL GLASSMORPHISM STYLE (เปลี่ยน Modal ทั้งระบบให้เป็นกระจกฝ้า)
   วางโค้ดนี้ไว้ล่างสุดของไฟล์ CSS เพื่อให้มันทับค่าเดิมทั้งหมด
   ========================================================================== */

/* 1. ฉากหลังเบลอ (Backdrop) - พระเอกของงาน */
.modal-backdrop.show {
  opacity: 0.7 !important;
  /* ความเข้มของพื้นหลัง */
  -webkit-backdrop-filter: blur(8px) !important;
  /* สั่งเบลอสำหรับ Safari */
  backdrop-filter: blur(8px) !important;
  /* สั่งเบลอสำหรับ Chrome/Edge */
  background-color: rgba(20, 30, 50, 0.6) !important;
  /* สีพื้นหลังโทนน้ำเงินเข้มโปร่งแสง */
}

/* 2. ตัวกล่อง Modal (ตัดขอบ, โปร่งแสง, มีเงาฟุ้ง) */
.modal-content {
  border: none !important;
  border-radius: 20px !important;
  /* มุมโค้งมน */
  background: rgba(255, 255, 255, 0.95) !important;
  /* พื้นขาวโปร่งแสง 95% */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  /* เงาฟุ้งๆ ด้านล่าง */
  overflow: hidden;
  /* ซ่อนส่วนเกิน */
  position: relative;
}

/* 3. แถบสีรุ้งด้านบน (Signature ความหรู) */
.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  /* เปลี่ยนคู่สีตรงนี้ได้ตามธีมโรงเรียน */
  background: linear-gradient(90deg, #4e73df, #36b9cc, #f6c23e);
  z-index: 1;
}

/* 4. จัด Header ใหม่ (เอาเส้นขอบออก, จัดกลาง) */
.modal-header {
  border-bottom: none !important;
  padding: 25px 25px 5px 25px !important;
  /* เว้นระยะให้สวยงาม */
  display: block !important;
  text-align: center;
  background: transparent !important;
  /* ให้พื้นหลังใส เพื่อโชว์ความโปร่งของ modal-content */
}

/* 5. ชื่อหัวข้อ (Title) - บังคับฟอนต์และสี */
.modal-title {
  font-family: 'Sarabun', sans-serif !important;
  font-weight: 800 !important;
  font-size: 1.6rem !important;
  margin-top: 10px;
  margin-bottom: 0;
  /* ไล่เฉดสีตัวอักษร */
  background: -webkit-linear-gradient(45deg, #1e3c72, #2a5298);
  -webkit-text-fill-color: transparent;
  color: #1e3c72;
  /* Fallback color */
}

/* 6. ปุ่มปิด (X) - เปลี่ยนเป็นวงกลมลอยๆ */
.modal-header .close {
  position: absolute;
  right: 20px;
  top: 20px;
  background: #f1f3f4;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  padding: 0 !important;
  margin: 0 !important;
  text-shadow: none;
  color: #555;
  /* สีไอคอน X ปกติ */
  z-index: 10;
}

.modal-header .close:hover {
  background: #ff6b6b;
  /* สีพื้นหลังตอนเอาเมาส์ชี้ (แดงอ่อน) */
  color: white;
  /* สีไอคอนตอนชี้ */
  transform: rotate(90deg);
  /* หมุนปุ่ม */
}

/* 7. ปรับเนื้อหา (Body) ให้มีระยะหายใจ */
.modal-body {
  padding: 10px 30px 30px 30px !important;
  font-size: 1.05rem;
  color: #444;
}

/* 8. ปรับส่วนท้าย (Footer) */
.modal-footer {
  border-top: none !important;
  padding: 0 30px 30px 30px !important;
  justify-content: center;
  /* จัดปุ่มให้อยู่กึ่งกลาง (ถ้าชอบชิดขวาลบตรงนี้ออก) */
  background: transparent !important;
}

/* 9. ปรับปุ่มใน Modal ให้ดูเข้าชุดกัน */
.modal-footer .btn {
  border-radius: 50px;
  /* ปุ่มมน */
  padding: 8px 25px;
  font-weight: 600;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
}

.modal-footer .btn-secondary,
.modal-footer .btn-default {
  background-color: #e2e6ea;
  border-color: #e2e6ea;
  color: #555;
}

/* มาตรฐานปุ่มดำเนินการ (MIS Action Button) */
.btn-mis-action {
  border-radius: 10px !important;
  /* ความมนที่ดูทันสมัย */
  padding: 8px 16px !important;
  /* ระยะห่างที่พอดีมือ */
  font-weight: 600 !important;
  /* ตัวหนาให้อ่านง่าย */
  white-space: nowrap !important;
  /* ป้องกันตัวหนังสือตัดบรรทัด */
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  /* ระยะห่างระหว่างไอคอนกับตัวหนังสือ */
  transition: all 0.2s ease;
}

.btn-mis-action:hover:not([disabled]) {
  transform: translateY(-1px);
  /* เอฟเฟกต์ลอยตัวเมื่อชี้ */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

/* ปรับไอคอนในปุ่มให้ขนาดพอดี */
.btn-mis-action i {
  font-size: 0.9rem;
}