/* styles.css — 版面樣式
   需求依據：航班工程師排程系統自動加手動思路 §2 版面要求 */

:root {
  /* Layout heights (for calc in .main-content) */
  --menu-height: 40px;
  --tab-height: 40px;
  --msg-height: 48px;

  /* Colors */
  --color-primary: #2196F3;
  --color-af: #4CAF50;
  --color-unassigned: #FF9800;
  --color-danger: #e65100;
  --color-bg: #f5f5f5;
  --color-border: #e0e0e0;
  --color-text: #222;
  --color-text-muted: #777;

  /* Message bar backgrounds (used by .message-bar.message-*) */
  --msg-success-bg: #d4edda;
  --msg-error-bg: #f8d7da;
  --msg-warn-bg: #fff3cd;
  --msg-info-bg: #f5f5f5;
}

/* Body children only — SVG elements must NOT inherit box-sizing reset */
body, body * { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
}

/* === 菜單欄 === */
.menu-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 0 12px;
  height: 40px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.menu-bar .logo {
  font-weight: bold;
  font-size: 15px;
  color: var(--color-primary);
  margin-right: 20px;
}

.menu-item {
  position: relative;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  border-radius: 4px;
}
.menu-item:hover { background: #f0f0f0; }

.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 180px;
  z-index: 200;
}
.menu-item:hover .menu-dropdown { display: block; }
/* 右側選單（最後一個 menu-item）：靠右對齊 */
.menu-item:last-of-type .menu-dropdown {
  left: auto;
  right: 0;
}
.menu-dropdown-item {
  display: block;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
}
.menu-dropdown-item:hover { background: #f5f5f5; }
.menu-dropdown-item + .menu-dropdown-item { border-top: 1px solid #f0f0f0; }

/* === 日期和日夜顯示 === */
.date-display {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.date-display .date { font-weight: bold; }
.date-display .shift-badge {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}
.shift-badge.day { background: #e3f2fd; color: #1565c0; }
.shift-badge.night { background: #ede7f6; color: #6a1b9a; }

/* === 雙 TAB 切換 === */
.tab-bar {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 0 12px;
  height: var(--tab-height);  /* 明確高度，確保 .main-content calc 正確 */
}
.tab-btn {
  padding: 10px 24px;
  cursor: pointer;
  font-size: 13px;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
}
.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: bold;
}

/* === 主內容區（上下左右滾動） === */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--menu-height) - var(--tab-height) - var(--msg-height));
  height: calc(100dvh - var(--menu-height) - var(--tab-height) - var(--msg-height)); /* MOBILE-VIEW-B：dvh＝網址列自適應可視高（舊瀏覽器沿用上行 vh） */
}

.table-view, .gantt-view {
  flex: 1;
  overflow: auto;
  padding: 12px;
  min-width: 0;   /* GANTT-MOBILE-WIDTH §4.2：flex 伸展陷阱封口（layout 釘死不被寬畫布撐開） */
  width: 100%;
}

/* MOBILE-VIEW-B（Hank B 案）：手機/平板（≤768px）取消固定高裁切——整頁自然捲動，
   數據行與工程師區必達；GANTT-MOBILE-WIDTH §4.4：寬畫布/寬表撐開 document → 文件級橫捲。
   ⚠️ 源序必須後出於上方 .table-view/.gantt-view 基底規則（同特異度後出覆寫；@media 不加特異度），
   否則基底 overflow:auto 生效 → document 不撐開 → AC1/AC3 鏈斷。
   overflow 用單一 visible 值：auto+visible 會把 visible 計算成 auto（overflow 計算值陷阱）。 */
/* === 響應：平板/窄桌面（≤1615px）菜單列換行＋主區自然高整頁捲 ===
   2026-09-28「平板無法 full screen」根因：.menu-bar 12+ 項自然寬 1615px 撐寬文件，
   Chrome 縮放適應＝內容縮小＋灰餘白。本塊讓文件寬＝視口寬、內容鋪滿。
   源序後出於 .menu-bar(L38)/.main-content 基底規則；≤768px 另有手機塊（同值不衝突）。
   >1615px 不受影響＝桌機零漂移（menu 單行高 40、main-content calc 原樣）。 */
@media (max-width: 1615px) {
  .menu-bar {
    height: auto;
    min-height: 40px;
    flex-wrap: wrap;
    padding: 2px 6px;
    row-gap: 2px;
    gap: 1px;
    font-size: 12px;
    justify-content: space-between;
  }
  .menu-bar .logo {
    font-size: 12px;
    margin-right: 8px;
  }
  .menu-item {
    padding: 3px 6px;
    font-size: 12px;
  }
  .menu-bar .menu-quick {
    flex-wrap: wrap;
    flex: 1 1 auto;
    margin-left: 6px !important;
    row-gap: 2px;
  }
  .menu-bar .quick-link {
    padding: 2px 6px;
    font-size: 11px;
  }
  .main-content {
    height: auto;
    overflow: visible;
  }
  /* 表格/甘特維持內層橫向捲動（基底 overflow:auto）：1853px 表格不得撐寬文件
     ——撐寬＝Chrome 縮放灰餘白復現。手機 ≤768px 之文件級橫捲由下方手機塊另行覆寫（G-NAV 設計保留）。 */
  .table-view, .gantt-view {
    height: auto;
  }
}

@media (max-width: 768px) {
  .main-content {
    height: auto;
    overflow: visible;
  }
  .table-view, .gantt-view {
    height: auto;
    overflow: visible;
  }
  /* tab-bar 手機堆疊（2026-09-28 390px 實錘：nowrap 擠壓＋絕對定位 refresh 重疊＋Final Check 溢出屏外）
     源序後出於 L113 .tab-bar 基底（同特異度後出覆寫）；內聯樣式用 !important 蓋。 */
  .tab-bar {
    flex-wrap: wrap;
    height: auto;
    align-items: center;
    row-gap: 4px;
    padding: 4px 12px;
  }
  #refresh-live-btn {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 0 8px !important;
  }
  .tab-bar label {
    margin-left: 8px !important;
    font-size: 12px;
  }
}

/* === 表格顯示 === */
.flight-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.flight-table th {
  background: #f0f0f0;
  padding: 8px 10px;
  text-align: left;
  font-weight: bold;
  border-bottom: 2px solid #ccc;
  position: sticky;
  top: 0;
  z-index: 10;
}
/* thead 第一行（列名 Airline...Shift_type）：固定在頂部，層級最高 */
.flight-table thead tr:first-child th {
  top: 0;
  z-index: 12;
  /* 固定行高：13px 粗體在 Chrome 的 normal line-height 即為 14px，
     固定後第一行總高恆為 32px（14px 內容 + 8px*2 padding + 2px border），
     與下方 .filter-row 的 top: 32px 精確對齊，避免跨瀏覽器閃爍/重疊 */
  line-height: 14px;
}
/* thead 第二行（filter 輸入框）：固定在列名行下方 32px 處，層級低於列名行 */
.flight-table .filter-row th {
  top: 32px;
  z-index: 11;
}
.flight-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.flight-table tr:hover td { background: #fafafa; }
.flight-table .cell-eic { cursor: pointer; }
.flight-table .cell-eic:hover { background: #e3f2fd; }
.flight-table .cell-eic-id { min-width: 50px; }

.flight-table .cell-eic-locked {
    background: #f0f0f0 !important;
    color: #bbb;
    cursor: not-allowed;
    user-select: none;
}
.flight-table td[data-col="eic2"] { min-width: 200px; }

/* 淡黃色高亮（SubType 衝突） */
.flight-table tr.highlight-yellow td { background: #fffde7 !important; }

/* 淡紅色高亮（衝突） */
.flight-table tr.highlight-red td { background: #ffebee !important; }

/* 淡藍色高亮（交接班時段航班） */
.flight-table tr.highlight-lightblue td { background: #e3f2fd !important; }

/* === FIX 2026-10-22：completed 綠底置檔尾，壓過 as-jump-highlight/cell-eic-locked === */
.flight-table tr.highlight-completed td { background: #c8e6c9 !important; }





/* V4 MRV 首筆高亮（藍色邊框 + ➤ 標記，避免黃底） */
.flight-table tr.highlight-mrv-first td { 
  border-top: 2px solid #1565C0 !important;
  border-bottom: 2px solid #1565C0 !important;
}
.flight-table tr.highlight-mrv-first td:first-child::before {
  content: '➤ ';
  color: #1565C0;
  font-weight: bold;
}

/* Hank 2026-09-10 裁示：manual=1 整行紅底「最高優先」——!important + 置於全部
   highlight-* 之後（同 specificity 下後定義勝出），蓋過 completed 綠底等一切；
   取消 manual=0 後 row-manual class 移除 → 回歸正常流程顏色判斷 */
.flight-table tr.row-manual td { background: #ffcdd2 !important; }

/* === 表格過濾 === */
.filter-row th {
  padding: 4px 6px;
  background: #fafafa;
  border-bottom: 1px solid #ddd;
}
.table-filter {
  width: 100%;
  min-width: 0;          /* 2026-09-19（Hank）：避免 input 預設最小寬撐開 <th>，讓欄寬依 thead 指定 */
  max-width: 220px;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 11px;
  box-sizing: border-box;
  background: #fff;
}
.table-filter:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(33,150,243,0.15);
}

/* === 甘特圖容器 === */
.gantt-container {
  width: 100%;
  overflow: visible;   /* sticky 軸需相對真正 scrollport（.gantt-view）釘頂；container 高度隨內容增長本就不滾動 */
  background: #fff;
}
.gantt-container svg { display: block; }

/* === 甘特圖 sticky 時間軸（in-flow sticky div，SVG 之前；刻度與 _renderTimeAxis 同源）=== */
.gantt-sticky-axis {
  position: sticky;
  top: 0;
  z-index: 8;                 /* m2：低於 flight-table thead z-index=10；tooltip(9999) 更高 */
  height: 30px;
  background: #fff;
  border-bottom: 1px solid #aaa;
}
.gantt-sticky-axis .gantt-axis-tick {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  color: #999;
  line-height: 1;
}
.gantt-sticky-axis .gantt-axis-hour {
  font-size: 11px;
  color: #333;
}

/* === 消息欄 === */
.message-bar {
  height: var(--msg-height);
  min-height: var(--msg-height);
  background: #fff;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  font-size: 13px;
  overflow: hidden;
}
.message-bar .msg-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 訊息類型背景色 + 文字色（限定在 .message-bar 上下文） */
.message-bar.message-success { background: var(--msg-success-bg); }
.message-bar.message-error   { background: var(--msg-error-bg); }
.message-bar.message-warn    { background: var(--msg-warn-bg); }
.message-bar.message-info    { background: var(--msg-info-bg); }
.message-bar.message-success .msg-text { color: #2e7d32; }
.message-bar.message-error   .msg-text { color: #c62828; }
.message-bar.message-warn    .msg-text { color: #e65100; }
.message-bar.message-info    .msg-text { color: #555; }

.message-bar .msg-btn {
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}
.message-bar .msg-btn:hover { background: #f5f5f5; }

/* === 最終檢查按鈕 === */
.check-btn {
  padding: 6px 16px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
}
.check-btn:hover { background: #1976d2; }

.dropdown-panel {
  position: absolute;
  z-index: 999;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 320px;
  overflow-y: auto;
  min-width: 280px;
}

/* === EIC 下拉面板（t_80a8aad5 P1：position:fixed 跟隨滾動） === */
#eic-dropdown-panel, #engineer-panel {
  display: none;
  position: fixed;
  z-index: 1001;   /* 2026-10-31：999→1001，必須高於 .dialog-overlay(1000) 才能在指導頁/dialog 內選人；仍低於 .modal-overlay(9999) */
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 320px;
  overflow-y: auto;
  min-width: 280px;
}
/* AC6：EIC規則:不派 航班橫幅（保險列表頂部一條） */
.eic-exclude-banner {
  padding: 6px 12px;
  background: #fff3e0;
  color: #c62828;
  font-size: 12px;
  font-weight: bold;
  border-bottom: 1px solid #ffcc80;
}
.panel-header {
  padding: 8px 12px;
  background: #f5f5f5;
  font-weight: bold;
  font-size: 13px;
  border-bottom: 1px solid #ddd;
  position: relative;
}
.panel-close-btn {
  position: absolute;
  top: 5px;
  right: 10px;
  cursor: pointer;
  font-size: 16px;
  color: #999;
}
.panel-close-btn:hover { color: #333; }

.engineer-item, .eic-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 1px solid #f5f5f5;
}
.eic-recommended { background: #e8f5e9; }
.eic-clear { color: #999; border-bottom: 1px solid #eee; font-style: italic; }
.eic-stat { font-size: 11px; color: #888; margin-left: 6px; }
/* t_fda92614：[全部] 保險列表切換按鈕（✕ 左側）+ 三態 badge */
.eic-show-all-btn {
  position: absolute;
  top: 5px;
  right: 34px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  color: #1a73e8;
  border: 1px solid #1a73e8;
  border-radius: 3px;
  padding: 0 6px;
  line-height: 18px;
  user-select: none;
}
.eic-show-all-btn:hover { background: #e8f0fe; }
.eic-show-all-btn.active { background: #1a73e8; color: #fff; }
.eic-badge { font-size: 11px; margin-left: 6px; }
.eic-badge-off { color: #b26a00; }
.eic-badge-warn { color: #b26a00; }
.eic-badge-exclude { color: #c62828; }
.eic-check { color: #2e7d32; font-weight: bold; }
.eic-cross { color: #c62828; font-weight: bold; }
.engineer-item:hover, .eic-option:hover { background: #e3f2fd; }
.engineer-item.active, .eic-option.active { background: #bbdefb; }

/* === 下拉過濾（SUBTYPE / AC_TYPE / ENG_TYPE） === */
.dropdown-wrapper { position: relative; display: inline-block; }
.dropdown-option { padding: 6px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.dropdown-option:hover { background: #e3f2fd; }
.dropdown-empty { padding: 8px; color: #999; font-size: 12px; }

/* AC_TYPE / ENG_TYPE dropdowns (reuse .dropdown-option, .dropdown-empty above) */
.ac-type-dropdown, .eng-type-dropdown { }
/* subtype dropdown also uses these shared classes */

/* === SUBTYPE 輸入框 === */
input[type="text"].subtype-input {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 13px;
}
input[type="text"].subtype-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(33,150,243,0.2);
}

/* 編輯標色（session 內標記已編輯欄位）— 疊加在 row highlight 之上 */
.cell-edited {
  background: #fff8e1 !important;
  border-color: #f9a825 !important;
}

/* === 對話框（SubType 機型確定） === */
.dialog-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.dialog-overlay.active { display: flex; }

.dialog-box {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow: auto;
}
.dialog-header {
  padding: 14px 18px;
  font-weight: bold;
  font-size: 15px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-body { padding: 16px 18px; }
.dialog-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.dialog-footer .btn {
  padding: 6px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  border: 1px solid var(--color-border);
}
.dialog-footer .btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.dialog-footer .btn-primary:hover { background: #1976d2; }
.dialog-footer .btn-secondary { background: #fff; }
.dialog-footer .btn-secondary:hover { background: #f5f5f5; }

/* === 排班顯示格式（Memo MEMORY.md）== */
.engineer-row { }
.engineer-name { font-weight: bold; }
.engineer-name .ccar66-tag { color: #e65100; font-size: 10px; font-weight: normal; }
.engineer-name .qa-tag     { color: #6a1b9a; font-size: 10px; }
.engineer-name .de-tag     { color: #1565c0; font-size: 10px; }
.shift-code-bold { font-weight: bold; }
/* 班次分類標記（甘特圖用） */
.shift-A { color: #2196F3; }   /* 早班 🟢 */
.shift-B { color: #e65100; }   /* 中班 🟡 */
.shift-C { color: #c62828; }   /* 夜班 🔴 */

/* === hide-skip-eic checkbox 功能 === */
body.hide-skip-eic tr[data-skip-eic="true"] {
    display: none !important;
}

/* hide-cols：隱藏 ATA / Cal_eta / Cal_etd / EIC1 ID / EIC2 ID（屬性選擇器，免欄序錯位） */
body.hide-cols #flight-table [data-col="ata"],
body.hide-cols #flight-table [data-col="cal_eta"],
body.hide-cols #flight-table [data-col="cal_etd"],
body.hide-cols #flight-table [data-col="eic1_id"],
body.hide-cols #flight-table [data-col="eic2_id"] {
    display: none !important;
}

/* === 上傳區域 === */
.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 13px;
}
.upload-zone:hover { border-color: var(--color-primary); color: var(--color-primary); }
.upload-zone [type=file] { display: none; }

/* === 對話框 / Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-box {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.btn {
  padding: 6px 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 13px;
}
.btn:hover { background: #e8e8e8; }
.btn-primary {
  background: #007bff;
  color: #fff;
  border-color: #0056b3;
}
.btn-primary:hover { background: #0056b3; }

/* === 回溯 HIGHLIGHT（AF-④）=== */
.gantt-bar.least-conflict {
  stroke: #e53935;
  stroke-width: 2;
  stroke-dasharray: 4 2;
}

/* === 表格欄位寬度 === */
.flight-table th:nth-child(1) { width: 30px; }
.flight-table th:nth-child(2) { width: 60px; }
.flight-table td:nth-child(1),
.flight-table td:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Arr_flt(3) 右 padding、Dep_flt(4) 左 padding — 縮小間距 1/3 */
.flight-table th:nth-child(3),
.flight-table td:nth-child(3) { padding-right: 7px; }
.flight-table th:nth-child(4),
.flight-table td:nth-child(4) { padding-left: 7px; }

/* 上傳按鈕防重複 */
.btn-disabled { opacity: 0.5; cursor: not-allowed; }

/* === LCV Toggle 按鈕（開關式 MRV/LCV 排序，AC1） === */
.lcv-toggle-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #555;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lcv-toggle-btn:hover { background: #f0f0f0; }
.lcv-toggle-btn.active {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
  font-weight: bold;
}
.lcv-toggle-btn.active:hover { background: #2e7d32; }
.lcv-switch {
  display: inline-block;
  width: 26px;
  height: 14px;
  border-radius: 7px;
  background: #bbb;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s;
}
.lcv-knob {
  position: absolute;
  top: 2px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(2px);
  transition: transform 0.15s;
}
.lcv-toggle-btn.active .lcv-switch { background: #2e7d32; }
.lcv-toggle-btn.active .lcv-knob { transform: translateX(12px); }


/* ── Hank 2026-09-11：EIC 來源三態改為「字色」（原 09-10 D3-A 底色版）──
   導入=深灰 / 人工=深藍 / 自動=深紫；空值不上色（由 app.js class 條件控制）。
   移除 background → completed 綠 / highlight-* 底不被遮蓋（資訊疊加）。
   置檔尾 + !important：防任何既有/未來 td color 規則覆蓋；locked 走 .cell-eic-locked（互斥）。 */
.flight-table tr td.cell-eic-src-import { color: #424242 !important; }  /* 導入：深灰、不加粗 */
.flight-table tr td.cell-eic-src-manual { color: #00796b !important; font-weight: bold !important; }  /* 人工：藍綠（Teal 700）、加粗 */
.flight-table tr td.cell-eic-src-auto   { color: #7b1fa2 !important; font-weight: bold !important; }  /* 自動：紫（Purple 700）、加粗 */

/* ── Hank 2026-09-17：短碼疑誤檢查（契約①）——表格短碼紅色加粗（app.js renderTable 掛 class） ── */
/* 🐛 2026-09-19（Hank）：疑誤除了紅粗字，再加**明黃背景**讓它更顯眼。
   !important 必要——input 的 inline style 帶 background:#fff，會蓋掉 class。 */
.cell-subtype-input.subtype-suspect { color: #d32f2f !important; font-weight: 700 !important; background: #FFEB3B !important; }

/* ── t_0d3eccd5：EIC2 下拉「覆蓋時間」不能覆蓋 EIC1 剩餘時間者標紅（app.js _renderAll 掛 class）──
   複合選擇器（0-2-0）勝過 .eic-stat（0-1-0，L392），置檔尾雙保險；色沿用 .eic-cross 同值。 */
.eic-stat.eic-stat-warn { color: #c62828; font-weight: bold; }

/* === 全自動排程指導頁 modal（Phase 4；計畫 v5 §3；卡 t_ee58241d） === */
.as-sec { margin-bottom: 14px; }
.as-sec-title { margin: 0 0 6px; font-size: 13px; font-weight: bold; color: #444; }
.as-subtitle { font-size: 12px; font-weight: bold; color: #666; margin: 6px 0 4px; }
/* ① 前提紅/綠條：ok 綠、gate=False 警示橙、gate=True 阻斷紅 */
.as-check { font-size: 12px; padding: 4px 8px; border-radius: 4px; margin-bottom: 3px; }
.as-check-ok { background: #e8f5e9; color: #2e7d32; }
.as-check-warn { background: #fff3e0; color: #e65100; }
.as-check-block { background: #ffebee; color: #c62828; font-weight: bold; }
.as-empty { font-size: 12px; color: #888; padding: 4px 8px; }
.as-spin { font-size: 12px; color: #2c5f8a; padding: 6px 8px; }
.as-spin::before { content: '⏳ '; }
/* ⓪ 前置指派列（BA031／LH796） */
.as-pf-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; flex-wrap: wrap; }
.as-pf-status { flex: 1 1 auto; min-width: 90px; color: #555; font-size: 12px; }
/* ⓪ 前置指派列：EIC1／EIC2 現值名單，班次碼在姓名前 → （A80）HOU Yin（2026-10-31）
   每個 EIC 區塊 nowrap；容器可換行，避免窄版面把 EIC2 擠出畫面 */
.as-pf-names { color: #1a4a7a; font-size: 12px; font-weight: bold; white-space: normal; }
.as-pf-names span { white-space: nowrap; }
/* ② S/O 候選＋③ 無解清單：整行可點（點 → 跳 OCC 該班列） */
.as-so-row, .as-inf-row {
  display: block; width: 100%; text-align: left; font-size: 12px;
  padding: 4px 8px; border: none; border-bottom: 1px solid #eee;
  background: #fff; cursor: pointer; font-family: inherit;
}
.as-so-row:hover, .as-inf-row:hover { background: #eef4fa; }
/* ③ 解對比列（≤5 解；點列選中） */
.as-sol-row { font-size: 12px; padding: 6px 8px; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 4px; cursor: pointer; }
.as-sol-row.selected { border-color: #2c5f8a; background: #eef4fa; }
/* 跳轉定位高亮（AC-P4-5：scrollIntoView 後視覺定位該列） */
#flight-tbody tr.as-jump-highlight { outline: 3px solid #2c5f8a; outline-offset: -3px; background: #fff9c4 !important; }
