/* gc-shipping.css - extracted shipping styles from index.html */
/* shipping-css-split-v1: move only CSS; no visual change intended. */
/* 船务跟进 tab */
.ship-page { padding: 20px 28px; max-width: 1280px; margin: 0 auto; }
.ship-title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ship-page-title { font-size: 20px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 6px; }
.ship-role-hint { font-size: 11px; color: var(--ink-mute); background: var(--bg-soft); padding: 3px 8px; border-radius: 10px; }
.ship-report-btn {
  margin-left: auto;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(0, 122, 255, 0.32);
  border-radius: 9px;
  background: #fff;
  color: var(--apple-blue, #007AFF);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.ship-report-btn:hover { background: rgba(0,122,255,0.07); border-color: var(--apple-blue, #007AFF); transform: translateY(-1px); }

/* 顶部 6 段摘要 */
.ship-strip { display: grid; grid-template-columns: repeat(6, 1fr); background: #fff; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03); }
.ship-cell { padding: 12px 14px; border-right: 1px solid var(--line-soft); cursor: pointer; transition: background 0.15s ease; }
.ship-cell:last-child { border-right: none; }
.ship-cell:hover { background: var(--bg-soft); }
.ship-cell.readonly { background: rgba(0, 122, 255, 0.03); }
.ship-cell.writable { background: rgba(0, 122, 255, 0.03); }
.ship-cell.active { background: rgba(0, 122, 255, 0.10); }
.ship-cell .sc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ship-cell .sc-ico { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 11px; flex-shrink: 0; }
.ship-cell.readonly .sc-ico { background: rgba(0, 122, 255, 0.12); }
.ship-cell.writable .sc-ico { background: rgba(0, 122, 255, 0.15); }
.ship-cell .sc-label { font-size: 10.5px; color: var(--ink-mute); font-weight: 600; }
.ship-cell .sc-mode { font-size: 8.5px; padding: 1px 5px; border-radius: 3px; margin-left: auto; font-weight: 700; }
.ship-cell.readonly .sc-mode { background: rgba(0,122,255,0.12); color: #007AFF; }
.ship-cell.writable .sc-mode { background: rgba(0,122,255,0.15); color: var(--apple-blue, #007AFF); }
.ship-cell .sc-num { font-size: 22px; font-weight: 700; line-height: 1; }
.ship-cell.readonly .sc-num { color: #007AFF; }
.ship-cell.writable .sc-num { color: var(--apple-blue, #007AFF); }
.ship-cell .sc-sub { font-size: 10px; color: var(--ink-soft); margin-top: 3px; }

/* sub-tabs */
.ship-subtabs { display: inline-flex; background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 0; box-shadow: 0 1px 2px rgba(0,0,0,0.03); height: 36px; box-sizing: border-box; align-items: center; }
.ship-subtab { padding: 0 14px; border-radius: 7px; font-size: 12px; color: var(--ink-mute); cursor: pointer; font-weight: 500; background: transparent; border: none; font-family: inherit; height: 28px; display: inline-flex; align-items: center; gap: 6px; }
.ship-subtab.active { background: var(--apple-blue, #007AFF); color: #fff; font-weight: 600; }
.ship-subtab .count { background: rgba(0,0,0,0.06); color: var(--ink-mute); font-size: 10px; padding: 1px 5px; border-radius: 5px; font-weight: 600; margin-left: 4px; }
.ship-subtab.active .count { background: rgba(255,255,255,0.22); color: #fff; }

.ship-search-input { background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; padding: 0 12px; font-size: 12.5px; flex: 1; max-width: 280px; font-family: inherit; transition: border-color 0.15s, box-shadow 0.15s; height: 36px; box-sizing: border-box; }
.ship-search-input:focus { outline: none; border-color: var(--apple-blue, #007AFF); box-shadow: 0 0 0 3px rgba(0,122,255,0.12); }
.ship-filter-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-mute);
  font-size: 12px;
}
.ship-filter-main {
  color: var(--ink);
  font-weight: 650;
}
.ship-filter-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  color: var(--ink-mute);
  font-weight: 600;
}
/* 苹果风 active filter chip */
.ship-active-filter-chip {
  background: var(--apple-blue, #007AFF);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 0 8px 0 14px;
  height: 36px;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  transition: background 0.15s;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.25);
}
.ship-active-filter-chip:hover { background: var(--apple-blue-hover, #0051D5); }
.ship-active-filter-chip .afc-x {
  background: rgba(255,255,255,0.22);
  border-radius: 50%;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
}

/* 表格 */
.ship-table-wrap { background: #fff; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03); }
.ship-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ship-table th { background: var(--bg-soft); font-size: 10.5px; font-weight: 700; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.05em; padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.ship-table td { padding: 14px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.ship-table tr:last-child td { border-bottom: none; }
.ship-table tr.s-row { cursor: pointer; transition: background 0.15s ease; }
.ship-table tr.s-row:hover { background: rgba(0, 122, 255, 0.035); }

.ship-row-thumb { width: 36px; height: 36px; border-radius: 5px; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; font-size: 9px; color: var(--ink-soft); overflow: hidden; }
.ship-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ship-row-sku { font-weight: 650; font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; line-height: 1.35; }
.ship-row-meta { font-size: 11.5px; color: var(--ink-mute); margin-top: 4px; line-height: 1.45; }
.ship-row-meta .bl { color: var(--apple-blue, #007AFF); font-family: var(--font-mono, monospace); font-size: 10.5px; }
.gc-shiprpt-sheet .gc-rpt-title h1 { color: #12386b; }
.gc-shiprpt-score-row { grid-template-columns: repeat(5, 1fr); }
.gc-shiprpt-score-row .gc-rpt-score.good .value { color: #0f8b5f; }
.gc-shiprpt-score-row .gc-rpt-score.warn .value { color: #b91c1c; }
.gc-shiprpt-reason { color: #8a4b00; font-weight: 800; }
#gcShippingReportPreview .gc-rpt-shell {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}
#gcShippingReportPreview .gc-rpt-topbar {
  align-items: stretch;
  justify-content: flex-start;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px;
  border-right: 1px solid #d6dbe5;
  border-bottom: 0;
  overflow: auto;
}
#gcShippingReportPreview .gc-rpt-topbar-title strong { font-size: 18px; }
#gcShippingReportPreview .gc-rpt-topbar-title span { margin-top: 6px; line-height: 1.45; }
#gcShippingReportPreview .gc-rpt-controls {
  display: grid;
  gap: 14px;
  align-items: stretch;
  justify-content: stretch;
}
#gcShippingReportPreview .gc-rpt-field-list,
#gcShippingReportPreview .gc-rpt-quick-grid,
#gcShippingReportPreview .gc-rpt-action-grid {
  display: grid;
  gap: 10px;
}
#gcShippingReportPreview .gc-rpt-quick-grid,
#gcShippingReportPreview .gc-rpt-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#gcShippingReportPreview .gc-rpt-field input,
#gcShippingReportPreview .gc-rpt-field select {
  width: 100%;
  min-width: 0;
  height: 38px;
}
#gcShippingReportPreview .gc-rpt-btn {
  width: 100%;
  height: 38px;
}
#gcShippingReportPreview .gc-rpt-stage { padding: 28px 28px 46px; }
@media (max-width: 1180px) {
  .gc-shiprpt-score-row { grid-template-columns: 1fr; }
  #gcShippingReportPreview .gc-rpt-shell { grid-template-columns: 1fr; }
  #gcShippingReportPreview .gc-rpt-topbar {
    border-right: 0;
    border-bottom: 1px solid #d6dbe5;
  }
}
@media print {
  body.gc-shiprpt-printing { margin:0!important; background:#fff!important; }
  body.gc-shiprpt-printing > *:not(#gcShippingReportPreview) { display:none!important; }
  body.gc-shiprpt-printing #gcShippingReportPreview {
    position:static!important;
    inset:auto!important;
    display:block!important;
    background:#fff!important;
    overflow:visible!important;
    z-index:auto!important;
  }
  body.gc-shiprpt-printing #gcShippingReportPreview .gc-rpt-shell { display:block!important; }
  body.gc-shiprpt-printing #gcShippingReportPreview .gc-rpt-topbar { display:none!important; }
  body.gc-shiprpt-printing #gcShippingReportPreview .gc-rpt-stage {
    display:block!important;
    overflow:visible!important;
    min-height:auto!important;
    padding:0!important;
  }
  body.gc-shiprpt-printing #gcShippingReportPreview .gc-rpt-sheet {
    width:auto!important;
    min-height:auto!important;
    margin:0!important;
    padding:16mm 14mm 12mm!important;
    box-shadow:none!important;
    page-break-after:auto;
  }
}
.ship-month-row td { padding: 0 !important; background: #fff !important; border-bottom: 1px solid var(--line-soft); }
.ship-month-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(0,122,255,0.06), rgba(52,199,89,0.05));
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.ship-month-title { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 750; }
.ship-month-arrow { color: var(--apple-blue, #007AFF); font-size: 11px; width: 14px; text-align: center; }
.ship-month-meta { font-size: 11.5px; color: var(--ink-mute); font-weight: 600; }
.ship-group-row td { padding: 0 !important; background: #fff !important; border-bottom: 1px solid var(--line-soft); }
.ship-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px;
  background: #F6F8FB;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.ship-group-row.static .ship-group-head { cursor: default; background: #F8F8FA; }
.ship-group-title { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 750; }
.ship-group-arrow { color: var(--apple-blue, #007AFF); font-size: 11px; width: 14px; text-align: center; }
.ship-group-row.static .ship-group-arrow { color: var(--ink-mute); }
.ship-group-meta { font-size: 11.5px; color: var(--ink-mute); font-weight: 650; }
.ship-done-summary {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px;
  font-size: 11.5px; color: var(--ok-soft); font-weight: 700; line-height: 1.35;
}
.ship-done-summary .qty { font-size: 12.5px; color: #15803d; }
.ship-done-summary .sub { color: var(--ink-mute); font-weight: 500; }
/* ship-row-chip-polish-v1: 船务列表内新单/反单/空运/海运统一小 chip,避免混用全局 badge 尺寸 */
.ship-row-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
  border: 1px solid transparent;
  box-sizing: border-box;
  white-space: nowrap;
}
.ship-row-chip.order-new { background: #EAF7EC; color: #23823A; border-color: #D7EEDD; }
.ship-row-chip.order-repeat { background: var(--warn-bg, #FFF1E0); color: var(--warn, #B25400); border-color: #F2D4B1; }
.ship-row-chip.ship-air { background: #EAF3FB; color: #0C5D96; border-color: #D8E8F6; }
.ship-row-chip.ship-sea { background: #EAF7F0; color: #0F6E56; border-color: #D3ECDF; }

/* 6 格状态条 — shipping-v1-fix: 跟 mockup v2 对齐 */
.ship-stage-bar-wrap { position: relative; padding-bottom: 17px; padding-top: 2px; }
/* ship-phase-split-v1: 3 段(船板)+ 竖线 + 3 段(大货) */
.ship-stage-bar { display: grid; grid-template-columns: repeat(3, 1fr) max-content repeat(3, 1fr); gap: 3px; }
.ship-stage-ps {
  grid-column: 1 / 4;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  min-width: 0;
}
.ship-stage-ps.no-client {
  grid-template-columns: minmax(0, 1fr);
}
.ship-stage-ps .ship-stage-cell {
  min-width: 0;
}
.ship-stage-div { width: 1px; background: var(--line-strong, #d2d2d7); justify-self: center; align-self: stretch; margin: 1px 4px; }
.ship-phase-row { display: grid; grid-template-columns: repeat(3, 1fr) max-content repeat(3, 1fr); gap: 3px; margin-bottom: 4px; }
.ship-phase { font-size: 10px; font-weight: 700; letter-spacing: .03em; border-radius: 5px; padding: 1px 0; text-align: center; white-space: nowrap; }
.ship-phase.ps { grid-column: 1 / 4; background: rgba(0,122,255,0.1); color: var(--apple-blue, #007AFF); }
.ship-phase.bulk { grid-column: 5 / 8; background: rgba(10,107,214,0.1); color: #0a6bd6; }
.ship-stage-cell {
  height: 30px;
  background: var(--line-soft);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ink-soft);
  position: relative;
  padding: 0 4px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  min-width: 0;
}
.ship-stage-cell .ship-sc-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ship-stage-cell .ship-sc-date {
  position: absolute;
  bottom: -16px;
  left: 3px; right: 3px;
  text-align: center;
  font-size: 9.5px;
  color: var(--ink-soft);
  font-family: var(--font-mono, monospace);
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 6px);
}
.ship-stage-cell.done { background: rgba(47, 154, 74, 0.15); color: #2f9a4a; }
.ship-stage-cell.done .ship-sc-date { color: #2f9a4a; opacity: 0.85; }
.ship-stage-cell.current { background: var(--apple-blue, #007AFF); color: #fff; animation: ship-pulse 2s ease-in-out infinite; }
.ship-stage-cell.current.followup-zone { background: #007AFF; }
.ship-stage-cell.current .ship-sc-date { color: #fff; font-weight: 700; }
.ship-stage-cell.blocked { background: rgba(255, 149, 0, 0.18); color: #8B4500; font-weight: 600; }
@keyframes ship-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.35); }
  50% { box-shadow: 0 0 0 4px rgba(0, 122, 255, 0); }
}

.ship-action-btn {
  background: var(--apple-blue, #007AFF);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 12.5px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.20);
}
.ship-action-btn:hover { background: var(--apple-blue-hover, #0051D5); box-shadow: 0 4px 10px rgba(0, 122, 255, 0.28); }
.ship-action-btn:active { transform: translateY(1px); }
.ship-action-btn.green { background: var(--ok-soft); }
.ship-action-btn.green:hover { background: #258a3e; }
.ship-action-btn.secondary {
  background: #fff;
  color: var(--ink-mute);
  border: 1px solid var(--line);
  box-shadow: none;
}
.ship-action-btn.secondary:hover {
  background: var(--bg-soft);
  color: var(--ink);
  box-shadow: none;
}
.ship-action-btn.disabled { background: var(--bg-soft); color: var(--ink-soft); cursor: not-allowed; }

.ship-qc-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.form-field label.ship-qc-option,
.ship-qc-option {
  position: relative;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-soft);
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
  padding: 0 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.ship-qc-option:hover {
  border-color: #007AFF;
  background: #F7FBFF;
}
.form-field .ship-qc-option input[type="radio"],
.ship-qc-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  opacity: 0 !important;
  cursor: pointer;
}
.ship-qc-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--bg-soft);
  color: var(--ink-mute);
  display: inline-grid;
  align-items: center;
  justify-content: center;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}
.ship-qc-option.selected {
  border-color: #007AFF;
  background: #EAF2FF;
  color: #0057D8;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.10);
}
.ship-qc-option.selected .ship-qc-mark {
  background: #007AFF;
  color: #fff;
}
.ship-qc-option[data-result="failed"].selected {
  border-color: #FF3B30;
  background: #FFF2F2;
  color: #B42318;
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.10);
}
.ship-qc-option[data-result="failed"].selected .ship-qc-mark {
  background: #FF3B30;
  color: #fff;
}
.ship-qc-option[data-result="returned"].selected {
  border-color: #FF9500;
  background: #FFF7E8;
  color: #9A4B00;
  box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.12);
}
.ship-qc-option[data-result="returned"].selected .ship-qc-mark {
  background: #FF9500;
  color: #fff;
}

.ship-ref-box {
  border: 1px solid #B8D2FF;
  background: #F2F7FF;
  color: #174EA6;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 12.5px;
  line-height: 1.45;
}
.ship-ref-box b {
  color: var(--ink);
  font-weight: 760;
}
.ship-ref-title {
  color: #174EA6;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}
.ship-ref-lock {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  margin: 2px 0 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(0, 122, 255, 0.22);
}
.ship-ref-lock span {
  color: #174EA6;
  font-weight: 700;
}
.ship-ref-lock b {
  font-size: 18px;
  line-height: 1;
}
.ship-ref-formula {
  color: #5f6f95;
  font-size: 11.5px;
  margin-bottom: 6px;
}
.ship-ref-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 0;
  border-top: 1px solid rgba(23, 78, 166, 0.12);
}
.ship-ref-row:first-of-type { border-top: 0; }
.ship-ref-row span { color: #5f6f95; }
.ship-ref-empty {
  color: #6b6b70;
  background: #FAFAFC;
  border-color: var(--line, #E5E5EA);
}

.ship-empty { padding: 40px 20px; text-align: center; color: var(--ink-mute); }
.ship-empty h3 { color: var(--ink); margin: 0 0 6px; font-size: 15px; }

/* BL number 弹窗 */
.bl-dialog-input { width: 100%; padding: 9px 12px; font-size: 14px; border: 1.5px solid var(--line); border-radius: 8px; font-family: var(--font-mono, monospace); margin-top: 8px; }
.bl-dialog-input:focus { outline: none; border-color: var(--apple-blue, #007AFF); box-shadow: 0 0 0 3px rgba(0,122,255,0.12); }
