/*
 * Phiên bản tương tác V2
 * Chuẩn thẩm mỹ: bản đồ làng nông dân số giàu chi tiết, giao diện bao quanh,
 * tông giấy ngà – xanh đậm – vàng đồng, ưu tiên màn hình ngang.
 */
:root {
  --v2-forest: #183f2a;
  --v2-forest-deep: #103320;
  --v2-jade: #2f6f4c;
  --v2-gold: #c89a35;
  --v2-gold-light: #ead083;
  --v2-paper: rgba(255, 248, 220, 0.97);
  --v2-paper-soft: rgba(255, 252, 235, 0.92);
  --v2-line: rgba(150, 108, 28, 0.34);
  --v2-shadow: 0 14px 34px rgba(25, 43, 26, 0.28);
}

html,
body {
  min-height: 100%;
  background: #d8c889;
}

body {
  overflow: hidden;
}

.app-shell {
  width: 100%;
  min-width: 1120px;
  height: 100vh;
  min-height: 720px;
  overflow: hidden;
  background: #dfcf99;
}

/* ---------- ĐẦU TRANG: GỌN, KHÔNG ÉP NÚT XUỐNG DÒNG ---------- */
.top-header {
  height: 82px;
  min-height: 82px;
  grid-template-columns: minmax(500px, 1fr) auto auto;
  gap: 12px;
  padding: 7px 26px 6px;
  border-bottom: 1px solid rgba(142, 101, 27, 0.38);
  background:
    radial-gradient(circle at 82% -30%, rgba(255, 252, 222, 0.98), transparent 46%),
    linear-gradient(180deg, #fff9df 0%, #edddad 100%);
  box-shadow: 0 5px 17px rgba(67, 52, 20, 0.17);
}

.top-header::before {
  opacity: 0.13;
}

.top-header::after {
  height: 3px;
  opacity: 0.82;
}

.brand {
  min-width: 0;
  gap: 13px;
}

.brand-mark {
  width: 62px;
  height: 62px;
  font-size: 27px;
  border-width: 2px;
  box-shadow: inset 0 0 0 2px #f2d77c, 0 5px 14px rgba(31, 61, 36, 0.25);
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(25px, 2vw, 32px);
  line-height: 1.04;
  white-space: nowrap;
}

.brand-copy small {
  max-width: 740px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  white-space: nowrap;
}

.current-member-badge {
  margin-top: 4px;
  padding: 3px 9px;
  font-size: 9px;
}

.live-strip {
  gap: 7px;
}

.clock-block,
.weather-chip {
  min-height: 52px;
  padding: 7px 11px;
  border-radius: 10px;
}

.clock-block strong,
.weather-chip strong {
  font-size: 16px;
}

.clock-block small,
.weather-chip small {
  font-size: 8px;
}

.header-actions {
  flex-wrap: nowrap;
  gap: 7px;
}

.search-box {
  width: 154px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 8px;
}

.action-button {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
}

.assistant-link,
.admin-link {
  color: #f8e7a4;
  background: linear-gradient(180deg, #316f4b, #153c27);
  border-color: #c99b35;
}

.admin-link {
  min-width: 92px;
  font-size: 11px;
}

.admin-link span {
  font-size: 15px;
}

/* ---------- THANH CHỨC NĂNG ---------- */
.main-navigation {
  height: 50px;
  padding: 4px 4.5%;
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 2px solid #a77c26;
  background:
    repeating-linear-gradient(1deg, transparent 0 12px, rgba(119, 86, 24, 0.035) 13px),
    linear-gradient(180deg, #fff4ca, #dfc889);
  box-shadow: 0 5px 15px rgba(58, 49, 23, 0.16);
}

.nav-item {
  min-width: 0;
  border-right-color: rgba(122, 89, 28, 0.22);
  border-radius: 5px;
  color: #304232;
  font-size: 13px;
  font-weight: 600;
}

.nav-item:hover,
.nav-item.active {
  color: #ffe69a;
  background: linear-gradient(180deg, #316e4a, #163d28);
  box-shadow: inset 0 0 0 2px #d1a843, 0 4px 12px rgba(38, 48, 26, 0.18);
}

/* ---------- BẢN ĐỒ: CHIẾM TRỌN PHẦN CÒN LẠI ---------- */
.map-workspace {
  height: calc(100vh - 132px);
  min-height: 588px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(245, 217, 132, 0.035), rgba(24, 54, 33, 0.12)),
    url('/my-phu-summer.svg') center center / 100% 100% no-repeat,
    #728b55;
}

.map-workspace::before {
  background:
    linear-gradient(90deg, rgba(23, 45, 27, 0.13), transparent 17%, transparent 83%, rgba(23, 45, 27, 0.13)),
    radial-gradient(circle at 50% 45%, transparent 42%, rgba(72, 54, 18, 0.09) 100%);
}

.map-workspace::after {
  box-shadow: inset 0 0 100px rgba(31, 44, 24, 0.22);
}

.sun-glow {
  right: 21%;
  opacity: 0.24;
}

.ambient-cloud {
  opacity: 0.22;
}

.water-shimmer {
  opacity: 0.12;
}

.boat {
  opacity: 0.42;
}

/* ---------- HAI BẢNG BÊN: NHẸ, MẢNH, KHÔNG CHE CẢNH ---------- */
.side-panel {
  top: 16px;
  width: 278px;
  max-height: calc(100% - 154px);
  border: 2px solid rgba(180, 133, 38, 0.72);
  border-radius: 11px;
  background:
    repeating-linear-gradient(2deg, transparent 0 13px, rgba(123, 88, 22, 0.024) 14px),
    var(--v2-paper);
  box-shadow: var(--v2-shadow);
}

.conversation-panel {
  left: 18px;
}

.task-panel {
  right: 18px;
}

.panel-heading {
  min-height: 54px;
  padding: 8px 10px 8px 13px;
  color: #ffefb5;
  background: linear-gradient(180deg, #34704d, #173f29);
  border-bottom: 1px solid #d5aa43;
}

.panel-heading strong {
  font-size: 16px;
  letter-spacing: 0.2px;
}

.panel-heading small {
  margin-top: 2px;
  color: #f0e2aa;
  font-size: 8px;
}

.collapse-button {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  font-size: 17px;
}

.chat-tabs,
.task-tabs {
  gap: 2px;
  padding: 6px;
  background: rgba(236, 220, 169, 0.47);
}

.chat-tabs button,
.task-tabs button {
  min-height: 28px;
  padding-inline: 3px;
  font-size: 8px;
}

.chat-message {
  grid-template-columns: 34px 1fr;
  gap: 7px;
  padding: 7px 9px;
}

.avatar {
  width: 32px;
  height: 32px;
  font-size: 9px;
}

.chat-message strong {
  font-size: 9px;
}

.chat-message p {
  margin-top: 2px;
  font-size: 8px;
  line-height: 1.35;
}

.chat-message small {
  font-size: 7px;
}

.chat-composer {
  grid-template-columns: 1fr 33px;
  gap: 4px;
  padding: 6px;
}

.chat-composer input {
  height: 32px;
  padding-inline: 8px;
  font-size: 9px;
}

.task-item {
  grid-template-columns: 36px 1fr;
  gap: 7px;
  padding: 8px 9px;
}

.task-item > span:first-child {
  width: 32px;
  height: 32px;
  font-size: 15px;
}

.task-item strong {
  font-size: 9px;
}

.task-item small {
  margin-top: 3px;
  font-size: 7.5px;
  line-height: 1.35;
}

.panel-footer-button {
  min-height: 32px;
  margin: 7px;
  font-size: 8px;
}

/* ---------- CÁC CÔNG TRÌNH ---------- */
.hotspot span {
  padding: 5px 10px 6px;
  border: 2px solid #d0a23a;
  border-radius: 4px;
  color: #ffe59a;
  font-size: 9px;
  letter-spacing: 0.1px;
  background: linear-gradient(180deg, rgba(45, 96, 61, 0.98), rgba(18, 56, 36, 0.98));
  box-shadow: 0 6px 14px rgba(16, 39, 24, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.hotspot::after {
  height: 18px;
}

.hotspot:hover span,
.hotspot:focus-visible span {
  transform: translateY(-2px) scale(1.025);
  box-shadow: 0 10px 22px rgba(15, 41, 24, 0.36), 0 0 0 5px rgba(222, 187, 75, 0.12);
}

.hotspot-headquarters { left: 50%; top: 16%; }
.hotspot-branch { left: 31%; top: 24%; }
.hotspot-leaders { left: 27.5%; top: 43%; }
.hotspot-market { left: 70%; top: 21%; }
.hotspot-weather { left: 70.5%; top: 40%; }
.hotspot-support { left: 61.5%; top: 58%; }
.hotspot-collective { left: 76%; top: 71%; }
.hotspot-data { left: 31%; top: 67%; }
.hotspot-honor { left: 51%; top: 76%; }

/* ---------- DẢI DƯỚI: 4 TIN HIỆN ĐỒNG THỜI ---------- */
.bottom-dock {
  left: 18px;
  right: 18px;
  bottom: 10px;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 11px;
}

.news-panel,
.contact-panel {
  border: 2px solid rgba(180, 133, 38, 0.72);
  border-radius: 10px;
  background:
    repeating-linear-gradient(1deg, transparent 0 13px, rgba(124, 89, 23, 0.024) 14px),
    var(--v2-paper);
  box-shadow: var(--v2-shadow);
}

.dock-heading,
.contact-summary {
  height: 36px;
  min-height: 36px;
  color: #ffefb4;
  background: linear-gradient(180deg, #34704d, #173f29);
  border-bottom: 1px solid #d5aa43;
}

.dock-heading strong,
.contact-summary strong {
  font-size: 14px;
}

.news-rotator {
  min-height: 86px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 7px 9px;
}

.news-card,
.news-card.active {
  position: relative;
  inset: auto;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
  padding: 4px 10px;
  border-right: 1px solid rgba(138, 99, 27, 0.22);
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.news-card:last-child {
  border-right: 0;
}

.news-card > span {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(167, 123, 34, 0.24);
  border-radius: 9px;
  font-size: 21px;
  background: rgba(222, 198, 121, 0.25);
}

.news-card strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.news-card small {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: #62644f;
  font-size: 7px;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.contact-summary {
  padding-inline: 12px;
}

.contact-summary span {
  font-size: 7px;
}

.contact-details {
  padding: 5px;
}

.contact-details button {
  min-height: 50px;
  font-size: 19px;
}

.contact-details span {
  font-size: 7px;
}

/* ---------- CỬA SỔ CÔNG TRÌNH ---------- */
.modal-window {
  border: 2px solid #bd9134;
  border-radius: 13px;
  background:
    repeating-linear-gradient(2deg, transparent 0 13px, rgba(119, 85, 25, 0.032) 14px),
    linear-gradient(145deg, #fff8d8, #eadbad);
  box-shadow: 0 28px 90px rgba(20, 40, 24, 0.36);
}

.modal-option {
  border-color: rgba(139, 98, 23, 0.25);
  background: rgba(255, 251, 226, 0.8);
}

/* ---------- CỠ MÀN HÌNH PHỔ BIẾN ---------- */
@media (max-width: 1500px) {
  .top-header {
    grid-template-columns: minmax(430px, 1fr) auto auto;
    padding-inline: 18px;
  }

  .brand-copy strong {
    font-size: 25px;
  }

  .search-box {
    width: 130px;
  }

  .action-button {
    padding-inline: 9px;
    font-size: 10px;
  }

  .admin-link {
    min-width: 42px;
    font-size: 0;
  }

  .admin-link span {
    font-size: 15px;
  }

  .side-panel {
    width: 252px;
  }

  .bottom-dock {
    grid-template-columns: minmax(0, 1fr) 305px;
  }

  .hotspot span {
    font-size: 8px;
  }
}

@media (max-width: 1250px) {
  .top-header {
    grid-template-columns: minmax(360px, 1fr) auto;
    height: 92px;
    min-height: 92px;
  }

  .header-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin-top: -8px;
  }

  .main-navigation {
    height: 46px;
  }

  .map-workspace {
    height: calc(100vh - 138px);
  }

  .side-panel {
    width: 236px;
  }

  .conversation-panel {
    left: 10px;
  }

  .task-panel {
    right: 10px;
  }

  .bottom-dock {
    left: 10px;
    right: 10px;
    grid-template-columns: minmax(0, 1fr) 285px;
  }
}

@media (max-height: 780px) {
  .top-header {
    height: 74px;
    min-height: 74px;
  }

  .brand-mark {
    width: 55px;
    height: 55px;
  }

  .brand-copy strong {
    font-size: 24px;
  }

  .current-member-badge {
    display: none;
  }

  .main-navigation {
    height: 46px;
  }

  .map-workspace {
    height: calc(100vh - 120px);
    min-height: 570px;
  }

  .side-panel {
    top: 10px;
    max-height: calc(100% - 137px);
  }

  .chat-message,
  .task-item {
    padding-block: 6px;
  }

  .bottom-dock {
    bottom: 7px;
  }

  .news-rotator {
    min-height: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-cloud,
  .sun-glow,
  .water-shimmer,
  .boat {
    animation: none !important;
  }
}
