/* 採購系統唯一的樣式表；手機版（<768px）放最後 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft JhengHei", "PingFang TC", sans-serif; display: flex; flex-direction: column; min-height: 100vh; background: #f5f6f7; font-size: 17px; }

header {
  background: #2c3e50; color: #fff; padding: 20px 30px;
  font-size: 26px; font-weight: bold;
  display: flex; justify-content: space-between; align-items: center;
}
header .right { display: flex; align-items: center; gap: 14px; }
header .greeting { font-size: 15px; font-weight: normal; }
header .logout-link {
  font-size: 15px; font-weight: normal; color: #fff; text-decoration: none;
  border: 1px solid #fff; padding: 6px 14px; border-radius: 4px;
}
header .logout-link:hover { background: rgba(255,255,255,0.15); }

.layout { display: flex; flex: 1; }
nav { width: 220px; background: #ecf0f1; padding: 20px 0; }
nav ul { list-style: none; }
nav li a { display: flex; align-items: center; gap: 8px; padding: 12px 20px; color: #2c3e50; text-decoration: none; font-size: 17px; }
nav li a:hover, nav li a.active { background: #dfe6e9; }
nav .nav-group-label { padding: 16px 20px 6px; font-size: 12px; color: #95a5a6; letter-spacing: 0.5px; }
nav .nav-group-label:first-child { padding-top: 0; }
/* 群組之間的分隔線（11/11 使用者：設計圖有、上線漏了） */
nav ul + .nav-group-label { border-top: 1px solid #d5dcdf; margin: 8px 20px 0; padding: 14px 0 6px; }
.nav-badge { display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 10px; background: #c0392b; color: #fff; font-size: 12px; text-align: center; }

main { flex: 1; padding: 30px; }
.page-wrap { max-width: 900px; margin: 0 auto; }
.page-wrap.full, .vd-wrap.full { max-width: 85%; }   /* 以表格為主的頁面跟著畫面寬，留邊 85%（11/11 使用者） */
.card { background: #fff; border-radius: 8px; padding: 20px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 12px; }

.title-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.form-title { font-size: 22px; font-weight: bold; color: #2c3e50; }
.form-sub { font-size: 14px; color: #7f8c8d; margin-top: 4px; }
.status-badge { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 14px; background: #fdf3d8; color: #8a6d00; }
.co-tag { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 10px; font-size: 13px; vertical-align: middle; white-space: nowrap; }   /* 公司標籤（12/4） */
.co-tag.co-hc { background: #e6f1fb; color: #0c447c; }
.co-tag.co-hcmp { background: #e1f5ee; color: #085041; }
.form-title .co-tag { font-size: 14px; }
.co-switch { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 14px; color: #7f8c8d; }   /* 填單切換公司（12/4） */
.co-switch button { border: 1px solid #d5d8dc; background: #fff; color: #7f8c8d; padding: 3px 14px; border-radius: 12px; font-size: 14px; cursor: pointer; }
.co-switch button.on.co-hc { background: #e6f1fb; color: #0c447c; border-color: #0c447c; font-weight: bold; }
.co-switch button.on.co-hcmp { background: #e1f5ee; color: #085041; border-color: #085041; font-weight: bold; }
.urgent-badge { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 10px; font-size: 13px; background: #c0392b; color: #fff; vertical-align: middle; }

.part-head { font-size: 15px; color: #7f8c8d; margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; }
.part-head::after { content: ''; flex: 1; border-top: 1px dashed #ccc; }

.section-label { font-size: 17px; font-weight: bold; color: #2c3e50; border-left: 4px solid #2c3e50; padding-left: 10px; margin-bottom: 14px; }

.kv-grid { display: flex; flex-wrap: wrap; gap: 14px 40px; }   /* 每格依內容寬，長的值不會被折成兩行 */
.kv-grid .kv { min-width: 120px; }
.kv label { display: block; font-size: 15px; color: #555; margin-bottom: 4px; }
.kv div.value { font-size: 16px; color: #2c3e50; }
.kv-grid.secondary { border-top: 1px solid #eee; padding-top: 14px; margin-top: 14px; }
.kv-grid.secondary .kv label { color: #999; }
.kv-grid.secondary .kv div.value { color: #555; }

table.items { width: 100%; border-collapse: collapse; }
table.items th { background: #ecf0f1; padding: 8px; font-size: 15px; text-align: left; }
table.items td { padding: 8px; border-bottom: 1px solid #eee; font-size: 15px; white-space: pre-wrap; }

.attachment-preview { display: flex; flex-wrap: wrap; gap: 12px; }
.attachment-card { width: 100px; text-align: center; }
.attachment-card img { width: 100px; height: 100px; object-fit: cover; border-radius: 6px; border: 1px solid #ddd; display: block; }
.attachment-card .file-icon { width: 100px; height: 100px; border-radius: 6px; border: 1px solid #ddd; background: #f0f1f2; display: flex; align-items: center; justify-content: center; font-size: 32px; }
.attachment-card .file-name { font-size: 12px; color: #555; margin-top: 4px; word-break: break-all; line-height: 1.3; }
.attachment-card .file-by { font-size: 11px; color: #95a5a6; margin-top: 2px; }

.empty-note { font-size: 15px; color: #999; }
.purpose-box { white-space: pre-wrap; font-size: 15px; color: #2c3e50; background: #f8f9fa; border-radius: 6px; padding: 12px; }

.sign-row { display: flex; border: 1px solid #ccd3d8; border-radius: 6px; overflow: hidden; }
.sign-box { flex: 1 1 0; min-width: 0; border-right: 1px solid #ccd3d8; text-align: center; }
.sign-box:last-child { border-right: none; }
.sign-box .sign-label { background: #ecf0f1; font-size: 14px; color: #555; padding: 6px; border-bottom: 1px solid #ccd3d8; }
.sign-box .sign-who { font-size: 16px; color: #2c3e50; padding: 12px 6px 4px; }
.sign-box .sign-at { font-size: 13px; color: #7f8c8d; padding-bottom: 10px; }

/* 採購擬辦區 */
.plan-card { border-top: 4px solid #2c5aa0; }
.plan-field { margin-bottom: 16px; }
.plan-field > label { display: block; font-size: 15px; color: #555; margin-bottom: 6px; }
.plan-field .value { font-size: 16px; color: #2c3e50; }
.plan-text-box { white-space: pre-wrap; font-size: 16px; line-height: 1.6; color: #2c3e50; background: #f8f9fa; border-radius: 6px; padding: 12px; }
#planText {
  width: 100%; min-height: 160px; padding: 12px; resize: vertical; overflow: hidden;
  border: 1px solid #ccc; border-radius: 6px; font-family: inherit; font-size: 16px; line-height: 1.6;
}
#planText:focus { outline: none; border-color: #2c5aa0; }
.required-mark { color: #c0392b; font-size: 13px; margin-left: 4px; }
.form-error { color: #c0392b; font-size: 14px; margin-top: 6px; display: none; }

.mode-switch { display: inline-flex; border: 1px solid #ccd3d8; border-radius: 6px; overflow: hidden; }
.mode-switch button {
  padding: 8px 26px; border: none; background: #fff; color: #555;
  font-size: 15px; font-family: inherit; cursor: pointer;
}
.mode-switch button + button { border-left: 1px solid #ccd3d8; }
.mode-switch button:hover { background: #f4f6f7; }
.mode-switch button.active { color: #fff; }
.mode-switch button.active.c-blue { background: #2c5aa0; }
.mode-switch button.active.c-red { background: #c0392b; }
.mode-switch button.active.c-dark { background: #2c3e50; }
.plan-card.c-red { border-top-color: #c0392b; }
.plan-card.c-dark { border-top-color: #2c3e50; }

.action-row { text-align: center; margin-top: 6px; }
.go-btn { padding: 10px 36px; border-radius: 6px; font-size: 15px; font-family: inherit; border: none; color: #fff; background: #2c5aa0; cursor: pointer; }
.plan-card.c-red .go-btn { background: #c0392b; }
.plan-card.c-dark .go-btn { background: #2c3e50; }
.reject-btn { padding: 10px 30px; background: #fdecea; color: #c0392b; border: 1px solid #f6d0cc; border-radius: 6px; font-size: 15px; font-family: inherit; cursor: pointer; margin-left: 10px; }

.alert-card { border-left: 4px solid #c0392b; background: #fdecea; color: #a94442; border-radius: 6px; padding: 12px 16px; margin-bottom: 12px; font-size: 15px; }
.alert-card .alert-text { margin-top: 6px; color: #2c3e50; white-space: pre-wrap; }
.action-msg { background: #eaf6ec; color: #1e8449; font-size: 14px; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }

/* 採購處理紀錄 */
.pe-item { border-left: 4px solid #bdc3c7; background: #f8f9fa; border-radius: 6px; padding: 8px 14px; margin-bottom: 6px; font-size: 14px; color: #2c3e50; }
.pe-item .pe-time { color: #7f8c8d; font-size: 13px; }
.pe-item .pe-text { margin-top: 4px; color: #2c3e50; white-space: pre-wrap; }
.pe-plan { border-left-color: #2c5aa0; background: #eaf1fb; color: #2c5aa0; }
.pe-approve { border-left-color: #27ae60; background: #eaf6ec; color: #1e8449; }
.pe-reject, .pe-return { border-left-color: #c0392b; background: #fdecea; color: #a94442; }
.pe-close { border-left-color: #2c3e50; background: #ecf0f1; color: #2c3e50; }

.lightbox {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.85); z-index: 1000;
  flex-direction: column; align-items: center; justify-content: center; cursor: zoom-out;
}
.lightbox img { max-width: 90%; max-height: 80vh; border-radius: 6px; }
.lightbox-caption { color: #fff; font-size: 14px; margin-top: 12px; }
.lightbox-close { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 36px; font-weight: bold; cursor: pointer; line-height: 1; }

footer { background: #2c3e50; color: #bdc3c7; text-align: center; padding: 12px; font-size: 14px; }

/* ---- 清單 ---- */
.card.wide { margin: 0 auto 12px; max-width: 85%; overflow-x: auto; }   /* 表格比卡片寬時在卡片裡左右捲，不要超出卡片（11/11 帳號頁超出）   /* 清單：跟著畫面寬（留邊 85%，11/11 使用者），欄位多時不會被擠成好幾行 */
table.list { width: 100%; border-collapse: collapse; }
table.list th { background: #ecf0f1; padding: 10px; font-size: 14px; text-align: left; }
table.list td { padding: 10px; border-bottom: 1px solid #eee; font-size: 14px; color: #2c3e50; }
table.list tr.data-row { cursor: pointer; }
table.list tr.data-row:hover td { background: #f8f9fa; }
.state-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 13px; background: #eaf1fb; color: #2c5aa0; }
.state-badge.rejected { background: #2c3e50; color: #fff; }
nav li a { justify-content: space-between; }
footer { background: #2c3e50; color: #bdc3c7; text-align: center; padding: 12px; font-size: 14px; }
/* 選公司 */
.company-buttons { display: flex; gap: 40px; flex-wrap: wrap; justify-content: center; }
.company-btn { display: flex; align-items: center; justify-content: center; width: 260px; height: 160px; background: #2c3e50; color: #fff; font-size: 24px; font-weight: bold; text-decoration: none; border-radius: 10px; text-align: center; padding: 20px; transition: background 0.2s; }
.company-btn:hover { background: #34495e; }
/* 名單小標籤（代開知會名單） */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 14px; background: #eaf1fb; color: #2c5aa0; font-size: 14px; }
.chip button { background: none; border: none; color: #7f8c8d; cursor: pointer; font-size: 13px; padding: 0 4px; }
.chip-row select { padding: 4px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; font-family: inherit; }

/* ---- 填單 ---- */
  form.req-form { max-width: 900px; margin: 0 auto; }

  .form-title { font-size: 22px; font-weight: bold; color: #2c3e50; margin-bottom: 4px; }
  .form-subtitle { font-size: 15px; color: #7f8c8d; }

  .title-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
  .req-no-badge { font-size: 15px; color: #7f8c8d; background: #f0f1f2; border-radius: 4px; padding: 6px 12px; white-space: nowrap; }

  .section { background: #fff; border-radius: 8px; padding: 22px 26px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
  .section-label { font-size: 17px; font-weight: bold; color: #2c3e50; border-left: 4px solid #2c3e50; padding-left: 10px; margin-bottom: 12px; }

  .row { display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
  .field { flex: 1; min-width: 160px; }
  .field label { display: block; font-size: 15px; color: #555; margin-bottom: 4px; }
  .field input[type=text], .field input[type=date], .field input[type=number], .field select, .field textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; font-family: inherit;
  }
  .field textarea { resize: vertical; min-height: 110px; }
  .field input[readonly] { background: #f0f1f2; color: #555; }

  .help-icon {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #bdc3c7; color: #fff; font-size: 11px; font-weight: bold;
    cursor: help; flex-shrink: 0;
  }
  .help-icon .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: #fff;
    text-align: left;
    padding: 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.6;
    width: 280px;
    white-space: normal;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    transition: opacity 0.15s ease;
    z-index: 10;
    overflow: hidden;
  }
  .tooltip-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    font-weight: bold; font-size: 13px;
  }
  .tooltip-header .tooltip-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%;
    background: rgba(255,255,255,0.2); font-size: 12px; flex-shrink: 0;
  }
  .tooltip-body {
    display: block;
    padding: 12px 14px;
  }
  .tooltip-p { display: block; }
  .tooltip-p + .tooltip-p { margin-top: 8px; }
  .help-icon .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2c3e50 transparent transparent transparent;
  }
  @media (hover: hover) {
    .help-icon:hover .tooltip-text { visibility: visible; opacity: 1; }
  }
  .help-icon.open .tooltip-text { visibility: visible; opacity: 1; }
  .radio-group label .help-icon { margin-left: 2px; }

  .radio-group, .checkbox-group { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
  .radio-group label, .checkbox-group label { font-size: 17px; display: flex; align-items: center; gap: 8px; font-weight: normal; cursor: pointer; }
  .radio-group input[type=radio], .checkbox-group input[type=checkbox] {
    width: 19px; height: 19px; accent-color: #2c3e50; cursor: pointer;
  }

  .conditional { margin-top: 10px; padding: 10px 14px; background: #f8f9fa; border-radius: 4px; display: none; }
  .conditional.show { display: block; }

  table.items { width: 100%; border-collapse: collapse; margin-top: 8px; }
  table.items th { background: #ecf0f1; padding: 8px; font-size: 15px; text-align: left; }
  table.items td { padding: 4px; border-bottom: 1px solid #eee; }
  table.items input, table.items textarea { width: 100%; padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 15px; font-family: inherit; resize: vertical; }
  table.items th:nth-child(3), table.items td:nth-child(3) { width: 70px; }
  table.items th:nth-child(4), table.items td:nth-child(4) { width: 70px; }
  table.items td.remove { width: 30px; text-align: center; }
  table.items td.remove button { background: none; border: none; color: #c0392b; cursor: pointer; font-size: 18px; }

  #addRowBtn { margin-top: 10px; padding: 8px 16px; background: #ecf0f1; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; font-size: 15px; }
  #addRowBtn:hover { background: #dfe6e9; }

  #attachmentsInput, #invoicesInput { font-size: 15px; }
  #attachmentsInput::file-selector-button, #invoicesInput::file-selector-button {
    padding: 8px 16px; margin-right: 12px;
    background: #ecf0f1; border: 1px solid #ccc; border-radius: 4px;
    color: #2c3e50; font-size: 15px; font-family: inherit; cursor: pointer;
  }
  #attachmentsInput::file-selector-button:hover, #invoicesInput::file-selector-button:hover { background: #dfe6e9; }

  .submit-row { text-align: center; margin-top: 30px; }
  .submit-row button { padding: 12px 40px; background: #2c3e50; color: #fff; border: none; border-radius: 6px; font-size: 18px; cursor: pointer; }
  .submit-row button:hover { background: #34495e; }

  .submitted-box { max-width: 500px; margin: 60px auto; background: #fff; border-radius: 8px; padding: 40px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
  .submitted-title { font-size: 22px; font-weight: bold; color: #2c3e50; margin-bottom: 16px; }
  .submitted-reqno { font-size: 18px; color: #2c3e50; background: #f0f1f2; border-radius: 6px; padding: 10px 20px; margin-bottom: 20px; display: inline-block; }
  .submitted-link { display: inline-block; margin-top: 10px; color: #2c3e50; text-decoration: underline; }

  .attachment-preview { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
  .attachment-card { width: 100px; text-align: center; }
  .attachment-card img { width: 100px; height: 100px; object-fit: cover; border-radius: 6px; border: 1px solid #ddd; display: block; }
  .attachment-card .file-icon { width: 100px; height: 100px; border-radius: 6px; border: 1px solid #ddd; background: #f0f1f2; display: flex; align-items: center; justify-content: center; font-size: 32px; }
  .attachment-card .file-name { font-size: 12px; color: #555; margin-top: 4px; word-break: break-all; line-height: 1.3; }

  .lightbox {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 1000;
    flex-direction: column; align-items: center; justify-content: center; cursor: zoom-out;
  }
  .lightbox img { max-width: 90%; max-height: 80vh; border-radius: 6px; }
  .lightbox-caption { color: #fff; font-size: 14px; margin-top: 12px; }
  .lightbox-close { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 36px; font-weight: bold; cursor: pointer; line-height: 1; }

  .edit-notice { background: #fdecea; border: 1px solid #f6d0cc; border-radius: 8px; padding: 14px 18px; margin-bottom: 20px; }
  .edit-notice-title { font-size: 15px; font-weight: bold; color: #c0392b; }
  .edit-notice-reason { font-size: 16px; color: #2c3e50; margin-top: 8px; white-space: pre-wrap; }
  .copy-notice { background: #eaf1fb; border: 1px solid #cddcf3; border-radius: 8px; padding: 14px 18px; margin-bottom: 20px; font-size: 15px; font-weight: bold; color: #2c5aa0; }
  .existing-file { position: relative; }
  .existing-file.marked-remove img, .existing-file.marked-remove .file-icon, .existing-file.marked-remove .file-name { opacity: 0.3; }
  .existing-file.marked-remove .file-name { text-decoration: line-through; }
  .file-del-btn { font-size: 12px; font-family: inherit; padding: 2px 10px; margin-top: 4px; border-radius: 4px; background: #fdecea; color: #c0392b; border: 1px solid #f6d0cc; cursor: pointer; }
  .file-del-btn:hover { background: #fbdedb; }
/* ---- 單子內容 ---- */
  .attachment-card .file-by { font-size: 11px; color: #95a5a6; margin-top: 2px; }
  .action-msg { background: #eaf6ec; color: #1e8449; font-size: 14px; padding: 10px 14px; border-radius: 6px; margin-bottom: 20px; }
  .tl-item { border-left: 4px solid #bdc3c7; background: #f8f9fa; border-radius: 6px; padding: 8px 14px; margin-bottom: 6px; font-size: 14px; color: #2c3e50; }
  .tl-item .tl-time { color: #7f8c8d; font-size: 13px; }
  .tl-item .tl-reason { margin-top: 6px; font-size: 14px; white-space: pre-wrap; }
  .tl-approve, .tl-pdone { border-left-color: #27ae60; background: #eaf6ec; color: #1e8449; }
  .tl-reject { border-left-color: #c0392b; background: #fdecea; color: #a94442; }
  .tl-reject .tl-reason { color: #2c3e50; }
  .tl-preturn { border-left-color: #c0392b; background: #fdecea; color: #a94442; }
  .tl-preturn .tl-reason { color: #2c3e50; }
  .tl-close { border-left-color: #2c3e50; background: #ecf0f1; color: #2c3e50; }
  .tl-withdraw { border-left-color: #d4a017; background: #fdf3d8; color: #8a6d00; }
  .tl-submit, .tl-resubmit { border-left-color: #2c5aa0; background: #eaf1fb; color: #2c5aa0; }
  .approve-btn { padding: 10px 30px; background: #2c5aa0; color: #fff; border: none; border-radius: 6px; font-size: 15px; cursor: pointer; margin-right: 10px; }
  .approve-btn:hover { background: #234780; }
  .reject-btn { padding: 10px 30px; background: #fdecea; color: #c0392b; border: 1px solid #f6d0cc; border-radius: 6px; font-size: 15px; cursor: pointer; }
  .reject-btn:hover { background: #fbdedb; }
  .copy-btn { padding: 6px 14px; background: #ecf0f1; border: 1px solid #ccc; border-radius: 4px; color: #2c3e50; font-size: 14px; text-decoration: none; white-space: nowrap; }
  .copy-btn:hover { background: #dfe6e9; }
  .del-btn { padding: 10px 30px; background: #fdecea; color: #c0392b; border: 1px solid #f6d0cc; border-radius: 6px; font-size: 15px; cursor: pointer; }
  .del-btn:hover { background: #fbdedb; }
/* ---- 清單的查詢與分頁 ---- */
  .search-row { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
  .search-row input { flex: 1; padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 15px; font-family: inherit; }
  .search-row button { padding: 8px 18px; background: #2c5aa0; color: #fff; border: none; border-radius: 4px; font-size: 15px; font-family: inherit; cursor: pointer; }
  .search-row button:hover { background: #234780; }
  .search-row a { color: #7f8c8d; font-size: 14px; }
  .tab-row { display: flex; gap: 4px; border-bottom: 2px solid #ecf0f1; margin-bottom: 16px; }
  .tab-row a { padding: 8px 20px; font-size: 15px; color: #7f8c8d; text-decoration: none; border-radius: 6px 6px 0 0; }
  .tab-row a.active { background: #2c3e50; color: #fff; }
/* 手機版面（簽核相關頁面共用）：只在螢幕寬度小於 768px 時生效，桌機畫面不受影響 */
/* 「選擇檔案」按鈕一律用站內灰底圓角樣式 */
input[type=file] { font-size: 15px; font-family: inherit; }
input[type=file]::file-selector-button { padding: 8px 16px; margin-right: 12px; background: #ecf0f1; border: 1px solid #ccc; border-radius: 4px; color: #2c3e50; font-size: 15px; font-family: inherit; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: #dfe6e9; }
/* 待我簽核的類型標籤 */
.kind-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; white-space: nowrap; background: #eaf1fb; color: #2c5aa0; }
.kind-tag.plan { background: #fdf3d8; color: #8a6d00; }
/* ---- 承辦卡片 ---- */
  .inq-done-bar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin: -4px 0 16px; }
  .inquiry-card { border-top: 4px solid #2c5aa0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 15px; }
  .inquiry-card .label { font-weight: bold; color: #2c3e50; }
  .btn-inquiry { display: inline-block; padding: 8px 22px; border-radius: 6px; background: #2c5aa0; color: #fff; text-decoration: none; font-size: 15px; }
  .inquiry-card .hint { color: #7f8c8d; font-size: 14px; }
  .inq-step { border-top: 4px solid #2c5aa0; font-size: 15px; }
  .inq-step .inq-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .inq-step .hint { color: #7f8c8d; font-size: 14px; }
  .quote .q-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
  .quote .q-row > label { font-weight: bold; min-width: 70px; }
  .quote select, .quote input, .quote-files input { font-size: 15px; font-family: inherit; padding: 5px 7px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
  .quote .q-search { position: relative; }
  .quote .q-search input { width: 260px; }
  .q-list { display: none; position: absolute; top: 100%; left: 0; min-width: 260px; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid #ccc; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.15); z-index: 20; }
  .q-list div { padding: 6px 10px; cursor: pointer; }
  .q-list div:hover { background: #eef3fb; }
  .q-list .none { color: #c0392b; cursor: default; }
  .q-list .none:hover { background: #fff; }
  .quote .q-wrap { overflow-x: auto; }
  .quote table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 14px; }
  .quote th, .quote td { border: 1px solid #dfe4e8; padding: 5px 6px; vertical-align: middle; }
  .quote th { background: #f4f6f8; color: #2c3e50; font-weight: normal; white-space: nowrap; }
  .quote td.spec { color: #7f8c8d; font-size: 13px; }
  .quote td.num { text-align: right; white-space: nowrap; }
  .quote td input { width: 100%; }
  .quote td input.n { text-align: right; }
  .quote td.q-ex { text-align: center; width: 48px; }
  .quote td.q-ex input { width: 18px; height: 18px; cursor: pointer; }
  .quote tr.excluded td { color: #95a5a6; }
  .quote tr.excluded td input:not(.q-exc) { background: #eef0f2; color: #95a5a6; }
  .quote tr.excluded td.q-sub { color: #c0392b; }
  .quote tr.excluded td.q-sub s { color: #95a5a6; }
  .quote td input[readonly] { background: #f4f6f8; color: #7f8c8d; }
  .quote .x-del { background: none; border: none; color: #c0392b; font-size: 18px; cursor: pointer; }
  .quote .x-add { background: #fff; border: 1px dashed #2c5aa0; color: #2c5aa0; border-radius: 4px; padding: 4px 12px; font-size: 14px; font-family: inherit; cursor: pointer; }
  .quote .q-fees td { background: #fcfcfd; }
  .quote .q-fees .hint, .quote .q-cond .hint { color: #7f8c8d; font-size: 13px; font-weight: normal; }
  .quote .f-lbl label { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
  .quote .s-lbl { text-align: right; font-weight: bold; }
  .quote .s-total td { font-size: 15px; font-weight: bold; background: #f4f6f8; }
  .quote .q-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
  .quote .q-saved { color: #7f8c8d; font-size: 13px; }
  .quote .q-cond { margin-top: 14px; border-top: 1px solid #eef0f2; padding-top: 10px; }
  .quote .c-row { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; flex-wrap: wrap; }
  .quote .c-lbl { font-weight: bold; min-width: 100px; }
  .quote .c-opts { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; }
  .quote .c-opts label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
  .quote .c-opts .hint { color: #7f8c8d; font-size: 13px; }
  .quote .q-addr { position: relative; display: inline-block; }
  .q-list .from { color: #95a5a6; font-size: 12px; margin-left: 6px; }
  .quote .c-note { margin-top: 14px; padding-top: 10px; border-top: 1px solid #eef0f2; }   /* 跟貨源上面的分隔線同規格 */
  .quote textarea[name=other_note] { width: 100%; font-size: 15px; font-family: inherit; padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; resize: vertical; }
  .quote .c-grid { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 18px; align-items: center; }
  .quote input.days { width: 60px; text-align: right; }
  .quote select.bad { border-color: #c0392b; background: #fdecea; }
  .quote input.bad { border-color: #c0392b; background: #fdecea; }
  .quote .q-msgs { color: #c0392b; font-size: 14px; text-align: right; }
  .btn-save-quote:disabled { background: #b8c2cc; cursor: not-allowed; }
  .quote-files .qf-card { position: relative; }
  .quote-files .qf-img { cursor: pointer; }
  .quote-files .qf-meta { font-size: 11px; color: #95a5a6; margin-top: 2px; }
  .quote-files .qf-del { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid #f6d0cc; background: #fff; color: #c0392b; font-size: 12px; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
  .quote-files .qf-none { color: #95a5a6; font-size: 14px; padding: 4px 0; }
  .quote-files .qf-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
  .quote-files .qf-pick { display: inline-block; padding: 6px 16px; border-radius: 6px; border: 1px dashed #2c5aa0; color: #2c5aa0; background: #fff; font-size: 14px; cursor: pointer; }
  .quote-files .hint { color: #7f8c8d; font-size: 13px; }
  .quote-files .qf-vendor { position: relative; }
  .quote-files .qf-vendor input { width: 240px; }
  .quote-files .qf-pick.off { border-color: #b8c2cc; color: #b8c2cc; cursor: not-allowed; }
  .quote-files .qf-group { font-size: 14px; font-weight: 600; color: #2c3e50; border-bottom: 1px solid #e3e8ef; padding: 4px 0; margin: 10px 0 8px; }
  .quote-files .qf-group.empty { color: #c0392b; }
  .quote-files .qf-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 12px; }
  .quote-files .qf-state { color: #7f8c8d; font-size: 13px; }
  .quote-files .qf-new { color: #e67e22; font-weight: 600; }
  .quote-files .qf-msg { color: #c0392b; font-size: 14px; margin-top: 6px; }
  .btn-save-quote { padding: 8px 26px; border-radius: 6px; border: none; background: #2c5aa0; color: #fff; font-size: 15px; font-family: inherit; cursor: pointer; }
  .side-actions { position: sticky; top: 12px; z-index: 50; display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 8px; pointer-events: none; }
  .side-actions button { pointer-events: auto; padding: 8px 18px; border-radius: 6px; font-size: 15px; font-family: inherit; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
  .side-actions .btn-return { background: #fdecea; color: #c0392b; border: 1px solid #f6d0cc; }
  .side-actions .btn-close { background: #fff; color: #2c3e50; border: 1px solid #ccd3d8; }
  .modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; align-items: center; justify-content: center; padding: 16px; }
  .modal-bg.open { display: flex; }
  .modal { background: #fff; border-radius: 8px; width: 100%; max-width: 520px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
  .modal-head { background: #2c3e50; color: #fff; font-size: 17px; font-weight: bold; padding: 12px 18px; }
  .modal-body { padding: 18px; font-size: 15px; color: #2c3e50; line-height: 1.6; }
  .modal-body textarea { width: 100%; min-height: 130px; box-sizing: border-box; font-size: 15px; font-family: inherit; padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; margin-top: 6px; resize: vertical; }
  .modal-body .note { color: #7f8c8d; font-size: 14px; margin-top: 6px; }
  .modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 18px 18px; }
  .modal-foot button { padding: 9px 22px; border-radius: 6px; font-size: 15px; font-family: inherit; cursor: pointer; }
  .modal-foot .m-cancel { background: #fff; color: #2c3e50; border: 1px solid #ccc; }
  .modal-foot .m-go { color: #fff; border: none; }
  @media (max-width: 767px) {
    .side-actions { position: fixed; top: auto; right: 0; left: 0; bottom: 0; margin: 0; gap: 0; background: #fff; box-shadow: 0 -2px 8px rgba(0,0,0,0.12); }
    .side-actions button { flex: 1; border-radius: 0; box-shadow: none; padding: 14px 0; font-size: 16px; }
    body.has-side-actions { padding-bottom: 56px; }   /* 滑到底時內容不會被按鈕列擋住 */
  }
  /* 承辦卡片：段和段之間的分隔線 */
  .h-part { margin-top: 14px; padding-top: 10px; border-top: 1px solid #eef0f2; }
  .h-inq { margin-bottom: 4px; }
  #hPlanText { width: 100%; min-height: 160px; padding: 12px; resize: vertical; overflow: hidden; box-sizing: border-box; border: 1px solid #ccc; border-radius: 6px; font-family: inherit; font-size: 16px; line-height: 1.6; }
  #hPlanText:focus { outline: none; border-color: #2c5aa0; }
  .d-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
  .d-foot .q-saved { color: #7f8c8d; font-size: 13px; }
  .d-foot .q-msgs, .inq-done-bar .q-msgs { color: #c0392b; font-size: 14px; text-align: right; }
  .h-card .inq-done-bar { margin: 18px 0 0; }
  .h-card .go-btn:disabled { background: #b8c2cc; cursor: not-allowed; }
  .h-card .hint { color: #7f8c8d; font-size: 13px; }
  .h-vhint { padding: 3px 12px; border: 1px solid #ccd3d8; border-radius: 4px; background: #ecf0f1; color: #2c3e50; font-family: inherit; font-size: 14px; cursor: pointer; }
  #hPayee select { font-size: 15px; font-family: inherit; padding: 5px 7px; border: 1px solid #ccc; border-radius: 4px; }
  #hPayee select.bad { border-color: #c0392b; background: #fdecea; }
  #hPayee label { display: inline-flex; align-items: center; gap: 4px; }

.nav-toggle { display: none; }

@media (max-width: 767px) {
  body { font-size: 16px; }

  header { padding: 10px 12px; font-size: 15px; gap: 8px; }
  header .title-wrap span { white-space: nowrap; }
  header .title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
  header .right { gap: 8px; flex-shrink: 0; }
  header .greeting { font-size: 12px; white-space: nowrap; }
  header .logout-link { font-size: 12px; padding: 3px 8px; white-space: nowrap; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; flex-shrink: 0;
    background: none; border: 1px solid rgba(255,255,255,0.6); border-radius: 4px;
    color: #fff; font-size: 20px; cursor: pointer;
  }

  .layout { flex-direction: column; }
  nav { display: none; width: 100%; padding: 4px 0; border-bottom: 1px solid #dfe6e9; }
  body.nav-open nav { display: block; }

  main { padding: 12px 10px; }
  .card { padding: 16px 14px; }

  /* 表格改成一張一張的卡片 */
  table.cardify thead { display: none; }
  table.cardify, table.cardify tbody, table.cardify tr, table.cardify td { display: block; width: 100%; }
  table.cardify tr { border: 1px solid #e3e6e8; border-radius: 8px; margin-bottom: 10px; padding: 8px 12px; background: #fff; }
  table.cardify td { border: none; padding: 4px 0; display: flex; gap: 10px; font-size: 15px; }
  table.cardify td[data-label]::before { content: attr(data-label); flex-shrink: 0; min-width: 4.5em; color: #7f8c8d; font-size: 14px; }
  table.cardify tr.data-row:hover td { background: none; }

  /* 案件明細 */
  .form-title { font-size: 20px; }
  .kv-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .attachment-preview { gap: 10px; }

  .action-row form { display: block !important; }
  .action-row .approve-btn, .action-row .reject-btn, .action-row .del-btn {
    display: block; width: 100%; margin: 0 0 10px 0; padding: 14px; font-size: 17px; text-align: center;
  }
  #invoiceForm #invoiceInput { width: 100%; margin-bottom: 10px; }
  #invoiceForm .approve-btn { margin-left: 0 !important; padding: 12px !important; }

  /* 填單頁：品項明細改成每項一張可填寫的卡片，表頭只保留「急單」勾選 */
  #itemsTable, #itemsTable tbody, #itemsTable tr, #itemsTable td { display: block; width: 100% !important; }
  #itemsTable thead { display: block; }
  #itemsTable thead tr { display: flex; justify-content: flex-end; }
  #itemsTable thead th { display: none; }
  #itemsTable thead th:nth-child(5) { display: block; background: none; padding: 0 0 8px; }
  #itemsTable thead th:nth-child(5) span { display: none; }
  #itemsTable tbody tr { position: relative; border: 1px solid #e3e6e8; border-radius: 8px; padding: 8px 12px 10px; margin-bottom: 10px; }
  #itemsTable tbody td { border: none; padding: 3px 0; }
  #itemsTable tbody td[data-label]::before { content: attr(data-label); display: block; font-size: 13px; color: #7f8c8d; margin-bottom: 2px; }
  #itemsTable tbody td:nth-child(1) { padding-right: 30px; }
  #itemsTable tbody td.remove { position: absolute; top: 4px; right: 4px; width: auto !important; padding: 0; }
  .title-row .form-title { font-size: 20px; }

  /* 說明小視窗：手機上固定在畫面中間顯示，不會超出畫面 */
  .help-icon .tooltip-text { position: fixed; top: 30%; bottom: auto; left: 50%; transform: translateX(-50%); width: calc(100vw - 32px); max-width: 340px; }
  .help-icon .tooltip-text::after { display: none; }

  /* 帳號管理 */
  table.cardify td:empty { display: none; }
  .card .card-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .card .card-head input { width: 100%; }
  table.cardify td.link-col { flex-wrap: wrap; }
  table.cardify td.link-col .copy-btn { margin-left: 0; white-space: nowrap; }
  table.cardify td.action-col { justify-content: flex-end; }

  /* 簽核流程管理 */
  .path-row { flex-direction: column; align-items: stretch !important; gap: 8px; }
  .path-seq { flex-wrap: wrap; white-space: nowrap; }
  .path-meta { justify-content: space-between; white-space: nowrap; }
  .path-count-wrap .tooltip-text { position: fixed; top: 30%; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); width: calc(100vw - 32px); max-width: 340px; }
  .card .card-head input { width: 100% !important; max-width: none; }

  .lightbox img { max-width: 96%; }
  .lightbox-close { top: 10px; right: 16px; }
}

/* ---- 廠商 ---- */
.vd-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.vd-search { display: flex; gap: 8px; align-items: center; }
.vd-search input { font-size: 15px; font-family: inherit; padding: 8px 12px; width: 340px; border: 1px solid #ccc; border-radius: 4px; color: #2c3e50; }
.vd-search input:focus { outline: none; border-color: #2c5aa0; }
.vd-btn { display: inline-block; font-size: 15px; font-family: inherit; padding: 7px 16px; border-radius: 6px; white-space: nowrap; text-decoration: none; cursor: pointer; border: 1px solid #dfe4e8; background: #fff; color: #2c5aa0; }
.vd-btn:hover { background: #f4f6f8; }
.vd-btn.primary { background: #2c5aa0; border-color: #2c5aa0; color: #fff; }
.vd-btn.primary:hover { background: #234780; }
.vd-btn.danger { background: #fdecea; border-color: #f6d0cc; color: #c0392b; }
.vd-btn:disabled { opacity: .6; cursor: default; }
.vd-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.vd-tab { font-size: 15px; font-family: inherit; cursor: pointer; padding: 6px 12px; border: 1px solid #dfe4e8; border-radius: 5px; background: #fff; color: #2c3e50; }
.vd-tab .n { color: #95a5a6; margin-left: 4px; font-size: 13px; }
.vd-tab:hover { background: #f4f6f8; }
.vd-tab.active { background: #2c3e50; border-color: #2c3e50; color: #fff; }
.vd-tab.active .n { color: #dfe6e9; }
.vd-tabs.searching .vd-tab.active { background: #fff; border-color: #dfe4e8; color: #2c3e50; }
.vd-count { font-size: 15px; color: #777; margin: 0 0 10px; }
table.list td.nowrap { white-space: nowrap; }
table.list.vd-list td { vertical-align: top; }
.vd-ct { white-space: nowrap; }
.vd-ct .br { color: #95a5a6; font-size: 13px; }
.vd-ct .tel { color: #555; margin-left: 8px; }
.vd-hit { color: #c0392b; font-weight: bold; }
a.vd-link { color: #2c5aa0; text-decoration: none; }
a.vd-link:hover { text-decoration: underline; }
.vd-hitline + .vd-hitline { margin-top: 4px; }
.vd-hitline .where { color: #7f8c8d; }
.vd-pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.vd-pager button, .vd-pager a, .vd-pager span.cur, .vd-pager span.dis { font-size: 15px; font-family: inherit; min-width: 36px; padding: 5px 10px; text-align: center; border: 1px solid #dfe4e8; border-radius: 5px; background: #fff; color: #2c3e50; text-decoration: none; cursor: pointer; }
.vd-pager button:hover, .vd-pager a:hover { background: #f4f6f8; }
.vd-pager button.cur, .vd-pager span.cur { background: #2c3e50; border-color: #2c3e50; color: #fff; }
.vd-pager button:disabled, .vd-pager span.dis { color: #bbb; cursor: default; background: #fff; }
.vd-pager .gap { color: #999; }
.vd-back { display: inline-block; font-size: 15px; color: #2c5aa0; text-decoration: none; margin-bottom: 10px; }
.vd-back:hover { text-decoration: underline; }
.vd-wrap { max-width: 1100px; margin: 0 auto; }
.vd-hint { font-size: 14px; color: #7f8c8d; margin: 6px 0 14px; }
dl.vd-info { display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; margin: 0; font-size: 15px; color: #2c3e50; }
dl.vd-info dt { color: #7f8c8d; }
dl.vd-info dd { margin: 0; word-break: break-all; }
.vd-empty { color: #bbb; }
.vd-same { color: #95a5a6; font-size: 13px; margin-left: 4px; }
.vd-addr-type { display: inline-block; font-size: 13px; color: #555; background: #ecf0f1; border-radius: 3px; padding: 1px 6px; margin-right: 6px; }
.vd-cat { border-top: 1px solid #eee; padding-top: 14px; margin-top: 16px; }
.vd-cat h3 { font-size: 16px; color: #2c3e50; margin: 0 0 10px; }
table.vd-contacts { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.vd-contacts th { background: #f4f6f8; padding: 8px; font-size: 14px; text-align: left; white-space: nowrap; color: #555; }
table.vd-contacts td { padding: 8px; border-bottom: 1px solid #eee; font-size: 15px; color: #2c3e50; vertical-align: top; }
.modal-body ul { margin: 8px 0 12px; padding-left: 22px; }
.modal-body input.vd-confirm { font-size: 15px; font-family: inherit; padding: 7px 10px; width: 100%; border: 1px solid #ccc; border-radius: 4px; margin-top: 6px; }
.modal-foot .m-go.danger { background: #c0392b; }
.modal-foot .m-go:disabled { opacity: .4; cursor: default; }
/* 廠商編輯 */
.vd-grid { display: grid; grid-template-columns: 100px 1fr; gap: 10px 12px; align-items: start; font-size: 15px; color: #2c3e50; }
.vd-grid > .lbl { color: #7f8c8d; padding-top: 7px; }
.vd-edit .req { color: #c0392b; }
.vd-edit input.f, .vd-edit select.f, .vd-edit textarea.f { font-size: 15px; font-family: inherit; padding: 6px 10px; border: 1px solid #ccc; border-radius: 4px; background: #fff; color: #2c3e50; width: 100%; }
.vd-edit .f:focus { outline: none; border-color: #2c5aa0; }
.vd-edit textarea.f { min-height: 60px; resize: vertical; }
.vd-edit .f.has-err { border-color: #c0392b; }
.vd-edit .err { color: #c0392b; font-size: 13px; margin-top: 3px; }
.vd-edit .err a { color: #c0392b; text-decoration: underline; }
.vd-guide { background: #eef4fb; border: 1px solid #d4e3f5; border-radius: 6px; padding: 12px 16px; margin-bottom: 12px; font-size: 15px; color: #2c3e50; line-height: 1.7; }
.vd-guide b { color: #2c5aa0; }
.vd-edit .rows { display: flex; flex-direction: column; gap: 8px; }
.vd-edit .row { display: flex; gap: 8px; align-items: flex-start; }
.vd-edit .cell { display: flex; flex-direction: column; }
.vd-edit .w-type { width: 120px; flex: none; }
.vd-edit .w-ext { width: 110px; flex: none; }
.vd-edit .w-num { width: 220px; flex: none; }
.vd-edit .cell.narrow input.f { max-width: 220px; }
.vd-edit .grow { flex: 1; min-width: 0; }
.vd-edit .x-btn { flex: none; background: none; border: none; color: #c0392b; cursor: pointer; font-size: 20px; line-height: 1; padding: 6px 4px; }
.vd-edit .add-btn { align-self: flex-start; font-size: 14px; font-family: inherit; cursor: pointer; padding: 5px 14px; border: 1px dashed #95a5a6; border-radius: 5px; background: #fff; color: #2c5aa0; }
.vd-edit .add-btn:hover { background: #f4f6f8; }
.vd-edit .rm-btn { font-size: 13px; font-family: inherit; padding: 4px 12px; border-radius: 5px; background: #fdecea; color: #c0392b; border: 1px solid #f6d0cc; cursor: pointer; font-weight: normal; }
.vd-edit .section-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.vd-edit .ecat { border: 1px solid #e5e8eb; border-radius: 6px; padding: 14px 16px; margin-top: 14px; background: #fafbfc; }
.vd-edit .ecat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.vd-edit .ecat-head .cell { width: 260px; }
.vd-edit .picks { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 6px; }
.vd-edit .picks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.vd-edit .picks input { width: 18px; height: 18px; accent-color: #2c3e50; }
.vd-edit .hint { color: #95a5a6; font-size: 13px; padding-top: 7px; }
.vd-edit .contact { border-bottom: 1px solid #eee; padding: 12px 0; }
.vd-edit .contact:first-child { padding-top: 0; }
.vd-edit .contact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 10px; flex: 1; min-width: 0; }
.vd-edit .contact-grid .cell label { font-size: 13px; color: #7f8c8d; margin-bottom: 2px; }
.vd-edit .actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.vd-msg { background: #fdecea; border: 1px solid #f6d0cc; color: #c0392b; border-radius: 6px; padding: 12px 16px; margin-bottom: 12px; font-size: 15px; }
@media (max-width: 767px) {
  .vd-search { width: 100%; }
  .vd-search input { flex: 1; width: auto; min-width: 0; }
  .vd-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .vd-tab { white-space: nowrap; }
  dl.vd-info { grid-template-columns: 80px 1fr; }
  .vd-grid { grid-template-columns: 1fr; gap: 4px; }
  .vd-grid > .lbl { padding-top: 8px; }
  .vd-edit .row { flex-wrap: wrap; }
  .vd-edit .w-type, .vd-edit .w-num, .vd-edit .w-ext { width: auto; flex: 1; }
  .vd-edit .contact-grid { grid-template-columns: 1fr 1fr; }
  .vd-edit .ecat-head .cell { width: auto; flex: 1; }
}

/* ---- 帳號、簽核流程 ---- */
.ac-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-family: inherit; cursor: pointer; padding: 6px 12px; border-radius: 5px; border: 1px solid transparent; text-decoration: none; margin-left: 6px; white-space: nowrap; }
.ac-btn.edit { background: #eaf1fb; color: #2c5aa0; border-color: #cfe0f5; }
.ac-btn.edit:hover { background: #dbe9fa; }
.ac-btn.danger { background: #fdecea; color: #c0392b; border-color: #f6d0cc; }
.ac-btn.danger:hover { background: #fbdedb; }
.ac-btn.copy { background: #eef1f3; color: #2c3e50; border-color: #dfe4e8; margin-left: 8px; }
.ac-btn:disabled { opacity: .5; cursor: not-allowed; }
table.list td.perm-col, table.list th.perm-col { text-align: center; white-space: nowrap; }
table.list td.link-col { white-space: nowrap; }
table.list td.action-col { white-space: nowrap; text-align: right; }
table.list a.copy-link { color: #2c3e50; }
.ac-ok { background: #eafaf1; border: 1px solid #2ecc71; border-radius: 6px; padding: 12px 16px; margin-bottom: 12px; font-size: 15px; word-break: break-all; }
.ac-ok a { color: #1e824c; }
.ac-row { display: flex; gap: 16px; flex-wrap: wrap; }
.ac-field { width: 280px; }
.ac-field label { display: block; font-size: 14px; color: #555; margin-bottom: 4px; }
.ac-field input, .ac-field select { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 15px; font-family: inherit; background: #fff; }
.ac-checks { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 10px; }
.ac-checks label { display: flex; align-items: center; gap: 6px; font-size: 15px; cursor: pointer; }
.ac-only { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 10px 0 14px; }
.ac-dup { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; padding: 10px; background: #f8f9fa; border-radius: 6px; flex-wrap: wrap; }
.ac-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ac-add select { font-size: 15px; font-family: inherit; padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; min-width: 160px; }
.arrow { color: #999; font-size: 16px; }
.path-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border: 1px solid #eee; border-radius: 6px; margin-bottom: 8px; }
.path-seq { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.path-meta { display: flex; align-items: center; gap: 10px; }
.path-meta form { display: inline; }
.path-count-wrap { position: relative; display: inline-block; }
.path-count { font-size: 13px; color: #999; }
.path-count.has-users { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.path-count.plan { background: #fdf3d8; color: #8a6d00; padding: 3px 8px; border-radius: 4px; }
.path-count-wrap .tooltip-text { visibility: hidden; opacity: 0; position: absolute; bottom: 135%; right: 0; background: #2c3e50; color: #fff; border-radius: 8px; font-size: 13px; line-height: 1.6; width: 200px; box-shadow: 0 6px 16px rgba(0,0,0,0.18); transition: opacity 0.15s ease; z-index: 10; }
.path-count-wrap:hover .tooltip-text { visibility: visible; opacity: 1; }
.path-count-wrap .tooltip-body { display: block; padding: 10px 14px; }
.inactive-tag { color: #c0392b; font-size: 12px; margin-left: 2px; }
/* 未登入首頁 */
.contact-notice { background: #fff; border-radius: 10px; padding: 40px 44px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); max-width: 420px; margin: 60px auto; text-align: center; }
.contact-notice .icon { font-size: 34px; margin-bottom: 6px; }
.contact-notice h2 { font-size: 19px; color: #2c3e50; margin-bottom: 8px; }
.contact-notice .sub { font-size: 14px; color: #888; margin-bottom: 26px; }
.contact-notice .contact-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px; border-top: 1px solid #eee; text-align: left; }
.contact-notice .who { font-size: 15px; color: #2c3e50; }
.contact-notice .who .role { display: block; font-size: 12px; color: #999; margin-top: 2px; }
.contact-notice .ext { font-size: 14px; color: #2c3e50; background: #ecf0f1; padding: 6px 12px; border-radius: 20px; white-space: nowrap; }
@media (max-width: 767px) {
  .ac-field { width: 100% !important; }
  table.cardify td.perm-col { text-align: left; }
  table.cardify td.link-col { white-space: normal; word-break: break-all; }
}

/* ---- 交貨地點 ---- */
.dl-cols { display: grid; grid-template-columns: 220px 280px 1fr; gap: 16px; align-items: start; }
.dl-col { border: 1px solid #eee; border-radius: 6px; padding: 10px; min-width: 0; }
.dl-col-title { font-size: 14px; color: #7f8c8d; margin: 2px 4px 8px; }
.dl-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 5px; color: #2c3e50; text-decoration: none; font-size: 15px; }
.dl-item:hover { background: #f4f6f8; }
.dl-item.on { background: #2c3e50; color: #fff; }
.dl-item.on .dl-code, .dl-item.on .dl-n, .dl-item.on .dl-sub { color: #dfe6e9; }
.dl-item.off { color: #aaa; }
.dl-code { font-size: 12px; color: #95a5a6; }
.dl-n { font-size: 13px; color: #95a5a6; }
.dl-sub { display: block; font-size: 13px; color: #95a5a6; margin-top: 2px; }
.dl-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.dl-add input, .dl-add select, .dl-inline input, .dl-form input { font-size: 14px; font-family: inherit; padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; min-width: 0; }
.dl-add input { flex: 1; min-width: 90px; }
.dl-add .ac-btn, .dl-inline .ac-btn { margin-left: 0; }
.dl-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.dl-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #7f8c8d; }
.dl-line { margin-top: 12px; font-size: 14px; color: #7f8c8d; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dl-place { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.dl-pname { min-width: 150px; font-size: 15px; color: #2c3e50; }
.dl-inline { display: inline-flex; gap: 6px; align-items: center; }
.dl-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
@media (max-width: 1100px) { .dl-cols { grid-template-columns: 1fr 1fr; } .dl-detail { grid-column: 1 / -1; } }
@media (max-width: 767px) { .dl-cols { grid-template-columns: 1fr; } }

/* ---- 下單卡片 ---- */
.od-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.od-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: #555; }
.od-grid input, .od-grid select { font-size: 15px; font-family: inherit; padding: 7px 10px; border: 1px solid #ccc; border-radius: 4px; background: #fff; }
/* 驗收卡片（照紙本驗收欄：到貨日期、到貨數量單行；驗收意見、備註多行） */
.ac-area { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: #555; margin-top: 12px; }
.ac-area textarea { font-size: 15px; font-family: inherit; padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; resize: vertical; }
/* 顯示用的品項表（11/5 使用者：要一眼看得出是品項表）：外框、深色表頭、交錯底色、項次 */
table.itable { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid #9fb3c8; border-radius: 6px; overflow: hidden; }
table.itable th { background: #2c5aa0; color: #fff; font-weight: bold; padding: 9px 10px; font-size: 15px; text-align: left; }
table.itable td { padding: 9px 10px; border-top: 1px solid #dde4ec; font-size: 15px; vertical-align: top; white-space: pre-wrap; }
table.itable tbody tr:nth-child(even) td { background: #f2f6fb; }
table.itable .no { width: 60px; text-align: center; white-space: nowrap; }
table.itable .n { text-align: right; }
@media (max-width: 767px) {
  table.itable { border: none; }
  table.itable td, table.itable tbody tr:nth-child(even) td { background: none; border-top: none; }
  table.itable tr { border-left: 4px solid #2c5aa0; }
  table.itable .no, table.itable .n { width: auto; text-align: left; }
}
/* 側欄：待辦／查詢（11/9 使用者定的設計）。待辦一律顯示數字（沒單灰色 0）、虛線「查詢」分隔、查詢淡色字、圖示、採購案件子項目 */
nav .nav-ico { width: 19px; height: 19px; flex: none; stroke-width: 1.8; }
nav .nav-l { flex: 1; }
nav .nav-badge.zero { background: #dfe3e6; color: #95a5a6; }
nav li a.nav-q { color: #6c7a7d; }
nav li a.nav-sub, nav li a.nav-sub2 { padding: 6px 20px 6px 47px; font-size: 15px; position: relative; }
nav li a.nav-sub2 { padding-left: 63px; font-size: 14px; }
/* 子項目左邊的細導引線（11/11 使用者選 C）：第二層對齊上一層圖示中間，第三層對齊「已結案」的字；
   每一層最後一項的線停在字的中間、轉小彎（└），不要一路畫到底 */
nav li a.nav-sub::before, nav li a.nav-sub2::before { content: ""; position: absolute; top: 0; bottom: 0; left: 29px; border-left: 1px solid #c3ccd0; }
nav li a.nav-sub2::before { left: 53px; }
nav li a.nav-last::before { bottom: 50%; width: 7px; border-bottom: 1px solid #c3ccd0; border-bottom-left-radius: 5px; }
nav li a.nav-cont::after { content: ""; position: absolute; top: 0; bottom: 0; left: 29px; border-left: 1px solid #c3ccd0; }
nav .nav-cnt { font-size: 13px; color: #95a5a6; }
/* 採購清單的類型欄（11/9 使用者）：每張單都有類型，用顏色分 */
.type-tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 13px; margin: 1px 0; white-space: nowrap; }
.type-tag.dlv { background: #e1f5ee; color: #085041; }
.type-tag.adv { background: #faeeda; color: #633806; }
.type-tag.rej { background: #fcebeb; color: #a32d2d; }
.type-tag.gray { background: #ecf0f1; color: #5f6b6d; }
.type-tag.chg { background: #e6eefb; color: #2c5aa0; }   /* 採購變更（12/4） */
.pc-item + .pc-item { margin-top: 14px; padding-top: 14px; border-top: 1px solid #eee; }
/* 請購人寫的廠商，放在購買明細廠商欄後面（11/9 使用者） */
.h-vhint-row { flex: 1 1 0; min-width: 0; align-items: center; gap: 6px 8px; flex-wrap: wrap; font-size: 14px; color: #7f8c8d; }
.h-vhint-row b { color: #2c3e50; }
/* 待下單三步驟（11/9 使用者：存下單資料 → 寄給廠商 → 下單完成） */
.od-steps { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 14px; color: #95a5a6; }
.od-steps span { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #ccd3d9; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: bold; flex: none; }
.od-steps span.now { border-color: #2c5aa0; background: #2c5aa0; color: #fff; }
.od-steps span.now + b { color: #2c3e50; }
.od-steps span.done { border-color: #27ae60; background: #27ae60; color: #fff; }
.od-steps b { font-weight: normal; }
.od-steps i { flex: 0 0 36px; height: 2px; background: #dfe4e8; }
.od-log { margin-top: 14px; }
.od-log-h { font-size: 14px; color: #7f8c8d; margin-bottom: 6px; }
.od-log-t { border-collapse: collapse; font-size: 14px; }
.od-log-t td { border-bottom: 1px solid #eef1f3; padding: 5px 14px 5px 0; }
/* 下單卡片照三步驟由上往下排（11/9 使用者） */
.od-sec { border-top: 1px solid #eef1f3; padding-top: 16px; margin-top: 16px; }
.od-sec.od-first { border-top: none; padding-top: 0; margin-top: 4px; }
.od-sec.off { opacity: .5; }
.od-sec-h { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: bold; color: #2c3e50; margin-bottom: 12px; }
.od-sec-h small { font-size: 13px; font-weight: normal; color: #95a5a6; }
.od-num { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #ccd3d9; color: #95a5a6; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.od-num.now { border-color: #2c5aa0; background: #2c5aa0; color: #fff; }
.od-num.done { border-color: #27ae60; background: #27ae60; color: #fff; }
.od-btns { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.od-btns .go-btn:disabled { background: #b8c2cc; cursor: not-allowed; }
.od-saved { color: #27ae60; font-size: 14px; }
.od-dirty { display: none; color: #c0392b; font-size: 14px; margin-bottom: 8px; }
#orderCard.dirty .od-dirty { display: block; }
#orderCard.dirty .od-need-clean { opacity: .4; pointer-events: none; }
#orderCard.dirty .od-saved { display: none; }
/* 下單資料的整單備註，整行寬（11/9 錦蘭姐） */
.od-grid .od-remark { grid-column: 1 / -1; }
.od-grid .od-remark small { color: #95a5a6; font-size: 13px; margin-left: 6px; }
.od-grid textarea { font-size: 15px; font-family: inherit; padding: 7px 10px; border: 1px solid #ccc; border-radius: 4px; background: #fff; resize: vertical; line-height: 1.5; }
/* 採購看待驗收：驗收狀況卡片、其餘內容收起來（11/9 使用者） */
.aw-card { border-left: 4px solid #e0a030; }
.aw-card.late { border-left-color: #c0392b; }
.aw-main { font-size: 17px; color: #2c3e50; }
.aw-sub { font-size: 14px; color: #7f8c8d; margin-left: 4px; }
.aw-due { margin-top: 6px; font-size: 15px; color: #7f8c8d; }
.aw-card.late .aw-due { color: #c0392b; font-weight: bold; }
details.fold { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 16px; }
details.fold > summary { cursor: pointer; padding: 16px 22px; font-size: 16px; font-weight: bold; color: #2c3e50; list-style: none; display: flex; align-items: center; gap: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '▸'; color: #95a5a6; }
details.fold[open] > summary::before { content: '▾'; }
details.fold > summary small { font-size: 13px; font-weight: normal; color: #95a5a6; }
details.fold[open] { background: transparent; box-shadow: none; }
details.fold[open] > summary { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 12px; }
.aw-sec { margin-top: 18px; padding-top: 14px; border-top: 1px solid #eef1f3; }
.aw-h { font-size: 14px; color: #7f8c8d; margin-bottom: 8px; }
.aw-note { margin-left: 12px; font-size: 14px; color: #95a5a6; }
/* 備註／其它約定事項二選一（11/9 使用者） */
.od-grid .od-terms-on { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; font-size: 15px; color: #2c3e50; cursor: pointer; }
.od-grid textarea:disabled { background: #f4f6f8; color: #95a5a6; }
@media (max-width: 768px) { .page-wrap.full, .vd-wrap.full, .card.wide { max-width: none; } }   /* 手機不留邊 */
/* 採購各卡片統一成已驗收的框線樣式（11/11 使用者：都要一起改）
   規則：卡片標題＝左邊直線；卡片裡每一段＝一個框（#dfe4e8 邊、圓角 6px），段標題＝灰底標題列（#f4f6f8） */
.h-card .h-part { border: 1px solid #dfe4e8; border-radius: 6px; padding: 0 14px 14px; margin-top: 14px; background: #fff; }
.h-card .h-part > .section-label { margin: 0 -14px 12px; padding: 8px 14px; background: #f4f6f8; border-left: none; border-bottom: 1px solid #dfe4e8; border-radius: 6px 6px 0 0; font-size: 15px; color: #2c3e50; }
.od-sec, .od-sec.od-first { border: 1px solid #dfe4e8; border-radius: 6px; padding: 0 14px 14px; margin-top: 12px; background: #fff; }
.od-sec-h { margin: 0 -14px 12px; padding: 8px 14px; background: #f4f6f8; border-bottom: 1px solid #dfe4e8; border-radius: 6px 6px 0 0; font-size: 15px; }
.aw-sec { border: 1px solid #dfe4e8; border-radius: 6px; padding: 0 14px 14px; margin-top: 14px; background: #fff; }
.aw-h { margin: 0 -14px 12px; padding: 7px 14px; background: #f4f6f8; border-bottom: 1px solid #dfe4e8; border-radius: 6px 6px 0 0; font-size: 14px; color: #555; }
.od-log { border: 1px solid #dfe4e8; border-radius: 6px; overflow: hidden; }
.od-log-h { margin: 0; padding: 7px 14px; background: #f4f6f8; border-bottom: 1px solid #dfe4e8; font-size: 14px; color: #555; }
.od-log-t { margin: 4px 14px 8px; }
.od-log > .empty-note { padding: 8px 14px; }
.kv-grid { border: 1px solid #dfe4e8; border-radius: 6px; gap: 0; overflow: hidden; background: #fff; }
.kv-grid .kv { flex: 1 1 auto; padding: 10px 18px; border-right: 1px solid #eef1f3; }
.kv-grid .kv:last-child { border-right: none; }
.kv-grid.secondary { border-top: 1px solid #dfe4e8; padding-top: 0; margin-top: 12px; }
.purpose-box, .plan-text-box { background: #fff; border: 1px solid #dfe4e8; }
#invoiceForm { border: 1px solid #dfe4e8 !important; border-radius: 6px; padding: 12px 14px !important; background: #f8f9fa; }
/* 請購內容：一張表（11/11 使用者：填單人的零碎資訊整理過再顯示）；配色沿用系統 */
.rq-wrap { overflow-x: auto; }
.rq-table { width: 100%; min-width: 760px; table-layout: fixed; border-collapse: collapse; border: 1px solid #ccd3d8; font-size: 15px; color: #2c3e50; }
.rq-table th, .rq-table td { border: 1px solid #dfe4e8; padding: 8px 12px; text-align: left; vertical-align: top; word-break: break-word; }
.rq-table th.rq-l { background: #f4f6f8; color: #555; font-weight: normal; font-size: 14px; white-space: nowrap; }
.rq-table tr.rq-sec td { background: #ecf0f1; font-size: 14px; font-weight: bold; padding: 6px 12px; }
.rq-table tr.rq-ih th { background: #2c5aa0; color: #fff; font-weight: normal; font-size: 14px; border-color: #2c5aa0; }
.rq-table tr.rq-it:nth-child(even) td { background: #f7f9fb; }
.rq-table .n { text-align: right; }
.rq-table .rq-spec { white-space: pre-wrap; }
.rq-table .rq-purpose { white-space: pre-wrap; line-height: 1.7; padding: 10px 12px; }
.rq-urgent { display: inline-block; background: #fdecea; color: #c0392b; font-size: 13px; padding: 1px 10px; border-radius: 10px; }
.card.wide.full-w { max-width: none; }   /* 帳號頁：登入網址很長，這一頁用全寬（11/11 使用者） */
.or-sep { color: #7f8c8d; font-size: 14px; margin: 0 4px; }
/* 採購查詢（11/13） */
.sr-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.sr-form .sr-kw { flex: 1 1 280px; min-width: 220px; }
.sr-form .sr-date { display: inline-flex; align-items: center; gap: 4px; color: #555; }
.sr-count { color: #7f8c8d; font-size: 14px; margin-bottom: 8px; }
.sr-table td.n, .sr-table th.n { text-align: right; white-space: nowrap; }
.sr-print { white-space: nowrap; }
.sr-print .ac-btn { text-decoration: none; margin-right: 4px; }
.sr-pager { display: flex; justify-content: center; gap: 16px; margin-top: 14px; }
.sr-table td:nth-child(2), .sr-table td:nth-child(3), .sr-table td:nth-child(8), .sr-table th { white-space: nowrap; }
/* 採購查詢：欄位樣式跟其他頁一致（11/13 使用者：下拉、輸入框要有樣式；單號不要像舊式超連結） */
.sr-form input[type=text], .sr-form input[type=date], .sr-form select { font-size: 15px; font-family: inherit; padding: 7px 10px; border: 1px solid #ccc; border-radius: 4px; background: #fff; color: #2c3e50; height: 38px; box-sizing: border-box; }
.sr-form input:focus, .sr-form select:focus { outline: none; border-color: #2c5aa0; }
.sr-form .vd-btn { height: 38px; box-sizing: border-box; }
.sr-table td.sr-no { font-weight: bold; color: #2c3e50; white-space: nowrap; }
.sr-pager a { color: #2c5aa0; text-decoration: none; }

/* 問題回報（11/24 使用者）：回報頁沿用請購單的表單樣式；狀態徽章三色 */
.fb-err { background: #fdecea; border: 1px solid #f6d0cc; color: #c0392b; border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; }
.fb-from { font-size: 13px; color: #7f8c8d; margin-top: 6px; }
.fb-mine { max-width: 900px; margin: 18px auto 12px; box-sizing: border-box; }
.fb-item { border: 1px solid #dfe4e8; border-radius: 8px; padding: 14px 18px; margin-bottom: 12px; background: #fff; }
.fb-item-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.fb-no { font-weight: bold; color: #2c3e50; }
.fb-kind { font-size: 14px; color: #2c3e50; background: #f4f6f8; border-radius: 4px; padding: 2px 8px; }
.fb-time { font-size: 14px; color: #888; }
.fb-body { white-space: pre-wrap; font-size: 16px; color: #2c3e50; line-height: 1.7; border-left: 4px solid #dfe4e8; padding: 4px 12px; margin-bottom: 10px; }
.fb-close-note { margin-top: 10px; background: #eaf6ec; color: #1e5631; border-radius: 6px; padding: 10px 14px; font-size: 15px; white-space: pre-wrap; }
.fb-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 13px; }
.fb-badge.fb-pending { background: #fdecea; color: #c0392b; }
.fb-badge.fb-handling { background: #eaf1fb; color: #2c5aa0; }
.fb-badge.fb-closed { background: #eef1f3; color: #6b7785; }
.fb-detail { margin-top: 6px; }
.fb-back { margin-left: auto; font-size: 14px; color: #2c5aa0; text-decoration: none; }
.fb-sum { color: #555; }
.fb-close-form { margin-top: 18px; border-top: 1px solid #eef1f3; padding-top: 14px; display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.fb-close-form label { font-weight: bold; color: #2c3e50; }
.fb-close-form textarea { font-family: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid #ccd3da; border-radius: 6px; min-height: 90px; resize: vertical; }
.fb-close-form button { align-self: flex-start; }

/* 12/2 送出前新選的附件：右上角 × 個別移除 */
.attachment-card.new-file { position: relative; }
.attachment-card .file-x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid #c0392b; background: #fff; color: #c0392b; font-size: 16px; line-height: 20px; text-align: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.attachment-card .file-x:hover { background: #c0392b; color: #fff; }

/* 12/2 PDF 縮圖與燈箱 */
.pdf-thumb { width: 100px; height: 100px; border-radius: 6px; border: 1px solid #ddd; background: #fff; overflow: hidden; }
.pdf-thumb iframe { width: calc(100% + 18px); height: 100%; border: 0; pointer-events: none; display: block; }
.lightbox-pdf { width: 90vw; max-width: 1000px; height: 82vh; border: 0; border-radius: 6px; background: #fff; cursor: auto; }
.lightbox-dl { position: absolute; top: 18px; left: 30px; background: #fff; color: #2c3e50; font-size: 16px; font-weight: bold; padding: 8px 18px; border-radius: 6px; text-decoration: none; box-shadow: 0 2px 6px rgba(0,0,0,.3); cursor: pointer; }
.lightbox-dl:hover { background: #2980b9; color: #fff; }
@media (max-width: 768px) {
  .lightbox-pdf { width: 96vw; height: 78vh; }
  .lightbox-dl { top: 10px; left: 16px; }
}

/* 12/3 詢價單備註 */
.inq-note { margin: 0 0 14px; }
.inq-note label { display: block; font-weight: bold; margin-bottom: 6px; }
.inq-note textarea { width: 100%; box-sizing: border-box; font-size: 15px; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; resize: vertical; font-family: inherit; }
.inq-note-bar { display: flex; align-items: center; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.inq-note-bar .hint { flex: 1; }
.inq-note-state { color: #c0392b; font-size: 13px; }

/* 12/4 到貨登錄 */
.al-card .section-label small { font-weight: normal; color: #7f8c8d; margin-left: 8px; font-size: 13px; }
.al-now { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; }
.al-by { color: #7f8c8d; font-size: 14px; }
.al-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.al-form input[type=date] { font-size: 15px; padding: 6px 8px; margin-left: 6px; }
