﻿:root {
  --green: #1f7a4d;
  --green-2: #2fa46a;
  --dark-green: #0b2f22;
  --black: #050807;
  --white: #ffffff;
  --surface: #f7faf6;
  --surface-2: #eef5ef;
  --line: #dde7df;
  --muted: #647067;
  --amber: #c4891f;
  --red: #b84532;
  --blue: #3766d6;
  --shadow: 0 20px 55px rgba(12, 35, 25, 0.11);
  --shadow-sm: 0 10px 25px rgba(12, 35, 25, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --font-ui: Inter, Manrope, system-ui, sans-serif;
  --font-display: Sora, "Space Grotesk", Inter, sans-serif;
  --sidebar-bg: #050807;
  --sidebar-surface: rgba(255, 255, 255, 0.06);
  --sidebar-surface-strong: rgba(255, 255, 255, 0.11);
  --sidebar-border: rgba(255, 255, 255, 0.12);
  --sidebar-text: #ffffff;
  --sidebar-muted: rgba(255, 255, 255, 0.68);
  --sidebar-rail: 46px;
}

[data-theme="dark"] {
  --black: #f8fbf8;
  --white: #07110d;
  --surface: #030806;
  --surface-2: #0b1711;
  --line: #193528;
  --muted: #9bad9f;
  --shadow: 0 20px 65px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.28);
  --sidebar-bg: #030806;
  --sidebar-surface: rgba(255, 255, 255, 0.07);
  --sidebar-surface-strong: rgba(47, 164, 106, 0.22);
  --sidebar-border: rgba(124, 180, 146, 0.22);
  --sidebar-text: #f8fbf8;
  --sidebar-muted: rgba(226, 238, 229, 0.72);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--black);
  font-family: var(--font-ui);
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  gap: 18px;
  padding: 18px;
}

.login-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: var(--black);
  color: var(--white);
  padding: clamp(30px, 7vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(var(--green) 1px, transparent 1px),
    linear-gradient(90deg, var(--green) 1px, transparent 1px);
  background-size: 54px 54px;
  transform: rotate(-2deg) scale(1.05);
}

.login-hero > * {
  position: relative;
}

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

.brand-lockup img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: block;
  border-radius: 12px;
}

.brand-lockup strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.login-card-brand {
  margin-bottom: 22px;
}

.hero-title {
  max-width: 860px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-2);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-title h1,
.page-title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 9vw, 8.8rem);
  line-height: 0.86;
  letter-spacing: -0.07em;
}

.hero-title p {
  margin: 22px 0 0;
  max-width: 640px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.12rem;
  line-height: 1.7;
}

.login-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-panel h2,
.panel h2,
.panel h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}

.login-panel h2 {
  font-size: 2rem;
}

.login-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.terms-consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.45;
}

.terms-consent input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--green);
}

.terms-consent a,
.terms-page a {
  color: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.terms-consent a:hover,
.terms-page a:hover {
  text-decoration: underline;
}

label {
  display: grid;
  gap: 7px;
  color: var(--black);
  font-weight: 800;
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--black);
  padding: 11px 12px;
  outline: 0;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 122, 77, 0.14);
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 44px;
  padding: 11px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 12px 24px rgba(31, 122, 77, 0.22);
}

.btn-secondary {
  background: var(--white);
  color: var(--black);
  border-color: var(--line);
}

.btn-danger {
  background: #b84532;
  color: var(--white);
  border-color: #b84532;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 220ms ease;
}

.shell.sidebar-collapsed {
  grid-template-columns: 70px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 12;
  overflow: visible;
  transition: background 180ms ease, width 220ms ease, transform 220ms ease, padding 220ms ease;
}

.sidebar-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  gap: 10px;
}

.sidebar .brand-lockup {
  display: grid;
  grid-template-columns: var(--sidebar-rail) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.sidebar .brand-lockup img {
  width: 36px;
  height: 36px;
  justify-self: center;
  border-radius: 10px;
}

.sidebar .brand-lockup strong,
.nav-label,
.sidebar-footer {
  transition: opacity 160ms ease, transform 180ms ease, width 180ms ease;
}

.sidebar-toggle,
.hamburger {
  width: 36px;
  height: 36px;
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  background: var(--sidebar-surface);
  color: var(--sidebar-text);
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  transition: background 180ms ease, transform 180ms ease;
}

.sidebar-toggle:hover,
.hamburger:hover {
  background: var(--sidebar-surface-strong);
  transform: translateY(-1px);
}

.sidebar-collapsed .sidebar-toggle {
  transform: rotate(180deg);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  position: relative;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--sidebar-muted);
  padding: 0;
  text-align: left;
  font-weight: 800;
  display: grid;
  grid-template-columns: var(--sidebar-rail) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 44px;
  width: 100%;
  white-space: nowrap;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav button:hover {
  background: var(--sidebar-surface);
  color: var(--sidebar-text);
  transform: translateX(2px);
}

.nav button.active {
  background: var(--sidebar-surface-strong);
  color: var(--sidebar-text);
  box-shadow: inset 3px 0 0 var(--green-2);
}

.nav-icon {
  width: 22px;
  height: 22px;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.icon {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  margin-top: auto;
  border: 1px solid var(--sidebar-border);
  border-radius: 16px;
  padding: 14px;
  color: var(--sidebar-muted);
  background: var(--sidebar-surface);
}

.sidebar-collapsed .sidebar {
  align-items: center;
  padding-left: 12px;
  padding-right: 12px;
}

.sidebar-collapsed .sidebar .brand-lockup strong,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .sidebar-footer {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
}

.sidebar-collapsed .sidebar .brand-lockup strong,
.sidebar-collapsed .nav-label {
  width: 0;
  overflow: hidden;
}

.sidebar-collapsed .sidebar-footer {
  width: var(--sidebar-rail);
  height: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

.sidebar-collapsed .sidebar .brand-lockup {
  width: var(--sidebar-rail);
  grid-template-columns: var(--sidebar-rail);
  padding: 0;
}

.sidebar-collapsed .sidebar-head {
  width: var(--sidebar-rail);
  grid-template-columns: var(--sidebar-rail);
  justify-items: center;
  gap: 10px;
}

.sidebar-collapsed .sidebar-toggle {
  width: 34px;
  height: 34px;
}

.sidebar-collapsed .nav {
  width: var(--sidebar-rail);
}

.sidebar-collapsed .nav button {
  grid-template-columns: var(--sidebar-rail);
  justify-content: center;
  width: var(--sidebar-rail);
  min-height: 46px;
  padding: 0;
  transform: none;
}

.sidebar-collapsed .nav button:hover {
  transform: none;
}

.sidebar-collapsed .nav button.active {
  box-shadow: inset 0 0 0 1px var(--sidebar-border);
}

.sidebar-collapsed .nav button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  opacity: 0;
  pointer-events: none;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.78rem;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 20;
}

.sidebar-collapsed .nav button:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.mobile-scrim,
.hamburger {
  display: none;
}

.main {
  min-width: 0;
  padding: 18px 18px 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  min-height: 68px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--black);
  color: var(--white);
  font-weight: 900;
}

.page {
  animation: rise 420ms ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-title {
  margin: 24px 0 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.page-title h1 {
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  color: var(--black);
}

.page-title p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.zeqyra-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.zeqyra-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.zeqyra-hero p {
  color: var(--muted);
  line-height: 1.5;
  margin: 12px 0 0;
}

.health-ring {
  width: 132px;
  aspect-ratio: 1;
  flex: 0 0 132px;
  border: 10px solid rgba(31, 122, 77, 0.2);
  border-radius: 999px;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--surface);
}

.health-ring span {
  display: block;
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 900;
}

.health-ring small {
  color: var(--muted);
  font-weight: 900;
}

.health-ring.watch {
  border-color: rgba(196, 137, 31, 0.34);
}

.health-ring.urgent {
  border-color: rgba(184, 69, 50, 0.34);
}

.kpi-grid,
.prediction-grid,
.two-grid,
.three-grid {
  display: grid;
  gap: 14px;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.prediction-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.three-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.kpi,
.prediction-card,
.onboarding-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel {
  padding: 18px;
  min-width: 0;
}

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

.unframed-heading {
  margin: 0 0 12px;
}

.priority-list {
  display: grid;
  gap: 10px;
}

.priority-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 12px;
  background: var(--surface);
}

.priority-card.risk-high {
  border-left-color: var(--red);
}

.priority-card.risk-medium {
  border-left-color: var(--amber);
}

.priority-card p {
  margin: 2px 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.pest-card .mini-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-metrics div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.mini-metrics div.risk-low {
  background: #1f7a4d;
  border-color: #1f7a4d;
  color: #ffffff;
}

.mini-metrics div.risk-medium {
  background: #f0c14b;
  border-color: #f0c14b;
  color: #1c1404;
}

.mini-metrics div.risk-high {
  background: #b84532;
  border-color: #b84532;
  color: #ffffff;
}

.mini-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.mini-metrics div.risk-low span,
.mini-metrics div.risk-low strong,
.mini-metrics div.risk-high span,
.mini-metrics div.risk-high strong {
  color: #ffffff;
}

.mini-metrics div.risk-medium span,
.mini-metrics div.risk-medium strong {
  color: #1c1404;
}

.mini-metrics strong {
  display: block;
  margin-top: 3px;
}

.quick-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.report-builder {
  margin-bottom: 14px;
}

.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-header p,
.kpi p,
.prediction-card p,
.record-row p {
  color: var(--muted);
  line-height: 1.5;
}

.risk-score-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.risk-score-pair > div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--soft);
}

.risk-score-pair span,
.risk-score-pair small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.risk-score-pair strong {
  display: block;
  margin: 4px 0;
  color: var(--black);
  font-size: 1.8rem;
}

.spray-adjustment-note {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(28, 128, 79, 0.22);
  border-radius: 14px;
  background: rgba(28, 128, 79, 0.08);
}

.spray-adjustment-note strong,
.spray-adjustment-note small {
  color: var(--green-dark);
}

.kpi {
  padding: 16px;
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.kpi-value {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.trend {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
}

.risk-pill,
.notice-pill {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.risk-low {
  background: rgba(31, 122, 77, 0.11);
  color: var(--green);
}

.risk-medium {
  background: rgba(196, 137, 31, 0.14);
  color: var(--amber);
}

.risk-high {
  background: rgba(184, 69, 50, 0.12);
  color: var(--red);
}

.prediction-card {
  padding: 18px;
  overflow: hidden;
  position: relative;
}

.prediction-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 0 18px;
  height: 4px;
  background: var(--green);
  border-radius: 999px 999px 0 0;
}

.score {
  margin: 18px 0 8px;
  font-family: var(--font-display);
  font-size: 3.2rem;
  line-height: 1;
  letter-spacing: -0.06em;
  font-weight: 800;
}

.chart {
  width: 100%;
  height: 260px;
  display: block;
}

.trap-trend-stack {
  display: grid;
  gap: 18px;
}

.trap-chart-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow-x: auto;
}

.trap-chart-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.trap-chart-title h3 {
  margin: 0;
  font-size: 1rem;
}

.chart-legend-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.chart-legend-dot::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--green);
}

.trap-trend-chart {
  display: block;
  width: min(100%, var(--chart-width, 920px));
  min-width: min(100%, 560px);
  height: auto;
  color: var(--black);
}

.trap-trend-chart.wide {
  width: var(--chart-width, 920px);
  min-width: var(--chart-width, 920px);
}

.chart-gridline line {
  stroke: rgba(20, 33, 28, 0.1);
  stroke-width: 1;
}

.chart-gridline text,
.trap-date-label,
.trap-value-label {
  fill: var(--black);
  font-weight: 900;
}

.chart-gridline text {
  font-size: 13px;
}

.chart-axis {
  stroke: rgba(20, 33, 28, 0.28);
  stroke-width: 1.5;
}

.trap-trend-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trap-point circle {
  fill: var(--white);
  stroke: var(--green);
  stroke-width: 5;
}

.trap-value-label {
  font-size: 17px;
}

.trap-date-label {
  font-size: 12px;
}

.trap-chart-empty {
  display: grid;
  gap: 6px;
  min-height: 180px;
  place-content: center;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}

.orchard-map-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.orchard-map-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.map-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.map-search-form,
.map-mode-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.map-search-form input {
  min-width: min(240px, 100%);
  flex: 1 1 180px;
}

.map-mode-buttons,
.map-block-picker {
  grid-column: 1 / -1;
}

.map-mode-buttons .is-active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.map-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
  align-items: stretch;
}

.map {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.leaflet-map {
  height: 560px;
  z-index: 0;
}

.map-side-panel {
  min-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.map-panel-title {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.map-panel-title h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}

.map-panel-grid {
  display: grid;
  gap: 10px;
}

.map-panel-empty,
.map-fallback {
  display: grid;
  place-content: center;
  min-height: 280px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.orchard-marker {
  display: grid;
  place-items: center;
}

.orchard-marker span {
  width: 24px;
  height: 24px;
  display: block;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 8px 18px rgba(5, 8, 7, 0.24);
  transform: rotate(-45deg);
}

.map-help {
  padding: 0 2px;
}

.leaflet-control-layers {
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-sm) !important;
  font: 12px var(--font-ui) !important;
}

.spray-progress-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.spray-progress-copy {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.spray-progress-copy strong {
  font: 800 28px/1 var(--font-display);
  color: var(--black);
}

.spray-progress-copy span {
  color: var(--muted);
  font-weight: 700;
}

.spray-progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.spray-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1f7a4d;
  transition: width 240ms ease;
}

.spray-coverage-panel {
  gap: 16px;
}

.spray-coverage-panel .map-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  align-items: start;
}

.spray-coverage-panel .map,
.spray-coverage-panel .leaflet-map {
  min-height: 580px;
  height: 580px;
}

.coverage-legend,
.coverage-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.coverage-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.coverage-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #b84532;
}

.coverage-dot.sprayed,
.coverage-status-pill.sprayed {
  background: #1f7a4d;
}

.coverage-dot.needs_spray,
.coverage-status-pill.needs_spray {
  background: #b84532;
}

.coverage-dot.scheduled,
.coverage-status-pill.scheduled {
  background: #c4891f;
}

.coverage-dot.not_applicable,
.coverage-status-pill.not_applicable {
  background: #7a817c;
}

.coverage-filters {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.coverage-filters label {
  display: grid;
  min-width: 180px;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.coverage-filters select,
.coverage-action-form select,
.coverage-action-form input,
.coverage-action-form textarea,
.last-row-form input {
  width: 100%;
}

.coverage-side-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  height: auto;
}

.coverage-status-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.coverage-action-form,
.last-row-form {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.coverage-action-form label,
.last-row-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.last-row-form {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.coverage-detail-panel {
  display: grid;
  gap: 12px;
  margin-top: 2px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-header.compact {
  padding-bottom: 0;
}

.panel-header.compact h3 {
  margin: 0;
  font-family: var(--font-display);
}

.coverage-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.coverage-info-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.coverage-info-card strong {
  color: var(--black);
  font: 800 18px/1.2 var(--font-display);
}

.coverage-info-card span {
  color: var(--muted);
  line-height: 1.4;
}

.coverage-wide-card {
  grid-column: span 2;
}

.coverage-timeline,
.coverage-history-list {
  display: grid;
  gap: 10px;
}

.coverage-timeline div {
  display: grid;
  gap: 2px;
  padding-left: 12px;
  border-left: 3px solid #1f7a4d;
}

.coverage-marker span {
  box-shadow: 0 10px 22px rgba(5, 8, 7, 0.28);
}

.assistant {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 480px;
}

.chat-log {
  display: grid;
  gap: 10px;
  align-content: end;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.bubble {
  border-radius: 16px;
  padding: 12px;
  line-height: 1.45;
  color: var(--black);
  background: var(--surface-2);
}

.bubble.user {
  background: var(--green);
  color: white;
  margin-left: 24px;
}

.chat-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.chat-form input {
  min-width: 0;
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-row {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 12px;
}

.record-row strong {
  display: block;
  margin-bottom: 4px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.source-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 0.82rem;
  font-weight: 800;
}

.source-chip.ok {
  color: var(--green);
  border-color: rgba(31, 122, 77, 0.25);
  background: rgba(31, 122, 77, 0.1);
}

.source-chip.warn {
  color: var(--amber);
  border-color: rgba(196, 137, 31, 0.28);
  background: rgba(196, 137, 31, 0.1);
}

.source-chip.error {
  color: var(--red);
  border-color: rgba(184, 69, 50, 0.26);
  background: rgba(184, 69, 50, 0.1);
}

.weather-freshness {
  display: inline-grid;
  gap: 2px;
  min-width: 128px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.15;
}

.weather-freshness strong {
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.weather-freshness small {
  color: var(--muted);
  font-weight: 800;
}

.weather-freshness.live {
  border-color: rgba(31, 122, 77, 0.32);
  background: rgba(31, 122, 77, 0.12);
}

.weather-freshness.live strong {
  color: var(--green);
}

.weather-freshness.updating {
  border-color: rgba(196, 137, 31, 0.34);
  background: rgba(196, 137, 31, 0.12);
}

.weather-freshness.updating strong {
  color: var(--amber);
}

.weather-freshness.outdated {
  border-color: rgba(184, 69, 50, 0.3);
  background: rgba(184, 69, 50, 0.1);
}

.weather-freshness.outdated strong {
  color: var(--red);
}

.forecast-source-note {
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.weather-verified-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.weather-verified-badge.verified {
  border-color: rgba(31, 122, 77, 0.35);
  background: rgba(31, 122, 77, 0.14);
  color: var(--green);
}

.weather-verified-badge.unverified {
  border-color: rgba(196, 137, 31, 0.32);
  background: rgba(196, 137, 31, 0.12);
  color: var(--amber);
}

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

.validation-card {
  min-width: 0;
}

.validation-table {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.validation-row {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(0, 0.8fr));
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.84rem;
  font-weight: 800;
}

.validation-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.validation-head {
  background: var(--surface-2);
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
}

.validation-row.pass {
  border-color: rgba(31, 122, 77, 0.22);
}

.validation-row.fail {
  border-color: rgba(184, 69, 50, 0.3);
  background: rgba(184, 69, 50, 0.08);
}

.validation-row.skip {
  color: var(--muted);
}

.weather-setup {
  margin-bottom: 18px;
}

.first-orchard-page {
  display: grid;
  gap: 22px;
}

.first-orchard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 20px;
  align-items: stretch;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.first-orchard-hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  letter-spacing: 0;
}

.first-orchard-hero p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.setup-status-card {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--soft);
}

.setup-status-card strong {
  font-size: 1.05rem;
  line-height: 1.35;
}

.setup-status-card small {
  color: var(--muted);
  line-height: 1.45;
}

.first-orchard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.first-orchard-form {
  display: grid;
  gap: 14px;
}

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

.first-orchard-side {
  position: sticky;
  top: 18px;
}

.debug-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.debug-toggle input {
  width: 18px;
  min-height: 18px;
}

.alert-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--black);
  font-weight: 900;
}

.alert-toggle input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--green);
}

.alert-checklist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.alert-checklist .form-note {
  grid-column: 1 / -1;
  font-weight: 900;
}

.compact-list {
  margin-top: 14px;
}

.form-note {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.onboarding {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.onboarding-card {
  padding: 18px;
}

.step-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--black);
  color: var(--white);
  font-weight: 900;
  margin-bottom: 18px;
}

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

.full {
  grid-column: 1 / -1;
}

.auth-error {
  border: 1px solid rgba(185, 28, 28, 0.22);
  border-radius: 12px;
  background: rgba(254, 242, 242, 0.9);
  color: #991b1b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  padding: 11px 12px;
}

[data-theme="dark"] .auth-error {
  background: rgba(127, 29, 29, 0.22);
  border-color: rgba(248, 113, 113, 0.32);
  color: #fecaca;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  color: var(--black);
  box-shadow: var(--shadow);
  padding: 14px;
  animation: rise 280ms ease both;
}

.terms-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(31, 122, 77, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(31, 122, 77, 0.08) 1px, transparent 1px),
    var(--surface);
  background-size: 72px 72px;
  color: var(--black);
}

.terms-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.terms-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 28px;
}

.terms-document {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 56px);
}

.terms-document header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
  padding-bottom: 24px;
}

.terms-document h1,
.terms-document h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}

.terms-document h1 {
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  line-height: 0.96;
}

.terms-document h2 {
  font-size: 1.25rem;
  margin-top: 28px;
}

.terms-document p,
.terms-document li {
  color: var(--muted);
  line-height: 1.72;
}

.terms-document ul {
  padding-left: 22px;
}

.terms-callout {
  border: 1px solid rgba(31, 122, 77, 0.28);
  border-radius: 16px;
  background: rgba(31, 122, 77, 0.08);
  color: var(--black);
  font-weight: 800;
  line-height: 1.65;
  padding: 16px;
}

.inline-notice,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--black);
  padding: 16px;
}

.inline-notice {
  margin: 0 0 18px;
}

.inline-notice p,
.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
}

.empty-state .btn {
  margin-top: 12px;
}

.quick-start {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

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

.check-item {
  display: grid;
  gap: 6px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--black);
  padding: 12px;
  cursor: pointer;
}

.check-item span {
  width: max-content;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.check-item.done span {
  background: var(--green);
}

.check-item small {
  color: var(--muted);
}

.block-editor {
  padding: 12px;
}

.block-editor .table-form {
  gap: 10px;
}

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 292px;
    height: 100vh;
    transform: translateX(-105%);
    box-shadow: var(--shadow);
    padding: 16px;
  }

  .shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .shell.mobile-menu-open .sidebar {
    align-items: stretch;
    transform: translateX(0);
  }

  .shell.mobile-menu-open .sidebar .brand-lockup {
    width: auto;
    grid-template-columns: var(--sidebar-rail) minmax(0, 1fr);
  }

  .shell.mobile-menu-open .sidebar .brand-lockup strong,
  .shell.mobile-menu-open .nav-label,
  .shell.mobile-menu-open .sidebar-footer {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .shell.mobile-menu-open .nav button {
    width: 100%;
    grid-template-columns: var(--sidebar-rail) minmax(0, 1fr);
    justify-content: initial;
    padding: 0;
  }

  .shell.mobile-menu-open .sidebar-head {
    width: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
  }

  .mobile-scrim {
    position: fixed;
    inset: 0;
    z-index: 11;
    display: none;
    border: 0;
    background: rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(2px);
  }

  .shell.mobile-menu-open .mobile-scrim {
    display: block;
  }

  .hamburger {
    display: grid;
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
  }
}

@media (max-width: 900px) {
  .zeqyra-hero {
    display: grid;
  }

  .health-ring {
    width: 108px;
    justify-self: start;
  }

  .login-screen,
  .first-orchard-hero,
  .first-orchard-layout,
  .kpi-grid,
  .prediction-grid,
  .status-grid,
  .two-grid,
  .three-grid,
  .onboarding {
    grid-template-columns: 1fr;
  }

  .login-screen {
    padding: 10px;
  }

  .login-hero {
    min-height: 420px;
  }

  .page-title {
    display: grid;
  }

  .topbar {
    align-items: stretch;
    display: grid;
  }

  .top-actions {
    justify-content: space-between;
  }

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

  .alert-checklist {
    grid-template-columns: 1fr;
  }

  .map-toolbar,
  .map-workspace {
    grid-template-columns: 1fr;
  }

  .spray-coverage-panel .map-workspace {
    grid-template-columns: 1fr;
  }

  .spray-coverage-panel .map,
  .spray-coverage-panel .leaflet-map {
    min-height: 480px;
    height: 480px;
  }

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

  .coverage-wide-card {
    grid-column: 1 / -1;
  }

  .coverage-filters,
  .spray-progress-copy {
    display: grid;
    align-items: stretch;
  }

  .coverage-filters label {
    min-width: 0;
  }

  .map,
  .leaflet-map,
  .map-side-panel {
    min-height: 420px;
    height: 420px;
  }

  .map-side-panel {
    height: auto;
  }

  .spray-coverage-panel .coverage-side-panel {
    min-height: 0;
    height: auto;
  }

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

  .priority-card {
    grid-template-columns: 1fr;
  }

  .quick-action-grid .btn {
    width: 100%;
  }

  .report-row {
    display: grid;
  }

  .trap-chart-title {
    align-items: flex-start;
    display: grid;
  }

  .first-orchard-side {
    position: static;
  }
}

@media (max-width: 520px) {
  .first-orchard-hero {
    padding: 20px;
    border-radius: 18px;
  }

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

  .risk-score-pair {
    grid-template-columns: 1fr;
  }

  .spray-coverage-panel .map,
  .spray-coverage-panel .leaflet-map {
    min-height: 400px;
    height: 400px;
  }

  .coverage-detail-grid {
    grid-template-columns: 1fr;
  }

  .trap-chart-card {
    padding: 12px;
  }

  .trap-trend-chart {
    min-width: min(100%, 520px);
  }

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

@media print {
  .trap-chart-card {
    break-inside: avoid;
    overflow: visible;
  }

  .trap-trend-chart {
    min-width: 0;
  }
}

