/* 2026-04-26 Curtis: Phase 6.2 IRIS Helix Witness 視覺對齊
 *
 * 設計原則：
 * - 不動 ACE / Bootstrap 源碼，全部覆寫集中在這檔。Easy rollback：
 *   只要從 main.jsp 拿掉這行 link 就回到原貌。
 * - 沿用 login.jsp Phase 6.1 已定的 IRIS color token + system font stack，
 *   兩端一致（登入頁 → 主應用）。
 * - !important 用在已知 ACE 強制覆寫的規則（ACE 自己也愛用 !important）。
 */

:root {
	--iris-brand:        #2B3990;   /* IRIS Helix primary */
	--iris-brand-hover:  #1f2a6c;   /* hover 暗一階 */
	--iris-brand-soft:   #eff3fa;   /* 淡藍 hover bg */
	--iris-ink:          #0a1628;
	--iris-ink-soft:     #1e293b;
	--iris-text:         #334155;
	--iris-muted:        #64748b;
	--iris-line:         #e2e8f0;
	--iris-error:        #b91c1c;
	--iris-success:      #059669;
	--iris-warning:      #d97706;

	/* System font stack（醫院內網無 CDN 依賴）— 同 login.jsp Phase 6.1 */
	--iris-font-zh: 'PingFang TC', 'Microsoft JhengHei', 'Heiti TC', 'Noto Sans CJK TC', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================================
 * 1. Typography — 全站套 system font，蓋掉 ACE 的 Open Sans / 標楷體
 * ============================================================ */
html, body, .navbar, .sidebar, .breadcrumb, .nav-list,
.btn, .form-control, .table, .panel, .modal, .tooltip, .popover,
input, textarea, select, button {
	font-family: var(--iris-font-zh) !important;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* 標題稍粗、字距收緊 */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--iris-font-zh) !important;
	letter-spacing: 0.01em;
}

/* ============================================================
 * 2. Primary button — ACE 預設 #428bca → IRIS #2B3990
 * ============================================================ */
.btn-primary,
.btn-primary:focus {
	background-color: var(--iris-brand) !important;
	border-color: var(--iris-brand) !important;
}
.btn-primary:hover,
.btn-primary:active,
.open .btn-primary.dropdown-toggle,
.btn-primary.active {
	background-color: var(--iris-brand-hover) !important;
	border-color: var(--iris-brand-hover) !important;
}

/* primary text/bg utility */
.text-primary, a.text-primary:hover { color: var(--iris-brand) !important; }
.bg-primary { background-color: var(--iris-brand) !important; }
.label-primary { background-color: var(--iris-brand) !important; }

/* ============================================================
 * 3. Links — primary blue 對齊
 * ============================================================ */
a { color: var(--iris-brand); }
a:hover, a:focus { color: var(--iris-brand-hover); }

/* ============================================================
 * 4. Navbar — 2026-05-24 Curtis: 主藍 header
 * 深藍底 #1c6aa6（= 表單設計系統 --iris-accent）+ 白字 + 反白系圖示
 * header 與表單統一同一個藍；白字過 WCAG AA 5.7:1
 * ============================================================ */
.navbar,
.navbar-default,
.navbar .navbar-inner {
	background: #1c6aa6 !important;            /* 主藍 header — 統一表單設計系統 --iris-accent */
	background-image: none !important;
	border-bottom: 1px solid #134e7c !important;  /* 深一階主藍 separator */
}

/* navbar 標題 + brand：深藍底配白字 */
.navbar-brand,
.navbar .navbar-brand small {
	color: #ffffff !important;
}

/* nav li 預設文字色：深藍底配白字 */
.navbar .nav > li > a {
	color: #ffffff !important;
}

/* hover/focus/open：深藍底用「白色微透明 overlay」+ 白字 */
.navbar .nav > li > a:hover,
.navbar .nav > li > a:focus,
.navbar .nav > li.open > a {
	background-color: rgba(255, 255, 255, 0.16) !important;  /* 深藍底用淡白 overlay */
	color: #ffffff !important;
}
/* 2026-04-28 Curtis: Phase 6.4 Q2 D — dropdown 開啟時加底部 underline，
 * 明確標示「目前打開的是哪個」，補強無永久色塊區隔下的「open state 辨識度」 */
.navbar .nav > li.open > a {
	box-shadow: inset 0 -2px 0 #ffffff !important;
}
/* 2026-04-28 Curtis: Phase 6.4 Q2 D — keyboard focus-visible 高對比 outline (a11y)
 * 鍵盤使用者必須清楚看到「目前 focus 在哪個 tab」，WCAG 2.4.7 Focus Visible AA */
.navbar .nav > li > a:focus-visible {
	outline: 2px solid #ffffff !important;
	outline-offset: -2px;
}

/* badge 紅色不變 */
.navbar .nav > li > a > .badge {
	background-color: var(--iris-error) !important;
}

/* 保留「重新計時」綠色按鈕能看清 */
.navbar .btn-success {
	background-color: var(--iris-success) !important;
	border-color: var(--iris-success) !important;
}

/* 漢堡按鈕 icon-bar：深藍底配白 */
#navbar #menu-toggler.navbar-toggle .icon-bar {
	background-color: #ffffff !important;
}

/* ============================================================
 * 5. Sidebar 左側選單 — active 狀態用 IRIS 主色
 * ============================================================ */
.sidebar {
	background-color: #f8fafc !important;
	border-right: 1px solid var(--iris-line) !important;
}
.nav-list > li.active > a,
.nav-list > li.active:hover > a {
	background-color: var(--iris-brand-soft) !important;
	color: var(--iris-brand) !important;
	font-weight: 600;
	border-left: 3px solid var(--iris-brand) !important;
}
.nav-list > li > a:hover {
	background-color: #f1f5f9 !important;
	color: var(--iris-ink) !important;
}
.nav-list > li.active > a > .menu-icon,
.nav-list > li.active > a > [class*="icon-"] {
	color: var(--iris-brand) !important;
}

/* ============================================================
 * 6. Tables — 拿掉重邊框、加細線
 * ============================================================ */
.table {
	color: var(--iris-text);
}
.table thead > tr > th {
	background-color: #f8fafc !important;
	border-bottom: 2px solid var(--iris-line) !important;
	color: var(--iris-ink-soft);
	font-weight: 600;
}
.table > tbody > tr > td {
	border-top: 1px solid var(--iris-line) !important;
}
.table-striped > tbody > tr:nth-of-type(odd) {
	background-color: #f8fafc !important;
}

/* ============================================================
 * 7. Form controls — focus 用 IRIS 色
 * ============================================================ */
.form-control:focus {
	border-color: var(--iris-brand) !important;
	box-shadow: 0 0 0 3px rgba(43, 57, 144, 0.12) !important;
	outline: none !important;
}

/* ============================================================
 * 8. Panel headers — 拿掉 ACE 漸層、改 flat
 * ============================================================ */
.widget-box .widget-header,
.widget-header,
.panel-heading {
	background: #f8fafc !important;
	background-image: none !important;
	border-bottom: 1px solid var(--iris-line) !important;
	color: var(--iris-ink-soft);
}

/* ============================================================
 * 9. Page header (h1.header) — IRIS 強調色
 * ============================================================ */
.page-header h1,
.page-header h2,
.page-header h3,
h1.header, h2.header, h3.header, h4.header, h5.header {
	color: var(--iris-ink) !important;
	border-bottom-color: var(--iris-line) !important;
}
h5.header.smaller.red {
	color: var(--iris-brand) !important;   /* 「待辦案件」標題改 IRIS 藍 */
	border-bottom-color: var(--iris-brand-soft) !important;
}

/* ============================================================
 * 10. Breadcrumb — 細緻化
 * ============================================================ */
.breadcrumbs {
	background-color: #fff !important;
	background-image: none !important;
	border-bottom: 1px solid var(--iris-line) !important;
}
.breadcrumb {
	background-color: transparent !important;
}
.breadcrumb > li > a {
	color: var(--iris-muted);
}
.breadcrumb > .active {
	color: var(--iris-ink-soft);
}

/* ============================================================
 * 11. Alert / Toast colors — 對齊 IRIS token
 * ============================================================ */
.alert-info {
	background-color: var(--iris-brand-soft) !important;
	border-color: var(--iris-brand) !important;
	color: var(--iris-ink) !important;
}

/* ============================================================
 * 12. Footer — 新 footer 風格已在 footer.jsp 改字串，這裡微調樣式
 * ============================================================ */
.footer .footer-inner .footer-content {
	color: var(--iris-muted);
}
.footer .footer-content .blue.bolder {
	color: var(--iris-brand) !important;
}

/* ============================================================
 * 13. 通用：拿掉 ACE box-shadow 重感
 * ============================================================ */
.widget-box,
.panel {
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

/* ============================================================
 * 14. Session status chip（navbar 永遠顯示）— Phase 6.3
 * ============================================================ */
/* chip wrap：desktop 自然撐寬給文字 chip，手機版再切 absolute 圓點居中
 * 保住 .ace-nav > li 預設 float: left；用 flex 內部垂直居中 */
.ace-nav > li.iris-session-chip-wrap {
	float: left;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 45px;
	padding: 0 12px;
	background: transparent;
}

.iris-session-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 14px;
	font-weight: 500;
	line-height: 1.15;
	border-radius: 18px;
	border: 1px solid transparent;
	/* 深藍底 navbar — chip 用淡白底 + 白字 */
	background: rgba(255, 255, 255, 0.14);
	color: #ffffff;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
	cursor: default;
	user-select: none;
	white-space: nowrap;
}
/* 兩行排版：時間突出（top 13px 粗）、動作小淡（bot 10px）*/
.iris-session-chip-text {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	line-height: 1.15;
	gap: 1px;
}
.iris-session-chip-text .line-top {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.01em;
}
.iris-session-chip-text .line-bot {
	font-size: 10px;
	font-weight: 400;
	opacity: 0.85;
	letter-spacing: 0.02em;
}
.iris-session-chip::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--iris-success);
	box-shadow: 0 0 0 0 currentColor;
	flex-shrink: 0;
}
/* 2026-04-27 Curtis: Phase 6.4 B3 淺底 navbar 改造 — chip 三狀態重新調配
 * 原本給深底 navbar 設計（深底配亮文字），改 light-on-dark → dark-on-light 強對比 */

/* 平時：綠色 — 深藍底用亮綠字 + 半透綠填充 */
.iris-session-chip-ok {
	background: rgba(52, 211, 153, 0.18) !important;
	color: #a7f3d0 !important;
	border-color: rgba(52, 211, 153, 0.45) !important;
}
.iris-session-chip-ok::before { background: #34d399; }

/* 警告：橘色 — 亮橘字 + 半透橘填充 */
.iris-session-chip-warn {
	background: rgba(251, 191, 36, 0.20) !important;
	color: #fde68a !important;
	border-color: rgba(251, 191, 36, 0.5) !important;
}
.iris-session-chip-warn::before { background: #fbbf24; }

/* 危急：紅色 — 亮紅字 + 半透紅填充 */
.iris-session-chip-danger {
	background: rgba(248, 113, 113, 0.20) !important;
	color: #fecaca !important;
	border-color: rgba(248, 113, 113, 0.55) !important;
}
.iris-session-chip-danger::before { background: #f87171; }

/* 脈動動畫（剩 < 5min 觸發）*/
@keyframes iris-session-pulse {
	0%, 100% { box-shadow: 0 0 0 0 currentColor; }
	50%      { box-shadow: 0 0 0 4px rgba(255,255,255,0.05); }
}
.iris-session-chip-pulse::before {
	animation: iris-session-pulse 2s ease-in-out infinite;
}

/* RWD 二段式：永遠中文 2 行，只在手機才切圓點。
 * 中等寬度只縮 padding / 字級，文字不切英文（避免認知切換）*/
.iris-session-chip-text-en { display: none !important; }    /* 用不到，永遠藏 */
.iris-session-chip-text { white-space: nowrap; }

/* ≤ 1199px：中等螢幕縮緊 padding + 字級 */
@media (max-width: 1199px) {
	.iris-session-chip { padding: 3px 10px; }
	.iris-session-chip-text .line-top { font-size: 12px; }
	.iris-session-chip-text .line-bot { font-size: 9px; }
}

/* ≤ 767px：手機版只剩圓點 + tooltip
 * wrap 改 absolute 釘圓點在 45px navbar 中央（圓點 22px 沒辦法 flex 垂直 align）*/
@media (max-width: 767px) {
	.ace-nav > li.iris-session-chip-wrap {
		display: block;
		position: relative;
		min-width: 44px;
		padding: 0;
	}
	.ace-nav > li.iris-session-chip-wrap > .iris-session-chip {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		padding: 0;
		width: 22px;
		height: 22px;
		gap: 0;
		justify-content: center;
		background: transparent !important;
		border-color: transparent !important;
	}
	.iris-session-chip .iris-session-chip-text { display: none !important; }
	.iris-session-chip::before {
		width: 12px;
		height: 12px;
	}
}

/* ============================================================
 * 15. Reduce motion — 尊重使用者系統設定
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

/* ============================================================
 * 16. Sidebar RWD lockout 修補（2026-04-27 Curtis）
 * 768~991px 死區：ACE 把 sidebar.responsive 推出畫面，
 * 但 #menu-toggler 同時掛 .navbar-toggle（Bootstrap @>=768px display:none）
 * 與 .menu-toggler（ACE @<=991px display:block，且要 .main-container 後代）
 * 而按鈕在 navbar 內、main-container 外，ACE 規則 miss → 死區無法導航。
 * 救回 display 即可，沿用 Bootstrap navbar-toggle 既有定位，不要疊 ACE absolute。
 * ============================================================ */
@media only screen and (max-width: 991px) {
	#navbar #menu-toggler.navbar-toggle.menu-toggler {
		display: block !important;
	}
}

/* ============================================================
 * 17. Navbar 視覺修補（2026-04-27 Curtis）— Phase 6.4
 *
 * 問題：>835px 時 navbar 右邊界 + 下邊界露空隙
 * 根因（DevTools 驗證 + Codex 第二意見確認）：
 *   - navbar 計算高度 47.97px（不是 ACE 標準 45px）
 *   - 來源：navbar-brand padding 10+10 + logo 27px（1449x1086 比例 36px寬→27px高）
 *           = 47px content + 1px iris border-bottom = 47.97px
 *   - ace-nav > li 是 ACE 標準 45px → 比 navbar 矮 ~3px → 下邊界露空隙
 *   - 加上 commit 3925df4 加回漢堡按鈕後，836-991 區間寬度 budget 變窄，
 *     navbar-buttons 內容（chip + 鈴鐺 + 信件 + Welcome）擠到右邊界外被切
 *
 * 修法（不動 ACE 45px 假設、順著規範走）：
 *   (1) 換正方形 logo（1024x1024）+ 縮 brand 為 45px
 *   (2) 768-991 區間給 navbar-buttons 留 12px 右安全邊
 *   (3) 統一 ace-nav li 背景透明，避免 ACE 殘留色塊撞 IRIS 主色
 * ============================================================ */

/* (1) Brand 縮回 ACE 45px 規範：padding 7+8 + img 30px = 45 */
#navbar .navbar-brand {
	height: 45px;
	padding-top: 7px;
	padding-bottom: 8px;
	line-height: 30px;
}
#navbar .navbar-brand > small {
	line-height: 30px;
}
#navbar .navbar-brand img {
	height: 30px;
	width: auto;       /* 正方形 logo → 寬高同 30px */
	/* 2026-05-24 Curtis: 深藍底 header — 官方校徽加白色圓角底襯（不換 logo，保留識別）*/
	background: #ffffff;
	border-radius: 6px;
	padding: 2px;
	box-sizing: content-box;
}

/* (2) 768-991 區間留右邊安全邊（避免漢堡按鈕加回後 navbar-buttons 切右邊） */
@media only screen and (min-width: 768px) and (max-width: 991px) {
	#navbar .navbar-buttons.pull-right {
		margin-right: 12px;
	}
}

/* (3) ace-nav li 統一透明（顧問建議：醫療系統 monochromatic 配色，業界 Epic/Cerner/NIH IRB 全單色）
 *     2026-04-27 Curtis 拍板：先嘗試多色階後改採顧問 a 方案 + Tier 1 增強
 *     視覺層次不靠色相，靠 (4)(5)(6) icon 微差色 + 分隔線 + hover lift 堆疊
 *     2026-04-27 Curtis: Phase 6.4 B3 淺底 navbar 改造 — hover bg 改淡青藍 */
#navbar .ace-nav > li > a {
	background-color: transparent !important;
}
#navbar .ace-nav > li > a:hover,
#navbar .ace-nav > li > a:focus,
#navbar .ace-nav > li.open > a {
	background-color: rgba(255, 255, 255, 0.16) !important;  /* 深藍底用淡白 overlay */
}

/* (4) Tier 1-1 Icon 微差色 — 避免「全純白看起來同一坨」單調感
 *     2026-04-27 Curtis: Phase 6.4 B3 淺底 navbar 改造 — 白系 icon 改深灰系
 *     不同 li 的 icon 用不同明度深灰，眼睛能感受層次但仍協調 */
#navbar .ace-nav > li.purple > a > .fa-bell {
	color: #ffffff;                          /* 鈴鐺：白（紅 badge 提示時最醒目）*/
}
#navbar .ace-nav > li.green > a > .fa-envelope {
	color: rgba(255, 255, 255, 0.85);        /* 信件：次亮白 */
}
#navbar .ace-nav > li.light-blue > a > .glyphicon-user,
#navbar .ace-nav > li.light-blue > a > .fa-caret-down {
	color: rgba(255, 255, 255, 0.72);        /* Welcome：淺白（user icon 不搶風頭）*/
}

/* (5) Tier 1-2 垂直分隔線 — li 之間加 1px 細線，視覺自然分塊不喧賓奪主
 *     2026-04-27 Curtis: Phase 6.4 B3 淺底 navbar 改造 — 白系分隔改淡黑 */
#navbar .ace-nav > li + li {
	border-left: 1px solid rgba(255, 255, 255, 0.18);
}

/* (6) Tier 1-3 Hover 微 lift — 0.5px 上移 + 200ms ease，現代 SaaS 互動回饋
 *     reduce-motion 由 Section 15 全域規則接手，不重複 */
#navbar .ace-nav > li > a {
	transition: background-color 0.2s ease, transform 0.15s ease;
}
#navbar .ace-nav > li > a:hover {
	transform: translateY(-0.5px);
}

/* ============================================================
 * 18. Brand text — 全銜兩行堆疊（2026-05-24 Curtis）
 *   上：中文機構全銜「中山醫學大學附設醫院」
 *   下：英文系統全銜「Human Ethics Review & Management Electronic System」
 *   ≥992 顯示中英全銜；<992 只留中文（英文系統全銜太長，窄螢幕隱藏）
 * 螢幕閱讀器仍用 navbar-brand 的 aria-label 拿到完整名稱
 * ============================================================ */
.iris-brand-stack {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	line-height: 1.12;
	vertical-align: middle;
}
.iris-brand-zh {
	font-size: 15px;
	font-weight: 600;
}
/* 機構名（主）粗、系統名（從）一般字重 + 淡一階，拉出主從層次 */
.iris-brand-org { font-weight: 700; }
.iris-brand-sys { font-weight: 400; opacity: 0.85; }
.iris-brand-en {
	font-size: 10px;
	font-weight: 400;
	opacity: 0.82;
	letter-spacing: 0.01em;
}
@media (max-width: 991px) {
	.iris-brand-en { display: none; }
}

/* ============================================================
 * 19. 手機 navbar 維持單行（2026-04-30 Curtis）
 * 問題：iPhone (375-430) 內頁 header 折成兩行
 * 根因：menu-toggler 50 + brand 135 + chip 44 + envelope 50 + Welcome+使用者名 ~150
 *      ≈ 430px，iPhone 主流寬度撐不下，.navbar-buttons.pull-right 掉到第二行
 *      ACE 原 fallback 只在 480-540 / ≤360 隱 .user-info，iPhone 主流寬度落空
 * 修法：<768 隱藏 .user-info（Welcome + 名字），保留 user icon + caret
 *      點開 dropdown 仍可看到名字 / 修改個人資訊 / 登出
 * ============================================================ */
@media (max-width: 767px) {
	#navbar .ace-nav > li.light-blue .user-info {
		display: none !important;
	}
}

/* ============================================================
 * 20. Auth pages forms — login / register / forget / reset_password
 * 2026-05-02 Curtis: B-style 階段，純 CSS 視覺 polish（不投資 brand）
 * (rename 自 a agent worktree 原 §17，避免跟既有 §17 navbar 修補衝號)
 *
 * 設計目標：
 *   - 高 44px 輸入框、圓角 8、淡灰底，現代 SaaS 觀感
 *   - focus 走 IRIS brand 色 + 8% 陰影光暈
 *   - 主要 CTA 按鈕（送出 / 登入 / 註冊）改寬版 100% / 高 46px / 圓角 10
 *   - has-error 用 brand error 紅，與訊息對齊
 *   - desktop label 從 col-sm-4 right-align 改 stacked top-align
 *
 * 範圍：全部 scope 在 .login-container 內，避免影響其他頁面（如 main 業務表單）
 * ============================================================ */

/* Inputs：高 44 + 圓角 8 + 淡底 + 線色 */
.login-container .form-control {
	height: 44px;
	border-radius: 8px;
	background: #f8fafc;
	border-color: #e2e8f0;
}

/* Focus：IRIS brand 色 + 8% 陰影 */
.login-container .form-control:focus {
	border-color: var(--iris-brand) !important;
	box-shadow: 0 0 0 3px rgba(12, 44, 91, 0.08) !important;
	outline: none !important;
}

/* has-error：brand 紅 */
.login-container .has-error .form-control {
	border-color: #b91c1c !important;
}

/* Primary CTA：寬 100% + 高 46 + 圓角 10 */
.login-container .btn-primary {
	width: 100%;
	height: 46px;
	border-radius: 10px;
	font-weight: 500;
	letter-spacing: 0.02em;
}

/* form 內 .clearfix 包送出鈕 改 block 拿掉 float */
.login-container form .clearfix > .btn-primary.pull-right {
	float: none !important;
	display: block;
	margin-left: 0;
}

/* desktop (≥768) label stacked：control-label 從右靠 col-sm-4 改 top-align */
@media (min-width: 768px) {
	.login-container .form-horizontal label.control-label {
		text-align: left;
		padding-top: 0;
		margin-bottom: 4px;
		font-weight: 500;
		color: var(--iris-ink-soft);
	}
}

/* 2026-05-04 Curtis: P0-K K-1 — CIRB 案件待辦 row 紅底（時效性突出）
 * spec M0120-FLOW-09；不衝突 .bg-withdraw 灰底（case_progress.jsp:126）
 * 用淡紅背景 + 紅左 border、視覺權重「比一般高、比錯誤輕」
 */
.bg-cirb-alert {
	background-color: #fdedec !important;
	border-left: 3px solid #b91c1c;
}
.bg-cirb-alert td:first-child {
	position: relative;
}
.bg-cirb-alert:hover {
	background-color: #fad7d3 !important;
}
/* 2026-05-25 Curtis: 斑馬紋 .table-striped tr:nth-of-type(odd)（特異度 0,2,2 + !important）
 * 會在奇數列蓋掉 .bg-cirb-alert（0,1,0）的粉紅底、只剩左紅邊。拉高 selector 特異度，
 * 讓 CIRB 粉紅在斑馬表的奇偶列都勝出。 */
.table-striped > tbody > tr.bg-cirb-alert {
	background-color: #fdedec !important;
}
.table-striped > tbody > tr.bg-cirb-alert:hover {
	background-color: #fad7d3 !important;
}

/* 2026-05-10 Curtis: P0-I 件 2 — disabled / 鎖定區塊游標 not-allowed
 * 動機：表單鎖定區塊（如審查中、案件已送出後 PI 唯讀欄位）滑鼠移上去仍是
 * 普通箭頭、使用者誤以為可點。改 cursor: not-allowed 視覺一眼可辨識。
 * scope：HTML [disabled] 屬性 + readonly + 自訂 .iris-disabled / .iris-readonly class
 * 不破壞既有可點元件、僅針對「真的鎖住」的元素。
 */
[disabled],
[readonly],
.iris-disabled,
.iris-readonly,
input[disabled],
textarea[disabled],
select[disabled],
button[disabled] {
	cursor: not-allowed !important;
}

/* ============================================================
 * 21. P0-D 附件管理 table — clean SaaS file list
 * 2026-05-12 Curtis: form_accessory_20230801.jsp 專用 class。
 * ============================================================ */
.iris-accessory-table-shell {
	width: 95%;
	margin: 0 auto 12px;
	overflow-x: auto;
	background: #ffffff;
	border: 1px solid var(--iris-line);
	border-radius: 8px;
}

.iris-accessory-table {
	width: 100%;
	min-width: 960px;
	margin: 0;
	border-collapse: collapse;
	table-layout: fixed;
	background: #ffffff;
}

.iris-accessory-table th {
	padding: 11px 14px;
	background: #f8fafc;
	border-bottom: 1px solid var(--iris-line);
	color: #64748b;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-align: left;
}

.iris-accessory-table td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--iris-line);
	color: #1e293b;
	font-size: 14px;
	line-height: 1.45;
	vertical-align: middle;
}

.iris-accessory-table tbody:last-child tr:last-child td {
	border-bottom: 0;
}

.iris-accessory-row:hover td {
	background: #f8fafc;
}

.iris-accessory-row.is-new td {
	background: #f8fbff;
}

.iris-accessory-row.is-new .iris-accessory-index-badge {
	background: #e0f2fe;
	color: #0369a1;
}

.iris-accessory-row.has-error td {
	background: #fff7ed;
}

.iris-accessory-row.is-saved-flash td {
	animation: irisAccessorySavedFlash 2.2s ease-out;
}

@keyframes irisAccessorySavedFlash {
	0% { background: #ecfdf5; }
	70% { background: #ecfdf5; }
	100% { background: #ffffff; }
}

.iris-accessory-index-cell,
.iris-accessory-select-cell,
.iris-accessory-action-cell {
	text-align: center;
}

.iris-accessory-index-badge {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	background: #f1f5f9;
	color: #94a3b8;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
}

.iris-accessory-choice-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: flex-start;
}

.iris-accessory-choice {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 22px;
	margin: 0;
	padding: 2px 6px;
	border: 1px solid transparent;
	border-radius: 6px;
	color: #475569;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.iris-accessory-choice:hover {
	background: var(--iris-brand-soft);
	border-color: #c7d2fe;
	color: var(--iris-brand);
}

.iris-accessory-choice input[type="radio"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.iris-accessory-radio-dot {
	display: inline-block;
	flex: 0 0 auto;
	width: 12px;
	height: 12px;
	border: 2px solid #cbd5e1;
	border-radius: 999px;
	background: #ffffff;
	box-sizing: border-box;
	transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.iris-accessory-choice input[type="radio"]:checked + .iris-accessory-radio-dot {
	background: var(--iris-brand);
	border-color: var(--iris-brand);
	box-shadow: inset 0 0 0 2px #ffffff;
}

.iris-accessory-choice input[type="radio"]:focus + .iris-accessory-radio-dot {
	outline: 2px solid rgba(43, 57, 144, 0.22);
	outline-offset: 2px;
}

.iris-accessory-choice.is-selected {
	background: #f8fafc;
	border-color: #dbe4f0;
	color: #1e293b;
}

.iris-accessory-choice-warn .iris-accessory-choice-text {
	color: #dc2626;
}

.iris-accessory-status-readonly {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: #475569;
	font-size: 13px;
	font-weight: 600;
}

.iris-accessory-status-dot {
	width: 10px;
	height: 10px;
	border-radius: 999px;
	background: var(--iris-brand);
	box-shadow: 0 0 0 3px rgba(43, 57, 144, 0.12);
}

.iris-accessory-status-readonly.is-excluded {
	color: #dc2626;
}

.iris-accessory-status-readonly.is-excluded .iris-accessory-status-dot {
	background: #ffffff;
	border: 2px solid #cbd5e1;
	box-shadow: none;
}

.iris-accessory-file-cell {
	min-width: 0;
}

.iris-accessory-file-link {
	display: inline-flex;
	align-items: flex-start;
	max-width: 100%;
	gap: 9px;
	color: #1e293b;
	font-weight: 600;
	text-decoration: none;
}

.iris-accessory-file-link:hover,
.iris-accessory-file-link:focus {
	color: var(--iris-brand);
	text-decoration: none;
}

.iris-accessory-file-icon {
	flex: 0 0 auto;
	margin-top: 2px;
	font-size: 18px;
	line-height: 1.2;
}

.iris-accessory-file-icon-pdf {
	color: #dc2626;
}

.iris-accessory-file-icon-image {
	color: #3b82f6;
}

.iris-accessory-file-icon-generic {
	color: #64748b;
}

.iris-accessory-file-name {
	display: inline-block;
	min-width: 0;
	flex: 1 1 auto;
	white-space: normal;
	word-break: break-all;
	overflow-wrap: anywhere;
	line-height: 1.4;
}

.iris-accessory-file-meta,
.iris-accessory-row-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
}

.iris-accessory-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 7px;
	border-radius: 999px;
	background: #f1f5f9;
	color: #64748b;
	font-size: 12px;
	font-weight: 500;
}

.iris-accessory-tag-warn {
	background: #fef2f2;
	color: #dc2626;
}

.iris-accessory-upload-field {
	display: flex;
	align-items: center;
	gap: 9px;
	min-width: 0;
}

.iris-accessory-upload-icon {
	flex: 0 0 auto;
	font-size: 18px;
}

/* 2026-05-17 Curtis: Phase 5 — form_accessory 脫離 ace_file_input plugin。
 * 原生 file input 視覺隱藏(保留鍵盤可聚焦),改用 <label> 當按鈕。 */
.iris-accessory-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.iris-accessory-upload-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 14px;
	border: 1px solid #cbd5e1;
	border-radius: 7px;
	background: #ffffff;
	color: var(--iris-brand, #2B3990);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.iris-accessory-upload-btn:hover {
	background: var(--iris-brand-soft, #eff3fa);
	border-color: var(--iris-brand, #2B3990);
}

/* 原生 input 聚焦(鍵盤操作)時,在 label 按鈕顯示 focus ring */
.iris-accessory-upload-field:focus-within .iris-accessory-upload-btn {
	border-color: var(--iris-brand, #2B3990);
	box-shadow: 0 0 0 3px rgba(43, 57, 144, 0.16);
}

.iris-accessory-upload-field.is-error .iris-accessory-upload-btn {
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.iris-accessory-selected-file {
	display: none;
	align-items: center;
	gap: 7px;
	margin-top: 8px;
	padding: 7px 9px;
	border: 1px solid #dbe4f0;
	border-radius: 7px;
	background: #f8fafc;
	color: #475569;
	font-size: 12px;
	line-height: 1.35;
}

.iris-accessory-selected-file.is-visible {
	display: inline-flex;
	max-width: 100%;
}

.iris-accessory-selected-file-name {
	min-width: 0;
	max-width: 260px;
	overflow: hidden;
	color: #1e293b;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.iris-accessory-selected-file-size {
	flex: 0 0 auto;
	color: #64748b;
}

.iris-accessory-field,
.iris-accessory-select {
	width: 100%;
	min-height: 34px;
	border: 1px solid #cbd5e1;
	border-radius: 7px;
	background: #ffffff;
	color: #1e293b;
	font-size: 14px;
	line-height: 1.4;
	box-sizing: border-box;
	vertical-align: middle;
}

.iris-accessory-field {
	padding: 6px 9px;
}

.iris-accessory-select {
	width: auto;
	max-width: 190px;
	padding: 5px 8px;
	color: #475569;
	font-size: 13px;
}

.iris-accessory-field:focus,
.iris-accessory-select:focus {
	border-color: var(--iris-brand) !important;
	box-shadow: 0 0 0 3px rgba(43, 57, 144, 0.10) !important;
	outline: none !important;
}

.iris-accessory-date-field {
	max-width: 150px;
}

.iris-accessory-required-mark {
	position: absolute;
	left: 2px;
	top: 50%;
	transform: translateY(-50%);
	width: 10px;
	color: #dc2626;
	font-weight: 700;
	line-height: 1;
	text-align: center;
}

.iris-accessory-type-cell,
.iris-accessory-date-cell {
	position: relative;
}

.iris-accessory-type-cell .iris-accessory-field,
.iris-accessory-date-cell .iris-accessory-field {
	width: 100%;
}

.iris-accessory-row.is-cert-excluded .cert-doc-type-field,
.iris-accessory-row.is-cert-excluded .cert-version-date-field {
	background: #f8fafc;
	color: #94a3b8;
	opacity: 0.58;
}

.iris-accessory-row.is-cert-excluded .cert-required-mark {
	opacity: 0;
}

.iris-accessory-field.is-error,
.iris-accessory-select.is-error {
	border-color: #dc2626 !important;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10) !important;
}

.iris-accessory-error {
	margin-top: 5px;
	color: #dc2626;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.35;
}

.iris-accessory-readonly-value {
	color: #475569;
	font-weight: 500;
}

.iris-accessory-action-cell {
	white-space: nowrap;
}

.iris-accessory-delete-checkbox,
.iris-accessory-select-all-checkbox {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--iris-brand);
	cursor: pointer;
	vertical-align: middle;
}

.iris-accessory-delete-checkbox:focus,
.iris-accessory-select-all-checkbox:focus {
	outline: 2px solid rgba(43, 57, 144, 0.22);
	outline-offset: 2px;
}

.iris-accessory-icon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 1px solid transparent;
	border-radius: 7px;
	background: transparent;
	color: #94a3b8;
	font-size: 17px;
	line-height: 1;
	transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.iris-accessory-icon-button:hover,
.iris-accessory-icon-button:focus {
	background: #f8fafc;
	border-color: #e2e8f0;
	color: var(--iris-brand);
	outline: none;
}

.iris-accessory-delete-button:hover,
.iris-accessory-delete-button:focus {
	background: #fef2f2;
	border-color: #fecaca;
	color: #dc2626;
}

.iris-accessory-remove-button:hover,
.iris-accessory-remove-button:focus {
	background: #f1f5f9;
	color: #64748b;
}

.iris-accessory-action-placeholder {
	color: #cbd5e1;
	font-weight: 600;
}

.iris-accessory-empty-row td {
	padding: 34px 16px;
	background: #ffffff;
	text-align: center;
}

.iris-accessory-empty-state {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 7px;
	color: #94a3b8;
	font-size: 13px;
}

.iris-accessory-empty-state i {
	font-size: 30px;
	color: #cbd5e1;
}

.iris-accessory-empty-state strong {
	color: #475569;
	font-size: 14px;
	font-weight: 600;
}

.iris-accessory-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 95%;
	margin: 10px auto 22px;
	gap: 12px;
}

.iris-accessory-toolbar-actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.iris-accessory-help,
.iris-accessory-view-help {
	color: #64748b;
	font-size: 13px;
}

.iris-accessory-help {
	flex: 1 1 auto;
	min-width: 220px;
}

.iris-accessory-view-help {
	width: 95%;
	margin: 8px auto 18px;
	text-align: right;
}

.iris-accessory-add-button,
.iris-accessory-batch-delete-button,
.iris-accessory-save-button,
.iris-accessory-cancel-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	height: 36px;
	min-width: 108px;
	padding: 0 14px;
	border: 1px solid transparent;
	border-radius: 7px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.iris-accessory-add-button span,
.iris-accessory-batch-delete-button span,
.iris-accessory-save-button span,
.iris-accessory-cancel-button span {
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

.iris-accessory-add-button i,
.iris-accessory-batch-delete-button i,
.iris-accessory-save-button i,
.iris-accessory-cancel-button i {
	width: 14px;
	font-size: 13px;
	line-height: 1;
	text-align: center;
}

.iris-accessory-add-button {
	border-color: #b8c2ee;
	background: #ffffff;
	color: var(--iris-brand);
}

.iris-accessory-batch-delete-button {
	border: 1px solid #fecaca;
	background: #ffffff;
	color: #dc2626;
}

.iris-accessory-save-button {
	border-color: var(--iris-brand);
	background: var(--iris-brand);
	color: #ffffff;
}

.iris-accessory-cancel-button {
	border-color: #cbd5e1;
	background: #ffffff;
	color: #475569;
}

.iris-accessory-form-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	width: 95%;
	margin: 6px auto 22px;
	gap: 8px;
}

.iris-accessory-add-button:hover,
.iris-accessory-add-button:focus {
	background: var(--iris-brand-soft);
	border-color: var(--iris-brand);
	color: var(--iris-brand);
	outline: none;
	box-shadow: 0 0 0 3px rgba(43, 57, 144, 0.10);
}

.iris-accessory-batch-delete-button:hover,
.iris-accessory-batch-delete-button:focus {
	background: #fef2f2;
	border-color: #dc2626;
	color: #dc2626;
	outline: none;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10);
}

.iris-accessory-save-button:hover,
.iris-accessory-save-button:focus {
	background: #1f2b75;
	border-color: #1f2b75;
	color: #ffffff;
	outline: none;
	box-shadow: 0 0 0 3px rgba(43, 57, 144, 0.16);
}

.iris-accessory-save-button:disabled {
	opacity: 0.68;
	cursor: not-allowed;
}

.iris-accessory-cancel-button:hover,
.iris-accessory-cancel-button:focus {
	background: #f8fafc;
	border-color: #94a3b8;
	color: #1e293b;
	outline: none;
	box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.10);
}

@media (max-width: 767px) {
	.iris-accessory-toolbar {
		align-items: stretch;
		flex-direction: column;
	}
	.iris-accessory-toolbar-actions {
		align-items: stretch;
		flex-direction: column;
	}
	.iris-accessory-batch-delete-button,
	.iris-accessory-add-button,
	.iris-accessory-save-button,
	.iris-accessory-cancel-button {
		justify-content: center;
		width: 100%;
	}
	.iris-accessory-form-actions {
		align-items: stretch;
		flex-direction: column-reverse;
	}
}

/* ============================================================
 * 22. iris-toast + iris-modal — 取代 native alert/confirm
 * 2026-05-12 Curtis: fade-only / no scale / no bounce、減少視覺干擾
 * ============================================================ */
.iris-toast-container {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
	max-width: calc(100vw - 40px);
}

.iris-toast {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	min-width: 280px;
	max-width: 420px;
	padding: 12px 14px;
	background: #ffffff;
	border: 1px solid var(--iris-line);
	border-left: 4px solid #64748b;
	border-radius: 8px;
	box-shadow: 0 8px 24px -10px rgba(15, 23, 42, 0.18), 0 2px 6px -2px rgba(15, 23, 42, 0.08);
	color: #1e293b;
	font-size: 14px;
	line-height: 1.45;
	pointer-events: auto;
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.iris-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.iris-toast.is-leaving {
	opacity: 0;
	transform: translateY(-6px);
}

.iris-toast-success { border-left-color: #16a34a; }
.iris-toast-info    { border-left-color: #2b3990; }
.iris-toast-warn    { border-left-color: #f59e0b; }
.iris-toast-error   { border-left-color: #dc2626; }

.iris-toast-icon {
	flex: 0 0 auto;
	margin-top: 2px;
	font-size: 16px;
	color: #64748b;
}
.iris-toast-success .iris-toast-icon { color: #16a34a; }
.iris-toast-info    .iris-toast-icon { color: #2b3990; }
.iris-toast-warn    .iris-toast-icon { color: #f59e0b; }
.iris-toast-error   .iris-toast-icon { color: #dc2626; }

.iris-toast-message {
	flex: 1 1 auto;
	min-width: 0;
	word-break: break-word;
}

.iris-toast-close {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin: -2px -4px 0 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #94a3b8;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.14s ease, color 0.14s ease;
}
.iris-toast-close:hover {
	background: #f1f5f9;
	color: #475569;
}

.iris-modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 9998;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(15, 23, 42, 0.32);
	opacity: 0;
	transition: opacity 0.18s ease-out;
}

.iris-modal-backdrop.is-visible {
	opacity: 1;
}

.iris-modal-dialog {
	width: 100%;
	max-width: 420px;
	background: #ffffff;
	border-radius: 10px;
	box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.28), 0 4px 12px -4px rgba(15, 23, 42, 0.10);
	overflow: hidden;
}

.iris-modal-header {
	padding: 16px 20px 4px;
}

.iris-modal-title {
	margin: 0;
	color: #1e293b;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
}

.iris-modal-body {
	padding: 8px 20px 16px;
	color: #475569;
	font-size: 14px;
	line-height: 1.55;
}

.iris-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: 12px 20px 16px;
	background: #f8fafc;
}

.iris-modal-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 80px;
	height: 34px;
	padding: 0 14px;
	border: 1px solid transparent;
	border-radius: 7px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.iris-modal-btn-secondary {
	background: #ffffff;
	border-color: #cbd5e1;
	color: #475569;
}
.iris-modal-btn-secondary:hover {
	background: #f8fafc;
	border-color: #94a3b8;
}

.iris-modal-btn-primary {
	background: var(--iris-brand);
	border-color: var(--iris-brand);
	color: #ffffff;
}
.iris-modal-btn-primary:hover {
	background: #1f2a6e;
	border-color: #1f2a6e;
}

.iris-modal-btn-danger {
	background: #dc2626;
	border-color: #dc2626;
	color: #ffffff;
}
.iris-modal-btn-danger:hover {
	background: #b91c1c;
	border-color: #b91c1c;
}

.iris-modal-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(43, 57, 144, 0.18);
}

/* ============================================================
 * 23. Form autosave status — P0-M server-side drafts
 * ============================================================ */
.iris-autosave-status {
	position: fixed;
	right: 14px;
	bottom: 14px;
	z-index: 1050;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	max-width: min(260px, calc(100vw - 28px));
	padding: 5px 9px;
	border: 1px solid #dbe4ef;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.94);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.10);
	color: #475569;
	font-size: 14px;
	line-height: 1.45;
	opacity: 0.85;
}
.iris-autosave-status:hover {
	opacity: 1;
}
.iris-autosave-status .ace-icon {
	width: 12px;
	text-align: center;
	color: #94a3b8;
	font-size: 14px;
}
.iris-autosave-status span {
	font-size: 14px !important;
	line-height: 1.45 !important;
}
.iris-autosave-status-saving {
	border-color: #b9c7ff;
	background: rgba(248, 250, 255, 0.98);
}
.iris-autosave-status-saving .ace-icon {
	color: #2b3990;
}
.iris-autosave-status-saved .ace-icon {
	color: #059669;
}
.iris-autosave-status-warn .ace-icon {
	color: #d97706;
}
.iris-autosave-status-error .ace-icon {
	color: #b91c1c;
}

/* 2026-05-24 Curtis: form060 keeps draft status and formal save actions together. */
.iris-form #form060 {
	padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
.form060-actionbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1040;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
	border-top: 1px solid #dbe4ef;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.10);
}
.form060-actionbar__status {
	display: flex;
	align-items: center;
	min-width: 0;
	flex: 1 1 auto;
}
.form060-actionbar__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	flex: 0 0 auto;
	flex-wrap: wrap;
}
.form060-actionbar__button {
	margin: 0;
	min-height: 36px;
}
.form060-actionbar__save {
	min-width: 118px;
	font-weight: 700;
}
.form060-actionbar .blank-alert {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}
.form060-actionbar .iris-autosave-status {
	position: static;
	right: auto;
	bottom: auto;
	z-index: auto;
	max-width: 100%;
	box-shadow: none;
	opacity: 1;
	background: #f8fafc;
}
.form060-actionbar .iris-autosave-status span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
@media (max-width: 720px) {
	.iris-form #form060 {
		padding-bottom: calc(150px + env(safe-area-inset-bottom));
	}
	.form060-actionbar {
		align-items: stretch;
		flex-direction: column;
		gap: 8px;
		padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
	}
	.form060-actionbar__status,
	.form060-actionbar__actions {
		width: 100%;
	}
	.form060-actionbar__actions {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(112px, 1.2fr);
	}
	.form060-actionbar__actions .btn,
	.form060-actionbar__actions input[type="button"] {
		width: 100%;
		min-width: 0;
		padding-left: 8px;
		padding-right: 8px;
	}
	.form060-actionbar .iris-autosave-status {
		width: 100%;
		justify-content: center;
	}
	.form060-actionbar .iris-autosave-status span {
		overflow: visible;
		text-align: center;
		text-overflow: clip;
		white-space: normal;
	}
}
@media (max-width: 430px) {
	.iris-form #form060 {
		padding-bottom: calc(205px + env(safe-area-inset-bottom));
	}
	.form060-actionbar__actions {
		grid-template-columns: 1fr;
	}
}

/* 2026-05-24 Curtis: form060 正式儲存錯誤欄位反紅，與「檢查缺漏」#F2DEDE 一致。 */
.form060-save-invalid {
	background-color: #F2DEDE !important;
	border: 1px solid #b91c1c !important;
}

/* 2026-05-13 Curtis: P0-M restore can rebuild many dynamic fields; show blocking progress feedback. */
.iris-autosave-loading-backdrop {
	position: fixed;
	inset: 0;
	z-index: 1065;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
	background: rgba(15, 23, 42, 0.22);
	opacity: 0;
	pointer-events: auto;
	transition: opacity 0.16s ease;
}
.iris-autosave-loading-backdrop.is-visible {
	opacity: 1;
}
.iris-autosave-loading-dialog {
	width: min(360px, 100%);
	padding: 22px 24px 20px;
	border: 1px solid #dbe4ef;
	border-radius: 8px;
	background: #ffffff;
	box-shadow: 0 22px 48px rgba(15, 23, 42, 0.22);
	color: #334155;
	text-align: center;
}
.iris-autosave-loading-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin-bottom: 10px;
	color: var(--iris-brand);
	font-size: 28px;
}
.iris-autosave-loading-title {
	margin-bottom: 4px;
	color: #1e293b;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
}
.iris-autosave-loading-text {
	color: #64748b;
	font-size: 13px;
	line-height: 1.55;
}

/* ============================================================
   2026-05-24 Curtis: 案件資訊卡（new_project.jsp #case_header）
   取代 ace .table-header 藍底 banner → 平靜 info card；
   label/值分層、grid 對齊、空值「—」、案件狀態 chip。色階呼應主藍 #1c6aa6。
   ============================================================ */
.case-summary {
	margin: 0 0 16px;
	padding: 16px 18px;
	background: #ffffff;
	border: 1px solid #d8e3ec;
	border-top: 3px solid #1c6aa6;
	border-radius: 6px;
	color: #263746;
	box-shadow: 0 1px 2px rgba(28, 106, 166, .06);
}
.case-summary__main {
	padding-bottom: 12px;
	margin-bottom: 12px;
	border-bottom: 1px solid #d8e3ec;
}
.case-summary__title-label,
.case-summary__label {
	color: #66788a;
	font-size: 12px;
	line-height: 1.4;
	font-weight: 600;
}
.case-summary__title {
	margin-top: 4px;
	font-size: 17px;
	line-height: 1.45;
	font-weight: 600;
	word-break: break-word;
}
.case-summary__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px 18px;
}
.case-summary__item { min-width: 0; }
.case-summary__item--wide { grid-column: span 2; }
.case-summary__value {
	margin-top: 3px;
	font-size: 14px;
	line-height: 1.45;
	min-height: 20px;
	word-break: break-word;
}
.case-summary__value:empty::before { content: "—"; color: #9aa8b5; }
.case-summary__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid #d8e3ec;
}
.case-summary__actions { flex: 0 0 auto; text-align: right; }
.case-status {
	display: inline-block;
	min-width: 4.5em;
	padding: 2px 10px;
	border: 1px solid transparent;
	border-radius: 999px;
	font-size: 12px;
	line-height: 1.6;
	font-weight: 600;
	text-align: center;
}
.case-status--draft { color: #5f6f7f; background: #f3f6f8; border-color: #d9e1e7; }
.case-status--reviewing { color: #15517f; background: #f2f8fc; border-color: #dbeaf5; }
.case-status--approved { color: #2f6b4f; background: #eef8f3; border-color: #cfe8da; }
.case-status--warning { color: #8a5a12; background: #fff7e6; border-color: #f1d49a; }
.case-status--closed { color: #69717a; background: #f1f3f5; border-color: #d7dde2; }
.case-status--rejected { color: #9f3a38; background: #fbf0f0; border-color: #efc9c8; }
@media (max-width: 991px) {
	.case-summary__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.case-summary__item--wide { grid-column: span 2; }
}
@media (max-width: 600px) {
	.case-summary__grid { grid-template-columns: 1fr; gap: 10px; }
	.case-summary__item--wide { grid-column: auto; }
	.case-summary__footer { display: block; }
	.case-summary__actions { margin-top: 10px; text-align: left; }
}
