/* 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; }
.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; }
.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; }

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