:root {
  color-scheme: dark;
  --bg: #080a0b;
  --text: #eef1f2;
  --surface: #101315;
  --surface-raised: #111619;
  --surface-end: #0d1012;
  --chrome: #0b0d0f;
  --input-bg: #0b0f11;
  --line: #293034;
  --strong-line: #657078;
  --muted: #8f999f;
  --dim: #78868d;
  --disabled: #70777b;
  --disabled-bg: #191d20;
  --hover: #222a2e;
  --on-primary: #0a0c0d;
  --primary-hover: #cbd3d7;
  --accent: #d8efdf;
  --notice-bg: #131b18;
  --notice-text: #b2c2b8;
  --notice-line: #8d9d92;
  --focus: #b6c7d0;
  --toast-bg: #e9efeb;
  --toast-text: #14221b;
  --toast-line: #c1d3c8;
  --error: #f1b5a9;
  --overlay: #000b;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f6;
  --text: #182127;
  --surface: #ffffff;
  --surface-raised: #fbfcfd;
  --surface-end: #ffffff;
  --chrome: #edf1f3;
  --input-bg: #ffffff;
  --line: #d2dbe0;
  --strong-line: #81929c;
  --muted: #4d606b;
  --dim: #5d707b;
  --disabled: #737f86;
  --disabled-bg: #e6ebee;
  --hover: #e5ecef;
  --on-primary: #ffffff;
  --primary-hover: #30434e;
  --accent: #355e49;
  --notice-bg: #e6f0e9;
  --notice-text: #284b37;
  --notice-line: #638672;
  --focus: #355e49;
  --toast-bg: #183e2a;
  --toast-text: #f4faf6;
  --toast-line: #517a61;
  --error: #a22c22;
  --overlay: #0008;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.65 Arial,
    Tahoma,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 5px;
}
button,
.button {
  border: 1px solid var(--strong-line);
  background: transparent;
  color: var(--text);
  padding: 11px 19px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 14px;
  min-height: 46px;
  transition:
    background 0.2s,
    border-color 0.2s;
}
button:hover:not(:disabled),
.button:hover {
  background: var(--hover);
  border-color: var(--text);
}
.primary {
  background: var(--text);
  color: var(--on-primary);
  border-color: var(--text);
}
.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  color: var(--on-primary);
}
button:disabled {
  color: var(--disabled);
  background: var(--disabled-bg);
  border-color: var(--line);
  cursor: not-allowed;
}
.text-button {
  border: 0;
  padding: 5px 0;
  min-height: 36px;
  color: var(--muted);
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(34px, 4.5vw, 60px);
  line-height: 1.28;
  letter-spacing: -1.8px;
  font-weight: 500;
  margin-bottom: 20px;
}
h2 {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.4px;
  margin-bottom: 12px;
}
h3 {
  font-weight: 500;
  font-size: 19px;
  margin-bottom: 6px;
}
.dim {
  color: var(--dim);
}
.muted {
  color: var(--muted);
  font-size: 14px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 16px;
}
.brand,
.login-brand {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.1;
}
.brand span,
.login-brand span {
  color: var(--accent);
}
.brand small {
  display: block;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 1.8px;
  margin-top: 18px;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  border-right: 1px solid var(--line);
  padding: 40px 27px;
  display: flex;
  flex-direction: column;
  background: var(--chrome);
}
nav {
  display: grid;
  gap: 9px;
  margin-top: 65px;
}
nav a {
  font-size: 13px;
  padding: 12px 0;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}
nav a.active {
  color: white;
  border-bottom-color: var(--text);
}
nav b {
  font-size: 10px;
  font-weight: 400;
  color: var(--dim);
  margin-right: 14px;
}
.sidebar-bottom {
  margin-top: auto;
  font-size: 10px;
  letter-spacing: 1px;
}
.sidebar-bottom p {
  margin-bottom: 8px;
}
.sidebar-bottom small {
  display: block;
  color: var(--muted);
}
.workspace {
  margin-left: 232px;
}
header {
  height: 78px;
  border-bottom: 1px solid var(--line);
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header .eyebrow {
  margin: 0;
}
header > div {
  display: flex;
  gap: 26px;
  font-size: 11px;
  color: var(--muted);
}
main {
  max-width: 1550px;
  margin: auto;
  padding: 42px;
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin: 12px 0 34px;
}
.page-heading p:last-child {
  margin-bottom: 0;
}
.status-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
}
.dot.offline {
  background: var(--disabled);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 30px 0;
}
.metrics article {
  padding: 22px 28px;
  border-right: 1px solid var(--line);
}
.metrics article:first-child {
  padding-left: 0;
}
.metrics article:last-child {
  border: 0;
}
.metrics strong {
  display: block;
  font-size: 52px;
  font-weight: 400;
  letter-spacing: -2px;
  line-height: 1.3;
}
.metrics strong.small-number {
  font-size: 27px;
  letter-spacing: 1px;
  padding: 16px 0;
}
.metrics p:last-child {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 0;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.panel {
  border: 1px solid var(--line);
  padding: 26px;
  margin-bottom: 22px;
  background: linear-gradient(
    135deg,
    var(--surface-raised),
    var(--surface-end)
  );
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.section-title h2 {
  margin: 0;
}
.section-title a {
  font-size: 11px;
  color: var(--muted);
}
.section-title .eyebrow {
  margin: 0;
}
.zone-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 24px 0;
}
.zone-summary:last-child {
  padding-bottom: 0;
}
.zone-summary small,
.zone-card small {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
}
.zone-summary .muted {
  font-size: 12px;
}
.valve-drawing {
  width: 65px;
  height: 32px;
  border-top: 1px solid var(--strong-line);
  border-bottom: 1px solid var(--strong-line);
  position: relative;
  opacity: 0.6;
}
.valve-drawing:before {
  content: "";
  position: absolute;
  top: -10px;
  bottom: -10px;
  border-left: 1px solid var(--strong-line);
  left: 8px;
}
.valve-drawing:after {
  content: "";
  position: absolute;
  top: -10px;
  bottom: -10px;
  border-right: 1px solid var(--strong-line);
  right: 8px;
}
.valve-drawing span {
  position: absolute;
  left: 25px;
  top: 4px;
  width: 16px;
  height: 20px;
  border: 1px solid var(--strong-line);
}
.future-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.future-banner h3 {
  color: var(--dim);
}
.future-banner .eyebrow {
  margin-bottom: 8px;
}
.future-banner p:last-child {
  margin: 0;
}
.empty {
  padding: 36px 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  font-size: 13px;
}
.activity {
  border-top: 1px solid var(--line);
  padding: 14px 0;
  font-size: 13px;
}
.activity time {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
.notice {
  padding: 15px 18px;
  border-left: 2px solid var(--notice-line);
  background: var(--notice-bg);
  color: var(--notice-text);
  font-size: 13px;
  margin: 20px 0;
}
.auto-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auto-panel p:last-child {
  margin: 0;
}
.toggle span {
  width: 30px;
  height: 17px;
  border: 1px solid var(--strong-line);
  border-radius: 12px;
  position: relative;
}
.toggle span:before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--disabled);
  position: absolute;
  left: 3px;
  top: 3px;
}
.zone-card .number {
  font-size: 70px;
  line-height: 1;
  color: var(--dim);
  margin: 20px 0;
}
.zone-card .actions {
  margin-top: 24px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tag {
  font-size: 10px;
  border: 1px solid var(--line);
  padding: 4px 9px;
  color: var(--muted);
  white-space: nowrap;
}
.schedule-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.schedule-row p {
  margin: 0;
}
.schedule-row small {
  color: var(--muted);
}
.plot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.plot-card {
  border: 1px solid var(--line);
  padding: 24px;
  background: var(--surface);
}
.plot-card .eyebrow {
  margin-bottom: 32px;
}
.plot-card strong {
  font-size: 21px;
  font-weight: 400;
}
.plot-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
}
.records-title {
  margin-top: 36px;
}
.records-title select {
  max-width: 210px;
}
.soil-card {
  border-top: 1px solid var(--line);
  padding: 24px 0;
}
.soil-card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.soil-card-top p {
  margin-bottom: 5px;
}
.soil-values {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.soil-values span {
  color: var(--muted);
  font-size: 11px;
}
.soil-values b {
  display: block;
  color: var(--text);
  font-size: 20px;
  font-weight: 400;
}
.soil-photo {
  width: 90px;
  height: 75px;
  object-fit: cover;
  margin: 15px 8px 0 0;
  border: 1px solid var(--line);
}
.weather-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.weather-card {
  border: 1px solid var(--line);
  padding: 24px;
}
.weather-card p {
  font-size: 12px;
  color: var(--muted);
}
.weather-card strong {
  font-size: 34px;
  font-weight: 400;
}
.weather-card small {
  font-size: 12px;
  color: var(--muted);
  margin-left: 10px;
}
dl {
  margin-bottom: 0;
}
dl div {
  display: grid;
  grid-template-columns: 190px 1fr;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  gap: 20px;
}
dt {
  font-size: 13px;
  color: var(--muted);
}
dd {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--dim);
  padding: 22px 42px;
  border-top: 1px solid var(--line);
}
dialog {
  width: min(760px, calc(100% - 32px));
  max-height: 90dvh;
  border: 1px solid var(--strong-line);
  background: var(--surface);
  color: var(--text);
  padding: 28px;
  overflow-y: auto;
}
dialog::backdrop {
  background: var(--overlay);
  backdrop-filter: blur(7px);
}
.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-top p {
  margin: 0;
}
.modal-top + h2 {
  margin-top: 20px;
}
form .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.full {
  grid-column: 1/-1;
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
input,
select,
textarea {
  display: block;
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--strong-line);
  color: var(--text);
  border-radius: 0;
  padding: 12px;
  margin-top: 7px;
  min-height: 46px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  outline: 1px solid var(--focus);
}
input:disabled {
  color: var(--disabled);
}
input[type="checkbox"] {
  display: inline-block;
  width: auto;
  min-height: auto;
  margin: 0 6px 0 0;
}
.check-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.check-row label {
  padding: 10px 0;
}
.form-section {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 23px;
}
.form-section h3 {
  font-size: 16px;
}
.form-actions {
  margin-top: 25px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.form-error {
  color: var(--error);
  font-size: 13px;
}
.photo-preview {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.photo-preview img {
  width: 100px;
  height: 80px;
  object-fit: cover;
}
.photo-preview button {
  font-size: 11px;
  min-height: 28px;
  padding: 2px 10px;
  display: block;
  width: 100%;
}
#gps-status {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}
#toast {
  position: fixed;
  bottom: 26px;
  right: 24px;
  max-width: calc(100% - 48px);
  padding: 15px 24px;
  background: var(--toast-bg);
  color: var(--toast-text);
  border: 1px solid var(--toast-line);
  z-index: 100;
  font-size: 14px;
}
.login {
  max-width: 490px;
  margin: 9vh auto;
  padding: 35px;
}
.login .login-brand {
  margin-bottom: 60px;
}
.login h1 {
  font-size: 45px;
}
.login form {
  margin: 35px 0;
}
.login label {
  margin-bottom: 18px;
}
.login form button {
  width: 100%;
  justify-content: space-between;
}
.login small {
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 2px;
}
#login-error {
  color: var(--error);
  margin-top: 14px;
  font-size: 13px;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1600px) {
  main {
    padding: 55px 65px;
  }
}
@media (max-width: 1050px) {
  aside {
    width: 195px;
    padding: 30px 20px;
  }
  .workspace {
    margin-left: 195px;
  }
  main {
    padding: 30px 25px;
  }
  header {
    padding: 0 25px;
  }
  .plot-grid {
    grid-template-columns: 1fr 1fr;
  }
  .page-heading {
    align-items: flex-start;
  }
  .page-heading > .actions {
    max-width: 170px;
  }
  .two-col {
    gap: 15px;
  }
  .panel {
    padding: 20px;
  }
  .section-title {
    flex-wrap: wrap;
  }
}
@media (max-width: 760px) {
  aside {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    height: auto;
    padding: 16px 20px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 17px;
    line-height: 1;
  }
  .brand br {
    display: none;
  }
  .brand small,
  .sidebar-bottom {
    display: none;
  }
  nav {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    overflow: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }
  nav a {
    font-size: 12px;
    padding: 11px 0;
  }
  nav b {
    display: none;
  }
  .workspace {
    margin: 0;
  }
  header {
    height: 50px;
    padding: 0 20px;
  }
  header > div {
    gap: 10px;
  }
  header > .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
  #clock {
    display: none;
  }
  main {
    padding: 25px 20px;
  }
  h1 {
    font-size: 35px;
    letter-spacing: -1px;
  }
  .page-heading {
    display: block;
    margin: 8px 0 25px;
  }
  .page-heading > .button,
  .page-heading > .actions {
    margin-top: 22px;
    max-width: none;
  }
  .status-strip {
    flex-wrap: wrap;
    gap: 10px;
    font-size: 9px;
  }
  .status-strip span:first-child {
    flex-basis: 100%;
  }
  .metrics {
    margin: 15px 0 25px;
  }
  .metrics article {
    padding: 15px 12px;
  }
  .metrics .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .metrics strong {
    font-size: 36px;
  }
  .metrics strong.small-number {
    font-size: 16px;
    letter-spacing: 0;
    padding: 13px 0;
  }
  .metrics p:last-child {
    font-size: 10px;
  }
  .two-col,
  .weather-grid {
    grid-template-columns: 1fr 1fr;
  }
  .two-col > .panel {
    grid-column: 1/-1;
  }
  .panel {
    padding: 20px;
  }
  .future-banner {
    display: block;
  }
  .future-banner button {
    margin-top: 18px;
  }
  .auto-panel {
    display: block;
  }
  .auto-panel button {
    margin-top: 18px;
  }
  .plot-grid {
    grid-template-columns: 1fr;
  }
  .plot-card .eyebrow {
    margin-bottom: 15px;
  }
  .section-title h2 {
    font-size: 19px;
  }
  .section-title {
    gap: 10px;
  }
  .records-title select {
    max-width: 150px;
  }
  .soil-card-top {
    display: block;
  }
  .soil-card-top small {
    font-size: 11px;
  }
  dl div {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  footer {
    padding: 20px;
    font-size: 8px;
  }
  footer span:nth-child(2) {
    display: none;
  }
  dialog {
    padding: 21px;
    max-height: 94dvh;
  }
  form .grid {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  .form-actions {
    position: sticky;
    bottom: -21px;
    background: var(--surface);
    padding: 15px 0;
    margin-top: 15px;
  }
  .weather-card {
    padding: 18px;
  }
  .login {
    margin: 3vh auto;
    padding: 25px;
  }
  .login .login-brand {
    margin-bottom: 45px;
  }
  .login h1 {
    font-size: 39px;
  }
  .schedule-row {
    align-items: flex-start;
  }
}

.theme-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.theme-label select {
  min-height: 36px;
  margin: 0;
  padding: 4px 8px;
  width: 82px;
  font-size: 12px;
}
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 25px 0;
  border: 1px solid var(--line);
  background: var(--surface);
}
.dashboard-metrics article {
  padding: 20px;
  border-right: 1px solid var(--line);
}
.dashboard-metrics article:last-child {
  border: 0;
}
.dashboard-metrics strong {
  font-weight: 400;
  display: block;
  font-size: 35px;
}
.dashboard-metrics p:last-child {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 0;
}
#page-overview h1,
#page-audit h1,
#page-reports h1 {
  font-size: 34px;
}
.weather-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.weather-summary small {
  color: var(--muted);
}
.weather-summary strong {
  display: block;
  font-size: 24px;
  font-weight: 400;
}
.audit-detail {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}
.audit-detail summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  cursor: pointer;
}
.audit-detail small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.audit-detail dd {
  overflow-wrap: anywhere;
}
.audit-detail summary::after {
  content: "+";
  color: var(--muted);
}
@media (max-width: 760px) {
  .dashboard-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-metrics article {
    padding: 17px;
    border-bottom: 1px solid var(--line);
  }
  .dashboard-metrics strong {
    font-size: 29px;
  }
  .dashboard-metrics .eyebrow {
    font-size: 9px;
    letter-spacing: 1px;
  }
  header {
    height: auto;
    min-height: 55px;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 20px;
  }
  .theme-label {
    font-size: 10px;
  }
  .theme-label select {
    font-size: 16px;
  }
  .theme-label + span {
    font-size: 10px;
  }
  .page-heading {
    align-items: start;
  }
}

.site-label{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--muted)}.site-label select{min-height:36px;margin:0;padding:4px 8px;max-width:170px;font-size:12px}header>div{flex-wrap:wrap;justify-content:flex-end}@media(max-width:760px){.site-label select{font-size:16px;max-width:145px}header>div{justify-content:flex-start;width:100%}}
