﻿/* ===== 環境主題變數（正式藍 / 測試粉紅）=====
   配色集中於此：chrome／主按鈕／日曆一律吃 var(--jas-*)，切換靠 body 的 theme-{name}
   class（由 UiThemeOptions.ThemeName 決定）。:root＝正式藍，也是未知／未設定主題的 fallback。 */
:root {
  --jas-primary: #246f9f;
  --jas-primary-rgb: 36, 111, 159;
  --jas-primary-hover: #1d5d86;
  --jas-primary-active: #17496a;
  --jas-accent: #246f9f;
  --jas-header-bg: #2676a9;
  --jas-sidebar-bg: #f4f5f7;
  --jas-sidebar-border: #d7dde5;
  --jas-sidebar-text: #374151;
  --jas-sidebar-muted: #778292;
  --jas-sidebar-hover-bg: #e5eef7;
  --jas-sidebar-active-bg: #d8eaf6;
  --jas-content-bg: #f6f7f9;
  --jas-card-border: #ccd9e8;
  --jas-focus-ring: #74abd7;
  --jas-avatar-bg: #6cc7ff;
  --jas-brand: #d4b78d;
  --jas-soft-shadow: 0 .85rem 2rem rgba(15, 23, 42, .07);
  /* sticky 表頭要避開的頂部高度：頂列 48px，
     頂端選單釘選常駐時再加上選單列高度（由 site.js 實測寫回）。 */
  --jas-sticky-top: 48px;
  --bs-primary: var(--jas-primary);
  --bs-primary-rgb: var(--jas-primary-rgb);
  --bs-link-color: var(--jas-primary);
  --bs-link-hover-color: var(--jas-primary-hover);
}

/* 測試環境粉紅系：先定義、暫不啟用（無 body.theme-test 時不生效）。 */
.theme-test {
  --jas-primary: #d63384;
  --jas-primary-rgb: 214, 51, 132;
  --jas-primary-hover: #ab296a;
  --jas-primary-active: #86204f;
  --jas-accent: #b02a6f;
  --jas-header-bg: #5c1f3d;
  --jas-sidebar-active-bg: #fbe3ef;
  --jas-focus-ring: #e685b5;
  --jas-avatar-bg: #f3a6cc;
  --jas-brand: #d4b78d;
}

/* 全站主按鈕吃主題主色（Bootstrap 5.3 button 局部變數；不改各功能頁既有規則）。 */
.btn-primary {
  --bs-btn-bg: var(--jas-primary);
  --bs-btn-border-color: var(--jas-primary);
  --bs-btn-hover-bg: var(--jas-primary-hover);
  --bs-btn-hover-border-color: var(--jas-primary-hover);
  --bs-btn-active-bg: var(--jas-primary-hover);
  --bs-btn-active-border-color: var(--jas-primary-hover);
  --bs-btn-disabled-bg: var(--jas-primary);
  --bs-btn-disabled-border-color: var(--jas-primary);
}

/* 環境 badge（頂列右側小膠囊；預設關，測試環境用以一眼辨識）。 */
.app-env-badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.6;
  background: var(--jas-primary);
  color: #fff;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--jas-focus-ring);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--jas-content-bg);
  color: #172033;
}

.app-busy-overlay {
  align-items: center;
  background: rgba(248, 250, 252, .72);
  backdrop-filter: blur(2px);
  display: none;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 3000;
}

.app-busy-overlay.is-visible {
  display: flex;
}

.app-busy-dialog {
  align-items: center;
  background: #fff;
  border: 1px solid var(--jas-card-border);
  border-radius: 8px;
  box-shadow: 0 22px 58px rgba(15, 23, 42, .18);
  color: #24364d;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
  padding: 24px 28px;
  text-align: center;
}

.app-busy-title {
  font-size: .96rem;
  font-weight: 800;
}

.app-busy-text {
  color: #64748b;
  font-size: .82rem;
}

.app-is-busy {
  cursor: progress;
}

.app-is-busy .btn.is-busy,
.app-is-busy button.is-busy,
.app-is-busy input.is-busy {
  pointer-events: none;
}

.btn-outline-primary {
  --bs-btn-color: var(--jas-primary);
  --bs-btn-border-color: rgba(var(--jas-primary-rgb), .45);
  --bs-btn-hover-bg: var(--jas-primary);
  --bs-btn-hover-border-color: var(--jas-primary);
  --bs-btn-active-bg: var(--jas-primary-hover);
  --bs-btn-active-border-color: var(--jas-primary-hover);
  --bs-btn-disabled-color: var(--jas-primary);
  --bs-btn-disabled-border-color: rgba(var(--jas-primary-rgb), .35);
}

.form-check-input:checked {
  background-color: var(--jas-primary);
  border-color: var(--jas-primary);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ===== App shell：上方列 + 左側鐵軌 + 內容 ===== */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 16px;
  background: linear-gradient(90deg, var(--jas-header-bg) 0%, #1f6f9f 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 10px 28px rgba(15, 23, 42, .12);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 600;
  letter-spacing: .5px;
  text-decoration: none;
}

.app-logo {
  display: inline-block;
  width: 26px;
  height: 26px;
  /* 公司 logo：從 AluxeLogo_H.jpg 自動裁出、白底轉透明的 PNG，當作 CSS mask 用，
     顏色由 background-color 控制（深色 topbar 上用亮金棕，呼應品牌色）。 */
  background-color: var(--jas-brand);
  -webkit-mask: url('/images/aluxe-icon.png') center / contain no-repeat;
          mask: url('/images/aluxe-icon.png') center / contain no-repeat;
}

/* 頂列麵包屑：首頁 / 大類 / 頁 */
.app-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, .18);
  font-size: .9rem;
  color: #d7e2ee;
}

.app-breadcrumb a {
  color: #d7e2ee;
  text-decoration: none;
}

.app-breadcrumb a:hover {
  color: #fff;
  text-decoration: underline;
}

.app-breadcrumb .sep {
  opacity: .45;
}

.app-breadcrumb .crumb.current {
  color: #fff;
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .app-breadcrumb {
    display: none;
  }
}

/* 頂列「加入我的最愛」星號切換鈕 */
.app-fav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: #d7e2ee;
  font-size: .82rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.app-fav-toggle:hover {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.app-fav-toggle .app-fav-star {
  font-size: 1rem;
  line-height: 1;
  color: #ffd166;
}

.app-fav-toggle.is-fav {
  background: rgba(255, 209, 102, .18);
  border-color: rgba(255, 209, 102, .55);
  color: #fff;
}

@media (max-width: 767.98px) {
  .app-fav-toggle .app-fav-label {
    display: none;
  }
}

/* 首頁文件待辦卡片：可點擊，hover 微浮起 */
.dashboard-doc-card {
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}

.dashboard-doc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .12) !important;
}

/* 首頁我的最愛快捷：編輯模式才顯示移除鈕 */
.fav-quick-item {
  position: relative;
}

.fav-quick-item .js-fav-remove {
  display: none;
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #dc3545;
  color: #fff;
  font-size: .8rem;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.fav-quick-list.is-editing .fav-quick-item .js-fav-remove {
  display: inline-block;
}

.fav-quick-list.is-editing .fav-quick-item .fav-quick-link {
  pointer-events: none;
}

.app-brand:hover {
  color: #fff;
  opacity: .9;
}

.app-topbar-spacer {
  flex: 1;
}

.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 右上角使用者頭像（圈圈）＋ 點開卡片 */
.app-avatar {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--jas-avatar-bg);
  color: #08263b;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.app-avatar:hover {
  filter: brightness(1.08);
}

/* 有大頭照時照片覆蓋整個圈（object-fit 裁切置中）；載入失敗時 onerror 移除 img → 露出字首 */
.app-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
}

.app-usercard {
  min-width: 248px;
  padding: 0;
}

.app-usercard-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.app-usercard-id {
  min-width: 0;
}

.app-usercard-name {
  font-weight: 600;
  color: #242424;
}

.app-usercard-acct {
  font-size: .85rem;
  color: #6c757d;
}

.app-usercard-sub {
  font-size: .85rem;
  color: #6c757d;
}

/* 卡片下半的員工資訊（員工編號／職等／帳號）：label 靠左、值靠右 */
.app-usercard-meta {
  margin: 0;
  padding: 8px 16px 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
}

.app-usercard-meta dt {
  color: #8a8886;
  font-weight: 500;
  font-size: .82rem;
}

.app-usercard-meta dd {
  margin: 0;
  color: #242424;
  font-size: .82rem;
  text-align: right;
}

.app-topbar-link {
  color: #fff;
  text-decoration: none;
}

.app-topbar-link:hover {
  color: #fff;
  text-decoration: underline;
}

.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.app-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--jas-content-bg);
}

.app-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--jas-sidebar-border);
  color: #667085;
  font-size: .85rem;
}

/* 左側鐵軌 */
.app-rail {
  width: 220px;
  flex: 0 0 220px;
  background: var(--jas-sidebar-bg);
  border-right: 1px solid var(--jas-sidebar-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 48px;
  align-self: flex-start;
  height: calc(100vh - 48px);
  transition: width .12s ease, flex-basis .12s ease;
  z-index: 1030;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  flex: 1;
  /* 不可用 overflow:auto/hidden，否則會裁掉 left:100% 的飛出面板。
     目前大類少不需捲動；日後大類變多要捲動時，飛出改用 JS 定位的 fixed 面板。 */
  overflow: visible;
}

.rail-empty {
  padding: 8px 16px;
  font-size: .85rem;
}

.rail-item {
  position: relative;
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--jas-sidebar-text);
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  font-size: .92rem;
  text-decoration: none;
}

.rail-link:hover {
  background: var(--jas-sidebar-hover-bg);
  color: #123c61;
}

.rail-icon {
  display: inline-flex;
  flex: 0 0 20px;
  color: var(--jas-accent);
}

.rail-label {
  white-space: nowrap;
  overflow: hidden;
}

.rail-caret {
  margin-left: auto;
  opacity: .45;
}

/* 一級選單的通知徽章（目前用於「文件」的待我審核件數）。
   側邊模式：跟在選單文字後面；頂端模式另外覆寫成浮在項目右下角。 */
.rail-badge {
  align-items: center;
  background: #dc3545;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: .68rem;
  font-weight: 600;
  height: 18px;
  justify-content: center;
  line-height: 1;
  margin-left: 6px;
  min-width: 18px;
  padding: 0 5px;
}

/* 飛出子選單：由 JavaScript 定位，避免 hover 面板重疊。 */
.rail-flyout {
  position: fixed;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--jas-card-border);
  border-radius: 0 8px 8px 0;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .14);
  display: none;
  z-index: 1060;
  padding: 6px 0;
  overflow-x: hidden;
  overflow-y: auto;
}


.rail-flyout-title {
  padding: 6px 16px;
  font-weight: 600;
  color: var(--jas-accent);
  font-size: .88rem;
}

.rail-flyout ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail-flyout a,
.rail-subtrigger,
.rail-disabled {
  display: block;
  padding: 7px 16px;
  font-size: .9rem;
  color: #323130;
  text-decoration: none;
}

.rail-flyout a:hover,
button.rail-subtrigger:hover {
  background: var(--jas-sidebar-hover-bg);
  color: var(--jas-accent);
}

.rail-subitem {
  position: relative;
}

.rail-subitem::after {
  content: "";
  position: absolute;
  top: 0;
  right: -12px;
  width: 12px;
  height: 100%;
}

.rail-subitem-divided {
  border-top: 1px solid rgba(148, 163, 184, .28);
  margin: 8px 12px 0;
  padding-top: 8px;
}

.rail-subtrigger {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.rail-nested-item {
  position: relative;
}

.rail-nested-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--jas-sidebar-text);
  padding: 7px 16px;
  font-size: .9rem;
  text-align: left;
  cursor: pointer;
}

.rail-nested-trigger:hover,
.rail-nested-trigger.is-active {
  background: var(--jas-sidebar-hover-bg);
  color: var(--jas-accent);
}

.rail-nested-trigger .rail-caret {
  display: inline;
  margin-left: auto;
}

.rail-category-label {
  cursor: default;
}

.rail-subtrigger .rail-caret {
  display: inline;
  margin-left: auto;
}

.rail-subtrigger.is-active {
  background: var(--jas-sidebar-active-bg);
  color: #123c61;
  font-weight: 600;
}

.rail-nested-heading {
  display: block;
  color: var(--jas-sidebar-text);
  padding: 7px 16px;
  font-size: .9rem;
}

.rail-nested-heading.is-active {
  color: #123c61;
  font-weight: 600;
}

.rail-nested-list {
  margin: 0;
  padding: 0 0 4px;
}

.rail-flyout .rail-nested-link {
  padding-left: 30px;
  font-size: .82rem;
}

.rail-submenu {
  position: fixed;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--jas-card-border);
  border-radius: 0 8px 8px 0;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .14);
  display: none;
  z-index: 1070;
  padding: 6px 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.rail-nested-submenu {
  position: fixed;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--jas-card-border);
  border-radius: 0 8px 8px 0;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .14);
  display: none;
  z-index: 1080;
  padding: 6px 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.rail-subitem:hover > .rail-submenu,
.rail-subitem:focus-within > .rail-submenu {
  display: block;
}

.rail-nested-item:hover > .rail-nested-submenu,
.rail-nested-item:focus-within > .rail-nested-submenu {
  display: block;
}

.rail-disabled {
  color: #a19f9d;
}

/* 當前 hub / category / page 反白；active hub 僅常駐展開第二層。 */
.rail-link.is-active {
  color: #123c61;
  font-weight: 600;
  background: var(--jas-sidebar-active-bg);
  box-shadow: inset 3px 0 0 var(--jas-accent);
}

.rail-item.is-active-hub > .rail-link .rail-caret {
  transform: rotate(90deg);
  opacity: .65;
}

.rail-item.is-active-hub > .rail-flyout {
  position: static;
  display: block;
  min-width: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 2px 0 6px;
  z-index: auto;
}

.rail-item.is-active-hub > .rail-flyout > .rail-flyout-title {
  display: none;
}

.rail-item.is-active-hub .rail-subitem {
  position: relative;
}

.rail-item.is-active-hub .rail-subtrigger {
  color: var(--jas-sidebar-text);
  padding-left: 14px;
  font-size: .88rem;
}

.rail-flyout a.is-active {
  background: var(--jas-sidebar-active-bg);
  color: #123c61;
  font-weight: 600;
  border-left: 3px solid var(--jas-accent);
  padding-left: 11px;
}

.rail-flyout .rail-nested-link.is-active {
  padding-left: 27px;
}

.rail-nested-list .rail-nested-list .rail-nested-heading,
.rail-nested-list .rail-nested-list .rail-disabled,
.rail-nested-list .rail-nested-list .rail-nested-link {
  padding-left: 44px;
  font-size: .8rem;
}

.rail-nested-list .rail-nested-list .rail-nested-link.is-active {
  padding-left: 41px;
}

/* 收合鈕 */
.rail-collapse {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-top: 1px solid var(--jas-sidebar-border);
  background: transparent;
  padding: 9px 14px;
  cursor: pointer;
  color: var(--jas-sidebar-muted);
  font-size: .9rem;
}

.rail-collapse:hover {
  background: var(--jas-sidebar-hover-bg);
  color: #123c61;
}

.rail-collapse-icon {
  display: inline-flex;
  flex: 0 0 20px;
  justify-content: center;
}

/* 收合狀態：只剩圖示，hover 仍可飛出 */
.app-rail.is-collapsed {
  width: 48px;
  flex-basis: 48px;
}

.app-rail.is-collapsed .rail-label,
.app-rail.is-collapsed .rail-caret {
  display: none;
}

.app-rail.is-collapsed .rail-flyout .rail-caret {
  display: inline;
}

/* 收合狀態只剩圖示，徽章若還佔一個 inline 位置會把圖示擠歪 → 改成浮在項目右下角。
   （窄螢幕的 media query 版本同理，見下方。） */
.app-rail.is-collapsed .rail-badge {
  bottom: 3px;
  box-shadow: 0 0 0 2px var(--jas-sidebar-bg);
  font-size: .62rem;
  height: 16px;
  margin-left: 0;
  min-width: 16px;
  padding: 0 4px;
  position: absolute;
  right: 3px;
}

.app-rail.is-collapsed .rail-link,
.app-rail.is-collapsed .rail-collapse {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.app-rail.is-collapsed .rail-collapse-icon {
  transform: rotate(180deg);
}

.app-rail.is-collapsed .rail-item > .rail-flyout {
  position: fixed;
  left: 48px;
  top: 56px;
}

.app-rail.is-collapsed .rail-item.is-active-hub > .rail-flyout {
  position: fixed;
  display: none;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--jas-card-border);
  border-radius: 0 8px 8px 0;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .14);
  padding: 6px 0;
  z-index: 1060;
}

.app-rail.is-collapsed .rail-item.is-active-hub:hover > .rail-flyout,
.app-rail.is-collapsed .rail-item.is-active-hub:focus-within > .rail-flyout {
  display: block;
}

.app-rail.is-collapsed .rail-item.is-active-hub > .rail-flyout > .rail-flyout-title {
  display: block;
}

.app-rail.is-collapsed .rail-item.is-active-hub .rail-subitem {
  position: relative;
}

.app-rail.is-collapsed .rail-item.is-active-hub .rail-subtrigger {
  color: #323130;
  padding-left: 16px;
  font-size: .9rem;
}

.app-rail.is-collapsed .rail-item.is-active-hub .rail-subtrigger .rail-caret {
  transform: none;
}

.app-rail.is-collapsed .rail-item.is-active-hub .rail-subitem:not(.is-active-category) > .rail-submenu,
.app-rail.is-collapsed .rail-item.is-active-hub .rail-subitem.is-active-category > .rail-submenu {
  position: absolute;
  display: none;
  left: 100%;
  top: var(--rail-flyout-top, 0);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--jas-card-border);
  border-radius: 0 8px 8px 0;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .14);
  padding: 6px 0;
  z-index: 1070;
}

.app-rail.is-collapsed .rail-item.is-active-hub .rail-subitem:hover > .rail-submenu,
.app-rail.is-collapsed .rail-item.is-active-hub .rail-subitem:focus-within > .rail-submenu {
  display: block;
}

.app-rail.is-collapsed .rail-item.is-active-hub .rail-submenu > .rail-flyout-title {
  display: block;
}

.app-rail.is-collapsed .rail-item.is-active-hub .rail-submenu a,
.app-rail.is-collapsed .rail-item.is-active-hub .rail-submenu .rail-disabled {
  color: #323130;
  padding-left: 16px;
  font-size: .9rem;
}

@media (max-width: 991.98px) {
  .app-rail {
    width: 48px;
    flex-basis: 48px;
  }

  .app-rail .rail-label,
  .app-rail .rail-caret {
    display: none;
  }

  .app-rail .rail-flyout .rail-caret {
    display: inline;
  }

  .app-rail .rail-badge {
    bottom: 3px;
    box-shadow: 0 0 0 2px var(--jas-sidebar-bg);
    font-size: .62rem;
    height: 16px;
    margin-left: 0;
    min-width: 16px;
    padding: 0 4px;
    position: absolute;
    right: 3px;
  }

  .app-rail .rail-link,
  .app-rail .rail-collapse {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .app-rail .rail-item > .rail-flyout {
    position: fixed;
    left: 48px;
    top: 56px;
  }

  .app-rail .rail-item.is-active-hub > .rail-flyout {
    position: fixed;
    display: none;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--jas-card-border);
    box-shadow: 0 18px 36px rgba(15, 23, 42, .14);
    padding: 6px 0;
    z-index: 1060;
  }

  .app-rail .rail-item.is-active-hub:hover > .rail-flyout,
  .app-rail .rail-item.is-active-hub:focus-within > .rail-flyout {
    display: block;
  }

  .app-rail .rail-item.is-active-hub > .rail-flyout > .rail-flyout-title {
    display: block;
  }

  .app-rail .rail-item.is-active-hub .rail-subitem {
    position: relative;
  }

  .app-rail .rail-item.is-active-hub .rail-subtrigger {
    color: #323130;
    padding-left: 16px;
    font-size: .9rem;
  }

  .app-rail .rail-item.is-active-hub .rail-subtrigger .rail-caret {
    transform: none;
  }

  .app-rail .rail-item.is-active-hub .rail-subitem:not(.is-active-category) > .rail-submenu,
  .app-rail .rail-item.is-active-hub .rail-subitem.is-active-category > .rail-submenu {
    position: absolute;
    display: none;
    left: 100%;
    top: var(--rail-flyout-top, 0);
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--jas-card-border);
    border-radius: 0 8px 8px 0;
    box-shadow: 0 18px 36px rgba(15, 23, 42, .14);
    padding: 6px 0;
    z-index: 1070;
  }

  .app-rail .rail-item.is-active-hub .rail-subitem:hover > .rail-submenu,
  .app-rail .rail-item.is-active-hub .rail-subitem:focus-within > .rail-submenu {
    display: block;
  }

  .app-rail .rail-item.is-active-hub .rail-submenu > .rail-flyout-title {
    display: block;
  }

  .app-rail .rail-item.is-active-hub .rail-submenu a,
  .app-rail .rail-item.is-active-hub .rail-submenu .rail-disabled {
    color: #323130;
    padding-left: 16px;
    font-size: .9rem;
  }
}

/* ===== 頂端水平選單模式 ===== */
.app-shell.nav-top .rail-collapse { display: none; }
/* 釘選（常駐）模式：選單列黏在 topbar（高 48px）下方，捲動時不跟著頁面走掉。
   .app-shell 是 column flex 且靠視窗捲動，故用 sticky 而非 fixed —— 保留原本的
   文件流高度，下方 .app-body 不需要額外補 padding。自動隱藏模式另見下方 nav-autohide 規則。 */
.app-shell.nav-top .app-rail { width: auto; flex: 0 0 auto; height: auto; flex-direction: row; align-items: stretch; border-right: 0; border-bottom: 1px solid var(--jas-sidebar-border); overflow: visible; position: sticky; top: 48px; align-self: auto; z-index: 1029; box-shadow: 0 2px 6px rgba(15, 23, 42, .06); }
.app-shell.nav-top .rail-list { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: stretch; flex: 1; min-width: 0; padding: 0; overflow-x: auto; overflow-y: visible; }
.app-shell.nav-top .rail-item { position: relative; flex: 0 0 auto; }
.app-shell.nav-top .rail-link { width: auto; gap: 5px; padding: 9px 7px; font-size: .88rem; white-space: nowrap; }
.app-shell.nav-top .rail-icon { flex-basis: 17px; }
.app-shell.nav-top .rail-icon svg { width: 17px; height: 17px; }
.app-shell.nav-top .rail-link.is-active { box-shadow: inset 0 -3px 0 var(--jas-accent); }
.app-shell.nav-top .rail-link .rail-caret { display: none; }
/* 頂端模式：徽章浮在選單項的右下角（.rail-item 已是 position: relative）。
   白色描邊讓它壓在文字/底線上仍看得清楚。 */
.app-shell.nav-top .rail-badge { position: absolute; right: 1px; bottom: 1px; margin-left: 0; height: 16px; min-width: 16px; padding: 0 4px; font-size: .62rem; box-shadow: 0 0 0 2px #fff; }
/* 有徽章的項目右側多留一點空間，否則絕對定位的徽章會壓在選單文字上 */
.app-shell.nav-top .rail-link.has-badge { padding-right: 26px; }
.app-shell.nav-top .rail-flyout { border-radius: 0 0 8px 8px; }
.app-shell.nav-top .rail-flyout > .rail-flyout-title { display: none; }
.app-shell.nav-top .rail-item.is-active-hub > .rail-flyout { position: fixed; display: none; min-width: 220px; background: #fff; border: 1px solid var(--jas-card-border); border-radius: 0 0 8px 8px; box-shadow: 0 18px 36px rgba(15, 23, 42, .14); padding: 6px 0; z-index: 1060; }
.app-shell.nav-top .rail-item.is-active-hub > .rail-flyout > .rail-flyout-title { display: block; }
.rail-pin { display: none; }
.app-shell.nav-top .rail-pin { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; margin-left: auto; align-self: center; border: 0; background: transparent; padding: 6px 14px; cursor: pointer; color: var(--jas-sidebar-muted); font-size: .85rem; white-space: nowrap; }
.app-shell.nav-top .rail-pin:hover { color: #123c61; }
.app-shell.nav-top .rail-pin[aria-pressed="true"] .rail-pin-icon { filter: grayscale(1); opacity: .55; }
.app-nav-hotzone { display: none; }
.app-shell.nav-top.nav-autohide .app-rail { position: fixed; top: 48px; left: 0; right: 0; transform: translateY(-115%); transition: transform .18s ease; box-shadow: 0 10px 24px rgba(15, 23, 42, .16); }
.app-shell.nav-top.nav-autohide.nav-revealed .app-rail { transform: none; }
.app-shell.nav-top.nav-autohide .app-nav-hotzone { display: block; position: fixed; top: 48px; left: 0; right: 0; height: 8px; z-index: 1028; }
@media (max-width: 991.98px) { .app-shell.nav-top .rail-label { display: inline; } .app-shell.nav-top .rail-link { justify-content: flex-start; padding: 8px 9px; } .app-shell.nav-top .rail-caret { display: inline; } }

/* ===== 日曆管理 ===== */
.calendar-page {
  max-width: none;
}

.calendar-shell {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 320px minmax(0, 1fr);
}

.calendar-list-panel,
.calendar-workspace {
  background: #fff;
  border: 1px solid var(--jas-card-border);
  border-radius: 8px;
  box-shadow: var(--jas-soft-shadow);
}

.calendar-list-panel {
  overflow: hidden;
  position: sticky;
  top: 76px;
}

.calendar-search {
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
  border-bottom: 1px solid #e5edf5;
  padding: 14px 16px;
}

.calendar-search .input-group-text {
  background: #eef2f7;
  border-color: #cbd5e1;
  color: #40566f;
  font-weight: 600;
}

.calendar-search .form-control {
  border-color: #cbd5e1;
}

.calendar-list {
  list-style: none;
  margin: 0;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  padding: 8px;
}

.calendar-list li {
  margin-bottom: 7px;
}

.calendar-list li a {
  background: #fff;
  border: 1px solid #e5edf5;
  border-radius: 7px;
  color: #24364d;
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}

.calendar-list li.active a {
  background: #edf6ff;
  border-color: #9cc8ec;
  box-shadow: inset 3px 0 0 var(--jas-primary);
}

.calendar-list li a:hover {
  background: #f6fbff;
  border-color: #c9dff3;
}

.calendar-empty-list {
  color: #64748b;
  padding: 28px 10px;
  text-align: center;
}

.calendar-item-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.calendar-item-name {
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-item-id {
  color: #64748b;
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
}

.calendar-item-tags,
.calendar-template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.calendar-tag {
  border-radius: 999px;
  display: inline-flex;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
  padding: .26rem .5rem;
}

.calendar-tag.tag-off {
  background: #fff0f0;
  border: 1px solid #ffd5d5;
  color: #b42318;
}

.calendar-tag.tag-on {
  background: #eaf8ef;
  border: 1px solid #c6ebd2;
  color: #137333;
}

.calendar-workspace {
  min-height: 620px;
  min-width: 0;
  overflow: hidden;
}

.calendar-empty-state {
  align-items: center;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.calendar-empty-state h2 {
  color: #1f2937;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.calendar-empty-state p {
  color: #64748b;
  margin-bottom: 16px;
}

.calendar-detail-head {
  align-items: flex-start;
  background: linear-gradient(135deg, #f7fbff, #fffaf2);
  border-bottom: 1px solid #e5edf5;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px 22px 18px;
}

.calendar-detail-head h2 {
  color: #102a43;
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
}

.calendar-year-bar {
  align-items: center;
  border-bottom: 1px solid #e5edf5;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: space-between;
  padding: 14px 22px;
}

.calendar-year-picker {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.calendar-year-picker span {
  color: #64748b;
  font-size: .86rem;
  font-weight: 700;
  margin-right: 2px;
}

.calendar-year-picker a {
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--jas-primary);
  font-size: .86rem;
  font-weight: 700;
  line-height: 1;
  padding: .38rem .68rem;
  text-decoration: none;
}

.calendar-year-picker a.active {
  background: var(--jas-primary);
  border-color: var(--jas-primary);
  color: #fff;
}

.calendar-year-picker a:hover:not(.active) {
  background: #edf6ff;
  border-color: #c9dff3;
}

.calendar-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-stats span {
  background: #f8fafc;
  border: 1px solid #e5edf5;
  border-radius: 999px;
  color: #64748b;
  font-size: .83rem;
  padding: .28rem .58rem;
}

.calendar-stats strong {
  color: #1f2937;
}

.calendar-toolbar {
  align-items: center;
  background: #fbfdff;
  border-bottom: 1px solid #e5edf5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 22px;
}

.calendar-month-tabs {
  background: #fff;
  border-bottom: 1px solid #e5edf5;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px 22px;
}

.calendar-month-tab {
  background: #fff;
  border: 1px solid #d7e0ea;
  border-radius: 999px;
  color: #24364d;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1;
  padding: .45rem .7rem;
  transition: background-color .12s, border-color .12s;
}

.calendar-month-tab:hover {
  background: #edf6ff;
  border-color: #9cc8ec;
}

.calendar-month-tab.active {
  background: var(--jas-primary);
  border-color: var(--jas-primary);
  color: #fff;
}

.calendar-year-overview {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  padding: 18px 22px 22px;
}

.calendar-month-mini {
  background: #fff;
  border: 1px solid #dbe6f2;
  border-radius: 7px;
  cursor: pointer;
  padding: 10px;
  user-select: none;
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}

.calendar-month-mini:hover {
  background: #f6fbff;
  border-color: #9cc8ec;
  box-shadow: 0 .45rem 1rem rgba(15, 23, 42, .07);
}

.calendar-month-mini:focus {
  outline: 2px solid var(--jas-primary);
  outline-offset: 2px;
}

.calendar-mini-head {
  align-items: center;
  display: flex;
  font-size: .9rem;
  justify-content: space-between;
  margin-bottom: 7px;
}

.calendar-mini-head strong {
  color: #102a43;
}

.calendar-mini-head span {
  color: #b42318;
  font-size: .78rem;
  font-weight: 700;
}

.calendar-mini-grid {
  display: grid;
  font-size: .74rem;
  gap: 2px;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-mini-day,
.calendar-mini-empty {
  color: #64748b;
  padding: 2px 0;
  text-align: center;
}

.calendar-mini-day.off {
  background: #fff0f0;
  border-radius: 3px;
  color: #b42318;
}

.calendar-mini-day.statutory {
  font-weight: 800;
}

.calendar-month-detail {
  padding: 18px 22px 22px;
}

.calendar-month-detail h3 {
  color: #102a43;
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 10px;
}

.calendar-detail-grid {
  border: 1px solid #d7e0ea;
  border-radius: 7px;
  overflow: hidden;
}

.calendar-detail-head-row {
  background: #f6f9fd;
  color: #334155;
  display: grid;
  font-weight: 800;
  grid-template-columns: repeat(7, 1fr);
  padding: 8px 0;
  text-align: center;
}

.calendar-detail-head-row .calendar-wkend {
  color: #b42318;
}

.calendar-detail-body {
  background: #dbe6f2;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-detail-day,
.calendar-detail-empty {
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  min-height: 92px;
  padding: 8px;
  position: relative;
  transition: background-color .12s;
}

.calendar-detail-day {
  cursor: pointer;
}

.calendar-detail-day:hover {
  background: #f6fbff;
}

.calendar-detail-toggle {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.calendar-detail-row1 {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.calendar-detail-num {
  color: #1f2937;
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.1;
}

.calendar-detail-day[data-wkend="1"] .calendar-detail-num {
  color: #b42318;
}

.calendar-detail-mark {
  background: #b42318;
  border-radius: 999px;
  color: #fff;
  display: none;
  font-size: .7rem;
  font-weight: 800;
  line-height: 1;
  padding: .22rem .45rem;
}

.calendar-detail-day:has(.calendar-detail-toggle:checked) {
  background: #fff8e6;
}

.calendar-detail-day:has(.calendar-detail-toggle:checked):hover {
  background: #fff1c9;
}

.calendar-detail-day:has(.calendar-detail-toggle:checked) .calendar-detail-mark {
  display: inline-flex;
}

.calendar-day-name {
  background: rgba(255, 255, 255, .88);
  border: 1px solid #d7e0ea;
  border-radius: 5px;
  color: #137333;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  margin-top: auto;
  padding: 4px 6px;
  width: 100%;
}

.calendar-day-name:placeholder-shown {
  background: transparent;
  border-color: transparent;
  opacity: 0;
}

.calendar-detail-day:hover .calendar-day-name:placeholder-shown,
.calendar-day-name:placeholder-shown:focus,
.calendar-detail-day:has(.calendar-detail-toggle:checked) .calendar-day-name:placeholder-shown {
  background: rgba(255, 255, 255, .62);
  border: 1px dashed #b7c4d4;
  color: #64748b;
  opacity: 1;
}

.calendar-day-name:focus {
  background: #fff;
  border-color: var(--jas-primary);
  box-shadow: 0 0 0 2px rgba(var(--jas-primary-rgb), .15);
  color: #137333;
  outline: none;
}

.calendar-page-form {
  max-width: 1120px;
}

.calendar-form-shell {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.calendar-form-card .card-body {
  padding: 24px;
}

.calendar-form-card .input-group-text {
  justify-content: center;
  min-width: 72px;
  white-space: nowrap;
}

.calendar-rule-panel {
  background: #f8fbff;
  border: 1px solid #e4edf6;
  border-radius: 7px;
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.calendar-rule-panel .form-check {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 0;
  min-height: 30px;
  padding-left: 2.6rem;
}

.calendar-rule-panel .form-check-input {
  margin-left: -2.6rem;
  margin-top: 0;
}

.calendar-rule-panel .form-check-label {
  color: #334155;
  font-weight: 700;
}

.calendar-danger-form {
  border-top: 1px solid #e5edf5;
  margin-top: 16px;
  padding-top: 16px;
}

@media (max-width: 1199.98px) {
  .calendar-year-overview {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }
}

@media (max-width: 991.98px) {
  .calendar-shell,
  .calendar-form-shell {
    grid-template-columns: 1fr;
  }

  .calendar-list-panel {
    position: static;
  }

  .calendar-list {
    max-height: 260px;
  }
}

@media (max-width: 767.98px) {
  .calendar-detail-head,
  .calendar-year-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-year-overview {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  }

  .calendar-detail-day,
  .calendar-detail-empty {
    min-height: 64px;
    padding: 5px;
  }

  .calendar-detail-num {
    font-size: .95rem;
  }

  .calendar-day-name {
    font-size: .72rem;
    padding: 2px 4px;
  }
}

.account-security {
  max-width: 1040px;
  margin: 0 auto;
  padding: 34px 18px;
}

.account-security-eyebrow {
  color: var(--jas-primary);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.account-security-panel {
  border: 1px solid #d7e0ea;
  border-radius: 6px;
  box-shadow: 0 1rem 2.25rem rgba(15, 23, 42, .1);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  overflow: hidden;
}

.account-security-form-panel {
  background: #fff;
  padding: 50px clamp(28px, 4vw, 56px);
}

.account-security-form-panel h1 {
  color: #1f2937;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.account-security-lead {
  color: #64748b;
  margin: 0 0 26px;
}

.account-security-form {
  max-width: 520px;
}

.account-security-form .form-field {
  margin-bottom: 17px;
}

.account-security-form .form-label {
  color: #334155;
  font-weight: 600;
  margin-bottom: 7px;
}

.account-security-form .form-control {
  border-color: #cbd5e1;
  min-height: 48px;
}

.account-security-form .form-control::placeholder {
  color: #8b99aa;
}

.account-security-form .form-control:focus {
  border-color: var(--jas-primary);
  box-shadow: 0 0 0 .2rem rgba(var(--jas-primary-rgb), .14);
}

.account-password-field .form-control {
  border-left: 0;
}

/* 右側還有 toggle 時才拿掉右邊框；僅 prefix+input（帳號欄）保留完整右框。 */
.account-password-field .form-control:not(:last-child) {
  border-right: 0;
}

.account-password-prefix {
  background: #eef2f7;
  border-color: #cbd5e1;
  color: #40566f;
  justify-content: center;
  min-width: 50px;
}

.account-password-toggle {
  align-items: center;
  background: #fff;
  border-color: #cbd5e1;
  border-left: 0;
  color: #64748b;
  display: inline-flex;
  justify-content: center;
  min-width: 50px;
}

.account-password-toggle:hover,
.account-password-toggle:focus {
  background: #eef5ff;
  color: var(--jas-primary);
}

.account-password-icon {
  display: inline-flex;
  height: 20px;
  width: 20px;
}

.account-password-icon svg {
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 20px;
}

.account-password-prefix .account-password-icon svg {
  stroke-width: 2;
}

.account-security-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
}

.account-security-actions .btn {
  min-width: 104px;
  padding-inline: 18px;
}

.account-security-actions .btn-primary {
  background: linear-gradient(135deg, var(--jas-primary), var(--jas-primary-hover));
  border-color: var(--jas-primary-hover);
  box-shadow: 0 .35rem .8rem rgba(var(--jas-primary-rgb), .2);
}

.account-security-actions .btn-primary:hover,
.account-security-actions .btn-primary:focus {
  background: linear-gradient(135deg, var(--jas-primary-hover), var(--jas-primary-active));
  border-color: var(--jas-primary-active);
}

.account-security-help {
  align-items: center;
  background: linear-gradient(135deg, var(--jas-primary), var(--jas-primary-hover));
  color: #fff;
  display: flex;
  padding: 52px 42px;
}

.account-security-help-inner {
  width: 100%;
}

.account-security-help h2 {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 14px;
}

.account-security-help h3 {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.account-security-help p {
  color: rgba(255, 255, 255, .88);
  line-height: 1.7;
  margin: 0;
}

.account-security-checklist {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.account-security-checklist li {
  color: #fff;
  position: relative;
  padding-left: 24px;
}

.account-security-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .22), inset 0 0 0 2px #d2a64b;
}

.account-security-help-note {
  border-top: 1px solid rgba(255, 255, 255, .25);
  margin-top: 26px;
  padding-top: 24px;
}

@media (max-width: 991.98px) {
  .account-security {
    padding: 20px 14px;
  }

  .account-security-panel {
    grid-template-columns: 1fr;
  }

  .account-security-form {
    max-width: none;
  }

  .account-security-help {
    padding: 34px 28px;
  }
}

@media (max-width: 575.98px) {
  .account-security-form-panel {
    padding: 28px 20px;
  }

  .account-security-form-panel h1,
  .account-security-help h2 {
    font-size: 1.55rem;
  }

  .account-security-actions {
    flex-direction: column-reverse;
  }

  .account-security-actions .btn {
    width: 100%;
  }
}

/* 登入頁：沿用 account-security 雙欄，單一主按鈕拉滿寬（未登入無取消鈕）。 */
.account-login-actions {
  justify-content: stretch;
}

.account-login-actions .btn-primary {
  min-width: 0;
  width: 100%;
}

/* LINE 登入（僅 LineOAuth:LoginHost 命中的站台顯示） */
.account-login-line {
  margin-top: 1rem;
  text-align: center;
}

.btn-line-login {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 6px;
  background-color: #06c755;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.btn-line-login:hover,
.btn-line-login:focus {
  color: #fff;
  opacity: 0.88;
}

.account-security-help strong {
  color: #fff;
  font-weight: 700;
}

/* ===== 登入／未登入 auth 頁（_LayoutAuth）===== */
.app-auth-body {
  background: #eef2f7;
}

.app-auth-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-auth-topbar {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}

.app-auth-main {
  align-items: center;
  display: flex;
  flex: 1;
  justify-content: center;
  padding: clamp(20px, 4vw, 48px) 16px;
}

.app-auth-main .account-security {
  margin: 0;
  padding: 0;
  width: min(1040px, 100%);
}

.app-auth-footer {
  color: #64748b;
  font-size: .78rem;
  padding: 12px 16px 18px;
  text-align: center;
}

/* ===== 帳號資料 ===== */
.profile-edit {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 14px 36px;
}

.profile-edit-hero {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-edit-eyebrow {
  color: var(--jas-primary);
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-edit-hero h1 {
  color: #1f2937;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 5px;
}

.profile-edit-hero p {
  color: #64748b;
  margin: 0;
}

.profile-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
}

.profile-edit-card,
.profile-photo-card {
  border-color: #d7e0ea;
  border-radius: 6px;
  box-shadow: 0 .85rem 1.8rem rgba(15, 23, 42, .08);
  overflow: hidden;
}

.profile-edit-card-head {
  background: linear-gradient(135deg, #f7fbff, #fffaf2);
  border-bottom-color: #e5edf5;
  padding: 18px 22px;
}

.profile-edit-card-head h2,
.profile-photo-card h2 {
  color: #1f2937;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 5px;
}

.profile-edit-card-head p {
  color: #64748b;
  font-size: .9rem;
  margin: 0;
}

.profile-edit-card .card-body {
  padding: 22px;
}

.profile-edit .form-label {
  color: #334155;
  font-weight: 600;
  margin-bottom: 7px;
}

.profile-edit .form-control {
  border-color: #cbd5e1;
  min-height: 42px;
}

.profile-edit .form-control:focus {
  border-color: var(--jas-primary);
  box-shadow: 0 0 0 .2rem rgba(var(--jas-primary-rgb), .13);
}

.profile-edit .form-control[readonly] {
  background: #f8fafc;
  color: #64748b;
}

.profile-input-icon {
  background: #eef2f7;
  border-color: #cbd5e1;
  color: #40566f;
  justify-content: center;
  min-width: 44px;
}

.profile-input-icon svg {
  fill: none;
  height: 19px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 19px;
}

.profile-photo-card {
  align-self: start;
}

.profile-photo-top {
  background: linear-gradient(135deg, var(--jas-primary), var(--jas-primary-hover));
  color: #fff;
  padding: 28px 24px 24px;
  text-align: center;
}

.profile-photo-frame {
  align-items: center;
  background: rgba(255, 255, 255, .18);
  border: 3px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  box-shadow: 0 .75rem 1.6rem rgba(15, 23, 42, .18);
  color: #fff;
  display: inline-flex;
  font-size: 2.4rem;
  font-weight: 700;
  height: 124px;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
  width: 124px;
}

.profile-photo-frame img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.profile-photo-initial {
  position: relative;
  z-index: 0;
}

.profile-photo-top h2 {
  color: #fff;
  font-size: 1.35rem;
  margin-bottom: 6px;
}

.profile-photo-top p {
  color: rgba(255, 255, 255, .88);
  margin: 0;
}

.profile-meta-list {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.profile-meta-list div {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5edf5;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
}

.profile-meta-list span {
  color: #64748b;
  font-size: .86rem;
}

.profile-meta-list strong {
  color: #1f2937;
  font-size: .9rem;
  font-weight: 700;
  text-align: right;
}

.profile-photo-actions {
  border-top: 1px solid #e5edf5;
  padding-top: 18px;
}

.profile-edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.profile-edit-actions .btn {
  min-width: 104px;
}

@media (max-width: 991.98px) {
  .profile-edit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .profile-edit {
    padding: 18px 10px 28px;
  }

  .profile-edit-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-edit-actions {
    flex-direction: column-reverse;
  }

  .profile-edit-actions .btn {
    width: 100%;
  }
}

/* ===== 帳號管理 table-form（仿 legacy 4 欄 label|input|label|input）===== */
.user-form-table {
  width: 100%;
  border-collapse: collapse;
}

.user-form-table td {
  padding: 6px 8px;
  vertical-align: middle;
}

.user-form-table .lbl {
  background: #f0f4f8;
  border: 1px solid #d7e0ea;
  color: #334155;
  font-weight: 600;
  font-size: .875rem;
  white-space: nowrap;
  width: 110px;
  text-align: right;
  padding-right: 12px;
}

.user-form-table .val {
  border: 1px solid #d7e0ea;
  min-width: 160px;
}

.user-form-table .val .form-control,
.user-form-table .val .form-select {
  border: none;
  border-radius: 0;
  box-shadow: none;
  min-height: 32px;
  height: 32px;
  padding: 2px 8px;
  font-size: .875rem;
}

.user-form-table .val .form-control:focus,
.user-form-table .val .form-select:focus {
  box-shadow: inset 0 0 0 2px rgba(var(--jas-primary-rgb), .2);
}

.user-form-table .val .form-check {
  display: inline-flex;
  align-items: center;
  margin-right: 12px;
  margin-bottom: 0;
}

.user-form-table .val .form-check-input {
  margin-top: 0;
}

.user-form-table .val .form-control-plaintext {
  font-size: .875rem;
  padding: 2px 8px;
  min-height: 32px;
}

.user-form-table .salary-row td {
  border: 1px solid #d7e0ea;
}

.user-form-table .btn-row td {
  border: none;
  padding-top: 14px;
  text-align: center;
}

.user-form-head {
  background: linear-gradient(135deg, var(--jas-primary), var(--jas-primary-hover));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 6px 6px 0 0;
}

@media (max-width: 767.98px) {
  .user-form-table .lbl,
  .user-form-table .val {
    display: block;
    width: 100%;
    text-align: left;
  }

  .user-form-table .lbl {
    padding: 6px 8px;
  }
}

/* ===== 基本資料主檔（MasterData 清單 / 表單）===== */
.md-page {
  margin: 0 auto;
  max-width: 1440px;
  padding: 16px 24px 40px;
}

.md-page-narrow {
  max-width: 720px;
}

.md-page-form {
  max-width: 1060px;
}

/* 員工主檔等欄位多的表單：吃滿主內容區，後續分頁可橫向延展 */
.md-page-wide {
  max-width: none;
  width: 100%;
}

.md-page-hero {
  margin-bottom: 20px;
}

.md-panel {
  background: #fff;
  border: 1px solid var(--jas-card-border);
  border-radius: 8px;
  box-shadow: var(--jas-soft-shadow);
  overflow: hidden;
}

.md-panel-toolbar {
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
  border-bottom: 1px solid #e5edf5;
  padding: 16px 18px;
}

.md-panel-toolbar .form-control {
  border-color: #cbd5e1;
  min-height: 40px;
}

.md-panel-toolbar .input-group-sm .form-control,
.md-panel-toolbar .input-group-sm .form-select,
.md-panel-toolbar .input-group-sm .input-group-text {
  min-height: 32px;
}

.md-panel-toolbar .input-group-text {
  background: #eef2f7;
  border-color: #cbd5e1;
  color: #40566f;
  font-weight: 600;
}

.md-panel-toolbar .form-control:focus {
  border-color: var(--jas-primary);
  box-shadow: 0 0 0 .2rem rgba(var(--jas-primary-rgb), .13);
}

.md-table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: transparent;
  margin: 0;
}

.md-table thead th {
  background: #f6f9fd;
  border-bottom: 1px solid #e5edf5;
  color: #334155;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding-top: .65rem;
  padding-bottom: .65rem;
}

.md-table tbody td {
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}

.md-table tbody tr:nth-child(even) {
  background: #f6faff;
}

.md-table tbody tr:last-child td {
  border-bottom: 0;
}

.md-table tbody tr:hover {
  background: #edf6ff;
}

.md-sticky-table thead th {
  background: #f6f9fd;
  box-shadow: inset 0 -1px 0 #d8e4f0;
  position: sticky;
  top: var(--jas-sticky-top, 48px);
  z-index: 10;
}

/* Bootstrap 的 .table-responsive 是 overflow-x: auto，依 CSS 規範 overflow-y 會一併算成 auto，
   於是它自己成為捲動容器——表頭的 sticky 就改以「這個容器」為基準，不再是頁面。
   此時再套用給頁面捲動用的 --jas-sticky-top（頂列＋選單列，實測 98px），
   表頭會被硬生生往下推 98px，正好蓋住第二列資料（Menu 文件類別即為一例）。
   容器內的表頭黏在容器頂端就好，故 top 歸零。 */
.table-responsive .md-sticky-table thead th {
  top: 0;
}

.md-cross-hover-table tbody tr.is-cross-hover-row > td {
  background: #edf6ff;
}

.md-cross-hover-table :is(thead th, tbody td).is-cross-hover-col {
  background: #eaf4fb;
}

.md-cross-hover-table tbody tr.is-cross-hover-row > td.is-cross-hover-col {
  background: #dcecf8;
}

/* ===== HR / Attendance ===== */
.attendance-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: .84rem;
}

.attendance-table-wrap {
  overflow-x: auto;
}

.employee-autocomplete-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 1080;
  max-height: 16rem;
  overflow-y: auto;
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .12);
}

.additional-leave-toolbar .input-group-text {
  height: 32px;
  justify-content: center;
  min-width: 58px;
}

.additional-leave-toolbar .accounting-search-group > .form-control,
.additional-leave-toolbar .accounting-search-group .employee-autocomplete {
  height: 32px;
  min-height: 32px;
}

.additional-leave-actions {
  justify-content: flex-start;
}

.additional-leave-actions .btn {
  min-height: 30px;
  padding-bottom: .18rem;
  padding-top: .18rem;
}

.additional-leave-note {
  line-height: 1.45;
  padding-top: .2rem;
}

.additional-leave-user-name[readonly] {
  background: #fff;
  border-color: #e2e8f0;
  color: #334155;
  max-width: 8rem;
}

.additional-leave-grant-panel {
  border-bottom: 1px solid #e5edf5;
  margin: 0;
  padding: .75rem 1rem;
}

.additional-leave-grant-form .card {
  background: #fbfdff;
  border-color: #d8e4f0;
  border-radius: 6px;
}

.additional-leave-grant-form .card-title {
  color: #334155;
  font-weight: 700;
}

.additional-leave-summary {
  border-bottom: 1px solid #e5edf5;
  padding: .85rem 1rem;
}

.additional-leave-summary-grid {
  display: grid;
  gap: .5rem;
  grid-template-columns: repeat(6, minmax(8rem, 1fr));
  margin: 0;
}

.additional-leave-summary-grid > div {
  border-right: 1px solid #e5edf5;
  min-width: 0;
  padding-right: .75rem;
}

.additional-leave-summary-grid > div:last-child {
  border-right: 0;
}

.additional-leave-summary-grid dt {
  color: #64748b;
  font-size: .76rem;
  font-weight: 600;
  margin-bottom: .2rem;
}

.additional-leave-summary-grid dd {
  color: #0f172a;
  font-size: .92rem;
  font-weight: 600;
  margin: 0;
  word-break: keep-all;
}

.additional-leave-table-head {
  padding: .75rem 1rem;
}

/* 卡片標題後的小註記：說明「剩餘時數」只計未過期，避免與下方含過期列的清單對不起來。 */
.additional-leave-summary-grid .additional-leave-dt-note {
  color: #94a3b8;
  font-size: .68rem;
  font-weight: 500;
  white-space: nowrap;
}

/* 已過期的發放列：淡化 + 標記，數值原樣保留（legacy 清單回溯兩年，含已過期）。 */
.additional-leave-row-expired > td {
  color: #94a3b8;
}

.additional-leave-expired-badge {
  background: #f1f5f9;
  border: 1px solid #dbe3ec;
  border-radius: .65rem;
  color: #64748b;
  font-size: .68rem;
  margin-left: .35rem;
  padding: 0 .4rem;
  white-space: nowrap;
}

.additional-leave-table {
  min-width: 1280px;
}

.additional-leave-table th,
.additional-leave-table td {
  white-space: nowrap;
}

.additional-leave-table .additional-leave-memo {
  min-width: 18rem;
  white-space: normal;
}

.additional-leave-detail-frame {
  border: 0;
  height: min(800px, 75vh);
  width: 100%;
}

.additional-leave-detail-modal .modal-content {
  border: 1px solid #b9d4e6;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .24);
  overflow: hidden;
}

.additional-leave-detail-modal .modal-header {
  background: linear-gradient(180deg, #2d8ab8 0%, #0f7199 100%);
  border-bottom: 1px solid #0d6386;
  color: #fff;
  min-height: 48px;
  padding: .65rem .9rem;
}

.additional-leave-detail-modal .modal-title {
  font-size: .98rem;
  font-weight: 700;
}

.additional-leave-detail-modal .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: .85;
}

.additional-leave-detail-page {
  padding: .75rem 1rem 1rem;
}

.additional-leave-detail-panel {
  box-shadow: none;
}

.additional-leave-detail-adjust .input-group-text {
  min-width: auto;
}

.additional-leave-detail-delta {
  width: 16rem;
}

.additional-leave-detail-delta .form-control {
  max-width: 5rem;
}

.additional-leave-detail-expire {
  width: 15rem;
}

.additional-leave-detail-memo-group {
  min-width: 16rem;
}

.additional-leave-detail-help {
  white-space: nowrap;
}

.additional-leave-detail-submit {
  min-width: 3.5rem;
}

.additional-leave-detail-table {
  font-size: .9rem;
  table-layout: fixed;
  width: 100%;
}

.additional-leave-detail-table th,
.additional-leave-detail-table td {
  white-space: nowrap;
}

.additional-leave-detail-col-date {
  width: 16%;
}

.additional-leave-detail-col-docno {
  width: 28%;
}

.additional-leave-detail-col-hours {
  width: 12%;
}

.additional-leave-detail-table .additional-leave-detail-memo {
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 991.98px) {
  .additional-leave-detail-memo-group {
    min-width: 12rem;
  }
}

@media (max-width: 1199.98px) {
  .additional-leave-note {
    padding-top: .45rem;
  }

  .additional-leave-summary-grid {
    grid-template-columns: repeat(3, minmax(9rem, 1fr));
  }

  .additional-leave-summary-grid > div:nth-child(3n) {
    border-right: 0;
  }
}

@media (max-width: 767.98px) {
  .additional-leave-summary-grid {
    grid-template-columns: 1fr;
  }

  .additional-leave-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .additional-leave-actions .btn {
    width: 100%;
  }

  .additional-leave-summary-grid > div {
    border-right: 0;
    border-bottom: 1px solid #e5edf5;
    padding-bottom: .5rem;
    padding-right: 0;
  }

  .additional-leave-summary-grid > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
}

/* ===== Finance / Accounting ===== */
.accounting-page .accounting-hero {
  display: grid;
  gap: .45rem;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: .9rem;
}

.accounting-page .accounting-eyebrow {
  color: var(--jas-primary);
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: .35rem;
}

.accounting-page .accounting-hero h1 {
  border-bottom: 1px solid #cfe0e8;
  color: #087f9a;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  padding-bottom: .4rem;
}

.accounting-page .accounting-hero p {
  grid-column: 1 / -1;
  line-height: 1.45;
  margin-top: .1rem;
}

.accounting-page .accounting-hero > .btn {
  align-self: end;
  margin-bottom: .35rem;
}

.accounting-page .accounting-list-hero {
  row-gap: .7rem;
}

.accounting-page .accounting-list-hero .accounting-hero-title {
  grid-column: 1 / -1;
}

.accounting-page .accounting-list-hero .accounting-hero-body {
  align-items: center;
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 1rem;
  margin-top: -.1rem;
}

.accounting-page .accounting-list-hero .accounting-hero-body p {
  flex: 1 1 auto;
  margin: 0;
}

.accounting-page .accounting-list-hero .accounting-hero-body .btn {
  flex: 0 0 auto;
}

.accounting-form-page .accounting-hero {
  align-items: end;
}

.accounting-form-page {
  max-width: 1060px;
}

.accounting-workbench-page {
  max-width: none;
  padding-left: 10px;
  padding-right: 10px;
  width: 100%;
}

.accounting-workbench-page .accounting-hero {
  margin-bottom: .45rem;
}

.accounting-workbench-page .accounting-eyebrow {
  margin-bottom: .15rem;
}

.accounting-workbench-page .accounting-hero h1 {
  padding-bottom: .25rem;
}

.accounting-workbench-page .md-panel-toolbar {
  padding: 10px 12px;
}

.accounting-workbench-page .accounting-table-wrap {
  overflow-x: visible;
  overflow-y: visible;
}

.accounting-workbench-page .accounting-table {
  min-width: 0;
  width: 100%;
}

.accounting-workbench-page .voucher-entry-table thead th {
  position: static;
  top: auto;
  z-index: auto;
}

.voucher-entry-out-page .voucher-entry-table thead th {
  position: sticky;
  top: var(--jas-sticky-top, 48px);
  z-index: 10;
}

.accounting-workbench-page .accounting-search-group .input-group-text,
.accounting-workbench-page .accounting-search-group .form-control,
.accounting-workbench-page .accounting-search-group .form-select,
.accounting-workbench-page .accounting-table .form-control,
.accounting-workbench-page .accounting-table .form-select {
  font-size: .8rem;
  min-height: 26px;
  padding-bottom: .12rem;
  padding-top: .12rem;
}

.accounting-workbench-page .accounting-table tbody td {
  padding: .18rem .25rem;
}

.accounting-workbench-page .accounting-table thead th {
  padding-bottom: .28rem;
  padding-top: .28rem;
}

.accounting-workbench-page .voucher-entry-options {
  min-height: 28px;
}

.accounting-workbench-page .reallocate-create-panel .md-panel-toolbar,
.accounting-workbench-page .reallocate-product-toolbar {
  padding: 0 !important;
}

.reallocate-page .md-panel {
  border-color: #d7dee6;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(15, 23, 42, .08);
  margin-bottom: 12px;
}

.reallocate-page .md-panel-toolbar {
  background: #fff;
  border-bottom-color: #d8e0e8;
}

.product-reallocate-page .reallocate-query-panel,
.product-acceptance-page .reallocate-query-panel {
  margin-bottom: 20px;
}

.reallocate-page .reallocate-create-panel .md-panel-toolbar,
.reallocate-page .reallocate-product-toolbar {
  background: #fff;
}

.reallocate-section-title {
  background: #eef4f8;
  border-bottom: 1px solid #d5e0e8;
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 10px;
  padding: 8px 12px;
}

.reallocate-page .reallocate-section-title {
  color: #0f4e75;
}

.reallocate-subsection-title {
  background: transparent;
  color: #334155;
  margin: 14px 12px 8px;
  padding: 0;
}

.reallocate-receiver-grid + .reallocate-note-grid {
  margin-top: 8px;
}

.reallocate-page .reallocate-product-toolbar .reallocate-section-title {
  background: #e7f2fa;
  border-bottom-color: #cfe0ea;
  color: #0f5f8f;
}

.reallocate-page .reallocate-table-title {
  background: #f8fafc;
  border-bottom: 1px solid #d8e0e8;
  padding: 8px 12px;
}

.reallocate-page .reallocate-table-title h2 {
  color: #0f172a;
  font-size: .9rem;
  font-weight: 700;
}

.reallocate-page .inventory-table {
  border-collapse: collapse;
}

.reallocate-page .inventory-table thead th {
  background: #f8fafc;
  border: 1px solid #dce3ea;
  color: #0f172a;
  font-size: .8rem;
  padding: .55rem .45rem;
  text-align: center;
}

.reallocate-page .inventory-table tbody td {
  border: 1px solid #e1e7ee;
  padding: .45rem .45rem;
}

.reallocate-page .inventory-table tbody tr:nth-child(even) {
  background: #fff;
}

.reallocate-page .inventory-table tbody tr:hover {
  background: #f6fbff;
}

.reallocate-page .inventory-table .table-light td,
.reallocate-page .inventory-table tr.table-light td {
  background: #f9fafb;
  font-weight: 700;
}

.reallocate-header-grid {
  display: grid;
  gap: .35rem .45rem;
  grid-template-columns: minmax(170px, .8fr) minmax(170px, .8fr) minmax(290px, 1.4fr) minmax(290px, 1.4fr);
  padding: 0 12px 12px;
}

.reallocate-receiver-grid {
  display: grid;
  gap: .35rem .45rem;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) minmax(260px, 1fr);
  padding: 0 12px;
}

.reallocate-note-grid {
  display: grid;
  gap: .35rem .45rem;
  grid-template-columns: auto;
  padding: 0 12px 10px;
}

.reallocate-note-grid textarea.form-control {
  min-height: 42px;
}

.reallocate-direct-check {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #cbdcec;
  display: flex;
  min-height: 42px;
  padding: 0 .65rem;
}

.reallocate-product-add-grid {
  align-items: center;
  display: grid;
  gap: .45rem;
  grid-template-columns: minmax(360px, .42fr) auto 1fr;
  padding: 0 12px 12px;
}

.reallocate-note-panel {
  margin-top: .85rem;
}

.reallocate-legacy-note-row {
  align-items: stretch;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
}

.reallocate-note-label {
  align-items: center;
  background: #eef2f6;
  border-right: 1px solid #d8e0e8;
  color: #1f2937;
  display: flex;
  font-size: .82rem;
  font-weight: 700;
  justify-content: center;
  min-height: 88px;
}

.reallocate-legacy-note-row textarea {
  border: 0;
  border-radius: 0;
  min-height: 88px;
  resize: vertical;
}

.reallocate-bottom-actions {
  align-items: center;
  display: flex;
  gap: .75rem;
  justify-content: center;
  margin: .75rem 0 1.2rem;
}

.reallocate-product-panel .reallocate-product-subsection {
  padding: 12px;
}

.reallocate-product-panel .reallocate-product-subsection + .reallocate-product-subsection {
  border-top: 1px solid #d8e0e8;
}

.reallocate-product-panel .reallocate-product-subsection .inventory-table {
  border-bottom: 1px solid #dce3ea;
}

.tab-content > .reallocate-content-tab.active {
  display: grid;
  gap: 12px;
}

.reallocate-content-tab > .md-panel,
.reallocate-content-tab > form {
  margin-bottom: 0 !important;
}

.reallocate-receiver-toolbar .reallocate-receiver-grid {
  padding-bottom: 12px;
}

.reallocate-product-summary {
  color: #64748b;
  font-size: .8rem;
  justify-self: end;
  white-space: nowrap;
}

.reallocate-product-summary strong,
.reallocate-item-count {
  color: #0f5f8f;
  font-variant-numeric: tabular-nums;
}

.reallocate-item-count {
  background: #e7f2fa;
  border-radius: 999px;
  font-size: .72rem;
  margin-left: .3rem;
  padding: .1rem .45rem;
}

.reallocate-item-panel .inventory-table tbody td {
  min-height: 52px;
}

.reallocate-row-action-cell {
  padding: .3rem !important;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.reallocate-row-action-form {
  display: inline-block;
  margin: 0;
}

.reallocate-row-action-form + .reallocate-row-action-form {
  margin-left: .25rem;
}

.reallocate-row-action-btn {
  background: #fff;
  border: 1px solid #0d6efd;
  border-radius: 4px;
  color: #0d6efd;
  display: inline-block;
  font-family: inherit;
  font-size: .82rem;
  line-height: 1.45;
  min-width: 48px;
  padding: .22rem .5rem;
  text-align: center;
}

.reallocate-row-action-btn:hover,
.reallocate-row-action-btn:focus {
  background: #0d6efd;
  color: #fff;
}

.reallocate-row-delete-btn {
  border-color: #dc3545;
  color: #dc3545;
}

.reallocate-row-delete-btn:hover,
.reallocate-row-delete-btn:focus {
  background: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

.reallocate-row-convert-btn {
  min-width: 62px;
}

.reallocate-content-tab .reallocate-note-panel {
  margin-top: 0;
}

.reallocate-content-tab .reallocate-legacy-note-row textarea {
  min-height: 72px;
}

.reallocate-submit-actions {
  border-top: 1px solid #d8e0e8;
  justify-content: flex-end;
  margin: 0;
  padding: 12px 0 0;
}

@media (max-width: 1200px) {
  .reallocate-header-grid,
  .reallocate-receiver-grid,
  .reallocate-note-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reallocate-product-add-grid {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 768px) {
  .reallocate-header-grid,
  .reallocate-receiver-grid,
  .reallocate-note-grid,
  .reallocate-product-add-grid {
    grid-template-columns: 1fr;
  }
}

.accounting-workbench-page .voucher-entry-header-grid {
  display: grid;
  gap: .35rem .45rem;
  grid-template-columns: minmax(210px, .95fr) minmax(170px, .75fr) minmax(360px, 1.8fr);
}

.accounting-workbench-page .voucher-header-date {
  grid-column: 1;
  grid-row: 1;
}

.accounting-workbench-page .voucher-header-no {
  grid-column: 2;
  grid-row: 1;
}

.accounting-workbench-page .voucher-header-summary {
  grid-column: 3;
  grid-row: 1;
}

.accounting-workbench-page .voucher-header-branch {
  grid-column: 1;
  grid-row: 2;
}

.accounting-workbench-page .voucher-header-currency {
  grid-column: 2;
  grid-row: 2;
}

.accounting-workbench-page .voucher-header-supplier {
  grid-column: 3;
  grid-row: 2;
}

.accounting-workbench-page .voucher-company-select {
  max-width: 300px;
  min-width: 220px;
}

.accounting-workbench-page .voucher-entry-table {
  table-layout: fixed;
}

.accounting-workbench-page .voucher-entry-table th,
.accounting-workbench-page .voucher-entry-table td {
  overflow: hidden;
}

.accounting-workbench-page .voucher-col-branch {
  width: 14%;
}

.accounting-workbench-page .voucher-col-code {
  width: 10%;
}

.accounting-workbench-page .voucher-col-title {
  width: 15%;
}

.accounting-workbench-page .voucher-col-currency {
  width: 6%;
}

.accounting-workbench-page .voucher-col-amount {
  width: 8.5%;
}

.accounting-workbench-page .voucher-col-summary {
  width: 13.5%;
}

.accounting-workbench-page .voucher-entry-table .line-branch-select,
.accounting-workbench-page .voucher-entry-table .currency-select {
  padding-left: .35rem;
  padding-right: 1.45rem;
}

.accounting-workbench-page .voucher-account-code-group .account-picker-button {
  align-items: center;
  display: inline-flex;
  font-size: .78rem;
  justify-content: center;
  padding-left: .38rem;
  padding-right: .38rem;
}

.voucher-query-page .voucher-query-search {
  padding: 8px 12px;
}

.voucher-query-page .accounting-search-group .input-group-text,
.voucher-query-page .accounting-search-group .form-control,
.voucher-query-page .accounting-search-group .form-select {
  font-size: .84rem;
  min-height: 30px;
  padding-bottom: .18rem;
  padding-top: .18rem;
}

.voucher-query-page .voucher-query-foreign-toggle,
.voucher-query-page .voucher-query-search-actions {
  min-height: 30px;
}

.voucher-query-page .voucher-query-search-actions {
  align-items: center;
  display: flex;
  justify-content: flex-end;
}

.voucher-query-page .voucher-query-search-actions .btn {
  min-height: 30px;
  padding-bottom: .18rem;
  padding-top: .18rem;
}

.voucher-query-page .voucher-query-branch-group {
  align-items: stretch;
}

.voucher-query-page .voucher-query-branch-group .input-group-text {
  align-items: flex-start;
  padding-top: .32rem;
}

.voucher-query-page .voucher-query-branch-control {
  align-items: center;
  background: #fff;
  display: flex;
  height: auto;
  min-height: 30px;
  padding: .18rem .5rem;
}

.voucher-query-page .voucher-query-branch-control .gbp-root {
  width: 100%;
}

.voucher-query-page .voucher-query-branch-control .gbp-toggle {
  font-size: .82rem;
}

.voucher-query-page .voucher-query-branch-control .gbp-body {
  margin-top: 6px;
}

.voucher-query-page .voucher-query-op-head {
  width: 78px;
}

.voucher-query-page .voucher-query-op-cell {
  width: 78px;
}

.voucher-query-page .voucher-query-op-btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  line-height: 1;
  margin-right: 2px;
  min-height: 24px;
  padding-left: 0;
  padding-right: 0;
  width: 24px;
}

.voucher-query-page .accounting-table tbody td {
  padding-bottom: .32rem;
  padding-top: .32rem;
}

.voucher-query-page .voucher-query-nowrap {
  white-space: nowrap;
}

.voucher-query-page .voucher-query-rate-col {
  width: 46px;
}

.voucher-query-page .voucher-query-receipt-link {
  color: var(--bs-link-color);
  text-decoration: none;
}

.voucher-query-page .voucher-query-receipt-link:hover {
  color: var(--bs-link-hover-color);
  text-decoration: none;
}

.popup-layout {
  background: #fff;
  color: var(--bs-body-color);
  font-family: var(--bs-body-font-family);
  font-size: var(--bs-body-font-size);
}

.popup-layout .print-voucher-page {
  margin: 0;
  max-width: none;
  padding: 1.25rem;
}

.popup-layout .print-voucher-page .md-panel {
  border-color: #cfe2ff;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 41, 66, .12);
}

.popup-layout .print-voucher-page .table {
  margin-bottom: 0;
}

.popup-layout .print-voucher-toolbar {
  align-items: center;
  background: linear-gradient(180deg, #fbfdff 0%, #eef6ff 100%);
  border-bottom: 1px solid #d8e8f7;
  display: flex;
  min-height: 48px;
  padding: .65rem 1rem;
}

.popup-layout .print-voucher-toolbar .form-check-input {
  border-color: #8bb8dc;
}

.popup-layout .print-voucher-toolbar .form-check-input:checked {
  background-color: var(--jas-primary);
  border-color: var(--jas-primary);
}

.popup-layout .print-voucher-body {
  background: #fff;
  padding: 1.1rem 1rem 1rem;
}

.popup-layout .print-voucher-heading {
  position: relative;
}

.popup-layout .print-voucher-heading .fw-semibold {
  color: #0f2942;
}

.popup-layout .print-voucher-meta {
  color: #52677f;
  margin-top: .45rem;
  text-align: right;
}

.popup-layout .print-voucher-summary {
  background: #f8fbff;
  border: 1px solid #d8e8f7;
  border-radius: 6px;
  color: #0f2942;
  overflow: hidden;
}

.popup-layout .print-voucher-summary-cell {
  align-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f2f7fc 100%);
  display: flex;
  font-size: .92rem;
  justify-content: center;
  line-height: 1.2;
  min-height: 30px;
  padding: .2rem .75rem;
}

.popup-layout .print-voucher-summary-value {
  color: #0f2942;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
}

.popup-layout .print-voucher-summary-cell + .print-voucher-summary-cell {
  border-left: 1px solid #d8e8f7;
}

.popup-layout .print-voucher-page .accounting-table {
  border: 1px solid #d8e8f7;
  border-radius: 6px;
  overflow: visible;
  table-layout: auto;
  width: 100%;
}

.popup-layout .print-voucher-page .accounting-table thead th {
  background: #edf6ff;
  border-bottom: 1px solid #cfe2ff;
  color: #0f2942;
  position: sticky;
  top: 0;
  z-index: 5;
}

.popup-layout .print-voucher-page .accounting-table-wrap {
  overflow: visible;
}

.popup-layout .print-voucher-page .accounting-table tbody tr:nth-child(even) {
  background: #f3f8fd;
}

.popup-layout .print-voucher-signature {
  border: 1px solid #d8e8f7;
  border-radius: 6px;
  overflow: hidden;
}

.popup-layout .print-voucher-signature-cell {
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
  border-bottom: 1px solid #d8e8f7;
  min-height: 32px;
  padding: .45rem .65rem;
}

.popup-layout .print-voucher-signature-cell:nth-child(2) {
  border-left: 1px solid #d8e8f7;
}

.popup-layout .print-voucher-signature-cell:last-child {
  border-bottom: 0;
}

.popup-layout .print-voucher-actions {
  background: #fbfdff;
  border-top: 1px solid #d8e8f7;
  margin: 1rem -1rem -1rem;
  padding: .85rem 1rem;
}

.accounting-workbench-page .voucher-entry-table .account-title-display {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voucher-entry-out-page .voucher-entry-today-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.voucher-entry-out-page .voucher-entry-today-header h2 {
  color: #0f2942;
  font-size: .92rem;
  font-weight: 700;
}

.voucher-entry-out-page .voucher-entry-today-table thead th {
  font-size: .78rem;
  font-weight: 700;
  padding: .48rem .5rem;
  text-align: center;
}

.voucher-entry-out-page .voucher-entry-today-table tbody td {
  color: #334155;
  font-size: .8125rem;
  line-height: 1.38;
  padding: .45rem .5rem;
}

.voucher-entry-out-page .voucher-entry-today-receipt a {
  font-weight: 600;
  text-decoration: none;
}

.voucher-entry-out-page .voucher-entry-today-receipt a:hover {
  text-decoration: underline;
}

.voucher-entry-out-page .voucher-entry-today-edit {
  line-height: 1;
  min-height: 24px;
  padding: .18rem .45rem;
}

.accounting-workbench-page .voucher-total-row td {
  background: #f4f4f4;
  padding-bottom: .24rem;
  padding-top: .24rem;
  vertical-align: middle;
}

.accounting-workbench-page .voucher-tax-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .3rem;
}

.accounting-workbench-page .voucher-tax-tools .form-check-input {
  margin-top: .18rem;
}

/* 稅額工具列擠在「科目號碼+科目名稱」兩欄寬內，縮小文字與內距避免 2214 銷項稅額 換行跑版。 */
.accounting-workbench-page .voucher-tax-tools .btn {
  font-size: .72rem;
  padding: .1rem .35rem;
  white-space: nowrap;
}

.accounting-workbench-page .voucher-tax-tools .form-check-label,
.accounting-workbench-page .voucher-tax-tools > .fw-semibold {
  font-size: .78rem;
}

.accounting-workbench-page .voucher-entry-actions {
  min-height: 30px;
}

.voucher-tax-calculator-trigger {
  background: #fff;
  bottom: 44px;
  box-shadow: 0 8px 22px rgba(15, 113, 153, .14);
  position: fixed;
  right: 28px;
  z-index: 1020;
}

.voucher-account-modal .modal-header {
  background: linear-gradient(180deg, #2d8ab8 0%, #0f7199 100%);
  border-bottom: 1px solid #0d6386;
  color: #fff;
}

.voucher-calculator-modal .modal-header {
  background: linear-gradient(180deg, #2d8ab8 0%, #0f7199 100%);
  border-bottom: 1px solid #0d6386;
  color: #fff;
}

.voucher-account-modal .modal-title {
  font-size: .95rem;
  font-weight: 700;
}

.voucher-calculator-modal .modal-title {
  font-size: .95rem;
  font-weight: 700;
}

.voucher-account-modal .btn-close,
.voucher-calculator-modal .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: .85;
}

.voucher-account-modal .modal-body {
  background: #fbfdff;
}

.voucher-calculator-modal .modal-body {
  background: #fbfdff;
}

.voucher-calculator-dialog {
  max-width: 420px;
}

.voucher-calculator-modal .input-group-text {
  background: #eef6fb;
  border-color: #bfd4e3;
  color: #315b75;
  font-weight: 700;
  min-width: 58px;
}

.voucher-calculator-modal .form-control,
.voucher-calculator-modal .btn {
  border-color: #bfd4e3;
}

.voucher-calculator-results {
  border: 1px solid #d8e6ef;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.voucher-calculator-result {
  align-items: center;
  border-bottom: 1px solid #e3eef5;
  display: grid;
  gap: .45rem;
  grid-template-columns: 64px minmax(0, 1fr);
  padding: .45rem;
}

.voucher-calculator-result:nth-child(odd) {
  border-right: 1px solid #e3eef5;
}

.voucher-calculator-result:nth-last-child(-n+2) {
  border-bottom: 0;
}

.voucher-calculator-result span {
  color: #315b75;
  font-weight: 700;
}

.voucher-account-search-group .input-group-text {
  background: #eef6fb;
  border-color: #bfd4e3;
  color: #315b75;
  font-weight: 700;
  min-width: 58px;
}

.voucher-account-search-group .form-control,
.voucher-account-search-group .btn {
  border-color: #bfd4e3;
}

.voucher-account-search-group .btn {
  min-width: 72px;
  white-space: nowrap;
}

/* 科目選擇鈕：舊站是欄位旁的 add_to_list 圖示鈕；新站改成放大鏡＋文字的實體按鈕，
   刻意與 input-group 分離（左邊留空隙、獨立圓角、陰影），讓人一眼看出可點並會跳出科目清單。 */
.account-title-pick-btn {
  align-items: center;
  background: linear-gradient(180deg, #2d8ab8 0%, #0f7199 100%);
  border: 1px solid #0d6386;
  border-radius: .375rem !important;
  box-shadow: 0 1px 3px rgba(15, 113, 153, .4);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 600;
  gap: .3rem;
  padding: .15rem .6rem;
  white-space: nowrap;
}

/* bootstrap 的 .input-group > :not(:first-child) 會塞 margin-left:-1px 把鈕黏在欄位上，
   這裡改成左右留空隙讓它像獨立按鈕；後面的科目名稱欄位補回自己的圓角。 */
.input-group > .account-title-pick-btn {
  margin-left: .4rem !important;   /* bootstrap 的 :not() 串接選擇器特異性較高，需 important 才蓋掉 -1px */
  margin-right: .4rem;
}

.account-title-pick-btn + .form-control {
  border-radius: .375rem !important;
}

.account-title-pick-btn:hover,
.account-title-pick-btn:focus {
  background: linear-gradient(180deg, #3ba0d0 0%, #1381ad 100%);
  box-shadow: 0 2px 6px rgba(15, 113, 153, .45);
  color: #fff;
}

.account-title-pick-btn:active {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .25);
  transform: translateY(1px);
}

.account-title-pick-btn:focus-visible {
  outline: 2px solid #7cc4e0;
  outline-offset: 1px;
}

/* 傳票登錄類表格每列一顆時只放圖示（欄位窄，放文字會撐寬欄位）。 */
.account-title-pick-btn.account-title-pick-btn-icon {
  padding: .1rem .35rem;
}

.input-group > .account-title-pick-btn.account-title-pick-btn-icon {
  margin-left: .25rem !important;
  margin-right: 0;
}

.account-title-pick-btn svg {
  fill: none;
  height: 14px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
  width: 14px;
}

.voucher-account-result-wrap {
  border: 1px solid #cdd6df;
  max-height: 470px;
  overflow: auto;
}

.voucher-account-result-table th {
  background: #edf6fb;
  color: #244c63;
  position: sticky;
  top: 0;
  z-index: 1;
}

.voucher-account-result-row {
  cursor: pointer;
}

.voucher-account-result-row:hover,
.voucher-account-result-row:focus {
  background: #eaf4fb;
  outline: none;
}

@media (max-width: 1399.98px) {
  .accounting-workbench-page .voucher-entry-header-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .accounting-workbench-page .voucher-entry-header-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .accounting-workbench-page .voucher-header-date,
  .accounting-workbench-page .voucher-header-no,
  .accounting-workbench-page .voucher-header-summary,
  .accounting-workbench-page .voucher-header-branch,
  .accounting-workbench-page .voucher-header-currency,
  .accounting-workbench-page .voucher-header-supplier {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 575.98px) {
  .accounting-workbench-page .voucher-entry-header-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .voucher-tax-calculator-trigger {
    bottom: 18px;
    right: 14px;
  }

  .voucher-calculator-results {
    grid-template-columns: minmax(0, 1fr);
  }

  .voucher-calculator-result:nth-child(odd) {
    border-right: 0;
  }

  .voucher-calculator-result:nth-last-child(2) {
    border-bottom: 1px solid #e3eef5;
  }
}

.accounting-form-shell {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.accounting-form-panel {
  border-color: #cbdcec;
}

.accounting-page .md-panel {
  overflow: visible;
}

/* 0704 批次入庫：保留 legacy 三欄廠商清單的閱讀尺寸與欄位位置。 */
.batch-storage-import-form {
  font-family: Arial, "Microsoft JhengHei", sans-serif;
  font-size: 14px;
}

.batch-storage-import {
  padding: 24px 2px 0;
}

.batch-storage-import .form-check {
  line-height: 22px;
  margin: 0;
  min-height: 22px;
}

.batch-storage-import .form-check-input {
  margin-top: .2em;
}

.batch-storage-order-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  margin-bottom: 28px;
}

.batch-storage-supplier-row {
  align-items: start;
  column-gap: 16px;
  display: grid;
  grid-template-columns: 62px max-content;
}

.batch-storage-supplier-label {
  line-height: 22px;
  white-space: nowrap;
}

.batch-storage-supplier-grid {
  column-gap: 16px;
  display: grid;
  grid-template-columns: repeat(3, max-content);
  row-gap: 13px;
}

.batch-storage-supplier-spacer {
  min-height: 22px;
}

.batch-storage-purchase-suppliers {
  column-gap: 14px;
  display: flex;
  flex-wrap: wrap;
  row-gap: 8px;
}

.batch-storage-field {
  margin-top: 22px;
}

.batch-storage-field .form-label {
  display: block;
  line-height: 22px;
  margin-bottom: 8px;
}

.batch-storage-import .form-select,
.batch-storage-import .form-control,
.batch-storage-import .btn {
  font-size: 14px;
}

.batch-storage-import-action {
  margin-top: 30px;
}

.batch-storage-file-input {
  display: none;
}

.batch-storage-result-currency {
  width: auto;
}

.batch-storage-result-table {
  font-size: 14px;
}

.batch-storage-result-table a {
  text-decoration: none;
}

.accounting-page .table-responsive.md-sticky-table {
  overflow: visible;
}

.accounting-master-form-card .card-body {
  padding: 22px;
}

.petty-cash-form-shell {
  display: block;
  margin: 0 auto;
  max-width: 1280px;
}

.petty-cash-form-card {
  overflow: hidden;
}

.petty-cash-form-card .profile-edit-card-head {
  padding: 16px 22px;
}

.petty-cash-form-card .profile-edit-card-head h2 {
  font-size: 1.05rem;
}

.petty-cash-form-card .profile-edit-card-head p {
  font-size: .88rem;
}

.petty-cash-form-card .card-body {
  background: #fbfdff;
  padding: 20px 22px;
}

.petty-cash-form-card .accounting-search-group .input-group-text {
  min-width: 82px;
}

.petty-cash-form-card .accounting-search-group .btn {
  border-color: #cbd5e1;
}

.petty-cash-account-group .account-code-input {
  flex: 0 0 34%;
  min-width: 96px;
}

.petty-cash-account-group .account-title-display {
  flex: 1 1 auto;
  min-width: 150px;
}

.ledger-query-account-group .account-code-input {
  flex: 0 0 34%;
  min-width: 96px;
}

.ledger-query-account-group .account-title-display {
  flex: 1 1 auto;
  min-width: 150px;
}

@media (max-width: 991.98px) {
  .petty-cash-account-group {
    flex-wrap: wrap;
  }

  .petty-cash-account-group .input-group-text,
  .petty-cash-account-group .account-code-input,
  .petty-cash-account-group .account-title-display {
    flex: 1 1 auto;
  }

  .petty-cash-account-group .btn {
    flex: 0 0 42px;
  }

  .ledger-query-account-group {
    flex-wrap: wrap;
  }

  .ledger-query-account-group .input-group-text,
  .ledger-query-account-group .account-code-input,
  .ledger-query-account-group .account-title-display {
    flex: 1 1 auto;
  }

  .ledger-query-account-group .btn {
    flex: 0 0 42px;
  }
}

.accounting-master-form-card .input-group-text,
.accounting-input-group .input-group-text {
  background: #edf5fb;
  border-color: #cbdcec;
  color: #28536f;
  justify-content: center;
  min-width: 72px;
  white-space: nowrap;
}

.accounting-search-group .input-group-text {
  background: #edf5fb;
  border-color: #cbdcec;
  color: #28536f;
  font-weight: 700;
  justify-content: center;
  min-width: 86px;
}

.accounting-search-group .form-control,
.accounting-search-group .form-select {
  border-color: #cbd5e1;
}

.product-reallocate-search-grid {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns:
    minmax(15rem, 1fr)
    minmax(28rem, 1.35fr)
    minmax(16rem, 1fr)
    minmax(16rem, 1fr);
  grid-template-areas:
    "stock-order stock-date product stock-out"
    "stock-in create-date remark actions";
}

.product-reallocate-search-field,
.product-reallocate-search-actions {
  min-width: 0;
}

.product-reallocate-search-grid .accounting-search-group {
  width: 100%;
}

.product-reallocate-search-grid .accounting-search-group > .input-group-text:first-child {
  flex: 0 0 86px;
}

.product-reallocate-date-group input[type="date"].form-control {
  flex: 1 1 10rem;
  min-width: 10rem;
}

.product-reallocate-date-group .input-group-text:first-child {
  flex: 0 0 86px;
}

.product-reallocate-date-group .input-group-text:not(:first-child) {
  flex: 0 0 42px;
  min-width: 42px;
}

.product-reallocate-search-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.product-reallocate-stock-order-field { grid-area: stock-order; }
.product-reallocate-stock-date-field { grid-area: stock-date; }
.product-reallocate-product-field { grid-area: product; }
.product-reallocate-stock-out-field { grid-area: stock-out; }
.product-reallocate-stock-in-field { grid-area: stock-in; }
.product-reallocate-create-date-field { grid-area: create-date; }
.product-reallocate-remark-field { grid-area: remark; }
.product-reallocate-search-actions { grid-area: actions; }

@media (max-width: 1399.98px) {
  .product-reallocate-search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "stock-order product"
      "stock-date stock-date"
      "stock-out stock-in"
      "create-date create-date"
      "remark actions";
  }
}

@media (max-width: 575.98px) {
  .product-reallocate-page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .product-reallocate-page .accounting-list-hero .accounting-hero-body {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .product-reallocate-page .accounting-list-hero .accounting-hero-body p {
    width: 100%;
  }

  .product-reallocate-page .accounting-list-hero .accounting-hero-body .btn {
    align-self: flex-start;
    width: auto;
  }

  .product-reallocate-search-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "stock-order"
      "stock-date"
      "product"
      "stock-out"
      "stock-in"
      "create-date"
      "remark"
      "actions";
  }

  .product-reallocate-date-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  }

  .product-reallocate-date-group .input-group-text:first-child {
    grid-column: 1 / -1;
  }

  .product-reallocate-date-group input[type="date"].form-control {
    min-width: 0;
    width: 100%;
  }
}

.accounting-section-panel {
  background: #fff;
  border: 1px solid #b8d5e6;
  border-radius: 4px;
  overflow: hidden;
}

.accounting-section-heading {
  background: #eef6fb;
  border-bottom: 1px solid #b8d5e6;
  color: #0f3760;
  display: block;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: 30px;
  padding: .45rem .9rem;
  width: 100%;
}

.accounting-section-body {
  background: #fff;
  padding: .55rem .65rem;
}

.accounting-compact-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.accounting-compact-group {
  flex-wrap: nowrap;
  min-width: 0;
}

.accounting-compact-group .input-group-text {
  background: #eef6fb;
  border-color: #b8d5e6;
  color: #0f3760;
  font-size: .8rem;
  font-weight: 700;
  min-height: 28px;
  padding-bottom: .1rem;
  padding-top: .1rem;
}

.accounting-compact-group .form-control,
.accounting-compact-group .form-select {
  border-color: #b8d5e6;
  font-size: .8rem;
  height: 28px;
  line-height: 1.1;
  min-height: 28px;
  padding-bottom: .1rem;
  padding-top: .1rem;
}

.accounting-compact-group .btn {
  font-size: .8rem;
  height: 28px;
  line-height: 1.1;
  min-height: 28px;
  padding-bottom: .1rem;
  padding-top: .1rem;
  white-space: nowrap;
}

.receivable-collection-search-grid {
  align-items: stretch;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.receivable-collection-field,
.receivable-collection-action-field {
  min-width: 0;
}

.receivable-collection-account-field,
.receivable-collection-currency-field,
.receivable-collection-branch-field,
.receivable-collection-date-field,
.receivable-collection-view-field {
  grid-column: span 3;
}

.receivable-collection-search-grid .accounting-search-group {
  flex-wrap: nowrap;
  width: 100%;
}

.receivable-collection-search-grid .accounting-search-group > .input-group-text:first-child {
  flex: 0 0 86px;
  min-width: 86px;
}

.receivable-collection-date-group .input-group-text:first-child {
  flex: 0 0 86px;
  min-width: 86px;
}

.receivable-collection-date-group .input-group-text:not(:first-child) {
  flex: 0 0 36px;
  min-width: 36px;
}

.receivable-collection-date {
  min-width: 0;
  width: 100%;
}

.receivable-collection-view-field {
  grid-column: 1 / span 3;
}

.receivable-collection-action-field {
  align-self: end;
  display: flex;
  grid-column: 12 / span 1;
  grid-row: 2;
  justify-content: end;
}

.receivable-collection-action-field .btn {
  min-width: 46px;
}

@media (max-width: 1399.98px) {
  .receivable-collection-search-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .receivable-collection-account-field,
  .receivable-collection-currency-field,
  .receivable-collection-branch-field,
  .receivable-collection-date-field {
    grid-column: span 3;
  }

  .receivable-collection-view-field {
    grid-column: 1 / span 3;
  }

  .receivable-collection-action-field {
    grid-column: 6 / span 1;
    grid-row: auto;
  }
}

@media (max-width: 991.98px) {
  .receivable-collection-search-grid {
    grid-template-columns: 1fr;
  }

  .receivable-collection-account-field,
  .receivable-collection-currency-field,
  .receivable-collection-branch-field,
  .receivable-collection-date-field,
  .receivable-collection-view-field,
  .receivable-collection-action-field {
    grid-column: auto;
    grid-row: auto;
  }

  .receivable-collection-date-group {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) 36px minmax(0, 1fr);
  }

  .receivable-collection-date-group .form-control {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .receivable-collection-date-group {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .receivable-collection-date-group .input-group-text:not(:first-child) {
    grid-column: 1;
  }
}

.accounting-check-group .form-control {
  align-items: center;
  display: flex;
  gap: 1rem;
  min-height: 38px;
}

.accounting-check-group .form-check {
  margin-bottom: 0;
}

.accounting-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: .84rem;
}

.accounting-table-wrap {
  overflow: visible;
}

.arap-management-page {
  overflow: visible;
}

.arap-management-page .arap-matrix-browser-scroll {
  overflow: visible;
}

.arap-management-page .arap-matrix-table {
  font-size: 12px;
  min-width: 1320px;
  table-layout: fixed;
  white-space: nowrap;
  width: 1320px;
}

.arap-management-page .arap-matrix-table th,
.arap-management-page .arap-matrix-table td {
  font-size: 12px;
}

.arap-management-page .arap-matrix-table th:first-child,
.arap-management-page .arap-matrix-table td:first-child {
  width: 126px;
}

.arap-management-page .arap-matrix-table th:not(:first-child),
.arap-management-page .arap-matrix-table td:not(:first-child) {
  width: 92px;
}

.arap-management-page .arap-matrix-table tr.arap-row-hover > th,
.arap-management-page .arap-matrix-table tr.arap-row-hover > td,
.arap-management-page .arap-matrix-table .arap-col-hover {
  background-color: #fff8d6;
}

.arap-management-page .arap-matrix-table .arap-cell-hover {
  background-color: #ffe8a3;
}

.income-compare-chart-page .income-chart-scroll {
  overflow-x: auto;
}

.income-compare-chart-page .income-chart-svg {
  display: block;
  height: 340px;
  min-width: 760px;
  width: 100%;
}

.balance-sheet-1528-page .balance-sheet-tree {
  background: #fff;
  border: 1px solid #d8e4f0;
  border-radius: 6px;
  padding: .45rem .55rem;
}

.balance-sheet-1528-page .balance-sheet-node {
  line-height: 1.75;
}

.balance-sheet-1528-page .balance-sheet-node-link {
  border-radius: 4px;
  color: #1f2937;
  display: inline-block;
  padding: .08rem .35rem;
}

.balance-sheet-1528-page .balance-sheet-node-link:hover,
.balance-sheet-1528-page .balance-sheet-node-link:focus {
  background: #edf6ff;
  color: var(--jas-primary);
}

.balance-sheet-1528-page .balance-sheet-root > .balance-sheet-node-link {
  color: #0f5f75;
  font-weight: 700;
}

.balance-sheet-1528-page .balance-sheet-child > .balance-sheet-node-link {
  font-size: .92rem;
}

.inventory-filter-shell {
  border-color: #cbdcec;
  box-shadow: 0 10px 24px rgb(15 23 42 / 5%);
  overflow: hidden;
}

.inventory-filter-form {
  background:
    linear-gradient(90deg, rgb(240 249 255 / 86%), rgb(255 251 235 / 56%)),
    #fff;
}

.inventory-filter-head {
  align-items: flex-start;
  border-bottom: 1px solid #dbe8f2;
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  margin: -.35rem -.2rem .65rem;
  padding: .25rem .2rem .65rem;
}

.inventory-section-label {
  color: #0f5f75;
  font-size: .86rem;
  font-weight: 700;
}

.inventory-filter-context {
  color: #64748b;
  font-size: .78rem;
  line-height: 1.45;
}

.inventory-mode-pills {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: flex-end;
}

.inventory-mode-pill {
  background: #eef6ff;
  border: 1px solid #b9d7ee;
  border-radius: 999px;
  color: #0f5f75;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
  padding: .35rem .55rem;
}

.inventory-mode-pill-accent {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.inventory-filter-grid .form-select,
.inventory-filter-grid .form-control {
  border-color: #b8d5e6;
}

.inventory-filter-choice-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  height: auto;
  min-height: calc(1.5em + .5rem + 2px);
}

.inventory-ring-filter-row {
  align-items: center;
  display: flex;
  gap: .5rem;
}

.inventory-ring-filter-row .input-group {
  flex: 1 1 auto;
  min-width: 0;
}

.inventory-ring-type-only {
  flex: 0 0 auto;
  white-space: nowrap;
}

.inventory-page .ir-choice-group .input-group-text {
  height: 32px;
}

.inventory-page .ir-check-control {
  flex: 1 1 auto;
  min-width: 0;
}

.inventory-page .ir-check-toggle {
  align-items: center;
  display: flex;
  font-size: .82rem;
  height: 32px;
  line-height: 1;
  min-height: 32px;
  overflow: hidden;
  padding: .2rem .55rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.inventory-page .ir-check-toggle::after {
  margin-left: auto;
}

.inventory-page .ir-check-menu {
  max-height: 18rem;
  min-width: min(640px, calc(100vw - 3rem));
  overflow-x: hidden;
  overflow-y: auto;
  padding: .5rem;
}

.inventory-page .ir-check-all {
  align-items: center;
  background: #eef2f7;
  border: 1px solid #d8e5ee;
  border-radius: 6px;
  display: inline-flex;
  font-size: .8rem;
  font-weight: 600;
  gap: .3rem;
  margin-bottom: .45rem;
  padding: .2rem .55rem;
}

.inventory-page .ir-check-grid {
  display: grid;
  gap: .3rem .85rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inventory-page .ir-check-grid label {
  align-items: center;
  display: grid;
  font-size: .78rem;
  gap: .25rem;
  grid-template-columns: 14px minmax(0, 1fr);
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-page .ir-check-grid input,
.inventory-page .ir-check-all input {
  height: .75rem;
  margin: 0;
  width: .75rem;
}

.inventory-primary-action {
  min-width: 4.5rem;
}

.inventory-result-summary {
  display: grid;
  gap: .5rem;
  grid-template-columns: repeat(4, minmax(9.5rem, 1fr));
  margin-bottom: .75rem;
}

.inventory-result-card {
  align-items: baseline;
  background: #fff;
  border: 1px solid #d7e4ef;
  border-left: 4px solid #94a3b8;
  border-radius: 6px;
  display: flex;
  gap: .55rem;
  min-width: 0;
  padding: .4rem .65rem;
}

.inventory-result-card span {
  color: #64748b;
  font-size: .76rem;
  white-space: nowrap;
}

.inventory-result-card strong {
  color: #0f172a;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.inventory-result-card-primary {
  background: #f0fdfa;
  border-left-color: #0f766e;
}

.inventory-result-card-cost {
  background: #fff7ed;
  border-left-color: #ea580c;
}

.inventory-result-card-rows {
  background: #eef2ff;
  border-left-color: #4f46e5;
}

.inventory-result-card-stock {
  background: #f8fafc;
  border-left-color: #475569;
}

.inventory-product-thumb {
  background: #fff;
  border: 1px solid #d8e2ec;
  border-radius: 4px;
  height: 42px;
  object-fit: contain;
  position: relative;
  transition: transform .12s ease, box-shadow .12s ease;
  width: 42px;
}

.inventory-product-thumb:hover,
.inventory-product-thumb:focus {
  box-shadow: 0 12px 26px rgba(15, 23, 42, .22);
  transform: scale(2.35);
  z-index: 20;
}

.inventory-help-popover {
  display: inline-flex;
  position: relative;
}

.inventory-help-panel {
  background: #fff;
  border: 1px solid #cbdcec;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
  display: none;
  left: 0;
  max-width: min(92vw, 760px);
  padding: .5rem;
  position: absolute;
  top: calc(100% + .35rem);
  z-index: 1080;
}

.inventory-help-panel img {
  display: block;
  height: auto;
  max-width: 100%;
}

.inventory-help-panel-large {
  width: min(80vw, 1207px);
}

.inventory-help-panel-large img {
  width: 100%;
}

.inventory-help-panel-wide img + img {
  margin-top: .5rem;
}

.inventory-help-popover:hover .inventory-help-panel,
.inventory-help-popover:focus-within .inventory-help-panel {
  display: block;
}

.inventory-table .inventory-row-index {
  color: #64748b;
  font-variant-numeric: tabular-nums;
  width: 3.25rem;
}

.material-quantity-page .inventory-table,
.material-quantity-page .inventory-table :is(th, td) * {
  font-size: 12px;
}

.material-quantity-page .inventory-product-thumb:hover,
.material-quantity-page .inventory-product-thumb:focus {
  transform: scale(7.05);
}

.inventory-table .inventory-stock-code {
  color: #475569;
  font-weight: 700;
}

.inventory-table .inventory-stock-name {
  color: #0f5f75;
  font-weight: 700;
}

.inventory-table .inventory-product-link {
  color: #0f5f75;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.inventory-table .inventory-mount-badge {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 4px;
  color: #9a3412;
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  margin-left: .25rem;
  padding: .08rem .25rem;
  vertical-align: middle;
}

.inventory-table .inventory-product-name-cell {
  color: #1e293b;
  font-weight: 600;
}

.inventory-table .inventory-number-cell {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.inventory-table .inventory-quantity-cell {
  color: #047857;
}

.inventory-table .inventory-cost-cell {
  color: #b45309;
}

.inventory-table .inventory-note-cell {
  color: #475569;
  max-width: 18rem;
  white-space: normal;
}

.inventory-table .express-ship-metal-cell {
  color: #7c2d12;
  font-weight: 700;
  white-space: nowrap;
}

.inventory-table .express-ship-size-cell {
  min-width: 3.4rem;
  white-space: nowrap;
}

.inventory-table .express-ship-size-link {
  color: #047857;
  display: inline-block;
  font-weight: 800;
  min-width: 1.25rem;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.inventory-table .express-ship-half-size {
  color: #9a3412;
  font-size: .78rem;
  font-weight: 700;
}

.inventory-table .express-ship-total-cell {
  background: #f0fdfa;
  color: #065f46;
  font-weight: 800;
}

.inventory-table td.express-ship-size-cell:hover,
.inventory-table td.express-ship-size-cell:focus-within,
.inventory-table tbody tr.is-cross-hover-row > td.express-ship-size-cell.is-cross-hover-col {
  background: #fef3c7;
  box-shadow: inset 0 0 0 2px #f59e0b;
  color: #78350f;
}

.inventory-table td.express-ship-size-cell:hover .express-ship-size-link,
.inventory-table td.express-ship-size-cell:focus-within .express-ship-size-link {
  color: #78350f;
}

.inventory-table td.inventory-number-cell:hover,
.inventory-table td.inventory-number-cell:focus-within,
.inventory-table tbody tr.is-cross-hover-row > td.inventory-number-cell.is-cross-hover-col {
  background: #fef3c7;
  box-shadow: inset 0 0 0 2px #f59e0b;
  color: #78350f;
}

.inventory-table.md-cross-hover-table tbody tr.is-cross-hover-row > td {
  background: #f1f8ff;
}

.inventory-table.md-cross-hover-table :is(thead th, tbody td).is-cross-hover-col {
  background: #eef6ff;
}

@media (max-width: 992px) {
  .inventory-filter-head {
    display: grid;
  }

  .inventory-mode-pills {
    justify-content: flex-start;
  }

  .inventory-result-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .inventory-result-summary {
    grid-template-columns: 1fr;
  }
}

.physical-inventory-category-select,
.physical-inventory-material-select {
  max-width: 100%;
}

.physical-inventory-category-select {
  flex: 1 1 0;
  min-width: 0;
}

.physical-inventory-filter-form {
  overflow: visible;
}

.physical-inventory-filter-panel {
  overflow: visible;
  position: relative;
  z-index: 20;
}

.physical-inventory-filter-label {
  justify-content: center;
  min-width: 5.5rem;
}

.physical-inventory-stock-check-control {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

.physical-inventory-stock-check-toggle {
  align-items: center;
  display: flex;
  font-size: .82rem;
  height: 28px;
  line-height: 1;
  min-height: 28px;
  overflow: hidden;
  padding: .2rem .55rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.physical-inventory-stock-check-toggle::after {
  margin-left: auto;
}

.physical-inventory-stock-check-menu {
  max-height: min(32rem, calc(100vh - 15rem));
  min-width: min(960px, calc(100vw - 3rem));
  overflow-x: hidden;
  overflow-y: auto;
  padding: .5rem;
}

.physical-inventory-stock-check-control .dropdown-menu {
  position: absolute;
  z-index: 1080;
}

.physical-inventory-stock-check-all {
  align-items: center;
  background: #eef2f7;
  border: 1px solid #d8e5ee;
  border-radius: 6px;
  display: inline-flex;
  font-size: .8rem;
  font-weight: 600;
  gap: .3rem;
  margin-bottom: .45rem;
  padding: .2rem .55rem;
}

.physical-inventory-stock-check-grid {
  display: grid;
  gap: .3rem .85rem;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
}

.physical-inventory-stock-check-grid label {
  align-items: center;
  display: grid;
  font-size: .78rem;
  gap: .25rem;
  grid-template-columns: 14px minmax(0, 1fr);
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.physical-inventory-stock-check-grid input,
.physical-inventory-stock-check-all input {
  height: .75rem;
  margin: 0;
  width: .75rem;
}

.physical-inventory-radio-row {
  align-items: center;
  display: flex;
  gap: 1rem;
  height: 28px;
  min-height: 28px;
  overflow: hidden;
}

.physical-inventory-action-cell {
  display: flex;
  justify-content: flex-end;
}

.physical-inventory-instruction {
  color: #64748b;
  padding-left: .1rem;
}

.physical-inventory-material-select {
  width: 12rem;
}

.physical-inventory-cost-input {
  max-width: 100%;
  width: 8rem;
}

.physical-inventory-qty-input {
  max-width: 100%;
  width: 6rem;
}

.physical-inventory-report-result {
  margin-top: .5rem;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.physical-inventory-summary-table,
.physical-inventory-detail-table {
  width: max-content;
}

.physical-inventory-summary-table {
  min-width: 720px;
}

.physical-inventory-detail-table {
  min-width: 1500px;
}

.physical-inventory-report-empty {
  color: #64748b;
  padding: 1.5rem;
  text-align: center !important;
}

.regular-voucher-page .regular-voucher-search {
  border-color: #cbdcec;
  box-shadow: 0 12px 30px rgb(15 23 42 / 6%);
  margin-bottom: .75rem;
  overflow: hidden;
}

.regular-voucher-page .regular-voucher-search-toolbar {
  padding: .85rem 1rem;
}

.regular-voucher-page .regular-voucher-search-grid {
  align-items: center;
  display: grid;
  gap: .5rem;
  grid-template-columns: minmax(12rem, .65fr) minmax(12rem, .65fr) minmax(15rem, 1fr) minmax(16rem, 1.1fr) auto;
}

.regular-voucher-page .regular-voucher-search-grid .accounting-search-group {
  flex-wrap: nowrap;
  width: 100%;
}

.regular-voucher-page .regular-voucher-search-grid .accounting-search-group > .input-group-text:first-child {
  flex: 0 0 86px;
  min-width: 86px;
}

.regular-voucher-page .regular-voucher-date-field > .input-group-text:first-child {
  flex-basis: 58px;
  min-width: 58px;
}

.regular-voucher-page .regular-voucher-date-field .form-control {
  min-width: 0;
}

.regular-voucher-page .regular-voucher-search-actions {
  display: inline-flex;
  gap: .4rem;
  justify-content: flex-end;
  white-space: nowrap;
}

.regular-voucher-page .regular-voucher-list-panel {
  border-color: #cbdcec;
  box-shadow: 0 12px 30px rgb(15 23 42 / 6%);
  overflow: hidden;
  padding: 0;
}

.regular-voucher-page .regular-voucher-list-panel > legend {
  display: none;
}

.regular-voucher-page #flag-form {
  align-items: center;
  display: flex;
  margin: 0;
}

.regular-voucher-page .regular-voucher-flag-tabs {
  margin-bottom: 0;
}

.regular-voucher-page .regular-voucher-list-head {
  align-items: center;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
  border-bottom: 1px solid #dce7f1;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: .8rem 1rem;
}

.regular-voucher-page .regular-voucher-list-title {
  color: #0f4f78;
  font-size: .92rem;
  font-weight: 800;
}

.regular-voucher-page .regular-voucher-list-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  justify-content: flex-end;
}

.regular-voucher-page .regular-voucher-section-title {
  align-items: center;
  color: #0f4f78;
  display: flex;
  font-size: .82rem;
  font-weight: 800;
  gap: .4rem;
  margin: .9rem 1rem .45rem;
}

.regular-voucher-page .regular-voucher-section-title::before {
  background: #2a7fab;
  border-radius: 999px;
  content: "";
  height: .55rem;
  width: .2rem;
}

.regular-voucher-page .regular-voucher-action-cell {
  padding-left: .6rem;
  padding-right: .6rem;
  text-align: center;
  white-space: nowrap;
}

.regular-voucher-page .regular-voucher-action-cell .btn-link {
  padding-left: .35rem !important;
  padding-right: .35rem !important;
}

.regular-voucher-page .regular-voucher-table-link {
  color: #0068b7;
  font-size: .82rem;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.regular-voucher-page .regular-voucher-table-link:hover,
.regular-voucher-page .regular-voucher-table-link:focus {
  color: #004f8f;
}

.regular-voucher-page .regular-voucher-list-panel .accounting-table-wrap {
  margin-left: .75rem;
  margin-right: .75rem;
}

.regular-voucher-page .regular-voucher-list-panel .accounting-table {
  border: 1px solid #e4edf5;
  border-radius: 6px;
  overflow: hidden;
}

.regular-voucher-page .regular-voucher-list-panel .md-sticky-table thead th {
  position: static;
  top: auto;
  z-index: auto;
}

.popup-layout .regular-voucher-items-page .md-sticky-table thead th {
  top: 0;
}

.regular-voucher-page .regular-voucher-add-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.regular-voucher-page .regular-voucher-add-main {
  min-width: 0;
}

.regular-voucher-page .regular-voucher-add-card {
  border-color: #d7e0ea;
  border-radius: 6px;
}

.regular-voucher-page .regular-voucher-add-card .card-body {
  padding: 18px 22px;
}

.regular-voucher-page .regular-voucher-add-form .form-label {
  color: #1e3a5f;
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 7px;
}

.regular-voucher-page .regular-voucher-add-form .form-control,
.regular-voucher-page .regular-voucher-add-form .form-select {
  border-color: #cbd5e1;
  border-radius: 6px;
  color: #334155;
  min-height: 40px;
}

.regular-voucher-page .regular-voucher-add-form .form-control:focus,
.regular-voucher-page .regular-voucher-add-form .form-select:focus {
  border-color: #7db7ff;
  box-shadow: 0 0 0 .18rem rgba(13, 110, 253, .12);
}

.regular-voucher-page .regular-voucher-description {
  min-height: 86px;
}

.regular-voucher-page .regular-voucher-field-groups {
  display: grid;
  gap: 20px;
}

.regular-voucher-page .regular-voucher-field-group {
  background: #f8fafc;
  border: 1px solid #e0e8f1;
  border-radius: 6px;
  display: grid;
  gap: 14px;
  padding: 14px;
}

.regular-voucher-page .regular-voucher-field-group + .regular-voucher-field-group {
  margin-top: 2px;
}

.regular-voucher-page .regular-voucher-field-group .employee-section-title {
  margin-top: 0;
}

.regular-voucher-page .regular-voucher-type-group {
  min-height: 40px;
}

.regular-voucher-page .regular-voucher-schedule-strip {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 180px) minmax(0, 180px) auto;
}

.regular-voucher-page .regular-voucher-calc-action {
  align-items: end;
  display: flex;
}

.regular-voucher-page .regular-voucher-info-note {
  background: #fff8e6;
  border: 1px solid #ffe2a9;
  border-radius: 6px;
  color: #7a4b00;
  font-size: .86rem;
  min-height: 40px;
  padding: 9px 12px;
}

.regular-voucher-page .regular-voucher-lines-head {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.regular-voucher-page .regular-voucher-lines-card .accounting-table-wrap {
  border: 1px solid #d7e0ea;
  border-radius: 6px;
  overflow: hidden;
}

.regular-voucher-page .regular-voucher-lines-group-title {
  margin-bottom: 14px;
}

.regular-voucher-page .regular-voucher-lines-card .md-sticky-table thead th {
  position: static;
  top: auto;
  z-index: auto;
}

.regular-voucher-page .regular-voucher-empty-lines {
  align-items: center;
  color: #64748b;
  display: grid;
  gap: 3px;
  justify-items: center;
  min-height: 72px;
  padding: 10px;
}

.regular-voucher-page .regular-voucher-empty-lines strong {
  color: #1e3a5f;
  font-size: .95rem;
}

.regular-voucher-page .regular-voucher-form-actions {
  background: #fbfdff;
  border-top: 1px solid #e2edf5;
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  padding: .8rem 1rem;
}

.regular-voucher-page .regular-voucher-add-side {
  min-width: 0;
  position: sticky;
  top: 72px;
}

.regular-voucher-page .regular-voucher-summary-card {
  border-color: #d7e0ea;
}

.regular-voucher-page .regular-voucher-summary-top {
  padding: 22px 20px 20px;
}

.regular-voucher-page .regular-voucher-summary-mark {
  align-items: center;
  background: rgba(255, 255, 255, .18);
  border: 3px solid rgba(255, 255, 255, .58);
  border-radius: 50%;
  display: inline-flex;
  font-size: 1.55rem;
  font-weight: 800;
  height: 82px;
  justify-content: center;
  margin-bottom: 12px;
  width: 82px;
}

.regular-voucher-page .regular-voucher-summary-steps {
  color: #334155;
  display: grid;
  font-size: .88rem;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.regular-voucher-page .btn-primary {
  background-color: #1f6f9f;
  border-color: #1f6f9f;
}

.regular-voucher-page .btn-primary:hover,
.regular-voucher-page .btn-primary:focus {
  background-color: #185a82;
  border-color: #185a82;
}

.regular-voucher-page .btn-outline-primary {
  border-color: #2a7fab;
  color: #1f6f9f;
}

.regular-voucher-page .btn-outline-primary:hover,
.regular-voucher-page .btn-outline-primary:focus,
.regular-voucher-page .btn-check:checked + .btn-outline-primary {
  background-color: #1f6f9f;
  border-color: #1f6f9f;
  color: #fff;
}

.regular-voucher-page .form-check-input:checked {
  background-color: #1f6f9f;
  border-color: #1f6f9f;
}

@media (max-width: 1199.98px) {
  .regular-voucher-page .regular-voucher-search-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .regular-voucher-page .regular-voucher-search-actions {
    justify-content: flex-start;
  }

  .regular-voucher-page .regular-voucher-add-layout {
    grid-template-columns: 1fr;
  }

  .regular-voucher-page .regular-voucher-add-side {
    position: static;
  }
}

@media (max-width: 767.98px) {
  .regular-voucher-page .regular-voucher-search-grid {
    grid-template-columns: 1fr;
  }

  .regular-voucher-page .regular-voucher-list-head,
  .regular-voucher-page .regular-voucher-lines-head {
    align-items: stretch;
    flex-direction: column;
  }

  .regular-voucher-page .regular-voucher-list-tools,
  .regular-voucher-page .regular-voucher-form-actions {
    justify-content: flex-start;
  }

  .regular-voucher-page .regular-voucher-schedule-strip {
    grid-template-columns: 1fr;
  }
}

.monetary-manage-page {
  padding-bottom: 24px;
}

.monetary-manage-page .monetary-workspace {
  border-color: #cbdcec;
  box-shadow: 0 12px 30px rgb(15 23 42 / 7%);
  overflow: hidden;
}

.monetary-manage-page .monetary-workspace-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  justify-content: space-between;
  padding: .85rem 1rem;
}

.monetary-manage-page .monetary-filter-toolbar {
  flex: 1 1 22rem;
  min-width: 0;
}

.monetary-manage-page .monetary-filter-fields {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.monetary-manage-page .accounting-search-group {
  width: auto;
}

.monetary-manage-page .accounting-search-group .input-group-text {
  min-width: 56px;
  padding-left: .75rem;
  padding-right: .75rem;
}

.monetary-manage-page .accounting-search-group .form-select {
  min-width: 82px;
}

.monetary-manage-page .monetary-action-bar {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
}

.monetary-manage-page #lblDate:empty {
  display: none;
}

.monetary-manage-page .monetary-table-wrap {
  background: #fff;
  border-top: 1px solid #dce7f1;
  overflow-x: auto;
}

.monetary-manage-page .monetary-table {
  min-width: 72rem;
  width: 100%;
}

.monetary-manage-page .monetary-table thead th {
  background: #f3f8fc;
  color: #173654;
  font-size: .82rem;
  height: 42px;
  padding: .55rem .7rem;
  text-align: center;
  top: 0;
  z-index: 10;
}

.monetary-manage-page .monetary-table tbody td {
  background-clip: padding-box;
  padding: .45rem .45rem;
}

.monetary-manage-page .monetary-table tbody tr:nth-child(even) td {
  background: #f8fbff;
}

.monetary-manage-page .monetary-table tbody tr:hover td {
  background: #edf6ff;
}

.monetary-manage-page .monetary-table tbody td.monetary-rate-cell {
  min-width: 9.5rem;
}

.monetary-manage-page .monetary-date-column {
  box-shadow: inset -1px 0 #dce7f1;
  left: 0;
  min-width: 3.5rem;
  position: sticky;
  text-align: center;
  width: 3.5rem;
  z-index: 12;
}

.monetary-manage-page thead .monetary-date-column {
  z-index: 14;
}

.monetary-manage-page tbody .monetary-date-column {
  background: #fff;
  color: #173654;
  font-weight: 700;
  z-index: 8;
}

.monetary-manage-page .monetary-table tbody tr:nth-child(even) .monetary-date-column {
  background: #f8fbff;
}

.monetary-manage-page .monetary-table tbody tr:hover .monetary-date-column {
  background: #e8f2fb;
}

.monetary-manage-page .monetary-rate-input {
  border-color: #d5dee8;
  box-shadow: inset 0 1px 1px rgb(15 23 42 / 3%);
  font-variant-numeric: tabular-nums;
  min-width: 8.6rem;
  width: 100%;
}

.monetary-manage-page .monetary-rate-input:focus {
  border-color: var(--jas-primary);
  box-shadow: 0 0 0 .14rem rgba(var(--jas-primary-rgb), .14);
}

@media (max-width: 767.98px) {
  .monetary-manage-page .monetary-workspace-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .monetary-manage-page .monetary-filter-toolbar,
  .monetary-manage-page .monetary-action-bar {
    flex: 1 1 auto;
    width: 100%;
  }

  .monetary-manage-page .monetary-filter-fields {
    align-items: stretch;
  }

  .monetary-manage-page .accounting-search-group {
    flex: 1 1 9rem;
  }

  .monetary-manage-page .monetary-action-bar {
    justify-content: flex-start;
  }

}

.accounting-table thead th {
  background: #f6f9fd;
  border-bottom-color: #d8e4f0;
  color: #0f2942;
  font-weight: 800;
  position: sticky;
  top: var(--jas-sticky-top, 48px);
  box-shadow: inset 0 -1px 0 #d8e4f0;
  white-space: nowrap;
  z-index: 10;
}

.accounting-table tbody td {
  padding-bottom: .56rem;
  padding-top: .56rem;
}

.discount0603-page .discount0603-search-grid {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-areas:
    "name name name name flag flag flag flag currency currency currency currency"
    "regions regions regions regions regions regions branches branches branches branches branches branches"
    "start start start start start start end end end end end end"
    "range range range range range range range range range range action action"
    "note note note note note note note note note note note note";
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.discount0603-page .discount0603-search-name {
  grid-area: name;
}

.discount0603-page .discount0603-search-flag {
  grid-area: flag;
}

.discount0603-page .discount0603-search-currency {
  grid-area: currency;
}

.discount0603-page .discount0603-search-regions {
  grid-area: regions;
}

.discount0603-page .discount0603-search-branches {
  grid-area: branches;
}

.discount0603-page .discount0603-search-start-date {
  grid-area: start;
}

.discount0603-page .discount0603-search-end-date {
  grid-area: end;
}

.discount0603-page .discount0603-search-start-date,
.discount0603-page .discount0603-search-end-date {
  min-width: 0;
}

.discount0603-page .discount0603-search-time-range {
  grid-area: range;
}

.discount0603-page .discount0603-search-note {
  grid-area: note;
  line-height: 1.55;
}

.discount0603-page .discount0603-search-action {
  align-self: center;
  display: flex;
  grid-area: action;
  justify-content: flex-start;
}

.discount0603-page .discount0603-search-action .btn {
  min-width: 56px;
}

.discount0603-page .accounting-search-group {
  flex-wrap: nowrap;
  width: 100%;
}

.discount0603-page .accounting-search-group > .input-group-text:first-child {
  flex: 0 0 104px;
  min-width: 104px;
}

.discount0603-page .discount0603-date-group > .input-group-text:first-child {
  flex-basis: 112px;
  min-width: 112px;
}

.discount0603-page .discount0603-date-group > .input-group-text:not(:first-child) {
  flex: 0 0 36px;
  min-width: 36px;
}

.discount0603-page .discount0603-date-group .form-control {
  min-width: 0;
}

.discount0603-page .discount0603-check-group .form-control {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .85rem;
  min-height: 32px;
  padding: .25rem .65rem;
}

.discount0603-page .discount0603-check-group .form-check {
  align-items: center;
  display: inline-flex;
  gap: .25rem;
  margin: 0;
  min-height: 22px;
  white-space: nowrap;
}

.discount0603-page .discount0603-check-group .form-check-input {
  margin: 0;
}

.discount0603-page .discount0603-check-group .form-check-label {
  color: #334155;
  font-size: .8125rem;
}

.discount0603-page .md-panel {
  overflow: visible;
}

.discount0603-page .discount0603-table-wrap {
  border-top: 1px solid #e5edf5;
  max-height: none;
  min-height: 0;
  overflow: visible;
}

.discount0603-page .discount0603-table {
  min-width: 1360px;
}

.discount0603-page .discount0603-table thead th {
  background: #f6f9fd;
  box-shadow: inset 0 -1px 0 #d8e4f0;
  font-size: .78rem;
  line-height: 1.3;
  padding: .52rem .55rem;
  position: sticky;
  top: var(--jas-sticky-top, 48px);
  white-space: nowrap;
  z-index: 20;
}

.discount0603-page .discount0603-table tbody td {
  color: #26384d;
  font-size: .8125rem;
  line-height: 1.35;
  padding: .48rem .55rem;
  white-space: nowrap;
}

.discount0603-page .discount0603-table tbody td:nth-child(2) {
  min-width: 34rem;
  white-space: normal;
}

.discount0603-page .discount0603-table tbody td:nth-child(5) {
  font-variant-numeric: tabular-nums;
}

.discount0603-modal .modal-dialog {
  max-width: 860px;
}

.discount0603-modal .modal-content {
  border: 1px solid #b9d4e6;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .24);
  overflow: hidden;
}

.discount0603-modal .modal-header {
  background: linear-gradient(180deg, #2d8ab8 0%, #0f7199 100%);
  border-bottom: 1px solid #0d6386;
  color: #fff;
  min-height: 48px;
  padding: .65rem .9rem;
}

.discount0603-modal .modal-title {
  font-size: .98rem;
  font-weight: 700;
}

.discount0603-modal .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: .85;
}

.discount0603-modal .modal-body {
  background: #f6f9fd;
  padding: .85rem;
}

.discount0603-modal .modal-footer {
  background: #fff;
  border-top: 1px solid #d8e6ef;
  padding: .65rem .9rem;
}

.discount0603-modal-alert {
  border-color: #ead08b;
  color: #6b4a00;
  font-size: .84rem;
  line-height: 1.55;
  margin: 0 0 .75rem;
  padding: .55rem .75rem;
}

.discount0603-modal-form {
  display: grid;
  gap: .75rem;
}

.discount0603-form-section {
  background: #fff;
  border: 1px solid #d8e6ef;
  border-radius: 6px;
  padding: .75rem;
}

.discount0603-section-title {
  border-bottom: 1px solid #e5edf5;
  color: #0f7199;
  font-size: .84rem;
  font-weight: 700;
  margin: -.1rem 0 .65rem;
  padding-bottom: .45rem;
}

.discount0603-field-grid {
  display: grid;
  gap: .6rem .75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.discount0603-field-full {
  grid-column: 1 / -1;
}

.discount0603-modal .accounting-search-group {
  flex-wrap: nowrap;
  width: 100%;
}

.discount0603-modal .accounting-search-group > .input-group-text:first-child {
  flex: 0 0 112px;
  justify-content: center;
  min-width: 112px;
}

.discount0603-modal .accounting-search-group .form-control,
.discount0603-modal .accounting-search-group .form-select,
.discount0603-modal .accounting-search-group .input-group-text {
  min-height: 32px;
}

.discount0603-modal-choice-group .form-control {
  align-items: center;
  display: flex;
  min-height: 32px;
  padding: .25rem .65rem;
}

.discount0603-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
}

.discount0603-modal .form-check {
  align-items: center;
  display: inline-flex;
  gap: .3rem;
  margin: 0;
  min-height: 22px;
}

.discount0603-modal .form-check-input {
  margin: 0;
}

.discount0603-modal .form-check-label {
  color: #334155;
  font-size: .8125rem;
}

.discount0603-inline-check {
  align-items: center;
  background: #f8fbfe;
  border: 1px solid #d8e6ef;
  border-radius: 6px;
  display: flex;
  padding: .25rem .65rem;
}

.discount0603-modal-date-group .form-control {
  min-width: 0;
}

.discount0603-modal-date-group .discount0603-range-separator {
  flex: 0 0 34px;
  justify-content: center;
  min-width: 34px;
}

.discount0603-rule-list {
  background: #f8fbfe;
  border: 1px solid #d8e6ef;
  border-radius: 6px;
  display: grid;
  gap: .45rem .9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: .55rem .65rem;
}

@media (max-width: 767.98px) {
  .discount0603-field-grid,
  .discount0603-rule-list {
    grid-template-columns: 1fr;
  }

  .discount0603-modal .accounting-search-group {
    flex-wrap: wrap;
  }

  .discount0603-modal .accounting-search-group > .input-group-text:first-child {
    flex-basis: 100%;
  }
}

@media (max-width: 1399.98px) {
  .discount0603-page .discount0603-search-grid {
    grid-template-areas:
      "name name name name flag flag flag flag currency currency currency currency"
      "regions regions regions regions regions regions branches branches branches branches branches branches"
      "start start start start start start end end end end end end"
      "range range range range range range range range range range action action"
      "note note note note note note note note note note note note";
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .discount0603-page .discount0603-search-grid {
    grid-template-areas:
      "name"
      "flag"
      "currency"
      "regions"
      "branches"
      "start"
      "end"
      "range"
      "note"
      "action";
    grid-template-columns: 1fr;
  }

  .discount0603-page .discount0603-search-action {
    justify-content: flex-start;
  }

  .discount0603-page .discount0603-table-wrap {
    max-height: none;
  }
}

.goldprice1553-page .accounting-search-group .input-group-text {
  min-height: 28px;
  min-width: 56px;
  padding: .15rem .5rem;
}

.goldprice1553-page .accounting-search-group .form-select {
  min-height: 28px;
  padding-bottom: .15rem;
  padding-top: .15rem;
}

.goldprice1553-page .md-panel-toolbar .btn-sm {
  min-height: 28px;
  padding-bottom: .15rem;
  padding-top: .15rem;
}

.goldprice1553-page .accounting-search-group {
  width: auto;
}

.goldprice1553-page .accounting-table thead th,
.goldprice1553-page .accounting-table tbody td {
  text-align: center;
}

.goldprice1553-page .goldprice1553-table thead th {
  font-size: .78rem;
  font-weight: 700;
  padding: .48rem .5rem;
}

.goldprice1553-page .goldprice1553-table tbody td {
  color: #334155;
  font-size: .8125rem;
  line-height: 1.38;
  padding: .45rem .5rem;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .accounting-page .accounting-hero {
    grid-template-columns: 1fr;
  }

  .accounting-page .accounting-hero > .btn {
    justify-self: start;
    margin-bottom: 0;
    margin-top: .25rem;
  }
}

/* 部門列表：緊湊、中文不斷行、ellipsis 長欄 */
.department-table {
  table-layout: fixed;
  width: 100%;
}

.department-table thead th {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: .48rem .5rem;
  white-space: nowrap;
}

.department-table tbody td {
  color: #334155;
  font-size: .8125rem;
  line-height: 1.38;
  padding: .45rem .5rem;
}

.department-table thead th.col-compact,
.department-table tbody td.col-compact {
  padding-left: .35rem;
  padding-right: .35rem;
}

.department-table tbody td.col-nowrap {
  white-space: nowrap;
}

.department-table tbody td.col-ellipsis {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.department-table code {
  font-size: .78rem;
}

.department-table .department-tree-link {
  color: #1d4ed8;
  display: inline;
  font-weight: 600;
  white-space: nowrap;
}

.department-table .department-tree-link:hover {
  color: #1e40af;
}

.department-table td.department-name-cell {
  max-width: none;
  overflow: hidden;
  padding-left: .55rem;
  padding-right: .65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.department-table .department-level-code {
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .75rem;
}

.department-table .department-meta {
  color: #64748b;
  font-size: .8125rem;
}

.department-table .department-count-badge {
  font-size: .72rem;
  font-weight: 600;
  min-width: 1.5rem;
  padding: .18em .45em;
}

.department-table .department-actions {
  white-space: nowrap;
}

.department-table .department-actions .btn {
  font-size: .78rem;
  padding: .18rem .42rem;
}

.department-table .department-flag {
  color: #64748b;
  font-size: .8125rem;
  text-align: center;
}

.branch-page-list {
  max-width: 1280px;
}

.branch-summary-badges {
  min-width: 240px;
}

.branch-table th:nth-child(2),
.branch-table td:nth-child(2) {
  width: auto;
}

.branch-table th:nth-child(3),
.branch-table td:nth-child(3) {
  width: 84px;
}

.branch-table th:nth-child(4),
.branch-table td:nth-child(4) {
  width: 112px;
}

.branch-table th:nth-child(5),
.branch-table td:nth-child(5) {
  width: 96px;
}

.branch-table th:nth-child(6),
.branch-table td:nth-child(6) {
  width: 56px;
}

.branch-table th:nth-child(7),
.branch-table td:nth-child(7) {
  width: 112px;
}

.salary-item-page-list {
  max-width: none;
  width: 100%;
}

.salary-item-table th:nth-child(2),
.salary-item-table td:nth-child(2) {
  width: 22%;
}

.salary-item-table th:nth-child(3),
.salary-item-table td:nth-child(3) {
  width: 136px;
}

.salary-item-table th:nth-child(4),
.salary-item-table td:nth-child(4),
.salary-item-table th:nth-child(5),
.salary-item-table td:nth-child(5),
.salary-item-table th:nth-child(6),
.salary-item-table td:nth-child(6),
.salary-item-table th:nth-child(7),
.salary-item-table td:nth-child(7) {
  width: 64px;
}

.salary-item-table th:nth-child(8),
.salary-item-table td:nth-child(8) {
  width: 132px;
}

.salary-item-table th:nth-child(9),
.salary-item-table td:nth-child(9) {
  width: 56px;
}

.salary-item-table th:nth-child(10),
.salary-item-table td:nth-child(10) {
  width: 112px;
}

.salary-item-panel {
  overflow: visible;
}

.overtime-pay-type-panel,
.insurance-identity-panel {
  overflow: visible;
}

.salary-item-table-wrap {
  --salary-item-sticky-top: var(--jas-sticky-top, 48px);
  overflow: visible;
}

.overtime-pay-type-table-wrap,
.insurance-identity-table-wrap {
  overflow: visible;
}

.salary-item-table {
  border-collapse: separate;
  border-spacing: 0;
}

.salary-item-table thead {
  position: sticky;
  top: var(--salary-item-sticky-top);
  z-index: 30;
}

.salary-item-table thead th {
  background: #f6f9fd;
  border-bottom: 1px solid #dbe6f2;
  border-top: 0;
  font-size: .92rem;
  padding-bottom: .55rem;
  padding-top: .55rem;
  position: sticky;
  text-align: center !important;
  top: var(--salary-item-sticky-top);
  z-index: 31;
}

.salary-item-table tbody td,
.salary-item-table .department-meta {
  font-size: .94rem;
}

.salary-item-table code {
  font-size: .9rem;
}

.salary-item-table .department-tree-link {
  font-size: .94rem;
}

.salary-item-table .department-count-badge {
  font-size: .84rem;
}

.insurance-identity-table th:nth-child(1),
.insurance-identity-table td:nth-child(1) {
  width: 72px;
}

.insurance-identity-table th:nth-child(2),
.insurance-identity-table td:nth-child(2) {
  width: 104px;
}

.insurance-identity-table th:nth-child(3),
.insurance-identity-table td:nth-child(3) {
  width: auto;
}

.insurance-identity-table th:nth-child(5),
.insurance-identity-table td:nth-child(5) {
  width: 72px;
}

.insurance-identity-table th:nth-child(6),
.insurance-identity-table td:nth-child(6) {
  width: 108px;
}

.holiday-date-pill {
  background: #eef7ff;
  border: 1px solid #c9dff3;
  border-radius: 999px;
  color: #1f5f93;
  display: inline-flex;
  font-weight: 700;
  line-height: 1;
  min-width: 3.25rem;
  padding: .28rem .6rem;
}

.master-actions {
  white-space: nowrap;
}

.master-actions .btn {
  font-size: .78rem;
  padding: .18rem .42rem;
}

.master-form-shell {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.master-form-card {
  border-color: #d7e0ea;
  border-radius: 6px;
  min-width: 0;
}

.master-form-card .input-group-text {
  background: #eef2f7;
  border-color: #cbd5e1;
  color: #40566f;
  font-weight: 600;
}

.branch-page-form {
  max-width: 1240px;
}

.branch-form-shell {
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.branch-form-card .card-body {
  padding: 22px;
}

.branch-form-card .input-group-text {
  justify-content: center;
  min-width: 72px;
  white-space: nowrap;
}

.branch-form-card .form-select {
  min-width: 0;
}

.branch-rules-card .card-body {
  padding: 18px 16px;
}

.salary-item-page-form {
  max-width: 1240px;
}

.salary-item-form-shell {
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.salary-item-form-card .card-body {
  padding: 22px;
}

.salary-item-form-card .input-group-text {
  justify-content: center;
  min-width: 72px;
  white-space: nowrap;
}

.salary-item-form-card .form-select,
.salary-item-form-card textarea.form-control {
  min-width: 0;
}

.salary-item-form-grid {
  align-items: start;
}

.salary-item-flags {
  background: #f8fbff;
  border: 1px solid #e4edf6;
  border-radius: 6px;
  padding: 12px 14px;
}

.salary-item-rules-card .card-body {
  padding: 18px 16px;
}

.insurance-identity-page-form {
  max-width: 1240px;
}

.insurance-identity-form-shell {
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.insurance-identity-form-card .card-body {
  padding: 22px;
}

.insurance-identity-form-card .input-group-text {
  justify-content: center;
  min-width: 72px;
  white-space: nowrap;
}

.insurance-identity-form-card textarea.form-control {
  min-width: 0;
}

.insurance-identity-form-card fieldset,
.insurance-identity-form-card section {
  border-top: 1px solid #e5edf5;
  padding-top: 16px;
}

.insurance-identity-form-card section:first-of-type {
  margin-top: 18px !important;
}

.insurance-identity-form-card h3 {
  color: #334155;
  font-weight: 800;
}

.insurance-identity-rules-card .card-body {
  padding: 18px 16px;
}

@media (min-width: 1400px) {
  .salary-item-page-form,
  .insurance-identity-page-form {
    max-width: 1280px;
  }

  .salary-item-form-card .card-body,
  .insurance-identity-form-card .card-body {
    padding: 24px 28px;
  }
}

.access-card-page-form {
  max-width: 1120px;
}

.access-card-panel {
  overflow: hidden;
}

.access-card-toolbar {
  border-bottom: 1px solid #e5edf5;
  padding: 14px 18px;
}

.access-card-summary {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
}

.access-card-table {
  table-layout: fixed;
}

.access-card-table thead th {
  text-align: center;
}

.access-card-table tbody td {
  font-size: .9rem;
  padding-bottom: .56rem;
  padding-top: .56rem;
}

.access-card-table .access-card-no-cell {
  min-width: 0;
}

.access-card-no {
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88rem;
  font-weight: 700;
}

.access-card-state {
  font-size: .72rem;
  font-weight: 700;
  margin-left: 8px;
}

.access-card-table .department-actions .btn {
  min-width: 46px;
}

.access-card-pager {
  align-items: center;
  border-top: 1px solid #e5edf5;
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 12px 16px;
}

.access-card-form-shell {
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 260px;
}

.access-card-form-card .card-body {
  padding: 24px;
}

.access-card-form-card .input-group-text {
  justify-content: center;
  min-width: 64px;
  white-space: nowrap;
}

.access-card-form-grid {
  align-items: start;
}

.access-card-form-card .form-label {
  font-weight: 700;
  margin-bottom: 6px;
}

.access-card-form-note {
  background: #f7fbff;
  border: 1px solid #e1edf7;
  border-radius: 6px;
  color: #516983;
  font-size: .86rem;
  line-height: 1.55;
  margin-top: 18px;
  padding: 10px 12px;
}

.access-card-rules-card .card-body {
  padding: 18px 16px;
}

.access-card-rule-list {
  gap: 12px;
}

.access-card-rule-list li {
  align-items: start;
  display: grid;
  gap: 2px;
}

.access-card-rule-list strong {
  color: #1f5f93;
  font-size: .82rem;
}

.access-card-rule-list span {
  color: #334155;
  line-height: 1.5;
}

@media (max-width: 991.98px) {
  .access-card-form-shell {
    grid-template-columns: 1fr;
  }
}

.pto-setting-page-form {
  max-width: 1120px;
}

.pto-setting-form-shell {
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 260px;
}

.pto-setting-form-card .card-body {
  padding: 24px;
}

.pto-setting-form-card .input-group-text {
  justify-content: center;
  min-width: 58px;
  white-space: nowrap;
}

.pto-setting-form-card .form-label {
  font-weight: 700;
  margin-bottom: 6px;
}

.pto-setting-form-note {
  background: #f7fbff;
  border: 1px solid #e1edf7;
  border-radius: 6px;
  color: #516983;
  font-size: .86rem;
  line-height: 1.55;
  margin-top: 18px;
  padding: 10px 12px;
}

.pto-setting-toolbar {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.pto-setting-summary {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
}

.pto-setting-panel {
  width: 100%;
}

.pto-setting-table-wrap {
  overflow: visible;
}

.pto-setting-table {
  table-layout: fixed;
}

.pto-setting-table thead th {
  text-align: center;
}

.pto-setting-table tbody td {
  font-size: .9rem;
  padding-bottom: .62rem;
  padding-top: .62rem;
}

.pto-threshold {
  color: #0f172a;
  font-weight: 700;
}

.pto-days {
  background: #eef7ff;
  border: 1px solid #c9dff3;
  border-radius: 999px;
  color: #1f5f93;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-width: 4rem;
  padding: .22rem .62rem;
}

@media (max-width: 991.98px) {
  .pto-setting-form-shell {
    grid-template-columns: 1fr;
  }

  .pto-setting-toolbar {
    align-items: start;
    flex-direction: column;
  }
}

.attendance-config-page {
  max-width: none;
}

.attendance-config-hero {
  margin-bottom: 12px;
}

.attendance-config-overview {
  margin-bottom: 12px;
}

.attendance-config-overview-card {
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgb(15 23 42 / 5%);
  min-height: 78px;
}

.attendance-config-overview-card .card-body {
  display: grid;
  gap: 2px;
}

.attendance-config-overview-label {
  color: #64748b;
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.attendance-config-overview-card strong {
  color: #102a43;
  font-size: 1.2rem;
  line-height: 1.2;
}

.attendance-config-overview-card span:last-child {
  color: #52677e;
  font-size: .82rem;
}

.attendance-config-layout {
  align-items: start;
}

.attendance-config-primary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.attendance-config-section {
  margin-bottom: 0 !important;
  scroll-margin-top: 132px;
}

.attendance-config-section .profile-edit-card-head {
  border-left: 3px solid #2a7dad;
  padding: 15px 18px 11px;
}

.attendance-config-section .profile-edit-card-head h2 {
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.attendance-config-section .profile-edit-card-head p {
  font-size: .84rem;
  margin-bottom: 0;
}

.attendance-config-section .card-body {
  padding: 16px 18px 18px;
}

.attendance-config-field-grid .form-label {
  color: #14324a;
  font-size: .86rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.attendance-config-field-grid .form-text {
  font-size: .78rem;
  margin-top: 4px;
}

.attendance-config-field-grid .input-group-text {
  border-color: #c7d6e5;
  color: #18354e;
  font-weight: 600;
  justify-content: center;
  min-width: 52px;
}

.attendance-config-field-grid .input-group-text,
.attendance-config-field-grid .form-control,
.attendance-config-field-grid .form-select {
  min-height: 40px;
}

.attendance-config-field-grid .form-control,
.attendance-config-field-grid .form-select {
  border-color: #c7d6e5;
}

.attendance-config-field-grid .form-control:focus,
.attendance-config-field-grid .form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 .15rem rgb(13 110 253 / 14%);
}

.attendance-config-grades {
  font-size: .82rem;
  line-height: 1.45;
  min-height: 72px;
  resize: vertical;
}

.attendance-config-grades-field {
  min-width: 0;
}

.attendance-config-grades-label-row {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.attendance-config-grades-label-row .form-label {
  margin-bottom: 0;
}

.attendance-config-grades-expand {
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
}

.attendance-config-grades-expand:hover {
  color: #1e3a8a;
  text-decoration: underline;
}

.attendance-config-grades-shell {
  position: relative;
}

.attendance-config-grades-shell .input-group-text {
  align-items: flex-start;
  padding-top: 8px;
}

.attendance-config-grades-shell .attendance-config-grades-trigger {
  padding-right: 36px;
}

.attendance-config-grades-open {
  align-items: center;
  background: rgb(255 255 255 / 92%);
  border: 1px solid #dbe5f0;
  border-radius: 6px;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  font-size: .95rem;
  height: 28px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 28px;
}

.attendance-config-grades-open:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.attendance-config-grades-modal-text {
  font-size: .88rem;
  line-height: 1.5;
  min-height: 360px;
  resize: vertical;
}

.attendance-config-grades-modal .modal-content {
  border-color: #dbe5f0;
  box-shadow: 0 18px 48px rgb(15 23 42 / 16%);
}

.attendance-config-save-bar {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
  padding: 0;
}

.attendance-config-save-card {
  border-color: #d7e6f3;
  border-radius: 8px;
  box-shadow: var(--jas-soft-shadow);
}

.attendance-config-save-card .card-body {
  padding: 10px 14px;
}

.attendance-config-save-bar-top {
  position: sticky;
  top: 72px;
  z-index: 20;
}

.attendance-config-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attendance-config-section-nav a {
  border: 1px solid #dbe5f0;
  border-radius: 999px;
  color: #475569;
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 10px;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.attendance-config-section-nav a:hover {
  background: #f0f7ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.attendance-config-save-actions {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.attendance-config-save-hint {
  color: #64748b;
  font-size: .78rem;
}

.attendance-config-aside {
  align-self: flex-start;
  display: grid;
  gap: 12px;
  min-width: 0;
  position: sticky;
  top: 72px;
}

.attendance-config-aside-panel {
  border-color: #d7e6f3;
  border-radius: 8px;
  box-shadow: var(--jas-soft-shadow);
  overflow: hidden;
}

.attendance-config-rules .card-body {
  padding: 16px;
}

.attendance-config-rules .card-title {
  color: #102a43;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0;
}

.attendance-config-aside-subhead {
  background: #f8fbff;
  border-color: #e2edf7;
  color: #14324a;
  font-size: .9rem;
  font-weight: 800;
  padding: 11px 16px;
}

.attendance-config-impact-list {
  margin-bottom: 0;
}

.attendance-config-impact-list .list-group-item {
  align-items: flex-start;
  background: transparent;
  border-color: #e8eef5;
  color: #334155;
  display: flex;
  font-size: .86rem;
  gap: 8px;
  line-height: 1.55;
  padding: 8px 16px;
}

.attendance-config-impact-list .badge {
  border-radius: 999px;
  flex: 0 0 auto;
  min-width: 48px;
  padding: .32rem .5rem;
}

@media (max-width: 991.98px) {
  .attendance-config-save-bar-top {
    position: static;
  }

  .attendance-config-aside {
    position: static;
  }

  .attendance-config-save-actions {
    margin-left: 0;
    width: 100%;
  }

  .attendance-config-save-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

.master-rules-card {
  border-color: #d7e0ea;
  border-radius: 6px;
  box-shadow: var(--jas-soft-shadow);
  overflow: hidden;
  position: sticky;
  top: 88px;
}

.master-rules-card .card-body {
  padding: 18px;
}

.master-rules-card h2 {
  color: #102a43;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.master-rules-card p {
  color: #52677e;
  font-size: .88rem;
  line-height: 1.55;
  margin-bottom: 12px;
}

.master-rules-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.master-rules-list li {
  color: #334155;
  font-size: .88rem;
  line-height: 1.45;
  padding-left: 18px;
  position: relative;
}

.master-rules-list li::before {
  background: var(--jas-primary);
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(var(--jas-primary-rgb), .13);
  content: "";
  height: 6px;
  left: 2px;
  position: absolute;
  top: .55em;
  width: 6px;
}

.md-form .form-label {
  color: #334155;
  font-weight: 600;
  margin-bottom: 7px;
}

.md-form .form-control,
.md-form .form-select {
  border-color: #cbd5e1;
  min-height: 42px;
}

.md-form .form-control:focus,
.md-form .form-select:focus {
  border-color: var(--jas-primary);
  box-shadow: 0 0 0 .2rem rgba(var(--jas-primary-rgb), .13);
}

.md-form-actions {
  background: #fafcff;
  border-top: 1px solid #e5edf5;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 22px;
}

.working-day-type-form-page {
  max-width: 1260px;
}

.working-day-type-form-card .card-body {
  background: #fbfdff;
  display: grid;
  gap: 18px;
  padding: 20px 26px 26px;
}

.wdt-form-section {
  background: #fff;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  padding: 18px 20px 20px;
}

.wdt-section-head {
  align-items: flex-start;
  border-bottom: 1px solid #edf2f7;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: -2px 0 18px;
  padding-bottom: 12px;
}

.wdt-section-head h3 {
  color: #17324d;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.wdt-section-head p {
  color: #64748b;
  font-size: .88rem;
  margin: 0;
}

.wdt-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.wdt-summary-pills .badge {
  color: #334155;
  font-size: .82rem;
  font-weight: 600;
  padding: .48rem .65rem;
}

.wdt-summary-pills strong {
  color: #0f5f93;
  margin-left: 2px;
}

.working-day-type-form-card .input-group-text {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
  font-weight: 700;
  justify-content: center;
  min-width: 58px;
}

.working-day-type-form-card .input-group .form-control,
.working-day-type-form-card .input-group .form-select {
  min-width: 0;
}

.wdt-switch {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  min-height: 42px;
  padding: 9px 12px;
  width: 100%;
}

.wdt-switch .form-check-input {
  margin: 0;
}

.wdt-switch .form-check-label {
  color: #334155;
  font-weight: 600;
}

.wdt-department-check {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  display: flex;
  min-height: 38px;
  padding: 8px 10px 8px 34px;
}

.wdt-department-check .form-check-input {
  margin-left: -22px;
  margin-right: 8px;
}

.md-form-section {
  border-top: 1px solid #e5edf5;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
}

.md-form-section-title {
  color: #102a43;
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.branch-form-tabs {
  gap: 4px;
  margin: -4px -4px 22px;
}

.branch-form-tabs .nav-link {
  border-color: transparent;
  border-radius: 6px 6px 0 0;
  color: #2563eb;
  font-weight: 600;
  min-height: 40px;
  padding: 9px 16px;
}

.branch-form-tabs .nav-link:hover {
  background: #f2f7ff;
  border-color: transparent;
}

.branch-form-tabs .nav-link.active {
  background: #fff;
  border-color: #d7e0ea #d7e0ea #fff;
  color: #0f2742;
}

.branch-form-tab-content {
  min-height: 300px;
}

.branch-form-tab-content .row {
  row-gap: 4px;
}

@media (min-width: 1400px) {
  .branch-page-form {
    max-width: 1280px;
  }

  .branch-form-shell {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .branch-form-card .card-body {
    padding: 24px 28px;
  }
}

.department-table .department-col-name {
  width: auto;
}

.employee-edit-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.employee-edit-page.accounting-form-page {
  max-width: none;
}

.employee-edit-page .employee-edit-layout {
  grid-template-columns: minmax(0, 9fr) minmax(280px, 3fr);
}

.employee-edit-main {
  min-width: 0;
}

.employee-edit-main .profile-edit-card {
  border-color: #d7e0ea;
  border-radius: 6px;
}

.employee-edit-main .profile-edit-card .card-body,
.employee-edit-main .tab-content.card-body {
  padding: 18px 22px;
}

.employee-edit-main .profile-edit-card-head {
  padding: 16px 22px;
}

.employee-edit-main .profile-edit-card-head h2 {
  font-size: 1.05rem;
}

.employee-edit-main .profile-edit-card-head p {
  font-size: .88rem;
}

.employee-inline-note {
  color: #64748b;
  display: inline-block;
  margin-left: 8px;
}

.employee-identity-grid {
  align-items: end;
}

.employee-tabs {
  border-bottom-color: #d7e0ea;
  gap: 4px;
  padding-left: 16px;
}

.employee-tabs .nav-link {
  border-color: transparent;
  border-radius: 6px 6px 0 0;
  color: #2563eb;
  font-weight: 600;
  min-height: 40px;
  padding: 9px 16px;
}

.employee-tabs .nav-link:hover {
  background: #f2f7ff;
  border-color: transparent;
}

.employee-tabs .nav-link.active {
  background: #fff;
  border-color: #d7e0ea #d7e0ea #fff;
  color: #0f2742;
}

.employee-tab-card {
  box-shadow: 0 .7rem 1.4rem rgba(15, 23, 42, .04);
}

@media (min-width: 1200px) {
  .employee-identity-grid > .col-lg-3 {
    width: 33.333333%;
  }
}

.employee-input-group .input-group-text,
.employee-input-group .form-control,
.employee-input-group .form-select {
  min-height: 40px;
}

.employee-input-group input[type="date"] {
  color: #334155;
}

.employee-input-group input[type="date"]::-webkit-calendar-picker-indicator {
  border-radius: 4px;
  cursor: pointer;
  opacity: .68;
  padding: 5px;
}

.employee-input-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background: #e8f1ff;
  opacity: 1;
}

.employee-edit-main .tab-pane .form-control,
.employee-edit-main .tab-pane .form-select {
  border-color: #cbd5e1;
  border-radius: 6px;
  color: #334155;
  min-height: 40px;
}

.employee-edit-main .tab-pane .form-control:focus,
.employee-edit-main .tab-pane .form-select:focus,
.employee-input-group .form-control:focus,
.employee-input-group .form-select:focus {
  border-color: #7db7ff;
  box-shadow: 0 0 0 .18rem rgba(13, 110, 253, .12);
}

.employee-edit-main .tab-pane textarea.form-control {
  min-height: 86px;
}

.employee-edit-page,
.employee-edit-page .form-label,
.employee-edit-page .form-control,
.employee-edit-page .form-select,
.employee-edit-page .input-group-text,
.employee-edit-page .accounting-hero h1,
.employee-edit-page .accounting-hero p,
.employee-edit-page .btn,
.employee-edit-page .employee-inline-note,
.employee-edit-page .profile-edit-card-head h2,
.employee-edit-page .profile-edit-card-head p,
.employee-edit-page .employee-tabs .nav-link,
.employee-edit-page .employee-section-title,
.employee-edit-page .employee-section-title span,
.employee-edit-page .employee-check-tile .form-check-label,
.employee-edit-page .employee-readonly-field,
.employee-edit-page .employee-radio-group,
.employee-edit-page .employee-radio-group .form-check-label,
.employee-edit-page .employee-summary-top h2,
.employee-edit-page .employee-summary-top p,
.employee-edit-page .employee-summary-list span,
.employee-edit-page .employee-summary-list strong,
.employee-edit-page .employee-summary-section h3,
.employee-edit-page .employee-file-button,
.employee-edit-page .employee-file-name,
.employee-edit-page .employee-upload-help {
  font-size: 14px;
}

.employee-edit-page .employee-input-group .input-group-text,
.employee-edit-page .employee-input-group input.form-control,
.employee-edit-page .employee-input-group select.form-select,
.employee-edit-page .employee-edit-main .tab-pane input.form-control,
.employee-edit-page .employee-edit-main .tab-pane select.form-select {
  font-size: 14px;
  height: 32px;
  line-height: 1.2;
  min-height: 32px;
  padding-bottom: 3px;
  padding-top: 3px;
}

.employee-edit-page .employee-input-group input[type="date"]::-webkit-calendar-picker-indicator {
  padding: 2px;
}

.employee-edit-page .employee-input-group {
  position: relative;
}

.employee-edit-page .employee-input-group:has(.input-validation-error),
.employee-edit-page .employee-input-group:has(.is-invalid) {
  border: 1px solid #ff3b4f;
  border-radius: 6px;
}

.employee-edit-page .employee-input-group:has(.input-validation-error)::after,
.employee-edit-page .employee-input-group:has(.is-invalid)::after {
  align-items: center;
  border: 2px solid #ff3b4f;
  border-radius: 50%;
  color: #ff3b4f;
  content: "!";
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 18px;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  z-index: 4;
}

.employee-edit-page .employee-input-group .form-control.input-validation-error,
.employee-edit-page .employee-input-group .form-select.input-validation-error,
.employee-edit-page .employee-input-group .form-control.is-invalid,
.employee-edit-page .employee-input-group .form-select.is-invalid {
  background-image: none;
  border-color: transparent;
  box-shadow: none;
  padding-right: 44px;
}

.employee-edit-page .employee-input-group .form-control.input-validation-error:focus,
.employee-edit-page .employee-input-group .form-select.input-validation-error:focus,
.employee-edit-page .employee-input-group .form-control.is-invalid:focus,
.employee-edit-page .employee-input-group .form-select.is-invalid:focus {
  border-color: transparent;
  box-shadow: none;
}

.employee-edit-page .employee-input-group:has(.input-validation-error) .input-group-text,
.employee-edit-page .employee-input-group:has(.is-invalid) .input-group-text {
  border-color: transparent #ff3b4f transparent transparent;
}

.employee-edit-page .employee-input-group:has(.input-validation-error):focus-within,
.employee-edit-page .employee-input-group:has(.is-invalid):focus-within {
  box-shadow: 0 0 0 .16rem rgba(255, 59, 79, .12);
}

.employee-edit-page .field-validation-error,
.employee-edit-page .field-validation-valid {
  display: none;
}

.employee-edit-page .employee-input-group:has(textarea.form-control) .input-group-text {
  height: auto;
  min-height: 86px;
  padding-bottom: 10px;
  padding-top: 10px;
}

.employee-section-title {
  align-items: center;
  color: #1e3a5f;
  display: flex;
  font-size: .9rem;
  font-weight: 700;
  gap: 8px;
  margin: 2px 0 0;
}

.employee-section-title::before {
  background: var(--jas-accent);
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 6px;
  width: 6px;
}

.employee-section-title span {
  color: #64748b;
  font-size: .82rem;
  font-weight: 500;
}

.employee-check-tile {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  gap: 9px;
  margin: 0;
  min-height: 40px;
  padding: 9px 12px;
  width: 100%;
}

.employee-check-tile.employee-check-tile-inline {
  width: auto;
}

.employee-edit-page .employee-check-tile.employee-check-tile-compact {
  height: 32px;
  min-height: 32px;
  padding: 3px 10px;
}

.employee-check-tile .form-check-input {
  flex: 0 0 auto;
  margin: 0;
}

.employee-check-tile .form-check-label {
  color: #334155;
  font-size: .92rem;
  font-weight: 600;
}

.employee-readonly-field {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e0e8f1;
  border-radius: 6px;
  color: #334155;
  display: flex;
  min-height: 40px;
  padding: 8px 12px;
}

.employee-edit-page .employee-readonly-field {
  flex: 1 1 auto;
  min-height: 32px;
  padding: 5px 10px;
}

.employee-readonly-field-number {
  font-variant-numeric: tabular-nums;
  justify-content: flex-end;
}

.employee-mini-table {
  border-color: #d7e0ea;
  color: #334155;
}

.employee-mini-table thead th {
  background: #f2f6fb;
  border-bottom-color: #d7e0ea;
  color: #1e3a5f;
  font-size: .84rem;
  font-weight: 700;
  white-space: nowrap;
}

.employee-mini-table tbody td {
  font-size: .88rem;
  vertical-align: middle;
}

.employee-option-list {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.employee-option-list .form-check {
  align-items: center;
  display: flex;
  gap: 9px;
  margin: 0;
}

.employee-option-list .form-check-input {
  margin: 0;
}

.employee-option-list .form-check-label {
  color: #334155;
  font-weight: 600;
}

.employee-edit-page .employee-plain-check {
  align-items: center;
  display: flex;
  gap: 6px;
  min-height: 24px;
  padding-left: 0;
}

.employee-edit-page .employee-plain-check .form-check-input,
.employee-edit-page .employee-edi-options .form-check-input {
  flex: 0 0 auto;
  margin: 0;
}

.employee-edit-page .employee-plain-check .form-check-label,
.employee-edit-page .employee-edi-options .form-check-label {
  color: #0f172a;
  font-weight: 400;
}

.employee-edit-page .employee-edi-options {
  background: #fff;
  border: 1px solid #d8e5ee;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.employee-edit-page .employee-edi-options .form-check {
  align-items: center;
  display: flex;
  gap: 6px;
  line-height: 1.45;
  margin: 0;
  min-height: 22px;
  padding-left: 0;
}

.employee-empty-note {
  background: #fff8e6;
  border-color: #ffe2a9;
  color: #7a4b00;
}

.employee-input-icon {
  align-items: center;
  background: #f2f6fb;
  border-color: #cbd5e1;
  color: #4b6583;
  display: inline-flex;
  justify-content: center;
  width: 42px;
}

.employee-input-icon svg {
  fill: none;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 17px;
}

.employee-radio-group {
  align-items: center;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-height: 40px;
  padding: 7px 11px;
}

.employee-edit-page .employee-radio-group {
  min-height: 32px;
  padding: 3px 10px;
}

.employee-radio-group .form-check {
  margin-bottom: 0;
  margin-right: 0;
}

.employee-radio-group .form-check-input {
  margin-top: .2rem;
}

.employee-radio-group .form-check-label {
  color: #334155;
  font-size: .92rem;
}

.employee-edit-side {
  min-width: 0;
  position: sticky;
  top: 72px;
}

.employee-summary-card {
  border-color: #d7e0ea;
  border-radius: 6px;
  box-shadow: 0 .85rem 1.8rem rgba(15, 23, 42, .08);
  overflow: hidden;
}

.employee-summary-top {
  background: linear-gradient(135deg, var(--jas-primary), #22c1dc);
  color: #fff;
  padding: 22px 22px 20px;
  text-align: center;
}

.employee-summary-photo {
  align-items: center;
  background: rgba(255, 255, 255, .18);
  border: 3px solid rgba(255, 255, 255, .58);
  border-radius: 50%;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 700;
  height: 94px;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
  width: 94px;
}

.employee-summary-photo img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.employee-summary-photo span {
  position: relative;
  z-index: 0;
}

.employee-summary-top h2 {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 5px;
}

.employee-summary-top p {
  color: rgba(255, 255, 255, .88);
  margin: 0;
}

.employee-summary-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.employee-summary-list div {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5edf5;
  border-radius: 6px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 8px 10px;
}

.employee-summary-list span {
  color: #64748b;
  font-size: .84rem;
}

.employee-summary-list strong {
  color: #1f2937;
  font-size: .9rem;
  font-weight: 700;
  text-align: right;
}

.employee-summary-section {
  border-top: 1px solid #e5edf5;
  padding-top: 14px;
}

.employee-summary-section + .employee-summary-section {
  margin-top: 14px;
}

.employee-summary-section h3 {
  color: #1f2937;
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.employee-file-upload {
  align-items: stretch;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  min-height: 40px;
  overflow: hidden;
}

.employee-file-upload input[type="file"] {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.employee-file-button {
  align-items: center;
  background: #f2f6fb;
  border-right: 1px solid #cbd5e1;
  color: #1e3a5f;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: .88rem;
  font-weight: 700;
  gap: 7px;
  margin: 0;
  padding: 9px 11px;
}

.employee-file-button:hover {
  background: #e8f1ff;
  color: var(--jas-accent);
}

.employee-file-button svg {
  fill: none;
  height: 16px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 16px;
}

.employee-file-name {
  align-items: center;
  background: #fff;
  color: #64748b;
  display: inline-flex;
  flex: 1 1 auto;
  font-size: .86rem;
  min-width: 0;
  overflow: hidden;
  padding: 9px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-upload-help {
  color: #64748b;
  font-size: .82rem;
  margin-top: 7px;
}

.employee-photo-clear {
  margin-top: 10px;
}

.employee-switch-list {
  display: grid;
  gap: 8px;
}

.employee-switch-list .form-check {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5edf5;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  margin: 0;
  min-height: 38px;
  padding: 8px 10px 8px 2.7rem;
}

.employee-switch-list .form-check-input {
  margin-top: 0;
}

.employee-switch-list .form-check-label {
  color: #334155;
  font-size: .9rem;
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .md-page-hero {
    align-items: stretch !important;
    flex-direction: column;
  }

  .md-page-hero .btn {
    width: 100%;
  }

  .md-form-actions {
    flex-direction: column-reverse;
  }

  .md-form-actions .btn {
    width: 100%;
  }
}

@media (max-width: 991.98px) {
  .master-form-shell {
    grid-template-columns: 1fr;
  }

  .master-rules-card {
    position: static;
  }

  .employee-edit-layout {
    grid-template-columns: 1fr;
  }

  .employee-edit-side {
    position: static;
  }
}

/* ===== 到職申請單（Documents / TakeOffice）===== */
.take-office-page {
  max-width: none;
}

.take-office-page:not(.take-office-form-page):not(.take-office-detail-page) .take-office-hero,
.document-admin-page .document-admin-hero {
  align-items: center;
  border-bottom: 0;
  column-gap: .75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: .55rem;
  padding-bottom: 0;
  row-gap: 0;
}

.take-office-page:not(.take-office-form-page):not(.take-office-detail-page) .take-office-hero > div,
.document-admin-page .document-admin-hero > div {
  display: contents;
}

.take-office-page:not(.take-office-form-page):not(.take-office-detail-page) .take-office-hero .profile-edit-eyebrow,
.document-admin-page .document-admin-hero .profile-edit-eyebrow {
  color: #087f9a;
  font-size: .78rem;
  grid-column: 1 / -1;
  margin-bottom: .35rem;
}

.take-office-page:not(.take-office-form-page):not(.take-office-detail-page) .take-office-hero h1,
.document-admin-page .document-admin-hero h1 {
  color: #087f9a;
  font-size: 1.05rem;
  font-weight: 700;
  grid-column: 1;
  grid-row: 2;
  line-height: 1.2;
  margin: 0;
}

.take-office-page:not(.take-office-form-page):not(.take-office-detail-page) .take-office-hero > .btn,
.document-admin-page .document-admin-hero > .btn {
  align-self: center;
  grid-column: 2;
  grid-row: 4;
  justify-self: end;
  margin-top: .45rem;
}

.take-office-page:not(.take-office-form-page):not(.take-office-detail-page) .take-office-hero::after,
.document-admin-page .document-admin-hero::after {
  border-bottom: 1px solid #cfe0e8;
  content: "";
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: .4rem;
}

.take-office-page:not(.take-office-form-page):not(.take-office-detail-page) .take-office-hero p,
.document-admin-page .document-admin-hero p {
  color: #64748b;
  font-size: .78rem;
  grid-column: 1 / -1;
  grid-row: 4;
  line-height: 1.4;
  margin-bottom: 0 !important;
  margin-top: .3rem !important;
}

@media (max-width: 575.98px) {
  .take-office-page:not(.take-office-form-page):not(.take-office-detail-page) .take-office-hero,
  .document-admin-page .document-admin-hero {
    grid-template-columns: 1fr;
  }

  .take-office-page:not(.take-office-form-page):not(.take-office-detail-page) .take-office-hero > .btn,
  .document-admin-page .document-admin-hero > .btn {
    grid-column: 1;
    grid-row: 5;
    justify-self: start;
    margin-top: .45rem;
  }
}

.take-office-hero .take-office-back {
  padding-left: 0;
}

.document-admin-page .document-admin-hero > .take-office-detail-actions {
  align-self: center;
  display: inline-flex;
  grid-column: 2;
  grid-row: 4;
  justify-self: end;
  margin-top: .45rem;
  width: auto;
}

@media (max-width: 575.98px) {
  .document-admin-page .document-admin-hero > .take-office-detail-actions {
    grid-column: 1;
    grid-row: 5;
    justify-self: start;
    margin-top: .45rem;
    width: auto;
  }
}

.take-office-panel {
  margin-bottom: 0;
}

.take-office-toolbar {
  padding-bottom: 14px;
}

.take-office-summary {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.take-office-table-wrap {
  border-top: 1px solid #e5edf5;
}

.take-office-table {
  font-size: .84rem;
}

.take-office-table thead th {
  background: #f6f9fd;
  border-bottom: 1px solid #d8e4f0;
  color: #0f2942;
  font-weight: 800;
  position: sticky;
  text-align: center;
  top: 0;
  z-index: 1;
}

.take-office-table tbody td {
  border-bottom-color: #e8eef5;
  padding-bottom: .56rem;
  padding-top: .56rem;
  vertical-align: middle;
}

.take-office-table .take-office-row {
  cursor: pointer;
}

.take-office-table .take-office-row:hover {
  --bs-table-hover-bg: #edf6ff;
}

.take-office-table .take-office-row:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(var(--jas-primary-rgb), .35);
  outline: 0;
}

.take-office-detail-btn {
  pointer-events: auto;
}

.take-office-pager {
  align-items: center;
  border-top: 1px solid #e5edf5;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 12px 16px;
}

.take-office-doc-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
}

.take-office-doc-approved {
  color: var(--jas-primary);
}

.take-office-doc-reviewing {
  color: #15803d;
}

.take-office-doc-action {
  color: #b91c1c;
}

.take-office-status-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.4;
  padding: 2px 9px;
  white-space: nowrap;
}

.take-office-status-approved {
  background: #e8f2fb;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
}

.take-office-status-reviewing {
  background: #ecfdf3;
  border: 1px solid #86efac;
  color: #15803d;
}

.take-office-status-action {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.take-office-detail-title {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  font-size: 1.65rem;
  gap: 10px;
  margin-bottom: 8px;
}

.take-office-detail-employee {
  color: #475569;
  font-size: 1rem;
  font-weight: 600;
}

.take-office-detail-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.take-office-detail-actions {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.take-office-detail-page .profile-edit-hero {
  align-items: end;
}

.take-office-alert {
  align-items: center;
  border-radius: 7px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-left: 14px;
  padding-right: 14px;
}

.take-office-alert .btn-close {
  margin-left: 16px;
  opacity: .65;
}

.alert-dismissible {
  padding-right: 3rem;
}

.alert-dismissible .btn-close {
  align-items: center;
  display: inline-flex;
  height: 1.75rem;
  justify-content: center;
  padding: 0;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.75rem;
}

.take-office-edit-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.take-office-edit-summary-card {
  border-color: #d6e2ef;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgb(15 23 42 / 4%);
  min-width: 0;
  overflow: hidden;
}

.take-office-edit-summary-card .card-body {
  min-width: 0;
  padding: 14px 16px;
}

.take-office-edit-summary-label {
  color: #64748b;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.take-office-edit-summary-value {
  color: #10243a;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.take-office-edit-summary-meta {
  align-items: center;
  color: #57708d;
  display: flex;
  font-size: .82rem;
  gap: 6px;
  margin-top: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.take-office-edit-summary-chip {
  background: #eef6ff;
  border: 1px solid #c9def2;
  border-radius: 999px;
  color: #1f5f93;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1;
  padding: 4px 8px;
}

.take-office-approval-wrap {
  margin-bottom: 14px;
}

.take-office-approval-wrap-bottom {
  margin-top: 4px;
}

.take-office-approval-panel {
  align-items: center;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
  border: 1px solid #d7e6f3;
  border-radius: 8px;
  box-shadow: var(--jas-soft-shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
  padding: 10px 14px;
}

.take-office-approval-label {
  color: #64748b;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.take-office-approval-actions {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.take-office-approval-form {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.take-office-approval-form .form-control {
  min-width: 12rem;
  width: 12rem;
}

.take-office-approval-danger {
  margin-left: 4px;
}

.take-office-section {
  border-color: #d6e2ef;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgb(15 23 42 / 4%);
  overflow: hidden;
  scroll-margin-top: 132px;
}

.take-office-section .profile-edit-card-head {
  background: linear-gradient(90deg, #f7fbff 0%, #fffdf8 100%);
  border-bottom: 1px solid #e3edf7;
  padding: 14px 20px;
}

.take-office-section .profile-edit-card-head h2 {
  color: #10243a;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.take-office-section .profile-edit-card-head p {
  color: #57708d;
  font-size: .82rem;
  margin-bottom: 0;
}

.take-office-section .card-body {
  padding: 18px 22px;
}

.take-office-readonly-group,
.take-office-form-group {
  border-radius: 6px;
  box-shadow: 0 1px 0 rgb(15 23 42 / 2%);
}

.take-office-readonly-group .input-group-text {
  background: #f3f7fb;
  border-color: #cfddea;
  color: #173654;
  font-size: .82rem;
  font-weight: 800;
  min-width: 8rem;
  padding-left: 12px;
  padding-right: 12px;
}

.take-office-readonly-value {
  align-items: center;
  background: #fefefe;
  border-color: #cfddea;
  color: #10243a;
  display: flex;
  font-size: .88rem;
  min-height: calc(1.5em + .5rem + 2px);
  padding-left: 12px;
  padding-right: 12px;
  white-space: normal;
  word-break: break-word;
}

.take-office-detail-page .take-office-section .profile-edit-card-head {
  border-left: 3px solid #2a7dad;
}

.take-office-detail-page .take-office-readonly-group {
  --bs-border-opacity: 1;
}

.take-office-detail-page .take-office-section .row.g-2 {
  --bs-gutter-x: .75rem;
  --bs-gutter-y: .6rem;
}

.take-office-subhead {
  border-bottom: 1px solid #e5edf5;
  color: #64748b;
  font-size: .84rem;
  font-weight: 700;
  margin-bottom: .75rem;
  padding-bottom: .35rem;
}

.take-office-memo {
  white-space: pre-wrap;
}

.take-office-audit {
  margin-bottom: 0;
  margin-top: 8px;
}

.take-office-form-page .take-office-section .profile-edit-card-head {
  border-left: 3px solid #2a7dad;
}

.take-office-form-page .take-office-hero h1 {
  font-size: 1.55rem;
  line-height: 1.25;
  margin-bottom: 4px;
}

@media (max-width: 575.98px) {
  .take-office-form-page .take-office-hero h1 {
    font-size: 1.35rem;
  }
}

.take-office-save-bar-top {
  margin-bottom: 12px;
  position: sticky;
  top: 72px;
  z-index: 20;
}

.take-office-save-card {
  border-color: #d7e6f3;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgb(15 23 42 / 8%);
}

.take-office-save-card .card-body {
  padding: 10px 14px;
}

.take-office-save-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
}

.take-office-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.take-office-section-nav a {
  border: 1px solid #dbe5f0;
  border-radius: 999px;
  color: #475569;
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 10px;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.take-office-section-nav a:hover {
  background: #f0f7ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.take-office-save-actions {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.take-office-save-hint {
  color: #64748b;
  font-size: .78rem;
}

.take-office-field-grid .form-label {
  color: #334155;
  display: block;
  font-size: .84rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.take-office-four-grid {
  align-items: start;
  display: grid;
  gap: 12px 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.take-office-salary-grid {
  align-items: start;
  display: grid;
  gap: 14px 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.take-office-field {
  min-width: 0;
}

.take-office-field-span-2 {
  grid-column: span 2;
}

.take-office-form-group {
  width: 100%;
}

.take-office-form-group .input-group-text {
  align-items: center;
  background: #f3f7fb;
  border-color: #cfddea;
  color: #173654;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: .82rem;
  font-weight: 800;
  justify-content: center;
  line-height: 1.2;
  min-width: 3.25rem;
  min-height: 2.05rem;
  overflow: hidden;
  padding-left: 10px;
  padding-right: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.take-office-form-group .input-group-text:first-child {
  flex-basis: 3.65rem;
  min-width: 3.65rem;
}

.take-office-form-group .input-group-text:has(.form-check-input) {
  flex-basis: 5rem;
  min-width: 5rem;
}

/* 列印到職証明單（30224）的欄名比到職申請單長得多（「員編(可輸入姓名後用選的)」14 字、
   「列印到職日期」6 字），沿用上面固定的 flex-basis: 3.65rem＋justify-content: center＋
   overflow: hidden，會把標籤壓成固定寬再從左右各裁掉、只剩中段（「印到職日」）——
   連 3 個字的「經手人」都差 3px。本頁改由內容決定寬度、靠左、不裁切。
   範圍化覆寫（只加頁面專屬 class，不動共用的 take-office-form-group）見 TEMPLATES §13。 */
/* 加班費類別（30128）的四個金額是 decimal(18,5)，畫面上是 1.33334（7 個字），
   而那一格（col-xl-3）只有 145px、扣掉「平日 A」欄名後輸入框僅剩 84px，值被切成「1.333」。
   欄位寬度不隨視窗變寬（卡片是固定寬版面），所以要從這格內部騰空間：
   欄名收內距（省約 16px）＋ 拿掉 number 的上下箭頭（省約 17px，這幾格是打字輸入的，
   legacy 也只是純 TextBox）。不用 min-width——.input-group 預設 flex-wrap: wrap，
   撐不下時會把欄名擠到上一行、整格變兩倍高。 */
.overtime-pay-type-page-form fieldset .input-group-text {
  padding-left: 6px;
  padding-right: 6px;
}

.overtime-pay-type-page-form .input-group .form-control[type="number"] {
  -moz-appearance: textfield;
}

.overtime-pay-type-page-form .input-group .form-control[type="number"]::-webkit-outer-spin-button,
.overtime-pay-type-page-form .input-group .form-control[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.certificate-print-page .take-office-form-group .input-group-text,
.certificate-print-page .take-office-form-group .input-group-text:first-child {
  flex: 0 0 auto;
  flex-basis: auto;
  justify-content: flex-start;
  min-width: auto;
  overflow: visible;
  text-overflow: clip;
}

/* legacy 30224 是一列 table（欄名還特地包 <nobr>）。桌機寬度一律不換行，
   空間不夠時由輸入框自己收縮（form-control 已有 min-width: 0），欄名不縮。
   1200px 以下仍允許換行，否則窄視窗會被擠到看不見。 */
@media (min-width: 1200px) {
  .certificate-print-page .certificate-search-row {
    flex-wrap: nowrap;
  }

  /* .col-auto 是 flex: 0 0 auto（不縮），nowrap 下會撐破面板。
     只讓「有輸入框」的欄位可收縮，按鈕維持原寬以免文字被壓。 */
  .certificate-print-page .certificate-search-row > .col-auto:has(.take-office-form-group) {
    flex-shrink: 1;
    min-width: 0;
  }

  /* .input-group 預設 flex-wrap: wrap——欄位被壓窄時輸入框會掉到欄名下一行、
     整格變成兩倍高（畫面看起來就是又換行了）。這裡一律同一行。 */
  .certificate-print-page .certificate-search-row .take-office-form-group {
    flex-wrap: nowrap;
  }

  /* 三個日期欄要放得下 yyyy/MM/dd（含左右各 12px 內距，實測要 103px），
     所以固定 7rem、不參與收縮；空間不足時由員編／經手人這兩個比較能忍受變窄的欄位吸收。 */
  .certificate-print-page #certificate-arrived-date-label,
  .certificate-print-page .certificate-search-row input[data-date-picker] {
    flex: 0 0 7rem;
  }
}

.take-office-form-group .form-control,
.take-office-form-group .form-select {
  border-color: #cfddea;
  color: #10243a;
  font-size: .9rem;
  min-height: 2.05rem;
  min-width: 0;
  padding-left: 12px;
  padding-right: 12px;
}

.take-office-form-group .form-control:focus,
.take-office-form-group .form-select:focus {
  border-color: #86b7df;
  box-shadow: 0 0 0 .12rem rgb(42 125 173 / 16%);
}

.take-office-check-group .input-group-text {
  width: auto;
}

.take-office-check-value {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 700;
}

.take-office-check-addon {
  cursor: pointer;
  gap: 0;
  justify-content: flex-start;
}

.take-office-employee-name {
  color: #64748b;
  font-size: .82rem;
  margin-top: 4px;
}

.take-office-template-bar {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #e3edf7;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 18px;
  padding: 10px 12px;
}

.take-office-template-bar > .text-muted {
  align-items: center;
  align-self: stretch;
  background: #edf3f9;
  border: 1px solid #cfddea;
  border-radius: 6px;
  color: #173654 !important;
  display: inline-flex;
  font-weight: 800;
  flex: 0 0 3.65rem;
  justify-content: center;
  min-height: 2.05rem;
  padding: 0 10px;
  white-space: nowrap;
}

.take-office-template-picker {
  flex: 1 1 18rem;
  max-width: 24rem;
  min-width: 14rem;
}

.take-office-template-name {
  flex: 1 1 16rem;
  max-width: 20rem;
  min-width: 12rem;
}

.take-office-inline-amount {
  max-width: 8rem;
}

.take-office-overtime-select {
  max-width: 16rem;
}

.take-office-divider {
  border-color: #e5edf5;
  margin: 1.25rem 0;
}

.take-office-salary-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.take-office-salary-tools .form-control {
  max-width: 11rem;
}

.take-office-salary-scroll .take-office-salary-table thead th {
  background: #f6f9fd;
  border-bottom: 1px solid #e5edf5;
  color: #173654;
  font-weight: 800;
}

.take-office-salary-table tbody td {
  border-color: #e8eef5;
  padding-bottom: .48rem;
  padding-top: .48rem;
}

.take-office-salary-modal .modal-content {
  border-color: #dbe5f0;
  box-shadow: 0 18px 48px rgb(15 23 42 / 16%);
}

.take-office-salary-modal-tools {
  align-items: center;
  background: #f8fbff;
  border-bottom: 1px solid #e5edf5;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
}

.take-office-salary-modal-tools .form-control {
  max-width: 14rem;
}

.take-office-salary-modal-scroll {
  max-height: min(70vh, 640px);
  overflow: auto;
}

.take-office-salary-modal-scroll thead th {
  background: #f6f9fd;
  border-bottom: 1px solid #e5edf5;
  position: sticky;
  top: 0;
  z-index: 1;
}

.job-adjust-page {
  max-width: none;
}

.job-adjust-hero {
  background:
    linear-gradient(135deg, rgb(255 255 255 / 92%), rgb(244 250 255 / 88%)),
    radial-gradient(circle at 85% 15%, rgb(34 197 94 / 14%), transparent 32%),
    radial-gradient(circle at 8% 92%, rgb(14 165 233 / 13%), transparent 28%);
}

.job-adjust-section .profile-edit-card-head {
  border-left-color: #0f9f8f;
}

.job-adjust-picker-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.job-adjust-picker-input {
  flex: 1 1 24rem;
  max-width: 35rem;
  min-width: 18rem;
}

.job-adjust-picker-actions {
  align-items: center;
  display: inline-flex;
  min-height: 2.05rem;
}

.job-adjust-picker-person {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #dbe7f1;
  border-radius: 999px;
  color: #173654;
  display: inline-flex;
  flex-wrap: wrap;
  font-size: .82rem;
  gap: 6px;
  min-height: 2.05rem;
  padding: 4px 12px;
}

.job-adjust-picker-person span {
  font-weight: 800;
}

.job-adjust-picker-person strong {
  color: #64748b;
  font-weight: 700;
}

.job-adjust-summary-grid {
  margin-bottom: 12px;
}

.job-adjust-diff-grid {
  display: grid;
  gap: 14px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.job-adjust-diff-field,
.job-adjust-salary-grid .take-office-field {
  border: 1px solid transparent;
  border-radius: 8px;
  min-width: 0;
  padding: 8px;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.job-adjust-diff-field.is-changed,
.job-adjust-salary-grid .take-office-field.is-changed {
  background: #fffdf4;
  border-color: #f4d27a;
  box-shadow: inset 3px 0 0 #d7a928;
}

.job-adjust-diff-field .form-label {
  color: #334155;
  font-size: .84rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.job-adjust-before-after {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 1.75rem minmax(0, 1.2fr);
}

.job-adjust-before,
.job-adjust-after {
  background: #fbfdff;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  min-width: 0;
  padding: 8px 10px;
}

.job-adjust-before span,
.job-adjust-after span {
  color: #64748b;
  display: block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 4px;
}

.job-adjust-before strong {
  color: #10243a;
  display: block;
  font-size: .9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  padding-top: 3px;
}

.job-adjust-after .form-control,
.job-adjust-after .form-select {
  border-color: #cfddea;
  color: #10243a;
  min-height: 2.05rem;
}

.job-adjust-arrow {
  align-items: center;
  color: #0f766e;
  display: flex;
  font-size: 1.1rem;
  font-weight: 900;
  justify-content: center;
}

.job-adjust-old-note {
  color: #64748b;
  font-size: .76rem;
  line-height: 1.35;
  margin-top: 5px;
}

.job-adjust-salary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.job-adjust-salary-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.job-adjust-salary-search {
  flex: 1 1 18rem;
  max-width: 28rem;
}

.job-adjust-salary-count {
  color: #64748b;
  font-size: .8rem;
  font-weight: 700;
}

.job-adjust-salary-wrap {
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  overflow: auto;
}

.job-adjust-salary-table {
  min-width: 48rem;
}

.job-adjust-salary-table thead th {
  background: #f6f9fd;
  border-bottom: 1px solid #dbe5f0;
  color: #173654;
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 1;
}

.job-adjust-salary-table tbody td {
  border-color: #e8eef5;
  padding-bottom: .55rem;
  padding-top: .55rem;
}

.job-adjust-salary-row.is-changed td {
  background: #fffdf4;
}

.job-adjust-salary-row[hidden] {
  display: none !important;
}

.job-adjust-old-cell {
  vertical-align: middle;
}

.job-adjust-old-box {
  align-items: flex-start;
  background: #f8fbff;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  min-width: 7rem;
  padding: 6px 8px;
}

.job-adjust-old-value {
  color: #173654;
  font-size: .98rem;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1.1;
}

.job-adjust-old-period {
  color: #64748b;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.job-adjust-old-period.is-empty {
  color: #94a3b8;
  font-weight: 600;
}

.job-adjust-item-name {
  color: #10243a;
  display: block;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.job-adjust-item-code {
  color: #64748b;
  display: block;
  font-size: .76rem;
  font-weight: 700;
  margin-top: 2px;
}

@media (max-width: 991.98px) {
  .job-adjust-diff-grid,
  .job-adjust-salary-grid {
    grid-template-columns: 1fr;
  }

  .job-adjust-before-after {
    grid-template-columns: 1fr;
  }

  .job-adjust-arrow {
    min-height: 1.25rem;
    transform: rotate(90deg);
  }

  .job-adjust-picker-input,
  .job-adjust-salary-search {
    max-width: none;
    min-width: 100%;
  }
}

/* ===== 文件審核左右同屏（30207 split shell）===== */
.doc-review-page {
  max-width: none;
}

.doc-review-body {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.doc-review-main {
  min-width: 0;
}

.doc-review-log {
  align-self: start;
  position: sticky;
  scroll-margin-top: 80px;
  top: 86px;
}

.flow-log-panel {
  border-color: #d6e2ef;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgb(15 23 42 / 7%);
  margin-bottom: 0;
  overflow: hidden;
}

.flow-log-panel .card-header,
.flow-log-panel-head {
  background: linear-gradient(90deg, #f8fbff 0%, #fffaf4 100%);
  border-bottom: 1px solid #e3edf7;
  padding: 16px 18px;
}

.flow-log-panel-head h2 {
  color: #10243a;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.flow-log-panel-head p {
  color: #57708d;
  font-size: .78rem;
  margin-bottom: 0;
}

.flow-log-panel-body {
  background: #fbfdff;
  padding: 14px;
}

.flow-log-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-log-entry {
  background: #fff;
  border: 1px solid #dbe7f2;
  border-radius: 8px;
  padding: 12px 14px;
}

.flow-log-entry--latest {
  background: #f8fbff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 1px rgb(147 197 253 / 35%);
}

.flow-log-entry-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  justify-content: space-between;
  margin-bottom: 4px;
}

.flow-log-time {
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
  font-weight: 600;
}

.flow-log-action {
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.3;
  padding: 2px 8px;
  white-space: nowrap;
}

.flow-log-action-neutral {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.flow-log-action-success {
  background: #ecfdf3;
  border: 1px solid #86efac;
  color: #15803d;
}

.flow-log-action-danger {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.flow-log-node {
  color: #1e293b;
  font-size: .84rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.flow-log-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.flow-log-meta-row {
  display: grid;
  gap: 2px 8px;
  grid-template-columns: 3.5rem minmax(0, 1fr);
}

.flow-log-meta-row dt {
  color: #64748b;
  font-size: .72rem;
  font-weight: 600;
  margin: 0;
}

.flow-log-meta-row dd {
  color: #334155;
  font-size: .78rem;
  margin: 0;
}

.flow-log-memo {
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 991.98px) {
  .take-office-edit-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .take-office-four-grid,
  .take-office-salary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .take-office-field-span-2 {
    grid-column: span 2;
  }

  .doc-review-body {
    grid-template-columns: 1fr;
  }

  .doc-review-log {
    position: static;
  }

}

@media (max-width: 767.98px) {
  .take-office-edit-summary-grid {
    grid-template-columns: 1fr;
  }

  .take-office-four-grid,
  .take-office-salary-grid {
    grid-template-columns: 1fr;
  }

  .take-office-field-span-2 {
    grid-column: span 1;
  }

  .take-office-detail-title {
    font-size: 1.35rem;
  }

  .take-office-detail-actions {
    width: 100%;
  }

  .take-office-readonly-group .input-group-text {
    min-width: 6.5rem;
  }

  .take-office-form-group .input-group-text:first-child {
    flex-basis: 3.65rem;
    min-width: 3.65rem;
  }

  .take-office-approval-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .take-office-approval-actions {
    justify-content: flex-start;
  }

  .take-office-approval-form {
    flex-wrap: wrap;
    width: 100%;
  }

  .take-office-approval-form .form-control {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }

  .take-office-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .take-office-save-actions {
    justify-content: flex-end;
    margin-left: 0;
    width: 100%;
  }

  .take-office-save-bar-top {
    top: 56px;
  }
}

/* ===========================================================================
   報表頁共用樣式（report pages）— 單一來源，勿在各 view 自刻表格 CSS。
   標準：表格直接攤在頁面、不包 overflow 容器 → 右/下捲動交給瀏覽器原生捲軸；
   表頭 sticky 以 var(--jas-sticky-top) 凍結（頂列＋頂端選單列，site.js 實測）。對齊 Sales/IntegrateSales。
   用法：<div class="md-page md-page-wide md-report-page">；搜尋用 form.md-panel；
        表格 <table class="report-table md-cross-hover-table">（金額欄加 report-num，
        負數加 report-neg、零值可加 report-zero）。
   一般 CRUD 清單仍用 accounting-table（VoucherQuery）；報表頁才用 report-table。
   =========================================================================== */
.md-report-page .md-page-hero { display: grid; gap: .3rem; margin-bottom: .55rem; }
.md-report-page .md-page-hero h1 { color: #087f9a; font-size: 1.05rem; font-weight: 700; line-height: 1.2; margin-bottom: 0; }
.md-report-page .md-page-hero h1::after { border-bottom: 1px solid #cfe0e8; content: ""; display: block; margin-top: .4rem; }
.md-report-page .md-page-hero p { font-size: .78rem; line-height: 1.4; margin-bottom: 0; }
.md-report-page form.md-panel { box-shadow: none; margin-bottom: .65rem !important; padding: .5rem .75rem !important; }
.md-report-page form.md-panel .input-group-text { background: #eef6fb; border-color: #b8d5e6; color: #0f172a; font-size: .8rem; font-weight: 700; min-height: 28px; padding-bottom: .1rem; padding-top: .1rem; }
.md-report-page form.md-panel .form-control,
.md-report-page form.md-panel .form-select { border-color: #b8d5e6; font-size: .8rem; height: 28px; line-height: 1.1; min-height: 28px; padding-bottom: .1rem; padding-top: .1rem; }
.md-report-page form.md-panel input[type="date"].form-control { border-color: #b8d5e6; font-size: .8rem; height: 28px; line-height: 1.1; min-height: 28px; padding-bottom: .1rem; padding-top: .1rem; width: 170px; }
.md-report-page form.md-panel .btn { --bs-btn-font-size: .85rem; --bs-btn-padding-x: .65rem; --bs-btn-padding-y: .25rem; }

/* 業績表查詢區採用 14px 文字與 32px 下拉欄位。 */
.sales-order-report-page .md-panel-toolbar .input-group-text,
.sales-order-report-page .md-panel-toolbar .form-select,
.sales-order-report-page .md-panel-toolbar .btn { font-size: 14px; }
.sales-order-report-page .md-panel-toolbar .form-select { height: 32px; line-height: 1.2; min-height: 32px; padding-bottom: 3px; padding-top: 3px; }

.report-table { background: #fff; border: 1px solid #111827; border-collapse: separate; border-spacing: 0; font-size: .72rem; margin: 0; white-space: nowrap; }
.report-table th,
.report-table td { background: #fff; border-bottom: 1px solid #111827; border-right: 1px solid #111827; padding: 4px 8px; text-align: left; }
.report-table thead th { background: #e5e5e5; border-bottom: 2px solid #111827; font-weight: 700; position: sticky; text-align: center; top: var(--jas-sticky-top, 48px); vertical-align: middle; z-index: 2; }
.report-table tfoot td { background: #e5e5e5; border-top: 2px solid #111827; font-weight: 700; }
.report-table .report-num { font-variant-numeric: tabular-nums; text-align: right; }
.report-table .report-neg { color: #dc2626; }
.report-table .report-zero { color: #cbd5e1; }


/* ===== 舊站 0362ServiceOperation.aspx 版面複刻樣式（原本內嵌在銷售訂單 Detail.cshtml）=====
   維修單（0701）也要同一套 legacy 版面，所以搬到共用 site.css；兩頁都把最外層掛 .so-page。
   規則全部由 .so-page 或 so-／dt- 前綴限定範圍，搬過來不影響其他頁。 */
    .so-page { font-size: 13px; color: #222; }
    /* 欄位名稱：正常中性色（環境主題色僅用於列標題/區塊標題） */
    .so-page .InputLabel {
        background-color: #eef2f7; border: 1px solid #d5dee8; color: #334155;
        font-weight: 700; padding: 3px 8px; text-align: left; white-space: nowrap; vertical-align: middle;
    }
    .so-page .GrayLabel {
        background-color: #fff; border: 1px solid #d9d9d9; padding: 3px 6px; vertical-align: middle;
    }
    .so-legacy-table { border-collapse: collapse; }
    .so-legacy-table input[type="text"], .so-legacy-table input[type="number"],
    .so-legacy-table input[type="email"], .so-legacy-table input[type="date"],
    .so-legacy-table select {
        border: 1px solid #a9a9a9; height: 24px; padding: 1px 4px; font-size: 13px;
    }
    .so-legacy-table input[readonly], .so-ro-input { background-color: #f8f8ff; color: #444; }
    .so-pick-input { background-color: #fff !important; color: #222; }
    .so-header-table { width: 100%; }
    .so-header-table input[type="text"], .so-header-table input[type="date"], .so-header-table select { width: 190px; }
    .so-w100 { width: 100px !important; }
    .so-w110 { width: 110px !important; }
    .so-w120 { width: 120px !important; }
    .so-w140 { width: 140px !important; }
    .so-w70 { width: 70px !important; }
    .so-w250 { width: 250px !important; }
    .so-w325 { width: 325px !important; }
    .so-h1 { font-size: 15px; font-weight: 700; color: #333; margin: .6rem 0 .3rem; }
    .so-btn {
        background: linear-gradient(#fdfdfd, #e3e3e3); border: 1px solid #999; border-radius: 3px;
        color: #222; cursor: pointer; display: inline-block; font-size: 12.5px;
        padding: 2px 10px; text-decoration: none; line-height: 1.5; vertical-align: middle;
    }
    .so-btn:hover { background: #e8f0fe; color: #222; }
    .so-btn:disabled { color: #999; cursor: default; }
    .so-btn-primary { background: #ffcccc; }
    .so-person-layout { border-collapse: collapse; width: 100%; }
    .so-person-icon-cell { text-align: center; width: 68px; }
    .so-person-icon { font-size: 26px; }
    .so-person-fields { vertical-align: top; border: none; padding: 0 8px 0 0; }
    .so-nocheck { font-weight: 400; font-size: 12px; }
    .so-nocheck input, .so-notify input { vertical-align: middle; margin-right: 2px; }
    .so-notify { color: red; margin-right: 8px; font-weight: 400; }
    .so-primary-contact { font-weight: 400; font-size: 12px; white-space: nowrap; }

    /* 摺疊區塊標題（列標題吃環境主題色：正式青色 / 測試玫瑰紅，接 --jas-primary） */
    .so-collapse-title {
        background: rgba(var(--jas-primary-rgb), .18); border: 1px solid rgba(var(--jas-primary-rgb), .35);
        color: #333; cursor: pointer; font-weight: 700; margin-top: .5rem; padding: 4px 10px; user-select: none;
    }
    .so-collapse-title::before { content: "▾ "; color: var(--jas-primary); }
    .so-collapse-title.collapsed::before { content: "▸ "; }
    .so-collapse-body { border: 1px solid #ddd; border-top: none; padding: 6px; overflow-x: auto; }

    /* datagrid（複刻舊系統 GridView；列標題吃環境主題色） */
    .so-datagrid { border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
    .so-datagrid th {
        background-color: rgba(var(--jas-primary-rgb), .18); border: 1px solid rgba(var(--jas-primary-rgb), .35);
        color: #333; font-weight: 700; padding: 3px 6px; text-align: center;
    }
    .so-datagrid td { border: 1px solid #d9d9d9; padding: 3px 6px; }
    .so-datagrid tr.so-cancelled td { color: darkgray; text-decoration: line-through; }
.so-datagrid a { color: #0645ad; text-decoration: none; }

/* 銷售發票批次開立沿用舊版 GridView 的連結呈現：可點擊但不顯示底線。 */
.sales-iv-batch-open-page .accounting-table a,
.sales-iv-batch-open-page .accounting-table a:hover,
.sales-iv-batch-open-page .accounting-table a:focus {
    text-decoration: none;
}
.dt-trial-grid tfoot td { vertical-align: top; }
    .dt-trial-grid input { box-sizing: border-box; }
    .dt-extra-wrap { display: inline-block; position: relative; }
    .dt-extra-popup {
        background: #fff; border: 1px solid #bbb; box-shadow: 0 2px 6px rgba(0,0,0,.18);
        display: none; position: fixed; z-index: 2060;
    }
    .dt-extra-grid { background: #fff; width: 250px; }
    .dt-extra-grid td { cursor: pointer; }
    .dt-extra-grid tbody tr:hover td { background: #eef5ff; }
    .dt-extra-grid .dt-extra-name { white-space: nowrap; width: 150px; }
    .dt-extra-grid .dt-extra-price { text-align: center; width: 100px; }

    /* Tab（複刻 ajaxToolkit TabContainer；作用色吃環境主題） */
    .so-tabs { border-bottom: 1px solid var(--jas-primary); display: flex; gap: 2px; margin-top: .5rem; }
    .so-tabs button {
        background: #f2f2f2; border: 1px solid #bbb; border-bottom: none; border-radius: 4px 4px 0 0;
        cursor: pointer; font-weight: 700; padding: 4px 24px;
    }
    .so-tabs button.active { background: #fff; border-color: var(--jas-primary); color: var(--jas-primary); }
    .so-tab-body { border: 1px solid var(--jas-primary); border-top: none; padding: 8px; }
    .so-tabs button:disabled { cursor: not-allowed; opacity: .55; }

    .so-footer { text-align: center; margin-top: .8rem; }
    .so-footer .so-btn { margin: 0 2px; min-width: 80px; }
    .so-red { color: red; }
    .so-checkout-table td { padding: 2px 8px; }
    .so-checkout-table .InputLabel { width: 120px; }

    /* Modal（Bootstrap 骨架 + 舊系統 modalBox 標題樣式） */
    /* 視窗標題吃環境主題色（正式青色／測試玫瑰紅）；舊站也是靠環境換色，不是寫死藍色。
       銷售訂單那頁還在用自己內嵌的寫死值，等內嵌那份併掉時一起改。 */
    .so-modal-caption { background-color: var(--jas-primary); color: #fff; font-size: larger; padding: 4px 10px; }
    .so-tabs .nav-link { padding: 3px 12px; font-size: 13px; color: #333; }
    .so-tabs .nav-link.active { color: var(--jas-primary); border-color: var(--jas-primary) var(--jas-primary) #fff; font-weight: 700; }
    .so-item-tabs-body { border: 1px solid #dee2e6; border-top: 0; padding: 6px; }

    /* 明細視窗版面：上方基本欄位跨滿版，下面左右兩欄（左＝分頁與金額、右＝出貨倉庫與庫存） */
    .so-item-columns { display: flex; gap: 12px; align-items: flex-start; }
    .so-item-main-col { flex: 0 0 500px; max-width: 500px; }
    .so-item-side { flex: 1 1 auto; min-width: 0; }
    .so-item-single .InputLabel { width: 140px; }
    .so-item-single td { white-space: nowrap; }
    #itemTabPrint,
    #itemTabPrint td {
        white-space: normal;
    }
    #itemTabPrint .so-print-fieldset {
        border: 1px solid #ccc;
        box-sizing: border-box;
        margin: 0 0 10px;
        padding: 4px 8px 8px;
        width: 100%;
    }
    #itemTabPrint .so-print-fieldset legend {
        color: var(--jas-primary);
        float: none;
        font-size: 13px;
        font-weight: 700;
        margin: 0;
        padding: 0 6px;
        width: auto;
    }
    #itemTabPrint .so-print-hint {
        font-size: 13px;
        margin: 0 0 4px;
        white-space: normal;
    }
    #itemTabPrint table {
        width: auto;
    }
    .so-font-sample { max-height: 420px; overflow-y: auto; }
    .so-font-sample td { padding: 2px 4px; }
    .so-font-sample img { width: 100%; max-width: 600px; }
    .so-item-pattern-panel {
        display: none; position: fixed; z-index: 1095;
        max-width: min(900px, calc(100vw - 40px)); max-height: min(760px, calc(100vh - 40px));
        overflow: auto; border: 3px solid #222; background: lightblue;
        box-shadow: 5px 5px 8px rgba(0, 0, 0, .45); padding: 4px; font-weight: 700;
    }
    .so-item-pattern-grid { border-collapse: collapse; background-color: lightblue; }
    .so-item-pattern-grid td { border: 1px solid #d9d9d9; background-color: #fff; padding: 2px; text-align: center; vertical-align: top; }
    .so-item-pattern-code { font-size: 12px; white-space: nowrap; }
    .so-item-pattern-disney-cell img { display: block; width: 70px; height: 70px; object-fit: cover; }
    .so-item-pattern-lover-cell img { display: block; width: 140px; height: 140px; object-fit: contain; }
    .so-item-pattern-acredo img { display: block; max-width: 500px; }
    .so-item-pattern-aluxe { width: 768px; height: 721px; background: #fff url('/admin/images/ALUXE_加價刻印圖案.png') no-repeat; background-size: 768px 721px; }

    /* 廠商規格彈出清單（對應舊系統 PopupControlExtender + 無表頭 GridView，214x66 可捲動） */
    .so-popup-host { position: relative; display: inline-block; }
    .so-popup-list {
        display: none; position: absolute; left: 0; top: 100%; z-index: 1080;
        width: 214px; max-height: 66px; overflow: auto;
        border: 1px solid gray; background-color: #fff;
    }
    .so-popup-list table { width: 100%; border-collapse: collapse; font-size: 12px; }
    .so-popup-list tr { cursor: pointer; }
    .so-popup-list:not(.so-finger-popup) tr:hover { background-color: lightblue; }
    .so-popup-list td { padding: 0 2px; white-space: nowrap; }
    .so-popup-list tr {
        height: var(--legacy-popup-row-height, auto);
    }
    .so-popup-list img {
        width: var(--legacy-popup-image-width, auto);
        max-height: var(--legacy-popup-row-height, none);
        margin-right: 4px;
        vertical-align: middle;
    }
    .so-popup-desc {
        margin-left: 4px;
        color: #555;
    }
    .so-surface-popup,
    .so-ring-position-popup {
        overflow: auto;
    }
    .so-surface-popup td,
    .so-ring-position-popup td {
        overflow: hidden;
        text-overflow: clip;
        max-width: 100%;
    }
    .so-surface-range-popup {
        overflow: auto;
    }
    /* 表面處理位置／分色金屬位置有 100px 縮圖，舊站 .popupControl 沒有尺寸限制、依內容撐開 */
    .so-photo-popup { width: max-content; max-width: none; max-height: 400px; overflow: auto; }
    .so-photo-popup td { white-space: nowrap; padding: 4px 6px; }
    .so-ring-size-popup { width: 160px; max-height: 200px; overflow: auto; }
    .so-ring-size-popup td:first-child { width: 80px; }
    .so-metal-popup { max-height: none; overflow: visible; }
    .so-lettering-popup {
        left: -45px;
        width: 1200px;
        height: 500px;
        max-height: none;
        overflow: auto;
        padding: 0;
    }
    .so-lettering-popup button {
        min-width: 38px;
        margin: 2px;
    }
    .so-print-popup-host { display: inline-block; }
    .so-print-lettering-popup {
        left: -45px;
        width: 1200px;
        height: 200px;
        max-height: none;
        overflow: auto;
        padding: 0;
    }
    .so-print-lettering-popup button {
        min-width: 38px;
        margin: 2px;
    }
    .so-finger-popup {
        width: 318px;
        max-height: none;
        overflow: visible;
        padding: 0;
    }
    .so-finger-popup table { width: 100%; border-collapse: collapse; font-size: 14px; }
    .so-finger-popup th {
        background-color: #0066cc;
        color: #fff;
        font-weight: 700;
        text-align: center;
        padding: 2px;
    }
    .so-finger-popup td {
        width: 31px;
        height: 100px;
        text-align: center;
        vertical-align: middle;
        cursor: pointer;
        white-space: normal;
        padding: 0 2px;
    }
    .so-finger-popup td:hover { background-color: lightblue; }
    .so-finger-confirm {
        display: inline-block;
        border: 0;
        background: transparent;
        color: #06c;
        padding: 0 2px;
        text-align: left;
    }
    .so-finger-label { writing-mode: vertical-rl; text-orientation: upright; }

/* 舊站的 asp:Panel GroupingText 會 render 成 fieldset/legend；bootstrap reboot 把 legend 變成
   width:100% 的區塊標題，所以在 .so-page 內還原成舊站那種細框 + 小標題。 */
.so-page fieldset {
  border: 1px solid #d9d9d9;
  margin: 6px 0;
  padding: 6px 10px;
}

.so-page fieldset > legend {
  float: none;
  width: auto;
  margin: 0;
  padding: 0 4px;
  color: #333;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

/* 維修單（明細頁與建立頁）：舊站靠內層 table 的間距把左邊縱向圖示格與內容隔開，
   這裡用 padding 補回來。限定 .md-page 以免動到銷售訂單那頁。 */
.md-page .so-person-fields {
    padding: 4px 10px;
}

.md-page .so-collapse-body {
    padding: 8px 10px;
}

.md-page .so-person-icon-cell {
    padding: 6px 4px;
}

/* 區塊內的表格與 fieldset 之間留一點空隙 */
.md-page .so-person-fields > .so-legacy-table {
    margin-bottom: 6px;
}

.md-page .so-person-fields > .so-h1 {
    margin-top: .8rem;
}

/* ===== 停用中的按鈕 =====
   bootstrap 預設只把 .btn:disabled 降成 opacity .65，outline 樣式在白底上幾乎看不出不能按。
   這裡統一改成明確的灰底灰字 + not-allowed 游標，讓「可按/不可按」一眼分得出來。
   用 !important 是刻意覆寫 .btn-primary:disabled 等各色變體（否則要逐色列舉）。 */
.btn:disabled,
.btn.disabled,
fieldset:disabled .btn {
  background-color: #e9ecef !important;
  background-image: none !important;
  border-color: #ced4da !important;
  color: #8a939c !important;
  opacity: 1 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  /* 保留指標事件，滑過停用鈕時 title 說明才顯示得出來 */
  pointer-events: auto !important;
}

/* 清單列的動作欄：按鈕貼齊、不換行，配色靠實心/灰底區分可按與否 */
.survey-actions-cell .btn {
  white-space: nowrap;
}
