/* ================================================================
   报价工具 P0 专用样式（通用按钮/弹窗/表格沿用 admin.css）
================================================================ */

/* 侧边栏标题 */
#quote-sidebar .ad-side-title { background: transparent; }

/* 审批状态徽章 */
.q-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.qb-draft   { background: #f1f5f9; color: #475569; }
.qb-pending { background: var(--amber-l); color: var(--amber); }
.qb-passed  { background: var(--green-l); color: var(--green); }
.qb-reject  { background: var(--red-l); color: var(--red); }

/* 页面头部操作行 */
.q-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.q-toolbar h3 { font-size: 16px; }
.q-toolbar .tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.q-filter-select {
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13px; background: #fff; min-width: 110px; cursor: pointer;
}
.q-filter-select:focus { outline: none; border-color: var(--primary); }

/* 报价单列表行 */
.q-itin-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 17px; margin-bottom: 12px;
  display: flex; justify-content: space-between; gap: 14px; align-items: center;
}
.q-itin-card .qi-main { flex: 1; min-width: 0; }
.q-itin-card .qi-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.q-itin-card .qi-meta { color: var(--sub); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.q-itin-card .qi-side { text-align: right; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* 编辑器 */
.qe-head {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px;
}
.qe-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.qe-grid .af-field { margin: 0; }
.qe-grid label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 5px; }
.qe-grid input, .qe-grid select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 13px; background: #fff;
}
.qe-grid .full { grid-column: span 2; }

/* 行程天 */
.qe-day {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 14px; overflow: hidden;
}
.qe-day-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: #f8fafc; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.qe-day-head .day-no {
  width: 30px; height: 30px; border-radius: 9px; background: var(--blue);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.qe-day-head input {
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
}
.qe-day-head .day-title { flex: 1; min-width: 130px; }
.qe-day-body { padding: 8px 16px 14px; }

/* 条目行 */
.qe-item {
  display: grid; grid-template-columns: 2fr 80px 70px 100px 100px 38px;
  gap: 8px; align-items: center; padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.qe-item:last-child { border-bottom: none; }
.qe-item input {
  width: 100%; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 12px;
}
.qe-item .qi-name { font-size: 13px; font-weight: 600; min-width: 0; }
.qe-item .qi-name small { display: block; color: var(--faint); font-weight: 400; font-size: 11px; }
.qe-item .qi-subtotal { font-size: 13px; font-weight: 700; text-align: right; }
.qe-item .qi-del {
  width: 32px; height: 30px; padding: 0; justify-self: center;
  border: 1px solid var(--line); border-radius: 8px; background: #f8fafc;
  font-size: 14px; cursor: pointer; color: var(--faint); line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.qe-item .qi-del:hover { color: var(--red); border-color: var(--red); background: var(--red-l); }
.qe-item.lodging { background: linear-gradient(90deg, rgba(147,51,234,.05), transparent); }
.qe-item.lodging .qi-name::before { content: '🏨 '; }

.qe-add-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 添加条目弹层 */
.q-picker .qp-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.q-picker .qp-tab {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; cursor: pointer;
}
.q-picker .qp-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.q-picker .qp-filter { display: flex; gap: 8px; margin-bottom: 12px; }
.q-picker .qp-filter select, .q-picker .qp-filter input {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px;
}
.q-picker .qp-list { max-height: 340px; overflow-y: auto; }
.q-picker .qp-opt {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 8px; cursor: pointer; gap: 10px;
}
.q-picker .qp-opt:hover { border-color: var(--blue); background: var(--blue-l); }
.q-picker .qp-opt b { font-size: 13px; }
.q-picker .qp-opt small { color: var(--sub); font-size: 12px; }
.q-picker .qp-opt .qp-price { font-weight: 700; color: var(--blue); white-space: nowrap; }

/* 算价面板 */
.qe-pricing {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin-top: 14px;
}
.qe-pricing h4 { font-size: 14px; margin-bottom: 12px; }
.qp-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.qp-form .af-field { margin: 0; }
.qp-form label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 5px; }
.qp-form input, .qp-form select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 13px; background: #fff;
}
.qp-result {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.qp-kpi .l { font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.qp-kpi .n { font-size: 18px; font-weight: 800; }
.qp-kpi .n.red { color: var(--red); }
.qp-kpi .n.green { color: var(--green); }

/* 审批轨迹 */
.qe-approval {
  background: #f8fafc; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-top: 14px;
}
.qe-approval h4 { font-size: 13px; margin-bottom: 10px; }
.qa-log { font-size: 12px; color: var(--sub); padding: 5px 0; display: flex; gap: 8px; }
.qa-log b { color: var(--ink); font-weight: 600; }

/* 底部操作 */
.qe-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* 价格日历子表（5 元素：开始/结束/金额/季节/删除） */
.q-price-row {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 96px minmax(104px,0.9fr) 40px;
  gap: 8px; align-items: center; margin-bottom: 8px;
}
.q-price-row input, .q-price-row select {
  width: 100%; min-width: 0; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 12px;
}

/* 模块明细行（3 元素：资源/数量/删除） */
.q-module-row {
  display: grid; grid-template-columns: minmax(0,1fr) 110px 40px;
  gap: 8px; align-items: center; margin-bottom: 8px;
}
.q-module-row input, .q-module-row select {
  width: 100%; min-width: 0; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 12px;
}

/* 删除按钮统一：固定列宽、居中、不溢出 */
.q-price-row .p-del,
.q-module-row .p-del {
  width: 36px; height: 32px; padding: 0; justify-self: center;
  border: 1px solid var(--line); border-radius: 8px; background: #f8fafc;
  cursor: pointer; color: var(--faint); font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.q-price-row .p-del:hover,
.q-module-row .p-del:hover { color: var(--red); border-color: var(--red); background: var(--red-l); }

/* 响应式 */
@media (max-width: 1000px) {
  .qe-grid { grid-template-columns: repeat(2, 1fr); }
  .qp-form, .qp-result { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .q-itin-card { flex-direction: column; align-items: stretch; }
  .q-itin-card .qi-side { flex-direction: row; align-items: center; justify-content: space-between; }
  .qe-item { grid-template-columns: 1.4fr 56px 64px 32px; }
  .qe-item .qi-unit, .qe-item .qi-subtotal { display: none; }
  .q-price-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 36px; }
  .q-price-row .pr-season, .q-price-row .pr-amount { display: none; }
  .q-module-row { grid-template-columns: minmax(0,1fr) 36px; }
  .q-module-row input[type=number] { display: none; }
}

/* 列表行内删除按钮：危险操作 hover 变红 */
.q-del-btn { color: #8a94a6; }
.q-del-btn:hover { color: #e5484d; border-color: rgba(229,72,77,.4); background: rgba(229,72,77,.06); }
