:root {
  --paper: #f4f7f1;
  --paper-2: #eaf1e7;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --ink: #17352c;
  --muted: #66796f;
  --line: #cfdcd4;
  --leaf: #15803d;
  --leaf-2: #22c55e;
  --river: #0ea5e9;
  --amber: #f59e0b;
  --rose: #ef4444;
  --indigo: #4f46e5;
  --shadow: 0 18px 50px rgba(19, 60, 48, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(244, 247, 241, 0.94), rgba(234, 241, 231, 0.94)),
    linear-gradient(90deg, rgba(21, 128, 61, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(14, 165, 233, 0.08) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

button {
  color: inherit;
}

.boot,
.login-shell {
  min-height: 100vh;
}

.boot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.boot-mark,
.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px 16px 16px 4px;
  background: linear-gradient(135deg, #15803d, #0ea5e9);
  color: #fff;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.boot h1,
.brand h1 {
  margin: 0;
}

.boot p,
.brand p {
  margin: 4px 0 0;
  color: var(--muted);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(340px, 430px) 1fr;
}

.login-panel {
  display: grid;
  align-content: center;
  gap: 28px;
  padding: 44px;
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--line);
}

.login-panel .brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-form,
.field,
.profile-form,
.task-form {
  display: grid;
  gap: 12px;
}

.field {
  gap: 7px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.login-error {
  min-height: 20px;
  color: var(--rose);
  font-size: 13px;
}

.login-visual {
  min-height: 100vh;
  padding: 44px;
  display: grid;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.14), transparent 48%),
    linear-gradient(45deg, rgba(34, 197, 94, 0.16), transparent 55%),
    #edf7ef;
}

.visual-board {
  width: min(820px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.visual-map,
.visual-stack article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.visual-map {
  min-height: 430px;
  padding: 26px;
  display: grid;
  align-content: end;
  background:
    linear-gradient(120deg, transparent 0 46%, rgba(14, 165, 233, 0.3) 47% 49%, transparent 50%),
    linear-gradient(20deg, transparent 0 56%, rgba(21, 128, 61, 0.24) 57% 59%, transparent 60%),
    #f9fff8;
}

.visual-map h2 {
  margin: 0;
  font-size: 34px;
}

.visual-map p {
  max-width: 420px;
  color: var(--muted);
  line-height: 1.7;
}

.visual-stack {
  display: grid;
  gap: 12px;
}

.visual-stack article {
  padding: 18px;
}

.visual-stack strong {
  display: block;
  margin-bottom: 12px;
}

.visual-stack span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 92px 1fr;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 14px 10px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.rail-logo {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border-radius: 16px 16px 16px 4px;
  background: linear-gradient(135deg, var(--leaf), var(--river));
  color: #fff;
  font-weight: 900;
}

.rail-nav {
  display: grid;
  gap: 8px;
  align-content: start;
}

.rail-tab {
  min-height: 62px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  gap: 3px;
  cursor: pointer;
}

.rail-tab b {
  font-size: 18px;
}

.rail-tab span {
  font-size: 12px;
}

.rail-tab.active,
.rail-tab:hover {
  border-color: rgba(21, 128, 61, 0.38);
  background: rgba(21, 128, 61, 0.09);
  color: var(--leaf);
}

.rail-status {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--leaf-2);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.7);
}

.dot.warn {
  background: var(--amber);
}

.dot.off {
  background: var(--rose);
}

.page {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 78px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 247, 241, 0.88);
  backdrop-filter: blur(18px);
}

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

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

.top-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  padding: 7px 11px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.btn:hover {
  border-color: rgba(21, 128, 61, 0.42);
  background: #f7fbf5;
}

.btn-primary {
  border-color: rgba(21, 128, 61, 0.68);
  background: linear-gradient(135deg, #15803d, #22c55e);
  color: #fff;
  font-weight: 800;
}

.btn-danger {
  border-color: rgba(239, 68, 68, 0.3);
  background: #fff1f2;
  color: #b91c1c;
}

.btn-small {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.btn-icon {
  width: 38px;
  padding: 0;
  font-weight: 800;
}

.content {
  padding: 16px;
}

.view.hidden {
  display: none;
}

.command-layout {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(560px, 1fr) minmax(280px, 360px);
  gap: 12px;
  min-height: calc(100vh - 110px);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  min-height: 56px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-title {
  display: grid;
  gap: 3px;
}

.panel-title h2,
.panel-title h3 {
  margin: 0;
  font-size: 16px;
}

.panel-title span {
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 14px;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric {
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f6fbf4);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin: 9px 0 7px;
  font-size: 34px;
  line-height: 1;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.segment {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.segment.active {
  border-color: rgba(21, 128, 61, 0.58);
  background: rgba(21, 128, 61, 0.1);
  color: var(--leaf);
  font-weight: 800;
}

.asset-list,
.task-list,
.alarm-list,
.plan-list {
  display: grid;
  gap: 8px;
}

.asset-item {
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.asset-item.active {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.badge {
  width: 44px;
  height: 44px;
  border-radius: 14px 14px 14px 4px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: var(--leaf);
}

.asset-main strong {
  display: block;
  font-size: 14px;
}

.asset-main span,
.asset-meta {
  color: var(--muted);
  font-size: 12px;
}

.asset-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.tag {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2f1;
  color: var(--muted);
  font-size: 12px;
}

.tag.online,
.tag.done {
  color: #166534;
  background: #dcfce7;
}

.tag.warning,
.tag.high {
  color: #92400e;
  background: #fef3c7;
}

.tag.offline,
.tag.urgent {
  color: #991b1b;
  background: #fee2e2;
}

.tag.active {
  color: #075985;
  background: #e0f2fe;
}

.map-panel {
  position: relative;
  min-height: 640px;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 640px;
  background: #eef3ef;
}

.map-card {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 700;
  width: min(340px, calc(100% - 28px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.map-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.map-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 12px;
  font-size: 12px;
}

.map-card dt {
  color: var(--muted);
}

.map-card dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.map-tools {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 700;
  display: flex;
  gap: 8px;
}

.legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 700;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.leaflet-container {
  background: #eef3ef;
  font-family: inherit;
}

.asset-marker {
  position: relative;
  width: 56px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 30px 30px 30px 6px;
  transform: rotate(-18deg);
  border: 2px solid #fff;
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.28), transparent 28%),
    var(--marker-color, var(--leaf));
  box-shadow: 0 14px 26px rgba(20, 70, 50, 0.28), 0 0 0 6px rgba(34, 197, 94, 0.12);
  color: #fff;
}

.asset-marker::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: -7px;
  width: 18px;
  height: 9px;
  border-radius: 0 0 18px 18px;
  background: #166534;
}

.asset-marker svg {
  width: 28px;
  height: 28px;
  transform: rotate(18deg);
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.asset-marker.person svg circle {
  fill: currentColor;
  stroke: none;
}

.asset-marker.warning {
  box-shadow: 0 14px 26px rgba(20, 70, 50, 0.28), 0 0 0 6px rgba(245, 158, 11, 0.16);
}

.asset-marker.offline {
  box-shadow: 0 14px 26px rgba(20, 70, 50, 0.28), 0 0 0 6px rgba(239, 68, 68, 0.14);
}

.popup-card {
  min-width: 210px;
}

.popup-card strong,
.popup-card span {
  display: block;
}

.popup-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.right-stack,
.operations-grid,
.registry-grid,
.report-grid {
  display: grid;
  gap: 12px;
}

.task-card,
.alarm-card,
.plan-card,
.dispatch-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.task-card {
  display: grid;
  gap: 8px;
}

.task-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.task-head strong {
  display: block;
}

.task-head span,
.task-card p,
.alarm-card span,
.plan-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.task-card p {
  margin: 0;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.registry-grid {
  grid-template-columns: minmax(560px, 1fr) minmax(340px, 420px);
  align-items: start;
}

.table-wrap {
  overflow-x: auto;
}

.asset-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.asset-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.data-table th {
  color: var(--muted);
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:hover td,
.data-table tbody tr.selected td {
  background: #f0fdf4;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.profile-actions .btn {
  min-width: 118px;
}

.profile-actions .btn-primary {
  margin-top: 0;
}

.yz-gps-page {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(520px, 1.25fr);
  gap: 14px;
  align-items: start;
}

.gps-intake-panel {
  border-left: 5px solid #16a34a;
}

.gps-ledger-panel {
  grid-row: span 2;
}

.gps-bind-form {
  display: grid;
  gap: 12px;
}

.gps-bind-form textarea {
  min-height: 148px;
  resize: vertical;
  border: 1px solid #cfe2d4;
  border-radius: 18px 18px 18px 4px;
  padding: 14px;
  font: inherit;
  background: #fbfff9;
}

.gps-bind-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.gps-bind-row input,
.gps-binding-row select {
  min-height: 40px;
  border: 1px solid #cfe2d4;
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
}

.gps-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.gps-stat-row article {
  padding: 12px;
  border-radius: 16px 16px 16px 4px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.gps-stat-row span,
.gps-field-stack span,
.gps-device-meta,
.gps-position {
  color: var(--muted);
  font-size: 12px;
}

.gps-stat-row strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  color: var(--leaf);
}

.gps-device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(270px, 1fr));
  gap: 12px;
}

.gps-device-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d9eadc;
  border-radius: 22px 22px 22px 6px;
  background: linear-gradient(135deg, #ffffff, #f7fff5);
  box-shadow: 0 12px 30px rgba(21, 128, 61, 0.08);
}

.gps-device-card.is-bound {
  border-color: rgba(21, 128, 61, 0.34);
}

.gps-device-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.gps-device-head span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
}

.gps-device-head strong {
  font-size: 15px;
}

.gps-device-meta,
.gps-position {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gps-bound-asset {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ecfdf5;
}

.gps-bound-asset span {
  color: var(--muted);
  font-size: 12px;
}

.gps-binding-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.gps-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.gps-field-stack {
  display: grid;
  gap: 10px;
}

.gps-field-stack article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-left: 4px solid #86efac;
  background: #f7fff5;
}

.operations-grid {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
}

.report-grid {
  grid-template-columns: minmax(340px, 0.8fr) minmax(520px, 1.2fr);
}

.mini-map {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(115deg, transparent 0 44%, rgba(14, 165, 233, 0.18) 45% 47%, transparent 48%),
    linear-gradient(25deg, transparent 0 58%, rgba(21, 128, 61, 0.16) 59% 61%, transparent 62%),
    #f8fff7;
}

.toast-root,
#toast-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px 13px;
  box-shadow: var(--shadow);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.35);
  color: #991b1b;
}

.toast.success {
  border-color: rgba(21, 128, 61, 0.35);
  color: #166534;
}

.empty {
  min-height: 110px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 16px;
}

.garden-command {
  display: grid;
  grid-template-columns: minmax(380px, 1.2fr) minmax(300px, 0.86fr) minmax(300px, 0.86fr);
  gap: 12px;
  align-items: start;
}

.garden-hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(520px, 1.28fr);
  min-height: 178px;
  background:
    linear-gradient(90deg, rgba(21, 128, 61, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(14, 165, 233, 0.08) 1px, transparent 1px),
    #fbfdf9;
  background-size: 32px 32px;
}

.garden-hero-copy {
  padding: 22px;
  display: grid;
  align-content: center;
  gap: 8px;
  border-right: 1px solid var(--line);
}

.garden-hero-copy span {
  color: var(--leaf);
  font-size: 12px;
  font-weight: 900;
}

.garden-hero-copy h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.garden-hero-copy p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.garden-hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.garden-kpi {
  min-height: 132px;
  border-radius: 0;
  background: #fff;
  border-left: 5px solid var(--leaf);
  box-shadow: 0 8px 22px rgba(19, 60, 48, 0.08);
}

.garden-kpi.kpi-2 {
  border-left-color: var(--river);
}

.garden-kpi.kpi-3 {
  border-left-color: var(--amber);
}

.garden-kpi.kpi-4 {
  border-left-color: var(--rose);
}

.garden-map-strip {
  grid-column: 1 / 3;
  grid-row: 2;
  min-height: 560px;
}

.garden-map-board {
  display: grid;
  grid-template-rows: auto minmax(430px, 1fr) auto;
  background: #fbfdf9;
}

.garden-map-head,
.garden-map-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(21, 128, 61, 0.08) 1px, transparent 1px),
    #f6fbf4;
  background-size: 26px 26px;
}

.garden-map-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.garden-map-head span {
  display: block;
  color: var(--leaf);
  font-size: 12px;
  font-weight: 900;
}

.garden-map-head strong {
  font-size: 16px;
}

.garden-map-body {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 310px;
  min-height: 430px;
}

.garden-map-canvas {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.garden-map-strip #map,
.garden-map-canvas #map {
  min-height: 430px;
}

.garden-map-board .map-card {
  position: static;
  width: auto;
  height: 100%;
  border: 0;
  border-radius: 0;
  border-left: 4px solid var(--leaf);
  background:
    linear-gradient(90deg, rgba(21, 128, 61, 0.08) 1px, transparent 1px),
    #ffffff;
  background-size: 24px 24px;
  box-shadow: none;
  backdrop-filter: none;
}

.garden-map-ledger h3 {
  font-size: 20px;
}

.garden-map-ledger dl {
  gap: 10px 12px;
  font-size: 13px;
}

.garden-map-ledger dt {
  color: var(--leaf);
  font-weight: 800;
}

.garden-map-ledger dd {
  text-align: left;
}

.garden-map-foot .legend {
  position: static;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.garden-map-board .map-tools {
  position: static;
}

.map-workflow {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.map-workflow span {
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--leaf);
  font-weight: 800;
}

.garden-assets {
  grid-column: 3;
  grid-row: 2;
}

.garden-assets .asset-list {
  max-height: 428px;
  overflow: auto;
  padding-right: 2px;
}

.garden-assets .segmented {
  grid-template-columns: 1fr;
  gap: 6px;
}

.garden-assets .segment {
  border-radius: 0 16px 16px 16px;
  text-align: left;
  padding: 0 14px;
  background: #f8fcf7;
}

.garden-office {
  grid-column: 1;
}

.garden-inventory {
  grid-column: 2;
}

.garden-tasks {
  grid-column: 3;
}

.garden-tasks .task-list,
.garden-alarms .alarm-list {
  max-height: 320px;
  overflow: auto;
}

.garden-alarms {
  grid-column: 1 / -1;
}

.office-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.office-grid article {
  min-height: 118px;
  padding: 13px;
  border: 1px solid #dce9df;
  border-left: 4px solid var(--leaf);
  background: #fff;
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.mini-create-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(130px, 0.8fr) minmax(110px, 0.7fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.mini-create-form input,
.mini-create-form select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.office-grid article:nth-child(2) {
  border-left-color: var(--amber);
}

.office-grid article:nth-child(3) {
  border-left-color: var(--river);
}

.office-grid article:nth-child(4) {
  border-left-color: var(--indigo);
}

.office-grid strong,
.office-grid span {
  font-size: 13px;
}

.office-grid b {
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.office-grid span {
  color: var(--muted);
  line-height: 1.5;
}

.inventory-list,
.stock-ledger {
  display: grid;
  gap: 10px;
}

.inventory-list article,
.stock-ledger article {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 4px 10px;
  padding: 12px 0;
  border-bottom: 1px solid #dce9df;
}

.inventory-list article:last-child,
.stock-ledger article:last-child {
  border-bottom: 0;
}

.inventory-list span,
.stock-ledger span {
  grid-row: span 2;
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #f8fcf7;
  color: var(--leaf);
  font-size: 12px;
  font-weight: 800;
}

.inventory-list strong,
.stock-ledger strong {
  font-size: 14px;
}

.inventory-list em,
.stock-ledger em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.yz-office-page,
.yz-inventory-page {
  display: grid;
  gap: 12px;
  align-items: start;
}

.yz-office-page {
  grid-template-columns: minmax(520px, 1.1fr) minmax(320px, 0.9fr);
}

.oa-ledger {
  grid-row: span 2;
}

.requisition-stack,
.oa-todo-board,
.flow-line,
.stock-matrix,
.shelf-list {
  display: grid;
  gap: 10px;
}

.requisition-stack article {
  position: relative;
  min-height: 104px;
  padding: 14px 14px 12px;
  border: 1px solid #dce9df;
  background:
    linear-gradient(90deg, rgba(21, 128, 61, 0.08) 1px, transparent 1px),
    #fff;
  background-size: 26px 26px;
}

.requisition-stack i,
.requisition-stack span,
.requisition-stack b {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.requisition-stack strong {
  display: block;
  margin: 8px 0;
  font-size: 18px;
}

.requisition-stack b {
  position: absolute;
  right: 14px;
  top: 14px;
  min-width: 54px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(21, 128, 61, 0.32);
  color: var(--leaf);
  font-weight: 900;
}

.requisition-stack .row-actions {
  padding-right: 74px;
}

.oa-todo-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.oa-todo-board article {
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.oa-todo-board strong,
.oa-todo-board span,
.oa-todo-board em {
  display: block;
}

.oa-todo-board span {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.oa-todo-board em {
  color: var(--river);
  font-size: 24px;
  font-style: normal;
  font-weight: 900;
}

.flow-line article {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 64px;
}

.flow-line b {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--leaf);
  color: #fff;
}

.flow-line span {
  color: var(--muted);
  line-height: 1.5;
}

.yz-inventory-page {
  grid-template-columns: minmax(360px, 0.9fr) minmax(320px, 0.8fr) minmax(420px, 1fr);
}

.stock-matrix {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stock-matrix article {
  min-height: 132px;
  padding: 14px;
  border: 1px solid #dce9df;
  background: #fff;
  display: grid;
  align-content: space-between;
}

.stock-matrix span,
.stock-matrix small {
  color: var(--muted);
  font-size: 12px;
}

.stock-matrix strong {
  font-size: 38px;
  line-height: 1;
}

.shelf-list article {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 8px 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.shelf-list b {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  color: var(--leaf);
}

.shelf-list span {
  font-weight: 800;
}

.shelf-list strong {
  justify-self: end;
}

.shelf-list em {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.shelf-list .row-actions {
  grid-column: 1 / -1;
}

.garden-actions {
  align-items: stretch;
  gap: 10px;
}

.duty-card {
  min-width: 150px;
  padding: 8px 12px 7px;
  border-left: 4px solid var(--leaf);
  background: #fff;
  box-shadow: 0 8px 22px rgba(19, 60, 48, 0.1);
}

.duty-card span,
.duty-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.duty-card strong {
  display: block;
  margin: 2px 0;
  color: var(--ink);
  font-size: 17px;
}

.leaf-tool {
  width: 58px;
  min-height: 52px;
  border: 0;
  border-radius: 18px 18px 18px 4px;
  background: linear-gradient(180deg, #ffffff, #eff8ee);
  color: var(--leaf);
  box-shadow: inset 0 0 0 1px var(--line), 0 8px 20px rgba(19, 60, 48, 0.12);
  display: grid;
  place-items: center;
  gap: 1px;
  cursor: pointer;
}

.leaf-tool b {
  font-size: 18px;
  line-height: 1;
}

.leaf-tool span {
  font-size: 11px;
}

.sync-ribbon {
  min-width: 112px;
  min-height: 52px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, var(--leaf), var(--river));
  color: #fff;
  padding: 8px 14px;
  display: grid;
  align-content: center;
  justify-items: start;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.sync-ribbon span {
  font-size: 11px;
  opacity: 0.82;
}

.sync-ribbon strong {
  font-size: 15px;
}

.exit-link {
  min-height: 52px;
  border: 0;
  border-bottom: 2px solid var(--leaf);
  background: transparent;
  color: var(--leaf);
  padding: 0 6px;
  font-weight: 800;
  cursor: pointer;
}

.registry-grid > .panel:nth-child(2) {
  background:
    linear-gradient(90deg, rgba(21, 128, 61, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(21, 128, 61, 0.06) 1px, transparent 1px),
    #fbfdf9;
  background-size: 28px 28px;
}

.registry-grid > .panel:nth-child(2) .panel-header {
  display: block;
  padding: 18px 20px;
  background: #f6fbf4;
}

.registry-grid > .panel:nth-child(2) .panel-title h2 {
  font-size: 24px;
  letter-spacing: 0;
}

.profile-form,
.task-form {
  gap: 0;
  border-top: 2px solid var(--leaf);
  background: rgba(255, 255, 255, 0.74);
}

.profile-form .field,
.task-form .field {
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 10px 0;
  border-bottom: 1px solid #dbe7df;
}

.profile-form .field label,
.task-form .field label {
  color: var(--leaf);
  font-weight: 800;
  font-size: 13px;
}

.profile-form .field input,
.profile-form .field select,
.profile-form .field textarea,
.task-form .field input,
.task-form .field select,
.task-form .field textarea {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 8px 2px;
  font-size: 17px;
  box-shadow: none;
}

.profile-form .field textarea,
.task-form .field textarea {
  min-height: 62px;
}

.profile-form .btn-primary,
.task-form .btn-primary {
  justify-self: end;
  min-width: 136px;
  margin-top: 16px;
  border-radius: 0 18px 18px 18px;
}

.profile-actions .btn-primary {
  margin-top: 0;
}

@media (max-width: 1160px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: none;
    align-items: center;
  }

  .rail-nav {
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .rail-tab {
    min-width: 72px;
  }

  .command-layout,
  .garden-command,
  .yz-office-page,
  .yz-inventory-page,
  .registry-grid,
  .report-grid,
  .operations-grid {
    grid-template-columns: 1fr;
  }

  .garden-hero,
  .garden-hero-metrics,
  .stock-matrix {
    grid-template-columns: 1fr 1fr;
  }

  .garden-hero {
    grid-column: auto;
  }

  .garden-map-strip,
  .garden-assets,
  .garden-office,
  .garden-inventory,
  .garden-tasks,
  .garden-alarms,
  .oa-ledger {
    grid-column: auto;
    grid-row: auto;
  }

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

  .garden-map-canvas {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .map-panel,
  #map {
    min-height: 560px;
  }
}

@media (max-width: 760px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .garden-hero,
  .garden-hero-metrics,
  .office-grid,
  .oa-todo-board,
  .stock-matrix,
  .shelf-list,
  .mini-create-form,
  .yz-gps-page,
  .gps-device-grid,
  .gps-bind-row,
  .gps-binding-row {
    grid-template-columns: 1fr;
  }

  .gps-ledger-panel {
    grid-row: auto;
  }

  .garden-map-head,
  .garden-map-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .content {
    padding: 10px;
  }
}
