:root {
  --ink: #18231e;
  --ink-soft: #3a4a42;
  --mist: #eef3ef;
  --paper: #f7faf7;
  --sage: #2f6b52;
  --sage-deep: #1f4d3b;
  --line: rgba(24, 35, 30, 0.12);
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Noto Serif SC", "Songti SC", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* —— Hero：整屏一构图 —— */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #f4f7f5;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.06);
  animation: heroDrift 18s ease-in-out infinite alternate;
  will-change: transform;
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(16, 28, 22, 0.18) 0%, rgba(16, 28, 22, 0.22) 42%, rgba(12, 22, 18, 0.78) 100%),
    linear-gradient(90deg, rgba(12, 22, 18, 0.35) 0%, transparent 55%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 48px));
  margin: 0 auto 12vh;
  padding: 0 4px;
}

.brand {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.06em;
  opacity: 0;
  animation: riseIn 0.9s ease 0.15s forwards;
}

.headline {
  margin: 0 0 14px;
  max-width: 16em;
  font-family: var(--font-sans);
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: rgba(244, 247, 245, 0.92);
  opacity: 0;
  animation: riseIn 0.9s ease 0.35s forwards;
}

.lede {
  margin: 0 0 28px;
  max-width: 28em;
  font-size: 0.98rem;
  color: rgba(232, 239, 234, 0.78);
  opacity: 0;
  animation: riseIn 0.9s ease 0.5s forwards;
}

.cta-row {
  opacity: 0;
  animation: riseIn 0.9s ease 0.65s forwards;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9.5em;
  padding: 0.85em 1.6em;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.cta:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.cta:active {
  transform: translateY(0);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta-ghost {
  background: transparent;
}

/* —— 顶栏 / 认证 / 工作台 —— */
.topbar {
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.topbar-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sage-deep);
  text-decoration: none;
  letter-spacing: 0.06em;
}
.topbar-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.topbar-tenant { font-weight: 500; color: var(--ink); }
.topbar-link {
  color: var(--sage);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.topbar-link:hover { border-bottom-color: var(--sage); }

.flash {
  width: min(1120px, calc(100% - 40px));
  margin: 16px auto 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
}
.flash-error { background: #fdecea; color: #a32018; }
.flash-success { background: #e8f5ee; color: #1a6b45; }

.auth-page {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background:
    radial-gradient(ellipse 70% 50% at 80% 0%, rgba(47, 107, 82, 0.1), transparent 55%),
    var(--paper);
}
.auth-card {
  width: min(440px, 100%);
  padding: 32px 28px 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.auth-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}
.auth-sub {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.auth-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-size: 0.88rem; color: var(--ink-soft); }
.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d5ddd8;
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.input:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(47, 107, 82, 0.12);
}
.btn-primary {
  margin-top: 6px;
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--sage);
  color: #fff;
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.btn-primary:hover { background: var(--sage-deep); }
.auth-foot {
  margin: 18px 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  text-align: center;
}
.auth-foot a { color: var(--sage); }

.workspace { padding-bottom: 24px; }
.workspace-head {
  width: min(880px, calc(100% - 32px));
  margin: 28px auto 0;
}
.workspace-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.04em;
}
.workspace-sub { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.workspace .muted { color: #8a968e; }
.workspace .tools { padding-top: 36px; }

/* —— 工具区空壳 —— */
.tools {
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(47, 107, 82, 0.08), transparent 55%),
    var(--paper);
  padding: 72px 24px 88px;
}

.tools-inner {
  width: min(880px, 100%);
  margin: 0 auto;
}

.tools-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.tools-desc {
  margin: 0 0 36px;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.tools-empty {
  padding: 48px 28px;
  border: 1px dashed var(--line);
  background: linear-gradient(180deg, #fff 0%, var(--mist) 100%);
  text-align: center;
}

.tools-empty-label {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--sage-deep);
  letter-spacing: 0.12em;
}

.tools-empty-hint {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 22px 16px 28px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}

.footer .dot {
  opacity: 0.45;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroDrift {
  from {
    transform: scale(1.06) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.12) translate3d(-1.2%, -0.8%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-img,
  .brand,
  .headline,
  .lede,
  .cta-row {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .hero-content {
    margin-bottom: 10vh;
    width: calc(100% - 36px);
  }

  .brand {
    letter-spacing: 0.04em;
  }

  .tools {
    padding: 56px 18px 72px;
  }
}

/* ========== 统一后台版式 ========== */
.page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 40px;
  font-size: 13px;
  line-height: 1.45;
}
.page-narrow { width: min(520px, calc(100% - 40px)); }

.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.page-crumb {
  margin: 0 0 4px;
  font-size: 0.85em;
  color: #8a968e;
  letter-spacing: 0.04em;
}
.page-crumb a { color: var(--sage); text-decoration: none; }
.page-crumb span { margin: 0 6px; opacity: .5; }
.page-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.35em;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.2;
}
.page-lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92em;
}
.page-hero-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.page-note {
  margin: 10px 0 0;
  font-size: 0.88em;
  color: #8a968e;
  line-height: 1.45;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.92em;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-main { background: var(--sage); color: #fff; }
.btn-main:hover { background: var(--sage-deep); }
.btn-ghost {
  background: #fff;
  border-color: #d7e0da;
  color: var(--ink-soft);
}
.btn-ghost:hover { border-color: var(--sage); color: var(--sage-deep); }
.btn-block { width: 100%; margin-top: 14px; }

.sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 1px 0 rgba(24, 35, 30, 0.03);
}
.sheet-pad { padding: 22px 22px 24px; }
.sheet-head { padding: 16px 20px 0; }
.sheet-body { padding: 0; }
.sheet-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.05em;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.sheet-tip {
  margin: 0 0 12px;
  font-size: 0.88em;
  color: var(--ink-soft);
  line-height: 1.45;
}

.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #eef2ef;
  background: #fbfcfb;
}
.filter-fields {
  display: flex;
  flex: 1;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-item {
  display: grid;
  gap: 4px;
  font-size: 0.85em;
  color: #7d8a82;
  min-width: 100px;
}
.filter-search { flex: 1; min-width: 160px; }
.ctrl {
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid #d5ddd8;
  border-radius: 7px;
  background: #fff;
  font: inherit;
  font-size: 1em;
  color: var(--ink);
  box-sizing: border-box;
}
.ctrl:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(47, 107, 82, 0.12);
}

.table-scroll { overflow-x: auto; }
.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
}
.grid th, .grid td {
  padding: 6px 8px;
  border-bottom: 1px solid #eef2ef;
  text-align: left;
  vertical-align: middle;
}
.grid th {
  background: #f4f8f5;
  color: #617068;
  font-weight: 600;
  font-size: 0.85em;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.grid tbody tr:hover { background: #fafcfa; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid .strong { font-weight: 600; color: var(--ink); }
.grid .muted-num { color: #7d8a82; }
.grid .empty {
  text-align: center !important;
  color: #99a59c;
  padding: 36px 14px !important;
}
.grid .actions { text-align: right; white-space: nowrap; }
.link {
  color: var(--sage);
  text-decoration: none;
  font-weight: 500;
}
.link:hover { text-decoration: underline; }
.link.danger, .danger {
  color: #b42318;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.inline-form { display: inline; margin-left: 10px; }

.tag {
  display: inline-block;
  min-width: 2.2em;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}
.tag-warn { background: #fff3df; color: #9a6700; }
.tag-ok { background: #e8f5ee; color: #1a6b45; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.stat span {
  display: block;
  font-size: 0.8rem;
  color: #7d8a82;
  margin-bottom: 4px;
}
.stat strong {
  font-size: 1.35rem;
  color: var(--sage-deep);
  font-variant-numeric: tabular-nums;
}
.stat-warn { border-color: #e6b566; background: #fffaf0; }
.stat-ok strong { color: #1a6b45; }

.split-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.form-stack { display: grid; gap: 12px; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.field {
  display: grid;
  gap: 5px;
  font-size: 0.8rem;
  color: #7d8a82;
}
.crop-4 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.import-form { margin-top: 4px; }
.hint-list {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.7;
}
.hint-list p { margin: 0; }

.m-file {
  position: relative;
  display: block;
  min-height: 72px;
  padding: 18px 16px;
  border: 1px dashed #c5d2ca;
  border-radius: 12px;
  background: #f7faf7;
  cursor: pointer;
}
.m-file:hover { border-color: var(--sage); background: #f2f8f4; }
.m-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  font-size: 48px;
  z-index: 2;
}
.m-file-ui { pointer-events: none; display: grid; gap: 4px; }
.m-file-btn { color: var(--sage); font-weight: 600; font-size: 0.98rem; }
.m-file-name { font-size: 0.82rem; color: #8a968e; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.tool-card {
  display: block;
  padding: 18px 16px;
  border: 1px solid #e2ebe5;
  border-radius: 12px;
  background: #fbfcfb;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, background .2s;
}
.tool-card:hover {
  border-color: var(--sage);
  background: #fff;
}
.tool-name {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--sage-deep);
}
.tool-desc {
  display: block;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.kpi-card.soft { background: #f7faf7; }
.kpi-card.is-warn { border-color: #e6b566; background: #fffaf0; }
.kpi-card span {
  display: block;
  font-size: 0.85em;
  color: #7d8a82;
  margin-bottom: 4px;
}
.kpi-card strong {
  font-size: 1.25em;
  color: var(--sage-deep);
  font-variant-numeric: tabular-nums;
}
.kpi-card small {
  margin-left: 3px;
  font-size: 0.8em;
  color: #8a968e;
  font-weight: 500;
}

.bars { display: grid; gap: 14px; padding-top: 4px; }
.bar-row {
  display: grid;
  grid-template-columns: 4.2em 1fr 3.6em;
  gap: 12px;
  align-items: center;
}
.bar-label { font-size: 0.88rem; color: var(--ink-soft); }
.bar-track {
  height: 10px;
  background: #e8efe9;
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: #2f6b52;
  border-radius: 999px;
}
.bar-val {
  text-align: right;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* 列表内联编辑 */
.farm-groups { padding: 0; }
.empty-block {
  margin: 0;
  padding: 36px 18px;
  text-align: center;
  color: #99a59c;
}
.group-block + .group-block {
  border-top: 10px solid #eef3ef;
}
.group-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 18px 12px;
  background: linear-gradient(180deg, #f4f8f5 0%, #eef5f0 100%);
  border-bottom: 1px solid #e2ebe5;
}
.group-banner-text { min-width: 0; }
.group-banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.grid .check-col {
  width: 36px;
  text-align: center;
  padding-left: 8px !important;
  padding-right: 8px !important;
}
.grid .check-col input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.modal-panel-sm { width: min(420px, 100%); }
.bigfarm-form { display: grid; gap: 14px; }
.bigfarm-form .field { display: grid; gap: 6px; font-size: 0.86rem; color: #7d8a82; }
.bigfarm-tip {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f4f8f5;
  color: var(--sage-deep);
  font-size: 0.88rem;
  font-weight: 600;
}
.check-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.88rem;
  color: #617068;
  cursor: pointer;
}
.check-line input { margin-top: 3px; }
.bigfarm-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.planter-same {
  flex: none;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #c5d6cb;
  border-radius: 6px;
  background: #eef6f1;
  color: var(--sage-deep);
  font: inherit;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.planter-same:hover { border-color: var(--sage); background: #e2f0e8; }
.plot-row.is-done .planter-cell {
  background: #d4edda;
}
.plot-row.is-done .planter-cell .js-planter {
  background: #c3e6cb;
  border-color: #a3d4b0;
  color: var(--ink);
  font-weight: inherit;
}
.plot-row.is-done .planter-cell .js-planter:hover,
.plot-row.is-done .planter-cell .js-planter:focus {
  background: #b7dfc2;
  border-color: var(--sage);
}
.group-name {
  margin: 0;
  font-size: 1em;
  font-weight: 700;
  color: var(--sage-deep);
  letter-spacing: 0.02em;
}
.group-meta {
  margin: 0;
  font-size: 0.88em;
  color: #7d8a82;
}
.grid-edit td { padding: 4px 6px; }
.grid-edit .cell {
  width: 100%;
  min-width: 2.8em;
  min-height: 28px;
  padding: 3px 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  font: inherit;
  font-size: 1em;
  color: var(--ink);
  box-sizing: border-box;
}
.grid-edit .cell:hover { border-color: #d5ddd8; background: #fff; }
.grid-edit .cell:focus {
  outline: none;
  border-color: var(--sage);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 107, 82, 0.12);
}
.grid-edit .cell-num {
  width: 4.5em;
  max-width: 4.5em;
  min-width: 0;
  margin-left: auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-left: 4px;
  padding-right: 4px;
}
.grid-edit .cell-num::-webkit-outer-spin-button,
.grid-edit .cell-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.grid-edit .cell-num[type=number] { -moz-appearance: textfield; appearance: textfield; }
.grid-edit th.num,
.grid-edit td.num { width: 1%; white-space: nowrap; }
.grid-mini .cell-num {
  width: 4.5em;
  max-width: 4.5em;
  min-width: 0;
}
.detail-add .cell-num {
  width: 100%;
  max-width: 5.5em;
}
.grid-edit .cell-strong { font-weight: 600; }
.grid-edit .cell[readonly] {
  color: #7d8a82;
  cursor: default;
}
.grid-edit .cell[readonly]:hover,
.grid-edit .cell[readonly]:focus {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.planter-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.grid-edit .cell-name {
  width: 5.5em;
  max-width: 5.5em;
  min-width: 0;
  flex: none;
}
.planter-more,
.planter-del {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #d5ddd8;
  border-radius: 6px;
  background: #fff;
  color: #7d8a82;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  font-weight: 600;
}
.planter-more:hover { border-color: var(--sage); color: var(--sage-deep); background: #eef6f1; }
.planter-del:hover { border-color: #c45c5c; color: #a33; background: #fff5f5; }
.plot-row.is-split-child td { background: #f7faf8; }
.split-mark {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  background: #e5efe9;
  color: #4d6b58;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
}
.muted { color: #9aa89f; }
.planter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #d5ddd8;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 0.86rem;
  color: var(--sage-deep);
  cursor: pointer;
}
.planter-btn:hover { border-color: var(--sage); }
.planter-btn.open .chev { transform: rotate(180deg); }
.planter-btn .chev { display: inline-block; transition: transform .15s ease; font-size: 0.75rem; color: #99a59c; }
.detail-row td {
  background: #f7faf8;
  padding: 0 !important;
  border-bottom: 1px solid #e2ebe5;
}
.detail-panel { padding: 14px 16px 16px; }
.detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}
.detail-head .muted { color: #7d8a82; font-size: 0.82rem; }
.detail-empty { margin: 0 0 10px; color: #99a59c; font-size: 0.9rem; }
.detail-add {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr repeat(4, 0.8fr) 1fr auto;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.detail-add .cell {
  border: 1px solid #d5ddd8;
  background: #fff;
}
.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.86rem;
}
.grid-mini { font-size: 0.86rem; }
.grid-mini th, .grid-mini td { padding: 6px 8px; }
.save-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(20, 40, 30, 0.16);
  color: #fff;
}
.save-toast.ok { background: #2f6b52; }
.save-toast.err { background: #b42318; }

.group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid #eef2ef;
  background: #fbfcfb;
}
.group-tab {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 9px;
  border: 1px solid #d5ddd8;
  border-radius: 6px;
  background: #fff;
  color: #617068;
  text-decoration: none;
  font-size: 0.88em;
  font-weight: 600;
}
.group-tab:hover { border-color: var(--sage); color: var(--sage-deep); }
.group-tab.is-active {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}
.grid .id-card {
  font-variant-numeric: tabular-nums;
  font-size: 0.88em;
  color: #617068;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.grid .total-row td {
  background: #f4f8f5;
  font-weight: 600;
  border-top: 2px solid #d7e4db;
}
.grid tr.group-break td {
  border-top: 2px solid #e2ebe5;
}

.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 35, 28, 0.45);
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(20, 40, 30, 0.22);
  padding: 16px 18px 18px;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--ink);
}
.modal-sub {
  margin: 4px 0 0;
  color: #7d8a82;
  font-size: 0.86rem;
}
.modal-x {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #f0f4f1;
  font-size: 1.3rem;
  line-height: 1;
  color: #617068;
  cursor: pointer;
}
.modal-x:hover { background: #e4ebe6; }
.modal-add { margin-top: 14px; }
body.modal-open { overflow: hidden; }

@media (max-width: 1100px) {
  .detail-add {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 960px) {
  .kpi-row, .kpi-row-4, .stat-strip, .split-2 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 720px) {
  .page-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .kpi-row, .kpi-row-4, .stat-strip, .split-2, .crop-4 {
    grid-template-columns: 1fr;
  }
  .page { width: calc(100% - 28px); }
}
