/* pages.css - 各页面专属样式：仪表盘、配镜订单、定片编辑弹窗、回访管理 */

/* ===== 仪表盘 ===== */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.dash-card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 16px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.dash-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-card-name { font-size: 14px; font-weight: bold; color: var(--text); }
.dash-card-count { font-size: 12px; color: #999; }

.dash-card-amount {
  font-size: 26px; font-weight: bold; color: var(--primary);
  margin: 8px 0 4px;
}

.dash-card-detail { font-size: 11px; color: #999; }

.dash-loading { grid-column: 1 / -1; color: var(--muted); padding: 40px; text-align: center; }

.dash-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  margin-top: 12px;
  padding: 16px 20px;
}

.dash-total-num { font-size: 22px; font-weight: bold; color: var(--success); }
.dash-total-detail { font-size: 13px; color: #666; }

.dash-time { color: #999; font-size: 12px; margin-top: 8px; text-align: right; }

/* ===== 配镜订单 ===== */
#page-peijing .table-wrap { overflow-x: visible; }
#page-peijing .data-table td { white-space: normal; }
/* 配镜订单表：所有列数据居中 */
#page-peijing .data-table th,
#page-peijing .data-table td { text-align: center; }

/* ===== 定片编辑弹窗 ===== */
.pe-edit-wrap { display: flex; gap: 16px; }
.pe-edit-left { width: 380px; flex-shrink: 0; }
.pe-info { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: #334155; margin-bottom: 4px; }
.pe-label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
#pe-edit-product, #pe-edit-remark-input {
  width: 100%; border: 1px solid #c0c0c0; padding: 6px 8px;
  font-size: 13px; font-family: inherit; box-sizing: border-box;
}
#pe-edit-product:focus, #pe-edit-remark-input:focus { border-color: var(--primary); outline: none; }
.pe-eye-table { width: 100%; border-collapse: collapse; margin: 4px 0 6px; }
.pe-eye-table th { background: #e8ecf1; border: 1px solid #d0d0d0; padding: 4px 6px; font-size: 12px; text-align: center; color: #333; }
.pe-eye-table td { border: 1px solid #e0e0e0; padding: 3px 4px; text-align: center; font-size: 12px; color: #666; }
.pe-eye-table td:first-child { white-space: nowrap; background: #f8f9fc; }
.pe-eye-table input {
  width: 100%; border: 1px solid #c0c0c0; padding: 3px 4px; font-size: 13px;
  font-family: inherit; text-align: center; box-sizing: border-box; min-height: 26px;
}
.pe-eye-table input:focus { border-color: var(--primary); outline: none; }
.pe-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* 处理中按钮：明显变灰（覆盖 .btn:disabled 的浅灰背景） */
.pe-btn-processing,
.pe-btn-processing:disabled {
  background: #9e9e9e !important;
  color: #fff !important;
  border-color: #9e9e9e !important;
  cursor: not-allowed;
}
.pe-edit-right { flex: 1; min-width: 0; }
.pe-edit-preview {
  background: #f1f5f9; border: 1px solid #e2e8f0;
  max-height: 72vh; overflow: auto; padding: 12px; box-sizing: border-box;
}
.pe-edit-preview svg { width: 100%; height: auto; background: #fff; display: block; }

/* ===== 回访管理（对齐 PyQt5 客户端） ===== */
.check-inline {
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap; font-size: 13px; color: var(--text); cursor: pointer;
}
.check-inline input[type="checkbox"] { cursor: pointer; }
#hf-date-filter { display: inline-flex; align-items: center; gap: 8px; }
/* 阶段筛选勾选栏（数据到位后动态生成） */
.hf-stage-filter {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 8px 12px; margin-bottom: 8px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px;
}
.td-clip { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-row { cursor: pointer; }
/* 紧急行（剩余<20天且待回访）：剩余日期+状态两列红底红字，对齐客户端 */
.hf-urgent-cell { background: #fce4e4 !important; color: #d9534f; font-weight: 600; }
.hf-urgent-cell .tag { background: #fde8e8; color: #d9534f; }
/* 弹窗内提示/展开行 */
.hf-hint { padding: 6px; text-align: center; color: #888; font-size: 12px; }
.hf-expand-title { font-weight: 600; font-size: 12px; margin: 6px 0 2px; color: #555; }
.hf-expand-line { font-size: 12px; color: #444; padding: 1px 4px; }
.hf-co-detail > td { background: #f7f9fb; }
.hf-co-row { cursor: pointer; }
/* 添加复查单弹窗验光输入 */
.eye-input {
  width: 100%; border: 1px solid #c0c0c0; padding: 3px 6px; font-size: 13px;
  font-family: inherit; text-align: center; box-sizing: border-box; min-height: 26px;
}
.eye-input:focus { border-color: var(--primary); outline: none; }

/* 镜片扫描：电脑端提示 */
.jpsm-mobile-tip {
  padding: 48px 20px; text-align: center; color: #888;
  font-size: 16px; line-height: 1.6;
}

/* 镜片扫码弹窗 */
.camera-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, .85);
  display: flex; align-items: center; justify-content: center;
}
.camera-box {
  width: min(94vw, 420px); background: #000; border-radius: 10px; overflow: hidden;
}
.camera-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; color: #fff; background: #111;
}
#jpsm-camera-video {
  width: 100%; display: block; max-height: 70vh; object-fit: contain; background: #000;
}
.camera-status { color: #ccc; font-size: 13px; text-align: center; padding: 8px; margin: 0; }
.camera-actions { display: flex; justify-content: center; padding: 0 0 12px; }

/* ===== 响应式（页面部分） ===== */
@media (max-width: 900px) {
  .dash-cards { grid-template-columns: 1fr; }
}

/* ===== 短信管理 ===== */
.sms-form { padding: 14px; }
.sms-config-info { margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.sms-form-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; max-width: 520px;
}
.sms-form-row label { width: 90px; color: var(--text); font-size: 13px; flex-shrink: 0; }
.sms-form-row input {
  flex: 1; border: 1px solid #c0c0c0; padding: 6px 8px;
  font-size: 13px; font-family: inherit; min-height: 30px;
}
.sms-form-row input:focus { border-color: var(--primary); outline: none; }
