.not-set {
  color: var(--bs-secondary-color);
  font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after,
a.desc:after {
  content: "";
  left: 3px;
  display: inline-block;
  width: 0;
  height: 0;
  border: solid 5px transparent;
  margin: 4px 4px 2px 4px;
  background: transparent;
}

a.asc:after {
  border-bottom: solid 7px var(--bs-body-color);
  border-top-width: 0;
}

a.desc:after {
  border-top: solid 7px var(--bs-body-color);
  border-bottom-width: 0;
}

.grid-view th {
  text-align: center;
  white-space: nowrap;
}

.hint-block {
  display: block;
  margin-top: 0.25rem;
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
}

.error-summary {
  font-size: 0.9rem;
  color: var(--bs-danger-text);
  background-color: var(--bs-danger-bg-subtle);
  border: 1px solid var(--bs-danger-border-subtle);
  border-left: 4px solid var(--bs-danger);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
}

/* align the logout "link" (button in form) of the navbar */

@media (max-width: 767px) {
  .nav li > form > button.logout {
    display: block;
    text-align: left;
    width: 100%;
    padding: 10px 0;
  }
}

.nav li > form > button.logout {
  border: 0;
  background: transparent;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  color: var(--bs-nav-link-color);
}

.nav li > form > button.logout:hover,
.nav li > form > button.logout:focus,
.nav li > form > button.logout:active {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--bs-nav-link-hover-color);
  text-decoration: none;
}

.nav > li > form > button.logout:focus-visible {
  outline: none;
}

.form-group {
  margin-bottom: 1rem;
}

/*********************************************************************************/

:root {
  --bs-font-sans-serif:
    "Sarabun", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --header-height: 60px;
  --footer-height: 60px;
}

:root[data-bs-theme="light"] {
  /* พื้นหลังหลัก (แทนขาวล้วน) */
  --bs-body-bg: #f4f7f4;

  /* สีตัวอักษร */
  --bs-body-color: #1f241f;

  /* พื้นผิว */
  --bs-secondary-bg: #ffffff; /* card / table */
  --bs-tertiary-bg: #eef3ec; /* header / section */

  /* เส้นขอบ */
  --bs-border-color: #d8ded4;
}

:root[data-bs-theme="light"] .table {
  --bs-table-bg: #ffffff;
  --bs-table-striped-bg: #f7faf7;
  --bs-table-hover-bg: #eef5ee;
}

:root[data-bs-theme="light"] .table thead {
  background-color: var(--bs-success);
  color: #ffffff;
}

:root[data-bs-theme="light"] .table thead th {
  background-color: var(--bs-success);
  color: #ffffff;
}

:root[data-bs-theme="light"] .card-header {
  background-color: var(--bs-tertiary-bg);
}

#map {
  min-height: 300px;
}

.required > label::after {
  content: " *";
  color: var(--bs-danger);
  font-weight: bold;
}

/************************************** Table style *******************************************/
.table th a {
  color: inherit;
  text-decoration: none;
}

.table th a:hover {
  color: inherit;
  text-decoration: none;
}

/*********************************************************************************/

.app-header {
  z-index: 1030;
  background-color: rgba(var(--bs-body-bg-rgb), 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.app-main {
  min-height: calc(100dvh - 120px);
}

.app-footer {
  background-color: rgba(var(--bs-body-bg-rgb), 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 0.875rem;
  border-top: 1px solid var(--bs-border-color);
}

* {
  transition: background-color 0.2s ease;
}

.theme-toggle.is-loading i {
  visibility: hidden;
}

/* =========================================================
   Print
   ========================================================= */

@media print {
  html,
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  * {
    color: #000000 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }
  table,
  table th,
  table td,
  .table,
  .table th,
  .table td,
  .table-bordered,
  .table-bordered th,
  .table-bordered td,
  .card {
    border: 1px solid #000000 !important;
  }
  table th,
  table td {
    color: #000000 !important;
    background: #ffffff !important;
  }
  thead,
  thead th,
  .table-success,
  .table-light {
    color: #000000 !important;
    background: #ffffff !important;
  }
  thead {
    display: table-header-group;
  }
  tr,
  img {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  body {
    font-size: 14px;
  }
  a {
    text-decoration: none !important;
  }
  .breadcrumb,
  .btn,
  .navbar,
  .pagination,
  .summary,
  .filters,
  .no-print {
    display: none !important;
  }
  /************************************** keep table in one page *******************************************/
  .print-keep-together {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-keep-together table {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .print-keep-together tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

.control-label {
  margin-bottom: 2rem;
}

/************************************** Tom Select *******************************************/
/* ตัวหนังสือหลัก */
/* Tom Select: sync text color with Bootstrap theme */
.ts-dropdown,
.ts-control,
.ts-control input {
  color: var(--bs-body-color);
  font-family: inherit;
  font-size: inherit;
  line-height: 1.5;
}

/************************************** error in form *******************************************/
.has-error .help-block {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--bs-danger);
  margin-top: 0.3rem;
  line-height: 1.2;
}
