/* ============================================================
   GELATOlab 冷鏈溫度追蹤（v509）— atelier brand v.02
   burgundy #641322 · champagne #B8965A · ivory #F7F2E8
   ============================================================ */

.view-cold-chain { max-width: 1100px; margin: 0 auto; padding: 8px 4px 60px; }

.view-cold-chain .cct-loading,
.view-cold-chain .cct-empty {
  padding: 40px 16px; text-align: center; color: #8B7355;
  font-size: 14px; letter-spacing: .02em;
}

/* 輪詢狀態列 */
.cct-pollbar { display: flex; justify-content: flex-end; margin: 0 0 12px; min-height: 18px; }
.cct-poll-status { font-size: 12px; color: #8B7355; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.cct-poll-status.ok { color: #5A6147; }
.cct-poll-status.err { color: #C0695F; }

/* 首次設定引導 */
.cct-setup-hero {
  text-align: center; background: linear-gradient(180deg, #FBF8F1, #F5EEE0);
  border: 1px solid rgba(184,150,90,.4); border-radius: 8px;
  padding: 28px 22px; margin: 0 0 22px;
}
.cct-setup-hero-icon { font-size: 40px; margin-bottom: 8px; }
.cct-setup-hero h3 { margin: 0 0 8px; font-size: 20px; color: #641322; font-weight: 600; }
.cct-setup-hero p { margin: 4px auto; max-width: 620px; font-size: 14px; color: #5B4B3A; line-height: 1.6; }
.cct-setup-hint { font-size: 12px !important; color: #8B7355 !important; }

/* 感測器卡片 */
.cct-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 0 0 24px; }
.cct-card {
  background: #fff; border: 1px solid rgba(184,150,90,.35); border-radius: 6px;
  padding: 14px 14px 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.cct-card:hover { border-color: #B8965A; box-shadow: 0 2px 10px rgba(100,19,34,.06); transform: translateY(-1px); }
.cct-card.selected { border-color: #641322; box-shadow: 0 0 0 1px #641322 inset; }
.cct-card.alert { border-color: #C0695F; background: #FDF4F2; }
.cct-card-name { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #641322; font-weight: 600; }
.cct-card-temp { font-size: 32px; font-weight: 300; color: #2B2118; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.cct-card-temp .cct-unit { font-size: 15px; color: #8B7355; margin-left: 2px; }
.cct-card-sub { font-size: 11px; color: #8B7355; line-height: 1.5; min-height: 30px; }
.cct-card-range { margin-top: 8px; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: #A6764B; }

/* 圖表 */
.cct-chart-section { background: #fff; border: 1px solid rgba(184,150,90,.3); border-radius: 8px; padding: 18px; margin: 0 0 24px; }
.cct-chart-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.cct-chart-title { margin: 0; font-size: 17px; color: #641322; font-weight: 500; }
.cct-chart-title em { color: #8B7355; font-style: italic; font-weight: 400; }
.cct-range-btns { display: inline-flex; gap: 4px; }
.cct-range-btns button {
  border: 1px solid rgba(184,150,90,.5); background: #fff; color: #8B7355;
  font-size: 11px; padding: 4px 10px; border-radius: 4px; cursor: pointer; letter-spacing: .04em;
}
.cct-range-btns button.active { background: #641322; color: #F7F2E8; border-color: #641322; }
.cct-chart-wrap { position: relative; height: 300px; }
.cct-report-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(184,150,90,.2); }
.cct-meta { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: #A6764B; }
.cct-report-row select, .cct-report-row input { border: 1px solid rgba(184,150,90,.5); border-radius: 4px; padding: 5px 8px; font-size: 13px; color: #2B2118; background: #fff; }

/* 設定區 */
.cct-settings { display: flex; flex-direction: column; gap: 12px; }
.cct-details { border: 1px solid rgba(184,150,90,.32); border-radius: 8px; background: #fff; overflow: hidden; }
.cct-details > summary {
  cursor: pointer; padding: 14px 18px; font-size: 15px; font-weight: 600; color: #641322;
  list-style: none; user-select: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cct-details > summary::-webkit-details-marker { display: none; }
.cct-details > summary::after { content: '＋'; margin-left: auto; color: #B8965A; font-weight: 400; }
.cct-details[open] > summary::after { content: '−'; }
.cct-details-body { padding: 4px 18px 18px; border-top: 1px solid rgba(184,150,90,.18); }
.cct-badge { font-size: 10px; padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(184,150,90,.5); color: #8B7355; letter-spacing: .03em; }
.cct-badge.ok { background: #EDF1E6; border-color: #5A6147; color: #3F4732; }

.cct-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.cct-row > label { flex: 0 0 120px; font-size: 12px; color: #5B4B3A; }
.cct-row input[type="text"], .cct-row input[type="password"], .cct-row input[type="number"], .cct-row input[type="time"], .cct-row select {
  flex: 1; min-width: 0; border: 1px solid rgba(184,150,90,.5); border-radius: 4px; padding: 6px 9px; font-size: 13px; color: #2B2118; background: #fff;
}
.cct-global-row { padding-top: 6px; }
.cct-sensor-settings { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.cct-sensor-setting { border: 1px solid rgba(184,150,90,.25); border-radius: 6px; padding: 10px 12px; background: #FBF8F1; }
.cct-sensor-mac { font-size: 11px; color: #A6764B; font-family: 'IBM Plex Mono', ui-monospace, monospace; margin-bottom: 4px; }

.cct-hint { font-size: 12px; color: #8B7355; line-height: 1.6; margin: 6px 0; }
.cct-hint a { color: #641322; text-decoration: underline; }
.cct-field-label { display: block; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #A6764B; margin: 8px 0 4px; }
.cct-hairline { height: 1px; background: rgba(184,150,90,.28); margin: 14px 0; }
.cct-msg { font-size: 12px; margin: 8px 0 0; min-height: 16px; }
.cct-msg.ok { color: #5A6147; }
.cct-msg.err { color: #C0695F; }

.cct-copy-row { display: flex; gap: 6px; }
.cct-copy-row input { flex: 1; min-width: 0; border: 1px solid rgba(184,150,90,.5); border-radius: 4px; padding: 6px 9px; font-size: 12px; color: #2B2118; background: #FBF8F1; font-family: 'IBM Plex Mono', ui-monospace, monospace; }

.cct-targets { margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.cct-target-row { font-size: 12px; color: #3F4732; }
.cct-targets-empty { font-style: italic; }

.cct-shares { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.cct-share-row { border: 1px solid rgba(184,150,90,.3); border-radius: 6px; padding: 10px 12px; background: #FBF8F1; }
.cct-share-name { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #641322; font-weight: 600; }
.cct-share-count { font-size: 10px; color: #A6764B; letter-spacing: .04em; }
.cct-share-pick { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.cct-share-pick label { font-size: 12px; color: #5B4B3A; display: inline-flex; align-items: center; gap: 4px; }

/* 按鈕 */
.cct-btn { border: 1px solid transparent; border-radius: 4px; padding: 8px 16px; font-size: 13px; cursor: pointer; letter-spacing: .02em; transition: opacity .15s, background .15s; margin-top: 6px; }
.cct-btn:disabled { opacity: .55; cursor: default; }
.cct-btn-sm { padding: 5px 12px; font-size: 12px; }
.cct-btn-ink { background: #641322; color: #F7F2E8; }
.cct-btn-ink:hover:not(:disabled) { background: #4E0E1A; }
.cct-btn-gold { background: #fff; color: #641322; border-color: #B8965A; }
.cct-btn-gold:hover:not(:disabled) { background: #641322; color: #F7F2E8; }
.cct-btn-ghost { background: #fff; color: #8B7355; border-color: rgba(184,150,90,.5); }
.cct-btn-ghost:hover:not(:disabled) { background: #FBF8F1; color: #641322; }

@media (max-width: 640px) {
  .cct-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .cct-row { flex-wrap: wrap; }
  .cct-row > label { flex: 0 0 100%; }
  .cct-chart-wrap { height: 240px; }
}
