/* static version: 20260816-2328 */

:root {
  --bg: #f5f7f2;
  --surface: #ffffff;
  --surface-muted: #eef3ea;
  --primary: #2e7d32;
  --primary-dark: #1f5f25;
  --soil: #7a5643;
  --bed-empty: #d9d0c8;
  --bed-planted: #a9d8a4;
  --bed-selected: #f7d979;
  --text: #243029;
  --muted: #65736b;
  --border: #dce4d8;
  --shadow: 0 12px 30px rgba(42, 55, 38, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.top-bar {
  min-height: 68px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(130px, 180px) auto minmax(420px, max-content);
  gap: 18px;
  align-items: center;
  padding: 12px 24px;
}

.brand {
  color: var(--primary-dark);
  font-size: 20px;
  font-weight: 800;
  white-space: nowrap;
}

.tabs,
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tabs {
  justify-content: center;
}

.controls {
  justify-content: flex-end;
}

.tab,
.btn-primary,
.controls select {
  min-height: 36px;
  border-radius: 6px;
  font-size: 14px;
}

.tab {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
}

.tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.controls label {
  color: var(--muted);
  font-size: 13px;
}

.controls select {
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  padding: 0 10px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border: 0;
  padding: 0 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.workspace {
  min-height: calc(100vh - 68px);
}

.map-view {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
}

.map-container {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  overflow: auto;
}

.garden-map {
  width: min(100%, 980px);
  height: auto;
  max-height: calc(100vh - 112px);
  background: #e9efe5;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.ground {
  fill: #e7eee2;
}

.pathway {
  stroke: #d9d2c9;
  stroke-width: 24;
  fill: none;
}

.greenhouse-frame {
  fill: #e7f5f7;
  stroke: #6cb6c7;
  stroke-width: 2;
  stroke-dasharray: 7 5;
}

.zone-title {
  font-size: 14px;
  font-weight: 800;
  fill: #526158;
}

.garden-note {
  text-anchor: middle;
  fill: #526158;
  font-size: 13px;
  font-weight: 800;
}

.lawn {
  fill: #cfe8bf;
  stroke: #7eaa69;
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.house-body {
  fill: #ead7b8;
  stroke: #705844;
  stroke-width: 2;
}

.house-roof {
  fill: #8b9aa0;
  stroke: #3f4e54;
  stroke-width: 2;
}

.house-door {
  fill: #8a5d3c;
  stroke: #5b3c27;
  stroke-width: 1.5;
}

.house-window {
  fill: #d9eef2;
  stroke: #5d7d85;
  stroke-width: 1.5;
}

.bed-frame {
  fill: #8d6e55;
  opacity: 0.22;
}

.bed-number {
  text-anchor: middle;
  fill: #233028;
  font-size: 19px;
  font-weight: 900;
}

.section {
  fill: var(--bed-empty);
  stroke: var(--soil);
  stroke-width: 2;
  cursor: pointer;
  outline: none;
  transition: fill 0.18s ease, stroke 0.18s ease, stroke-width 0.18s ease;
}

.section.has-plant {
  fill: var(--bed-planted);
  stroke: var(--primary);
}

.tree-section {
  fill: #b8dcae;
  stroke: #386f3f;
}

.section:hover,
.section:focus {
  stroke: #d8862c;
  stroke-width: 4;
}

.section.active {
  fill: var(--bed-selected);
  stroke: #c76e00;
  stroke-width: 4;
}

.section-label {
  pointer-events: none;
  text-anchor: middle;
  fill: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.sidebar {
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 22px;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.sidebar h2 {
  font-size: 22px;
  line-height: 1.2;
}

.btn-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.placeholder-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.badge-plant {
  display: inline-flex;
  max-width: 100%;
  background: #e6f4e6;
  color: var(--primary-dark);
  border: 1px solid #c6e6c5;
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 800;
}

.fact-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.fact-row span {
  color: var(--muted);
}

.card-section {
  margin-top: 20px;
}

.card-section h3 {
  font-size: 15px;
  margin-bottom: 12px;
}

.timeline-list {
  list-style: none;
}

.timeline-item {
  position: relative;
  padding-left: 20px;
  margin-bottom: 14px;
  font-size: 14px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.timeline-item.plant::before { background: #43a047; }
.timeline-item.fertilize::before { background: #f39c12; }
.timeline-item.treatment::before { background: #d84571; }
.timeline-item.harvest::before { background: #7e57c2; }

.item-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.item-title {
  margin-top: 2px;
  font-weight: 800;
}

.item-desc {
  margin-top: 2px;
  color: #4e5d54;
  line-height: 1.35;
}

.event-form,
.gallery-form {
  display: grid;
  gap: 10px;
}

.event-form {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.event-form h3 {
  font-size: 15px;
}

.event-form input,
.event-form select,
.event-form textarea,
.gallery-form input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--text);
  font: inherit;
  padding: 8px 10px;
}

.event-form textarea {
  resize: vertical;
}

.gallery-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  margin-top: 14px;
}

.link-danger {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: #b53838;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 0;
}

.gallery-view {
  padding: 28px;
}

.gallery-header {
  max-width: 920px;
  margin: 0 auto 22px;
}

.gallery-header h1 {
  font-size: 28px;
  margin-bottom: 6px;
}

.gallery-header p {
  color: var(--muted);
}

.gallery-grid {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.empty-gallery {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.empty-gallery strong {
  color: var(--text);
}

.photo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.photo-card div {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.photo-card span {
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none;
}

@media (max-width: 920px) {
  .top-bar {
    grid-template-columns: 1fr;
  }

  .tabs,
  .controls {
    justify-content: flex-start;
  }

  .map-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

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

@media (max-width: 560px) {
  .top-bar,
  .map-container,
  .sidebar,
  .gallery-view {
    padding-left: 14px;
    padding-right: 14px;
  }

  .controls label {
    width: 64px;
  }

  .controls select,
  .btn-primary {
    flex: 1 1 160px;
  }
}
