html,
body {
  width: 100%;
  height: 100%;
  word-break: break-all;
}

/* ＝＝＝＝＝＝ 按鈕 ＝＝＝＝＝＝ */
.btn {
  transition:
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
}

.btn:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.btn-b5p {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

.btn-b5p:hover,
.btn-b5p:focus {
  color: #fff;
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.btn-b5p:active {
  color: #fff;
  background-color: #0a58ca;
  border-color: #0a53be;
}

.btn-b5p:disabled,
.btn-b5p:disabled:hover {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-b5g {
  background-color: #33ff33;
  border-color: #33ff33;
  color: #fff;
}

.btn-b5g:hover,
.btn-b5g:focus {
  color: #fff;
  background-color: #66ff66;
  border-color: #66ff66;
}

.btn-b5g:active {
  color: #fff;
  background-color: #66ff66;
  border-color: #66ff66;
}

.btn-b5g:disabled,
.btn-b5g:disabled:hover {
  background-color: #66ff66;
  border-color: #66ff66;
}

.btn-b5w {
  color: #000;
  background-color: #ffc107;
  border-color: #ffc107;
}

.btn-b5w:hover,
.btn-b5w:focus {
  color: #000;
  background-color: #ffca2c;
  border-color: #ffc720;
}

.btn-b5w:active {
  color: #000;
  background-color: #ffcd39;
  border-color: #ffc720;
}

.btn-b5w:disabled,
.btn-b5w:disabled:hover {
  background-color: #ffc107;
  border-color: #ffc107;
}

.btn-b5d {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

.btn-b5d:hover,
.btn-b5d:focus {
  color: #fff;
  background-color: #bb2d3b;
  border-color: #b02a37;
}

.btn-b5d:active {
  color: #fff;
  background-color: #b02a37;
  border-color: #a52834;
}

.btn-b5d:disabled,
.btn-b5d:disabled:hover {
  background-color: #dc3545;
  border-color: #dc3545;
}

.btn-gray {
  color: #fff;
  background-color: #aaa;
  border-color: #9e9e9e;
}

.btn-gray:hover,
.btn-gray:focus {
  color: #fff;
  background-color: #999;
  border-color: #8e8e8e;
}

.btn-gray:active {
  color: #fff;
  background-color: #888;
  border-color: #7e7e7e;
}

.btn-gray:disabled,
.btn-gray:disabled:hover {
  background-color: #aaa;
  border-color: #9e9e9e;
}

.btn-darkblue,
.btn-darkblue:disabled,
.btn-darkblue:disabled:hover {
  background-color: #124ba1;
  border-color: #124ba1;
  color: #fff;
}

.btn-darkblue:hover,
.btn-darkblue:focus {
  color: #fff;
  background-color: #11438d;
  border-color: #11438d;
}

.btn-darkblue:active {
  color: #fff;
  background-color: #0f3877;
  border-color: #0f3877;
}

.btn:disabled {
  opacity: 0.65;
}

.btn > .bi {
  margin-right: 0.25rem;
  vertical-align: middle;
}

.btn > .bi.mr-2 {
  margin-right: 0.5rem;
}

/* ＝＝＝＝＝＝ 排版 ＝＝＝＝＝＝ */
.ta-l {
  text-align: left;
}

.ta-c {
  text-align: center;
}

.ta-r {
  text-align: right;
}

.td-underline,
.ta-underline {
  text-decoration: underline;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.w-100 {
  width: 100%;
}

/* ＝＝＝＝＝＝ Flex ＝＝＝＝＝＝ */
.f-cen {
  display: flex;
  align-items: center;
  justify-content: center;
}

.f-cs {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.f-es {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}

.f-ss {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.fd-c {
  flex-direction: column;
}

.f-n {
  flex-grow: 0;
  flex-shrink: 0;
}

.f-a {
  width: 100%;
  flex-grow: 1;
  flex-shrink: 1;
}

.f-a-v {
  flex-grow: 1;
  flex-shrink: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

/* ＝＝＝＝＝＝ 功能 ＝＝＝＝＝＝ */
.is-hidden {
  display: none !important;
}

.unit-txt {
  margin-left: 0.25rem;
  font-size: 0.8rem;
}

.fs-s {
  font-size: 0.94rem;
}

.fs-ss {
  font-size: 0.9rem;
}

.fs-sss {
  font-size: 0.85rem;
}

.fs-xs {
  font-size: 0.8rem;
}

.fs-xxs {
  font-size: 0.75rem;
}

.fw-bold {
  font-weight: bold;
}

.color-gray {
  color: #888;
}

.caseno {
  width: 296px;
}

/* Margin all sides */
.m-0 {
  margin: 0 !important;
}

.m-1 {
  margin: 0.25rem !important;
}

.m-2 {
  margin: 0.5rem !important;
}

.m-3 {
  margin: 1rem !important;
}

.m-4 {
  margin: 1.5rem !important;
}

.m-5 {
  margin: 3rem !important;
}

/* Margin X-axis (horizontal) */
.mx-0 {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.mx-1 {
  margin-left: 0.25rem !important;
  margin-right: 0.25rem !important;
}

.mx-2 {
  margin-left: 0.5rem !important;
  margin-right: 0.5rem !important;
}

.mx-3 {
  margin-left: 1rem !important;
  margin-right: 1rem !important;
}

.mx-4 {
  margin-left: 1.5rem !important;
  margin-right: 1.5rem !important;
}

.mx-5 {
  margin-left: 3rem !important;
  margin-right: 3rem !important;
}

/* Margin Y-axis (vertical) */
.my-0 {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.my-1 {
  margin-top: 0.25rem !important;
  margin-bottom: 0.25rem !important;
}

.my-2 {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

.my-3 {
  margin-top: 1rem !important;
  margin-bottom: 1rem !important;
}

.my-4 {
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
}

.my-5 {
  margin-top: 3rem !important;
  margin-bottom: 3rem !important;
}

/* Margin top */
.mt-0 {
  margin-top: 0 !important;
}

.mt-1 {
  margin-top: 0.25rem !important;
}

.mt-2 {
  margin-top: 0.5rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.mt-5 {
  margin-top: 3rem !important;
}

/* Margin bottom */
.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: 0.25rem !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mb-5 {
  margin-bottom: 3rem !important;
}

/* Margin left */
.ms-0 {
  margin-left: 0 !important;
}

.ms-1 {
  margin-left: 0.25rem !important;
}

.ms-2 {
  margin-left: 0.5rem !important;
}

.ms-3 {
  margin-left: 1rem !important;
}

.ms-4 {
  margin-left: 1.5rem !important;
}

.ms-5 {
  margin-left: 3rem !important;
}

/* Margin right */
.me-0 {
  margin-right: 0 !important;
}

.me-1 {
  margin-right: 0.25rem !important;
}

.me-2 {
  margin-right: 0.5rem !important;
}

.me-3 {
  margin-right: 1rem !important;
}

.me-4 {
  margin-right: 1.5rem !important;
}

.me-5 {
  margin-right: 3rem !important;
}

/* Auto margin */
.m-auto {
  margin: auto !important;
}

.mt-auto {
  margin-top: auto !important;
}

.mb-auto {
  margin-bottom: auto !important;
}

.ms-auto {
  margin-left: auto !important;
}

.me-auto {
  margin-right: auto !important;
}

/* Padding all sides */
.p-0 {
  padding: 0 !important;
}

.p-1 {
  padding: 0.25rem !important;
}

.p-2 {
  padding: 0.5rem !important;
}

.p-3 {
  padding: 1rem !important;
}

.p-4 {
  padding: 1.5rem !important;
}

.p-5 {
  padding: 3rem !important;
}

/* Padding X-axis (horizontal) */
.px-0 {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.px-1 {
  padding-left: 0.25rem !important;
  padding-right: 0.25rem !important;
}

.px-2 {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

.px-3 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

.px-4 {
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

.px-5 {
  padding-left: 3rem !important;
  padding-right: 3rem !important;
}

/* Padding Y-axis (vertical) */
.py-0 {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.py-1 {
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
}

.py-2 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.py-3 {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

.py-4 {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

.py-5 {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

/* Padding top */
.pt-0 {
  padding-top: 0 !important;
}

.pt-1 {
  padding-top: 0.25rem !important;
}

.pt-2 {
  padding-top: 0.5rem !important;
}

.pt-3 {
  padding-top: 1rem !important;
}

.pt-4 {
  padding-top: 1.5rem !important;
}

.pt-5 {
  padding-top: 3rem !important;
}

/* Padding bottom */
.pb-0 {
  padding-bottom: 0 !important;
}

.pb-1 {
  padding-bottom: 0.25rem !important;
}

.pb-2 {
  padding-bottom: 0.5rem !important;
}

.pb-3 {
  padding-bottom: 1rem !important;
}

.pb-4 {
  padding-bottom: 1.5rem !important;
}

.pb-5 {
  padding-bottom: 3rem !important;
}

/* Padding left */
.ps-0 {
  padding-left: 0 !important;
}

.ps-1 {
  padding-left: 0.25rem !important;
}

.ps-2 {
  padding-left: 0.5rem !important;
}

.ps-3 {
  padding-left: 1rem !important;
}

.ps-4 {
  padding-left: 1.5rem !important;
}

.ps-5 {
  padding-left: 3rem !important;
}

/* Padding right */
.pe-0 {
  padding-right: 0 !important;
}

.pe-1 {
  padding-right: 0.25rem !important;
}

.pe-2 {
  padding-right: 0.5rem !important;
}

.pe-3 {
  padding-right: 1rem !important;
}

.pe-4 {
  padding-right: 1.5rem !important;
}

.pe-5 {
  padding-right: 3rem !important;
}

/* Width classes from w-10 to w-100 */
.w-10 {
  width: 10% !important;
}

.w-15 {
  width: 15% !important;
}

.w-20 {
  width: 20% !important;
}

.w-25 {
  width: 25% !important;
}

.w-30 {
  width: 30% !important;
}

.w-40 {
  width: 40% !important;
}

.w-50 {
  width: 50% !important;
}

.w-60 {
  width: 60% !important;
}

.w-70 {
  width: 70% !important;
}

.w-75 {
  width: 75% !important;
}

.w-80 {
  width: 80% !important;
}

.w-90 {
  width: 90% !important;
}

.w-100 {
  width: 100% !important;
}

.h-100 {
  height: 100% !important;
}

.d-block {
  display: block !important;
}

.d-flex {
  display: flex !important;
}

.align-items-start {
  align-items: flex-start !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-start {
  justify-content: flex-start !important;
}

.justify-content-center {
  justify-content: center !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.d-inline {
  display: inline !important;
}

.d-none {
  display: none !important;
}

.d-contents {
  display: contents !important;
}

.text-underline {
  text-decoration: underline !important;
}

.position-relative {
  position: relative;
}

.rounded-circle {
  border-radius: 50% !important;
}

.lh-1 {
  line-height: 1 !important;
}

.company-stamp-2 {
  position: absolute;
  top: 0;
  right: 0;
}

.gap-1 {
  gap: 0.25rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 1rem;
}

.fs-3 {
  font-size: calc(1.3rem + 0.6vw) !important;
}

.fs-4 {
  font-size: calc(1.275rem + 0.3vw) !important;
}

.fs-5 {
  font-size: 1.25rem !important;
}

/* === 舊swal樣式 ===*/
.swal2-html-container .swal2-input,
.swal2-html-container .swal2-file,
.swal2-html-container .swal2-textarea {
  box-sizing: border-box;
  width: 100%;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
  border: 1px solid #d9d9d9;
  border-radius: 0.1875em;
  background: inherit;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06);
  color: inherit;
  font-size: 1.125em;
}
.swal2-html-container .swal2-input,
.swal2-html-container .swal2-file,
.swal2-html-container .swal2-textarea,
.swal2-html-container .swal2-select,
.swal2-html-container .swal2-radio,
.swal2-html-container .swal2-checkbox {
  margin: 1em auto;
}

/* === 新增全螢幕 iframe 模式 === */
.swal-full-popup {
  height: 95vh !important;
  display: flex !important; /* 改用 flex */
  flex-direction: column !important; /* 垂直排列 */
}

@media print {
  main {
    background-color: transparent !important;
  }

  .form-check-input:checked {
    background-color: initial !important;
    border-color: initial !important;
  }

  /* 調整根元素大小：這會讓所有 BS5 的 rem (包含字體和 mb-1~5 間距) 一次性等比例縮小 */
  html {
    font-size: 14px !important;
  }

  /* 避免區塊被切兩半 */
  .page {
    break-inside: avoid;
  }
}

/* === Bootstrap 3 → 5 相容性 shim === */

/* Margin Right */
.mr-0 {
  margin-right: 0 !important;
}
.mr-1 {
  margin-right: 0.25rem !important;
}
.mr-2 {
  margin-right: 0.5rem !important;
}
.mr-3 {
  margin-right: 1rem !important;
}
.mr-4 {
  margin-right: 1.5rem !important;
}
.mr-5 {
  margin-right: 3rem !important;
}

/* Margin Left */
.ml-0 {
  margin-left: 0 !important;
}
.ml-1 {
  margin-left: 0.25rem !important;
}
.ml-2 {
  margin-left: 0.5rem !important;
}
.ml-3 {
  margin-left: 1rem !important;
}
.ml-4 {
  margin-left: 1.5rem !important;
}
.ml-5 {
  margin-left: 3rem !important;
}

/* Margin Top */
.mt-0 {
  margin-top: 0 !important;
}
.mt-1 {
  margin-top: 0.25rem !important;
}
.mt-2 {
  margin-top: 0.5rem !important;
}
.mt-3 {
  margin-top: 1rem !important;
}
.mt-4 {
  margin-top: 1.5rem !important;
}
.mt-5 {
  margin-top: 3rem !important;
}

/* Margin Bottom */
.mb-0 {
  margin-bottom: 0 !important;
}
.mb-1 {
  margin-bottom: 0.25rem !important;
}
.mb-2 {
  margin-bottom: 0.5rem !important;
}
.mb-3 {
  margin-bottom: 1rem !important;
}
.mb-4 {
  margin-bottom: 1.5rem !important;
}
.mb-5 {
  margin-bottom: 3rem !important;
}

/* Padding Right */
.pr-0 {
  padding-right: 0 !important;
}
.pr-1 {
  padding-right: 0.25rem !important;
}
.pr-2 {
  padding-right: 0.5rem !important;
}
.pr-3 {
  padding-right: 1rem !important;
}
.pr-4 {
  padding-right: 1.5rem !important;
}
.pr-5 {
  padding-right: 3rem !important;
}

/* Padding Left */
.pl-0 {
  padding-left: 0 !important;
}
.pl-1 {
  padding-left: 0.25rem !important;
}
.pl-2 {
  padding-left: 0.5rem !important;
}
.pl-3 {
  padding-left: 1rem !important;
}
.pl-4 {
  padding-left: 1.5rem !important;
}
.pl-5 {
  padding-left: 3rem !important;
}

/* Padding Top */
.pt-0 {
  padding-top: 0 !important;
}
.pt-1 {
  padding-top: 0.25rem !important;
}
.pt-2 {
  padding-top: 0.5rem !important;
}
.pt-3 {
  padding-top: 1rem !important;
}
.pt-4 {
  padding-top: 1.5rem !important;
}
.pt-5 {
  padding-top: 3rem !important;
}

/* Padding Bottom */
.pb-0 {
  padding-bottom: 0 !important;
}
.pb-1 {
  padding-bottom: 0.25rem !important;
}
.pb-2 {
  padding-bottom: 0.5rem !important;
}
.pb-3 {
  padding-bottom: 1rem !important;
}
.pb-4 {
  padding-bottom: 1.5rem !important;
}
.pb-5 {
  padding-bottom: 3rem !important;
}

* === Float 舊語法 === */ .pull-left {
  float: left !important;
}
.pull-right {
  float: right !important;
}

/* === Text Alignment 舊語法 === */
.text-left {
  text-align: left !important;
}
.text-right {
  text-align: right !important;
}
.text-center {
  text-align: center !important;
}

/* === Form 舊語法 === */
.form-group {
  margin-bottom: 1rem !important;
}
.input-group-addon {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #495057;
  text-align: center;
  white-space: nowrap;
  background-color: #e9ecef;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
}
.input-group-addon:first-child {
  border-right: 0;
}
.input-group-addon:last-child {
  border-left: 0;
}

/* === Button 舊語法 === */
.btn-xs {
  padding: 0.25rem 0.4rem;
  font-size: 0.75rem;
  line-height: 1.5;
  border-radius: 0.2rem;
}

/* === Label 舊語法 === */
.label {
  display: inline-block;
  padding: 0.25em 0.4em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}
.label-default {
  background-color: #6c757d;
}
.label-primary {
  background-color: #0d6efd;
}
.label-success {
  background-color: #198754;
}
.label-info {
  background-color: #0dcaf0;
}
.label-warning {
  background-color: #ffc107;
}
.label-danger {
  background-color: #dc3545;
}

/* === Glyphicons (Bootstrap 3 已移除，這裡可用替代方案或留空) === */
.glyphicon {
  font-family: 'Bootstrap Icons', sans-serif;
}
