:root {
  --ink: #17362d;
  --ink-soft: #4f645d;
  --ink-faint: #7d8b86;
  --paper: #f5f2ea;
  --paper-raised: #fbfaf6;
  --paper-deep: #e9e5dc;
  --line: rgba(23, 54, 45, 0.13);
  --green: #1e6b50;
  --green-deep: #14513c;
  --green-soft: #dfede5;
  --amber: #ecad38;
  --amber-deep: #bd7916;
  --amber-soft: #fff0cf;
  --red: #ba4b3f;
  --red-deep: #94392f;
  --red-soft: #f7e1dc;
  --blue: #3d729a;
  --blue-soft: #deecf5;
  --shadow: 0 20px 55px rgba(29, 47, 40, 0.16);
  --sidebar-width: 340px;
  --detail-width: 438px;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Segoe UI",
    sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(236, 173, 56, 0.52);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-frame {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.topbar {
  display: flex;
  flex: 0 0 68px;
  align-items: center;
  gap: 22px;
  padding: 0 22px;
  color: #f8f3e8;
  background:
    radial-gradient(circle at 22% -80%, rgba(236, 173, 56, 0.34), transparent 36%),
    linear-gradient(108deg, #14352b, #1b4b3b 72%, #214d3e);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 310px;
}

.brand h1 {
  margin: 1px 0 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.eyebrow {
  margin: 0;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: rgba(248, 243, 232, 0.62);
}

.brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  transform: rotate(-8deg);
}

.brand-mark span {
  display: block;
  background: var(--amber);
}

.brand-mark span:nth-child(2),
.brand-mark span:nth-child(3) {
  clip-path: polygon(18% 0, 100% 0, 100% 82%, 0 82%);
}

.brand-mark span:nth-child(1),
.brand-mark span:nth-child(4) {
  border-radius: 2px;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: rgba(248, 243, 232, 0.7);
  font-size: 12px;
  white-space: nowrap;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b7c3be;
  box-shadow: 0 0 0 4px rgba(183, 195, 190, 0.12);
}

.sync-state.is-live .sync-dot {
  background: #7ed1a3;
  box-shadow: 0 0 0 4px rgba(126, 209, 163, 0.14);
}

.sync-state.is-error .sync-dot {
  background: #f1a593;
  box-shadow: 0 0 0 4px rgba(241, 165, 147, 0.15);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  color: #fff;
  background: var(--green);
}

.button-primary:hover {
  background: var(--green-deep);
}

.button-amber {
  color: #2b251d;
  background: var(--amber);
}

.button-amber:hover {
  background: #f4bd50;
}

.button-dark {
  color: #fff7e8;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
}

.button-dark:hover {
  background: rgba(255, 255, 255, 0.17);
}

.button-quiet {
  color: var(--ink-soft);
  border-color: var(--line);
  background: transparent;
}

.button-quiet:hover {
  color: var(--ink);
  background: rgba(23, 54, 45, 0.045);
}

.button-danger {
  color: var(--red-deep);
  border-color: rgba(186, 75, 63, 0.22);
  background: var(--red-soft);
}

.overview {
  display: grid;
  flex: 0 0 101px;
  grid-template-columns: minmax(350px, 1.55fr) repeat(4, minmax(112px, 0.56fr));
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: var(--paper-raised);
}

.overview-main {
  display: flex;
  align-items: center;
  gap: 21px;
  padding: 19px 26px;
  border-right: 1px solid var(--line);
}

.overview-copy {
  min-width: 82px;
}

.overview-copy p {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.overview-copy strong {
  color: var(--green);
  font-size: 31px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.overview-progress {
  flex: 1;
  min-width: 150px;
}

.overview-progress p {
  margin: 9px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.progress-track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--green);
  transition: width 350ms ease;
}

.progress-large {
  height: 9px;
}

.overview-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.overview-stat:last-child {
  border-right: 0;
}

.overview-stat span {
  margin-bottom: 5px;
  color: var(--ink-faint);
  font-size: 11px;
}

.overview-stat strong {
  font-size: 20px;
  line-height: 1.1;
}

.overview-stat-alert strong {
  color: var(--red);
}

.workspace {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  flex: 0 0 var(--sidebar-width);
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: var(--paper-raised);
}

.sidebar-mobile-head {
  display: none;
}

.tabbar {
  display: grid;
  flex: 0 0 53px;
  grid-template-columns: repeat(3, 1fr);
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  position: relative;
  padding: 0 5px;
  color: var(--ink-faint);
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.tab-button::after {
  position: absolute;
  right: 16px;
  bottom: -1px;
  left: 16px;
  height: 2px;
  background: transparent;
  content: "";
}

.tab-button.is-active {
  color: var(--ink);
}

.tab-button.is-active::after {
  background: var(--green);
}

.tab-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
}

.search-box {
  position: relative;
  flex: 0 0 auto;
}

.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 13px 0 37px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f2eb;
  font-size: 13px;
}

.search-box input::placeholder {
  color: #929c98;
}

.search-icon {
  position: absolute;
  z-index: 2;
  top: 13px;
  left: 13px;
  width: 14px;
  height: 14px;
  border: 1.7px solid var(--ink-faint);
  border-radius: 50%;
}

.search-icon::after {
  position: absolute;
  top: 11px;
  left: 10px;
  width: 6px;
  height: 1.7px;
  background: var(--ink-faint);
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}

.filter-row {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 9px;
}

.filter-row select,
.field select,
.field input,
.field textarea {
  width: 100%;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-raised);
}

.filter-row select {
  padding: 0 30px 0 10px;
  color: var(--ink-soft);
  font-size: 12px;
}

.list-meta {
  display: flex;
  flex: 0 0 39px;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 11px;
}

.text-button {
  padding: 6px 0;
  color: var(--green);
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.site-list,
.issue-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  padding: 1px 3px 18px 1px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 54, 45, 0.2) transparent;
}

.site-card {
  position: relative;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  transition:
    background-color 140ms ease,
    border-color 140ms ease;
}

.site-card:hover,
.site-card.is-selected {
  border-color: var(--line);
  background: #f1eee6;
}

.site-status-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #9aa39f;
}

.site-status-dot.completed {
  background: var(--green);
}

.site-status-dot.in_progress {
  background: var(--blue);
}

.site-status-dot.issues,
.site-status-dot.blocked {
  background: var(--red);
}

.site-card-main {
  min-width: 0;
}

.site-card-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 10px;
}

.phase-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  color: var(--green-deep);
  background: var(--green-soft);
  font-size: 9px;
  font-weight: 700;
}

.phase-tag.phase-2 {
  color: #755321;
  background: var(--amber-soft);
}

.site-card-progress {
  display: flex;
  min-width: 37px;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.site-card-progress strong {
  font-size: 12px;
}

.site-card-progress span {
  color: var(--ink-faint);
  font-size: 9px;
  white-space: nowrap;
}

.map-column {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(30, 107, 80, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(30, 107, 80, 0.045) 1px, transparent 1px),
    #e5ebe5;
  background-size: 32px 32px;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #dee7df;
}

.leaflet-container {
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Segoe UI",
    sans-serif;
  background: #dfe7e0;
}

.leaflet-control-attribution {
  color: #65736e !important;
  background: rgba(250, 249, 245, 0.82) !important;
  font-size: 9px !important;
}

.leaflet-control-attribution a {
  color: var(--green) !important;
}

.leaflet-bar {
  overflow: hidden;
  border: 0 !important;
  border-radius: 9px !important;
  box-shadow: 0 7px 22px rgba(29, 47, 40, 0.16) !important;
}

.leaflet-bar a {
  color: var(--ink) !important;
  border-bottom-color: var(--line) !important;
  background: rgba(251, 250, 246, 0.96) !important;
}

.map-caption {
  position: absolute;
  z-index: 10;
  top: 15px;
  left: 16px;
  display: flex;
  height: 33px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--ink-soft);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 9px;
  background: rgba(251, 250, 246, 0.91);
  box-shadow: 0 7px 22px rgba(29, 47, 40, 0.12);
  font-size: 11px;
  backdrop-filter: blur(12px);
}

.map-caption-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.map-caption-divider {
  width: 1px;
  height: 13px;
  background: var(--line);
}

.map-tools {
  position: absolute;
  z-index: 10;
  right: 16px;
  bottom: 25px;
  display: flex;
  gap: 7px;
}

.map-tool {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--ink-soft);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 9px;
  background: rgba(251, 250, 246, 0.94);
  box-shadow: 0 7px 22px rgba(29, 47, 40, 0.13);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.map-tool.is-active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.sidebar-toggle {
  display: none;
}

.project-marker {
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translateY(-2px);
}

.project-marker-pin {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 50% 50% 50% 8px;
  background: #8c9994;
  box-shadow: 0 6px 14px rgba(23, 54, 45, 0.25);
  font-size: 10px;
  font-weight: 800;
  transform: rotate(-45deg);
}

.project-marker-pin span {
  transform: rotate(45deg);
}

.project-marker-pin.pending {
  background: #7f8c87;
}

.project-marker-pin.in_progress {
  background: var(--blue);
}

.project-marker-pin.completed {
  background: var(--green);
}

.project-marker-pin.blocked,
.project-marker-pin.issues {
  background: var(--red);
}

.project-marker.selected .project-marker-pin {
  box-shadow:
    0 0 0 5px rgba(236, 173, 56, 0.48),
    0 8px 18px rgba(23, 54, 45, 0.28);
}

.marker-count {
  display: grid;
  min-width: 25px;
  height: 24px;
  place-items: center;
  padding: 0 6px;
  color: var(--ink);
  border: 1px solid rgba(23, 54, 45, 0.1);
  border-radius: 7px;
  background: rgba(251, 250, 246, 0.94);
  box-shadow: 0 4px 12px rgba(23, 54, 45, 0.12);
  font-size: 10px;
  font-weight: 800;
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(30, 107, 80, 0.19) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  color: #fff !important;
  background: var(--green) !important;
  font-family: inherit !important;
}

.detail-panel {
  position: absolute;
  z-index: 35;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--detail-width);
  max-width: 100%;
  overflow: hidden;
  border-left: 1px solid rgba(23, 54, 45, 0.12);
  background: var(--paper-raised);
  box-shadow: -22px 0 50px rgba(29, 47, 40, 0.13);
  transform: translateX(calc(100% + 30px));
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.detail-panel.is-open {
  transform: translateX(0);
}

.detail-panel-inner {
  height: 100%;
  overflow: auto;
  scrollbar-width: thin;
}

.detail-loading {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--ink-faint);
}

.detail-header {
  position: sticky;
  z-index: 5;
  top: 0;
  padding: 20px 20px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: blur(14px);
}

.detail-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-header h2 {
  max-width: 330px;
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.detail-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.detail-header-meta span {
  color: var(--ink-faint);
  font-size: 10px;
}

.project-status-select {
  min-width: 118px;
  height: 34px;
  padding: 0 29px 0 10px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-deep);
  font-size: 11px;
  font-weight: 800;
}

.project-status-select[data-status="completed"] {
  color: var(--green-deep);
  border-color: rgba(30, 107, 80, 0.14);
  background: var(--green-soft);
}

.project-status-select[data-status="in_progress"] {
  color: #2c6185;
  border-color: rgba(61, 114, 154, 0.14);
  background: var(--blue-soft);
}

.project-status-select[data-status="blocked"] {
  color: var(--red-deep);
  border-color: rgba(186, 75, 63, 0.14);
  background: var(--red-soft);
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  font-size: 23px;
  line-height: 1;
}

.status-badge,
.severity-badge,
.issue-state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.completed,
.issue-state-badge.resolved {
  color: var(--green-deep);
  background: var(--green-soft);
}

.status-badge.in_progress,
.issue-state-badge.in_progress {
  color: #2c6185;
  background: var(--blue-soft);
}

.status-badge.blocked,
.severity-badge.high {
  color: var(--red-deep);
  background: var(--red-soft);
}

.severity-badge.medium {
  color: #805a1d;
  background: var(--amber-soft);
}

.severity-badge.low {
  color: var(--ink-soft);
  background: var(--paper-deep);
}

.detail-progress {
  margin-top: 15px;
}

.detail-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 11px;
}

.detail-progress-row strong {
  color: var(--ink);
  font-size: 12px;
}

.detail-body {
  padding: 2px 20px 36px;
}

.detail-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
  border-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.section-heading h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.section-heading small {
  color: var(--ink-faint);
  font-size: 10px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-button {
  padding: 4px 0;
  color: var(--green);
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.info-grid {
  display: grid;
  gap: 10px;
}

.info-row {
  display: grid;
  grid-template-columns: 79px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 12px;
  line-height: 1.55;
}

.info-row dt {
  color: var(--ink-faint);
}

.info-row dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.info-row a {
  color: var(--green);
  text-decoration: none;
  font-weight: 700;
}

.access-note {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 9px;
  color: var(--ink-soft);
  background: #f2efe7;
  font-size: 11px;
  line-height: 1.6;
}

.building-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.building-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 9px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefa;
}

.building-name {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.mini-tag {
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--ink-faint);
  background: var(--paper-deep);
  font-size: 9px;
}

.mini-tag.warn {
  color: #805a1d;
  background: var(--amber-soft);
}

.status-select {
  width: 100%;
  height: 34px;
  padding: 0 24px 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-raised);
  font-size: 11px;
  font-weight: 700;
}

.status-select[data-status="completed"] {
  color: var(--green-deep);
  background: var(--green-soft);
}

.status-select[data-status="in_progress"] {
  color: #2c6185;
  background: var(--blue-soft);
}

.status-select[data-status="blocked"] {
  color: var(--red-deep);
  background: var(--red-soft);
}

.issue-cards {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.issue-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefa;
}

.issue-card.is-resolved {
  opacity: 0.68;
}

.issue-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.issue-card h4 {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.severity-select,
.all-issue-controls select {
  min-width: 68px;
  height: 30px;
  padding: 0 24px 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-deep);
  font-size: 10px;
  font-weight: 700;
}

.severity-select.severity-high {
  color: var(--red-deep);
  border-color: rgba(186, 75, 63, 0.14);
  background: var(--red-soft);
}

.severity-select.severity-medium {
  color: #805a1d;
  border-color: rgba(236, 173, 56, 0.2);
  background: var(--amber-soft);
}

.severity-select.severity-low {
  color: var(--ink-soft);
  border-color: var(--line);
  background: var(--paper-deep);
}

.issue-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.issue-card-description {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.issue-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.issue-card-footer span {
  color: var(--ink-faint);
  font-size: 9px;
}

.issue-card-footer select {
  height: 30px;
  padding: 0 22px 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-raised);
  font-size: 10px;
}

.empty-state {
  display: flex;
  min-height: 110px;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--ink-faint);
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.65;
  text-align: center;
}

.photo-uploader {
  display: flex;
  align-items: center;
  gap: 8px;
}

.photo-caption {
  flex: 1;
  height: 36px;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-raised);
  font-size: 11px;
}

.upload-button {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 11px;
}

.photo-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 0.78;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--paper-deep);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.photo-thumb:hover img {
  transform: scale(1.035);
}

.photo-thumb span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  left: 4px;
  overflow: hidden;
  padding: 3px 5px;
  border-radius: 3px;
  color: #fff;
  background: rgba(17, 34, 28, 0.68);
  font-size: 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-status {
  margin-top: 9px;
  color: var(--ink-faint);
  font-size: 10px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-item {
  position: relative;
  padding-left: 16px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.timeline-item::before {
  position: absolute;
  top: 5px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  content: "";
}

.progress-panel-heading {
  margin-bottom: 15px;
}

.progress-panel-heading h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.progress-panel-heading p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.phase-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffefa;
}

.phase-card + .phase-card {
  margin-top: 9px;
}

.phase-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.phase-card-head strong {
  font-size: 13px;
}

.phase-card-head span {
  color: var(--ink-faint);
  font-size: 10px;
}

.phase-card .progress-track {
  margin-top: 10px;
}

.phase-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--ink-faint);
  font-size: 9px;
}

.status-chart {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffefa;
}

.status-chart h3 {
  margin: 0 0 12px;
  font-size: 12px;
}

.status-chart-bar {
  display: flex;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.status-chart-bar span {
  display: block;
  min-width: 0;
  transition: width 300ms ease;
}

.status-chart-bar .completed {
  background: var(--green);
}

.status-chart-bar .in_progress {
  background: var(--blue);
}

.status-chart-bar .blocked {
  background: var(--red);
}

.status-chart-bar .pending {
  background: #bdc4c0;
}

.status-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.status-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  font-size: 10px;
}

.status-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #bdc4c0;
}

.status-legend i.completed {
  background: var(--green);
}

.status-legend i.in_progress {
  background: var(--blue);
}

.status-legend i.blocked {
  background: var(--red);
}

.progress-site-list {
  margin-top: 13px;
}

.progress-site-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.progress-site-row:last-child {
  border-bottom: 0;
}

.progress-site-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 105px;
  gap: 9px;
  align-items: center;
}

.progress-site-info strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.progress-site-row > span {
  color: var(--ink-faint);
  text-align: right;
}

.issues-summary {
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.issue-panel-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.issue-panel-heading h2 {
  margin: 0;
  font-size: 15px;
}

.issue-panel-heading p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.issue-panel-heading .button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 11px;
  white-space: nowrap;
}

.issue-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.issue-summary-grid div {
  padding: 10px;
  border-radius: 9px;
  background: #f1eee7;
}

.issue-summary-grid span {
  display: block;
  color: var(--ink-faint);
  font-size: 9px;
}

.issue-summary-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.issue-filters {
  margin-bottom: 9px;
}

.all-issue-card {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.all-issue-card:hover {
  background: rgba(30, 107, 80, 0.025);
}

.all-issue-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefa;
}

.all-issue-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--line);
  background: #f8f6f0;
}

.all-issue-controls label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.all-issue-controls label > span {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 9px;
}

.all-issue-controls select {
  width: 100%;
  min-width: 0;
}

.all-issue-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.all-issue-card h3 {
  margin: 8px 0 0;
  font-size: 12px;
}

.all-issue-card p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.all-issue-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  color: var(--ink-faint);
  font-size: 9px;
}

.toast-region {
  position: fixed;
  z-index: 1000;
  top: 82px;
  left: 50%;
  display: flex;
  max-width: min(420px, calc(100vw - 30px));
  align-items: center;
  padding: 11px 15px;
  color: #fff;
  border: 0;
  border-radius: 9px;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12px;
  text-align: left;
  transform: translateX(-50%);
}

.toast-region.is-error {
  background: var(--red-deep);
}

dialog {
  padding: 0;
  color: var(--ink);
  border: 0;
  border-radius: 15px;
  background: var(--paper-raised);
  box-shadow: 0 26px 80px rgba(13, 31, 25, 0.3);
}

dialog::backdrop {
  background: rgba(15, 35, 28, 0.46);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(570px, calc(100vw - 28px));
  max-height: min(88vh, 760px);
  overflow: auto;
}

.modal-small {
  width: min(420px, calc(100vw - 28px));
}

.modal form {
  padding: 22px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 {
  margin: 5px 0 0;
  font-size: 20px;
}

.modal-description {
  margin: 14px 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 19px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  padding: 9px 10px;
  color: var(--ink);
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.field-wide {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 21px;
}

.login-modal {
  width: min(410px, calc(100vw - 26px));
  color: #f8f3e8;
  background:
    radial-gradient(circle at 85% 2%, rgba(236, 173, 56, 0.28), transparent 28%),
    linear-gradient(145deg, #14352b, #1d4b3c);
}

.login-modal form {
  padding: 28px;
}

.login-brand h2 {
  margin: 8px 0 6px;
  font-size: 25px;
}

.login-brand > p:last-child {
  margin: 0;
  color: rgba(248, 243, 232, 0.65);
  font-size: 12px;
}

.login-modal .eyebrow {
  margin-top: 17px;
  color: var(--amber);
}

.brand-mark-light {
  width: 38px;
  height: 38px;
}

.field-on-dark {
  margin-top: 23px;
}

.field-on-dark > span {
  color: rgba(248, 243, 232, 0.72);
}

.field-on-dark input {
  height: 45px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.19);
  background: rgba(255, 255, 255, 0.08);
  font-size: 18px;
  letter-spacing: 0.15em;
}

.login-error {
  min-height: 17px;
  margin: 8px 0 0;
  color: #ffc0b3;
  font-size: 11px;
}

.login-submit {
  width: 100%;
  margin-top: 8px;
}

.photo-lightbox {
  width: min(960px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  color: #fff;
  background: #0e1d18;
}

.photo-lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 95px);
  object-fit: contain;
}

.photo-lightbox p {
  margin: 0;
  padding: 12px 18px 15px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(10, 24, 19, 0.65);
  font-size: 23px;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 310px;
    --detail-width: 410px;
  }

  .overview {
    grid-template-columns: minmax(310px, 1.35fr) repeat(4, minmax(92px, 0.5fr));
  }

  .overview-stat {
    padding-right: 11px;
    padding-left: 11px;
  }
}

@media (max-width: 900px) {
  :root {
    --detail-width: min(430px, 100vw);
  }

  .topbar {
    padding: 0 15px;
  }

  .brand {
    min-width: 0;
  }

  .brand h1 {
    font-size: 16px;
  }

  .sync-state {
    display: none;
  }

  .overview {
    display: flex;
    flex: 0 0 89px;
    overflow-x: auto;
  }

  .overview-main {
    flex: 1 0 270px;
    padding: 15px 18px;
  }

  .overview-stat {
    flex: 0 0 105px;
    padding: 13px 14px;
  }

  .overview-copy strong {
    font-size: 27px;
  }

  .sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(var(--sidebar-width), 88vw);
    box-shadow: 20px 0 45px rgba(29, 47, 40, 0.2);
    transform: translateX(-102%);
    transition: transform 200ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-mobile-head {
    display: flex;
    flex: 0 0 50px;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
  }

  .sidebar-toggle {
    position: absolute;
    z-index: 12;
    top: 15px;
    left: 16px;
    display: block;
    height: 35px;
    padding: 0 13px;
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 9px;
    background: rgba(251, 250, 246, 0.94);
    box-shadow: 0 7px 22px rgba(29, 47, 40, 0.13);
    font-size: 11px;
    font-weight: 700;
  }

  .map-caption {
    left: 68px;
  }
}

@media (max-width: 620px) {
  .topbar {
    flex-basis: 61px;
    gap: 9px;
  }

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

  .brand .eyebrow {
    display: none;
  }

  .brand h1 {
    font-size: 14px;
  }

  .top-actions .button-quiet {
    display: none;
  }

  .top-actions .button-dark {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 11px;
  }

  .overview {
    flex-basis: 79px;
  }

  .overview-main {
    flex-basis: 235px;
    gap: 12px;
    padding: 12px 14px;
  }

  .overview-copy {
    min-width: 65px;
  }

  .overview-copy p {
    font-size: 10px;
  }

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

  .overview-progress p {
    font-size: 9px;
  }

  .overview-stat {
    flex-basis: 91px;
    padding: 10px 11px;
  }

  .overview-stat span {
    font-size: 9px;
  }

  .overview-stat strong {
    font-size: 17px;
  }

  .map-caption {
    max-width: calc(100vw - 160px);
    overflow: hidden;
    white-space: nowrap;
  }

  .map-caption-divider,
  #map-site-count {
    display: none;
  }

  .detail-header {
    padding: 17px 16px 14px;
  }

  .detail-header h2 {
    font-size: 19px;
  }

  .detail-body {
    padding-right: 16px;
    padding-left: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .modal form {
    padding: 18px;
  }

  .building-row {
    grid-template-columns: minmax(0, 1fr) 104px;
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

