/* serve-board.css — 传菜 / 上菜看板（服务员专用）v20261107e
 * 复用 kitchen.css 的深色主题与工单卡片样式（.kds-page / .kds-ticket-card / .kds-action-btn / .kds-status-*）。
 * 本文件只补充「按状态分组」的布局与少量传菜专属元素（桌号高亮 / 已送达标签 / 叫起统计卡）。
 */

/* 顶部统计：补「已叫起」卡（kitchen.css 只有 pending/cooking/ready/total 四色） */
.kds-stat-card.recalled { border-left-color: #9b59b6; }
.kds-stat-card.recalled .kds-stat-num { color: #9b59b6; }

/* 分组滚动区（对应 kitchen.css 的 .kds-ticket-area） */
.serve-groups {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 单个状态分组 */
.serve-group {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 12px 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.serve-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}
.serve-group-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.dot-cooking  { background: #f39c12; }
.dot-ready    { background: #27ae60; }
.dot-recalled { background: #9b59b6; }
.dot-served   { background: #7f8c8d; }

.serve-group-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.serve-group-count {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 1px 10px;
  border-radius: 10px;
}
.serve-group-hint {
  font-size: 13px;
  color: #9aa4b2;
  margin-left: auto;
}

/* 「待上菜」分组高亮 —— 这是服务员的核心操作区，给一层淡淡的绿色描边提示 */
.serve-group-ready {
  border-color: rgba(39, 174, 96, 0.45);
  box-shadow: inset 0 0 0 1px rgba(39, 174, 96, 0.15);
}

.serve-group-empty {
  padding: 18px;
  text-align: center;
  color: #6b7684;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}

/* 传菜关键信息：桌号高亮（服务员一眼看到送哪桌） */
.kds-meta-table {
  background: rgba(52, 152, 219, 0.25) !important;
  border: 1px solid rgba(52, 152, 219, 0.6);
  font-weight: 700;
  color: #cfe8ff !important;
}

/* 已上菜的确认标签（无操作按钮时显示） */
.serve-done-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  background: rgba(127, 140, 141, 0.2);
  color: #b9c2c8;
  font-size: 14px;
  font-weight: 600;
}

/* ============ v20261107e：同菜同桌「重复上菜」预警 ============
 * 深色看板语境：待上菜卡片若本桌已上过同菜，整卡红色描边 + 菜品行红字标注；
 * 弹窗语境：.dup-warn-* 系列跑在浅色 modal 里，必须用深字浅底才可读。
 */
.kds-ticket-card.dup-warn {
  border-color: rgba(231, 76, 60, 0.85) !important;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.22), 0 0 18px rgba(231, 76, 60, 0.16);
  animation: dupPulse 2.2s ease-in-out infinite;
}
@keyframes dupPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.22), 0 0 18px rgba(231, 76, 60, 0.16); }
  50%      { box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.45), 0 0 26px rgba(231, 76, 60, 0.30); }
}
@media (prefers-reduced-motion: reduce) {
  .kds-ticket-card.dup-warn { animation: none; }
}

.kds-dup-badge {
  display: inline-block;
  background: rgba(231, 76, 60, 0.18);
  color: #ff8a80;
  border: 1px solid rgba(231, 76, 60, 0.7);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.kds-item.kds-item-warn {
  background: rgba(231, 76, 60, 0.12);
  border-radius: 6px;
  padding-left: 6px;
  padding-right: 6px;
}
.kds-item-dup {
  margin-left: auto;
  white-space: nowrap;
  color: #ff8a80;
  font-size: 12px;
  font-weight: 700;
  background: rgba(231, 76, 60, 0.16);
  border: 1px solid rgba(231, 76, 60, 0.55);
  border-radius: 5px;
  padding: 1px 6px;
}

/* —— 弹窗内（浅色主题，必须深字浅底） —— */
.dup-warn-box {
  background: #fff7f5;
  border: 1px solid #ffccc7;
  border-radius: 10px;
  padding: 14px 16px;
}
.dup-warn-head { display: flex; align-items: flex-start; gap: 10px; }
.dup-warn-icon { font-size: 26px; line-height: 1.1; flex: 0 0 auto; }
.dup-warn-title { font-size: 15px; font-weight: 700; color: #cf1322; line-height: 1.4; }
.dup-warn-sub { margin-top: 4px; font-size: 13px; color: #595959; }
.dup-warn-sub b { color: #cf1322; }

.dup-warn-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 10px;
  font-size: 13px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.dup-warn-table th {
  background: #fff1f0;
  color: #a8071a;
  text-align: left;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid #ffccc7;
  white-space: nowrap;
}
.dup-warn-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #ffe7e6;
  color: #262626;
  vertical-align: top;
}
.dup-warn-table tr:last-child td { border-bottom: none; }
.dup-td-dish { font-weight: 600; }
.dup-td-qty { color: #cf1322; font-weight: 700; white-space: nowrap; }
.dup-td-served { color: #cf1322; font-weight: 700; white-space: nowrap; }
.dup-td-when { white-space: nowrap; color: #595959; }
.dup-td-sub { display: block; font-size: 11px; color: #8c8c8c; margin-top: 2px; }

.dup-warn-ack {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fff1f0;
  border: 1px solid #ffccc7;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #a8071a;
  cursor: pointer;
  line-height: 1.5;
}
.dup-warn-ack input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #cf1322;
  cursor: pointer;
}
.dup-warn-tip {
  margin-top: 10px;
  font-size: 12px;
  color: #8c8c8c;
  line-height: 1.6;
}

/* ★ v20261108a：历史工单分组（非本日）—— 整组降透明度灰显，与「本日」区隔 */
.serve-group-history { opacity: .82; }
.serve-group-history .kds-ticket-card {
  opacity: .68;
  border-style: dashed;
  filter: saturate(.45);
}
.serve-group-history .kds-ticket-card .kds-order-no { color: #9e9e9e; }
.serve-group-history .serve-group-hint { color: #8c8c8c; }

/* 小屏（手机/PAD 竖屏）优化 */
@media (max-width: 768px) {
  .serve-groups { padding: 12px; gap: 14px; }
  .serve-group-hint { display: none; }
  .kds-ticket-grid { grid-template-columns: 1fr; }
}
