﻿:root {
  --green: #408f52;
  --green-dark: #226b36;
  --green-soft: #d9eddf;
  --blue: #0b2a97;
  --ink: #172019;
  --muted: #66756c;
  --line: #dfe7e1;
  --paper: #fbfdf9;
  --card: rgba(255, 255, 255, 0.86);
  --shadow: 0 18px 45px rgba(29, 65, 41, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(217, 237, 223, 0.76), rgba(251, 253, 249, 0.82) 34%, rgba(244, 249, 245, 0.96)),
    var(--paper);
  color: var(--ink);
  font-family: "Montserrat", Arial, sans-serif;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-shell {
  width: min(430px, 100%);
}

.login-card {
  padding: 28px;
  border: 1px solid rgba(220, 231, 223, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-logo-wrap {
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.login-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 auto;
}

.login-card h1 {
  font-size: 32px;
  text-align: center;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-form input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.login-form button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.login-error {
  margin: 0;
  color: #9f2419;
  font-weight: 800;
}

.login-hint {
  display: block;
  margin-top: 14px;
  color: var(--muted);
}

button,
select,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  transition: grid-template-columns 0.22s ease;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 20px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 28px;
  transition: width 0.22s ease, padding 0.22s ease;
}

.sidebar-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(64, 143, 82, 0.22);
  border-radius: 12px;
  background: #fff;
  color: var(--green-dark);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(29, 65, 41, 0.08);
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 86px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  padding: 20px 12px;
  align-items: center;
}

body.sidebar-collapsed .brand span,
body.sidebar-collapsed .nav-item {
  font-size: 0;
}

body.sidebar-collapsed .brand,
body.sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
}

body.sidebar-collapsed .nav-item {
  width: 48px;
  height: 48px;
  padding: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  position: relative;
}

.brand-logo,
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.brand-logo {
  object-fit: contain;
}

.brand-mark {
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
}

.brand strong,
h1,
h2,
.kpi-card strong {
  font-family: "Montserrat", sans-serif;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.nav-stack {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 10px;
  color: #58645d;
  text-decoration: none;
  font-weight: 700;
  position: relative;
}

.nav-item:hover,
.nav-item.active {
  background: var(--green-soft);
  color: var(--green-dark);
}

[hidden] {
  display: none !important;
}

.nav-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: rgba(64, 143, 82, 0.12);
  color: var(--green);
  font-weight: 800;
  line-height: 1;
  position: relative;
  color: transparent;
}

.nav-icon svg {
  display: none;
}

.nav-icon::before {
  content: "";
  width: 18px;
  height: 18px;
  background: var(--green);
  mask: var(--icon-mask) center / contain no-repeat;
  -webkit-mask: var(--icon-mask) center / contain no-repeat;
}

.nav-item[href="#pre-semeio"] .nav-icon {
  --icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 5h16v14H4z' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M4 10h16M9 5v14M15 5v14' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.nav-item[href="#semeio"] .nav-icon {
  --icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 4c-7.5.6-12 4.8-12 10.6 0 3 2.2 5.4 5.2 5.4 5.6 0 8.2-6.7 6.8-16Z' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M7 18c2.8-4.3 6-6.8 10-8' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.main {
  padding: 28px;
  min-width: 0;
  transition: margin-right 0.24s ease;
}

body.zimi-open .main {
  margin-right: 440px;
}

.topbar,
.sync-strip,
.panel,
.kpi-card {
  background: var(--card);
  border: 1px solid rgba(220, 231, 223, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar {
  border-radius: 18px;
  padding: 16px 18px;
  display: block;
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--green);
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.15;
}

.page-title {
  font-size: clamp(15px, 1.5vw, 19px);
}

h2 {
  margin: 0;
  font-size: 20px;
}

.top-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.top-icon-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.field select,
.field input,
.refresh-button {
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
}

.refresh-button,
.notification-button {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.top-icon-button,
.notification-button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(64, 143, 82, 0.28);
  background: #fff;
  color: var(--green-dark);
  display: inline-grid;
  place-items: center;
  padding: 0;
  position: relative;
}

.top-icon-button::after,
.notification-button::after,
.sidebar-toggle::after,
.brand::after,
.nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 50;
  transform: translateX(-50%) translateY(-2px);
  min-width: max-content;
  max-width: 180px;
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(23, 32, 25, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.top-icon-button:hover::after,
.notification-button:hover::after,
.sidebar-toggle:hover::after,
.brand:hover::after,
.nav-item:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.top-icon-button svg,
.notification-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-icon-button:hover,
.notification-button:hover {
  background: var(--green-soft);
}

.notification-button strong {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #fff;
  color: var(--green-dark);
  border: 1px solid rgba(64, 143, 82, 0.34);
  font-size: 10px;
  line-height: 1;
  padding: 0 4px;
}

.profile-shortcut {
  display: none;
}

body[data-view="admin"][data-admin-page="perfil"] .profile-shortcut {
  display: inline-grid;
}

.sync-strip {
  margin-top: 18px;
  border-radius: 16px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sync-strip div {
  padding: 8px 12px;
  border-left: 3px solid var(--green);
}

.label,
.kpi-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.25;
}

.sync-strip strong {
  display: block;
  margin-top: 5px;
}


.zimi-insight-strip {
  margin-top: 16px;
  min-height: 86px;
  border: 1px solid rgba(64, 143, 82, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 45px rgba(29, 65, 41, 0.1);
  backdrop-filter: blur(18px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.zimi-insight-strip:hover,
.zimi-insight-strip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(64, 143, 82, 0.34);
  box-shadow: 0 24px 60px rgba(29, 65, 41, 0.14);
  outline: none;
}

.zimi-insight-strip[data-severity="danger"] {
  border-color: rgba(209, 67, 67, 0.3);
}

.zimi-insight-strip[data-severity="warn"] {
  border-color: rgba(242, 163, 58, 0.36);
}

.zimi-insight-avatar {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(217, 237, 223, 0.88), rgba(255, 255, 255, 0.94));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.zimi-insight-avatar img {
  width: 48px;
  height: 48px;
  object-fit: cover;
}

.zimi-insight-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.zimi-insight-copy span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.zimi-insight-copy p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
}

.zimi-insight-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.zimi-insight-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zimi-insight-actions button {
  min-height: 36px;
  border: 1px solid rgba(64, 143, 82, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--green-dark);
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  padding: 0 14px;
}

.zimi-insight-actions button:hover {
  background: var(--green-soft);
}

.kpi-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-card {
  min-height: 150px;
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  gap: 10px;
  position: relative;
}

.hero-kpi {
  background: linear-gradient(145deg, #ffffff, #eef8f1);
}

.kpi-card strong {
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.12;
  color: var(--green-dark);
  overflow-wrap: anywhere;
  hyphens: auto;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(64, 143, 82, 0.12);
  position: relative;
  flex: 0 0 auto;
}

.kpi-icon::before {
  content: "";
  position: absolute;
  inset: 7px;
  background: var(--green);
  mask: var(--kpi-mask) center / contain no-repeat;
  -webkit-mask: var(--kpi-mask) center / contain no-repeat;
}

.kpi-ready {
  --kpi-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 19h16M6 16l3-9h6l3 9' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M10 16l1-9M14 16l-1-9M8 12h8' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.kpi-delay {
  --kpi-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 17h14M7 14c3-3 7-3 10 0M8 10c2-2 6-2 8 0' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 18c0 2 2 3 4 3s4-1 4-3' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 4v5M9 6h6' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.kpi-time {
  --kpi-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 17h16M5 13h14M7 9h10M9 5h6' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M5 20h14' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.kpi-evidence,
.kpi-photo {
  --kpi-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='4' y='6' width='16' height='13' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Ccircle cx='9' cy='11' r='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='m4 17 4-4 3 3 2-2 5 5' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.kpi-sowed {
  --kpi-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 20V8' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 13c-4.5 0-7-2.5-7-6 4.5 0 7 2.5 7 6ZM12 13c4.5 0 7-2.5 7-6-4.5 0-7 2.5-7 6Z' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M5 21h14' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.kpi-spacing {
  --kpi-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7h14M5 12h14M5 17h14' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 5v14M16 5v14' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.kpi-fertilizer {
  --kpi-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 20h10l2-11H5l2 11Z' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 9V5h8v4M9 14h6M10 17h4' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.kpi-water-rework {
  --kpi-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3s6 6.2 6 11a6 6 0 0 1-12 0c0-4.8 6-11 6-11Z' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M15 15a3 3 0 0 1-3 3' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.kpi-soil {
  --kpi-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 17c3-3 13-3 16 0M6 13c3-2 9-2 12 0M8 9c2-1 6-1 8 0' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M5 21h14' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.kpi-logs {
  --kpi-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 4h8l4 4v12H7V4Z' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M15 4v5h5M9 13h6M9 17h6' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.kpi-sync {
  --kpi-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17 3v5h-5M7 21v-5h5' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M18 9a6 6 0 0 0-10-3M6 15a6 6 0 0 0 10 3' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.kpi-plots {
  --kpi-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 5h16v14H4z' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M4 10h16M9 5v14M15 5v14' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.kpi-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.activity-kpi {
  min-height: 220px;
}

.kpi-progress {
  grid-column: auto;
  height: 12px;
}

.kpi-detail {
  display: grid;
  gap: 5px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-3px);
  transition: max-height 0.22s ease, opacity 0.22s ease, transform 0.22s ease;
}

.activity-kpi:hover .kpi-detail,
.activity-kpi:focus .kpi-detail,
.activity-kpi:focus-within .kpi-detail,
.semeio-kpi:hover .kpi-detail,
.semeio-kpi:focus .kpi-detail,
.semeio-kpi:focus-within .kpi-detail {
  max-height: 140px;
  opacity: 1;
  transform: translateY(0);
}

.kpi-detail span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.dashboard-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  border-radius: 18px;
  padding: 20px;
  min-width: 0;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 800;
  white-space: nowrap;
}

.progress-list {
  display: grid;
  gap: 18px;
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: center;
}

.progress-row span {
  font-weight: 800;
}

.progress-row strong {
  color: var(--green-dark);
}

.progress-track {
  grid-column: 1 / -1;
  height: 13px;
  border-radius: 999px;
  background: #e8eee9;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #8bbf65);
  transition: width 0.35s ease;
}

.chart-wrap {
  height: 270px;
}

.field-map-panel {
  overflow: hidden;
}

.field-map-heading {
  align-items: flex-start;
}

.field-map-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.field-map-metrics div {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.field-map-metrics span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  text-transform: uppercase;
}

.field-map-metrics strong {
  display: block;
  color: var(--green-dark);
  font-size: clamp(15px, 1.5vw, 20px);
  overflow-wrap: anywhere;
}

.field-map-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
}

.field-map-toolbar button {
  min-height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(64, 143, 82, 0.24);
  border-radius: 999px;
  padding: 0 13px;
  background: #fff;
  color: var(--green-dark);
  font-weight: 800;
  cursor: pointer;
}

.field-map-toolbar button:hover,
.field-map-toolbar button.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.field-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.field-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.map-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c5ccc7;
  box-shadow: 0 0 0 3px rgba(197, 204, 199, 0.22);
}

.map-legend-dot.good {
  background: #2f8f4e;
  box-shadow: 0 0 0 3px rgba(47, 143, 78, 0.16);
}

.map-legend-dot.progress {
  background: #75ad42;
  box-shadow: 0 0 0 3px rgba(117, 173, 66, 0.16);
}

.map-legend-dot.attention {
  background: #dc8f24;
  box-shadow: 0 0 0 3px rgba(220, 143, 36, 0.16);
}

.field-block {
  position: relative;
  padding: 18px;
  border: 2px solid rgba(62, 112, 55, 0.38);
  border-radius: 24px 24px 30px 20px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)),
    repeating-linear-gradient(0deg, rgba(88, 120, 57, 0.05) 0 2px, transparent 2px 13px),
    #edf3df;
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.32);
}

.field-block::before {
  content: "5 ha";
  position: absolute;
  top: 10px;
  right: 13px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(31, 75, 40, 0.86);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.field-block-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.field-plot {
  position: relative;
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(85, 102, 65, 0.28);
  border-radius: 14px 10px 15px 9px;
  padding: 12px;
  background: #eef1ec;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}

.field-plot:nth-child(3n) {
  border-radius: 10px 15px 9px 14px;
}

.field-plot:hover,
.field-plot:focus-visible {
  z-index: 1;
  transform: translateY(-3px);
  border-color: rgba(31, 75, 40, 0.55);
  box-shadow: 0 10px 24px rgba(26, 70, 39, 0.18);
  outline: none;
}

.field-plot.good {
  background: linear-gradient(145deg, #d7f0dc, #eef8e7);
  border-color: rgba(47, 143, 78, 0.38);
}

.field-plot.progress {
  background: linear-gradient(145deg, #e6f2cf, #f5f8e8);
  border-color: rgba(117, 173, 66, 0.4);
}

.field-plot.attention {
  background: linear-gradient(145deg, #fff0cf, #fff8e8);
  border-color: rgba(220, 143, 36, 0.48);
}

.field-plot.danger {
  background: linear-gradient(145deg, #f9d8d3, #fff0ed);
  border-color: rgba(171, 55, 42, 0.48);
}

.field-plot.neutral {
  background: linear-gradient(145deg, #e7ebe7, #f5f7f4);
}

.field-plot.filtered-out {
  opacity: 0.32;
  filter: saturate(0.5);
}

.field-plot.selected {
  opacity: 1;
  border: 2px solid var(--green-dark);
  box-shadow: 0 0 0 3px rgba(64, 143, 82, 0.18);
}

.field-plot-top,
.field-plot-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-plot-id {
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
}

.field-plot-area {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.field-plot-farmer {
  min-height: 32px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.field-plot-status {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.field-plot-status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.field-plot.good .field-plot-status-dot { color: #2f8f4e; }
.field-plot.progress .field-plot-status-dot { color: #75ad42; }
.field-plot.attention .field-plot-status-dot { color: #dc8f24; }
.field-plot.danger .field-plot-status-dot { color: #ab372a; }
.field-plot.neutral .field-plot-status-dot { color: #9aa39c; }

.field-map-caption {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.profile-actions-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-card img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.profile-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.profile-card span strong {
  color: var(--ink);
}

.profile-actions {
  margin-top: 16px;
}

.profile-actions button,
.edit-profile-button,
.logout-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--green-dark);
  font-weight: 800;
  padding: 0 14px;
  cursor: pointer;
}

.edit-profile-button {
  border-color: rgba(64, 143, 82, 0.28);
  background: var(--green-soft);
  color: var(--green-dark);
}

.logout-button {
  border-color: rgba(159, 36, 25, 0.24);
  background: #fff4f2;
  color: #9f2419;
  white-space: nowrap;
}

.profile-edit-form {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-edit-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-edit-form input,
.profile-edit-form select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  text-transform: none;
  font-weight: 700;
}

.profile-form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-form-actions button {
  min-height: 42px;
  border: 1px solid rgba(64, 143, 82, 0.26);
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  padding: 0 14px;
  cursor: pointer;
}

.profile-form-actions button[type="button"] {
  background: #fff;
  color: var(--green-dark);
}

.profile-edit-form .helper-text {
  grid-column: 1 / -1;
  margin-top: 0;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-nav a,
.admin-section-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid rgba(64, 143, 82, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--green-dark);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.admin-nav a:hover,
.admin-section-link:hover,
.admin-section-link.active {
  background: var(--green-soft);
}

.admin-section {
  scroll-margin-top: 24px;
}

.admin-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-status div {
  padding: 14px;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green-dark);
}

.admin-status span {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-status strong {
  overflow-wrap: anywhere;
}

.admin-list div,
.drawer-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.admin-list span,
.drawer-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.admin-list strong,
.drawer-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-weight: 600;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: rgba(217, 237, 223, 0.46);
}

.panel-helper {
  display: block;
  max-width: 720px;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.farmer-panel-heading {
  align-items: flex-end;
}

.farmer-panel-tools {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.farmer-search-field {
  display: grid;
  gap: 6px;
  min-width: min(280px, 100%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.farmer-search-field input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-transform: none;
}

.farmer-performance-table {
  min-width: 1180px;
}

.farmer-performance-table td:first-child {
  min-width: 190px;
  font-weight: 800;
  color: var(--green-dark);
}

.farmer-document-number {
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.farmer-edit-button {
  min-height: 34px;
  border: 1px solid rgba(64, 143, 82, 0.28);
  border-radius: 10px;
  padding: 0 12px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 800;
  cursor: pointer;
}

.farmer-edit-button:hover {
  background: #d9eddf;
}

.farmer-dialog {
  width: min(620px, calc(100vw - 28px));
  border: 0;
  border-radius: 20px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(18, 61, 37, 0.26);
}

.farmer-dialog::backdrop {
  background: rgba(12, 35, 23, 0.58);
  backdrop-filter: blur(3px);
}

.farmer-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 24px;
}

.farmer-dialog-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.farmer-dialog-close {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.farmer-edit-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.farmer-edit-form input,
.farmer-edit-form select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-transform: none;
}

.farmer-document-field,
.farmer-gps-field,
.farmer-form-status,
.farmer-form-actions {
  grid-column: 1 / -1;
}

.farmer-gps-field output {
  min-height: 46px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
}

.farmer-form-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.farmer-form-status.error {
  color: #9f2419;
}

.farmer-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.farmer-form-actions button {
  min-height: 42px;
  border: 1px solid rgba(64, 143, 82, 0.28);
  border-radius: 12px;
  padding: 0 16px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.farmer-form-actions button[type="button"] {
  background: #fff;
  color: var(--green-dark);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f1f5f2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge.ok {
  background: var(--green-soft);
  color: var(--green-dark);
}

.badge.warn {
  background: #fff4da;
  color: #8a5a00;
}

.badge.danger {
  background: #ffe7e4;
  color: #9f2419;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-metrics div {
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.mini-metrics strong {
  font-family: "Montserrat", sans-serif;
  color: var(--green-dark);
  font-size: 32px;
  line-height: 1;
}

.mini-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-feed {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.activity-feed li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
}

.activity-feed li.has-photo {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  align-items: center;
  padding-left: 10px;
}

.evidence-photo {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(64, 143, 82, 0.18);
  background: #fff;
}

.activity-feed strong {
  color: var(--ink);
}

.attention-panel {
  border-color: rgba(242, 163, 58, 0.35);
}

.attention-list {
  display: grid;
  gap: 10px;
}

.attention-item,
.attention-empty {
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.attention-item strong,
.attention-item span {
  display: block;
}

.attention-item span {
  margin-top: 4px;
  color: var(--muted);
}

.attention-item.warn {
  border-color: #f2d28a;
  background: #fff8e8;
}

.attention-item.danger {
  border-color: #f2b0aa;
  background: #fff0ee;
}

.attention-item.info {
  border-color: #b9c7f2;
  background: #f1f5ff;
}

.ai-summary {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(217, 237, 223, 0.78), rgba(255, 255, 255, 0.74));
}

.ai-summary p {
  margin: 8px 0 0;
  color: var(--muted);
}

.ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ai-actions span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.supervisor-actions {
  display: grid;
  gap: 10px;
}

.supervisor-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--green-dark);
  font-weight: 800;
  cursor: pointer;
}

.supervisor-actions button:hover {
  background: var(--green-soft);
}

.helper-text {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.next-action {
  border-color: rgba(64, 143, 82, 0.28) !important;
  background: var(--green-soft) !important;
}

.notification-panel {
  position: fixed;
  top: 86px;
  right: 28px;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 116px);
  overflow: auto;
  z-index: 35;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(23, 32, 25, 0.2);
  backdrop-filter: blur(18px);
}

.notification-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.notification-header button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--green-dark);
  font-weight: 800;
  cursor: pointer;
  padding: 0 12px;
}

.notification-subtitle {
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.chatbot {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
}

body.zimi-open .chatbot {
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 100vw;
}

.chatbot-toggle {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(64, 143, 82, 0.24);
  border-radius: 999px;
  background: #fff;
  color: #fff;
  box-shadow: 0 18px 45px rgba(29, 65, 41, 0.24);
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  overflow: hidden;
}

body.zimi-open .chatbot-toggle {
  display: none;
}

.chatbot-toggle img {
  width: 54px;
  height: 54px;
  object-fit: cover;
}

.chatbot-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(430px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(23, 32, 25, 0.22);
  overflow: hidden;
}

body.zimi-open .chatbot-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 100vw;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  box-shadow: -24px 0 70px rgba(23, 32, 25, 0.18);
}

.chatbot-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.chatbot-header button {
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font-weight: 800;
  cursor: pointer;
}

.chatbot-messages {
  min-height: 280px;
  max-height: 430px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(180deg, #fbfdf9, #f5faf6);
}

body.zimi-open .chatbot-messages {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.bot-message,
.user-message {
  padding: 10px 12px;
  border-radius: 13px;
  line-height: 1.42;
}

.bot-message {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.user-message {
  margin-left: 34px;
  background: var(--green);
  color: #fff;
}

.chatbot-suggestions {
  padding: 0 16px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chatbot-suggestions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 9px;
  cursor: pointer;
}

.chatbot-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chatbot-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
}

.chatbot-form button {
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  padding: 0 12px;
}

.plot-drawer {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(760px, calc(100vw - 36px));
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 24px 80px rgba(23, 32, 25, 0.22);
  backdrop-filter: blur(18px);
  overflow: auto;
  z-index: 20;
}

.drawer-close {
  float: right;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--green-dark);
  font-weight: 800;
  cursor: pointer;
}

.drawer-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.drawer-grid.compact {
  margin-top: 0;
}

.drawer-section {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.drawer-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.drawer-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.drawer-wide {
  grid-column: 1 / -1;
}

.drawer-log-list {
  display: grid;
  gap: 8px;
}

.drawer-log-list div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
}

.drawer-log-list span,
.drawer-log-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .sidebar {
    padding: 20px 12px;
    align-items: center;
  }

  .sidebar .brand span,
  .sidebar .nav-item {
    font-size: 0;
  }

  .sidebar .brand,
  .sidebar .nav-item {
    justify-content: center;
    gap: 0;
  }

  .sidebar .nav-item {
    width: 48px;
    height: 48px;
    padding: 0;
  }

  
.kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-card strong {
    font-size: clamp(22px, 3vw, 30px);
  }

  .field-map-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: 92px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
    gap: 12px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .field,
  .field input,
  .field select,
  .refresh-button {
    width: 100%;
  }

  .field:nth-child(3),
  .refresh-button,
  .top-icon-group {
    grid-column: 1 / -1;
  }

  .top-icon-group {
    justify-content: space-between;
  }

  .sync-strip,
  .kpi-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .field-map-heading {
    align-items: stretch;
  }

  .field-map-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-map-metrics div:last-child {
    grid-column: 1 / -1;
  }

  .field-block {
    padding: 16px 12px;
  }

  .field-block-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-plot {
    min-height: 116px;
  }

  .sidebar {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    top: auto;
    height: 68px;
    padding: 8px;
    z-index: 30;
    border: 1px solid rgba(220, 231, 223, 0.92);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(29, 65, 41, 0.18);
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 6px;
    overflow: visible;
  }

  .sidebar-toggle {
    display: none;
  }

  .brand {
    justify-content: center;
    gap: 0;
  }

  .brand span:not(.brand-mark) {
    display: none;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .sidebar-note {
    display: none;
  }

  .nav-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    gap: 6px;
  }

  .sidebar .nav-item {
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    padding: 7px 6px;
    font-size: 11px;
    width: auto;
    height: auto;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  .admin-status {
    grid-template-columns: 1fr;
  }

  .profile-layout {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-actions-main {
    justify-content: stretch;
  }

  .profile-actions-main button {
    flex: 1 1 160px;
  }

  .profile-edit-form {
    grid-template-columns: 1fr;
  }

  .farmer-panel-heading,
  .farmer-panel-tools {
    align-items: stretch;
  }

  .farmer-panel-tools,
  .farmer-search-field {
    width: 100%;
  }

  .farmer-edit-form {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .farmer-edit-form label,
  .farmer-document-field {
    grid-column: 1;
  }

  .logout-button {
    width: 100%;
  }

  .admin-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-nav a {
    justify-content: center;
  }


  .zimi-insight-strip {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    padding: 13px;
  }

  .zimi-insight-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .zimi-insight-actions button {
    flex: 1;
  }

  .zimi-insight-copy p {
    font-size: 13px;
  }

  .kpi-card {
    min-height: 126px;
    padding: 14px;
  }

  .kpi-card strong {
    font-size: 24px;
  }

  .kpi-card small {
    font-size: 11px;
  }

  .drawer-grid {
    grid-template-columns: 1fr;
  }

  .drawer-summary {
    grid-template-columns: 1fr;
  }

  .plot-drawer,
  .notification-panel {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .notification-panel {
    top: 14px;
    max-height: calc(100vh - 120px);
  }

  .chatbot {
    right: 16px;
    bottom: 96px;
  }

  body.zimi-open .main {
    margin-right: 0;
  }

  body.zimi-open .chatbot {
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    z-index: 60;
  }

  body.zimi-open .chatbot-panel {
    width: 100vw;
    max-width: 100vw;
    border: 0;
    border-radius: 0;
  }
}

.language-setting select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  padding: 0 10px;
}
.master-table-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  position: relative;
}
.column-toggle-panel {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  z-index: 20;
  min-width: 220px;
}
.column-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.sortable-header { cursor: pointer; user-select: none; white-space: nowrap; color: var(--ink); }
.sortable-header:hover { color: var(--green-dark); }
/* ---- Navegação inferior em ecrãs pequenos (telemóvel) ----
   A barra tem logótipo + 3 separadores (Pre-semeio, Semeio, Dados).
   Antes só havia 2 colunas para 3 separadores: o 3.º ia para uma 2.ª linha,
   fora da barra, e empurrava o logótipo para baixo. Fica tudo numa linha. */
.nav-item[href="#dados"] .nav-icon {
  --icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

@media (max-width: 760px) {
  .sidebar,
  body.sidebar-collapsed .sidebar {
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: 1fr;
    align-items: center;
    height: 68px;
    padding: 8px;
    gap: 6px;
  }

  .sidebar .brand,
  body.sidebar-collapsed .sidebar .brand {
    width: 56px;
    height: 52px;
    align-self: center;
    justify-content: center;
    gap: 0;
    padding: 0;
  }

  .sidebar .brand-logo {
    width: 40px;
    height: 40px;
    display: block;
  }

  .sidebar .nav-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 52px;
    align-self: center;
    gap: 4px;
  }

  .sidebar .nav-item,
  body.sidebar-collapsed .sidebar .nav-item {
    width: auto;
    height: 52px;
    padding: 4px 2px;
    font-size: 11px;
    line-height: 1.1;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
  }

  .sidebar .brand::after,
  .sidebar .nav-item::after {
    display: none;
  }
}

/* ===== Dias-homem (v1, 2026-11-01) ===== */
.mdays-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 8px 0 16px;
}

.mdays-kpi {
  background: var(--green-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

.mdays-kpi small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mdays-kpi strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  color: var(--green-dark);
}

.mdays-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 18px 0;
}

.mdays-charts h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.mdays-bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 38%) 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 13px;
}

.mdays-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mdays-bar-track {
  height: 10px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.mdays-bar-fill {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 6px;
}

.mdays-bar-value {
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* ===== Agua (v1, 2026-11-12) ===== */
.water-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.water-estimated {
  background: #fff3d6;
  color: #8a5a00;
}

.water-measured {
  background: var(--green-soft);
  color: var(--green-dark);
}

.water-calc {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 8px 0;
}

/* ===== Visao geral (v1, 2026-11-12) ===== */
.ov-grid { display: grid; gap: 16px; margin: 12px 0 20px; }
.ov-stages { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.ov-cols { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: stretch; }
.ov-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); text-decoration: none; }
a.ov-card:hover { border-color: var(--green); }
.ov-empty { background: var(--paper); border: 2px dashed #b7c7bc; }
.ov-chip { align-self: flex-start; padding: 3px 10px; border-radius: 999px; background: #e6f3ea; color: var(--green-dark); font-size: 11px; font-weight: 700; }
.ov-blue { background: #e8ecff; color: var(--blue); }
.ov-amber { background: #fff3d6; color: #6b4500; }
.ov-label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #4d5c53; }
.ov-big { font-size: 26px; font-weight: 800; color: var(--green-dark); line-height: 1.1; }
.ov-big small { font-size: 14px; font-weight: 700; }
.ov-note { font-size: 12px; color: #4d5c53; }
.ov-track { display: block; flex: 1; height: 8px; border-radius: 999px; background: #e5ebe7; overflow: hidden; }
.ov-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #408f52, #8bc56f); }
.ov-panel { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.ov-panel h3 { margin: 0; }
.ov-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ov-panel-head a { font-size: 13px; font-weight: 700; color: var(--green-dark); }
.ov-dashed { background: var(--paper); border: 2px dashed #b7c7bc; box-shadow: none; }
.ov-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.ov-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.ov-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 6px 2px; border-radius: 12px; text-align: center; box-sizing: border-box; }
.ov-tile strong { font-size: 15px; }
.ov-tile span { font-size: 10px; font-weight: 600; line-height: 1.2; }
.ov-ok { background: #d9eddf; border: 2px solid #226b36; color: #1d5a2d; }
.ov-review { background: #fff3d6; border: 2px solid #b26a00; color: #6b4500; }
.ov-redo { background: #ffe3df; border: 2px solid #a32a1c; color: #7a1d12; }
.ov-progress { background: #e8ecff; border: 2px solid var(--blue); color: var(--blue); }
.ov-none { background: #fff; border: 2px dashed #9aa89f; color: #4d5c53; }
.ov-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.ov-row-name { flex: 0 0 120px; font-weight: 600; }
.ov-row-val { flex: 0 0 48px; text-align: right; font-weight: 700; }
.ov-split { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: #0b2a97; }
.ov-split span { display: block; background: var(--green-dark); }
.ov-days { display: flex; align-items: flex-end; gap: 4px; height: 84px; border-bottom: 1px solid var(--line); }
.ov-days span { flex: 1; min-width: 0; border-radius: 4px 4px 0 0; background: #e0a93b; }
.ov-alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: #f4f9f5; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 13px; line-height: 1.5; }
.ov-alert small { color: #4d5c53; }

/* ===== Cronograma da campanha ===== */
.campanha-table {
  min-width: 820px;
}

.campanha-table td:first-child {
  font-weight: 800;
  color: var(--green-dark);
}
