@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Manrope:wght@400;600;700&display=swap");

:root {
  --ink: #1e1b16;
  --leaf: #2f4a3a;
  --sage: #d7e6d5;
  --terra: #d27a4f;
  --sun: #f5e7cf;
  --cream: #fbf7ef;
  --stone: #6f7a73;
  --mist: #eef2ea;
  --shadow: rgba(30, 27, 22, 0.12);
  --shadow-strong: rgba(30, 27, 22, 0.2);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --nav-bg: rgba(251, 247, 239, 0.9);
  --nav-border: rgba(47, 74, 58, 0.2);
}

body[data-theme="oscuro"] {
  --ink: #e6f0ef;
  --leaf: #016367;
  --sage: #1c3e3f;
  --terra: #1aa3a8;
  --sun: #1a2f30;
  --cream: #13292a;
  --stone: #859579;
  --mist: #163637;
  --shadow: rgba(0, 0, 0, 0.45);
  --shadow-strong: rgba(0, 0, 0, 0.65);
  --nav-bg: rgba(19, 41, 42, 0.9);
  --nav-border: rgba(1, 99, 103, 0.35);
}

body[data-theme="caliente"] {
  --ink: #3a231b;
  --leaf: #8a4a2f;
  --sage: #f2d7c2;
  --terra: #d86a3d;
  --sun: #f7d9b4;
  --cream: #fbefe4;
  --stone: #7a6258;
  --mist: #f6e7d7;
  --shadow: rgba(60, 35, 20, 0.16);
  --shadow-strong: rgba(60, 35, 20, 0.25);
  --nav-bg: rgba(251, 239, 228, 0.9);
  --nav-border: rgba(122, 98, 88, 0.2);
}

body[data-theme="oliva"] {
  --ink: #233326;
  --leaf: #3b5a2a;
  --sage: #dbe4c7;
  --terra: #a66b3d;
  --sun: #f0e6c2;
  --cream: #f6f5e6;
  --stone: #6c7564;
  --mist: #edf0dc;
  --shadow: rgba(35, 51, 38, 0.14);
  --shadow-strong: rgba(35, 51, 38, 0.22);
  --nav-bg: rgba(246, 245, 230, 0.92);
  --nav-border: rgba(59, 90, 42, 0.2);
}

body[data-theme="brisa"] {
  --ink: #1c2d2c;
  --leaf: #2a5b5a;
  --sage: #cfe7e3;
  --terra: #c58a5f;
  --sun: #e8f1ef;
  --cream: #f3f7f6;
  --stone: #5f7372;
  --mist: #e4efed;
  --shadow: rgba(28, 45, 44, 0.14);
  --shadow-strong: rgba(28, 45, 44, 0.22);
  --nav-bg: rgba(243, 247, 246, 0.92);
  --nav-border: rgba(42, 91, 90, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
h3 {
  font-family: "Fraunces", "Georgia", serif;
  margin: 0 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: inherit;
  text-decoration: none;
}

.background-wash {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 10%, rgba(215, 230, 213, 0.8), transparent 50%),
    radial-gradient(circle at 85% 5%, rgba(242, 215, 185, 0.9), transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(210, 122, 79, 0.22), transparent 55%),
    linear-gradient(120deg, #f7efe2, #f0f3ea 60%, #eef4f1);
}

body[data-theme="oscuro"] .background-wash {
  background:
    radial-gradient(circle at 15% 10%, rgba(1, 99, 103, 0.35), transparent 55%),
    radial-gradient(circle at 85% 5%, rgba(19, 41, 42, 0.6), transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(26, 163, 168, 0.25), transparent 55%),
    linear-gradient(120deg, #13292a, #162f30 60%, #122526);
}

body[data-theme="caliente"] .background-wash {
  background:
    radial-gradient(circle at 15% 10%, rgba(246, 200, 170, 0.8), transparent 55%),
    radial-gradient(circle at 85% 5%, rgba(255, 215, 180, 0.75), transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(224, 118, 74, 0.25), transparent 55%),
    linear-gradient(120deg, #fbefe4, #f5e6d4 60%, #f0e0cd);
}

body[data-theme="oliva"] .background-wash {
  background:
    radial-gradient(circle at 15% 10%, rgba(210, 226, 190, 0.75), transparent 55%),
    radial-gradient(circle at 85% 5%, rgba(230, 238, 198, 0.8), transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(170, 140, 90, 0.2), transparent 55%),
    linear-gradient(120deg, #f6f5e6, #edf0dc 60%, #e7ecd3);
}

body[data-theme="brisa"] .background-wash {
  background:
    radial-gradient(circle at 15% 10%, rgba(198, 230, 224, 0.7), transparent 55%),
    radial-gradient(circle at 85% 5%, rgba(220, 238, 236, 0.75), transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(197, 156, 111, 0.2), transparent 55%),
    linear-gradient(120deg, #f3f7f6, #e9f2f0 60%, #e4eeec);
}

body[data-theme="oscuro"] .card,
body[data-theme="oscuro"] .panel,
body[data-theme="oscuro"] .form-card,
body[data-theme="oscuro"] .day-card,
body[data-theme="oscuro"] .month-cell,
body[data-theme="oscuro"] .board-column,
body[data-theme="oscuro"] .modal-card,
body[data-theme="oscuro"] .user-menu,
body[data-theme="oscuro"] .action-list,
body[data-theme="oscuro"] .auth-card,
body[data-theme="oscuro"] .no-date,
body[data-theme="oscuro"] .metric-card,
body[data-theme="oscuro"] .harvest-panel {
  background: #162e30;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-theme="oscuro"] input,
body[data-theme="oscuro"] select,
body[data-theme="oscuro"] textarea,
body[data-theme="oscuro"] .field-static {
  background: #162e30;
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--ink);
}

body[data-theme="oscuro"] .action-list a:hover,
body[data-theme="oscuro"] .action-list button:hover,
body[data-theme="oscuro"] .user-menu-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

body[data-theme="oscuro"] .data-table th,
body[data-theme="oscuro"] .data-table td {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="oscuro"] .report-qty,
body[data-theme="oscuro"] .task-chip,
body[data-theme="oscuro"] .other-item {
  background: #1d3a3c;
}

body[data-theme="oscuro"] .other-item:hover {
  background: #224245;
}
.auth .background-wash {
  background:
    linear-gradient(135deg, rgba(20, 24, 20, 0.55), rgba(20, 24, 20, 0.2)),
    url("images/back.jpeg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.app .content {
  padding: 2.5rem 4vw 4rem;
  max-width: 1300px;
  margin: 0 auto;
}

.content--auth {
  padding: 8vh 4vw;
  display: flex;
  justify-content: center;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  justify-content: space-between;
  padding: 0.9rem 4vw;
  border-bottom: 1px solid var(--nav-border);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.brand-mark {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--leaf);
  letter-spacing: 0.01em;
}

.brand-tag {
  font-size: 0.85rem;
  color: var(--stone);
}

.main-nav {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.theme-switch {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--stone);
  font-size: 0.82rem;
}

.theme-select {
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  background: transparent;
  padding: 0.2rem 0;
  font-weight: 600;
  color: var(--leaf);
  font-size: 0.88rem;
  cursor: pointer;
}

.theme-select:focus {
  outline: none;
  border-color: rgba(210, 122, 79, 0.7);
}

body[data-theme="oscuro"] .theme-select {
  border-bottom-color: rgba(255, 255, 255, 0.25);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0;
  border-radius: 0;
  background: none;
  font-weight: 600;
  color: var(--stone);
  position: relative;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 2px;
  background: rgba(47, 74, 58, 0.55);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  color: var(--leaf);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-link.is-active {
  color: var(--leaf);
}

.nav-link.is-active::after {
  transform: scaleX(1);
  background: var(--terra);
}

.nav-link.danger {
  color: #8a2b2b;
}

.user-panel {
  position: relative;
  display: flex;
  align-items: center;
}

.user-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: var(--mist);
  box-shadow: 0 10px 25px var(--shadow);
  cursor: pointer;
}

.user-menu-toggle svg {
  width: 18px;
  height: 18px;
  color: var(--stone);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.user-name {
  font-weight: 700;
}

.user-role {
  font-size: 0.8rem;
  color: var(--stone);
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 180px;
  padding: 0.6rem;
  border-radius: var(--radius-md);
  background: white;
  box-shadow: 0 18px 35px var(--shadow);
  display: none;
  z-index: 1200;
}

.user-panel.is-open .user-menu {
  display: block;
}

.user-menu-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
  color: var(--ink);
}

.user-menu-link:hover {
  background: rgba(47, 74, 58, 0.08);
}

.user-menu-link.danger {
  background: rgba(184, 71, 59, 0.12);
  color: #8a2b2b;
}

.avatar-uploader {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: var(--mist);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(47, 74, 58, 0.15);
  cursor: pointer;
}

.avatar-uploader:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 2px;
}

.avatar-uploader img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  font-size: 0.75rem;
  color: var(--stone);
  text-align: center;
  padding: 0.4rem;
}

.avatar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.field-inline input[type="file"] {
  display: none;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.page-head p {
  max-width: 520px;
  color: var(--stone);
}

.hint {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(47, 74, 58, 0.12);
  font-size: 0.85rem;
}

.card-grid {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.farm-cards.is-list {
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.farm-cards.is-list .farm-card {
  padding: 1rem 1.2rem;
  box-shadow: none;
  border: 1px solid rgba(47, 74, 58, 0.16);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 2fr);
  gap: 0.6rem 1.4rem;
  align-items: start;
}

.farm-cards.is-list .card-top {
  grid-column: 1 / -1;
}

.farm-cards.is-list .farm-card > .muted {
  grid-column: 1 / 2;
  margin: 0;
}

.farm-cards.is-list .info-row {
  grid-column: 2 / -1;
}

.farm-cards.is-list .description {
  grid-column: 2 / -1;
  margin: 0;
}

.card {
  padding: 1.6rem;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: 0 15px 35px var(--shadow);
  animation: rise 0.5s ease both;
  animation-delay: calc(var(--i) * 0.04s);
}

.farm-card.is-clickable {
  cursor: pointer;
}

.farm-card.is-clickable:hover {
  box-shadow: 0 18px 38px var(--shadow-strong);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.badge {
  background: var(--sun);
  color: var(--leaf);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge--warn {
  background: #f3b562;
  color: #6a3b00;
}

.badge--danger {
  background: #e1614b;
  color: #fff;
}

.action-menu {
  position: relative;
}

.action-menu summary {
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(47, 74, 58, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.action-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  color: var(--leaf);
}

.action-menu[open] .action-toggle,
.action-toggle:hover {
  background: rgba(210, 122, 79, 0.18);
  transform: translateY(-1px);
}

.action-list {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 180px;
  padding: 0.5rem;
  border-radius: 12px;
  background: white;
  box-shadow: 0 18px 30px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  z-index: 25;
}

.action-menu:not([open]) .action-list {
  display: none;
}

.action-list a,
.action-list button {
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.7rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 0.85rem;
  cursor: pointer;
}

.action-list a:hover,
.action-list button:hover {
  background: rgba(47, 74, 58, 0.08);
}

.action-list button.danger {
  color: #8a2b2b;
}

.action-list form {
  margin: 0;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
}

.meta-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--stone);
}

.meta-block {
  margin-top: 1rem;
}

.info-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.6rem 0 0.8rem;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(47, 74, 58, 0.08);
  font-size: 0.78rem;
  color: var(--ink);
}

.climate-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.climate-row.compact {
  gap: 0.35rem;
}

.climate-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--mist);
  font-size: 0.78rem;
  color: var(--ink);
}

.climate-chip svg {
  width: 16px;
  height: 16px;
  color: var(--leaf);
}

.description {
  font-size: 0.95rem;
  color: var(--stone);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.tag-chip {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(47, 74, 58, 0.1);
  font-size: 0.75rem;
  color: var(--leaf);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 1.4rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.board-column {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 18px 30px var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.column-head {
  padding: 1.2rem 1.2rem 0.6rem;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  background: linear-gradient(120deg, rgba(47, 74, 58, 0.1), rgba(210, 122, 79, 0.12));
  border-top: 4px solid var(--accent, var(--leaf));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.column-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.column-body {
  padding: 0.8rem 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 200px;
}

.column-body.is-over {
  background: rgba(47, 74, 58, 0.08);
  border-radius: var(--radius-md);
}

.task-card {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--mist);
  box-shadow: 0 10px 20px var(--shadow);
  cursor: grab;
  animation: rise 0.4s ease both;
  animation-delay: calc(var(--i) * 0.03s);
  position: relative;
}

.task-card:active {
  cursor: grabbing;
}

.task-card.is-dragging {
  opacity: 0.5;
}

.task-card[draggable="false"] {
  cursor: default;
  opacity: 0.92;
}

.task-meta {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--stone);
}

.task-meta.compact {
  gap: 0.25rem;
}

.crop-card {
  display: grid;
  gap: 0.6rem;
}

.crop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.crop-meta {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--stone);
}

.crop-images {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.crop-images img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 16px var(--shadow);
}

.field-images {
  margin-top: 1rem;
  display: grid;
  gap: 0.6rem;
}

.week-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.week-grid.is-selecting {
  user-select: none;
}

.month-grid {
  display: grid;
  gap: 0.6rem;
  overflow-x: auto;
}

.month-grid.is-selecting {
  user-select: none;
}

.month-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.6rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--stone);
  min-width: 760px;
}

.month-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.6rem;
  min-width: 760px;
}

.month-cell {
  background: white;
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  min-height: 120px;
  box-shadow: 0 10px 20px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.month-cell.is-selected {
  box-shadow: 0 0 0 2px rgba(210, 122, 79, 0.45), 0 10px 20px var(--shadow);
  background: rgba(210, 122, 79, 0.08);
}

.month-cell.is-outside {
  opacity: 0.5;
}

.month-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.month-day {
  font-weight: 700;
}

.month-cell-body {
  display: grid;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.month-task {
  padding: 0.3rem 0.5rem;
  border-radius: 10px;
  background: var(--mist);
  cursor: pointer;
}

.day-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: 0 12px 25px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  animation: rise 0.45s ease both;
  animation-delay: calc(var(--i) * 0.04s);
}

.day-card.is-selected {
  box-shadow: 0 0 0 2px rgba(210, 122, 79, 0.45), 0 12px 25px var(--shadow);
  background: rgba(210, 122, 79, 0.08);
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.day-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(47, 74, 58, 0.1);
  color: var(--leaf);
  transition: transform 0.2s ease, background 0.2s ease;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  background: rgba(210, 122, 79, 0.18);
  transform: translateY(-1px);
}

.day-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.day-body.is-over,
.no-date-body.is-over {
  background: rgba(47, 74, 58, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
}

.mini-card {
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--mist);
  position: relative;
}

.mini-card.is-dragging {
  opacity: 0.6;
}

.task-item {
  cursor: pointer;
}

.mini-card h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.task-delete {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
}

.task-delete button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(184, 71, 59, 0.12);
  color: #8a2b2b;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.task-delete button:hover {
  background: rgba(184, 71, 59, 0.2);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 27, 22, 0.55);
}

.modal-card {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  width: min(520px, 92vw);
  box-shadow: 0 25px 50px var(--shadow-strong);
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(47, 74, 58, 0.1);
  color: var(--leaf);
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.modal-comments {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.8rem;
}

.comment-list {
  display: grid;
  gap: 0.6rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.comment-item {
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--mist);
  display: grid;
  gap: 0.4rem;
}

.comment-meta {
  font-size: 0.75rem;
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.comment-body {
  font-size: 0.9rem;
}

.comment-attachment {
  font-size: 0.82rem;
  color: var(--leaf);
  font-weight: 600;
}

.comment-attachment:hover {
  text-decoration: underline;
}

.comment-empty {
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(47, 74, 58, 0.08);
  color: var(--stone);
  font-size: 0.85rem;
}

.comment-form {
  display: grid;
  gap: 0.6rem;
}

.comment-file {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.comment-file input[type="file"] {
  display: none;
}

.comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.comment-error {
  color: #8a2b2b;
  font-size: 0.8rem;
}

.no-date {
  margin-top: 2rem;
  padding: 1.6rem;
  border-radius: var(--radius-md);
  background: white;
  box-shadow: 0 15px 30px var(--shadow);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

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

.split {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.wizard {
  display: grid;
  gap: 1.6rem;
}

.stepper {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(47, 74, 58, 0.08);
  font-size: 0.85rem;
}

.step.active {
  background: rgba(210, 122, 79, 0.2);
}

.step.done {
  background: rgba(47, 74, 58, 0.16);
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--mist);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.wizard-body {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.summary {
  display: grid;
  gap: 0.8rem;
  font-size: 0.9rem;
}

.panel {
  padding: 1.6rem;
  border-radius: var(--radius-md);
  background: white;
  box-shadow: 0 12px 25px var(--shadow);
}

section.panel + section.panel {
  margin-top: 1.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid rgba(47, 74, 58, 0.1);
}

.data-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--stone);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.task-table .task-row {
  cursor: pointer;
}

.pending-panel {
  margin-top: 2rem;
}

.history-panel {
  margin-top: 2rem;
}

.status-list {
  display: grid;
  gap: 0.8rem;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.form-card {
  padding: 1.6rem;
  border-radius: var(--radius-md);
  background: white;
  box-shadow: 0 15px 35px var(--shadow);
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.field-static {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(47, 74, 58, 0.2);
  background: #fff;
  font-size: 0.9rem;
}

.field-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.field-row input {
  flex: 1;
}

.field-help {
  font-size: 0.78rem;
  color: var(--stone);
}

.map-box {
  width: 100%;
  height: 280px;
  border-radius: 14px;
  border: 1px solid rgba(47, 74, 58, 0.2);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(47, 74, 58, 0.05);
}

.map-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.map-tools-note {
  font-size: 0.8rem;
  color: var(--stone);
}

.farm-map-panel {
  margin-bottom: 2rem;
}

.farms-map {
  width: 100%;
  height: 360px;
  border-radius: 16px;
  border: 1px solid rgba(47, 74, 58, 0.2);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(47, 74, 58, 0.05);
  position: relative;
}

.map-banner {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 700;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(251, 247, 239, 0.92);
  border: 1px solid rgba(47, 74, 58, 0.25);
  color: var(--leaf);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 20px var(--shadow);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.leaflet-tooltip.map-label {
  background: rgba(251, 247, 239, 0.95);
  border: 1px solid rgba(47, 74, 58, 0.35);
  color: var(--leaf);
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  box-shadow: 0 8px 18px var(--shadow);
}

.satellite-card {
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(47, 74, 58, 0.05);
  display: grid;
  gap: 0.8rem;
}

.satellite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.satellite-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.map-preview {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(47, 74, 58, 0.2);
  background: rgba(47, 74, 58, 0.1);
}

.map-preview-canvas {
  width: 100%;
  height: 220px;
}

.map-preview-link {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0.8rem;
  color: white;
  font-weight: 600;
  background: linear-gradient(160deg, rgba(30, 27, 22, 0.1), rgba(30, 27, 22, 0.6));
}

.map-preview-link:hover {
  background: linear-gradient(160deg, rgba(30, 27, 22, 0.2), rgba(30, 27, 22, 0.7));
}

.map-preview-empty {
  padding: 1.2rem;
  border-radius: 16px;
  background: rgba(47, 74, 58, 0.08);
  color: var(--stone);
  text-align: center;
}

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

input,
select,
textarea {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(47, 74, 58, 0.2);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  background: #fff;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
}

.form-errors {
  margin-top: 1rem;
  color: #8a2b2b;
  font-weight: 600;
}

.form-errors:empty {
  display: none;
}

.errorlist {
  margin: 0.4rem 0 0;
  padding: 0;
  color: #8a2b2b;
  font-size: 0.8rem;
  list-style: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--mist);
}

.btn.small {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.btn.primary {
  background: var(--leaf);
  color: white;
  box-shadow: 0 12px 25px var(--shadow-strong);
}

.btn.danger {
  background: #b8473b;
  color: #fff;
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(47, 74, 58, 0.3);
}

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

.link {
  font-weight: 600;
  color: var(--leaf);
}

.empty,
.empty-slot {
  padding: 1.4rem;
  border-radius: var(--radius-md);
  background: rgba(47, 74, 58, 0.08);
  color: var(--stone);
}

.empty {
  text-align: center;
}

.auth-card {
  max-width: 420px;
  width: 100%;
  padding: 2.2rem;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: 0 20px 40px var(--shadow);
}

.auth-header {
  margin-bottom: 1.5rem;
}

.auth-footer {
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--stone);
}

.week-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.page-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7rem;
}

.filter-form {
  display: grid;
  gap: 0.4rem;
  justify-items: end;
}

.filter-form select {
  min-width: 220px;
}

.action-menu select {
  width: 100%;
  margin-bottom: 0.4rem;
}

.select-list {
  display: grid;
  gap: 0.6rem;
}

.select-row {
  margin: 0;
}

.select-button {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(47, 74, 58, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  background: rgba(47, 74, 58, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  cursor: pointer;
}

.select-button:hover {
  background: rgba(47, 74, 58, 0.12);
}

.select-title {
  font-weight: 700;
}

.assigned-list {
  display: grid;
  gap: 0.8rem;
}

.assigned-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(47, 74, 58, 0.12);
  background: rgba(255, 255, 255, 0.9);
}

.tab-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1rem 0 1.6rem;
}

.tab-link {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(47, 74, 58, 0.08);
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease;
}

.tab-link:hover {
  background: rgba(210, 122, 79, 0.18);
  transform: translateY(-1px);
}

.tab-link.is-active {
  background: var(--leaf);
  color: white;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.view-option {
  border: none;
  background: none;
  padding: 0.2rem 0;
  font-weight: 600;
  color: var(--stone);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.view-option.is-active {
  color: var(--leaf);
  border-color: rgba(47, 74, 58, 0.5);
}

.view-option:hover {
  color: var(--terra);
  border-color: rgba(210, 122, 79, 0.7);
}

.pill {
  background: var(--mist);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.muted {
  color: var(--stone);
}

.harvest-columns {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.harvest-column {
  display: grid;
  gap: 1.4rem;
  align-content: start;
}

.report-list {
  display: grid;
  gap: 0.8rem;
}

.report-item {
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--mist);
  display: grid;
  gap: 0.45rem;
}

.report-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.report-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.report-farm {
  font-weight: 700;
}

.report-date {
  font-size: 0.82rem;
  color: var(--stone);
}

.report-qty {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: white;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--stone);
}

.quantity-wheel {
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.wheel-dial {
  --turn: 0;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 55%, rgba(47, 74, 58, 0.15) 56% 100%),
    conic-gradient(
      from -135deg,
      rgba(210, 122, 79, 0.6),
      rgba(47, 74, 58, 0.7),
      rgba(210, 122, 79, 0.4)
    );
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.8), 0 16px 30px var(--shadow);
}

.wheel-center {
  display: grid;
  gap: 0.25rem;
  text-align: center;
}

.wheel-value {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--leaf);
}

.wheel-unit {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
}

.wheel-needle {
  position: absolute;
  width: 3px;
  height: 48%;
  background: var(--terra);
  top: 50%;
  left: 50%;
  transform-origin: bottom center;
  transform: translate(-50%, -100%) rotate(calc(-135deg + var(--turn) * 270deg));
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(210, 122, 79, 0.6);
}

.wheel-needle::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--terra);
  transform: translateX(-50%);
  box-shadow: 0 4px 8px rgba(210, 122, 79, 0.4);
}

.wheel-slider {
  width: min(320px, 100%);
}

.quantity-range {
  width: 100%;
  accent-color: var(--leaf);
}

.harvest-toggle {
  margin: 0;
}

.harvest-note {
  background: rgba(47, 74, 58, 0.08);
  margin-bottom: 1.5rem;
}

.counter-input {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.counter-input input[type="number"] {
  max-width: 140px;
}

.counter-quick {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.counter-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.6rem;
}

.counter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--mist);
  font-weight: 600;
}

.harvest-chart {
  margin-top: 2rem;
}

.chart-wrapper {
  position: relative;
  padding: 1rem 0.5rem 1.6rem;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: var(--stone);
  margin-top: 0.6rem;
}

.chart-axis span {
  white-space: nowrap;
}

.chart-empty {
  display: none;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--stone);
}

.harvest-metrics {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 2rem;
}

.metric-card {
  background: white;
  padding: 1.3rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 25px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.metric-card.accent {
  background: linear-gradient(120deg, rgba(47, 74, 58, 0.12), rgba(210, 122, 79, 0.12));
}

.metric-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--leaf);
}

.metric-meta {
  font-size: 0.85rem;
  color: var(--stone);
}

.harvest-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.harvest-panel {
  background: white;
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 35px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.day-strip {
  display: grid;
  gap: 0.8rem;
}

.day-chip {
  padding: 0.8rem;
  background: var(--mist);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.6rem;
}

.day-chip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.day-chip-label {
  font-weight: 700;
}

.day-chip-bar {
  height: 6px;
  background: rgba(47, 74, 58, 0.18);
  border-radius: 999px;
  overflow: hidden;
}

.day-chip-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--leaf), var(--terra));
}

.day-chip-tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.task-chip {
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: white;
  font-size: 0.78rem;
  box-shadow: 0 6px 12px var(--shadow);
  cursor: pointer;
}

.farm-list {
  display: grid;
  gap: 0.7rem;
}

.farm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
  background: var(--mist);
  border-radius: var(--radius-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.farm-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px var(--shadow);
}

.farm-row h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.farm-count {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(47, 74, 58, 0.12);
  color: var(--leaf);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.status-breakdown {
  display: grid;
  gap: 0.6rem;
}

.status-line {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr auto;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.9rem;
}

.status-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(47, 74, 58, 0.12);
  overflow: hidden;
}

.status-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--bar-color, var(--leaf));
}

.other-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.other-card {
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--mist);
  display: grid;
  gap: 0.6rem;
}

.other-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.other-list {
  display: grid;
  gap: 0.5rem;
}

.other-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.85rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.other-item:hover {
  background: white;
}

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

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-panel {
    width: 100%;
    justify-content: space-between;
  }

  .user-menu-toggle {
    width: 100%;
    justify-content: space-between;
  }

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

  .page-actions {
    align-items: flex-start;
  }

  .theme-switch {
    width: 100%;
    justify-content: flex-start;
  }

  .farm-cards.is-list .farm-card {
    grid-template-columns: 1fr;
  }

  .farm-cards.is-list .info-row,
  .farm-cards.is-list .description,
  .farm-cards.is-list .farm-card > .muted {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
