/* ================= THỜI TIẾT, ĐƠN ĐẶT HÀNG, ĐẶC SẢN, THANH KHU PHỐ ================= */

/* Thanh khu phố gọn cho 6 khu */
.district-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.district-bar::-webkit-scrollbar { display: none; }
.dist-btn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; padding: 5px 11px 5px 11px; }
.dist-btn .db-icon { font-size: 13px; }
.dist-btn small { font-size: 10px; font-weight: 800; opacity: .85; margin-left: 2px; }

/* Cụm tiện ích trên phố (trên nút Trò chuyện) */
.street-widgets {
  position: absolute; left: 12px; bottom: 62px; z-index: 3;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  line-height: normal;
}
.sw-btn {
  position: relative;
  display: flex; align-items: center; gap: 7px;
  min-width: 150px;
  padding: 5px 12px 5px 6px;
  font-family: inherit; text-align: left; cursor: pointer;
  background: rgba(255, 253, 246, 0.95);
  border: 2.5px solid var(--outline); border-radius: 14px;
  box-shadow: 0 3px 0 var(--outline), 0 6px 14px rgba(0,0,0,.18);
  transition: transform .12s;
}
.sw-btn:hover { transform: translateY(-2px); }
.sw-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; border-radius: 10px; background: #fff3bf; border: 2px solid var(--outline);
}
.sw-text { display: flex; flex-direction: column; }
.sw-text b { font-size: 13px; font-weight: 900; }
.sw-text small { font-size: 11px; color: var(--muted); font-weight: 700; }
.sw-weather.w-mua_rao .sw-icon { background: #d0ebff; }
.sw-weather.w-nang_nong .sw-icon { background: #ffd8a8; }
.sw-weather.w-gio_mat .sw-icon { background: #d3f9d8; }
.sw-weather.w-ngay_hoi .sw-icon { background: #ffdeeb; }
.sw-orders .sw-icon { background: #e7f5ff; }
.sw-orders.has-ready { border-color: #2b8a3e; animation: ready-glow 1.4s ease-in-out infinite; }
.sw-orders.has-ready .sw-text small { color: #2b8a3e; }
.sw-badge {
  position: absolute; top: -8px; right: -8px;
  min-width: 20px; height: 20px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #fff;
  background: var(--danger); border: 2px solid #fff; border-radius: 99px;
}

/* Nhãn trong Chợ Đầu Mối */
.tag-spec, .tag-hot, .tag-cold {
  display: inline-block; font-size: 10px; font-weight: 900; border-radius: 6px; padding: 1px 6px; vertical-align: 2px; white-space: nowrap;
}
.tag-spec { color: #7a5500; background: #fff3bf; border: 1.5px solid #fab005; }
.tag-hot { color: #a61e4d; background: #ffe3e3; border: 1.5px solid #ff8787; }
.tag-cold { color: #1864ab; background: #e7f5ff; border: 1.5px solid #74c0fc; }

/* Bảng đơn đặt hàng */
.order-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.order-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px;
  background: #fff; border: 2.5px solid var(--outline); border-radius: 16px;
  box-shadow: 0 3px 0 var(--outline);
}
.order-card.ready { background: #ebfbee; border-color: #2b8a3e; box-shadow: 0 3px 0 #2b8a3e; }
.od-client { display: flex; align-items: center; gap: 9px; }
.od-client > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.od-client b { font-size: 14.5px; }
.od-client small { color: var(--muted); font-size: 12px; font-style: italic; }
.od-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: #fff9db; border: 2px solid var(--outline); border-radius: 12px; }
.od-time { font-size: 12px; font-weight: 900; background: #f1f3f5; border-radius: 99px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.od-time.urgent { background: #ffe3e3; color: #c92a2a; }
.od-items { display: flex; flex-direction: column; gap: 4px; }
.od-item { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 9px; font-size: 13px; font-weight: 700; }
.od-item.ok { background: #d3f9d8; }
.od-item.lack { background: #fff4e6; }
.odi-icon { font-size: 18px; }
.odi-qty { font-weight: 900; font-variant-numeric: tabular-nums; }
.od-item.lack .odi-qty { color: #d9480f; }
.od-item.ok .odi-qty { color: #2b8a3e; }
.od-reward { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; }
.od-actions { display: flex; gap: 6px; }
.od-actions .btn:first-child { flex: 1; }
.od-next { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 0; }

/* Thời tiết */
.weather-now {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; margin-bottom: 8px;
  border: 2.5px solid var(--outline); border-radius: 16px; box-shadow: 0 3px 0 var(--outline);
  background: linear-gradient(90deg, #fff9db, #fff);
}
.weather-now.w-mua_rao { background: linear-gradient(90deg, #d0ebff, #fff); }
.weather-now.w-nang_nong { background: linear-gradient(90deg, #ffd8a8, #fff); }
.weather-now.w-gio_mat { background: linear-gradient(90deg, #d3f9d8, #fff); }
.weather-now.w-ngay_hoi { background: linear-gradient(90deg, #ffdeeb, #fff); }
.wn-icon { font-size: 46px; }
.wn-name { font-size: 20px; font-weight: 900; }
.wn-desc { font-size: 13px; color: #495057; margin: 2px 0; }
.wn-time { font-size: 12.5px; }
.wf-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.wf { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: #f1f3f5; border: 1.5px solid #dee2e6; }
.wf.up { background: #ebfbee; border-color: #69db7c; color: #2b8a3e; }
.wf.down { background: #fff5f5; border-color: #ffa8a8; color: #c92a2a; }

@media (max-width: 760px) {
  .street-widgets { bottom: 58px; }
  .sw-btn { min-width: 0; padding-right: 8px; }
  .sw-text small { display: none; }
  .order-list { grid-template-columns: 1fr; }
}

/* ===== VỆ SINH PHỐ & CÚN CƯNG ===== */
.sw-clean.is-clean { background: linear-gradient(180deg, #d3f9d8, #b2f2bb); }
.sw-clean.is-dirty { background: linear-gradient(180deg, #fff4e6, #ffd8a8); }
.sw-badge.dog { background: #f08c00; animation: badge-pulse .8s ease-in-out infinite; }
.dg-head { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 2.5px solid var(--outline); border-radius: 14px; background: #fff; margin-bottom: 10px; }
.dg-head.clean { background: linear-gradient(90deg, #d3f9d8, #fff); }
.dg-head.dirty { background: linear-gradient(90deg, #fff4e6, #fff); }
.dg-score { width: 74px; height: 74px; flex: none; border-radius: 50%; border: 3px solid var(--outline); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dg-score b { font-size: 22px; font-weight: 900; }
.dg-score small { font-size: 10.5px; color: #868e96; }
.dg-head.clean .dg-score { border-color: #2f9e44; color: #2b8a3e; }
.dg-head.dirty .dg-score { border-color: #e8590c; color: #d9480f; }
.dg-status { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dg-status small { color: #666; }
.dg-head.clean .pm-bar i { background: linear-gradient(90deg, #40c057, #2b8a3e); }
.dg-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.dg-stats > div { text-align: center; padding: 8px; border: 2px solid #dee2e6; border-radius: 12px; background: #fff; display: flex; flex-direction: column; }
.dg-stats span { font-size: 22px; }
.dg-stats b { font-size: 18px; font-weight: 900; }
.dg-stats small { font-size: 11px; color: #868e96; }
.dg-pet { display: flex; align-items: center; gap: 12px; padding: 12px; border: 2.5px solid var(--outline); border-radius: 14px; background: #fff; flex-wrap: wrap; }
.dg-pet.fed { background: linear-gradient(90deg, #fff9db, #fff); }
.dg-pet.hungry { background: linear-gradient(90deg, #fff0f6, #fff); }
.dg-pet-icon { position: relative; width: 64px; height: 64px; flex: none; border-radius: 16px; border: 2px solid var(--outline); background: #fff3bf; display: flex; align-items: center; justify-content: center; font-size: 38px; }
.dg-pet.fed .dg-pet-icon { animation: dg-wag 0.5s ease-in-out infinite alternate; }
.dg-pet.locked .dg-pet-icon { filter: grayscale(.8); }
.dg-pet-icon span { position: absolute; right: -8px; top: -10px; font-size: 20px; }
@keyframes dg-wag { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
.dg-pet-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 4px; }
.dg-pet-info small { color: #666; font-size: 12px; }
.dg-rules { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.6; color: #495057; }
.exp-cap { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; padding: 8px 12px; margin: 8px 0; border: 2px solid #dee2e6; border-radius: 12px; background: #fff; font-size: 12.5px; }
.exp-cap > span { font-weight: 800; }
.exp-cap > small { grid-column: 1 / -1; color: #868e96; font-size: 11.5px; }
.exp-cap.over { border-color: #ffa94d; background: #fff4e6; }
.exp-cap .pm-bar { margin: 0; }
@media (max-width: 760px) { .dg-stats { grid-template-columns: repeat(3, 1fr); } .dg-pet .btn { width: 100%; } .exp-cap { grid-template-columns: 1fr auto; } .exp-cap .pm-bar { grid-column: 1 / -1; grid-row: 2; } }
@media (prefers-reduced-motion: reduce) { .dg-pet.fed .dg-pet-icon, .sw-badge.dog { animation: none; } }
